tekivex-ui 2.6.0 → 3.0.1

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.
Files changed (48) hide show
  1. package/README.md +22 -8
  2. package/dist/charts.cjs +1 -1
  3. package/dist/charts.js +14 -14
  4. package/dist/{chunk-B3ph66Zb.js → chunk-BHX35YDv.js} +1 -1
  5. package/dist/chunk-BpuJ3-K8.js +1 -0
  6. package/dist/{chunk-Bc16rJT-.js → chunk-C8Wy8P59.js} +1 -1
  7. package/dist/chunk-CDGrC2Wo.js +3 -0
  8. package/dist/{chunk-LWkKqC8d.js → chunk-D7-yknXg.js} +1 -1
  9. package/dist/{chunk-DnCXUUx5.js → chunk-DcVMayoM.js} +1 -1
  10. package/dist/chunk-DdHSYetV.js +1 -0
  11. package/dist/chunk-VUD-TF9j.js +1 -0
  12. package/dist/headless.cjs +1 -1
  13. package/dist/headless.js +1 -1
  14. package/dist/i18n.cjs +1 -1
  15. package/dist/i18n.js +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.ts +18 -2
  18. package/dist/index.js +499 -414
  19. package/dist/quantum.cjs +1 -1
  20. package/dist/quantum.js +1 -1
  21. package/dist/realtime.cjs +1 -1
  22. package/dist/realtime.js +1 -1
  23. package/dist/src/components/TkxAadhaarInput.d.ts +22 -0
  24. package/dist/src/components/TkxAddressInput.d.ts +32 -0
  25. package/dist/src/components/TkxCalendarLunar.d.ts +25 -0
  26. package/dist/src/components/TkxCaptcha.d.ts +23 -0
  27. package/dist/src/components/TkxCheckout.d.ts +26 -0
  28. package/dist/src/components/TkxConfetti.d.ts +21 -0
  29. package/dist/src/components/TkxCurrencyInput.d.ts +20 -0
  30. package/dist/src/components/TkxFontProvider.d.ts +12 -0
  31. package/dist/src/components/TkxImageEditor.d.ts +44 -0
  32. package/dist/src/components/TkxKycInputs.d.ts +59 -0
  33. package/dist/src/components/TkxOTP.d.ts +2 -1
  34. package/dist/src/components/TkxPaymentButton.d.ts +61 -0
  35. package/dist/src/components/TkxPhoneInput.d.ts +34 -0
  36. package/dist/src/components/TkxSEO.d.ts +58 -0
  37. package/dist/src/components/TkxSignaturePad.d.ts +21 -0
  38. package/dist/src/components/TkxSortable.d.ts +18 -0
  39. package/dist/src/components/TkxSubscription.d.ts +42 -0
  40. package/dist/src/components/TkxWatermark.d.ts +8 -1
  41. package/dist/src/i18n/index.d.ts +51 -0
  42. package/dist/src/themes/index.d.ts +6 -1
  43. package/dist/tekivex-ui.css +1 -1
  44. package/package.json +20 -4
  45. package/dist/chunk-Dike2DLU.js +0 -3
  46. package/dist/chunk-DjxOP8W4.js +0 -1
  47. package/dist/chunk-DkoFTL1O.js +0 -1
  48. package/dist/chunk-PJ50l0JC.js +0 -1
@@ -1 +1 @@
1
- import{I as e}from"./chunk-PJ50l0JC.js";var t={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;","`":"&#96;"};function r(e){let r=String(e);return r=r.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,""),r.replace(/[<>&'"`]/g,e=>t[e]??e)}function n(e){const t={};for(const r of Object.keys(e))t[r]=o(e[r]);return t}function o(e){return"string"==typeof e?r(e):Array.isArray(e)?e.map(o):null===e||"object"!=typeof e||function(e){return"object"==typeof e&&null!==e&&"$$typeof"in e}(e)?e:n(e)}function i(e,t){const r=[];for(const[n,o]of Object.entries(t)){const t=e[n],i=null==t;o.required&&i?r.push(`prop '${n}' is required`):i||(typeof t===o.type?("number"===o.type&&"number"==typeof t&&(void 0!==o.min&&t<o.min&&r.push(`prop '${n}' must be >= ${o.min}`),void 0!==o.max&&t>o.max&&r.push(`prop '${n}' must be <= ${o.max}`)),"string"===o.type&&"string"==typeof t&&o.pattern&&!o.pattern.test(t)&&r.push(`prop '${n}' does not match pattern ${o.pattern}`),o.enum&&!o.enum.includes(t)&&r.push(`prop '${n}' must be one of: ${o.enum.join(", ")}`)):r.push(`prop '${n}' must be of type ${o.type}, got ${typeof t}`))}return{valid:0===r.length,errors:r}}var s=/* @__PURE__ */new Map,a=[];function l(t,r,n){const o=e(JSON.stringify(n??{})),i=e((a.length>0?a[a.length-1].chainHash:"00000000")+o+r+t),s=Object.freeze({timestamp:Date.now(),component:r,action:t,propsHash:o,chainHash:i});return a=Object.freeze([...a,s]),s}function f(e){let t=a;return e?.component&&(t=t.filter(t=>t.component===e.component)),e?.action&&(t=t.filter(t=>t.action===e.action)),e?.limit&&(t=t.slice(-e.limit)),t}function c(){let t="00000000";for(const r of a){if(e(t+r.propsHash+r.component+r.action)!==r.chainHash)return!1;t=r.chainHash}return!0}function u(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;const r=t.replace(/[\u0000-\u001F\u007F]/g,"");return/^javascript:/i.test(r)||/^vbscript:/i.test(r)||/^data:/i.test(r)&&!/^data:image\//i.test(r)||/^file:/i.test(r)?null:r}var d=new Set(["a","abbr","b","blockquote","br","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),p={a:new Set(["href","title","target","rel"]),img:new Set(["src","alt","title","width","height","loading","decoding"]),th:new Set(["scope","colspan","rowspan","align"]),td:new Set(["colspan","rowspan","align"]),"*":new Set(["id","class","lang","dir","title"])},m=new Set(["constructor","prototype","__proto__","submit","reset","action","method","enctype","target","elements","children","firstChild","nextSibling","parentNode","ownerDocument","cookie","domain","location","documentElement","body","head","title","contentWindow","contentDocument"]);function b(e){if("string"!=typeof e)return"";if("undefined"==typeof DOMParser)return r(e);const t=(new DOMParser).parseFromString(`<div>${e}</div>`,"text/html").body.firstElementChild;return t?(g(t),t.innerHTML):""}function g(e){const t=Array.from(e.children);for(const r of t){const e=r.tagName.toLowerCase();if(d.has(e)){for(const t of Array.from(r.attributes)){const n=t.name.toLowerCase();if(n.startsWith("on"))r.removeAttribute(t.name);else if(m.has(n))r.removeAttribute(t.name);else if("style"!==n)if((p[e]??/* @__PURE__ */new Set).has(n)||p["*"].has(n)){if(("href"===n||"src"===n)&&"string"==typeof t.value){const e=u(t.value);null===e?r.removeAttribute(t.name):r.setAttribute(t.name,e)}"name"!==n&&"id"!==n||!m.has(t.value.toLowerCase())||r.removeAttribute(t.name)}else r.removeAttribute(t.name);else r.setAttribute("style",x(t.value))}g(r)}else r.remove()}}function x(e){if("string"!=typeof e)return"";let t=e;return t=t.replace(/expression\s*\([^)]*\)/gi,""),t=t.replace(/url\s*\(\s*['"]?\s*(javascript|vbscript|data)\s*:[^)]*\)/gi,"url(#)"),t=t.replace(/@import[^;]*;?/gi,""),t=t.replace(/behavior\s*:[^;]*;?/gi,""),t=t.replace(/-moz-binding[^;]*;?/gi,""),t=t.replace(/[<>]/g,""),t=t.replace(/[\u0000-\u001F\u007F]/g,""),t.trim()}var h=new Set(["__proto__","constructor","prototype"]);function w(e){try{return $(JSON.parse(e,(e,t)=>{if(!h.has(e))return t}))}catch{return null}}function $(e){if(Array.isArray(e))return e.map($);if(e&&"object"==typeof e){const t={};for(const[r,n]of Object.entries(e))h.has(r)||(t[r]=$(n));return t}return e}function y(e){return!("string"!=typeof e||!e||/[\u0000-\u001F\u007F<>"]/.test(e)||m.has(e.toLowerCase()))}function v(e){return"string"!=typeof e?"":e.replace(/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF\u00AD]/g,"")}function k(e={}){const{allowInlineStyles:t=!0,imgHosts:r=[],connectHosts:n=[],fontHosts:o=[],scriptNonce:i,reportUri:s}=e,a=["default-src 'self'","script-src "+(i?`'self' 'nonce-${i}'`:"'self'"),"style-src "+(t?"'self' 'unsafe-inline'":"'self'"),`img-src ${["'self'","data:","https:",...r].join(" ")}`,`font-src ${["'self'","https:","data:",...o].join(" ")}`,`connect-src ${["'self'",...n].join(" ")}`,"frame-ancestors 'none'","form-action 'self'","base-uri 'self'","object-src 'none'","upgrade-insecure-requests"];return s&&a.push(`report-uri ${s}`),a.join("; ")}function j(){if("undefined"==typeof window)return;const e=window.trustedTypes;if(e)try{e.createPolicy("tkx",{createHTML:b,createScriptURL:e=>u(e)??"",createScript:()=>{throw new Error("TekiVex: inline script creation forbidden")}})}catch{}}function z(){if("undefined"==typeof window)return!1;try{return window.top!==window.self}catch{return!0}}function S(e){if("undefined"!=typeof window&&z())if(e)e();else try{window.top.location.href=window.self.location.href}catch{}}function A(e,t){let r=e,n=Date.now();return{check(){const o=Date.now(),i=o-n,s=Math.floor(i/t);return s>0&&(r=Math.min(e,r+s),n=o),!(r<=0||(r-=1,0))},reset(){r=e,n=Date.now()}}}async function O(e){const t=new Uint8Array(await e.slice(0,12).arrayBuffer()),r=(...e)=>e.every((e,r)=>t[r]===e);return r(137,80,78,71)?"image/png":r(255,216,255)?"image/jpeg":r(71,73,70,56)?"image/gif":r(66,77)?"image/bmp":r(82,73,70,70)&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"image/webp":r(37,80,68,70)?"application/pdf":r(80,75,3,4)?"application/zip":123===t[0]||91===t[0]?"application/json":[...t].includes(0)?null:"text/plain"}var F=[{name:"ssn",re:/\b\d{3}-\d{2}-\d{4}\b/g,repl:"[redacted-ssn]"},{name:"credit",re:/\b(?:\d[ -]*?){13,19}\b/g,repl:"[redacted-card]"},{name:"email",re:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,repl:"[redacted-email]"},{name:"phone",re:/\b(\+?\d{1,3}[ -])?\(?\d{3}\)?[ -]?\d{3}[ -]?\d{4}\b/g,repl:"[redacted-phone]"},{name:"apikey",re:/\b(sk|pk|rk)-[A-Za-z0-9]{20,}\b/g,repl:"[redacted-key]"}];function _(e){if("string"!=typeof e)return"";let t=e;for(const{re:r,repl:n}of F)t=t.replace(r,n);return t}function M(e){if(e&&"object"==typeof e&&!Object.isFrozen(e)){for(const t of Object.keys(e))M(e[t]);Object.freeze(e)}return e}var C=Object.freeze({sanitizeString:r,sanitizeHref:u,sanitizeHTML:b,sanitizeCSS:x,sanitizeJSON:w,sanitizeUnicode:v,isSafeAttrName:y,buildTkxCSP:k,installTrustedTypes:j,isFramed:z,installFrameBuster:S,createRateLimiter:A,sniffMimeType:O,scrubPII:_,deepFreeze:M,__brand:"TekiVex SecurityCore v2.6.0 © 007krcs"}),D={sanitize:r,sanitizeProps:n,validateProps:i,createCSP:function(e,t){const r={componentId:e,permissions:t,directives:{"default-src":["'self'"],"style-src":t.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":t.allowDataUrls?["'self'","data:"]:t.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":t.allowScripts?["'self'"]:["'none'"]}};return s.set(e,r),r},hasPermission:function(e,t){return!0===s.get(e)?.permissions[t]},audit:l,getAuditLog:f,verifyAuditIntegrity:c},T={0:"0",px:"1px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},q={...T,screen:"100vh"},H={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},I={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},P={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},Z={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},E={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},N={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},B={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},L={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},U=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),X=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Y={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},J=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,R=new Set(["behavior","-moz-binding","-webkit-binding","src"]),V=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function G(e){return J.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function W(e){const t=e.match(/^\[(.+)]$/);return t?G(t[1]):null}function K(e){return X.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":W(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function Q(e){const t=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(t){const e=function(e){const t=e.toLowerCase().trim();return R.has(t)?null:V.has(t)?t:null}(t[1]),r=G(t[2]);return e&&r?{[e]:r}:null}const r={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(r[e])return{display:r[e]};const n={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(n[e])return{"flex-direction":n[e]};const o={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(o[e])return{"flex-wrap":o[e]};const i={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(i[e])return{flex:i[e]};if("grow"===e||"flex-grow"===e)return{"flex-grow":"1"};if("grow-0"===e)return{"flex-grow":"0"};if("shrink"===e||"flex-shrink"===e)return{"flex-shrink":"1"};if("shrink-0"===e||"flex-shrink-0"===e)return{"flex-shrink":"0"};const s={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(s[e])return{"align-items":s[e]};const a={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(a[e])return{"justify-content":a[e]};const l={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(l[e])return{"align-self":l[e]};const f={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(f[e])return{"align-content":f[e]};let c;if(c=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===c[1]?"none":"subgrid"===c[1]?"subgrid":`repeat(${c[1]},minmax(0,1fr))`};if(c=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===c[1]?"none":"subgrid"===c[1]?"subgrid":`repeat(${c[1]},minmax(0,1fr))`};if(c=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===c[1]?"1 / -1":`span ${c[1]} / span ${c[1]}`};if(c=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":c[1]};if(c=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":c[1]};if(c=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===c[1]?"1 / -1":`span ${c[1]} / span ${c[1]}`};if(c=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":c[1]};if(c=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":c[1]};if("grid-flow-row"===e)return{"grid-auto-flow":"row"};if("grid-flow-col"===e)return{"grid-auto-flow":"column"};if("grid-flow-dense"===e)return{"grid-auto-flow":"dense"};if("grid-flow-row-dense"===e)return{"grid-auto-flow":"row dense"};if("grid-flow-col-dense"===e)return{"grid-auto-flow":"column dense"};if(c=e.match(/^p-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{padding:e}}if(c=e.match(/^px-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-left":e,"padding-right":e}}if(c=e.match(/^py-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(c=e.match(/^pt-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-top":e}}if(c=e.match(/^pr-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-right":e}}if(c=e.match(/^pb-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-bottom":e}}if(c=e.match(/^pl-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-left":e}}if(c=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{margin:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-left":e,"margin-right":e}}}if(c=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-top":e,"margin-bottom":e}}}if(c=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-top":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-right":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-bottom":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-left":t&&"0"!==r?`-${r}`:r}}if("mx-auto"===e)return{"margin-left":"auto","margin-right":"auto"};if("my-auto"===e)return{"margin-top":"auto","margin-bottom":"auto"};if(c=e.match(/^gap-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{gap:e}}if(c=e.match(/^gap-x-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"column-gap":e}}if(c=e.match(/^gap-y-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"row-gap":e}}if(c=e.match(/^w-(.+)$/)){const e=c[1],t=T[e]??H[e]??W(e);if(t)return{width:t}}if(c=e.match(/^min-w-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"min-width":e}}if(c=e.match(/^max-w-(.+)$/)){const e={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[c[1]]??T[c[1]]??W(c[1]);if(e)return{"max-width":e}}if(c=e.match(/^h-(.+)$/)){const e=c[1],t=q[e]??H[e]??W(e);if(t)return{height:t}}if(c=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[c[1]]??T[c[1]]??W(c[1]);if(e)return{"min-height":e}}if(c=e.match(/^max-h-(.+)$/)){const e=q[c[1]]??W(c[1]);if(e)return{"max-height":e}}if(c=e.match(/^size-(.+)$/)){const e=T[c[1]]??H[c[1]]??W(c[1]);if(e)return{width:e,height:e}}if(c=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=Z[c[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(c=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":E[c[1]]??c[1]};if(c=e.match(/^leading-(.+)$/)){const e=N[c[1]]??W(c[1]);if(e)return{"line-height":e}}if(c=e.match(/^tracking-(.+)$/)){const e=B[c[1]]??W(c[1]);if(e)return{"letter-spacing":e}}const u={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(u[e])return{"text-align":u[e]};if("italic"===e)return{"font-style":"italic"};if("not-italic"===e)return{"font-style":"normal"};if("uppercase"===e)return{"text-transform":"uppercase"};if("lowercase"===e)return{"text-transform":"lowercase"};if("capitalize"===e)return{"text-transform":"capitalize"};if("normal-case"===e)return{"text-transform":"none"};if("underline"===e)return{"text-decoration-line":"underline"};if("overline"===e)return{"text-decoration-line":"overline"};if("line-through"===e)return{"text-decoration-line":"line-through"};if("no-underline"===e)return{"text-decoration-line":"none"};if("truncate"===e)return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if("text-ellipsis"===e)return{"text-overflow":"ellipsis"};if("text-clip"===e)return{"text-overflow":"clip"};if("whitespace-normal"===e)return{"white-space":"normal"};if("whitespace-nowrap"===e)return{"white-space":"nowrap"};if("whitespace-pre"===e)return{"white-space":"pre"};if("whitespace-pre-wrap"===e)return{"white-space":"pre-wrap"};if("whitespace-pre-line"===e)return{"white-space":"pre-line"};if("break-words"===e)return{"overflow-wrap":"break-word"};if("break-all"===e)return{"word-break":"break-all"};if("break-keep"===e)return{"word-break":"keep-all"};if("font-mono"===e)return{"font-family":"var(--tkx-font-mono,monospace)"};if("font-sans"===e)return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if("font-serif"===e)return{"font-family":"ui-serif,Georgia,serif"};if("antialiased"===e)return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(c=e.match(/^indent-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"text-indent":e}}if(c=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":c[1],"-webkit-box-orient":"vertical"};if(c=e.match(/^text-(.+)$/)){const[e,t]=c[1].split("/"),r=K(e);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(e)){if(t){const e=parseInt(t)/100;return{color:r,opacity:String(e)}}return{color:r}}}if(c=e.match(/^bg-(.+)$/)){const[e,t]=c[1].split("/"),r=K(e);return t?{"background-color":r,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":r}}if(c=e.match(/^border-color-(.+)$/))return{"border-color":K(c[1])};if(c=e.match(/^fill-(.+)$/))return{fill:K(c[1])};if(c=e.match(/^stroke-(.+)$/))return{stroke:K(c[1])};if(c=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":K(c[1])};if(c=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":K(c[1])};if(c=e.match(/^accent-(.+)$/))return{"accent-color":K(c[1])};if(c=e.match(/^caret-(.+)$/))return{"caret-color":K(c[1])};if(c=e.match(/^outline-color-(.+)$/))return{"outline-color":K(c[1])};if("border"===e)return{"border-width":"1px"};if(c=e.match(/^border-(\d+)$/))return{"border-width":`${c[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(c=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${c[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(c=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${c[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(c=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${c[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(c=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${c[1]}px`};if("border-x"===e)return{"border-left-width":"1px","border-right-width":"1px"};if("border-y"===e)return{"border-top-width":"1px","border-bottom-width":"1px"};if("border-none"===e)return{"border-style":"none"};if("border-solid"===e)return{"border-style":"solid"};if("border-dashed"===e)return{"border-style":"dashed"};if("border-dotted"===e)return{"border-style":"dotted"};if("border-double"===e)return{"border-style":"double"};if((c=e.match(/^border-([a-zA-Z].*)$/))&&X.has(c[1]))return{"border-color":`var(--tkx-${c[1]})`};if(c=e.match(/^border-\[(.+)]$/))return{"border-color":c[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":I[""]};if(c=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":I[c[1]]??W(c[1])??c[1]};if(c=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=c[1],t=I[c[2]??""]??I[""];return{t:{"border-top-left-radius":t,"border-top-right-radius":t},r:{"border-top-right-radius":t,"border-bottom-right-radius":t},b:{"border-bottom-left-radius":t,"border-bottom-right-radius":t},l:{"border-top-left-radius":t,"border-bottom-left-radius":t},tl:{"border-top-left-radius":t},tr:{"border-top-right-radius":t},br:{"border-bottom-right-radius":t},bl:{"border-bottom-left-radius":t}}[e]??{}}const d={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if("ring"===e)return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((c=e.match(/^ring-(\d+)$/))&&d[c[1]])return{"box-shadow":`0 0 0 ${d[c[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(c=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${c[1]}px`,"box-shadow":`0 0 0 ${c[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":P[""]};if(c=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":P[c[1]]};if(c=e.match(/^opacity-(\d+)$/)){const e=U[c[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const p={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(p[e])return{"background-size":p[e]};const m={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(m[e])return{"background-position":m[e]};const b={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(b[e])return{"background-repeat":b[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${L[""]})`};if(c=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${L[c[1]]})`};if("blur"===e)return{filter:`blur(${L[""]})`};if(c=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${L[c[1]]})`};if("grayscale"===e)return{filter:"grayscale(100%)"};if("grayscale-0"===e)return{filter:"grayscale(0)"};if("invert"===e)return{filter:"invert(100%)"};if("invert-0"===e)return{filter:"invert(0)"};const g={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(g[e])return{position:g[e]};if("inset-0"===e)return{top:"0",right:"0",bottom:"0",left:"0"};if("inset-auto"===e)return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if("inset-full"===e)return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if("inset-x-0"===e)return{left:"0",right:"0"};if("inset-y-0"===e)return{top:"0",bottom:"0"};if(c=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{top:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{right:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{bottom:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{left:t&&"0"!==r?`-${r}`:r}}const x={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(c=e.match(/^z-(.+)$/)){const e=x[c[1]]??W(c[1]);if(e)return{"z-index":e}}const h={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(h[e])return{overflow:h[e]};if(c=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${c[1]}`]:c[2]};if("scrollbar-hide"===e)return{"-ms-overflow-style":"none","scrollbar-width":"none"};if("visible"===e)return{visibility:"visible"};if("invisible"===e)return{visibility:"hidden"};if("collapse"===e)return{visibility:"collapse"};const w={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(w[e])return{cursor:w[e]};if("select-none"===e)return{"user-select":"none"};if("select-text"===e)return{"user-select":"text"};if("select-all"===e)return{"user-select":"all"};if("select-auto"===e)return{"user-select":"auto"};if("pointer-events-none"===e)return{"pointer-events":"none"};if("pointer-events-auto"===e)return{"pointer-events":"auto"};const $={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(c=e.match(/^scale-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scale(${e})`}}if(c=e.match(/^scale-x-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scaleX(${e})`}}if(c=e.match(/^scale-y-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scaleY(${e})`}}const y={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(c=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),r=y[c[1]]??W(c[1]);if(r)return{transform:t?`rotate(-${r})`:`rotate(${r})`}}if(c=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{transform:`translateX(${t&&"0"!==r?`-${r}`:r})`}}if(c=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{transform:`translateY(${t&&"0"!==r?`-${r}`:r})`}}if(c=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),r=W(c[1])??`${c[1]}deg`;return{transform:t?`skewX(-${r})`:`skewX(${r})`}}if(c=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),r=W(c[1])??`${c[1]}deg`;return{transform:t?`skewY(-${r})`:`skewY(${r})`}}const v={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(v[e])return{"transform-origin":v[e]};const k={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(k[e])return{"transition-property":k[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const j={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(c=e.match(/^duration-(.+)$/)){const e=j[c[1]]??W(c[1]);if(e)return{"transition-duration":e}}if(c=e.match(/^delay-(.+)$/)){const e=j[c[1]]??W(c[1]);if(e)return{"transition-delay":e}}const z={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(z[e])return{"transition-timing-function":z[e]};const S={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(S[e])return{animation:S[e]};const A={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return A[e]?{"object-fit":A[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(c=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":c[1]}:"list-none"===e?{"list-style-type":"none"}:"list-disc"===e?{"list-style-type":"disc"}:"list-decimal"===e?{"list-style-type":"decimal"}:"list-inside"===e?{"list-style-position":"inside"}:"list-outside"===e?{"list-style-position":"outside"}:(c=e.match(/^columns-(\d+)$/))?{columns:c[1]}:"resize"===e?{resize:"both"}:"resize-none"===e?{resize:"none"}:"resize-x"===e?{resize:"horizontal"}:"resize-y"===e?{resize:"vertical"}:"sr-only"===e?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:"not-sr-only"===e?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:"focus-ring"===e?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:"appearance-none"===e?{appearance:"none"}:"outline-none"===e?{outline:"none"}:"outline"===e?{outline:"2px solid currentColor","outline-offset":"2px"}:"float-left"===e?{float:"left"}:"float-right"===e?{float:"right"}:"float-none"===e?{float:"none"}:"clear-both"===e?{clear:"both"}:"isolate"===e?{isolation:"isolate"}:"isolation-auto"===e?{isolation:"auto"}:(c=e.match(/^will-change-(.+)$/))?{"will-change":c[1]}:"touch-manipulation"===e?{"touch-action":"manipulation"}:"touch-none"===e?{"touch-action":"none"}:"touch-pan-x"===e?{"touch-action":"pan-x"}:"touch-pan-y"===e?{"touch-action":"pan-y"}:"scroll-smooth"===e?{"scroll-behavior":"smooth"}:"scroll-auto"===e?{"scroll-behavior":"auto"}:(c=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[c[1]]:c[2]}:xe(e)||null}function ee(e){let t=0,r=-1;for(let n=0;n<e.length;n++)if("["===e[n])t++;else if("]"===e[n])t--;else if(":"===e[n]&&0===t){r=n;break}return-1===r?{variant:null,utility:e}:{variant:e.slice(0,r),utility:e.slice(r+1)}}function te(e,t){for(const[r,n]of Object.entries(t))e[r]=n}function re(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var ne=/* @__PURE__ */new Map,oe=null,ie=null;function se(){return oe&&oe.isConnected||(oe=document.getElementById("tkx-atomic"))||((oe=document.createElement("style")).id="tkx-atomic",document.head.appendChild(oe)),oe}function ae(e){const t=[];for(const r of e)if(r)if("string"==typeof r)t.push(...r.split(/\s+/).filter(Boolean));else if(Array.isArray(r))t.push(...ae(r));else if("object"==typeof r)for(const[e,n]of Object.entries(r))n&&t.push(e);return t}function le(...t){const r=ae(t);if(0===r.length)return"";const n={base:{},variants:{}};for(const e of r){const{variant:t,utility:r}=ee(e),o=Q(r);o&&(t?(n.variants[t]||(n.variants[t]={}),te(n.variants[t],o)):te(n.base,o))}const o=[],i=re(n.base),s=e([i,...Object.entries(n.variants).map(([e,t])=>`${e}{${re(t)}}`)].join("|")),a=`tkx-${s}`;i&&o.push(`.${a}{${i}}`);for(const[e,l]of Object.entries(n.variants)){const t=re(l);if(t)if(e.startsWith("@")){const r=Y[e.slice(1)];r&&o.push(`@media(min-width:${r}){.${a}{${t}}}`)}else if("motion-safe"===e)o.push(`@media(prefers-reduced-motion:no-preference){.${a}{${t}}}`);else if("motion-reduce"===e)o.push(`@media(prefers-reduced-motion:reduce){.${a}{${t}}}`);else if("contrast-more"===e)o.push(`@media(prefers-contrast:more){.${a}{${t}}}`);else if("forced-colors"===e)o.push(`@media(forced-colors:active){.${a}{${t}}}`);else if("dark"===e)o.push(`@media(prefers-color-scheme:dark){.${a}{${t}}}`);else if("print"===e)o.push(`@media print{.${a}{${t}}}`);else if("group-hover"===e)o.push(`.group:hover .${a}{${t}}`);else if("group-focus"===e)o.push(`.group:focus-within .${a}{${t}}`);else if("peer-hover"===e)o.push(`.peer:hover~.${a}{${t}}`);else{const r={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[e]??`:${e}`;o.push(`.${a}${r}{${t}}`)}}return o.length>0&&function(e,t){if(ne.has(e))return;if(ne.set(e,t),"undefined"==typeof document)return;const r=function(){if(ie)return ie;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],ie=e,e}catch{return null}}();if(r){const e=function(e){const t=[];let r=0,n=0;for(let o=0;o<e.length;o++)if("{"===e[o])r++;else if("}"===e[o]&&(r--,0===r)){const r=e.slice(n,o+1).trim();r&&t.push(r),n=o+1}return t}(t);for(const t of e)try{r.insertRule(t,r.cssRules.length)}catch{se().textContent+=t+"\n"}}else se().textContent+=t+"\n"}(s,o.join("")),a}var fe=le;function ce(){return Array.from(ne.values()).join("\n")}function ue(){ne.clear(),oe=null,ie&&"undefined"!=typeof document&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==ie),ie=null)}function de(...e){return e.filter(Boolean).join(" ")}var pe=/* @__PURE__ */new Map;function me(e){pe.set(e.name,e.utilities)}function be(e){pe.delete(e)}function ge(){return Array.from(pe.keys())}function xe(e){for(const t of pe.values())if(t[e])return t[e];return null}export{i as A,u as C,v as D,r as E,_ as O,b as S,n as T,S as _,le as a,y as b,be as c,D as d,l as f,f as g,M as h,xe as i,c as j,O as k,fe as l,A as m,ce as n,ge as o,k as p,ue as r,me as s,de as t,C as u,j as v,w,x,z as y};
1
+ import{L as e}from"./chunk-DdHSYetV.js";var t={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;","`":"&#96;"};function r(e){let r=String(e);return r=r.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,""),r.replace(/[<>&'"`]/g,e=>t[e]??e)}function n(e){const t={};for(const r of Object.keys(e))t[r]=o(e[r]);return t}function o(e){return"string"==typeof e?r(e):Array.isArray(e)?e.map(o):null===e||"object"!=typeof e||function(e){return"object"==typeof e&&null!==e&&"$$typeof"in e}(e)?e:n(e)}function i(e,t){const r=[];for(const[n,o]of Object.entries(t)){const t=e[n],i=null==t;o.required&&i?r.push(`prop '${n}' is required`):i||(typeof t===o.type?("number"===o.type&&"number"==typeof t&&(void 0!==o.min&&t<o.min&&r.push(`prop '${n}' must be >= ${o.min}`),void 0!==o.max&&t>o.max&&r.push(`prop '${n}' must be <= ${o.max}`)),"string"===o.type&&"string"==typeof t&&o.pattern&&!o.pattern.test(t)&&r.push(`prop '${n}' does not match pattern ${o.pattern}`),o.enum&&!o.enum.includes(t)&&r.push(`prop '${n}' must be one of: ${o.enum.join(", ")}`)):r.push(`prop '${n}' must be of type ${o.type}, got ${typeof t}`))}return{valid:0===r.length,errors:r}}var s=/* @__PURE__ */new Map,a=[];function l(t,r,n){const o=e(JSON.stringify(n??{})),i=e((a.length>0?a[a.length-1].chainHash:"00000000")+o+r+t),s=Object.freeze({timestamp:Date.now(),component:r,action:t,propsHash:o,chainHash:i});return a=Object.freeze([...a,s]),s}function f(e){let t=a;return e?.component&&(t=t.filter(t=>t.component===e.component)),e?.action&&(t=t.filter(t=>t.action===e.action)),e?.limit&&(t=t.slice(-e.limit)),t}function c(){let t="00000000";for(const r of a){if(e(t+r.propsHash+r.component+r.action)!==r.chainHash)return!1;t=r.chainHash}return!0}function u(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;const r=t.replace(/[\u0000-\u001F\u007F]/g,"");return/^javascript:/i.test(r)||/^vbscript:/i.test(r)||/^data:/i.test(r)&&!/^data:image\//i.test(r)||/^file:/i.test(r)?null:r}var d=new Set(["a","abbr","b","blockquote","br","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),p={a:new Set(["href","title","target","rel"]),img:new Set(["src","alt","title","width","height","loading","decoding"]),th:new Set(["scope","colspan","rowspan","align"]),td:new Set(["colspan","rowspan","align"]),"*":new Set(["id","class","lang","dir","title"])},m=new Set(["constructor","prototype","__proto__","submit","reset","action","method","enctype","target","elements","children","firstChild","nextSibling","parentNode","ownerDocument","cookie","domain","location","documentElement","body","head","title","contentWindow","contentDocument"]);function b(e){if("string"!=typeof e)return"";if("undefined"==typeof DOMParser)return r(e);const t=(new DOMParser).parseFromString(`<div>${e}</div>`,"text/html").body.firstElementChild;return t?(g(t),t.innerHTML):""}function g(e){const t=Array.from(e.children);for(const r of t){const e=r.tagName.toLowerCase();if(d.has(e)){for(const t of Array.from(r.attributes)){const n=t.name.toLowerCase();if(n.startsWith("on"))r.removeAttribute(t.name);else if(m.has(n))r.removeAttribute(t.name);else if("style"!==n)if((p[e]??/* @__PURE__ */new Set).has(n)||p["*"].has(n)){if(("href"===n||"src"===n)&&"string"==typeof t.value){const e=u(t.value);null===e?r.removeAttribute(t.name):r.setAttribute(t.name,e)}"name"!==n&&"id"!==n||!m.has(t.value.toLowerCase())||r.removeAttribute(t.name)}else r.removeAttribute(t.name);else r.setAttribute("style",x(t.value))}g(r)}else r.remove()}}function x(e){if("string"!=typeof e)return"";let t=e;return t=t.replace(/expression\s*\([^)]*\)/gi,""),t=t.replace(/url\s*\(\s*['"]?\s*(javascript|vbscript|data)\s*:[^)]*\)/gi,"url(#)"),t=t.replace(/@import[^;]*;?/gi,""),t=t.replace(/behavior\s*:[^;]*;?/gi,""),t=t.replace(/-moz-binding[^;]*;?/gi,""),t=t.replace(/[<>]/g,""),t=t.replace(/[\u0000-\u001F\u007F]/g,""),t.trim()}var h=new Set(["__proto__","constructor","prototype"]);function w(e){try{return $(JSON.parse(e,(e,t)=>{if(!h.has(e))return t}))}catch{return null}}function $(e){if(Array.isArray(e))return e.map($);if(e&&"object"==typeof e){const t={};for(const[r,n]of Object.entries(e))h.has(r)||(t[r]=$(n));return t}return e}function y(e){return!("string"!=typeof e||!e||/[\u0000-\u001F\u007F<>"]/.test(e)||m.has(e.toLowerCase()))}function v(e){return"string"!=typeof e?"":e.replace(/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF\u00AD]/g,"")}function k(e={}){const{allowInlineStyles:t=!0,imgHosts:r=[],connectHosts:n=[],fontHosts:o=[],scriptNonce:i,reportUri:s}=e,a=["default-src 'self'","script-src "+(i?`'self' 'nonce-${i}'`:"'self'"),"style-src "+(t?"'self' 'unsafe-inline'":"'self'"),`img-src ${["'self'","data:","https:",...r].join(" ")}`,`font-src ${["'self'","https:","data:",...o].join(" ")}`,`connect-src ${["'self'",...n].join(" ")}`,"frame-ancestors 'none'","form-action 'self'","base-uri 'self'","object-src 'none'","upgrade-insecure-requests"];return s&&a.push(`report-uri ${s}`),a.join("; ")}function j(){if("undefined"==typeof window)return;const e=window.trustedTypes;if(e)try{e.createPolicy("tkx",{createHTML:b,createScriptURL:e=>u(e)??"",createScript:()=>{throw new Error("TekiVex: inline script creation forbidden")}})}catch{}}function z(){if("undefined"==typeof window)return!1;try{return window.top!==window.self}catch{return!0}}function S(e){if("undefined"!=typeof window&&z())if(e)e();else try{window.top.location.href=window.self.location.href}catch{}}function A(e,t){let r=e,n=Date.now();return{check(){const o=Date.now(),i=o-n,s=Math.floor(i/t);return s>0&&(r=Math.min(e,r+s),n=o),!(r<=0||(r-=1,0))},reset(){r=e,n=Date.now()}}}async function O(e){const t=new Uint8Array(await e.slice(0,12).arrayBuffer()),r=(...e)=>e.every((e,r)=>t[r]===e);return r(137,80,78,71)?"image/png":r(255,216,255)?"image/jpeg":r(71,73,70,56)?"image/gif":r(66,77)?"image/bmp":r(82,73,70,70)&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"image/webp":r(37,80,68,70)?"application/pdf":r(80,75,3,4)?"application/zip":123===t[0]||91===t[0]?"application/json":[...t].includes(0)?null:"text/plain"}var F=[{name:"ssn",re:/\b\d{3}-\d{2}-\d{4}\b/g,repl:"[redacted-ssn]"},{name:"credit",re:/\b(?:\d[ -]*?){13,19}\b/g,repl:"[redacted-card]"},{name:"email",re:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,repl:"[redacted-email]"},{name:"phone",re:/\b(\+?\d{1,3}[ -])?\(?\d{3}\)?[ -]?\d{3}[ -]?\d{4}\b/g,repl:"[redacted-phone]"},{name:"apikey",re:/\b(sk|pk|rk)-[A-Za-z0-9]{20,}\b/g,repl:"[redacted-key]"}];function _(e){if("string"!=typeof e)return"";let t=e;for(const{re:r,repl:n}of F)t=t.replace(r,n);return t}function M(e){if(e&&"object"==typeof e&&!Object.isFrozen(e)){for(const t of Object.keys(e))M(e[t]);Object.freeze(e)}return e}var C=Object.freeze({sanitizeString:r,sanitizeHref:u,sanitizeHTML:b,sanitizeCSS:x,sanitizeJSON:w,sanitizeUnicode:v,isSafeAttrName:y,buildTkxCSP:k,installTrustedTypes:j,isFramed:z,installFrameBuster:S,createRateLimiter:A,sniffMimeType:O,scrubPII:_,deepFreeze:M,__brand:"TekiVex SecurityCore v2.6.0 © 007krcs"}),D={sanitize:r,sanitizeProps:n,validateProps:i,createCSP:function(e,t){const r={componentId:e,permissions:t,directives:{"default-src":["'self'"],"style-src":t.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":t.allowDataUrls?["'self'","data:"]:t.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":t.allowScripts?["'self'"]:["'none'"]}};return s.set(e,r),r},hasPermission:function(e,t){return!0===s.get(e)?.permissions[t]},audit:l,getAuditLog:f,verifyAuditIntegrity:c},T={0:"0",px:"1px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},q={...T,screen:"100vh"},H={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},P={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},I={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},Z={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},E={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},L={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},N={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},B={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},U=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),X=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Y={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},J=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,R=new Set(["behavior","-moz-binding","-webkit-binding","src"]),V=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function G(e){return J.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function W(e){const t=e.match(/^\[(.+)]$/);return t?G(t[1]):null}function K(e){return X.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":W(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function Q(e){const t=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(t){const e=function(e){const t=e.toLowerCase().trim();return R.has(t)?null:V.has(t)?t:null}(t[1]),r=G(t[2]);return e&&r?{[e]:r}:null}const r={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(r[e])return{display:r[e]};const n={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(n[e])return{"flex-direction":n[e]};const o={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(o[e])return{"flex-wrap":o[e]};const i={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(i[e])return{flex:i[e]};if("grow"===e||"flex-grow"===e)return{"flex-grow":"1"};if("grow-0"===e)return{"flex-grow":"0"};if("shrink"===e||"flex-shrink"===e)return{"flex-shrink":"1"};if("shrink-0"===e||"flex-shrink-0"===e)return{"flex-shrink":"0"};const s={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(s[e])return{"align-items":s[e]};const a={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(a[e])return{"justify-content":a[e]};const l={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(l[e])return{"align-self":l[e]};const f={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(f[e])return{"align-content":f[e]};let c;if(c=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===c[1]?"none":"subgrid"===c[1]?"subgrid":`repeat(${c[1]},minmax(0,1fr))`};if(c=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===c[1]?"none":"subgrid"===c[1]?"subgrid":`repeat(${c[1]},minmax(0,1fr))`};if(c=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===c[1]?"1 / -1":`span ${c[1]} / span ${c[1]}`};if(c=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":c[1]};if(c=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":c[1]};if(c=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===c[1]?"1 / -1":`span ${c[1]} / span ${c[1]}`};if(c=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":c[1]};if(c=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":c[1]};if("grid-flow-row"===e)return{"grid-auto-flow":"row"};if("grid-flow-col"===e)return{"grid-auto-flow":"column"};if("grid-flow-dense"===e)return{"grid-auto-flow":"dense"};if("grid-flow-row-dense"===e)return{"grid-auto-flow":"row dense"};if("grid-flow-col-dense"===e)return{"grid-auto-flow":"column dense"};if(c=e.match(/^p-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{padding:e}}if(c=e.match(/^px-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-left":e,"padding-right":e}}if(c=e.match(/^py-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(c=e.match(/^pt-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-top":e}}if(c=e.match(/^pr-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-right":e}}if(c=e.match(/^pb-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-bottom":e}}if(c=e.match(/^pl-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"padding-left":e}}if(c=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{margin:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-left":e,"margin-right":e}}}if(c=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-top":e,"margin-bottom":e}}}if(c=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-top":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-right":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-bottom":t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??W(c[1]);if(r)return{"margin-left":t&&"0"!==r?`-${r}`:r}}if("mx-auto"===e)return{"margin-left":"auto","margin-right":"auto"};if("my-auto"===e)return{"margin-top":"auto","margin-bottom":"auto"};if(c=e.match(/^gap-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{gap:e}}if(c=e.match(/^gap-x-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"column-gap":e}}if(c=e.match(/^gap-y-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"row-gap":e}}if(c=e.match(/^w-(.+)$/)){const e=c[1],t=T[e]??H[e]??W(e);if(t)return{width:t}}if(c=e.match(/^min-w-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"min-width":e}}if(c=e.match(/^max-w-(.+)$/)){const e={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[c[1]]??T[c[1]]??W(c[1]);if(e)return{"max-width":e}}if(c=e.match(/^h-(.+)$/)){const e=c[1],t=q[e]??H[e]??W(e);if(t)return{height:t}}if(c=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[c[1]]??T[c[1]]??W(c[1]);if(e)return{"min-height":e}}if(c=e.match(/^max-h-(.+)$/)){const e=q[c[1]]??W(c[1]);if(e)return{"max-height":e}}if(c=e.match(/^size-(.+)$/)){const e=T[c[1]]??H[c[1]]??W(c[1]);if(e)return{width:e,height:e}}if(c=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=Z[c[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(c=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":E[c[1]]??c[1]};if(c=e.match(/^leading-(.+)$/)){const e=L[c[1]]??W(c[1]);if(e)return{"line-height":e}}if(c=e.match(/^tracking-(.+)$/)){const e=N[c[1]]??W(c[1]);if(e)return{"letter-spacing":e}}const u={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(u[e])return{"text-align":u[e]};if("italic"===e)return{"font-style":"italic"};if("not-italic"===e)return{"font-style":"normal"};if("uppercase"===e)return{"text-transform":"uppercase"};if("lowercase"===e)return{"text-transform":"lowercase"};if("capitalize"===e)return{"text-transform":"capitalize"};if("normal-case"===e)return{"text-transform":"none"};if("underline"===e)return{"text-decoration-line":"underline"};if("overline"===e)return{"text-decoration-line":"overline"};if("line-through"===e)return{"text-decoration-line":"line-through"};if("no-underline"===e)return{"text-decoration-line":"none"};if("truncate"===e)return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if("text-ellipsis"===e)return{"text-overflow":"ellipsis"};if("text-clip"===e)return{"text-overflow":"clip"};if("whitespace-normal"===e)return{"white-space":"normal"};if("whitespace-nowrap"===e)return{"white-space":"nowrap"};if("whitespace-pre"===e)return{"white-space":"pre"};if("whitespace-pre-wrap"===e)return{"white-space":"pre-wrap"};if("whitespace-pre-line"===e)return{"white-space":"pre-line"};if("break-words"===e)return{"overflow-wrap":"break-word"};if("break-all"===e)return{"word-break":"break-all"};if("break-keep"===e)return{"word-break":"keep-all"};if("font-mono"===e)return{"font-family":"var(--tkx-font-mono,monospace)"};if("font-sans"===e)return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if("font-serif"===e)return{"font-family":"ui-serif,Georgia,serif"};if("antialiased"===e)return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(c=e.match(/^indent-(.+)$/)){const e=T[c[1]]??W(c[1]);if(e)return{"text-indent":e}}if(c=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":c[1],"-webkit-box-orient":"vertical"};if(c=e.match(/^text-(.+)$/)){const[e,t]=c[1].split("/"),r=K(e);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(e)){if(t){const e=parseInt(t)/100;return{color:r,opacity:String(e)}}return{color:r}}}if(c=e.match(/^bg-(.+)$/)){const[e,t]=c[1].split("/"),r=K(e);return t?{"background-color":r,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":r}}if(c=e.match(/^border-color-(.+)$/))return{"border-color":K(c[1])};if(c=e.match(/^fill-(.+)$/))return{fill:K(c[1])};if(c=e.match(/^stroke-(.+)$/))return{stroke:K(c[1])};if(c=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":K(c[1])};if(c=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":K(c[1])};if(c=e.match(/^accent-(.+)$/))return{"accent-color":K(c[1])};if(c=e.match(/^caret-(.+)$/))return{"caret-color":K(c[1])};if(c=e.match(/^outline-color-(.+)$/))return{"outline-color":K(c[1])};if("border"===e)return{"border-width":"1px"};if(c=e.match(/^border-(\d+)$/))return{"border-width":`${c[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(c=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${c[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(c=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${c[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(c=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${c[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(c=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${c[1]}px`};if("border-x"===e)return{"border-left-width":"1px","border-right-width":"1px"};if("border-y"===e)return{"border-top-width":"1px","border-bottom-width":"1px"};if("border-none"===e)return{"border-style":"none"};if("border-solid"===e)return{"border-style":"solid"};if("border-dashed"===e)return{"border-style":"dashed"};if("border-dotted"===e)return{"border-style":"dotted"};if("border-double"===e)return{"border-style":"double"};if((c=e.match(/^border-([a-zA-Z].*)$/))&&X.has(c[1]))return{"border-color":`var(--tkx-${c[1]})`};if(c=e.match(/^border-\[(.+)]$/))return{"border-color":c[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":P[""]};if(c=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":P[c[1]]??W(c[1])??c[1]};if(c=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=c[1],t=P[c[2]??""]??P[""];return{t:{"border-top-left-radius":t,"border-top-right-radius":t},r:{"border-top-right-radius":t,"border-bottom-right-radius":t},b:{"border-bottom-left-radius":t,"border-bottom-right-radius":t},l:{"border-top-left-radius":t,"border-bottom-left-radius":t},tl:{"border-top-left-radius":t},tr:{"border-top-right-radius":t},br:{"border-bottom-right-radius":t},bl:{"border-bottom-left-radius":t}}[e]??{}}const d={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if("ring"===e)return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((c=e.match(/^ring-(\d+)$/))&&d[c[1]])return{"box-shadow":`0 0 0 ${d[c[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(c=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${c[1]}px`,"box-shadow":`0 0 0 ${c[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":I[""]};if(c=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":I[c[1]]};if(c=e.match(/^opacity-(\d+)$/)){const e=U[c[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const p={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(p[e])return{"background-size":p[e]};const m={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(m[e])return{"background-position":m[e]};const b={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(b[e])return{"background-repeat":b[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${B[""]})`};if(c=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${B[c[1]]})`};if("blur"===e)return{filter:`blur(${B[""]})`};if(c=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${B[c[1]]})`};if("grayscale"===e)return{filter:"grayscale(100%)"};if("grayscale-0"===e)return{filter:"grayscale(0)"};if("invert"===e)return{filter:"invert(100%)"};if("invert-0"===e)return{filter:"invert(0)"};const g={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(g[e])return{position:g[e]};if("inset-0"===e)return{top:"0",right:"0",bottom:"0",left:"0"};if("inset-auto"===e)return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if("inset-full"===e)return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if("inset-x-0"===e)return{left:"0",right:"0"};if("inset-y-0"===e)return{top:"0",bottom:"0"};if(c=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{top:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{right:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{bottom:t&&"0"!==r?`-${r}`:r}}if(c=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{left:t&&"0"!==r?`-${r}`:r}}const x={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(c=e.match(/^z-(.+)$/)){const e=x[c[1]]??W(c[1]);if(e)return{"z-index":e}}const h={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(h[e])return{overflow:h[e]};if(c=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${c[1]}`]:c[2]};if("scrollbar-hide"===e)return{"-ms-overflow-style":"none","scrollbar-width":"none"};if("visible"===e)return{visibility:"visible"};if("invisible"===e)return{visibility:"hidden"};if("collapse"===e)return{visibility:"collapse"};const w={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(w[e])return{cursor:w[e]};if("select-none"===e)return{"user-select":"none"};if("select-text"===e)return{"user-select":"text"};if("select-all"===e)return{"user-select":"all"};if("select-auto"===e)return{"user-select":"auto"};if("pointer-events-none"===e)return{"pointer-events":"none"};if("pointer-events-auto"===e)return{"pointer-events":"auto"};const $={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(c=e.match(/^scale-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scale(${e})`}}if(c=e.match(/^scale-x-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scaleX(${e})`}}if(c=e.match(/^scale-y-(.+)$/)){const e=$[c[1]]??W(c[1]);if(e)return{transform:`scaleY(${e})`}}const y={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(c=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),r=y[c[1]]??W(c[1]);if(r)return{transform:t?`rotate(-${r})`:`rotate(${r})`}}if(c=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{transform:`translateX(${t&&"0"!==r?`-${r}`:r})`}}if(c=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),r=T[c[1]]??H[c[1]]??W(c[1]);if(r)return{transform:`translateY(${t&&"0"!==r?`-${r}`:r})`}}if(c=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),r=W(c[1])??`${c[1]}deg`;return{transform:t?`skewX(-${r})`:`skewX(${r})`}}if(c=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),r=W(c[1])??`${c[1]}deg`;return{transform:t?`skewY(-${r})`:`skewY(${r})`}}const v={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(v[e])return{"transform-origin":v[e]};const k={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(k[e])return{"transition-property":k[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const j={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(c=e.match(/^duration-(.+)$/)){const e=j[c[1]]??W(c[1]);if(e)return{"transition-duration":e}}if(c=e.match(/^delay-(.+)$/)){const e=j[c[1]]??W(c[1]);if(e)return{"transition-delay":e}}const z={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(z[e])return{"transition-timing-function":z[e]};const S={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(S[e])return{animation:S[e]};const A={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return A[e]?{"object-fit":A[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(c=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":c[1]}:"list-none"===e?{"list-style-type":"none"}:"list-disc"===e?{"list-style-type":"disc"}:"list-decimal"===e?{"list-style-type":"decimal"}:"list-inside"===e?{"list-style-position":"inside"}:"list-outside"===e?{"list-style-position":"outside"}:(c=e.match(/^columns-(\d+)$/))?{columns:c[1]}:"resize"===e?{resize:"both"}:"resize-none"===e?{resize:"none"}:"resize-x"===e?{resize:"horizontal"}:"resize-y"===e?{resize:"vertical"}:"sr-only"===e?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:"not-sr-only"===e?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:"focus-ring"===e?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:"appearance-none"===e?{appearance:"none"}:"outline-none"===e?{outline:"none"}:"outline"===e?{outline:"2px solid currentColor","outline-offset":"2px"}:"float-left"===e?{float:"left"}:"float-right"===e?{float:"right"}:"float-none"===e?{float:"none"}:"clear-both"===e?{clear:"both"}:"isolate"===e?{isolation:"isolate"}:"isolation-auto"===e?{isolation:"auto"}:(c=e.match(/^will-change-(.+)$/))?{"will-change":c[1]}:"touch-manipulation"===e?{"touch-action":"manipulation"}:"touch-none"===e?{"touch-action":"none"}:"touch-pan-x"===e?{"touch-action":"pan-x"}:"touch-pan-y"===e?{"touch-action":"pan-y"}:"scroll-smooth"===e?{"scroll-behavior":"smooth"}:"scroll-auto"===e?{"scroll-behavior":"auto"}:(c=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[c[1]]:c[2]}:xe(e)||null}function ee(e){let t=0,r=-1;for(let n=0;n<e.length;n++)if("["===e[n])t++;else if("]"===e[n])t--;else if(":"===e[n]&&0===t){r=n;break}return-1===r?{variant:null,utility:e}:{variant:e.slice(0,r),utility:e.slice(r+1)}}function te(e,t){for(const[r,n]of Object.entries(t))e[r]=n}function re(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var ne=/* @__PURE__ */new Map,oe=null,ie=null;function se(){return oe&&oe.isConnected||(oe=document.getElementById("tkx-atomic"))||((oe=document.createElement("style")).id="tkx-atomic",document.head.appendChild(oe)),oe}function ae(e){const t=[];for(const r of e)if(r)if("string"==typeof r)t.push(...r.split(/\s+/).filter(Boolean));else if(Array.isArray(r))t.push(...ae(r));else if("object"==typeof r)for(const[e,n]of Object.entries(r))n&&t.push(e);return t}function le(...t){const r=ae(t);if(0===r.length)return"";const n={base:{},variants:{}};for(const e of r){const{variant:t,utility:r}=ee(e),o=Q(r);o&&(t?(n.variants[t]||(n.variants[t]={}),te(n.variants[t],o)):te(n.base,o))}const o=[],i=re(n.base),s=e([i,...Object.entries(n.variants).map(([e,t])=>`${e}{${re(t)}}`)].join("|")),a=`tkx-${s}`;i&&o.push(`.${a}{${i}}`);for(const[e,l]of Object.entries(n.variants)){const t=re(l);if(t)if(e.startsWith("@")){const r=Y[e.slice(1)];r&&o.push(`@media(min-width:${r}){.${a}{${t}}}`)}else if("motion-safe"===e)o.push(`@media(prefers-reduced-motion:no-preference){.${a}{${t}}}`);else if("motion-reduce"===e)o.push(`@media(prefers-reduced-motion:reduce){.${a}{${t}}}`);else if("contrast-more"===e)o.push(`@media(prefers-contrast:more){.${a}{${t}}}`);else if("forced-colors"===e)o.push(`@media(forced-colors:active){.${a}{${t}}}`);else if("dark"===e)o.push(`@media(prefers-color-scheme:dark){.${a}{${t}}}`);else if("print"===e)o.push(`@media print{.${a}{${t}}}`);else if("group-hover"===e)o.push(`.group:hover .${a}{${t}}`);else if("group-focus"===e)o.push(`.group:focus-within .${a}{${t}}`);else if("peer-hover"===e)o.push(`.peer:hover~.${a}{${t}}`);else{const r={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[e]??`:${e}`;o.push(`.${a}${r}{${t}}`)}}return o.length>0&&function(e,t){if(ne.has(e))return;if(ne.set(e,t),"undefined"==typeof document)return;const r=function(){if(ie)return ie;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],ie=e,e}catch{return null}}();if(r){const e=function(e){const t=[];let r=0,n=0;for(let o=0;o<e.length;o++)if("{"===e[o])r++;else if("}"===e[o]&&(r--,0===r)){const r=e.slice(n,o+1).trim();r&&t.push(r),n=o+1}return t}(t);for(const t of e)try{r.insertRule(t,r.cssRules.length)}catch{se().textContent+=t+"\n"}}else se().textContent+=t+"\n"}(s,o.join("")),a}var fe=le;function ce(){return Array.from(ne.values()).join("\n")}function ue(){ne.clear(),oe=null,ie&&"undefined"!=typeof document&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==ie),ie=null)}function de(...e){return e.filter(Boolean).join(" ")}var pe=/* @__PURE__ */new Map;function me(e){pe.set(e.name,e.utilities)}function be(e){pe.delete(e)}function ge(){return Array.from(pe.keys())}function xe(e){for(const t of pe.values())if(t[e])return t[e];return null}export{i as A,u as C,v as D,r as E,_ as O,b as S,n as T,S as _,le as a,y as b,be as c,D as d,l as f,f as g,M as h,xe as i,c as j,O as k,fe as l,A as m,ce as n,ge as o,k as p,ue as r,me as s,de as t,C as u,j as v,w,x,z as y};
@@ -0,0 +1 @@
1
+ import{createContext as e,createElement as t,useContext as n,useEffect as r,useLayoutEffect as o,useState as a}from"react";function i(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}var s=class{constructor(e=512){this.cache=/* @__PURE__ */new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(e,512)}get(e){if(!this.cache.has(e))return void this.misses++;this.hits++;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}has(e){return this.cache.has(e)}invalidate(e){void 0!==e?this.cache.delete(e):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const e=this.hits+this.misses;return 0===e?0:this.hits/e*100}},c=new s(512);function d(e,t){const n=c.get(e);if(void 0!==n)return n;const r=t();return c.set(e,r),r}var u=[],f=!1,p=[],l=0,x=0;function h(e){u.push(e),f||(f=!0,queueMicrotask(()=>{!function(){const e=u.splice(0),t=performance.now();for(const r of e)try{r()}catch{}const n=performance.now()-t;l+=n,x++,p.push({duration:n,timestamp:Date.now()}),p.length>100&&p.shift()}(),f=!1}))}var m={hash:i,memoize:d,batchUpdate:h,invalidate:function(e){void 0!==e?c.invalidate(e):c.invalidate()},get avgRenderTime(){return 0===x?0:l/x},get cacheHitRate(){return c.cacheHitRate},getMetrics:function(e){const t=void 0!==e?p.slice(-e):p.slice();return{avgRenderTime:0===x?0:l/x,cacheHitRate:c.cacheHitRate,renderCount:x,recent:t}}},w=/* @__PURE__ */new Map;function g(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function b(e){const t=function(e){return"tkx-"+i(e)}(e);return w.has(t)||w.set(t,e),t}function v(e,...t){const n=e.reduce((e,n,r)=>e+n+(void 0!==t[r]?String(t[r]):""),"");return{className:b(n.trim()),styles:n.trim()}}function k(e){const t=Object.entries(e).map(([e,t])=>`${g(e)}: ${t};`).join(" ");return{className:b(t),styles:t}}var y={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function M(e,t){return`@media (min-width: ${y[e]}) { ${t} }`}function $(e,t){return`@keyframes ${e} { ${Object.entries(t).map(([e,t])=>`${e} { ${Object.entries(t).map(([e,t])=>`${g(e)}: ${t};`).join(" ")} }`).join(" ")} }`}function A(e,t){return void 0!==t?`--tkx-${e}: ${t};`:`var(--tkx-${e})`}function H(){return Array.from(w.entries()).map(([e,t])=>`.${e} { ${t} }`).join("\n")}function S(){w.clear()}function z(){if("undefined"==typeof document)return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=H()}var T={css:v,fromObject:k,responsive:M,keyframes:$,cssVar:A,extractCSS:H,injectStyles:z,resetStyles:S};function j(e){const[t,n,r]=function(e){if(!e||"string"!=typeof e)return[0,0,0];const t=e.replace("#",""),n=3===t.length?t.split("").map(e=>e+e).join(""):t,r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[isNaN(r)?0:r,isNaN(o)?0:o,isNaN(a)?0:a]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*r}function N(e,t){const n=j(e),r=j(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function O(e,t,n=!1){return N(e,t)>=(n?3:4.5)}function R(e,t,n=!1){return N(e,t)>=(n?4.5:7)}function E(e,t){const n=t??["#ffffff","#000000"];return n.reduce((t,n)=>N(n,e)>N(t,e)?n:t,n[0])}function I(){const e=document.createElement("div"),t=document.createElement("div");for(const n of[e,t])n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n);return e.setAttribute("aria-live","polite"),t.setAttribute("aria-live","assertive"),{announce(n,r="polite"){const o="assertive"===r?t:e;o.textContent="",setTimeout(()=>{o.textContent=n},0)},destroy(){e.remove(),t.remove()}}}var C=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function D(e){let t=null,n=null;function r(){return Array.from(e.querySelectorAll(C)).filter(e=>!e.closest("[hidden]")&&!e.closest('[aria-hidden="true"]'))}return{activate(){t=document.activeElement;const o=r();o.length>0&&o[0].focus(),n=e=>{if("Tab"!==e.key)return;const t=r();if(0===t.length)return;const n=t[0],o=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),o.focus()):document.activeElement===o&&(e.preventDefault(),n.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),t instanceof HTMLElement&&t.focus(),t=null,n=null}}}function F(e,t,n,r){let o=t;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),o=0===t?n-1:t-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),o=t===n-1?0:t+1;break;case"Home":e.preventDefault(),o=0;break;case"End":e.preventDefault(),o=n-1;break;case"Enter":case" ":return e.preventDefault(),void r(t);default:return}r(o)}function L(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function U(){return"undefined"!=typeof window&&window.matchMedia("(forced-colors: active)").matches}var K={contrastRatio:N,meetsAA:O,meetsAAA:R,getAccessibleForeground:E,createAnnouncer:I,createFocusTrap:D,handleTabsKeyboard:F,handleMenuKeyboard:function(e,t,n,r,o){let a=t;switch(e.key){case"ArrowUp":e.preventDefault(),a=0===t?n-1:t-1;break;case"ArrowDown":e.preventDefault(),a=t===n-1?0:t+1;break;case"Home":e.preventDefault(),a=0;break;case"End":e.preventDefault(),a=n-1;break;case"Enter":case" ":return e.preventDefault(),void r(t);case"Escape":return e.preventDefault(),void o?.();default:return}r(a)},prefersReducedMotion:L,prefersHighContrast:U,announce:function(e,t="polite"){if("undefined"==typeof document)return;let n=document.getElementById("tkx-live-region");n||(n=document.createElement("div"),n.id="tkx-live-region",n.setAttribute("aria-live",t),n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n)),n.textContent="",setTimeout(()=>{n&&(n.textContent=e)},0)}},q="undefined"!=typeof window?o:r,P={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},V={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},Z=/^#[0-9a-fA-F]{3,8}$/;function _(e,t){const n={...e,...t};for(const[r,o]of Object.entries(n))if(!Z.test(o))throw new Error(`Invalid hex color for theme token '${r}': ${o}`);return O(n.text,n.bg),O(n.primary,n.bg),R(n.text,n.bg),n}var B=e(P);function G({theme:e,mode:n,lightTheme:o=V,darkTheme:i=P,children:s}){const c=void 0!==e,d=function(e){const[t,n]=a(()=>!e||"undefined"==typeof window||!window.matchMedia||window.matchMedia("(prefers-color-scheme: dark)").matches);return r(()=>{if(!e||"undefined"==typeof window||!window.matchMedia)return;const t=window.matchMedia("(prefers-color-scheme: dark)"),r=e=>n(e.matches);return t.addEventListener?(t.addEventListener("change",r),()=>t.removeEventListener("change",r)):(t.addListener(r),()=>t.removeListener(r))},[e]),t}(!c&&("auto"===n||void 0===n));let u;u=c?e:"light"===n?o:"dark"===n||d?i:o,q(()=>{const e=Object.entries(u).map(([e,t])=>A(e,t)).join(" ");let t=document.getElementById("tkx-theme");if(!t){t=document.createElement("style"),t.id="tkx-theme";const e=document.head.querySelector("style");e?document.head.insertBefore(t,e):document.head.appendChild(t)}t.textContent=`:root { ${e} }`,document.documentElement.setAttribute("data-tkx-scheme",u===i?"dark":u===o?"light":"custom")},[u,i,o]);const f=Object.fromEntries(Object.entries(u).map(([e,t])=>[`--tkx-${e}`,t]));return t(B.Provider,{value:u},t("div",{style:{display:"contents",...f}},s))}function J(){return n(B)}function Q(){const[e,t]=a(()=>"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark");return r(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),n=e=>t(e.matches?"dark":"light");return e.addEventListener?(e.addEventListener("change",n),()=>e.removeEventListener("change",n)):(e.addListener(n),()=>e.removeListener(n))},[]),e}function W(e,t,n){n/=100;const r=(t/=100)*Math.min(n,1-n),o=t=>{const o=(t+e/30)%12,a=n-r*Math.max(Math.min(o-3,9-o,1),-1);return Math.round(255*a).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}function X(e){const[t,n]=function(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(n,r,o),i=Math.min(n,r,o);let s=0,c=0;const d=(a+i)/2;if(a!==i){const e=a-i;switch(c=d>.5?e/(2-a-i):e/(a+i),a){case n:s=((r-o)/e+(r<o?6:0))/6;break;case r:s=((o-n)/e+2)/6;break;case o:s=((n-r)/e+4)/6}}return[Math.round(360*s),Math.round(100*c),Math.round(100*d)]}(e);return{50:W(t,Math.min(n,30),96),100:W(t,Math.min(n,40),90),200:W(t,Math.min(n,50),80),300:W(t,n,70),400:W(t,n,60),500:e,600:W(t,n,45),700:W(t,n,35),800:W(t,n,25),900:W(t,n,15)}}var Y={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1.15"}},ee={0:"0px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",4:"16px",5:"20px",6:"24px",8:"32px",10:"40px",12:"48px",16:"64px",20:"80px",24:"96px"},te={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},ne={none:"none",xs:"0 1px 2px 0 rgba(0,0,0,0.05)",sm:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)"},re={hide:-1,base:0,dropdown:1e3,sticky:1100,fixed:1200,overlay:1300,modal:1400,popover:1500,tooltip:1600,toast:1700,max:9999},oe={none:"0",sm:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px",full:"9999px"};export{z as A,U as C,A as D,v as E,m as F,h as I,i as L,S as M,M as N,H as O,s as P,d as R,R as S,T,I as _,_ as a,F as b,oe as c,Y as d,Q as f,N as g,K as h,te as i,$ as j,k,ne as l,re as m,G as n,X as o,J as p,V as r,P as s,B as t,ee as u,D as v,L as w,O as x,E as y};
@@ -0,0 +1 @@
1
+ require("./chunk-DmRB1Blb.js");const e=require("./chunk-BpuJ3-K8.js"),r=require("./chunk-D7-yknXg.js"),t=require("./i18n.cjs");let n=require("react"),l=require("react/jsx-runtime");var i=(0,n.createContext)(null),a={required:"This field is required",invalidFormat:"Invalid format",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be no more than ${e} characters`,minValue:e=>`Must be at least ${e}`,maxValue:e=>`Must be no more than ${e}`};async function s(e,r,t=a){for(const n of r){if(n.required&&(null==e||""===e||Array.isArray(e)&&0===e.length))return n.message??t.required;if(null!=e&&""!==e){if(void 0!==n.min){if("string"==typeof e&&e.length<n.min)return n.message??t.minLength(n.min);if("number"==typeof e&&e<n.min)return n.message??t.minValue(n.min)}if(void 0!==n.max){if("string"==typeof e&&e.length>n.max)return n.message??t.maxLength(n.max);if("number"==typeof e&&e>n.max)return n.message??t.maxValue(n.max)}if(n.pattern&&"string"==typeof e&&!n.pattern.test(e))return n.message??t.invalidFormat;if(n.validator){const r=await n.validator(e);if(r)return r}}}return null}function o(){const e=(0,n.useContext)(i),r=(0,n.useRef)({}),t=(0,n.useRef)({}),l=(0,n.useRef)({}),a=(0,n.useMemo)(()=>({getFieldValue:e=>r.current[e],setFieldValue:(e,t)=>{r.current[e]=t},getFieldsValue:()=>({...r.current}),setFieldsValue:e=>{Object.assign(r.current,e)},validateFields:()=>Promise.resolve({...r.current}),validateField:e=>Promise.resolve(!0),resetFields:()=>{r.current={},t.current={},l.current={}},getFieldError:e=>t.current[e]??null,isFieldTouched:e=>l.current[e]??!1}),[]);return e?e.instance:a}function u({onSubmit:o,onValuesChange:u,initialValues:c={},layout:d="vertical",disabled:m=!1,children:f,className:h,style:x,form:F}){const v=e.useTheme(),y=t.useLocale(),g=(0,n.useMemo)(()=>({required:y.fieldRequired??a.required,invalidFormat:y.invalidFormat??a.invalidFormat,minLength:y.minLength??a.minLength,maxLength:y.maxLength??a.maxLength,minValue:y.minValue??a.minValue,maxValue:y.maxValue??a.maxValue}),[y]),[p,b]=(0,n.useState)({values:{...c},errors:{},touched:{}}),V=(0,n.useRef)(c),k=(0,n.useRef)({}),w=(0,n.useRef)(p);w.current=p;const j=(0,n.useCallback)((e,r)=>{k.current[e]=r},[]),q=(0,n.useCallback)(e=>{delete k.current[e]},[]),T=(0,n.useCallback)((e,r)=>{b(t=>{const n={...t,values:{...t.values,[e]:r}};return u?.({[e]:r},n.values),n})},[u]),N=(0,n.useCallback)((e,r)=>{b(t=>({...t,errors:{...t.errors,[e]:r}}))},[]),E=(0,n.useCallback)(e=>{b(r=>({...r,touched:{...r.touched,[e]:!0}}))},[]),M=(0,n.useCallback)(async e=>{const r=k.current[e];if(!r)return!0;const t=w.current.values[e],n=await s(t,r.rules,g);return b(r=>({...r,errors:{...r.errors,[e]:n},touched:{...r.touched,[e]:!0}})),null===n},[g]),O=(0,n.useCallback)(async()=>{const e=Object.keys(k.current),r=await Promise.all(e.map(async e=>{const r=k.current[e],t=w.current.values[e];return{name:e,error:await s(t,r.rules,g)}})),t={},n={};let l=!1;for(const{name:i,error:a}of r)t[i]=a,n[i]=!0,a&&(l=!0);if(b(e=>({...e,errors:{...e.errors,...t},touched:{...e.touched,...n}})),l){const e=Object.fromEntries(r.filter(e=>e.error).map(e=>[e.name,e.error]));return Promise.reject(e)}return{...w.current.values}},[]),z=(0,n.useCallback)(()=>{b({values:{...V.current},errors:{},touched:{}})},[]),C=(0,n.useMemo)(()=>({getFieldValue:e=>w.current.values[e],setFieldValue:T,getFieldsValue:()=>({...w.current.values}),setFieldsValue:e=>{b(r=>{const t={...r.values,...e};return u?.(e,t),{...r,values:t}})},validateFields:O,validateField:M,resetFields:z,getFieldError:e=>w.current.errors[e]??null,isFieldTouched:e=>!!w.current.touched[e]}),[T,O,M,z,u]),L=(0,n.useCallback)(async e=>{e.preventDefault();try{const e=await O();await(o?.(e))}catch{}},[O,o]),P="inline"===d?r.tkx("flex flex-row flex-wrap items-end gap-4"):r.tkx("flex flex-col gap-5");(0,n.useEffect)(()=>{if(!F)return;const e=F;e.getFieldValue=C.getFieldValue,e.setFieldValue=C.setFieldValue,e.getFieldsValue=C.getFieldsValue,e.setFieldsValue=C.setFieldsValue,e.validateFields=C.validateFields,e.validateField=C.validateField,e.resetFields=C.resetFields,e.getFieldError=C.getFieldError,e.isFieldTouched=C.isFieldTouched},[F,C]);const $=F??C,R=(0,n.useMemo)(()=>({state:p,initialValues:V.current,layout:d,disabled:m,fieldMeta:k,setFieldValue:T,setFieldError:N,setFieldTouched:E,registerField:j,unregisterField:q,validateField:M,instance:$}),[p,d,m,T,N,E,j,q,M,$]);return(0,l.jsx)(i.Provider,{value:R,children:(0,l.jsx)("form",{noValidate:!0,role:"form","aria-label":"Form",onSubmit:L,className:r.cx(P,h),style:{color:v.text,...x},children:f})})}function c({name:t,label:s,rules:o,help:u,required:c,children:d,className:m,style:f}){const h=e.useTheme(),x=function(){const e=(0,n.useContext)(i);if(!e)throw new Error("TkxFormField must be used inside a <TkxForm>. Wrap your fields in a TkxForm component.");return e}(),{state:F,layout:v,disabled:y}=x,g=(0,n.useMemo)(()=>function(e,r,t=a.required){const n=e?[...e]:[];return r&&!n.some(e=>e.required)&&n.unshift({required:!0,message:t}),n}(o,c),[o,c]),p=function(e){return e.some(e=>e.required)}(g),b=(0,n.useRef)({rules:g});b.current.rules=g;const V=(0,n.useRef)(!1);V.current||(x.registerField(t,b.current),V.current=!0),(0,n.useMemo)(()=>{x.registerField(t,b.current)},[g,t,x]);const k=F.values[t],w=F.touched[t]?F.errors[t]??null:null,j=w?r.sanitizeString(w):null,q=s?r.sanitizeString(s):void 0,T=u?r.sanitizeString(u):void 0,N=(0,n.useCallback)(e=>{let r;if(null!==e&&"object"==typeof e&&"target"in e){const t=e.target;r="checkbox"===t.type?t.checked:t.value}else r=e;x.setFieldValue(t,r)},[x,t]),E=(0,n.useCallback)(()=>{x.setFieldTouched(t),x.validateField(t)},[x,t]),M=d,O=(0,n.cloneElement)(M,{value:k??"",onChange:N,onBlur:E,error:j??void 0,isInvalid:!!j,isRequired:p,disabled:y||M.props.disabled,name:t}),z="horizontal"===v,C="inline"===v,L=(0,l.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),P=q?(0,l.jsxs)("label",{className:r.tkx("text-sm font-medium font-sans",z?"min-w-[140px] pt-2.5":""),style:{color:h.text},children:[q,p&&(0,l.jsx)("span",{"aria-hidden":"true",className:r.tkx("ml-1"),style:{color:h.danger},children:"*"})]}):null,$=(0,l.jsxs)(l.Fragment,{children:[T&&!j&&(0,l.jsx)("span",{className:r.tkx("text-xs mt-0.5"),style:{color:h.textMuted},children:T}),j&&(0,l.jsxs)("span",{role:"alert",className:r.tkx("text-xs flex items-center gap-1 mt-0.5"),style:{color:h.danger,animation:"tkxFormErrorReveal 200ms ease-out"},children:[L,j]})]});return C?(0,l.jsxs)("div",{className:r.cx(r.tkx("flex flex-col gap-1"),m),style:f,children:[P,O,$]}):z?(0,l.jsxs)("div",{className:r.cx(r.tkx("flex flex-row gap-4 items-start"),m),style:f,children:[P,(0,l.jsxs)("div",{className:r.tkx("flex flex-col gap-1 flex-1 min-w-0"),children:[O,$]})]}):(0,l.jsxs)("div",{className:r.cx(r.tkx("flex flex-col gap-1"),m),style:f,children:[P,O,$]})}u.displayName="TkxForm",c.displayName="TkxFormField";var d=!1;!function(){if(d)return;if("undefined"==typeof document)return;d=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent="\n @keyframes tkxFormErrorReveal {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n ",document.head.appendChild(e)}(),Object.defineProperty(exports,"TkxForm",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"TkxFormField",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"useTkxForm",{enumerable:!0,get:function(){return o}});
package/dist/headless.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./chunk-DmRB1Blb.js");const e=require("./chunk-DjxOP8W4.js"),t=require("./chunk-LWkKqC8d.js"),n=require("./chunk-Bc16rJT-.js"),r=require("./chunk-DkoFTL1O.js");let o=require("react");exports.contrastRatio=e.contrastRatio,exports.cssVar=e.cssVar,exports.cx=t.cx,exports.extractAtomicCSS=t.extractAtomicCSS,exports.extractCSS=e.extractCSS,exports.injectStyles=e.injectStyles,exports.meetsAA=e.meetsAA,exports.meetsAAA=e.meetsAAA,exports.resetAtomicCSS=t.resetAtomicCSS,exports.resetStyles=e.resetStyles,exports.sanitizeProps=t.sanitizeProps,exports.sanitizeString=t.sanitizeString,exports.tkxListPlugins=t.tkxListPlugins,exports.tkxPlugin=t.tkxPlugin,exports.tkxRemovePlugin=t.tkxRemovePlugin,exports.useAnnounce=n.useAnnounce,exports.useClickOutside=n.useClickOutside,exports.useControllable=function({value:e,onChange:t,defaultValue:n}){const r=void 0!==e,[s,c]=(0,o.useState)(n),i=(0,o.useRef)(t);i.current=t;const u=(0,o.useCallback)(e=>{r||c(e),i.current?.(e)},[r]);return[r?e:s,u]},exports.useDebounce=function(e,t){const[n,r]=(0,o.useState)(e);return(0,o.useEffect)(()=>{const n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n},exports.useDisclosure=function(e=!1){const[t,n]=(0,o.useState)(e);return{isOpen:t,open:(0,o.useCallback)(()=>n(!0),[]),close:(0,o.useCallback)(()=>n(!1),[]),toggle:(0,o.useCallback)(()=>n(e=>!e),[])}},exports.useEscapeKey=n.useEscapeKey,exports.useFocusTrap=n.useFocusTrap,exports.useFormState=function({initialValues:e,validate:t}){const[n,r]=(0,o.useState)({...e}),[s,c]=(0,o.useState)({}),[i,u]=(0,o.useState)({}),l=(0,o.useRef)(e),a=(0,o.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),d=(0,o.useCallback)(e=>{r(t=>({...t,...e}))},[]),p=(0,o.useCallback)(e=>{u(t=>({...t,[e]:!0}))},[]),f=(0,o.useCallback)(()=>{if(!t)return!0;const e=t(n),r=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e));return c(r),u(Object.fromEntries(Object.keys(n).map(e=>[e,!0]))),0===Object.keys(r).length},[n,t]),w=(0,o.useCallback)(()=>{r({...l.current}),c({}),u({})},[]);return{values:n,errors:s,touched:i,dirty:Object.keys(n).some(e=>n[e]!==l.current[e]),isValid:0===Object.keys(s).length,setValue:a,setValues:d,touchField:p,validate:f,reset:w,getFieldProps:(0,o.useCallback)(e=>({value:n[e],onChange:t=>{a(e,t.target.value)},onBlur:()=>p(e),"aria-invalid":!(!i[e]||!s[e])||void 0,"aria-describedby":s[e]?`${String(e)}-error`:void 0}),[n,s,i,a,p])}},exports.useHighContrast=n.useHighContrast,exports.useInfiniteQuery=function(e){const{queryFn:t,initialCursor:n=null,enabled:r=!0,dedupKey:s}=e,[c,i]=(0,o.useState)([]),[u,l]=(0,o.useState)("idle"),[a,d]=(0,o.useState)(null),[p,f]=(0,o.useState)(!1),[w,x]=(0,o.useState)(0),h=(0,o.useRef)(n??null),g=(0,o.useRef)(!1),y=(0,o.useRef)(!0),v=(0,o.useRef)(void 0),S=(0,o.useRef)(t);S.current=t;const m=(0,o.useCallback)(async(e,t,n)=>{if(g.current)return;if(void 0!==s&&s===v.current)return;g.current=!0;let r=!1;y.current&&(l(n?"loading":"fetching-more"),d(null));try{const o=await S.current(e,t);if(r||!y.current)return;void 0!==s&&(v.current=s),h.current=o.nextCursor,i(e=>n?[o.data]:[...e,o.data]),f(o.hasMore),x(t),l("success")}catch(o){if(r||!y.current)return;d(o instanceof Error?o:new Error(String(o))),l("error")}finally{r||(g.current=!1)}return()=>{r=!0}},[s]),b=(0,o.useCallback)(()=>{p&&!g.current&&m(h.current,w+1,!1)},[p,w,m]),O=(0,o.useCallback)(()=>{g.current=!1,v.current=void 0,h.current=n??null,i([]),l("idle"),d(null),f(!1),x(0)},[n]);(0,o.useEffect)(()=>(y.current=!0,r&&m(n??null,0,!0),()=>{y.current=!1}),[r]);const j=c.flat();return{data:j,pages:c,status:u,error:a,hasMore:p,isFetchingMore:"fetching-more"===u,fetchMore:b,reset:O,pageIndex:w,totalLoaded:j.length}},exports.useIntersectionObserver=function({threshold:e=0,rootMargin:t="0px",root:n=null,once:r=!1}={}){const s=(0,o.useRef)(null),[c,i]=(0,o.useState)(null),u=(0,o.useRef)(null);return(0,o.useEffect)(()=>{const o=s.current;if(o&&"undefined"!=typeof IntersectionObserver)return u.current=new IntersectionObserver(([e])=>{i(e),r&&e.isIntersecting&&u.current?.unobserve(o)},{threshold:e,rootMargin:t,root:n}),u.current.observe(o),()=>u.current?.disconnect()},[e,t,n,r]),{ref:s,isIntersecting:c?.isIntersecting??!1,entry:c}},exports.useListSelection=function({items:e,initialSelected:t=[],multiple:n=!0}){const[r,s]=(0,o.useState)(()=>new Set(t)),c=(0,o.useCallback)(e=>{s(t=>{const r=new Set(t);return r.has(e)?r.delete(e):(n||r.clear(),r.add(e)),r})},[n]),i=(0,o.useCallback)(e=>{s(t=>{if(t.has(e))return t;const r=n?new Set(t):new Set;return r.add(e),r})},[n]),u=(0,o.useCallback)(e=>{s(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),l=(0,o.useCallback)(()=>{n&&s(new Set(e))},[e,n]),a=(0,o.useCallback)(()=>s(new Set),[]),d=(0,o.useCallback)(()=>{s(t=>e.every(e=>t.has(e))?new Set:new Set(e))},[e]),p=e.length>0&&e.every(e=>r.has(e)),f=e.some(e=>r.has(e)),w=(0,o.useMemo)(()=>Array.from(r),[r]);return{selected:r,isSelected:(0,o.useCallback)(e=>r.has(e),[r]),toggle:c,select:i,deselect:u,selectAll:l,deselectAll:a,toggleAll:d,allSelected:p,someSelected:f,selectedCount:r.size,selectedArray:w}},exports.useLocalStorage=function(e,t){const[n,r]=(0,o.useState)(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,(0,o.useCallback)(t=>{r(n=>{const r="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(r))}catch{}return r})},[e]),(0,o.useCallback)(()=>{if(r(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]},exports.useMediaQuery=function(e){const[t,n]=(0,o.useState)(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return(0,o.useEffect)(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),t},exports.useReducedMotion=n.useReducedMotion,exports.useRovingTabIndex=function({count:e,initialIndex:t=0,orientation:n="horizontal",loop:r=!0}){const[s,c]=(0,o.useState)(t),i=(0,o.useRef)([]),u=(0,o.useCallback)(t=>{c(n=>{let o=n+t;return o=r?(o%e+e)%e:Math.max(0,Math.min(e-1,o)),requestAnimationFrame(()=>{i.current[o]?.focus()}),o})},[e,r]);return{focusedIndex:s,setFocusedIndex:c,getItemProps:(0,o.useCallback)(t=>({tabIndex:t===s?0:-1,"data-focused":t===s,onFocus:()=>c(t),onKeyDown:t=>{const r="horizontal"===n||"both"===n,o="vertical"===n||"both"===n;r&&"ArrowRight"===t.key&&(t.preventDefault(),u(1)),r&&"ArrowLeft"===t.key&&(t.preventDefault(),u(-1)),o&&"ArrowDown"===t.key&&(t.preventDefault(),u(1)),o&&"ArrowUp"===t.key&&(t.preventDefault(),u(-1)),"Home"===t.key&&(t.preventDefault(),c(0),requestAnimationFrame(()=>i.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),c(e-1),requestAnimationFrame(()=>i.current[e-1]?.focus()))}}),[s,u,n,e])}},exports.useSSE=function(e){const{url:t,events:n=["message"],withCredentials:r=!1,reconnect:s=!0,reconnectDelay:c=3e3,onOpen:i,onError:u}=e,[l,a]=(0,o.useState)("connecting"),[d,p]=(0,o.useState)(null),[f,w]=(0,o.useState)([]),[x,h]=(0,o.useState)(0),g=(0,o.useRef)(null),y=(0,o.useRef)(null),v=(0,o.useRef)(!0),S=(0,o.useRef)(!1),m=(0,o.useRef)(i),b=(0,o.useRef)(u);m.current=i,b.current=u;const O=(0,o.useCallback)(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),j=(0,o.useCallback)(()=>{if("undefined"==typeof EventSource)return void(v.current&&a("error"));S.current=!1,O(),g.current&&(g.current.close(),g.current=null),v.current&&a("connecting");const e=new EventSource(t,{withCredentials:r});g.current=e,e.onopen=()=>{v.current&&(a("connected"),m.current?.())},e.onerror=e=>{v.current&&(a("error"),b.current?.(e),!S.current&&s&&(O(),y.current=setTimeout(()=>{v.current&&j()},c)))};const o=e=>t=>{if(!v.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const r={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};p({type:r.type,data:r.data,id:r.id}),w(e=>{const t=[...e,r];return t.length>200?t.slice(t.length-200):t}),h(e=>e+1)};for(const t of n)e.addEventListener(t,o(t))},[t,r,s,c,O]),A=(0,o.useCallback)(()=>{S.current=!0,O(),g.current&&(g.current.close(),g.current=null),v.current&&a("closed")},[O]);return(0,o.useEffect)(()=>(v.current=!0,j(),()=>{v.current=!1,S.current=!0,O(),g.current&&(g.current.close(),g.current=null)}),[]),{status:l,lastEvent:d,events:f,connect:j,disconnect:A,eventCount:x}},exports.useThrottle=function(e,t){const[n,r]=(0,o.useState)(e),s=(0,o.useRef)(Date.now());return(0,o.useEffect)(()=>{const n=Date.now(),o=t-(n-s.current);if(!(o<=0)){const t=setTimeout(()=>{s.current=Date.now(),r(e)},o);return()=>clearTimeout(t)}s.current=n,r(e)},[e,t]),n},exports.useTkxForm=r.useTkxForm,exports.useWebSocket=function(e){const{url:t,protocols:n,reconnect:r=!0,reconnectDelay:s=1e3,reconnectAttempts:c=10,heartbeatInterval:i=3e4,heartbeatMessage:u="ping",onOpen:l,onClose:a,onError:d,onMessage:p}=e,[f,w]=(0,o.useState)("disconnected"),[x,h]=(0,o.useState)(null),[g,y]=(0,o.useState)([]),[v,S]=(0,o.useState)(0),[m,b]=(0,o.useState)(null),O=(0,o.useRef)(null),j=(0,o.useRef)(0),A=(0,o.useRef)(null),I=(0,o.useRef)(null),M=(0,o.useRef)(null),D=(0,o.useRef)([]),q=(0,o.useRef)(!0),k=(0,o.useRef)(!1),C=(0,o.useRef)(l),F=(0,o.useRef)(a),E=(0,o.useRef)(d),T=(0,o.useRef)(p);C.current=l,F.current=a,E.current=d,T.current=p;const J=(0,o.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null),I.current&&(clearInterval(I.current),I.current=null)},[]),N=(0,o.useCallback)(e=>{for(;D.current.length>0;){const t=D.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),V=(0,o.useCallback)(()=>{if(O.current&&O.current.readyState===WebSocket.OPEN)return;k.current=!1,J(),q.current&&w("connecting");const e=new WebSocket(t,n);O.current=e,e.onopen=t=>{q.current&&(w("connected"),j.current=0,S(0),C.current?.(t),N(e),I.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){M.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:M.current}))}catch{}}},i))},e.onmessage=e=>{if(!q.current)return;let t;try{t=JSON.parse(e.data)}catch{t=e.data}const n=t;if(n&&"object"==typeof n&&"pong"===n.type&&"number"==typeof n.t)b(Date.now()-n.t);else{if(t===u&&null!==M.current)return b(Date.now()-M.current),void(M.current=null);h(t),y(e=>{const n=[...e,t];return n.length>100?n.slice(n.length-100):n}),T.current?.(t)}},e.onerror=e=>{q.current&&(w("error"),E.current?.(e))},e.onclose=e=>{if(q.current&&(J(),w("disconnected"),F.current?.(e),!k.current&&r&&j.current<c)){const e=j.current,t=s*Math.pow(1.5,e);j.current+=1,S(j.current),A.current=setTimeout(()=>{q.current&&V()},t)}}},[t,n,r,s,c,i,u,J,N]),W=(0,o.useCallback)(()=>{k.current=!0,J(),O.current&&(O.current.close(),O.current=null),q.current&&w("disconnected")},[J]),z=(0,o.useCallback)(e=>{O.current&&O.current.readyState===WebSocket.OPEN?O.current.send("string"==typeof e?e:JSON.stringify(e)):D.current.push(e)},[]);return(0,o.useEffect)(()=>(q.current=!0,V(),()=>{q.current=!1,k.current=!0,J(),O.current&&(O.current.close(),O.current=null)}),[]),{status:f,lastMessage:x,messages:g,send:z,connect:V,disconnect:W,reconnectCount:v,latency:m}};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./chunk-DmRB1Blb.js");const e=require("./chunk-BpuJ3-K8.js"),t=require("./chunk-D7-yknXg.js"),n=require("./chunk-C8Wy8P59.js"),r=require("./chunk-VUD-TF9j.js");let o=require("react");exports.contrastRatio=e.contrastRatio,exports.cssVar=e.cssVar,exports.cx=t.cx,exports.extractAtomicCSS=t.extractAtomicCSS,exports.extractCSS=e.extractCSS,exports.injectStyles=e.injectStyles,exports.meetsAA=e.meetsAA,exports.meetsAAA=e.meetsAAA,exports.resetAtomicCSS=t.resetAtomicCSS,exports.resetStyles=e.resetStyles,exports.sanitizeProps=t.sanitizeProps,exports.sanitizeString=t.sanitizeString,exports.tkxListPlugins=t.tkxListPlugins,exports.tkxPlugin=t.tkxPlugin,exports.tkxRemovePlugin=t.tkxRemovePlugin,exports.useAnnounce=n.useAnnounce,exports.useClickOutside=n.useClickOutside,exports.useControllable=function({value:e,onChange:t,defaultValue:n}){const r=void 0!==e,[s,c]=(0,o.useState)(n),i=(0,o.useRef)(t);i.current=t;const u=(0,o.useCallback)(e=>{r||c(e),i.current?.(e)},[r]);return[r?e:s,u]},exports.useDebounce=function(e,t){const[n,r]=(0,o.useState)(e);return(0,o.useEffect)(()=>{const n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n},exports.useDisclosure=function(e=!1){const[t,n]=(0,o.useState)(e);return{isOpen:t,open:(0,o.useCallback)(()=>n(!0),[]),close:(0,o.useCallback)(()=>n(!1),[]),toggle:(0,o.useCallback)(()=>n(e=>!e),[])}},exports.useEscapeKey=n.useEscapeKey,exports.useFocusTrap=n.useFocusTrap,exports.useFormState=function({initialValues:e,validate:t}){const[n,r]=(0,o.useState)({...e}),[s,c]=(0,o.useState)({}),[i,u]=(0,o.useState)({}),l=(0,o.useRef)(e),a=(0,o.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),d=(0,o.useCallback)(e=>{r(t=>({...t,...e}))},[]),p=(0,o.useCallback)(e=>{u(t=>({...t,[e]:!0}))},[]),f=(0,o.useCallback)(()=>{if(!t)return!0;const e=t(n),r=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e));return c(r),u(Object.fromEntries(Object.keys(n).map(e=>[e,!0]))),0===Object.keys(r).length},[n,t]),w=(0,o.useCallback)(()=>{r({...l.current}),c({}),u({})},[]);return{values:n,errors:s,touched:i,dirty:Object.keys(n).some(e=>n[e]!==l.current[e]),isValid:0===Object.keys(s).length,setValue:a,setValues:d,touchField:p,validate:f,reset:w,getFieldProps:(0,o.useCallback)(e=>({value:n[e],onChange:t=>{a(e,t.target.value)},onBlur:()=>p(e),"aria-invalid":!(!i[e]||!s[e])||void 0,"aria-describedby":s[e]?`${String(e)}-error`:void 0}),[n,s,i,a,p])}},exports.useHighContrast=n.useHighContrast,exports.useInfiniteQuery=function(e){const{queryFn:t,initialCursor:n=null,enabled:r=!0,dedupKey:s}=e,[c,i]=(0,o.useState)([]),[u,l]=(0,o.useState)("idle"),[a,d]=(0,o.useState)(null),[p,f]=(0,o.useState)(!1),[w,x]=(0,o.useState)(0),h=(0,o.useRef)(n??null),g=(0,o.useRef)(!1),y=(0,o.useRef)(!0),v=(0,o.useRef)(void 0),S=(0,o.useRef)(t);S.current=t;const m=(0,o.useCallback)(async(e,t,n)=>{if(g.current)return;if(void 0!==s&&s===v.current)return;g.current=!0;let r=!1;y.current&&(l(n?"loading":"fetching-more"),d(null));try{const o=await S.current(e,t);if(r||!y.current)return;void 0!==s&&(v.current=s),h.current=o.nextCursor,i(e=>n?[o.data]:[...e,o.data]),f(o.hasMore),x(t),l("success")}catch(o){if(r||!y.current)return;d(o instanceof Error?o:new Error(String(o))),l("error")}finally{r||(g.current=!1)}return()=>{r=!0}},[s]),b=(0,o.useCallback)(()=>{p&&!g.current&&m(h.current,w+1,!1)},[p,w,m]),O=(0,o.useCallback)(()=>{g.current=!1,v.current=void 0,h.current=n??null,i([]),l("idle"),d(null),f(!1),x(0)},[n]);(0,o.useEffect)(()=>(y.current=!0,r&&m(n??null,0,!0),()=>{y.current=!1}),[r]);const j=c.flat();return{data:j,pages:c,status:u,error:a,hasMore:p,isFetchingMore:"fetching-more"===u,fetchMore:b,reset:O,pageIndex:w,totalLoaded:j.length}},exports.useIntersectionObserver=function({threshold:e=0,rootMargin:t="0px",root:n=null,once:r=!1}={}){const s=(0,o.useRef)(null),[c,i]=(0,o.useState)(null),u=(0,o.useRef)(null);return(0,o.useEffect)(()=>{const o=s.current;if(o&&"undefined"!=typeof IntersectionObserver)return u.current=new IntersectionObserver(([e])=>{i(e),r&&e.isIntersecting&&u.current?.unobserve(o)},{threshold:e,rootMargin:t,root:n}),u.current.observe(o),()=>u.current?.disconnect()},[e,t,n,r]),{ref:s,isIntersecting:c?.isIntersecting??!1,entry:c}},exports.useListSelection=function({items:e,initialSelected:t=[],multiple:n=!0}){const[r,s]=(0,o.useState)(()=>new Set(t)),c=(0,o.useCallback)(e=>{s(t=>{const r=new Set(t);return r.has(e)?r.delete(e):(n||r.clear(),r.add(e)),r})},[n]),i=(0,o.useCallback)(e=>{s(t=>{if(t.has(e))return t;const r=n?new Set(t):new Set;return r.add(e),r})},[n]),u=(0,o.useCallback)(e=>{s(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),l=(0,o.useCallback)(()=>{n&&s(new Set(e))},[e,n]),a=(0,o.useCallback)(()=>s(new Set),[]),d=(0,o.useCallback)(()=>{s(t=>e.every(e=>t.has(e))?new Set:new Set(e))},[e]),p=e.length>0&&e.every(e=>r.has(e)),f=e.some(e=>r.has(e)),w=(0,o.useMemo)(()=>Array.from(r),[r]);return{selected:r,isSelected:(0,o.useCallback)(e=>r.has(e),[r]),toggle:c,select:i,deselect:u,selectAll:l,deselectAll:a,toggleAll:d,allSelected:p,someSelected:f,selectedCount:r.size,selectedArray:w}},exports.useLocalStorage=function(e,t){const[n,r]=(0,o.useState)(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,(0,o.useCallback)(t=>{r(n=>{const r="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(r))}catch{}return r})},[e]),(0,o.useCallback)(()=>{if(r(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]},exports.useMediaQuery=function(e){const[t,n]=(0,o.useState)(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return(0,o.useEffect)(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),t},exports.useReducedMotion=n.useReducedMotion,exports.useRovingTabIndex=function({count:e,initialIndex:t=0,orientation:n="horizontal",loop:r=!0}){const[s,c]=(0,o.useState)(t),i=(0,o.useRef)([]),u=(0,o.useCallback)(t=>{c(n=>{let o=n+t;return o=r?(o%e+e)%e:Math.max(0,Math.min(e-1,o)),requestAnimationFrame(()=>{i.current[o]?.focus()}),o})},[e,r]);return{focusedIndex:s,setFocusedIndex:c,getItemProps:(0,o.useCallback)(t=>({tabIndex:t===s?0:-1,"data-focused":t===s,onFocus:()=>c(t),onKeyDown:t=>{const r="horizontal"===n||"both"===n,o="vertical"===n||"both"===n;r&&"ArrowRight"===t.key&&(t.preventDefault(),u(1)),r&&"ArrowLeft"===t.key&&(t.preventDefault(),u(-1)),o&&"ArrowDown"===t.key&&(t.preventDefault(),u(1)),o&&"ArrowUp"===t.key&&(t.preventDefault(),u(-1)),"Home"===t.key&&(t.preventDefault(),c(0),requestAnimationFrame(()=>i.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),c(e-1),requestAnimationFrame(()=>i.current[e-1]?.focus()))}}),[s,u,n,e])}},exports.useSSE=function(e){const{url:t,events:n=["message"],withCredentials:r=!1,reconnect:s=!0,reconnectDelay:c=3e3,onOpen:i,onError:u}=e,[l,a]=(0,o.useState)("connecting"),[d,p]=(0,o.useState)(null),[f,w]=(0,o.useState)([]),[x,h]=(0,o.useState)(0),g=(0,o.useRef)(null),y=(0,o.useRef)(null),v=(0,o.useRef)(!0),S=(0,o.useRef)(!1),m=(0,o.useRef)(i),b=(0,o.useRef)(u);m.current=i,b.current=u;const O=(0,o.useCallback)(()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),j=(0,o.useCallback)(()=>{if("undefined"==typeof EventSource)return void(v.current&&a("error"));S.current=!1,O(),g.current&&(g.current.close(),g.current=null),v.current&&a("connecting");const e=new EventSource(t,{withCredentials:r});g.current=e,e.onopen=()=>{v.current&&(a("connected"),m.current?.())},e.onerror=e=>{v.current&&(a("error"),b.current?.(e),!S.current&&s&&(O(),y.current=setTimeout(()=>{v.current&&j()},c)))};const o=e=>t=>{if(!v.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const r={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};p({type:r.type,data:r.data,id:r.id}),w(e=>{const t=[...e,r];return t.length>200?t.slice(t.length-200):t}),h(e=>e+1)};for(const t of n)e.addEventListener(t,o(t))},[t,r,s,c,O]),A=(0,o.useCallback)(()=>{S.current=!0,O(),g.current&&(g.current.close(),g.current=null),v.current&&a("closed")},[O]);return(0,o.useEffect)(()=>(v.current=!0,j(),()=>{v.current=!1,S.current=!0,O(),g.current&&(g.current.close(),g.current=null)}),[]),{status:l,lastEvent:d,events:f,connect:j,disconnect:A,eventCount:x}},exports.useThrottle=function(e,t){const[n,r]=(0,o.useState)(e),s=(0,o.useRef)(Date.now());return(0,o.useEffect)(()=>{const n=Date.now(),o=t-(n-s.current);if(!(o<=0)){const t=setTimeout(()=>{s.current=Date.now(),r(e)},o);return()=>clearTimeout(t)}s.current=n,r(e)},[e,t]),n},exports.useTkxForm=r.useTkxForm,exports.useWebSocket=function(e){const{url:t,protocols:n,reconnect:r=!0,reconnectDelay:s=1e3,reconnectAttempts:c=10,heartbeatInterval:i=3e4,heartbeatMessage:u="ping",onOpen:l,onClose:a,onError:d,onMessage:p}=e,[f,w]=(0,o.useState)("disconnected"),[x,h]=(0,o.useState)(null),[g,y]=(0,o.useState)([]),[v,S]=(0,o.useState)(0),[m,b]=(0,o.useState)(null),O=(0,o.useRef)(null),j=(0,o.useRef)(0),A=(0,o.useRef)(null),I=(0,o.useRef)(null),M=(0,o.useRef)(null),D=(0,o.useRef)([]),q=(0,o.useRef)(!0),k=(0,o.useRef)(!1),C=(0,o.useRef)(l),F=(0,o.useRef)(a),E=(0,o.useRef)(d),T=(0,o.useRef)(p);C.current=l,F.current=a,E.current=d,T.current=p;const J=(0,o.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null),I.current&&(clearInterval(I.current),I.current=null)},[]),N=(0,o.useCallback)(e=>{for(;D.current.length>0;){const t=D.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),V=(0,o.useCallback)(()=>{if(O.current&&O.current.readyState===WebSocket.OPEN)return;k.current=!1,J(),q.current&&w("connecting");const e=new WebSocket(t,n);O.current=e,e.onopen=t=>{q.current&&(w("connected"),j.current=0,S(0),C.current?.(t),N(e),I.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){M.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:M.current}))}catch{}}},i))},e.onmessage=e=>{if(!q.current)return;let t;try{t=JSON.parse(e.data)}catch{t=e.data}const n=t;if(n&&"object"==typeof n&&"pong"===n.type&&"number"==typeof n.t)b(Date.now()-n.t);else{if(t===u&&null!==M.current)return b(Date.now()-M.current),void(M.current=null);h(t),y(e=>{const n=[...e,t];return n.length>100?n.slice(n.length-100):n}),T.current?.(t)}},e.onerror=e=>{q.current&&(w("error"),E.current?.(e))},e.onclose=e=>{if(q.current&&(J(),w("disconnected"),F.current?.(e),!k.current&&r&&j.current<c)){const e=j.current,t=s*Math.pow(1.5,e);j.current+=1,S(j.current),A.current=setTimeout(()=>{q.current&&V()},t)}}},[t,n,r,s,c,i,u,J,N]),W=(0,o.useCallback)(()=>{k.current=!0,J(),O.current&&(O.current.close(),O.current=null),q.current&&w("disconnected")},[J]),z=(0,o.useCallback)(e=>{O.current&&O.current.readyState===WebSocket.OPEN?O.current.send("string"==typeof e?e:JSON.stringify(e)):D.current.push(e)},[]);return(0,o.useEffect)(()=>(q.current=!0,V(),()=>{q.current=!1,k.current=!0,J(),O.current&&(O.current.close(),O.current=null)}),[]),{status:f,lastMessage:x,messages:g,send:z,connect:V,disconnect:W,reconnectCount:v,latency:m}};
package/dist/headless.js CHANGED
@@ -1 +1 @@
1
- import{D as e,E as t,b as n,h as o,j as r,k as c,x as s}from"./chunk-PJ50l0JC.js";import{E as i,T as l,c as u,n as a,o as d,r as f,s as w,t as p}from"./chunk-DnCXUUx5.js";import{a as h,i as g,n as m,o as y,r as v,t as S}from"./chunk-B3ph66Zb.js";import{r as b}from"./chunk-Dike2DLU.js";import{useCallback as O,useEffect as j,useMemo as A,useRef as D,useState as I}from"react";function M(e=!1){const[t,n]=I(e);return{isOpen:t,open:O(()=>n(!0),[]),close:O(()=>n(!1),[]),toggle:O(()=>n(e=>!e),[])}}function E({count:e,initialIndex:t=0,orientation:n="horizontal",loop:o=!0}){const[r,c]=I(t),s=D([]),i=O(t=>{c(n=>{let r=n+t;return r=o?(r%e+e)%e:Math.max(0,Math.min(e-1,r)),requestAnimationFrame(()=>{s.current[r]?.focus()}),r})},[e,o]);return{focusedIndex:r,setFocusedIndex:c,getItemProps:O(t=>({tabIndex:t===r?0:-1,"data-focused":t===r,onFocus:()=>c(t),onKeyDown:t=>{const o="horizontal"===n||"both"===n,r="vertical"===n||"both"===n;o&&"ArrowRight"===t.key&&(t.preventDefault(),i(1)),o&&"ArrowLeft"===t.key&&(t.preventDefault(),i(-1)),r&&"ArrowDown"===t.key&&(t.preventDefault(),i(1)),r&&"ArrowUp"===t.key&&(t.preventDefault(),i(-1)),"Home"===t.key&&(t.preventDefault(),c(0),requestAnimationFrame(()=>s.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),c(e-1),requestAnimationFrame(()=>s.current[e-1]?.focus()))}}),[r,i,n,e])}}function k({initialValues:e,validate:t}){const[n,o]=I({...e}),[r,c]=I({}),[s,i]=I({}),l=D(e),u=O((e,t)=>{o(n=>({...n,[e]:t}))},[]),a=O(e=>{o(t=>({...t,...e}))},[]),d=O(e=>{i(t=>({...t,[e]:!0}))},[]),f=O(()=>{if(!t)return!0;const e=t(n),o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e));return c(o),i(Object.fromEntries(Object.keys(n).map(e=>[e,!0]))),0===Object.keys(o).length},[n,t]),w=O(()=>{o({...l.current}),c({}),i({})},[]);return{values:n,errors:r,touched:s,dirty:Object.keys(n).some(e=>n[e]!==l.current[e]),isValid:0===Object.keys(r).length,setValue:u,setValues:a,touchField:d,validate:f,reset:w,getFieldProps:O(e=>({value:n[e],onChange:t=>{u(e,t.target.value)},onBlur:()=>d(e),"aria-invalid":!(!s[e]||!r[e])||void 0,"aria-describedby":r[e]?`${String(e)}-error`:void 0}),[n,r,s,u,d])}}function C({items:e,initialSelected:t=[],multiple:n=!0}){const[o,r]=I(()=>new Set(t)),c=O(e=>{r(t=>{const o=new Set(t);return o.has(e)?o.delete(e):(n||o.clear(),o.add(e)),o})},[n]),s=O(e=>{r(t=>{if(t.has(e))return t;const o=n?new Set(t):/* @__PURE__ */new Set;return o.add(e),o})},[n]),i=O(e=>{r(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),l=O(()=>{n&&r(new Set(e))},[e,n]),u=O(()=>r(/* @__PURE__ */new Set),[]),a=O(()=>{r(t=>e.every(e=>t.has(e))?/* @__PURE__ */new Set:new Set(e))},[e]),d=e.length>0&&e.every(e=>o.has(e)),f=e.some(e=>o.has(e)),w=A(()=>Array.from(o),[o]);return{selected:o,isSelected:O(e=>o.has(e),[o]),toggle:c,select:s,deselect:i,selectAll:l,deselectAll:u,toggleAll:a,allSelected:d,someSelected:f,selectedCount:o.size,selectedArray:w}}function F(e,t){const[n,o]=I(e);return j(()=>{const n=setTimeout(()=>o(e),t);return()=>clearTimeout(n)},[e,t]),n}function T(e,t){const[n,o]=I(e),r=D(Date.now());return j(()=>{const n=Date.now(),c=t-(n-r.current);if(!(c<=0)){const t=setTimeout(()=>{r.current=Date.now(),o(e)},c);return()=>clearTimeout(t)}r.current=n,o(e)},[e,t]),n}function x({value:e,onChange:t,defaultValue:n}){const o=void 0!==e,[r,c]=I(n),s=D(t);s.current=t;const i=O(e=>{o||c(e),s.current?.(e)},[o]);return[o?e:r,i]}function J(e){const[t,n]=I(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return j(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const o=e=>n(e.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[e]),t}function N(e,t){const[n,o]=I(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,O(t=>{o(n=>{const o="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(o))}catch{}return o})},[e]),O(()=>{if(o(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]}function V({threshold:e=0,rootMargin:t="0px",root:n=null,once:o=!1}={}){const r=D(null),[c,s]=I(null),i=D(null);return j(()=>{const c=r.current;if(c&&"undefined"!=typeof IntersectionObserver)return i.current=new IntersectionObserver(([e])=>{s(e),o&&e.isIntersecting&&i.current?.unobserve(c)},{threshold:e,rootMargin:t,root:n}),i.current.observe(c),()=>i.current?.disconnect()},[e,t,n,o]),{ref:r,isIntersecting:c?.isIntersecting??!1,entry:c}}function q(e){const{url:t,protocols:n,reconnect:o=!0,reconnectDelay:r=1e3,reconnectAttempts:c=10,heartbeatInterval:s=3e4,heartbeatMessage:i="ping",onOpen:l,onClose:u,onError:a,onMessage:d}=e,[f,w]=I("disconnected"),[p,h]=I(null),[g,m]=I([]),[y,v]=I(0),[S,b]=I(null),A=D(null),M=D(0),E=D(null),k=D(null),C=D(null),F=D([]),T=D(!0),x=D(!1),J=D(l),N=D(u),V=D(a),q=D(d);J.current=l,N.current=u,V.current=a,q.current=d;const W=O(()=>{E.current&&(clearTimeout(E.current),E.current=null),k.current&&(clearInterval(k.current),k.current=null)},[]),z=O(e=>{for(;F.current.length>0;){const t=F.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),K=O(()=>{if(A.current&&A.current.readyState===WebSocket.OPEN)return;x.current=!1,W(),T.current&&w("connecting");const e=new WebSocket(t,n);A.current=e,e.onopen=t=>{T.current&&(w("connected"),M.current=0,v(0),J.current?.(t),z(e),k.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){C.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:C.current}))}catch{}}},s))},e.onmessage=e=>{if(!T.current)return;let t;try{t=JSON.parse(e.data)}catch{t=e.data}const n=t;if(n&&"object"==typeof n&&"pong"===n.type&&"number"==typeof n.t)b(Date.now()-n.t);else{if(t===i&&null!==C.current)return b(Date.now()-C.current),void(C.current=null);h(t),m(e=>{const n=[...e,t];return n.length>100?n.slice(n.length-100):n}),q.current?.(t)}},e.onerror=e=>{T.current&&(w("error"),V.current?.(e))},e.onclose=e=>{if(T.current&&(W(),w("disconnected"),N.current?.(e),!x.current&&o&&M.current<c)){const e=M.current,t=r*Math.pow(1.5,e);M.current+=1,v(M.current),E.current=setTimeout(()=>{T.current&&K()},t)}}},[t,n,o,r,c,s,i,W,z]),L=O(()=>{x.current=!0,W(),A.current&&(A.current.close(),A.current=null),T.current&&w("disconnected")},[W]),P=O(e=>{A.current&&A.current.readyState===WebSocket.OPEN?A.current.send("string"==typeof e?e:JSON.stringify(e)):F.current.push(e)},[]);return j(()=>(T.current=!0,K(),()=>{T.current=!1,x.current=!0,W(),A.current&&(A.current.close(),A.current=null)}),[]),{status:f,lastMessage:p,messages:g,send:P,connect:K,disconnect:L,reconnectCount:y,latency:S}}function W(e){const{url:t,events:n=["message"],withCredentials:o=!1,reconnect:r=!0,reconnectDelay:c=3e3,onOpen:s,onError:i}=e,[l,u]=I("connecting"),[a,d]=I(null),[f,w]=I([]),[p,h]=I(0),g=D(null),m=D(null),y=D(!0),v=D(!1),S=D(s),b=D(i);S.current=s,b.current=i;const A=O(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),M=O(()=>{if("undefined"==typeof EventSource)return void(y.current&&u("error"));v.current=!1,A(),g.current&&(g.current.close(),g.current=null),y.current&&u("connecting");const e=new EventSource(t,{withCredentials:o});g.current=e,e.onopen=()=>{y.current&&(u("connected"),S.current?.())},e.onerror=e=>{y.current&&(u("error"),b.current?.(e),!v.current&&r&&(A(),m.current=setTimeout(()=>{y.current&&M()},c)))};const s=e=>t=>{if(!y.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const o={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};d({type:o.type,data:o.data,id:o.id}),w(e=>{const t=[...e,o];return t.length>200?t.slice(t.length-200):t}),h(e=>e+1)};for(const t of n)e.addEventListener(t,s(t))},[t,o,r,c,A]),E=O(()=>{v.current=!0,A(),g.current&&(g.current.close(),g.current=null),y.current&&u("closed")},[A]);return j(()=>(y.current=!0,M(),()=>{y.current=!1,v.current=!0,A(),g.current&&(g.current.close(),g.current=null)}),[]),{status:l,lastEvent:a,events:f,connect:M,disconnect:E,eventCount:p}}function z(e){const{queryFn:t,initialCursor:n=null,enabled:o=!0,dedupKey:r}=e,[c,s]=I([]),[i,l]=I("idle"),[u,a]=I(null),[d,f]=I(!1),[w,p]=I(0),h=D(n??null),g=D(!1),m=D(!0),y=D(void 0),v=D(t);v.current=t;const S=O(async(e,t,n)=>{if(g.current)return;if(void 0!==r&&r===y.current)return;g.current=!0;let o=!1;m.current&&(l(n?"loading":"fetching-more"),a(null));try{const c=await v.current(e,t);if(o||!m.current)return;void 0!==r&&(y.current=r),h.current=c.nextCursor,s(e=>n?[c.data]:[...e,c.data]),f(c.hasMore),p(t),l("success")}catch(c){if(o||!m.current)return;a(c instanceof Error?c:new Error(String(c))),l("error")}finally{o||(g.current=!1)}return()=>{o=!0}},[r]),b=O(()=>{d&&!g.current&&S(h.current,w+1,!1)},[d,w,S]),A=O(()=>{g.current=!1,y.current=void 0,h.current=n??null,s([]),l("idle"),a(null),f(!1),p(0)},[n]);j(()=>(m.current=!0,o&&S(n??null,0,!0),()=>{m.current=!1}),[o]);const M=c.flat();return{data:M,pages:c,status:i,error:u,hasMore:d,isFetchingMore:"fetching-more"===i,fetchMore:b,reset:A,pageIndex:w,totalLoaded:M.length}}export{o as contrastRatio,t as cssVar,p as cx,a as extractAtomicCSS,e as extractCSS,c as injectStyles,n as meetsAA,s as meetsAAA,f as resetAtomicCSS,r as resetStyles,l as sanitizeProps,i as sanitizeString,d as tkxListPlugins,w as tkxPlugin,u as tkxRemovePlugin,S as useAnnounce,m as useClickOutside,x as useControllable,F as useDebounce,M as useDisclosure,v as useEscapeKey,g as useFocusTrap,k as useFormState,h as useHighContrast,z as useInfiniteQuery,V as useIntersectionObserver,C as useListSelection,N as useLocalStorage,J as useMediaQuery,y as useReducedMotion,E as useRovingTabIndex,W as useSSE,T as useThrottle,b as useTkxForm,q as useWebSocket};
1
+ import{A as e,D as t,M as n,O as o,S as r,g as c,x as s}from"./chunk-DdHSYetV.js";import{E as i,T as l,c as u,n as a,o as d,r as f,s as w,t as p}from"./chunk-DcVMayoM.js";import{a as g,i as h,n as m,o as y,r as S,t as v}from"./chunk-BHX35YDv.js";import{r as b}from"./chunk-CDGrC2Wo.js";import{useCallback as O,useEffect as A,useMemo as j,useRef as D,useState as I}from"react";function M(e=!1){const[t,n]=I(e);return{isOpen:t,open:O(()=>n(!0),[]),close:O(()=>n(!1),[]),toggle:O(()=>n(e=>!e),[])}}function C({count:e,initialIndex:t=0,orientation:n="horizontal",loop:o=!0}){const[r,c]=I(t),s=D([]),i=O(t=>{c(n=>{let r=n+t;return r=o?(r%e+e)%e:Math.max(0,Math.min(e-1,r)),requestAnimationFrame(()=>{s.current[r]?.focus()}),r})},[e,o]);return{focusedIndex:r,setFocusedIndex:c,getItemProps:O(t=>({tabIndex:t===r?0:-1,"data-focused":t===r,onFocus:()=>c(t),onKeyDown:t=>{const o="horizontal"===n||"both"===n,r="vertical"===n||"both"===n;o&&"ArrowRight"===t.key&&(t.preventDefault(),i(1)),o&&"ArrowLeft"===t.key&&(t.preventDefault(),i(-1)),r&&"ArrowDown"===t.key&&(t.preventDefault(),i(1)),r&&"ArrowUp"===t.key&&(t.preventDefault(),i(-1)),"Home"===t.key&&(t.preventDefault(),c(0),requestAnimationFrame(()=>s.current[0]?.focus())),"End"===t.key&&(t.preventDefault(),c(e-1),requestAnimationFrame(()=>s.current[e-1]?.focus()))}}),[r,i,n,e])}}function E({initialValues:e,validate:t}){const[n,o]=I({...e}),[r,c]=I({}),[s,i]=I({}),l=D(e),u=O((e,t)=>{o(n=>({...n,[e]:t}))},[]),a=O(e=>{o(t=>({...t,...e}))},[]),d=O(e=>{i(t=>({...t,[e]:!0}))},[]),f=O(()=>{if(!t)return!0;const e=t(n),o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e));return c(o),i(Object.fromEntries(Object.keys(n).map(e=>[e,!0]))),0===Object.keys(o).length},[n,t]),w=O(()=>{o({...l.current}),c({}),i({})},[]);return{values:n,errors:r,touched:s,dirty:Object.keys(n).some(e=>n[e]!==l.current[e]),isValid:0===Object.keys(r).length,setValue:u,setValues:a,touchField:d,validate:f,reset:w,getFieldProps:O(e=>({value:n[e],onChange:t=>{u(e,t.target.value)},onBlur:()=>d(e),"aria-invalid":!(!s[e]||!r[e])||void 0,"aria-describedby":r[e]?`${String(e)}-error`:void 0}),[n,r,s,u,d])}}function F({items:e,initialSelected:t=[],multiple:n=!0}){const[o,r]=I(()=>new Set(t)),c=O(e=>{r(t=>{const o=new Set(t);return o.has(e)?o.delete(e):(n||o.clear(),o.add(e)),o})},[n]),s=O(e=>{r(t=>{if(t.has(e))return t;const o=n?new Set(t):/* @__PURE__ */new Set;return o.add(e),o})},[n]),i=O(e=>{r(t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n})},[]),l=O(()=>{n&&r(new Set(e))},[e,n]),u=O(()=>r(/* @__PURE__ */new Set),[]),a=O(()=>{r(t=>e.every(e=>t.has(e))?/* @__PURE__ */new Set:new Set(e))},[e]),d=e.length>0&&e.every(e=>o.has(e)),f=e.some(e=>o.has(e)),w=j(()=>Array.from(o),[o]);return{selected:o,isSelected:O(e=>o.has(e),[o]),toggle:c,select:s,deselect:i,selectAll:l,deselectAll:u,toggleAll:a,allSelected:d,someSelected:f,selectedCount:o.size,selectedArray:w}}function T(e,t){const[n,o]=I(e);return A(()=>{const n=setTimeout(()=>o(e),t);return()=>clearTimeout(n)},[e,t]),n}function k(e,t){const[n,o]=I(e),r=D(Date.now());return A(()=>{const n=Date.now(),c=t-(n-r.current);if(!(c<=0)){const t=setTimeout(()=>{r.current=Date.now(),o(e)},c);return()=>clearTimeout(t)}r.current=n,o(e)},[e,t]),n}function x({value:e,onChange:t,defaultValue:n}){const o=void 0!==e,[r,c]=I(n),s=D(t);s.current=t;const i=O(e=>{o||c(e),s.current?.(e)},[o]);return[o?e:r,i]}function J(e){const[t,n]=I(()=>"undefined"!=typeof window&&window.matchMedia(e).matches);return A(()=>{if("undefined"==typeof window)return;const t=window.matchMedia(e);n(t.matches);const o=e=>n(e.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[e]),t}function N(e,t){const[n,o]=I(()=>{if("undefined"==typeof window)return t;try{const n=window.localStorage.getItem(e);return null!==n?JSON.parse(n):t}catch{return t}});return[n,O(t=>{o(n=>{const o="function"==typeof t?t(n):t;if("undefined"!=typeof window)try{window.localStorage.setItem(e,JSON.stringify(o))}catch{}return o})},[e]),O(()=>{if(o(t),"undefined"!=typeof window)try{window.localStorage.removeItem(e)}catch{}},[e,t])]}function V({threshold:e=0,rootMargin:t="0px",root:n=null,once:o=!1}={}){const r=D(null),[c,s]=I(null),i=D(null);return A(()=>{const c=r.current;if(c&&"undefined"!=typeof IntersectionObserver)return i.current=new IntersectionObserver(([e])=>{s(e),o&&e.isIntersecting&&i.current?.unobserve(c)},{threshold:e,rootMargin:t,root:n}),i.current.observe(c),()=>i.current?.disconnect()},[e,t,n,o]),{ref:r,isIntersecting:c?.isIntersecting??!1,entry:c}}function q(e){const{url:t,protocols:n,reconnect:o=!0,reconnectDelay:r=1e3,reconnectAttempts:c=10,heartbeatInterval:s=3e4,heartbeatMessage:i="ping",onOpen:l,onClose:u,onError:a,onMessage:d}=e,[f,w]=I("disconnected"),[p,g]=I(null),[h,m]=I([]),[y,S]=I(0),[v,b]=I(null),j=D(null),M=D(0),C=D(null),E=D(null),F=D(null),T=D([]),k=D(!0),x=D(!1),J=D(l),N=D(u),V=D(a),q=D(d);J.current=l,N.current=u,V.current=a,q.current=d;const W=O(()=>{C.current&&(clearTimeout(C.current),C.current=null),E.current&&(clearInterval(E.current),E.current=null)},[]),z=O(e=>{for(;T.current.length>0;){const t=T.current.shift();void 0!==t&&e.send("string"==typeof t?t:JSON.stringify(t))}},[]),K=O(()=>{if(j.current&&j.current.readyState===WebSocket.OPEN)return;x.current=!1,W(),k.current&&w("connecting");const e=new WebSocket(t,n);j.current=e,e.onopen=t=>{k.current&&(w("connected"),M.current=0,S(0),J.current?.(t),z(e),E.current=setInterval(()=>{if(e.readyState===WebSocket.OPEN){F.current=Date.now();try{e.send(JSON.stringify({type:"ping",t:F.current}))}catch{}}},s))},e.onmessage=e=>{if(!k.current)return;let t;try{t=JSON.parse(e.data)}catch{t=e.data}const n=t;if(n&&"object"==typeof n&&"pong"===n.type&&"number"==typeof n.t)b(Date.now()-n.t);else{if(t===i&&null!==F.current)return b(Date.now()-F.current),void(F.current=null);g(t),m(e=>{const n=[...e,t];return n.length>100?n.slice(n.length-100):n}),q.current?.(t)}},e.onerror=e=>{k.current&&(w("error"),V.current?.(e))},e.onclose=e=>{if(k.current&&(W(),w("disconnected"),N.current?.(e),!x.current&&o&&M.current<c)){const e=M.current,t=r*Math.pow(1.5,e);M.current+=1,S(M.current),C.current=setTimeout(()=>{k.current&&K()},t)}}},[t,n,o,r,c,s,i,W,z]),L=O(()=>{x.current=!0,W(),j.current&&(j.current.close(),j.current=null),k.current&&w("disconnected")},[W]),P=O(e=>{j.current&&j.current.readyState===WebSocket.OPEN?j.current.send("string"==typeof e?e:JSON.stringify(e)):T.current.push(e)},[]);return A(()=>(k.current=!0,K(),()=>{k.current=!1,x.current=!0,W(),j.current&&(j.current.close(),j.current=null)}),[]),{status:f,lastMessage:p,messages:h,send:P,connect:K,disconnect:L,reconnectCount:y,latency:v}}function W(e){const{url:t,events:n=["message"],withCredentials:o=!1,reconnect:r=!0,reconnectDelay:c=3e3,onOpen:s,onError:i}=e,[l,u]=I("connecting"),[a,d]=I(null),[f,w]=I([]),[p,g]=I(0),h=D(null),m=D(null),y=D(!0),S=D(!1),v=D(s),b=D(i);v.current=s,b.current=i;const j=O(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),M=O(()=>{if("undefined"==typeof EventSource)return void(y.current&&u("error"));S.current=!1,j(),h.current&&(h.current.close(),h.current=null),y.current&&u("connecting");const e=new EventSource(t,{withCredentials:o});h.current=e,e.onopen=()=>{y.current&&(u("connected"),v.current?.())},e.onerror=e=>{y.current&&(u("error"),b.current?.(e),!S.current&&r&&(j(),m.current=setTimeout(()=>{y.current&&M()},c)))};const s=e=>t=>{if(!y.current)return;let n;try{n=JSON.parse(t.data)}catch{n=t.data}const o={type:e,data:n,timestamp:Date.now(),...t.lastEventId?{id:t.lastEventId}:{}};d({type:o.type,data:o.data,id:o.id}),w(e=>{const t=[...e,o];return t.length>200?t.slice(t.length-200):t}),g(e=>e+1)};for(const t of n)e.addEventListener(t,s(t))},[t,o,r,c,j]),C=O(()=>{S.current=!0,j(),h.current&&(h.current.close(),h.current=null),y.current&&u("closed")},[j]);return A(()=>(y.current=!0,M(),()=>{y.current=!1,S.current=!0,j(),h.current&&(h.current.close(),h.current=null)}),[]),{status:l,lastEvent:a,events:f,connect:M,disconnect:C,eventCount:p}}function z(e){const{queryFn:t,initialCursor:n=null,enabled:o=!0,dedupKey:r}=e,[c,s]=I([]),[i,l]=I("idle"),[u,a]=I(null),[d,f]=I(!1),[w,p]=I(0),g=D(n??null),h=D(!1),m=D(!0),y=D(void 0),S=D(t);S.current=t;const v=O(async(e,t,n)=>{if(h.current)return;if(void 0!==r&&r===y.current)return;h.current=!0;let o=!1;m.current&&(l(n?"loading":"fetching-more"),a(null));try{const c=await S.current(e,t);if(o||!m.current)return;void 0!==r&&(y.current=r),g.current=c.nextCursor,s(e=>n?[c.data]:[...e,c.data]),f(c.hasMore),p(t),l("success")}catch(c){if(o||!m.current)return;a(c instanceof Error?c:new Error(String(c))),l("error")}finally{o||(h.current=!1)}return()=>{o=!0}},[r]),b=O(()=>{d&&!h.current&&v(g.current,w+1,!1)},[d,w,v]),j=O(()=>{h.current=!1,y.current=void 0,g.current=n??null,s([]),l("idle"),a(null),f(!1),p(0)},[n]);A(()=>(m.current=!0,o&&v(n??null,0,!0),()=>{m.current=!1}),[o]);const M=c.flat();return{data:M,pages:c,status:i,error:u,hasMore:d,isFetchingMore:"fetching-more"===i,fetchMore:b,reset:j,pageIndex:w,totalLoaded:M.length}}export{c as contrastRatio,t as cssVar,p as cx,a as extractAtomicCSS,o as extractCSS,e as injectStyles,s as meetsAA,r as meetsAAA,f as resetAtomicCSS,n as resetStyles,l as sanitizeProps,i as sanitizeString,d as tkxListPlugins,w as tkxPlugin,u as tkxRemovePlugin,v as useAnnounce,m as useClickOutside,x as useControllable,T as useDebounce,M as useDisclosure,S as useEscapeKey,h as useFocusTrap,E as useFormState,g as useHighContrast,z as useInfiniteQuery,V as useIntersectionObserver,F as useListSelection,N as useLocalStorage,J as useMediaQuery,y as useReducedMotion,C as useRovingTabIndex,W as useSSE,k as useThrottle,b as useTkxForm,q as useWebSocket};