@nice2dev/ui-core 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -0
- package/dist/core/hooks.d.ts +12 -0
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/i18nDictionaries.d.ts.map +1 -1
- package/dist/core/icons.d.ts.map +1 -1
- package/dist/core/useThemeIsDark.d.ts +15 -8
- package/dist/core/useThemeIsDark.d.ts.map +1 -1
- package/dist/index.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1366 -1350
- package/dist/index.mjs.map +1 -1
- package/dist/viewSchema.d.ts +2 -2
- package/dist/viewSchema.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),x=require("react/jsx-runtime"),V=require("@nice2dev/i18n"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),x=require("react/jsx-runtime"),V=require("@nice2dev/i18n"),jo={small:"sm",medium:"md",large:"lg"};function Bo(e,t){return e?jo[e]??e:"md"}function Oo(e){return e==="danger"?"error":e}/**
|
|
2
2
|
* @file themeVariants.ts
|
|
3
3
|
* @description Extended theme variants - radius, shadows, fills, gradients, effects
|
|
4
4
|
*
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @since 2026-03
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const he={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},Ie={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",md:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 2px 4px -2px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",lg:"0 10px 15px -3px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 4px 6px -4px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",xl:"0 20px 25px -5px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 8px 10px -6px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",inner:"inset 0 2px 4px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},rr={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",md:"0 4px 6px -1px var(--nice-overlay-30, rgba(0, 0, 0, 0.3)), 0 2px 4px -2px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",lg:"0 10px 15px -3px var(--nice-overlay-40, rgba(0, 0, 0, 0.4)), 0 4px 6px -4px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",xl:"0 20px 25px -5px var(--nice-overlay-50, rgba(0, 0, 0, 0.5)), 0 8px 10px -6px var(--nice-overlay-40, rgba(0, 0, 0, 0.4))",inner:"inset 0 2px 4px 0 var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},ve={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},He={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function _o(e,t,r){switch(e){case"solid":return{background:t};case"gradient-linear":return{background:`linear-gradient(135deg, ${t} 0%, ${r||te(t,-20)} 100%)`};case"gradient-radial":return{background:`radial-gradient(circle at top left, ${t} 0%, ${r||te(t,-30)} 100%)`};case"glass":return{background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))"};case"frosted":return{background:"var(--nice-overlay-light-70, rgba(255, 255, 255, 0.7))",backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",border:"1px solid var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3))"};case"pattern":return{backgroundImage:`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='${encodeURIComponent(t)}' fill-opacity='0.05'%3E%3Cpath d='M0 0h20L10 10z'/%3E%3C/g%3E%3C/svg%3E")`,backgroundColor:"var(--ntd-bg-surface)"};case"texture":return{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,backgroundBlendMode:"overlay",backgroundColor:t};case"gradient-conic":return{background:`conic-gradient(from 180deg, ${t}, ${r||te(t,-20)}, ${t})`};case"mesh":return{background:`radial-gradient(at 40% 20%, ${t} 0%, transparent 50%), radial-gradient(at 80% 0%, ${r||te(t,30)} 0%, transparent 50%), radial-gradient(at 0% 50%, ${te(t,-20)} 0%, transparent 50%)`,backgroundColor:"var(--ntd-bg-surface, #fff)"};default:return{background:t}}}function ut(e,t){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...r,background:t,boxShadow:"none",border:"none"};case"raised":return{...r,background:t,boxShadow:"0 2px 4px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...r,background:"transparent",border:"none",color:t};case"soft":return{...r,background:`${t}20`,border:"none",color:t};case"gradient":return{...r,background:`linear-gradient(135deg, ${t} 0%, ${te(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...r,background:t,border:"none",boxShadow:`0 4px 0 ${te(t,-30)}, 0 6px 10px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))`,transform:"translateY(-2px)"};case"neumorphic":return{...r,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), -5px -5px 10px var(--nice-overlay-light-80, rgba(255, 255, 255, 0.8))",color:t};case"pill":return{...r,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:t,border:"3px solid var(--nice-text, #000)",boxShadow:"4px 4px 0 var(--nice-text, #000)",borderRadius:"0"};default:return r}}function ft(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, var(--bg-secondary, rgba(255,255,255,0.06)))",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--bg-primary, transparent))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), inset -3px -3px 6px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"pill":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function mt(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",boxShadow:"none"};case"glass":return{...t,background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))",boxShadow:"0 8px 32px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"8px 8px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), -8px -8px 16px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",boxShadow:"none"};case"paper":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"2px 3px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"2px"};default:return t}}function ar(e,t){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...r,background:t,color:"var(--nice-bg, #fff)",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:t,color:"var(--nice-bg, #fff)",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${t}, ${te(t,-20)})`,color:"var(--nice-bg, #fff)",padding:"2px 8px",borderRadius:"4px"};default:return r}}function nr(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"var(--nice-bg, #fff)",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function sr(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function or(e){switch(e){case"dark":return{background:"var(--nice-text, #1f2937)",color:"var(--nice-bg-secondary, #f9fafb)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))"};case"light":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",border:"1px solid var(--nice-border, #e5e7eb)"};case"primary":return{background:"var(--color-primary,#6366f1)",color:"var(--nice-bg, #fff)",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",backdropFilter:"blur(12px)",color:"var(--nice-bg, #fff)",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--color-primary,#6366f1)"};default:return{}}}function ir(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const K={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},$e={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function pt(e,t=":root"){const r=he[e.radius],a=e.shadow,n=ve[e.density],s=He[e.animation],i=[`${t} {`];for(const[o,l]of Object.entries(r))i.push(` --ntd-radius-${o}: ${l};`);i.push(` --ntd-shadow: ${Ie[a]};`),i.push(` --ntd-shadow-dark: ${rr[a]};`);for(const[o,l]of Object.entries(n)){const d=o.replace(/([A-Z])/g,"-$1").toLowerCase();i.push(` --ntd-${d}: ${l};`)}for(const[o,l]of Object.entries(s)){const d=o.replace(/([A-Z])/g,"-$1").toLowerCase();i.push(` --ntd-animation-${d}: ${l};`)}return e.backgroundImage&&i.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&i.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),i.push("}"),i.join(`
|
|
11
|
-
`)}function gt(e,t=document.documentElement,r){const a=r?`[data-ntd-provider="${r}"]`:":root",n=r?`ntd-variant-styles-${r}`:"ntd-variant-styles",s=pt(e,a);let i=document.getElementById(n);i||(i=document.createElement("style"),i.id=n,document.head.appendChild(i)),i.textContent=s,r&&t.setAttribute("data-ntd-provider",r),t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function cr(e,t){const r=document.getElementById(`ntd-variant-styles-${e}`);r&&r.remove(),t&&t.removeAttribute("data-ntd-provider")}function te(e,t){if(e.startsWith("#")){const r=e.slice(1),a=parseInt(r,16),n=Math.max(0,Math.min(255,(a>>16&255)+t)),s=Math.max(0,Math.min(255,(a>>8&255)+t)),i=Math.max(0,Math.min(255,(a&255)+t));return`#${(n<<16|s<<8|i).toString(16).padStart(6,"0")}`}return e}function Wo(e,t){const r={...K,...t};return{...e,variantConfig:r}}const Vo=["default","minimal","rounded","sharp","glass","neumorphic","playful","enterprise","modern3d","brutalist","luxe","pill","flat","editorial","dashboard","softCloud","cosmic","corporate","bank","government","military","legal","medical","swiss","scandinavian","bauhaus","notebook","origami","watercolor","monochrome","paper","zen","terminal","hacker","retro8bit","synthwave","cyberpunk","steampunk","vapor","neon","windows95","material","fluent","cupertino","ant","bootstrap","chakra","notion","linear","vercel","candy","bubblegum","cartoon","kawaii","circus","gaming","kiddo","disco","clown"];function be(e){return e==="default"?K:$e[e]??K}const Be=c.createContext({displayStyle:"default",variantConfig:K,setDisplayStyle:()=>{}});function Xo(){return c.useContext(Be)}function Se(e){const t=c.useContext(Be),r=e??t.displayStyle??"default",a=be(r);return{style:r,config:a}}function Uo(e,t,r="var(--color-primary, #6366f1)"){const{config:a}=Se(t);return lr(e,a,r)}function qo(e,t){const{config:r}=Se(t);switch(e){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function Go(e){const{config:t}=Se(e),r=ve[t.density];return{"--ntd-padding-x":r.paddingX,"--ntd-padding-y":r.paddingY,"--ntd-gap":r.gap,"--ntd-font-size":r.fontSize,"--ntd-line-height":r.lineHeight,"--ntd-input-height":r.inputHeight,"--ntd-button-height":r.buttonHeight}}function Ko(e){const{config:t}=Se(e),r=He[t.animation];return{"--ntd-anim-duration":r.duration,"--ntd-anim-easing":r.easing,"--ntd-hover-scale":r.hoverScale,"--ntd-click-scale":r.clickScale}}function lr(e,t,r="var(--nice-info, #6366f1)"){switch(e){case"button":return ut(t.buttonStyle,r);case"input":return ft(t.inputStyle);case"card":return mt(t.cardStyle);case"badge":return ar(t.badgeStyle??"solid",r);case"tab":return nr(t.tabStyle??"underline",r);case"toggle":return sr(t.toggleStyle??"default");case"tooltip":return or(t.tooltipStyle??"dark");case"table":return ir(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function dr(e){const t=be(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}const Jo=[{name:"default",label:"Default",description:"Standard balanced look",density:"normal",animation:"normal"},{name:"minimal",label:"Minimal",description:"Subtle shadows, underlined inputs",density:"normal",animation:"subtle"},{name:"rounded",label:"Rounded",description:"Large radii, pill tabs, filled inputs",density:"comfortable",animation:"normal"},{name:"sharp",label:"Sharp",description:"Zero radius, bordered cards, compact",density:"compact",animation:"subtle"},{name:"glass",label:"Glass",description:"Glassmorphism with frosted backdrops",density:"normal",animation:"normal"},{name:"neumorphic",label:"Neumorphic",description:"Soft raised and sunken surfaces",density:"comfortable",animation:"subtle"},{name:"playful",label:"Playful",description:"Gradients, bouncy animations, colorful",density:"comfortable",animation:"playful"},{name:"enterprise",label:"Enterprise",description:"Conservative, outlined, striped tables",density:"compact",animation:"subtle"},{name:"modern3d",label:"Modern 3D",description:"Deep shadows, 3D buttons, elevated",density:"normal",animation:"normal"},{name:"brutalist",label:"Brutalist",description:"Raw bold borders, no radius, no shadow",density:"normal",animation:"none"},{name:"luxe",label:"Luxe",description:"Premium feel with gradients and depth",density:"comfortable",animation:"normal"},{name:"pill",label:"Pill",description:"Full-radius pill shapes everywhere",density:"normal",animation:"normal"},{name:"flat",label:"Flat",description:"No shadows, filled inputs, soft badges",density:"normal",animation:"subtle"},{name:"editorial",label:"Editorial",description:"Clean typographic, paper cards",density:"comfortable",animation:"subtle"},{name:"dashboard",label:"Dashboard",description:"Data-dense, enclosed tabs, striped",density:"compact",animation:"subtle"},{name:"softCloud",label:"Soft Cloud",description:"Frosted glass, soft iOS-style toggles",density:"comfortable",animation:"normal"},{name:"cosmic",label:"Cosmic",description:"Mesh backgrounds, glowing shadows",density:"comfortable",animation:"dramatic"},{name:"corporate",label:"Corporate",description:"Safe, grey, no flair — boardroom ready",density:"compact",animation:"none"},{name:"bank",label:"Bank",description:"Ultra-conservative, heavy borders",density:"compact",animation:"none"},{name:"government",label:"Government",description:"Accessible, high-contrast, minimal",density:"normal",animation:"none"},{name:"military",label:"Military",description:"Dark, angular, no-nonsense tactical",density:"compact",animation:"none"},{name:"legal",label:"Legal",description:"Typographic, paper-like, document feel",density:"comfortable",animation:"none"},{name:"medical",label:"Medical",description:"Clean clinical, professional blue-toned",density:"normal",animation:"subtle"},{name:"swiss",label:"Swiss",description:"Grid-based, Helvetica spirit, precision",density:"normal",animation:"subtle"},{name:"scandinavian",label:"Scandinavian",description:"Warm, spacious, hygge-inspired calm",density:"spacious",animation:"subtle"},{name:"bauhaus",label:"Bauhaus",description:"Geometric, primary colours, strong lines",density:"normal",animation:"none"},{name:"notebook",label:"Notebook",description:"Handwritten feel, paper textures, ruled",density:"comfortable",animation:"subtle"},{name:"origami",label:"Origami",description:"Folded paper, subtle shadows, layered",density:"normal",animation:"normal"},{name:"watercolor",label:"Watercolor",description:"Soft bleeding edges, artistic, dreamy",density:"comfortable",animation:"normal"},{name:"monochrome",label:"Monochrome",description:"Pure black & white, typography focus",density:"normal",animation:"none"},{name:"paper",label:"Paper",description:"Minimal white, subtle shadows, like stationery",density:"comfortable",animation:"subtle"},{name:"zen",label:"Zen",description:"Ultra-minimal, whitespace, meditative calm",density:"spacious",animation:"subtle"},{name:"terminal",label:"Terminal",description:"Monospace, dark, retro-computing green",density:"compact",animation:"none"},{name:"hacker",label:"Hacker",description:"Matrix-style, neon green on black",density:"compact",animation:"subtle"},{name:"retro8bit",label:"8-bit Retro",description:"Pixel art, chunky borders, game boy era",density:"normal",animation:"none"},{name:"synthwave",label:"Synthwave",description:"80s synth, neon grids, chrome gradients",density:"normal",animation:"dramatic"},{name:"cyberpunk",label:"Cyberpunk",description:"Angular, neon, glitch aesthetics, dark",density:"compact",animation:"dramatic"},{name:"steampunk",label:"Steampunk",description:"Brass, gears, Victorian-era technology",density:"normal",animation:"subtle"},{name:"vapor",label:"Vaporwave",description:"80s/90s aesthetics, pink/teal gradients",density:"comfortable",animation:"playful"},{name:"neon",label:"Neon",description:"Bright glowing outlines on dark surfaces",density:"normal",animation:"dramatic"},{name:"windows95",label:"Windows 95",description:"Chunky beveled 3D, classic OS nostalgia",density:"compact",animation:"none"},{name:"material",label:"Material",description:"Google Material Design — depth & motion",density:"normal",animation:"normal"},{name:"fluent",label:"Fluent",description:"Microsoft Fluent — acrylic, reveal, depth",density:"normal",animation:"subtle"},{name:"cupertino",label:"Cupertino",description:"Apple iOS/macOS style — frosted, rounded",density:"comfortable",animation:"normal"},{name:"ant",label:"Ant Design",description:"Ant Design — clean, reliable, professional",density:"normal",animation:"subtle"},{name:"bootstrap",label:"Bootstrap",description:"Bootstrap-like — rounded, striped tables",density:"normal",animation:"subtle"},{name:"chakra",label:"Chakra",description:"Chakra UI — accessible, clean, modern",density:"normal",animation:"normal"},{name:"notion",label:"Notion",description:"Notion-like — text-focused, minimal chrome",density:"normal",animation:"subtle"},{name:"linear",label:"Linear",description:"Linear app — sleek, dark, polished",density:"compact",animation:"subtle"},{name:"vercel",label:"Vercel",description:"Vercel/Next.js — black/white, sharp, modern",density:"normal",animation:"subtle"},{name:"candy",label:"Candy",description:"Sweet pastels, rounded, sugar rush!",density:"comfortable",animation:"playful"},{name:"bubblegum",label:"Bubblegum",description:"Pink puffy bubbles, extremely round",density:"spacious",animation:"playful"},{name:"cartoon",label:"Cartoon",description:"Thick outlines, bold colours, exaggerated",density:"comfortable",animation:"playful"},{name:"kawaii",label:"Kawaii",description:"Cute, pastel, sparkly, UwU aesthetic",density:"spacious",animation:"dramatic"},{name:"circus",label:"Circus",description:"Bold stripes, loud, step right up!",density:"spacious",animation:"dramatic"},{name:"gaming",label:"Gaming",description:"Dark, neon accents, angular, RGB everything",density:"normal",animation:"dramatic"},{name:"kiddo",label:"Kiddo",description:"Colourful, puffy, child-friendly, big touch",density:"spacious",animation:"playful"},{name:"disco",label:"Disco",description:"Flashing, spinning, Saturday night fever 🕺",density:"comfortable",animation:"dramatic"},{name:"clown",label:"Clown",description:"Maximum chaos, honk honk, pure madness 🤡",density:"spacious",animation:"dramatic"}];function Yo({enabled:e,readOnly:t,disabled:r}){const[a,n]=c.useState(!1),s=c.useRef(!1),i=c.useCallback(()=>{t||r||!e||(s.current=!0,n(!0))},[t,r,e]),o=c.useCallback(()=>{n(!1)},[]),l=c.useCallback(d=>{d&&s.current&&(s.current=!1,requestAnimationFrame(()=>{if(d.focus(),d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)try{d.select()}catch{}}))},[]);return c.useEffect(()=>{(t||r)&&a&&n(!1)},[t,r,a]),{isDisplay:!!e&&!a,enterEdit:i,exitEdit:o,autoFocusRef:l}}const Qo=({value:e,placeholder:t,disabled:r,readOnly:a,onActivate:n,className:s,ariaLabel:i})=>{const o=e==null||e==="",l=d=>{r||a||(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())};return x.jsx("span",{role:"button",tabIndex:r?-1:0,className:`nice-display-value ${o?"nice-display-value--empty":""} ${r?"nice-display-value--disabled":""} ${a?"nice-display-value--readonly":""} ${s||""}`.trim(),onClick:()=>{!r&&!a&&n()},onKeyDown:l,"aria-label":i,"aria-disabled":r||void 0,children:o?t??"—":e})};function Zo(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}function ei(e){const t=e.trim().toLowerCase();return!!(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:")||t.startsWith("data:image/")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))}const ur={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",hash:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",circle:"M12 21a9 9 0 100-18 9 9 0 000 18z",box:"M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",tabs:"M3 9h18v10H3z M7 9V5h6v4",columns:"M4 4h7v16H4z M13 4h7v16h-7z",grid:"M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",table:"M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",heading:"M6 4v16M18 4v16M6 12h12",type:"M4 7V4h16v3M9 20h6M12 4v16","align-left":"M3 6h18M3 12h12M3 18h15",input:"M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",button:"M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",select:"M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3","check-square":"M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",video:"M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",card:"M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18","bar-chart":"M6 20v-6M12 20V4M18 20v-10",globe:"M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",monitor:"M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",camera:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",plug:"M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",save:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",tag:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",palette:"M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",book:"M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",cloud:"M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",target:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",message:"M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",flask:"M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",rocket:"M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",music:"M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",wifi:"M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",database:"M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",slash:"M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",puzzle:"M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",dollar:"M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",printer:"M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",scale:"M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",accessibility:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",window:"M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01","map-pin":"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",cursor:"M5 3l14 7-6 2-2 6-6-15z",shuffle:"M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",lightbulb:"M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",server:"M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",terminal:"M4 17l6-6-6-6 M12 19h8",send:"M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",mic:"M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",briefcase:"M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",building:"M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",medal:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",clipboard:"M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2","skip-forward":"M5 4l10 8-10 8V4zM19 5v14","at-sign":"M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",gift:"M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",archive:"M21 8v13H3V8M1 3h22v5H1zM10 12h4",reply:"M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",forward:"M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",paperclip:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",zap:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",square:"M4 4h16v16H4z",triangle:"M12 4L3 20h18z",hexagon:"M7.5 3h9l4.5 9-4.5 9h-9L3 12z",line:"M5 19L19 5",pen:"M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",brush:"M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",droplet:"M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",bucket:"M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",scissors:"M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",layers:"M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",crop:"M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",eyedropper:"M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",ruler:"M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",wand:"M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",move:"M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",gamepad:"M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",eraser:"M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",thermometer:"M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",door:"M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",stairs:"M3 20h3v-3h3v-3h3v-3h3v-3h3",elevator:"M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",bed:"M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",sofa:"M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",chair:"M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",utensils:"M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",mountain:"M8 3l4 8 5-5 5 15H2L8 3z",tree:"M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",sun:"M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",moon:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"},ti={xs:12,sm:16,md:20,lg:24,xl:32},yt=c.createContext({}),ri=({resolver:e,children:t})=>c.createElement(yt.Provider,{value:{resolver:e}},t);function ai({path:e,size:t,className:r,style:a,color:n,title:s,onClick:i}){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${r||""}`,style:a,role:s?"img":"presentation","aria-label":s,"aria-hidden":!s,onClick:i,children:[s&&x.jsx("title",{children:s}),x.jsx("path",{d:e})]})}const fr=({name:e,size:t="md",className:r,style:a,color:n,title:s,onClick:i})=>{const{resolver:o}=c.useContext(yt),l=typeof t=="number"?t:ti[t];if(o){const u=o(e,l);if(u)return x.jsx("span",{className:`nice-icon-wrap ${r||""}`,style:a,onClick:i,children:u})}const d=ur[e];return d?x.jsx(ai,{path:d,size:l,className:r,style:a,color:n,title:s,onClick:i}):null};function ni(){const{resolver:e}=c.useContext(yt);return{renderIcon:c.useCallback((r,a="md")=>r==null?null:typeof r!="string"?r:c.createElement(fr,{name:r,size:a}),[e])}}const si=Object.keys(ur);function oi(){const[e,t]=c.useState(()=>typeof window<"u"?window.matchMedia("(pointer: coarse)").matches:!1);return c.useEffect(()=>{const r=window.matchMedia("(pointer: coarse)");t(r.matches);const a=n=>t(n.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function ii(){const[e,t]=c.useState(()=>typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches?"touch":"mouse");return c.useEffect(()=>{const r=()=>t("touch"),a=n=>{n.pointerType==="mouse"&&t("mouse")};return window.addEventListener("touchstart",r,{passive:!0,capture:!0}),window.addEventListener("pointerdown",a,{capture:!0}),()=>{window.removeEventListener("touchstart",r,{capture:!0}),window.removeEventListener("pointerdown",a,{capture:!0})}},[]),e}function ci(e,t=500){const r=c.useRef(null),a=c.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]);return{onPointerDown:c.useCallback(s=>{s.pointerType==="touch"&&(a(),r.current=setTimeout(e,t))},[e,t,a]),onPointerUp:a,onPointerCancel:a}}function li(e){const t=c.useId();return e||t}function di(e,t){const[r,a]=c.useState(e);return c.useEffect(()=>{const n=setTimeout(()=>a(e),t);return()=>clearTimeout(n)},[e,t]),r}function ui(e,t){c.useEffect(()=>{const r=a=>{!e.current||e.current.contains(a.target)||t()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function fi(e,t){c.useEffect(()=>{if(!t||!e.current)return;const r=e.current,a=document.activeElement,n=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=n[0],i=n[n.length-1],o=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===s&&(l.preventDefault(),i==null||i.focus()):document.activeElement===i&&(l.preventDefault(),s==null||s.focus()))};return s==null||s.focus(),r.addEventListener("keydown",o),()=>{var l;r.removeEventListener("keydown",o),(l=a==null?void 0:a.focus)==null||l.call(a)}},[e,t])}function mi(e={}){const{defaultMode:t="system",storageKey:r="nice-color-mode",darkClass:a="nice-dark",lightClass:n="nice-light"}=e,[s,i]=c.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),[o,l]=c.useState(()=>{if(typeof window>"u")return t;const m=localStorage.getItem(r);return m==="light"||m==="dark"||m==="system"?m:t});c.useEffect(()=>{const m=window.matchMedia("(prefers-color-scheme: dark)"),y=p=>i(p.matches?"dark":"light");return m.addEventListener("change",y),()=>m.removeEventListener("change",y)},[]);const d=o==="system"?s==="dark":o==="dark";c.useEffect(()=>{const m=document.documentElement;return d?(m.classList.add(a),m.classList.remove(n)):(m.classList.add(n),m.classList.remove(a)),()=>{m.classList.remove(a,n)}},[d,a,n]),c.useEffect(()=>{localStorage.setItem(r,o)},[o,r]);const u=c.useCallback(()=>l("light"),[]),f=c.useCallback(()=>l("dark"),[]),g=c.useCallback(()=>l("system"),[]),h=c.useCallback(()=>l(m=>m==="system"?s==="dark"?"light":"dark":m==="dark"?"light":"dark"),[s]);return{isDark:d,mode:o,systemPreference:s,setLight:u,setDark:f,setSystem:g,toggle:h}}function pi(e,t={}){const{colorCount:r=5,quality:a=5}=t,[n,s]=c.useState(null),[i,o]=c.useState(!1),[l,d]=c.useState(null);return c.useEffect(()=>{if(!e){s(null);return}(async()=>{o(!0),d(null);try{let f;typeof e=="string"?(f=new Image,f.crossOrigin="anonymous",await new Promise((M,N)=>{f.onload=()=>M(),f.onerror=()=>N(new Error("Failed to load image")),f.src=e})):f=e;const g=document.createElement("canvas"),h=100,m=Math.min(h/f.width,h/f.height,1);g.width=f.width*m,g.height=f.height*m;const y=g.getContext("2d");if(!y)throw new Error("Canvas context unavailable");y.drawImage(f,0,0,g.width,g.height);const p=y.getImageData(0,0,g.width,g.height),v=[],b=Math.max(1,Math.floor(11-a));for(let M=0;M<p.data.length;M+=4*b){const N=p.data[M],L=p.data[M+1],E=p.data[M+2];if(p.data[M+3]>200){const T=(N+L+E)/3;T>20&&T<235&&v.push([N,L,E])}}if(v.length===0)throw new Error("No valid colors found in image");const w=gi(v,r).sort((M,N)=>{const L=Math.max(...M)-Math.min(...M);return Math.max(...N)-Math.min(...N)-L}),A=M=>"#"+M.map(N=>Math.round(N).toString(16).padStart(2,"0")).join(""),k=M=>(.299*M[0]+.587*M[1]+.114*M[2])/255>.5?"var(--nice-text, #000000)":"var(--nice-bg, #fff)",C=w.slice();s({primary:A(C[0]||[100,100,100]),secondary:A(C[1]||C[0]||[150,150,150]),accent:A(w[0]||[100,100,100]),palette:C.map(A),primaryText:k(C[0]||[100,100,100]),secondaryText:k(C[1]||C[0]||[150,150,150])})}catch(f){d(f instanceof Error?f.message:"Unknown error"),s(null)}finally{o(!1)}})()},[e,r,a]),{colors:n,loading:i,error:l}}function gi(e,t,r=20){if(e.length<=t)return e;const a=[],n=new Set;for(;a.length<t;){const s=Math.floor(Math.random()*e.length);n.has(s)||(n.add(s),a.push([...e[s]]))}for(let s=0;s<r;s++){const i=Array.from({length:t},()=>[]);for(const l of e){let d=1/0,u=0;for(let f=0;f<t;f++){const g=Math.sqrt((l[0]-a[f][0])**2+(l[1]-a[f][1])**2+(l[2]-a[f][2])**2);g<d&&(d=g,u=f)}i[u].push(l)}let o=!1;for(let l=0;l<t;l++){if(i[l].length===0)continue;const d=[0,0,0];for(const u of i[l])d[0]+=u[0],d[1]+=u[1],d[2]+=u[2];d[0]/=i[l].length,d[1]/=i[l].length,d[2]/=i[l].length,(Math.abs(d[0]-a[l][0])>1||Math.abs(d[1]-a[l][1])>1||Math.abs(d[2]-a[l][2])>1)&&(o=!0),a[l]=d}if(!o)break}return a}function yi(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),s=Math.max(r,a,n)/255,i=Math.min(r,a,n)/255;let o=0,l=0;const d=(s+i)/2;if(s!==i){const f=s-i;switch(l=d>.5?f/(2-s-i):f/(s+i),s){case r/255:o=((a/255-n/255)/f+(a<n?6:0))/6;break;case a/255:o=((n/255-r/255)/f+2)/6;break;case n/255:o=((r/255-a/255)/f+4)/6;break}}const u=(f,g,h)=>{const m=(w,A,k)=>(k<0&&(k+=1),k>1&&(k-=1),k<.16666666666666666?w+(A-w)*6*k:k<.5?A:k<.6666666666666666?w+(A-w)*(.6666666666666666-k)*6:w),y=h<.5?h*(1+g):h+g-h*g,p=2*h-y,v=Math.round(m(p,y,f+1/3)*255),b=Math.round(m(p,y,f)*255),S=Math.round(m(p,y,f-1/3)*255);return"#"+[v,b,S].map(w=>w.toString(16).padStart(2,"0")).join("")};return{lightest:u(o,Math.min(l*.3,1),.97),lighter:u(o,Math.min(l*.5,1),.9),light:u(o,Math.min(l*.7,1),.8),base:e,dark:u(o,Math.min(l*1.1,1),Math.max(d-.15,.1)),darker:u(o,Math.min(l*1.2,1),Math.max(d-.25,.05)),darkest:u(o,Math.min(l*1.3,1),Math.max(d-.35,.02)),text:d>.5?"var(--nice-text, #000000)":"var(--nice-bg, #fff)",textInverse:d>.5?"var(--nice-bg, #fff)":"var(--nice-text, #000000)"}}const ue={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},ie=["xs","sm","md","lg","xl","xxl"];function xe(e=ue){const[t,r]=c.useState(()=>typeof window<"u"?window.innerWidth:e.lg);c.useEffect(()=>{let o;const l=()=>{o&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>r(window.innerWidth))};return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),o&&cancelAnimationFrame(o)}},[]);const a=c.useMemo(()=>{for(let o=ie.length-1;o>=0;o--)if(t>=e[ie[o]])return ie[o];return"xs"},[t,e]),n=c.useCallback(o=>t>=e[o],[t,e]),s=c.useCallback(o=>t<e[o],[t,e]),i=c.useCallback((o,l)=>t>=e[o]&&t<e[l],[t,e]);return{current:a,width:t,isAbove:n,isBelow:s,isBetween:i,isMobile:t<e.md,isTablet:t>=e.md&&t<e.lg,isDesktop:t>=e.lg}}function ze(e){const[t,r]=c.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return c.useEffect(()=>{const a=window.matchMedia(e);r(a.matches);const n=s=>r(s.matches);return a.addEventListener("change",n),()=>a.removeEventListener("change",n)},[e]),t}function hi(e,t=ue){const{current:r}=xe(t);return c.useMemo(()=>{if(e==null||typeof e!="object"||Array.isArray(e))return e;const a=e,n=ie.indexOf(r);for(let s=n;s>=0;s--){const i=a[ie[s]];if(i!==void 0)return i}for(let s=n+1;s<ie.length;s++){const i=a[ie[s]];if(i!==void 0)return i}},[e,r])}function bi(e){const[t,r]=c.useState({width:0,height:0});return c.useEffect(()=>{const a=e.current;if(!a)return;const n=new ResizeObserver(([s])=>{const{width:i,height:o}=s.contentRect;r({width:i,height:o})});return n.observe(a),()=>n.disconnect()},[e]),t}function mr(){const{width:e,isMobile:t}=xe(),r=c.useMemo(()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,[]),a=ze("(prefers-reduced-motion: reduce)"),n=ze("(orientation: portrait)"),s=c.useMemo(()=>typeof window>"u"?1:window.devicePixelRatio||1,[]),i=t&&r,o=!t&&e<ue.lg&&r,l=!r||e>=ue.lg;return{isMobile:i||o,isTouch:r,isPhone:i,isTablet:o,isDesktop:l,prefersReducedMotion:a,isPortrait:n,pixelRatio:s}}function vi(e={}){const{forceVariant:t,breakpoints:r=ue}=e,{isMobile:a,isTablet:n,isDesktop:s}=xe(r),i=mr();return t||(i.isPhone?"mobile":i.isTablet?"tablet":i.isDesktop?"desktop":a?"mobile":n?"tablet":"desktop")}function Si(e={}){const{showAt:t,hideAt:r,mobileOnly:a,desktopOnly:n,tabletOnly:s}=e,{current:i,isMobile:o,isTablet:l,isDesktop:d}=xe();return a?o:n?d:s?l:r&&r.includes(i)?!1:t?t.includes(i):!0}function xi(){return ze("(orientation: portrait)")?"portrait":"landscape"}function wi(){const[e,t]=c.useState({top:0,right:0,bottom:0,left:0});return c.useEffect(()=>{if(typeof window>"u"||!CSS.supports("padding-top","env(safe-area-inset-top)"))return;const r=()=>{getComputedStyle(document.documentElement);const a=document.createElement("div");a.style.cssText=`
|
|
10
|
+
*/const he={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},Re={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",md:"0 4px 6px -1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 2px 4px -2px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",lg:"0 10px 15px -3px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 4px 6px -4px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",xl:"0 20px 25px -5px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), 0 8px 10px -6px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",inner:"inset 0 2px 4px 0 var(--nice-overlay-5, rgba(0, 0, 0, 0.05))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},rr={none:"none",subtle:"0 1px 2px 0 var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",md:"0 4px 6px -1px var(--nice-overlay-30, rgba(0, 0, 0, 0.3)), 0 2px 4px -2px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",lg:"0 10px 15px -3px var(--nice-overlay-40, rgba(0, 0, 0, 0.4)), 0 4px 6px -4px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",xl:"0 20px 25px -5px var(--nice-overlay-50, rgba(0, 0, 0, 0.5)), 0 8px 10px -6px var(--nice-overlay-40, rgba(0, 0, 0, 0.4))",inner:"inset 0 2px 4px 0 var(--nice-overlay-30, rgba(0, 0, 0, 0.3))",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},ve={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},Fe={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function _o(e,t,r){switch(e){case"solid":return{background:t};case"gradient-linear":return{background:`linear-gradient(135deg, ${t} 0%, ${r||te(t,-20)} 100%)`};case"gradient-radial":return{background:`radial-gradient(circle at top left, ${t} 0%, ${r||te(t,-30)} 100%)`};case"glass":return{background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))"};case"frosted":return{background:"var(--nice-overlay-light-70, rgba(255, 255, 255, 0.7))",backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",border:"1px solid var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3))"};case"pattern":return{backgroundImage:`url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='${encodeURIComponent(t)}' fill-opacity='0.05'%3E%3Cpath d='M0 0h20L10 10z'/%3E%3C/g%3E%3C/svg%3E")`,backgroundColor:"var(--ntd-bg-surface)"};case"texture":return{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,backgroundBlendMode:"overlay",backgroundColor:t};case"gradient-conic":return{background:`conic-gradient(from 180deg, ${t}, ${r||te(t,-20)}, ${t})`};case"mesh":return{background:`radial-gradient(at 40% 20%, ${t} 0%, transparent 50%), radial-gradient(at 80% 0%, ${r||te(t,30)} 0%, transparent 50%), radial-gradient(at 0% 50%, ${te(t,-20)} 0%, transparent 50%)`,backgroundColor:"var(--ntd-bg-surface, #fff)"};default:return{background:t}}}function dt(e,t){const r={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...r,background:t,boxShadow:"none",border:"none"};case"raised":return{...r,background:t,boxShadow:"0 2px 4px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))",border:"none"};case"outlined":return{...r,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...r,background:"transparent",border:"none",color:t};case"soft":return{...r,background:`${t}20`,border:"none",color:t};case"gradient":return{...r,background:`linear-gradient(135deg, ${t} 0%, ${te(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...r,background:t,border:"none",boxShadow:`0 4px 0 ${te(t,-30)}, 0 6px 10px var(--nice-overlay-20, rgba(0, 0, 0, 0.2))`,transform:"translateY(-2px)"};case"neumorphic":return{...r,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px var(--nice-overlay-10, rgba(0, 0, 0, 0.1)), -5px -5px 10px var(--nice-overlay-light-80, rgba(255, 255, 255, 0.8))",color:t};case"pill":return{...r,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...r,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...r,background:t,border:"3px solid var(--nice-text, #000)",boxShadow:"4px 4px 0 var(--nice-text, #000)",borderRadius:"0"};default:return r}}function ut(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, var(--bg-secondary, rgba(255,255,255,0.06)))",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--bg-primary, transparent))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), inset -3px -3px 6px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"pill":return{...t,background:"var(--ntd-bg-input, var(--bg-primary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function ft(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"1px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",boxShadow:"none"};case"glass":return{...t,background:"var(--nice-overlay-light-10, rgba(255, 255, 255, 0.1))",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))",boxShadow:"0 8px 32px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"8px 8px 16px var(--nice-overlay-20, rgba(0, 0, 0, 0.2)), -8px -8px 16px var(--nice-overlay-light-5, rgba(255, 255, 255, 0.05))"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, var(--border-color, #3a3a3a))",boxShadow:"none"};case"paper":return{...t,background:"var(--ntd-bg-surface, var(--bg-secondary, transparent))",border:"none",boxShadow:"2px 3px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"2px"};default:return t}}function ar(e,t){const r={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...r,background:t,color:"var(--nice-bg, #fff)",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...r,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...r,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...r,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...r,background:t,color:"var(--nice-bg, #fff)",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...r,background:`linear-gradient(135deg, ${t}, ${te(t,-20)})`,color:"var(--nice-bg, #fff)",padding:"2px 8px",borderRadius:"4px"};default:return r}}function nr(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"var(--nice-bg, #fff)",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px var(--nice-overlay-6, rgba(0, 0, 0, 0.06))",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function sr(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function or(e){switch(e){case"dark":return{background:"var(--nice-text, #1f2937)",color:"var(--nice-bg-secondary, #f9fafb)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-30, rgba(0, 0, 0, 0.3))"};case"light":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px var(--nice-overlay-10, rgba(0, 0, 0, 0.1))",border:"1px solid var(--nice-border, #e5e7eb)"};case"primary":return{background:"var(--color-primary,#6366f1)",color:"var(--nice-bg, #fff)",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))",backdropFilter:"blur(12px)",color:"var(--nice-bg, #fff)",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"var(--nice-bg, #fff)",color:"var(--nice-text, #374151)",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--color-primary,#6366f1)"};default:return{}}}function ir(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const K={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},He={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function mt(e,t=":root"){const r=he[e.radius],a=e.shadow,n=ve[e.density],s=Fe[e.animation],i=[`${t} {`];for(const[o,l]of Object.entries(r))i.push(` --ntd-radius-${o}: ${l};`);i.push(` --ntd-shadow: ${Re[a]};`),i.push(` --ntd-shadow-dark: ${rr[a]};`);for(const[o,l]of Object.entries(n)){const d=o.replace(/([A-Z])/g,"-$1").toLowerCase();i.push(` --ntd-${d}: ${l};`)}for(const[o,l]of Object.entries(s)){const d=o.replace(/([A-Z])/g,"-$1").toLowerCase();i.push(` --ntd-animation-${d}: ${l};`)}return e.backgroundImage&&i.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&i.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),i.push("}"),i.join(`
|
|
11
|
+
`)}function pt(e,t=document.documentElement,r){const a=r?`[data-ntd-provider="${r}"]`:":root",n=r?`ntd-variant-styles-${r}`:"ntd-variant-styles",s=mt(e,a);let i=document.getElementById(n);i||(i=document.createElement("style"),i.id=n,document.head.appendChild(i)),i.textContent=s,r&&t.setAttribute("data-ntd-provider",r),t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function cr(e,t){const r=document.getElementById(`ntd-variant-styles-${e}`);r&&r.remove(),t&&t.removeAttribute("data-ntd-provider")}function te(e,t){if(e.startsWith("#")){const r=e.slice(1),a=parseInt(r,16),n=Math.max(0,Math.min(255,(a>>16&255)+t)),s=Math.max(0,Math.min(255,(a>>8&255)+t)),i=Math.max(0,Math.min(255,(a&255)+t));return`#${(n<<16|s<<8|i).toString(16).padStart(6,"0")}`}return e}function Wo(e,t){const r={...K,...t};return{...e,variantConfig:r}}const Vo=["default","minimal","rounded","sharp","glass","neumorphic","playful","enterprise","modern3d","brutalist","luxe","pill","flat","editorial","dashboard","softCloud","cosmic","corporate","bank","government","military","legal","medical","swiss","scandinavian","bauhaus","notebook","origami","watercolor","monochrome","paper","zen","terminal","hacker","retro8bit","synthwave","cyberpunk","steampunk","vapor","neon","windows95","material","fluent","cupertino","ant","bootstrap","chakra","notion","linear","vercel","candy","bubblegum","cartoon","kawaii","circus","gaming","kiddo","disco","clown"];function be(e){return e==="default"?K:He[e]??K}const $e=c.createContext({displayStyle:"default",variantConfig:K,setDisplayStyle:()=>{}});function Xo(){return c.useContext($e)}function Se(e){const t=c.useContext($e),r=e??t.displayStyle??"default",a=be(r);return{style:r,config:a}}function Uo(e,t,r="var(--color-primary, #6366f1)"){const{config:a}=Se(t);return lr(e,a,r)}function qo(e,t){const{config:r}=Se(t);switch(e){case"button":return r.buttonStyle;case"input":return r.inputStyle;case"card":return r.cardStyle;case"badge":return r.badgeStyle??"solid";case"tab":return r.tabStyle??"underline";case"toggle":return r.toggleStyle??"default";case"tooltip":return r.tooltipStyle??"dark";case"modal":return r.modalStyle??"default";case"table":return r.tableStyle??"default";case"menu":return r.menuStyle??"default";default:return"default"}}function Go(e){const{config:t}=Se(e),r=ve[t.density];return{"--ntd-padding-x":r.paddingX,"--ntd-padding-y":r.paddingY,"--ntd-gap":r.gap,"--ntd-font-size":r.fontSize,"--ntd-line-height":r.lineHeight,"--ntd-input-height":r.inputHeight,"--ntd-button-height":r.buttonHeight}}function Ko(e){const{config:t}=Se(e),r=Fe[t.animation];return{"--ntd-anim-duration":r.duration,"--ntd-anim-easing":r.easing,"--ntd-hover-scale":r.hoverScale,"--ntd-click-scale":r.clickScale}}function lr(e,t,r="var(--nice-info, #6366f1)"){switch(e){case"button":return dt(t.buttonStyle,r);case"input":return ut(t.inputStyle);case"card":return ft(t.cardStyle);case"badge":return ar(t.badgeStyle??"solid",r);case"tab":return nr(t.tabStyle??"underline",r);case"toggle":return sr(t.toggleStyle??"default");case"tooltip":return or(t.tooltipStyle??"dark");case"table":return ir(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function dr(e){const t=be(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}const Jo=[{name:"default",label:"Default",description:"Standard balanced look",density:"normal",animation:"normal"},{name:"minimal",label:"Minimal",description:"Subtle shadows, underlined inputs",density:"normal",animation:"subtle"},{name:"rounded",label:"Rounded",description:"Large radii, pill tabs, filled inputs",density:"comfortable",animation:"normal"},{name:"sharp",label:"Sharp",description:"Zero radius, bordered cards, compact",density:"compact",animation:"subtle"},{name:"glass",label:"Glass",description:"Glassmorphism with frosted backdrops",density:"normal",animation:"normal"},{name:"neumorphic",label:"Neumorphic",description:"Soft raised and sunken surfaces",density:"comfortable",animation:"subtle"},{name:"playful",label:"Playful",description:"Gradients, bouncy animations, colorful",density:"comfortable",animation:"playful"},{name:"enterprise",label:"Enterprise",description:"Conservative, outlined, striped tables",density:"compact",animation:"subtle"},{name:"modern3d",label:"Modern 3D",description:"Deep shadows, 3D buttons, elevated",density:"normal",animation:"normal"},{name:"brutalist",label:"Brutalist",description:"Raw bold borders, no radius, no shadow",density:"normal",animation:"none"},{name:"luxe",label:"Luxe",description:"Premium feel with gradients and depth",density:"comfortable",animation:"normal"},{name:"pill",label:"Pill",description:"Full-radius pill shapes everywhere",density:"normal",animation:"normal"},{name:"flat",label:"Flat",description:"No shadows, filled inputs, soft badges",density:"normal",animation:"subtle"},{name:"editorial",label:"Editorial",description:"Clean typographic, paper cards",density:"comfortable",animation:"subtle"},{name:"dashboard",label:"Dashboard",description:"Data-dense, enclosed tabs, striped",density:"compact",animation:"subtle"},{name:"softCloud",label:"Soft Cloud",description:"Frosted glass, soft iOS-style toggles",density:"comfortable",animation:"normal"},{name:"cosmic",label:"Cosmic",description:"Mesh backgrounds, glowing shadows",density:"comfortable",animation:"dramatic"},{name:"corporate",label:"Corporate",description:"Safe, grey, no flair — boardroom ready",density:"compact",animation:"none"},{name:"bank",label:"Bank",description:"Ultra-conservative, heavy borders",density:"compact",animation:"none"},{name:"government",label:"Government",description:"Accessible, high-contrast, minimal",density:"normal",animation:"none"},{name:"military",label:"Military",description:"Dark, angular, no-nonsense tactical",density:"compact",animation:"none"},{name:"legal",label:"Legal",description:"Typographic, paper-like, document feel",density:"comfortable",animation:"none"},{name:"medical",label:"Medical",description:"Clean clinical, professional blue-toned",density:"normal",animation:"subtle"},{name:"swiss",label:"Swiss",description:"Grid-based, Helvetica spirit, precision",density:"normal",animation:"subtle"},{name:"scandinavian",label:"Scandinavian",description:"Warm, spacious, hygge-inspired calm",density:"spacious",animation:"subtle"},{name:"bauhaus",label:"Bauhaus",description:"Geometric, primary colours, strong lines",density:"normal",animation:"none"},{name:"notebook",label:"Notebook",description:"Handwritten feel, paper textures, ruled",density:"comfortable",animation:"subtle"},{name:"origami",label:"Origami",description:"Folded paper, subtle shadows, layered",density:"normal",animation:"normal"},{name:"watercolor",label:"Watercolor",description:"Soft bleeding edges, artistic, dreamy",density:"comfortable",animation:"normal"},{name:"monochrome",label:"Monochrome",description:"Pure black & white, typography focus",density:"normal",animation:"none"},{name:"paper",label:"Paper",description:"Minimal white, subtle shadows, like stationery",density:"comfortable",animation:"subtle"},{name:"zen",label:"Zen",description:"Ultra-minimal, whitespace, meditative calm",density:"spacious",animation:"subtle"},{name:"terminal",label:"Terminal",description:"Monospace, dark, retro-computing green",density:"compact",animation:"none"},{name:"hacker",label:"Hacker",description:"Matrix-style, neon green on black",density:"compact",animation:"subtle"},{name:"retro8bit",label:"8-bit Retro",description:"Pixel art, chunky borders, game boy era",density:"normal",animation:"none"},{name:"synthwave",label:"Synthwave",description:"80s synth, neon grids, chrome gradients",density:"normal",animation:"dramatic"},{name:"cyberpunk",label:"Cyberpunk",description:"Angular, neon, glitch aesthetics, dark",density:"compact",animation:"dramatic"},{name:"steampunk",label:"Steampunk",description:"Brass, gears, Victorian-era technology",density:"normal",animation:"subtle"},{name:"vapor",label:"Vaporwave",description:"80s/90s aesthetics, pink/teal gradients",density:"comfortable",animation:"playful"},{name:"neon",label:"Neon",description:"Bright glowing outlines on dark surfaces",density:"normal",animation:"dramatic"},{name:"windows95",label:"Windows 95",description:"Chunky beveled 3D, classic OS nostalgia",density:"compact",animation:"none"},{name:"material",label:"Material",description:"Google Material Design — depth & motion",density:"normal",animation:"normal"},{name:"fluent",label:"Fluent",description:"Microsoft Fluent — acrylic, reveal, depth",density:"normal",animation:"subtle"},{name:"cupertino",label:"Cupertino",description:"Apple iOS/macOS style — frosted, rounded",density:"comfortable",animation:"normal"},{name:"ant",label:"Ant Design",description:"Ant Design — clean, reliable, professional",density:"normal",animation:"subtle"},{name:"bootstrap",label:"Bootstrap",description:"Bootstrap-like — rounded, striped tables",density:"normal",animation:"subtle"},{name:"chakra",label:"Chakra",description:"Chakra UI — accessible, clean, modern",density:"normal",animation:"normal"},{name:"notion",label:"Notion",description:"Notion-like — text-focused, minimal chrome",density:"normal",animation:"subtle"},{name:"linear",label:"Linear",description:"Linear app — sleek, dark, polished",density:"compact",animation:"subtle"},{name:"vercel",label:"Vercel",description:"Vercel/Next.js — black/white, sharp, modern",density:"normal",animation:"subtle"},{name:"candy",label:"Candy",description:"Sweet pastels, rounded, sugar rush!",density:"comfortable",animation:"playful"},{name:"bubblegum",label:"Bubblegum",description:"Pink puffy bubbles, extremely round",density:"spacious",animation:"playful"},{name:"cartoon",label:"Cartoon",description:"Thick outlines, bold colours, exaggerated",density:"comfortable",animation:"playful"},{name:"kawaii",label:"Kawaii",description:"Cute, pastel, sparkly, UwU aesthetic",density:"spacious",animation:"dramatic"},{name:"circus",label:"Circus",description:"Bold stripes, loud, step right up!",density:"spacious",animation:"dramatic"},{name:"gaming",label:"Gaming",description:"Dark, neon accents, angular, RGB everything",density:"normal",animation:"dramatic"},{name:"kiddo",label:"Kiddo",description:"Colourful, puffy, child-friendly, big touch",density:"spacious",animation:"playful"},{name:"disco",label:"Disco",description:"Flashing, spinning, Saturday night fever 🕺",density:"comfortable",animation:"dramatic"},{name:"clown",label:"Clown",description:"Maximum chaos, honk honk, pure madness 🤡",density:"spacious",animation:"dramatic"}];function Yo({enabled:e,readOnly:t,disabled:r}){const[a,n]=c.useState(!1),s=c.useRef(!1),i=c.useCallback(()=>{t||r||!e||(s.current=!0,n(!0))},[t,r,e]),o=c.useCallback(()=>{n(!1)},[]),l=c.useCallback(d=>{d&&s.current&&(s.current=!1,requestAnimationFrame(()=>{if(d.focus(),d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)try{d.select()}catch{}}))},[]);return c.useEffect(()=>{(t||r)&&a&&n(!1)},[t,r,a]),{isDisplay:!!e&&!a,enterEdit:i,exitEdit:o,autoFocusRef:l}}const Qo=({value:e,placeholder:t,disabled:r,readOnly:a,onActivate:n,className:s,ariaLabel:i})=>{const o=e==null||e==="",l=d=>{r||a||(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n())};return x.jsx("span",{role:"button",tabIndex:r?-1:0,className:`nice-display-value ${o?"nice-display-value--empty":""} ${r?"nice-display-value--disabled":""} ${a?"nice-display-value--readonly":""} ${s||""}`.trim(),onClick:()=>{!r&&!a&&n()},onKeyDown:l,"aria-label":i,"aria-disabled":r||void 0,children:o?t??"—":e})};function Zo(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}function ei(e){const t=e.trim().toLowerCase();return!!(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("blob:")||t.startsWith("data:image/")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"))}const ur={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",sort:"M6 10l6-6 6 6M6 14l6 6 6-6",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",hash:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",circle:"M12 21a9 9 0 100-18 9 9 0 000 18z",box:"M21 8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16V8z M3.27 6.96L12 12.01l8.73-5.05 M12 22.08V12",tabs:"M3 9h18v10H3z M7 9V5h6v4",columns:"M4 4h7v16H4z M13 4h7v16h-7z",grid:"M3 3h7v7H3z M14 3h7v7h-7z M14 14h7v7h-7z M3 14h7v7H3z",table:"M3 5h18v14H3z M3 10h18M3 15h18M9 5v14M15 5v14",heading:"M6 4v16M18 4v16M6 12h12",type:"M4 7V4h16v3M9 20h6M12 4v16","align-left":"M3 6h18M3 12h12M3 18h15",input:"M4 9h16a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4a1 1 0 011-1z M7 12h5",button:"M5 9h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2a2 2 0 012-2z",select:"M4 6h16a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1z M15 11l-3 3-3-3","check-square":"M9 11l3 3L22 4 M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",video:"M23 7l-7 5 7 5V7z M16 5H3a2 2 0 00-2 2v10a2 2 0 002 2h13a2 2 0 002-2V7a2 2 0 00-2-2z",card:"M3 5h18a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V6a1 1 0 011-1z M3 10h18","bar-chart":"M6 20v-6M12 20V4M18 20v-10",globe:"M12 3a9 9 0 100 18 9 9 0 000-18z M3 12h18 M12 3a14 14 0 010 18 M12 3a14 14 0 000 18",monitor:"M3 4h18a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M8 21h8 M12 17v4",camera:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h3l2-3h6l2 3h3a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z",plug:"M9 2v5 M15 2v5 M7 7h10v3a5 5 0 01-10 0V7z M12 15v7",save:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z M17 21v-8H7v8 M7 3v5h8",tag:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z M7 7h.01",palette:"M12 2a10 10 0 000 20 2 2 0 002-2c0-.5-.2-1-.5-1.3a2 2 0 01-.5-1.2 2 2 0 012-2H17a5 5 0 005-5c0-5-4.5-9-10-9z M6.5 11.5h.01 M9.5 7.5h.01 M14.5 7.5h.01",book:"M4 19.5A2.5 2.5 0 016.5 17H20 M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z",cloud:"M18 10h-1.26A8 8 0 109 20h9a5 5 0 000-10z",target:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 7a5 5 0 100 10 5 5 0 000-10z M12 11a1 1 0 100 2 1 1 0 000-2z",message:"M21 11.5a8.5 8.5 0 01-8.5 8.5 8.4 8.4 0 01-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 01-.9-3.8A8.5 8.5 0 0112.5 3 8.5 8.5 0 0121 11.5z",flask:"M9 2h6 M10 2v6.5L4.5 19a1 1 0 00.9 1.5h13.2a1 1 0 00.9-1.5L14 8.5V2 M7 15h10",rocket:"M12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22 22 0 01-3.95 2z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0 M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5 M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 00-2.91-.09z",music:"M9 18V5l12-2v13 M9 18a3 3 0 11-6 0 3 3 0 016 0z M21 16a3 3 0 11-6 0 3 3 0 016 0z",wifi:"M5 12.55a11 11 0 0114 0 M8.5 16.11a6 6 0 017 0 M12 20h.01 M2 8.82a15 15 0 0120 0",database:"M12 8c4.97 0 9-1.34 9-3s-4.03-3-9-3-9 1.34-9 3 4.03 3 9 3z M21 5v6c0 1.66-4.03 3-9 3s-9-1.34-9-3V5 M21 11v6c0 1.66-4.03 3-9 3s-9-1.34-9-3v-6",slash:"M12 3a9 9 0 100 18 9 9 0 000-18z M5.6 5.6l12.8 12.8",puzzle:"M19.4 13.6a1.6 1.6 0 10.2-3.2H19V7a2 2 0 00-2-2h-3.4v-.4a1.6 1.6 0 10-3.2 0V5H7a2 2 0 00-2 2v3.4h.4a1.6 1.6 0 100 3.2H5V17a2 2 0 002 2h3.4v.4a1.6 1.6 0 103.2 0V19H17a2 2 0 002-2v-3.4z",dollar:"M12 1v22 M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6",printer:"M6 9V2h12v7 M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2 M6 14h12v8H6z",scale:"M12 3v18 M5 21h14 M5 7l7-2 7 2 M2 13a3 3 0 006 0L5 7zm14 0a3 3 0 006 0L19 7z",accessibility:"M12 3a9 9 0 100 18 9 9 0 000-18z M12 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M7.5 10.5l4.5 1 4.5-1 M12 11.5v3.5l-2 3.5 M12 15l2 3.5",window:"M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M2 9h20 M6 6.5h.01 M9 6.5h.01","map-pin":"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",cursor:"M5 3l14 7-6 2-2 6-6-15z",shuffle:"M16 3h5v5 M4 20L21 3 M21 16v5h-5 M15 15l6 6 M4 4l5 5",lightbulb:"M9 18h6 M10 22h4 M12 2a7 7 0 00-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0012 2z",server:"M3 4h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1z M3 14h18a1 1 0 011 1v4a1 1 0 01-1 1H3a1 1 0 01-1-1v-4a1 1 0 011-1z M7 7h.01 M7 17h.01",terminal:"M4 17l6-6-6-6 M12 19h8",send:"M22 2L11 13 M22 2l-7 20-4-9-9-4 20-7z",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",mic:"M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",briefcase:"M20 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2M2 12h20",building:"M4 22V4a2 2 0 012-2h12a2 2 0 012 2v18M4 22h16M9 22v-4h6v4M9 6h.01M15 6h.01M9 10h.01M15 10h.01M9 14h.01M15 14h.01",medal:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11M12 15a6 6 0 100-12 6 6 0 000 12z",clipboard:"M9 2h6a1 1 0 011 1v1a1 1 0 01-1 1H9a1 1 0 01-1-1V3a1 1 0 011-1zM16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2","skip-forward":"M5 4l10 8-10 8V4zM19 5v14","at-sign":"M12 16a4 4 0 100-8 4 4 0 000 8zM16 12v1.5a2.5 2.5 0 005 0V12a9 9 0 10-3.5 7.14",gift:"M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z",archive:"M21 8v13H3V8M1 3h22v5H1zM10 12h4",reply:"M9 17l-5-5 5-5M4 12h11a4 4 0 014 4v2",forward:"M15 17l5-5-5-5M20 12H9a4 4 0 00-4 4v2",paperclip:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",zap:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",square:"M4 4h16v16H4z",triangle:"M12 4L3 20h18z",hexagon:"M7.5 3h9l4.5 9-4.5 9h-9L3 12z",line:"M5 19L19 5",pen:"M12 19l7-7 3 3-7 7-3-3z M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z M11 11a2 2 0 100-4 2 2 0 000 4z",brush:"M9.06 11.9l8.07-8.06a2.85 2.85 0 114.03 4.03l-8.06 8.08 M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 00-3-3.02z",droplet:"M12 2.69l5.66 5.66a8 8 0 11-11.31 0z",bucket:"M5 8h14l-1.5 11a2 2 0 01-2 1.8H8.5a2 2 0 01-2-1.8L5 8z M5 8l2-4h10l2 4",scissors:"M6 9a3 3 0 100-6 3 3 0 000 6z M6 21a3 3 0 100-6 3 3 0 000 6z M20 4L8.12 15.88 M14.47 14.48L20 20 M8.12 8.12L12 12",layers:"M12 2l9 5-9 5-9-5 9-5z M3 12l9 5 9-5 M3 17l9 5 9-5",crop:"M6 2v14a2 2 0 002 2h14 M2 6h14a2 2 0 012 2v14",eyedropper:"M2 22l1-1h3l9-9 M3 21v-3l9-9 M15 6l3.5-3.5a2.12 2.12 0 013 3L18 9l-3-3z",ruler:"M21.3 8.7l-6-6a1 1 0 00-1.4 0L2.7 13.9a1 1 0 000 1.4l6 6a1 1 0 001.4 0L21.3 10.1a1 1 0 000-1.4z M7.5 10.5l2 2 M11 7l2 2 M14.5 3.5l2 2",wand:"M15 4V2 M15 16v-2 M8 9h2 M20 9h2 M3 21l9-9 M12.2 6.2L11 5 M17.8 6.2L19 5 M17.8 11.8L19 13",move:"M5 9l-3 3 3 3 M9 5l3-3 3 3 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M12 2v20",gamepad:"M6 12h4 M8 10v4 M15 13h.01 M18 11h.01 M2 12a4 4 0 014-4h12a4 4 0 014 4l-1.5 6a2 2 0 01-2 1.5H5.5a2 2 0 01-2-1.5L2 12z",eraser:"M7 21l-4.3-4.3a1 1 0 010-1.4l9.6-9.6a2 2 0 012.8 0l4.6 4.6a2 2 0 010 2.8L13 21H7z M22 21H7 M5 12l5 5",thermometer:"M14 14.76V3.5a2.5 2.5 0 00-5 0v11.26a4.5 4.5 0 105 0z",door:"M18 20V5a1 1 0 00-1-1H7a1 1 0 00-1 1v15 M3 20h18 M13 11.5h.01",stairs:"M3 20h3v-3h3v-3h3v-3h3v-3h3",elevator:"M5 3h14a1 1 0 011 1v16a1 1 0 01-1 1H5a1 1 0 01-1-1V4a1 1 0 011-1z M9.5 9L12 6.5 14.5 9 M9.5 15l2.5 2.5 2.5-2.5",bed:"M2 4v16 M2 8h18a2 2 0 012 2v10 M22 17H2 M6 8v4 M2 12h4",sofa:"M3 9V7a2 2 0 012-2h14a2 2 0 012 2v2 M21 9a2 2 0 00-2 2v3H5v-3a2 2 0 00-2-2 2 2 0 00-2 2v4a1 1 0 001 1h18a1 1 0 001-1v-4a2 2 0 00-2-2 M5 18v2 M19 18v2",chair:"M6 11V5a2 2 0 012-2h8a2 2 0 012 2v6 M5 11h14 M6 11l-1 8h14l-1-8 M6 19v2 M18 19v2",utensils:"M3 2v7a2 2 0 002 2 2 2 0 002-2V2 M5 2v20 M21 2v9c0 1-1 1.8-2 1.8h-1V20 M18 2v9",mountain:"M8 3l4 8 5-5 5 15H2L8 3z",tree:"M12 2L7 11h10L12 2z M9 11l3 5 3-5 M12 16v6",sun:"M12 17a5 5 0 100-10 5 5 0 000 10z M12 1v2 M12 21v2 M4.22 4.22l1.42 1.42 M18.36 18.36l1.42 1.42 M1 12h2 M21 12h2 M4.22 19.78l1.42-1.42 M18.36 5.64l1.42-1.42",moon:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"},ti={xs:12,sm:16,md:20,lg:24,xl:32},gt=c.createContext({}),ri=({resolver:e,children:t})=>c.createElement(gt.Provider,{value:{resolver:e}},t);function ai({path:e,size:t,className:r,style:a,color:n,title:s,onClick:i}){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${r||""}`,style:a,role:s?"img":"presentation","aria-label":s,"aria-hidden":!s,onClick:i,children:[s&&x.jsx("title",{children:s}),x.jsx("path",{d:e})]})}const fr=({name:e,size:t="md",className:r,style:a,color:n,title:s,onClick:i})=>{const{resolver:o}=c.useContext(gt),l=typeof t=="number"?t:ti[t];if(o){const u=o(e,l);if(u)return x.jsx("span",{className:`nice-icon-wrap ${r||""}`,style:a,onClick:i,children:u})}const d=ur[e];return d?x.jsx(ai,{path:d,size:l,className:r,style:a,color:n,title:s,onClick:i}):null};function ni(){const{resolver:e}=c.useContext(gt);return{renderIcon:c.useCallback((r,a="md")=>r==null?null:typeof r!="string"?r:c.createElement(fr,{name:r,size:a}),[e])}}const si=Object.keys(ur);function oi(){const[e,t]=c.useState(()=>typeof window<"u"?window.matchMedia("(pointer: coarse)").matches:!1);return c.useEffect(()=>{const r=window.matchMedia("(pointer: coarse)");t(r.matches);const a=n=>t(n.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function ii(){const[e,t]=c.useState(()=>typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches?"touch":"mouse");return c.useEffect(()=>{const r=()=>t("touch"),a=n=>{n.pointerType==="mouse"&&t("mouse")};return window.addEventListener("touchstart",r,{passive:!0,capture:!0}),window.addEventListener("pointerdown",a,{capture:!0}),()=>{window.removeEventListener("touchstart",r,{capture:!0}),window.removeEventListener("pointerdown",a,{capture:!0})}},[]),e}function ci(e,t=500){const r=c.useRef(null),a=c.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]);return{onPointerDown:c.useCallback(s=>{s.pointerType==="touch"&&(a(),r.current=setTimeout(e,t))},[e,t,a]),onPointerUp:a,onPointerCancel:a}}function li(){const e=c.useRef(null),t=c.useCallback(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),r=c.useCallback(a=>{t();let n=300;const s=()=>{a(),n=Math.max(30,n*.82),e.current=setTimeout(s,n)};e.current=setTimeout(s,400)},[t]);return c.useEffect(()=>t,[t]),{start:r,stop:t}}function di(e){const t=c.useId();return e||t}function ui(e,t){const[r,a]=c.useState(e);return c.useEffect(()=>{const n=setTimeout(()=>a(e),t);return()=>clearTimeout(n)},[e,t]),r}function fi(e,t){c.useEffect(()=>{const r=a=>{!e.current||e.current.contains(a.target)||t()};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function mi(e,t){c.useEffect(()=>{if(!t||!e.current)return;const r=e.current,a=document.activeElement,n=r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=n[0],i=n[n.length-1],o=l=>{l.key==="Tab"&&(l.shiftKey?document.activeElement===s&&(l.preventDefault(),i==null||i.focus()):document.activeElement===i&&(l.preventDefault(),s==null||s.focus()))};return s==null||s.focus(),r.addEventListener("keydown",o),()=>{var l;r.removeEventListener("keydown",o),(l=a==null?void 0:a.focus)==null||l.call(a)}},[e,t])}function pi(e={}){const{defaultMode:t="system",storageKey:r="nice-color-mode",darkClass:a="nice-dark",lightClass:n="nice-light"}=e,[s,i]=c.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),[o,l]=c.useState(()=>{if(typeof window>"u")return t;const m=localStorage.getItem(r);return m==="light"||m==="dark"||m==="system"?m:t});c.useEffect(()=>{const m=window.matchMedia("(prefers-color-scheme: dark)"),y=g=>i(g.matches?"dark":"light");return m.addEventListener("change",y),()=>m.removeEventListener("change",y)},[]);const d=o==="system"?s==="dark":o==="dark";c.useEffect(()=>{const m=document.documentElement;return d?(m.classList.add(a),m.classList.remove(n)):(m.classList.add(n),m.classList.remove(a)),()=>{m.classList.remove(a,n)}},[d,a,n]),c.useEffect(()=>{localStorage.setItem(r,o)},[o,r]);const u=c.useCallback(()=>l("light"),[]),f=c.useCallback(()=>l("dark"),[]),p=c.useCallback(()=>l("system"),[]),h=c.useCallback(()=>l(m=>m==="system"?s==="dark"?"light":"dark":m==="dark"?"light":"dark"),[s]);return{isDark:d,mode:o,systemPreference:s,setLight:u,setDark:f,setSystem:p,toggle:h}}function gi(e,t={}){const{colorCount:r=5,quality:a=5}=t,[n,s]=c.useState(null),[i,o]=c.useState(!1),[l,d]=c.useState(null);return c.useEffect(()=>{if(!e){s(null);return}(async()=>{o(!0),d(null);try{let f;typeof e=="string"?(f=new Image,f.crossOrigin="anonymous",await new Promise((M,N)=>{f.onload=()=>M(),f.onerror=()=>N(new Error("Failed to load image")),f.src=e})):f=e;const p=document.createElement("canvas"),h=100,m=Math.min(h/f.width,h/f.height,1);p.width=f.width*m,p.height=f.height*m;const y=p.getContext("2d");if(!y)throw new Error("Canvas context unavailable");y.drawImage(f,0,0,p.width,p.height);const g=y.getImageData(0,0,p.width,p.height),v=[],b=Math.max(1,Math.floor(11-a));for(let M=0;M<g.data.length;M+=4*b){const N=g.data[M],L=g.data[M+1],E=g.data[M+2];if(g.data[M+3]>200){const T=(N+L+E)/3;T>20&&T<235&&v.push([N,L,E])}}if(v.length===0)throw new Error("No valid colors found in image");const w=yi(v,r).sort((M,N)=>{const L=Math.max(...M)-Math.min(...M);return Math.max(...N)-Math.min(...N)-L}),A=M=>"#"+M.map(N=>Math.round(N).toString(16).padStart(2,"0")).join(""),k=M=>(.299*M[0]+.587*M[1]+.114*M[2])/255>.5?"var(--nice-text, #000000)":"var(--nice-bg, #fff)",C=w.slice();s({primary:A(C[0]||[100,100,100]),secondary:A(C[1]||C[0]||[150,150,150]),accent:A(w[0]||[100,100,100]),palette:C.map(A),primaryText:k(C[0]||[100,100,100]),secondaryText:k(C[1]||C[0]||[150,150,150])})}catch(f){d(f instanceof Error?f.message:"Unknown error"),s(null)}finally{o(!1)}})()},[e,r,a]),{colors:n,loading:i,error:l}}function yi(e,t,r=20){if(e.length<=t)return e;const a=[],n=new Set;for(;a.length<t;){const s=Math.floor(Math.random()*e.length);n.has(s)||(n.add(s),a.push([...e[s]]))}for(let s=0;s<r;s++){const i=Array.from({length:t},()=>[]);for(const l of e){let d=1/0,u=0;for(let f=0;f<t;f++){const p=Math.sqrt((l[0]-a[f][0])**2+(l[1]-a[f][1])**2+(l[2]-a[f][2])**2);p<d&&(d=p,u=f)}i[u].push(l)}let o=!1;for(let l=0;l<t;l++){if(i[l].length===0)continue;const d=[0,0,0];for(const u of i[l])d[0]+=u[0],d[1]+=u[1],d[2]+=u[2];d[0]/=i[l].length,d[1]/=i[l].length,d[2]/=i[l].length,(Math.abs(d[0]-a[l][0])>1||Math.abs(d[1]-a[l][1])>1||Math.abs(d[2]-a[l][2])>1)&&(o=!0),a[l]=d}if(!o)break}return a}function hi(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),s=Math.max(r,a,n)/255,i=Math.min(r,a,n)/255;let o=0,l=0;const d=(s+i)/2;if(s!==i){const f=s-i;switch(l=d>.5?f/(2-s-i):f/(s+i),s){case r/255:o=((a/255-n/255)/f+(a<n?6:0))/6;break;case a/255:o=((n/255-r/255)/f+2)/6;break;case n/255:o=((r/255-a/255)/f+4)/6;break}}const u=(f,p,h)=>{const m=(w,A,k)=>(k<0&&(k+=1),k>1&&(k-=1),k<.16666666666666666?w+(A-w)*6*k:k<.5?A:k<.6666666666666666?w+(A-w)*(.6666666666666666-k)*6:w),y=h<.5?h*(1+p):h+p-h*p,g=2*h-y,v=Math.round(m(g,y,f+1/3)*255),b=Math.round(m(g,y,f)*255),S=Math.round(m(g,y,f-1/3)*255);return"#"+[v,b,S].map(w=>w.toString(16).padStart(2,"0")).join("")};return{lightest:u(o,Math.min(l*.3,1),.97),lighter:u(o,Math.min(l*.5,1),.9),light:u(o,Math.min(l*.7,1),.8),base:e,dark:u(o,Math.min(l*1.1,1),Math.max(d-.15,.1)),darker:u(o,Math.min(l*1.2,1),Math.max(d-.25,.05)),darkest:u(o,Math.min(l*1.3,1),Math.max(d-.35,.02)),text:d>.5?"var(--nice-text, #000000)":"var(--nice-bg, #fff)",textInverse:d>.5?"var(--nice-bg, #fff)":"var(--nice-text, #000000)"}}const ue={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},ie=["xs","sm","md","lg","xl","xxl"];function xe(e=ue){const[t,r]=c.useState(()=>typeof window<"u"?window.innerWidth:e.lg);c.useEffect(()=>{let o;const l=()=>{o&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>r(window.innerWidth))};return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),o&&cancelAnimationFrame(o)}},[]);const a=c.useMemo(()=>{for(let o=ie.length-1;o>=0;o--)if(t>=e[ie[o]])return ie[o];return"xs"},[t,e]),n=c.useCallback(o=>t>=e[o],[t,e]),s=c.useCallback(o=>t<e[o],[t,e]),i=c.useCallback((o,l)=>t>=e[o]&&t<e[l],[t,e]);return{current:a,width:t,isAbove:n,isBelow:s,isBetween:i,isMobile:t<e.md,isTablet:t>=e.md&&t<e.lg,isDesktop:t>=e.lg}}function Ie(e){const[t,r]=c.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return c.useEffect(()=>{const a=window.matchMedia(e);r(a.matches);const n=s=>r(s.matches);return a.addEventListener("change",n),()=>a.removeEventListener("change",n)},[e]),t}function bi(e,t=ue){const{current:r}=xe(t);return c.useMemo(()=>{if(e==null||typeof e!="object"||Array.isArray(e))return e;const a=e,n=ie.indexOf(r);for(let s=n;s>=0;s--){const i=a[ie[s]];if(i!==void 0)return i}for(let s=n+1;s<ie.length;s++){const i=a[ie[s]];if(i!==void 0)return i}},[e,r])}function vi(e){const[t,r]=c.useState({width:0,height:0});return c.useEffect(()=>{const a=e.current;if(!a)return;const n=new ResizeObserver(([s])=>{const{width:i,height:o}=s.contentRect;r({width:i,height:o})});return n.observe(a),()=>n.disconnect()},[e]),t}function mr(){const{width:e,isMobile:t}=xe(),r=c.useMemo(()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,[]),a=Ie("(prefers-reduced-motion: reduce)"),n=Ie("(orientation: portrait)"),s=c.useMemo(()=>typeof window>"u"?1:window.devicePixelRatio||1,[]),i=t&&r,o=!t&&e<ue.lg&&r,l=!r||e>=ue.lg;return{isMobile:i||o,isTouch:r,isPhone:i,isTablet:o,isDesktop:l,prefersReducedMotion:a,isPortrait:n,pixelRatio:s}}function Si(e={}){const{forceVariant:t,breakpoints:r=ue}=e,{isMobile:a,isTablet:n,isDesktop:s}=xe(r),i=mr();return t||(i.isPhone?"mobile":i.isTablet?"tablet":i.isDesktop?"desktop":a?"mobile":n?"tablet":"desktop")}function xi(e={}){const{showAt:t,hideAt:r,mobileOnly:a,desktopOnly:n,tabletOnly:s}=e,{current:i,isMobile:o,isTablet:l,isDesktop:d}=xe();return a?o:n?d:s?l:r&&r.includes(i)?!1:t?t.includes(i):!0}function wi(){return Ie("(orientation: portrait)")?"portrait":"landscape"}function ki(){const[e,t]=c.useState({top:0,right:0,bottom:0,left:0});return c.useEffect(()=>{if(typeof window>"u"||!CSS.supports("padding-top","env(safe-area-inset-top)"))return;const r=()=>{getComputedStyle(document.documentElement);const a=document.createElement("div");a.style.cssText=`
|
|
12
12
|
position: fixed;
|
|
13
13
|
top: 0;
|
|
14
14
|
left: 0;
|
|
15
15
|
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
|
|
16
16
|
visibility: hidden;
|
|
17
17
|
pointer-events: none;
|
|
18
|
-
`,document.body.appendChild(a);const n=getComputedStyle(a);t({top:parseInt(n.paddingTop,10)||0,right:parseInt(n.paddingRight,10)||0,bottom:parseInt(n.paddingBottom,10)||0,left:parseInt(n.paddingLeft,10)||0}),document.body.removeChild(a)};return r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),e}function pr(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const et={fade:"nice-anim-fade-enter",slideUp:"nice-anim-slide-up-enter",slideDown:"nice-anim-slide-down-enter",slideLeft:"nice-anim-slide-left-enter",slideRight:"nice-anim-slide-right-enter",scaleUp:"nice-anim-scale-up-enter",scaleDown:"nice-anim-scale-down-enter",zoom:"nice-anim-zoom-enter",flip:"nice-anim-flip-enter",none:""},gr={fade:"nice-anim-fade-exit",slideUp:"nice-anim-slide-up-exit",slideDown:"nice-anim-slide-down-exit",slideLeft:"nice-anim-slide-left-exit",slideRight:"nice-anim-slide-right-exit",scaleUp:"nice-anim-scale-up-exit",scaleDown:"nice-anim-scale-down-exit",zoom:"nice-anim-zoom-exit",flip:"nice-anim-flip-exit",none:""};function ki(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:s}=e,[i,o]=c.useState(t?"entered":"exited"),[l,d]=c.useState(t),u=c.useRef(),f=pr(a),g=c.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=g||r==="none"?0:f;c.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),o("entering"),u.current=setTimeout(()=>{o("entered"),n==null||n()},h)):(o("exiting"),u.current=setTimeout(()=>{o("exited"),d(!1),s==null||s()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const m=c.useMemo(()=>r==="none"||g?"":i==="entering"?et[r]:i==="exiting"?gr[r]:i==="entered"?`${et[r]} nice-anim-active`:"",[r,i,g]),y=c.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:i,shouldRender:l,className:m,style:y}}function Mi(e,t){const{expanded:r,duration:a="normal"}=t,[n,s]=c.useState(r?"auto":0),i=pr(a);return c.useEffect(()=>{const o=e.current;if(o)if(r){const l=o.scrollHeight;s(l);const d=setTimeout(()=>s("auto"),i);return()=>clearTimeout(d)}else{const l=o.scrollHeight;s(l),requestAnimationFrame(()=>{requestAnimationFrame(()=>s(0))})}},[r,i,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${i}ms ease`}}function Ci(e,t=50){return`${e*t}ms`}function Ai(e,t){return t==="enter"?et[e]:gr[e]}const yr=c.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),hr=({direction:e,children:t})=>{const r=c.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";c.useEffect(()=>(e!=="auto"&&(document.documentElement.setAttribute("dir",r),document.documentElement.style.direction=r),()=>{e!=="auto"&&(document.documentElement.removeAttribute("dir"),document.documentElement.style.direction="")}),[e,r]);const n=c.useCallback(o=>a?{left:"right",right:"left",start:"end",end:"start"}[o]??o:o,[a]),s=c.useCallback((o,l)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[o]||o]:l}:{[o]:l},[a]),i=c.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:s}),[r,a,n,s]);return x.jsx(yr.Provider,{value:i,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};hr.displayName="NiceRTLProvider";function Ei(){return c.useContext(yr)}const Ni={marginStart:"marginInlineStart",marginEnd:"marginInlineEnd",paddingStart:"paddingInlineStart",paddingEnd:"paddingInlineEnd",borderStart:"borderInlineStart",borderEnd:"borderInlineEnd",insetStart:"insetInlineStart",insetEnd:"insetInlineEnd",start:"insetInlineStart",end:"insetInlineEnd",textAlign:{start:"start",end:"end"}},br=c.createContext({permissions:{},getAccessMode:()=>"full"}),vr=({permissions:e,children:t})=>{const r=c.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var s,i;return n&&a&&((s=e.fields)!=null&&s[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((i=e.components)!=null&&i[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(br.Provider,{value:r,children:t})};vr.displayName="NiceAccessControl";function Li(e,t,r){const a=c.useContext(br);return e||a.getAccessMode(t,r)}function Ti(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function Ri(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:s,onSwipeUp:i,onSwipeDown:o,enabled:l=!0}=e,d=c.useRef(null),[u,f]=c.useState(!1),[g,h]=c.useState(null),m=c.useRef(null);return c.useEffect(()=>{const y=d.current;if(!y||!l)return;const p=w=>{if(w.touches.length!==1)return;const A=w.touches[0];m.current={x:A.clientX,y:A.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!m.current||w.touches.length!==1)return;const A=w.touches[0],k=A.clientX-m.current.x,C=A.clientY-m.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},b=w=>{if(!m.current)return;const A=w.changedTouches[0],k={x:A.clientX,y:A.clientY,timestamp:Date.now()},C=k.x-m.current.x,M=k.y-m.current.y,N=k.timestamp-m.current.timestamp,L=Math.sqrt(C*C+M*M),E=L/N;if(f(!1),N<=r&&L>=t){let R;Math.abs(C)>Math.abs(M)?R=C>0?"right":"left":R=M>0?"down":"up";const T={direction:R,distance:L,velocity:E,duration:N};switch(a==null||a(T),R){case"left":n==null||n(T);break;case"right":s==null||s(T);break;case"up":i==null||i(T);break;case"down":o==null||o(T);break}}m.current=null,h(null)},S=()=>{m.current=null,f(!1),h(null)};return y.addEventListener("touchstart",p,{passive:!0}),y.addEventListener("touchmove",v,{passive:!0}),y.addEventListener("touchend",b,{passive:!0}),y.addEventListener("touchcancel",S,{passive:!0}),()=>{y.removeEventListener("touchstart",p),y.removeEventListener("touchmove",v),y.removeEventListener("touchend",b),y.removeEventListener("touchcancel",S)}},[l,t,r,a,n,s,i,o]),{ref:d,isSwiping:u,swipeDirection:g}}function Ii(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:s=3,enabled:i=!0}=e,o=c.useRef(null),[l,d]=c.useState(1),[u,f]=c.useState(!1),g=c.useRef(null),h=c.useRef(1);return c.useEffect(()=>{const m=o.current;if(!m||!i)return;const y=(w,A)=>{const k=w.clientX-A.clientX,C=w.clientY-A.clientY;return Math.sqrt(k*k+C*C)},p=(w,A)=>({x:(w.clientX+A.clientX)/2,y:(w.clientY+A.clientY)/2}),v=w=>{w.touches.length===2&&(g.current=y(w.touches[0],w.touches[1]),h.current=l,f(!0),r==null||r())},b=w=>{if(w.touches.length!==2||!g.current)return;const A=y(w.touches[0],w.touches[1]),k=Math.min(s,Math.max(n,h.current*(A/g.current)));d(k),t==null||t({scale:k,center:p(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(l),g.current=null)};return m.addEventListener("touchstart",v,{passive:!0}),m.addEventListener("touchmove",b,{passive:!0}),m.addEventListener("touchend",S,{passive:!0}),m.addEventListener("touchcancel",S,{passive:!0}),()=>{m.removeEventListener("touchstart",v),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",S),m.removeEventListener("touchcancel",S)}},[i,l,u,n,s,t,r,a]),{ref:o,scale:l,isPinching:u}}function zi(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(0),[u,f]=c.useState(0),g=c.useRef(null),h=c.useRef(null);return c.useEffect(()=>{const m=s.current;if(!m||!n)return;const y=b=>{if(b.touches.length!==1)return;const S=b.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};g.current=w,h.current=w,o(!0),d(0),f(0),r==null||r()},p=b=>{if(!g.current||!h.current||b.touches.length!==1)return;const S=b.touches[0],w=Date.now(),A={x:S.clientX,y:S.clientY,timestamp:w},k=A.x-g.current.x,C=A.y-g.current.y,M=A.timestamp-h.current.timestamp||1,N=(A.x-h.current.x)/M,L=(A.y-h.current.y)/M;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:N,velocityY:L}),h.current=A},v=()=>{if(!i||!g.current||!h.current)return;const b=l,S=u,w=h.current.timestamp-g.current.timestamp||1;a==null||a({deltaX:b,deltaY:S,velocityX:b/w,velocityY:S/w}),o(!1),g.current=null,h.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",p,{passive:!0}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",p),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,i,l,u,t,r,a]),{ref:s,isPanning:i,deltaX:l,deltaY:u}}function Sr(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(!1),[u,f]=c.useState(0),g=c.useRef(null),h=Math.min(1,u/r);return c.useEffect(()=>{const m=s.current;if(!m||!n||l)return;const y=b=>{m.scrollTop>0||b.touches.length===1&&(g.current=b.touches[0].clientY)},p=b=>{if(g.current===null||b.touches.length!==1)return;const w=b.touches[0].clientY-g.current;if(w<=0){f(0),o(!1);return}const k=Math.min(a,w*.5);f(k),o(k>0),k>0&&b.preventDefault()},v=async()=>{if(u>=r&&!l){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);o(!1),g.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",p,{passive:!1}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",p),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,l,u,r,a,t]),{ref:s,isPulling:i,isRefreshing:l,pullDistance:u,pullProgress:h}}const Di=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:s=.5,className:i,style:o})=>{const l=c.useRef(null),d=c.useRef(null),[u,f]=c.useState(0),[g,h]=c.useState(!1),m=c.useRef(0),y=c.useRef(0),p=t.length*a,v=r.length*a,b=p*n,S=v*n,w=c.useCallback(N=>{h(!1),m.current=N.touches[0].clientX,y.current=u},[u]),A=c.useCallback(N=>{const L=N.touches[0].clientX-m.current;let E=y.current+L;E>b?E=b+(E-b)*.2:E<-S&&(E=-S+(E+S)*.2),!(E>0&&t.length===0)&&(E<0&&r.length===0||f(E))},[b,S,t.length,r.length]),k=c.useCallback(()=>{h(!0),u>p*s?f(p):u<-v*s?f(-v):f(0)},[u,p,v,s]),C=c.useCallback(N=>{h(!0),f(0),N.onAction()},[]),M=c.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:l,className:`nice-swipeable ${i||""}`,style:{...o,position:"relative",overflow:"hidden"},children:[x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--left",style:{position:"absolute",left:0,top:0,bottom:0,display:"flex",width:p},children:t.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--right",style:{position:"absolute",right:0,top:0,bottom:0,display:"flex",width:v},children:r.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:g?"transform 0.3s ease-out":"none",background:"var(--bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:A,onTouchEnd:k,onClick:u!==0?M:void 0,children:e})]})},Pi=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:s=!0,className:i,style:o})=>{const{ref:l,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:g}=Sr({onRefresh:t,threshold:r,enabled:s});return x.jsxs("div",{ref:l,className:`nice-pull-refresh ${i||""}`,style:{...o,position:"relative",overflow:"auto",overscrollBehavior:"contain"},children:[x.jsx("div",{className:"nice-pull-refresh__indicator",style:{position:"absolute",top:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",height:f,overflow:"hidden",transition:d?"none":"height 0.2s ease-out"},children:u?n||x.jsx("div",{className:"nice-pull-refresh__spinner",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):a||x.jsx("div",{className:"nice-pull-refresh__arrow",style:{transform:`rotate(${g>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:g},children:x.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function xr(e="light"){if(!("vibrate"in navigator))return;const t={light:10,medium:20,heavy:30,selection:5,success:[10,30,10],warning:[20,20,20],error:[30,30,30,30]};try{navigator.vibrate(t[e])}catch{}}function Fi(){return c.useCallback((e="light")=>{xr(e)},[])}const Hi=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{className:`nice-touch-target ${r||""}`,style:{...a,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:e,minHeight:e,cursor:n?"pointer":void 0},onClick:n,children:t});function $i(){const[e,t]=c.useState(!1),[r,a]=c.useState(0),n=c.useRef(typeof window<"u"?window.innerHeight:0);return c.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const i=window.visualViewport,o=()=>{const l=n.current-i.height,d=150;t(l>d),a(l>d?l:0)};return i.addEventListener("resize",o),()=>i.removeEventListener("resize",o)}const s=()=>{const i=n.current-window.innerHeight,o=150;t(i>o),a(i>o?i:0)};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const wr={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},kr=c.createContext(null),Mr=({config:e,children:t})=>{const r=c.useMemo(()=>({...wr,...e}),[e]),a=c.useRef(null),n=c.useRef(null),[s,i]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");i(h.matches);const m=y=>i(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const[o,l]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");l(h.matches);const m=y=>l(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:s,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:o,f=c.useCallback((h,m="polite")=>{if(!r.announceChanges)return;const y=m==="assertive"?n.current:a.current;y&&(y.textContent="",requestAnimationFrame(()=>{y.textContent=h}))},[r.announceChanges]),g=c.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(kr.Provider,{value:g,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:tt}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:tt})]})};Mr.displayName="NiceA11yProvider";function Bi(){const e=c.useContext(kr);return e||{config:wr,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const tt={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Cr(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function ji(e){const t=e.error?`${e.id}-error`:void 0,r=e.helperText?`${e.id}-helper`:void 0;return{"aria-invalid":e.error?!0:void 0,"aria-required":e.required||void 0,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readOnly||void 0,"aria-describedby":Cr(t,r),"aria-errormessage":t}}function Oi(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;c.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>Array.from(s.querySelectorAll(n)).filter(l=>!l.hasAttribute("disabled")&&l.getAttribute("aria-disabled")!=="true"),o=l=>{var y;const d=i();if(d.length===0)return;const u=document.activeElement,f=d.indexOf(u);if(f===-1)return;let g=-1;const h=r==="horizontal"||r==="both"||r==="grid",m=r==="vertical"||r==="both"||r==="grid";if(h&&l.key==="ArrowRight")g=f+1;else if(h&&l.key==="ArrowLeft")g=f-1;else if(m&&l.key==="ArrowDown")g=f+1;else if(m&&l.key==="ArrowUp")g=f-1;else if(l.key==="Home")g=0;else if(l.key==="End")g=d.length-1;else return;l.preventDefault(),a?g=(g%d.length+d.length)%d.length:g=Math.max(0,Math.min(d.length-1,g)),d.forEach((p,v)=>{p.tabIndex=v===g?0:-1}),(y=d[g])==null||y.focus()};return s.addEventListener("keydown",o),()=>s.removeEventListener("keydown",o)},[e,r,a,n])}function _i(e){const t=c.useRef(null);c.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const Ar=({children:e,as:t="span"})=>c.createElement(t,{style:tt},e);Ar.displayName="NiceVisuallyHidden";const Er=({targetId:e,children:t="Skip to main content"})=>x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:r=>{r.preventDefault();const a=document.getElementById(e);a&&(a.tabIndex=-1,a.focus())},children:t});Er.displayName="NiceSkipLink";const Wi={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{key:"Space",description:"Toggle selection",descriptionKey:"shortcuts.toggleSelect"},undo:{key:"Z",description:"Undo",descriptionKey:"shortcuts.undo",modifiers:["ctrl"]},redo:{key:"Y",description:"Redo",descriptionKey:"shortcuts.redo",modifiers:["ctrl"]},copy:{key:"C",description:"Copy",descriptionKey:"shortcuts.copy",modifiers:["ctrl"]},paste:{key:"V",description:"Paste",descriptionKey:"shortcuts.paste",modifiers:["ctrl"]},cut:{key:"X",description:"Cut",descriptionKey:"shortcuts.cut",modifiers:["ctrl"]},edit:{key:"Enter",description:"Edit cell",descriptionKey:"shortcuts.edit"},tab:{key:"Tab",description:"Next cell",descriptionKey:"shortcuts.tab"},shiftTab:{key:"Tab",description:"Previous cell",descriptionKey:"shortcuts.shiftTab",modifiers:["shift"]},open:{key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Nr(e){var r,a,n,s;const t=[];return(r=e.modifiers)!=null&&r.includes("ctrl")&&t.push("Ctrl"),(a=e.modifiers)!=null&&a.includes("alt")&&t.push("Alt"),(n=e.modifiers)!=null&&n.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Vi(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const a=t.modifiers??[];return!(a.includes("ctrl")!==(e.ctrlKey||e.metaKey)||a.includes("alt")!==e.altKey||a.includes("shift")!==e.shiftKey)}const Lr=({shortcuts:e,position:t="top",icon:r,size:a="sm",className:n})=>{const[s,i]=c.useState(!1),o=c.useRef(null),[l,d]=c.useState({top:0,left:0}),u=c.useCallback(()=>{if(!o.current)return;const h=o.current.getBoundingClientRect(),m=8;let y=0,p=0;switch(t){case"top":y=h.top-m,p=h.left+h.width/2;break;case"bottom":y=h.bottom+m,p=h.left+h.width/2;break;case"left":y=h.top+h.height/2,p=h.left-m;break;case"right":y=h.top+h.height/2,p=h.right+m;break}d({top:y,left:p})},[t]),f=c.useCallback(()=>{u(),i(!0)},[u]),g=c.useCallback(()=>{u(),i(!0)},[u]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:o,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:f,onMouseLeave:()=>i(!1),onFocus:g,onBlur:()=>i(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),s&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:l.top,left:l.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[x.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((h,m)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[x.jsx("kbd",{className:"nice-keyboard-hint__key",children:Nr(h)}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:h.description})]},m))})]})]})};Lr.displayName="NiceKeyboardHint";function Xi(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:s=!0}=e;return c.useCallback(i=>{!t||!r||i.key==="Enter"&&(n&&!i.ctrlKey&&!i.metaKey||s&&i.target.tagName==="TEXTAREA"||(a&&i.preventDefault(),r()))},[t,r,a,n,s])}function Ui(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:s=!0,as:i,selected:o}=e,l=a??i??"button",d=c.useCallback(g=>{r||t==null||t(g)},[r,t]),u=c.useCallback(g=>{if(r)return;const h=s&&(g.key===" "||g.key==="Spacebar");(g.key==="Enter"||h)&&(g.preventDefault(),t==null||t(g))},[r,t,s]),f={role:l,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),o!==void 0&&(l==="option"||l==="tab"||l==="row")&&(f["aria-selected"]=o),f}function qi(e={}){const[t,r]=c.useState(!1),[a,n]=c.useState(""),s=c.useRef(null),i=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=c.useCallback(u=>{if(!e.commands)return;const f=u.toLowerCase().trim();for(const g of e.commands)if(typeof g.phrase=="string"){if(f===g.phrase.toLowerCase()){g.action([],u);return}}else{const h=u.match(g.phrase);if(h){g.action(Array.from(h),u);return}}},[e.commands]),l=c.useCallback(()=>{if(!i||t)return;const u=window.SpeechRecognition??window.webkitSpeechRecognition,f=new u;f.lang=e.language??"en-US",f.continuous=e.continuous??!0,f.interimResults=e.interimResults??!1,f.onresult=g=>{var p;const h=g.results[g.results.length-1],m=h[0].transcript,y=h.isFinal;n(m),(p=e.onTranscript)==null||p.call(e,m,y),y&&o(m)},f.onerror=g=>{var h;(h=e.onError)==null||h.call(e,g.error),g.error==="not-allowed"&&r(!1)},f.onend=()=>{if(t&&e.continuous)try{f.start()}catch{r(!1)}else r(!1)},s.current=f,f.start(),r(!0)},[i,t,e.language,e.continuous]),d=c.useCallback(()=>{var u;(u=s.current)==null||u.stop(),s.current=null,r(!1)},[]);return c.useEffect(()=>()=>d(),[]),{isListening:t,isSupported:i,start:l,stop:d,transcript:a}}function Tr(e={}){const[t,r]=c.useState(""),a=c.useRef(),n=c.useCallback(i=>{r(""),requestAnimationFrame(()=>{r(i),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const s={role:"status","aria-live":e.politeness??"polite","aria-atomic":e.atomic??!0,"aria-relevant":e.relevant??"additions text",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}};return{message:t,announce:n,regionProps:s}}function Gi(){const{announce:e,regionProps:t,message:r}=Tr({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:c.useCallback(n=>{e(`Nawigacja do: ${n}`),typeof document<"u"&&(document.title=n)},[e]),regionProps:t,message:r}}function Ki(){const e=c.useRef(null),t=c.useCallback(()=>{var s;const n=(s=e.current)==null?void 0:s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=c.useCallback(n=>{var s,i;(i=(s=e.current)==null?void 0:s.querySelector(n))==null||i.focus()},[]),a=c.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]);return{containerRef:e,focusFirst:t,focusElement:r,getFocusableElements:a}}const jt={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function Ji(e=jt){const[t,r]=c.useState({...jt,...e}),a=c.useCallback((o,l)=>{r(d=>({...d,[o]:l}))},[]),n=Yi(t),s=[t.simplifiedMode&&"nice-a11y-simplified",t.increasedSpacing&&"nice-a11y-spacing",t.enhancedFocus&&"nice-a11y-enhanced-focus",t.reduceMotion&&"nice-a11y-reduce-motion",t.iconLabels&&"nice-a11y-icon-labels",t.largeTargets&&"nice-a11y-large-targets",t.dyslexiaFont&&"nice-a11y-dyslexia"].filter(Boolean).join(" "),i={};return t.lineSpacing&&t.lineSpacing!==1.5&&(i.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(i.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:s,rootStyle:i}}function Yi(e){const t=[];return e.simplifiedMode&&t.push(`
|
|
18
|
+
`,document.body.appendChild(a);const n=getComputedStyle(a);t({top:parseInt(n.paddingTop,10)||0,right:parseInt(n.paddingRight,10)||0,bottom:parseInt(n.paddingBottom,10)||0,left:parseInt(n.paddingLeft,10)||0}),document.body.removeChild(a)};return r(),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),e}function pr(e="normal"){return typeof e=="number"?e:e==="fast"?120:e==="slow"?300:200}const Ze={fade:"nice-anim-fade-enter",slideUp:"nice-anim-slide-up-enter",slideDown:"nice-anim-slide-down-enter",slideLeft:"nice-anim-slide-left-enter",slideRight:"nice-anim-slide-right-enter",scaleUp:"nice-anim-scale-up-enter",scaleDown:"nice-anim-scale-down-enter",zoom:"nice-anim-zoom-enter",flip:"nice-anim-flip-enter",none:""},gr={fade:"nice-anim-fade-exit",slideUp:"nice-anim-slide-up-exit",slideDown:"nice-anim-slide-down-exit",slideLeft:"nice-anim-slide-left-exit",slideRight:"nice-anim-slide-right-exit",scaleUp:"nice-anim-scale-up-exit",scaleDown:"nice-anim-scale-down-exit",zoom:"nice-anim-zoom-exit",flip:"nice-anim-flip-exit",none:""};function Mi(e){const{visible:t,animation:r="fade",duration:a="normal",onEntered:n,onExited:s}=e,[i,o]=c.useState(t?"entered":"exited"),[l,d]=c.useState(t),u=c.useRef(),f=pr(a),p=c.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[]),h=p||r==="none"?0:f;c.useEffect(()=>(u.current&&clearTimeout(u.current),t?(d(!0),o("entering"),u.current=setTimeout(()=>{o("entered"),n==null||n()},h)):(o("exiting"),u.current=setTimeout(()=>{o("exited"),d(!1),s==null||s()},h)),()=>{u.current&&clearTimeout(u.current)}),[t,h]);const m=c.useMemo(()=>r==="none"||p?"":i==="entering"?Ze[r]:i==="exiting"?gr[r]:i==="entered"?`${Ze[r]} nice-anim-active`:"",[r,i,p]),y=c.useMemo(()=>({animationDuration:`${h}ms`,transitionDuration:`${h}ms`}),[h]);return{state:i,shouldRender:l,className:m,style:y}}function Ci(e,t){const{expanded:r,duration:a="normal"}=t,[n,s]=c.useState(r?"auto":0),i=pr(a);return c.useEffect(()=>{const o=e.current;if(o)if(r){const l=o.scrollHeight;s(l);const d=setTimeout(()=>s("auto"),i);return()=>clearTimeout(d)}else{const l=o.scrollHeight;s(l),requestAnimationFrame(()=>{requestAnimationFrame(()=>s(0))})}},[r,i,e]),{overflow:"hidden",height:typeof n=="number"?`${n}px`:n,transition:`height ${i}ms ease`}}function Ai(e,t=50){return`${e*t}ms`}function Ei(e,t){return t==="enter"?Ze[e]:gr[e]}const yr=c.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})}),hr=({direction:e,children:t})=>{const r=c.useMemo(()=>e!=="auto"?e:typeof document<"u"&&document.documentElement.getAttribute("dir")==="rtl"?"rtl":"ltr",[e]),a=r==="rtl";c.useEffect(()=>(e!=="auto"&&(document.documentElement.setAttribute("dir",r),document.documentElement.style.direction=r),()=>{e!=="auto"&&(document.documentElement.removeAttribute("dir"),document.documentElement.style.direction="")}),[e,r]);const n=c.useCallback(o=>a?{left:"right",right:"left",start:"end",end:"start"}[o]??o:o,[a]),s=c.useCallback((o,l)=>a?{[{paddingLeft:"paddingRight",paddingRight:"paddingLeft",marginLeft:"marginRight",marginRight:"marginLeft"}[o]||o]:l}:{[o]:l},[a]),i=c.useMemo(()=>({direction:r,isRTL:a,flip:n,flipStyle:s}),[r,a,n,s]);return x.jsx(yr.Provider,{value:i,children:x.jsx("div",{dir:r,style:{direction:r,display:"contents"},children:t})})};hr.displayName="NiceRTLProvider";function Ni(){return c.useContext(yr)}const Li={marginStart:"marginInlineStart",marginEnd:"marginInlineEnd",paddingStart:"paddingInlineStart",paddingEnd:"paddingInlineEnd",borderStart:"borderInlineStart",borderEnd:"borderInlineEnd",insetStart:"insetInlineStart",insetEnd:"insetInlineEnd",start:"insetInlineStart",end:"insetInlineEnd",textAlign:{start:"start",end:"end"}},br=c.createContext({permissions:{},getAccessMode:()=>"full"}),vr=({permissions:e,children:t})=>{const r=c.useMemo(()=>({permissions:e,getAccessMode:(a,n)=>{var s,i;return n&&a&&((s=e.fields)!=null&&s[`${a}.${n}`])?e.fields[`${a}.${n}`]:a&&((i=e.components)!=null&&i[a])?e.components[a]:e.defaultMode??"full"}}),[e]);return x.jsx(br.Provider,{value:r,children:t})};vr.displayName="NiceAccessControl";function Ti(e,t,r){const a=c.useContext(br);return e||a.getAccessMode(t,r)}function Ri(e){switch(e){case"disabled":return{disabled:!0,"aria-disabled":!0,tabIndex:-1};case"readOnly":return{readOnly:!0};default:return{}}}function Ii(e={}){const{threshold:t=50,maxDuration:r=300,onSwipe:a,onSwipeLeft:n,onSwipeRight:s,onSwipeUp:i,onSwipeDown:o,enabled:l=!0}=e,d=c.useRef(null),[u,f]=c.useState(!1),[p,h]=c.useState(null),m=c.useRef(null);return c.useEffect(()=>{const y=d.current;if(!y||!l)return;const g=w=>{if(w.touches.length!==1)return;const A=w.touches[0];m.current={x:A.clientX,y:A.clientY,timestamp:Date.now()},f(!0),h(null)},v=w=>{if(!m.current||w.touches.length!==1)return;const A=w.touches[0],k=A.clientX-m.current.x,C=A.clientY-m.current.y;Math.abs(k)>Math.abs(C)?h(k>0?"right":"left"):h(C>0?"down":"up")},b=w=>{if(!m.current)return;const A=w.changedTouches[0],k={x:A.clientX,y:A.clientY,timestamp:Date.now()},C=k.x-m.current.x,M=k.y-m.current.y,N=k.timestamp-m.current.timestamp,L=Math.sqrt(C*C+M*M),E=L/N;if(f(!1),N<=r&&L>=t){let R;Math.abs(C)>Math.abs(M)?R=C>0?"right":"left":R=M>0?"down":"up";const T={direction:R,distance:L,velocity:E,duration:N};switch(a==null||a(T),R){case"left":n==null||n(T);break;case"right":s==null||s(T);break;case"up":i==null||i(T);break;case"down":o==null||o(T);break}}m.current=null,h(null)},S=()=>{m.current=null,f(!1),h(null)};return y.addEventListener("touchstart",g,{passive:!0}),y.addEventListener("touchmove",v,{passive:!0}),y.addEventListener("touchend",b,{passive:!0}),y.addEventListener("touchcancel",S,{passive:!0}),()=>{y.removeEventListener("touchstart",g),y.removeEventListener("touchmove",v),y.removeEventListener("touchend",b),y.removeEventListener("touchcancel",S)}},[l,t,r,a,n,s,i,o]),{ref:d,isSwiping:u,swipeDirection:p}}function zi(e={}){const{onPinch:t,onPinchStart:r,onPinchEnd:a,minScale:n=.5,maxScale:s=3,enabled:i=!0}=e,o=c.useRef(null),[l,d]=c.useState(1),[u,f]=c.useState(!1),p=c.useRef(null),h=c.useRef(1);return c.useEffect(()=>{const m=o.current;if(!m||!i)return;const y=(w,A)=>{const k=w.clientX-A.clientX,C=w.clientY-A.clientY;return Math.sqrt(k*k+C*C)},g=(w,A)=>({x:(w.clientX+A.clientX)/2,y:(w.clientY+A.clientY)/2}),v=w=>{w.touches.length===2&&(p.current=y(w.touches[0],w.touches[1]),h.current=l,f(!0),r==null||r())},b=w=>{if(w.touches.length!==2||!p.current)return;const A=y(w.touches[0],w.touches[1]),k=Math.min(s,Math.max(n,h.current*(A/p.current)));d(k),t==null||t({scale:k,center:g(w.touches[0],w.touches[1])})},S=()=>{u&&(f(!1),a==null||a(l),p.current=null)};return m.addEventListener("touchstart",v,{passive:!0}),m.addEventListener("touchmove",b,{passive:!0}),m.addEventListener("touchend",S,{passive:!0}),m.addEventListener("touchcancel",S,{passive:!0}),()=>{m.removeEventListener("touchstart",v),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",S),m.removeEventListener("touchcancel",S)}},[i,l,u,n,s,t,r,a]),{ref:o,scale:l,isPinching:u}}function Di(e={}){const{onPan:t,onPanStart:r,onPanEnd:a,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(0),[u,f]=c.useState(0),p=c.useRef(null),h=c.useRef(null);return c.useEffect(()=>{const m=s.current;if(!m||!n)return;const y=b=>{if(b.touches.length!==1)return;const S=b.touches[0],w={x:S.clientX,y:S.clientY,timestamp:Date.now()};p.current=w,h.current=w,o(!0),d(0),f(0),r==null||r()},g=b=>{if(!p.current||!h.current||b.touches.length!==1)return;const S=b.touches[0],w=Date.now(),A={x:S.clientX,y:S.clientY,timestamp:w},k=A.x-p.current.x,C=A.y-p.current.y,M=A.timestamp-h.current.timestamp||1,N=(A.x-h.current.x)/M,L=(A.y-h.current.y)/M;d(k),f(C),t==null||t({deltaX:k,deltaY:C,velocityX:N,velocityY:L}),h.current=A},v=()=>{if(!i||!p.current||!h.current)return;const b=l,S=u,w=h.current.timestamp-p.current.timestamp||1;a==null||a({deltaX:b,deltaY:S,velocityX:b/w,velocityY:S/w}),o(!1),p.current=null,h.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!0}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,i,l,u,t,r,a]),{ref:s,isPanning:i,deltaX:l,deltaY:u}}function Sr(e){const{onRefresh:t,threshold:r=80,maxPull:a=120,enabled:n=!0}=e,s=c.useRef(null),[i,o]=c.useState(!1),[l,d]=c.useState(!1),[u,f]=c.useState(0),p=c.useRef(null),h=Math.min(1,u/r);return c.useEffect(()=>{const m=s.current;if(!m||!n||l)return;const y=b=>{m.scrollTop>0||b.touches.length===1&&(p.current=b.touches[0].clientY)},g=b=>{if(p.current===null||b.touches.length!==1)return;const w=b.touches[0].clientY-p.current;if(w<=0){f(0),o(!1);return}const k=Math.min(a,w*.5);f(k),o(k>0),k>0&&b.preventDefault()},v=async()=>{if(u>=r&&!l){d(!0),f(r);try{await t()}finally{d(!1),f(0)}}else f(0);o(!1),p.current=null};return m.addEventListener("touchstart",y,{passive:!0}),m.addEventListener("touchmove",g,{passive:!1}),m.addEventListener("touchend",v,{passive:!0}),m.addEventListener("touchcancel",v,{passive:!0}),()=>{m.removeEventListener("touchstart",y),m.removeEventListener("touchmove",g),m.removeEventListener("touchend",v),m.removeEventListener("touchcancel",v)}},[n,l,u,r,a,t]),{ref:s,isPulling:i,isRefreshing:l,pullDistance:u,pullProgress:h}}const Pi=({children:e,leftActions:t=[],rightActions:r=[],actionWidth:a=80,maxSwipe:n=1.5,threshold:s=.5,className:i,style:o})=>{const l=c.useRef(null),d=c.useRef(null),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(0),y=c.useRef(0),g=t.length*a,v=r.length*a,b=g*n,S=v*n,w=c.useCallback(N=>{h(!1),m.current=N.touches[0].clientX,y.current=u},[u]),A=c.useCallback(N=>{const L=N.touches[0].clientX-m.current;let E=y.current+L;E>b?E=b+(E-b)*.2:E<-S&&(E=-S+(E+S)*.2),!(E>0&&t.length===0)&&(E<0&&r.length===0||f(E))},[b,S,t.length,r.length]),k=c.useCallback(()=>{h(!0),u>g*s?f(g):u<-v*s?f(-v):f(0)},[u,g,v,s]),C=c.useCallback(N=>{h(!0),f(0),N.onAction()},[]),M=c.useCallback(()=>{h(!0),f(0)},[]);return x.jsxs("div",{ref:l,className:`nice-swipeable ${i||""}`,style:{...o,position:"relative",overflow:"hidden"},children:[x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--left",style:{position:"absolute",left:0,top:0,bottom:0,display:"flex",width:g},children:t.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{className:"nice-swipeable__actions nice-swipeable__actions--right",style:{position:"absolute",right:0,top:0,bottom:0,display:"flex",width:v},children:r.map(N=>x.jsx("button",{className:"nice-swipeable__action",style:{width:a,background:N.color,border:"none",color:"var(--bg-primary, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>C(N),children:N.content},N.key))}),x.jsx("div",{ref:d,className:"nice-swipeable__content",style:{transform:`translateX(${u}px)`,transition:p?"transform 0.3s ease-out":"none",background:"var(--bg-primary, #fff)",position:"relative",zIndex:1},onTouchStart:w,onTouchMove:A,onTouchEnd:k,onClick:u!==0?M:void 0,children:e})]})},Fi=({children:e,onRefresh:t,threshold:r=80,pullingContent:a,refreshingContent:n,enabled:s=!0,className:i,style:o})=>{const{ref:l,isPulling:d,isRefreshing:u,pullDistance:f,pullProgress:p}=Sr({onRefresh:t,threshold:r,enabled:s});return x.jsxs("div",{ref:l,className:`nice-pull-refresh ${i||""}`,style:{...o,position:"relative",overflow:"auto",overscrollBehavior:"contain"},children:[x.jsx("div",{className:"nice-pull-refresh__indicator",style:{position:"absolute",top:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",height:f,overflow:"hidden",transition:d?"none":"height 0.2s ease-out"},children:u?n||x.jsx("div",{className:"nice-pull-refresh__spinner",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):a||x.jsx("div",{className:"nice-pull-refresh__arrow",style:{transform:`rotate(${p>=1?180:0}deg)`,transition:"transform 0.2s ease",opacity:p},children:x.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})})}),x.jsx("div",{className:"nice-pull-refresh__content",style:{transform:`translateY(${f}px)`,transition:d?"none":"transform 0.2s ease-out"},children:e})]})};function xr(e="light"){if(!("vibrate"in navigator))return;const t={light:10,medium:20,heavy:30,selection:5,success:[10,30,10],warning:[20,20,20],error:[30,30,30,30]};try{navigator.vibrate(t[e])}catch{}}function Hi(){return c.useCallback((e="light")=>{xr(e)},[])}const $i=({minSize:e=44,children:t,className:r,style:a,onClick:n})=>x.jsx("div",{className:`nice-touch-target ${r||""}`,style:{...a,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:e,minHeight:e,cursor:n?"pointer":void 0},onClick:n,children:t});function ji(){const[e,t]=c.useState(!1),[r,a]=c.useState(0),n=c.useRef(typeof window<"u"?window.innerHeight:0);return c.useEffect(()=>{if(typeof window>"u")return;if("visualViewport"in window&&window.visualViewport){const i=window.visualViewport,o=()=>{const l=n.current-i.height,d=150;t(l>d),a(l>d?l:0)};return i.addEventListener("resize",o),()=>i.removeEventListener("resize",o)}const s=()=>{const i=n.current-window.innerHeight,o=150;t(i>o),a(i>o?i:0)};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),{isKeyboardVisible:e,keyboardHeight:r}}const wr={announceChanges:!0,reduceMotion:"auto",highContrast:"auto",focusStyle:"auto",keyboardShortcuts:!0,minTouchTarget:44},kr=c.createContext(null),Mr=({config:e,children:t})=>{const r=c.useMemo(()=>({...wr,...e}),[e]),a=c.useRef(null),n=c.useRef(null),[s,i]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");i(h.matches);const m=y=>i(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const[o,l]=c.useState(!1);c.useEffect(()=>{const h=window.matchMedia("(prefers-contrast: more)");l(h.matches);const m=y=>l(y.matches);return h.addEventListener("change",m),()=>h.removeEventListener("change",m)},[]);const d=r.reduceMotion==="always"?!0:r.reduceMotion==="never"?!1:s,u=r.highContrast==="always"?!0:r.highContrast==="never"?!1:o,f=c.useCallback((h,m="polite")=>{if(!r.announceChanges)return;const y=m==="assertive"?n.current:a.current;y&&(y.textContent="",requestAnimationFrame(()=>{y.textContent=h}))},[r.announceChanges]),p=c.useMemo(()=>({config:r,announce:f,prefersReducedMotion:d,prefersHighContrast:u}),[r,f,d,u]);return x.jsxs(kr.Provider,{value:p,children:[t,x.jsx("div",{ref:a,role:"status","aria-live":"polite","aria-atomic":"true",style:et}),x.jsx("div",{ref:n,role:"alert","aria-live":"assertive","aria-atomic":"true",style:et})]})};Mr.displayName="NiceA11yProvider";function Bi(){const e=c.useContext(kr);return e||{config:wr,announce:()=>{},prefersReducedMotion:!1,prefersHighContrast:!1}}const et={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};function Cr(...e){const t=e.filter(Boolean);return t.length>0?t.join(" "):void 0}function Oi(e){const t=e.error?`${e.id}-error`:void 0,r=e.helperText?`${e.id}-helper`:void 0;return{"aria-invalid":e.error?!0:void 0,"aria-required":e.required||void 0,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readOnly||void 0,"aria-describedby":Cr(t,r),"aria-errormessage":t}}function _i(e,t){const{direction:r,wrap:a=!0,itemSelector:n='[role="option"], [role="tab"], [role="menuitem"], [role="radio"], button, a, [tabindex]'}=t;c.useEffect(()=>{const s=e.current;if(!s)return;const i=()=>Array.from(s.querySelectorAll(n)).filter(l=>!l.hasAttribute("disabled")&&l.getAttribute("aria-disabled")!=="true"),o=l=>{var y;const d=i();if(d.length===0)return;const u=document.activeElement,f=d.indexOf(u);if(f===-1)return;let p=-1;const h=r==="horizontal"||r==="both"||r==="grid",m=r==="vertical"||r==="both"||r==="grid";if(h&&l.key==="ArrowRight")p=f+1;else if(h&&l.key==="ArrowLeft")p=f-1;else if(m&&l.key==="ArrowDown")p=f+1;else if(m&&l.key==="ArrowUp")p=f-1;else if(l.key==="Home")p=0;else if(l.key==="End")p=d.length-1;else return;l.preventDefault(),a?p=(p%d.length+d.length)%d.length:p=Math.max(0,Math.min(d.length-1,p)),d.forEach((g,v)=>{g.tabIndex=v===p?0:-1}),(y=d[p])==null||y.focus()};return s.addEventListener("keydown",o),()=>s.removeEventListener("keydown",o)},[e,r,a,n])}function Wi(e){const t=c.useRef(null);c.useEffect(()=>(e&&(t.current=document.activeElement),()=>{e&&t.current&&typeof t.current.focus=="function"&&t.current.focus()}),[e])}const Ar=({children:e,as:t="span"})=>c.createElement(t,{style:et},e);Ar.displayName="NiceVisuallyHidden";const Er=({targetId:e,children:t="Skip to main content"})=>x.jsx("a",{href:`#${e}`,className:"nice-skip-link",onClick:r=>{r.preventDefault();const a=document.getElementById(e);a&&(a.tabIndex=-1,a.focus())},children:t});Er.displayName="NiceSkipLink";const Vi={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},clear:{key:"Delete",description:"Clear value",descriptionKey:"shortcuts.clear",modifiers:["ctrl"]},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},selectAll:{key:"A",description:"Select all",descriptionKey:"shortcuts.selectAll",modifiers:["ctrl"]},toggleSelect:{key:"Space",description:"Toggle selection",descriptionKey:"shortcuts.toggleSelect"},undo:{key:"Z",description:"Undo",descriptionKey:"shortcuts.undo",modifiers:["ctrl"]},redo:{key:"Y",description:"Redo",descriptionKey:"shortcuts.redo",modifiers:["ctrl"]},copy:{key:"C",description:"Copy",descriptionKey:"shortcuts.copy",modifiers:["ctrl"]},paste:{key:"V",description:"Paste",descriptionKey:"shortcuts.paste",modifiers:["ctrl"]},cut:{key:"X",description:"Cut",descriptionKey:"shortcuts.cut",modifiers:["ctrl"]},edit:{key:"Enter",description:"Edit cell",descriptionKey:"shortcuts.edit"},tab:{key:"Tab",description:"Next cell",descriptionKey:"shortcuts.tab"},shiftTab:{key:"Tab",description:"Previous cell",descriptionKey:"shortcuts.shiftTab",modifiers:["shift"]},open:{key:"ArrowDown",description:"Open dropdown",descriptionKey:"shortcuts.open"},close:{key:"Escape",description:"Close popup",descriptionKey:"shortcuts.close"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function Nr(e){var r,a,n,s;const t=[];return(r=e.modifiers)!=null&&r.includes("ctrl")&&t.push("Ctrl"),(a=e.modifiers)!=null&&a.includes("alt")&&t.push("Alt"),(n=e.modifiers)!=null&&n.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function Xi(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const a=t.modifiers??[];return!(a.includes("ctrl")!==(e.ctrlKey||e.metaKey)||a.includes("alt")!==e.altKey||a.includes("shift")!==e.shiftKey)}const Lr=({shortcuts:e,position:t="top",icon:r,size:a="sm",className:n})=>{const[s,i]=c.useState(!1),o=c.useRef(null),[l,d]=c.useState({top:0,left:0}),u=c.useCallback(()=>{if(!o.current)return;const h=o.current.getBoundingClientRect(),m=8;let y=0,g=0;switch(t){case"top":y=h.top-m,g=h.left+h.width/2;break;case"bottom":y=h.bottom+m,g=h.left+h.width/2;break;case"left":y=h.top+h.height/2,g=h.left-m;break;case"right":y=h.top+h.height/2,g=h.right+m;break}d({top:y,left:g})},[t]),f=c.useCallback(()=>{u(),i(!0)},[u]),p=c.useCallback(()=>{u(),i(!0)},[u]);return e.length===0?null:x.jsxs(x.Fragment,{children:[x.jsx("button",{ref:o,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${a} ${n||""}`,onMouseEnter:f,onMouseLeave:()=>i(!1),onFocus:p,onBlur:()=>i(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:r||"?"}),s&&x.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:l.top,left:l.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[x.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),x.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((h,m)=>x.jsxs("li",{className:"nice-keyboard-hint__item",children:[x.jsx("kbd",{className:"nice-keyboard-hint__key",children:Nr(h)}),x.jsx("span",{className:"nice-keyboard-hint__desc",children:h.description})]},m))})]})]})};Lr.displayName="NiceKeyboardHint";function Ui(e={}){const{enabled:t=!1,onSubmit:r,preventDefault:a=!0,requireCtrl:n=!1,skipTextarea:s=!0}=e;return c.useCallback(i=>{!t||!r||i.key==="Enter"&&(n&&!i.ctrlKey&&!i.metaKey||s&&i.target.tagName==="TEXTAREA"||(a&&i.preventDefault(),r()))},[t,r,a,n,s])}function qi(e={}){const{onClick:t,disabled:r=!1,role:a,tabIndex:n,triggerOnSpace:s=!0,as:i,selected:o}=e,l=a??i??"button",d=c.useCallback(p=>{r||t==null||t(p)},[r,t]),u=c.useCallback(p=>{if(r)return;const h=s&&(p.key===" "||p.key==="Spacebar");(p.key==="Enter"||h)&&(p.preventDefault(),t==null||t(p))},[r,t,s]),f={role:l,tabIndex:n??(r?-1:0),onClick:d,onKeyDown:u};return r&&(f["aria-disabled"]=!0),o!==void 0&&(l==="option"||l==="tab"||l==="row")&&(f["aria-selected"]=o),f}function Gi(e={}){const[t,r]=c.useState(!1),[a,n]=c.useState(""),s=c.useRef(null),i=typeof window<"u"&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window),o=c.useCallback(u=>{if(!e.commands)return;const f=u.toLowerCase().trim();for(const p of e.commands)if(typeof p.phrase=="string"){if(f===p.phrase.toLowerCase()){p.action([],u);return}}else{const h=u.match(p.phrase);if(h){p.action(Array.from(h),u);return}}},[e.commands]),l=c.useCallback(()=>{if(!i||t)return;const u=window.SpeechRecognition??window.webkitSpeechRecognition,f=new u;f.lang=e.language??"en-US",f.continuous=e.continuous??!0,f.interimResults=e.interimResults??!1,f.onresult=p=>{var g;const h=p.results[p.results.length-1],m=h[0].transcript,y=h.isFinal;n(m),(g=e.onTranscript)==null||g.call(e,m,y),y&&o(m)},f.onerror=p=>{var h;(h=e.onError)==null||h.call(e,p.error),p.error==="not-allowed"&&r(!1)},f.onend=()=>{if(t&&e.continuous)try{f.start()}catch{r(!1)}else r(!1)},s.current=f,f.start(),r(!0)},[i,t,e.language,e.continuous]),d=c.useCallback(()=>{var u;(u=s.current)==null||u.stop(),s.current=null,r(!1)},[]);return c.useEffect(()=>()=>d(),[]),{isListening:t,isSupported:i,start:l,stop:d,transcript:a}}function Tr(e={}){const[t,r]=c.useState(""),a=c.useRef(),n=c.useCallback(i=>{r(""),requestAnimationFrame(()=>{r(i),e.clearAfterMs&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(""),e.clearAfterMs))})},[e.clearAfterMs]);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const s={role:"status","aria-live":e.politeness??"polite","aria-atomic":e.atomic??!0,"aria-relevant":e.relevant??"additions text",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}};return{message:t,announce:n,regionProps:s}}function Ki(){const{announce:e,regionProps:t,message:r}=Tr({politeness:"assertive",clearAfterMs:3e3});return{announcePageChange:c.useCallback(n=>{e(`Nawigacja do: ${n}`),typeof document<"u"&&(document.title=n)},[e]),regionProps:t,message:r}}function Ji(){const e=c.useRef(null),t=c.useCallback(()=>{var s;const n=(s=e.current)==null?void 0:s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');n==null||n.focus()},[]),r=c.useCallback(n=>{var s,i;(i=(s=e.current)==null?void 0:s.querySelector(n))==null||i.focus()},[]),a=c.useCallback(()=>e.current?Array.from(e.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]);return{containerRef:e,focusFirst:t,focusElement:r,getFocusableElements:a}}const jt={simplifiedMode:!1,increasedSpacing:!1,readingGuide:!1,enhancedFocus:!1,reduceMotion:!1,iconLabels:!1,largeTargets:!1,dyslexiaFont:!1,lineSpacing:1.5,wordSpacing:1};function Yi(e=jt){const[t,r]=c.useState({...jt,...e}),a=c.useCallback((o,l)=>{r(d=>({...d,[o]:l}))},[]),n=Qi(t),s=[t.simplifiedMode&&"nice-a11y-simplified",t.increasedSpacing&&"nice-a11y-spacing",t.enhancedFocus&&"nice-a11y-enhanced-focus",t.reduceMotion&&"nice-a11y-reduce-motion",t.iconLabels&&"nice-a11y-icon-labels",t.largeTargets&&"nice-a11y-large-targets",t.dyslexiaFont&&"nice-a11y-dyslexia"].filter(Boolean).join(" "),i={};return t.lineSpacing&&t.lineSpacing!==1.5&&(i.lineHeight=String(t.lineSpacing)),t.wordSpacing&&t.wordSpacing!==1&&(i.wordSpacing=`${(t.wordSpacing-1)*.25}em`),{settings:t,updateSetting:a,css:n,rootClasses:s,rootStyle:i}}function Qi(e){const t=[];return e.simplifiedMode&&t.push(`
|
|
19
19
|
.nice-a11y-simplified .nice-secondary,
|
|
20
20
|
.nice-a11y-simplified .nice-decorative,
|
|
21
21
|
.nice-a11y-simplified [role="presentation"] { display: none !important; }
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
min-height: 56px !important; min-width: 56px !important; font-size: 18px !important;
|
|
36
36
|
}`),e.dyslexiaFont&&t.push(`
|
|
37
37
|
.nice-a11y-dyslexia { font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important; letter-spacing: 0.05em !important; }`),t.join(`
|
|
38
|
-
`)}function Qi(e,t,r=!1){const a=_t(Ot(e)),n=_t(Ot(t)),s=ec(a,n),i=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:s>=i,message:`Contrast ratio ${s.toFixed(2)}:1 (requires ${i}:1 for AAA${r?" large text":""})`}}function Zi(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var i;const a=((i=r.textContent)==null?void 0:i.trim())??"",n=!!r.getAttribute("aria-label");["click here","read more","learn more","here","link"].includes(a.toLowerCase())&&!n&&e.push({rule:"2.4.9",level:"AAA",passed:!1,message:`Link with generic text "${a}" lacks descriptive label`,element:r.outerHTML.slice(0,100)})}),document.querySelectorAll("h1, h2, h3, h4, h5, h6"),document.querySelectorAll("section, article, main, aside").forEach(r=>{r.querySelector("h1, h2, h3, h4, h5, h6")||e.push({rule:"2.4.10",level:"AAA",passed:!1,message:`<${r.tagName.toLowerCase()}> lacks a heading element`,element:r.tagName.toLowerCase()})}),document.querySelectorAll("p, li, td, span").forEach(r=>{const a=window.getComputedStyle(r),n=parseFloat(a.width),s=parseFloat(a.fontSize);s>0&&n/s>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/s)} chars)`,element:r.tagName.toLowerCase()})}),document.querySelectorAll('input[type="checkbox"], input[type="radio"], select').forEach(r=>{r.hasAttribute("onchange")&&e.push({rule:"3.2.5",level:"AAA",passed:!1,message:"Form control has inline onchange handler — may cause unexpected context change",element:r.tagName.toLowerCase()})}),document.querySelectorAll("video[autoplay], audio[autoplay]").forEach(r=>{e.push({rule:"2.2.3",level:"AAA",passed:!1,message:"Auto-playing media found — user should control timing",element:r.tagName.toLowerCase()})}),e}function Ot(e){if(e.startsWith("#")){const t=e.slice(1),r=parseInt(t.slice(0,2),16)/255,a=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255;return[r,a,n]}return[0,0,0]}function _t([e,t,r]){const a=n=>n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*a(e)+.7152*a(t)+.0722*a(r)}function ec(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const tc=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],Wt="nice2dev-color-blind-filters",Vt="nice2dev-color-blind-styles",rt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",protanomaly:"0.817 0.183 0 0 0 0.333 0.667 0 0 0 0 0.125 0.875 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",deuteranomaly:"0.8 0.2 0 0 0 0.258 0.742 0 0 0 0 0.142 0.858 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0",tritanomaly:"0.967 0.033 0 0 0 0 0.733 0.267 0 0 0 0.183 0.817 0 0 0 0 0 1 0",achromatopsia:"0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0 0 0 1 0",achromatomaly:"0.618 0.320 0.062 0 0 0.163 0.775 0.062 0 0 0.163 0.320 0.516 0 0 0 0 0 1 0"};function rc(){if(typeof document>"u"||document.getElementById(Wt))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=Wt,t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.overflow="hidden";const r=document.createElementNS(e,"defs");for(const[a,n]of Object.entries(rt)){const s=document.createElementNS(e,"filter");s.id=`nice-cb-${a}`,s.setAttribute("color-interpolation-filters","sRGB");const i=document.createElementNS(e,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values",n),s.appendChild(i),r.appendChild(s)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Vt)){const a=document.createElement("style");a.id=Vt,a.textContent=Object.keys(rt).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function ht(e){for(const t of Object.keys(rt))e.classList.remove(`nice-color-blind-${t}`)}function bt(e,t=typeof document<"u"?document.documentElement:null){t&&(rc(),ht(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function Rr(e,t={}){const{target:r}=t,a=c.useRef(null);c.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,bt(e,n),()=>{const s=a.current;s&&ht(s)}},[e,r])}function ac(e,t){if(typeof window>"u")return null;try{if(t==="cookie"){const a=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"=([^;]*)"));return a?decodeURIComponent(a[1]):null}const r=window[t].getItem(e);return r||null}catch{return null}}function nc(e,t,r,a){if(!(typeof window>"u"))try{if(r==="cookie"){document.cookie=`${e}=${encodeURIComponent(t)};path=/;max-age=${a};SameSite=Lax`;return}window[r].setItem(e,t)}catch{}}function sc(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:s=3600*24*60}=e,i=c.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const m=y=>{y.key===t&&h()};return window.addEventListener("storage",m),()=>window.removeEventListener("storage",m)},[r,t]),o=c.useCallback(()=>ac(t,r)??a,[r,t,a]),l=c.useCallback(()=>a,[a]),d=c.useSyncExternalStore(i,o,l),[u,f]=c.useState(d);c.useEffect(()=>{d!==u&&f(d)},[d]),Rr(u,{target:n});const g=c.useCallback(h=>{f(h),nc(t,h,r,s)},[r,t,s]);return[u,g]}function oc(e=typeof document<"u"?document.documentElement:null){return{set:t=>bt(t,e),clear:()=>{e&&ht(e)}}}const ic=e=>[...e],cc=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function lc(e={}){var g,h;const t=e.permissionPolicy??ic,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=cc();const n=(g=e.permissions)==null?void 0:g.canActivate,s={user:(h=e.permissions)==null?void 0:h.user},i=e.logger,o=new Map,l=new Map,d=new Map,u=(m,y)=>{const p=d.get(m);if(p)for(const v of p)try{v(y)}catch{}},f=(m,y,p)=>{const v=new Set(y);return{permissions:v,log:(b,...S)=>{i&&i(m.id,b,S)},on:(b,S)=>{let w=l.get(b);w||(w=new Set,l.set(b,w)),w.add(S);const A=()=>{w.delete(S)};return p.push(A),A},emit:(b,S)=>{if(!v.has("events:emit"))return;const w=l.get(b);if(w)for(const A of w)try{A(S)}catch{}},setItem:async(b,S)=>{v.has("storage:write")&&await a.setItem(`${m.id}:${b}`,S)},getItem:async b=>{if(v.has("storage:read"))return await a.getItem(`${m.id}:${b}`)}}};return{register(m){const y=m.manifest.id;if(o.has(y))throw new Error(`Plugin "${y}" already registered`);const p={manifest:m.manifest,status:"registered"};return o.set(y,{plugin:m,record:p,cleanups:[]}),u("register",p),p},unregister(m){return o.get(m)?(o.delete(m),!0):!1},async activate(m){const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status==="active")return y.record;for(const p of y.plugin.manifest.dependsOn??[]){const v=o.get(p);if(!v)throw y.record.status="error",y.record.error=`Missing dependency: ${p}`,u("error",y.record),new Error(y.record.error);v.record.status!=="active"&&await this.activate(p)}y.record.status="activating";try{if(n&&!n(y.plugin.manifest,s))throw y.record.status="error",y.record.error="permission-denied",u("error",y.record),new Error(y.record.error);const p=t(y.plugin.manifest.permissions??[],y.plugin.manifest),v=f(y.plugin.manifest,p,y.cleanups);await y.plugin.activate(v),y.record.status="active",y.record.activatedAt=Date.now(),y.record.error=void 0,u("activate",y.record)}catch(p){throw y.record.status="error",y.record.error=p instanceof Error?p.message:String(p),u("error",y.record),p}return y.record},async deactivate(m){var p,v;const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status!=="active")return y.record;y.record.status="deactivating";try{await((v=(p=y.plugin).deactivate)==null?void 0:v.call(p));for(const b of y.cleanups.splice(0))await b();y.record.status="inactive",u("deactivate",y.record)}catch(b){throw y.record.status="error",y.record.error=b instanceof Error?b.message:String(b),u("error",y.record),b}return y.record},list(){return[...o.values()].map(m=>({...m.record}))},get(m){const y=o.get(m);return y?{...y.record}:void 0},on(m,y){let p=d.get(m);return p||(p=new Set,d.set(m,p)),p.add(y),()=>{p.delete(y)}},events:{on(m,y){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[m];let b=d.get(v);return b||(b=new Set,d.set(v,b)),b.add(y),()=>{b.delete(y)}},emit(m,y){const p=l.get(m);if(p)for(const v of p)try{v(y)}catch{}}}}}function dc(...e){return e.join("-")}const uc={button:e=>e?`nice-button-${e}`:"nice-button",textInput:e=>e?`nice-text-input-${e}`:"nice-text-input",numberInput:e=>e?`nice-number-input-${e}`:"nice-number-input",select:e=>e?`nice-select-${e}`:"nice-select",checkbox:e=>e?`nice-checkbox-${e}`:"nice-checkbox",toggle:e=>e?`nice-toggle-${e}`:"nice-toggle",datePicker:e=>e?`nice-date-picker-${e}`:"nice-date-picker",dataGrid:e=>e?`nice-datagrid-${e}`:"nice-datagrid",table:e=>e?`nice-table-${e}`:"nice-table",list:e=>e?`nice-list-${e}`:"nice-list",treeView:e=>e?`nice-tree-${e}`:"nice-tree",modal:e=>e?`nice-modal-${e}`:"nice-modal",drawer:e=>e?`nice-drawer-${e}`:"nice-drawer",form:e=>e?`nice-form-${e}`:"nice-form",tabs:e=>e?`nice-tabs-${e}`:"nice-tabs",menu:e=>e?`nice-menu-${e}`:"nice-menu",chart:e=>e?`nice-chart-${e}`:"nice-chart",scheduler:e=>e?`nice-scheduler-${e}`:"nice-scheduler"},Ir=({children:e,direction:t="ltr"})=>c.createElement("div",{dir:t,"data-testid":"nice-test-root",style:{direction:t}},e);Ir.displayName="NiceTestWrapper";function fc(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function mc(e,t){var a,n;const r=((a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:a.set)||((n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value"))==null?void 0:n.set);r&&r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function pc(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(s=>setTimeout(s,r)),{data:[...n],totalCount:n.length}),insert:async s=>(n.push(s),s),update:async(s,i)=>{const o=n.findIndex(l=>l[a]===s);o>=0&&(n[o]={...n[o],...i})},remove:async s=>{n=n.filter(i=>i[a]!==s)},getData:()=>[...n],reset:()=>{n=[...t]}}}function gc(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(s=>{var o;s.getAttribute("aria-label")||s.getAttribute("aria-labelledby")||((o=s.textContent)==null?void 0:o.trim())||s.getAttribute("title")||t.push(`${s.tagName.toLowerCase()}${s.id?"#"+s.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(s=>{!s.alt&&s.getAttribute("role")!=="presentation"&&t.push(`img${s.src?'[src="'+s.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(s=>{const i=s.id&&e.querySelector(`label[for="${s.id}"]`),o=s.getAttribute("aria-label")||s.getAttribute("aria-labelledby");!i&&!o&&t.push(`${s.tagName.toLowerCase()}${s.name?'[name="'+s.name+'"]':""} missing label`)}),t}const zr=process.env.NODE_ENV==="development";let $={enabled:zr,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const je=[],J=new Map,Oe=new Map;let yc=1;function Dr(e){$={...$,...e}}function Pr(){return new Map(J)}function Fr(e){return J.get(e)}function hc(e=100){return je.slice(-e)}function vt(){je.length=0,J.clear(),Oe.clear()}function St(e){const t=e??$.slowRenderThreshold??16;return je.filter(r=>r.actualDuration>t)}function bc(){return Math.random()<($.samplingRate??1)}function vc(e){const t=J.get(e.componentName);t?(t.renderCount++,e.phase==="mount"?t.mountCount++:t.updateCount++,t.totalRenderTime+=e.actualDuration,t.avgRenderTime=t.totalRenderTime/t.renderCount,t.maxRenderTime=Math.max(t.maxRenderTime,e.actualDuration),t.minRenderTime=Math.min(t.minRenderTime,e.actualDuration),t.lastRenderAt=e.timestamp,e.actualDuration>($.slowRenderThreshold??16)&&t.slowRenderCount++):J.set(e.componentName,{componentName:e.componentName,renderCount:1,mountCount:e.phase==="mount"?1:0,updateCount:e.phase==="mount"?0:1,avgRenderTime:e.actualDuration,maxRenderTime:e.actualDuration,minRenderTime:e.actualDuration,totalRenderTime:e.actualDuration,lastRenderAt:e.timestamp,slowRenderCount:e.actualDuration>($.slowRenderThreshold??16)?1:0})}function G(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const Sc=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:s})=>{const i=c.useCallback((o,l,d,u,f,g)=>{var p,v,b;if(!$.enabled||!bc()||(p=$.ignoreComponents)!=null&&p.includes(o))return;const h={componentName:o,renderId:`render-${yc++}`,phase:l,actualDuration:d,baseDuration:u,startTime:f,commitTime:g,interactions:new Set,timestamp:Date.now()};if(je.push(h),vc(h),$.enableUserTiming)try{performance.measure(`Nice:${o}:${l}`,{start:f,duration:d})}catch{}if(s??$.logToConsole){const S=n??$.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${o} ${l}`,`color: ${w?"var(--color-error, #dc2626)":"var(--color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:G(d),base:G(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=$.onRender)==null||v.call($,h);const y=n??$.slowRenderThreshold??16;d>y&&(a==null||a(h),(b=$.onSlowRender)==null||b.call($,h))},[e,r,a,n,s]);return $.enabled?x.jsx(c.Profiler,{id:e,onRender:i,children:t}):x.jsx(x.Fragment,{children:t})};function Hr(e,t){const r=c.useRef(),a=c.useRef(0);c.useEffect(()=>{if(!$.enabled||!$.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,s=[],i=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const o of i){const l=n==null?void 0:n[o],d=t[o];Object.is(l,d)||s.push({propName:o,oldValue:l,newValue:d,timestamp:Date.now()})}s.length>0&&$.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,s.map(o=>({prop:o.propName,from:o.oldValue,to:o.newValue,type:typeof o.newValue}))),r.current=t})}function xc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Hr(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function wc(e){const t=c.useRef(0);return t.current++,c.useEffect(()=>{$.enabled&&$.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`)}),t.current}function _e(e,t){if(!$.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(Oe.set(e,r),$.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function We(e){if(!$.enabled)return 0;const t=Oe.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,$.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return $.logToConsole&&console.log(`%c[Measure] ${e}: ${G(r)}`,`color: ${r>100?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`),r}async function kc(e,t,r){_e(e,r);try{return await t()}finally{We(e)}}function Mc(e,t,r){_e(e,r);try{return t()}finally{We(e)}}function Cc(e,t,r){c.useEffect(()=>{_e(e);const a=t();return We(e),a},r)}function $r(){const e=Array.from(J.values()),t=St(),r=e.reduce((s,i)=>s+i.renderCount,0),a=e.length>0?e.reduce((s,i)=>s+i.avgRenderTime,0)/e.length:0,n=Array.from(Oe.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function xt(){const e=$r();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${G(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,r)=>r.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":G(t.avgRenderTime),"Max Time":G(t.maxRenderTime),"Total Time":G(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:G(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:G(t.duration)}))),console.groupEnd()),console.groupEnd()}const Br=new Map;function jr(){for(const[e,t]of J)Br.set(e,{...t});console.log("[Profile] Baseline saved")}function Or(e=20){const t=[];for(const[r,a]of J){const n=Br.get(r);if(!n)continue;const s=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;s>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:s});const i=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;i>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:i})}return t.length>0&&$.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const _r=c.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[r,a]=c.useState(t),[n,s]=c.useState([]),[i,o]=c.useState({used:0,total:0});if(c.useEffect(()=>{const d=()=>{const f=Array.from(J.values());s(f.sort((h,m)=>m.totalRenderTime-h.totalRenderTime).slice(0,10));const g=window.performance;g.memory&&o({used:g.memory.usedJSHeapSize/1024/1024,total:g.memory.totalJSHeapSize/1024/1024})};d();const u=setInterval(d,2e3);return()=>clearInterval(u)},[]),!$.enabled)return null;const l={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...l,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[x.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>a(d=>!d),children:[x.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),x.jsx("span",{children:"Profiler"}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:"Top Components"})}),n.map(d=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:d.componentName}),x.jsx("span",{style:{color:d.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:G(d.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",d.renderCount]})]},d.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:xt,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),x.jsx("button",{onClick:vt,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});_r.displayName="ProfilerOverlay";function Ac(){zr&&(window.__NICE2DEV_PROFILER__={getStats:Pr,getComponentStats:Fr,getSlowRenders:St,printReport:xt,clear:vt,saveBaseline:jr,checkRegression:Or,configure:Dr},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const wt=process.env.NODE_ENV==="development";let B={enabled:wt,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const Ve=[],De=new Map,Je=new Map,Xt=new WeakMap;let Ec=1;function Nc(){return Math.random()<(B.samplingRate??1)}function Xe(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
|
|
38
|
+
`)}function Zi(e,t,r=!1){const a=Ot(Bt(e)),n=Ot(Bt(t)),s=tc(a,n),i=r?4.5:7;return{rule:"1.4.6",level:"AAA",passed:s>=i,message:`Contrast ratio ${s.toFixed(2)}:1 (requires ${i}:1 for AAA${r?" large text":""})`}}function ec(){if(typeof document>"u")return[];const e=[];return document.querySelectorAll("a").forEach(r=>{var i;const a=((i=r.textContent)==null?void 0:i.trim())??"",n=!!r.getAttribute("aria-label");["click here","read more","learn more","here","link"].includes(a.toLowerCase())&&!n&&e.push({rule:"2.4.9",level:"AAA",passed:!1,message:`Link with generic text "${a}" lacks descriptive label`,element:r.outerHTML.slice(0,100)})}),document.querySelectorAll("h1, h2, h3, h4, h5, h6"),document.querySelectorAll("section, article, main, aside").forEach(r=>{r.querySelector("h1, h2, h3, h4, h5, h6")||e.push({rule:"2.4.10",level:"AAA",passed:!1,message:`<${r.tagName.toLowerCase()}> lacks a heading element`,element:r.tagName.toLowerCase()})}),document.querySelectorAll("p, li, td, span").forEach(r=>{const a=window.getComputedStyle(r),n=parseFloat(a.width),s=parseFloat(a.fontSize);s>0&&n/s>80&&e.push({rule:"1.4.8",level:"AAA",passed:!1,message:`Text block exceeds 80 character width (${Math.round(n/s)} chars)`,element:r.tagName.toLowerCase()})}),document.querySelectorAll('input[type="checkbox"], input[type="radio"], select').forEach(r=>{r.hasAttribute("onchange")&&e.push({rule:"3.2.5",level:"AAA",passed:!1,message:"Form control has inline onchange handler — may cause unexpected context change",element:r.tagName.toLowerCase()})}),document.querySelectorAll("video[autoplay], audio[autoplay]").forEach(r=>{e.push({rule:"2.2.3",level:"AAA",passed:!1,message:"Auto-playing media found — user should control timing",element:r.tagName.toLowerCase()})}),e}function Bt(e){if(e.startsWith("#")){const t=e.slice(1),r=parseInt(t.slice(0,2),16)/255,a=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255;return[r,a,n]}return[0,0,0]}function Ot([e,t,r]){const a=n=>n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4);return .2126*a(e)+.7152*a(t)+.0722*a(r)}function tc(e,t){const r=Math.max(e,t),a=Math.min(e,t);return(r+.05)/(a+.05)}const rc=["none","protanopia","protanomaly","deuteranopia","deuteranomaly","tritanopia","tritanomaly","achromatopsia","achromatomaly"],_t="nice2dev-color-blind-filters",Wt="nice2dev-color-blind-styles",tt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",protanomaly:"0.817 0.183 0 0 0 0.333 0.667 0 0 0 0 0.125 0.875 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",deuteranomaly:"0.8 0.2 0 0 0 0.258 0.742 0 0 0 0 0.142 0.858 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0",tritanomaly:"0.967 0.033 0 0 0 0 0.733 0.267 0 0 0 0.183 0.817 0 0 0 0 0 1 0",achromatopsia:"0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0 0 0 1 0",achromatomaly:"0.618 0.320 0.062 0 0 0.163 0.775 0.062 0 0 0.163 0.320 0.516 0 0 0 0 0 1 0"};function ac(){if(typeof document>"u"||document.getElementById(_t))return;const e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.id=_t,t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.overflow="hidden";const r=document.createElementNS(e,"defs");for(const[a,n]of Object.entries(tt)){const s=document.createElementNS(e,"filter");s.id=`nice-cb-${a}`,s.setAttribute("color-interpolation-filters","sRGB");const i=document.createElementNS(e,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values",n),s.appendChild(i),r.appendChild(s)}if(t.appendChild(r),document.body.appendChild(t),!document.getElementById(Wt)){const a=document.createElement("style");a.id=Wt,a.textContent=Object.keys(tt).map(n=>`.nice-color-blind-${n}{filter:url(#nice-cb-${n})!important;}`).join(""),document.head.appendChild(a)}}function yt(e){for(const t of Object.keys(tt))e.classList.remove(`nice-color-blind-${t}`)}function ht(e,t=typeof document<"u"?document.documentElement:null){t&&(ac(),yt(t),e!=="none"&&t.classList.add(`nice-color-blind-${e}`))}function Rr(e,t={}){const{target:r}=t,a=c.useRef(null);c.useEffect(()=>{const n=r??(typeof document<"u"?document.documentElement:null);return a.current=n,ht(e,n),()=>{const s=a.current;s&&yt(s)}},[e,r])}function nc(e,t){if(typeof window>"u")return null;try{if(t==="cookie"){const a=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"=([^;]*)"));return a?decodeURIComponent(a[1]):null}const r=window[t].getItem(e);return r||null}catch{return null}}function sc(e,t,r,a){if(!(typeof window>"u"))try{if(r==="cookie"){document.cookie=`${e}=${encodeURIComponent(t)};path=/;max-age=${a};SameSite=Lax`;return}window[r].setItem(e,t)}catch{}}function oc(e={}){const{storageKey:t="nice2dev.a11y.cvd",storage:r="localStorage",defaultMode:a="none",target:n,cookieMaxAgeSeconds:s=3600*24*60}=e,i=c.useCallback(h=>{if(typeof window>"u"||r==="cookie")return()=>{};const m=y=>{y.key===t&&h()};return window.addEventListener("storage",m),()=>window.removeEventListener("storage",m)},[r,t]),o=c.useCallback(()=>nc(t,r)??a,[r,t,a]),l=c.useCallback(()=>a,[a]),d=c.useSyncExternalStore(i,o,l),[u,f]=c.useState(d);c.useEffect(()=>{d!==u&&f(d)},[d]),Rr(u,{target:n});const p=c.useCallback(h=>{f(h),sc(t,h,r,s)},[r,t,s]);return[u,p]}function ic(e=typeof document<"u"?document.documentElement:null){return{set:t=>ht(t,e),clear:()=>{e&&yt(e)}}}const cc=e=>[...e],lc=()=>{const e=new Map;return{getItem:t=>Promise.resolve(e.get(t)),setItem:(t,r)=>(e.set(t,r),Promise.resolve())}};function dc(e={}){var p,h;const t=e.permissionPolicy??cc,r=e.storage;let a;r&&typeof r.getItem=="function"&&typeof r.setItem=="function"?a={getItem:r.getItem,setItem:r.setItem}:a=lc();const n=(p=e.permissions)==null?void 0:p.canActivate,s={user:(h=e.permissions)==null?void 0:h.user},i=e.logger,o=new Map,l=new Map,d=new Map,u=(m,y)=>{const g=d.get(m);if(g)for(const v of g)try{v(y)}catch{}},f=(m,y,g)=>{const v=new Set(y);return{permissions:v,log:(b,...S)=>{i&&i(m.id,b,S)},on:(b,S)=>{let w=l.get(b);w||(w=new Set,l.set(b,w)),w.add(S);const A=()=>{w.delete(S)};return g.push(A),A},emit:(b,S)=>{if(!v.has("events:emit"))return;const w=l.get(b);if(w)for(const A of w)try{A(S)}catch{}},setItem:async(b,S)=>{v.has("storage:write")&&await a.setItem(`${m.id}:${b}`,S)},getItem:async b=>{if(v.has("storage:read"))return await a.getItem(`${m.id}:${b}`)}}};return{register(m){const y=m.manifest.id;if(o.has(y))throw new Error(`Plugin "${y}" already registered`);const g={manifest:m.manifest,status:"registered"};return o.set(y,{plugin:m,record:g,cleanups:[]}),u("register",g),g},unregister(m){return o.get(m)?(o.delete(m),!0):!1},async activate(m){const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status==="active")return y.record;for(const g of y.plugin.manifest.dependsOn??[]){const v=o.get(g);if(!v)throw y.record.status="error",y.record.error=`Missing dependency: ${g}`,u("error",y.record),new Error(y.record.error);v.record.status!=="active"&&await this.activate(g)}y.record.status="activating";try{if(n&&!n(y.plugin.manifest,s))throw y.record.status="error",y.record.error="permission-denied",u("error",y.record),new Error(y.record.error);const g=t(y.plugin.manifest.permissions??[],y.plugin.manifest),v=f(y.plugin.manifest,g,y.cleanups);await y.plugin.activate(v),y.record.status="active",y.record.activatedAt=Date.now(),y.record.error=void 0,u("activate",y.record)}catch(g){throw y.record.status="error",y.record.error=g instanceof Error?g.message:String(g),u("error",y.record),g}return y.record},async deactivate(m){var g,v;const y=o.get(m);if(!y)throw new Error(`Unknown plugin "${m}"`);if(y.record.status!=="active")return y.record;y.record.status="deactivating";try{await((v=(g=y.plugin).deactivate)==null?void 0:v.call(g));for(const b of y.cleanups.splice(0))await b();y.record.status="inactive",u("deactivate",y.record)}catch(b){throw y.record.status="error",y.record.error=b instanceof Error?b.message:String(b),u("error",y.record),b}return y.record},list(){return[...o.values()].map(m=>({...m.record}))},get(m){const y=o.get(m);return y?{...y.record}:void 0},on(m,y){let g=d.get(m);return g||(g=new Set,d.set(m,g)),g.add(y),()=>{g.delete(y)}},events:{on(m,y){const v={"plugin:registered":"register","plugin:activated":"activate","plugin:deactivated":"deactivate","plugin:error":"error"}[m];let b=d.get(v);return b||(b=new Set,d.set(v,b)),b.add(y),()=>{b.delete(y)}},emit(m,y){const g=l.get(m);if(g)for(const v of g)try{v(y)}catch{}}}}}function uc(...e){return e.join("-")}const fc={button:e=>e?`nice-button-${e}`:"nice-button",textInput:e=>e?`nice-text-input-${e}`:"nice-text-input",numberInput:e=>e?`nice-number-input-${e}`:"nice-number-input",select:e=>e?`nice-select-${e}`:"nice-select",checkbox:e=>e?`nice-checkbox-${e}`:"nice-checkbox",toggle:e=>e?`nice-toggle-${e}`:"nice-toggle",datePicker:e=>e?`nice-date-picker-${e}`:"nice-date-picker",dataGrid:e=>e?`nice-datagrid-${e}`:"nice-datagrid",table:e=>e?`nice-table-${e}`:"nice-table",list:e=>e?`nice-list-${e}`:"nice-list",treeView:e=>e?`nice-tree-${e}`:"nice-tree",modal:e=>e?`nice-modal-${e}`:"nice-modal",drawer:e=>e?`nice-drawer-${e}`:"nice-drawer",form:e=>e?`nice-form-${e}`:"nice-form",tabs:e=>e?`nice-tabs-${e}`:"nice-tabs",menu:e=>e?`nice-menu-${e}`:"nice-menu",chart:e=>e?`nice-chart-${e}`:"nice-chart",scheduler:e=>e?`nice-scheduler-${e}`:"nice-scheduler"},Ir=({children:e,direction:t="ltr"})=>c.createElement("div",{dir:t,"data-testid":"nice-test-root",style:{direction:t}},e);Ir.displayName="NiceTestWrapper";function mc(e,t,r){const a=new KeyboardEvent("keydown",{key:t,bubbles:!0,cancelable:!0,...r});e.dispatchEvent(a)}function pc(e,t){var a,n;const r=((a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:a.set)||((n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value"))==null?void 0:n.set);r&&r.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function gc(e){const{data:t,delay:r=0,keyField:a="id"}=e;let n=[...t];return{key:a,load:async()=>(r>0&&await new Promise(s=>setTimeout(s,r)),{data:[...n],totalCount:n.length}),insert:async s=>(n.push(s),s),update:async(s,i)=>{const o=n.findIndex(l=>l[a]===s);o>=0&&(n[o]={...n[o],...i})},remove:async s=>{n=n.filter(i=>i[a]!==s)},getData:()=>[...n],reset:()=>{n=[...t]}}}function yc(e){const t=[];return e.querySelectorAll('button, input, select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"]').forEach(s=>{var o;s.getAttribute("aria-label")||s.getAttribute("aria-labelledby")||((o=s.textContent)==null?void 0:o.trim())||s.getAttribute("title")||t.push(`${s.tagName.toLowerCase()}${s.id?"#"+s.id:""} missing accessible name`)}),e.querySelectorAll("img").forEach(s=>{!s.alt&&s.getAttribute("role")!=="presentation"&&t.push(`img${s.src?'[src="'+s.src.substring(0,40)+'..."]':""} missing alt text`)}),e.querySelectorAll('input:not([type="hidden"]), select, textarea').forEach(s=>{const i=s.id&&e.querySelector(`label[for="${s.id}"]`),o=s.getAttribute("aria-label")||s.getAttribute("aria-labelledby");!i&&!o&&t.push(`${s.tagName.toLowerCase()}${s.name?'[name="'+s.name+'"]':""} missing label`)}),t}const zr=process.env.NODE_ENV==="development";let $={enabled:zr,logToConsole:!1,slowRenderThreshold:16,samplingRate:1,enableUserTiming:!0,trackPropsChanges:!1};const je=[],J=new Map,Be=new Map;let hc=1;function Dr(e){$={...$,...e}}function Pr(){return new Map(J)}function Fr(e){return J.get(e)}function bc(e=100){return je.slice(-e)}function bt(){je.length=0,J.clear(),Be.clear()}function vt(e){const t=e??$.slowRenderThreshold??16;return je.filter(r=>r.actualDuration>t)}function vc(){return Math.random()<($.samplingRate??1)}function Sc(e){const t=J.get(e.componentName);t?(t.renderCount++,e.phase==="mount"?t.mountCount++:t.updateCount++,t.totalRenderTime+=e.actualDuration,t.avgRenderTime=t.totalRenderTime/t.renderCount,t.maxRenderTime=Math.max(t.maxRenderTime,e.actualDuration),t.minRenderTime=Math.min(t.minRenderTime,e.actualDuration),t.lastRenderAt=e.timestamp,e.actualDuration>($.slowRenderThreshold??16)&&t.slowRenderCount++):J.set(e.componentName,{componentName:e.componentName,renderCount:1,mountCount:e.phase==="mount"?1:0,updateCount:e.phase==="mount"?0:1,avgRenderTime:e.actualDuration,maxRenderTime:e.actualDuration,minRenderTime:e.actualDuration,totalRenderTime:e.actualDuration,lastRenderAt:e.timestamp,slowRenderCount:e.actualDuration>($.slowRenderThreshold??16)?1:0})}function G(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}const xc=({id:e,children:t,onRender:r,onSlowRender:a,slowThreshold:n,logToConsole:s})=>{const i=c.useCallback((o,l,d,u,f,p)=>{var g,v,b;if(!$.enabled||!vc()||(g=$.ignoreComponents)!=null&&g.includes(o))return;const h={componentName:o,renderId:`render-${hc++}`,phase:l,actualDuration:d,baseDuration:u,startTime:f,commitTime:p,interactions:new Set,timestamp:Date.now()};if(je.push(h),Sc(h),$.enableUserTiming)try{performance.measure(`Nice:${o}:${l}`,{start:f,duration:d})}catch{}if(s??$.logToConsole){const S=n??$.slowRenderThreshold??16,w=d>S;console.log(`%c[Profile] ${o} ${l}`,`color: ${w?"var(--color-error, #dc2626)":"var(--color-success, #22c55e)"}; font-weight: ${w?"bold":"normal"}`,{actual:G(d),base:G(u),savings:`${((1-d/u)*100).toFixed(1)}%`})}r==null||r(h),(v=$.onRender)==null||v.call($,h);const y=n??$.slowRenderThreshold??16;d>y&&(a==null||a(h),(b=$.onSlowRender)==null||b.call($,h))},[e,r,a,n,s]);return $.enabled?x.jsx(c.Profiler,{id:e,onRender:i,children:t}):x.jsx(x.Fragment,{children:t})};function Hr(e,t){const r=c.useRef(),a=c.useRef(0);c.useEffect(()=>{if(!$.enabled||!$.trackPropsChanges)return;if(a.current++,a.current===1){r.current=t;return}const n=r.current,s=[],i=new Set([...Object.keys(n||{}),...Object.keys(t)]);for(const o of i){const l=n==null?void 0:n[o],d=t[o];Object.is(l,d)||s.push({propName:o,oldValue:l,newValue:d,timestamp:Date.now()})}s.length>0&&$.logToConsole&&console.log(`%c[Why render?] ${e}`,"color: var(--nice-info, #6366f1); font-weight: bold",`Render #${a.current}`,s.map(o=>({prop:o.propName,from:o.oldValue,to:o.newValue,type:typeof o.newValue}))),r.current=t})}function wc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>(Hr(r,n),x.jsx(e,{...n}));return a.displayName=`WhyDidYouRender(${r})`,a}function kc(e){const t=c.useRef(0);return t.current++,c.useEffect(()=>{$.enabled&&$.logToConsole&&e&&console.log(`%c[Render count] ${e}: ${t.current}`,`color: ${t.current>10?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`)}),t.current}function Oe(e,t){if(!$.enabled)return;const r={name:e,startTime:performance.now(),detail:t};if(Be.set(e,r),$.enableUserTiming)try{performance.mark(`Nice:${e}:start`,{detail:t})}catch{}}function _e(e){if(!$.enabled)return 0;const t=Be.get(e);if(!t)return console.warn(`[Profile] No mark found for: ${e}`),0;const r=performance.now()-t.startTime;if(t.duration=r,$.enableUserTiming)try{performance.mark(`Nice:${e}:end`),performance.measure(`Nice:${e}`,`Nice:${e}:start`,`Nice:${e}:end`)}catch{}return $.logToConsole&&console.log(`%c[Measure] ${e}: ${G(r)}`,`color: ${r>100?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"}`),r}async function Mc(e,t,r){Oe(e,r);try{return await t()}finally{_e(e)}}function Cc(e,t,r){Oe(e,r);try{return t()}finally{_e(e)}}function Ac(e,t,r){c.useEffect(()=>{Oe(e);const a=t();return _e(e),a},r)}function $r(){const e=Array.from(J.values()),t=vt(),r=e.reduce((s,i)=>s+i.renderCount,0),a=e.length>0?e.reduce((s,i)=>s+i.avgRenderTime,0)/e.length:0,n=Array.from(Be.values());return{stats:e,slowRenders:t,totalRenders:r,avgRenderTime:a,marks:n}}function St(){const e=$r();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${G(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,r)=>r.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":G(t.avgRenderTime),"Max Time":G(t.maxRenderTime),"Total Time":G(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:G(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:G(t.duration)}))),console.groupEnd()),console.groupEnd()}const jr=new Map;function Br(){for(const[e,t]of J)jr.set(e,{...t});console.log("[Profile] Baseline saved")}function Or(e=20){const t=[];for(const[r,a]of J){const n=jr.get(r);if(!n)continue;const s=(a.avgRenderTime-n.avgRenderTime)/n.avgRenderTime*100;s>e&&t.push({componentName:r,metric:"avgRenderTime",baseline:n.avgRenderTime,current:a.avgRenderTime,changePercent:s});const i=(a.maxRenderTime-n.maxRenderTime)/n.maxRenderTime*100;i>e&&t.push({componentName:r,metric:"maxRenderTime",baseline:n.maxRenderTime,current:a.maxRenderTime,changePercent:i})}return t.length>0&&$.logToConsole&&console.warn("%c[Regression] Performance regressions detected!","color: var(--nice-danger-dark, #dc2626); font-weight: bold",t),t}const _r=c.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[r,a]=c.useState(t),[n,s]=c.useState([]),[i,o]=c.useState({used:0,total:0});if(c.useEffect(()=>{const d=()=>{const f=Array.from(J.values());s(f.sort((h,m)=>m.totalRenderTime-h.totalRenderTime).slice(0,10));const p=window.performance;p.memory&&o({used:p.memory.usedJSHeapSize/1024/1024,total:p.memory.totalJSHeapSize/1024/1024})};d();const u=setInterval(d,2e3);return()=>clearInterval(u)},[]),!$.enabled)return null;const l={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return x.jsxs("div",{style:{...l,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:r?"4px 8px":8,maxWidth:r?"auto":300,maxHeight:r?"auto":400,overflow:"auto"},children:[x.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>a(d=>!d),children:[x.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),x.jsx("span",{children:"Profiler"}),i.used>0&&x.jsxs("span",{style:{color:i.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[i.used.toFixed(0),"MB"]}),x.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:r?"▼":"▲"})]}),!r&&x.jsxs("div",{style:{marginTop:8},children:[x.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:x.jsx("strong",{children:"Top Components"})}),n.map(d=>x.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[x.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:d.componentName}),x.jsx("span",{style:{color:d.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:G(d.avgRenderTime)}),x.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",d.renderCount]})]},d.componentName)),x.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[x.jsx("button",{onClick:St,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),x.jsx("button",{onClick:bt,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});_r.displayName="ProfilerOverlay";function Ec(){zr&&(window.__NICE2DEV_PROFILER__={getStats:Pr,getComponentStats:Fr,getSlowRenders:vt,printReport:St,clear:bt,saveBaseline:Br,checkRegression:Or,configure:Dr},console.log("%c[Nice2Dev Profiler] DevTools integration ready. Use __NICE2DEV_PROFILER__ in console.","color: var(--nice-info, #6366f1)"))}const xt=process.env.NODE_ENV==="development";let j={enabled:xt,logToConsole:!0,samplingRate:1,trackDetachedNodes:!1,closureSizeThreshold:1024*1024};const We=[],ze=new Map,Ke=new Map,Vt=new WeakMap;let Nc=1;function Lc(){return Math.random()<(j.samplingRate??1)}function Ve(){var e;try{throw new Error}catch(t){return((e=t.stack)==null?void 0:e.split(`
|
|
39
39
|
`).slice(3).join(`
|
|
40
|
-
`))??""}}function Ye(e,t,r){return`${e.__ntd_id??Math.random()}-${t}-${r.toString().slice(0,50)}`}function ae(e,t,r="warning",a,n){var i,o;if(!B.enabled||!Nc()||a&&((i=B.ignoreComponents)!=null&&i.includes(a)))return;const s={id:`leak-${Ec++}`,type:e,severity:r,componentName:a,message:t,stack:Xe(),timestamp:Date.now(),data:n};Ve.push(s),B.logToConsole&&console[r==="critical"?"error":r==="warning"?"warn":"info"](`%c[NTD Leak Detector] ${e}`,`color: ${r==="critical"?"var(--color-error, #dc2626)":r==="warning"?"var(--color-warning, #f59e0b)":"var(--color-primary, #3b82f6)"}; font-weight: bold`,t,a?`(${a})`:"",""),(o=B.onLeak)==null||o.call(B,s)}function Lc(e){B={...B,...e}}function Tc(){return[...Ve]}function Rc(){Ve.length=0}function Wr(){return Ve.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{})}function Ic(e,t){const[r,a]=c.useState(e),n=c.useRef(!0),s=c.useRef(t);c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]);const i=c.useCallback(o=>{n.current?a(o):B.enabled&&ae("setState-after-unmount","setState called on unmounted component","warning",s.current)},[]);return[r,i]}function zc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearTimeout(t.current),B.enabled&&De.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setTimeout(s,i),B.enabled&&De.set(t.current,{id:t.current,type:"timeout",componentName:r.current,stack:Xe(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(B.enabled&&ae("timer-not-cleared","Timeout would have leaked without cleanup","info",s),a())}},[a]),[n,a]}function Dc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearInterval(t.current),B.enabled&&De.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setInterval(s,i),B.enabled&&De.set(t.current,{id:t.current,type:"interval",componentName:r.current,stack:Xe(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(B.enabled&&ae("timer-not-cleared","Interval would have leaked without cleanup","warning",s),a())}},[a]),[n,a]}function Pc(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const{target:s,type:i,listener:o,options:l}of a)if(s.removeEventListener(i,o,l),B.enabled){const d=Ye(s,i,o);Je.delete(d)}a.length>0&&B.enabled&&ae("listener-not-removed",`${a.length} event listener(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback((a,n,s,i)=>{if(a.addEventListener(n,s,i),t.current.push({target:a,type:n,listener:s,options:i}),B.enabled){const o=Ye(a,n,s);Je.set(o,{target:a,type:n,listener:s,componentName:r.current,stack:Xe(),createdAt:Date.now()})}return()=>{if(a.removeEventListener(n,s,i),t.current=t.current.filter(o=>o.target!==a||o.type!==n||o.listener!==s),B.enabled){const o=Ye(a,n,s);Je.delete(o)}}},[])}function Vr(e){const t=c.useRef(null),r=c.useRef(e);return c.useEffect(()=>{const a=r.current;return()=>{t.current&&!t.current.signal.aborted&&(t.current.abort(),B.enabled&&ae("abort-controller-not-aborted","AbortController was auto-aborted on unmount (fetch may have leaked)","info",a))}},[]),c.useCallback(()=>(t.current&&t.current.abort(),t.current=new AbortController,t.current.signal),[])}function Fc(e){const t=Vr(e);return c.useCallback((r,a)=>{const n=t();return fetch(r,{...a,signal:n})},[t])}function Hc(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const s of a)try{s()}catch(i){console.error("Error during subscription cleanup:",i)}a.length>0&&B.enabled&&ae("subscription-not-unsubscribed",`${a.length} subscription(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback(a=>{typeof a=="function"?t.current.push(a):a&&typeof a.unsubscribe=="function"&&t.current.push(()=>a.unsubscribe())},[])}function $c(e,t,r){const[a,n]=c.useState(null),[s,i]=c.useState(WebSocket.CLOSED),o=c.useRef(r);c.useEffect(()=>{if(!e)return;const u=new WebSocket(e,t);n(u);const f=o.current;return u.onopen=()=>i(u.readyState),u.onclose=()=>i(u.readyState),u.onerror=()=>i(u.readyState),()=>{(u.readyState===WebSocket.OPEN||u.readyState===WebSocket.CONNECTING)&&(u.close(),B.enabled&&ae("websocket-not-closed","WebSocket was auto-closed on unmount","info",f))}},[e,t]);const l=c.useCallback(u=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(u)},[a]),d=c.useCallback((u,f)=>{a==null||a.close(u,f)},[a]);return{socket:a,readyState:s,send:l,close:d}}function Bc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>{const s=c.useRef({});return c.useEffect(()=>{if(!B.enabled)return;const i=s.current;return Xt.set(i,{name:r,mountedAt:Date.now()}),()=>{Xt.delete(i)}},[]),x.jsx(e,{...n})};return a.displayName=`LeakTracked(${r})`,a}function jc(e){const t=c.useRef(Date.now());c.useEffect(()=>{B.enabled&&B.logToConsole&&console.log(`%c[NTD] ${e} mounted`,"color: var(--nice-success, #22c55e)");const r=t.current;return()=>{if(B.enabled&&B.logToConsole){const a=Date.now()-r;console.log(`%c[NTD] ${e} unmounted (lifetime: ${a}ms)`,"color: var(--nice-warning, #f59e0b)")}}},[e])}async function Oc(e){if(!wt)return;const t=window.performance;if(t.memory){const r=t.memory;console.log(`%c[Memory Snapshot${e?`: ${e}`:""}]`,"color: var(--nice-info, #6366f1); font-weight: bold",{usedJSHeapSize:`${(r.usedJSHeapSize/1024/1024).toFixed(2)} MB`,totalJSHeapSize:`${(r.totalJSHeapSize/1024/1024).toFixed(2)} MB`,jsHeapSizeLimit:`${(r.jsHeapSizeLimit/1024/1024).toFixed(2)} MB`})}console.log("%cTip: Use Chrome DevTools Memory tab for detailed heap snapshots","color: var(--nice-text-secondary, #64748b); font-style: italic")}function _c(){wt&&(window.gc?(window.gc(),console.log("%c[GC] Forced garbage collection","color: var(--nice-success, #22c55e)")):console.log("%c[GC] gc() not available. Run Chrome with --expose-gc flag","color: var(--nice-warning, #f59e0b)"))}function Wc(e=5e3,t=100){const[r,a]=c.useState({usedMB:0,totalMB:0,limitMB:0,isWarning:!1});return c.useEffect(()=>{const n=window.performance;if(!n.memory)return;const s=()=>{const o=n.memory;if(!o)return;const l=o.usedJSHeapSize/1024/1024,d=o.totalJSHeapSize/1024/1024,u=o.jsHeapSizeLimit/1024/1024,f=l>t;a({usedMB:l,totalMB:d,limitMB:u,isWarning:f}),f&&B.enabled&&ae("large-closure",`Memory usage exceeded ${t}MB (${l.toFixed(2)}MB)`,"warning")};s();const i=setInterval(s,e);return()=>clearInterval(i)},[e,t]),r}const Xr=()=>{const e=c.useMemo(()=>Wr(),[]),t=Object.values(e).reduce((r,a)=>r+a,0);return!B.enabled||t===0,null};Xr.displayName="NiceLeakDetectorStatus";function Vc(e){const t=()=>{var r;(r=e.queryClient)==null||r.invalidateQueries({queryKey:e.queryKey})};return{load:r=>e.queryFn(r),insert:e.mutationFn?async r=>{const a=await e.mutationFn(r);return t(),a}:void 0,update:e.updateMutationFn?async(r,a)=>{const n=await e.updateMutationFn({key:r,values:a});return t(),n}:void 0,remove:e.deleteMutationFn?async r=>{await e.deleteMutationFn(r),t()}:void 0}}function Xc(e,t){return{load:async()=>t.getData(e.getState()),insert:t.addItem?async r=>{const a=e.getState();return t.addItem(a)(r),r}:void 0,update:t.updateItem?async(r,a)=>{const n=e.getState();return t.updateItem(n)(r,a),{...a}}:void 0,remove:t.removeItem?async r=>{const a=e.getState();t.removeItem(a)(r)}:void 0}}function Uc(e={}){const t=e.actionPrefix??"nice";return r=>a=>n=>{const s=a(n);if(n.type.startsWith(`${t}/grid/`)){const o=n.type.split("/")[2];o&&e.onGridStateChange&&e.onGridStateChange(o,n.payload)}if(n.type.startsWith(`${t}/form/`)){const o=n.type.split("/")[2];o&&e.onFormStateChange&&e.onFormStateChange(o,n.payload)}return s}}function qc(e="nice"){return{setGridState:(t,r)=>({type:`${e}/grid/${t}/setState`,payload:r}),setGridFilter:(t,r)=>({type:`${e}/grid/${t}/setFilter`,payload:r}),setGridSort:(t,r)=>({type:`${e}/grid/${t}/setSort`,payload:r}),setFormValues:(t,r)=>({type:`${e}/form/${t}/setValues`,payload:r}),resetForm:t=>({type:`${e}/form/${t}/reset`})}}function Gc(e="nice"){return(t={},r)=>{if(!r.type.startsWith(`${e}/`))return t;const a=r.type.split("/"),[,n,s,i]=a;if(!n||!s)return t;const o=`${n}/${s}`;switch(i){case"setState":return{...t,[o]:{...t[o]??{},...r.payload}};case"setFilter":case"setSort":case"setValues":return{...t,[o]:{...t[o]??{},[i]:r.payload}};case"reset":return{...t,[o]:{}};default:return t}}}function Kc(e){let t=null,r=[];return{load:async()=>{if(r.length>0)return r;const s=await e.queryFn();return r=s,s},subscribe:()=>(t=new WebSocket(e.url,"graphql-ws"),t.onopen=()=>{t.send(JSON.stringify({type:"connection_init",payload:e.connectionParams??{}})),t.send(JSON.stringify({type:"start",id:"1",payload:{query:e.query,variables:e.variables}}))},t.onmessage=s=>{var i,o;try{const l=JSON.parse(s.data);l.type==="data"&&((i=l.payload)!=null&&i.data)&&(r=(e.extractData??(u=>{const f=u,g=Object.keys(f)[0];return g?f[g]:[]}))(l.payload.data),(o=e.onData)==null||o.call(e,r))}catch{}},()=>{t==null||t.close(),t=null}),unsubscribe:()=>{t==null||t.close(),t=null}}}async function Jc(e,t){var d;const r=await fetch(e);if(!r.ok)throw new Error(`OpenAPI fetch failed: ${r.status}`);const a=await r.json(),s=(((d=a.components)==null?void 0:d.schemas)??a.definitions??{})[t];if(!s)throw new Error(`Schema "${t}" not found in OpenAPI spec`);const i=new Set(s.required??[]),o=[],l=[];for(const[u,f]of Object.entries(s.properties??{})){const g=kt(f),h=f.title??Mt(u);o.push({dataField:u,caption:h,dataType:g,allowEditing:!f.readOnly,visible:!u.toLowerCase().endsWith("id")||u==="id",...f.enum?{lookup:{dataSource:f.enum,valueExpr:"this",displayExpr:"this"}}:{}}),l.push({dataField:u,label:h,editorType:Ur(f,g),isRequired:i.has(u),editorOptions:qr(f),...i.has(u)?{validationRules:[{type:"required",message:`${h} jest wymagane`}]}:{}})}return{columns:o,formFields:l,schema:s}}function Yc(e){const t=[];for(const[r,a]of Object.entries(e.properties??{}))t.push({dataField:r,caption:a.title??Mt(r),dataType:kt(a),allowEditing:!a.readOnly});return t}function Qc(e){const t=new Set(e.required??[]),r=[];for(const[a,n]of Object.entries(e.properties??{})){const s=kt(n);r.push({dataField:a,label:n.title??Mt(a),editorType:Ur(n,s),isRequired:t.has(a),editorOptions:qr(n)})}return r}function kt(e){return e.type==="integer"||e.type==="number"?"number":e.type==="boolean"?"boolean":e.format==="date"?"date":e.format==="date-time"?"datetime":e.type==="object"||e.type==="array"?"object":"string"}function Ur(e,t){return e.enum?"NiceSelect":e.format==="email"||e.format==="uri"||e.format==="url"?"NiceTextInput":e.format==="password"?"NicePasswordInput":t==="number"?"NiceNumberInput":t==="boolean"?"NiceToggle":t==="date"?"NiceDatePicker":t==="datetime"?"NiceDateTimePicker":e.maxLength&&e.maxLength>200?"NiceTextArea":"NiceTextInput"}function qr(e){const t={};return e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.pattern&&(t.pattern=e.pattern),e.enum&&(t.items=e.enum.map(r=>({label:r,value:r}))),e.description&&(t.hint=e.description),Object.keys(t).length>0?t:{}}function Mt(e){return e.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}const Gr={enabled:!0,defaultExpanded:!1,showHelpIcon:!0,position:"tooltip",locale:"en"},Zc=async(e,t)=>{try{return null}catch{return null}},Kr=c.createContext(null),Jr=({children:e,config:t,helpContent:r})=>{const[a,n]=c.useState({...Gr,...t}),[s,i]=c.useState(new Set),[o,l]=c.useState(()=>new Map(Object.entries(r||{}))),d=c.useCallback(p=>{n(v=>({...v,...p}))},[]),u=c.useCallback(()=>{n(p=>({...p,enabled:!p.enabled}))},[]),f=c.useCallback(p=>{i(v=>new Set(v).add(p))},[]),g=c.useCallback(p=>{i(v=>{const b=new Set(v);return b.delete(p),b})},[]),h=c.useCallback(p=>a.enabled&&!s.has(p),[a.enabled,s]),m=c.useCallback(async p=>{if(o.has(p))return o.get(p)||null;const b=await(a.contentLoader||Zc)(p,a.locale);return b&&l(S=>new Map(S).set(p,b)),b},[o,a.contentLoader,a.locale]),y=c.useMemo(()=>({config:a,setConfig:d,toggleGlobalHelp:u,disabledComponents:s,disableComponentHelp:f,enableComponentHelp:g,isHelpEnabled:h,getHelpContent:m,helpCache:o}),[a,d,u,s,f,g,h,m,o]);return x.jsx(Kr.Provider,{value:y,children:e})};Jr.displayName="NiceHelpProvider";function Yr(){const e=c.useContext(Kr);return e||{config:Gr,setConfig:()=>{},toggleGlobalHelp:()=>{},disabledComponents:new Set,disableComponentHelp:()=>{},enableComponentHelp:()=>{},isHelpEnabled:()=>!0,getHelpContent:async()=>null,helpCache:new Map}}function Qr(e){const{isHelpEnabled:t,getHelpContent:r,helpCache:a,config:n}=Yr(),[s,i]=c.useState(a.get(e)||null),[o,l]=c.useState(!1),d=t(e),u=c.useCallback(async()=>{if(!d)return;l(!0);const f=await r(e);i(f),l(!1)},[d,e,r]);return{content:s,loading:o,enabled:d,loadContent:u,position:n.position,defaultExpanded:n.defaultExpanded,showHelpIcon:n.showHelpIcon}}const Zr=({props:e,compact:t})=>{const{t:r}=V.useNiceTranslation();return!e||e.length===0?null:t?x.jsxs("div",{className:"nice-help__props-compact",children:[e.slice(0,5).map(a=>x.jsxs("div",{className:"nice-help__prop-chip",children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",children:"*"})]},a.name)),e.length>5&&x.jsxs("span",{className:"nice-help__more",children:["+",e.length-5," ",r("help.moreProps","more")]})]}):x.jsxs("div",{className:"nice-help__props",children:[x.jsx("h4",{className:"nice-help__section-title",children:r("help.props","Properties")}),x.jsxs("table",{className:"nice-help__props-table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{children:r("help.propName","Name")}),x.jsx("th",{children:r("help.propType","Type")}),x.jsx("th",{children:r("help.propDefault","Default")}),x.jsx("th",{children:r("help.propDescription","Description")})]})}),x.jsx("tbody",{children:e.map(a=>x.jsxs("tr",{children:[x.jsxs("td",{children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",title:r("help.required","Required"),children:"*"})]}),x.jsx("td",{children:x.jsx("code",{className:"nice-help__type",children:a.type})}),x.jsx("td",{children:a.default!==void 0?x.jsx("code",{children:String(a.default)}):"—"}),x.jsx("td",{children:a.description})]},a.name))})]})]})},at=({tips:e})=>{const{t}=V.useNiceTranslation();return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__tips",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.tips","Tips")}),x.jsx("ul",{children:e.map((r,a)=>x.jsxs("li",{children:[x.jsx("span",{className:"nice-help__tip-icon",children:"💡"}),r]},a))})]})},el=({examples:e})=>{var n,s;const{t}=V.useNiceTranslation(),[r,a]=c.useState(0);return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__examples",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.examples","Examples")}),e.length>1&&x.jsx("div",{className:"nice-help__example-tabs",children:e.map((i,o)=>x.jsx("button",{className:`nice-help__example-tab ${r===o?"nice-help__example-tab--active":""}`,onClick:()=>a(o),children:i.title},o))}),x.jsx("pre",{className:"nice-help__code",children:x.jsx("code",{className:`language-${((n=e[r])==null?void 0:n.language)||"tsx"}`,children:(s=e[r])==null?void 0:s.code})})]})},ea=({componentName:e,content:t,children:r,position:a,defaultExpanded:n,disabled:s=!1,className:i,icon:o,title:l,showProps:d=!0,showExamples:u=!1,showTips:f=!0,compact:g=!1})=>{const{t:h}=V.useNiceTranslation(),{content:m,loading:y,enabled:p,loadContent:v,position:b,defaultExpanded:S,showHelpIcon:w}=Qr(e),A=t||m,k=a||b,C=n??S,[M,N]=c.useState(C);return c.useEffect(()=>{p&&!t&&!m&&v()},[p,t,m,v]),s||!p?x.jsx(x.Fragment,{children:r}):k==="tooltip"?x.jsxs("div",{className:`nice-help-tooltip-wrapper ${i||""}`,children:[r,w&&A&&x.jsx("button",{className:"nice-help__trigger",onClick:()=>N(!M),"aria-label":h("help.toggle","Toggle help"),"aria-expanded":M,children:o||x.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),M&&A&&x.jsx("div",{className:"nice-help__tooltip",children:x.jsxs("div",{className:"nice-help__tooltip-content",children:[x.jsx("h3",{className:"nice-help__title",children:l||A.name}),x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(at,{tips:A.tips}),d&&A.props&&x.jsx(Zr,{props:A.props,compact:!0})]})})]}):x.jsxs("div",{className:`nice-help ${k==="bottom"?"nice-help--bottom":""} ${i||""}`,children:[k==="top"&&A&&x.jsx(Ut,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:g}),r,k==="bottom"&&A&&x.jsx(Ut,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:g}),k==="inline"&&A&&M&&x.jsxs("div",{className:"nice-help__inline",children:[x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(at,{tips:A.tips})]})]})};ea.displayName="NiceInlineHelp";const Ut=({content:e,expanded:t,onToggle:r,loading:a,title:n,showProps:s,showExamples:i,showTips:o,compact:l})=>{const{t:d}=V.useNiceTranslation();return a?x.jsx("div",{className:"nice-help__panel nice-help__panel--loading",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):x.jsxs("div",{className:`nice-help__panel ${t?"nice-help__panel--expanded":""}`,children:[x.jsxs("button",{className:"nice-help__panel-header",onClick:r,"aria-expanded":t,children:[x.jsx("span",{className:"nice-help__panel-icon",children:t?"▾":"▸"}),x.jsxs("span",{className:"nice-help__panel-title",children:[n||d("help.about","About")," ",e.name]}),e.status&&x.jsx("span",{className:`nice-help__status nice-help__status--${e.status}`,children:e.status})]}),t&&x.jsxs("div",{className:"nice-help__panel-content",children:[x.jsx("p",{className:"nice-help__description",children:e.description}),o&&e.tips&&x.jsx(at,{tips:e.tips}),s&&e.props&&x.jsx(Zr,{props:e.props,compact:l}),i&&e.examples&&x.jsx(el,{examples:e.examples}),e.seeAlso&&e.seeAlso.length>0&&x.jsxs("div",{className:"nice-help__see-also",children:[x.jsx("h4",{className:"nice-help__section-title",children:d("help.seeAlso","See Also")}),x.jsx("ul",{children:e.seeAlso.map((u,f)=>x.jsx("li",{children:x.jsx("code",{children:u})},f))})]})]})]})},ta=({text:e,position:t="top",className:r,children:a})=>{const[n,s]=c.useState(!1);return x.jsxs("span",{className:`nice-quick-help nice-quick-help--${t} ${r||""}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),children:[a,n&&x.jsx("span",{className:"nice-quick-help__popup",role:"tooltip",children:e})]})};ta.displayName="NiceQuickHelp";const ra=({content:e,size:t="sm",className:r,onOpen:a})=>{const{t:n}=V.useNiceTranslation(),[s,i]=c.useState(!1),o=c.useCallback(()=>{i(!s),!s&&a&&a()},[s,a]),l=typeof e=="string"?e:e.description,d=typeof e=="string"?void 0:e.name;return x.jsxs("span",{className:`nice-help-icon nice-help-icon--${t} ${r||""}`,children:[x.jsx("button",{className:"nice-help-icon__btn",onClick:o,"aria-label":n("help.showHelp","Show help"),"aria-expanded":s,children:x.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),s&&x.jsxs("div",{className:"nice-help-icon__popup",children:[d&&x.jsx("strong",{children:d}),x.jsx("p",{children:l}),x.jsx("button",{className:"nice-help-icon__close",onClick:()=>i(!1),children:"×"})]})]})};ra.displayName="NiceHelpIcon";const Ct=c.createContext({enabled:!0,active:!1,run:()=>{}}),tl=({enabled:e=!0,active:t=!1,onRun:r,children:a})=>{const n=c.useMemo(()=>({enabled:e,active:t,run:r??(()=>{})}),[e,t,r]);return x.jsx(Ct.Provider,{value:n,children:a})};function aa(){return c.useContext(Ct)}function rl(){return c.useContext(Ct).enabled}function al(e,t){if(!e)return null;if(e===!0)return t&&t.length>0?t:null;if(Array.isArray(e))return e.length>0?e:null;const r=e.steps??t;return r&&r.length>0?r:null}function na(e,t){return e.map(r=>({target:r.target,title:r.titleKey?t(r.titleKey,r.title??""):r.title??"",content:r.contentKey?t(r.contentKey,r.content??""):r.content??"",placement:r.placement,highlightPadding:r.highlightPadding,showArrow:r.showArrow,scrollIntoView:r.scrollIntoView,disableInteraction:r.disableInteraction}))}const nl=({steps:e,autoStart:t,label:r,size:a="md",className:n,style:s,"data-testid":i})=>{const{enabled:o,run:l}=aa(),{t:d}=V.useNiceTranslation();if(!o||!e||e.length===0)return null;const u=r??d("tutorial.startAria","Start tutorial");return x.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${a}`+(n?` ${n}`:""),style:s,"data-testid":i,"aria-label":u,title:u,onClick:()=>l(na(e,d),{autoStart:t}),children:"?"})},qt="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(qt)){const e=document.createElement("style");e.id=qt,e.textContent=`
|
|
40
|
+
`))??""}}function Je(e,t,r){return`${e.__ntd_id??Math.random()}-${t}-${r.toString().slice(0,50)}`}function ae(e,t,r="warning",a,n){var i,o;if(!j.enabled||!Lc()||a&&((i=j.ignoreComponents)!=null&&i.includes(a)))return;const s={id:`leak-${Nc++}`,type:e,severity:r,componentName:a,message:t,stack:Ve(),timestamp:Date.now(),data:n};We.push(s),j.logToConsole&&console[r==="critical"?"error":r==="warning"?"warn":"info"](`%c[NTD Leak Detector] ${e}`,`color: ${r==="critical"?"var(--color-error, #dc2626)":r==="warning"?"var(--color-warning, #f59e0b)":"var(--color-primary, #3b82f6)"}; font-weight: bold`,t,a?`(${a})`:"",""),(o=j.onLeak)==null||o.call(j,s)}function Tc(e){j={...j,...e}}function Rc(){return[...We]}function Ic(){We.length=0}function Wr(){return We.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{})}function zc(e,t){const[r,a]=c.useState(e),n=c.useRef(!0),s=c.useRef(t);c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]);const i=c.useCallback(o=>{n.current?a(o):j.enabled&&ae("setState-after-unmount","setState called on unmounted component","warning",s.current)},[]);return[r,i]}function Dc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearTimeout(t.current),j.enabled&&ze.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setTimeout(s,i),j.enabled&&ze.set(t.current,{id:t.current,type:"timeout",componentName:r.current,stack:Ve(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(j.enabled&&ae("timer-not-cleared","Timeout would have leaked without cleanup","info",s),a())}},[a]),[n,a]}function Pc(e){const t=c.useRef(null),r=c.useRef(e),a=c.useCallback(()=>{t.current&&(clearInterval(t.current),j.enabled&&ze.delete(t.current),t.current=null)},[]),n=c.useCallback((s,i)=>{a(),t.current=setInterval(s,i),j.enabled&&ze.set(t.current,{id:t.current,type:"interval",componentName:r.current,stack:Ve(),createdAt:Date.now()})},[a]);return c.useEffect(()=>{const s=r.current;return()=>{t.current&&(j.enabled&&ae("timer-not-cleared","Interval would have leaked without cleanup","warning",s),a())}},[a]),[n,a]}function Fc(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const{target:s,type:i,listener:o,options:l}of a)if(s.removeEventListener(i,o,l),j.enabled){const d=Je(s,i,o);Ke.delete(d)}a.length>0&&j.enabled&&ae("listener-not-removed",`${a.length} event listener(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback((a,n,s,i)=>{if(a.addEventListener(n,s,i),t.current.push({target:a,type:n,listener:s,options:i}),j.enabled){const o=Je(a,n,s);Ke.set(o,{target:a,type:n,listener:s,componentName:r.current,stack:Ve(),createdAt:Date.now()})}return()=>{if(a.removeEventListener(n,s,i),t.current=t.current.filter(o=>o.target!==a||o.type!==n||o.listener!==s),j.enabled){const o=Je(a,n,s);Ke.delete(o)}}},[])}function Vr(e){const t=c.useRef(null),r=c.useRef(e);return c.useEffect(()=>{const a=r.current;return()=>{t.current&&!t.current.signal.aborted&&(t.current.abort(),j.enabled&&ae("abort-controller-not-aborted","AbortController was auto-aborted on unmount (fetch may have leaked)","info",a))}},[]),c.useCallback(()=>(t.current&&t.current.abort(),t.current=new AbortController,t.current.signal),[])}function Hc(e){const t=Vr(e);return c.useCallback((r,a)=>{const n=t();return fetch(r,{...a,signal:n})},[t])}function $c(e){const t=c.useRef([]),r=c.useRef(e);return c.useEffect(()=>{const a=t.current,n=r.current;return()=>{for(const s of a)try{s()}catch(i){console.error("Error during subscription cleanup:",i)}a.length>0&&j.enabled&&ae("subscription-not-unsubscribed",`${a.length} subscription(s) would have leaked without cleanup`,"info",n),t.current=[]}},[]),c.useCallback(a=>{typeof a=="function"?t.current.push(a):a&&typeof a.unsubscribe=="function"&&t.current.push(()=>a.unsubscribe())},[])}function jc(e,t,r){const[a,n]=c.useState(null),[s,i]=c.useState(WebSocket.CLOSED),o=c.useRef(r);c.useEffect(()=>{if(!e)return;const u=new WebSocket(e,t);n(u);const f=o.current;return u.onopen=()=>i(u.readyState),u.onclose=()=>i(u.readyState),u.onerror=()=>i(u.readyState),()=>{(u.readyState===WebSocket.OPEN||u.readyState===WebSocket.CONNECTING)&&(u.close(),j.enabled&&ae("websocket-not-closed","WebSocket was auto-closed on unmount","info",f))}},[e,t]);const l=c.useCallback(u=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(u)},[a]),d=c.useCallback((u,f)=>{a==null||a.close(u,f)},[a]);return{socket:a,readyState:s,send:l,close:d}}function Bc(e,t){const r=t||e.displayName||e.name||"Unknown",a=n=>{const s=c.useRef({});return c.useEffect(()=>{if(!j.enabled)return;const i=s.current;return Vt.set(i,{name:r,mountedAt:Date.now()}),()=>{Vt.delete(i)}},[]),x.jsx(e,{...n})};return a.displayName=`LeakTracked(${r})`,a}function Oc(e){const t=c.useRef(Date.now());c.useEffect(()=>{j.enabled&&j.logToConsole&&console.log(`%c[NTD] ${e} mounted`,"color: var(--nice-success, #22c55e)");const r=t.current;return()=>{if(j.enabled&&j.logToConsole){const a=Date.now()-r;console.log(`%c[NTD] ${e} unmounted (lifetime: ${a}ms)`,"color: var(--nice-warning, #f59e0b)")}}},[e])}async function _c(e){if(!xt)return;const t=window.performance;if(t.memory){const r=t.memory;console.log(`%c[Memory Snapshot${e?`: ${e}`:""}]`,"color: var(--nice-info, #6366f1); font-weight: bold",{usedJSHeapSize:`${(r.usedJSHeapSize/1024/1024).toFixed(2)} MB`,totalJSHeapSize:`${(r.totalJSHeapSize/1024/1024).toFixed(2)} MB`,jsHeapSizeLimit:`${(r.jsHeapSizeLimit/1024/1024).toFixed(2)} MB`})}console.log("%cTip: Use Chrome DevTools Memory tab for detailed heap snapshots","color: var(--nice-text-secondary, #64748b); font-style: italic")}function Wc(){xt&&(window.gc?(window.gc(),console.log("%c[GC] Forced garbage collection","color: var(--nice-success, #22c55e)")):console.log("%c[GC] gc() not available. Run Chrome with --expose-gc flag","color: var(--nice-warning, #f59e0b)"))}function Vc(e=5e3,t=100){const[r,a]=c.useState({usedMB:0,totalMB:0,limitMB:0,isWarning:!1});return c.useEffect(()=>{const n=window.performance;if(!n.memory)return;const s=()=>{const o=n.memory;if(!o)return;const l=o.usedJSHeapSize/1024/1024,d=o.totalJSHeapSize/1024/1024,u=o.jsHeapSizeLimit/1024/1024,f=l>t;a({usedMB:l,totalMB:d,limitMB:u,isWarning:f}),f&&j.enabled&&ae("large-closure",`Memory usage exceeded ${t}MB (${l.toFixed(2)}MB)`,"warning")};s();const i=setInterval(s,e);return()=>clearInterval(i)},[e,t]),r}const Xr=()=>{const e=c.useMemo(()=>Wr(),[]),t=Object.values(e).reduce((r,a)=>r+a,0);return!j.enabled||t===0,null};Xr.displayName="NiceLeakDetectorStatus";function Xc(e){const t=()=>{var r;(r=e.queryClient)==null||r.invalidateQueries({queryKey:e.queryKey})};return{load:r=>e.queryFn(r),insert:e.mutationFn?async r=>{const a=await e.mutationFn(r);return t(),a}:void 0,update:e.updateMutationFn?async(r,a)=>{const n=await e.updateMutationFn({key:r,values:a});return t(),n}:void 0,remove:e.deleteMutationFn?async r=>{await e.deleteMutationFn(r),t()}:void 0}}function Uc(e,t){return{load:async()=>t.getData(e.getState()),insert:t.addItem?async r=>{const a=e.getState();return t.addItem(a)(r),r}:void 0,update:t.updateItem?async(r,a)=>{const n=e.getState();return t.updateItem(n)(r,a),{...a}}:void 0,remove:t.removeItem?async r=>{const a=e.getState();t.removeItem(a)(r)}:void 0}}function qc(e={}){const t=e.actionPrefix??"nice";return r=>a=>n=>{const s=a(n);if(n.type.startsWith(`${t}/grid/`)){const o=n.type.split("/")[2];o&&e.onGridStateChange&&e.onGridStateChange(o,n.payload)}if(n.type.startsWith(`${t}/form/`)){const o=n.type.split("/")[2];o&&e.onFormStateChange&&e.onFormStateChange(o,n.payload)}return s}}function Gc(e="nice"){return{setGridState:(t,r)=>({type:`${e}/grid/${t}/setState`,payload:r}),setGridFilter:(t,r)=>({type:`${e}/grid/${t}/setFilter`,payload:r}),setGridSort:(t,r)=>({type:`${e}/grid/${t}/setSort`,payload:r}),setFormValues:(t,r)=>({type:`${e}/form/${t}/setValues`,payload:r}),resetForm:t=>({type:`${e}/form/${t}/reset`})}}function Kc(e="nice"){return(t={},r)=>{if(!r.type.startsWith(`${e}/`))return t;const a=r.type.split("/"),[,n,s,i]=a;if(!n||!s)return t;const o=`${n}/${s}`;switch(i){case"setState":return{...t,[o]:{...t[o]??{},...r.payload}};case"setFilter":case"setSort":case"setValues":return{...t,[o]:{...t[o]??{},[i]:r.payload}};case"reset":return{...t,[o]:{}};default:return t}}}function Jc(e){let t=null,r=[];return{load:async()=>{if(r.length>0)return r;const s=await e.queryFn();return r=s,s},subscribe:()=>(t=new WebSocket(e.url,"graphql-ws"),t.onopen=()=>{t.send(JSON.stringify({type:"connection_init",payload:e.connectionParams??{}})),t.send(JSON.stringify({type:"start",id:"1",payload:{query:e.query,variables:e.variables}}))},t.onmessage=s=>{var i,o;try{const l=JSON.parse(s.data);l.type==="data"&&((i=l.payload)!=null&&i.data)&&(r=(e.extractData??(u=>{const f=u,p=Object.keys(f)[0];return p?f[p]:[]}))(l.payload.data),(o=e.onData)==null||o.call(e,r))}catch{}},()=>{t==null||t.close(),t=null}),unsubscribe:()=>{t==null||t.close(),t=null}}}async function Yc(e,t){var d;const r=await fetch(e);if(!r.ok)throw new Error(`OpenAPI fetch failed: ${r.status}`);const a=await r.json(),s=(((d=a.components)==null?void 0:d.schemas)??a.definitions??{})[t];if(!s)throw new Error(`Schema "${t}" not found in OpenAPI spec`);const i=new Set(s.required??[]),o=[],l=[];for(const[u,f]of Object.entries(s.properties??{})){const p=wt(f),h=f.title??kt(u);o.push({dataField:u,caption:h,dataType:p,allowEditing:!f.readOnly,visible:!u.toLowerCase().endsWith("id")||u==="id",...f.enum?{lookup:{dataSource:f.enum,valueExpr:"this",displayExpr:"this"}}:{}}),l.push({dataField:u,label:h,editorType:Ur(f,p),isRequired:i.has(u),editorOptions:qr(f),...i.has(u)?{validationRules:[{type:"required",message:`${h} jest wymagane`}]}:{}})}return{columns:o,formFields:l,schema:s}}function Qc(e){const t=[];for(const[r,a]of Object.entries(e.properties??{}))t.push({dataField:r,caption:a.title??kt(r),dataType:wt(a),allowEditing:!a.readOnly});return t}function Zc(e){const t=new Set(e.required??[]),r=[];for(const[a,n]of Object.entries(e.properties??{})){const s=wt(n);r.push({dataField:a,label:n.title??kt(a),editorType:Ur(n,s),isRequired:t.has(a),editorOptions:qr(n)})}return r}function wt(e){return e.type==="integer"||e.type==="number"?"number":e.type==="boolean"?"boolean":e.format==="date"?"date":e.format==="date-time"?"datetime":e.type==="object"||e.type==="array"?"object":"string"}function Ur(e,t){return e.enum?"NiceSelect":e.format==="email"||e.format==="uri"||e.format==="url"?"NiceTextInput":e.format==="password"?"NicePasswordInput":t==="number"?"NiceNumberInput":t==="boolean"?"NiceToggle":t==="date"||t==="datetime"?"NiceDateTimePicker":e.maxLength&&e.maxLength>200?"NiceTextArea":"NiceTextInput"}function qr(e){const t={};return e.minimum!==void 0&&(t.min=e.minimum),e.maximum!==void 0&&(t.max=e.maximum),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.pattern&&(t.pattern=e.pattern),e.enum&&(t.items=e.enum.map(r=>({label:r,value:r}))),e.description&&(t.hint=e.description),Object.keys(t).length>0?t:{}}function kt(e){return e.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}const Gr={enabled:!0,defaultExpanded:!1,showHelpIcon:!0,position:"tooltip",locale:"en"},el=async(e,t)=>{try{return null}catch{return null}},Kr=c.createContext(null),Jr=({children:e,config:t,helpContent:r})=>{const[a,n]=c.useState({...Gr,...t}),[s,i]=c.useState(new Set),[o,l]=c.useState(()=>new Map(Object.entries(r||{}))),d=c.useCallback(g=>{n(v=>({...v,...g}))},[]),u=c.useCallback(()=>{n(g=>({...g,enabled:!g.enabled}))},[]),f=c.useCallback(g=>{i(v=>new Set(v).add(g))},[]),p=c.useCallback(g=>{i(v=>{const b=new Set(v);return b.delete(g),b})},[]),h=c.useCallback(g=>a.enabled&&!s.has(g),[a.enabled,s]),m=c.useCallback(async g=>{if(o.has(g))return o.get(g)||null;const b=await(a.contentLoader||el)(g,a.locale);return b&&l(S=>new Map(S).set(g,b)),b},[o,a.contentLoader,a.locale]),y=c.useMemo(()=>({config:a,setConfig:d,toggleGlobalHelp:u,disabledComponents:s,disableComponentHelp:f,enableComponentHelp:p,isHelpEnabled:h,getHelpContent:m,helpCache:o}),[a,d,u,s,f,p,h,m,o]);return x.jsx(Kr.Provider,{value:y,children:e})};Jr.displayName="NiceHelpProvider";function Yr(){const e=c.useContext(Kr);return e||{config:Gr,setConfig:()=>{},toggleGlobalHelp:()=>{},disabledComponents:new Set,disableComponentHelp:()=>{},enableComponentHelp:()=>{},isHelpEnabled:()=>!0,getHelpContent:async()=>null,helpCache:new Map}}function Qr(e){const{isHelpEnabled:t,getHelpContent:r,helpCache:a,config:n}=Yr(),[s,i]=c.useState(a.get(e)||null),[o,l]=c.useState(!1),d=t(e),u=c.useCallback(async()=>{if(!d)return;l(!0);const f=await r(e);i(f),l(!1)},[d,e,r]);return{content:s,loading:o,enabled:d,loadContent:u,position:n.position,defaultExpanded:n.defaultExpanded,showHelpIcon:n.showHelpIcon}}const Zr=({props:e,compact:t})=>{const{t:r}=V.useNiceTranslation();return!e||e.length===0?null:t?x.jsxs("div",{className:"nice-help__props-compact",children:[e.slice(0,5).map(a=>x.jsxs("div",{className:"nice-help__prop-chip",children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",children:"*"})]},a.name)),e.length>5&&x.jsxs("span",{className:"nice-help__more",children:["+",e.length-5," ",r("help.moreProps","more")]})]}):x.jsxs("div",{className:"nice-help__props",children:[x.jsx("h4",{className:"nice-help__section-title",children:r("help.props","Properties")}),x.jsxs("table",{className:"nice-help__props-table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{children:r("help.propName","Name")}),x.jsx("th",{children:r("help.propType","Type")}),x.jsx("th",{children:r("help.propDefault","Default")}),x.jsx("th",{children:r("help.propDescription","Description")})]})}),x.jsx("tbody",{children:e.map(a=>x.jsxs("tr",{children:[x.jsxs("td",{children:[x.jsx("code",{children:a.name}),a.required&&x.jsx("span",{className:"nice-help__required",title:r("help.required","Required"),children:"*"})]}),x.jsx("td",{children:x.jsx("code",{className:"nice-help__type",children:a.type})}),x.jsx("td",{children:a.default!==void 0?x.jsx("code",{children:String(a.default)}):"—"}),x.jsx("td",{children:a.description})]},a.name))})]})]})},rt=({tips:e})=>{const{t}=V.useNiceTranslation();return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__tips",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.tips","Tips")}),x.jsx("ul",{children:e.map((r,a)=>x.jsxs("li",{children:[x.jsx("span",{className:"nice-help__tip-icon",children:"💡"}),r]},a))})]})},tl=({examples:e})=>{var n,s;const{t}=V.useNiceTranslation(),[r,a]=c.useState(0);return!e||e.length===0?null:x.jsxs("div",{className:"nice-help__examples",children:[x.jsx("h4",{className:"nice-help__section-title",children:t("help.examples","Examples")}),e.length>1&&x.jsx("div",{className:"nice-help__example-tabs",children:e.map((i,o)=>x.jsx("button",{className:`nice-help__example-tab ${r===o?"nice-help__example-tab--active":""}`,onClick:()=>a(o),children:i.title},o))}),x.jsx("pre",{className:"nice-help__code",children:x.jsx("code",{className:`language-${((n=e[r])==null?void 0:n.language)||"tsx"}`,children:(s=e[r])==null?void 0:s.code})})]})},ea=({componentName:e,content:t,children:r,position:a,defaultExpanded:n,disabled:s=!1,className:i,icon:o,title:l,showProps:d=!0,showExamples:u=!1,showTips:f=!0,compact:p=!1})=>{const{t:h}=V.useNiceTranslation(),{content:m,loading:y,enabled:g,loadContent:v,position:b,defaultExpanded:S,showHelpIcon:w}=Qr(e),A=t||m,k=a||b,C=n??S,[M,N]=c.useState(C);return c.useEffect(()=>{g&&!t&&!m&&v()},[g,t,m,v]),s||!g?x.jsx(x.Fragment,{children:r}):k==="tooltip"?x.jsxs("div",{className:`nice-help-tooltip-wrapper ${i||""}`,children:[r,w&&A&&x.jsx("button",{className:"nice-help__trigger",onClick:()=>N(!M),"aria-label":h("help.toggle","Toggle help"),"aria-expanded":M,children:o||x.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),M&&A&&x.jsx("div",{className:"nice-help__tooltip",children:x.jsxs("div",{className:"nice-help__tooltip-content",children:[x.jsx("h3",{className:"nice-help__title",children:l||A.name}),x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(rt,{tips:A.tips}),d&&A.props&&x.jsx(Zr,{props:A.props,compact:!0})]})})]}):x.jsxs("div",{className:`nice-help ${k==="bottom"?"nice-help--bottom":""} ${i||""}`,children:[k==="top"&&A&&x.jsx(Xt,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:p}),r,k==="bottom"&&A&&x.jsx(Xt,{content:A,expanded:M,onToggle:()=>N(!M),loading:y,title:l,showProps:d,showExamples:u,showTips:f,compact:p}),k==="inline"&&A&&M&&x.jsxs("div",{className:"nice-help__inline",children:[x.jsx("p",{className:"nice-help__description",children:A.description}),f&&A.tips&&x.jsx(rt,{tips:A.tips})]})]})};ea.displayName="NiceInlineHelp";const Xt=({content:e,expanded:t,onToggle:r,loading:a,title:n,showProps:s,showExamples:i,showTips:o,compact:l})=>{const{t:d}=V.useNiceTranslation();return a?x.jsx("div",{className:"nice-help__panel nice-help__panel--loading",children:x.jsx("div",{className:"nice-spinner nice-spinner--sm"})}):x.jsxs("div",{className:`nice-help__panel ${t?"nice-help__panel--expanded":""}`,children:[x.jsxs("button",{className:"nice-help__panel-header",onClick:r,"aria-expanded":t,children:[x.jsx("span",{className:"nice-help__panel-icon",children:t?"▾":"▸"}),x.jsxs("span",{className:"nice-help__panel-title",children:[n||d("help.about","About")," ",e.name]}),e.status&&x.jsx("span",{className:`nice-help__status nice-help__status--${e.status}`,children:e.status})]}),t&&x.jsxs("div",{className:"nice-help__panel-content",children:[x.jsx("p",{className:"nice-help__description",children:e.description}),o&&e.tips&&x.jsx(rt,{tips:e.tips}),s&&e.props&&x.jsx(Zr,{props:e.props,compact:l}),i&&e.examples&&x.jsx(tl,{examples:e.examples}),e.seeAlso&&e.seeAlso.length>0&&x.jsxs("div",{className:"nice-help__see-also",children:[x.jsx("h4",{className:"nice-help__section-title",children:d("help.seeAlso","See Also")}),x.jsx("ul",{children:e.seeAlso.map((u,f)=>x.jsx("li",{children:x.jsx("code",{children:u})},f))})]})]})]})},ta=({text:e,position:t="top",className:r,children:a})=>{const[n,s]=c.useState(!1);return x.jsxs("span",{className:`nice-quick-help nice-quick-help--${t} ${r||""}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),children:[a,n&&x.jsx("span",{className:"nice-quick-help__popup",role:"tooltip",children:e})]})};ta.displayName="NiceQuickHelp";const ra=({content:e,size:t="sm",className:r,onOpen:a})=>{const{t:n}=V.useNiceTranslation(),[s,i]=c.useState(!1),o=c.useCallback(()=>{i(!s),!s&&a&&a()},[s,a]),l=typeof e=="string"?e:e.description,d=typeof e=="string"?void 0:e.name;return x.jsxs("span",{className:`nice-help-icon nice-help-icon--${t} ${r||""}`,children:[x.jsx("button",{className:"nice-help-icon__btn",onClick:o,"aria-label":n("help.showHelp","Show help"),"aria-expanded":s,children:x.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})})}),s&&x.jsxs("div",{className:"nice-help-icon__popup",children:[d&&x.jsx("strong",{children:d}),x.jsx("p",{children:l}),x.jsx("button",{className:"nice-help-icon__close",onClick:()=>i(!1),children:"×"})]})]})};ra.displayName="NiceHelpIcon";const Mt=c.createContext({enabled:!0,active:!1,run:()=>{}}),rl=({enabled:e=!0,active:t=!1,onRun:r,children:a})=>{const n=c.useMemo(()=>({enabled:e,active:t,run:r??(()=>{})}),[e,t,r]);return x.jsx(Mt.Provider,{value:n,children:a})};function aa(){return c.useContext(Mt)}function al(){return c.useContext(Mt).enabled}function nl(e,t){if(!e)return null;if(e===!0)return t&&t.length>0?t:null;if(Array.isArray(e))return e.length>0?e:null;const r=e.steps??t;return r&&r.length>0?r:null}function na(e,t){return e.map(r=>({target:r.target,title:r.titleKey?t(r.titleKey,r.title??""):r.title??"",content:r.contentKey?t(r.contentKey,r.content??""):r.content??"",placement:r.placement,highlightPadding:r.highlightPadding,showArrow:r.showArrow,scrollIntoView:r.scrollIntoView,disableInteraction:r.disableInteraction}))}const sl=({steps:e,autoStart:t,label:r,size:a="md",className:n,style:s,"data-testid":i})=>{const{enabled:o,run:l}=aa(),{t:d}=V.useNiceTranslation();if(!o||!e||e.length===0)return null;const u=r??d("tutorial.startAria","Start tutorial");return x.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${a}`+(n?` ${n}`:""),style:s,"data-testid":i,"aria-label":u,title:u,onClick:()=>l(na(e,d),{autoStart:t}),children:"?"})},Ut="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(Ut)){const e=document.createElement("style");e.id=Ut,e.textContent=`
|
|
41
41
|
.nice-tutorial-button {
|
|
42
42
|
display: inline-flex;
|
|
43
43
|
align-items: center;
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
.nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
|
|
65
65
|
.nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
|
|
66
|
-
`,document.head.appendChild(e)}class sa{constructor(t="ntd-user-preferences"){this.key=t}async load(){try{const t=localStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){localStorage.setItem(this.key,JSON.stringify(t))}async clear(){localStorage.removeItem(this.key)}}class sl{constructor(t="ntd-preferences",r="preferences"){this.db=null,this.dbName=t,this.storeName=r}async getDB(){return this.db?this.db:new Promise((t,r)=>{const a=indexedDB.open(this.dbName,1);a.onerror=()=>r(a.error),a.onsuccess=()=>{this.db=a.result,t(this.db)},a.onupgradeneeded=n=>{const s=n.target.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName,{keyPath:"id"})}})}async load(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>{var o;return r(((o=i.result)==null?void 0:o.data)||null)}})}async save(t){const r=await this.getDB();return new Promise((a,n)=>{const o=r.transaction(this.storeName,"readwrite").objectStore(this.storeName).put({id:"user-preferences",data:t});o.onerror=()=>n(o.error),o.onsuccess=()=>a()})}async clear(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>r()})}}class ol{constructor(t,r){this.baseUrl=t,this.getAuthHeaders=r}getHeaders(){var t;return{"Content-Type":"application/json",...((t=this.getAuthHeaders)==null?void 0:t.call(this))||{}}}async fetch(){const t=await fetch(`${this.baseUrl}/preferences`,{method:"GET",headers:this.getHeaders()});if(!t.ok){if(t.status===404)return null;throw new Error(`Failed to fetch preferences: ${t.statusText}`)}return t.json()}async push(t){const r=await fetch(`${this.baseUrl}/preferences`,{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to save preferences: ${r.statusText}`)}async getServerTimestamp(){const t=await fetch(`${this.baseUrl}/preferences/timestamp`,{method:"GET",headers:this.getHeaders()});return t.ok&&(await t.json()).timestamp||0}}const oa=c.createContext(null);function At(){const e=c.useContext(oa);if(!e)throw new Error("useUserPreferences must be used within NiceUserPreferencesProvider");return e}function Et(e,t){const{getControlPreferences:r,setControlPreferences:a,updateControlPreferences:n}=At(),s=r(e,t),i=c.useCallback(l=>a(e,t,l),[e,t,a]),o=c.useCallback(l=>n(e,t,l),[e,t,n]);return[s,i,o]}function il(e){return Et(e,"grid")}function cl(e){return Et(e,"chart")}const Gt={version:1,global:{},controls:{}};function ll({storage:e=new sa,syncAdapter:t,autoSyncInterval:r=0,saveDebounce:a=500,children:n}){const[s,i]=c.useState(Gt),[o,l]=c.useState(!0),[d,u]=c.useState(!1),[f,g]=c.useState(null),h=c.useRef(),m=c.useRef();c.useEffect(()=>{let E=!0;return(async()=>{try{const T=await e.load();E&&T&&i(T)}catch(T){E&&g(T instanceof Error?T:new Error("Failed to load preferences"))}finally{E&&l(!1)}})(),()=>{E=!1}},[e]);const y=c.useCallback(E=>{h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{try{await e.save(E)}catch(R){g(R instanceof Error?R:new Error("Failed to save preferences"))}},a)},[e,a]);c.useEffect(()=>{o||y(s)},[s,o,y]),c.useEffect(()=>{if(t&&r>0)return m.current=setInterval(()=>{k()},r),()=>{m.current&&clearInterval(m.current)}},[t,r]),c.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m.current&&clearInterval(m.current)},[]);const p=c.useCallback((E,R)=>{var T;return(T=s.controls[E])==null?void 0:T[R]},[s]),v=c.useCallback((E,R,T)=>{i(D=>({...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:T,lastModified:Date.now()}}}))},[]),b=c.useCallback((E,R,T)=>{i(D=>{var H;const F=(H=D.controls[E])==null?void 0:H[R],z=typeof F=="object"&&F!==null?{...F,...T}:T;return{...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:z,lastModified:Date.now()}}}})},[]),S=c.useCallback((E,R)=>{i(T=>{if(R){const{[R]:z,...H}=T.controls[E]||{};return{...T,controls:{...T.controls,[E]:H}}}const{[E]:D,...F}=T.controls;return{...T,controls:F}})},[]),w=c.useCallback(E=>s.global[E],[s]),A=c.useCallback((E,R)=>{i(T=>({...T,global:{...T.global,[E]:R}}))},[]),k=c.useCallback(async()=>{if(t){u(!0),g(null);try{const E=await t.getServerTimestamp(),R=s.lastSync||0;if(E>R){const T=await t.fetch();T&&(i({...T,lastSync:Date.now()}),await e.save(T))}else{const T={...s,lastSync:Date.now()};await t.push(T),i(T)}}catch(E){g(E instanceof Error?E:new Error("Sync failed"))}finally{u(!1)}}},[t,s,e]),C=c.useCallback(()=>JSON.stringify(s,null,2),[s]),M=c.useCallback(E=>{try{const R=JSON.parse(E);if(typeof R.version!="number"||!R.controls)throw new Error("Invalid preferences format");i(R)}catch(R){g(R instanceof Error?R:new Error("Import failed"))}},[]),N=c.useCallback(()=>{i(Gt),e.clear()},[e]),L=c.useMemo(()=>({preferences:s,isLoading:o,isSyncing:d,error:f,getControlPreferences:p,setControlPreferences:v,updateControlPreferences:b,clearControlPreferences:S,getGlobalPreferences:w,setGlobalPreferences:A,sync:k,exportPreferences:C,importPreferences:M,resetAllPreferences:N}),[s,o,d,f,p,v,b,S,w,A,k,C,M,N]);return x.jsx(oa.Provider,{value:L,children:n})}function dl({showGlobal:e=!0,showControls:t=!0,showExportImport:r=!0,showSync:a=!0,className:n,style:s}){var w,A,k,C;const{preferences:i,isLoading:o,isSyncing:l,error:d,sync:u,exportPreferences:f,importPreferences:g,resetAllPreferences:h,setGlobalPreferences:m,clearControlPreferences:y}=At(),p=c.useRef(null),v=()=>{const M=f(),N=new Blob([M],{type:"application/json"}),L=URL.createObjectURL(N),E=document.createElement("a");E.href=L,E.download="nice2dev-preferences.json",E.click(),URL.revokeObjectURL(L)},b=M=>{var E;const N=(E=M.target.files)==null?void 0:E[0];if(!N)return;const L=new FileReader;L.onload=()=>{g(L.result)},L.readAsText(N)};if(o)return x.jsx("div",{className:n,style:s,children:"Loading preferences..."});const S=Object.keys(i.controls);return x.jsxs("div",{className:`ntd-preferences-panel ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",padding:"16px",...s},children:[d&&x.jsx("div",{style:{padding:"12px",marginBottom:"16px",background:"var(--danger-bg, #fef2f2)",border:"1px solid var(--nice-danger-bg, #fecaca)",borderRadius:"6px",color:"var(--color-error, #dc2626)"},children:d.message}),x.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px",flexWrap:"wrap"},children:[a&&x.jsx("button",{onClick:u,disabled:l,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:l?"wait":"pointer"},children:l?"Syncing...":"Sync"}),r&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:v,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Export"}),x.jsx("button",{onClick:()=>{var M;return(M=p.current)==null?void 0:M.click()},style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Import"}),x.jsx("input",{ref:p,type:"file",accept:".json",onChange:b,style:{display:"none"}})]}),x.jsx("button",{onClick:h,style:{padding:"8px 16px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer",marginLeft:"auto"},children:"Reset All"})]}),e&&x.jsxs("div",{style:{marginBottom:"24px"},children:[x.jsx("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:"Global Preferences"}),x.jsxs("div",{style:{display:"grid",gap:"12px"},children:[x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((w=i.global.display)==null?void 0:w.reducedMotion)||!1,onChange:M=>m("display",{...i.global.display,reducedMotion:M.target.checked})}),"Reduced motion"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((A=i.global.display)==null?void 0:A.highContrast)||!1,onChange:M=>m("display",{...i.global.display,highContrast:M.target.checked})}),"High contrast"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:["Font scale:",x.jsx("input",{type:"range",min:"0.8",max:"1.5",step:"0.1",value:((k=i.global.display)==null?void 0:k.fontScale)||1,onChange:M=>m("display",{...i.global.display,fontScale:parseFloat(M.target.value)}),style:{flex:1}}),x.jsxs("span",{children:[((((C=i.global.display)==null?void 0:C.fontScale)||1)*100).toFixed(0),"%"]})]})]})]}),t&&S.length>0&&x.jsxs("div",{children:[x.jsxs("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:["Control Preferences (",S.length,")"]}),x.jsx("div",{style:{display:"grid",gap:"8px"},children:S.map(M=>{const N=i.controls[M],L=Object.keys(N).filter(E=>E!=="lastModified");return x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"6px"},children:[x.jsxs("div",{children:[x.jsx("div",{style:{fontWeight:500},children:M}),x.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted, #6b7280)"},children:L.join(", ")})]}),x.jsx("button",{onClick:()=>y(M),style:{padding:"4px 8px",border:"none",borderRadius:"4px",background:"var(--border-color, #e5e7eb)",cursor:"pointer",fontSize:"12px"},children:"Clear"})]},M)})})]}),t&&S.length===0&&x.jsx("div",{style:{color:"var(--text-muted, #6b7280)",fontStyle:"italic"},children:"No control preferences saved yet."})]})}const ul={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},ia={traceless:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",requiresConsentBanner:!1},ephemeral:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"ephemeral",requiresConsentBanner:!1},private:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!0,effectiveMode:"private",requiresConsentBanner:!1},balanced:{cookiesAllowed:!1,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"balanced",requiresConsentBanner:!0},full:{cookiesAllowed:!0,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"full",requiresConsentBanner:!0},custom:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"custom",requiresConsentBanner:!1}},fe=["traceless","ephemeral","private","balanced","full","custom"];function fl(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a?e:t}function Te(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a}function ml(e,t,r,a){let n=e.defaultMode,s="instance";t&&e.allowTenantOverride&&Te(t.mode,n)&&(n=t.mode,s="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Te(r.mode,n)&&(n=r.mode,s="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Te(a.preferredMode,n)&&(n=a.preferredMode,s="user");const i=ia[n],o={...i,cookiesAllowed:i.cookiesAllowed&&e.maxCookies,localStorageAllowed:i.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:i.sessionStorageAllowed&&e.maxSessionStorage,source:s,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(o.cookiesAllowed=!1),a.restrictLocalStorage&&(o.localStorageAllowed=!1),a.restrictSessionStorage&&(o.sessionStorageAllowed=!1)),o.effectiveMode=Nt(o),o.requiresConsentBanner=ca(o),o}function Nt(e){const{cookiesAllowed:t,localStorageAllowed:r,sessionStorageAllowed:a,strictAuthCookieOnly:n}=e;return!t&&!r&&!a?"traceless":!t&&!r&&a&&!n?"ephemeral":!t&&!r&&a&&n?"private":!t&&r&&a?"balanced":t&&r&&a?"full":"custom"}function ca(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const la=new Map;class da{constructor(t,r="nice2dev",a="local"){this.policy=t,this.namespace=r,this.defaultBackend=a}getBackend(t){const r=t||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return la}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const s=a instanceof Map?a.get(n):a.getItem(n);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,r,a){const n=this.getBackend(a),s=this.getKey(t);try{const i=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(s,i):n.setItem(s,i),!0}catch{return!1}}remove(t,r){const a=this.getBackend(r),n=this.getKey(t);try{return a instanceof Map?a.delete(n):(a.removeItem(n),!0)}catch{return!1}}clear(t){const r=this.getBackend(t),a=`${this.namespace}:`;try{if(r instanceof Map)for(const n of r.keys())n.startsWith(a)&&r.delete(n);else{const n=[];for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i)}n.forEach(s=>r.removeItem(s))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const s of r.keys())s.startsWith(a)&&n.push(s.slice(a.length));else for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i.slice(a.length))}}catch{}return n}has(t,r){return this.get(t,r)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}}function pl(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,s={...e};if(n&&n!=="auto")switch(n){case"traceless":s.cookiesAllowed=!1,s.localStorageAllowed=!1,s.sessionStorageAllowed=!1;break;case"ephemeral":s.cookiesAllowed=!1,s.localStorageAllowed=!1;break}return r===!1&&(s.cookiesAllowed=!1),a===!1&&(s.localStorageAllowed=!1),s.effectiveMode=Nt(s),s.source="control",s}function gl(e,t,r){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:r,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:yl(e)}}function yl(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function hl(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"var(--nice-success, #10b981)",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"var(--nice-primary, #3b82f6)",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"var(--nice-warning, #eab308)",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"var(--nice-warning, #f97316)",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"var(--nice-danger, #ef4444)",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function bl(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,s={preferences:{message:"Your preferences will reset when you close this tab.",key:"traceless.warning.preferences"},draft:{message:"Unsaved draft will be lost if you close or refresh this page.",key:"traceless.warning.draft"},history:{message:"Search history is not saved in this privacy mode.",key:"traceless.warning.history"},auth:{message:"You will need to log in again each time you visit.",key:"traceless.warning.auth"},"grid-state":{message:"Table settings (sorting, filtering, columns) will reset on page refresh.",key:"traceless.warning.gridState"}}[t];return!r&&!a?{canPersist:!1,canSession:!1,warningMessage:s.message,warningKey:s.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?s.message:void 0,warningKey:t!=="auth"?s.key:void 0}:{canPersist:!0,canSession:!0}}const vl="X-OmniVerk-Storage-Policy";function Sl(e){const t=e.toLowerCase().trim();return fe.includes(t)?t:null}function xl(e){return e.effectiveMode}function wl(e,t){return new da(e,t)}function kl(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function Ml(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function Cl(){if(typeof document<"u"){const e=document.cookie.split(";");for(const t of e){const r=t.split("=")[0].trim();document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`}}try{typeof localStorage<"u"&&localStorage.clear()}catch{}try{typeof sessionStorage<"u"&&sessionStorage.clear()}catch{}la.clear()}function Al(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const ua=c.createContext(null),El=({config:e,children:t})=>{const[r,a]=c.useState(!1),[n,s]=c.useState(null),i=c.useRef(null);c.useEffect(()=>()=>{var m;(m=i.current)==null||m.abort()},[]);const o=c.useCallback(()=>{var m;(m=i.current)==null||m.abort(),i.current=null,a(!1)},[]),l=async(m,y,p)=>{var S,w,A,k,C,M;const v=new TextDecoder;let b="";for(;;){const{done:N,value:L}=await m.read();if(N)break;b+=v.decode(L,{stream:!0});const E=b.split(`
|
|
67
|
-
`);b=E.pop()||"";for(const R of E)if(R.startsWith("data: ")){const T=R.slice(6).trim();if(T==="[DONE]"){y({content:"",done:!0});return}try{const D=JSON.parse(T);let F="",z=!1;
|
|
66
|
+
`,document.head.appendChild(e)}class sa{constructor(t="ntd-user-preferences"){this.key=t}async load(){try{const t=localStorage.getItem(this.key);return t?JSON.parse(t):null}catch{return null}}async save(t){localStorage.setItem(this.key,JSON.stringify(t))}async clear(){localStorage.removeItem(this.key)}}class ol{constructor(t="ntd-preferences",r="preferences"){this.db=null,this.dbName=t,this.storeName=r}async getDB(){return this.db?this.db:new Promise((t,r)=>{const a=indexedDB.open(this.dbName,1);a.onerror=()=>r(a.error),a.onsuccess=()=>{this.db=a.result,t(this.db)},a.onupgradeneeded=n=>{const s=n.target.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName,{keyPath:"id"})}})}async load(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readonly").objectStore(this.storeName).get("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>{var o;return r(((o=i.result)==null?void 0:o.data)||null)}})}async save(t){const r=await this.getDB();return new Promise((a,n)=>{const o=r.transaction(this.storeName,"readwrite").objectStore(this.storeName).put({id:"user-preferences",data:t});o.onerror=()=>n(o.error),o.onsuccess=()=>a()})}async clear(){const t=await this.getDB();return new Promise((r,a)=>{const i=t.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete("user-preferences");i.onerror=()=>a(i.error),i.onsuccess=()=>r()})}}class il{constructor(t,r){this.baseUrl=t,this.getAuthHeaders=r}getHeaders(){var t;return{"Content-Type":"application/json",...((t=this.getAuthHeaders)==null?void 0:t.call(this))||{}}}async fetch(){const t=await fetch(`${this.baseUrl}/preferences`,{method:"GET",headers:this.getHeaders()});if(!t.ok){if(t.status===404)return null;throw new Error(`Failed to fetch preferences: ${t.statusText}`)}return t.json()}async push(t){const r=await fetch(`${this.baseUrl}/preferences`,{method:"PUT",headers:this.getHeaders(),body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to save preferences: ${r.statusText}`)}async getServerTimestamp(){const t=await fetch(`${this.baseUrl}/preferences/timestamp`,{method:"GET",headers:this.getHeaders()});return t.ok&&(await t.json()).timestamp||0}}const oa=c.createContext(null);function Ct(){const e=c.useContext(oa);if(!e)throw new Error("useUserPreferences must be used within NiceUserPreferencesProvider");return e}function At(e,t){const{getControlPreferences:r,setControlPreferences:a,updateControlPreferences:n}=Ct(),s=r(e,t),i=c.useCallback(l=>a(e,t,l),[e,t,a]),o=c.useCallback(l=>n(e,t,l),[e,t,n]);return[s,i,o]}function cl(e){return At(e,"grid")}function ll(e){return At(e,"chart")}const qt={version:1,global:{},controls:{}};function dl({storage:e=new sa,syncAdapter:t,autoSyncInterval:r=0,saveDebounce:a=500,children:n}){const[s,i]=c.useState(qt),[o,l]=c.useState(!0),[d,u]=c.useState(!1),[f,p]=c.useState(null),h=c.useRef(),m=c.useRef();c.useEffect(()=>{let E=!0;return(async()=>{try{const T=await e.load();E&&T&&i(T)}catch(T){E&&p(T instanceof Error?T:new Error("Failed to load preferences"))}finally{E&&l(!1)}})(),()=>{E=!1}},[e]);const y=c.useCallback(E=>{h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{try{await e.save(E)}catch(R){p(R instanceof Error?R:new Error("Failed to save preferences"))}},a)},[e,a]);c.useEffect(()=>{o||y(s)},[s,o,y]),c.useEffect(()=>{if(t&&r>0)return m.current=setInterval(()=>{k()},r),()=>{m.current&&clearInterval(m.current)}},[t,r]),c.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m.current&&clearInterval(m.current)},[]);const g=c.useCallback((E,R)=>{var T;return(T=s.controls[E])==null?void 0:T[R]},[s]),v=c.useCallback((E,R,T)=>{i(D=>({...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:T,lastModified:Date.now()}}}))},[]),b=c.useCallback((E,R,T)=>{i(D=>{var H;const F=(H=D.controls[E])==null?void 0:H[R],z=typeof F=="object"&&F!==null?{...F,...T}:T;return{...D,controls:{...D.controls,[E]:{...D.controls[E],[R]:z,lastModified:Date.now()}}}})},[]),S=c.useCallback((E,R)=>{i(T=>{if(R){const{[R]:z,...H}=T.controls[E]||{};return{...T,controls:{...T.controls,[E]:H}}}const{[E]:D,...F}=T.controls;return{...T,controls:F}})},[]),w=c.useCallback(E=>s.global[E],[s]),A=c.useCallback((E,R)=>{i(T=>({...T,global:{...T.global,[E]:R}}))},[]),k=c.useCallback(async()=>{if(t){u(!0),p(null);try{const E=await t.getServerTimestamp(),R=s.lastSync||0;if(E>R){const T=await t.fetch();T&&(i({...T,lastSync:Date.now()}),await e.save(T))}else{const T={...s,lastSync:Date.now()};await t.push(T),i(T)}}catch(E){p(E instanceof Error?E:new Error("Sync failed"))}finally{u(!1)}}},[t,s,e]),C=c.useCallback(()=>JSON.stringify(s,null,2),[s]),M=c.useCallback(E=>{try{const R=JSON.parse(E);if(typeof R.version!="number"||!R.controls)throw new Error("Invalid preferences format");i(R)}catch(R){p(R instanceof Error?R:new Error("Import failed"))}},[]),N=c.useCallback(()=>{i(qt),e.clear()},[e]),L=c.useMemo(()=>({preferences:s,isLoading:o,isSyncing:d,error:f,getControlPreferences:g,setControlPreferences:v,updateControlPreferences:b,clearControlPreferences:S,getGlobalPreferences:w,setGlobalPreferences:A,sync:k,exportPreferences:C,importPreferences:M,resetAllPreferences:N}),[s,o,d,f,g,v,b,S,w,A,k,C,M,N]);return x.jsx(oa.Provider,{value:L,children:n})}function ul({showGlobal:e=!0,showControls:t=!0,showExportImport:r=!0,showSync:a=!0,className:n,style:s}){var w,A,k,C;const{preferences:i,isLoading:o,isSyncing:l,error:d,sync:u,exportPreferences:f,importPreferences:p,resetAllPreferences:h,setGlobalPreferences:m,clearControlPreferences:y}=Ct(),g=c.useRef(null),v=()=>{const M=f(),N=new Blob([M],{type:"application/json"}),L=URL.createObjectURL(N),E=document.createElement("a");E.href=L,E.download="nice2dev-preferences.json",E.click(),URL.revokeObjectURL(L)},b=M=>{var E;const N=(E=M.target.files)==null?void 0:E[0];if(!N)return;const L=new FileReader;L.onload=()=>{p(L.result)},L.readAsText(N)};if(o)return x.jsx("div",{className:n,style:s,children:"Loading preferences..."});const S=Object.keys(i.controls);return x.jsxs("div",{className:`ntd-preferences-panel ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",padding:"16px",...s},children:[d&&x.jsx("div",{style:{padding:"12px",marginBottom:"16px",background:"var(--danger-bg, #fef2f2)",border:"1px solid var(--nice-danger-bg, #fecaca)",borderRadius:"6px",color:"var(--color-error, #dc2626)"},children:d.message}),x.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"20px",flexWrap:"wrap"},children:[a&&x.jsx("button",{onClick:u,disabled:l,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:l?"wait":"pointer"},children:l?"Syncing...":"Sync"}),r&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:v,style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Export"}),x.jsx("button",{onClick:()=>{var M;return(M=g.current)==null?void 0:M.click()},style:{padding:"8px 16px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Import"}),x.jsx("input",{ref:g,type:"file",accept:".json",onChange:b,style:{display:"none"}})]}),x.jsx("button",{onClick:h,style:{padding:"8px 16px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer",marginLeft:"auto"},children:"Reset All"})]}),e&&x.jsxs("div",{style:{marginBottom:"24px"},children:[x.jsx("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:"Global Preferences"}),x.jsxs("div",{style:{display:"grid",gap:"12px"},children:[x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((w=i.global.display)==null?void 0:w.reducedMotion)||!1,onChange:M=>m("display",{...i.global.display,reducedMotion:M.target.checked})}),"Reduced motion"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[x.jsx("input",{type:"checkbox",checked:((A=i.global.display)==null?void 0:A.highContrast)||!1,onChange:M=>m("display",{...i.global.display,highContrast:M.target.checked})}),"High contrast"]}),x.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px"},children:["Font scale:",x.jsx("input",{type:"range",min:"0.8",max:"1.5",step:"0.1",value:((k=i.global.display)==null?void 0:k.fontScale)||1,onChange:M=>m("display",{...i.global.display,fontScale:parseFloat(M.target.value)}),style:{flex:1}}),x.jsxs("span",{children:[((((C=i.global.display)==null?void 0:C.fontScale)||1)*100).toFixed(0),"%"]})]})]})]}),t&&S.length>0&&x.jsxs("div",{children:[x.jsxs("h3",{style:{margin:"0 0 12px",fontSize:"16px",fontWeight:600},children:["Control Preferences (",S.length,")"]}),x.jsx("div",{style:{display:"grid",gap:"8px"},children:S.map(M=>{const N=i.controls[M],L=Object.keys(N).filter(E=>E!=="lastModified");return x.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"6px"},children:[x.jsxs("div",{children:[x.jsx("div",{style:{fontWeight:500},children:M}),x.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted, #6b7280)"},children:L.join(", ")})]}),x.jsx("button",{onClick:()=>y(M),style:{padding:"4px 8px",border:"none",borderRadius:"4px",background:"var(--border-color, #e5e7eb)",cursor:"pointer",fontSize:"12px"},children:"Clear"})]},M)})})]}),t&&S.length===0&&x.jsx("div",{style:{color:"var(--text-muted, #6b7280)",fontStyle:"italic"},children:"No control preferences saved yet."})]})}const fl={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},ia={traceless:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",requiresConsentBanner:!1},ephemeral:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"ephemeral",requiresConsentBanner:!1},private:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!0,strictAuthCookieOnly:!0,effectiveMode:"private",requiresConsentBanner:!1},balanced:{cookiesAllowed:!1,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"balanced",requiresConsentBanner:!0},full:{cookiesAllowed:!0,localStorageAllowed:!0,sessionStorageAllowed:!0,strictAuthCookieOnly:!1,effectiveMode:"full",requiresConsentBanner:!0},custom:{cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"custom",requiresConsentBanner:!1}},fe=["traceless","ephemeral","private","balanced","full","custom"];function ml(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a?e:t}function Le(e,t){const r=fe.indexOf(e),a=fe.indexOf(t);return r<=a}function pl(e,t,r,a){let n=e.defaultMode,s="instance";t&&e.allowTenantOverride&&Le(t.mode,n)&&(n=t.mode,s="tenant"),r&&(t!=null&&t.allowGroupOverride)&&Le(r.mode,n)&&(n=r.mode,s="group"),a&&(t!=null&&t.allowUserOverride||r!=null&&r.allowUserLockdown)&&Le(a.preferredMode,n)&&(n=a.preferredMode,s="user");const i=ia[n],o={...i,cookiesAllowed:i.cookiesAllowed&&e.maxCookies,localStorageAllowed:i.localStorageAllowed&&e.maxLocalStorage,sessionStorageAllowed:i.sessionStorageAllowed&&e.maxSessionStorage,source:s,resolvedAt:Date.now(),version:"1.0.0"};return a&&(a.restrictCookies&&(o.cookiesAllowed=!1),a.restrictLocalStorage&&(o.localStorageAllowed=!1),a.restrictSessionStorage&&(o.sessionStorageAllowed=!1)),o.effectiveMode=Et(o),o.requiresConsentBanner=ca(o),o}function Et(e){const{cookiesAllowed:t,localStorageAllowed:r,sessionStorageAllowed:a,strictAuthCookieOnly:n}=e;return!t&&!r&&!a?"traceless":!t&&!r&&a&&!n?"ephemeral":!t&&!r&&a&&n?"private":!t&&r&&a?"balanced":t&&r&&a?"full":"custom"}function ca(e){return!e.cookiesAllowed&&!e.localStorageAllowed?!1:e.effectiveMode==="full"||e.effectiveMode==="balanced"}const la=new Map;class da{constructor(t,r="nice2dev",a="local"){this.policy=t,this.namespace=r,this.defaultBackend=a}getBackend(t){const r=t||this.defaultBackend;if(r==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((r==="session"||r==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return la}getKey(t){return`${this.namespace}:${t}`}get(t,r){const a=this.getBackend(r),n=this.getKey(t);try{const s=a instanceof Map?a.get(n):a.getItem(n);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,r,a){const n=this.getBackend(a),s=this.getKey(t);try{const i=typeof r=="string"?r:JSON.stringify(r);return n instanceof Map?n.set(s,i):n.setItem(s,i),!0}catch{return!1}}remove(t,r){const a=this.getBackend(r),n=this.getKey(t);try{return a instanceof Map?a.delete(n):(a.removeItem(n),!0)}catch{return!1}}clear(t){const r=this.getBackend(t),a=`${this.namespace}:`;try{if(r instanceof Map)for(const n of r.keys())n.startsWith(a)&&r.delete(n);else{const n=[];for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i)}n.forEach(s=>r.removeItem(s))}}catch{}}keys(t){const r=this.getBackend(t),a=`${this.namespace}:`,n=[];try{if(r instanceof Map)for(const s of r.keys())s.startsWith(a)&&n.push(s.slice(a.length));else for(let s=0;s<r.length;s++){const i=r.key(s);i&&i.startsWith(a)&&n.push(i.slice(a.length))}}catch{}return n}has(t,r){return this.get(t,r)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}}function gl(e,t){const{cookies:r,localStorage:a,storageMode:n}=t,s={...e};if(n&&n!=="auto")switch(n){case"traceless":s.cookiesAllowed=!1,s.localStorageAllowed=!1,s.sessionStorageAllowed=!1;break;case"ephemeral":s.cookiesAllowed=!1,s.localStorageAllowed=!1;break}return r===!1&&(s.cookiesAllowed=!1),a===!1&&(s.localStorageAllowed=!1),s.effectiveMode=Et(s),s.source="control",s}function yl(e,t,r){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:r,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:hl(e)}}function hl(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function bl(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"var(--nice-success, #10b981)",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"var(--nice-primary, #3b82f6)",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"var(--nice-warning, #eab308)",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"var(--nice-warning, #f97316)",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"var(--nice-danger, #ef4444)",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"var(--nice-text-secondary, #6b7280)",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function vl(e,t){const r=e.localStorageAllowed,a=e.sessionStorageAllowed,s={preferences:{message:"Your preferences will reset when you close this tab.",key:"traceless.warning.preferences"},draft:{message:"Unsaved draft will be lost if you close or refresh this page.",key:"traceless.warning.draft"},history:{message:"Search history is not saved in this privacy mode.",key:"traceless.warning.history"},auth:{message:"You will need to log in again each time you visit.",key:"traceless.warning.auth"},"grid-state":{message:"Table settings (sorting, filtering, columns) will reset on page refresh.",key:"traceless.warning.gridState"}}[t];return!r&&!a?{canPersist:!1,canSession:!1,warningMessage:s.message,warningKey:s.key}:!r&&a?{canPersist:!1,canSession:!0,warningMessage:t!=="auth"?s.message:void 0,warningKey:t!=="auth"?s.key:void 0}:{canPersist:!0,canSession:!0}}const Sl="X-OmniVerk-Storage-Policy";function xl(e){const t=e.toLowerCase().trim();return fe.includes(t)?t:null}function wl(e){return e.effectiveMode}function kl(e,t){return new da(e,t)}function Ml(e){return{maxCookies:!1,maxLocalStorage:!1,maxSessionStorage:!0,defaultMode:"ephemeral",allowTenantOverride:!1,instanceId:e}}function Cl(e){return{maxCookies:!0,maxLocalStorage:!0,maxSessionStorage:!0,defaultMode:"balanced",allowTenantOverride:!0,instanceId:e}}function Al(){if(typeof document<"u"){const e=document.cookie.split(";");for(const t of e){const r=t.split("=")[0].trim();document.cookie=`${r}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`}}try{typeof localStorage<"u"&&localStorage.clear()}catch{}try{typeof sessionStorage<"u"&&sessionStorage.clear()}catch{}la.clear()}function El(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const r=document.cookie;r&&r.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${r.split(";").length} cookie(s)`,data:r})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const ua=c.createContext(null),Nl=({config:e,children:t})=>{const[r,a]=c.useState(!1),[n,s]=c.useState(null),i=c.useRef(null);c.useEffect(()=>()=>{var m;(m=i.current)==null||m.abort()},[]);const o=c.useCallback(()=>{var m;(m=i.current)==null||m.abort(),i.current=null,a(!1)},[]),l=async(m,y,g)=>{var S,w,A,k,C,M;const v=new TextDecoder;let b="";for(;;){const{done:N,value:L}=await m.read();if(N)break;b+=v.decode(L,{stream:!0});const E=b.split(`
|
|
67
|
+
`);b=E.pop()||"";for(const R of E)if(R.startsWith("data: ")){const T=R.slice(6).trim();if(T==="[DONE]"){y({content:"",done:!0});return}try{const D=JSON.parse(T);let F="",z=!1;g==="openai"||g==="azure-openai"?(F=((A=(w=(S=D.choices)==null?void 0:S[0])==null?void 0:w.delta)==null?void 0:A.content)||"",z=((C=(k=D.choices)==null?void 0:k[0])==null?void 0:C.finish_reason)==="stop"):g==="anthropic"&&(D.type==="content_block_delta"?F=((M=D.delta)==null?void 0:M.text)||"":D.type==="message_stop"&&(z=!0)),(F||z)&&y({content:F,done:z})}catch{}}}y({content:"",done:!0})},d=(m,y)=>{var g;return{model:y.model||e.defaultModel||"gpt-4",messages:y.systemPrompt?[{role:"system",content:y.systemPrompt},...m]:m,temperature:y.temperature??.7,max_tokens:y.maxTokens,stop:y.stop,stream:y.stream??!1,tools:(g=y.tools)==null?void 0:g.map(v=>({type:"function",function:{name:v.name,description:v.description,parameters:v.parameters}}))}},u=(m,y)=>{var b;const g=y.systemPrompt||((b=m.find(S=>S.role==="system"))==null?void 0:b.content),v=m.filter(S=>S.role!=="system");return{model:y.model||e.defaultModel||"claude-3-opus-20240229",max_tokens:y.maxTokens||4096,system:g,messages:v.map(S=>({role:S.role==="assistant"?"assistant":"user",content:S.content})),temperature:y.temperature??.7,stop_sequences:y.stop,stream:y.stream??!1}},f=c.useCallback(async(m,y={})=>{var g,v,b,S,w,A;if(e.provider==="custom"&&e.customHandler)return e.customHandler(m,y);a(!0),s(null),i.current=new AbortController;try{let k,C,M;if(e.provider==="openai")k=e.endpoint||"https://api.openai.com/v1/chat/completions",C={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},M=d(m,{...y,stream:!1});else if(e.provider==="azure-openai")k=e.endpoint||"",C={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},M=d(m,{...y,stream:!1});else if(e.provider==="anthropic")k=e.endpoint||"https://api.anthropic.com/v1/messages",C={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},M=u(m,{...y,stream:!1});else throw new Error(`Unsupported provider: ${e.provider}`);const N=await fetch(k,{method:"POST",headers:C,body:JSON.stringify(M),signal:i.current.signal});if(!N.ok){const R=await N.text();throw new Error(`AI request failed: ${N.status} ${R}`)}const L=await N.json();let E;if(e.provider==="openai"||e.provider==="azure-openai"){const R=(g=L.choices)==null?void 0:g[0];E={content:((v=R==null?void 0:R.message)==null?void 0:v.content)||"",finishReason:(R==null?void 0:R.finish_reason)||"stop",toolCalls:(S=(b=R==null?void 0:R.message)==null?void 0:b.tool_calls)==null?void 0:S.map(T=>({id:T.id,name:T.function.name,arguments:JSON.parse(T.function.arguments)})),usage:L.usage&&{promptTokens:L.usage.prompt_tokens,completionTokens:L.usage.completion_tokens,totalTokens:L.usage.total_tokens}}}else e.provider==="anthropic"?E={content:((A=(w=L.content)==null?void 0:w[0])==null?void 0:A.text)||"",finishReason:L.stop_reason||"stop",usage:L.usage&&{promptTokens:L.usage.input_tokens,completionTokens:L.usage.output_tokens,totalTokens:L.usage.input_tokens+L.usage.output_tokens}}:E={content:"",finishReason:"stop"};return E}catch(k){throw k.name==="AbortError"?new Error("Request cancelled"):(s(k),k)}finally{a(!1)}},[e]),p=c.useCallback(async(m,y,g={})=>{if(e.provider==="custom"&&e.customStreamHandler)return e.customStreamHandler(m,g,y);a(!0),s(null),i.current=new AbortController;try{let v,b,S;if(e.provider==="openai")v=e.endpoint||"https://api.openai.com/v1/chat/completions",b={"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`,...e.organizationId&&{"OpenAI-Organization":e.organizationId},...e.headers},S=d(m,{...g,stream:!0});else if(e.provider==="azure-openai")v=e.endpoint||"",b={"Content-Type":"application/json","api-key":e.apiKey||"",...e.headers},S=d(m,{...g,stream:!0});else if(e.provider==="anthropic")v=e.endpoint||"https://api.anthropic.com/v1/messages",b={"Content-Type":"application/json","x-api-key":e.apiKey||"","anthropic-version":"2023-06-01",...e.headers},S=u(m,{...g,stream:!0});else throw new Error(`Unsupported provider: ${e.provider}`);const w=await fetch(v,{method:"POST",headers:b,body:JSON.stringify(S),signal:i.current.signal});if(!w.ok){const k=await w.text();throw new Error(`AI request failed: ${w.status} ${k}`)}if(!w.body)throw new Error("Response body is null");const A=w.body.getReader();await l(A,y,e.provider)}catch(v){if(v.name==="AbortError"){y({content:"",done:!0});return}throw s(v),v}finally{a(!1)}},[e]),h={isConfigured:!!e.apiKey||e.provider==="custom"||e.provider==="local",provider:e.provider,defaultModel:e.defaultModel||null,complete:f,stream:p,cancel:o,isLoading:r,error:n};return x.jsx(ua.Provider,{value:h,children:t})};function ce(){const e=c.useContext(ua);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function Ll(e={}){const t=ce(),[r,a]=c.useState(""),[n,s]=c.useState([]),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useCallback(async y=>{o(!0),d(null),a("");const g=[...n,{role:"user",content:y}];try{const v=await t.complete(g,{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature});return s([...g,{role:"assistant",content:v.content}]),a(v.content),v.content}catch(v){throw d(v),v}finally{o(!1)}},[t,n,e]),f=c.useCallback(async(y,g)=>{o(!0),d(null),a("");const v=[...n,{role:"user",content:y}];try{let b="";return await t.stream(v,S=>{S.done||(b+=S.content,a(b),g==null||g(S.content))},{systemPrompt:e.systemPrompt,model:e.model,temperature:e.temperature}),s([...v,{role:"assistant",content:b}]),b}catch(b){throw d(b),b}finally{o(!1)}},[t,n,e]),p=c.useCallback(()=>{a(""),d(null)},[]),h=c.useCallback(()=>{s([]),a(""),d(null)},[]),m=c.useCallback(()=>{t.cancel(),o(!1)},[t]);return{response:r,isLoading:i,error:l,send:u,sendStreaming:f,clear:p,cancel:m,history:n,clearHistory:h}}function Tl(e={}){const t=ce(),[r,a]=c.useState(""),[n,s]=c.useState(!1),i=c.useCallback(async(u,f="")=>{s(!0),a("");try{const h=(await t.complete([{role:"user",content:`Complete the following ${e.language||""} code. Return ONLY the completion text, no explanation.
|
|
68
68
|
|
|
69
69
|
Code before cursor:
|
|
70
70
|
\`\`\`
|
|
@@ -80,7 +80,7 @@ Completion:`}],{model:e.model,temperature:.2,maxTokens:200})).content.trim();ret
|
|
|
80
80
|
|
|
81
81
|
\`\`\`
|
|
82
82
|
${u}
|
|
83
|
-
\`\`\``}],{model:e.model,temperature:.3})).content}finally{s(!1)}},[t,e]),l=c.useCallback(async(u,f)=>{s(!0);try{const
|
|
83
|
+
\`\`\``}],{model:e.model,temperature:.3})).content}finally{s(!1)}},[t,e]),l=c.useCallback(async(u,f)=>{s(!0);try{const p=await t.complete([{role:"user",content:`Refactor the following ${e.language||""} code according to the instruction. Return ONLY the refactored code.
|
|
84
84
|
|
|
85
85
|
Code:
|
|
86
86
|
\`\`\`
|
|
@@ -89,25 +89,25 @@ ${u}
|
|
|
89
89
|
|
|
90
90
|
Instruction: ${f}
|
|
91
91
|
|
|
92
|
-
Refactored code:`}],{model:e.model,temperature:.2}),h=
|
|
92
|
+
Refactored code:`}],{model:e.model,temperature:.2}),h=p.content.match(/```[\w]*\n?([\s\S]*?)```/);return h?h[1].trim():p.content.trim()}finally{s(!1)}},[t,e]),d=c.useCallback(async u=>{s(!0);try{const f=await t.complete([{role:"user",content:`Generate ${e.language||""} code from this comment/description. Return ONLY the code.
|
|
93
93
|
|
|
94
94
|
Description: ${u}
|
|
95
95
|
|
|
96
|
-
Code:`}],{model:e.model,temperature:.3}),
|
|
96
|
+
Code:`}],{model:e.model,temperature:.3}),p=f.content.match(/```[\w]*\n?([\s\S]*?)```/);return p?p[1].trim():f.content.trim()}finally{s(!1)}},[t,e]);return{suggestion:r,isLoading:n,complete:i,explain:o,refactor:l,generateFromComment:d}}function Rl(){const e=ce(),[t,r]=c.useState(!1);return{parseFilter:c.useCallback(async(n,s)=>{r(!0);try{const i=await e.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(s)}
|
|
97
97
|
|
|
98
98
|
Query: "${n}"
|
|
99
99
|
|
|
100
100
|
Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
|
|
101
|
-
Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const o=JSON.parse(i.content);return Array.isArray(o)?o:[]}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function
|
|
101
|
+
Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const o=JSON.parse(i.content);return Array.isArray(o)?o:[]}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function Il(){const e=ce(),[t,r]=c.useState(!1),a=c.useCallback(async(s,i)=>{r(!0);try{const o=s.slice(0,5),l=await e.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(o)}
|
|
102
102
|
${i?`Context: ${i}`:""}
|
|
103
103
|
|
|
104
104
|
Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
|
|
105
105
|
Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(l.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{r(!1)}},[e]),n=c.useCallback(async(s,i)=>{r(!0);try{const o=await e.complete([{role:"user",content:`Analyze this ${i} chart data and provide 3-5 key insights. Data: ${JSON.stringify(s.slice(0,20))}
|
|
106
106
|
|
|
107
|
-
Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(o.content)}catch{return[]}}finally{r(!1)}},[e]);return{suggestChartType:a,generateInsights:n,isLoading:t}}function
|
|
107
|
+
Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(o.content)}catch{return[]}}finally{r(!1)}},[e]);return{suggestChartType:a,generateInsights:n,isLoading:t}}function zl(){const e=ce(),[t,r]=c.useState(!1);return{generateForm:c.useCallback(async n=>{r(!0);try{const s=await e.complete([{role:"user",content:`Generate a form definition from this description: "${n}"
|
|
108
108
|
|
|
109
109
|
Return a JSON array of field objects with: label, field (camelCase), type (text, number, email, date, select, checkbox, textarea), required (boolean), options (for select type).
|
|
110
|
-
Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(s.content)}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function
|
|
110
|
+
Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(s.content)}catch{return[]}}finally{r(!1)}},[e]),isLoading:t}}function Dl(){const e=ce(),[t,r]=c.useState(!1),a=c.useCallback(async(i,o)=>{r(!0);try{return(await e.complete([{role:"user",content:`Improve this text to be more ${o||"professional"}. Keep the same meaning. Return only the improved text.
|
|
111
111
|
|
|
112
112
|
Text: ${i}
|
|
113
113
|
|
|
@@ -119,7 +119,7 @@ Translation:`}],{temperature:.2})).content.trim()}finally{r(!1)}},[e]),s=c.useCa
|
|
|
119
119
|
|
|
120
120
|
Prompt: ${i}
|
|
121
121
|
|
|
122
|
-
HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return l?l[1].trim():o.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:s,isLoading:t}}class Ue{constructor(){this._listeners=new Map}on(t,r){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(r),()=>{var a;(a=this._listeners.get(t))==null||a.delete(r)}}emit(t,...r){var a;(a=this._listeners.get(t))==null||a.forEach(n=>{try{n(...r)}catch{}})}}function Dl(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"notcontains":return!String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"startswith":return String(r??"").toLowerCase().startsWith(String(a??"").toLowerCase());case"endswith":return String(r??"").toLowerCase().endsWith(String(a??"").toLowerCase());case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";default:return!0}}function fa(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Dl(e,a):fa(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Pl(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(s=>fa(s,t.filter))),t.search){const s=t.search.toLowerCase(),i=t.searchFields;r=r.filter(o=>(i?i.map(d=>o[d]):Object.values(o)).some(d=>String(d??"").toLowerCase().includes(s)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((s,i)=>{for(const o of t.sort){const l=s[o.field]??"",d=i[o.field]??"",u=typeof l=="number"&&typeof d=="number"?l-d:String(l).localeCompare(String(d));if(u!==0)return o.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const s=t.skip??0,i=t.take??r.length;r=r.slice(s,s+i)}return{data:r,totalCount:a}}function Fl(e){const t=e.keyField??"id";let r=[...e.data];const a=new Ue;return{keyField:t,writable:!0,async load(s={}){a.emit("loading",!0);try{const i=Pl(r,s);return a.emit("loaded",i),a.emit("loading",!1),i}catch(i){throw a.emit("error",i instanceof Error?i:new Error(String(i))),a.emit("loading",!1),i}},async byKey(s){return r.find(i=>i[t]===s)},async insert(s){const i={...s};return r=[...r,i],a.emit("changed"),i},async update(s,i){const o=r.findIndex(d=>d[t]===s);if(o===-1)throw new Error(`Record not found: ${s}`);const l={...r[o],...i};return r=r.map((d,u)=>u===o?l:d),a.emit("changed"),l},async remove(s){r=r.filter(i=>i[t]!==s),a.emit("changed")},on:a.on.bind(a)}}async function Hl(e){const t={"Content-Type":"application/json"};if(!e.headers)return t;const r=typeof e.headers=="function"?await e.headers():e.headers;return{...t,...r}}function Qe(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function $l(e){var r,a,n;const t={};return e.skip!=null&&(t.skip=String(e.skip)),e.take!=null&&(t.take=String(e.take)),e.search&&(t.search=e.search),(r=e.sort)!=null&&r.length&&(t.sort=e.sort.map(s=>`${s.field} ${s.direction}`).join(",")),e.filter&&(t.filter=JSON.stringify(e.filter)),(a=e.select)!=null&&a.length&&(t.select=e.select.join(",")),(n=e.expand)!=null&&n.length&&(t.expand=e.expand.join(",")),t}function Bl(e){if(Array.isArray(e))return{data:e,totalCount:e.length};const t=e,r=t.data??t.items??t.value??t.results??[],a=t.totalCount??t.total??t.count??t["@odata.count"]??r.length;return{data:r,totalCount:a}}function ma(e){const t=e.keyField??"id",r=new Ue;async function a(s,i){const o=await Hl(e),l=await fetch(s,{...e.fetchOptions,...i,headers:{...o,...i==null?void 0:i.headers}});if(!l.ok){const u=await l.text().catch(()=>l.statusText);throw new Error(`HTTP ${l.status}: ${u}`)}return(l.headers.get("content-type")??"").includes("json")?l.json():l.text()}return{keyField:t,writable:!0,async load(s={}){var i;r.emit("loading",!0);try{const o=e.loadUrl??e.url,l=e.mapLoadParams?e.mapLoadParams(s):$l(s),d=new URLSearchParams(l).toString(),u=d?`${o}?${d}`:o,f=await a(u),g=e.extractLoadResult?e.extractLoadResult(f):Bl(f);return r.emit("loaded",g),r.emit("loading",!1),g}catch(o){const l=o instanceof Error?o:new Error(String(o));throw r.emit("error",l),r.emit("loading",!1),(i=e.onError)==null||i.call(e,l,"load"),l}},async byKey(s){const i=Qe(e.byKeyUrl,e.url,s),o=await a(i);return e.extractItem?e.extractItem(o):o},async insert(s){const i=e.insertUrl??e.url,o=e.prepareInsertBody?e.prepareInsertBody(s):s,l=await a(i,{method:"POST",body:JSON.stringify(o)}),d=e.extractItem?e.extractItem(l):l;return r.emit("changed"),d},async update(s,i){const o=Qe(e.updateUrl,e.url,s),l=e.prepareUpdateBody?e.prepareUpdateBody(s,i):i,d=await a(o,{method:e.updateMethod??"PUT",body:JSON.stringify(l)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(s){const i=Qe(e.deleteUrl,e.url,s);await a(i,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function jl(e,t){const r=e.field,a=typeof e.value=="string"?`'${e.value.replace(/'/g,"''")}'`:String(e.value??"null");switch(e.operator){case"=":return`${r} eq ${a}`;case"<>":return`${r} ne ${a}`;case"<":return`${r} lt ${a}`;case"<=":return`${r} le ${a}`;case">":return`${r} gt ${a}`;case">=":return`${r} ge ${a}`;case"contains":return t>=4?`contains(${r},${a})`:`substringof(${a},${r})`;case"notcontains":return t>=4?`not contains(${r},${a})`:`not substringof(${a},${r})`;case"startswith":return`startswith(${r},${a})`;case"endswith":return`endswith(${r},${a})`;case"isblank":return`${r} eq null`;case"isnotblank":return`${r} ne null`;default:return"true"}}function pa(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?jl(a,t):`(${pa(a,t)})`).join(e.logic==="and"?" and ":" or ")}function Ol(e){const t=e.version??4,r={url:e.url,keyField:e.keyField,headers:e.headers,fetchOptions:e.fetchOptions,onError:e.onError,updateMethod:"PATCH",mapLoadParams(a){var s,i,o;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(s=a.sort)!=null&&s.length&&(n.$orderby=a.sort.map(l=>`${l.field} ${l.direction}`).join(",")),a.filter){const l=pa(a.filter,t);l&&(n.$filter=l)}return a.search&&(n.$search=`"${a.search}"`),(i=a.select)!=null&&i.length&&(n.$select=a.select.join(",")),(o=a.expand)!=null&&o.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var o,l;const n=a,s=n.value??((o=n.d)==null?void 0:o.results)??[],i=n["@odata.count"]??((l=n.d)==null?void 0:l.__count)??s.length;return{data:s,totalCount:i}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return ma(r)}function _l(e){const t=e.keyField??"id",r=new Ue;async function a(l,d){var m;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},g=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:l,variables:d})});if(!g.ok){const y=await g.text().catch(()=>g.statusText);throw new Error(`GraphQL HTTP ${g.status}: ${y}`)}const h=await g.json();if((m=h.errors)!=null&&m.length)throw new Error(h.errors.map(y=>y.message).join("; "));return h.data}function n(l){var u;const d={};return l.skip!=null&&(d.skip=l.skip),l.take!=null&&(d.take=l.take),l.search&&(d.search=l.search),(u=l.sort)!=null&&u.length&&(d.sort=l.sort),l.filter&&(d.filter=l.filter),d}function s(l){if(!l||typeof l!="object")return{data:[],totalCount:0};const d=Object.values(l)[0];if(!d)return{data:[],totalCount:0};if(Array.isArray(d))return{data:d,totalCount:d.length};const u=d.items??d.nodes??d.edges??d.data??[],f=d.totalCount??d.total??d.count??u.length;return{data:u,totalCount:f}}function i(l){return!l||typeof l!="object"?l:Object.values(l)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(l={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(l):n(l),f=await a(e.queries.load,u),g=e.extractLoadResult?e.extractLoadResult(f):s(f);return r.emit("loaded",g),r.emit("loading",!1),g}catch(u){const f=u instanceof Error?u:new Error(String(u));throw r.emit("error",f),r.emit("loading",!1),(d=e.onError)==null||d.call(e,f,"load"),f}},async byKey(l){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:l});return e.extractItem?e.extractItem(d):i(d)},insert:e.queries.insert?async l=>{const d=await a(e.queries.insert,{input:l}),u=e.extractItem?e.extractItem(d):i(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(l,d)=>{const u=await a(e.queries.update,{[t]:l,input:d}),f=e.extractItem?e.extractItem(u):i(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async l=>{await a(e.queries.remove,{[t]:l}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Wl(e){const t=e.keyField??"id",r=new Ue;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const s=await e.load(n);return r.emit("loaded",s),r.emit("loading",!1),s}catch(s){const i=s instanceof Error?s:new Error(String(s));throw r.emit("error",i),r.emit("loading",!1),i}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const s=await e.insert(n);return r.emit("changed"),s}:void 0,update:e.update?async(n,s)=>{const i=await e.update(n,s);return r.emit("changed"),i}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function ga(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Vl(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??ga,s=l=>(r.push(l),a(r.length-1)),i=l=>{const d=n(l.field);switch(l.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${l.operator} ${s(l.value)}`;case"contains":return`${d} LIKE ${s(`%${String(l.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${s(`%${String(l.value)}%`)}`;case"startswith":return`${d} LIKE ${s(`${String(l.value)}%`)}`;case"endswith":return`${d} LIKE ${s(`%${String(l.value)}`)}`;case"between":{const u=Array.isArray(l.value)?l.value:[l.value,l.value];return`${d} BETWEEN ${s(u[0])} AND ${s(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${s("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${s("")})`;case"in":{const u=Array.isArray(l.value)?l.value:[l.value];return u.length?`${d} IN (${u.map(s).join(", ")})`:"1 = 0"}default:return`${d} = ${s(l.value)}`}},o=l=>{const d=[];for(const u of l.items)if(u.type==="group"){const f=o(u);f&&d.push(`(${f})`)}else d.push(i(u));return d.join(l.logic==="or"?" OR ":" AND ")};return{sql:o(e),params:r}}function Xl(e,t={}){const r=t.quoteField??ga;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ee(e){return String(e??"").toLowerCase()}function ya(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return ee(r).includes(ee(a));case"notcontains":return!ee(r).includes(ee(a));case"startswith":return ee(r).startsWith(ee(a));case"endswith":return ee(r).endsWith(ee(a));case"between":{const n=Array.isArray(a)?a:[a,a];return r>=n[0]&&r<=n[1]}case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";case"in":return(Array.isArray(a)?a:[a]).some(s=>r==s);default:return!0}}function Lt(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?ya(e,a):Lt(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Kt(e){return e==null||e===""}const Ul=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ql(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function W(e){return typeof e=="number"?e:parseFloat(String(e))}function ha(e){const t=e.field;switch(e.op){case"required":return`${t} is required`;case"minLength":return`${t} must be at least ${e.value} characters`;case"maxLength":return`${t} must be at most ${e.value} characters`;case"min":return`${t} must be ≥ ${e.value}`;case"max":return`${t} must be ≤ ${e.value}`;case"pattern":return`${t} has an invalid format`;case"email":return`${t} must be a valid email`;case"url":return`${t} must be a valid URL`;case"equals":return`${t} must equal ${e.value}`;case"notEquals":return`${t} must not equal ${e.value}`;case"greaterThan":return`${t} must be greater than ${e.value}`;case"lessThan":return`${t} must be less than ${e.value}`;case"matchesField":return`${t} must match ${e.compareField}`;case"greaterThanField":return`${t} must be greater than ${e.compareField}`;case"lessThanField":return`${t} must be less than ${e.compareField}`;default:return`${t} is invalid`}}function ba(e,t){const r=t[e.field];if(e.op==="required")return!Kt(r);if(Kt(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=W(e.value);case"maxLength":return String(r).length<=W(e.value);case"min":return W(r)>=W(e.value);case"max":return W(r)<=W(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return Ul.test(String(r));case"url":return ql(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return W(r)>W(e.value);case"lessThan":return W(r)<W(e.value);case"matchesField":return r===a;case"greaterThanField":return W(r)>W(a);case"lessThanField":return W(r)<W(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function va(e,t){const r=[];for(const a of e??[])a.when&&!Lt(t,a.when)||ba(a,t)||r.push({field:a.field,message:a.message??ha(a),severity:a.severity??"error",ruleId:a.id});return r}function Gl(e,t){return va(e,t).every(r=>r.severity!=="error")}class nt{constructor(t={}){this.cache=new Map,this.ttl=t.ttl??6e4,this.maxSize=t.maxSize??100}get(t){const r=this.cache.get(t);if(r){if(Date.now()>r.expiresAt){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,r),r.data}}set(t,r,a){if(this.cache.size>=this.maxSize){const n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(t,{data:r,timestamp:Date.now(),expiresAt:Date.now()+(a??this.ttl)})}has(t){return this.get(t)!==void 0}invalidate(t){this.cache.delete(t)}invalidateAll(){this.cache.clear()}invalidateMatching(t){for(const r of this.cache.keys())t.test(r)&&this.cache.delete(r)}}class Sa{constructor(){this.pending=new Map}async dedupe(t,r){const a=this.pending.get(t);if(a)return a;const n=r().finally(()=>{this.pending.delete(t)});return this.pending.set(t,n),n}hasPending(t){return this.pending.has(t)}cancelAll(){this.pending.clear()}}function Kl(e,t={}){const r=new nt(t),a=new nt(t),n=new Sa,s=t.generateKey??(l=>JSON.stringify(l)),i=t.cacheLoads!==!1,o=t.cacheByKey!==!1;return{...e,cache:r,async load(l={}){const d=`load:${s(l)}`;if(i){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(l);return i&&r.set(d,u),u})},async byKey(l){const d=`byKey:${String(l)}`;if(o){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(l);return o&&u&&a.set(d,u),u})},async insert(l){const d=await e.insert(l);return r.invalidateAll(),d},async update(l,d){const u=await e.update(l,d);return r.invalidateAll(),a.invalidate(`byKey:${String(l)}`),u},async remove(l){await e.remove(l),r.invalidateAll(),a.invalidate(`byKey:${String(l)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function Jl(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(s={}){var p;const i=s.pageSize??a,o=s.direction??"forward",l=s.cursor?{type:"condition",field:r,operator:o==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Yl(s.cursor)}:null,d=l?{type:"group",logic:"and",items:[...((p=s.filter)==null?void 0:p.items)??[],l]}:s.filter,u=[{field:r,direction:o==="forward"?n:n==="asc"?"desc":"asc"},...s.sort??[]],f=await e.load({...s,filter:d,sort:u,take:i+1}),g=f.data.length>i,h=g?f.data.slice(0,i):f.data;o==="backward"&&h.reverse();const m=h[h.length-1],y=h[0];return{data:h,nextCursor:g&&m?Ze(m[r]):null,prevCursor:y&&s.cursor?Ze(y[r]):null,hasMore:g}},async*loadAll(s={}){let i=null;do{const o=await e.load({...s,...i?{cursor:i}:{}});if(o.data.length===0)break;yield o.data;const l=o.data[o.data.length-1];i=l?Ze(l[r]):null}while(i)}}}function Ze(e){return btoa(JSON.stringify(e))}function Yl(e){try{return JSON.parse(atob(e))}catch{return e}}function Ql(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let s={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const i=new Set;function o(){i.forEach(h=>h(s))}function l(h){s={...s,...h},o()}let d={};async function u(){if(!(s.isLoading||!s.hasMore)){l({isLoading:!0,error:null});try{const h=await e.load({...d,skip:s.page*r,take:r}),m=[...s.items,...h.data],y=m.length<h.totalCount;l({items:m,page:s.page+1,totalCount:h.totalCount,hasMore:y,isLoading:!1})}catch(h){l({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,s={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},o()}function g(h){const m=h.target;if(!m)return;m.scrollHeight-m.scrollTop-m.clientHeight<a&&u()}return{get state(){return s},loadMore:u,reset:f,handleScroll:g,subscribe(h){return i.add(h),()=>i.delete(h)},setOptions(h){d=h}}}function Zl(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,heartbeatInterval:i=3e4}=e;let o=null,l=0,d=null,u=[];const f=new Map;function g(k,...C){var M;(M=f.get(k))==null||M.forEach(N=>N(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function m(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function y(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],g("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),g("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),g("changed"));break;case"refresh":case"sync":A.load().catch(()=>{});break}}function p(){(o==null?void 0:o.readyState)!==WebSocket.OPEN&&(o=new WebSocket(t),o.onopen=()=>{l=0,g("connected"),b()},o.onmessage=k=>{const C=h(k);C&&(y(C),g("message",C))},o.onerror=k=>{g("error",new Error("WebSocket error"))},o.onclose=()=>{S(),g("disconnected"),l<s&&(l++,setTimeout(p,n*Math.min(l,5)))})}function v(){S(),o&&(o.close(),o=null)}function b(){S(),d=window.setInterval(()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({type:"ping"}))},i)}function S(){d&&(clearInterval(d),d=null)}function w(k){(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(m(k))}const A={keyField:a,writable:r.writable,async load(k={}){g("loading",!0);try{const C=await r.load(k);return u=C.data,g("loaded",C),g("loading",!1),C}catch(C){throw g("error",C),g("loading",!1),C}},async byKey(k){const C=u.find(M=>M[a]===k);return C||r.byKey(k)},async insert(k){const C=await r.insert(k);return w({type:"insert",data:C}),C},async update(k,C){const M=await r.update(k,C);return w({type:"update",key:k,changes:C}),M},async remove(k){await r.remove(k),w({type:"remove",key:k})},on(k,C){return f.has(k)||f.set(k,new Set),f.get(k).add(C),()=>{var M;return(M=f.get(k))==null?void 0:M.delete(C)}},connect:p,disconnect:v,isConnected:()=>(o==null?void 0:o.readyState)===WebSocket.OPEN,sendMessage:w};return A}function ed(e){const{connection:t,baseSource:r}=e,a={onInsert:"OnInsert",onUpdate:"OnUpdate",onRemove:"OnRemove",onRefresh:"OnRefresh",insert:"Insert",update:"Update",remove:"Remove",...e.methods},n=r.keyField;let s=[];const i=new Map;function o(f,...g){var h;(h=i.get(f))==null||h.forEach(m=>m(...g))}const l=f=>{s=[...s,f],o("changed")},d=(f,g)=>{s=s.map(h=>h[n]===f?{...h,...g}:h),o("changed")},u=f=>{s=s.filter(g=>g[n]!==f),o("changed")};return{keyField:n,writable:r.writable,async load(f={}){o("loading",!0);try{const g=await r.load(f);return s=g.data,o("loaded",g),o("loading",!1),g}catch(g){throw o("error",g),o("loading",!1),g}},async byKey(f){const g=s.find(h=>h[n]===f);return g||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,g){return await t.invoke(a.update,f,g)},async remove(f){await t.invoke(a.remove,f)},on(f,g){return i.has(f)||i.set(f,new Set),i.get(f).add(g),()=>{var h;return(h=i.get(f))==null?void 0:h.delete(g)}},async connect(){t.on(a.onInsert,l),t.on(a.onUpdate,d),t.on(a.onRemove,u),t.on(a.onRefresh,()=>this.load()),await t.start()},async disconnect(){t.off(a.onInsert,l),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function td(e,t={}){const r=e.keyField;let a=[];const n=new Map;let s=0;const i=new Map;function o(d,...u){var f;(f=i.get(d))==null||f.forEach(g=>g(...u))}function l(){return`op_${++s}_${Date.now()}`}return{keyField:r,writable:!0,async load(d={}){const u=await e.load(d);return a=u.data,u},async byKey(d){return a.find(u=>u[r]===d)??e.byKey(d)},async insert(d){var g,h,m;const u=l(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(g=t.onOptimisticApply)==null||g.call(t,f,"insert"),o("changed");try{const y=await e.insert(d);return a=a.map(p=>p===f?y:p),n.delete(u),(h=t.onConfirm)==null||h.call(t,y,"insert"),o("changed"),y}catch(y){throw a=a.filter(p=>p!==f),n.delete(u),(m=t.onRollback)==null||m.call(t,f,"insert",y instanceof Error?y:new Error(String(y))),o("changed"),y}},async update(d,u){var y,p,v;const f=l(),g=a.findIndex(b=>b[r]===d);if(g===-1)return e.update(d,u);const h=a[g],m={...h,...u};a=a.map((b,S)=>S===g?m:b),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(y=t.onOptimisticApply)==null||y.call(t,m,"update"),o("changed");try{const b=await e.update(d,u);return a=a.map((S,w)=>w===g?b:S),n.delete(f),(p=t.onConfirm)==null||p.call(t,b,"update"),o("changed"),b}catch(b){throw a=a.map((S,w)=>w===g?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",b instanceof Error?b:new Error(String(b))),o("changed"),b}},async remove(d){var g,h,m;const u=l(),f=a.find(y=>y[r]===d);if(!f)return e.remove(d);a=a.filter(y=>y!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(g=t.onOptimisticApply)==null||g.call(t,f,"remove"),o("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(y){throw a=[...a,f],n.delete(u),(m=t.onRollback)==null||m.call(t,f,"remove",y instanceof Error?y:new Error(String(y))),o("changed"),y}},on(d,u){return i.has(d)||i.set(d,new Set),i.get(d).add(u),()=>{var f;return(f=i.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function xa(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),s=[],i=[],o=[],l=[];for(const[d,u]of n){const f=a.get(d);if(!f)s.push(u);else if(wa(f,u))l.push(u);else{const g={};for(const h of Object.keys(u))f[h]!==u[h]&&(g[h]=u[h]);i.push({key:d,changes:g,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||o.push(u);return{inserted:s,updated:i,removed:o,unchanged:l}}function wa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e===null||t===null||typeof e!="object")return e===t;const r=e,a=t,n=new Set([...Object.keys(r),...Object.keys(a)]);for(const s of n)if(!wa(r[s],a[s]))return!1;return!0}function rd(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:s}=t;let i=r,o=null,l=[],d={};const u=new Map;function f(p,...v){var b;(b=u.get(p))==null||b.forEach(S=>S(...v))}async function g(){if(!(n&&document.hidden))try{const p=await e.load(d),v=xa(l,p.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(l=p.data,f("changed"),s==null||s(v))}catch{}}function h(){o||(o=window.setInterval(g,i))}function m(){o&&(clearInterval(o),o=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||o&&g()});const y={...e,async load(p={}){d=p;const v=await e.load(p);return l=v.data,v},on(p,v){u.has(p)||u.set(p,new Set),u.get(p).add(v);const b=e.on(p,v);return()=>{var S;(S=u.get(p))==null||S.delete(v),b()}},startPolling:h,stopPolling:m,isPolling:()=>o!==null,setInterval(p){i=p,o&&(m(),h())}};return a&&h(),y}function ad(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,withCredentials:i=!1}=e;let o=null,l=0,d=null,u=[];const f=new Map;function g(b,...S){var w;(w=f.get(b))==null||w.forEach(A=>A(...S))}function h(b){if(e.parseEvent)return e.parseEvent(b);try{return JSON.parse(b.data)}catch{return null}}function m(b){switch(b.type){case"insert":b.data&&(u=[...u,b.data],g("changed"));break;case"update":b.key&&b.changes&&(u=u.map(S=>S[a]===b.key?{...S,...b.changes}:S),g("changed"));break;case"remove":b.key&&(u=u.filter(S=>S[a]!==b.key),g("changed"));break;case"snapshot":Array.isArray(b.data)&&(u=b.data,g("changed"));break;case"refresh":v.load().catch(()=>{});break}}function y(){(o==null?void 0:o.readyState)!==EventSource.OPEN&&(p(),o=new EventSource(t,{withCredentials:i}),o.onopen=()=>{l=0,g("connected")},o.onmessage=b=>{const S=h(b);S&&(m(S),g("message",S))},o.onerror=()=>{if(g("error",new Error("SSE connection error")),(o==null?void 0:o.readyState)===EventSource.CLOSED&&(g("disconnected"),o=null,l<s)){l++;const b=n*Math.min(l,5);d=setTimeout(y,b)}})}function p(){d&&(clearTimeout(d),d=null),o&&(o.close(),o=null)}const v={keyField:a,writable:r.writable,async load(b={}){g("loading",!0);try{const S=await r.load(b);return u=S.data,g("loaded",S),g("loading",!1),S}catch(S){throw g("error",S),g("loading",!1),S}},async byKey(b){const S=u.find(w=>w[a]===b);return S||r.byKey(b)},async insert(b){return r.insert(b)},async update(b,S){return r.update(b,S)},async remove(b){return r.remove(b)},on(b,S){return f.has(b)||f.set(b,new Set),f.get(b).add(S),()=>{var w;return(w=f.get(b))==null?void 0:w.delete(S)}},connect:y,disconnect:p,isConnected:()=>(o==null?void 0:o.readyState)===EventSource.OPEN};return v}function re(e,t){const r={};for(const a of t){const n=e.map(i=>i[a.field]).filter(i=>i!=null),s=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[s]=n.reduce((i,o)=>Number(i)+Number(o),0);break;case"avg":r[s]=n.length?n.reduce((i,o)=>Number(i)+Number(o),0)/n.length:0;break;case"min":r[s]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[s]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[s]=n.length;break;case"first":r[s]=n[0]??null;break;case"last":r[s]=n[n.length-1]??null;break;case"distinct":r[s]=[...new Set(n)];break}}return r}function Tt(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:s}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:re(e,a),items:n?e:void 0}];const i=new Map;for(const l of e){const d={};for(const f of r)d[f]=l[f];const u=JSON.stringify(d);i.has(u)||i.set(u,{key:d,items:[]}),i.get(u).items.push(l)}const o=[];for(const[,l]of i)o.push({key:l.key,count:l.items.length,aggregates:re(l.items,a),items:n?l.items:void 0});return s!=null&&s.length&&o.sort((l,d)=>{for(const u of s){const f=l.key[u.field]??l.aggregates[u.field],g=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof g=="number"?f-g:String(f??"").localeCompare(String(g??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),o}function ka(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:re(e,r),items:e}];const[a,...n]=t,s=Tt(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const i of s)i.groups=ka(i.items,n,r),delete i.items;return s}function nd(e,t){const{rows:r,columns:a,values:n,aggregateFunction:s="sum",rowTotals:i=!0,columnTotals:o=!0,grandTotal:l=!0}=t,d=[...new Set(e.map(m=>String(m[a])))].sort(),u=Tt(e,{groupBy:r,includeItems:!0}),f=[];for(const m of u){const y={rowKey:m.key,values:{}};for(const p of d){const v=m.items.filter(S=>String(S[a])===p),b=re(v,[{field:n,fn:s}]);y.values[p]=b[`${s}_${n}`]??null}if(i){const p=re(m.items,[{field:n,fn:s}]);y.rowTotal=p[`${s}_${n}`]}f.push(y)}let g;if(o){g={};for(const m of d){const y=e.filter(v=>String(v[a])===m),p=re(y,[{field:n,fn:s}]);g[m]=p[`${s}_${n}`]}}let h;return l&&(h=re(e,[{field:n,fn:s}])[`${s}_${n}`]),{columnHeaders:d,rows:f,columnTotals:g,grandTotal:h}}function sd(e,t){return e.map((r,a)=>{const n={...r};for(const s of t)n[s.name]=s.formula(r,a,e);return n})}const od={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,s)=>n+Number(s[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((s,i)=>s+Number(i[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((s,i)=>s+Number(i[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((i,o)=>{const l=Number(i[e]??0)-Number(o[e]??0);return t==="desc"?-l:l}).findIndex(i=>i===r)+1,diffFromPrevious:e=>(t,r,a)=>r===0?null:Number(t[e]??0)-Number(a[r-1][e]??0),percentChange:e=>(t,r,a)=>{if(r===0)return null;const n=Number(a[r-1][e]??0);return n===0?null:(Number(t[e]??0)-n)/n*100},movingAverage:(e,t)=>(r,a,n)=>{const s=Math.max(0,a-t+1),i=n.slice(s,a+1);return i.reduce((o,l)=>o+Number(l[e]??0),0)/i.length},conditional:(e,t,r)=>a=>e(a)?t:r,concat:(...e)=>t=>e.map(r=>t[r]??"").join(" "),formatDate:(e,t="medium")=>r=>{const a=r[e];return a?new Date(a).toLocaleDateString(void 0,{dateStyle:t}):""}};function id(e,t){const r=[],a=new Map,n=new Map;for(let o=0;o<e.length;o++){const l=e[o];for(const d of t)if(!d.validate(l,o,e)){const u=typeof d.message=="function"?d.message(l):d.message,f={index:o,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:l};r.push(f),a.has(o)||a.set(o,[]),a.get(o).push(f);for(const g of f.fields)n.has(g)||n.set(g,[]),n.get(g).push(f)}}const s=r.filter(o=>o.severity==="error").length,i=r.filter(o=>o.severity==="warning").length;return{isValid:s===0,errorCount:s,warningCount:i,errors:r,byIndex:a,byField:n}}const cd={required:e=>({name:`required_${String(e)}`,validate:t=>t[e]!=null&&t[e]!=="",message:`${String(e)} is required`,fields:[String(e)]}),minLength:(e,t)=>({name:`minLength_${String(e)}`,validate:r=>String(r[e]??"").length>=t,message:`${String(e)} must be at least ${t} characters`,fields:[String(e)]}),maxLength:(e,t)=>({name:`maxLength_${String(e)}`,validate:r=>String(r[e]??"").length<=t,message:`${String(e)} must be at most ${t} characters`,fields:[String(e)]}),min:(e,t)=>({name:`min_${String(e)}`,validate:r=>Number(r[e])>=t,message:`${String(e)} must be at least ${t}`,fields:[String(e)]}),max:(e,t)=>({name:`max_${String(e)}`,validate:r=>Number(r[e])<=t,message:`${String(e)} must be at most ${t}`,fields:[String(e)]}),email:e=>({name:`email_${String(e)}`,validate:t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t[e]??"")),message:`${String(e)} must be a valid email`,fields:[String(e)]}),pattern:(e,t,r)=>({name:`pattern_${String(e)}`,validate:a=>t.test(String(a[e]??"")),message:r??`${String(e)} has invalid format`,fields:[String(e)]}),unique:e=>({name:`unique_${String(e)}`,validate:(t,r,a)=>{const n=t[e];return a.findIndex(s=>s[e]===n)===r},message:`${String(e)} must be unique`,fields:[String(e)]}),custom:(e,t,r,a)=>({name:e,validate:t,message:r,fields:a})},ld={async updateWhere(e,t,r){return e.map(a=>{if(!t(a))return a;const n=typeof r=="function"?r(a):r;return{...a,...n}})},async removeWhere(e,t){const r=[],a=[];for(const n of e)t(n)?a.push(n):r.push(n);return{remaining:r,removed:a}},async transform(e,t,r={}){const{parallel:a=!1,batchSize:n=10}=r,s=[],i=[];let o=0;if(a)for(let l=0;l<e.length;l+=n){const d=e.slice(l,l+n),u=await Promise.allSettled(d.map((f,g)=>t(f,l+g)));for(let f=0;f<u.length;f++){const g=u[f];g.status==="fulfilled"?(s.push(g.value),o++):i.push({index:l+f,item:d[f],error:g.reason})}}else for(let l=0;l<e.length;l++)try{const d=await t(e[l],l);s.push(d),o++}catch(d){i.push({index:l,item:e[l],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:o,failed:i.length,errors:i,results:s}},deduplicate(e,t){const r=new Set;return e.filter(a=>{const n=a[t];return r.has(n)?!1:(r.add(n),!0)})},merge(e,t,r,a={}){const{updateExisting:n=!0,addNew:s=!0}=a,i=new Map(e.map(l=>[l[r],l])),o=[...e];for(const l of t){const d=l[r],u=i.get(d);if(u){if(n){const f=o.indexOf(u);o[f]={...u,...l}}}else s&&o.push(l)}return o}};function dd(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,s]=c.useState([]),[i,o]=c.useState(0),[l,d]=c.useState(!1),[u,f]=c.useState(null),[g,h]=c.useState(1),[m,y]=c.useState(a),[p,v]=c.useState((t==null?void 0:t.defaultSort)??[]),[b,S]=c.useState(t==null?void 0:t.defaultFilter),[w,A]=c.useState((t==null?void 0:t.defaultSearch)??""),k=c.useRef(0),C=t==null?void 0:t.loadOptions,M=c.useCallback(async()=>{if(!e)return;const z=++k.current;d(!0),f(null);try{const H=await e.load({skip:(g-1)*m,take:m,sort:p.length?p:void 0,filter:b,search:w||void 0,...C});if(z!==k.current)return;s(H.data),o(H.totalCount)}catch(H){if(z!==k.current)return;f(H instanceof Error?H.message:String(H))}finally{z===k.current&&d(!1)}},[e,g,m,p,b,w,C]);c.useEffect(()=>{r&&M()},[M,r]),c.useEffect(()=>{if(e)return e.on("changed",()=>{M()})},[e,M]);const N=c.useCallback((z,H)=>{v([{field:z,direction:H}]),h(1)},[]),L=c.useCallback(z=>{S(z),h(1)},[]),E=c.useCallback(z=>{A(z),h(1)},[]),R=c.useCallback(z=>{y(z),h(1)},[]),T=c.useCallback(async z=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(z)},[e]),D=c.useCallback(async(z,H)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(z,H)},[e]),F=c.useCallback(async z=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(z)},[e]);return{data:n,totalCount:i,loading:l,error:u,page:g,pageSize:m,sort:p,filter:b,search:w,setPage:h,setPageSize:R,setSort:v,setSortField:N,setFilter:L,setSearch:E,reload:M,insert:T,update:D,remove:F}}function Ma(e,t){const[r,a]=c.useState(void 0),[n,s]=c.useState({}),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(0),f=c.useCallback(async()=>{if(!e||t==null){a(void 0);return}const b=++u.current;o(!0),d(null);try{const S=await e.byKey(t);if(b!==u.current)return;a(S),s({})}catch(S){if(b!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{b===u.current&&o(!1)}},[e,t]);c.useEffect(()=>{f()},[f]),c.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const g=c.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,m=c.useCallback((b,S)=>{s(w=>({...w,[b]:S}))},[]),y=c.useCallback(b=>{s(S=>({...S,...b}))},[]),p=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");h&&await e.update(t,n)},[e,t,n,h]),v=c.useCallback(()=>{s({})},[]);return{data:r,editData:g,loading:i,error:l,changes:n,isDirty:h,set:m,setMany:y,save:p,reload:f,reset:v}}function ud(e,t,r){const a=Ma(e,t),n=a.editData[r],s=c.useCallback(o=>{a.set(r,o)},[a,r]),i=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const o={[r]:a.editData[r]};await e.update(t,o)},[e,t,r,a.editData]);return{value:n,setValue:s,loading:a.loading,error:a.error,isDirty:r in a.changes,save:i}}function fd(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,s=(a==null?void 0:a.take)??200,[i,o]=c.useState([]),[l,d]=c.useState(!1),[u,f]=c.useState(null),g=c.useRef(0),h=c.useCallback(async p=>{if(!e)return;const v=++g.current;d(!0),f(null);try{const b=await e.load({take:s,search:p||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==g.current)return;o(b.data)}catch(b){if(v!==g.current)return;f(b instanceof Error?b.message:String(b))}finally{v===g.current&&d(!1)}},[e,s,a==null?void 0:a.searchFields]);c.useEffect(()=>{n&&h()},[h,n]);const m=c.useMemo(()=>i.map(p=>{const v=p,b={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(b.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(b.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(b.group=String(v[a.groupField])),b}),[i,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),y=c.useCallback(p=>{h(p)},[h]);return{options:m,loading:l,error:u,search:y,reload:()=>h()}}function st(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:s=[]}=e;let i=null;const o=new Map;function l(m,...y){var p;(p=o.get(m))==null||p.forEach(v=>v(...y))}async function d(){return i||new Promise((m,y)=>{const p=indexedDB.open(t,n);p.onerror=()=>y(p.error),p.onsuccess=()=>{i=p.result,m(i)},p.onupgradeneeded=v=>{const b=v.target.result;if(!b.objectStoreNames.contains(r)){const S=b.createObjectStore(r,{keyPath:a});for(const w of s)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(m,y){const p=await d();return new Promise((v,b)=>{const w=p.transaction(r,m).objectStore(r),A=y(w);A.onsuccess=()=>v(A.result),A.onerror=()=>b(A.error)})}async function f(m,y,p){const v=await d();return new Promise((b,S)=>{var D;const A=v.transaction(r,m).objectStore(r),k=[];let C=A,M="next";if((D=y.sort)!=null&&D.length){const F=y.sort[0].field,z=y.sort[0].direction;A.indexNames.contains(F)&&(C=A.index(F)),M=z==="desc"?"prev":"next"}const N=C.openCursor(null,M);let L=0,E=0;const R=y.skip??0,T=y.take??1/0;N.onsuccess=()=>{const F=N.result;if(!F||E>=T){b(k);return}const z=F.value;if(y.filter&&!g(z,y.filter)){F.continue();return}if(y.search&&!h(z,y.search,y.searchFields)){F.continue();return}if(L<R){L++,F.continue();return}k.push(z),E++,F.continue()},N.onerror=()=>S(N.error)})}function g(m,y){if(!y.items.length)return!0;const p=v=>{if(v.type==="group")return g(m,v);const b=m[v.field],S=v.value;switch(v.operator){case"=":return b==S;case"<>":return b!=S;case"<":return b<S;case"<=":return b<=S;case">":return b>S;case">=":return b>=S;case"contains":return String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(b??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(b??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return b==null||b==="";case"isnotblank":return b!=null&&b!=="";default:return!0}};return y.logic==="and"?y.items.every(p):y.items.some(p)}function h(m,y,p){const v=y.toLowerCase();return(p?p.map(S=>m[S]):Object.values(m)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(m={}){var y;l("loading",!0);try{const p=await f("readonly",m,()=>{});(y=m.sort)!=null&&y.length&&p.sort((S,w)=>{for(const A of m.sort){const k=S[A.field]??"",C=w[A.field]??"",M=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(M!==0)return A.direction==="desc"?-M:M}return 0});const v=await this.count(),b={data:p,totalCount:v};return l("loaded",b),l("loading",!1),b}catch(p){throw l("error",p),l("loading",!1),p}},async byKey(m){return u("readonly",y=>y.get(m))},async insert(m){return await u("readwrite",y=>y.add(m)),l("changed"),m},async update(m,y){const p=await this.byKey(m);if(!p)throw new Error(`Record not found: ${m}`);const v={...p,...y};return await u("readwrite",b=>b.put(v)),l("changed"),v},async remove(m){await u("readwrite",y=>y.delete(m)),l("changed")},on(m,y){return o.has(m)||o.set(m,new Set),o.get(m).add(y),()=>{var p;return(p=o.get(m))==null?void 0:p.delete(y)}},async clear(){await u("readwrite",m=>m.clear()),l("changed")},async count(){return u("readonly",m=>m.count())},async getAll(){return u("readonly",m=>m.getAll())},async bulkInsert(m){const y=await d();return new Promise((p,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.put(w);b.oncomplete=()=>{l("changed"),p()},b.onerror=()=>v(b.error)})},async bulkDelete(m){const y=await d();return new Promise((p,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.delete(w);b.oncomplete=()=>{l("changed"),p()},b.onerror=()=>v(b.error)})},async exportData(){return this.getAll()},async importData(m){await this.clear(),await this.bulkInsert(m)}}}function md(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:s,autoSyncInterval:i=0}=e,o=r.keyField??t.keyField,l=st({...r,keyField:o}),d=st({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const g=new Map;function h(p,...v){var b;(b=g.get(p))==null||b.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),y()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function m(p,v,b){const S={id:`pending_${++f}_${Date.now()}`,action:p,key:v,data:b,timestamp:Date.now(),retries:0};await d.insert(S)}async function y(){if(u){h("syncing",!0);try{let p=0,v=0,b=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),p++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),b++;break}await d.remove(w.id)}catch{w.retries<3&&await d.update(w.id,{retries:w.retries+1})}if(a!=="local-first"){const w=await t.load();if(a==="remote-first")await l.importData(w.data);else if(a==="merge"&&n){const A=await l.load(),k=new Map(A.data.map(M=>[M[o],M])),C=[];for(const M of w.data){const N=k.get(M[o]);N?C.push(n(N,M)):C.push(M)}await l.importData(C)}}h("synced",{added:p,updated:v,removed:b}),s==null||s({added:p,updated:v,removed:b})}catch(p){h("syncError",p)}finally{h("syncing",!1)}}}return i>0&&window.setInterval(y,i),{keyField:o,writable:!0,async load(p={}){if(u&&a==="remote-first")try{const v=await t.load(p);return await l.bulkInsert(v.data),v}catch{}return l.load(p)},async byKey(p){if(u)try{const v=await t.byKey(p);return v&&await l.update(p,v).catch(()=>l.insert(v)),v}catch{}return l.byKey(p)},async insert(p){const v=await l.insert(p);if(u)try{return await t.insert(p)}catch{await m("insert",void 0,p)}else await m("insert",void 0,p);return h("changed"),v},async update(p,v){const b=await l.update(p,v);if(u)try{return await t.update(p,v)}catch{await m("update",p,v)}else await m("update",p,v);return h("changed"),b},async remove(p){if(await l.remove(p),u)try{await t.remove(p)}catch{await m("remove",p)}else await m("remove",p);h("changed")},on(p,v){return g.has(p)||g.set(p,new Set),g.get(p).add(v),()=>{var b;return(b=g.get(p))==null?void 0:b.delete(v)}},sync:y,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function pd(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function s(o,...l){var d;(d=n.get(o))==null||d.forEach(u=>u(...l))}a.onmessage=o=>{const l=o.data;switch(l.type){case"insert":case"update":case"remove":s("changed"),s("crossTabChange",l);break;case"refresh":s("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function i(o){a.postMessage(o)}return{...r,async insert(o){const l=await r.insert(o);return i({type:"insert",data:l}),l},async update(o,l){const d=await r.update(o,l);return i({type:"update",key:o,changes:l}),d},async remove(o){await r.remove(o),i({type:"remove",key:o})},on(o,l){n.has(o)||n.set(o,new Set),n.get(o).add(l);const d=r.on(o,l);return()=>{var u;(u=n.get(o))==null||u.delete(l),d()}},broadcast:i,requestSync(){i({type:"request-sync"})}}}function gd(e={}){const{prefix:t="",persist:r={filter:!0,sort:!0,page:!0,search:!0},useHash:a=!1}=e;function n(){return a?new URLSearchParams(window.location.hash.slice(1)):new URLSearchParams(window.location.search)}function s(o){if(a)window.location.hash=o.toString();else{const l=new URL(window.location.href);l.search=o.toString(),window.history.replaceState({},"",l.toString())}}function i(o){return t?`${t}_${o}`:o}return{read(){const o=n(),l={};if(r.filter){const d=o.get(i("filter"));if(d)try{l.filter=JSON.parse(d)}catch{}}if(r.sort){const d=o.get(i("sort"));if(d)try{l.sort=JSON.parse(d)}catch{}}if(r.page){const d=o.get(i("skip")),u=o.get(i("take"));d&&(l.skip=parseInt(d,10)),u&&(l.take=parseInt(u,10))}if(r.search){const d=o.get(i("search"));d&&(l.search=d)}return l},write(o){const l=n();r.filter&&(o.filter&&o.filter.items.length>0?l.set(i("filter"),JSON.stringify(o.filter)):l.delete(i("filter"))),r.sort&&(o.sort&&o.sort.length>0?l.set(i("sort"),JSON.stringify(o.sort)):l.delete(i("sort"))),r.page&&(o.skip?l.set(i("skip"),String(o.skip)):l.delete(i("skip")),o.take?l.set(i("take"),String(o.take)):l.delete(i("take"))),r.search&&(o.search?l.set(i("search"),o.search):l.delete(i("search"))),s(l)},clear(){const o=n();o.delete(i("filter")),o.delete(i("sort")),o.delete(i("skip")),o.delete(i("take")),o.delete(i("search")),s(o)},toLoadOptions(){const o=this.read();return{filter:o.filter,sort:o.sort,skip:o.skip,take:o.take,search:o.search}}}}const yd={async exportToJSON(e,t){const r=await e.load(),a={version:"1.0",timestamp:Date.now(),data:r.data,metadata:t};return JSON.stringify(a,null,2)},async importFromJSON(e,t,r={}){const n=JSON.parse(t).data;let s=0,i=0;r.replace&&"clear"in e&&await e.clear();for(const o of n){if(r.validate&&!r.validate(o)){i++;continue}try{await e.insert(o),s++}catch{i++}}return{imported:s,skipped:i}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function hd(e="nice_user_prefs"){let t=null;function r(){if(t)return t;try{const n=localStorage.getItem(e);t=n?JSON.parse(n):{}}catch{t={}}return t}function a(n){t=n,localStorage.setItem(e,JSON.stringify(n))}return{get(n,s){return r()[n]??s},set(n,s){const i=r();i[n]=s,a(i)},remove(n){const s=r();delete s[n],a(s)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const Ca={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function bd(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function Pe(e){var r;const t={};for(const[a,n]of Object.entries(Ca)){const s=bd(e,a);s!==void 0&&(t[n]=String(s))}if(e.nesting)for(const a of["sidebar","menu","tree"]){const n=e.nesting[a];if(!n)continue;const s=e.backgrounds.secondary||e.backgrounds.primary||"#ffffff",i=((r=e.text)==null?void 0:r.primary)||"#111111";Object.assign(t,Td(a,n,s,i))}return t}function vd(e,t){const r=t??document.documentElement,a=Pe(e);for(const[n,s]of Object.entries(a))r.style.setProperty(n,s);xd(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const Sd={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function xd(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const r=Sd[e.pattern];if(r){const a=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;t.style.setProperty("--ntd-bg-image",a),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function Aa(e){const t=e??document.documentElement;for(const r of Object.values(Ca))t.style.removeProperty(r);for(const r of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(r);delete t.dataset.ntdColorScheme,delete t.dataset.theme,t.classList.remove("nice-dark");for(const r of["sidebar","menu","tree"]){t.style.removeProperty(`--nice-${r}-levels`);for(let a=1;a<=10;a++)t.style.removeProperty(`--nice-${r}-level-${a}-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-text`),t.style.removeProperty(`--nice-${r}-level-${a}-hover-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-active-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-border`)}}function wd(e){const t=e??document.documentElement,r=getComputedStyle(t),a=i=>r.getPropertyValue(i).trim(),n=i=>parseFloat(r.getPropertyValue(i))||0,s=i=>a(i)||void 0;return{name:"Current",colors:{primary:a("--color-primary"),primaryHover:a("--color-primary-hover"),success:a("--color-success"),warning:a("--color-warning"),error:a("--color-error"),info:a("--color-info"),accent:s("--color-accent"),accentHover:s("--color-accent-hover"),link:s("--color-link"),linkHover:s("--color-link-hover"),focus:s("--color-focus"),overlay:s("--color-overlay"),surface:s("--color-surface"),surfaceHover:s("--color-surface-hover"),disabled:s("--color-disabled"),disabledText:s("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:s("--bg-elevated"),inset:s("--bg-inset"),canvas:s("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:s("--text-inverse"),onPrimary:s("--text-on-primary"),onAccent:s("--text-on-accent")},borders:{color:a("--border-color"),radiusSm:a("--nice-radius-sm"),radiusMd:a("--nice-radius-md"),radiusLg:a("--nice-radius-lg"),radiusXl:a("--nice-radius-xl"),radiusFull:a("--nice-radius-full"),width:s("--border-width"),focusColor:s("--border-focus-color"),divider:s("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:s("--shadow-inner"),glow:s("--shadow-glow")},spacing:{space1:a("--nice-space-1"),space2:a("--nice-space-2"),space3:a("--nice-space-3"),space4:a("--nice-space-4"),space5:a("--nice-space-5"),space6:a("--nice-space-6"),space8:a("--nice-space-8"),space10:s("--nice-space-10"),space12:s("--nice-space-12"),space16:s("--nice-space-16")},typography:{fontFamily:a("--nice-font-family"),fontSizeXs:a("--nice-font-size-xs"),fontSizeSm:a("--nice-font-size-sm"),fontSizeMd:a("--nice-font-size-md"),fontSizeLg:a("--nice-font-size-lg"),fontSizeXl:a("--nice-font-size-xl"),fontWeightNormal:n("--nice-font-weight-normal"),fontWeightMedium:n("--nice-font-weight-medium"),fontWeightSemibold:n("--nice-font-weight-semibold"),fontWeightBold:n("--nice-font-weight-bold"),lineHeight:n("--nice-line-height"),headingFontFamily:s("--nice-heading-font-family"),monoFontFamily:s("--nice-mono-font-family"),fontSize2xl:s("--nice-font-size-2xl"),fontSize3xl:s("--nice-font-size-3xl"),letterSpacing:s("--nice-letter-spacing"),headingLetterSpacing:s("--nice-heading-letter-spacing")},transitions:{fast:a("--nice-transition-fast"),normal:a("--nice-transition"),slow:a("--nice-transition-slow")},darkMode:t.dataset.ntdColorScheme??void 0}}function kd(e){return JSON.stringify(e,null,2)}function Md(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const Cd=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,Ad=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;function ot(e){if(!e)return null;const t=e.trim();let r=t.match(Ad);if(r)return{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)};if(r=t.match(Cd),r)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16)};const a=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return a?{r:+a[1],g:+a[2],b:+a[3]}:null}function Ed({r:e,g:t,b:r}){const a=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(r)}`}function Rt(e,t,r){const a=ot(e),n=ot(t);return!a||!n?e:Ed({r:a.r+(n.r-a.r)*r,g:a.g+(n.g-a.g)*r,b:a.b+(n.b-a.b)*r})}function it(e,t){return Rt(e,"#ffffff",t)}function ct(e,t){return Rt(e,"#000000",t)}function lt(e){const t=ot(e);if(!t)return 1;const r=a=>{const n=a/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)};return .2126*r(t.r)+.7152*r(t.g)+.0722*r(t.b)}function Nd(e,t,r){return lt(e)>.5?r:t}function Ld(e,t,r){const a=t.palette??[],n=t.bgStep??.06,s=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return ct(s,Math.min(.9,n*(e-1)));case"mix-surface":return Rt(s,r,Math.min(1,n*(e-1)));case"tint":default:return it(s,Math.min(.9,n*(e-1)))}}function Td(e,t,r,a){var i;const n={},s=Math.max(1,Math.min(10,t.levels??5));for(let o=1;o<=s;o++){const l=(i=t.overrides)==null?void 0:i[o],d=(l==null?void 0:l.background)??Ld(o,t,r),u=(l==null?void 0:l.text)??Nd(d,"#ffffff",a),f=(l==null?void 0:l.hoverBackground)??(lt(d)>.5?ct(d,.06):it(d,.08)),g=(l==null?void 0:l.activeBackground)??(lt(d)>.5?ct(d,.12):it(d,.16)),h=l==null?void 0:l.border;n[`--nice-${e}-level-${o}-bg`]=d,n[`--nice-${e}-level-${o}-text`]=u,n[`--nice-${e}-level-${o}-hover-bg`]=f,n[`--nice-${e}-level-${o}-active-bg`]=g,h&&(n[`--nice-${e}-level-${o}-border`]=h)}return n[`--nice-${e}-levels`]=String(s),n}const It=c.createContext(null);function Rd(){const e=c.useContext(It);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const we={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ke={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Me={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},zt=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Ea={sm:"0 1px 2px rgba(0,0,0,0.05)",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)"},Id={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function I(e,t,r,a,n){return{name:e,darkMode:"light",colors:{...t,surface:t.surface??r.primary,surfaceHover:t.surfaceHover??r.secondary},backgrounds:{...r,elevated:r.elevated??r.primary,inset:r.inset??r.tertiary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#ffffff"},borders:zt(n),shadows:Ea,spacing:we,typography:ke,transitions:Me}}function O(e,t,r,a,n){return{name:e,darkMode:"dark",colors:{...t,surface:t.surface??r.secondary,surfaceHover:t.surfaceHover??r.tertiary},backgrounds:{...r,elevated:r.elevated??r.secondary,inset:r.inset??r.primary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#0f172a"},borders:zt(n),shadows:Id,spacing:we,typography:ke,transitions:Me}}const Na=I("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),La=I("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),Ta=I("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Ra=I("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),Ia=I("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),za=I("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),Da=I("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),Pa=I("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),Fa=I("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),Ha=I("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),$a=I("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),Ba=I("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),ja=I("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Oa=I("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),_a=I("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Wa=I("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),Va=I("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),Xa=I("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),Ua=I("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),qa=I("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),Ga=I("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),Ka=I("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),Ja=O("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),Ya=O("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),Qa=O("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),Za=O("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),en=O("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),tn=O("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),rn=O("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),an=O("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),nn=O("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),sn=O("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),on=I("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cn=I("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),ln=I("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),dn=I("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),un=I("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),fn=I("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),mn=I("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),pn=I("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),gn=I("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),yn=I("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),hn=I("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),bn=I("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),vn=I("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),Sn=I("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),xn=I("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),wn=I("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),kn=I("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),Mn=I("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),Cn=I("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),An=I("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),En=I("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Nn=I("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ln=I("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),Tn=I("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),Rn=I("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),In=I("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),zn=I("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),Dn=O("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),Pn=I("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),Fn=O("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),Hn=O("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),$n=O("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),Bn=O("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),jn=I("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),On=O("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),_n=I("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Wn=I("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Vn=O("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),Xn=O("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),Un=O("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),qn=I("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),Gn=O("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),Kn=I("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),Jn=I("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),Yn=I("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),Qn=I("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),Zn=I("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),es=I("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),ts=I("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),rs=I("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),as=I("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),ns=I("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),ss=I("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),os=I("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),is=I("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cs=I("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),ls=O("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),ds=I("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),us=I("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),fs={name:"Large Text",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#ffffff"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:zt("#e2e8f0"),shadows:Ea,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Me},ms={name:"Glassmorphism",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"rgba(255,255,255,0.7)",surfaceHover:"rgba(255,255,255,0.5)"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"rgba(255,255,255,0.7)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:we,typography:ke,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},ps={name:"Neumorphism Light",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#e0e5ec",surfaceHover:"#d5dae2"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2",elevated:"#e0e5ec",inset:"#ccd1d9",canvas:"#e0e5ec"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096",inverse:"#ffffff"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:we,typography:ke,transitions:Me},gs={name:"Neumorphism Dark",darkMode:"dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",surface:"#283141",surfaceHover:"#232b3a"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141",elevated:"#283141",inset:"#2d3748",canvas:"#2d3748"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096",inverse:"#0f172a"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:we,typography:ke,transitions:Me},ys=I("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),hs=O("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),bs=O("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),vs=I("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),Ss=I("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),xs=[Na,La,Ta,Ra,Ia,za,Da,Pa,Fa,Ha,$a,Ba,ja,Oa,_a,Wa,Va,Xa,Ua,qa,Ga,Ka,Ja,Ya,Qa,Za,en,tn,rn,an,nn,sn,on,cn,ln,dn,un,fn,mn,pn,gn,yn,hn,bn,vn,Sn,xn,wn,kn,Mn,Cn,An,En,Nn,Ln,Tn,Rn,In,zn,Dn,Pn,Fn,Hn,$n,Bn,jn,On,_n,Wn,Vn,Xn,Un,qn,Gn,Kn,Jn,Yn,Qn,Zn,es,ts,rs,as,ns,ss,os,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss],le={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},qe={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Ce={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Ae={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},Dt={name:"Light",darkMode:"light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Ce,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",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)"},spacing:le,typography:qe,transitions:Ae},ws={name:"Dark",darkMode:"dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Ce,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:le,typography:qe,transitions:Ae},ks={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Ce,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:le,typography:qe,transitions:Ae},Ms={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Ce,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:le,typography:qe,transitions:Ae},Cs={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Ce,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:le,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},As={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:le,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Ae},Es={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:le,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},dt=[Dt,ws,ks,Ms,Cs,As,Es,...xs],zd=["https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap","https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;600&display=swap","https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap"],Dd={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},ne={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Pt={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Ns={meta:{id:"obsidianEditorial",name:"Obsidian Editorial",tagline:"Dark-mode magazine — serif display, razor borders, grain.",tags:["dark","editorial","serif"]},theme:{name:"Obsidian Editorial",darkMode:"dark",colors:{primary:"#e8dcc4",primaryHover:"#d4c29c",success:"#7fb069",warning:"#e6aa68",error:"#d65a5a",info:"#88aabb",accent:"#c98a5b",focus:"#e8dcc4",surface:"#1a1715",surfaceHover:"#221e1b"},backgrounds:{primary:"#0e0c0b",secondary:"#1a1715",tertiary:"#221e1b",hover:"#2a2522",elevated:"#1a1715",inset:"#0b0908",canvas:"#0e0c0b"},text:{primary:"#ede4d1",secondary:"#a39787",muted:"#6b6055",inverse:"#0e0c0b"},borders:{color:"#332d28",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px",width:"1px",divider:"#28231f"},shadows:{sm:"none",md:"0 1px 0 0 rgba(232,220,196,0.04)",lg:"0 2px 0 0 rgba(232,220,196,0.06)",xl:"0 4px 0 0 rgba(232,220,196,0.08)"},spacing:Pt,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Fraunces', 'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"80ms cubic-bezier(0.4,0,0.2,1)",normal:"140ms cubic-bezier(0.4,0,0.2,1)",slow:"220ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.35,blendMode:"overlay"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"subtle"}},Ls={meta:{id:"neonArcade",name:"Neon Arcade",tagline:"Phosphor-green terminal glow on absolute black.",tags:["dark","retro","mono","terminal"]},theme:{name:"Neon Arcade",darkMode:"dark",colors:{primary:"#39ff14",primaryHover:"#50ff35",success:"#39ff14",warning:"#ffcc00",error:"#ff3355",info:"#00e5ff",accent:"#ff00aa",focus:"#39ff14",surface:"#060a06",surfaceHover:"#0b140b"},backgrounds:{primary:"#000000",secondary:"#060a06",tertiary:"#0b140b",hover:"#12241a",elevated:"#060a06",inset:"#000000",canvas:"#000000"},text:{primary:"#c8ffb8",secondary:"#7be368",muted:"#3e7a39",inverse:"#000000"},borders:{color:"#1d3a1d",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"1px",divider:"#143014",focusColor:"#39ff14"},shadows:{sm:"0 0 4px rgba(57,255,20,0.3)",md:"0 0 10px rgba(57,255,20,0.35), 0 0 2px rgba(57,255,20,0.6)",lg:"0 0 22px rgba(57,255,20,0.4), 0 0 4px rgba(57,255,20,0.7)",xl:"0 0 40px rgba(57,255,20,0.5), 0 0 8px rgba(57,255,20,0.8)",glow:"0 0 30px #39ff14, 0 0 60px rgba(57,255,20,0.4)"},spacing:ne,typography:{fontFamily:"'JetBrains Mono', 'Fira Code', ui-monospace, monospace",headingFontFamily:"'JetBrains Mono', monospace",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"60ms steps(4, end)",normal:"120ms steps(6, end)",slow:"200ms steps(8, end)"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.25}},displayStyle:"terminal",variantConfig:{radius:"none",shadow:"glow",density:"compact",animation:"subtle"}},Ts={meta:{id:"hyggeScandinavian",name:"Hygge Scandinavian",tagline:"Warm cream, generous breathing room, soft serif display.",tags:["light","warm","serif","spacious"]},theme:{name:"Hygge Scandinavian",darkMode:"light",colors:{primary:"#8b6f47",primaryHover:"#6f5738",success:"#6b8e4e",warning:"#d49a3e",error:"#b84c4c",info:"#6a8aad",accent:"#c98754",focus:"#8b6f47",surface:"#fbf6ed",surfaceHover:"#f3ecdf"},backgrounds:{primary:"#fdf9f1",secondary:"#f5eee0",tertiary:"#ede3d0",hover:"#e8ddc8",elevated:"#ffffff",inset:"#f0e7d4",canvas:"#fdf9f1"},text:{primary:"#3a2f22",secondary:"#6a5845",muted:"#9c8c76",inverse:"#fdf9f1"},borders:{color:"#d9cbb0",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px",width:"1px",divider:"#e8ddc8"},shadows:{sm:"0 1px 2px rgba(122,92,58,0.05)",md:"0 6px 16px -4px rgba(122,92,58,0.08)",lg:"0 16px 32px -10px rgba(122,92,58,0.10)",xl:"0 28px 56px -18px rgba(122,92,58,0.14)"},spacing:Pt,typography:{fontFamily:"'Work Sans', -apple-system, sans-serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"ui-monospace, 'SF Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"160ms cubic-bezier(0.16,1,0.3,1)",normal:"260ms cubic-bezier(0.16,1,0.3,1)",slow:"400ms cubic-bezier(0.16,1,0.3,1)"}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Rs={meta:{id:"brutalistRaw",name:"Brutalist Raw",tagline:"Paper + ink + hard shadows — zero blur, zero mercy.",tags:["light","brutalist","experimental"]},theme:{name:"Brutalist Raw",darkMode:"light",colors:{primary:"#ff3b30",primaryHover:"#000000",success:"#00aa55",warning:"#ffcc00",error:"#ff0000",info:"#0066ff",accent:"#ffcc00",focus:"#ff3b30",surface:"#ffffff",surfaceHover:"#f5f3ee"},backgrounds:{primary:"#f5f3ee",secondary:"#ffffff",tertiary:"#e8e4d8",hover:"#e0dcd0",elevated:"#ffffff",inset:"#e8e4d8",canvas:"#f5f3ee"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#555555",inverse:"#ffffff"},borders:{color:"#000000",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"2px",divider:"#000000"},shadows:{sm:"3px 3px 0 0 #000000",md:"6px 6px 0 0 #000000",lg:"10px 10px 0 0 #000000",xl:"14px 14px 0 0 #000000"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.4,letterSpacing:"-0.01em",headingLetterSpacing:"-0.04em"},transitions:{fast:"0ms linear",normal:"80ms cubic-bezier(0.2,0,0,1)",slow:"140ms cubic-bezier(0.2,0,0,1)"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Is={meta:{id:"glassAurora",name:"Glass Aurora",tagline:"Frosted translucency floating over aurora light.",tags:["light","glass","modern","gradient"]},theme:{name:"Glass Aurora",darkMode:"light",colors:{primary:"#5b5bff",primaryHover:"#4343e8",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",accent:"#ec4899",focus:"#5b5bff",surface:"rgba(255,255,255,0.55)",surfaceHover:"rgba(255,255,255,0.75)"},backgrounds:{primary:"rgba(255,255,255,0.55)",secondary:"rgba(255,255,255,0.35)",tertiary:"rgba(255,255,255,0.22)",hover:"rgba(255,255,255,0.7)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"#e8d6ff"},text:{primary:"#1a1440",secondary:"#443c78",muted:"#8b83b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.6)",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"36px",radiusFull:"9999px",width:"1px",divider:"rgba(255,255,255,0.4)"},shadows:{sm:"0 2px 12px rgba(91,91,255,0.08)",md:"0 8px 32px rgba(91,91,255,0.12)",lg:"0 18px 56px rgba(236,72,153,0.18)",xl:"0 32px 80px rgba(91,91,255,0.22)"},spacing:ne,typography:{fontFamily:"'Outfit', -apple-system, sans-serif",headingFontFamily:"'Outfit', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"-0.005em",headingLetterSpacing:"-0.025em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"400ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 12% 18%, #ffd6e8 0%, transparent 48%), radial-gradient(at 88% 22%, #c8d8ff 0%, transparent 52%), radial-gradient(at 42% 86%, #d8ffe8 0%, transparent 50%), linear-gradient(180deg, #eee4ff 0%, #ffe8f2 100%)"}},displayStyle:"glass",variantConfig:{density:"normal",animation:"normal"}},zs={meta:{id:"candyPop",name:"Candy Pop",tagline:"Bubblegum pastels, pill shapes, bouncy easing.",tags:["light","playful","pastel","pill"]},theme:{name:"Candy Pop",darkMode:"light",colors:{primary:"#ff4fa3",primaryHover:"#ff2d8e",success:"#3dd68c",warning:"#ffd63d",error:"#ff5577",info:"#4ec8ff",accent:"#b85bff",focus:"#ff4fa3",surface:"#ffffff",surfaceHover:"#fff5fa"},backgrounds:{primary:"#fff5fa",secondary:"#ffeaf3",tertiary:"#ffd8e9",hover:"#ffc4dc",elevated:"#ffffff",inset:"#ffeaf3",canvas:"#fff8f5"},text:{primary:"#531645",secondary:"#8b3a70",muted:"#c678a8",inverse:"#ffffff"},borders:{color:"#ffc4dc",radiusSm:"9999px",radiusMd:"9999px",radiusLg:"9999px",radiusXl:"9999px",radiusFull:"9999px",width:"2px",divider:"#ffd8e9"},shadows:{sm:"0 2px 0 0 #ffc4dc",md:"0 4px 0 0 #ffa3c7",lg:"0 6px 16px rgba(255,79,163,0.2), 0 3px 0 0 #ff4fa3",xl:"0 12px 28px rgba(255,79,163,0.25)"},spacing:ne,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"140ms cubic-bezier(0.34,1.56,0.64,1)",normal:"240ms cubic-bezier(0.34,1.56,0.64,1)",slow:"380ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"pill",variantConfig:{radius:"full",density:"comfortable",animation:"playful"}},Ds={meta:{id:"newspaperBroadsheet",name:"Newspaper Broadsheet",tagline:"Ivory paper, hairline rules, serif gravity.",tags:["light","editorial","serif","print"]},theme:{name:"Newspaper Broadsheet",darkMode:"light",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2d5016",warning:"#8b6914",error:"#8b0000",info:"#1d3a5f",accent:"#8b0000",focus:"#1a1a1a",surface:"#fbf7ee",surfaceHover:"#f3ecdd"},backgrounds:{primary:"#fbf7ee",secondary:"#f5eedb",tertiary:"#ede4cc",hover:"#e8ddbe",elevated:"#fbf7ee",inset:"#f0e7d0",canvas:"#fbf7ee"},text:{primary:"#14110c",secondary:"#3d362a",muted:"#7a6f58",inverse:"#fbf7ee"},borders:{color:"#14110c",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"1px",divider:"#14110c"},shadows:{sm:"none",md:"none",lg:"none",xl:"none"},spacing:ne,typography:{fontFamily:"'Fraunces', 'Source Serif Pro', Georgia, serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.01em",headingLetterSpacing:"-0.025em"},transitions:{fast:"0ms",normal:"100ms linear",slow:"180ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.18,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"normal"}},Ps={meta:{id:"synthwave84",name:"Synthwave 84",tagline:"Magenta & cyan pulse over deep navy — 1984 forever.",tags:["dark","retro","neon","80s"]},theme:{name:"Synthwave 84",darkMode:"dark",colors:{primary:"#ff3ca8",primaryHover:"#ff6bc1",success:"#72f1b8",warning:"#ffcc33",error:"#fe4450",info:"#36f9f6",accent:"#36f9f6",focus:"#ff3ca8",surface:"#2a1a4f",surfaceHover:"#332260"},backgrounds:{primary:"#1a0933",secondary:"#241443",tertiary:"#2d1a52",hover:"#382266",elevated:"#2a1a4f",inset:"#120626",canvas:"#0e0524"},text:{primary:"#f5e8ff",secondary:"#c9a7ff",muted:"#8063b0",inverse:"#0e0524"},borders:{color:"#553388",radiusSm:"2px",radiusMd:"4px",radiusLg:"6px",radiusXl:"8px",radiusFull:"9999px",width:"1px",divider:"#3d2270",focusColor:"#36f9f6"},shadows:{sm:"0 0 8px rgba(255,60,168,0.4)",md:"0 0 18px rgba(255,60,168,0.45), 0 2px 0 0 #36f9f6",lg:"0 0 36px rgba(255,60,168,0.55), 0 4px 0 0 #36f9f6",xl:"0 0 60px rgba(255,60,168,0.6), 0 6px 0 0 #36f9f6",glow:"0 0 28px #ff3ca8, 0 0 56px rgba(255,60,168,0.5)"},spacing:ne,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"120ms cubic-bezier(0.23,1,0.32,1)",normal:"200ms cubic-bezier(0.23,1,0.32,1)",slow:"360ms cubic-bezier(0.23,1,0.32,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0e0524 0%, #1a0933 55%, #2d1a52 100%), repeating-linear-gradient(0deg, rgba(54,249,246,0.04) 0 1px, transparent 1px 3px)"}},displayStyle:"synthwave",variantConfig:{shadow:"glow",animation:"dramatic",density:"normal"}},Fs={meta:{id:"zenMinimal",name:"Zen Minimal",tagline:"Whisper-light type, hairlines, oceans of whitespace.",tags:["light","minimal","airy"]},theme:{name:"Zen Minimal",darkMode:"light",colors:{primary:"#0a0a0a",primaryHover:"#262626",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#2563eb",accent:"#737373",focus:"#0a0a0a",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f0f0f0",elevated:"#ffffff",inset:"#fafafa",canvas:"#ffffff"},text:{primary:"#171717",secondary:"#525252",muted:"#a3a3a3",inverse:"#ffffff"},borders:{color:"#ededed",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px",width:"1px",divider:"#f0f0f0"},shadows:{sm:"none",md:"0 0 0 1px rgba(0,0,0,0.04)",lg:"0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05)",xl:"0 4px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)"},spacing:Pt,typography:{fontFamily:"'Manrope', -apple-system, sans-serif",headingFontFamily:"'Manrope', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"-0.005em",headingLetterSpacing:"-0.03em"},transitions:{fast:"100ms ease",normal:"180ms ease",slow:"280ms ease"}},displayStyle:"minimal",variantConfig:{density:"spacious",animation:"subtle"}},Hs={meta:{id:"claymorphism",name:"Claymorphism",tagline:"Soft-clay 3D surfaces — pressable, friendly, tactile.",tags:["light","playful","neumorphic","3d"]},theme:{name:"Claymorphism",darkMode:"light",colors:{primary:"#8b7ef5",primaryHover:"#7469ec",success:"#6ed6a5",warning:"#ffc771",error:"#ff8b8b",info:"#7ec4f5",accent:"#ffb3d9",focus:"#8b7ef5",surface:"#f3efff",surfaceHover:"#ebe4ff"},backgrounds:{primary:"#f6f0ff",secondary:"#ede4ff",tertiary:"#dfd3fc",hover:"#d3c5fa",elevated:"#ffffff",inset:"#e5daff",canvas:"#f6f0ff"},text:{primary:"#2a1f5e",secondary:"#584a8e",muted:"#9388bd",inverse:"#ffffff"},borders:{color:"rgba(139,126,245,0.15)",radiusSm:"14px",radiusMd:"22px",radiusLg:"32px",radiusXl:"48px",radiusFull:"9999px",width:"0px",divider:"rgba(139,126,245,0.12)"},shadows:{sm:"-3px -3px 6px rgba(255,255,255,0.8), 3px 3px 8px rgba(139,126,245,0.18), inset 0 0 0 rgba(255,255,255,0)",md:"-5px -5px 12px rgba(255,255,255,0.9), 6px 6px 18px rgba(139,126,245,0.22), inset 1px 1px 1px rgba(255,255,255,0.6)",lg:"-8px -8px 20px rgba(255,255,255,0.95), 10px 10px 32px rgba(139,126,245,0.28), inset 2px 2px 2px rgba(255,255,255,0.7)",xl:"-14px -14px 32px rgba(255,255,255,1), 16px 16px 48px rgba(139,126,245,0.34), inset 3px 3px 4px rgba(255,255,255,0.8)",inner:"inset 4px 4px 10px rgba(139,126,245,0.2), inset -4px -4px 10px rgba(255,255,255,0.9)"},spacing:ne,typography:{fontFamily:"'Nunito', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1.4)",normal:"260ms cubic-bezier(0.4,0,0.2,1.4)",slow:"400ms cubic-bezier(0.4,0,0.2,1.4)"}},displayStyle:"neumorphic",variantConfig:{radius:"2xl",density:"comfortable",animation:"normal"}},$s={meta:{id:"bauhaus",name:"Bauhaus",tagline:"Primary palette, geometric rigour, grid as foundation.",tags:["light","geometric","primary","design"]},theme:{name:"Bauhaus",darkMode:"light",colors:{primary:"#d62828",primaryHover:"#a81e1e",success:"#2a9d8f",warning:"#fcbf49",error:"#d62828",info:"#1d4e89",accent:"#fcbf49",focus:"#1d4e89",surface:"#faf5e8",surfaceHover:"#f2ead3"},backgrounds:{primary:"#faf5e8",secondary:"#f5ecd3",tertiary:"#ede0be",hover:"#e5d5a8",elevated:"#ffffff",inset:"#f0e3c0",canvas:"#faf5e8"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#7a7a7a",inverse:"#faf5e8"},borders:{color:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"3px",divider:"#1a1a1a"},shadows:{sm:"0 2px 0 0 #1a1a1a",md:"4px 4px 0 0 #1a1a1a",lg:"6px 6px 0 0 #1d4e89",xl:"8px 8px 0 0 #d62828"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:800,fontWeightBold:900,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.35}},displayStyle:"bauhaus",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},Bs={meta:{id:"bankVault",name:"Bank Vault",tagline:"Navy, gilt accents, serif gravitas — trusted by institutions.",tags:["light","corporate","serif","conservative"]},theme:{name:"Bank Vault",darkMode:"light",colors:{primary:"#0b2545",primaryHover:"#163969",success:"#2d6a4f",warning:"#b08d2e",error:"#8b1a1a",info:"#1d4e89",accent:"#b08d2e",focus:"#0b2545",surface:"#ffffff",surfaceHover:"#f7f4ec"},backgrounds:{primary:"#fbfaf6",secondary:"#f4f0e4",tertiary:"#ebe5d2",hover:"#e3dcc4",elevated:"#ffffff",inset:"#efeadb",canvas:"#fbfaf6"},text:{primary:"#0b2545",secondary:"#3a4b65",muted:"#7a8399",inverse:"#fbfaf6"},borders:{color:"#c9bfa3",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px",width:"1px",divider:"#d4c9a8"},shadows:{sm:"0 1px 0 0 rgba(11,37,69,0.08)",md:"0 1px 3px rgba(11,37,69,0.08), 0 0 0 1px rgba(176,141,46,0.12)",lg:"0 4px 10px rgba(11,37,69,0.1)",xl:"0 12px 24px rgba(11,37,69,0.12)"},spacing:Dd,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'Libre Caslon Text', 'DM Serif Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0.005em",headingLetterSpacing:"-0.01em"},transitions:{fast:"90ms cubic-bezier(0.4,0,0.2,1)",normal:"160ms cubic-bezier(0.4,0,0.2,1)",slow:"260ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"bank",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"none"}},Ft={obsidianEditorial:Ns,neonArcade:Ls,hyggeScandinavian:Ts,brutalistRaw:Rs,glassAurora:Is,candyPop:zs,newspaperBroadsheet:Ds,synthwave84:Ps,zenMinimal:Fs,claymorphism:Hs,bauhaus:$s,bankVault:Bs},js=Object.values(Ft);function Pd(e){return Ft[e]}function Fd(e){return js.filter(t=>t.meta.tags.includes(e))}const Hd=["https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Poiret+One&family=Cormorant+Garamond:wght@300;400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Roboto+Condensed:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Space+Mono:wght@400;700&display=swap","https://fonts.googleapis.com/css2?family=VT323&display=swap","https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Special+Elite&display=swap","https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&display=swap","https://fonts.googleapis.com/css2?family=Bangers&display=swap","https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap","https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Rubik+Mono+One&family=Rubik:wght@400;500;700;800&display=swap"],Os={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},X={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ee={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Ge={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},_s={meta:{id:"forestCanopy",name:"Forest Canopy",tagline:"Moss on bark, dappled light — organic radii, earth serif.",tags:["light","nature","serif","organic"]},theme:{name:"Forest Canopy",darkMode:"light",recommendedDisplayStyle:"scandinavian",colors:{primary:"#3d5a40",primaryHover:"#2d4430",success:"#4a7c3a",warning:"#c88d3e",error:"#a63c3c",info:"#5a7c8a",accent:"#8ba878",focus:"#3d5a40",surface:"#f4f1e8",surfaceHover:"#ebe7d5"},backgrounds:{primary:"#f7f4e9",secondary:"#ede8d4",tertiary:"#dfd8be",hover:"#d5cdae",elevated:"#fcfaf1",inset:"#e5ddc5",canvas:"#f0ece0"},text:{primary:"#1e2a1c",secondary:"#3d4a36",muted:"#7a8570",inverse:"#f7f4e9"},borders:{color:"#c4bda0",width:"1px",divider:"#d8d0b5",radiusSm:"3px",radiusMd:"7px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(61,90,64,0.06)",md:"0 4px 12px -2px rgba(61,90,64,0.12), 0 2px 4px rgba(61,90,64,0.05)",lg:"0 10px 24px -6px rgba(61,90,64,0.16)",xl:"0 20px 40px -12px rgba(61,90,64,0.22)"},spacing:Ee,typography:{fontFamily:"'Lora', Georgia, serif",headingFontFamily:"'Spectral', 'Lora', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"180ms cubic-bezier(0.16,1,0.3,1)",normal:"280ms cubic-bezier(0.16,1,0.3,1)",slow:"420ms cubic-bezier(0.16,1,0.3,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.25}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Ws={meta:{id:"desertDune",name:"Desert Dune",tagline:"Ochre horizons, warm grain, serif that suns itself.",tags:["light","nature","serif","warm"]},theme:{name:"Desert Dune",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#c8732f",primaryHover:"#a65a1c",success:"#7a8c3a",warning:"#e0a83a",error:"#b34747",info:"#7a8fa6",accent:"#e8a863",focus:"#c8732f",surface:"#fbf3e5",surfaceHover:"#f4e8d0"},backgrounds:{primary:"#fdf7ea",secondary:"#f6ebd3",tertiary:"#eeddb6",hover:"#e5cfa0",elevated:"#ffffff",inset:"#f0dfb8",canvas:"#fdf5e6"},text:{primary:"#3a2413",secondary:"#6b4823",muted:"#a88860",inverse:"#fdf7ea"},borders:{color:"#dcc08c",width:"1px",divider:"#e8d0a5",radiusSm:"12px",radiusMd:"18px",radiusLg:"28px",radiusXl:"40px",radiusFull:"9999px"},shadows:{sm:"0 2px 6px -2px rgba(200,115,47,0.1)",md:"0 8px 20px -6px rgba(200,115,47,0.15)",lg:"0 18px 36px -10px rgba(200,115,47,0.2)",xl:"0 32px 56px -18px rgba(200,115,47,0.28)"},spacing:Ee,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'DM Serif Display', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.025em"},transitions:{fast:"160ms ease-out",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"460ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(175deg, #fbecc5 0%, #f6ddaf 40%, #eec28a 100%), radial-gradient(ellipse at 80% 10%, #fff4d9 0%, transparent 60%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Vs={meta:{id:"arcticCrystal",name:"Arctic Crystal",tagline:"Facets of ice, lean typography, surgical whitespace.",tags:["light","nature","minimal","cold"]},theme:{name:"Arctic Crystal",darkMode:"light",recommendedDisplayStyle:"minimal",colors:{primary:"#2a6a8c",primaryHover:"#1e5374",success:"#4a8a6a",warning:"#d0a040",error:"#c24848",info:"#5a9fc0",accent:"#a8d4e8",focus:"#2a6a8c",surface:"#ffffff",surfaceHover:"#f0f6fa"},backgrounds:{primary:"#f5fafd",secondary:"#eaf2f7",tertiary:"#d8e5ed",hover:"#cfdce6",elevated:"#ffffff",inset:"#e3eef5",canvas:"#f0f7fb"},text:{primary:"#0a2030",secondary:"#3a5468",muted:"#7a95a8",inverse:"#ffffff"},borders:{color:"#cfdde8",width:"1px",divider:"#e0ebf3",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px"},shadows:{sm:"1px 1px 0 rgba(42,106,140,0.06), -1px 0 0 rgba(42,106,140,0.04)",md:"2px 2px 0 rgba(42,106,140,0.08), -2px 0 0 rgba(42,106,140,0.04), 0 4px 8px -2px rgba(42,106,140,0.1)",lg:"4px 4px 0 rgba(42,106,140,0.1), 0 10px 16px -4px rgba(42,106,140,0.14)",xl:"0 24px 40px -12px rgba(42,106,140,0.2)"},spacing:Ge,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Inter', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:200,fontWeightMedium:300,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"-0.02em"},transitions:{fast:"90ms ease",normal:"160ms ease",slow:"260ms ease"}},displayStyle:"minimal",variantConfig:{radius:"sm",shadow:"subtle",density:"spacious",animation:"subtle"}},Xs={meta:{id:"autumnFoliage",name:"Autumn Foliage",tagline:"Ember glow, Fraunces serif, woodsmoke warmth.",tags:["light","nature","serif","warm"]},theme:{name:"Autumn Foliage",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#a83828",primaryHover:"#842818",success:"#6b7c2c",warning:"#c48020",error:"#8a2020",info:"#7a5a3a",accent:"#d89040",focus:"#a83828",surface:"#fbf1e3",surfaceHover:"#f2e4ce"},backgrounds:{primary:"#fdf5e8",secondary:"#f4e5cc",tertiary:"#e8d2aa",hover:"#dec295",elevated:"#fff9ee",inset:"#eedab5",canvas:"#faeed6"},text:{primary:"#2a140a",secondary:"#5a3020",muted:"#997860",inverse:"#fdf5e8"},borders:{color:"#d4b890",width:"1px",divider:"#e0c8a0",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(168,56,40,0.08)",md:"0 4px 10px -2px rgba(168,56,40,0.12), 0 2px 4px rgba(168,56,40,0.08)",lg:"0 12px 24px -6px rgba(168,56,40,0.18)",xl:"0 24px 48px -16px rgba(168,56,40,0.24)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"140ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"normal"}},Us={meta:{id:"japaneseWashi",name:"Japanese Washi",tagline:"Sumi ink on cream — quiet serif, paper grain, zero excess.",tags:["light","cultural","serif","minimal"]},theme:{name:"Japanese Washi",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1d3557",primaryHover:"#0d2545",success:"#4a7042",warning:"#a8803e",error:"#8b2a2a",info:"#3a5a78",accent:"#c83a3a",focus:"#1d3557",surface:"#faf6ea",surfaceHover:"#f2ebd7"},backgrounds:{primary:"#fdf9ee",secondary:"#f5ecd5",tertiary:"#ecdfbd",hover:"#e4d5aa",elevated:"#ffffff",inset:"#f0e5c8",canvas:"#fbf6e7"},text:{primary:"#1a1610",secondary:"#3d352a",muted:"#8a7f64",inverse:"#fdf9ee"},borders:{color:"#1a1610",width:"1px",divider:"#d4c89e",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(26,22,16,0.08)",lg:"0 2px 0 0 rgba(26,22,16,0.1)",xl:"0 4px 12px rgba(26,22,16,0.08)"},spacing:Ge,typography:{fontFamily:"'Noto Sans JP', 'Inter', sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.75,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"340ms ease"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.22,blendMode:"multiply"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},qs={meta:{id:"moroccanMosaic",name:"Moroccan Mosaic",tagline:"Zellige geometry — terracotta, teal, saffron in tiled rhythm.",tags:["light","cultural","geometric","warm"]},theme:{name:"Moroccan Mosaic",darkMode:"light",recommendedDisplayStyle:"bauhaus",colors:{primary:"#0f6b5c",primaryHover:"#0a5246",success:"#5a8a3a",warning:"#e0a03a",error:"#c2522a",info:"#3a7090",accent:"#e8a840",focus:"#0f6b5c",surface:"#f9f1dc",surfaceHover:"#f0e5c2"},backgrounds:{primary:"#fbf3e0",secondary:"#f2e4c2",tertiary:"#e6d2a0",hover:"#dac38a",elevated:"#fdf7e8",inset:"#ecd8b2",canvas:"#f8edd3"},text:{primary:"#2a1608",secondary:"#5a3a20",muted:"#a08860",inverse:"#fbf3e0"},borders:{color:"#2a1608",width:"2px",divider:"#b89868",radiusSm:"3px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"2px 2px 0 rgba(42,22,8,0.12)",md:"3px 3px 0 #0f6b5c, 6px 6px 0 rgba(42,22,8,0.08)",lg:"4px 4px 0 #0f6b5c, 8px 8px 0 #e8a840",xl:"6px 6px 0 #c2522a, 12px 12px 0 rgba(42,22,8,0.1)"},spacing:X,typography:{fontFamily:"'Cairo', 'Inter', sans-serif",headingFontFamily:"'Amiri', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms linear",normal:"200ms linear",slow:"320ms linear"},backgroundImage:{type:"pattern",pattern:"hexagons",opacity:.2}},displayStyle:"bauhaus",variantConfig:{radius:"sm",shadow:"md",density:"normal",animation:"subtle"}},Gs={meta:{id:"artDecoGatsby",name:"Art Deco Gatsby",tagline:"Gold, emerald, onyx — geometric glamour, thin gilt lines.",tags:["dark","cultural","luxury","geometric"]},theme:{name:"Art Deco Gatsby",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#d4af37",primaryHover:"#e8c850",success:"#4a9c7a",warning:"#e8c850",error:"#c24040",info:"#70a8c0",accent:"#1e5c4a",focus:"#d4af37",surface:"#0f1a16",surfaceHover:"#16251e"},backgrounds:{primary:"#0a0f0c",secondary:"#0f1a16",tertiary:"#16251e",hover:"#1c3028",elevated:"#0f1a16",inset:"#050908",canvas:"#080c0a"},text:{primary:"#f0e4c2",secondary:"#c0b080",muted:"#706448",inverse:"#0a0f0c"},borders:{color:"#6b5828",width:"1px",divider:"#4a3c18",focusColor:"#d4af37",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(212,175,55,0.15)",md:"0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.2)",lg:"0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.3), inset 0 1px 0 rgba(212,175,55,0.1)",xl:"0 20px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.4)",glow:"0 0 16px rgba(212,175,55,0.3)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Poiret One', 'Cormorant Garamond', serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.04em",headingLetterSpacing:"0.12em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"none",shadow:"lg",density:"comfortable",animation:"subtle"}},Ks={meta:{id:"sovietConstructivist",name:"Soviet Constructivist",tagline:"Rodchenko red — slab type, hard angles, propaganda poise.",tags:["light","cultural","brutalist","geometric"]},theme:{name:"Soviet Constructivist",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#c41e1e",primaryHover:"#8a1414",success:"#3a6a3a",warning:"#d08028",error:"#8a1414",info:"#2a4060",accent:"#1a1a1a",focus:"#c41e1e",surface:"#f0ead8",surfaceHover:"#e5dcc0"},backgrounds:{primary:"#f4efde",secondary:"#e8dec4",tertiary:"#d8c9a4",hover:"#ccbb90",elevated:"#faf5e5",inset:"#dccda8",canvas:"#f0ead5"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#706d5a",inverse:"#f4efde"},borders:{color:"#1a1a1a",width:"3px",divider:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"4px 0 0 0 #c41e1e",md:"6px 6px 0 0 #1a1a1a, 8px 8px 0 0 #c41e1e",lg:"10px 10px 0 0 #c41e1e",xl:"12px -4px 0 0 #1a1a1a, 16px 0 0 0 #c41e1e"},spacing:X,typography:{fontFamily:"'Roboto Condensed', 'Archivo', sans-serif",headingFontFamily:"'Alfa Slab One', 'Archivo Black', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.35,letterSpacing:"0.02em",headingLetterSpacing:"-0.005em"},transitions:{fast:"0ms linear",normal:"80ms linear",slow:"160ms linear"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Js={meta:{id:"blueprint",name:"Blueprint",tagline:"Cyanotype drafting — white lines, grid paper, technical mono.",tags:["dark","tech","technical","mono"]},theme:{name:"Blueprint",darkMode:"dark",recommendedDisplayStyle:"dashboard",colors:{primary:"#f0f4f8",primaryHover:"#ffffff",success:"#88e0b8",warning:"#ffcc66",error:"#ff8888",info:"#88c8ff",accent:"#6eb0e0",focus:"#ffffff",surface:"#18456a",surfaceHover:"#1f527e"},backgrounds:{primary:"#0e3356",secondary:"#124066",tertiary:"#184d79",hover:"#1e5a8c",elevated:"#18456a",inset:"#082540",canvas:"#0a2d4a"},text:{primary:"#f0f4f8",secondary:"#b5c8da",muted:"#6e8aa4",inverse:"#0e3356"},borders:{color:"#3870a0",width:"1px",divider:"#2a5680",focusColor:"#ffffff",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(240,244,248,0.05)",md:"0 1px 0 0 rgba(240,244,248,0.1), 0 4px 8px rgba(0,0,0,0.3)",lg:"0 1px 0 0 rgba(240,244,248,0.14), 0 10px 20px rgba(0,0,0,0.4)",xl:"0 20px 40px rgba(0,0,0,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Mono', ui-monospace, monospace",headingFontFamily:"'Space Grotesk', 'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"-0.01em"},transitions:{fast:"80ms linear",normal:"140ms linear",slow:"220ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.4}},displayStyle:"dashboard",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},Ys={meta:{id:"hologramUI",name:"Hologram UI",tagline:"Iridescent light-leaks, translucent layers, futurist geometry.",tags:["dark","tech","glass","neon"]},theme:{name:"Hologram UI",darkMode:"dark",recommendedDisplayStyle:"cosmic",colors:{primary:"#8be9fd",primaryHover:"#a8f0ff",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#bd93f9",accent:"#ff79c6",focus:"#8be9fd",surface:"rgba(40,30,70,0.5)",surfaceHover:"rgba(50,40,85,0.6)"},backgrounds:{primary:"rgba(30,20,55,0.6)",secondary:"rgba(40,30,70,0.5)",tertiary:"rgba(55,40,90,0.4)",hover:"rgba(65,50,105,0.55)",elevated:"rgba(50,38,82,0.7)",inset:"rgba(25,18,45,0.6)",canvas:"#0a0618"},text:{primary:"#f0e8ff",secondary:"#b0a0e0",muted:"#6a5a94",inverse:"#0a0618"},borders:{color:"rgba(139,233,253,0.25)",width:"1px",divider:"rgba(139,233,253,0.15)",focusColor:"#8be9fd",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"0 0 12px rgba(139,233,253,0.2)",md:"0 4px 20px rgba(189,147,249,0.3), 0 0 1px rgba(139,233,253,0.4)",lg:"0 8px 40px rgba(255,121,198,0.35), 0 0 2px rgba(139,233,253,0.5), inset 0 1px 0 rgba(255,255,255,0.08)",xl:"0 20px 60px rgba(139,233,253,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",glow:"0 0 32px rgba(139,233,253,0.6), 0 0 64px rgba(255,121,198,0.3)"},spacing:X,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.06em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1)",normal:"280ms cubic-bezier(0.4,0,0.2,1)",slow:"440ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 15% 20%, rgba(139,233,253,0.25) 0%, transparent 50%), radial-gradient(at 85% 25%, rgba(255,121,198,0.25) 0%, transparent 50%), radial-gradient(at 50% 90%, rgba(189,147,249,0.3) 0%, transparent 55%), linear-gradient(135deg, #0a0618 0%, #1a0e38 100%)"}},displayStyle:"cosmic",variantConfig:{shadow:"glow",density:"normal",animation:"normal"}},Qs={meta:{id:"deepSea",name:"Deep Sea",tagline:"Midnight blue abyss, bioluminescent accents in the dark.",tags:["dark","tech","organic"]},theme:{name:"Deep Sea",darkMode:"dark",recommendedDisplayStyle:"modern3d",colors:{primary:"#00d9c4",primaryHover:"#2feedc",success:"#5af0b0",warning:"#f0c858",error:"#ff6a82",info:"#60c0ff",accent:"#a878f0",focus:"#00d9c4",surface:"#0a1524",surfaceHover:"#0e1c30"},backgrounds:{primary:"#05101c",secondary:"#0a1524",tertiary:"#0f1f34",hover:"#163044",elevated:"#0e1c30",inset:"#030810",canvas:"#030810"},text:{primary:"#d8f0f5",secondary:"#88b8c8",muted:"#4a7080",inverse:"#030810"},borders:{color:"#183548",width:"1px",divider:"#0f2638",focusColor:"#00d9c4",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,217,196,0.08)",md:"0 6px 20px rgba(0,217,196,0.12), 0 2px 4px rgba(0,0,0,0.5)",lg:"0 14px 40px rgba(0,217,196,0.18), 0 4px 8px rgba(0,0,0,0.6)",xl:"0 28px 64px rgba(0,217,196,0.22), 0 8px 16px rgba(0,0,0,0.7)",glow:"0 0 24px rgba(0,217,196,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"160ms cubic-bezier(0.22,1,0.36,1)",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"440ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 20% 30%, rgba(0,217,196,0.08) 0%, transparent 60%), radial-gradient(at 80% 80%, rgba(168,120,240,0.06) 0%, transparent 55%), linear-gradient(180deg, #030810 0%, #05101c 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Zs={meta:{id:"analog70s",name:"Analog 70s",tagline:"Mustard, rust, walnut — chunky, warm, turntable energy.",tags:["light","retro","warm","serif"]},theme:{name:"Analog 70s",darkMode:"light",recommendedDisplayStyle:"rounded",colors:{primary:"#c8621e",primaryHover:"#a04d14",success:"#7a8a2a",warning:"#d8a030",error:"#a03030",info:"#6a7a8a",accent:"#d8a830",focus:"#c8621e",surface:"#f5ead2",surfaceHover:"#ecdfc0"},backgrounds:{primary:"#f7ecd6",secondary:"#eeddb8",tertiary:"#e2c998",hover:"#d8bc80",elevated:"#fbf2de",inset:"#e8cfa5",canvas:"#f2e4c8"},text:{primary:"#2a1608",secondary:"#5a2e14",muted:"#a07852",inverse:"#f7ecd6"},borders:{color:"#b89868",width:"2px",divider:"#ccb285",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"34px",radiusFull:"9999px"},shadows:{sm:"0 2px 0 0 rgba(42,22,8,0.12)",md:"0 4px 0 0 rgba(42,22,8,0.15), 0 6px 10px rgba(200,98,30,0.12)",lg:"0 6px 0 0 rgba(42,22,8,0.18), 0 10px 20px rgba(200,98,30,0.2)",xl:"0 8px 0 0 rgba(42,22,8,0.22), 0 20px 40px rgba(200,98,30,0.28)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Abril Fatface', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"180ms cubic-bezier(0.34,1.56,0.64,1)",normal:"280ms cubic-bezier(0.34,1.56,0.64,1)",slow:"440ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"rounded",variantConfig:{radius:"xl",shadow:"md",density:"comfortable",animation:"playful"}},eo={meta:{id:"vhsTracking",name:"VHS Tracking",tagline:"Chromatic smear, scan-line haze, pixel type from another decade.",tags:["dark","retro","pixel","experimental"]},theme:{name:"VHS Tracking",darkMode:"dark",recommendedDisplayStyle:"retro8bit",colors:{primary:"#ff3eb5",primaryHover:"#ff5fc5",success:"#3eff90",warning:"#ffe83e",error:"#ff3e3e",info:"#3ee0ff",accent:"#3eff90",focus:"#ff3eb5",surface:"#120818",surfaceHover:"#1a0c24"},backgrounds:{primary:"#0a0412",secondary:"#120818",tertiary:"#1a0c24",hover:"#241230",elevated:"#120818",inset:"#050208",canvas:"#0a0412"},text:{primary:"#f8e8ff",secondary:"#c888d8",muted:"#605070",inverse:"#0a0412"},borders:{color:"#4a2864",width:"1px",divider:"#2a1840",focusColor:"#ff3eb5",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0"},shadows:{sm:"-2px 0 0 rgba(255,62,181,0.5), 2px 0 0 rgba(62,224,255,0.5)",md:"-3px 0 0 rgba(255,62,181,0.6), 3px 0 0 rgba(62,224,255,0.6), 0 4px 12px rgba(0,0,0,0.6)",lg:"-4px 0 0 rgba(255,62,181,0.7), 4px 0 0 rgba(62,224,255,0.7), 0 8px 24px rgba(0,0,0,0.7)",xl:"-6px 0 0 rgba(255,62,181,0.8), 6px 0 0 rgba(62,224,255,0.8)",glow:"0 0 20px rgba(255,62,181,0.6)"},spacing:X,typography:{fontFamily:"'VT323', 'JetBrains Mono', monospace",headingFontFamily:"'VT323', monospace",monoFontFamily:"'VT323', monospace",fontSizeXs:"0.9375rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.375rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.35,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms steps(3)",normal:"100ms steps(5)",slow:"180ms steps(8)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0a0412 0%, #120818 100%), repeating-linear-gradient(0deg, rgba(255,62,181,0.03) 0 2px, transparent 2px 4px)"}},displayStyle:"retro8bit",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},to={meta:{id:"typewriterPress",name:"Typewriter Press",tagline:"Ribbon red on cream — Courier bones, stamped display.",tags:["light","retro","mono","editorial"]},theme:{name:"Typewriter Press",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#b02020",primaryHover:"#8a1818",success:"#4a7038",warning:"#b08018",error:"#8a1818",info:"#3a5068",accent:"#1a1a1a",focus:"#b02020",surface:"#faf3df",surfaceHover:"#f0e7c6"},backgrounds:{primary:"#fbf5e3",secondary:"#f3e9c8",tertiary:"#ebdcab",hover:"#e2cf8f",elevated:"#fffae7",inset:"#efe0b0",canvas:"#fbf5e3"},text:{primary:"#1a1a1a",secondary:"#3d3428",muted:"#7a6f4a",inverse:"#fbf5e3"},borders:{color:"#1a1a1a",width:"1px",divider:"#c8b880",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"0 0 0 rgba(26,26,26,0), 1px 1px 0 rgba(26,26,26,0.12)",md:"1px 1px 0 rgba(26,26,26,0.15), 2px 2px 0 rgba(176,32,32,0.1)",lg:"2px 2px 0 rgba(26,26,26,0.2), 4px 4px 0 rgba(176,32,32,0.12)",xl:"3px 3px 0 rgba(26,26,26,0.25)"},spacing:X,typography:{fontFamily:"'Courier Prime', 'Courier New', monospace",headingFontFamily:"'Special Elite', 'Courier Prime', monospace",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms linear",normal:"80ms linear",slow:"140ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.2,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"subtle",density:"normal",animation:"none"}},ro={meta:{id:"y2kAqua",name:"Y2K Aqua",tagline:"Chrome and aqua — iMac blue, optimistic futurism, 2001 energy.",tags:["light","retro","glass"]},theme:{name:"Y2K Aqua",darkMode:"light",recommendedDisplayStyle:"modern3d",colors:{primary:"#0a84ff",primaryHover:"#0066cc",success:"#34c759",warning:"#ff9500",error:"#ff3b30",info:"#5ac8fa",accent:"#5ac8fa",focus:"#0a84ff",surface:"#f0f5fc",surfaceHover:"#e0ecfa"},backgrounds:{primary:"#e8f2fc",secondary:"#d8e8f8",tertiary:"#c0d8f0",hover:"#a8c8e8",elevated:"#ffffff",inset:"#c8dcf4",canvas:"#dce8f4"},text:{primary:"#0a1a30",secondary:"#304868",muted:"#6a88a8",inverse:"#ffffff"},borders:{color:"#a0c0e0",width:"1px",divider:"#c0d8f0",radiusSm:"6px",radiusMd:"10px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(10,132,255,0.15)",md:"inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 2px rgba(10,132,255,0.2), 0 2px 6px rgba(10,132,255,0.25), 0 4px 12px rgba(10,132,255,0.15)",lg:"inset 0 1px 0 rgba(255,255,255,0.95), 0 4px 12px rgba(10,132,255,0.3), 0 10px 24px rgba(90,200,250,0.25)",xl:"inset 0 2px 0 rgba(255,255,255,1), 0 8px 24px rgba(10,132,255,0.35), 0 20px 48px rgba(90,200,250,0.3)"},spacing:X,typography:{fontFamily:"'Chakra Petch', -apple-system, sans-serif",headingFontFamily:"'Chakra Petch', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.01em",headingLetterSpacing:"-0.005em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #f0f7ff 0%, #d8e8f8 60%, #bcd6f0 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"lg",shadow:"lg",density:"normal",animation:"normal"}},ao={meta:{id:"vogueDidone",name:"Vogue Didone",tagline:"Didone serif, arctic whitespace, one red heartbeat.",tags:["light","editorial","serif","luxury"]},theme:{name:"Vogue Didone",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#000000",primaryHover:"#1a1a1a",success:"#1f6a3a",warning:"#8a6a1a",error:"#c40018",info:"#2a4068",accent:"#c40018",focus:"#c40018",surface:"#ffffff",surfaceHover:"#f7f7f7"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f2f2f2",hover:"#ededed",elevated:"#ffffff",inset:"#f5f5f5",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#2a2a2a",muted:"#808080",inverse:"#ffffff"},borders:{color:"#000000",width:"1px",divider:"#dcdcdc",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"0 1px 0 0 #000000",xl:"0 2px 0 0 #000000"},spacing:Ge,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:900,lineHeight:1.7,letterSpacing:"0.02em",headingLetterSpacing:"-0.03em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},no={meta:{id:"comicHalftone",name:"Comic Halftone",tagline:"CMYK pop — halftone dots, action type, offset ink shadows.",tags:["light","editorial","playful"]},theme:{name:"Comic Halftone",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#e8182c",primaryHover:"#c01020",success:"#1ea862",warning:"#f0c820",error:"#e8182c",info:"#1878c8",accent:"#1878c8",focus:"#e8182c",surface:"#fffdf4",surfaceHover:"#fff8d8"},backgrounds:{primary:"#fffef0",secondary:"#fff6b8",tertiary:"#ffe870",hover:"#ffd838",elevated:"#ffffff",inset:"#fff090",canvas:"#fffdec"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#fffef0"},borders:{color:"#0a0a0a",width:"3px",divider:"#0a0a0a",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #0a0a0a",md:"5px 5px 0 0 #0a0a0a",lg:"6px 6px 0 0 #e8182c, 10px 10px 0 0 #0a0a0a",xl:"8px 8px 0 0 #1878c8, 12px 12px 0 0 #0a0a0a"},spacing:X,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Bangers', 'Archivo Black', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2.125rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"0.03em"},transitions:{fast:"100ms cubic-bezier(0.34,1.56,0.64,1)",normal:"200ms cubic-bezier(0.34,1.56,0.64,1)",slow:"320ms cubic-bezier(0.34,1.56,0.64,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.5}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},so={meta:{id:"zinePunk",name:"Zine Punk",tagline:"Photocopier grain, marker headlines, cut-and-paste attitude.",tags:["light","editorial","experimental","brutalist"]},theme:{name:"Zine Punk",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#0a0a0a",primaryHover:"#000000",success:"#1a1a1a",warning:"#2a2a2a",error:"#0a0a0a",info:"#1a1a1a",accent:"#0a0a0a",focus:"#0a0a0a",surface:"#f5f3ee",surfaceHover:"#e8e4d8"},backgrounds:{primary:"#efece0",secondary:"#e3dfd0",tertiary:"#d4d0c0",hover:"#c8c4b4",elevated:"#f5f3ee",inset:"#e0dcc8",canvas:"#ede8d8"},text:{primary:"#0a0a0a",secondary:"#1a1a1a",muted:"#505050",inverse:"#efece0"},borders:{color:"#0a0a0a",width:"2px",divider:"#0a0a0a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"2px 3px 0 rgba(10,10,10,0.9)",md:"4px 6px 0 rgba(10,10,10,0.9), -2px 2px 0 rgba(10,10,10,0.3)",lg:"6px 10px 0 rgba(10,10,10,1), -4px 2px 0 rgba(10,10,10,0.4)",xl:"10px 14px 0 rgba(10,10,10,1)"},spacing:X,typography:{fontFamily:"'Special Elite', 'Courier Prime', monospace",headingFontFamily:"'Permanent Marker', 'Special Elite', cursive",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"20ms linear",normal:"60ms linear",slow:"120ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.3,blendMode:"multiply"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"none"}},oo={meta:{id:"watercolorWash",name:"Watercolor Wash",tagline:"Soft pastel bleeds, handwritten headings, paper gentleness.",tags:["light","artistic","pastel","organic"]},theme:{name:"Watercolor Wash",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#9d7bc4",primaryHover:"#8262ab",success:"#7bb88a",warning:"#e0a868",error:"#d47878",info:"#7ba8c4",accent:"#e0a0c0",focus:"#9d7bc4",surface:"rgba(255,250,245,0.8)",surfaceHover:"rgba(250,240,238,0.9)"},backgrounds:{primary:"#fdf8f4",secondary:"#f8eee6",tertiary:"#f0e0d4",hover:"#e8d2c0",elevated:"#ffffff",inset:"#f4e4d8",canvas:"#fdf8f4"},text:{primary:"#3a2845",secondary:"#6a5868",muted:"#a89ca4",inverse:"#fdf8f4"},borders:{color:"#e8d4c8",width:"1px",divider:"#f0e0d4",radiusSm:"10px",radiusMd:"18px",radiusLg:"30px",radiusXl:"44px",radiusFull:"9999px"},shadows:{sm:"0 2px 10px rgba(157,123,196,0.08)",md:"0 6px 24px rgba(157,123,196,0.12), 0 2px 4px rgba(224,160,192,0.06)",lg:"0 16px 40px rgba(157,123,196,0.18), 0 6px 12px rgba(224,160,192,0.1)",xl:"0 30px 64px rgba(157,123,196,0.22)"},spacing:Ee,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Caveat', 'Quicksand', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.005em"},transitions:{fast:"220ms cubic-bezier(0.22,1,0.36,1)",normal:"380ms cubic-bezier(0.22,1,0.36,1)",slow:"600ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 18% 22%, rgba(232,208,220,0.5) 0%, transparent 40%), radial-gradient(at 82% 28%, rgba(200,220,240,0.45) 0%, transparent 45%), radial-gradient(at 35% 80%, rgba(232,228,200,0.4) 0%, transparent 50%), linear-gradient(180deg, #fdf8f4 0%, #f8eee6 100%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},io={meta:{id:"memphis80s",name:"Memphis 80s",tagline:"Squiggle chaos — cyan, pink, yellow, serious typography, no.",tags:["light","artistic","playful"]},theme:{name:"Memphis 80s",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#f02080",primaryHover:"#c81868",success:"#28c868",warning:"#f8d820",error:"#f02040",info:"#20b8e8",accent:"#f8d820",focus:"#20b8e8",surface:"#fffffa",surfaceHover:"#fff7d0"},backgrounds:{primary:"#fffceb",secondary:"#fff2d0",tertiary:"#ffe8b4",hover:"#ffdd98",elevated:"#ffffff",inset:"#fff0c0",canvas:"#fffbe0"},text:{primary:"#0a0a1a",secondary:"#2a2a3a",muted:"#6a6a7a",inverse:"#fffceb"},borders:{color:"#0a0a1a",width:"2px",divider:"#0a0a1a",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #20b8e8",md:"4px 4px 0 0 #f02080, 8px 8px 0 0 #f8d820",lg:"5px 5px 0 0 #28c868, 10px 10px 0 0 #20b8e8, 15px 15px 0 0 #f02080",xl:"6px 6px 0 0 #f8d820, 12px 12px 0 0 #f02080, 18px 18px 0 0 #20b8e8"},spacing:X,typography:{fontFamily:"'Rubik', -apple-system, sans-serif",headingFontFamily:"'Rubik Mono One', 'Rubik', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms cubic-bezier(0.68,-0.55,0.27,1.55)",normal:"220ms cubic-bezier(0.68,-0.55,0.27,1.55)",slow:"360ms cubic-bezier(0.68,-0.55,0.27,1.55)"},backgroundImage:{type:"pattern",pattern:"zigzag",opacity:.3}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},co={meta:{id:"inkSumie",name:"Ink Sumi-e",tagline:"Charcoal brush on rice paper — vast silence, one red seal.",tags:["light","artistic","serif","minimal"]},theme:{name:"Ink Sumi-e",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2a4a2a",warning:"#705820",error:"#b82020",info:"#2a4060",accent:"#b82020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f7f3"},backgrounds:{primary:"#fdfcf7",secondary:"#f5f3eb",tertiary:"#ebe8dc",hover:"#dfdbcc",elevated:"#ffffff",inset:"#f0edde",canvas:"#fdfcf7"},text:{primary:"#1a1a1a",secondary:"#3a3a3a",muted:"#888482",inverse:"#fdfcf7"},borders:{color:"#1a1a1a",width:"1px",divider:"#d8d4c4",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"none",xl:"0 0 0 1px #1a1a1a"},spacing:Ge,typography:{fontFamily:"'Noto Sans JP', -apple-system, sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.85,letterSpacing:"0.04em",headingLetterSpacing:"0"},transitions:{fast:"200ms ease",normal:"340ms ease",slow:"520ms ease"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},lo={meta:{id:"dieterRams",name:"Dieter Rams",tagline:"Less-but-better — warm gray, single yellow dot, measured everything.",tags:["light","minimal","industrial"]},theme:{name:"Dieter Rams",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#1a1a1a",primaryHover:"#0a0a0a",success:"#3a7840",warning:"#e8c020",error:"#c83028",info:"#3868a0",accent:"#e8c020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f8f8"},backgrounds:{primary:"#fbfbf9",secondary:"#f2f2ee",tertiary:"#e8e8e2",hover:"#dedeD6",elevated:"#ffffff",inset:"#ededE7",canvas:"#f5f5f1"},text:{primary:"#0a0a0a",secondary:"#3a3a38",muted:"#888880",inverse:"#fbfbf9"},borders:{color:"#d4d4ce",width:"1px",divider:"#e0e0da",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 1px 0 0 rgba(0,0,0,0.04)",md:"0 1px 0 0 rgba(0,0,0,0.06), 0 4px 8px -2px rgba(0,0,0,0.06)",lg:"0 2px 0 0 rgba(0,0,0,0.08), 0 10px 20px -6px rgba(0,0,0,0.1)",xl:"0 20px 40px -12px rgba(0,0,0,0.14)"},spacing:Os,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"100ms cubic-bezier(0.4,0,0.2,1)",normal:"180ms cubic-bezier(0.4,0,0.2,1)",slow:"280ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"swiss",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},uo={meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black, hand-gilded detail, whispered serif elegance.",tags:["dark","luxury","serif"]},theme:{name:"Black Tie Gala",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#68a878",warning:"#e0b050",error:"#c85858",info:"#8aa8d0",accent:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1e1e1e",elevated:"#0e0e0e",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#605848",inverse:"#050505"},borders:{color:"#3a2e18",width:"1px",divider:"#241a0c",focusColor:"#c89848",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.1)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.15)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.25), inset 0 1px 0 rgba(232,208,160,0.08)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.35)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.65,letterSpacing:"0.05em",headingLetterSpacing:"0.08em"},transitions:{fast:"180ms cubic-bezier(0.4,0,0.2,1)",normal:"320ms cubic-bezier(0.4,0,0.2,1)",slow:"500ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"sm",shadow:"lg",density:"spacious",animation:"subtle"}},fo={meta:{id:"swissGrid",name:"Swiss Grid",tagline:"Akzidenz rigor — white, black, one red, grid discipline.",tags:["light","minimal","editorial"]},theme:{name:"Swiss Grid",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#e30613",primaryHover:"#b8040f",success:"#00683d",warning:"#b8700a",error:"#e30613",info:"#004c98",accent:"#e30613",focus:"#e30613",surface:"#ffffff",surfaceHover:"#f5f5f5"},backgrounds:{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#e0e0e0",elevated:"#ffffff",inset:"#f0f0f0",canvas:"#ffffff"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#ffffff"},borders:{color:"#0a0a0a",width:"1px",divider:"#d0d0d0",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(10,10,10,0.1)",lg:"0 2px 0 0 rgba(10,10,10,0.12)",xl:"0 4px 0 0 rgba(10,10,10,0.15)"},spacing:Os,typography:{fontFamily:"'Inter', 'Helvetica Neue', sans-serif",headingFontFamily:"'Inter', 'Helvetica Neue', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"-0.03em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"}},displayStyle:"swiss",variantConfig:{radius:"none",shadow:"none",density:"compact",animation:"subtle"}},Ht={forestCanopy:_s,desertDune:Ws,arcticCrystal:Vs,autumnFoliage:Xs,japaneseWashi:Us,moroccanMosaic:qs,artDecoGatsby:Gs,sovietConstructivist:Ks,blueprint:Js,hologramUI:Ys,deepSea:Qs,analog70s:Zs,vhsTracking:eo,typewriterPress:to,y2kAqua:ro,vogueDidone:ao,comicHalftone:no,zinePunk:so,watercolorWash:oo,memphis80s:io,inkSumie:co,dieterRams:lo,blackTieGala:uo,swissGrid:fo},mo=Object.values(Ht);function $d(e){return Ht[e]}function Bd(e){return mo.filter(t=>t.meta.tags.includes(e))}function jd(e,t){return e??t.recommendedDisplayStyle??"default"}function Jt(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function Yt(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=Jt(e),r=dt.find(a=>Jt(a.name)===t);if(r)return r;process.env.NODE_ENV!=="production"&&console.warn(`[@nice2dev/ui] <NiceThemeProvider theme="${e}"> — unknown preset name. Falling back to 'Light'. Available: ${dt.map(a=>a.name).join(", ")}.`)}return Dt}const po=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:s=!0,children:i})=>{const o=c.useMemo(()=>Yt(e),[e]),l=c.useMemo(()=>t===void 0?void 0:Yt(t),[t]),d=c.useId(),u=c.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=c.useRef(null),g=c.useRef(null),[h,m]=c.useState(null),[y,p]=c.useState(o),[v,b]=c.useState(!1),[S,w]=c.useState(()=>jd(n,o));c.useEffect(()=>{n!==void 0?w(n):o.recommendedDisplayStyle&&w(o.recommendedDisplayStyle)},[n,o.recommendedDisplayStyle]),c.useEffect(()=>{const E=window.matchMedia("(prefers-color-scheme: dark)");b(E.matches);const R=T=>b(T.matches);return E.addEventListener("change",R),()=>E.removeEventListener("change",R)},[]);const A=a??o.darkMode??"light",k=A==="dark"||A==="auto"&&v;c.useEffect(()=>{p(k&&l?l:o)},[o,l,k]),c.useEffect(()=>{if(typeof document>"u")return;const E=document.createElement("div");return E.className="nice-theme-scope nice-theme-portal-host",E.dataset.ntdProvider=u,E.style.display="contents",document.body.appendChild(E),g.current=E,m(E),()=>{E.parentNode&&E.parentNode.removeChild(E),g.current=null,m(null)}},[u]),c.useEffect(()=>{const E=f.current;if(!E)return;s&&(E.style.transition="background-color 300ms ease, color 300ms ease");const R=Pe(y);for(const[F,z]of Object.entries(R))E.style.setProperty(F,z);const T=g.current;if(T)for(const[F,z]of Object.entries(R))T.style.setProperty(F,z);E.style.colorScheme=k?"dark":"light",E.dataset.ntdColorScheme=k?"dark":"light",E.dataset.theme=k?"dark":"light",k?E.classList.add("nice-dark"):E.classList.remove("nice-dark"),T&&(T.style.colorScheme=k?"dark":"light",T.dataset.ntdColorScheme=k?"dark":"light",T.dataset.theme=k?"dark":"light",k?T.classList.add("nice-dark"):T.classList.remove("nice-dark"));const D=y.backgroundImage;return D&&D.type!=="none"&&D.type==="gradient"&&D.gradient&&E.style.setProperty("--ntd-bg-image",D.gradient),()=>{E&&Aa(E)}},[y,k,s,h]);const C=c.useRef(new Set);c.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const E=window.setTimeout(()=>{const R=Pe(y),T=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(H=>R[H])??Object.keys(R)[0];if(!T)return;const D=String(R[T]??"").trim();if(!D)return;const F=getComputedStyle(document.documentElement).getPropertyValue(T).trim();if(!F||F===D)return;const z=`${u}::${y.name??"unnamed"}::${T}`;C.current.has(z)||(C.current.add(z),console.warn(`[NiceThemeProvider] CSS var "${T}" on documentElement (${F}) does not match the active provider pack "${y.name??"unnamed"}" (${D}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`))},0);return()=>window.clearTimeout(E)},[y,u]),c.useEffect(()=>{const E=f.current;if(!E)return;const R=r?{...K,...r}:be(S);gt(R,E,u);const T=dr(S);for(const[D,F]of Object.entries(T))E.setAttribute(D,F);return()=>{cr(u,E)}},[r,S,u]);const M=c.useCallback(E=>{p(E)},[]),N=c.useMemo(()=>({theme:y,setTheme:M,portalTarget:h}),[y,M,h]),L=c.useMemo(()=>({displayStyle:S,variantConfig:be(S),setDisplayStyle:w}),[S]);return x.jsx(It.Provider,{value:N,children:x.jsx(Be.Provider,{value:L,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:i})})})};po.displayName="NiceThemeProvider";const go=c.createContext(null);function yo(){const e=c.useContext(go);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function Od({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,s]=c.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...K,...JSON.parse(d)}}catch{}}return{...K,...e}});c.useEffect(()=>{r&&typeof window<"u"&>(n)},[n,r]),c.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const i=c.useCallback(d=>{s(u=>({...u,...d}))},[]),o=c.useCallback(d=>{const u=$e[d];u&&s(u)},[]),l=c.useCallback(()=>{s(K)},[]);return x.jsx(go.Provider,{value:{config:n,setConfig:i,applyPreset:o,reset:l},children:a})}function _d({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:s}){const{config:i,setConfig:o,applyPreset:l,reset:d}=yo(),[u,f]=c.useState(new Set(["presets","radius","shadow"])),g=m=>{a&&f(y=>{const p=new Set(y);return p.has(m)?p.delete(m):p.add(m),p})},h=m=>!a||u.has(m);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...s},children:[e&&x.jsx(q,{title:"Presets",expanded:h("presets"),onToggle:()=>g("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys($e).map(m=>x.jsx("button",{onClick:()=>l(m),style:{padding:"6px 12px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:m},m)),x.jsx("button",{onClick:d,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer"},children:"Reset"})]})}),x.jsx(q,{title:"Border Radius",expanded:h("radius"),onToggle:()=>g("radius"),children:x.jsx(oe,{options:Object.keys(he),value:i.radius,onChange:m=>o({radius:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--color-accent, #6366f1)",borderRadius:he[m].md}})})}),x.jsx(q,{title:"Shadows",expanded:h("shadow"),onToggle:()=>g("shadow"),children:x.jsx(oe,{options:Object.keys(Ie),value:i.shadow,onChange:m=>o({shadow:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--bg-primary, #fff)",borderRadius:"4px",boxShadow:Ie[m]}})})}),x.jsx(q,{title:"Button Style",expanded:h("button"),onToggle:()=>g("button"),children:x.jsx(oe,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:m=>o({buttonStyle:m})})}),x.jsx(q,{title:"Input Style",expanded:h("input"),onToggle:()=>g("input"),children:x.jsx(oe,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:m=>o({inputStyle:m})})}),x.jsx(q,{title:"Card Style",expanded:h("card"),onToggle:()=>g("card"),children:x.jsx(oe,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:m=>o({cardStyle:m})})}),x.jsx(q,{title:"Animation",expanded:h("animation"),onToggle:()=>g("animation"),children:x.jsx(oe,{options:Object.keys(He),value:i.animation,onChange:m=>o({animation:m})})}),x.jsx(q,{title:"Density",expanded:h("density"),onToggle:()=>g("density"),children:x.jsx(oe,{options:Object.keys(ve),value:i.density,onChange:m=>o({density:m})})}),t&&x.jsx(q,{title:"Preview",expanded:h("preview"),onToggle:()=>g("preview"),children:x.jsx(Wd,{config:i})}),r&&x.jsx(q,{title:"Generated CSS",expanded:h("css"),onToggle:()=>g("css"),children:x.jsx("pre",{style:{background:"var(--text-primary, #1f2937)",color:"var(--border-color, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:pt(i)})})]})}function q({title:e,expanded:t,onToggle:r,children:a}){return x.jsxs("div",{style:{marginBottom:"16px"},children:[x.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 0",border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"var(--text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:"▶"}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function oe({options:e,value:t,onChange:r,renderPreview:a}){return x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:e.map(n=>x.jsxs("button",{onClick:()=>r(n),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",border:t===n?"2px solid var(--nice-info, #6366f1)":"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function Wd({config:e}){const t=ut(e.buttonStyle,"var(--color-accent, #6366f1)"),r=ft(e.inputStyle),a=mt(e.cardStyle),n=he[e.radius],s=ve[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:n.lg,...a},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:"Card Preview"}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,color:"var(--bg-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...t},children:"Primary"}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,background:"var(--border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:"Secondary"})]}),x.jsx("input",{type:"text",placeholder:"Input preview...",style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...r}})]}),x.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:["Info","Success","Warning","Error"].map(i=>x.jsx("span",{style:{padding:"4px 10px",borderRadius:n.full,background:"var(--border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function Vd(){const[e,t]=c.useState(()=>typeof window>"u"?!1:Ne());return c.useEffect(()=>{var s;if(typeof window>"u")return;t(Ne());const r=new MutationObserver(()=>t(Ne()));r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class","style"]});const a=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>t(Ne());return(s=a.addEventListener)==null||s.call(a,"change",n),()=>{var i;r.disconnect(),(i=a.removeEventListener)==null||i.call(a,"change",n)}},[]),e}function Ne(){var e;try{const t=document.documentElement,r=t.getAttribute("data-theme");if(r==="dark")return!0;if(r==="light")return!1;if(t.classList.contains("nice-dark")||t.classList.contains("dark"))return!0;if(t.classList.contains("nice-light"))return!1;const a=getComputedStyle(t),n=a.getPropertyValue("--text-primary").trim()||a.color;if(n){const s=n.match(/rgba?\(([^)]+)\)/);if(s){const[i,o,l]=s[1].split(",").map(d=>parseFloat(d.trim()));return(.299*i+.587*o+.114*l)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(n)){const i=n.replace("#",""),o=i.length===3?i.split("").map(f=>f+f).join(""):i.slice(0,6),l=parseInt(o.slice(0,2),16),d=parseInt(o.slice(2,4),16),u=parseInt(o.slice(4,6),16);return(.299*l+.587*d+.114*u)/255>.5}}return((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const Xd=["NiceTextInput","NiceTextArea","NiceNumberInput","NiceDatePicker","NiceSelect","NiceCheckbox","NiceToggle","NiceRadioGroup","NiceSlider","NiceColorPicker","NiceAutocomplete","NiceLookup","NiceCalendar","NiceDateRangeBox","NiceTagBox","NiceRangeSlider","NiceDropDownBox","NiceHtmlEditor","NiceForm","NiceRating","NiceOtpInput","NiceSignaturePad","NiceMentionInput","NiceTreeSelect","NiceMaskedInput","NiceKnob","NicePickList","NiceInlineEdit","NiceButton","NiceButtonGroup","NiceIconButton","NiceDropDownButton","NiceSpeedDialAction","NiceTable","NiceDataGrid","NiceList","NiceTreeView","NiceTreeList","NiceCardView","NiceTileView","NicePivotGrid","NiceKanbanBoard","NiceSpreadsheet","NiceBadge","NiceTag","NiceAvatar","NiceAvatarGroup","NiceProgress","NiceDivider","NiceTooltip","NiceSkeleton","NiceSpinner","NiceEmpty","NiceTimeline","NiceCarousel","NiceVirtualScroller","NiceAlert","NiceModal","NiceDrawer","NiceToastContainer","NiceConfirmDialog","NiceCookieConsent","NiceTabs","NiceAccordion","NiceBreadcrumb","NicePagination","NiceCard","NiceMenu","NiceContextMenu","NiceMultiView","NiceSplitter","NiceToolbar","NiceAppLayout","NiceBottomNavigation","NiceDashboardLayout","NiceDesktop","NiceConsole","NiceChart","NicePieChart","NicePolarChart","NiceCircularGauge","NiceLinearGauge","NiceBarGauge","NiceSparkline","NiceBullet","NiceFunnel","NiceSankey","NiceRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagram","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChat","NiceFileUploader","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function Ud(e){const t=[];ho(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return bo(e.root,r,t),t}function ho(e,t,r){if((!e.type||e.type.trim()==="")&&t.push(`${r}: type is empty`),e.children)for(let a=0;a<e.children.length;a++)ho(e.children[a],t,`${r}.children[${a}]`)}function bo(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const s=n.split(".")[0];!t.has(s)&&s!=="form"&&s!=="route"&&r.push(`Binding "${a}" references unknown data source "${s}"`)}if(e.children)for(const a of e.children)bo(a,t,r)}function qd(e,t){const r=Gd(t,e.field);switch(e.operator){case"eq":return r===e.value;case"neq":return r!==e.value;case"gt":return r>e.value;case"gte":return r>=e.value;case"lt":return r<e.value;case"lte":return r<=e.value;case"contains":return String(r).includes(String(e.value));case"empty":return r==null||String(r)==="";case"notEmpty":return r!=null&&String(r)!=="";default:return!0}}function Gd(e,t){const r=t.split(".");let a=e;for(const n of r)if(a&&typeof a=="object"&&n in a)a=a[n];else return;return a}function vo(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:s=0}=e,[i,o]=c.useState(s),[l,d]=c.useState(!1),u=c.useRef(),f=c.useMemo(()=>{if(typeof r=="number")return null;const k=new Array(t+1);k[0]=0;for(let C=0;C<t;C++)k[C+1]=k[C]+r(C);return k},[t,r]),g=c.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=c.useCallback(k=>typeof r=="number"?r:r(k),[r]),m=c.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),y=c.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,M=t-1;for(;C<=M;){const N=Math.floor((C+M)/2),L=f[N];if(L===k)return N;L<k?C=N+1:M=N-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:p,endIndex:v,visibleItems:b}=c.useMemo(()=>{const k=Math.max(0,y(i)-n);let C=k,M=m(k);for(;C<t&&M<i+a;)M+=h(C),C++;C=Math.min(t,C+n);const N=[];for(let L=k;L<C;L++)N.push({index:L,offset:m(L),height:h(L),key:L});return{startIndex:k,endIndex:C,visibleItems:N}},[i,a,t,n,y,m,h]),S=c.useCallback(k=>{const C=k.currentTarget;o(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=c.useCallback((k,C="start")=>{const M=m(k),N=h(k);let L;switch(C){case"center":L=M-a/2+N/2;break;case"end":L=M-a+N;break;default:L=M}o(Math.max(0,Math.min(L,g-a)))},[m,h,a,g]),A=c.useCallback(k=>{o(Math.max(0,Math.min(k,g-a)))},[g,a]);return c.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:b,totalHeight:g,scrollTop:i,scrollToIndex:w,scrollTo:A,onScroll:S,startIndex:p,endIndex:v,isScrolling:l}}function Kd(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:s,containerWidth:i,overscan:o=2}=e,[l,d]=c.useState(0),[u,f]=c.useState(0),[g,h]=c.useState(!1),m=c.useRef(),y=c.useMemo(()=>{if(typeof a=="number")return t*a;let S=0;for(let w=0;w<t;w++)S+=a(w);return S},[t,a]),p=c.useMemo(()=>{if(typeof n=="number")return r*n;let S=0;for(let w=0;w<r;w++)S+=n(w);return S},[r,n]),v=c.useMemo(()=>{const S=[];let w=0,A=0;if(typeof a=="number")w=Math.floor(l/a),A=w*a;else for(;w<t&&A+a(w)<l;)A+=a(w),w++;w=Math.max(0,w-o);let k=w,C=typeof a=="number"?w*a:A;for(;k<t&&C<l+s;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+o);let M=0,N=0;if(typeof n=="number")M=Math.floor(u/n),N=M*n;else for(;M<r&&N+n(M)<u;)N+=n(M),M++;M=Math.max(0,M-o);let L=M,E=typeof n=="number"?M*n:N;for(;L<r&&E<u+i;)E+=typeof n=="number"?n:n(L),L++;L=Math.min(r,L+o);let R=typeof a=="number"?w*a:(()=>{let T=0;for(let D=0;D<w;D++)T+=a(D);return T})();for(let T=w;T<k;T++){const D=typeof a=="number"?a:a(T);let F=typeof n=="number"?M*n:(()=>{let z=0;for(let H=0;H<M;H++)z+=n(H);return z})();for(let z=M;z<L;z++){const H=typeof n=="number"?n:n(z);S.push({rowIndex:T,columnIndex:z,top:R,left:F,width:H,height:D,key:`${T}:${z}`}),F+=H}R+=D}return S},[l,u,t,r,a,n,s,i,o]),b=c.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h(!1)},150)},[]);return c.useEffect(()=>()=>{m.current&&window.clearTimeout(m.current)},[]),{visibleCells:v,totalWidth:p,totalHeight:y,onScroll:b,scrollTop:l,scrollLeft:u,isScrolling:g}}function Jd(e,t,r,a=3){const n=vo({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),s=c.useCallback(i=>e[i.index],[e]);return{...n,getItemData:s,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:i=>({position:"absolute",top:i.offset,left:0,right:0,height:i.height})}}function Yd(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[s,i]=c.useState(""),o=c.useDeferredValue(s),[l,d]=c.useState(""),u=c.useRef();c.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(s)},a),()=>{u.current&&window.clearTimeout(u.current)};d(s)},[s,a]);const f=c.useDeferredValue(l),g=c.useMemo(()=>f.length<n?t:t.filter(m=>r(m,f)),[t,f,r,n]);return{query:s,setQuery:i,results:g,isStale:f!==o,deferredQuery:f}}function Qd(e){const[t,r]=c.useState(e),[a,n]=c.useState(e),[s,i]=c.useTransition(),o=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),i(()=>{r(u)})},[t]),l=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:s,setValue:o,setValueImmediate:l}}function Zd(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[s,i]=c.useState(null),[o,l]=c.useState(0),[d,u]=c.useState(!1),f=c.useRef(!1),g=c.useCallback(async()=>{if(t.length===0){i([]);return}u(!0),l(0),f.current=!1;const m=[],y=t.length;for(let p=0;p<y&&!f.current;p+=a){const v=t.slice(p,p+a),b=v.map((w,A)=>r(w,p+A));m.push(...b);const S=Math.min(100,(p+v.length)/y*100);n==="background"?await new Promise(w=>{"requestIdleCallback"in window?window.requestIdleCallback(w):setTimeout(w,0)}):n==="user-visible"&&await new Promise(w=>requestAnimationFrame(w)),c.startTransition(()=>{l(S)})}i(m),u(!1),l(100)},[t,r,a,n]),h=c.useCallback(()=>{f.current=!0},[]);return c.useEffect(()=>(g(),()=>{f.current=!0}),[g]),{result:s,progress:o,isProcessing:d,process:g,cancel:h}}function eu(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[s,i]=c.useState(Math.min(r,e.length)),[o,l]=c.useState(e.length<=r);return c.useEffect(()=>{if(s>=e.length){l(!0);return}const u=setTimeout(()=>{c.startTransition(()=>{i(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[s,e.length,a,n]),c.useEffect(()=>{i(Math.min(r,e.length)),l(e.length<=r)},[e,r]),{visibleItems:c.useMemo(()=>e.slice(0,s),[e,s]),visibleCount:s,totalCount:e.length,isComplete:o,progress:s/e.length*100}}function tu(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,s]=c.useState(t),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(t),f=c.useCallback(async h=>{u.current=n,d(null),s(h),o(!0);try{const m=await r(h);s(m)}catch(m){d(m instanceof Error?m:new Error(String(m))),a&&s(u.current)}finally{o(!1)}},[n,r,a]),g=c.useCallback(()=>{s(t),d(null),o(!1)},[t]);return{value:n,update:f,isPending:i,error:l,reset:g}}function ru(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=c.useState(null),[s,i]=c.useState(!1),[o,l]=c.useState(null),d=c.useRef(null),u=c.useRef(0),f=c.useRef(null),g=c.useRef(),h=c.useCallback(()=>{if(!d.current){if(typeof t=="function"){const b=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(b))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=b=>{const S=b.data;S.id===f.current&&(S.type==="result"?(n(S.result??null),i(!1),f.current=null,m()):S.type==="error"&&(l(new Error(S.error)),i(!1),f.current=null,m()))},d.current.onerror=b=>{l(new Error(b.message)),i(!1),f.current=null}}return d.current},[t]),m=c.useCallback(()=>{g.current&&window.clearTimeout(g.current),r>0&&(g.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]),y=c.useCallback(b=>new Promise((S,w)=>{const A=h(),k=`task-${++u.current}`;f.current=k,i(!0),l(null);const C=A.onmessage;A.onmessage=M=>{C==null||C.call(A,M),M.data.id===k&&(M.data.type==="result"?S(M.data.result):M.data.type==="error"&&w(new Error(M.data.error)))},A.postMessage({type:"task",id:k,data:b})}),[h]),p=c.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,i(!1))},[]),v=c.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),g.current&&window.clearTimeout(g.current),f.current=null,i(!1)},[]);return c.useEffect(()=>()=>{v()},[v]),{result:a,isProcessing:s,error:o,execute:y,cancel:p,terminate:v}}function au(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=c.useRef([]),s=c.useRef([]),i=c.useRef(0),o=c.useRef(),l=c.useCallback(()=>{if(typeof t=="function"){const p=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(p))}return new Worker(t,{type:"module"})},[t]),d=c.useCallback(()=>{const p=n.current.find(v=>!v.busy);if(p)return p;if(n.current.length<r){const b={worker:l(),busy:!1,taskId:null};return n.current.push(b),b}return null},[l,r]),u=c.useCallback(()=>{for(;s.current.length>0;){const p=d();if(!p)break;const v=s.current.shift();p.busy=!0,p.taskId=v.id,p.worker.onmessage=b=>{const S=b.data;S.id===v.id&&(p.busy=!1,p.taskId=null,S.type==="result"?v.resolve(S.result):S.type==="error"&&v.reject(new Error(S.error)),u(),f())},p.worker.onerror=b=>{p.busy=!1,p.taskId=null,v.reject(new Error(b.message)),u()},p.worker.postMessage({type:"task",id:v.id,data:v.data})}},[d]),f=c.useCallback(()=>{o.current&&window.clearTimeout(o.current),a>0&&(o.current=window.setTimeout(()=>{n.current.filter(v=>!v.busy).forEach(v=>{v.worker.terminate(),n.current=n.current.filter(b=>b!==v)})},a))},[a]),g=c.useCallback(p=>new Promise((v,b)=>{const S=`pool-task-${++i.current}`;s.current.push({id:S,data:p,resolve:v,reject:b}),u()}),[u]),h=c.useCallback(p=>Promise.all(p.map(v=>g(v))),[g]),m=c.useCallback(()=>{n.current.forEach(p=>p.worker.terminate()),n.current=[],s.current=[],o.current&&window.clearTimeout(o.current)},[]),y=c.useCallback(()=>({total:n.current.length,busy:n.current.filter(p=>p.busy).length,idle:n.current.filter(p=>!p.busy).length,queued:s.current.length}),[]);return c.useEffect(()=>()=>{m()},[m]),{execute:g,executeAll:h,terminateAll:m,getStats:y}}function nu(e){const t=`
|
|
122
|
+
HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return l?l[1].trim():o.content.trim()}finally{r(!1)}},[e]);return{improveText:a,translate:n,generateHtml:s,isLoading:t}}class Xe{constructor(){this._listeners=new Map}on(t,r){return this._listeners.has(t)||this._listeners.set(t,new Set),this._listeners.get(t).add(r),()=>{var a;(a=this._listeners.get(t))==null||a.delete(r)}}emit(t,...r){var a;(a=this._listeners.get(t))==null||a.forEach(n=>{try{n(...r)}catch{}})}}function Pl(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"notcontains":return!String(r??"").toLowerCase().includes(String(a??"").toLowerCase());case"startswith":return String(r??"").toLowerCase().startsWith(String(a??"").toLowerCase());case"endswith":return String(r??"").toLowerCase().endsWith(String(a??"").toLowerCase());case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";default:return!0}}function fa(e,t){if(t.items.length===0)return!0;const r=a=>a.type==="condition"?Pl(e,a):fa(e,a);return t.logic==="and"?t.items.every(r):t.items.some(r)}function Fl(e,t){var n;let r=[...e];if(t.filter&&(r=r.filter(s=>fa(s,t.filter))),t.search){const s=t.search.toLowerCase(),i=t.searchFields;r=r.filter(o=>(i?i.map(d=>o[d]):Object.values(o)).some(d=>String(d??"").toLowerCase().includes(s)))}const a=r.length;if((n=t.sort)!=null&&n.length&&r.sort((s,i)=>{for(const o of t.sort){const l=s[o.field]??"",d=i[o.field]??"",u=typeof l=="number"&&typeof d=="number"?l-d:String(l).localeCompare(String(d));if(u!==0)return o.direction==="desc"?-u:u}return 0}),t.skip!=null||t.take!=null){const s=t.skip??0,i=t.take??r.length;r=r.slice(s,s+i)}return{data:r,totalCount:a}}function Hl(e){const t=e.keyField??"id";let r=[...e.data];const a=new Xe;return{keyField:t,writable:!0,async load(s={}){a.emit("loading",!0);try{const i=Fl(r,s);return a.emit("loaded",i),a.emit("loading",!1),i}catch(i){throw a.emit("error",i instanceof Error?i:new Error(String(i))),a.emit("loading",!1),i}},async byKey(s){return r.find(i=>i[t]===s)},async insert(s){const i={...s};return r=[...r,i],a.emit("changed"),i},async update(s,i){const o=r.findIndex(d=>d[t]===s);if(o===-1)throw new Error(`Record not found: ${s}`);const l={...r[o],...i};return r=r.map((d,u)=>u===o?l:d),a.emit("changed"),l},async remove(s){r=r.filter(i=>i[t]!==s),a.emit("changed")},on:a.on.bind(a)}}async function $l(e){const t={"Content-Type":"application/json"};if(!e.headers)return t;const r=typeof e.headers=="function"?await e.headers():e.headers;return{...t,...r}}function Ye(e,t,r){return typeof e=="function"?e(r):e||`${t}/${encodeURIComponent(String(r))}`}function jl(e){var r,a,n;const t={};return e.skip!=null&&(t.skip=String(e.skip)),e.take!=null&&(t.take=String(e.take)),e.search&&(t.search=e.search),(r=e.sort)!=null&&r.length&&(t.sort=e.sort.map(s=>`${s.field} ${s.direction}`).join(",")),e.filter&&(t.filter=JSON.stringify(e.filter)),(a=e.select)!=null&&a.length&&(t.select=e.select.join(",")),(n=e.expand)!=null&&n.length&&(t.expand=e.expand.join(",")),t}function Bl(e){if(Array.isArray(e))return{data:e,totalCount:e.length};const t=e,r=t.data??t.items??t.value??t.results??[],a=t.totalCount??t.total??t.count??t["@odata.count"]??r.length;return{data:r,totalCount:a}}function ma(e){const t=e.keyField??"id",r=new Xe;async function a(s,i){const o=await $l(e),l=await fetch(s,{...e.fetchOptions,...i,headers:{...o,...i==null?void 0:i.headers}});if(!l.ok){const u=await l.text().catch(()=>l.statusText);throw new Error(`HTTP ${l.status}: ${u}`)}return(l.headers.get("content-type")??"").includes("json")?l.json():l.text()}return{keyField:t,writable:!0,async load(s={}){var i;r.emit("loading",!0);try{const o=e.loadUrl??e.url,l=e.mapLoadParams?e.mapLoadParams(s):jl(s),d=new URLSearchParams(l).toString(),u=d?`${o}?${d}`:o,f=await a(u),p=e.extractLoadResult?e.extractLoadResult(f):Bl(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(o){const l=o instanceof Error?o:new Error(String(o));throw r.emit("error",l),r.emit("loading",!1),(i=e.onError)==null||i.call(e,l,"load"),l}},async byKey(s){const i=Ye(e.byKeyUrl,e.url,s),o=await a(i);return e.extractItem?e.extractItem(o):o},async insert(s){const i=e.insertUrl??e.url,o=e.prepareInsertBody?e.prepareInsertBody(s):s,l=await a(i,{method:"POST",body:JSON.stringify(o)}),d=e.extractItem?e.extractItem(l):l;return r.emit("changed"),d},async update(s,i){const o=Ye(e.updateUrl,e.url,s),l=e.prepareUpdateBody?e.prepareUpdateBody(s,i):i,d=await a(o,{method:e.updateMethod??"PUT",body:JSON.stringify(l)}),u=e.extractItem?e.extractItem(d):d;return r.emit("changed"),u},async remove(s){const i=Ye(e.deleteUrl,e.url,s);await a(i,{method:"DELETE"}),r.emit("changed")},on:r.on.bind(r)}}function Ol(e,t){const r=e.field,a=typeof e.value=="string"?`'${e.value.replace(/'/g,"''")}'`:String(e.value??"null");switch(e.operator){case"=":return`${r} eq ${a}`;case"<>":return`${r} ne ${a}`;case"<":return`${r} lt ${a}`;case"<=":return`${r} le ${a}`;case">":return`${r} gt ${a}`;case">=":return`${r} ge ${a}`;case"contains":return t>=4?`contains(${r},${a})`:`substringof(${a},${r})`;case"notcontains":return t>=4?`not contains(${r},${a})`:`not substringof(${a},${r})`;case"startswith":return`startswith(${r},${a})`;case"endswith":return`endswith(${r},${a})`;case"isblank":return`${r} eq null`;case"isnotblank":return`${r} ne null`;default:return"true"}}function pa(e,t){return e.items.length===0?"":e.items.map(a=>a.type==="condition"?Ol(a,t):`(${pa(a,t)})`).join(e.logic==="and"?" and ":" or ")}function _l(e){const t=e.version??4,r={url:e.url,keyField:e.keyField,headers:e.headers,fetchOptions:e.fetchOptions,onError:e.onError,updateMethod:"PATCH",mapLoadParams(a){var s,i,o;const n={};if(t>=4&&(n.$count="true"),a.skip!=null&&(n.$skip=String(a.skip)),a.take!=null&&(n.$top=String(a.take)),(s=a.sort)!=null&&s.length&&(n.$orderby=a.sort.map(l=>`${l.field} ${l.direction}`).join(",")),a.filter){const l=pa(a.filter,t);l&&(n.$filter=l)}return a.search&&(n.$search=`"${a.search}"`),(i=a.select)!=null&&i.length&&(n.$select=a.select.join(",")),(o=a.expand)!=null&&o.length&&(n.$expand=a.expand.join(",")),n},extractLoadResult(a){var o,l;const n=a,s=n.value??((o=n.d)==null?void 0:o.results)??[],i=n["@odata.count"]??((l=n.d)==null?void 0:l.__count)??s.length;return{data:s,totalCount:i}},byKeyUrl:a=>{const n=typeof a=="number"?a:`'${String(a).replace(/'/g,"''")}'`;return`${e.url}(${n})`}};return ma(r)}function Wl(e){const t=e.keyField??"id",r=new Xe;async function a(l,d){var m;const u={"Content-Type":"application/json"},f=e.headers?typeof e.headers=="function"?await e.headers():e.headers:{},p=await fetch(e.url,{method:"POST",headers:{...u,...f},body:JSON.stringify({query:l,variables:d})});if(!p.ok){const y=await p.text().catch(()=>p.statusText);throw new Error(`GraphQL HTTP ${p.status}: ${y}`)}const h=await p.json();if((m=h.errors)!=null&&m.length)throw new Error(h.errors.map(y=>y.message).join("; "));return h.data}function n(l){var u;const d={};return l.skip!=null&&(d.skip=l.skip),l.take!=null&&(d.take=l.take),l.search&&(d.search=l.search),(u=l.sort)!=null&&u.length&&(d.sort=l.sort),l.filter&&(d.filter=l.filter),d}function s(l){if(!l||typeof l!="object")return{data:[],totalCount:0};const d=Object.values(l)[0];if(!d)return{data:[],totalCount:0};if(Array.isArray(d))return{data:d,totalCount:d.length};const u=d.items??d.nodes??d.edges??d.data??[],f=d.totalCount??d.total??d.count??u.length;return{data:u,totalCount:f}}function i(l){return!l||typeof l!="object"?l:Object.values(l)[0]}return{keyField:t,writable:!!(e.queries.insert||e.queries.update||e.queries.remove),async load(l={}){var d;r.emit("loading",!0);try{const u=e.mapVariables?e.mapVariables(l):n(l),f=await a(e.queries.load,u),p=e.extractLoadResult?e.extractLoadResult(f):s(f);return r.emit("loaded",p),r.emit("loading",!1),p}catch(u){const f=u instanceof Error?u:new Error(String(u));throw r.emit("error",f),r.emit("loading",!1),(d=e.onError)==null||d.call(e,f,"load"),f}},async byKey(l){if(!e.queries.byKey)throw new Error("byKey query not configured");const d=await a(e.queries.byKey,{[t]:l});return e.extractItem?e.extractItem(d):i(d)},insert:e.queries.insert?async l=>{const d=await a(e.queries.insert,{input:l}),u=e.extractItem?e.extractItem(d):i(d);return r.emit("changed"),u}:void 0,update:e.queries.update?async(l,d)=>{const u=await a(e.queries.update,{[t]:l,input:d}),f=e.extractItem?e.extractItem(u):i(u);return r.emit("changed"),f}:void 0,remove:e.queries.remove?async l=>{await a(e.queries.remove,{[t]:l}),r.emit("changed")}:void 0,on:r.on.bind(r)}}function Vl(e){const t=e.keyField??"id",r=new Xe;return{keyField:t,writable:!!(e.insert||e.update||e.remove),async load(n={}){r.emit("loading",!0);try{const s=await e.load(n);return r.emit("loaded",s),r.emit("loading",!1),s}catch(s){const i=s instanceof Error?s:new Error(String(s));throw r.emit("error",i),r.emit("loading",!1),i}},async byKey(n){if(!e.byKey)throw new Error("byKey handler not configured");return e.byKey(n)},insert:e.insert?async n=>{const s=await e.insert(n);return r.emit("changed"),s}:void 0,update:e.update?async(n,s)=>{const i=await e.update(n,s);return r.emit("changed"),i}:void 0,remove:e.remove?async n=>{await e.remove(n),r.emit("changed")}:void 0,on:r.on.bind(r)}}function ga(e){return/^[A-Za-z_][A-Za-z0-9_.]*$/.test(e)?e:`"${e.replace(/"/g,'""')}"`}function Xl(e,t={}){const r=[],a=t.placeholder??(()=>"?"),n=t.quoteField??ga,s=l=>(r.push(l),a(r.length-1)),i=l=>{const d=n(l.field);switch(l.operator){case"=":case"<>":case"<":case"<=":case">":case">=":return`${d} ${l.operator} ${s(l.value)}`;case"contains":return`${d} LIKE ${s(`%${String(l.value)}%`)}`;case"notcontains":return`${d} NOT LIKE ${s(`%${String(l.value)}%`)}`;case"startswith":return`${d} LIKE ${s(`${String(l.value)}%`)}`;case"endswith":return`${d} LIKE ${s(`%${String(l.value)}`)}`;case"between":{const u=Array.isArray(l.value)?l.value:[l.value,l.value];return`${d} BETWEEN ${s(u[0])} AND ${s(u[1])}`}case"isblank":return`(${d} IS NULL OR ${d} = ${s("")})`;case"isnotblank":return`(${d} IS NOT NULL AND ${d} <> ${s("")})`;case"in":{const u=Array.isArray(l.value)?l.value:[l.value];return u.length?`${d} IN (${u.map(s).join(", ")})`:"1 = 0"}default:return`${d} = ${s(l.value)}`}},o=l=>{const d=[];for(const u of l.items)if(u.type==="group"){const f=o(u);f&&d.push(`(${f})`)}else d.push(i(u));return d.join(l.logic==="or"?" OR ":" AND ")};return{sql:o(e),params:r}}function Ul(e,t={}){const r=t.quoteField??ga;return e.filter(a=>a.field).map(a=>`${r(a.field)} ${a.direction==="desc"?"DESC":"ASC"}`).join(", ")}function ee(e){return String(e??"").toLowerCase()}function ya(e,t){const r=e[t.field],a=t.value;switch(t.operator){case"=":return r==a;case"<>":return r!=a;case"<":return r<a;case"<=":return r<=a;case">":return r>a;case">=":return r>=a;case"contains":return ee(r).includes(ee(a));case"notcontains":return!ee(r).includes(ee(a));case"startswith":return ee(r).startsWith(ee(a));case"endswith":return ee(r).endsWith(ee(a));case"between":{const n=Array.isArray(a)?a:[a,a];return r>=n[0]&&r<=n[1]}case"isblank":return r==null||r==="";case"isnotblank":return r!=null&&r!=="";case"in":return(Array.isArray(a)?a:[a]).some(s=>r==s);default:return!0}}function Nt(e,t){if(!t.items.length)return!0;const r=a=>a.type==="condition"?ya(e,a):Nt(e,a);return t.logic==="or"?t.items.some(r):t.items.every(r)}function Gt(e){return e==null||e===""}const ql=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Gl(e){const t=String(e);try{return new URL(t),!0}catch{return/^https?:\/\/[^\s]+$/.test(t)}}function W(e){return typeof e=="number"?e:parseFloat(String(e))}function ha(e){const t=e.field;switch(e.op){case"required":return`${t} is required`;case"minLength":return`${t} must be at least ${e.value} characters`;case"maxLength":return`${t} must be at most ${e.value} characters`;case"min":return`${t} must be ≥ ${e.value}`;case"max":return`${t} must be ≤ ${e.value}`;case"pattern":return`${t} has an invalid format`;case"email":return`${t} must be a valid email`;case"url":return`${t} must be a valid URL`;case"equals":return`${t} must equal ${e.value}`;case"notEquals":return`${t} must not equal ${e.value}`;case"greaterThan":return`${t} must be greater than ${e.value}`;case"lessThan":return`${t} must be less than ${e.value}`;case"matchesField":return`${t} must match ${e.compareField}`;case"greaterThanField":return`${t} must be greater than ${e.compareField}`;case"lessThanField":return`${t} must be less than ${e.compareField}`;default:return`${t} is invalid`}}function ba(e,t){const r=t[e.field];if(e.op==="required")return!Gt(r);if(Gt(r))return!0;const a=e.compareField!=null?t[e.compareField]:void 0;switch(e.op){case"minLength":return String(r).length>=W(e.value);case"maxLength":return String(r).length<=W(e.value);case"min":return W(r)>=W(e.value);case"max":return W(r)<=W(e.value);case"pattern":try{return new RegExp(String(e.value)).test(String(r))}catch{return!0}case"email":return ql.test(String(r));case"url":return Gl(r);case"equals":return r===e.value;case"notEquals":return r!==e.value;case"greaterThan":return W(r)>W(e.value);case"lessThan":return W(r)<W(e.value);case"matchesField":return r===a;case"greaterThanField":return W(r)>W(a);case"lessThanField":return W(r)<W(a);case"custom":return e.validate?e.validate(r,t):!0;default:return!0}}function va(e,t){const r=[];for(const a of e??[])a.when&&!Nt(t,a.when)||ba(a,t)||r.push({field:a.field,message:a.message??ha(a),severity:a.severity??"error",ruleId:a.id});return r}function Kl(e,t){return va(e,t).every(r=>r.severity!=="error")}class at{constructor(t={}){this.cache=new Map,this.ttl=t.ttl??6e4,this.maxSize=t.maxSize??100}get(t){const r=this.cache.get(t);if(r){if(Date.now()>r.expiresAt){this.cache.delete(t);return}return this.cache.delete(t),this.cache.set(t,r),r.data}}set(t,r,a){if(this.cache.size>=this.maxSize){const n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(t,{data:r,timestamp:Date.now(),expiresAt:Date.now()+(a??this.ttl)})}has(t){return this.get(t)!==void 0}invalidate(t){this.cache.delete(t)}invalidateAll(){this.cache.clear()}invalidateMatching(t){for(const r of this.cache.keys())t.test(r)&&this.cache.delete(r)}}class Sa{constructor(){this.pending=new Map}async dedupe(t,r){const a=this.pending.get(t);if(a)return a;const n=r().finally(()=>{this.pending.delete(t)});return this.pending.set(t,n),n}hasPending(t){return this.pending.has(t)}cancelAll(){this.pending.clear()}}function Jl(e,t={}){const r=new at(t),a=new at(t),n=new Sa,s=t.generateKey??(l=>JSON.stringify(l)),i=t.cacheLoads!==!1,o=t.cacheByKey!==!1;return{...e,cache:r,async load(l={}){const d=`load:${s(l)}`;if(i){const u=r.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.load(l);return i&&r.set(d,u),u})},async byKey(l){const d=`byKey:${String(l)}`;if(o){const u=a.get(d);if(u)return u}return n.dedupe(d,async()=>{const u=await e.byKey(l);return o&&u&&a.set(d,u),u})},async insert(l){const d=await e.insert(l);return r.invalidateAll(),d},async update(l,d){const u=await e.update(l,d);return r.invalidateAll(),a.invalidate(`byKey:${String(l)}`),u},async remove(l){await e.remove(l),r.invalidateAll(),a.invalidate(`byKey:${String(l)}`)},invalidateCache(){r.invalidateAll(),a.invalidateAll()}}}function Yl(e,t){const{cursorField:r,pageSize:a=20,direction:n="asc"}=t;return{async loadPage(s={}){var g;const i=s.pageSize??a,o=s.direction??"forward",l=s.cursor?{type:"condition",field:r,operator:o==="forward"?n==="asc"?">":"<":n==="asc"?"<":">",value:Ql(s.cursor)}:null,d=l?{type:"group",logic:"and",items:[...((g=s.filter)==null?void 0:g.items)??[],l]}:s.filter,u=[{field:r,direction:o==="forward"?n:n==="asc"?"desc":"asc"},...s.sort??[]],f=await e.load({...s,filter:d,sort:u,take:i+1}),p=f.data.length>i,h=p?f.data.slice(0,i):f.data;o==="backward"&&h.reverse();const m=h[h.length-1],y=h[0];return{data:h,nextCursor:p&&m?Qe(m[r]):null,prevCursor:y&&s.cursor?Qe(y[r]):null,hasMore:p}},async*loadAll(s={}){let i=null;do{const o=await e.load({...s,...i?{cursor:i}:{}});if(o.data.length===0)break;yield o.data;const l=o.data[o.data.length-1];i=l?Qe(l[r]):null}while(i)}}}function Qe(e){return btoa(JSON.stringify(e))}function Ql(e){try{return JSON.parse(atob(e))}catch{return e}}function Zl(e,t={}){const{pageSize:r=50,threshold:a=200,initialPage:n=0}=t;let s={items:[],isLoading:!1,hasMore:!0,error:null,page:n,totalCount:0};const i=new Set;function o(){i.forEach(h=>h(s))}function l(h){s={...s,...h},o()}let d={};async function u(){if(!(s.isLoading||!s.hasMore)){l({isLoading:!0,error:null});try{const h=await e.load({...d,skip:s.page*r,take:r}),m=[...s.items,...h.data],y=m.length<h.totalCount;l({items:m,page:s.page+1,totalCount:h.totalCount,hasMore:y,isLoading:!1})}catch(h){l({error:h instanceof Error?h:new Error(String(h)),isLoading:!1})}}}function f(h={}){d=h,s={items:[],isLoading:!1,hasMore:!0,error:null,page:0,totalCount:0},o()}function p(h){const m=h.target;if(!m)return;m.scrollHeight-m.scrollTop-m.clientHeight<a&&u()}return{get state(){return s},loadMore:u,reset:f,handleScroll:p,subscribe(h){return i.add(h),()=>i.delete(h)},setOptions(h){d=h}}}function ed(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,heartbeatInterval:i=3e4}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(k,...C){var M;(M=f.get(k))==null||M.forEach(N=>N(...C))}function h(k){if(e.parseMessage)return e.parseMessage(k);try{return JSON.parse(k.data)}catch{return null}}function m(k){return e.serializeMessage?e.serializeMessage(k):JSON.stringify(k)}function y(k){switch(k.type){case"insert":k.data&&(u=[...u,k.data],p("changed"));break;case"update":k.key&&k.changes&&(u=u.map(C=>C[a]===k.key?{...C,...k.changes}:C),p("changed"));break;case"remove":k.key&&(u=u.filter(C=>C[a]!==k.key),p("changed"));break;case"refresh":case"sync":A.load().catch(()=>{});break}}function g(){(o==null?void 0:o.readyState)!==WebSocket.OPEN&&(o=new WebSocket(t),o.onopen=()=>{l=0,p("connected"),b()},o.onmessage=k=>{const C=h(k);C&&(y(C),p("message",C))},o.onerror=k=>{p("error",new Error("WebSocket error"))},o.onclose=()=>{S(),p("disconnected"),l<s&&(l++,setTimeout(g,n*Math.min(l,5)))})}function v(){S(),o&&(o.close(),o=null)}function b(){S(),d=window.setInterval(()=>{(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(JSON.stringify({type:"ping"}))},i)}function S(){d&&(clearInterval(d),d=null)}function w(k){(o==null?void 0:o.readyState)===WebSocket.OPEN&&o.send(m(k))}const A={keyField:a,writable:r.writable,async load(k={}){p("loading",!0);try{const C=await r.load(k);return u=C.data,p("loaded",C),p("loading",!1),C}catch(C){throw p("error",C),p("loading",!1),C}},async byKey(k){const C=u.find(M=>M[a]===k);return C||r.byKey(k)},async insert(k){const C=await r.insert(k);return w({type:"insert",data:C}),C},async update(k,C){const M=await r.update(k,C);return w({type:"update",key:k,changes:C}),M},async remove(k){await r.remove(k),w({type:"remove",key:k})},on(k,C){return f.has(k)||f.set(k,new Set),f.get(k).add(C),()=>{var M;return(M=f.get(k))==null?void 0:M.delete(C)}},connect:g,disconnect:v,isConnected:()=>(o==null?void 0:o.readyState)===WebSocket.OPEN,sendMessage:w};return A}function td(e){const{connection:t,baseSource:r}=e,a={onInsert:"OnInsert",onUpdate:"OnUpdate",onRemove:"OnRemove",onRefresh:"OnRefresh",insert:"Insert",update:"Update",remove:"Remove",...e.methods},n=r.keyField;let s=[];const i=new Map;function o(f,...p){var h;(h=i.get(f))==null||h.forEach(m=>m(...p))}const l=f=>{s=[...s,f],o("changed")},d=(f,p)=>{s=s.map(h=>h[n]===f?{...h,...p}:h),o("changed")},u=f=>{s=s.filter(p=>p[n]!==f),o("changed")};return{keyField:n,writable:r.writable,async load(f={}){o("loading",!0);try{const p=await r.load(f);return s=p.data,o("loaded",p),o("loading",!1),p}catch(p){throw o("error",p),o("loading",!1),p}},async byKey(f){const p=s.find(h=>h[n]===f);return p||r.byKey(f)},async insert(f){return await t.invoke(a.insert,f)},async update(f,p){return await t.invoke(a.update,f,p)},async remove(f){await t.invoke(a.remove,f)},on(f,p){return i.has(f)||i.set(f,new Set),i.get(f).add(p),()=>{var h;return(h=i.get(f))==null?void 0:h.delete(p)}},async connect(){t.on(a.onInsert,l),t.on(a.onUpdate,d),t.on(a.onRemove,u),t.on(a.onRefresh,()=>this.load()),await t.start()},async disconnect(){t.off(a.onInsert,l),t.off(a.onUpdate,d),t.off(a.onRemove,u),t.off(a.onRefresh,()=>{}),await t.stop()}}}function rd(e,t={}){const r=e.keyField;let a=[];const n=new Map;let s=0;const i=new Map;function o(d,...u){var f;(f=i.get(d))==null||f.forEach(p=>p(...u))}function l(){return`op_${++s}_${Date.now()}`}return{keyField:r,writable:!0,async load(d={}){const u=await e.load(d);return a=u.data,u},async byKey(d){return a.find(u=>u[r]===d)??e.byKey(d)},async insert(d){var p,h,m;const u=l(),f={...d};a=[...a,f],n.set(u,{id:u,action:"insert",item:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"insert"),o("changed");try{const y=await e.insert(d);return a=a.map(g=>g===f?y:g),n.delete(u),(h=t.onConfirm)==null||h.call(t,y,"insert"),o("changed"),y}catch(y){throw a=a.filter(g=>g!==f),n.delete(u),(m=t.onRollback)==null||m.call(t,f,"insert",y instanceof Error?y:new Error(String(y))),o("changed"),y}},async update(d,u){var y,g,v;const f=l(),p=a.findIndex(b=>b[r]===d);if(p===-1)return e.update(d,u);const h=a[p],m={...h,...u};a=a.map((b,S)=>S===p?m:b),n.set(f,{id:f,action:"update",key:d,originalItem:h}),(y=t.onOptimisticApply)==null||y.call(t,m,"update"),o("changed");try{const b=await e.update(d,u);return a=a.map((S,w)=>w===p?b:S),n.delete(f),(g=t.onConfirm)==null||g.call(t,b,"update"),o("changed"),b}catch(b){throw a=a.map((S,w)=>w===p?h:S),n.delete(f),(v=t.onRollback)==null||v.call(t,h,"update",b instanceof Error?b:new Error(String(b))),o("changed"),b}},async remove(d){var p,h,m;const u=l(),f=a.find(y=>y[r]===d);if(!f)return e.remove(d);a=a.filter(y=>y!==f),n.set(u,{id:u,action:"remove",key:d,originalItem:f}),(p=t.onOptimisticApply)==null||p.call(t,f,"remove"),o("changed");try{await e.remove(d),n.delete(u),(h=t.onConfirm)==null||h.call(t,f,"remove")}catch(y){throw a=[...a,f],n.delete(u),(m=t.onRollback)==null||m.call(t,f,"remove",y instanceof Error?y:new Error(String(y))),o("changed"),y}},on(d,u){return i.has(d)||i.set(d,new Set),i.get(d).add(u),()=>{var f;return(f=i.get(d))==null?void 0:f.delete(u)}},hasPendingChanges:()=>n.size>0,getPendingCount:()=>n.size}}function xa(e,t,r){const a=new Map(e.map(d=>[d[r],d])),n=new Map(t.map(d=>[d[r],d])),s=[],i=[],o=[],l=[];for(const[d,u]of n){const f=a.get(d);if(!f)s.push(u);else if(wa(f,u))l.push(u);else{const p={};for(const h of Object.keys(u))f[h]!==u[h]&&(p[h]=u[h]);i.push({key:d,changes:p,oldItem:f,newItem:u})}}for(const[d,u]of a)n.has(d)||o.push(u);return{inserted:s,updated:i,removed:o,unchanged:l}}function wa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e===null||t===null||typeof e!="object")return e===t;const r=e,a=t,n=new Set([...Object.keys(r),...Object.keys(a)]);for(const s of n)if(!wa(r[s],a[s]))return!1;return!0}function ad(e,t={}){const{interval:r=5e3,autoStart:a=!1,pauseWhenHidden:n=!0,onDataChange:s}=t;let i=r,o=null,l=[],d={};const u=new Map;function f(g,...v){var b;(b=u.get(g))==null||b.forEach(S=>S(...v))}async function p(){if(!(n&&document.hidden))try{const g=await e.load(d),v=xa(l,g.data,e.keyField);(v.inserted.length||v.updated.length||v.removed.length)&&(l=g.data,f("changed"),s==null||s(v))}catch{}}function h(){o||(o=window.setInterval(p,i))}function m(){o&&(clearInterval(o),o=null)}n&&document.addEventListener("visibilitychange",()=>{document.hidden||o&&p()});const y={...e,async load(g={}){d=g;const v=await e.load(g);return l=v.data,v},on(g,v){u.has(g)||u.set(g,new Set),u.get(g).add(v);const b=e.on(g,v);return()=>{var S;(S=u.get(g))==null||S.delete(v),b()}},startPolling:h,stopPolling:m,isPolling:()=>o!==null,setInterval(g){i=g,o&&(m(),h())}};return a&&h(),y}function nd(e){const{url:t,baseSource:r,keyField:a=r.keyField,reconnectDelay:n=3e3,maxReconnects:s=10,withCredentials:i=!1}=e;let o=null,l=0,d=null,u=[];const f=new Map;function p(b,...S){var w;(w=f.get(b))==null||w.forEach(A=>A(...S))}function h(b){if(e.parseEvent)return e.parseEvent(b);try{return JSON.parse(b.data)}catch{return null}}function m(b){switch(b.type){case"insert":b.data&&(u=[...u,b.data],p("changed"));break;case"update":b.key&&b.changes&&(u=u.map(S=>S[a]===b.key?{...S,...b.changes}:S),p("changed"));break;case"remove":b.key&&(u=u.filter(S=>S[a]!==b.key),p("changed"));break;case"snapshot":Array.isArray(b.data)&&(u=b.data,p("changed"));break;case"refresh":v.load().catch(()=>{});break}}function y(){(o==null?void 0:o.readyState)!==EventSource.OPEN&&(g(),o=new EventSource(t,{withCredentials:i}),o.onopen=()=>{l=0,p("connected")},o.onmessage=b=>{const S=h(b);S&&(m(S),p("message",S))},o.onerror=()=>{if(p("error",new Error("SSE connection error")),(o==null?void 0:o.readyState)===EventSource.CLOSED&&(p("disconnected"),o=null,l<s)){l++;const b=n*Math.min(l,5);d=setTimeout(y,b)}})}function g(){d&&(clearTimeout(d),d=null),o&&(o.close(),o=null)}const v={keyField:a,writable:r.writable,async load(b={}){p("loading",!0);try{const S=await r.load(b);return u=S.data,p("loaded",S),p("loading",!1),S}catch(S){throw p("error",S),p("loading",!1),S}},async byKey(b){const S=u.find(w=>w[a]===b);return S||r.byKey(b)},async insert(b){return r.insert(b)},async update(b,S){return r.update(b,S)},async remove(b){return r.remove(b)},on(b,S){return f.has(b)||f.set(b,new Set),f.get(b).add(S),()=>{var w;return(w=f.get(b))==null?void 0:w.delete(S)}},connect:y,disconnect:g,isConnected:()=>(o==null?void 0:o.readyState)===EventSource.OPEN};return v}function re(e,t){const r={};for(const a of t){const n=e.map(i=>i[a.field]).filter(i=>i!=null),s=a.alias??`${a.fn}_${a.field}`;switch(a.fn){case"sum":r[s]=n.reduce((i,o)=>Number(i)+Number(o),0);break;case"avg":r[s]=n.length?n.reduce((i,o)=>Number(i)+Number(o),0)/n.length:0;break;case"min":r[s]=n.length?Math.min(...n.map(Number)):null;break;case"max":r[s]=n.length?Math.max(...n.map(Number)):null;break;case"count":r[s]=n.length;break;case"first":r[s]=n[0]??null;break;case"last":r[s]=n[n.length-1]??null;break;case"distinct":r[s]=[...new Set(n)];break}}return r}function Lt(e,t){const{groupBy:r,aggregates:a=[],includeItems:n=!1,sortGroups:s}=t;if(r.length===0)return[{key:{},count:e.length,aggregates:re(e,a),items:n?e:void 0}];const i=new Map;for(const l of e){const d={};for(const f of r)d[f]=l[f];const u=JSON.stringify(d);i.has(u)||i.set(u,{key:d,items:[]}),i.get(u).items.push(l)}const o=[];for(const[,l]of i)o.push({key:l.key,count:l.items.length,aggregates:re(l.items,a),items:n?l.items:void 0});return s!=null&&s.length&&o.sort((l,d)=>{for(const u of s){const f=l.key[u.field]??l.aggregates[u.field],p=d.key[u.field]??d.aggregates[u.field],h=typeof f=="number"&&typeof p=="number"?f-p:String(f??"").localeCompare(String(p??""));if(h!==0)return u.direction==="desc"?-h:h}return 0}),o}function ka(e,t,r=[]){if(t.length===0)return[{key:{},count:e.length,aggregates:re(e,r),items:e}];const[a,...n]=t,s=Lt(e,{groupBy:[a],aggregates:r,includeItems:!0});if(n.length>0)for(const i of s)i.groups=ka(i.items,n,r),delete i.items;return s}function sd(e,t){const{rows:r,columns:a,values:n,aggregateFunction:s="sum",rowTotals:i=!0,columnTotals:o=!0,grandTotal:l=!0}=t,d=[...new Set(e.map(m=>String(m[a])))].sort(),u=Lt(e,{groupBy:r,includeItems:!0}),f=[];for(const m of u){const y={rowKey:m.key,values:{}};for(const g of d){const v=m.items.filter(S=>String(S[a])===g),b=re(v,[{field:n,fn:s}]);y.values[g]=b[`${s}_${n}`]??null}if(i){const g=re(m.items,[{field:n,fn:s}]);y.rowTotal=g[`${s}_${n}`]}f.push(y)}let p;if(o){p={};for(const m of d){const y=e.filter(v=>String(v[a])===m),g=re(y,[{field:n,fn:s}]);p[m]=g[`${s}_${n}`]}}let h;return l&&(h=re(e,[{field:n,fn:s}])[`${s}_${n}`]),{columnHeaders:d,rows:f,columnTotals:p,grandTotal:h}}function od(e,t){return e.map((r,a)=>{const n={...r};for(const s of t)n[s.name]=s.formula(r,a,e);return n})}const id={runningSum:e=>(t,r,a)=>a.slice(0,r+1).reduce((n,s)=>n+Number(s[e]??0),0),runningAvg:e=>(t,r,a)=>{const n=a.slice(0,r+1);return n.reduce((s,i)=>s+Number(i[e]??0),0)/n.length},percentOfTotal:e=>(t,r,a)=>{const n=a.reduce((s,i)=>s+Number(i[e]??0),0);return n?Number(t[e]??0)/n*100:0},rank:(e,t="desc")=>(r,a,n)=>[...n].sort((i,o)=>{const l=Number(i[e]??0)-Number(o[e]??0);return t==="desc"?-l:l}).findIndex(i=>i===r)+1,diffFromPrevious:e=>(t,r,a)=>r===0?null:Number(t[e]??0)-Number(a[r-1][e]??0),percentChange:e=>(t,r,a)=>{if(r===0)return null;const n=Number(a[r-1][e]??0);return n===0?null:(Number(t[e]??0)-n)/n*100},movingAverage:(e,t)=>(r,a,n)=>{const s=Math.max(0,a-t+1),i=n.slice(s,a+1);return i.reduce((o,l)=>o+Number(l[e]??0),0)/i.length},conditional:(e,t,r)=>a=>e(a)?t:r,concat:(...e)=>t=>e.map(r=>t[r]??"").join(" "),formatDate:(e,t="medium")=>r=>{const a=r[e];return a?new Date(a).toLocaleDateString(void 0,{dateStyle:t}):""}};function cd(e,t){const r=[],a=new Map,n=new Map;for(let o=0;o<e.length;o++){const l=e[o];for(const d of t)if(!d.validate(l,o,e)){const u=typeof d.message=="function"?d.message(l):d.message,f={index:o,rule:d.name,message:u,severity:d.severity??"error",fields:d.fields??[],item:l};r.push(f),a.has(o)||a.set(o,[]),a.get(o).push(f);for(const p of f.fields)n.has(p)||n.set(p,[]),n.get(p).push(f)}}const s=r.filter(o=>o.severity==="error").length,i=r.filter(o=>o.severity==="warning").length;return{isValid:s===0,errorCount:s,warningCount:i,errors:r,byIndex:a,byField:n}}const ld={required:e=>({name:`required_${String(e)}`,validate:t=>t[e]!=null&&t[e]!=="",message:`${String(e)} is required`,fields:[String(e)]}),minLength:(e,t)=>({name:`minLength_${String(e)}`,validate:r=>String(r[e]??"").length>=t,message:`${String(e)} must be at least ${t} characters`,fields:[String(e)]}),maxLength:(e,t)=>({name:`maxLength_${String(e)}`,validate:r=>String(r[e]??"").length<=t,message:`${String(e)} must be at most ${t} characters`,fields:[String(e)]}),min:(e,t)=>({name:`min_${String(e)}`,validate:r=>Number(r[e])>=t,message:`${String(e)} must be at least ${t}`,fields:[String(e)]}),max:(e,t)=>({name:`max_${String(e)}`,validate:r=>Number(r[e])<=t,message:`${String(e)} must be at most ${t}`,fields:[String(e)]}),email:e=>({name:`email_${String(e)}`,validate:t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t[e]??"")),message:`${String(e)} must be a valid email`,fields:[String(e)]}),pattern:(e,t,r)=>({name:`pattern_${String(e)}`,validate:a=>t.test(String(a[e]??"")),message:r??`${String(e)} has invalid format`,fields:[String(e)]}),unique:e=>({name:`unique_${String(e)}`,validate:(t,r,a)=>{const n=t[e];return a.findIndex(s=>s[e]===n)===r},message:`${String(e)} must be unique`,fields:[String(e)]}),custom:(e,t,r,a)=>({name:e,validate:t,message:r,fields:a})},dd={async updateWhere(e,t,r){return e.map(a=>{if(!t(a))return a;const n=typeof r=="function"?r(a):r;return{...a,...n}})},async removeWhere(e,t){const r=[],a=[];for(const n of e)t(n)?a.push(n):r.push(n);return{remaining:r,removed:a}},async transform(e,t,r={}){const{parallel:a=!1,batchSize:n=10}=r,s=[],i=[];let o=0;if(a)for(let l=0;l<e.length;l+=n){const d=e.slice(l,l+n),u=await Promise.allSettled(d.map((f,p)=>t(f,l+p)));for(let f=0;f<u.length;f++){const p=u[f];p.status==="fulfilled"?(s.push(p.value),o++):i.push({index:l+f,item:d[f],error:p.reason})}}else for(let l=0;l<e.length;l++)try{const d=await t(e[l],l);s.push(d),o++}catch(d){i.push({index:l,item:e[l],error:d instanceof Error?d:new Error(String(d))})}return{succeeded:o,failed:i.length,errors:i,results:s}},deduplicate(e,t){const r=new Set;return e.filter(a=>{const n=a[t];return r.has(n)?!1:(r.add(n),!0)})},merge(e,t,r,a={}){const{updateExisting:n=!0,addNew:s=!0}=a,i=new Map(e.map(l=>[l[r],l])),o=[...e];for(const l of t){const d=l[r],u=i.get(d);if(u){if(n){const f=o.indexOf(u);o[f]={...u,...l}}}else s&&o.push(l)}return o}};function ud(e,t){const r=(t==null?void 0:t.autoLoad)??!0,a=(t==null?void 0:t.defaultPageSize)??20,[n,s]=c.useState([]),[i,o]=c.useState(0),[l,d]=c.useState(!1),[u,f]=c.useState(null),[p,h]=c.useState(1),[m,y]=c.useState(a),[g,v]=c.useState((t==null?void 0:t.defaultSort)??[]),[b,S]=c.useState(t==null?void 0:t.defaultFilter),[w,A]=c.useState((t==null?void 0:t.defaultSearch)??""),k=c.useRef(0),C=t==null?void 0:t.loadOptions,M=c.useCallback(async()=>{if(!e)return;const z=++k.current;d(!0),f(null);try{const H=await e.load({skip:(p-1)*m,take:m,sort:g.length?g:void 0,filter:b,search:w||void 0,...C});if(z!==k.current)return;s(H.data),o(H.totalCount)}catch(H){if(z!==k.current)return;f(H instanceof Error?H.message:String(H))}finally{z===k.current&&d(!1)}},[e,p,m,g,b,w,C]);c.useEffect(()=>{r&&M()},[M,r]),c.useEffect(()=>{if(e)return e.on("changed",()=>{M()})},[e,M]);const N=c.useCallback((z,H)=>{v([{field:z,direction:H}]),h(1)},[]),L=c.useCallback(z=>{S(z),h(1)},[]),E=c.useCallback(z=>{A(z),h(1)},[]),R=c.useCallback(z=>{y(z),h(1)},[]),T=c.useCallback(async z=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(z)},[e]),D=c.useCallback(async(z,H)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(z,H)},[e]),F=c.useCallback(async z=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(z)},[e]);return{data:n,totalCount:i,loading:l,error:u,page:p,pageSize:m,sort:g,filter:b,search:w,setPage:h,setPageSize:R,setSort:v,setSortField:N,setFilter:L,setSearch:E,reload:M,insert:T,update:D,remove:F}}function Ma(e,t){const[r,a]=c.useState(void 0),[n,s]=c.useState({}),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(0),f=c.useCallback(async()=>{if(!e||t==null){a(void 0);return}const b=++u.current;o(!0),d(null);try{const S=await e.byKey(t);if(b!==u.current)return;a(S),s({})}catch(S){if(b!==u.current)return;d(S instanceof Error?S.message:String(S))}finally{b===u.current&&o(!1)}},[e,t]);c.useEffect(()=>{f()},[f]),c.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const p=c.useMemo(()=>({...r??{},...n}),[r,n]),h=Object.keys(n).length>0,m=c.useCallback((b,S)=>{s(w=>({...w,[b]:S}))},[]),y=c.useCallback(b=>{s(S=>({...S,...b}))},[]),g=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");h&&await e.update(t,n)},[e,t,n,h]),v=c.useCallback(()=>{s({})},[]);return{data:r,editData:p,loading:i,error:l,changes:n,isDirty:h,set:m,setMany:y,save:g,reload:f,reset:v}}function fd(e,t,r){const a=Ma(e,t),n=a.editData[r],s=c.useCallback(o=>{a.set(r,o)},[a,r]),i=c.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");const o={[r]:a.editData[r]};await e.update(t,o)},[e,t,r,a.editData]);return{value:n,setValue:s,loading:a.loading,error:a.error,isDirty:r in a.changes,save:i}}function md(e,t,r,a){const n=(a==null?void 0:a.autoLoad)??!0,s=(a==null?void 0:a.take)??200,[i,o]=c.useState([]),[l,d]=c.useState(!1),[u,f]=c.useState(null),p=c.useRef(0),h=c.useCallback(async g=>{if(!e)return;const v=++p.current;d(!0),f(null);try{const b=await e.load({take:s,search:g||void 0,searchFields:a==null?void 0:a.searchFields});if(v!==p.current)return;o(b.data)}catch(b){if(v!==p.current)return;f(b instanceof Error?b.message:String(b))}finally{v===p.current&&d(!1)}},[e,s,a==null?void 0:a.searchFields]);c.useEffect(()=>{n&&h()},[h,n]);const m=c.useMemo(()=>i.map(g=>{const v=g,b={value:String(v[t]??""),label:String(v[r]??"")};return a!=null&&a.iconField&&v[a.iconField]!=null&&(b.icon=v[a.iconField]),a!=null&&a.descriptionField&&v[a.descriptionField]!=null&&(b.description=String(v[a.descriptionField])),a!=null&&a.groupField&&v[a.groupField]!=null&&(b.group=String(v[a.groupField])),b}),[i,t,r,a==null?void 0:a.iconField,a==null?void 0:a.descriptionField,a==null?void 0:a.groupField]),y=c.useCallback(g=>{h(g)},[h]);return{options:m,loading:l,error:u,search:y,reload:()=>h()}}function nt(e){const{dbName:t,storeName:r,keyField:a="id",version:n=1,indexes:s=[]}=e;let i=null;const o=new Map;function l(m,...y){var g;(g=o.get(m))==null||g.forEach(v=>v(...y))}async function d(){return i||new Promise((m,y)=>{const g=indexedDB.open(t,n);g.onerror=()=>y(g.error),g.onsuccess=()=>{i=g.result,m(i)},g.onupgradeneeded=v=>{const b=v.target.result;if(!b.objectStoreNames.contains(r)){const S=b.createObjectStore(r,{keyPath:a});for(const w of s)S.createIndex(w.name,w.keyPath,{unique:w.unique??!1})}}})}async function u(m,y){const g=await d();return new Promise((v,b)=>{const w=g.transaction(r,m).objectStore(r),A=y(w);A.onsuccess=()=>v(A.result),A.onerror=()=>b(A.error)})}async function f(m,y,g){const v=await d();return new Promise((b,S)=>{var D;const A=v.transaction(r,m).objectStore(r),k=[];let C=A,M="next";if((D=y.sort)!=null&&D.length){const F=y.sort[0].field,z=y.sort[0].direction;A.indexNames.contains(F)&&(C=A.index(F)),M=z==="desc"?"prev":"next"}const N=C.openCursor(null,M);let L=0,E=0;const R=y.skip??0,T=y.take??1/0;N.onsuccess=()=>{const F=N.result;if(!F||E>=T){b(k);return}const z=F.value;if(y.filter&&!p(z,y.filter)){F.continue();return}if(y.search&&!h(z,y.search,y.searchFields)){F.continue();return}if(L<R){L++,F.continue();return}k.push(z),E++,F.continue()},N.onerror=()=>S(N.error)})}function p(m,y){if(!y.items.length)return!0;const g=v=>{if(v.type==="group")return p(m,v);const b=m[v.field],S=v.value;switch(v.operator){case"=":return b==S;case"<>":return b!=S;case"<":return b<S;case"<=":return b<=S;case">":return b>S;case">=":return b>=S;case"contains":return String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"notcontains":return!String(b??"").toLowerCase().includes(String(S??"").toLowerCase());case"startswith":return String(b??"").toLowerCase().startsWith(String(S??"").toLowerCase());case"endswith":return String(b??"").toLowerCase().endsWith(String(S??"").toLowerCase());case"isblank":return b==null||b==="";case"isnotblank":return b!=null&&b!=="";default:return!0}};return y.logic==="and"?y.items.every(g):y.items.some(g)}function h(m,y,g){const v=y.toLowerCase();return(g?g.map(S=>m[S]):Object.values(m)).some(S=>String(S??"").toLowerCase().includes(v))}return{keyField:a,writable:!0,async load(m={}){var y;l("loading",!0);try{const g=await f("readonly",m,()=>{});(y=m.sort)!=null&&y.length&&g.sort((S,w)=>{for(const A of m.sort){const k=S[A.field]??"",C=w[A.field]??"",M=typeof k=="number"&&typeof C=="number"?k-C:String(k).localeCompare(String(C));if(M!==0)return A.direction==="desc"?-M:M}return 0});const v=await this.count(),b={data:g,totalCount:v};return l("loaded",b),l("loading",!1),b}catch(g){throw l("error",g),l("loading",!1),g}},async byKey(m){return u("readonly",y=>y.get(m))},async insert(m){return await u("readwrite",y=>y.add(m)),l("changed"),m},async update(m,y){const g=await this.byKey(m);if(!g)throw new Error(`Record not found: ${m}`);const v={...g,...y};return await u("readwrite",b=>b.put(v)),l("changed"),v},async remove(m){await u("readwrite",y=>y.delete(m)),l("changed")},on(m,y){return o.has(m)||o.set(m,new Set),o.get(m).add(y),()=>{var g;return(g=o.get(m))==null?void 0:g.delete(y)}},async clear(){await u("readwrite",m=>m.clear()),l("changed")},async count(){return u("readonly",m=>m.count())},async getAll(){return u("readonly",m=>m.getAll())},async bulkInsert(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.put(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async bulkDelete(m){const y=await d();return new Promise((g,v)=>{const b=y.transaction(r,"readwrite"),S=b.objectStore(r);for(const w of m)S.delete(w);b.oncomplete=()=>{l("changed"),g()},b.onerror=()=>v(b.error)})},async exportData(){return this.getAll()},async importData(m){await this.clear(),await this.bulkInsert(m)}}}function pd(e){const{remoteSource:t,offlineConfig:r,syncStrategy:a="remote-first",onConflict:n,onSync:s,autoSyncInterval:i=0}=e,o=r.keyField??t.keyField,l=nt({...r,keyField:o}),d=nt({dbName:r.dbName,storeName:`${r.storeName}_pending`,keyField:"id"});let u=navigator.onLine,f=0;const p=new Map;function h(g,...v){var b;(b=p.get(g))==null||b.forEach(S=>S(...v))}window.addEventListener("online",()=>{u=!0,h("online"),y()}),window.addEventListener("offline",()=>{u=!1,h("offline")});async function m(g,v,b){const S={id:`pending_${++f}_${Date.now()}`,action:g,key:v,data:b,timestamp:Date.now(),retries:0};await d.insert(S)}async function y(){if(u){h("syncing",!0);try{let g=0,v=0,b=0;const S=await d.load();for(const w of S.data)try{switch(w.action){case"insert":await t.insert(w.data),g++;break;case"update":await t.update(w.key,w.data),v++;break;case"remove":await t.remove(w.key),b++;break}await d.remove(w.id)}catch{w.retries<3&&await d.update(w.id,{retries:w.retries+1})}if(a!=="local-first"){const w=await t.load();if(a==="remote-first")await l.importData(w.data);else if(a==="merge"&&n){const A=await l.load(),k=new Map(A.data.map(M=>[M[o],M])),C=[];for(const M of w.data){const N=k.get(M[o]);N?C.push(n(N,M)):C.push(M)}await l.importData(C)}}h("synced",{added:g,updated:v,removed:b}),s==null||s({added:g,updated:v,removed:b})}catch(g){h("syncError",g)}finally{h("syncing",!1)}}}return i>0&&window.setInterval(y,i),{keyField:o,writable:!0,async load(g={}){if(u&&a==="remote-first")try{const v=await t.load(g);return await l.bulkInsert(v.data),v}catch{}return l.load(g)},async byKey(g){if(u)try{const v=await t.byKey(g);return v&&await l.update(g,v).catch(()=>l.insert(v)),v}catch{}return l.byKey(g)},async insert(g){const v=await l.insert(g);if(u)try{return await t.insert(g)}catch{await m("insert",void 0,g)}else await m("insert",void 0,g);return h("changed"),v},async update(g,v){const b=await l.update(g,v);if(u)try{return await t.update(g,v)}catch{await m("update",g,v)}else await m("update",g,v);return h("changed"),b},async remove(g){if(await l.remove(g),u)try{await t.remove(g)}catch{await m("remove",g)}else await m("remove",g);h("changed")},on(g,v){return p.has(g)||p.set(g,new Set),p.get(g).add(v),()=>{var b;return(b=p.get(g))==null?void 0:b.delete(v)}},sync:y,isOnline:()=>u,async getPendingChanges(){return(await d.load()).data},async clearPendingChanges(){await d.clear()}}}function gd(e){const{channelName:t,source:r}=e,a=new BroadcastChannel(t),n=new Map;function s(o,...l){var d;(d=n.get(o))==null||d.forEach(u=>u(...l))}a.onmessage=o=>{const l=o.data;switch(l.type){case"insert":case"update":case"remove":s("changed"),s("crossTabChange",l);break;case"refresh":s("refresh");break;case"request-sync":r.load().then(d=>{a.postMessage({type:"sync-data",data:d.data})});break}};function i(o){a.postMessage(o)}return{...r,async insert(o){const l=await r.insert(o);return i({type:"insert",data:l}),l},async update(o,l){const d=await r.update(o,l);return i({type:"update",key:o,changes:l}),d},async remove(o){await r.remove(o),i({type:"remove",key:o})},on(o,l){n.has(o)||n.set(o,new Set),n.get(o).add(l);const d=r.on(o,l);return()=>{var u;(u=n.get(o))==null||u.delete(l),d()}},broadcast:i,requestSync(){i({type:"request-sync"})}}}function yd(e={}){const{prefix:t="",persist:r={filter:!0,sort:!0,page:!0,search:!0},useHash:a=!1}=e;function n(){return a?new URLSearchParams(window.location.hash.slice(1)):new URLSearchParams(window.location.search)}function s(o){if(a)window.location.hash=o.toString();else{const l=new URL(window.location.href);l.search=o.toString(),window.history.replaceState({},"",l.toString())}}function i(o){return t?`${t}_${o}`:o}return{read(){const o=n(),l={};if(r.filter){const d=o.get(i("filter"));if(d)try{l.filter=JSON.parse(d)}catch{}}if(r.sort){const d=o.get(i("sort"));if(d)try{l.sort=JSON.parse(d)}catch{}}if(r.page){const d=o.get(i("skip")),u=o.get(i("take"));d&&(l.skip=parseInt(d,10)),u&&(l.take=parseInt(u,10))}if(r.search){const d=o.get(i("search"));d&&(l.search=d)}return l},write(o){const l=n();r.filter&&(o.filter&&o.filter.items.length>0?l.set(i("filter"),JSON.stringify(o.filter)):l.delete(i("filter"))),r.sort&&(o.sort&&o.sort.length>0?l.set(i("sort"),JSON.stringify(o.sort)):l.delete(i("sort"))),r.page&&(o.skip?l.set(i("skip"),String(o.skip)):l.delete(i("skip")),o.take?l.set(i("take"),String(o.take)):l.delete(i("take"))),r.search&&(o.search?l.set(i("search"),o.search):l.delete(i("search"))),s(l)},clear(){const o=n();o.delete(i("filter")),o.delete(i("sort")),o.delete(i("skip")),o.delete(i("take")),o.delete(i("search")),s(o)},toLoadOptions(){const o=this.read();return{filter:o.filter,sort:o.sort,skip:o.skip,take:o.take,search:o.search}}}}const hd={async exportToJSON(e,t){const r=await e.load(),a={version:"1.0",timestamp:Date.now(),data:r.data,metadata:t};return JSON.stringify(a,null,2)},async importFromJSON(e,t,r={}){const n=JSON.parse(t).data;let s=0,i=0;r.replace&&"clear"in e&&await e.clear();for(const o of n){if(r.validate&&!r.validate(o)){i++;continue}try{await e.insert(o),s++}catch{i++}}return{imported:s,skipped:i}},async downloadAsJSON(e,t="export.json"){const r=await this.exportToJSON(e),a=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)},async importFromFile(e,t,r){const a=await t.text();return this.importFromJSON(e,a,r)}};function bd(e="nice_user_prefs"){let t=null;function r(){if(t)return t;try{const n=localStorage.getItem(e);t=n?JSON.parse(n):{}}catch{t={}}return t}function a(n){t=n,localStorage.setItem(e,JSON.stringify(n))}return{get(n,s){return r()[n]??s},set(n,s){const i=r();i[n]=s,a(i)},remove(n){const s=r();delete s[n],a(s)},getAll(){return{...r()}},setAll(n){a(n)},clear(){t={},localStorage.removeItem(e)},merge(n){a({...r(),...n})}}}const Ca={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function vd(e,t){return t.split(".").reduce((r,a)=>{if(r&&typeof r=="object")return r[a]},e)}function De(e){var r;const t={};for(const[a,n]of Object.entries(Ca)){const s=vd(e,a);s!==void 0&&(t[n]=String(s))}if(e.nesting)for(const a of["sidebar","menu","tree"]){const n=e.nesting[a];if(!n)continue;const s=e.backgrounds.secondary||e.backgrounds.primary||"#ffffff",i=((r=e.text)==null?void 0:r.primary)||"#111111";Object.assign(t,Rd(a,n,s,i))}return t}function Sd(e,t){const r=t??document.documentElement,a=De(e);for(const[n,s]of Object.entries(a))r.style.setProperty(n,s);wd(e.backgroundImage,r),e.darkMode&&(r.dataset.ntdColorScheme=e.darkMode)}const xd={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function wd(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const r=xd[e.pattern];if(r){const a=`url("data:image/svg+xml,${encodeURIComponent(r)}")`;t.style.setProperty("--ntd-bg-image",a),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function Aa(e){const t=e??document.documentElement;for(const r of Object.values(Ca))t.style.removeProperty(r);for(const r of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(r);delete t.dataset.ntdColorScheme,delete t.dataset.theme,t.classList.remove("nice-dark");for(const r of["sidebar","menu","tree"]){t.style.removeProperty(`--nice-${r}-levels`);for(let a=1;a<=10;a++)t.style.removeProperty(`--nice-${r}-level-${a}-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-text`),t.style.removeProperty(`--nice-${r}-level-${a}-hover-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-active-bg`),t.style.removeProperty(`--nice-${r}-level-${a}-border`)}}function kd(e){const t=e??document.documentElement,r=getComputedStyle(t),a=i=>r.getPropertyValue(i).trim(),n=i=>parseFloat(r.getPropertyValue(i))||0,s=i=>a(i)||void 0;return{name:"Current",colors:{primary:a("--color-primary"),primaryHover:a("--color-primary-hover"),success:a("--color-success"),warning:a("--color-warning"),error:a("--color-error"),info:a("--color-info"),accent:s("--color-accent"),accentHover:s("--color-accent-hover"),link:s("--color-link"),linkHover:s("--color-link-hover"),focus:s("--color-focus"),overlay:s("--color-overlay"),surface:s("--color-surface"),surfaceHover:s("--color-surface-hover"),disabled:s("--color-disabled"),disabledText:s("--color-disabled-text")},backgrounds:{primary:a("--bg-primary"),secondary:a("--bg-secondary"),tertiary:a("--bg-tertiary"),hover:a("--hover-bg"),elevated:s("--bg-elevated"),inset:s("--bg-inset"),canvas:s("--bg-canvas")},text:{primary:a("--text-primary"),secondary:a("--text-secondary"),muted:a("--text-muted"),inverse:s("--text-inverse"),onPrimary:s("--text-on-primary"),onAccent:s("--text-on-accent")},borders:{color:a("--border-color"),radiusSm:a("--nice-radius-sm"),radiusMd:a("--nice-radius-md"),radiusLg:a("--nice-radius-lg"),radiusXl:a("--nice-radius-xl"),radiusFull:a("--nice-radius-full"),width:s("--border-width"),focusColor:s("--border-focus-color"),divider:s("--border-divider")},shadows:{sm:a("--shadow-sm"),md:a("--shadow-md"),lg:a("--shadow-lg"),xl:a("--shadow-xl"),inner:s("--shadow-inner"),glow:s("--shadow-glow")},spacing:{space1:a("--nice-space-1"),space2:a("--nice-space-2"),space3:a("--nice-space-3"),space4:a("--nice-space-4"),space5:a("--nice-space-5"),space6:a("--nice-space-6"),space8:a("--nice-space-8"),space10:s("--nice-space-10"),space12:s("--nice-space-12"),space16:s("--nice-space-16")},typography:{fontFamily:a("--nice-font-family"),fontSizeXs:a("--nice-font-size-xs"),fontSizeSm:a("--nice-font-size-sm"),fontSizeMd:a("--nice-font-size-md"),fontSizeLg:a("--nice-font-size-lg"),fontSizeXl:a("--nice-font-size-xl"),fontWeightNormal:n("--nice-font-weight-normal"),fontWeightMedium:n("--nice-font-weight-medium"),fontWeightSemibold:n("--nice-font-weight-semibold"),fontWeightBold:n("--nice-font-weight-bold"),lineHeight:n("--nice-line-height"),headingFontFamily:s("--nice-heading-font-family"),monoFontFamily:s("--nice-mono-font-family"),fontSize2xl:s("--nice-font-size-2xl"),fontSize3xl:s("--nice-font-size-3xl"),letterSpacing:s("--nice-letter-spacing"),headingLetterSpacing:s("--nice-heading-letter-spacing")},transitions:{fast:a("--nice-transition-fast"),normal:a("--nice-transition"),slow:a("--nice-transition-slow")},darkMode:t.dataset.ntdColorScheme??void 0}}function Md(e){return JSON.stringify(e,null,2)}function Cd(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const Ad=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,Ed=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;function st(e){if(!e)return null;const t=e.trim();let r=t.match(Ed);if(r)return{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)};if(r=t.match(Ad),r)return{r:parseInt(r[1]+r[1],16),g:parseInt(r[2]+r[2],16),b:parseInt(r[3]+r[3],16)};const a=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);return a?{r:+a[1],g:+a[2],b:+a[3]}:null}function Nd({r:e,g:t,b:r}){const a=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(r)}`}function Tt(e,t,r){const a=st(e),n=st(t);return!a||!n?e:Nd({r:a.r+(n.r-a.r)*r,g:a.g+(n.g-a.g)*r,b:a.b+(n.b-a.b)*r})}function ot(e,t){return Tt(e,"#ffffff",t)}function it(e,t){return Tt(e,"#000000",t)}function ct(e){const t=st(e);if(!t)return 1;const r=a=>{const n=a/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)};return .2126*r(t.r)+.7152*r(t.g)+.0722*r(t.b)}function Ld(e,t,r){return ct(e)>.5?r:t}function Td(e,t,r){const a=t.palette??[],n=t.bgStep??.06,s=a[0]??r;switch(t.bgDerivation??"tint"){case"palette":return a.length===0?r:a[(e-1)%a.length];case"shade":return it(s,Math.min(.9,n*(e-1)));case"mix-surface":return Tt(s,r,Math.min(1,n*(e-1)));case"tint":default:return ot(s,Math.min(.9,n*(e-1)))}}function Rd(e,t,r,a){var i;const n={},s=Math.max(1,Math.min(10,t.levels??5));for(let o=1;o<=s;o++){const l=(i=t.overrides)==null?void 0:i[o],d=(l==null?void 0:l.background)??Td(o,t,r),u=(l==null?void 0:l.text)??Ld(d,"#ffffff",a),f=(l==null?void 0:l.hoverBackground)??(ct(d)>.5?it(d,.06):ot(d,.08)),p=(l==null?void 0:l.activeBackground)??(ct(d)>.5?it(d,.12):ot(d,.16)),h=l==null?void 0:l.border;n[`--nice-${e}-level-${o}-bg`]=d,n[`--nice-${e}-level-${o}-text`]=u,n[`--nice-${e}-level-${o}-hover-bg`]=f,n[`--nice-${e}-level-${o}-active-bg`]=p,h&&(n[`--nice-${e}-level-${o}-border`]=h)}return n[`--nice-${e}-levels`]=String(s),n}const Rt=c.createContext(null);function Id(){const e=c.useContext(Rt);if(!e)throw new Error("useNiceTheme must be used within a NiceThemeProvider");return e}const we={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},ke={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Me={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},It=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Ea={sm:"0 1px 2px rgba(0,0,0,0.05)",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)"},zd={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function I(e,t,r,a,n){return{name:e,darkMode:"light",colors:{...t,surface:t.surface??r.primary,surfaceHover:t.surfaceHover??r.secondary},backgrounds:{...r,elevated:r.elevated??r.primary,inset:r.inset??r.tertiary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#ffffff"},borders:It(n),shadows:Ea,spacing:we,typography:ke,transitions:Me}}function O(e,t,r,a,n){return{name:e,darkMode:"dark",colors:{...t,surface:t.surface??r.secondary,surfaceHover:t.surfaceHover??r.tertiary},backgrounds:{...r,elevated:r.elevated??r.secondary,inset:r.inset??r.primary,canvas:r.canvas??r.primary},text:{...a,inverse:a.inverse??"#0f172a"},borders:It(n),shadows:zd,spacing:we,typography:ke,transitions:Me}}const Na=I("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),La=I("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),Ta=I("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Ra=I("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),Ia=I("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),za=I("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),Da=I("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),Pa=I("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),Fa=I("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),Ha=I("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),$a=I("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),ja=I("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ba=I("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Oa=I("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),_a=I("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Wa=I("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),Va=I("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),Xa=I("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),Ua=I("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),qa=I("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),Ga=I("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),Ka=I("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),Ja=O("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),Ya=O("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),Qa=O("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),Za=O("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),en=O("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),tn=O("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),rn=O("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),an=O("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),nn=O("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),sn=O("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),on=I("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cn=I("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),ln=I("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),dn=I("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),un=I("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),fn=I("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),mn=I("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),pn=I("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),gn=I("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),yn=I("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),hn=I("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),bn=I("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),vn=I("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),Sn=I("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),xn=I("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),wn=I("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),kn=I("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),Mn=I("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),Cn=I("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),An=I("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),En=I("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),Nn=I("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),Ln=I("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),Tn=I("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),Rn=I("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),In=I("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),zn=I("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),Dn=O("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),Pn=I("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),Fn=O("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),Hn=O("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),$n=O("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),jn=O("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),Bn=I("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),On=O("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),_n=I("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Wn=I("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Vn=O("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),Xn=O("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),Un=O("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),qn=I("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),Gn=O("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),Kn=I("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),Jn=I("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),Yn=I("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),Qn=I("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),Zn=I("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),es=I("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),ts=I("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),rs=I("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),as=I("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),ns=I("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),ss=I("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),os=I("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),is=I("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),cs=I("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),ls=O("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),ds=I("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),us=I("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),fs={name:"Large Text",darkMode:"light",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#ffffff"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:It("#e2e8f0"),shadows:Ea,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:Me},ms={name:"Glassmorphism",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"rgba(255,255,255,0.7)",surfaceHover:"rgba(255,255,255,0.5)"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"rgba(255,255,255,0.7)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:we,typography:ke,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},ps={name:"Neumorphism Light",darkMode:"light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#e0e5ec",surfaceHover:"#d5dae2"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2",elevated:"#e0e5ec",inset:"#ccd1d9",canvas:"#e0e5ec"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096",inverse:"#ffffff"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:we,typography:ke,transitions:Me},gs={name:"Neumorphism Dark",darkMode:"dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",surface:"#283141",surfaceHover:"#232b3a"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141",elevated:"#283141",inset:"#2d3748",canvas:"#2d3748"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096",inverse:"#0f172a"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:we,typography:ke,transitions:Me},ys=I("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),hs=O("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),bs=O("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),vs=I("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),Ss=I("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),xs=[Na,La,Ta,Ra,Ia,za,Da,Pa,Fa,Ha,$a,ja,Ba,Oa,_a,Wa,Va,Xa,Ua,qa,Ga,Ka,Ja,Ya,Qa,Za,en,tn,rn,an,nn,sn,on,cn,ln,dn,un,fn,mn,pn,gn,yn,hn,bn,vn,Sn,xn,wn,kn,Mn,Cn,An,En,Nn,Ln,Tn,Rn,In,zn,Dn,Pn,Fn,Hn,$n,jn,Bn,On,_n,Wn,Vn,Xn,Un,qn,Gn,Kn,Jn,Yn,Qn,Zn,es,ts,rs,as,ns,ss,os,is,cs,ls,ds,us,fs,ms,ps,gs,ys,hs,bs,vs,Ss],le={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ue={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Ce={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Ae={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},zt={name:"Light",darkMode:"light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Ce,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",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)"},spacing:le,typography:Ue,transitions:Ae},ws={name:"Dark",darkMode:"dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Ce,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:le,typography:Ue,transitions:Ae},ks={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Ce,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:le,typography:Ue,transitions:Ae},Ms={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Ce,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:le,typography:Ue,transitions:Ae},Cs={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Ce,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:le,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},As={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:le,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Ae},Es={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:le,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},lt=[zt,ws,ks,Ms,Cs,As,Es,...xs],Dd=["https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Work+Sans:wght@400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap","https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;600&display=swap","https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:wght@400;700&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap"],Pd={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},ne={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Dt={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},Ns={meta:{id:"obsidianEditorial",name:"Obsidian Editorial",tagline:"Dark-mode magazine — serif display, razor borders, grain.",tags:["dark","editorial","serif"]},theme:{name:"Obsidian Editorial",darkMode:"dark",colors:{primary:"#e8dcc4",primaryHover:"#d4c29c",success:"#7fb069",warning:"#e6aa68",error:"#d65a5a",info:"#88aabb",accent:"#c98a5b",focus:"#e8dcc4",surface:"#1a1715",surfaceHover:"#221e1b"},backgrounds:{primary:"#0e0c0b",secondary:"#1a1715",tertiary:"#221e1b",hover:"#2a2522",elevated:"#1a1715",inset:"#0b0908",canvas:"#0e0c0b"},text:{primary:"#ede4d1",secondary:"#a39787",muted:"#6b6055",inverse:"#0e0c0b"},borders:{color:"#332d28",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px",width:"1px",divider:"#28231f"},shadows:{sm:"none",md:"0 1px 0 0 rgba(232,220,196,0.04)",lg:"0 2px 0 0 rgba(232,220,196,0.06)",xl:"0 4px 0 0 rgba(232,220,196,0.08)"},spacing:Dt,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Fraunces', 'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"80ms cubic-bezier(0.4,0,0.2,1)",normal:"140ms cubic-bezier(0.4,0,0.2,1)",slow:"220ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.35,blendMode:"overlay"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"subtle"}},Ls={meta:{id:"neonArcade",name:"Neon Arcade",tagline:"Phosphor-green terminal glow on absolute black.",tags:["dark","retro","mono","terminal"]},theme:{name:"Neon Arcade",darkMode:"dark",colors:{primary:"#39ff14",primaryHover:"#50ff35",success:"#39ff14",warning:"#ffcc00",error:"#ff3355",info:"#00e5ff",accent:"#ff00aa",focus:"#39ff14",surface:"#060a06",surfaceHover:"#0b140b"},backgrounds:{primary:"#000000",secondary:"#060a06",tertiary:"#0b140b",hover:"#12241a",elevated:"#060a06",inset:"#000000",canvas:"#000000"},text:{primary:"#c8ffb8",secondary:"#7be368",muted:"#3e7a39",inverse:"#000000"},borders:{color:"#1d3a1d",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"1px",divider:"#143014",focusColor:"#39ff14"},shadows:{sm:"0 0 4px rgba(57,255,20,0.3)",md:"0 0 10px rgba(57,255,20,0.35), 0 0 2px rgba(57,255,20,0.6)",lg:"0 0 22px rgba(57,255,20,0.4), 0 0 4px rgba(57,255,20,0.7)",xl:"0 0 40px rgba(57,255,20,0.5), 0 0 8px rgba(57,255,20,0.8)",glow:"0 0 30px #39ff14, 0 0 60px rgba(57,255,20,0.4)"},spacing:ne,typography:{fontFamily:"'JetBrains Mono', 'Fira Code', ui-monospace, monospace",headingFontFamily:"'JetBrains Mono', monospace",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"60ms steps(4, end)",normal:"120ms steps(6, end)",slow:"200ms steps(8, end)"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.25}},displayStyle:"terminal",variantConfig:{radius:"none",shadow:"glow",density:"compact",animation:"subtle"}},Ts={meta:{id:"hyggeScandinavian",name:"Hygge Scandinavian",tagline:"Warm cream, generous breathing room, soft serif display.",tags:["light","warm","serif","spacious"]},theme:{name:"Hygge Scandinavian",darkMode:"light",colors:{primary:"#8b6f47",primaryHover:"#6f5738",success:"#6b8e4e",warning:"#d49a3e",error:"#b84c4c",info:"#6a8aad",accent:"#c98754",focus:"#8b6f47",surface:"#fbf6ed",surfaceHover:"#f3ecdf"},backgrounds:{primary:"#fdf9f1",secondary:"#f5eee0",tertiary:"#ede3d0",hover:"#e8ddc8",elevated:"#ffffff",inset:"#f0e7d4",canvas:"#fdf9f1"},text:{primary:"#3a2f22",secondary:"#6a5845",muted:"#9c8c76",inverse:"#fdf9f1"},borders:{color:"#d9cbb0",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px",width:"1px",divider:"#e8ddc8"},shadows:{sm:"0 1px 2px rgba(122,92,58,0.05)",md:"0 6px 16px -4px rgba(122,92,58,0.08)",lg:"0 16px 32px -10px rgba(122,92,58,0.10)",xl:"0 28px 56px -18px rgba(122,92,58,0.14)"},spacing:Dt,typography:{fontFamily:"'Work Sans', -apple-system, sans-serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"ui-monospace, 'SF Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"160ms cubic-bezier(0.16,1,0.3,1)",normal:"260ms cubic-bezier(0.16,1,0.3,1)",slow:"400ms cubic-bezier(0.16,1,0.3,1)"}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Rs={meta:{id:"brutalistRaw",name:"Brutalist Raw",tagline:"Paper + ink + hard shadows — zero blur, zero mercy.",tags:["light","brutalist","experimental"]},theme:{name:"Brutalist Raw",darkMode:"light",colors:{primary:"#ff3b30",primaryHover:"#000000",success:"#00aa55",warning:"#ffcc00",error:"#ff0000",info:"#0066ff",accent:"#ffcc00",focus:"#ff3b30",surface:"#ffffff",surfaceHover:"#f5f3ee"},backgrounds:{primary:"#f5f3ee",secondary:"#ffffff",tertiary:"#e8e4d8",hover:"#e0dcd0",elevated:"#ffffff",inset:"#e8e4d8",canvas:"#f5f3ee"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#555555",inverse:"#ffffff"},borders:{color:"#000000",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0",width:"2px",divider:"#000000"},shadows:{sm:"3px 3px 0 0 #000000",md:"6px 6px 0 0 #000000",lg:"10px 10px 0 0 #000000",xl:"14px 14px 0 0 #000000"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.4,letterSpacing:"-0.01em",headingLetterSpacing:"-0.04em"},transitions:{fast:"0ms linear",normal:"80ms cubic-bezier(0.2,0,0,1)",slow:"140ms cubic-bezier(0.2,0,0,1)"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Is={meta:{id:"glassAurora",name:"Glass Aurora",tagline:"Frosted translucency floating over aurora light.",tags:["light","glass","modern","gradient"]},theme:{name:"Glass Aurora",darkMode:"light",colors:{primary:"#5b5bff",primaryHover:"#4343e8",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",accent:"#ec4899",focus:"#5b5bff",surface:"rgba(255,255,255,0.55)",surfaceHover:"rgba(255,255,255,0.75)"},backgrounds:{primary:"rgba(255,255,255,0.55)",secondary:"rgba(255,255,255,0.35)",tertiary:"rgba(255,255,255,0.22)",hover:"rgba(255,255,255,0.7)",elevated:"rgba(255,255,255,0.8)",inset:"rgba(255,255,255,0.3)",canvas:"#e8d6ff"},text:{primary:"#1a1440",secondary:"#443c78",muted:"#8b83b8",inverse:"#ffffff"},borders:{color:"rgba(255,255,255,0.6)",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"36px",radiusFull:"9999px",width:"1px",divider:"rgba(255,255,255,0.4)"},shadows:{sm:"0 2px 12px rgba(91,91,255,0.08)",md:"0 8px 32px rgba(91,91,255,0.12)",lg:"0 18px 56px rgba(236,72,153,0.18)",xl:"0 32px 80px rgba(91,91,255,0.22)"},spacing:ne,typography:{fontFamily:"'Outfit', -apple-system, sans-serif",headingFontFamily:"'Outfit', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"-0.005em",headingLetterSpacing:"-0.025em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"400ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 12% 18%, #ffd6e8 0%, transparent 48%), radial-gradient(at 88% 22%, #c8d8ff 0%, transparent 52%), radial-gradient(at 42% 86%, #d8ffe8 0%, transparent 50%), linear-gradient(180deg, #eee4ff 0%, #ffe8f2 100%)"}},displayStyle:"glass",variantConfig:{density:"normal",animation:"normal"}},zs={meta:{id:"candyPop",name:"Candy Pop",tagline:"Bubblegum pastels, pill shapes, bouncy easing.",tags:["light","playful","pastel","pill"]},theme:{name:"Candy Pop",darkMode:"light",colors:{primary:"#ff4fa3",primaryHover:"#ff2d8e",success:"#3dd68c",warning:"#ffd63d",error:"#ff5577",info:"#4ec8ff",accent:"#b85bff",focus:"#ff4fa3",surface:"#ffffff",surfaceHover:"#fff5fa"},backgrounds:{primary:"#fff5fa",secondary:"#ffeaf3",tertiary:"#ffd8e9",hover:"#ffc4dc",elevated:"#ffffff",inset:"#ffeaf3",canvas:"#fff8f5"},text:{primary:"#531645",secondary:"#8b3a70",muted:"#c678a8",inverse:"#ffffff"},borders:{color:"#ffc4dc",radiusSm:"9999px",radiusMd:"9999px",radiusLg:"9999px",radiusXl:"9999px",radiusFull:"9999px",width:"2px",divider:"#ffd8e9"},shadows:{sm:"0 2px 0 0 #ffc4dc",md:"0 4px 0 0 #ffa3c7",lg:"0 6px 16px rgba(255,79,163,0.2), 0 3px 0 0 #ff4fa3",xl:"0 12px 28px rgba(255,79,163,0.25)"},spacing:ne,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"140ms cubic-bezier(0.34,1.56,0.64,1)",normal:"240ms cubic-bezier(0.34,1.56,0.64,1)",slow:"380ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"pill",variantConfig:{radius:"full",density:"comfortable",animation:"playful"}},Ds={meta:{id:"newspaperBroadsheet",name:"Newspaper Broadsheet",tagline:"Ivory paper, hairline rules, serif gravity.",tags:["light","editorial","serif","print"]},theme:{name:"Newspaper Broadsheet",darkMode:"light",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2d5016",warning:"#8b6914",error:"#8b0000",info:"#1d3a5f",accent:"#8b0000",focus:"#1a1a1a",surface:"#fbf7ee",surfaceHover:"#f3ecdd"},backgrounds:{primary:"#fbf7ee",secondary:"#f5eedb",tertiary:"#ede4cc",hover:"#e8ddbe",elevated:"#fbf7ee",inset:"#f0e7d0",canvas:"#fbf7ee"},text:{primary:"#14110c",secondary:"#3d362a",muted:"#7a6f58",inverse:"#fbf7ee"},borders:{color:"#14110c",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"1px",divider:"#14110c"},shadows:{sm:"none",md:"none",lg:"none",xl:"none"},spacing:ne,typography:{fontFamily:"'Fraunces', 'Source Serif Pro', Georgia, serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.01em",headingLetterSpacing:"-0.025em"},transitions:{fast:"0ms",normal:"100ms linear",slow:"180ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.18,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"normal"}},Ps={meta:{id:"synthwave84",name:"Synthwave 84",tagline:"Magenta & cyan pulse over deep navy — 1984 forever.",tags:["dark","retro","neon","80s"]},theme:{name:"Synthwave 84",darkMode:"dark",colors:{primary:"#ff3ca8",primaryHover:"#ff6bc1",success:"#72f1b8",warning:"#ffcc33",error:"#fe4450",info:"#36f9f6",accent:"#36f9f6",focus:"#ff3ca8",surface:"#2a1a4f",surfaceHover:"#332260"},backgrounds:{primary:"#1a0933",secondary:"#241443",tertiary:"#2d1a52",hover:"#382266",elevated:"#2a1a4f",inset:"#120626",canvas:"#0e0524"},text:{primary:"#f5e8ff",secondary:"#c9a7ff",muted:"#8063b0",inverse:"#0e0524"},borders:{color:"#553388",radiusSm:"2px",radiusMd:"4px",radiusLg:"6px",radiusXl:"8px",radiusFull:"9999px",width:"1px",divider:"#3d2270",focusColor:"#36f9f6"},shadows:{sm:"0 0 8px rgba(255,60,168,0.4)",md:"0 0 18px rgba(255,60,168,0.45), 0 2px 0 0 #36f9f6",lg:"0 0 36px rgba(255,60,168,0.55), 0 4px 0 0 #36f9f6",xl:"0 0 60px rgba(255,60,168,0.6), 0 6px 0 0 #36f9f6",glow:"0 0 28px #ff3ca8, 0 0 56px rgba(255,60,168,0.5)"},spacing:ne,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:900,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.08em"},transitions:{fast:"120ms cubic-bezier(0.23,1,0.32,1)",normal:"200ms cubic-bezier(0.23,1,0.32,1)",slow:"360ms cubic-bezier(0.23,1,0.32,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0e0524 0%, #1a0933 55%, #2d1a52 100%), repeating-linear-gradient(0deg, rgba(54,249,246,0.04) 0 1px, transparent 1px 3px)"}},displayStyle:"synthwave",variantConfig:{shadow:"glow",animation:"dramatic",density:"normal"}},Fs={meta:{id:"zenMinimal",name:"Zen Minimal",tagline:"Whisper-light type, hairlines, oceans of whitespace.",tags:["light","minimal","airy"]},theme:{name:"Zen Minimal",darkMode:"light",colors:{primary:"#0a0a0a",primaryHover:"#262626",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#2563eb",accent:"#737373",focus:"#0a0a0a",surface:"#ffffff",surfaceHover:"#fafafa"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f0f0f0",elevated:"#ffffff",inset:"#fafafa",canvas:"#ffffff"},text:{primary:"#171717",secondary:"#525252",muted:"#a3a3a3",inverse:"#ffffff"},borders:{color:"#ededed",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px",width:"1px",divider:"#f0f0f0"},shadows:{sm:"none",md:"0 0 0 1px rgba(0,0,0,0.04)",lg:"0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.05)",xl:"0 4px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)"},spacing:Dt,typography:{fontFamily:"'Manrope', -apple-system, sans-serif",headingFontFamily:"'Manrope', sans-serif",monoFontFamily:"ui-monospace, monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"-0.005em",headingLetterSpacing:"-0.03em"},transitions:{fast:"100ms ease",normal:"180ms ease",slow:"280ms ease"}},displayStyle:"minimal",variantConfig:{density:"spacious",animation:"subtle"}},Hs={meta:{id:"claymorphism",name:"Claymorphism",tagline:"Soft-clay 3D surfaces — pressable, friendly, tactile.",tags:["light","playful","neumorphic","3d"]},theme:{name:"Claymorphism",darkMode:"light",colors:{primary:"#8b7ef5",primaryHover:"#7469ec",success:"#6ed6a5",warning:"#ffc771",error:"#ff8b8b",info:"#7ec4f5",accent:"#ffb3d9",focus:"#8b7ef5",surface:"#f3efff",surfaceHover:"#ebe4ff"},backgrounds:{primary:"#f6f0ff",secondary:"#ede4ff",tertiary:"#dfd3fc",hover:"#d3c5fa",elevated:"#ffffff",inset:"#e5daff",canvas:"#f6f0ff"},text:{primary:"#2a1f5e",secondary:"#584a8e",muted:"#9388bd",inverse:"#ffffff"},borders:{color:"rgba(139,126,245,0.15)",radiusSm:"14px",radiusMd:"22px",radiusLg:"32px",radiusXl:"48px",radiusFull:"9999px",width:"0px",divider:"rgba(139,126,245,0.12)"},shadows:{sm:"-3px -3px 6px rgba(255,255,255,0.8), 3px 3px 8px rgba(139,126,245,0.18), inset 0 0 0 rgba(255,255,255,0)",md:"-5px -5px 12px rgba(255,255,255,0.9), 6px 6px 18px rgba(139,126,245,0.22), inset 1px 1px 1px rgba(255,255,255,0.6)",lg:"-8px -8px 20px rgba(255,255,255,0.95), 10px 10px 32px rgba(139,126,245,0.28), inset 2px 2px 2px rgba(255,255,255,0.7)",xl:"-14px -14px 32px rgba(255,255,255,1), 16px 16px 48px rgba(139,126,245,0.34), inset 3px 3px 4px rgba(255,255,255,0.8)",inner:"inset 4px 4px 10px rgba(139,126,245,0.2), inset -4px -4px 10px rgba(255,255,255,0.9)"},spacing:ne,typography:{fontFamily:"'Nunito', -apple-system, sans-serif",headingFontFamily:"'Nunito', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1.4)",normal:"260ms cubic-bezier(0.4,0,0.2,1.4)",slow:"400ms cubic-bezier(0.4,0,0.2,1.4)"}},displayStyle:"neumorphic",variantConfig:{radius:"2xl",density:"comfortable",animation:"normal"}},$s={meta:{id:"bauhaus",name:"Bauhaus",tagline:"Primary palette, geometric rigour, grid as foundation.",tags:["light","geometric","primary","design"]},theme:{name:"Bauhaus",darkMode:"light",colors:{primary:"#d62828",primaryHover:"#a81e1e",success:"#2a9d8f",warning:"#fcbf49",error:"#d62828",info:"#1d4e89",accent:"#fcbf49",focus:"#1d4e89",surface:"#faf5e8",surfaceHover:"#f2ead3"},backgrounds:{primary:"#faf5e8",secondary:"#f5ecd3",tertiary:"#ede0be",hover:"#e5d5a8",elevated:"#ffffff",inset:"#f0e3c0",canvas:"#faf5e8"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#7a7a7a",inverse:"#faf5e8"},borders:{color:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px",width:"3px",divider:"#1a1a1a"},shadows:{sm:"0 2px 0 0 #1a1a1a",md:"4px 4px 0 0 #1a1a1a",lg:"6px 6px 0 0 #1d4e89",xl:"8px 8px 0 0 #d62828"},spacing:ne,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Archivo Black', 'Archivo', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:500,fontWeightMedium:700,fontWeightSemibold:800,fontWeightBold:900,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.35}},displayStyle:"bauhaus",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},js={meta:{id:"bankVault",name:"Bank Vault",tagline:"Navy, gilt accents, serif gravitas — trusted by institutions.",tags:["light","corporate","serif","conservative"]},theme:{name:"Bank Vault",darkMode:"light",colors:{primary:"#0b2545",primaryHover:"#163969",success:"#2d6a4f",warning:"#b08d2e",error:"#8b1a1a",info:"#1d4e89",accent:"#b08d2e",focus:"#0b2545",surface:"#ffffff",surfaceHover:"#f7f4ec"},backgrounds:{primary:"#fbfaf6",secondary:"#f4f0e4",tertiary:"#ebe5d2",hover:"#e3dcc4",elevated:"#ffffff",inset:"#efeadb",canvas:"#fbfaf6"},text:{primary:"#0b2545",secondary:"#3a4b65",muted:"#7a8399",inverse:"#fbfaf6"},borders:{color:"#c9bfa3",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px",width:"1px",divider:"#d4c9a8"},shadows:{sm:"0 1px 0 0 rgba(11,37,69,0.08)",md:"0 1px 3px rgba(11,37,69,0.08), 0 0 0 1px rgba(176,141,46,0.12)",lg:"0 4px 10px rgba(11,37,69,0.1)",xl:"0 12px 24px rgba(11,37,69,0.12)"},spacing:Pd,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'Libre Caslon Text', 'DM Serif Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0.005em",headingLetterSpacing:"-0.01em"},transitions:{fast:"90ms cubic-bezier(0.4,0,0.2,1)",normal:"160ms cubic-bezier(0.4,0,0.2,1)",slow:"260ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"bank",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"none"}},Pt={obsidianEditorial:Ns,neonArcade:Ls,hyggeScandinavian:Ts,brutalistRaw:Rs,glassAurora:Is,candyPop:zs,newspaperBroadsheet:Ds,synthwave84:Ps,zenMinimal:Fs,claymorphism:Hs,bauhaus:$s,bankVault:js},Bs=Object.values(Pt);function Fd(e){return Pt[e]}function Hd(e){return Bs.filter(t=>t.meta.tags.includes(e))}const $d=["https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;500;600;700&family=Lora:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Poiret+One&family=Cormorant+Garamond:wght@300;400;500;600&display=swap","https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Roboto+Condensed:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Space+Mono:wght@400;700&display=swap","https://fonts.googleapis.com/css2?family=VT323&display=swap","https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Special+Elite&display=swap","https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&display=swap","https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&display=swap","https://fonts.googleapis.com/css2?family=Bangers&display=swap","https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap","https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;700&display=swap","https://fonts.googleapis.com/css2?family=Rubik+Mono+One&family=Rubik:wght@400;500;700;800&display=swap"],Os={space1:"2px",space2:"4px",space3:"8px",space4:"12px",space5:"16px",space6:"20px",space8:"28px"},X={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ee={space1:"6px",space2:"12px",space3:"16px",space4:"24px",space5:"32px",space6:"40px",space8:"56px"},qe={space1:"8px",space2:"16px",space3:"24px",space4:"32px",space5:"44px",space6:"56px",space8:"80px"},_s={meta:{id:"forestCanopy",name:"Forest Canopy",tagline:"Moss on bark, dappled light — organic radii, earth serif.",tags:["light","nature","serif","organic"]},theme:{name:"Forest Canopy",darkMode:"light",recommendedDisplayStyle:"scandinavian",colors:{primary:"#3d5a40",primaryHover:"#2d4430",success:"#4a7c3a",warning:"#c88d3e",error:"#a63c3c",info:"#5a7c8a",accent:"#8ba878",focus:"#3d5a40",surface:"#f4f1e8",surfaceHover:"#ebe7d5"},backgrounds:{primary:"#f7f4e9",secondary:"#ede8d4",tertiary:"#dfd8be",hover:"#d5cdae",elevated:"#fcfaf1",inset:"#e5ddc5",canvas:"#f0ece0"},text:{primary:"#1e2a1c",secondary:"#3d4a36",muted:"#7a8570",inverse:"#f7f4e9"},borders:{color:"#c4bda0",width:"1px",divider:"#d8d0b5",radiusSm:"3px",radiusMd:"7px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(61,90,64,0.06)",md:"0 4px 12px -2px rgba(61,90,64,0.12), 0 2px 4px rgba(61,90,64,0.05)",lg:"0 10px 24px -6px rgba(61,90,64,0.16)",xl:"0 20px 40px -12px rgba(61,90,64,0.22)"},spacing:Ee,typography:{fontFamily:"'Lora', Georgia, serif",headingFontFamily:"'Spectral', 'Lora', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.7,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"180ms cubic-bezier(0.16,1,0.3,1)",normal:"280ms cubic-bezier(0.16,1,0.3,1)",slow:"420ms cubic-bezier(0.16,1,0.3,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.25}},displayStyle:"scandinavian",variantConfig:{density:"spacious",animation:"normal"}},Ws={meta:{id:"desertDune",name:"Desert Dune",tagline:"Ochre horizons, warm grain, serif that suns itself.",tags:["light","nature","serif","warm"]},theme:{name:"Desert Dune",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#c8732f",primaryHover:"#a65a1c",success:"#7a8c3a",warning:"#e0a83a",error:"#b34747",info:"#7a8fa6",accent:"#e8a863",focus:"#c8732f",surface:"#fbf3e5",surfaceHover:"#f4e8d0"},backgrounds:{primary:"#fdf7ea",secondary:"#f6ebd3",tertiary:"#eeddb6",hover:"#e5cfa0",elevated:"#ffffff",inset:"#f0dfb8",canvas:"#fdf5e6"},text:{primary:"#3a2413",secondary:"#6b4823",muted:"#a88860",inverse:"#fdf7ea"},borders:{color:"#dcc08c",width:"1px",divider:"#e8d0a5",radiusSm:"12px",radiusMd:"18px",radiusLg:"28px",radiusXl:"40px",radiusFull:"9999px"},shadows:{sm:"0 2px 6px -2px rgba(200,115,47,0.1)",md:"0 8px 20px -6px rgba(200,115,47,0.15)",lg:"0 18px 36px -10px rgba(200,115,47,0.2)",xl:"0 32px 56px -18px rgba(200,115,47,0.28)"},spacing:Ee,typography:{fontFamily:"'DM Sans', -apple-system, sans-serif",headingFontFamily:"'DM Serif Display', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.025em"},transitions:{fast:"160ms ease-out",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"460ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(175deg, #fbecc5 0%, #f6ddaf 40%, #eec28a 100%), radial-gradient(ellipse at 80% 10%, #fff4d9 0%, transparent 60%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Vs={meta:{id:"arcticCrystal",name:"Arctic Crystal",tagline:"Facets of ice, lean typography, surgical whitespace.",tags:["light","nature","minimal","cold"]},theme:{name:"Arctic Crystal",darkMode:"light",recommendedDisplayStyle:"minimal",colors:{primary:"#2a6a8c",primaryHover:"#1e5374",success:"#4a8a6a",warning:"#d0a040",error:"#c24848",info:"#5a9fc0",accent:"#a8d4e8",focus:"#2a6a8c",surface:"#ffffff",surfaceHover:"#f0f6fa"},backgrounds:{primary:"#f5fafd",secondary:"#eaf2f7",tertiary:"#d8e5ed",hover:"#cfdce6",elevated:"#ffffff",inset:"#e3eef5",canvas:"#f0f7fb"},text:{primary:"#0a2030",secondary:"#3a5468",muted:"#7a95a8",inverse:"#ffffff"},borders:{color:"#cfdde8",width:"1px",divider:"#e0ebf3",radiusSm:"2px",radiusMd:"3px",radiusLg:"4px",radiusXl:"6px",radiusFull:"9999px"},shadows:{sm:"1px 1px 0 rgba(42,106,140,0.06), -1px 0 0 rgba(42,106,140,0.04)",md:"2px 2px 0 rgba(42,106,140,0.08), -2px 0 0 rgba(42,106,140,0.04), 0 4px 8px -2px rgba(42,106,140,0.1)",lg:"4px 4px 0 rgba(42,106,140,0.1), 0 10px 16px -4px rgba(42,106,140,0.14)",xl:"0 24px 40px -12px rgba(42,106,140,0.2)"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Inter', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:200,fontWeightMedium:300,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"-0.02em"},transitions:{fast:"90ms ease",normal:"160ms ease",slow:"260ms ease"}},displayStyle:"minimal",variantConfig:{radius:"sm",shadow:"subtle",density:"spacious",animation:"subtle"}},Xs={meta:{id:"autumnFoliage",name:"Autumn Foliage",tagline:"Ember glow, Fraunces serif, woodsmoke warmth.",tags:["light","nature","serif","warm"]},theme:{name:"Autumn Foliage",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#a83828",primaryHover:"#842818",success:"#6b7c2c",warning:"#c48020",error:"#8a2020",info:"#7a5a3a",accent:"#d89040",focus:"#a83828",surface:"#fbf1e3",surfaceHover:"#f2e4ce"},backgrounds:{primary:"#fdf5e8",secondary:"#f4e5cc",tertiary:"#e8d2aa",hover:"#dec295",elevated:"#fff9ee",inset:"#eedab5",canvas:"#faeed6"},text:{primary:"#2a140a",secondary:"#5a3020",muted:"#997860",inverse:"#fdf5e8"},borders:{color:"#d4b890",width:"1px",divider:"#e0c8a0",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"22px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(168,56,40,0.08)",md:"0 4px 10px -2px rgba(168,56,40,0.12), 0 2px 4px rgba(168,56,40,0.08)",lg:"0 12px 24px -6px rgba(168,56,40,0.18)",xl:"0 24px 48px -16px rgba(168,56,40,0.24)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Fraunces', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0.005em",headingLetterSpacing:"-0.02em"},transitions:{fast:"140ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{density:"comfortable",animation:"normal"}},Us={meta:{id:"japaneseWashi",name:"Japanese Washi",tagline:"Sumi ink on cream — quiet serif, paper grain, zero excess.",tags:["light","cultural","serif","minimal"]},theme:{name:"Japanese Washi",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1d3557",primaryHover:"#0d2545",success:"#4a7042",warning:"#a8803e",error:"#8b2a2a",info:"#3a5a78",accent:"#c83a3a",focus:"#1d3557",surface:"#faf6ea",surfaceHover:"#f2ebd7"},backgrounds:{primary:"#fdf9ee",secondary:"#f5ecd5",tertiary:"#ecdfbd",hover:"#e4d5aa",elevated:"#ffffff",inset:"#f0e5c8",canvas:"#fbf6e7"},text:{primary:"#1a1610",secondary:"#3d352a",muted:"#8a7f64",inverse:"#fdf9ee"},borders:{color:"#1a1610",width:"1px",divider:"#d4c89e",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(26,22,16,0.08)",lg:"0 2px 0 0 rgba(26,22,16,0.1)",xl:"0 4px 12px rgba(26,22,16,0.08)"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', 'Inter', sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.75,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"340ms ease"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.22,blendMode:"multiply"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},qs={meta:{id:"moroccanMosaic",name:"Moroccan Mosaic",tagline:"Zellige geometry — terracotta, teal, saffron in tiled rhythm.",tags:["light","cultural","geometric","warm"]},theme:{name:"Moroccan Mosaic",darkMode:"light",recommendedDisplayStyle:"bauhaus",colors:{primary:"#0f6b5c",primaryHover:"#0a5246",success:"#5a8a3a",warning:"#e0a03a",error:"#c2522a",info:"#3a7090",accent:"#e8a840",focus:"#0f6b5c",surface:"#f9f1dc",surfaceHover:"#f0e5c2"},backgrounds:{primary:"#fbf3e0",secondary:"#f2e4c2",tertiary:"#e6d2a0",hover:"#dac38a",elevated:"#fdf7e8",inset:"#ecd8b2",canvas:"#f8edd3"},text:{primary:"#2a1608",secondary:"#5a3a20",muted:"#a08860",inverse:"#fbf3e0"},borders:{color:"#2a1608",width:"2px",divider:"#b89868",radiusSm:"3px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"2px 2px 0 rgba(42,22,8,0.12)",md:"3px 3px 0 #0f6b5c, 6px 6px 0 rgba(42,22,8,0.08)",lg:"4px 4px 0 #0f6b5c, 8px 8px 0 #e8a840",xl:"6px 6px 0 #c2522a, 12px 12px 0 rgba(42,22,8,0.1)"},spacing:X,typography:{fontFamily:"'Cairo', 'Inter', sans-serif",headingFontFamily:"'Amiri', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.625rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms linear",normal:"200ms linear",slow:"320ms linear"},backgroundImage:{type:"pattern",pattern:"hexagons",opacity:.2}},displayStyle:"bauhaus",variantConfig:{radius:"sm",shadow:"md",density:"normal",animation:"subtle"}},Gs={meta:{id:"artDecoGatsby",name:"Art Deco Gatsby",tagline:"Gold, emerald, onyx — geometric glamour, thin gilt lines.",tags:["dark","cultural","luxury","geometric"]},theme:{name:"Art Deco Gatsby",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#d4af37",primaryHover:"#e8c850",success:"#4a9c7a",warning:"#e8c850",error:"#c24040",info:"#70a8c0",accent:"#1e5c4a",focus:"#d4af37",surface:"#0f1a16",surfaceHover:"#16251e"},backgrounds:{primary:"#0a0f0c",secondary:"#0f1a16",tertiary:"#16251e",hover:"#1c3028",elevated:"#0f1a16",inset:"#050908",canvas:"#080c0a"},text:{primary:"#f0e4c2",secondary:"#c0b080",muted:"#706448",inverse:"#0a0f0c"},borders:{color:"#6b5828",width:"1px",divider:"#4a3c18",focusColor:"#d4af37",radiusSm:"0",radiusMd:"1px",radiusLg:"2px",radiusXl:"3px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(212,175,55,0.15)",md:"0 2px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.2)",lg:"0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.3), inset 0 1px 0 rgba(212,175,55,0.1)",xl:"0 20px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.4)",glow:"0 0 16px rgba(212,175,55,0.3)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Poiret One', 'Cormorant Garamond', serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.04em",headingLetterSpacing:"0.12em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"none",shadow:"lg",density:"comfortable",animation:"subtle"}},Ks={meta:{id:"sovietConstructivist",name:"Soviet Constructivist",tagline:"Rodchenko red — slab type, hard angles, propaganda poise.",tags:["light","cultural","brutalist","geometric"]},theme:{name:"Soviet Constructivist",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#c41e1e",primaryHover:"#8a1414",success:"#3a6a3a",warning:"#d08028",error:"#8a1414",info:"#2a4060",accent:"#1a1a1a",focus:"#c41e1e",surface:"#f0ead8",surfaceHover:"#e5dcc0"},backgrounds:{primary:"#f4efde",secondary:"#e8dec4",tertiary:"#d8c9a4",hover:"#ccbb90",elevated:"#faf5e5",inset:"#dccda8",canvas:"#f0ead5"},text:{primary:"#1a1a1a",secondary:"#3d3d3d",muted:"#706d5a",inverse:"#f4efde"},borders:{color:"#1a1a1a",width:"3px",divider:"#1a1a1a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"4px 0 0 0 #c41e1e",md:"6px 6px 0 0 #1a1a1a, 8px 8px 0 0 #c41e1e",lg:"10px 10px 0 0 #c41e1e",xl:"12px -4px 0 0 #1a1a1a, 16px 0 0 0 #c41e1e"},spacing:X,typography:{fontFamily:"'Roboto Condensed', 'Archivo', sans-serif",headingFontFamily:"'Alfa Slab One', 'Archivo Black', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.35,letterSpacing:"0.02em",headingLetterSpacing:"-0.005em"},transitions:{fast:"0ms linear",normal:"80ms linear",slow:"160ms linear"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"subtle"}},Js={meta:{id:"blueprint",name:"Blueprint",tagline:"Cyanotype drafting — white lines, grid paper, technical mono.",tags:["dark","tech","technical","mono"]},theme:{name:"Blueprint",darkMode:"dark",recommendedDisplayStyle:"dashboard",colors:{primary:"#f0f4f8",primaryHover:"#ffffff",success:"#88e0b8",warning:"#ffcc66",error:"#ff8888",info:"#88c8ff",accent:"#6eb0e0",focus:"#ffffff",surface:"#18456a",surfaceHover:"#1f527e"},backgrounds:{primary:"#0e3356",secondary:"#124066",tertiary:"#184d79",hover:"#1e5a8c",elevated:"#18456a",inset:"#082540",canvas:"#0a2d4a"},text:{primary:"#f0f4f8",secondary:"#b5c8da",muted:"#6e8aa4",inverse:"#0e3356"},borders:{color:"#3870a0",width:"1px",divider:"#2a5680",focusColor:"#ffffff",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(240,244,248,0.05)",md:"0 1px 0 0 rgba(240,244,248,0.1), 0 4px 8px rgba(0,0,0,0.3)",lg:"0 1px 0 0 rgba(240,244,248,0.14), 0 10px 20px rgba(0,0,0,0.4)",xl:"0 20px 40px rgba(0,0,0,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Mono', ui-monospace, monospace",headingFontFamily:"'Space Grotesk', 'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.25rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"-0.01em"},transitions:{fast:"80ms linear",normal:"140ms linear",slow:"220ms linear"},backgroundImage:{type:"pattern",pattern:"grid",opacity:.4}},displayStyle:"dashboard",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},Ys={meta:{id:"hologramUI",name:"Hologram UI",tagline:"Iridescent light-leaks, translucent layers, futurist geometry.",tags:["dark","tech","glass","neon"]},theme:{name:"Hologram UI",darkMode:"dark",recommendedDisplayStyle:"cosmic",colors:{primary:"#8be9fd",primaryHover:"#a8f0ff",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#bd93f9",accent:"#ff79c6",focus:"#8be9fd",surface:"rgba(40,30,70,0.5)",surfaceHover:"rgba(50,40,85,0.6)"},backgrounds:{primary:"rgba(30,20,55,0.6)",secondary:"rgba(40,30,70,0.5)",tertiary:"rgba(55,40,90,0.4)",hover:"rgba(65,50,105,0.55)",elevated:"rgba(50,38,82,0.7)",inset:"rgba(25,18,45,0.6)",canvas:"#0a0618"},text:{primary:"#f0e8ff",secondary:"#b0a0e0",muted:"#6a5a94",inverse:"#0a0618"},borders:{color:"rgba(139,233,253,0.25)",width:"1px",divider:"rgba(139,233,253,0.15)",focusColor:"#8be9fd",radiusSm:"4px",radiusMd:"8px",radiusLg:"14px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"0 0 12px rgba(139,233,253,0.2)",md:"0 4px 20px rgba(189,147,249,0.3), 0 0 1px rgba(139,233,253,0.4)",lg:"0 8px 40px rgba(255,121,198,0.35), 0 0 2px rgba(139,233,253,0.5), inset 0 1px 0 rgba(255,255,255,0.08)",xl:"0 20px 60px rgba(139,233,253,0.4), inset 0 1px 0 rgba(255,255,255,0.1)",glow:"0 0 32px rgba(139,233,253,0.6), 0 0 64px rgba(255,121,198,0.3)"},spacing:X,typography:{fontFamily:"'Rajdhani', -apple-system, sans-serif",headingFontFamily:"'Orbitron', 'Rajdhani', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.06em"},transitions:{fast:"160ms cubic-bezier(0.4,0,0.2,1)",normal:"280ms cubic-bezier(0.4,0,0.2,1)",slow:"440ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 15% 20%, rgba(139,233,253,0.25) 0%, transparent 50%), radial-gradient(at 85% 25%, rgba(255,121,198,0.25) 0%, transparent 50%), radial-gradient(at 50% 90%, rgba(189,147,249,0.3) 0%, transparent 55%), linear-gradient(135deg, #0a0618 0%, #1a0e38 100%)"}},displayStyle:"cosmic",variantConfig:{shadow:"glow",density:"normal",animation:"normal"}},Qs={meta:{id:"deepSea",name:"Deep Sea",tagline:"Midnight blue abyss, bioluminescent accents in the dark.",tags:["dark","tech","organic"]},theme:{name:"Deep Sea",darkMode:"dark",recommendedDisplayStyle:"modern3d",colors:{primary:"#00d9c4",primaryHover:"#2feedc",success:"#5af0b0",warning:"#f0c858",error:"#ff6a82",info:"#60c0ff",accent:"#a878f0",focus:"#00d9c4",surface:"#0a1524",surfaceHover:"#0e1c30"},backgrounds:{primary:"#05101c",secondary:"#0a1524",tertiary:"#0f1f34",hover:"#163044",elevated:"#0e1c30",inset:"#030810",canvas:"#030810"},text:{primary:"#d8f0f5",secondary:"#88b8c8",muted:"#4a7080",inverse:"#030810"},borders:{color:"#183548",width:"1px",divider:"#0f2638",focusColor:"#00d9c4",radiusSm:"8px",radiusMd:"14px",radiusLg:"22px",radiusXl:"32px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,217,196,0.08)",md:"0 6px 20px rgba(0,217,196,0.12), 0 2px 4px rgba(0,0,0,0.5)",lg:"0 14px 40px rgba(0,217,196,0.18), 0 4px 8px rgba(0,0,0,0.6)",xl:"0 28px 64px rgba(0,217,196,0.22), 0 8px 16px rgba(0,0,0,0.7)",glow:"0 0 24px rgba(0,217,196,0.5)"},spacing:X,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"160ms cubic-bezier(0.22,1,0.36,1)",normal:"280ms cubic-bezier(0.22,1,0.36,1)",slow:"440ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 20% 30%, rgba(0,217,196,0.08) 0%, transparent 60%), radial-gradient(at 80% 80%, rgba(168,120,240,0.06) 0%, transparent 55%), linear-gradient(180deg, #030810 0%, #05101c 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},Zs={meta:{id:"analog70s",name:"Analog 70s",tagline:"Mustard, rust, walnut — chunky, warm, turntable energy.",tags:["light","retro","warm","serif"]},theme:{name:"Analog 70s",darkMode:"light",recommendedDisplayStyle:"rounded",colors:{primary:"#c8621e",primaryHover:"#a04d14",success:"#7a8a2a",warning:"#d8a030",error:"#a03030",info:"#6a7a8a",accent:"#d8a830",focus:"#c8621e",surface:"#f5ead2",surfaceHover:"#ecdfc0"},backgrounds:{primary:"#f7ecd6",secondary:"#eeddb8",tertiary:"#e2c998",hover:"#d8bc80",elevated:"#fbf2de",inset:"#e8cfa5",canvas:"#f2e4c8"},text:{primary:"#2a1608",secondary:"#5a2e14",muted:"#a07852",inverse:"#f7ecd6"},borders:{color:"#b89868",width:"2px",divider:"#ccb285",radiusSm:"10px",radiusMd:"16px",radiusLg:"24px",radiusXl:"34px",radiusFull:"9999px"},shadows:{sm:"0 2px 0 0 rgba(42,22,8,0.12)",md:"0 4px 0 0 rgba(42,22,8,0.15), 0 6px 10px rgba(200,98,30,0.12)",lg:"0 6px 0 0 rgba(42,22,8,0.18), 0 10px 20px rgba(200,98,30,0.2)",xl:"0 8px 0 0 rgba(42,22,8,0.22), 0 20px 40px rgba(200,98,30,0.28)"},spacing:X,typography:{fontFamily:"'Work Sans', sans-serif",headingFontFamily:"'Abril Fatface', Georgia, serif",monoFontFamily:"'Space Mono', ui-monospace, monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.02em"},transitions:{fast:"180ms cubic-bezier(0.34,1.56,0.64,1)",normal:"280ms cubic-bezier(0.34,1.56,0.64,1)",slow:"440ms cubic-bezier(0.34,1.56,0.64,1)"}},displayStyle:"rounded",variantConfig:{radius:"xl",shadow:"md",density:"comfortable",animation:"playful"}},eo={meta:{id:"vhsTracking",name:"VHS Tracking",tagline:"Chromatic smear, scan-line haze, pixel type from another decade.",tags:["dark","retro","pixel","experimental"]},theme:{name:"VHS Tracking",darkMode:"dark",recommendedDisplayStyle:"retro8bit",colors:{primary:"#ff3eb5",primaryHover:"#ff5fc5",success:"#3eff90",warning:"#ffe83e",error:"#ff3e3e",info:"#3ee0ff",accent:"#3eff90",focus:"#ff3eb5",surface:"#120818",surfaceHover:"#1a0c24"},backgrounds:{primary:"#0a0412",secondary:"#120818",tertiary:"#1a0c24",hover:"#241230",elevated:"#120818",inset:"#050208",canvas:"#0a0412"},text:{primary:"#f8e8ff",secondary:"#c888d8",muted:"#605070",inverse:"#0a0412"},borders:{color:"#4a2864",width:"1px",divider:"#2a1840",focusColor:"#ff3eb5",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"0"},shadows:{sm:"-2px 0 0 rgba(255,62,181,0.5), 2px 0 0 rgba(62,224,255,0.5)",md:"-3px 0 0 rgba(255,62,181,0.6), 3px 0 0 rgba(62,224,255,0.6), 0 4px 12px rgba(0,0,0,0.6)",lg:"-4px 0 0 rgba(255,62,181,0.7), 4px 0 0 rgba(62,224,255,0.7), 0 8px 24px rgba(0,0,0,0.7)",xl:"-6px 0 0 rgba(255,62,181,0.8), 6px 0 0 rgba(62,224,255,0.8)",glow:"0 0 20px rgba(255,62,181,0.6)"},spacing:X,typography:{fontFamily:"'VT323', 'JetBrains Mono', monospace",headingFontFamily:"'VT323', monospace",monoFontFamily:"'VT323', monospace",fontSizeXs:"0.9375rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.375rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.35,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms steps(3)",normal:"100ms steps(5)",slow:"180ms steps(8)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #0a0412 0%, #120818 100%), repeating-linear-gradient(0deg, rgba(255,62,181,0.03) 0 2px, transparent 2px 4px)"}},displayStyle:"retro8bit",variantConfig:{radius:"none",shadow:"md",density:"normal",animation:"subtle"}},to={meta:{id:"typewriterPress",name:"Typewriter Press",tagline:"Ribbon red on cream — Courier bones, stamped display.",tags:["light","retro","mono","editorial"]},theme:{name:"Typewriter Press",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#b02020",primaryHover:"#8a1818",success:"#4a7038",warning:"#b08018",error:"#8a1818",info:"#3a5068",accent:"#1a1a1a",focus:"#b02020",surface:"#faf3df",surfaceHover:"#f0e7c6"},backgrounds:{primary:"#fbf5e3",secondary:"#f3e9c8",tertiary:"#ebdcab",hover:"#e2cf8f",elevated:"#fffae7",inset:"#efe0b0",canvas:"#fbf5e3"},text:{primary:"#1a1a1a",secondary:"#3d3428",muted:"#7a6f4a",inverse:"#fbf5e3"},borders:{color:"#1a1a1a",width:"1px",divider:"#c8b880",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"0 0 0 rgba(26,26,26,0), 1px 1px 0 rgba(26,26,26,0.12)",md:"1px 1px 0 rgba(26,26,26,0.15), 2px 2px 0 rgba(176,32,32,0.1)",lg:"2px 2px 0 rgba(26,26,26,0.2), 4px 4px 0 rgba(176,32,32,0.12)",xl:"3px 3px 0 rgba(26,26,26,0.25)"},spacing:X,typography:{fontFamily:"'Courier Prime', 'Courier New', monospace",headingFontFamily:"'Special Elite', 'Courier Prime', monospace",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.6,letterSpacing:"0.01em",headingLetterSpacing:"0.04em"},transitions:{fast:"40ms linear",normal:"80ms linear",slow:"140ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.2,blendMode:"multiply"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"subtle",density:"normal",animation:"none"}},ro={meta:{id:"y2kAqua",name:"Y2K Aqua",tagline:"Chrome and aqua — iMac blue, optimistic futurism, 2001 energy.",tags:["light","retro","glass"]},theme:{name:"Y2K Aqua",darkMode:"light",recommendedDisplayStyle:"modern3d",colors:{primary:"#0a84ff",primaryHover:"#0066cc",success:"#34c759",warning:"#ff9500",error:"#ff3b30",info:"#5ac8fa",accent:"#5ac8fa",focus:"#0a84ff",surface:"#f0f5fc",surfaceHover:"#e0ecfa"},backgrounds:{primary:"#e8f2fc",secondary:"#d8e8f8",tertiary:"#c0d8f0",hover:"#a8c8e8",elevated:"#ffffff",inset:"#c8dcf4",canvas:"#dce8f4"},text:{primary:"#0a1a30",secondary:"#304868",muted:"#6a88a8",inverse:"#ffffff"},borders:{color:"#a0c0e0",width:"1px",divider:"#c0d8f0",radiusSm:"6px",radiusMd:"10px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(10,132,255,0.15)",md:"inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 2px rgba(10,132,255,0.2), 0 2px 6px rgba(10,132,255,0.25), 0 4px 12px rgba(10,132,255,0.15)",lg:"inset 0 1px 0 rgba(255,255,255,0.95), 0 4px 12px rgba(10,132,255,0.3), 0 10px 24px rgba(90,200,250,0.25)",xl:"inset 0 2px 0 rgba(255,255,255,1), 0 8px 24px rgba(10,132,255,0.35), 0 20px 48px rgba(90,200,250,0.3)"},spacing:X,typography:{fontFamily:"'Chakra Petch', -apple-system, sans-serif",headingFontFamily:"'Chakra Petch', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5,letterSpacing:"0.01em",headingLetterSpacing:"-0.005em"},transitions:{fast:"140ms cubic-bezier(0.4,0,0.2,1)",normal:"240ms cubic-bezier(0.4,0,0.2,1)",slow:"380ms cubic-bezier(0.4,0,0.2,1)"},backgroundImage:{type:"gradient",gradient:"linear-gradient(180deg, #f0f7ff 0%, #d8e8f8 60%, #bcd6f0 100%)"}},displayStyle:"modern3d",variantConfig:{radius:"lg",shadow:"lg",density:"normal",animation:"normal"}},ao={meta:{id:"vogueDidone",name:"Vogue Didone",tagline:"Didone serif, arctic whitespace, one red heartbeat.",tags:["light","editorial","serif","luxury"]},theme:{name:"Vogue Didone",darkMode:"light",recommendedDisplayStyle:"editorial",colors:{primary:"#000000",primaryHover:"#1a1a1a",success:"#1f6a3a",warning:"#8a6a1a",error:"#c40018",info:"#2a4068",accent:"#c40018",focus:"#c40018",surface:"#ffffff",surfaceHover:"#f7f7f7"},backgrounds:{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f2f2f2",hover:"#ededed",elevated:"#ffffff",inset:"#f5f5f5",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#2a2a2a",muted:"#808080",inverse:"#ffffff"},borders:{color:"#000000",width:"1px",divider:"#dcdcdc",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"0 1px 0 0 #000000",xl:"0 2px 0 0 #000000"},spacing:qe,typography:{fontFamily:"'Inter', -apple-system, sans-serif",headingFontFamily:"'Playfair Display', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:900,lineHeight:1.7,letterSpacing:"0.02em",headingLetterSpacing:"-0.03em"},transitions:{fast:"120ms ease",normal:"220ms ease",slow:"360ms ease"}},displayStyle:"editorial",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},no={meta:{id:"comicHalftone",name:"Comic Halftone",tagline:"CMYK pop — halftone dots, action type, offset ink shadows.",tags:["light","editorial","playful"]},theme:{name:"Comic Halftone",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#e8182c",primaryHover:"#c01020",success:"#1ea862",warning:"#f0c820",error:"#e8182c",info:"#1878c8",accent:"#1878c8",focus:"#e8182c",surface:"#fffdf4",surfaceHover:"#fff8d8"},backgrounds:{primary:"#fffef0",secondary:"#fff6b8",tertiary:"#ffe870",hover:"#ffd838",elevated:"#ffffff",inset:"#fff090",canvas:"#fffdec"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#fffef0"},borders:{color:"#0a0a0a",width:"3px",divider:"#0a0a0a",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #0a0a0a",md:"5px 5px 0 0 #0a0a0a",lg:"6px 6px 0 0 #e8182c, 10px 10px 0 0 #0a0a0a",xl:"8px 8px 0 0 #1878c8, 12px 12px 0 0 #0a0a0a"},spacing:X,typography:{fontFamily:"'Archivo', -apple-system, sans-serif",headingFontFamily:"'Bangers', 'Archivo Black', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2.125rem",fontWeightNormal:500,fontWeightMedium:600,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"0.03em"},transitions:{fast:"100ms cubic-bezier(0.34,1.56,0.64,1)",normal:"200ms cubic-bezier(0.34,1.56,0.64,1)",slow:"320ms cubic-bezier(0.34,1.56,0.64,1)"},backgroundImage:{type:"pattern",pattern:"dots",opacity:.5}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},so={meta:{id:"zinePunk",name:"Zine Punk",tagline:"Photocopier grain, marker headlines, cut-and-paste attitude.",tags:["light","editorial","experimental","brutalist"]},theme:{name:"Zine Punk",darkMode:"light",recommendedDisplayStyle:"brutalist",colors:{primary:"#0a0a0a",primaryHover:"#000000",success:"#1a1a1a",warning:"#2a2a2a",error:"#0a0a0a",info:"#1a1a1a",accent:"#0a0a0a",focus:"#0a0a0a",surface:"#f5f3ee",surfaceHover:"#e8e4d8"},backgrounds:{primary:"#efece0",secondary:"#e3dfd0",tertiary:"#d4d0c0",hover:"#c8c4b4",elevated:"#f5f3ee",inset:"#e0dcc8",canvas:"#ede8d8"},text:{primary:"#0a0a0a",secondary:"#1a1a1a",muted:"#505050",inverse:"#efece0"},borders:{color:"#0a0a0a",width:"2px",divider:"#0a0a0a",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"2px 3px 0 rgba(10,10,10,0.9)",md:"4px 6px 0 rgba(10,10,10,0.9), -2px 2px 0 rgba(10,10,10,0.3)",lg:"6px 10px 0 rgba(10,10,10,1), -4px 2px 0 rgba(10,10,10,0.4)",xl:"10px 14px 0 rgba(10,10,10,1)"},spacing:X,typography:{fontFamily:"'Special Elite', 'Courier Prime', monospace",headingFontFamily:"'Permanent Marker', 'Special Elite', cursive",monoFontFamily:"'Courier Prime', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:400,fontWeightSemibold:400,fontWeightBold:400,lineHeight:1.5,letterSpacing:"0.02em",headingLetterSpacing:"0.01em"},transitions:{fast:"20ms linear",normal:"60ms linear",slow:"120ms linear"},backgroundImage:{type:"pattern",pattern:"noise",opacity:.3,blendMode:"multiply"}},displayStyle:"brutalist",variantConfig:{radius:"none",shadow:"lg",density:"normal",animation:"none"}},oo={meta:{id:"watercolorWash",name:"Watercolor Wash",tagline:"Soft pastel bleeds, handwritten headings, paper gentleness.",tags:["light","artistic","pastel","organic"]},theme:{name:"Watercolor Wash",darkMode:"light",recommendedDisplayStyle:"softCloud",colors:{primary:"#9d7bc4",primaryHover:"#8262ab",success:"#7bb88a",warning:"#e0a868",error:"#d47878",info:"#7ba8c4",accent:"#e0a0c0",focus:"#9d7bc4",surface:"rgba(255,250,245,0.8)",surfaceHover:"rgba(250,240,238,0.9)"},backgrounds:{primary:"#fdf8f4",secondary:"#f8eee6",tertiary:"#f0e0d4",hover:"#e8d2c0",elevated:"#ffffff",inset:"#f4e4d8",canvas:"#fdf8f4"},text:{primary:"#3a2845",secondary:"#6a5868",muted:"#a89ca4",inverse:"#fdf8f4"},borders:{color:"#e8d4c8",width:"1px",divider:"#f0e0d4",radiusSm:"10px",radiusMd:"18px",radiusLg:"30px",radiusXl:"44px",radiusFull:"9999px"},shadows:{sm:"0 2px 10px rgba(157,123,196,0.08)",md:"0 6px 24px rgba(157,123,196,0.12), 0 2px 4px rgba(224,160,192,0.06)",lg:"0 16px 40px rgba(157,123,196,0.18), 0 6px 12px rgba(224,160,192,0.1)",xl:"0 30px 64px rgba(157,123,196,0.22)"},spacing:Ee,typography:{fontFamily:"'Quicksand', -apple-system, sans-serif",headingFontFamily:"'Caveat', 'Quicksand', cursive",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"2rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.65,letterSpacing:"0",headingLetterSpacing:"-0.005em"},transitions:{fast:"220ms cubic-bezier(0.22,1,0.36,1)",normal:"380ms cubic-bezier(0.22,1,0.36,1)",slow:"600ms cubic-bezier(0.22,1,0.36,1)"},backgroundImage:{type:"gradient",gradient:"radial-gradient(at 18% 22%, rgba(232,208,220,0.5) 0%, transparent 40%), radial-gradient(at 82% 28%, rgba(200,220,240,0.45) 0%, transparent 45%), radial-gradient(at 35% 80%, rgba(232,228,200,0.4) 0%, transparent 50%), linear-gradient(180deg, #fdf8f4 0%, #f8eee6 100%)"}},displayStyle:"softCloud",variantConfig:{radius:"xl",density:"comfortable",animation:"normal"}},io={meta:{id:"memphis80s",name:"Memphis 80s",tagline:"Squiggle chaos — cyan, pink, yellow, serious typography, no.",tags:["light","artistic","playful"]},theme:{name:"Memphis 80s",darkMode:"light",recommendedDisplayStyle:"playful",colors:{primary:"#f02080",primaryHover:"#c81868",success:"#28c868",warning:"#f8d820",error:"#f02040",info:"#20b8e8",accent:"#f8d820",focus:"#20b8e8",surface:"#fffffa",surfaceHover:"#fff7d0"},backgrounds:{primary:"#fffceb",secondary:"#fff2d0",tertiary:"#ffe8b4",hover:"#ffdd98",elevated:"#ffffff",inset:"#fff0c0",canvas:"#fffbe0"},text:{primary:"#0a0a1a",secondary:"#2a2a3a",muted:"#6a6a7a",inverse:"#fffceb"},borders:{color:"#0a0a1a",width:"2px",divider:"#0a0a1a",radiusSm:"4px",radiusMd:"6px",radiusLg:"10px",radiusXl:"14px",radiusFull:"9999px"},shadows:{sm:"3px 3px 0 0 #20b8e8",md:"4px 4px 0 0 #f02080, 8px 8px 0 0 #f8d820",lg:"5px 5px 0 0 #28c868, 10px 10px 0 0 #20b8e8, 15px 15px 0 0 #f02080",xl:"6px 6px 0 0 #f8d820, 12px 12px 0 0 #f02080, 18px 18px 0 0 #20b8e8"},spacing:X,typography:{fontFamily:"'Rubik', -apple-system, sans-serif",headingFontFamily:"'Rubik Mono One', 'Rubik', sans-serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.8125rem",fontSizeSm:"0.9375rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.875rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:800,lineHeight:1.4,letterSpacing:"0",headingLetterSpacing:"-0.01em"},transitions:{fast:"120ms cubic-bezier(0.68,-0.55,0.27,1.55)",normal:"220ms cubic-bezier(0.68,-0.55,0.27,1.55)",slow:"360ms cubic-bezier(0.68,-0.55,0.27,1.55)"},backgroundImage:{type:"pattern",pattern:"zigzag",opacity:.3}},displayStyle:"playful",variantConfig:{radius:"sm",shadow:"lg",density:"normal",animation:"playful"}},co={meta:{id:"inkSumie",name:"Ink Sumi-e",tagline:"Charcoal brush on rice paper — vast silence, one red seal.",tags:["light","artistic","serif","minimal"]},theme:{name:"Ink Sumi-e",darkMode:"light",recommendedDisplayStyle:"zen",colors:{primary:"#1a1a1a",primaryHover:"#000000",success:"#2a4a2a",warning:"#705820",error:"#b82020",info:"#2a4060",accent:"#b82020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f7f3"},backgrounds:{primary:"#fdfcf7",secondary:"#f5f3eb",tertiary:"#ebe8dc",hover:"#dfdbcc",elevated:"#ffffff",inset:"#f0edde",canvas:"#fdfcf7"},text:{primary:"#1a1a1a",secondary:"#3a3a3a",muted:"#888482",inverse:"#fdfcf7"},borders:{color:"#1a1a1a",width:"1px",divider:"#d8d4c4",radiusSm:"0",radiusMd:"0",radiusLg:"1px",radiusXl:"2px",radiusFull:"9999px"},shadows:{sm:"none",md:"none",lg:"none",xl:"0 0 0 1px #1a1a1a"},spacing:qe,typography:{fontFamily:"'Noto Sans JP', -apple-system, sans-serif",headingFontFamily:"'Noto Serif JP', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.9375rem",fontSizeLg:"1.0625rem",fontSizeXl:"1.625rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:700,lineHeight:1.85,letterSpacing:"0.04em",headingLetterSpacing:"0"},transitions:{fast:"200ms ease",normal:"340ms ease",slow:"520ms ease"}},displayStyle:"zen",variantConfig:{radius:"none",shadow:"none",density:"spacious",animation:"subtle"}},lo={meta:{id:"dieterRams",name:"Dieter Rams",tagline:"Less-but-better — warm gray, single yellow dot, measured everything.",tags:["light","minimal","industrial"]},theme:{name:"Dieter Rams",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#1a1a1a",primaryHover:"#0a0a0a",success:"#3a7840",warning:"#e8c020",error:"#c83028",info:"#3868a0",accent:"#e8c020",focus:"#1a1a1a",surface:"#ffffff",surfaceHover:"#f8f8f8"},backgrounds:{primary:"#fbfbf9",secondary:"#f2f2ee",tertiary:"#e8e8e2",hover:"#dedeD6",elevated:"#ffffff",inset:"#ededE7",canvas:"#f5f5f1"},text:{primary:"#0a0a0a",secondary:"#3a3a38",muted:"#888880",inverse:"#fbfbf9"},borders:{color:"#d4d4ce",width:"1px",divider:"#e0e0da",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 1px 0 0 rgba(0,0,0,0.04)",md:"0 1px 0 0 rgba(0,0,0,0.06), 0 4px 8px -2px rgba(0,0,0,0.06)",lg:"0 2px 0 0 rgba(0,0,0,0.08), 0 10px 20px -6px rgba(0,0,0,0.1)",xl:"0 20px 40px -12px rgba(0,0,0,0.14)"},spacing:Os,typography:{fontFamily:"'IBM Plex Sans', -apple-system, sans-serif",headingFontFamily:"'IBM Plex Sans', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.55,letterSpacing:"0",headingLetterSpacing:"-0.015em"},transitions:{fast:"100ms cubic-bezier(0.4,0,0.2,1)",normal:"180ms cubic-bezier(0.4,0,0.2,1)",slow:"280ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"swiss",variantConfig:{radius:"sm",shadow:"subtle",density:"compact",animation:"subtle"}},uo={meta:{id:"blackTieGala",name:"Black Tie Gala",tagline:"Absolute black, hand-gilded detail, whispered serif elegance.",tags:["dark","luxury","serif"]},theme:{name:"Black Tie Gala",darkMode:"dark",recommendedDisplayStyle:"luxe",colors:{primary:"#c89848",primaryHover:"#e0b868",success:"#68a878",warning:"#e0b050",error:"#c85858",info:"#8aa8d0",accent:"#e8d0a0",focus:"#c89848",surface:"#0e0e0e",surfaceHover:"#161616"},backgrounds:{primary:"#050505",secondary:"#0e0e0e",tertiary:"#161616",hover:"#1e1e1e",elevated:"#0e0e0e",inset:"#020202",canvas:"#030303"},text:{primary:"#f0ead8",secondary:"#a89870",muted:"#605848",inverse:"#050505"},borders:{color:"#3a2e18",width:"1px",divider:"#241a0c",focusColor:"#c89848",radiusSm:"1px",radiusMd:"2px",radiusLg:"3px",radiusXl:"4px",radiusFull:"9999px"},shadows:{sm:"0 0 0 1px rgba(200,152,72,0.1)",md:"0 4px 16px rgba(0,0,0,0.8), 0 0 0 1px rgba(200,152,72,0.15)",lg:"0 10px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(200,152,72,0.25), inset 0 1px 0 rgba(232,208,160,0.08)",xl:"0 24px 56px rgba(0,0,0,1), 0 0 0 1px rgba(200,152,72,0.35)",glow:"0 0 24px rgba(200,152,72,0.25)"},spacing:Ee,typography:{fontFamily:"'Cormorant Garamond', Georgia, serif",headingFontFamily:"'Cormorant Garamond', Georgia, serif",monoFontFamily:"'JetBrains Mono', monospace",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.125rem",fontSizeXl:"1.75rem",fontWeightNormal:300,fontWeightMedium:400,fontWeightSemibold:500,fontWeightBold:600,lineHeight:1.65,letterSpacing:"0.05em",headingLetterSpacing:"0.08em"},transitions:{fast:"180ms cubic-bezier(0.4,0,0.2,1)",normal:"320ms cubic-bezier(0.4,0,0.2,1)",slow:"500ms cubic-bezier(0.4,0,0.2,1)"}},displayStyle:"luxe",variantConfig:{radius:"sm",shadow:"lg",density:"spacious",animation:"subtle"}},fo={meta:{id:"swissGrid",name:"Swiss Grid",tagline:"Akzidenz rigor — white, black, one red, grid discipline.",tags:["light","minimal","editorial"]},theme:{name:"Swiss Grid",darkMode:"light",recommendedDisplayStyle:"swiss",colors:{primary:"#e30613",primaryHover:"#b8040f",success:"#00683d",warning:"#b8700a",error:"#e30613",info:"#004c98",accent:"#e30613",focus:"#e30613",surface:"#ffffff",surfaceHover:"#f5f5f5"},backgrounds:{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#e0e0e0",elevated:"#ffffff",inset:"#f0f0f0",canvas:"#ffffff"},text:{primary:"#0a0a0a",secondary:"#2a2a2a",muted:"#707070",inverse:"#ffffff"},borders:{color:"#0a0a0a",width:"1px",divider:"#d0d0d0",radiusSm:"0",radiusMd:"0",radiusLg:"0",radiusXl:"0",radiusFull:"9999px"},shadows:{sm:"none",md:"0 1px 0 0 rgba(10,10,10,0.1)",lg:"0 2px 0 0 rgba(10,10,10,0.12)",xl:"0 4px 0 0 rgba(10,10,10,0.15)"},spacing:Os,typography:{fontFamily:"'Inter', 'Helvetica Neue', sans-serif",headingFontFamily:"'Inter', 'Helvetica Neue', sans-serif",monoFontFamily:"'IBM Plex Mono', monospace",fontSizeXs:"0.6875rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:700,fontWeightBold:700,lineHeight:1.45,letterSpacing:"0",headingLetterSpacing:"-0.03em"},transitions:{fast:"60ms linear",normal:"120ms linear",slow:"200ms linear"}},displayStyle:"swiss",variantConfig:{radius:"none",shadow:"none",density:"compact",animation:"subtle"}},Ft={forestCanopy:_s,desertDune:Ws,arcticCrystal:Vs,autumnFoliage:Xs,japaneseWashi:Us,moroccanMosaic:qs,artDecoGatsby:Gs,sovietConstructivist:Ks,blueprint:Js,hologramUI:Ys,deepSea:Qs,analog70s:Zs,vhsTracking:eo,typewriterPress:to,y2kAqua:ro,vogueDidone:ao,comicHalftone:no,zinePunk:so,watercolorWash:oo,memphis80s:io,inkSumie:co,dieterRams:lo,blackTieGala:uo,swissGrid:fo},mo=Object.values(Ft);function jd(e){return Ft[e]}function Bd(e){return mo.filter(t=>t.meta.tags.includes(e))}function Od(e,t){return e??t.recommendedDisplayStyle??"default"}function Kt(e){return e.toLowerCase().replace(/[\s_-]+/g,"")}function Jt(e){if(e&&typeof e=="object")return e;if(typeof e=="string"){const t=Kt(e),r=lt.find(a=>Kt(a.name)===t);if(r)return r;process.env.NODE_ENV!=="production"&&console.warn(`[@nice2dev/ui] <NiceThemeProvider theme="${e}"> — unknown preset name. Falling back to 'Light'. Available: ${lt.map(a=>a.name).join(", ")}.`)}return zt}const po=({theme:e,darkTheme:t,variantConfig:r,darkMode:a,displayStyle:n,animateTransitions:s=!0,children:i})=>{const o=c.useMemo(()=>Jt(e),[e]),l=c.useMemo(()=>t===void 0?void 0:Jt(t),[t]),d=c.useId(),u=c.useMemo(()=>`p${d.replace(/:/g,"")}`,[d]),f=c.useRef(null),p=c.useRef(null),[h,m]=c.useState(null),[y,g]=c.useState(o),[v,b]=c.useState(!1),[S,w]=c.useState(()=>Od(n,o));c.useEffect(()=>{n!==void 0?w(n):o.recommendedDisplayStyle&&w(o.recommendedDisplayStyle)},[n,o.recommendedDisplayStyle]),c.useEffect(()=>{const E=window.matchMedia("(prefers-color-scheme: dark)");b(E.matches);const R=T=>b(T.matches);return E.addEventListener("change",R),()=>E.removeEventListener("change",R)},[]);const A=a??o.darkMode??"light",k=A==="dark"||A==="auto"&&v;c.useEffect(()=>{g(k&&l?l:o)},[o,l,k]),c.useEffect(()=>{if(typeof document>"u")return;const E=document.createElement("div");return E.className="nice-theme-scope nice-theme-portal-host",E.dataset.ntdProvider=u,E.style.display="contents",document.body.appendChild(E),p.current=E,m(E),()=>{E.parentNode&&E.parentNode.removeChild(E),p.current=null,m(null)}},[u]),c.useEffect(()=>{const E=f.current;if(!E)return;s&&(E.style.transition="background-color 300ms ease, color 300ms ease");const R=De(y);for(const[F,z]of Object.entries(R))E.style.setProperty(F,z);const T=p.current;if(T)for(const[F,z]of Object.entries(R))T.style.setProperty(F,z);E.style.colorScheme=k?"dark":"light",E.dataset.ntdColorScheme=k?"dark":"light",E.dataset.theme=k?"dark":"light",k?E.classList.add("nice-dark"):E.classList.remove("nice-dark"),T&&(T.style.colorScheme=k?"dark":"light",T.dataset.ntdColorScheme=k?"dark":"light",T.dataset.theme=k?"dark":"light",k?T.classList.add("nice-dark"):T.classList.remove("nice-dark"));const D=y.backgroundImage;return D&&D.type!=="none"&&D.type==="gradient"&&D.gradient&&E.style.setProperty("--ntd-bg-image",D.gradient),()=>{E&&Aa(E)}},[y,k,s,h]);const C=c.useRef(new Set);c.useEffect(()=>{if(process.env.NODE_ENV==="production"||typeof window>"u"||typeof document>"u")return;const E=window.setTimeout(()=>{const R=De(y),T=["--color-primary","--nice-primary","--bg-primary","--text-primary"].find(H=>R[H])??Object.keys(R)[0];if(!T)return;const D=String(R[T]??"").trim();if(!D)return;const F=getComputedStyle(document.documentElement).getPropertyValue(T).trim();if(!F||F===D)return;const z=`${u}::${y.name??"unnamed"}::${T}`;C.current.has(z)||(C.current.add(z),console.warn(`[NiceThemeProvider] CSS var "${T}" on documentElement (${F}) does not match the active provider pack "${y.name??"unnamed"}" (${D}). An external applyTheme(...) call (or other code) is overriding the provider — portaled overlays and components reading from :root will look inconsistent. Either remove the external applyTheme call or wrap your app entirely in a single NiceThemeProvider.`))},0);return()=>window.clearTimeout(E)},[y,u]),c.useEffect(()=>{const E=f.current;if(!E)return;const R=r?{...K,...r}:be(S);pt(R,E,u);const T=dr(S);for(const[D,F]of Object.entries(T))E.setAttribute(D,F);return()=>{cr(u,E)}},[r,S,u]);const M=c.useCallback(E=>{g(E)},[]),N=c.useMemo(()=>({theme:y,setTheme:M,portalTarget:h}),[y,M,h]),L=c.useMemo(()=>({displayStyle:S,variantConfig:be(S),setDisplayStyle:w}),[S]);return x.jsx(Rt.Provider,{value:N,children:x.jsx($e.Provider,{value:L,children:x.jsx("div",{ref:f,className:"nice-theme-scope","data-ntd-provider":u,style:{display:"contents"},children:i})})})};po.displayName="NiceThemeProvider";const go=c.createContext(null);function yo(){const e=c.useContext(go);if(!e)throw new Error("useThemeVariants must be used within NiceThemeVariantProvider");return e}function _d({initialConfig:e,storageKey:t="ntd-variant-config",autoApply:r=!0,children:a}){const[n,s]=c.useState(()=>{if(typeof window<"u"&&t){const d=localStorage.getItem(t);if(d)try{return{...K,...JSON.parse(d)}}catch{}}return{...K,...e}});c.useEffect(()=>{r&&typeof window<"u"&&pt(n)},[n,r]),c.useEffect(()=>{typeof window<"u"&&t&&localStorage.setItem(t,JSON.stringify(n))},[n,t]);const i=c.useCallback(d=>{s(u=>({...u,...d}))},[]),o=c.useCallback(d=>{const u=He[d];u&&s(u)},[]),l=c.useCallback(()=>{s(K)},[]);return x.jsx(go.Provider,{value:{config:n,setConfig:i,applyPreset:o,reset:l},children:a})}function Wd({showPresets:e=!0,showPreview:t=!0,showCSS:r=!1,collapsible:a=!0,className:n,style:s}){const{config:i,setConfig:o,applyPreset:l,reset:d}=yo(),[u,f]=c.useState(new Set(["presets","radius","shadow"])),p=m=>{a&&f(y=>{const g=new Set(y);return g.has(m)?g.delete(m):g.add(m),g})},h=m=>!a||u.has(m);return x.jsxs("div",{className:`ntd-theme-variant-configurator ${n||""}`,style:{fontFamily:"system-ui, sans-serif",fontSize:"14px",...s},children:[e&&x.jsx(q,{title:"Presets",expanded:h("presets"),onToggle:()=>p("presets"),children:x.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[Object.keys(He).map(m=>x.jsx("button",{onClick:()=>l(m),style:{padding:"6px 12px",border:"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:"var(--bg-secondary, #f9fafb)",cursor:"pointer",textTransform:"capitalize"},children:m},m)),x.jsx("button",{onClick:d,style:{padding:"6px 12px",border:"1px solid var(--nice-danger-dark, #dc2626)",borderRadius:"6px",background:"var(--danger-bg, #fef2f2)",color:"var(--color-error, #dc2626)",cursor:"pointer"},children:"Reset"})]})}),x.jsx(q,{title:"Border Radius",expanded:h("radius"),onToggle:()=>p("radius"),children:x.jsx(oe,{options:Object.keys(he),value:i.radius,onChange:m=>o({radius:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--color-accent, #6366f1)",borderRadius:he[m].md}})})}),x.jsx(q,{title:"Shadows",expanded:h("shadow"),onToggle:()=>p("shadow"),children:x.jsx(oe,{options:Object.keys(Re),value:i.shadow,onChange:m=>o({shadow:m}),renderPreview:m=>x.jsx("div",{style:{width:"24px",height:"24px",background:"var(--bg-primary, #fff)",borderRadius:"4px",boxShadow:Re[m]}})})}),x.jsx(q,{title:"Button Style",expanded:h("button"),onToggle:()=>p("button"),children:x.jsx(oe,{options:["flat","raised","outlined","ghost","soft","gradient","3d","neumorphic"],value:i.buttonStyle,onChange:m=>o({buttonStyle:m})})}),x.jsx(q,{title:"Input Style",expanded:h("input"),onToggle:()=>p("input"),children:x.jsx(oe,{options:["bordered","filled","underlined","floating","soft","neumorphic"],value:i.inputStyle,onChange:m=>o({inputStyle:m})})}),x.jsx(q,{title:"Card Style",expanded:h("card"),onToggle:()=>p("card"),children:x.jsx(oe,{options:["flat","elevated","bordered","glass","gradient","neumorphic"],value:i.cardStyle,onChange:m=>o({cardStyle:m})})}),x.jsx(q,{title:"Animation",expanded:h("animation"),onToggle:()=>p("animation"),children:x.jsx(oe,{options:Object.keys(Fe),value:i.animation,onChange:m=>o({animation:m})})}),x.jsx(q,{title:"Density",expanded:h("density"),onToggle:()=>p("density"),children:x.jsx(oe,{options:Object.keys(ve),value:i.density,onChange:m=>o({density:m})})}),t&&x.jsx(q,{title:"Preview",expanded:h("preview"),onToggle:()=>p("preview"),children:x.jsx(Vd,{config:i})}),r&&x.jsx(q,{title:"Generated CSS",expanded:h("css"),onToggle:()=>p("css"),children:x.jsx("pre",{style:{background:"var(--text-primary, #1f2937)",color:"var(--border-color, #e5e7eb)",padding:"12px",borderRadius:"6px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:mt(i)})})]})}function q({title:e,expanded:t,onToggle:r,children:a}){return x.jsxs("div",{style:{marginBottom:"16px"},children:[x.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 0",border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:"var(--text-secondary, #374151)",textAlign:"left"},children:[x.jsx("span",{style:{transform:t?"rotate(90deg)":"none",transition:"transform 150ms"},children:"▶"}),e]}),t&&x.jsx("div",{style:{paddingLeft:"20px",paddingTop:"8px"},children:a})]})}function oe({options:e,value:t,onChange:r,renderPreview:a}){return x.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:e.map(n=>x.jsxs("button",{onClick:()=>r(n),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",border:t===n?"2px solid var(--nice-info, #6366f1)":"1px solid var(--border-color, #e5e7eb)",borderRadius:"6px",background:t===n?"var(--nice-primary-bg, #eef2ff)":"var(--bg-primary, #fff)",cursor:"pointer",textTransform:"capitalize",fontSize:"13px"},children:[a&&a(n),n]},n))})}function Vd({config:e}){const t=dt(e.buttonStyle,"var(--color-accent, #6366f1)"),r=ut(e.inputStyle),a=ft(e.cardStyle),n=he[e.radius],s=ve[e.density];return x.jsxs("div",{style:{padding:"20px",background:"var(--bg-secondary, #f9fafb)",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"16px"},children:[x.jsxs("div",{style:{padding:s.paddingX,borderRadius:n.lg,...a},children:[x.jsx("h4",{style:{margin:"0 0 12px",fontSize:s.fontSize},children:"Card Preview"}),x.jsxs("div",{style:{display:"flex",gap:s.gap,marginBottom:"12px"},children:[x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,color:"var(--bg-primary, #fff)",fontSize:s.fontSize,cursor:"pointer",...t},children:"Primary"}),x.jsx("button",{style:{padding:`${s.paddingY} ${s.paddingX}`,borderRadius:n.md,background:"var(--border-color, #e5e7eb)",border:"none",fontSize:s.fontSize,cursor:"pointer"},children:"Secondary"})]}),x.jsx("input",{type:"text",placeholder:"Input preview...",style:{width:"100%",height:s.inputHeight,padding:`0 ${s.paddingX}`,fontSize:s.fontSize,outline:"none",boxSizing:"border-box",...r}})]}),x.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:["Info","Success","Warning","Error"].map(i=>x.jsx("span",{style:{padding:"4px 10px",borderRadius:n.full,background:"var(--border-color, #e5e7eb)",fontSize:"12px"},children:i},i))})]})}function Xd(e){const[t,r]=c.useState(()=>typeof window>"u"?!1:Yt());return c.useEffect(()=>{var d,u,f;if(typeof window>"u")return;const a=()=>(e==null?void 0:e.current)??document.documentElement,n=()=>r(Yt(a()));n();const s=new MutationObserver(n),i={attributes:!0,attributeFilter:["data-theme","class","style"]};s.observe(document.documentElement,i);const o=(u=(d=e==null?void 0:e.current)==null?void 0:d.closest)==null?void 0:u.call(d,"[data-theme], .nice-dark, .nice-light, .dark");o&&o!==document.documentElement&&s.observe(o,i);const l=window.matchMedia("(prefers-color-scheme: dark)");return(f=l.addEventListener)==null||f.call(l,"change",n),()=>{var p;s.disconnect(),(p=l.removeEventListener)==null||p.call(l,"change",n)}},[e]),t}function Yt(e=document.documentElement){var t,r;try{const a=((t=e.closest)==null?void 0:t.call(e,"[data-theme], .nice-dark, .nice-light, .dark"))??document.documentElement,n=a.getAttribute("data-theme");if(n==="dark")return!0;if(n==="light")return!1;if(a.classList.contains("nice-dark")||a.classList.contains("dark"))return!0;if(a.classList.contains("nice-light"))return!1;const s=getComputedStyle(e),i=s.getPropertyValue("--text-primary").trim()||s.color;if(i){const o=i.match(/rgba?\(([^)]+)\)/);if(o){const[l,d,u]=o[1].split(",").map(f=>parseFloat(f.trim()));return(.299*l+.587*d+.114*u)/255>.5}if(/^#([0-9a-f]{3,8})$/i.test(i)){const l=i.replace("#",""),d=l.length===3?l.split("").map(h=>h+h).join(""):l.slice(0,6),u=parseInt(d.slice(0,2),16),f=parseInt(d.slice(2,4),16),p=parseInt(d.slice(4,6),16);return(.299*u+.587*f+.114*p)/255>.5}}return((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}catch{return!1}}const Ud=["NiceTextInput","NiceTextArea","NiceNumberInput","NiceDateTimePicker","NiceSelect","NiceCheckbox","NiceToggle","NiceRadioGroup","NiceSlider","NiceColorPicker","NiceAutocomplete","NiceLookup","NiceCalendar","NiceDateRangeBox","NiceTagBox","NiceRangeSlider","NiceDropDownBox","NiceHtmlEditor","NiceForm","NiceRating","NiceOtpInput","NiceMentionInput","NiceTreeSelect","NiceMaskedInput","NiceKnob","NicePickList","NiceInlineEdit","NiceButton","NiceButtonGroup","NiceDropDownButton","NiceSpeedDialAction","NiceTable","NiceDataGrid","NiceList","NiceTreeView","NiceTreeList","NiceTileView","NicePivotGrid","NiceKanbanBoard","NiceSpreadsheet","NiceBadge","NiceTag","NiceAvatar","NiceAvatarGroup","NiceProgress","NiceDivider","NiceTooltip","NiceSkeleton","NiceSpinner","NiceEmpty","NiceTimeline","NiceCarousel","NiceVirtualScroller","NiceAlert","NiceModal","NiceDrawer","NiceToastContainer","NiceConfirmDialog","NiceCookieConsent","NiceTabs","NiceAccordion","NiceBreadcrumb","NicePagination","NiceCard","NiceMenu","NiceContextMenu","NiceSplitter","NiceAppLayout","NiceDashboardLayout","NiceDesktop","NiceConsole","NiceChart","NicePieChart","NicePolarChart","NiceCircularGauge","NiceLinearGauge","NiceBarGauge","NiceSparkline","NiceBullet","NiceFunnel","NiceSankey","NiceRangeSelector","NiceVectorMap","NiceHeatMap","NiceTreeMap","NiceStockChart","NiceOrganizationChart","NiceActionSheet","NicePopover","NiceLoadPanel","NiceWindow","NiceBlockUI","NiceScheduler","NiceGantt","NiceDiagram","NiceStepper","NiceBox","NiceResponsiveBox","NiceResizable","NiceScrollView","NiceChat","NiceUpload","NiceFileManager","NiceFilterBuilder","NiceGallery","NiceMap","div","span","row","column","stack","container"];function qd(e){const t=[];ho(e.root,t,"root");const r=new Set((e.dataSources??[]).map(a=>a.id));return bo(e.root,r,t),t}function ho(e,t,r){if((!e.type||e.type.trim()==="")&&t.push(`${r}: type is empty`),e.children)for(let a=0;a<e.children.length;a++)ho(e.children[a],t,`${r}.children[${a}]`)}function bo(e,t,r){if(e.bindings)for(const[a,n]of Object.entries(e.bindings)){const s=n.split(".")[0];!t.has(s)&&s!=="form"&&s!=="route"&&r.push(`Binding "${a}" references unknown data source "${s}"`)}if(e.children)for(const a of e.children)bo(a,t,r)}function Gd(e,t){const r=Kd(t,e.field);switch(e.operator){case"eq":return r===e.value;case"neq":return r!==e.value;case"gt":return r>e.value;case"gte":return r>=e.value;case"lt":return r<e.value;case"lte":return r<=e.value;case"contains":return String(r).includes(String(e.value));case"empty":return r==null||String(r)==="";case"notEmpty":return r!=null&&String(r)!=="";default:return!0}}function Kd(e,t){const r=t.split(".");let a=e;for(const n of r)if(a&&typeof a=="object"&&n in a)a=a[n];else return;return a}function vo(e){const{itemCount:t,itemHeight:r,containerHeight:a,overscan:n=3,initialScrollTop:s=0}=e,[i,o]=c.useState(s),[l,d]=c.useState(!1),u=c.useRef(),f=c.useMemo(()=>{if(typeof r=="number")return null;const k=new Array(t+1);k[0]=0;for(let C=0;C<t;C++)k[C+1]=k[C]+r(C);return k},[t,r]),p=c.useMemo(()=>typeof r=="number"?t*r:f?f[t]:0,[t,r,f]),h=c.useCallback(k=>typeof r=="number"?r:r(k),[r]),m=c.useCallback(k=>typeof r=="number"?k*r:f?f[k]:0,[r,f]),y=c.useCallback(k=>{if(typeof r=="number")return Math.floor(k/r);if(!f)return 0;let C=0,M=t-1;for(;C<=M;){const N=Math.floor((C+M)/2),L=f[N];if(L===k)return N;L<k?C=N+1:M=N-1}return Math.max(0,C-1)},[t,r,f]),{startIndex:g,endIndex:v,visibleItems:b}=c.useMemo(()=>{const k=Math.max(0,y(i)-n);let C=k,M=m(k);for(;C<t&&M<i+a;)M+=h(C),C++;C=Math.min(t,C+n);const N=[];for(let L=k;L<C;L++)N.push({index:L,offset:m(L),height:h(L),key:L});return{startIndex:k,endIndex:C,visibleItems:N}},[i,a,t,n,y,m,h]),S=c.useCallback(k=>{const C=k.currentTarget;o(C.scrollTop),d(!0),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{d(!1)},150)},[]),w=c.useCallback((k,C="start")=>{const M=m(k),N=h(k);let L;switch(C){case"center":L=M-a/2+N/2;break;case"end":L=M-a+N;break;default:L=M}o(Math.max(0,Math.min(L,p-a)))},[m,h,a,p]),A=c.useCallback(k=>{o(Math.max(0,Math.min(k,p-a)))},[p,a]);return c.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current)},[]),{visibleItems:b,totalHeight:p,scrollTop:i,scrollToIndex:w,scrollTo:A,onScroll:S,startIndex:g,endIndex:v,isScrolling:l}}function Jd(e){const{rowCount:t,columnCount:r,rowHeight:a,columnWidth:n,containerHeight:s,containerWidth:i,overscan:o=2}=e,[l,d]=c.useState(0),[u,f]=c.useState(0),[p,h]=c.useState(!1),m=c.useRef(),y=c.useMemo(()=>{if(typeof a=="number")return t*a;let S=0;for(let w=0;w<t;w++)S+=a(w);return S},[t,a]),g=c.useMemo(()=>{if(typeof n=="number")return r*n;let S=0;for(let w=0;w<r;w++)S+=n(w);return S},[r,n]),v=c.useMemo(()=>{const S=[];let w=0,A=0;if(typeof a=="number")w=Math.floor(l/a),A=w*a;else for(;w<t&&A+a(w)<l;)A+=a(w),w++;w=Math.max(0,w-o);let k=w,C=typeof a=="number"?w*a:A;for(;k<t&&C<l+s;)C+=typeof a=="number"?a:a(k),k++;k=Math.min(t,k+o);let M=0,N=0;if(typeof n=="number")M=Math.floor(u/n),N=M*n;else for(;M<r&&N+n(M)<u;)N+=n(M),M++;M=Math.max(0,M-o);let L=M,E=typeof n=="number"?M*n:N;for(;L<r&&E<u+i;)E+=typeof n=="number"?n:n(L),L++;L=Math.min(r,L+o);let R=typeof a=="number"?w*a:(()=>{let T=0;for(let D=0;D<w;D++)T+=a(D);return T})();for(let T=w;T<k;T++){const D=typeof a=="number"?a:a(T);let F=typeof n=="number"?M*n:(()=>{let z=0;for(let H=0;H<M;H++)z+=n(H);return z})();for(let z=M;z<L;z++){const H=typeof n=="number"?n:n(z);S.push({rowIndex:T,columnIndex:z,top:R,left:F,width:H,height:D,key:`${T}:${z}`}),F+=H}R+=D}return S},[l,u,t,r,a,n,s,i,o]),b=c.useCallback(S=>{const w=S.currentTarget;d(w.scrollTop),f(w.scrollLeft),h(!0),m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{h(!1)},150)},[]);return c.useEffect(()=>()=>{m.current&&window.clearTimeout(m.current)},[]),{visibleCells:v,totalWidth:g,totalHeight:y,onScroll:b,scrollTop:l,scrollLeft:u,isScrolling:p}}function Yd(e,t,r,a=3){const n=vo({itemCount:e.length,itemHeight:r,containerHeight:t,overscan:a}),s=c.useCallback(i=>e[i.index],[e]);return{...n,getItemData:s,containerStyle:{height:t,overflow:"auto"},innerStyle:{height:n.totalHeight,position:"relative"},getItemStyle:i=>({position:"absolute",top:i.offset,left:0,right:0,height:i.height})}}function Qd(e){const{items:t,searchFn:r,debounce:a=0,minLength:n=0}=e,[s,i]=c.useState(""),o=c.useDeferredValue(s),[l,d]=c.useState(""),u=c.useRef();c.useEffect(()=>{if(a>0)return u.current=window.setTimeout(()=>{d(s)},a),()=>{u.current&&window.clearTimeout(u.current)};d(s)},[s,a]);const f=c.useDeferredValue(l),p=c.useMemo(()=>f.length<n?t:t.filter(m=>r(m,f)),[t,f,r,n]);return{query:s,setQuery:i,results:p,isStale:f!==o,deferredQuery:f}}function Zd(e){const[t,r]=c.useState(e),[a,n]=c.useState(e),[s,i]=c.useTransition(),o=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),i(()=>{r(u)})},[t]),l=c.useCallback(d=>{const u=typeof d=="function"?d(t):d;n(u),r(u)},[t]);return{value:t,pendingValue:a,isPending:s,setValue:o,setValueImmediate:l}}function eu(e){const{data:t,processFn:r,chunkSize:a=1e3,priority:n="user-visible"}=e,[s,i]=c.useState(null),[o,l]=c.useState(0),[d,u]=c.useState(!1),f=c.useRef(!1),p=c.useCallback(async()=>{if(t.length===0){i([]);return}u(!0),l(0),f.current=!1;const m=[],y=t.length;for(let g=0;g<y&&!f.current;g+=a){const v=t.slice(g,g+a),b=v.map((w,A)=>r(w,g+A));m.push(...b);const S=Math.min(100,(g+v.length)/y*100);n==="background"?await new Promise(w=>{"requestIdleCallback"in window?window.requestIdleCallback(w):setTimeout(w,0)}):n==="user-visible"&&await new Promise(w=>requestAnimationFrame(w)),c.startTransition(()=>{l(S)})}i(m),u(!1),l(100)},[t,r,a,n]),h=c.useCallback(()=>{f.current=!0},[]);return c.useEffect(()=>(p(),()=>{f.current=!0}),[p]),{result:s,progress:o,isProcessing:d,process:p,cancel:h}}function tu(e,t={}){const{initialCount:r=20,batchSize:a=50,batchDelay:n=16}=t,[s,i]=c.useState(Math.min(r,e.length)),[o,l]=c.useState(e.length<=r);return c.useEffect(()=>{if(s>=e.length){l(!0);return}const u=setTimeout(()=>{c.startTransition(()=>{i(f=>Math.min(f+a,e.length))})},n);return()=>clearTimeout(u)},[s,e.length,a,n]),c.useEffect(()=>{i(Math.min(r,e.length)),l(e.length<=r)},[e,r]),{visibleItems:c.useMemo(()=>e.slice(0,s),[e,s]),visibleCount:s,totalCount:e.length,isComplete:o,progress:s/e.length*100}}function ru(e){const{initial:t,mutate:r,rollbackOnError:a=!0}=e,[n,s]=c.useState(t),[i,o]=c.useState(!1),[l,d]=c.useState(null),u=c.useRef(t),f=c.useCallback(async h=>{u.current=n,d(null),s(h),o(!0);try{const m=await r(h);s(m)}catch(m){d(m instanceof Error?m:new Error(String(m))),a&&s(u.current)}finally{o(!1)}},[n,r,a]),p=c.useCallback(()=>{s(t),d(null),o(!1)},[t]);return{value:n,update:f,isPending:i,error:l,reset:p}}function au(e){const{workerScript:t,idleTimeout:r=3e4}=e,[a,n]=c.useState(null),[s,i]=c.useState(!1),[o,l]=c.useState(null),d=c.useRef(null),u=c.useRef(0),f=c.useRef(null),p=c.useRef(),h=c.useCallback(()=>{if(!d.current){if(typeof t=="function"){const b=new Blob([`(${t.toString()})()`],{type:"application/javascript"});d.current=new Worker(URL.createObjectURL(b))}else d.current=new Worker(t,{type:"module"});d.current.onmessage=b=>{const S=b.data;S.id===f.current&&(S.type==="result"?(n(S.result??null),i(!1),f.current=null,m()):S.type==="error"&&(l(new Error(S.error)),i(!1),f.current=null,m()))},d.current.onerror=b=>{l(new Error(b.message)),i(!1),f.current=null}}return d.current},[t]),m=c.useCallback(()=>{p.current&&window.clearTimeout(p.current),r>0&&(p.current=window.setTimeout(()=>{d.current&&!f.current&&(d.current.terminate(),d.current=null)},r))},[r]),y=c.useCallback(b=>new Promise((S,w)=>{const A=h(),k=`task-${++u.current}`;f.current=k,i(!0),l(null);const C=A.onmessage;A.onmessage=M=>{C==null||C.call(A,M),M.data.id===k&&(M.data.type==="result"?S(M.data.result):M.data.type==="error"&&w(new Error(M.data.error)))},A.postMessage({type:"task",id:k,data:b})}),[h]),g=c.useCallback(()=>{d.current&&f.current&&(d.current.postMessage({type:"cancel",id:f.current}),f.current=null,i(!1))},[]),v=c.useCallback(()=>{d.current&&(d.current.terminate(),d.current=null),p.current&&window.clearTimeout(p.current),f.current=null,i(!1)},[]);return c.useEffect(()=>()=>{v()},[v]),{result:a,isProcessing:s,error:o,execute:y,cancel:g,terminate:v}}function nu(e){const{workerScript:t,poolSize:r=navigator.hardwareConcurrency||4,idleTimeout:a=6e4}=e,n=c.useRef([]),s=c.useRef([]),i=c.useRef(0),o=c.useRef(),l=c.useCallback(()=>{if(typeof t=="function"){const g=new Blob([`(${t.toString()})()`],{type:"application/javascript"});return new Worker(URL.createObjectURL(g))}return new Worker(t,{type:"module"})},[t]),d=c.useCallback(()=>{const g=n.current.find(v=>!v.busy);if(g)return g;if(n.current.length<r){const b={worker:l(),busy:!1,taskId:null};return n.current.push(b),b}return null},[l,r]),u=c.useCallback(()=>{for(;s.current.length>0;){const g=d();if(!g)break;const v=s.current.shift();g.busy=!0,g.taskId=v.id,g.worker.onmessage=b=>{const S=b.data;S.id===v.id&&(g.busy=!1,g.taskId=null,S.type==="result"?v.resolve(S.result):S.type==="error"&&v.reject(new Error(S.error)),u(),f())},g.worker.onerror=b=>{g.busy=!1,g.taskId=null,v.reject(new Error(b.message)),u()},g.worker.postMessage({type:"task",id:v.id,data:v.data})}},[d]),f=c.useCallback(()=>{o.current&&window.clearTimeout(o.current),a>0&&(o.current=window.setTimeout(()=>{n.current.filter(v=>!v.busy).forEach(v=>{v.worker.terminate(),n.current=n.current.filter(b=>b!==v)})},a))},[a]),p=c.useCallback(g=>new Promise((v,b)=>{const S=`pool-task-${++i.current}`;s.current.push({id:S,data:g,resolve:v,reject:b}),u()}),[u]),h=c.useCallback(g=>Promise.all(g.map(v=>p(v))),[p]),m=c.useCallback(()=>{n.current.forEach(g=>g.worker.terminate()),n.current=[],s.current=[],o.current&&window.clearTimeout(o.current)},[]),y=c.useCallback(()=>({total:n.current.length,busy:n.current.filter(g=>g.busy).length,idle:n.current.filter(g=>!g.busy).length,queued:s.current.length}),[]);return c.useEffect(()=>()=>{m()},[m]),{execute:p,executeAll:h,terminateAll:m,getStats:y}}function su(e){const t=`
|
|
123
123
|
self.onmessage = function(e) {
|
|
124
124
|
const msg = e.data;
|
|
125
125
|
|
|
@@ -142,7 +142,7 @@ HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
|
-
`,r=new Blob([t],{type:"application/javascript"});return new URL(URL.createObjectURL(r))}function
|
|
145
|
+
`,r=new Blob([t],{type:"application/javascript"});return new URL(URL.createObjectURL(r))}function ou(e){const t=[],r=a=>{a instanceof ArrayBuffer||a instanceof MessagePort?t.push(a):"buffer"in a&&a.buffer instanceof ArrayBuffer?t.push(a.buffer):a instanceof ImageBitmap?t.push(a):Array.isArray(a)?a.forEach(r):a&&typeof a=="object"&&Object.values(a).forEach(r)};return r(e),t}function iu(){const e=new WeakMap;return{get:t=>e.get(t),set:(t,r)=>{e.set(t,r)},has:t=>e.has(t),delete:t=>e.delete(t)}}function cu(e={}){const{maxSize:t=1e3,ttl:r}=e,a=new Map,n=i=>r?Date.now()-i.timestamp>r:!1,s=()=>{if(a.size<=t)return;const i=[];for(const[o,l]of a.entries())if((n(l)||a.size-i.length>t)&&i.push(o),a.size-i.length<=t)break;i.forEach(o=>a.delete(o))};return{get:i=>{const o=a.get(i);if(o){if(n(o)){a.delete(i);return}return a.delete(i),a.set(i,{...o,timestamp:Date.now()}),o.value}},set:(i,o)=>{a.delete(i),a.set(i,{value:o,timestamp:Date.now()}),s()},has:i=>{const o=a.get(i);return o?n(o)?(a.delete(i),!1):!0:!1},delete:i=>a.delete(i),clear:()=>a.clear(),size:()=>a.size,keys:()=>Array.from(a.keys())}}function lu(){const e=new Map,t=new FinalizationRegistry(r=>{e.delete(r)});return{get:r=>{const a=e.get(r);if(!a)return;const n=a.deref();return n===void 0&&e.delete(r),n},set:(r,a)=>{const n=e.get(r);if(n){const s=n.deref();s&&t.unregister(s)}e.set(r,new WeakRef(a)),t.register(a,r,a)},has:r=>{const a=e.get(r);return a?a.deref()!==void 0:!1},delete:r=>{const a=e.get(r);if(a){const n=a.deref();n&&t.unregister(n)}return e.delete(r)},clear:()=>e.clear(),size:()=>{let r=0;for(const a of e.values())a.deref()!==void 0&&r++;return r}}}function du(){const e=c.useRef([]),t=c.useCallback((n,s,i,o)=>{n.addEventListener(s,i,o),e.current.push({target:n,event:s,handler:i,options:o})},[]),r=c.useCallback(()=>{e.current.forEach(({target:n,event:s,handler:i,options:o})=>{n.removeEventListener(s,i,o)}),e.current=[]},[]),a=c.useCallback(()=>e.current.length,[]);return c.useEffect(()=>()=>{r()},[r]),{add:t,removeAll:r,count:a}}function uu(){const e=[];return{add:(t,r,a,n)=>{t.addEventListener(r,a,n),e.push({target:t,event:r,handler:a,options:n})},removeAll:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0},count:()=>e.length,dispose:()=>{e.forEach(({target:t,event:r,handler:a,options:n})=>{t.removeEventListener(r,a,n)}),e.length=0}}}function Te(){const e=window.performance;if(!e.memory)return{jsHeapSizeLimit:0,totalJSHeapSize:0,usedJSHeapSize:0,usedPercent:0,isSupported:!1};const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a}=e.memory;return{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:a,usedPercent:a/t*100,isSupported:!0}}function fu(e={}){const{warningThreshold:t=75,pollInterval:r=1e4,onHighUsage:a}=e,[n,s]=c.useState(Te),[i,o]=c.useState(!1);return c.useEffect(()=>{if(!Te().isSupported)return;const d=setInterval(()=>{const u=Te();s(u);const f=u.usedPercent>t;o(f),f&&a&&a(u)},r);return()=>clearInterval(d)},[t,r,a]),{stats:n,isHighUsage:i}}function mu(e){const{src:t,rootMargin:r="200px",threshold:a=0,placeholder:n,progressive:s}=e,i=c.useRef(null),[o,l]=c.useState(!1),[d,u]=c.useState(!1),[f,p]=c.useState(n||"");return c.useEffect(()=>{const h=i.current;if(!h)return;const m=new IntersectionObserver(([y])=>{y.isIntersecting&&(l(!0),m.disconnect())},{rootMargin:r,threshold:a});return m.observe(h),()=>m.disconnect()},[r,a]),c.useEffect(()=>{if(!o)return;const h=new Image;return h.onload=()=>{p(t),u(!0)},h.src=t,()=>{h.onload=null}},[o,t,s]),{ref:i,isInView:o,isLoaded:d,currentSrc:f}}function pu(e){const{create:t,reset:r,maxSize:a=100}=e,n=[];return{acquire:()=>n.length>0?n.pop():t(),release:s=>{n.length<a&&(r&&r(s),n.push(s))},preallocate:s=>{const i=Math.min(s,a-n.length);for(let o=0;o<i;o++)n.push(t())},clear:()=>{n.length=0},size:()=>n.length}}const ye={avif:null,webp:null};async function Pe(e){if(ye[e]!==null)return ye[e];const t={avif:"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKBzgABhAQ0AIy0IEAAAAAAAAAAMHN",webp:"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"};return new Promise(r=>{const a=new Image;a.onload=()=>{ye[e]=a.width>0&&a.height>0,r(ye[e])},a.onerror=()=>{ye[e]=!1,r(!1)},a.src=t[e]})}function So(){const[e,t]=c.useState({avif:!1,webp:!1,jpg:!0,png:!0,gif:!0}),[r,a]=c.useState(!0);return c.useEffect(()=>{Promise.all([Pe("avif"),Pe("webp")]).then(([n,s])=>{t(i=>({...i,avif:n,webp:s})),a(!1)})},[]),{formats:e,isChecking:r}}function xo(e){return e.map(t=>`${t.src} ${t.width}w`).join(", ")}function wo(e,t){const r=e.map(a=>`(max-width: ${a.maxWidth}px) ${a.size}`);return r.push(t),r.join(", ")}function ko(e,t,r=window.devicePixelRatio){const a=t*r,n=[...e].sort((s,i)=>s.width-i.width);for(const s of n)if(s.width>=a)return s;return n[n.length-1]}function Mo(e){const{src:t,lqip:r,rootMargin:a="200px",threshold:n=0,blurRadius:s=20,delay:i=0,priority:o="auto",onLoad:l,onError:d}=e,u=c.useRef(null),[f,p]=c.useState({currentSrc:r||null,thumbnailSrc:r||null,fullSrc:t,stage:"idle",isLoaded:!1,isInView:!1,error:null});c.useEffect(()=>{if(o==="high"){p(g=>({...g,isInView:!0}));return}const m=u.current;if(!m)return;const y=new IntersectionObserver(([g])=>{g.isIntersecting&&(p(v=>({...v,isInView:!0})),y.disconnect())},{rootMargin:a,threshold:n});return y.observe(m),()=>y.disconnect()},[a,n,o]),c.useEffect(()=>{if(!f.isInView||f.isLoaded)return;p(g=>({...g,stage:r?"thumbnail":"loading"}));const m=i>0?setTimeout(y,i):null;m||y();function y(){const g=new Image;g.onload=()=>{p(v=>({...v,currentSrc:t,stage:"loaded",isLoaded:!0})),l==null||l()},g.onerror=()=>{const v=new Error(`Failed to load image: ${t}`);p(b=>({...b,stage:"error",error:v})),d==null||d(v)},g.src=t}return()=>{m&&clearTimeout(m)}},[f.isInView,f.isLoaded,t,r,i,l,d]);const h={filter:f.stage==="thumbnail"?`blur(${s}px)`:"none",transition:"filter 0.3s ease-out",...f.stage==="thumbnail"&&{transform:"scale(1.05)"}};return{ref:u,...f,style:h}}function Co(e){return Promise.all(e.map(t=>new Promise((r,a)=>{const n=new Image;n.onload=()=>r(),n.onerror=()=>a(new Error(`Failed to preload: ${t}`)),n.src=t})))}function Ao(e){const[t,r]=c.useState({loaded:0,total:e.length,isComplete:!1,errors:[]});return c.useEffect(()=>{if(e.length===0){r({loaded:0,total:0,isComplete:!0,errors:[]});return}let a=0;const n=[];e.forEach(i=>{const o=new Image;o.onload=()=>{a++,s()},o.onerror=()=>{a++,n.push(i),s()},o.src=i});function s(){r({loaded:a,total:e.length,isComplete:a===e.length,errors:n})}},[e]),t}async function Ht(e){const t=new Image;return t.src=e,typeof t.decode=="function"?await t.decode():await new Promise((r,a)=>{t.onload=()=>r(),t.onerror=()=>a(new Error(`Failed to load: ${e}`))}),t}function Eo(e){const[t,r]=c.useState(null),[a,n]=c.useState(!1),[s,i]=c.useState(null);return c.useEffect(()=>{if(!e){r(null);return}let o=!1;return n(!0),i(null),Ht(e).then(l=>{o||(r(l),n(!1))}).catch(l=>{o||(i(l),n(!1))}),()=>{o=!0}},[e]),{image:t,isLoading:a,error:s}}function No(e={}){const t=new Map,r=new IntersectionObserver(a=>{a.forEach(n=>{const s=t.get(n.target);s&&n.isIntersecting&&s(n)})},e);return{observe:(a,n)=>{t.set(a,n),r.observe(a)},unobserve:a=>{t.delete(a),r.unobserve(a)},disconnect:()=>{t.clear(),r.disconnect()}}}function Lo(e,t){const r=c.useRef(null),[a,n]=c.useState(!1);return c.useEffect(()=>{const s=r.current;if(s)return e.observe(s,()=>{n(!0),t(),e.unobserve(s)}),()=>{e.unobserve(s)}},[e,t]),{ref:r,isInView:a}}function To(e,t=10,r=10){const a=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}"><rect width="100%" height="100%" fill="${e}"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(a)}`}function Ro(e,t="vertical",r=10,a=10){const o=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${a}">
|
|
146
146
|
<defs>
|
|
147
147
|
<linearGradient id="g" x1="0%" y1="0%" x2="${t==="horizontal"?"100%":"0%"}" y2="${t==="vertical"?"100%":"0%"}">
|
|
148
148
|
<stop offset="0%" style="stop-color:${e[0]}"/>
|
|
@@ -150,5 +150,5 @@ HTML:`}],{temperature:.3}),l=o.content.match(/```html?\n?([\s\S]*?)```/);return
|
|
|
150
150
|
</linearGradient>
|
|
151
151
|
</defs>
|
|
152
152
|
<rect width="100%" height="100%" fill="url(#g)"/>
|
|
153
|
-
</svg>`;return`data:image/svg+xml,${encodeURIComponent(o)}`}const pu={checkFormatSupport:Fe,useImageFormats:So,generateSrcset:xo,generateSizes:wo,selectOptimalSource:ko,useProgressiveImage:Mo,preloadImages:Co,useImagePreload:Ao,loadAndDecodeImage:$t,useDecodedImage:Eo,createImageObserver:No,useSharedImageObserver:Lo,generateColorPlaceholder:To,generateGradientPlaceholder:Ro};function gu(e){return e["data-testid"]??e.testId}function Bt(e){return e.error||e.status==="error"?"error":e.warning||e.status==="warning"?"warning":e.success||e.status==="success"?"success":e.status??"idle"}function yu(e){const t=Bt(e),r={};return t==="error"&&(r["aria-invalid"]=!0),e.required&&(r["aria-required"]=!0),e.disabled&&(r["aria-disabled"]=!0),e.readOnly&&(r["aria-readonly"]=!0),e.describedById&&(r["aria-describedby"]=e.describedById),r}const Qt=new Set;function Io(e,t,r){process.env.NODE_ENV!=="production"&&t!==void 0&&r!==void 0&&!Qt.has(e)&&(Qt.add(e),console.warn(`[Nice2Dev] <${e}> received both \`value\` and \`defaultValue\`. Use one or the other (controlled XOR uncontrolled).`))}const Zt=new Set;function zo(e,t){process.env.NODE_ENV!=="production"&&(Zt.has(e)||(Zt.add(e),t()))}function Do(e){const{componentName:t,prop:r,replacement:a,removeIn:n,reason:s}=e;zo(`prop:${t}.${r}`,()=>{const i=[`[Nice2Dev] Prop \`${r}\` on <${t}> is deprecated.`,a?`Use \`${a}\` instead.`:"",n?`Will be removed in ${n}.`:"",s?`Reason: ${s}`:""].filter(Boolean);console.warn(i.join(" "))})}function hu(e){const{symbol:t,replacement:r,removeIn:a,reason:n}=e;zo(`symbol:${t}`,()=>{const s=[`[Nice2Dev] \`${t}\` is deprecated.`,r?`Use \`${r}\` instead.`:"",a?`Will be removed in ${a}.`:"",n?`Reason: ${n}`:""].filter(Boolean);console.warn(s.join(" "))})}function bu(e){return e.value!==void 0&&e.newValue===void 0&&Do({componentName:e.componentName,prop:e.prop,replacement:e.replacement,removeIn:e.removeIn}),e.newValue??e.value}const er=new Set;function vu(e){const{value:t,defaultValue:r,onChange:a,componentName:n="Component"}=e,s=t!==void 0,[i,o]=c.useState(r),l=c.useRef(s);process.env.NODE_ENV!=="production"&&(l.current!==s&&!er.has(n)&&(er.add(n),console.warn(`[Nice2Dev] <${n}> switched between controlled and uncontrolled. A component should not change between the two over its lifetime.`)),l.current=s,Io(n,t,e.defaultValue!==void 0?r:void 0));const d=s?t:i,u=c.useCallback((f,g)=>{const h=typeof f=="function"?f(d):f;s||o(h),a==null||a(h,g)},[d,s,a]);return[d,u,s]}const Su={idle:"nice-field-status nice-field-status--idle",success:"nice-field-status nice-field-status--success",warning:"nice-field-status nice-field-status--warning",error:"nice-field-status nice-field-status--error"};function xu(e){const t=Bt(e),r=t==="error"&&(typeof e.error=="string"?e.error:void 0)||t==="warning"&&e.warning||t==="success"&&e.success||e.helperText||null;return r?x.jsx("div",{id:e.id,role:t==="error"?"alert":void 0,"aria-live":t==="error"?"assertive":"polite","data-testid":e.testId,className:[Su[t],e.className].filter(Boolean).join(" "),children:r}):null}const Po={0:"A",1:"B",2:"X",3:"Y",4:"LB",5:"RB",6:"LT",7:"RT",8:"Back",9:"Start",10:"LS",11:"RS",12:"DpadUp",13:"DpadDown",14:"DpadLeft",15:"DpadRight",16:"Home"},wu={0:"LeftX",1:"LeftY",2:"RightX",3:"RightY"},ku={Cross:"A",Circle:"B",Square:"X",Triangle:"Y",L1:"LB",R1:"RB",L2:"LT",R2:"RT",Share:"Back",Options:"Start",L3:"LS",R3:"RS",PS:"Home"},Fo=Object.values(Po);function Ho(e={}){const{index:t=0,deadzone:r=.15,pollRate:a=16,actions:n={},enabled:s=!0,onButtonDown:i,onButtonUp:o}=e,[l,d]=c.useState({connected:!1,id:"",buttons:Le(),axes:{LeftX:0,LeftY:0,RightX:0,RightY:0},leftTrigger:0,rightTrigger:0,vibrate:()=>{}}),u=c.useRef(Le()),f=c.useRef(new Map),g=c.useRef(n);g.current=n;const h=c.useRef({onButtonDown:i,onButtonUp:o});h.current={onButtonDown:i,onButtonUp:o};const m=c.useRef({left:0,right:0}),y=c.useCallback((v,b=.5,S=.5)=>{var k,C;const A=navigator.getGamepads()[t];A!=null&&A.vibrationActuator&&((C=(k=A.vibrationActuator).playEffect)==null||C.call(k,"dual-rumble",{startDelay:0,duration:v,weakMagnitude:b,strongMagnitude:S}))},[t]),p=c.useCallback(v=>{if(Math.abs(v)<r)return 0;const b=v>0?1:-1,S=(Math.abs(v)-r)/(1-r);return b*S},[r]);return c.useEffect(()=>{if(!s)return;let v,b=0,S=!1;const w=A=>{var z,H,me,pe,ge,_,de,se;if(A-b<a){v=requestAnimationFrame(w);return}b=A;const C=navigator.getGamepads()[t];if(!C){S&&(S=!1,u.current=Le(),d(j=>({...j,connected:!1,id:""}))),v=requestAnimationFrame(w);return}S=!0;const M=Le();for(let j=0;j<C.buttons.length;j++){const P=Po[j];P&&(M[P]=C.buttons[j].pressed)}const N={LeftX:0,LeftY:0,RightX:0,RightY:0};for(let j=0;j<Math.min(C.axes.length,4);j++){const P=wu[j];P&&(N[P]=p(C.axes[j]))}const L=((z=C.buttons[6])==null?void 0:z.value)??0,E=((H=C.buttons[7])==null?void 0:H.value)??0,{onButtonDown:R,onButtonUp:T}=h.current;if(R||T)for(const j of Fo)M[j]&&!u.current[j]?R==null||R(j):!M[j]&&u.current[j]&&(T==null||T(j));const D=Date.now(),F=g.current;for(const[j,P]of Object.entries(F)){if(P.button||P.buttons){const U=P.buttons||[P.button],Y=U.every(Z=>M[Z]),Q=U.every(Z=>u.current[Z]);if(Y&&!Q)(me=P.onPress)==null||me.call(P),f.current.set(j,{startTime:D,lastRepeat:D});else if(!Y&&Q)(pe=P.onRelease)==null||pe.call(P),f.current.delete(j);else if(Y&&((ge=P.onHold)==null||ge.call(P),P.repeatDelay!==void 0&&P.repeatRate!==void 0)){const Z=f.current.get(j);Z&&D-Z.startTime>P.repeatDelay&&D-Z.lastRepeat>=P.repeatRate&&((_=P.onPress)==null||_.call(P),Z.lastRepeat=D)}}if(P.axis&&P.onAxisChange){const U=N[P.axis];P.axisDirection?P.axisDirection==="positive"&&U>0?P.onAxisChange(U):P.axisDirection==="negative"&&U<0&&P.onAxisChange(Math.abs(U)):P.onAxisChange(U)}if(P.trigger){const U=P.trigger==="LT"?L:E,Y=P.trigger==="LT"?m.current.left>.5:m.current.right>.5,Q=U>.5;Q&&!Y?(de=P.onPress)==null||de.call(P):!Q&&Y&&((se=P.onRelease)==null||se.call(P))}}u.current=M,m.current={left:L,right:E},d({connected:!0,id:C.id,buttons:M,axes:N,leftTrigger:L,rightTrigger:E,vibrate:y}),v=requestAnimationFrame(w)};return v=requestAnimationFrame(w),()=>cancelAnimationFrame(v)},[s,t,a,p,y]),c.useEffect(()=>{if(!s)return;const v=S=>{S.gamepad.index===t&&d(w=>({...w,connected:!0,id:S.gamepad.id}))},b=S=>{S.gamepad.index===t&&d(w=>({...w,connected:!1,id:""}))};return window.addEventListener("gamepadconnected",v),window.addEventListener("gamepaddisconnected",b),()=>{window.removeEventListener("gamepadconnected",v),window.removeEventListener("gamepaddisconnected",b)}},[s,t]),l}function Le(){return{A:!1,B:!1,X:!1,Y:!1,LB:!1,RB:!1,LT:!1,RT:!1,Back:!1,Start:!1,LS:!1,RS:!1,DpadUp:!1,DpadDown:!1,DpadLeft:!1,DpadRight:!1,Home:!1}}function Mu(e){const t={};return e.onNavigateUp&&(t.navUp={button:"DpadUp",onPress:e.onNavigateUp,repeatDelay:400,repeatRate:100},t.navUpStick={axis:"LeftY",axisDirection:"negative",onAxisChange:r=>{var a;r>.8&&((a=e.onNavigateUp)==null||a.call(e))}}),e.onNavigateDown&&(t.navDown={button:"DpadDown",onPress:e.onNavigateDown,repeatDelay:400,repeatRate:100},t.navDownStick={axis:"LeftY",axisDirection:"positive",onAxisChange:r=>{var a;r>.8&&((a=e.onNavigateDown)==null||a.call(e))}}),e.onNavigateLeft&&(t.navLeft={button:"DpadLeft",onPress:e.onNavigateLeft,repeatDelay:400,repeatRate:100}),e.onNavigateRight&&(t.navRight={button:"DpadRight",onPress:e.onNavigateRight,repeatDelay:400,repeatRate:100}),e.onConfirm&&(t.confirm={button:"A",onPress:e.onConfirm}),e.onCancel&&(t.cancel={button:"B",onPress:e.onCancel}),e.onTabNext&&(t.tabNext={button:"RB",onPress:e.onTabNext}),e.onTabPrev&&(t.tabPrev={button:"LB",onPress:e.onTabPrev}),e.onMenu&&(t.menu={button:"Start",onPress:e.onMenu}),t}const Ke=c.createContext(null);function tr(e){if(!e)return null;const t=e.getBoundingClientRect();return t.width===0&&t.height===0?null:{x:t.left+t.width/2,y:t.top+t.height/2}}const Cu=({keyboard:e=!0,gamepad:t=!0,gamepadIndex:r=0,children:a})=>{const[n,s]=c.useState([]),[i,o]=c.useState(null),l=c.useRef([]),d=c.useRef(null),u=c.useRef([]),f=c.useRef(0);c.useEffect(()=>{l.current=n},[n]),c.useEffect(()=>{d.current=i},[i]);const g=c.useCallback(()=>{f.current+=1},[]),h=c.useCallback(()=>{f.current=Math.max(0,f.current-1)},[]),m=c.useCallback((M,N)=>{u.current=[...u.current,{prefix:M,onDismiss:N}]},[]),y=c.useCallback(()=>{var L;const M=u.current;if(M.length===0)return;const N=M[M.length-1];u.current=M.slice(0,-1),(L=N.onDismiss)==null||L.call(N)},[]),p=c.useCallback(M=>{s(N=>N.some(L=>L.id===M.id)?N:[...N,M])},[]),v=c.useCallback(M=>{s(N=>{var E;const L=N.filter(R=>R.id!==M);if(d.current===M){const R=((E=L[0])==null?void 0:E.id)??null;o(R),d.current=R}return L})},[]),b=c.useCallback(M=>{o(M),d.current=M},[]),S=c.useCallback((M,N)=>{var pe,ge;if(f.current>0)return;const L=l.current.filter(_=>!_.disabled);if(L.length===0)return;const E=d.current,R=E?L.find(_=>_.id===E):void 0;if(!R){const _=L[0];b(_.id),(pe=_.ref.current)==null||pe.focus();return}const T=u.current,D=T.length>0?T[T.length-1]:void 0,F=L.filter(_=>_.id!==E&&(!D||_.id.startsWith(D.prefix))),z=tr(R.ref.current);if(!z||F.length===0)return;let H=null,me=1/0;for(const _ of F){const de=tr(_.ref.current);if(!de)continue;const se=de.x-z.x,j=de.y-z.y,P=M*se+N*j;if(P<=0)continue;const U=P,Y=Math.abs(M*j-N*se),Q=Math.sqrt(se*se+j*j)+Y*2-U*.001;Q<me&&(me=Q,H=_)}H&&(b(H.id),(ge=H.ref.current)==null||ge.focus())},[b]),w=c.useCallback(M=>{var E;if(f.current>0)return;const N=M??d.current;if(!N)return;const L=l.current.find(R=>R.id===N);L&&(L.onActivate?L.onActivate():(E=L.ref.current)==null||E.click())},[]);c.useEffect(()=>{if(!e)return;const M=N=>{if(!(f.current>0))switch(N.key){case"ArrowUp":S(0,-1),N.preventDefault();break;case"ArrowDown":S(0,1),N.preventDefault();break;case"ArrowLeft":S(-1,0),N.preventDefault();break;case"ArrowRight":S(1,0),N.preventDefault();break;case"Enter":case" ":d.current&&(w(),N.preventDefault());break;case"Escape":y();break}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[e,S,w,y]);const A=c.useRef({x:!0,y:!0}),k=c.useMemo(()=>({navUp:{button:"DpadUp",onPress:()=>S(0,-1),repeatDelay:400,repeatRate:120},navDown:{button:"DpadDown",onPress:()=>S(0,1),repeatDelay:400,repeatRate:120},navLeft:{button:"DpadLeft",onPress:()=>S(-1,0),repeatDelay:400,repeatRate:120},navRight:{button:"DpadRight",onPress:()=>S(1,0),repeatDelay:400,repeatRate:120},confirm:{button:"A",onPress:()=>w()},cancel:{button:"B",onPress:()=>y()},stickX:{axis:"LeftX",onAxisChange:M=>{Math.abs(M)>.6&&A.current.x?(A.current.x=!1,S(Math.sign(M),0)):Math.abs(M)<.3&&(A.current.x=!0)}},stickY:{axis:"LeftY",onAxisChange:M=>{Math.abs(M)>.6&&A.current.y?(A.current.y=!1,S(0,Math.sign(M))):Math.abs(M)<.3&&(A.current.y=!0)}}}),[S,w,y]);Ho({index:r,enabled:t,actions:k});const C=c.useMemo(()=>({register:p,unregister:v,moveFocus:S,activate:w,setActive:b,activeId:i,focusables:n,pushFocusTrap:m,popFocusTrap:y,pauseNavigation:g,resumeNavigation:h}),[p,v,S,w,b,i,n,m,y,g,h]);return x.jsx(Ke.Provider,{value:C,children:a})};function Au(){return c.useContext(Ke)}function Eu(){const e=c.useContext(Ke);if(!e)throw new Error("useSpatialNav must be used inside a NiceSpatialNavProvider");return e}function $o(e,t){const r=c.useContext(Ke),{id:a,onActivate:n,disabled:s}=t,i=c.useRef(n);i.current=n;const o=r==null?void 0:r.register,l=r==null?void 0:r.unregister,d=r==null?void 0:r.setActive;c.useEffect(()=>{if(!(!o||!l||s))return o({id:a,ref:e,onActivate:()=>{var f;return(f=i.current)==null?void 0:f.call(i)},disabled:s}),()=>l(a)},[o,l,a,s,e]),c.useEffect(()=>{const f=e.current;if(!f||!d||s)return;const g=()=>d(a);return f.addEventListener("focus",g),()=>f.removeEventListener("focus",g)},[d,a,s,e]);const u=(r==null?void 0:r.activeId)===a;return c.useEffect(()=>{const f=e.current;f&&(u?f.dataset.active="true":delete f.dataset.active)},[u,e]),{active:u}}const Nu=({focusId:e,onActivate:t,disabled:r,as:a="div",className:n,style:s,children:i,...o})=>{const l=c.useRef(null),{active:d}=$o(l,{id:e,onActivate:t,disabled:r});return x.jsx(a,{ref:l,tabIndex:r?-1:0,className:`nice-focusable${d?" nice-focusable--active":""}${n?` ${n}`:""}`,style:s,onClick:t,...o,children:i})};Object.defineProperty(exports,"NICE_I18N_DICTIONARIES",{enumerable:!0,get:()=>V.NICE_I18N_DICTIONARIES});Object.defineProperty(exports,"NICE_SUPPORTED_LANGS",{enumerable:!0,get:()=>V.NICE_SUPPORTED_LANGS});Object.defineProperty(exports,"NiceI18nProvider",{enumerable:!0,get:()=>V.NiceI18nProvider});Object.defineProperty(exports,"createICUTranslator",{enumerable:!0,get:()=>V.createICUTranslator});Object.defineProperty(exports,"formatICU",{enumerable:!0,get:()=>V.formatICU});Object.defineProperty(exports,"useNiceTranslation",{enumerable:!0,get:()=>V.useNiceTranslation});exports.ANIMATION_VALUES=He;exports.BatchOperations=ld;exports.COMMON_SHORTCUTS=Wi;exports.ColumnFormulas=od;exports.DEFAULT_TRACELESS_POLICY=ul;exports.DEFAULT_VARIANT_CONFIG=K;exports.DENSITY_VALUES=ve;exports.DisplayModeView=Qo;exports.GAMEPAD_BUTTONS=Fo;exports.ImageOptimization=pu;exports.IndexedDBAdapter=sl;exports.LeakDetectorStatus=Xr;exports.LocalStorageAdapter=sa;exports.NICE_BREAKPOINTS=ue;exports.NICE_BUILTIN_ICONS=si;exports.NICE_COLOR_BLIND_MODES=tc;exports.NICE_DISPLAY_STYLES=Vo;exports.NICE_DISPLAY_STYLE_INFO=Jo;exports.NICE_THEME_GALLERY=xs;exports.NICE_THEME_PACKS=Ft;exports.NICE_THEME_PACKS_EXTENDED=Ht;exports.NICE_THEME_PACK_FONT_LINKS=zd;exports.NICE_THEME_PACK_FONT_LINKS_EXTENDED=Hd;exports.NICE_THEME_PACK_LIST=js;exports.NICE_THEME_PACK_LIST_EXTENDED=mo;exports.NICE_THEME_PRESETS=dt;exports.NICE_VIEW_COMPONENT_TYPES=Xd;exports.NiceA11yProvider=Mr;exports.NiceAIProvider=El;exports.NiceAccessControl=vr;exports.NiceDataCache=nt;exports.NiceDisplayStyleContext=Be;exports.NiceFieldStatus=xu;exports.NiceFocusable=Nu;exports.NiceHelpIcon=ra;exports.NiceHelpProvider=Jr;exports.NiceIcon=fr;exports.NiceIconProvider=ri;exports.NiceInlineHelp=ea;exports.NiceKeyboardHint=Lr;exports.NicePreferencesPanel=dl;exports.NiceProfiler=Sc;exports.NicePullToRefresh=Pi;exports.NiceQuickHelp=ta;exports.NiceRTLProvider=hr;exports.NiceRequestDeduplicator=Sa;exports.NiceSkipLink=Er;exports.NiceSpatialNavProvider=Cu;exports.NiceStateIO=yd;exports.NiceSwipeableListItem=Di;exports.NiceTestWrapper=Ir;exports.NiceThemeContext=It;exports.NiceThemeProvider=po;exports.NiceThemeVariantConfigurator=_d;exports.NiceThemeVariantProvider=Od;exports.NiceTouchTarget=Hi;exports.NiceTutorialButton=nl;exports.NiceTutorialsProvider=tl;exports.NiceUserPreferencesProvider=ll;exports.NiceVisuallyHidden=Ar;exports.PRIVACY_LEVEL_ORDER=fe;exports.PS_BUTTON_ALIASES=ku;exports.ProfilerOverlay=_r;exports.RADIUS_VALUES=he;exports.RestAPISyncAdapter=ol;exports.SHADOW_DARK_MODE_VALUES=rr;exports.SHADOW_VALUES=Ie;exports.StorageAdapter=da;exports.TRACELESS_MODE_PRESETS=ia;exports.TRACELESS_POLICY_HEADER=vl;exports.VARIANT_PRESETS=$e;exports.ValidationRules=cd;exports.accessModeAttrs=Ti;exports.aggregate=re;exports.analog70s=Zs;exports.applyColorBlindMode=bt;exports.applyTheme=vd;exports.applyVariantConfig=gt;exports.applyVariantsToTheme=Wo;exports.arcticCrystal=Vs;exports.artDecoGatsby=Gs;exports.auditStorageCompliance=Al;exports.auditWCAG22AAA=Zi;exports.autumnFoliage=Xs;exports.bankVault=Bs;exports.bauhaus=$s;exports.blackTieGala=uo;exports.blueprint=Js;exports.brutalistRaw=Rs;exports.buildAriaDescribedBy=Cr;exports.buildFieldA11y=yu;exports.buildFormFieldAria=ji;exports.calculateDataDiff=xa;exports.candyPop=zs;exports.checkAriaCompliance=gc;exports.checkContrastAAA=Qi;exports.checkFormatSupport=Fe;exports.checkRegression=Or;exports.claymorphism=Hs;exports.clearAllClientStorage=Cl;exports.clearLeakReports=Rc;exports.clearProfilingData=vt;exports.comicHalftone=no;exports.configureLeakDetector=Lc;exports.configureProfiler=Dr;exports.createArrayDataSource=Fl;exports.createColorBlindController=oc;exports.createCustomDataSource=Wl;exports.createEventCleanup=du;exports.createGraphQLDataSource=_l;exports.createGraphQLSubscriptionSource=Kc;exports.createImageObserver=No;exports.createIndexedDBDataSource=st;exports.createInfiniteScroll=Ql;exports.createInlineWorker=nu;exports.createLRUCache=iu;exports.createMockDataSource=pc;exports.createNavigationActions=Mu;exports.createNicePluginSystem=lc;exports.createNiceReduxMiddleware=Uc;exports.createODataDataSource=Ol;exports.createObjectPool=mu;exports.createOfflineFirstDataSource=md;exports.createPermissiveInstanceCeiling=Ml;exports.createPolicyHeader=xl;exports.createReactQueryAdapter=Vc;exports.createRestDataSource=ma;exports.createRestrictiveInstanceCeiling=kl;exports.createSSEDataSource=ad;exports.createSignalRDataSource=ed;exports.createStorageAdapter=wl;exports.createURLStateManager=gd;exports.createUserPreferencesStore=hd;exports.createWeakCache=ou;exports.createWeakRefCache=cu;exports.createWebSocketDataSource=Zl;exports.createZustandAdapter=Xc;exports.deepSea=Qs;exports.defaultValidationMessage=ha;exports.deprecateProp=Do;exports.deprecateSymbol=hu;exports.deriveMode=Nt;exports.deserializeTheme=Md;exports.desertDune=Ws;exports.dieterRams=lo;exports.endMark=We;exports.evaluateCondition=qd;exports.evaluateValidation=va;exports.evaluateValidationRule=ba;exports.filterGroupToWhere=Vl;exports.filterNiceThemePacksByTag=Fd;exports.filterNiceThemePacksExtendedByTag=Bd;exports.forceGC=_c;exports.forestCanopy=_s;exports.formatShortcut=Nr;exports.forwardDeprecated=bu;exports.generateBadgeStyles=ar;exports.generateButtonStyles=ut;exports.generateCardStyles=mt;exports.generateColorPlaceholder=To;exports.generateColumnsFromSchema=Yc;exports.generateFillStyles=_o;exports.generateFormFieldsFromSchema=Qc;exports.generateFromOpenAPI=Jc;exports.generateGradientPlaceholder=Ro;exports.generateInputStyles=ft;exports.generatePaletteFromColor=yi;exports.generateSizes=wo;exports.generateSrcset=xo;exports.generateTabStyles=nr;exports.generateTableStyles=ir;exports.generateToggleStyles=sr;exports.generateTooltipStyles=or;exports.generateTracelessComplianceReport=gl;exports.generateVariantCSS=pt;exports.getComponentStats=Fr;exports.getComponentStyleFromConfig=lr;exports.getComputedTheme=wd;exports.getDisplayStyleDataAttrs=dr;exports.getGracefulDegradationInfo=bl;exports.getLeakReports=Tc;exports.getLeakSummary=Wr;exports.getMemoryStats=Re;exports.getMorePrivateMode=fl;exports.getNiceAnimationClass=Ai;exports.getNiceThemePack=Pd;exports.getNiceThemePackExtended=$d;exports.getPerformanceReport=$r;exports.getProfilingStats=Pr;exports.getRecentTimings=hc;exports.getSlowRenders=St;exports.getTracelessBadgeInfo=hl;exports.getTransferables=su;exports.glassAurora=Is;exports.groupBy=Tt;exports.groupByHierarchical=ka;exports.hologramUI=Ys;exports.hyggeScandinavian=Ts;exports.inkSumie=co;exports.isAtLeastAsPrivate=Te;exports.isRecordValid=Gl;exports.isSafeUrl=ei;exports.japaneseWashi=Us;exports.loadAndDecodeImage=$t;exports.logicalProps=Ni;exports.matchesFilterCondition=ya;exports.matchesFilterGroup=Lt;exports.matchesShortcut=Vi;exports.measureAsync=kc;exports.measureSync=Mc;exports.memphis80s=io;exports.moroccanMosaic=qs;exports.neonArcade=Ls;exports.newspaperBroadsheet=Ds;exports.niceReduxActions=qc;exports.niceReduxReducer=Gc;exports.niceSelectors=uc;exports.niceStaggerDelay=Ci;exports.niceThemeBlue=ks;exports.niceThemeBootstrap=As;exports.niceThemeDark=ws;exports.niceThemeFluent=Es;exports.niceThemeHighContrast=Ms;exports.niceThemeLight=Dt;exports.niceThemeMaterial=Cs;exports.normalizeSize=jo;exports.normalizeVariant=Oo;exports.obsidianEditorial=Ns;exports.parsePolicyFromHeader=Sl;exports.pivot=nd;exports.preloadImages=Co;exports.printPerformanceReport=xt;exports.removeTheme=Aa;exports.removeVariantConfig=cr;exports.resolveControlStoragePermissions=pl;exports.resolveDisplayStyleConfig=be;exports.resolveStatus=Bt;exports.resolveStepsI18n=na;exports.resolveTestId=gu;exports.resolveTracelessPolicy=ml;exports.resolveTutorial=al;exports.sanitizeHtml=Zo;exports.saveBaseline=jr;exports.selectOptimalSource=ko;exports.serializeTheme=kd;exports.setupReactDevToolsIntegration=Ac;exports.shouldShowConsentBanner=ca;exports.simulateKeyboard=fc;exports.simulateType=mc;exports.sortModelToOrderBy=Xl;exports.sovietConstructivist=Ks;exports.startMark=_e;exports.swissGrid=fo;exports.synthwave84=Ps;exports.takeMemorySnapshot=Oc;exports.testId=dc;exports.themeAbyss=an;exports.themeAfricanEarth=cs;exports.themeAmber=$a;exports.themeArctic=gn;exports.themeAurora=un;exports.themeAutumn=mn;exports.themeBanking=Cn;exports.themeBrazilianCarnival=is;exports.themeCarbon=en;exports.themeCharcoal=Da;exports.themeCherryBlossom=Zn;exports.themeChineseNewYear=ss;exports.themeChristmas=qn;exports.themeCoffee=vs;exports.themeCoolGray=Ra;exports.themeCoral=Ka;exports.themeCosmos=tn;exports.themeCyan=_a;exports.themeCyberpunk=Vn;exports.themeDesert=ln;exports.themeDracula=Dn;exports.themeEaster=Jn;exports.themeEclipse=Qa;exports.themeEducation=Rn;exports.themeEmerald=Ha;exports.themeEmeraldDark=sn;exports.themeEnhancedContrast=us;exports.themeEnterprise=Ln;exports.themeForest=on;exports.themeFuchsia=Ua;exports.themeGlassmorphism=ms;exports.themeGovernment=Tn;exports.themeHalloween=Gn;exports.themeHarvest=es;exports.themeHealthcare=An;exports.themeHighContrastDark=ls;exports.themeIndianFestive=os;exports.themeIndigo=Oa;exports.themeIvory=Pa;exports.themeJapaneseZen=ts;exports.themeLargeText=fs;exports.themeLavender=fn;exports.themeLegal=En;exports.themeLime=Wa;exports.themeMediterranean=ns;exports.themeMidnight=Ja;exports.themeMinimalist=ys;exports.themeMonochrome=ds;exports.themeMonokai=Hn;exports.themeMoroccan=rs;exports.themeNebula=rn;exports.themeNeon=Xn;exports.themeNeumorphismDark=gs;exports.themeNeumorphismLight=ps;exports.themeNord=zn;exports.themeObsidian=Ya;exports.themeOcean=cn;exports.themeOneDark=$n;exports.themeOnyx=Za;exports.themeOrange=Xa;exports.themePastelCoral=Mn;exports.themePastelLavender=xn;exports.themePastelLemon=wn;exports.themePastelMint=vn;exports.themePastelPeach=Sn;exports.themePastelRose=hn;exports.themePastelSage=kn;exports.themePastelSky=bn;exports.themePink=Va;exports.themeRealEstate=In;exports.themeRetrowave=Un;exports.themeRose=Fa;exports.themeRuby=Ga;exports.themeScandinavian=as;exports.themeSepia=_n;exports.themeShadow=nn;exports.themeSilver=za;exports.themeSky=qa;exports.themeSlate=Na;exports.themeSoftDark=bs;exports.themeSolarizedDark=Fn;exports.themeSolarizedLight=Pn;exports.themeSpring=pn;exports.themeStone=Ta;exports.themeSummerBeach=Yn;exports.themeSunset=dn;exports.themeSynthwave=Bn;exports.themeTeal=ja;exports.themeTechStartup=Nn;exports.themeTerminalGreen=On;exports.themeToCssVars=Pe;exports.themeTropical=yn;exports.themeValentine=Kn;exports.themeVaporwave=jn;exports.themeVintage=Wn;exports.themeViolet=Ba;exports.themeWarmDark=hs;exports.themeWarmGray=Ia;exports.themeWine=Ss;exports.themeWinterFrost=Qn;exports.themeZinc=La;exports.triggerHaptic=xr;exports.typewriterPress=to;exports.useAICompletion=Nl;exports.useAccessibleClick=Ui;exports.useAdaptiveVariant=vi;exports.useBrandColors=pi;exports.useBreakpoint=xe;exports.useChartPreferences=cl;exports.useChartSuggestion=Rl;exports.useChunkedProcessor=Zd;exports.useClickOutside=ui;exports.useCodeCompletion=Ll;exports.useCognitiveAccessibility=Ji;exports.useColorBlindMode=Rr;exports.useColorBlindModePersisted=sc;exports.useComponentDisplayClass=qo;exports.useComponentDisplayStyle=Uo;exports.useComponentHelp=Qr;exports.useContainerSize=bi;exports.useControlId=li;exports.useControlPreferences=Et;exports.useControllableState=vu;exports.useDarkMode=mi;exports.useDebouncedValue=di;exports.useDecodedImage=Eo;exports.useDeferredList=eu;exports.useDeferredSearch=Yd;exports.useDevice=mr;exports.useDisplayAnimation=Ko;exports.useDisplayDensity=Go;exports.useDisplayModeEdit=Yo;exports.useEventCleanup=lu;exports.useFocusManagement=Ki;exports.useFocusTrap=fi;exports.useFormGeneration=Il;exports.useGamepad=Ho;exports.useGridPreferences=il;exports.useHaptic=Fi;exports.useImageFormats=So;exports.useImagePreload=Ao;exports.useInputMode=ii;exports.useIsTouchDevice=oi;exports.useLazyImage=fu;exports.useLiveAnnouncement=Tr;exports.useLongPress=ci;exports.useMeasureEffect=Cc;exports.useMediaQuery=ze;exports.useMemoryMonitor=Wc;exports.useMemoryMonitorPerf=uu;exports.useNaturalLanguageFilter=Tl;exports.useNiceA11y=Bi;exports.useNiceAI=ce;exports.useNiceAccessMode=Li;exports.useNiceCollapse=Mi;exports.useNiceDataSource=dd;exports.useNiceDisplayStyle=Xo;exports.useNiceField=ud;exports.useNiceHelp=Yr;exports.useNiceIcon=ni;exports.useNiceLookupSource=fd;exports.useNiceRTL=Ei;exports.useNiceRecord=Ma;exports.useNiceTheme=Rd;exports.useNiceTransition=ki;exports.useNiceTutorials=aa;exports.useNiceTutorialsEnabled=rl;exports.useOptimistic=tu;exports.useOrientation=xi;exports.usePan=zi;exports.usePinch=Ii;exports.useProgressiveImage=Mo;exports.usePullToRefresh=Sr;exports.useRenderCount=wc;exports.useResolvedDisplayStyle=Se;exports.useResponsiveValue=hi;exports.useRestoreFocus=_i;exports.useRouteAnnouncement=Gi;exports.useRovingTabIndex=Oi;exports.useSafeAbortController=Vr;exports.useSafeAreaInsets=wi;exports.useSafeEventListener=Pc;exports.useSafeFetch=Fc;exports.useSafeInterval=Dc;exports.useSafeState=Ic;exports.useSafeSubscription=Hc;exports.useSafeTimeout=zc;exports.useSafeWebSocket=$c;exports.useSharedImageObserver=Lo;exports.useShowAt=Si;exports.useSpatialFocusable=$o;exports.useSpatialNav=Eu;exports.useSpatialNavOptional=Au;exports.useSubmitOnEnter=Xi;exports.useSwipe=Ri;exports.useTextImprovement=zl;exports.useThemeIsDark=Vd;exports.useThemeVariants=yo;exports.useTransitionState=Qd;exports.useUnmountLog=jc;exports.useUserPreferences=At;exports.useVirtualGrid=Kd;exports.useVirtualKeyboard=$i;exports.useVirtualScroll=vo;exports.useVoiceControl=qi;exports.useWhyDidYouRender=Hr;exports.useWindowedList=Jd;exports.useWorker=ru;exports.useWorkerPool=au;exports.validateData=id;exports.validateViewDocument=Ud;exports.vhsTracking=eo;exports.vogueDidone=ao;exports.warnControlledClash=Io;exports.watercolorWash=oo;exports.withCaching=Kl;exports.withCalculatedColumns=sd;exports.withCrossTabSync=pd;exports.withCursorPagination=Jl;exports.withLeakTracking=Bc;exports.withOptimisticUpdates=td;exports.withPolling=rd;exports.withWhyDidYouRender=xc;exports.y2kAqua=ro;exports.zenMinimal=Fs;exports.zinePunk=so;
|
|
153
|
+
</svg>`;return`data:image/svg+xml,${encodeURIComponent(o)}`}const gu={checkFormatSupport:Pe,useImageFormats:So,generateSrcset:xo,generateSizes:wo,selectOptimalSource:ko,useProgressiveImage:Mo,preloadImages:Co,useImagePreload:Ao,loadAndDecodeImage:Ht,useDecodedImage:Eo,createImageObserver:No,useSharedImageObserver:Lo,generateColorPlaceholder:To,generateGradientPlaceholder:Ro};function yu(e){return e["data-testid"]??e.testId}function $t(e){return e.error||e.status==="error"?"error":e.warning||e.status==="warning"?"warning":e.success||e.status==="success"?"success":e.status??"idle"}function hu(e){const t=$t(e),r={};return t==="error"&&(r["aria-invalid"]=!0),e.required&&(r["aria-required"]=!0),e.disabled&&(r["aria-disabled"]=!0),e.readOnly&&(r["aria-readonly"]=!0),e.describedById&&(r["aria-describedby"]=e.describedById),r}const Qt=new Set;function Io(e,t,r){process.env.NODE_ENV!=="production"&&t!==void 0&&r!==void 0&&!Qt.has(e)&&(Qt.add(e),console.warn(`[Nice2Dev] <${e}> received both \`value\` and \`defaultValue\`. Use one or the other (controlled XOR uncontrolled).`))}const Zt=new Set;function zo(e,t){process.env.NODE_ENV!=="production"&&(Zt.has(e)||(Zt.add(e),t()))}function Do(e){const{componentName:t,prop:r,replacement:a,removeIn:n,reason:s}=e;zo(`prop:${t}.${r}`,()=>{const i=[`[Nice2Dev] Prop \`${r}\` on <${t}> is deprecated.`,a?`Use \`${a}\` instead.`:"",n?`Will be removed in ${n}.`:"",s?`Reason: ${s}`:""].filter(Boolean);console.warn(i.join(" "))})}function bu(e){const{symbol:t,replacement:r,removeIn:a,reason:n}=e;zo(`symbol:${t}`,()=>{const s=[`[Nice2Dev] \`${t}\` is deprecated.`,r?`Use \`${r}\` instead.`:"",a?`Will be removed in ${a}.`:"",n?`Reason: ${n}`:""].filter(Boolean);console.warn(s.join(" "))})}function vu(e){return e.value!==void 0&&e.newValue===void 0&&Do({componentName:e.componentName,prop:e.prop,replacement:e.replacement,removeIn:e.removeIn}),e.newValue??e.value}const er=new Set;function Su(e){const{value:t,defaultValue:r,onChange:a,componentName:n="Component"}=e,s=t!==void 0,[i,o]=c.useState(r),l=c.useRef(s);process.env.NODE_ENV!=="production"&&(l.current!==s&&!er.has(n)&&(er.add(n),console.warn(`[Nice2Dev] <${n}> switched between controlled and uncontrolled. A component should not change between the two over its lifetime.`)),l.current=s,Io(n,t,e.defaultValue!==void 0?r:void 0));const d=s?t:i,u=c.useCallback((f,p)=>{const h=typeof f=="function"?f(d):f;s||o(h),a==null||a(h,p)},[d,s,a]);return[d,u,s]}const xu={idle:"nice-field-status nice-field-status--idle",success:"nice-field-status nice-field-status--success",warning:"nice-field-status nice-field-status--warning",error:"nice-field-status nice-field-status--error"};function wu(e){const t=$t(e),r=t==="error"&&(typeof e.error=="string"?e.error:void 0)||t==="warning"&&e.warning||t==="success"&&e.success||e.helperText||null;return r?x.jsx("div",{id:e.id,role:t==="error"?"alert":void 0,"aria-live":t==="error"?"assertive":"polite","data-testid":e.testId,className:[xu[t],e.className].filter(Boolean).join(" "),children:r}):null}const Po={0:"A",1:"B",2:"X",3:"Y",4:"LB",5:"RB",6:"LT",7:"RT",8:"Back",9:"Start",10:"LS",11:"RS",12:"DpadUp",13:"DpadDown",14:"DpadLeft",15:"DpadRight",16:"Home"},ku={0:"LeftX",1:"LeftY",2:"RightX",3:"RightY"},Mu={Cross:"A",Circle:"B",Square:"X",Triangle:"Y",L1:"LB",R1:"RB",L2:"LT",R2:"RT",Share:"Back",Options:"Start",L3:"LS",R3:"RS",PS:"Home"},Fo=Object.values(Po);function Ho(e={}){const{index:t=0,deadzone:r=.15,pollRate:a=16,actions:n={},enabled:s=!0,onButtonDown:i,onButtonUp:o}=e,[l,d]=c.useState({connected:!1,id:"",buttons:Ne(),axes:{LeftX:0,LeftY:0,RightX:0,RightY:0},leftTrigger:0,rightTrigger:0,vibrate:()=>{}}),u=c.useRef(Ne()),f=c.useRef(new Map),p=c.useRef(n);p.current=n;const h=c.useRef({onButtonDown:i,onButtonUp:o});h.current={onButtonDown:i,onButtonUp:o};const m=c.useRef({left:0,right:0}),y=c.useCallback((v,b=.5,S=.5)=>{var k,C;const A=navigator.getGamepads()[t];A!=null&&A.vibrationActuator&&((C=(k=A.vibrationActuator).playEffect)==null||C.call(k,"dual-rumble",{startDelay:0,duration:v,weakMagnitude:b,strongMagnitude:S}))},[t]),g=c.useCallback(v=>{if(Math.abs(v)<r)return 0;const b=v>0?1:-1,S=(Math.abs(v)-r)/(1-r);return b*S},[r]);return c.useEffect(()=>{if(!s)return;let v,b=0,S=!1;const w=A=>{var z,H,me,pe,ge,_,de,se;if(A-b<a){v=requestAnimationFrame(w);return}b=A;const C=navigator.getGamepads()[t];if(!C){S&&(S=!1,u.current=Ne(),d(B=>({...B,connected:!1,id:""}))),v=requestAnimationFrame(w);return}S=!0;const M=Ne();for(let B=0;B<C.buttons.length;B++){const P=Po[B];P&&(M[P]=C.buttons[B].pressed)}const N={LeftX:0,LeftY:0,RightX:0,RightY:0};for(let B=0;B<Math.min(C.axes.length,4);B++){const P=ku[B];P&&(N[P]=g(C.axes[B]))}const L=((z=C.buttons[6])==null?void 0:z.value)??0,E=((H=C.buttons[7])==null?void 0:H.value)??0,{onButtonDown:R,onButtonUp:T}=h.current;if(R||T)for(const B of Fo)M[B]&&!u.current[B]?R==null||R(B):!M[B]&&u.current[B]&&(T==null||T(B));const D=Date.now(),F=p.current;for(const[B,P]of Object.entries(F)){if(P.button||P.buttons){const U=P.buttons||[P.button],Y=U.every(Z=>M[Z]),Q=U.every(Z=>u.current[Z]);if(Y&&!Q)(me=P.onPress)==null||me.call(P),f.current.set(B,{startTime:D,lastRepeat:D});else if(!Y&&Q)(pe=P.onRelease)==null||pe.call(P),f.current.delete(B);else if(Y&&((ge=P.onHold)==null||ge.call(P),P.repeatDelay!==void 0&&P.repeatRate!==void 0)){const Z=f.current.get(B);Z&&D-Z.startTime>P.repeatDelay&&D-Z.lastRepeat>=P.repeatRate&&((_=P.onPress)==null||_.call(P),Z.lastRepeat=D)}}if(P.axis&&P.onAxisChange){const U=N[P.axis];P.axisDirection?P.axisDirection==="positive"&&U>0?P.onAxisChange(U):P.axisDirection==="negative"&&U<0&&P.onAxisChange(Math.abs(U)):P.onAxisChange(U)}if(P.trigger){const U=P.trigger==="LT"?L:E,Y=P.trigger==="LT"?m.current.left>.5:m.current.right>.5,Q=U>.5;Q&&!Y?(de=P.onPress)==null||de.call(P):!Q&&Y&&((se=P.onRelease)==null||se.call(P))}}u.current=M,m.current={left:L,right:E},d({connected:!0,id:C.id,buttons:M,axes:N,leftTrigger:L,rightTrigger:E,vibrate:y}),v=requestAnimationFrame(w)};return v=requestAnimationFrame(w),()=>cancelAnimationFrame(v)},[s,t,a,g,y]),c.useEffect(()=>{if(!s)return;const v=S=>{S.gamepad.index===t&&d(w=>({...w,connected:!0,id:S.gamepad.id}))},b=S=>{S.gamepad.index===t&&d(w=>({...w,connected:!1,id:""}))};return window.addEventListener("gamepadconnected",v),window.addEventListener("gamepaddisconnected",b),()=>{window.removeEventListener("gamepadconnected",v),window.removeEventListener("gamepaddisconnected",b)}},[s,t]),l}function Ne(){return{A:!1,B:!1,X:!1,Y:!1,LB:!1,RB:!1,LT:!1,RT:!1,Back:!1,Start:!1,LS:!1,RS:!1,DpadUp:!1,DpadDown:!1,DpadLeft:!1,DpadRight:!1,Home:!1}}function Cu(e){const t={};return e.onNavigateUp&&(t.navUp={button:"DpadUp",onPress:e.onNavigateUp,repeatDelay:400,repeatRate:100},t.navUpStick={axis:"LeftY",axisDirection:"negative",onAxisChange:r=>{var a;r>.8&&((a=e.onNavigateUp)==null||a.call(e))}}),e.onNavigateDown&&(t.navDown={button:"DpadDown",onPress:e.onNavigateDown,repeatDelay:400,repeatRate:100},t.navDownStick={axis:"LeftY",axisDirection:"positive",onAxisChange:r=>{var a;r>.8&&((a=e.onNavigateDown)==null||a.call(e))}}),e.onNavigateLeft&&(t.navLeft={button:"DpadLeft",onPress:e.onNavigateLeft,repeatDelay:400,repeatRate:100}),e.onNavigateRight&&(t.navRight={button:"DpadRight",onPress:e.onNavigateRight,repeatDelay:400,repeatRate:100}),e.onConfirm&&(t.confirm={button:"A",onPress:e.onConfirm}),e.onCancel&&(t.cancel={button:"B",onPress:e.onCancel}),e.onTabNext&&(t.tabNext={button:"RB",onPress:e.onTabNext}),e.onTabPrev&&(t.tabPrev={button:"LB",onPress:e.onTabPrev}),e.onMenu&&(t.menu={button:"Start",onPress:e.onMenu}),t}const Ge=c.createContext(null);function tr(e){if(!e)return null;const t=e.getBoundingClientRect();return t.width===0&&t.height===0?null:{x:t.left+t.width/2,y:t.top+t.height/2}}const Au=({keyboard:e=!0,gamepad:t=!0,gamepadIndex:r=0,children:a})=>{const[n,s]=c.useState([]),[i,o]=c.useState(null),l=c.useRef([]),d=c.useRef(null),u=c.useRef([]),f=c.useRef(0);c.useEffect(()=>{l.current=n},[n]),c.useEffect(()=>{d.current=i},[i]);const p=c.useCallback(()=>{f.current+=1},[]),h=c.useCallback(()=>{f.current=Math.max(0,f.current-1)},[]),m=c.useCallback((M,N)=>{u.current=[...u.current,{prefix:M,onDismiss:N}]},[]),y=c.useCallback(()=>{var L;const M=u.current;if(M.length===0)return;const N=M[M.length-1];u.current=M.slice(0,-1),(L=N.onDismiss)==null||L.call(N)},[]),g=c.useCallback(M=>{s(N=>N.some(L=>L.id===M.id)?N:[...N,M])},[]),v=c.useCallback(M=>{s(N=>{var E;const L=N.filter(R=>R.id!==M);if(d.current===M){const R=((E=L[0])==null?void 0:E.id)??null;o(R),d.current=R}return L})},[]),b=c.useCallback(M=>{o(M),d.current=M},[]),S=c.useCallback((M,N)=>{var pe,ge;if(f.current>0)return;const L=l.current.filter(_=>!_.disabled);if(L.length===0)return;const E=d.current,R=E?L.find(_=>_.id===E):void 0;if(!R){const _=L[0];b(_.id),(pe=_.ref.current)==null||pe.focus();return}const T=u.current,D=T.length>0?T[T.length-1]:void 0,F=L.filter(_=>_.id!==E&&(!D||_.id.startsWith(D.prefix))),z=tr(R.ref.current);if(!z||F.length===0)return;let H=null,me=1/0;for(const _ of F){const de=tr(_.ref.current);if(!de)continue;const se=de.x-z.x,B=de.y-z.y,P=M*se+N*B;if(P<=0)continue;const U=P,Y=Math.abs(M*B-N*se),Q=Math.sqrt(se*se+B*B)+Y*2-U*.001;Q<me&&(me=Q,H=_)}H&&(b(H.id),(ge=H.ref.current)==null||ge.focus())},[b]),w=c.useCallback(M=>{var E;if(f.current>0)return;const N=M??d.current;if(!N)return;const L=l.current.find(R=>R.id===N);L&&(L.onActivate?L.onActivate():(E=L.ref.current)==null||E.click())},[]);c.useEffect(()=>{if(!e)return;const M=N=>{if(!(f.current>0))switch(N.key){case"ArrowUp":S(0,-1),N.preventDefault();break;case"ArrowDown":S(0,1),N.preventDefault();break;case"ArrowLeft":S(-1,0),N.preventDefault();break;case"ArrowRight":S(1,0),N.preventDefault();break;case"Enter":case" ":d.current&&(w(),N.preventDefault());break;case"Escape":y();break}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[e,S,w,y]);const A=c.useRef({x:!0,y:!0}),k=c.useMemo(()=>({navUp:{button:"DpadUp",onPress:()=>S(0,-1),repeatDelay:400,repeatRate:120},navDown:{button:"DpadDown",onPress:()=>S(0,1),repeatDelay:400,repeatRate:120},navLeft:{button:"DpadLeft",onPress:()=>S(-1,0),repeatDelay:400,repeatRate:120},navRight:{button:"DpadRight",onPress:()=>S(1,0),repeatDelay:400,repeatRate:120},confirm:{button:"A",onPress:()=>w()},cancel:{button:"B",onPress:()=>y()},stickX:{axis:"LeftX",onAxisChange:M=>{Math.abs(M)>.6&&A.current.x?(A.current.x=!1,S(Math.sign(M),0)):Math.abs(M)<.3&&(A.current.x=!0)}},stickY:{axis:"LeftY",onAxisChange:M=>{Math.abs(M)>.6&&A.current.y?(A.current.y=!1,S(0,Math.sign(M))):Math.abs(M)<.3&&(A.current.y=!0)}}}),[S,w,y]);Ho({index:r,enabled:t,actions:k});const C=c.useMemo(()=>({register:g,unregister:v,moveFocus:S,activate:w,setActive:b,activeId:i,focusables:n,pushFocusTrap:m,popFocusTrap:y,pauseNavigation:p,resumeNavigation:h}),[g,v,S,w,b,i,n,m,y,p,h]);return x.jsx(Ge.Provider,{value:C,children:a})};function Eu(){return c.useContext(Ge)}function Nu(){const e=c.useContext(Ge);if(!e)throw new Error("useSpatialNav must be used inside a NiceSpatialNavProvider");return e}function $o(e,t){const r=c.useContext(Ge),{id:a,onActivate:n,disabled:s}=t,i=c.useRef(n);i.current=n;const o=r==null?void 0:r.register,l=r==null?void 0:r.unregister,d=r==null?void 0:r.setActive;c.useEffect(()=>{if(!(!o||!l||s))return o({id:a,ref:e,onActivate:()=>{var f;return(f=i.current)==null?void 0:f.call(i)},disabled:s}),()=>l(a)},[o,l,a,s,e]),c.useEffect(()=>{const f=e.current;if(!f||!d||s)return;const p=()=>d(a);return f.addEventListener("focus",p),()=>f.removeEventListener("focus",p)},[d,a,s,e]);const u=(r==null?void 0:r.activeId)===a;return c.useEffect(()=>{const f=e.current;f&&(u?f.dataset.active="true":delete f.dataset.active)},[u,e]),{active:u}}const Lu=({focusId:e,onActivate:t,disabled:r,as:a="div",className:n,style:s,children:i,...o})=>{const l=c.useRef(null),{active:d}=$o(l,{id:e,onActivate:t,disabled:r});return x.jsx(a,{ref:l,tabIndex:r?-1:0,className:`nice-focusable${d?" nice-focusable--active":""}${n?` ${n}`:""}`,style:s,onClick:t,...o,children:i})};Object.defineProperty(exports,"NICE_I18N_DICTIONARIES",{enumerable:!0,get:()=>V.NICE_I18N_DICTIONARIES});Object.defineProperty(exports,"NICE_SUPPORTED_LANGS",{enumerable:!0,get:()=>V.NICE_SUPPORTED_LANGS});Object.defineProperty(exports,"NiceI18nProvider",{enumerable:!0,get:()=>V.NiceI18nProvider});Object.defineProperty(exports,"createICUTranslator",{enumerable:!0,get:()=>V.createICUTranslator});Object.defineProperty(exports,"formatICU",{enumerable:!0,get:()=>V.formatICU});Object.defineProperty(exports,"useNiceTranslation",{enumerable:!0,get:()=>V.useNiceTranslation});exports.ANIMATION_VALUES=Fe;exports.BatchOperations=dd;exports.COMMON_SHORTCUTS=Vi;exports.ColumnFormulas=id;exports.DEFAULT_TRACELESS_POLICY=fl;exports.DEFAULT_VARIANT_CONFIG=K;exports.DENSITY_VALUES=ve;exports.DisplayModeView=Qo;exports.GAMEPAD_BUTTONS=Fo;exports.ImageOptimization=gu;exports.IndexedDBAdapter=ol;exports.LeakDetectorStatus=Xr;exports.LocalStorageAdapter=sa;exports.NICE_BREAKPOINTS=ue;exports.NICE_BUILTIN_ICONS=si;exports.NICE_COLOR_BLIND_MODES=rc;exports.NICE_DISPLAY_STYLES=Vo;exports.NICE_DISPLAY_STYLE_INFO=Jo;exports.NICE_THEME_GALLERY=xs;exports.NICE_THEME_PACKS=Pt;exports.NICE_THEME_PACKS_EXTENDED=Ft;exports.NICE_THEME_PACK_FONT_LINKS=Dd;exports.NICE_THEME_PACK_FONT_LINKS_EXTENDED=$d;exports.NICE_THEME_PACK_LIST=Bs;exports.NICE_THEME_PACK_LIST_EXTENDED=mo;exports.NICE_THEME_PRESETS=lt;exports.NICE_VIEW_COMPONENT_TYPES=Ud;exports.NiceA11yProvider=Mr;exports.NiceAIProvider=Nl;exports.NiceAccessControl=vr;exports.NiceDataCache=at;exports.NiceDisplayStyleContext=$e;exports.NiceFieldStatus=wu;exports.NiceFocusable=Lu;exports.NiceHelpIcon=ra;exports.NiceHelpProvider=Jr;exports.NiceIcon=fr;exports.NiceIconProvider=ri;exports.NiceInlineHelp=ea;exports.NiceKeyboardHint=Lr;exports.NicePreferencesPanel=ul;exports.NiceProfiler=xc;exports.NicePullToRefresh=Fi;exports.NiceQuickHelp=ta;exports.NiceRTLProvider=hr;exports.NiceRequestDeduplicator=Sa;exports.NiceSkipLink=Er;exports.NiceSpatialNavProvider=Au;exports.NiceStateIO=hd;exports.NiceSwipeableListItem=Pi;exports.NiceTestWrapper=Ir;exports.NiceThemeContext=Rt;exports.NiceThemeProvider=po;exports.NiceThemeVariantConfigurator=Wd;exports.NiceThemeVariantProvider=_d;exports.NiceTouchTarget=$i;exports.NiceTutorialButton=sl;exports.NiceTutorialsProvider=rl;exports.NiceUserPreferencesProvider=dl;exports.NiceVisuallyHidden=Ar;exports.PRIVACY_LEVEL_ORDER=fe;exports.PS_BUTTON_ALIASES=Mu;exports.ProfilerOverlay=_r;exports.RADIUS_VALUES=he;exports.RestAPISyncAdapter=il;exports.SHADOW_DARK_MODE_VALUES=rr;exports.SHADOW_VALUES=Re;exports.StorageAdapter=da;exports.TRACELESS_MODE_PRESETS=ia;exports.TRACELESS_POLICY_HEADER=Sl;exports.VARIANT_PRESETS=He;exports.ValidationRules=ld;exports.accessModeAttrs=Ri;exports.aggregate=re;exports.analog70s=Zs;exports.applyColorBlindMode=ht;exports.applyTheme=Sd;exports.applyVariantConfig=pt;exports.applyVariantsToTheme=Wo;exports.arcticCrystal=Vs;exports.artDecoGatsby=Gs;exports.auditStorageCompliance=El;exports.auditWCAG22AAA=ec;exports.autumnFoliage=Xs;exports.bankVault=js;exports.bauhaus=$s;exports.blackTieGala=uo;exports.blueprint=Js;exports.brutalistRaw=Rs;exports.buildAriaDescribedBy=Cr;exports.buildFieldA11y=hu;exports.buildFormFieldAria=Oi;exports.calculateDataDiff=xa;exports.candyPop=zs;exports.checkAriaCompliance=yc;exports.checkContrastAAA=Zi;exports.checkFormatSupport=Pe;exports.checkRegression=Or;exports.claymorphism=Hs;exports.clearAllClientStorage=Al;exports.clearLeakReports=Ic;exports.clearProfilingData=bt;exports.comicHalftone=no;exports.configureLeakDetector=Tc;exports.configureProfiler=Dr;exports.createArrayDataSource=Hl;exports.createColorBlindController=ic;exports.createCustomDataSource=Vl;exports.createEventCleanup=uu;exports.createGraphQLDataSource=Wl;exports.createGraphQLSubscriptionSource=Jc;exports.createImageObserver=No;exports.createIndexedDBDataSource=nt;exports.createInfiniteScroll=Zl;exports.createInlineWorker=su;exports.createLRUCache=cu;exports.createMockDataSource=gc;exports.createNavigationActions=Cu;exports.createNicePluginSystem=dc;exports.createNiceReduxMiddleware=qc;exports.createODataDataSource=_l;exports.createObjectPool=pu;exports.createOfflineFirstDataSource=pd;exports.createPermissiveInstanceCeiling=Cl;exports.createPolicyHeader=wl;exports.createReactQueryAdapter=Xc;exports.createRestDataSource=ma;exports.createRestrictiveInstanceCeiling=Ml;exports.createSSEDataSource=nd;exports.createSignalRDataSource=td;exports.createStorageAdapter=kl;exports.createURLStateManager=yd;exports.createUserPreferencesStore=bd;exports.createWeakCache=iu;exports.createWeakRefCache=lu;exports.createWebSocketDataSource=ed;exports.createZustandAdapter=Uc;exports.deepSea=Qs;exports.defaultValidationMessage=ha;exports.deprecateProp=Do;exports.deprecateSymbol=bu;exports.deriveMode=Et;exports.deserializeTheme=Cd;exports.desertDune=Ws;exports.dieterRams=lo;exports.endMark=_e;exports.evaluateCondition=Gd;exports.evaluateValidation=va;exports.evaluateValidationRule=ba;exports.filterGroupToWhere=Xl;exports.filterNiceThemePacksByTag=Hd;exports.filterNiceThemePacksExtendedByTag=Bd;exports.forceGC=Wc;exports.forestCanopy=_s;exports.formatShortcut=Nr;exports.forwardDeprecated=vu;exports.generateBadgeStyles=ar;exports.generateButtonStyles=dt;exports.generateCardStyles=ft;exports.generateColorPlaceholder=To;exports.generateColumnsFromSchema=Qc;exports.generateFillStyles=_o;exports.generateFormFieldsFromSchema=Zc;exports.generateFromOpenAPI=Yc;exports.generateGradientPlaceholder=Ro;exports.generateInputStyles=ut;exports.generatePaletteFromColor=hi;exports.generateSizes=wo;exports.generateSrcset=xo;exports.generateTabStyles=nr;exports.generateTableStyles=ir;exports.generateToggleStyles=sr;exports.generateTooltipStyles=or;exports.generateTracelessComplianceReport=yl;exports.generateVariantCSS=mt;exports.getComponentStats=Fr;exports.getComponentStyleFromConfig=lr;exports.getComputedTheme=kd;exports.getDisplayStyleDataAttrs=dr;exports.getGracefulDegradationInfo=vl;exports.getLeakReports=Rc;exports.getLeakSummary=Wr;exports.getMemoryStats=Te;exports.getMorePrivateMode=ml;exports.getNiceAnimationClass=Ei;exports.getNiceThemePack=Fd;exports.getNiceThemePackExtended=jd;exports.getPerformanceReport=$r;exports.getProfilingStats=Pr;exports.getRecentTimings=bc;exports.getSlowRenders=vt;exports.getTracelessBadgeInfo=bl;exports.getTransferables=ou;exports.glassAurora=Is;exports.groupBy=Lt;exports.groupByHierarchical=ka;exports.hologramUI=Ys;exports.hyggeScandinavian=Ts;exports.inkSumie=co;exports.isAtLeastAsPrivate=Le;exports.isRecordValid=Kl;exports.isSafeUrl=ei;exports.japaneseWashi=Us;exports.loadAndDecodeImage=Ht;exports.logicalProps=Li;exports.matchesFilterCondition=ya;exports.matchesFilterGroup=Nt;exports.matchesShortcut=Xi;exports.measureAsync=Mc;exports.measureSync=Cc;exports.memphis80s=io;exports.moroccanMosaic=qs;exports.neonArcade=Ls;exports.newspaperBroadsheet=Ds;exports.niceReduxActions=Gc;exports.niceReduxReducer=Kc;exports.niceSelectors=fc;exports.niceStaggerDelay=Ai;exports.niceThemeBlue=ks;exports.niceThemeBootstrap=As;exports.niceThemeDark=ws;exports.niceThemeFluent=Es;exports.niceThemeHighContrast=Ms;exports.niceThemeLight=zt;exports.niceThemeMaterial=Cs;exports.normalizeSize=Bo;exports.normalizeVariant=Oo;exports.obsidianEditorial=Ns;exports.parsePolicyFromHeader=xl;exports.pivot=sd;exports.preloadImages=Co;exports.printPerformanceReport=St;exports.removeTheme=Aa;exports.removeVariantConfig=cr;exports.resolveControlStoragePermissions=gl;exports.resolveDisplayStyleConfig=be;exports.resolveStatus=$t;exports.resolveStepsI18n=na;exports.resolveTestId=yu;exports.resolveTracelessPolicy=pl;exports.resolveTutorial=nl;exports.sanitizeHtml=Zo;exports.saveBaseline=Br;exports.selectOptimalSource=ko;exports.serializeTheme=Md;exports.setupReactDevToolsIntegration=Ec;exports.shouldShowConsentBanner=ca;exports.simulateKeyboard=mc;exports.simulateType=pc;exports.sortModelToOrderBy=Ul;exports.sovietConstructivist=Ks;exports.startMark=Oe;exports.swissGrid=fo;exports.synthwave84=Ps;exports.takeMemorySnapshot=_c;exports.testId=uc;exports.themeAbyss=an;exports.themeAfricanEarth=cs;exports.themeAmber=$a;exports.themeArctic=gn;exports.themeAurora=un;exports.themeAutumn=mn;exports.themeBanking=Cn;exports.themeBrazilianCarnival=is;exports.themeCarbon=en;exports.themeCharcoal=Da;exports.themeCherryBlossom=Zn;exports.themeChineseNewYear=ss;exports.themeChristmas=qn;exports.themeCoffee=vs;exports.themeCoolGray=Ra;exports.themeCoral=Ka;exports.themeCosmos=tn;exports.themeCyan=_a;exports.themeCyberpunk=Vn;exports.themeDesert=ln;exports.themeDracula=Dn;exports.themeEaster=Jn;exports.themeEclipse=Qa;exports.themeEducation=Rn;exports.themeEmerald=Ha;exports.themeEmeraldDark=sn;exports.themeEnhancedContrast=us;exports.themeEnterprise=Ln;exports.themeForest=on;exports.themeFuchsia=Ua;exports.themeGlassmorphism=ms;exports.themeGovernment=Tn;exports.themeHalloween=Gn;exports.themeHarvest=es;exports.themeHealthcare=An;exports.themeHighContrastDark=ls;exports.themeIndianFestive=os;exports.themeIndigo=Oa;exports.themeIvory=Pa;exports.themeJapaneseZen=ts;exports.themeLargeText=fs;exports.themeLavender=fn;exports.themeLegal=En;exports.themeLime=Wa;exports.themeMediterranean=ns;exports.themeMidnight=Ja;exports.themeMinimalist=ys;exports.themeMonochrome=ds;exports.themeMonokai=Hn;exports.themeMoroccan=rs;exports.themeNebula=rn;exports.themeNeon=Xn;exports.themeNeumorphismDark=gs;exports.themeNeumorphismLight=ps;exports.themeNord=zn;exports.themeObsidian=Ya;exports.themeOcean=cn;exports.themeOneDark=$n;exports.themeOnyx=Za;exports.themeOrange=Xa;exports.themePastelCoral=Mn;exports.themePastelLavender=xn;exports.themePastelLemon=wn;exports.themePastelMint=vn;exports.themePastelPeach=Sn;exports.themePastelRose=hn;exports.themePastelSage=kn;exports.themePastelSky=bn;exports.themePink=Va;exports.themeRealEstate=In;exports.themeRetrowave=Un;exports.themeRose=Fa;exports.themeRuby=Ga;exports.themeScandinavian=as;exports.themeSepia=_n;exports.themeShadow=nn;exports.themeSilver=za;exports.themeSky=qa;exports.themeSlate=Na;exports.themeSoftDark=bs;exports.themeSolarizedDark=Fn;exports.themeSolarizedLight=Pn;exports.themeSpring=pn;exports.themeStone=Ta;exports.themeSummerBeach=Yn;exports.themeSunset=dn;exports.themeSynthwave=jn;exports.themeTeal=Ba;exports.themeTechStartup=Nn;exports.themeTerminalGreen=On;exports.themeToCssVars=De;exports.themeTropical=yn;exports.themeValentine=Kn;exports.themeVaporwave=Bn;exports.themeVintage=Wn;exports.themeViolet=ja;exports.themeWarmDark=hs;exports.themeWarmGray=Ia;exports.themeWine=Ss;exports.themeWinterFrost=Qn;exports.themeZinc=La;exports.triggerHaptic=xr;exports.typewriterPress=to;exports.useAICompletion=Ll;exports.useAccessibleClick=qi;exports.useAdaptiveVariant=Si;exports.useBrandColors=gi;exports.useBreakpoint=xe;exports.useChartPreferences=ll;exports.useChartSuggestion=Il;exports.useChunkedProcessor=eu;exports.useClickOutside=fi;exports.useCodeCompletion=Tl;exports.useCognitiveAccessibility=Yi;exports.useColorBlindMode=Rr;exports.useColorBlindModePersisted=oc;exports.useComponentDisplayClass=qo;exports.useComponentDisplayStyle=Uo;exports.useComponentHelp=Qr;exports.useContainerSize=vi;exports.useControlId=di;exports.useControlPreferences=At;exports.useControllableState=Su;exports.useDarkMode=pi;exports.useDebouncedValue=ui;exports.useDecodedImage=Eo;exports.useDeferredList=tu;exports.useDeferredSearch=Qd;exports.useDevice=mr;exports.useDisplayAnimation=Ko;exports.useDisplayDensity=Go;exports.useDisplayModeEdit=Yo;exports.useEventCleanup=du;exports.useFocusManagement=Ji;exports.useFocusTrap=mi;exports.useFormGeneration=zl;exports.useGamepad=Ho;exports.useGridPreferences=cl;exports.useHaptic=Hi;exports.useHoldRepeat=li;exports.useImageFormats=So;exports.useImagePreload=Ao;exports.useInputMode=ii;exports.useIsTouchDevice=oi;exports.useLazyImage=mu;exports.useLiveAnnouncement=Tr;exports.useLongPress=ci;exports.useMeasureEffect=Ac;exports.useMediaQuery=Ie;exports.useMemoryMonitor=Vc;exports.useMemoryMonitorPerf=fu;exports.useNaturalLanguageFilter=Rl;exports.useNiceA11y=Bi;exports.useNiceAI=ce;exports.useNiceAccessMode=Ti;exports.useNiceCollapse=Ci;exports.useNiceDataSource=ud;exports.useNiceDisplayStyle=Xo;exports.useNiceField=fd;exports.useNiceHelp=Yr;exports.useNiceIcon=ni;exports.useNiceLookupSource=md;exports.useNiceRTL=Ni;exports.useNiceRecord=Ma;exports.useNiceTheme=Id;exports.useNiceTransition=Mi;exports.useNiceTutorials=aa;exports.useNiceTutorialsEnabled=al;exports.useOptimistic=ru;exports.useOrientation=wi;exports.usePan=Di;exports.usePinch=zi;exports.useProgressiveImage=Mo;exports.usePullToRefresh=Sr;exports.useRenderCount=kc;exports.useResolvedDisplayStyle=Se;exports.useResponsiveValue=bi;exports.useRestoreFocus=Wi;exports.useRouteAnnouncement=Ki;exports.useRovingTabIndex=_i;exports.useSafeAbortController=Vr;exports.useSafeAreaInsets=ki;exports.useSafeEventListener=Fc;exports.useSafeFetch=Hc;exports.useSafeInterval=Pc;exports.useSafeState=zc;exports.useSafeSubscription=$c;exports.useSafeTimeout=Dc;exports.useSafeWebSocket=jc;exports.useSharedImageObserver=Lo;exports.useShowAt=xi;exports.useSpatialFocusable=$o;exports.useSpatialNav=Nu;exports.useSpatialNavOptional=Eu;exports.useSubmitOnEnter=Ui;exports.useSwipe=Ii;exports.useTextImprovement=Dl;exports.useThemeIsDark=Xd;exports.useThemeVariants=yo;exports.useTransitionState=Zd;exports.useUnmountLog=Oc;exports.useUserPreferences=Ct;exports.useVirtualGrid=Jd;exports.useVirtualKeyboard=ji;exports.useVirtualScroll=vo;exports.useVoiceControl=Gi;exports.useWhyDidYouRender=Hr;exports.useWindowedList=Yd;exports.useWorker=au;exports.useWorkerPool=nu;exports.validateData=cd;exports.validateViewDocument=qd;exports.vhsTracking=eo;exports.vogueDidone=ao;exports.warnControlledClash=Io;exports.watercolorWash=oo;exports.withCaching=Jl;exports.withCalculatedColumns=od;exports.withCrossTabSync=gd;exports.withCursorPagination=Yl;exports.withLeakTracking=Bc;exports.withOptimisticUpdates=rd;exports.withPolling=ad;exports.withWhyDidYouRender=wc;exports.y2kAqua=ro;exports.zenMinimal=Fs;exports.zinePunk=so;
|
|
154
154
|
//# sourceMappingURL=index.cjs.map
|