@jasonshimmy/custom-elements-runtime 2.2.0 → 2.2.2

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.
@@ -1,21 +1,145 @@
1
- import { anchorBlock as be } from "./custom-elements-runtime.directives.es.js";
2
- function xe(e, ...r) {
1
+ import { anchorBlock as ye } from "./custom-elements-runtime.directives.es.js";
2
+ const $e = `/*
3
+ * Custom Elements Variables CSS
4
+ * CSS variables for colors and fonts
5
+ */
6
+
7
+ :root,
8
+ :host {
9
+ /* Font families (match runtime defaults in src/lib/runtime/style.ts) */
10
+ --cer-font-sans:
11
+ ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
12
+ 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
13
+ --cer-font-serif: ui-serif, Georgia, 'Times New Roman', Times, serif;
14
+ --cer-font-mono:
15
+ ui-monospace, 'SFMono-Regular', Menlo, Monaco, 'Roboto Mono', 'Courier New',
16
+ monospace;
17
+
18
+ /* Default outline style */
19
+ --cer-outline-style: solid;
20
+
21
+ /* Colors */
22
+ --cer-color-transparent: transparent;
23
+ --cer-color-current: currentColor;
24
+ --cer-color-black: #000000;
25
+ --cer-color-white: #ffffff;
26
+ --cer-color-inherit: inherit;
27
+
28
+ /* neutral */
29
+ --cer-color-neutral-50: #fafafa;
30
+ --cer-color-neutral-100: #f4f4f5;
31
+ --cer-color-neutral-200: #e4e4e7;
32
+ --cer-color-neutral-300: #d4d4d8;
33
+ --cer-color-neutral-400: #9f9fa9;
34
+ --cer-color-neutral-500: #71717b;
35
+ --cer-color-neutral-600: #52525c;
36
+ --cer-color-neutral-700: #3f3f46;
37
+ --cer-color-neutral-800: #27272a;
38
+ --cer-color-neutral-900: #18181b;
39
+ --cer-color-neutral-950: #09090b;
40
+
41
+ /* primary */
42
+ --cer-color-primary-50: #eff6ff;
43
+ --cer-color-primary-100: #dbeafe;
44
+ --cer-color-primary-200: #bfdbfe;
45
+ --cer-color-primary-300: #93c5fd;
46
+ --cer-color-primary-400: #60a5fa;
47
+ --cer-color-primary-500: #3b82f6;
48
+ --cer-color-primary-600: #2563eb;
49
+ --cer-color-primary-700: #1d4ed8;
50
+ --cer-color-primary-800: #1e40af;
51
+ --cer-color-primary-900: #1e3a8a;
52
+ --cer-color-primary-950: #172554;
53
+
54
+ /* secondary */
55
+ --cer-color-secondary-50: #eef2ff;
56
+ --cer-color-secondary-100: #e0e7ff;
57
+ --cer-color-secondary-200: #c7d2fe;
58
+ --cer-color-secondary-300: #a5b4fc;
59
+ --cer-color-secondary-400: #818cf8;
60
+ --cer-color-secondary-500: #6366f1;
61
+ --cer-color-secondary-600: #4f46e5;
62
+ --cer-color-secondary-700: #4338ca;
63
+ --cer-color-secondary-800: #3730a3;
64
+ --cer-color-secondary-900: #312e81;
65
+ --cer-color-secondary-950: #1e1b4b;
66
+
67
+ /* success */
68
+ --cer-color-success-50: #f0fdf4;
69
+ --cer-color-success-100: #dcfce7;
70
+ --cer-color-success-200: #bbf7d0;
71
+ --cer-color-success-300: #86efac;
72
+ --cer-color-success-400: #4ade80;
73
+ --cer-color-success-500: #22c55e;
74
+ --cer-color-success-600: #16a34a;
75
+ --cer-color-success-700: #15803d;
76
+ --cer-color-success-800: #166534;
77
+ --cer-color-success-900: #14532d;
78
+ --cer-color-success-950: #052e16;
79
+
80
+ /* info */
81
+ --cer-color-info-50: #f0f9ff;
82
+ --cer-color-info-100: #e0f2fe;
83
+ --cer-color-info-200: #bae6fd;
84
+ --cer-color-info-300: #7dd3fc;
85
+ --cer-color-info-400: #38bdf8;
86
+ --cer-color-info-500: #0ea5e9;
87
+ --cer-color-info-600: #0284c7;
88
+ --cer-color-info-700: #0369a1;
89
+ --cer-color-info-800: #075985;
90
+ --cer-color-info-900: #0c4a6e;
91
+ --cer-color-info-950: #082f49;
92
+
93
+ /* warning */
94
+ --cer-color-warning-50: #fffbeb;
95
+ --cer-color-warning-100: #fef3c7;
96
+ --cer-color-warning-200: #fde68a;
97
+ --cer-color-warning-300: #fcd34d;
98
+ --cer-color-warning-400: #fbbf24;
99
+ --cer-color-warning-500: #f59e0b;
100
+ --cer-color-warning-600: #d97706;
101
+ --cer-color-warning-700: #b45309;
102
+ --cer-color-warning-800: #92400e;
103
+ --cer-color-warning-900: #78350f;
104
+ --cer-color-warning-950: #451a03;
105
+
106
+ /* error */
107
+ --cer-color-error-50: #fef2f2;
108
+ --cer-color-error-100: #fee2e2;
109
+ --cer-color-error-200: #fecaca;
110
+ --cer-color-error-300: #fca5a5;
111
+ --cer-color-error-400: #f87171;
112
+ --cer-color-error-500: #ef4444;
113
+ --cer-color-error-600: #dc2626;
114
+ --cer-color-error-700: #b91c1c;
115
+ --cer-color-error-800: #991b1b;
116
+ --cer-color-error-900: #7f1d1d;
117
+ --cer-color-error-950: #450a0a;
118
+ }
119
+ `;
120
+ function ke(e, ...r) {
3
121
  let o = "";
4
- for (let i = 0; i < e.length; i++)
5
- o += e[i], i < r.length && (o += r[i]);
122
+ for (let n = 0; n < e.length; n++)
123
+ o += e[n], n < r.length && (o += r[n]);
6
124
  return o;
7
125
  }
8
- function ve(e) {
126
+ function ge(e) {
9
127
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
10
128
  }
11
- let J = null;
12
- function We() {
13
- return J || (J = new CSSStyleSheet(), J.replaceSync(ve(we))), J;
129
+ let K = null;
130
+ function Ie() {
131
+ return K || (typeof CSSStyleSheet > "u" ? K = {
132
+ cssRules: [],
133
+ replaceSync: () => {
134
+ },
135
+ toString: () => ge(pe)
136
+ } : (K = new CSSStyleSheet(), K.replaceSync(ge(pe)))), K;
14
137
  }
15
138
  function De(e) {
16
139
  return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
17
140
  }
18
- const we = xe`
141
+ const pe = ke`
142
+ ${$e}
19
143
  :host,
20
144
  *,
21
145
  ::before,
@@ -132,7 +256,7 @@ const we = xe`
132
256
  [hidden] {
133
257
  display: none;
134
258
  }
135
- `, $e = {
259
+ `, je = {
136
260
  // Existing semantic colors
137
261
  neutral: {
138
262
  50: "#fafafa",
@@ -230,17 +354,17 @@ const we = xe`
230
354
  black: { DEFAULT: "#000000" },
231
355
  transparent: { DEFAULT: "transparent" },
232
356
  current: { DEFAULT: "currentColor" }
233
- }, he = Object.fromEntries(
234
- Object.entries($e).map(([e, r]) => [
357
+ }, xe = Object.fromEntries(
358
+ Object.entries(je).map(([e, r]) => [
235
359
  e,
236
360
  Object.fromEntries(
237
- Object.entries(r).map(([o, i]) => [
361
+ Object.entries(r).map(([o, n]) => [
238
362
  o,
239
- `var(--cer-color-${e}${o === "DEFAULT" ? "" : `-${o}`}, ${i})`
363
+ `var(--cer-color-${e}${o === "DEFAULT" ? "" : `-${o}`}, ${n})`
240
364
  ])
241
365
  )
242
366
  ])
243
- ), B = "0.25rem", ye = {
367
+ ), I = "0.25rem", Se = {
244
368
  "3xs": 64,
245
369
  "2xs": 72,
246
370
  xs: 80,
@@ -285,7 +409,7 @@ const we = xe`
285
409
  gap: ["gap"],
286
410
  "gap-x": ["column-gap"],
287
411
  "gap-y": ["row-gap"]
288
- }, ke = () => {
412
+ }, Te = () => {
289
413
  const e = {};
290
414
  e["@container"] = "container-type:inline-size;", [
291
415
  "block",
@@ -409,8 +533,8 @@ const we = xe`
409
533
  ["text-7xl", "4.5rem", "1"],
410
534
  ["text-8xl", "6rem", "1"],
411
535
  ["text-9xl", "8rem", "1"]
412
- ].forEach(([t, a, g]) => {
413
- e[t] = `font-size:${a};line-height:var(--cer-line-height,${g});`;
536
+ ].forEach(([t, a, d]) => {
537
+ e[t] = `font-size:${a};line-height:var(--cer-line-height,${d});`;
414
538
  }), [
415
539
  ["tracking-tighter", "-0.05em"],
416
540
  ["tracking-tight", "-0.025em"],
@@ -438,8 +562,8 @@ const we = xe`
438
562
  ].forEach(([t, a]) => {
439
563
  e[t] = `line-height:${a};--cer-line-height:${a};line-height:var(--cer-line-height,${a});`;
440
564
  });
441
- const l = [0, 1, 2, 4, 6, 8];
442
- for (const t of l) {
565
+ const s = [0, 1, 2, 4, 6, 8];
566
+ for (const t of s) {
443
567
  const a = `${t}px`;
444
568
  e[`outline-${t}`] = `outline-style:var(--cer-outline-style);outline-width:${a};`, e[`outline-offset-${t}`] = `outline-offset:${a};`, e[`border-${t}`] = `border-width:${a};`, e[`border-t-${t}`] = `border-top-width:${a};`, e[`border-r-${t}`] = `border-right-width:${a};`, e[`border-b-${t}`] = `border-bottom-width:${a};`, e[`border-l-${t}`] = `border-left-width:${a};`, e[`border-x-${t}`] = `border-left-width:${a};border-right-width:${a};`, e[`border-y-${t}`] = `border-top-width:${a};border-bottom-width:${a};`;
445
569
  }
@@ -480,8 +604,8 @@ const we = xe`
480
604
  full: 9999
481
605
  };
482
606
  for (const [t, a] of Object.entries(u)) {
483
- const g = a === 9999 ? "9999px" : `${a / 16}rem`;
484
- e[`rounded-${t}`] = `border-radius:${g};`, e[`rounded-t-${t}`] = `border-top-left-radius:${g};border-top-right-radius:${g};`, e[`rounded-r-${t}`] = `border-top-right-radius:${g};border-bottom-right-radius:${g};`, e[`rounded-b-${t}`] = `border-bottom-left-radius:${g};border-bottom-right-radius:${g};`, e[`rounded-l-${t}`] = `border-top-left-radius:${g};border-bottom-left-radius:${g};`, e[`rounded-tl-${t}`] = `border-top-left-radius:${g};`, e[`rounded-tr-${t}`] = `border-top-right-radius:${g};`, e[`rounded-br-${t}`] = `border-bottom-right-radius:${g};`, e[`rounded-bl-${t}`] = `border-bottom-left-radius:${g};`;
607
+ const d = a === 9999 ? "9999px" : `${a / 16}rem`;
608
+ e[`rounded-${t}`] = `border-radius:${d};`, e[`rounded-t-${t}`] = `border-top-left-radius:${d};border-top-right-radius:${d};`, e[`rounded-r-${t}`] = `border-top-right-radius:${d};border-bottom-right-radius:${d};`, e[`rounded-b-${t}`] = `border-bottom-left-radius:${d};border-bottom-right-radius:${d};`, e[`rounded-l-${t}`] = `border-top-left-radius:${d};border-bottom-left-radius:${d};`, e[`rounded-tl-${t}`] = `border-top-left-radius:${d};`, e[`rounded-tr-${t}`] = `border-top-right-radius:${d};`, e[`rounded-br-${t}`] = `border-bottom-right-radius:${d};`, e[`rounded-bl-${t}`] = `border-bottom-left-radius:${d};`;
485
609
  }
486
610
  Object.assign(e, {
487
611
  "shadow-none": "--cer-shadow-color:rgb(0 0 0 / 0);box-shadow:0 0 var(--cer-shadow-color, #0000);",
@@ -509,7 +633,7 @@ const we = xe`
509
633
  "overflow-y-visible": "overflow-y:visible;",
510
634
  "overflow-y-scroll": "overflow-y:scroll;"
511
635
  });
512
- const j = [
636
+ const m = [
513
637
  "auto",
514
638
  "default",
515
639
  "pointer",
@@ -521,7 +645,7 @@ const we = xe`
521
645
  "grab",
522
646
  "grabbing"
523
647
  ];
524
- for (const t of j) e[`cursor-${t}`] = `cursor:${t};`;
648
+ for (const t of m) e[`cursor-${t}`] = `cursor:${t};`;
525
649
  for (const t of [0, 10, 20, 30, 40, 50]) e[`z-${t}`] = `z-index:${t};`;
526
650
  Object.assign(e, {
527
651
  "sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
@@ -557,8 +681,8 @@ const we = xe`
557
681
  "mx-auto": "margin-inline:auto;",
558
682
  "my-auto": "margin-block:auto;"
559
683
  });
560
- for (const [t, a] of Object.entries(ye))
561
- e[`max-w-${t}`] = `max-width:calc(${B} * ${a});`, e[`min-w-${t}`] = `min-width:calc(${B} * ${a});`, e[`w-${t}`] = `width:calc(${B} * ${a});`, e[`max-h-${t}`] = `max-height:calc(${B} * ${a});`, e[`min-h-${t}`] = `min-height:calc(${B} * ${a});`, e[`h-${t}`] = `height:calc(${B} * ${a});`;
684
+ for (const [t, a] of Object.entries(Se))
685
+ e[`max-w-${t}`] = `max-width:calc(${I} * ${a});`, e[`min-w-${t}`] = `min-width:calc(${I} * ${a});`, e[`w-${t}`] = `width:calc(${I} * ${a});`, e[`max-h-${t}`] = `max-height:calc(${I} * ${a});`, e[`min-h-${t}`] = `min-height:calc(${I} * ${a});`, e[`h-${t}`] = `height:calc(${I} * ${a});`;
562
686
  Object.assign(e, {
563
687
  transition: "transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;",
564
688
  "transition-none": "transition-property:none;",
@@ -675,33 +799,33 @@ const we = xe`
675
799
  "bg-conic-at-l": "background-image:conic-gradient(from 0deg at left, var(--cer-gradient-stops));",
676
800
  "bg-conic-at-tl": "background-image:conic-gradient(from 0deg at top left, var(--cer-gradient-stops));"
677
801
  }), e;
678
- }, re = ke();
679
- function L(e, r) {
802
+ }, re = Te();
803
+ function M(e, r) {
680
804
  let o = 0;
681
- for (let i = 0; i < e.length; i++) {
682
- const s = e[i];
683
- if (s === "[" || s === "(") o++;
684
- else if ((s === "]" || s === ")") && o > 0) o--;
685
- else if (o === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
686
- return e.slice(0, i) + r + e.slice(i);
805
+ for (let n = 0; n < e.length; n++) {
806
+ const c = e[n];
807
+ if (c === "[" || c === "(") o++;
808
+ else if ((c === "]" || c === ")") && o > 0) o--;
809
+ else if (o === 0 && (c === ">" || c === "+" || c === "~" || c === " "))
810
+ return e.slice(0, n) + r + e.slice(n);
687
811
  }
688
812
  return e + r;
689
813
  }
690
- const je = {
814
+ const Ce = {
691
815
  before: (e, r) => `${e}::before{${r}}`,
692
816
  after: (e, r) => `${e}::after{${r}}`,
693
- hover: (e, r) => `${L(e, ":hover")}{${r}}`,
694
- focus: (e, r) => `${L(e, ":focus")}{${r}}`,
695
- active: (e, r) => `${L(e, ":active")}{${r}}`,
696
- disabled: (e, r) => `${L(e, ":disabled")}{${r}}`,
697
- visited: (e, r) => `${L(e, ":visited")}{${r}}`,
698
- checked: (e, r) => `${L(e, ":checked")}{${r}}`,
699
- first: (e, r) => `${L(e, ":first-child")}{${r}}`,
700
- last: (e, r) => `${L(e, ":last-child")}{${r}}`,
701
- odd: (e, r) => `${L(e, ":nth-child(odd)")}{${r}}`,
702
- even: (e, r) => `${L(e, ":nth-child(even)")}{${r}}`,
703
- "focus-within": (e, r) => `${L(e, ":focus-within")}{${r}}`,
704
- "focus-visible": (e, r) => `${L(e, ":focus-visible")}{${r}}`,
817
+ hover: (e, r) => `${M(e, ":hover")}{${r}}`,
818
+ focus: (e, r) => `${M(e, ":focus")}{${r}}`,
819
+ active: (e, r) => `${M(e, ":active")}{${r}}`,
820
+ disabled: (e, r) => `${M(e, ":disabled")}{${r}}`,
821
+ visited: (e, r) => `${M(e, ":visited")}{${r}}`,
822
+ checked: (e, r) => `${M(e, ":checked")}{${r}}`,
823
+ first: (e, r) => `${M(e, ":first-child")}{${r}}`,
824
+ last: (e, r) => `${M(e, ":last-child")}{${r}}`,
825
+ odd: (e, r) => `${M(e, ":nth-child(odd)")}{${r}}`,
826
+ even: (e, r) => `${M(e, ":nth-child(even)")}{${r}}`,
827
+ "focus-within": (e, r) => `${M(e, ":focus-within")}{${r}}`,
828
+ "focus-visible": (e, r) => `${M(e, ":focus-visible")}{${r}}`,
705
829
  "group-hover": (e, r) => `.group:hover ${e}{${r}}`,
706
830
  "group-focus": (e, r) => `.group:focus ${e}{${r}}`,
707
831
  "group-active": (e, r) => `.group:active ${e}{${r}}`,
@@ -717,7 +841,7 @@ const je = {
717
841
  xl: "(min-width:1280px)",
718
842
  "2xl": "(min-width:1536px)",
719
843
  dark: "(prefers-color-scheme: dark)"
720
- }, ge = {
844
+ }, me = {
721
845
  xs: "(min-width:20rem)",
722
846
  sm: "(min-width:24rem)",
723
847
  md: "(min-width:28rem)",
@@ -729,7 +853,7 @@ const je = {
729
853
  "5xl": "(min-width:64rem)",
730
854
  "6xl": "(min-width:72rem)",
731
855
  "7xl": "(min-width:80rem)"
732
- }, ie = ["sm", "md", "lg", "xl", "2xl"], ne = [
856
+ }, ne = ["sm", "md", "lg", "xl", "2xl"], ie = [
733
857
  "xs",
734
858
  "sm",
735
859
  "md",
@@ -743,45 +867,47 @@ const je = {
743
867
  "7xl"
744
868
  ];
745
869
  function ae(e) {
746
- const r = e.startsWith("-"), o = r ? e.slice(1) : e, i = o.lastIndexOf("-");
747
- if (i === -1) return null;
748
- const s = o.slice(0, i), l = o.slice(i + 1);
749
- if (!te[s]) return null;
750
- if (l.includes("/")) {
751
- const [t, a] = l.split("/").map((T) => parseFloat(T));
870
+ const r = e.startsWith("-"), o = r ? e.slice(1) : e, n = o.lastIndexOf("-");
871
+ if (n === -1) return null;
872
+ const c = o.slice(0, n), s = o.slice(n + 1);
873
+ if (!te[c]) return null;
874
+ if (s.includes("/")) {
875
+ const [t, a] = s.split("/").map(($) => parseFloat($));
752
876
  if (Number.isNaN(t) || Number.isNaN(a) || a === 0)
753
877
  return null;
754
- const g = t / a * 100;
755
- return te[s].map((T) => `${T}:${g}%;`).join("");
878
+ const d = t / a * 100;
879
+ return te[c].map(($) => `${$}:${d}%;`).join("");
756
880
  }
757
- const u = parseFloat(l);
881
+ const u = parseFloat(s);
758
882
  if (Number.isNaN(u)) return null;
759
- const j = r ? "-" : "";
760
- return te[s].map((t) => `${t}:calc(${j}${B} * ${u});`).join("");
883
+ const m = r ? "-" : "";
884
+ return te[c].map((t) => `${t}:calc(${m}${I} * ${u});`).join("");
761
885
  }
762
- function se(e) {
763
- const r = e.startsWith("-"), i = (r ? e.slice(1) : e).match(/^space-(x|y)-(.+)$/);
764
- if (!i) return null;
765
- const [, s, l] = i, u = s === "x";
766
- if (l === "reverse")
886
+ function ce(e) {
887
+ const r = e.startsWith("-"), n = (r ? e.slice(1) : e).match(/^space-(x|y)-(.+)$/);
888
+ if (!n) return null;
889
+ const [, c, s] = n, u = c === "x";
890
+ if (s === "reverse")
767
891
  return u ? "--cer-space-x-reverse:1;" : "--cer-space-y-reverse:1;";
768
- if (l.includes("/")) {
769
- const [g, T] = l.split("/").map((z) => parseFloat(z));
770
- if (Number.isNaN(g) || Number.isNaN(T) || T === 0)
892
+ if (s.includes("/")) {
893
+ const [d, $] = s.split("/").map((A) => parseFloat(A));
894
+ if (Number.isNaN(d) || Number.isNaN($) || $ === 0)
771
895
  return null;
772
- const A = g / T * 100, S = r ? "-" : "";
773
- return u ? `--cer-space-x-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-inline-start:calc(${S}${A}% * calc(1 - var(--cer-space-x-reverse)));margin-inline-end:calc(${S}${A}% * var(--cer-space-x-reverse));}` : `--cer-space-y-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-top:calc(${S}${A}% * calc(1 - var(--cer-space-y-reverse)));margin-bottom:calc(${S}${A}% * var(--cer-space-y-reverse));}`;
896
+ const v = d / $ * 100, C = r ? "-" : "";
897
+ return u ? `--cer-space-x-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-inline-start:calc(${C}${v}% * calc(1 - var(--cer-space-x-reverse)));margin-inline-end:calc(${C}${v}% * var(--cer-space-x-reverse));}` : `--cer-space-y-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-top:calc(${C}${v}% * calc(1 - var(--cer-space-y-reverse)));margin-bottom:calc(${C}${v}% * var(--cer-space-y-reverse));}`;
774
898
  }
775
- const j = parseFloat(l);
776
- if (Number.isNaN(j)) return null;
777
- const a = `calc(${r ? "-" : ""}${B} * ${j})`;
899
+ const m = parseFloat(s);
900
+ if (Number.isNaN(m)) return null;
901
+ const a = `calc(${r ? "-" : ""}${I} * ${m})`;
778
902
  return u ? `--cer-space-x-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-inline-start:calc(${a} * calc(1 - var(--cer-space-x-reverse)));margin-inline-end:calc(${a} * var(--cer-space-x-reverse));}` : `--cer-space-y-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-top:calc(${a} * calc(1 - var(--cer-space-y-reverse)));margin-bottom:calc(${a} * var(--cer-space-y-reverse));}`;
779
903
  }
780
- function ue(e) {
781
- const r = e.replace("#", ""), o = parseInt(r, 16);
904
+ function J(e) {
905
+ let r = e.replace("#", "");
906
+ r.length === 3 && (r = r.split("").map((n) => n + n).join(""));
907
+ const o = parseInt(r, 16);
782
908
  return `${o >> 16 & 255} ${o >> 8 & 255} ${o & 255}`;
783
909
  }
784
- const Te = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/, Ae = {
910
+ const Ae = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/, Fe = {
785
911
  bg: "background-color",
786
912
  decoration: "text-decoration-color",
787
913
  text: "color",
@@ -792,56 +918,89 @@ const Te = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)
792
918
  fill: "fill",
793
919
  stroke: "stroke"
794
920
  };
795
- function Se(e) {
796
- const r = Te.exec(e);
921
+ function Oe(e) {
922
+ const r = Ae.exec(e);
797
923
  if (!r) return null;
798
- const [, o, i, s = "DEFAULT"] = r, l = he[i]?.[s];
799
- if (!l) return null;
800
- if (o === "shadow") return `--cer-shadow-color:${l};`;
801
- const u = Ae[o];
802
- return u ? `${u}:${l};` : null;
924
+ const [, o, n, c = "DEFAULT"] = r, s = xe[n]?.[c];
925
+ if (!s) return null;
926
+ if (o === "shadow") return `--cer-shadow-color:${s};`;
927
+ const u = Fe[o];
928
+ return u ? `${u}:${s};` : null;
803
929
  }
804
- function Fe(e) {
930
+ function Ee(e) {
805
931
  const r = e.indexOf("/");
806
932
  if (r === -1) return { base: e };
807
- const o = e.slice(0, r), i = e.slice(r + 1), s = parseInt(i, 10);
808
- return isNaN(s) || s < 0 || s > 100 ? { base: o } : { base: o, opacity: s / 100 };
933
+ const o = e.slice(0, r), n = e.slice(r + 1), c = parseInt(n, 10);
934
+ return isNaN(c) || c < 0 || c > 100 ? { base: o } : { base: o, opacity: c / 100 };
809
935
  }
810
- function le(e) {
811
- const { base: r, opacity: o } = Fe(e), i = Se(r);
812
- if (i && o !== void 0) {
813
- const l = /#([0-9a-f]{6})/i.exec(i);
814
- if (l) {
815
- const u = ue(l[0]);
816
- return i.replace(/#([0-9a-f]{6})/i, `rgb(${u} / ${o})`);
936
+ function se(e) {
937
+ const { base: r, opacity: o } = Ee(e), n = Oe(r);
938
+ if (n) {
939
+ if (o !== void 0) {
940
+ if (n.includes("var(")) {
941
+ const u = /var\([^)]*\)/.exec(n);
942
+ if (u) {
943
+ const m = u[0], t = o * 100, a = `color-mix(in srgb, ${m} ${t}%, rgba(0 0 0 / 0) ${100 - t}%)`, d = /#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(m), $ = /^([a-z-]+):/.exec(n), v = $ ? $[1] : "background-color";
944
+ if (d) {
945
+ const A = `rgb(${J(d[0])} / ${o})`, f = m.replace(
946
+ /#([0-9a-f]{6}|[0-9a-f]{3})/i,
947
+ A
948
+ );
949
+ return `${v}:${f};__CE_COLOR_MIX_SPLIT__${v}:${a};`;
950
+ }
951
+ return `${v}:${a};`;
952
+ }
953
+ }
954
+ const s = /#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(n);
955
+ if (s) {
956
+ const u = J(s[0]);
957
+ return n.replace(
958
+ /#([0-9a-f]{6}|[0-9a-f]{3})/i,
959
+ `rgb(${u} / ${o})`
960
+ );
961
+ }
817
962
  }
963
+ return n;
818
964
  }
819
- if (i) return i;
820
- const s = Q(r);
821
- if (s && o !== void 0) {
822
- const l = /#([0-9a-f]{6})/i.exec(s);
823
- if (l) {
824
- const u = ue(l[0]);
825
- return s.replace(
826
- /#([0-9a-f]{6})/i,
965
+ const c = Z(r);
966
+ if (c && o !== void 0) {
967
+ if (c.includes("var(")) {
968
+ const u = /var\([^)]*\)/.exec(c);
969
+ if (u) {
970
+ const m = u[0], t = o * 100, a = `color-mix(in srgb, ${m} ${t}%, rgba(0 0 0 / 0) ${100 - t}%)`, d = /#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(m), $ = /^([a-z-]+):/.exec(c), v = $ ? $[1] : null;
971
+ if (d && v) {
972
+ const A = `rgb(${J(d[0])} / ${o})`, f = m.replace(
973
+ /#([0-9a-f]{6}|[0-9a-f]{3})/i,
974
+ A
975
+ );
976
+ return `${v}:${f};__CE_COLOR_MIX_SPLIT__${v}:${a};`;
977
+ }
978
+ return c.replace(m, a);
979
+ }
980
+ }
981
+ const s = /#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(c);
982
+ if (s) {
983
+ const u = J(s[0]);
984
+ return c.replace(
985
+ /#([0-9a-f]{6}|[0-9a-f]{3})/i,
827
986
  `rgb(${u} / ${o})`
828
987
  );
829
988
  }
830
989
  }
831
- return s;
990
+ return c;
832
991
  }
833
- function ce(e) {
992
+ function le(e) {
834
993
  const r = /^(from|to|via)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
835
994
  if (!r) return null;
836
- const [, o, i, s = "DEFAULT"] = r, l = he[i]?.[s];
837
- if (!l) return null;
995
+ const [, o, n, c = "DEFAULT"] = r, s = xe[n]?.[c];
996
+ if (!s) return null;
838
997
  switch (o) {
839
998
  case "from":
840
- return `--cer-gradient-from:${l} var(--cer-gradient-from-position);--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), var(--cer-gradient-to);`;
999
+ return `--cer-gradient-from:${s} var(--cer-gradient-from-position);--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), var(--cer-gradient-to);`;
841
1000
  case "to":
842
- return `--cer-gradient-to:${l} var(--cer-gradient-to-position);`;
1001
+ return `--cer-gradient-to:${s} var(--cer-gradient-to-position);`;
843
1002
  case "via":
844
- return `--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), ${l} var(--cer-gradient-via-position), var(--cer-gradient-to);`;
1003
+ return `--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), ${s} var(--cer-gradient-via-position), var(--cer-gradient-to);`;
845
1004
  default:
846
1005
  return null;
847
1006
  }
@@ -852,17 +1011,17 @@ function de(e) {
852
1011
  const o = parseInt(r[1], 10);
853
1012
  return o < 0 || o > 100 ? null : `opacity:${o / 100};`;
854
1013
  }
855
- function Q(e) {
1014
+ function Z(e) {
856
1015
  if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
857
- const u = e.slice(1, -1).trim(), j = u.indexOf(":");
858
- if (j === -1) return null;
859
- const t = u.slice(0, j).trim();
860
- let a = u.slice(j + 1).trim();
1016
+ const u = e.slice(1, -1).trim(), m = u.indexOf(":");
1017
+ if (m === -1) return null;
1018
+ const t = u.slice(0, m).trim();
1019
+ let a = u.slice(m + 1).trim();
861
1020
  return /^[a-zA-Z][a-zA-Z0-9-]*$/.test(t) ? (a = a.replace(/_/g, " "), a = a.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), a = a.replace(/^'([^']*)'$/g, '"$1"'), `${t}:${a};`) : null;
862
1021
  }
863
1022
  const r = e.indexOf("-[");
864
1023
  if (r <= 0 || !e.endsWith("]")) return null;
865
- const o = e.slice(0, r), i = e.slice(r + 2, -1).replace(/_/g, " "), s = {
1024
+ const o = e.slice(0, r), n = e.slice(r + 2, -1).replace(/_/g, " "), c = {
866
1025
  bg: "background-color",
867
1026
  shadow: "box-shadow",
868
1027
  p: "padding",
@@ -903,15 +1062,15 @@ function Q(e) {
903
1062
  opacity: "opacity"
904
1063
  };
905
1064
  if (o === "text")
906
- return /^\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex)$/.test(i) ? `font-size:${i};` : `color:${i};`;
907
- if (o === "rotate") return `transform:rotate(${i});`;
908
- if (o === "scale") return `transform:scale(${i});`;
909
- if (o === "translate-x") return `transform:translateX(${i});`;
910
- if (o === "translate-y") return `transform:translateY(${i});`;
911
- const l = s[o] ?? o.replace(/_/g, "-");
912
- return l && i ? `${l}:${i};` : null;
1065
+ return /^\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex)$/.test(n) ? `font-size:${n};` : `color:${n};`;
1066
+ if (o === "rotate") return `transform:rotate(${n});`;
1067
+ if (o === "scale") return `transform:scale(${n});`;
1068
+ if (o === "translate-x") return `transform:translateX(${n});`;
1069
+ if (o === "translate-y") return `transform:translateY(${n});`;
1070
+ const s = c[o] ?? o.replace(/_/g, "-");
1071
+ return s && n ? `${s}:${n};` : null;
913
1072
  }
914
- function Ce(e) {
1073
+ function _e(e) {
915
1074
  if (e.startsWith("[") && e.endsWith("]")) {
916
1075
  const o = e.slice(1, -1);
917
1076
  return o.includes("&") ? o : e;
@@ -923,44 +1082,44 @@ function Ce(e) {
923
1082
  }
924
1083
  return null;
925
1084
  }
926
- function pe(e) {
1085
+ function be(e) {
927
1086
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
928
1087
  }
929
- function Oe(e) {
1088
+ function ze(e) {
930
1089
  const r = /class\s*=\s*(['"])([\s\S]*?)\1/g, o = [];
931
- let i;
932
- for (; i = r.exec(e); ) {
933
- const s = i[2].split(/\s+/).filter(Boolean);
934
- s.length && o.push(...s);
1090
+ let n;
1091
+ for (; n = r.exec(e); ) {
1092
+ const c = n[2].split(/\s+/).filter(Boolean);
1093
+ c.length && o.push(...c);
935
1094
  }
936
1095
  return o;
937
1096
  }
938
- const K = /* @__PURE__ */ new Map(), Ee = 16, me = 1e3;
939
- function ze(e) {
940
- const r = Date.now(), o = K.get(e);
941
- if (o && r - o.timestamp < Ee)
1097
+ const G = /* @__PURE__ */ new Map(), Re = 16, he = 1e3;
1098
+ function Le(e) {
1099
+ const r = Date.now(), o = G.get(e);
1100
+ if (o && r - o.timestamp < Re)
942
1101
  return o.css;
943
- const i = Oe(e);
944
- if (!i.length) return "";
945
- const s = new Set(i), l = [[], [], [], []], u = {}, j = (f, p = !1) => {
946
- const d = p ? `dark|${f}` : f;
947
- if (d in u) return u[d];
948
- const m = T(f, p);
949
- return u[d] = m, m;
1102
+ const n = ze(e);
1103
+ if (!n.length) return "";
1104
+ const c = new Set(n), s = [[], [], [], []], u = {}, m = (f, p = !1) => {
1105
+ const g = p ? `dark|${f}` : f;
1106
+ if (g in u) return u[g];
1107
+ const b = $(f, p);
1108
+ return u[g] = b, b;
950
1109
  }, t = (f) => {
951
- const p = f.some((w) => ie.includes(w)), d = f.some(
952
- (w) => w.startsWith("@") && (ne.includes(w.slice(1)) || w.match(/^@\[.+\]$/))
953
- ), m = f.includes("dark");
954
- return f.length ? !p && !m && !d ? 1 : m && (p || d) ? 3 : 2 : 0;
1110
+ const p = f.some((k) => ne.includes(k)), g = f.some(
1111
+ (k) => k.startsWith("@") && (ie.includes(k.slice(1)) || k.match(/^@\[.+\]$/))
1112
+ ), b = f.includes("dark");
1113
+ return f.length ? !p && !b && !g ? 1 : b && (p || g) ? 3 : 2 : 0;
955
1114
  }, a = (f) => {
956
1115
  const p = [];
957
- let d = "", m = 0;
958
- for (let w = 0; w < f.length; w++) {
959
- const b = f[w];
960
- b === "[" || b === "(" ? m++ : (b === "]" || b === ")") && m--, b === ":" && m === 0 ? (p.push(d), d = "") : d += b;
1116
+ let g = "", b = 0;
1117
+ for (let k = 0; k < f.length; k++) {
1118
+ const x = f[k];
1119
+ x === "[" || x === "(" ? b++ : (x === "]" || x === ")") && b--, x === ":" && b === 0 ? (p.push(g), g = "") : g += x;
961
1120
  }
962
- return d && p.push(d), p;
963
- }, g = {
1121
+ return g && p.push(g), p;
1122
+ }, d = {
964
1123
  hover: ":hover",
965
1124
  focus: ":focus",
966
1125
  active: ":active",
@@ -973,144 +1132,144 @@ function ze(e) {
973
1132
  even: ":nth-child(even)",
974
1133
  "focus-within": ":focus-within",
975
1134
  "focus-visible": ":focus-visible"
976
- }, T = (f, p = !1) => {
977
- const d = a(f);
978
- let m = "", w = !1;
979
- for (const n of d) {
980
- let v = n;
981
- if (v.startsWith("!") && (w = !0, v = v.slice(1)), re[v] || ae(v) || se(v) || de(v) || le(v) || ce(v) || Q(v)) {
982
- m = n;
1135
+ }, $ = (f, p = !1) => {
1136
+ const g = a(f);
1137
+ let b = "", k = !1;
1138
+ for (const i of g) {
1139
+ let y = i;
1140
+ if (y.startsWith("!") && (k = !0, y = y.slice(1)), re[y] || ae(y) || ce(y) || de(y) || se(y) || le(y) || Z(y)) {
1141
+ b = i;
983
1142
  break;
984
1143
  }
985
1144
  }
986
- if (!m) return null;
987
- const b = m.replace(/^!/, ""), C = re[b] ?? ae(b) ?? se(b) ?? de(b) ?? le(b) ?? ce(b) ?? Q(b);
988
- if (!C) return null;
989
- const k = d.indexOf(m);
990
- let h = k >= 0 ? d.slice(0, k) : [];
991
- p && (h = h.filter((n) => n !== "dark"));
992
- const P = `.${pe(f)}`, W = w ? C.replace(/;/g, " !important;") : C, x = "__SUBJECT__";
993
- let c = x;
994
- const D = [];
995
- for (const n of h)
996
- n.startsWith("group-") ? (c = `.group:${n.slice(6)} ${c}`, D.push(n)) : n.startsWith("peer-") && (c = c.replace(
997
- x,
998
- `.peer:${n.slice(5)}~${x}`
999
- ), D.push(n));
1000
- h = h.filter((n) => !D.includes(n));
1001
- const _ = [], V = [];
1002
- let y = null;
1003
- for (const n of h) {
1004
- if (n === "dark" || ie.includes(n) || n.startsWith("@") && (ne.includes(n.slice(1)) || n.match(/^@\[.+\]$/)))
1145
+ if (!b) return null;
1146
+ const x = b.replace(/^!/, ""), O = re[x] ?? ae(x) ?? ce(x) ?? de(x) ?? se(x) ?? le(x) ?? Z(x);
1147
+ if (!O) return null;
1148
+ const T = g.indexOf(b);
1149
+ let h = T >= 0 ? g.slice(0, T) : [];
1150
+ p && (h = h.filter((i) => i !== "dark"));
1151
+ const R = `.${be(f)}`, _ = k ? O.replace(/;/g, " !important;") : O, w = "__SUBJECT__";
1152
+ let l = w;
1153
+ const P = [];
1154
+ for (const i of h)
1155
+ i.startsWith("group-") ? (l = `.group:${i.slice(6)} ${l}`, P.push(i)) : i.startsWith("peer-") && (l = l.replace(
1156
+ w,
1157
+ `.peer:${i.slice(5)}~${w}`
1158
+ ), P.push(i));
1159
+ h = h.filter((i) => !P.includes(i));
1160
+ const W = [], V = [];
1161
+ let S = null;
1162
+ for (const i of h) {
1163
+ if (i === "dark" || ne.includes(i) || i.startsWith("@") && (ie.includes(i.slice(1)) || i.match(/^@\[.+\]$/)))
1005
1164
  continue;
1006
- const v = Ce(n);
1007
- if (v) {
1008
- y = v;
1165
+ const y = _e(i);
1166
+ if (y) {
1167
+ S = y;
1009
1168
  continue;
1010
1169
  }
1011
- const F = g[n];
1170
+ const F = d[i];
1012
1171
  if (F) {
1013
- y ? V.push(F) : _.push(F);
1172
+ S ? V.push(F) : W.push(F);
1014
1173
  continue;
1015
1174
  }
1016
- const O = je[n];
1017
- typeof O == "function" && (c = O(c, W).split("{")[0]);
1175
+ const E = Ce[i];
1176
+ typeof E == "function" && (l = E(l, _).split("{")[0]);
1018
1177
  }
1019
- const I = _.join(""), R = V.join("");
1020
- function X(n, v) {
1021
- if (!v) return n;
1022
- let F = 0, O = 0;
1023
- if (n.length && (n[0] === ">" || n[0] === "+" || n[0] === "~" || n[0] === " ")) {
1024
- let $ = 1;
1025
- for (; $ < n.length && n[$] === " "; ) $++;
1026
- for (; $ < n.length; $++) {
1027
- const E = n[$];
1028
- if (E === "[" ? F++ : E === "]" && F > 0 ? F-- : E === "(" ? O++ : E === ")" && O > 0 && O--, F === 0 && O === 0 && (n[$] === ">" || n[$] === "+" || n[$] === "~" || n[$] === " "))
1029
- return n.slice(0, $) + v + n.slice($);
1178
+ const D = W.join(""), L = V.join("");
1179
+ function Q(i, y) {
1180
+ if (!y) return i;
1181
+ let F = 0, E = 0;
1182
+ if (i.length && (i[0] === ">" || i[0] === "+" || i[0] === "~" || i[0] === " ")) {
1183
+ let j = 1;
1184
+ for (; j < i.length && i[j] === " "; ) j++;
1185
+ for (; j < i.length; j++) {
1186
+ const z = i[j];
1187
+ if (z === "[" ? F++ : z === "]" && F > 0 ? F-- : z === "(" ? E++ : z === ")" && E > 0 && E--, F === 0 && E === 0 && (i[j] === ">" || i[j] === "+" || i[j] === "~" || i[j] === " "))
1188
+ return i.slice(0, j) + y + i.slice(j);
1030
1189
  }
1031
- return n + v;
1190
+ return i + y;
1032
1191
  }
1033
- for (let $ = 0; $ < n.length; $++) {
1034
- const E = n[$];
1035
- if (E === "[" ? F++ : E === "]" && F > 0 ? F-- : E === "(" ? O++ : E === ")" && O > 0 && O--, F === 0 && O === 0 && (E === ">" || E === "+" || E === "~" || E === " "))
1036
- return n.slice(0, $) + v + n.slice($);
1192
+ for (let j = 0; j < i.length; j++) {
1193
+ const z = i[j];
1194
+ if (z === "[" ? F++ : z === "]" && F > 0 ? F-- : z === "(" ? E++ : z === ")" && E > 0 && E--, F === 0 && E === 0 && (z === ">" || z === "+" || z === "~" || z === " "))
1195
+ return i.slice(0, j) + y + i.slice(j);
1037
1196
  }
1038
- return n + v;
1197
+ return i + y;
1039
1198
  }
1040
- if (y)
1041
- if (y.includes("&")) {
1042
- const n = y.indexOf("&"), v = y.slice(0, n), F = y.slice(n + 1), O = x + I;
1043
- if (_.length === 0)
1044
- c = c.replace(
1045
- x,
1046
- v + O + R + F
1199
+ if (S)
1200
+ if (S.includes("&")) {
1201
+ const i = S.indexOf("&"), y = S.slice(0, i), F = S.slice(i + 1), E = w + D;
1202
+ if (W.length === 0)
1203
+ l = l.replace(
1204
+ w,
1205
+ y + E + L + F
1047
1206
  );
1048
1207
  else {
1049
- const $ = X(F, R);
1050
- c = c.replace(
1051
- x,
1052
- v + O + $
1208
+ const j = Q(F, L);
1209
+ l = l.replace(
1210
+ w,
1211
+ y + E + j
1053
1212
  );
1054
1213
  }
1055
1214
  } else
1056
- c = c.replace(
1057
- x,
1058
- `${y}${x + I}`
1059
- ), R && (c = c.replace(x, `${x}${R}`));
1215
+ l = l.replace(
1216
+ w,
1217
+ `${S}${w + D}`
1218
+ ), L && (l = l.replace(w, `${w}${L}`));
1060
1219
  else
1061
- c = c.replace(
1062
- x,
1063
- x + I + R
1220
+ l = l.replace(
1221
+ w,
1222
+ w + D + L
1064
1223
  );
1065
- c = c.replace(new RegExp(x, "g"), P);
1066
- let U = `${c}{${W}}`;
1067
- const Y = h.filter(
1068
- (n) => ie.includes(n)
1224
+ l = l.replace(new RegExp(w, "g"), R);
1225
+ const fe = "__CE_COLOR_MIX_SPLIT__", ve = _.includes(fe) ? _.split(fe).map((i) => `${l}{${i}}`) : [`${l}{${_}}`], Y = h.filter(
1226
+ (i) => ne.includes(i)
1069
1227
  ), ee = h.filter(
1070
- (n) => n.startsWith("@") && (ne.includes(n.slice(1)) || n.match(/^@\[.+\]$/))
1071
- ), G = Y.length ? Y[Y.length - 1] : null, H = ee.length ? ee[ee.length - 1] : null, fe = h.includes("dark");
1072
- let M = "", N = "";
1073
- if (fe && G ? M = `@media (prefers-color-scheme: dark) and ${oe[G]}` : fe ? M = "@media (prefers-color-scheme: dark)" : G && (M = `@media ${oe[G]}`), H)
1228
+ (i) => i.startsWith("@") && (ie.includes(i.slice(1)) || i.match(/^@\[.+\]$/))
1229
+ ), q = Y.length ? Y[Y.length - 1] : null, H = ee.length ? ee[ee.length - 1] : null, ue = h.includes("dark");
1230
+ let N = "", U = "";
1231
+ if (ue && q ? N = `@media (prefers-color-scheme: dark) and ${oe[q]}` : ue ? N = "@media (prefers-color-scheme: dark)" : q && (N = `@media ${oe[q]}`), H)
1074
1232
  if (H.startsWith("@[") && H.endsWith("]")) {
1075
- const n = H.slice(2, -1);
1076
- if (!/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|cm|mm|in|pt|pc)$/.test(n))
1233
+ const i = H.slice(2, -1);
1234
+ if (!/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|cm|mm|in|pt|pc)$/.test(i))
1077
1235
  return null;
1078
- N = `@container (min-width:${n})`;
1236
+ U = `@container (min-width:${i})`;
1079
1237
  } else {
1080
- const n = H.slice(1);
1081
- N = `@container ${ge[n] || `(min-width:${n})`}`;
1238
+ const i = H.slice(1);
1239
+ U = `@container ${me[i] || `(min-width:${i})`}`;
1082
1240
  }
1083
- return M && N ? U = `${M}${N}{${U}}` : M ? U = `${M}{${U}}` : N && (U = `${N}{${U}}`), U;
1241
+ const we = (i) => N && U ? `${N}${U}{${i}}` : N ? `${N}{${i}}` : U ? `${U}{${i}}` : i;
1242
+ return ve.map(we).join("");
1084
1243
  };
1085
- for (const f of s) {
1086
- const p = a(f), d = p.find(
1087
- (k) => re[k.replace(/^!/, "")] || ae(k.replace(/^!/, "")) || se(k.replace(/^!/, "")) || de(k.replace(/^!/, "")) || le(k.replace(/^!/, "")) || ce(k.replace(/^!/, "")) || Q(k.replace(/^!/, ""))
1244
+ for (const f of c) {
1245
+ const p = a(f), g = p.find(
1246
+ (T) => re[T.replace(/^!/, "")] || ae(T.replace(/^!/, "")) || ce(T.replace(/^!/, "")) || de(T.replace(/^!/, "")) || se(T.replace(/^!/, "")) || le(T.replace(/^!/, "")) || Z(T.replace(/^!/, ""))
1088
1247
  );
1089
- if (!d) continue;
1090
- const m = p.indexOf(d), w = m >= 0 ? p.slice(0, m) : [], b = t(w), C = j(f);
1091
- C && l[b].push(C);
1248
+ if (!g) continue;
1249
+ const b = p.indexOf(g), k = b >= 0 ? p.slice(0, b) : [], x = t(k), O = m(f);
1250
+ O && s[x].push(O);
1092
1251
  }
1093
- const A = /^(from|via|to)-[a-z]+-?\d{2,3}?$/;
1094
- for (const f of s)
1095
- if (A.test(f)) {
1096
- if (l.flat().join("").includes(`.${pe(f)}`)) continue;
1097
- const d = j(f);
1098
- d && l[0].push(d);
1252
+ const v = /^(from|via|to)-[a-z]+-?\d{2,3}?$/;
1253
+ for (const f of c)
1254
+ if (v.test(f)) {
1255
+ if (s.flat().join("").includes(`.${be(f)}`)) continue;
1256
+ const g = m(f);
1257
+ g && s[0].push(g);
1099
1258
  }
1100
- const S = (f) => f.sort((p, d) => {
1101
- const m = (P) => {
1102
- const W = {
1259
+ const C = (f) => f.sort((p, g) => {
1260
+ const b = (R) => {
1261
+ const _ = {
1103
1262
  sm: 640,
1104
1263
  md: 768,
1105
1264
  lg: 1024,
1106
1265
  xl: 1280,
1107
1266
  "2xl": 1536
1108
1267
  };
1109
- for (const [x, c] of Object.entries(W))
1110
- if (P.includes(`@media ${oe[x]}`)) return c;
1268
+ for (const [w, l] of Object.entries(_))
1269
+ if (R.includes(`@media ${oe[w]}`)) return l;
1111
1270
  return -1;
1112
- }, w = (P) => {
1113
- const W = {
1271
+ }, k = (R) => {
1272
+ const _ = {
1114
1273
  xs: 320,
1115
1274
  // 20rem
1116
1275
  sm: 384,
@@ -1134,27 +1293,27 @@ function ze(e) {
1134
1293
  "7xl": 1280
1135
1294
  // 80rem
1136
1295
  };
1137
- for (const [x, c] of Object.entries(W))
1138
- if (P.includes(`@container ${ge[x]}`)) return c;
1139
- if (P.includes("@container (min-width:")) {
1140
- const x = /@container \(min-width:(\d+(?:\.\d+)?)(px|rem|em)/.exec(P);
1141
- if (x) {
1142
- const c = parseFloat(x[1]), D = x[2];
1143
- return D === "rem" || D === "em" ? c * 16 : c;
1296
+ for (const [w, l] of Object.entries(_))
1297
+ if (R.includes(`@container ${me[w]}`)) return l;
1298
+ if (R.includes("@container (min-width:")) {
1299
+ const w = /@container \(min-width:(\d+(?:\.\d+)?)(px|rem|em)/.exec(R);
1300
+ if (w) {
1301
+ const l = parseFloat(w[1]), P = w[2];
1302
+ return P === "rem" || P === "em" ? l * 16 : l;
1144
1303
  }
1145
1304
  }
1146
1305
  return -1;
1147
- }, b = m(p), C = m(d), k = w(p), h = w(d);
1148
- return b >= 0 && C >= 0 && b !== C ? b - C : k >= 0 && h >= 0 && k !== h ? k - h : 0;
1306
+ }, x = b(p), O = b(g), T = k(p), h = k(g);
1307
+ return x >= 0 && O >= 0 && x !== O ? x - O : T >= 0 && h >= 0 && T !== h ? T - h : 0;
1149
1308
  });
1150
- l[2] = S(l[2]), l[3] = S(l[3]);
1151
- const z = l.flat().join("");
1152
- return K.size >= me && Array.from(K.keys()).slice(
1309
+ s[2] = C(s[2]), s[3] = C(s[3]);
1310
+ const A = s.flat().join("");
1311
+ return G.size >= he && Array.from(G.keys()).slice(
1153
1312
  0,
1154
- Math.floor(me / 2)
1155
- ).forEach((p) => K.delete(p)), K.set(e, { css: z, timestamp: r }), z;
1313
+ Math.floor(he / 2)
1314
+ ).forEach((p) => G.delete(p)), G.set(e, { css: A, timestamp: r }), A;
1156
1315
  }
1157
- const q = {
1316
+ const X = {
1158
1317
  /** Simple fade in/out */
1159
1318
  fade: {
1160
1319
  enterFrom: "opacity-0",
@@ -1246,181 +1405,202 @@ const q = {
1246
1405
  leaveTo: "rotate-[90deg] opacity-0"
1247
1406
  }
1248
1407
  };
1249
- function _e(e, r) {
1408
+ function Ne(e, r) {
1250
1409
  const {
1251
1410
  preset: o,
1252
- show: i,
1253
- mode: s = "default",
1254
- duration: l,
1411
+ show: n,
1412
+ mode: c = "default",
1413
+ duration: s,
1255
1414
  appear: u = !1,
1256
- css: j = !0,
1415
+ css: m = !0,
1257
1416
  name: t,
1258
1417
  enterFrom: a,
1259
- enterActive: g,
1260
- enterTo: T,
1261
- leaveFrom: A,
1262
- leaveActive: S,
1263
- leaveTo: z,
1418
+ enterActive: d,
1419
+ enterTo: $,
1420
+ leaveFrom: v,
1421
+ leaveActive: C,
1422
+ leaveTo: A,
1264
1423
  onBeforeEnter: f,
1265
1424
  onEnter: p,
1266
- onAfterEnter: d,
1267
- onEnterCancelled: m,
1268
- onBeforeLeave: w,
1269
- onLeave: b,
1270
- onAfterLeave: C,
1271
- onLeaveCancelled: k
1425
+ onAfterEnter: g,
1426
+ onEnterCancelled: b,
1427
+ onBeforeLeave: k,
1428
+ onLeave: x,
1429
+ onAfterLeave: O,
1430
+ onLeaveCancelled: T
1272
1431
  } = e;
1273
1432
  let h;
1274
- o && q[o] ? (h = { ...q[o] }, a && (h.enterFrom = a), g && (h.enterActive = g), T && (h.enterTo = T), A && (h.leaveFrom = A), S && (h.leaveActive = S), z && (h.leaveTo = z)) : h = {
1433
+ o && X[o] ? (h = { ...X[o] }, a && (h.enterFrom = a), d && (h.enterActive = d), $ && (h.enterTo = $), v && (h.leaveFrom = v), C && (h.leaveActive = C), A && (h.leaveTo = A)) : h = {
1275
1434
  enterFrom: a,
1276
- enterActive: g,
1277
- enterTo: T,
1278
- leaveFrom: A,
1279
- leaveActive: S,
1280
- leaveTo: z
1435
+ enterActive: d,
1436
+ enterTo: $,
1437
+ leaveFrom: v,
1438
+ leaveActive: C,
1439
+ leaveTo: A
1281
1440
  };
1282
- const P = t || (o ? `transition-${o}` : "transition"), W = be(i ? r : [], P);
1283
- return W._transition = {
1284
- name: P,
1441
+ const R = t || (o ? `transition-${o}` : "transition"), _ = ye(n ? r : [], R);
1442
+ return _._transition = {
1443
+ name: R,
1285
1444
  classes: h,
1286
- mode: s,
1287
- duration: l,
1445
+ mode: c,
1446
+ duration: s,
1288
1447
  appear: u,
1289
- css: j,
1290
- state: i ? "visible" : "hidden",
1448
+ css: m,
1449
+ state: n ? "visible" : "hidden",
1291
1450
  hooks: {
1292
1451
  onBeforeEnter: f,
1293
1452
  onEnter: p,
1294
- onAfterEnter: d,
1295
- onEnterCancelled: m,
1296
- onBeforeLeave: w,
1297
- onLeave: b,
1298
- onAfterLeave: C,
1299
- onLeaveCancelled: k
1453
+ onAfterEnter: g,
1454
+ onEnterCancelled: b,
1455
+ onBeforeLeave: k,
1456
+ onLeave: x,
1457
+ onAfterLeave: O,
1458
+ onLeaveCancelled: T
1300
1459
  }
1301
- }, W;
1460
+ }, _;
1302
1461
  }
1303
1462
  function Be(e, r) {
1304
1463
  const {
1305
1464
  tag: o = "div",
1306
- moveClass: i = "transition-transform duration-300",
1307
- preset: s,
1308
- show: l = !0,
1465
+ moveClass: n = "transition-transform duration-300",
1466
+ preset: c,
1467
+ show: s = !0,
1309
1468
  mode: u = "default",
1310
- duration: j,
1469
+ duration: m,
1311
1470
  appear: t = !1,
1312
1471
  css: a = !0,
1313
- name: g,
1314
- class: T,
1315
- style: A,
1316
- enterFrom: S,
1317
- enterActive: z,
1472
+ name: d,
1473
+ class: $,
1474
+ style: v,
1475
+ enterFrom: C,
1476
+ enterActive: A,
1318
1477
  enterTo: f,
1319
1478
  leaveFrom: p,
1320
- leaveActive: d,
1321
- leaveTo: m,
1322
- onBeforeEnter: w,
1323
- onEnter: b,
1324
- onAfterEnter: C,
1325
- onEnterCancelled: k,
1479
+ leaveActive: g,
1480
+ leaveTo: b,
1481
+ onBeforeEnter: k,
1482
+ onEnter: x,
1483
+ onAfterEnter: O,
1484
+ onEnterCancelled: T,
1326
1485
  onBeforeLeave: h,
1327
- onLeave: P,
1328
- onAfterLeave: W,
1329
- onLeaveCancelled: x
1486
+ onLeave: R,
1487
+ onAfterLeave: _,
1488
+ onLeaveCancelled: w
1330
1489
  } = e;
1331
- let c;
1332
- s && q[s] ? (c = { ...q[s] }, S && (c.enterFrom = S), z && (c.enterActive = z), f && (c.enterTo = f), p && (c.leaveFrom = p), d && (c.leaveActive = d), m && (c.leaveTo = m)) : c = {
1333
- enterFrom: S,
1334
- enterActive: z,
1490
+ let l;
1491
+ c && X[c] ? (l = { ...X[c] }, C && (l.enterFrom = C), A && (l.enterActive = A), f && (l.enterTo = f), p && (l.leaveFrom = p), g && (l.leaveActive = g), b && (l.leaveTo = b)) : l = {
1492
+ enterFrom: C,
1493
+ enterActive: A,
1335
1494
  enterTo: f,
1336
1495
  leaveFrom: p,
1337
- leaveActive: d,
1338
- leaveTo: m
1496
+ leaveActive: g,
1497
+ leaveTo: b
1339
1498
  };
1340
- const D = g || (s ? `transition-group-${s}` : "transition-group"), _ = [];
1341
- for (const y of l ? r : [])
1342
- if (y && typeof y == "object" && y.tag === "#anchor") {
1343
- const I = Array.isArray(y.children) ? y.children : [];
1344
- for (const R of I)
1345
- if (R && typeof R == "object") {
1346
- const X = {
1347
- ...R,
1348
- key: y.key || R.key,
1499
+ const P = d || (c ? `transition-group-${c}` : "transition-group"), W = [];
1500
+ for (const S of s ? r : [])
1501
+ if (S && typeof S == "object" && S.tag === "#anchor") {
1502
+ const D = Array.isArray(S.children) ? S.children : [];
1503
+ for (const L of D)
1504
+ if (L && typeof L == "object") {
1505
+ const Q = {
1506
+ ...L,
1507
+ key: S.key || L.key,
1349
1508
  props: {
1350
- ...R.props,
1351
- _anchorKey: y.key
1509
+ ...L.props,
1510
+ _anchorKey: S.key
1352
1511
  // Preserve original anchor key
1353
1512
  }
1354
1513
  };
1355
- _.push(X);
1514
+ W.push(Q);
1356
1515
  } else
1357
- _.push(R);
1516
+ W.push(L);
1358
1517
  } else
1359
- _.push(y);
1518
+ W.push(S);
1360
1519
  const V = (() => {
1361
- if (A)
1362
- return typeof A == "string" ? A : Object.entries(A).map(([y, I]) => `${y}: ${I}`).join("; ");
1520
+ if (v)
1521
+ return typeof v == "string" ? v : Object.entries(v).map(([S, D]) => `${S}: ${D}`).join("; ");
1363
1522
  })();
1364
1523
  return {
1365
1524
  tag: o,
1366
- children: _,
1367
- key: D,
1525
+ children: W,
1526
+ key: P,
1368
1527
  props: {
1369
1528
  attrs: {
1370
- ...T ? { class: T } : {},
1529
+ ...$ ? { class: $ } : {},
1371
1530
  ...V ? { style: V } : {}
1372
1531
  },
1373
1532
  _transitionGroup: {
1374
- name: D,
1375
- classes: c,
1376
- moveClass: i,
1533
+ name: P,
1534
+ classes: l,
1535
+ moveClass: n,
1377
1536
  mode: u,
1378
- duration: j,
1537
+ duration: m,
1379
1538
  appear: t,
1380
1539
  css: a,
1381
1540
  hooks: {
1382
- onBeforeEnter: w,
1383
- onEnter: b,
1384
- onAfterEnter: C,
1385
- onEnterCancelled: k,
1541
+ onBeforeEnter: k,
1542
+ onEnter: x,
1543
+ onAfterEnter: O,
1544
+ onEnterCancelled: T,
1386
1545
  onBeforeLeave: h,
1387
- onLeave: P,
1388
- onAfterLeave: W,
1389
- onLeaveCancelled: x
1546
+ onLeave: R,
1547
+ onAfterLeave: _,
1548
+ onLeaveCancelled: w
1390
1549
  }
1391
1550
  }
1392
1551
  }
1393
1552
  };
1394
1553
  }
1395
- function Ie(e) {
1554
+ function Ue(e) {
1396
1555
  return { ...e };
1397
1556
  }
1398
- let Z = null;
1399
- function Pe() {
1400
- if (!Z) {
1557
+ let B = null;
1558
+ function Me() {
1559
+ if (!B) {
1560
+ if (typeof CSSStyleSheet > "u")
1561
+ return B = {
1562
+ cssRules: [],
1563
+ replaceSync: () => {
1564
+ },
1565
+ toString: () => ""
1566
+ }, B;
1401
1567
  const e = [];
1402
- Object.values(q).forEach((i) => {
1403
- i.enterFrom && e.push(i.enterFrom), i.enterActive && e.push(i.enterActive), i.enterTo && e.push(i.enterTo), i.leaveFrom && e.push(i.leaveFrom), i.leaveActive && e.push(i.leaveActive), i.leaveTo && e.push(i.leaveTo);
1568
+ Object.values(X).forEach((n) => {
1569
+ n.enterFrom && e.push(n.enterFrom), n.enterActive && e.push(n.enterActive), n.enterTo && e.push(n.enterTo), n.leaveFrom && e.push(n.leaveFrom), n.leaveActive && e.push(n.leaveActive), n.leaveTo && e.push(n.leaveTo);
1404
1570
  });
1405
- const r = `<div class="${e.join(" ")}"></div>`, o = ze(r);
1406
- Z = new CSSStyleSheet(), Z.replaceSync(o);
1571
+ const r = `<div class="${e.join(" ")}"></div>`, o = Le(r);
1572
+ try {
1573
+ B = new CSSStyleSheet(), B.replaceSync(o);
1574
+ } catch {
1575
+ B = {
1576
+ cssRules: [],
1577
+ replaceSync: () => {
1578
+ },
1579
+ toString: () => o || ""
1580
+ };
1581
+ }
1407
1582
  }
1408
- return Z;
1583
+ return B;
1409
1584
  }
1410
- function Re() {
1411
- Pe();
1585
+ function Pe() {
1586
+ if (!(typeof window > "u" || typeof CSSStyleSheet > "u"))
1587
+ try {
1588
+ Me();
1589
+ } catch {
1590
+ }
1412
1591
  }
1413
- Re();
1592
+ Pe();
1414
1593
  export {
1415
- _e as T,
1416
- Pe as a,
1417
- Be as b,
1418
- xe as c,
1419
- Ie as d,
1420
- We as g,
1421
- ze as j,
1422
- ve as m,
1594
+ Ne as T,
1595
+ Me as a,
1596
+ pe as b,
1597
+ ke as c,
1598
+ Be as d,
1599
+ Ue as e,
1600
+ Ie as g,
1601
+ Le as j,
1602
+ ge as m,
1423
1603
  De as s,
1424
- q as t
1604
+ X as t
1425
1605
  };
1426
- //# sourceMappingURL=transitions-CbxTVf1F.js.map
1606
+ //# sourceMappingURL=transitions-m6FraTTL.js.map