@takazudo/zdtp 0.2.1 → 0.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.
- package/CHANGELOG.md +6 -0
- package/dist/element-path/build-element-path.d.ts.map +1 -1
- package/dist/element-path/element-path-orchestrator.d.ts.map +1 -1
- package/dist/element-path/element-path-toast.d.ts +6 -3
- package/dist/element-path/element-path-toast.d.ts.map +1 -1
- package/dist/element-path/inspector-overlay.d.ts.map +1 -1
- package/dist/highlight/find-elements.d.ts +9 -0
- package/dist/highlight/find-elements.d.ts.map +1 -1
- package/dist/highlight/highlight-orchestrator.d.ts.map +1 -1
- package/dist/index.js +558 -556
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as k, jsx as l, Fragment as re } from "preact/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useState as j, useRef as O, useMemo as Z, useEffect as X, useId as
|
|
4
|
-
import { b as
|
|
2
|
+
import { createContext as Ht, render as _n } from "preact";
|
|
3
|
+
import { useState as j, useRef as O, useMemo as Z, useEffect as X, useId as ct, useCallback as z, useLayoutEffect as _o, useContext as $o, createPortal as Bt, memo as je } from "preact/compat";
|
|
4
|
+
import { b as dt, i as $n, s as Co, r as Ke, e as Eo, c as So, d as nt, f as Cn, D as Zt, h as To, j as Mo, k as Ve, m as Ao, n as Lo, o as Po, p as Io, l as En, q as Qt, t as bt, u as Sn, v as Ro, w as Qe, x as vt, y as en, z as wt, A as tn, B as xt, C as zo, a as Oo } from "./tweak-state-DSJa5csL.js";
|
|
5
5
|
import { Z as zl } from "./tweak-state-DSJa5csL.js";
|
|
6
|
-
import { g as Q, j as ge, n as
|
|
6
|
+
import { g as Q, j as ge, n as Do, o as P, p as Vo, r as Ho, q as Bo, t as nn, a as Tn, u as Fo, v as jo } from "./panel-config-DP2_P7dD.js";
|
|
7
7
|
import { c as Dl, s as Vl } from "./panel-config-DP2_P7dD.js";
|
|
8
|
-
import { c as
|
|
9
|
-
import { r as
|
|
10
|
-
import { useContext as
|
|
8
|
+
import { c as Ko } from "./color-schemes-CgzOBqGO.js";
|
|
9
|
+
import { r as Wo } from "./route-tokens-to-files-1DvmWBdj.js";
|
|
10
|
+
import { useContext as Ft, useCallback as G, useRef as le, useEffect as se, useState as we, useMemo as ot } from "preact/hooks";
|
|
11
11
|
function xe(e) {
|
|
12
12
|
const t = Q().tabs.find((o) => o.id === e);
|
|
13
13
|
if (!t) return [];
|
|
@@ -17,11 +17,11 @@ function xe(e) {
|
|
|
17
17
|
n.push(r);
|
|
18
18
|
return n;
|
|
19
19
|
}
|
|
20
|
-
const et = "zudo-design-tokens/v2",
|
|
20
|
+
const et = "zudo-design-tokens/v2", yt = "zudo-design-tokens/v1";
|
|
21
21
|
function Mn() {
|
|
22
22
|
return {};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Xo() {
|
|
25
25
|
return Q().schemaId;
|
|
26
26
|
}
|
|
27
27
|
class Me extends Error {
|
|
@@ -35,17 +35,17 @@ function An(e, t = {}) {
|
|
|
35
35
|
const n = t.now ? t.now() : /* @__PURE__ */ new Date(), o = {
|
|
36
36
|
$schema: et,
|
|
37
37
|
exportedAt: n.toISOString()
|
|
38
|
-
}, r = {}, a =
|
|
38
|
+
}, r = {}, a = Yo(e.color, t);
|
|
39
39
|
a && (r.color = a);
|
|
40
|
-
const i =
|
|
40
|
+
const i = Nt(xe("spacing"), e.spacing, t);
|
|
41
41
|
i && (r.spacing = i);
|
|
42
|
-
const s =
|
|
42
|
+
const s = Nt(xe("font"), e.typography, t);
|
|
43
43
|
s && (r.font = s);
|
|
44
|
-
const d =
|
|
44
|
+
const d = Nt(xe("size"), e.size, t);
|
|
45
45
|
return d && (r.size = d), Object.keys(r).length > 0 && (o.tabs = r), o;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const n = t.colorDefaults, o = t.includeDefaults === !0, r =
|
|
47
|
+
function Yo(e, t) {
|
|
48
|
+
const n = t.colorDefaults, o = t.includeDefaults === !0, r = dt(), a = {};
|
|
49
49
|
let i = !1;
|
|
50
50
|
const s = {};
|
|
51
51
|
let d = !1;
|
|
@@ -64,7 +64,7 @@ function Wo(e, t) {
|
|
|
64
64
|
}
|
|
65
65
|
return u && (a.semantic = c, i = !0), i ? a : void 0;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Nt(e, t, n) {
|
|
68
68
|
const o = n.includeDefaults === !0, r = {};
|
|
69
69
|
let a = !1;
|
|
70
70
|
if (o)
|
|
@@ -81,34 +81,34 @@ function yt(e, t, n) {
|
|
|
81
81
|
}
|
|
82
82
|
return a ? { raw: r } : void 0;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function qo(e, t = {}) {
|
|
85
85
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
86
86
|
throw new Me("not-object", "Input is not a JSON object.");
|
|
87
87
|
const n = e, o = n.$schema;
|
|
88
88
|
if (o === void 0)
|
|
89
89
|
throw new Me(
|
|
90
90
|
"schema-missing",
|
|
91
|
-
`Missing "$schema" key. Expected "${et}" or "${
|
|
91
|
+
`Missing "$schema" key. Expected "${et}" or "${yt}".`
|
|
92
92
|
);
|
|
93
93
|
if (o === et)
|
|
94
|
-
return Yo(n, t);
|
|
95
|
-
if (o === xt)
|
|
96
94
|
return Go(n, t);
|
|
95
|
+
if (o === yt)
|
|
96
|
+
return Jo(n, t);
|
|
97
97
|
throw new Me(
|
|
98
98
|
"schema-mismatch",
|
|
99
|
-
`Unsupported "$schema" value: ${JSON.stringify(o)}. Expected "${et}" or "${
|
|
99
|
+
`Unsupported "$schema" value: ${JSON.stringify(o)}. Expected "${et}" or "${yt}".`,
|
|
100
100
|
o
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const n = [], o = [], r = t.colorDefaults ?? Ln(), a =
|
|
103
|
+
function Go(e, t) {
|
|
104
|
+
const n = [], o = [], r = t.colorDefaults ?? Ln(), a = dt(), i = e.tabs && typeof e.tabs == "object" && !Array.isArray(e.tabs) ? e.tabs : {}, s = i.color, d = Uo(s, r, a, n), c = i.spacing, u = c && typeof c == "object" ? c.raw : void 0, p = _t(u, xe("spacing"), "spacing", o, n), h = i.font, m = h && typeof h == "object" ? h.raw : void 0, $ = _t(m, xe("font"), "font.raw", o, n), b = i.size, x = b && typeof b == "object" ? b.raw : void 0, f = _t(x, xe("size"), "size", o, n);
|
|
105
105
|
return {
|
|
106
106
|
state: { color: d, spacing: p, typography: $, size: f },
|
|
107
107
|
unknownTokens: o,
|
|
108
108
|
warnings: n
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Uo(e, t, n, o) {
|
|
112
112
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
113
113
|
return { ...t, palette: [...t.palette], semanticMappings: { ...t.semanticMappings } };
|
|
114
114
|
const r = e;
|
|
@@ -146,7 +146,7 @@ function qo(e, t, n, o) {
|
|
|
146
146
|
shikiTheme: t.shikiTheme
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function _t(e, t, n, o, r) {
|
|
150
150
|
if (!e || typeof e != "object") return Mn();
|
|
151
151
|
const a = /* @__PURE__ */ new Map();
|
|
152
152
|
for (const s of t)
|
|
@@ -166,15 +166,15 @@ function Nt(e, t, n, o, r) {
|
|
|
166
166
|
}
|
|
167
167
|
return i;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
const n = [], o = [], r = t.colorDefaults ?? Ln(), a =
|
|
169
|
+
function Jo(e, t) {
|
|
170
|
+
const n = [], o = [], r = t.colorDefaults ?? Ln(), a = Zo(e.color, r, n), i = $t(e.spacing, xe("spacing"), "spacing", o, n), s = $t(e.typography, xe("font"), "typography", o, n), d = $t(e.size, xe("size"), "size", o, n);
|
|
171
171
|
return {
|
|
172
172
|
state: { color: a, spacing: i, typography: s, size: d },
|
|
173
173
|
unknownTokens: o,
|
|
174
174
|
warnings: n
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Zo(e, t, n) {
|
|
178
178
|
if (!e || typeof e != "object")
|
|
179
179
|
return {
|
|
180
180
|
...t,
|
|
@@ -214,7 +214,7 @@ function Uo(e, t, n) {
|
|
|
214
214
|
shikiTheme: h
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function $t(e, t, n, o, r) {
|
|
218
218
|
if (!e || typeof e != "object") return Mn();
|
|
219
219
|
const a = /* @__PURE__ */ new Map();
|
|
220
220
|
for (const s of t)
|
|
@@ -238,7 +238,7 @@ function Re(e, t) {
|
|
|
238
238
|
return typeof e == "number" && Number.isFinite(e) ? e : t;
|
|
239
239
|
}
|
|
240
240
|
function Ln() {
|
|
241
|
-
const e =
|
|
241
|
+
const e = dt(), t = e && e.paletteSize > 0 ? e.paletteSize : 16, n = t - 1, o = Array.from({ length: t }, (a, i) => i === 0 ? "#000000" : i === n ? "#ffffff" : "#808080"), r = (a) => Math.min(Math.max(a, 0), n);
|
|
242
242
|
return {
|
|
243
243
|
palette: o,
|
|
244
244
|
background: r(0),
|
|
@@ -250,14 +250,14 @@ function Ln() {
|
|
|
250
250
|
shikiTheme: "dracula"
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Qo(e, t) {
|
|
254
254
|
if (t) return t;
|
|
255
|
-
const n = Object.values(
|
|
255
|
+
const n = Object.values(Ko)[0];
|
|
256
256
|
return n ? $n(n) : e;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const [o, r] = j("Copy"), [a, i] = j(!1), s = O(null), d = O(null), c = O(null), u = Q(), p =
|
|
260
|
-
const f =
|
|
258
|
+
function er({ onClose: e, state: t, colorDefaults: n }) {
|
|
259
|
+
const [o, r] = j("Copy"), [a, i] = j(!1), s = O(null), d = O(null), c = O(null), u = Q(), p = Do(u), h = Z(() => {
|
|
260
|
+
const f = Qo(t.color, n), w = An(t, {
|
|
261
261
|
includeDefaults: a,
|
|
262
262
|
colorDefaults: f
|
|
263
263
|
});
|
|
@@ -304,7 +304,7 @@ function Zo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
304
304
|
}
|
|
305
305
|
r(f ? "Copied!" : "Failed"), c.current && clearTimeout(c.current), c.current = setTimeout(() => r("Copy"), 2e3);
|
|
306
306
|
}
|
|
307
|
-
const b =
|
|
307
|
+
const b = ct(), x = `${u.modalClassPrefix}-export-title-${b}`;
|
|
308
308
|
return /* @__PURE__ */ k(
|
|
309
309
|
"dialog",
|
|
310
310
|
{
|
|
@@ -366,8 +366,8 @@ function Zo({ onClose: e, state: t, colorDefaults: n }) {
|
|
|
366
366
|
}
|
|
367
367
|
);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
const [o, r] = j(""), [a, i] = j(null), s = O(null), d = O(null), c = Q(), u =
|
|
369
|
+
function tr({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
370
|
+
const [o, r] = j(""), [a, i] = j(null), s = O(null), d = O(null), c = Q(), u = Xo();
|
|
371
371
|
X(() => {
|
|
372
372
|
const b = s.current;
|
|
373
373
|
if (b)
|
|
@@ -406,7 +406,7 @@ function Qo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
try {
|
|
409
|
-
const { state: f, unknownTokens: w, warnings: C } =
|
|
409
|
+
const { state: f, unknownTokens: w, warnings: C } = qo(x, {
|
|
410
410
|
colorDefaults: n
|
|
411
411
|
});
|
|
412
412
|
if (w.length > 0) {
|
|
@@ -418,7 +418,7 @@ function Qo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
418
418
|
console.groupEnd();
|
|
419
419
|
}
|
|
420
420
|
C.length > 0 && console.warn("[design-token-serde] warnings:", C), t(f);
|
|
421
|
-
const E = Object.keys(f.spacing).length + Object.keys(f.typography).length + Object.keys(f.size).length, N =
|
|
421
|
+
const E = Object.keys(f.spacing).length + Object.keys(f.typography).length + Object.keys(f.size).length, N = Vo(f.color, n);
|
|
422
422
|
E === 0 && N && w.length > 0 ? i({
|
|
423
423
|
kind: "error",
|
|
424
424
|
text: `Nothing applied — all ${w.length} token${w.length === 1 ? "" : "s"} in the payload were unknown. See console for the list.`
|
|
@@ -441,7 +441,7 @@ function Qo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
441
441
|
i({ kind: "error", text: `Load failed: ${w}` });
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
const m =
|
|
444
|
+
const m = ct(), $ = `${c.modalClassPrefix}-import-title-${m}`;
|
|
445
445
|
return /* @__PURE__ */ k(
|
|
446
446
|
"dialog",
|
|
447
447
|
{
|
|
@@ -509,7 +509,7 @@ function Qo({ onClose: e, onLoad: t, colorDefaults: n }) {
|
|
|
509
509
|
}
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function on(e, t, n = dt(), o = Q().tabs) {
|
|
513
513
|
const r = {}, a = e.color, i = a.palette.length;
|
|
514
514
|
for (let d = 0; d < i; d++) {
|
|
515
515
|
const c = a.palette[d];
|
|
@@ -522,9 +522,9 @@ function nn(e, t, n = ct(), o = Q().tabs) {
|
|
|
522
522
|
if (u === void 0) continue;
|
|
523
523
|
const p = t?.semanticMappings[d];
|
|
524
524
|
if (!(t === void 0 || u !== p)) continue;
|
|
525
|
-
const m =
|
|
525
|
+
const m = or(u, a);
|
|
526
526
|
if (m === null) continue;
|
|
527
|
-
const $ =
|
|
527
|
+
const $ = Co(m, a.palette.length);
|
|
528
528
|
$ !== m && console.error(
|
|
529
529
|
`[design-token-panel] paletteIndex ${m} for ${c} is out of range (palette length ${a.palette.length}); clamping to ${$}.`
|
|
530
530
|
), r[c] = `var(${ge(n, $)})`;
|
|
@@ -537,11 +537,11 @@ function nn(e, t, n = ct(), o = Q().tabs) {
|
|
|
537
537
|
for (const { tabId: d, overrides: c } of s) {
|
|
538
538
|
if (Object.keys(c).length === 0) continue;
|
|
539
539
|
const u = o.find((p) => p.id === d);
|
|
540
|
-
u &&
|
|
540
|
+
u && nr(u, c, r);
|
|
541
541
|
}
|
|
542
542
|
return r;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function nr(e, t, n) {
|
|
545
545
|
const o = {};
|
|
546
546
|
for (const r of e.tiers) {
|
|
547
547
|
const a = {};
|
|
@@ -558,19 +558,19 @@ function er(e, t, n) {
|
|
|
558
558
|
if (!(typeof i != "string" || i.length === 0))
|
|
559
559
|
try {
|
|
560
560
|
const s = Ke(e, r.id, a.id, o);
|
|
561
|
-
n[a.cssVar] =
|
|
561
|
+
n[a.cssVar] = Eo(s);
|
|
562
562
|
} catch {
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function or(e, t) {
|
|
567
567
|
return e === "bg" ? t.background : e === "fg" ? t.foreground : typeof e == "number" && Number.isInteger(e) ? e : null;
|
|
568
568
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
569
|
+
const rr = 2e3, Ct = { kind: "preview" };
|
|
570
|
+
function ar(e, t) {
|
|
571
571
|
return JSON.stringify(An(e, { colorDefaults: t }), null, 2);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function ir(e) {
|
|
574
574
|
if (Array.isArray(e.updated)) return e.updated;
|
|
575
575
|
const t = e.results;
|
|
576
576
|
if (Array.isArray(t)) return t;
|
|
@@ -583,7 +583,7 @@ function rr(e) {
|
|
|
583
583
|
}
|
|
584
584
|
return n;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function lr(e) {
|
|
587
587
|
return {
|
|
588
588
|
dialog: `${P(e, "")} ${P(e, "--apply")}`,
|
|
589
589
|
header: P(e, "__header"),
|
|
@@ -605,8 +605,8 @@ function ar(e) {
|
|
|
605
605
|
jsonBlock: P(e, "__json")
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a } = e, i = O(null), s = O(null), d = Q(), c = Z(() =>
|
|
608
|
+
function sr(e) {
|
|
609
|
+
const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a } = e, i = O(null), s = O(null), d = Q(), c = Z(() => lr(d), [d]), u = ct(), p = `${d.modalClassPrefix}-apply-title-${u}`, [h, m] = j(Ct), [$, b] = j("Copy pre-apply state to clipboard");
|
|
610
610
|
X(() => {
|
|
611
611
|
const A = i.current;
|
|
612
612
|
if (!A) return;
|
|
@@ -615,23 +615,23 @@ function ir(e) {
|
|
|
615
615
|
s.current?.focus();
|
|
616
616
|
})) : !n && D && (typeof A.close == "function" ? A.close() : A.removeAttribute("open"));
|
|
617
617
|
}, [n]), X(() => {
|
|
618
|
-
n && (m(
|
|
618
|
+
n && (m(Ct), b("Copy pre-apply state to clipboard"));
|
|
619
619
|
}, [n]), X(() => {
|
|
620
620
|
if ($ !== "Copied!") return;
|
|
621
621
|
const A = window.setTimeout(
|
|
622
622
|
() => b("Copy pre-apply state to clipboard"),
|
|
623
|
-
|
|
623
|
+
rr
|
|
624
624
|
);
|
|
625
625
|
return () => window.clearTimeout(A);
|
|
626
626
|
}, [$]);
|
|
627
627
|
const x = Z(() => {
|
|
628
|
-
const A =
|
|
628
|
+
const A = on(t, r), D = Ho(d), te = D && t.secondary ? on({ ...t, color: t.secondary }, void 0, D) : {};
|
|
629
629
|
return { ...A, ...te };
|
|
630
|
-
}, [t, r, d]), f = Z(() =>
|
|
631
|
-
() =>
|
|
630
|
+
}, [t, r, d]), f = Z(() => Bo(d), [d]), { groups: w, rejected: C, rejectedReasons: E } = Z(
|
|
631
|
+
() => Wo(x, f),
|
|
632
632
|
[x, f]
|
|
633
633
|
), N = Z(() => Object.keys(x).length, [x]), v = N === 0, g = w.length > 0, _ = d.applyEndpoint, S = !!_ && Object.keys(f).length > 0;
|
|
634
|
-
async function
|
|
634
|
+
async function B() {
|
|
635
635
|
if (!_) {
|
|
636
636
|
m({
|
|
637
637
|
kind: "error",
|
|
@@ -639,7 +639,7 @@ function ir(e) {
|
|
|
639
639
|
});
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
|
-
const A =
|
|
642
|
+
const A = ar(t, r);
|
|
643
643
|
m({ kind: "applying" });
|
|
644
644
|
try {
|
|
645
645
|
const D = await fetch(_, {
|
|
@@ -688,7 +688,7 @@ function ir(e) {
|
|
|
688
688
|
a(), oe();
|
|
689
689
|
}
|
|
690
690
|
function ee() {
|
|
691
|
-
m(
|
|
691
|
+
m(Ct);
|
|
692
692
|
}
|
|
693
693
|
function pe() {
|
|
694
694
|
o();
|
|
@@ -744,7 +744,7 @@ function ir(e) {
|
|
|
744
744
|
] }),
|
|
745
745
|
/* @__PURE__ */ k("div", { children: [
|
|
746
746
|
h.kind === "preview" && /* @__PURE__ */ l(
|
|
747
|
-
|
|
747
|
+
cr,
|
|
748
748
|
{
|
|
749
749
|
cls: c,
|
|
750
750
|
groups: w,
|
|
@@ -755,19 +755,19 @@ function ir(e) {
|
|
|
755
755
|
applyConfigured: S
|
|
756
756
|
}
|
|
757
757
|
),
|
|
758
|
-
h.kind === "applying" && /* @__PURE__ */ l(
|
|
758
|
+
h.kind === "applying" && /* @__PURE__ */ l(dr, { cls: c }),
|
|
759
759
|
h.kind === "success" && /* @__PURE__ */ l(
|
|
760
|
-
|
|
760
|
+
ur,
|
|
761
761
|
{
|
|
762
762
|
cls: c,
|
|
763
|
-
results:
|
|
763
|
+
results: ir(h.response),
|
|
764
764
|
unknownCssVars: Array.isArray(h.response.unknownCssVars) ? h.response.unknownCssVars : [],
|
|
765
765
|
previewJson: h.previewJson,
|
|
766
766
|
copyLabel: $,
|
|
767
767
|
onCopy: () => K(h.previewJson)
|
|
768
768
|
}
|
|
769
769
|
),
|
|
770
|
-
h.kind === "error" && /* @__PURE__ */ l(
|
|
770
|
+
h.kind === "error" && /* @__PURE__ */ l(pr, { cls: c, message: h.message })
|
|
771
771
|
] }),
|
|
772
772
|
/* @__PURE__ */ k("div", { className: c.actions, children: [
|
|
773
773
|
h.kind === "preview" && /* @__PURE__ */ k(re, { children: [
|
|
@@ -783,10 +783,10 @@ function ir(e) {
|
|
|
783
783
|
"aria-disabled": A || void 0,
|
|
784
784
|
title: S ? void 0 : "Host has not configured an apply endpoint or routing map. The Apply modal can preview the diff but cannot rewrite source files.",
|
|
785
785
|
onClick: () => {
|
|
786
|
-
A ||
|
|
786
|
+
A || B();
|
|
787
787
|
},
|
|
788
788
|
onKeyDown: (D) => {
|
|
789
|
-
(D.key === "Enter" || D.key === " ") && (D.preventDefault(), A ||
|
|
789
|
+
(D.key === "Enter" || D.key === " ") && (D.preventDefault(), A || B());
|
|
790
790
|
},
|
|
791
791
|
children: Se
|
|
792
792
|
}
|
|
@@ -853,7 +853,7 @@ function ir(e) {
|
|
|
853
853
|
}
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function cr({
|
|
857
857
|
cls: e,
|
|
858
858
|
groups: t,
|
|
859
859
|
rejected: n,
|
|
@@ -882,7 +882,7 @@ function lr({
|
|
|
882
882
|
] }),
|
|
883
883
|
t.map((d) => /* @__PURE__ */ k("div", { children: [
|
|
884
884
|
/* @__PURE__ */ k("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: [
|
|
885
|
-
|
|
885
|
+
fr(d.relativePath),
|
|
886
886
|
" (",
|
|
887
887
|
Object.keys(d.tokens).length,
|
|
888
888
|
")"
|
|
@@ -911,13 +911,13 @@ function lr({
|
|
|
911
911
|
] })
|
|
912
912
|
] });
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function dr({ cls: e }) {
|
|
915
915
|
return /* @__PURE__ */ k("div", { className: e.applying, role: "status", "aria-live": "polite", children: [
|
|
916
916
|
/* @__PURE__ */ l("span", { className: e.spinner, "aria-hidden": "true" }),
|
|
917
917
|
/* @__PURE__ */ l("span", { children: "Applying changes…" })
|
|
918
918
|
] });
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function ur({
|
|
921
921
|
cls: e,
|
|
922
922
|
results: t,
|
|
923
923
|
unknownCssVars: n,
|
|
@@ -929,9 +929,9 @@ function cr({
|
|
|
929
929
|
/* @__PURE__ */ l("div", { className: e.statusSuccess, role: "status", children: "Applied successfully." }),
|
|
930
930
|
t.length === 0 ? /* @__PURE__ */ l("div", { className: e.hint, children: "The server returned no per-file details." }) : t.map((i) => /* @__PURE__ */ k("div", { children: [
|
|
931
931
|
/* @__PURE__ */ l("div", { role: "heading", "aria-level": 3, className: e.sectionHeading, children: i.file ?? "(unknown file)" }),
|
|
932
|
-
/* @__PURE__ */ l(
|
|
933
|
-
/* @__PURE__ */ l(
|
|
934
|
-
/* @__PURE__ */ l(
|
|
932
|
+
/* @__PURE__ */ l(Et, { cls: e, label: "changed", values: i.changed }),
|
|
933
|
+
/* @__PURE__ */ l(Et, { cls: e, label: "unknown", values: i.unknown }),
|
|
934
|
+
/* @__PURE__ */ l(Et, { cls: e, label: "unchanged", values: i.unchanged })
|
|
935
935
|
] }, i.file ?? "unknown-file")),
|
|
936
936
|
n.length > 0 && /* @__PURE__ */ k("div", { className: e.statusWarning, children: [
|
|
937
937
|
n.length,
|
|
@@ -957,7 +957,7 @@ function cr({
|
|
|
957
957
|
/* @__PURE__ */ l("div", { role: "none", className: e.jsonBlock, children: o })
|
|
958
958
|
] });
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function Et({ cls: e, label: t, values: n }) {
|
|
961
961
|
return !n || n.length === 0 ? null : /* @__PURE__ */ k("div", { children: [
|
|
962
962
|
/* @__PURE__ */ k("div", { className: e.hint, children: [
|
|
963
963
|
t,
|
|
@@ -968,13 +968,13 @@ function Ct({ cls: e, label: t, values: n }) {
|
|
|
968
968
|
/* @__PURE__ */ l("div", { className: e.list, children: n.map((o) => /* @__PURE__ */ l("div", { className: e.listItem, children: /* @__PURE__ */ l("span", { className: "tokenpanel-code", children: o }) }, o)) })
|
|
969
969
|
] });
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function pr({ cls: e, message: t }) {
|
|
972
972
|
return /* @__PURE__ */ k("div", { children: [
|
|
973
973
|
/* @__PURE__ */ l("div", { className: e.statusError, role: "alert", children: t }),
|
|
974
974
|
/* @__PURE__ */ l("div", { className: e.hint, children: "Your edits are still intact — click Retry to send the same diff again, or Close to keep editing." })
|
|
975
975
|
] });
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function fr(e) {
|
|
978
978
|
if (!e) return "(unknown file)";
|
|
979
979
|
const t = e.lastIndexOf("/");
|
|
980
980
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
@@ -1013,21 +1013,21 @@ function $e({
|
|
|
1013
1013
|
}
|
|
1014
1014
|
);
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1017
|
-
function
|
|
1016
|
+
const hr = { h: 0, s: 0, l: 0, a: 100 };
|
|
1017
|
+
function gr(e) {
|
|
1018
1018
|
const t = e.toLowerCase();
|
|
1019
1019
|
return /^#[0-9a-f]{6}$/.test(t) || /^#[0-9a-f]{8}$/.test(t) ? t : /^#[0-9a-f]{3}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}` : /^#[0-9a-f]{4}$/.test(t) ? `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}${t[4]}${t[4]}` : "";
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const t =
|
|
1023
|
-
if (!t) return { ...
|
|
1021
|
+
function kr(e) {
|
|
1022
|
+
const t = gr(e);
|
|
1023
|
+
if (!t) return { ...hr };
|
|
1024
1024
|
const n = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, r = parseInt(t.slice(5, 7), 16) / 255, a = t.length === 9 ? Math.round(parseInt(t.slice(7, 9), 16) / 255 * 100) : 100, i = Math.max(n, o, r), s = Math.min(n, o, r), d = (i + s) / 2;
|
|
1025
1025
|
if (i === s) return { h: 0, s: 0, l: Math.round(d * 100), a };
|
|
1026
1026
|
const c = i - s, u = d > 0.5 ? c / (2 - i - s) : c / (i + s);
|
|
1027
1027
|
let p = 0;
|
|
1028
1028
|
return i === n ? p = ((o - r) / c + (o < r ? 6 : 0)) / 6 : i === o ? p = ((r - n) / c + 2) / 6 : p = ((n - o) / c + 4) / 6, { h: Math.round(p * 360), s: Math.round(u * 100), l: Math.round(d * 100), a };
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function mr(e, t, n, o) {
|
|
1031
1031
|
t = Math.max(0, Math.min(100, t)), n = Math.max(0, Math.min(100, n)), o = Math.max(0, Math.min(100, o)), e = (e % 360 + 360) % 360;
|
|
1032
1032
|
const r = t / 100, a = n / 100, i = (1 - Math.abs(2 * a - 1)) * r, s = i * (1 - Math.abs(e / 60 % 2 - 1)), d = a - i / 2;
|
|
1033
1033
|
let c = 0, u = 0, p = 0;
|
|
@@ -1070,7 +1070,7 @@ const Pn = (e, t) => {
|
|
|
1070
1070
|
alpha: (e & 255) / 255
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
|
-
},
|
|
1073
|
+
}, br = {
|
|
1074
1074
|
aliceblue: 15792383,
|
|
1075
1075
|
antiquewhite: 16444375,
|
|
1076
1076
|
aqua: 65535,
|
|
@@ -1221,23 +1221,23 @@ const Pn = (e, t) => {
|
|
|
1221
1221
|
whitesmoke: 16119285,
|
|
1222
1222
|
yellow: 16776960,
|
|
1223
1223
|
yellowgreen: 10145074
|
|
1224
|
-
},
|
|
1224
|
+
}, vr = (e) => Pn(br[e.toLowerCase()], 6), wr = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, xr = (e) => {
|
|
1225
1225
|
let t;
|
|
1226
|
-
return (t = e.match(
|
|
1227
|
-
}, Ce = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",
|
|
1228
|
-
`^rgba?\\(\\s*${Ce}${Pe}${Ce}${Pe}${Ce}\\s*(?:,\\s*${
|
|
1229
|
-
),
|
|
1230
|
-
`^rgba?\\(\\s*${
|
|
1231
|
-
),
|
|
1226
|
+
return (t = e.match(wr)) ? Pn(parseInt(t[1], 16), t[1].length) : void 0;
|
|
1227
|
+
}, Ce = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", He = `${Ce}%`, jt = `(?:${Ce}%|${Ce})`, yr = `(?:${Ce}(deg|grad|rad|turn)|${Ce})`, Pe = "\\s*,\\s*", Nr = new RegExp(
|
|
1228
|
+
`^rgba?\\(\\s*${Ce}${Pe}${Ce}${Pe}${Ce}\\s*(?:,\\s*${jt}\\s*)?\\)$`
|
|
1229
|
+
), _r = new RegExp(
|
|
1230
|
+
`^rgba?\\(\\s*${He}${Pe}${He}${Pe}${He}\\s*(?:,\\s*${jt}\\s*)?\\)$`
|
|
1231
|
+
), $r = (e) => {
|
|
1232
1232
|
let t = { mode: "rgb" }, n;
|
|
1233
|
-
if (n = e.match(
|
|
1233
|
+
if (n = e.match(Nr))
|
|
1234
1234
|
n[1] !== void 0 && (t.r = n[1] / 255), n[2] !== void 0 && (t.g = n[2] / 255), n[3] !== void 0 && (t.b = n[3] / 255);
|
|
1235
|
-
else if (n = e.match(
|
|
1235
|
+
else if (n = e.match(_r))
|
|
1236
1236
|
n[1] !== void 0 && (t.r = n[1] / 100), n[2] !== void 0 && (t.g = n[2] / 100), n[3] !== void 0 && (t.b = n[3] / 100);
|
|
1237
1237
|
else
|
|
1238
1238
|
return;
|
|
1239
1239
|
return n[4] !== void 0 ? t.alpha = Math.max(0, Math.min(1, n[4] / 100)) : n[5] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +n[5]))), t;
|
|
1240
|
-
},
|
|
1240
|
+
}, rt = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? On(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, me = (e = "rgb") => (t) => (t = rt(t, e)) !== void 0 ? (
|
|
1241
1241
|
// if the color's mode corresponds to our target mode
|
|
1242
1242
|
t.mode === e ? (
|
|
1243
1243
|
// then just return the color
|
|
@@ -1260,7 +1260,7 @@ const Pn = (e, t) => {
|
|
|
1260
1260
|
)
|
|
1261
1261
|
)
|
|
1262
1262
|
)
|
|
1263
|
-
) : void 0, ke = {}, In = {},
|
|
1263
|
+
) : void 0, ke = {}, In = {}, at = [], Rn = {}, Cr = (e) => e, Kt = (e) => (ke[e.mode] = {
|
|
1264
1264
|
...ke[e.mode],
|
|
1265
1265
|
...e.toMode
|
|
1266
1266
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
@@ -1270,16 +1270,16 @@ const Pn = (e, t) => {
|
|
|
1270
1270
|
throw new Error(`Missing interpolator for: ${t}`);
|
|
1271
1271
|
typeof e.interpolate[t] == "function" && (e.interpolate[t] = {
|
|
1272
1272
|
use: e.interpolate[t]
|
|
1273
|
-
}), e.interpolate[t].fixup || (e.interpolate[t].fixup =
|
|
1273
|
+
}), e.interpolate[t].fixup || (e.interpolate[t].fixup = Cr);
|
|
1274
1274
|
}), In[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
1275
|
-
|
|
1276
|
-
}), me(e.mode)),
|
|
1275
|
+
Er(t, e.mode);
|
|
1276
|
+
}), me(e.mode)), ut = (e) => In[e], Er = (e, t) => {
|
|
1277
1277
|
if (typeof e == "string") {
|
|
1278
1278
|
if (!t)
|
|
1279
1279
|
throw new Error("'mode' required when 'parser' is a string");
|
|
1280
1280
|
Rn[e] = t;
|
|
1281
|
-
} else typeof e == "function" &&
|
|
1282
|
-
}, It = /[^\x00-\x7F]|[a-zA-Z_]/,
|
|
1281
|
+
} else typeof e == "function" && at.indexOf(e) < 0 && at.push(e);
|
|
1282
|
+
}, It = /[^\x00-\x7F]|[a-zA-Z_]/, Sr = /[^\x00-\x7F]|[-\w]/, M = {
|
|
1283
1283
|
Function: "function",
|
|
1284
1284
|
Ident: "ident",
|
|
1285
1285
|
Number: "number",
|
|
@@ -1308,7 +1308,7 @@ function Rt(e) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
return !1;
|
|
1310
1310
|
}
|
|
1311
|
-
const
|
|
1311
|
+
const Tr = {
|
|
1312
1312
|
deg: 1,
|
|
1313
1313
|
rad: 180 / Math.PI,
|
|
1314
1314
|
grad: 9 / 10,
|
|
@@ -1317,8 +1317,8 @@ const Er = {
|
|
|
1317
1317
|
function ze(e) {
|
|
1318
1318
|
let t = "";
|
|
1319
1319
|
if ((e[L] === "-" || e[L] === "+") && (t += e[L++]), t += Ye(e), e[L] === "." && /\d/.test(e[L + 1]) && (t += e[L++] + Ye(e)), (e[L] === "e" || e[L] === "E") && ((e[L + 1] === "-" || e[L + 1] === "+") && /\d/.test(e[L + 2]) ? t += e[L++] + e[L++] + Ye(e) : /\d/.test(e[L + 1]) && (t += e[L++] + Ye(e))), Rt(e)) {
|
|
1320
|
-
let n =
|
|
1321
|
-
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: M.Hue, value: t *
|
|
1320
|
+
let n = it(e);
|
|
1321
|
+
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: M.Hue, value: t * Tr[n] } : void 0;
|
|
1322
1322
|
}
|
|
1323
1323
|
return e[L] === "%" ? (L++, { type: M.Percentage, value: +t }) : { type: M.Number, value: +t };
|
|
1324
1324
|
}
|
|
@@ -1328,17 +1328,17 @@ function Ye(e) {
|
|
|
1328
1328
|
t += e[L++];
|
|
1329
1329
|
return t;
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function it(e) {
|
|
1332
1332
|
let t = "";
|
|
1333
|
-
for (; L < e.length &&
|
|
1333
|
+
for (; L < e.length && Sr.test(e[L]); )
|
|
1334
1334
|
t += e[L++];
|
|
1335
1335
|
return t;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1338
|
-
let t =
|
|
1337
|
+
function Mr(e) {
|
|
1338
|
+
let t = it(e);
|
|
1339
1339
|
return e[L] === "(" ? (L++, { type: M.Function, value: t }) : t === "none" ? { type: M.None, value: void 0 } : { type: M.Ident, value: t };
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function Ar(e = "") {
|
|
1342
1342
|
let t = e.trim(), n = [], o;
|
|
1343
1343
|
for (L = 0; L < t.length; ) {
|
|
1344
1344
|
if (o = t[L++], o === `
|
|
@@ -1367,7 +1367,7 @@ function Tr(e = "") {
|
|
|
1367
1367
|
continue;
|
|
1368
1368
|
}
|
|
1369
1369
|
if (Rt(t)) {
|
|
1370
|
-
n.push({ type: M.Ident, value:
|
|
1370
|
+
n.push({ type: M.Ident, value: it(t) });
|
|
1371
1371
|
continue;
|
|
1372
1372
|
}
|
|
1373
1373
|
return;
|
|
@@ -1388,7 +1388,7 @@ function Tr(e = "") {
|
|
|
1388
1388
|
n.push({ type: M.Alpha, value: r });
|
|
1389
1389
|
continue;
|
|
1390
1390
|
}
|
|
1391
|
-
if (Rt(t) &&
|
|
1391
|
+
if (Rt(t) && it(t) === "none") {
|
|
1392
1392
|
n.push({
|
|
1393
1393
|
type: M.Alpha,
|
|
1394
1394
|
value: { type: M.None, value: void 0 }
|
|
@@ -1402,14 +1402,14 @@ function Tr(e = "") {
|
|
|
1402
1402
|
continue;
|
|
1403
1403
|
}
|
|
1404
1404
|
if (It.test(o)) {
|
|
1405
|
-
L--, n.push(
|
|
1405
|
+
L--, n.push(Mr(t));
|
|
1406
1406
|
continue;
|
|
1407
1407
|
}
|
|
1408
1408
|
return;
|
|
1409
1409
|
}
|
|
1410
1410
|
return n;
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Lr(e) {
|
|
1413
1413
|
e._i = 0;
|
|
1414
1414
|
let t = e[e._i++];
|
|
1415
1415
|
if (!t || t.type !== M.Function || t.value !== "color" || (t = e[e._i++], t.type !== M.Ident))
|
|
@@ -1420,7 +1420,7 @@ function Mr(e) {
|
|
|
1420
1420
|
const o = { mode: n }, r = zn(e, !1);
|
|
1421
1421
|
if (!r)
|
|
1422
1422
|
return;
|
|
1423
|
-
const a =
|
|
1423
|
+
const a = ut(n).channels;
|
|
1424
1424
|
for (let i = 0, s, d; i < a.length; i++)
|
|
1425
1425
|
s = r[i], d = a[i], s.type !== M.None && (o[d] = s.type === M.Number ? s.value : s.value / 100, d === "alpha" && (o[d] = Math.max(0, Math.min(1, o[d]))));
|
|
1426
1426
|
return o;
|
|
@@ -1449,7 +1449,7 @@ function zn(e, t) {
|
|
|
1449
1449
|
return n.length === 3 && n.push({ type: M.None, value: void 0 }), n.every((r) => r.type !== M.Alpha) ? n : void 0;
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function Pr(e, t) {
|
|
1453
1453
|
e._i = 0;
|
|
1454
1454
|
let n = e[e._i++];
|
|
1455
1455
|
if (!n || n.type !== M.Function)
|
|
@@ -1461,14 +1461,14 @@ function Ar(e, t) {
|
|
|
1461
1461
|
const On = (e) => {
|
|
1462
1462
|
if (typeof e != "string")
|
|
1463
1463
|
return;
|
|
1464
|
-
const t =
|
|
1465
|
-
let o, r = 0, a =
|
|
1464
|
+
const t = Ar(e), n = t ? Pr(t, !0) : void 0;
|
|
1465
|
+
let o, r = 0, a = at.length;
|
|
1466
1466
|
for (; r < a; )
|
|
1467
|
-
if ((o =
|
|
1467
|
+
if ((o = at[r++](e, n)) !== void 0)
|
|
1468
1468
|
return o;
|
|
1469
|
-
return t ?
|
|
1469
|
+
return t ? Lr(t) : void 0;
|
|
1470
1470
|
};
|
|
1471
|
-
function
|
|
1471
|
+
function Ir(e, t) {
|
|
1472
1472
|
if (!t || t[0] !== "rgb" && t[0] !== "rgba")
|
|
1473
1473
|
return;
|
|
1474
1474
|
const n = { mode: "rgb" }, [, o, r, a, i] = t;
|
|
@@ -1481,31 +1481,31 @@ function Lr(e, t) {
|
|
|
1481
1481
|
)
|
|
1482
1482
|
)), n;
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const Rr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0, zr = (e, t, n) => e + n * (t - e), Or = (e) => {
|
|
1485
1485
|
let t = [];
|
|
1486
1486
|
for (let n = 0; n < e.length - 1; n++) {
|
|
1487
1487
|
let o = e[n], r = e[n + 1];
|
|
1488
1488
|
o === void 0 && r === void 0 ? t.push(void 0) : o !== void 0 && r !== void 0 ? t.push([o, r]) : t.push(o !== void 0 ? [o, o] : [r, r]);
|
|
1489
1489
|
}
|
|
1490
1490
|
return t;
|
|
1491
|
-
},
|
|
1492
|
-
let n =
|
|
1491
|
+
}, Dr = (e) => (t) => {
|
|
1492
|
+
let n = Or(t);
|
|
1493
1493
|
return (o) => {
|
|
1494
1494
|
let r = o * n.length, a = o >= 1 ? n.length - 1 : Math.max(Math.floor(r), 0), i = n[a];
|
|
1495
1495
|
return i === void 0 ? void 0 : e(i[0], i[1], r - a);
|
|
1496
1496
|
};
|
|
1497
|
-
}, ue = zr
|
|
1497
|
+
}, ue = Dr(zr), Wt = (e) => {
|
|
1498
1498
|
let t = !1, n = e.map((o) => o !== void 0 ? (t = !0, o) : 1);
|
|
1499
1499
|
return t ? n : e;
|
|
1500
|
-
},
|
|
1500
|
+
}, Vr = {
|
|
1501
1501
|
mode: "rgb",
|
|
1502
1502
|
channels: ["r", "g", "b", "alpha"],
|
|
1503
1503
|
parse: [
|
|
1504
|
-
|
|
1504
|
+
Ir,
|
|
1505
|
+
xr,
|
|
1506
|
+
$r,
|
|
1505
1507
|
vr,
|
|
1506
|
-
|
|
1507
|
-
mr,
|
|
1508
|
-
Pr,
|
|
1508
|
+
Rr,
|
|
1509
1509
|
"srgb"
|
|
1510
1510
|
],
|
|
1511
1511
|
serialize: "srgb",
|
|
@@ -1513,49 +1513,49 @@ const Pr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1513
1513
|
r: ue,
|
|
1514
1514
|
g: ue,
|
|
1515
1515
|
b: ue,
|
|
1516
|
-
alpha: { use: ue, fixup:
|
|
1516
|
+
alpha: { use: ue, fixup: Wt }
|
|
1517
1517
|
},
|
|
1518
1518
|
gamut: !0,
|
|
1519
1519
|
white: { r: 1, g: 1, b: 1 },
|
|
1520
1520
|
black: { r: 0, g: 0, b: 0 }
|
|
1521
|
-
},
|
|
1521
|
+
}, St = (e = 0) => {
|
|
1522
1522
|
const t = Math.abs(e);
|
|
1523
1523
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
1524
1524
|
}, Dn = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1525
1525
|
let r = {
|
|
1526
1526
|
mode: "lrgb",
|
|
1527
|
-
r:
|
|
1528
|
-
g:
|
|
1529
|
-
b:
|
|
1527
|
+
r: St(e),
|
|
1528
|
+
g: St(t),
|
|
1529
|
+
b: St(n)
|
|
1530
1530
|
};
|
|
1531
1531
|
return o !== void 0 && (r.alpha = o), r;
|
|
1532
|
-
},
|
|
1532
|
+
}, Tt = (e = 0) => {
|
|
1533
1533
|
const t = Math.abs(e);
|
|
1534
1534
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
1535
1535
|
}, Vn = ({ r: e, g: t, b: n, alpha: o }, r = "rgb") => {
|
|
1536
1536
|
let a = {
|
|
1537
1537
|
mode: r,
|
|
1538
|
-
r:
|
|
1539
|
-
g:
|
|
1540
|
-
b:
|
|
1538
|
+
r: Tt(e),
|
|
1539
|
+
g: Tt(t),
|
|
1540
|
+
b: Tt(n)
|
|
1541
1541
|
};
|
|
1542
1542
|
return o !== void 0 && (a.alpha = o), a;
|
|
1543
|
-
}, Ee = (e) => (e = e % 360) < 0 ? e + 360 : e,
|
|
1543
|
+
}, Ee = (e) => (e = e % 360) < 0 ? e + 360 : e, Hr = (e, t) => e.map((n, o, r) => {
|
|
1544
1544
|
if (n === void 0)
|
|
1545
1545
|
return n;
|
|
1546
1546
|
let a = Ee(n);
|
|
1547
1547
|
return o === 0 || e[o - 1] === void 0 ? a : t(a - Ee(r[o - 1]));
|
|
1548
|
-
}).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []),
|
|
1548
|
+
}).reduce((n, o) => !n.length || o === void 0 || n[n.length - 1] === void 0 ? (n.push(o), n) : (n.push(o + n[n.length - 1]), n), []), Hn = (e) => Hr(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), Br = (e, t) => {
|
|
1549
1549
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
|
|
1550
1550
|
return 0;
|
|
1551
1551
|
let n = Ee(e.h), o = Ee(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
1552
1552
|
return 2 * Math.sqrt(e.s * t.s) * r;
|
|
1553
|
-
},
|
|
1553
|
+
}, Fr = (e, t) => {
|
|
1554
1554
|
if (e.h === void 0 || t.h === void 0 || !e.c || !t.c)
|
|
1555
1555
|
return 0;
|
|
1556
1556
|
let n = Ee(e.h), o = Ee(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
1557
1557
|
return 2 * Math.sqrt(e.c * t.c) * r;
|
|
1558
|
-
},
|
|
1558
|
+
}, Bn = (e) => {
|
|
1559
1559
|
let t = e.reduce(
|
|
1560
1560
|
(o, r) => {
|
|
1561
1561
|
if (r !== void 0) {
|
|
@@ -1567,11 +1567,11 @@ const Pr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1567
1567
|
{ sin: 0, cos: 0 }
|
|
1568
1568
|
), n = Math.atan2(t.sin, t.cos) * 180 / Math.PI;
|
|
1569
1569
|
return n < 0 ? 360 + n : n;
|
|
1570
|
-
},
|
|
1570
|
+
}, lt = ({ l: e, a: t, b: n, alpha: o }, r = "lch") => {
|
|
1571
1571
|
t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1572
1572
|
let a = Math.sqrt(t * t + n * n), i = { mode: r, l: e, c: a };
|
|
1573
1573
|
return a && (i.h = Ee(Math.atan2(n, t) * 180 / Math.PI)), o !== void 0 && (i.alpha = o), i;
|
|
1574
|
-
},
|
|
1574
|
+
}, st = ({ l: e, c: t, h: n, alpha: o }, r = "lab") => {
|
|
1575
1575
|
n === void 0 && (n = 0);
|
|
1576
1576
|
let a = {
|
|
1577
1577
|
mode: r,
|
|
@@ -1585,7 +1585,7 @@ const Pr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1585
1585
|
Y: 1,
|
|
1586
1586
|
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
1587
1587
|
};
|
|
1588
|
-
function
|
|
1588
|
+
function jr({ h: e, s: t, l: n, alpha: o }) {
|
|
1589
1589
|
e = Ee(e !== void 0 ? e : 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1590
1590
|
let r = n + t * (n < 0.5 ? n : 1 - n), a = r - (r - n) * 2 * Math.abs(e / 60 % 2 - 1), i;
|
|
1591
1591
|
switch (Math.floor(e / 60)) {
|
|
@@ -1612,7 +1612,7 @@ function Hr({ h: e, s: t, l: n, alpha: o }) {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
return i.mode = "rgb", o !== void 0 && (i.alpha = o), i;
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function Kr({ r: e, g: t, b: n, alpha: o }) {
|
|
1616
1616
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1617
1617
|
let r = Math.max(e, t, n), a = Math.min(e, t, n), i = {
|
|
1618
1618
|
mode: "hsl",
|
|
@@ -1621,7 +1621,7 @@ function Fr({ r: e, g: t, b: n, alpha: o }) {
|
|
|
1621
1621
|
};
|
|
1622
1622
|
return r - a !== 0 && (i.h = (r === e ? (t - n) / (r - a) + (t < n) * 6 : r === t ? (n - e) / (r - a) + 2 : (e - t) / (r - a) + 4) * 60), o !== void 0 && (i.alpha = o), i;
|
|
1623
1623
|
}
|
|
1624
|
-
const
|
|
1624
|
+
const Wr = (e, t) => {
|
|
1625
1625
|
switch (t) {
|
|
1626
1626
|
case "deg":
|
|
1627
1627
|
return +e;
|
|
@@ -1632,15 +1632,15 @@ const jr = (e, t) => {
|
|
|
1632
1632
|
case "turn":
|
|
1633
1633
|
return e * 360;
|
|
1634
1634
|
}
|
|
1635
|
-
},
|
|
1636
|
-
`^hsla?\\(\\s*${
|
|
1637
|
-
),
|
|
1638
|
-
let t = e.match(
|
|
1635
|
+
}, Xr = new RegExp(
|
|
1636
|
+
`^hsla?\\(\\s*${yr}${Pe}${He}${Pe}${He}\\s*(?:,\\s*${jt}\\s*)?\\)$`
|
|
1637
|
+
), Yr = (e) => {
|
|
1638
|
+
let t = e.match(Xr);
|
|
1639
1639
|
if (!t) return;
|
|
1640
1640
|
let n = { mode: "hsl" };
|
|
1641
|
-
return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h =
|
|
1641
|
+
return t[3] !== void 0 ? n.h = +t[3] : t[1] !== void 0 && t[2] !== void 0 && (n.h = Wr(t[1], t[2])), t[4] !== void 0 && (n.s = Math.min(Math.max(0, t[4] / 100), 1)), t[5] !== void 0 && (n.l = Math.min(Math.max(0, t[5] / 100), 1)), t[6] !== void 0 ? n.alpha = Math.max(0, Math.min(1, t[6] / 100)) : t[7] !== void 0 && (n.alpha = Math.max(0, Math.min(1, +t[7]))), n;
|
|
1642
1642
|
};
|
|
1643
|
-
function
|
|
1643
|
+
function qr(e, t) {
|
|
1644
1644
|
if (!t || t[0] !== "hsl" && t[0] !== "hsla")
|
|
1645
1645
|
return;
|
|
1646
1646
|
const n = { mode: "hsl" }, [, o, r, a, i] = t;
|
|
@@ -1667,45 +1667,45 @@ function Xr(e, t) {
|
|
|
1667
1667
|
)
|
|
1668
1668
|
)), n;
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1670
|
+
const Gr = {
|
|
1671
1671
|
mode: "hsl",
|
|
1672
1672
|
toMode: {
|
|
1673
|
-
rgb:
|
|
1673
|
+
rgb: jr
|
|
1674
1674
|
},
|
|
1675
1675
|
fromMode: {
|
|
1676
|
-
rgb:
|
|
1676
|
+
rgb: Kr
|
|
1677
1677
|
},
|
|
1678
1678
|
channels: ["h", "s", "l", "alpha"],
|
|
1679
1679
|
ranges: {
|
|
1680
1680
|
h: [0, 360]
|
|
1681
1681
|
},
|
|
1682
1682
|
gamut: "rgb",
|
|
1683
|
-
parse: [
|
|
1683
|
+
parse: [qr, Yr],
|
|
1684
1684
|
serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1685
1685
|
interpolate: {
|
|
1686
|
-
h: { use: ue, fixup:
|
|
1686
|
+
h: { use: ue, fixup: Hn },
|
|
1687
1687
|
s: ue,
|
|
1688
1688
|
l: ue,
|
|
1689
|
-
alpha: { use: ue, fixup:
|
|
1689
|
+
alpha: { use: ue, fixup: Wt }
|
|
1690
1690
|
},
|
|
1691
1691
|
difference: {
|
|
1692
|
-
h:
|
|
1692
|
+
h: Br
|
|
1693
1693
|
},
|
|
1694
1694
|
average: {
|
|
1695
|
-
h:
|
|
1695
|
+
h: Bn
|
|
1696
1696
|
}
|
|
1697
1697
|
}, Fn = Math.pow(29, 3) / Math.pow(3, 3), jn = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1698
|
-
let
|
|
1699
|
-
const
|
|
1698
|
+
let Mt = (e) => Math.pow(e, 3) > jn ? Math.pow(e, 3) : (116 * e - 16) / Fn;
|
|
1699
|
+
const Ur = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1700
1700
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1701
1701
|
let r = (e + 16) / 116, a = t / 500 + r, i = r - n / 200, s = {
|
|
1702
1702
|
mode: "xyz50",
|
|
1703
|
-
x:
|
|
1704
|
-
y:
|
|
1705
|
-
z:
|
|
1703
|
+
x: Mt(a) * Ae.X,
|
|
1704
|
+
y: Mt(r) * Ae.Y,
|
|
1705
|
+
z: Mt(i) * Ae.Z
|
|
1706
1706
|
};
|
|
1707
1707
|
return o !== void 0 && (s.alpha = o), s;
|
|
1708
|
-
},
|
|
1708
|
+
}, Jr = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1709
1709
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1710
1710
|
let r = Vn({
|
|
1711
1711
|
r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * n,
|
|
@@ -1713,7 +1713,7 @@ const qr = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
|
1713
1713
|
b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * n
|
|
1714
1714
|
});
|
|
1715
1715
|
return o !== void 0 && (r.alpha = o), r;
|
|
1716
|
-
},
|
|
1716
|
+
}, Zr = (e) => Jr(Ur(e)), Qr = (e) => {
|
|
1717
1717
|
let { r: t, g: n, b: o, alpha: r } = Dn(e), a = {
|
|
1718
1718
|
mode: "xyz50",
|
|
1719
1719
|
x: 0.436065742824811 * t + 0.3851514688337912 * n + 0.14307845442264197 * o,
|
|
@@ -1721,20 +1721,20 @@ const qr = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
|
1721
1721
|
z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * o
|
|
1722
1722
|
};
|
|
1723
1723
|
return r !== void 0 && (a.alpha = r), a;
|
|
1724
|
-
},
|
|
1724
|
+
}, At = (e) => e > jn ? Math.cbrt(e) : (Fn * e + 16) / 116, ea = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1725
1725
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1726
|
-
let r =
|
|
1726
|
+
let r = At(e / Ae.X), a = At(t / Ae.Y), i = At(n / Ae.Z), s = {
|
|
1727
1727
|
mode: "lab",
|
|
1728
1728
|
l: 116 * a - 16,
|
|
1729
1729
|
a: 500 * (r - a),
|
|
1730
1730
|
b: 200 * (a - i)
|
|
1731
1731
|
};
|
|
1732
1732
|
return o !== void 0 && (s.alpha = o), s;
|
|
1733
|
-
},
|
|
1734
|
-
let t =
|
|
1733
|
+
}, ta = (e) => {
|
|
1734
|
+
let t = ea(Qr(e));
|
|
1735
1735
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1736
1736
|
};
|
|
1737
|
-
function
|
|
1737
|
+
function na(e, t) {
|
|
1738
1738
|
if (!t || t[0] !== "lch")
|
|
1739
1739
|
return;
|
|
1740
1740
|
const n = { mode: "lch" }, [, o, r, a, i] = t;
|
|
@@ -1759,15 +1759,15 @@ function ea(e, t) {
|
|
|
1759
1759
|
)
|
|
1760
1760
|
)), n;
|
|
1761
1761
|
}
|
|
1762
|
-
const
|
|
1762
|
+
const oa = {
|
|
1763
1763
|
mode: "lch",
|
|
1764
1764
|
toMode: {
|
|
1765
|
-
lab:
|
|
1766
|
-
rgb: (e) =>
|
|
1765
|
+
lab: st,
|
|
1766
|
+
rgb: (e) => Zr(st(e))
|
|
1767
1767
|
},
|
|
1768
1768
|
fromMode: {
|
|
1769
|
-
rgb: (e) =>
|
|
1770
|
-
lab:
|
|
1769
|
+
rgb: (e) => lt(ta(e)),
|
|
1770
|
+
lab: lt
|
|
1771
1771
|
},
|
|
1772
1772
|
channels: ["l", "c", "h", "alpha"],
|
|
1773
1773
|
ranges: {
|
|
@@ -1775,21 +1775,21 @@ const ta = {
|
|
|
1775
1775
|
c: [0, 150],
|
|
1776
1776
|
h: [0, 360]
|
|
1777
1777
|
},
|
|
1778
|
-
parse: [
|
|
1778
|
+
parse: [na],
|
|
1779
1779
|
serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1780
1780
|
interpolate: {
|
|
1781
|
-
h: { use: ue, fixup:
|
|
1781
|
+
h: { use: ue, fixup: Hn },
|
|
1782
1782
|
c: ue,
|
|
1783
1783
|
l: ue,
|
|
1784
|
-
alpha: { use: ue, fixup:
|
|
1784
|
+
alpha: { use: ue, fixup: Wt }
|
|
1785
1785
|
},
|
|
1786
1786
|
difference: {
|
|
1787
|
-
h:
|
|
1787
|
+
h: Fr
|
|
1788
1788
|
},
|
|
1789
1789
|
average: {
|
|
1790
|
-
h:
|
|
1790
|
+
h: Bn
|
|
1791
1791
|
}
|
|
1792
|
-
},
|
|
1792
|
+
}, ra = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1793
1793
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1794
1794
|
let r = Math.cbrt(
|
|
1795
1795
|
0.412221469470763 * e + 0.5363325372617348 * t + 0.0514459932675022 * n
|
|
@@ -1804,10 +1804,10 @@ const ta = {
|
|
|
1804
1804
|
b: 0.0259040424655478 * r + 0.7827717124575296 * a - 0.8086757549230774 * i
|
|
1805
1805
|
};
|
|
1806
1806
|
return o !== void 0 && (s.alpha = o), s;
|
|
1807
|
-
},
|
|
1808
|
-
let t =
|
|
1807
|
+
}, aa = (e) => {
|
|
1808
|
+
let t = ra(Dn(e));
|
|
1809
1809
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1810
|
-
},
|
|
1810
|
+
}, ia = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1811
1811
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1812
1812
|
let r = Math.pow(e + 0.3963377773761749 * t + 0.2158037573099136 * n, 3), a = Math.pow(e - 0.1055613458156586 * t - 0.0638541728258133 * n, 3), i = Math.pow(e - 0.0894841775298119 * t - 1.2914855480194092 * n, 3), s = {
|
|
1813
1813
|
mode: "lrgb",
|
|
@@ -1816,8 +1816,8 @@ const ta = {
|
|
|
1816
1816
|
b: -0.0041960761386756 * r - 0.7034186179359362 * a + 1.7076146940746117 * i
|
|
1817
1817
|
};
|
|
1818
1818
|
return o !== void 0 && (s.alpha = o), s;
|
|
1819
|
-
},
|
|
1820
|
-
function
|
|
1819
|
+
}, la = (e) => Vn(ia(e));
|
|
1820
|
+
function sa(e, t) {
|
|
1821
1821
|
if (!t || t[0] !== "oklch")
|
|
1822
1822
|
return;
|
|
1823
1823
|
const n = { mode: "oklch" }, [, o, r, a, i] = t;
|
|
@@ -1845,35 +1845,35 @@ function ia(e, t) {
|
|
|
1845
1845
|
)
|
|
1846
1846
|
)), n;
|
|
1847
1847
|
}
|
|
1848
|
-
const
|
|
1849
|
-
...
|
|
1848
|
+
const ca = {
|
|
1849
|
+
...oa,
|
|
1850
1850
|
mode: "oklch",
|
|
1851
1851
|
toMode: {
|
|
1852
|
-
oklab: (e) =>
|
|
1853
|
-
rgb: (e) =>
|
|
1852
|
+
oklab: (e) => st(e, "oklab"),
|
|
1853
|
+
rgb: (e) => la(st(e, "oklab"))
|
|
1854
1854
|
},
|
|
1855
1855
|
fromMode: {
|
|
1856
|
-
rgb: (e) =>
|
|
1857
|
-
oklab: (e) =>
|
|
1856
|
+
rgb: (e) => lt(aa(e), "oklch"),
|
|
1857
|
+
oklab: (e) => lt(e, "oklch")
|
|
1858
1858
|
},
|
|
1859
|
-
parse: [
|
|
1859
|
+
parse: [sa],
|
|
1860
1860
|
serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1861
1861
|
ranges: {
|
|
1862
1862
|
l: [0, 1],
|
|
1863
1863
|
c: [0, 0.4],
|
|
1864
1864
|
h: [0, 360]
|
|
1865
1865
|
}
|
|
1866
|
-
},
|
|
1866
|
+
}, da = (e) => Math.max(0, Math.min(1, e || 0)), tt = (e) => Math.round(da(e) * 255), Kn = me("rgb"), Wn = (e) => {
|
|
1867
1867
|
if (e === void 0)
|
|
1868
1868
|
return;
|
|
1869
1869
|
let t = tt(e.r), n = tt(e.g), o = tt(e.b);
|
|
1870
1870
|
return "#" + (1 << 24 | t << 16 | n << 8 | o).toString(16).slice(1);
|
|
1871
|
-
},
|
|
1871
|
+
}, ua = (e) => {
|
|
1872
1872
|
if (e === void 0)
|
|
1873
1873
|
return;
|
|
1874
1874
|
let t = tt(e.alpha !== void 0 ? e.alpha : 1);
|
|
1875
1875
|
return Wn(e) + (256 | t).toString(16).slice(1);
|
|
1876
|
-
},
|
|
1876
|
+
}, pa = (e) => Wn(Kn(e)), fa = (e) => ua(Kn(e)), Xn = me("rgb"), Yn = (e) => {
|
|
1877
1877
|
const t = {
|
|
1878
1878
|
mode: e.mode,
|
|
1879
1879
|
r: Math.max(0, Math.min(e.r !== void 0 ? e.r : 0, 1)),
|
|
@@ -1881,24 +1881,24 @@ const la = {
|
|
|
1881
1881
|
b: Math.max(0, Math.min(e.b !== void 0 ? e.b : 0, 1))
|
|
1882
1882
|
};
|
|
1883
1883
|
return e.alpha !== void 0 && (t.alpha = e.alpha), t;
|
|
1884
|
-
},
|
|
1885
|
-
function
|
|
1884
|
+
}, ha = (e) => Yn(Xn(e)), qn = (e) => e !== void 0 && (e.r === void 0 || e.r >= 0 && e.r <= 1) && (e.g === void 0 || e.g >= 0 && e.g <= 1) && (e.b === void 0 || e.b >= 0 && e.b <= 1);
|
|
1885
|
+
function ga(e) {
|
|
1886
1886
|
return qn(Xn(e));
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const { gamut: t } =
|
|
1888
|
+
function Xt(e = "rgb") {
|
|
1889
|
+
const { gamut: t } = ut(e);
|
|
1890
1890
|
if (!t)
|
|
1891
1891
|
return (o) => !0;
|
|
1892
1892
|
const n = me(typeof t == "string" ? t : e);
|
|
1893
1893
|
return (o) => qn(n(o));
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1896
|
-
const { gamut: t } =
|
|
1895
|
+
function ka(e = "rgb") {
|
|
1896
|
+
const { gamut: t } = ut(e);
|
|
1897
1897
|
if (!t)
|
|
1898
|
-
return (a) =>
|
|
1899
|
-
const n = typeof t == "string" ? t : e, o = me(n), r =
|
|
1898
|
+
return (a) => rt(a);
|
|
1899
|
+
const n = typeof t == "string" ? t : e, o = me(n), r = Xt(n);
|
|
1900
1900
|
return (a) => {
|
|
1901
|
-
const i =
|
|
1901
|
+
const i = rt(a);
|
|
1902
1902
|
if (!i)
|
|
1903
1903
|
return;
|
|
1904
1904
|
const s = o(i);
|
|
@@ -1908,27 +1908,27 @@ function ha(e = "rgb") {
|
|
|
1908
1908
|
return i.mode === d.mode ? d : me(i.mode)(d);
|
|
1909
1909
|
};
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1912
|
-
e =
|
|
1913
|
-
let o = n === "rgb" ?
|
|
1911
|
+
function ma(e, t = "lch", n = "rgb") {
|
|
1912
|
+
e = rt(e);
|
|
1913
|
+
let o = n === "rgb" ? ga : Xt(n), r = n === "rgb" ? ha : ka(n);
|
|
1914
1914
|
if (e === void 0 || o(e)) return e;
|
|
1915
1915
|
let a = me(e.mode);
|
|
1916
1916
|
e = me(t)(e);
|
|
1917
1917
|
let i = { ...e, c: 0 };
|
|
1918
1918
|
if (!o(i))
|
|
1919
1919
|
return a(r(i));
|
|
1920
|
-
let s = 0, d = e.c !== void 0 ? e.c : 0, c =
|
|
1920
|
+
let s = 0, d = e.c !== void 0 ? e.c : 0, c = ut(t).ranges.c, u = (c[1] - c[0]) / Math.pow(2, 13), p = i.c;
|
|
1921
1921
|
for (; d - s > u; )
|
|
1922
1922
|
i.c = s + (d - s) * 0.5, o(i) ? (p = i.c, s = i.c) : d = i.c;
|
|
1923
1923
|
return a(
|
|
1924
1924
|
o(i) ? i : { ...i, c: p }
|
|
1925
1925
|
);
|
|
1926
1926
|
}
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
const Gn = 0.37, Un = me("oklch"), Jn = me("rgb"),
|
|
1931
|
-
function
|
|
1927
|
+
Kt(ca);
|
|
1928
|
+
Kt(Vr);
|
|
1929
|
+
Kt(Gr);
|
|
1930
|
+
const Gn = 0.37, Un = me("oklch"), Jn = me("rgb"), ba = Xt("rgb");
|
|
1931
|
+
function Yt(e) {
|
|
1932
1932
|
return {
|
|
1933
1933
|
mode: "oklch",
|
|
1934
1934
|
l: e.l / 100,
|
|
@@ -1937,7 +1937,7 @@ function Xt(e) {
|
|
|
1937
1937
|
alpha: e.a / 100
|
|
1938
1938
|
};
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function va(e) {
|
|
1941
1941
|
return {
|
|
1942
1942
|
l: (e.l ?? 0) * 100,
|
|
1943
1943
|
c: e.c ?? 0,
|
|
@@ -1952,7 +1952,7 @@ function ne(e) {
|
|
|
1952
1952
|
const r = (e.a / 100).toFixed(4);
|
|
1953
1953
|
return `oklch(${t} ${n} ${o} / ${r})`;
|
|
1954
1954
|
}
|
|
1955
|
-
function
|
|
1955
|
+
function wa(e) {
|
|
1956
1956
|
const t = { l: 0, c: 0, h: 0, a: 100 };
|
|
1957
1957
|
try {
|
|
1958
1958
|
const n = On(e);
|
|
@@ -1970,9 +1970,9 @@ function ba(e) {
|
|
|
1970
1970
|
return t;
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1974
|
-
const n =
|
|
1975
|
-
return o ? e.a < 100 ?
|
|
1973
|
+
function rn(e, t) {
|
|
1974
|
+
const n = Yt(e), o = Jn(n);
|
|
1975
|
+
return o ? e.a < 100 ? fa({ ...o, alpha: e.a / 100 }) ?? "#000000ff" : pa(o) ?? "#000000" : "#000000";
|
|
1976
1976
|
}
|
|
1977
1977
|
function _e(e) {
|
|
1978
1978
|
const t = {
|
|
@@ -1982,10 +1982,10 @@ function _e(e) {
|
|
|
1982
1982
|
l: e.l / 100,
|
|
1983
1983
|
alpha: e.a / 100
|
|
1984
1984
|
}, n = Un(t);
|
|
1985
|
-
return n ?
|
|
1985
|
+
return n ? va(n) : { l: 0, c: 0, h: 0, a: e.a };
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1988
|
-
const t =
|
|
1987
|
+
function an(e) {
|
|
1988
|
+
const t = Yt(e), n = ma(t, "oklch", "rgb");
|
|
1989
1989
|
return n ? {
|
|
1990
1990
|
l: (n.l ?? e.l / 100) * 100,
|
|
1991
1991
|
c: n.c ?? 0,
|
|
@@ -1993,19 +1993,19 @@ function rn(e) {
|
|
|
1993
1993
|
a: e.a
|
|
1994
1994
|
} : { l: e.l, c: 0, h: e.h, a: e.a };
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const t = Jn(
|
|
1998
|
-
return t ?
|
|
1996
|
+
function xa(e) {
|
|
1997
|
+
const t = Jn(Yt(e));
|
|
1998
|
+
return t ? ba(t) : !1;
|
|
1999
1999
|
}
|
|
2000
2000
|
function qe(e, t, n) {
|
|
2001
2001
|
return Math.min(n, Math.max(t, e));
|
|
2002
2002
|
}
|
|
2003
|
-
function
|
|
2003
|
+
function ya(e, t, n) {
|
|
2004
2004
|
if (n <= 0) return e;
|
|
2005
2005
|
const o = Math.round((e - t) / n);
|
|
2006
2006
|
return t + o * n;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function ln({
|
|
2009
2009
|
config: e,
|
|
2010
2010
|
value: t,
|
|
2011
2011
|
gradient: n,
|
|
@@ -2030,7 +2030,7 @@ function an({
|
|
|
2030
2030
|
if (!_) return null;
|
|
2031
2031
|
const S = _.getBoundingClientRect();
|
|
2032
2032
|
if (S.width === 0) return null;
|
|
2033
|
-
const
|
|
2033
|
+
const B = qe((g - S.left) / S.width, 0, 1), K = C.current + B * (E.current - C.current), Y = ya(K, C.current, h.current);
|
|
2034
2034
|
return qe(Y, C.current, E.current);
|
|
2035
2035
|
}
|
|
2036
2036
|
X(() => {
|
|
@@ -2050,7 +2050,7 @@ function an({
|
|
|
2050
2050
|
const ee = N(Y.clientX);
|
|
2051
2051
|
ee !== null && x.current(ee);
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2053
|
+
function B(Y) {
|
|
2054
2054
|
if (m.current) {
|
|
2055
2055
|
m.current = !1;
|
|
2056
2056
|
try {
|
|
@@ -2070,8 +2070,8 @@ function an({
|
|
|
2070
2070
|
w.current();
|
|
2071
2071
|
}
|
|
2072
2072
|
}
|
|
2073
|
-
return g.addEventListener("pointerdown", _), g.addEventListener("pointermove", S), g.addEventListener("pointerup",
|
|
2074
|
-
g.removeEventListener("pointerdown", _), g.removeEventListener("pointermove", S), g.removeEventListener("pointerup",
|
|
2073
|
+
return g.addEventListener("pointerdown", _), g.addEventListener("pointermove", S), g.addEventListener("pointerup", B), g.addEventListener("pointercancel", K), () => {
|
|
2074
|
+
g.removeEventListener("pointerdown", _), g.removeEventListener("pointermove", S), g.removeEventListener("pointerup", B), g.removeEventListener("pointercancel", K);
|
|
2075
2075
|
};
|
|
2076
2076
|
}, []);
|
|
2077
2077
|
const v = z(
|
|
@@ -2136,8 +2136,8 @@ function an({
|
|
|
2136
2136
|
/* @__PURE__ */ l("span", { className: "tokenpanel-color-picker-slider-value", children: p(t) })
|
|
2137
2137
|
] });
|
|
2138
2138
|
}
|
|
2139
|
-
const Zn = "tokenpanel.colorPicker.mode", zt = [95, 78, 61, 44, 27, 10],
|
|
2140
|
-
function
|
|
2139
|
+
const Zn = "tokenpanel.colorPicker.mode", zt = [95, 78, 61, 44, 27, 10], Na = [0, 60, 120, 180, 240, 300], _a = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], $a = 0.18, Ca = 320, Ea = 400, Sa = 520, Ta = 440;
|
|
2140
|
+
function Ma() {
|
|
2141
2141
|
return [
|
|
2142
2142
|
{
|
|
2143
2143
|
key: "l",
|
|
@@ -2177,7 +2177,7 @@ function Sa() {
|
|
|
2177
2177
|
}
|
|
2178
2178
|
];
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function Aa() {
|
|
2181
2181
|
return [
|
|
2182
2182
|
{
|
|
2183
2183
|
key: "h",
|
|
@@ -2217,15 +2217,15 @@ function Ta() {
|
|
|
2217
2217
|
}
|
|
2218
2218
|
];
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function sn(e, t, n, o) {
|
|
2221
2221
|
return {
|
|
2222
2222
|
l: zt[e] ?? 50,
|
|
2223
|
-
c:
|
|
2223
|
+
c: $a,
|
|
2224
2224
|
h: o[t] ?? 0,
|
|
2225
2225
|
a: n
|
|
2226
2226
|
};
|
|
2227
2227
|
}
|
|
2228
|
-
function
|
|
2228
|
+
function La(e) {
|
|
2229
2229
|
if (typeof window > "u") return e;
|
|
2230
2230
|
try {
|
|
2231
2231
|
const t = window.localStorage.getItem(Zn);
|
|
@@ -2234,14 +2234,14 @@ function Ma(e) {
|
|
|
2234
2234
|
}
|
|
2235
2235
|
return e;
|
|
2236
2236
|
}
|
|
2237
|
-
function
|
|
2237
|
+
function Pa(e) {
|
|
2238
2238
|
if (!(typeof window > "u"))
|
|
2239
2239
|
try {
|
|
2240
2240
|
window.localStorage.setItem(Zn, e);
|
|
2241
2241
|
} catch {
|
|
2242
2242
|
}
|
|
2243
2243
|
}
|
|
2244
|
-
function
|
|
2244
|
+
function Ia(e, t) {
|
|
2245
2245
|
const [n, o] = j(e);
|
|
2246
2246
|
return X(() => {
|
|
2247
2247
|
t.current || o(e);
|
|
@@ -2279,15 +2279,15 @@ function to({
|
|
|
2279
2279
|
anchorRef: r,
|
|
2280
2280
|
onClose: a
|
|
2281
2281
|
}) {
|
|
2282
|
-
const i = O(null), s = O(null), d = O(!1), [c, u] =
|
|
2282
|
+
const i = O(null), s = O(null), d = O(!1), [c, u] = Ia(e, d), [p, h] = j(
|
|
2283
2283
|
null
|
|
2284
2284
|
), m = O(null), $ = O(!1), [b, x] = j(
|
|
2285
|
-
() =>
|
|
2285
|
+
() => La(o)
|
|
2286
2286
|
), [f, w] = j("mini"), [C, E] = j(c);
|
|
2287
2287
|
X(() => {
|
|
2288
2288
|
(/^#[0-9a-fA-F]{6}$/.test(C) || /^#[0-9a-fA-F]{8}$/.test(C)) && E(c);
|
|
2289
2289
|
}, [c]), eo(i, a);
|
|
2290
|
-
const N = Z(() =>
|
|
2290
|
+
const N = Z(() => wa(c), [c]), v = Z(() => kr(c), [c]), g = z(
|
|
2291
2291
|
(y) => {
|
|
2292
2292
|
const R = y.toLowerCase();
|
|
2293
2293
|
u(R), E(R), t(R);
|
|
@@ -2301,7 +2301,7 @@ function to({
|
|
|
2301
2301
|
h: y.h ?? N.h,
|
|
2302
2302
|
a: y.a ?? N.a
|
|
2303
2303
|
};
|
|
2304
|
-
g(
|
|
2304
|
+
g(rn(R));
|
|
2305
2305
|
},
|
|
2306
2306
|
[N, g]
|
|
2307
2307
|
), S = z(
|
|
@@ -2312,15 +2312,15 @@ function to({
|
|
|
2312
2312
|
l: y.l ?? v.l,
|
|
2313
2313
|
a: y.a ?? v.a
|
|
2314
2314
|
};
|
|
2315
|
-
g(
|
|
2315
|
+
g(mr(R.h, R.s, R.l, R.a));
|
|
2316
2316
|
},
|
|
2317
2317
|
[v, g]
|
|
2318
|
-
),
|
|
2318
|
+
), B = (y) => {
|
|
2319
2319
|
E(y), (/^#[0-9a-fA-F]{6}$/.test(y) || /^#[0-9a-fA-F]{8}$/.test(y)) && g(y);
|
|
2320
|
-
}, K = f === "expanded" ?
|
|
2320
|
+
}, K = f === "expanded" ? _a : Na, Y = z(
|
|
2321
2321
|
(y, R) => {
|
|
2322
|
-
const J =
|
|
2323
|
-
g(
|
|
2322
|
+
const J = sn(y, R, N.a, K), F = an(J);
|
|
2323
|
+
g(rn(F));
|
|
2324
2324
|
},
|
|
2325
2325
|
[N.a, K, g]
|
|
2326
2326
|
), ee = z(
|
|
@@ -2342,8 +2342,8 @@ function to({
|
|
|
2342
2342
|
},
|
|
2343
2343
|
[K, Y]
|
|
2344
2344
|
), pe = (y) => {
|
|
2345
|
-
|
|
2346
|
-
}, oe = Z(() =>
|
|
2345
|
+
Pa(y), x(y);
|
|
2346
|
+
}, oe = Z(() => Ma(), []), ye = Z(() => Aa(), []), he = Z(() => b === "oklch" ? {
|
|
2347
2347
|
l: `linear-gradient(90deg in oklch, ${ne({ l: 0, c: N.c, h: N.h, a: 100 })}, ${ne({ l: 100, c: N.c, h: N.h, a: 100 })})`,
|
|
2348
2348
|
c: `linear-gradient(90deg in oklch, ${ne({ l: N.l, c: 0, h: N.h, a: 100 })}, ${ne({ l: N.l, c: Gn, h: N.h, a: 100 })})`,
|
|
2349
2349
|
h: `linear-gradient(90deg in oklch longer hue, ${ne({ l: N.l, c: N.c, h: 0, a: 100 })}, ${ne({ l: N.l, c: N.c, h: 360, a: 100 })})`,
|
|
@@ -2357,7 +2357,7 @@ function to({
|
|
|
2357
2357
|
position: "fixed",
|
|
2358
2358
|
visibility: "hidden"
|
|
2359
2359
|
}));
|
|
2360
|
-
|
|
2360
|
+
_o(() => {
|
|
2361
2361
|
const y = r.current;
|
|
2362
2362
|
if (!y) {
|
|
2363
2363
|
A({ position: "fixed", visibility: "hidden" });
|
|
@@ -2366,8 +2366,8 @@ function to({
|
|
|
2366
2366
|
A(
|
|
2367
2367
|
Qn(
|
|
2368
2368
|
y,
|
|
2369
|
-
f === "mini" ?
|
|
2370
|
-
f === "mini" ?
|
|
2369
|
+
f === "mini" ? Ca : Sa,
|
|
2370
|
+
f === "mini" ? Ea : Ta
|
|
2371
2371
|
)
|
|
2372
2372
|
);
|
|
2373
2373
|
}, [r, f]), X(() => {
|
|
@@ -2377,13 +2377,13 @@ function to({
|
|
|
2377
2377
|
W.preventDefault(), W.stopPropagation();
|
|
2378
2378
|
const T = i.current;
|
|
2379
2379
|
if (!T) return;
|
|
2380
|
-
const
|
|
2380
|
+
const H = T.getBoundingClientRect();
|
|
2381
2381
|
m.current = {
|
|
2382
2382
|
pointerId: W.pointerId,
|
|
2383
2383
|
startX: W.clientX,
|
|
2384
2384
|
startY: W.clientY,
|
|
2385
|
-
baseLeft:
|
|
2386
|
-
baseTop:
|
|
2385
|
+
baseLeft: H.left,
|
|
2386
|
+
baseTop: H.top
|
|
2387
2387
|
}, $.current = !0;
|
|
2388
2388
|
try {
|
|
2389
2389
|
y.setPointerCapture(W.pointerId);
|
|
@@ -2392,7 +2392,7 @@ function to({
|
|
|
2392
2392
|
}
|
|
2393
2393
|
function J(W) {
|
|
2394
2394
|
if (!$.current || !m.current || W.pointerId !== m.current.pointerId) return;
|
|
2395
|
-
const { startX: T, startY:
|
|
2395
|
+
const { startX: T, startY: H, baseLeft: V, baseTop: U } = m.current, I = V + (W.clientX - T), q = U + (W.clientY - H);
|
|
2396
2396
|
h({ left: I, top: q });
|
|
2397
2397
|
}
|
|
2398
2398
|
function F(W) {
|
|
@@ -2404,12 +2404,12 @@ function to({
|
|
|
2404
2404
|
}
|
|
2405
2405
|
const T = i.current;
|
|
2406
2406
|
if (!T) return;
|
|
2407
|
-
const
|
|
2407
|
+
const H = T.getBoundingClientRect(), V = 8, U = window.innerWidth, I = window.innerHeight, q = Math.max(
|
|
2408
2408
|
V,
|
|
2409
|
-
Math.min(U - V -
|
|
2409
|
+
Math.min(U - V - H.width, H.left)
|
|
2410
2410
|
), fe = Math.max(
|
|
2411
2411
|
V,
|
|
2412
|
-
Math.min(I - V -
|
|
2412
|
+
Math.min(I - V - H.height, H.top)
|
|
2413
2413
|
);
|
|
2414
2414
|
h({ left: q, top: fe });
|
|
2415
2415
|
}
|
|
@@ -2515,7 +2515,7 @@ function to({
|
|
|
2515
2515
|
type: "text",
|
|
2516
2516
|
className: "tokenpanel-color-picker-hex-input",
|
|
2517
2517
|
value: C,
|
|
2518
|
-
onChange: (y) =>
|
|
2518
|
+
onChange: (y) => B(y.target.value),
|
|
2519
2519
|
spellcheck: !1,
|
|
2520
2520
|
"aria-label": "Hex color value"
|
|
2521
2521
|
}
|
|
@@ -2528,7 +2528,7 @@ function to({
|
|
|
2528
2528
|
role: "grid",
|
|
2529
2529
|
"aria-label": "Color presets",
|
|
2530
2530
|
children: zt.map((y, R) => /* @__PURE__ */ l("div", { role: "row", children: K.map((J, F) => {
|
|
2531
|
-
const W =
|
|
2531
|
+
const W = sn(R, F, N.a, K), T = xa(W), H = ne(an(W)), V = Math.abs(N.h - W.h) % 360, U = Math.min(V, 360 - V), I = Math.abs(N.l - W.l) < 2 && U < 5 && Math.abs(N.c - W.c) < 0.05;
|
|
2532
2532
|
return /* @__PURE__ */ l(
|
|
2533
2533
|
"div",
|
|
2534
2534
|
{
|
|
@@ -2539,7 +2539,7 @@ function to({
|
|
|
2539
2539
|
"aria-selected": I,
|
|
2540
2540
|
"aria-label": `Preset L ${W.l}% H ${W.h}°`,
|
|
2541
2541
|
className: "tokenpanel-color-picker-grid-cell",
|
|
2542
|
-
style: { background:
|
|
2542
|
+
style: { background: H },
|
|
2543
2543
|
tabIndex: R === 0 && F === 0 ? 0 : -1,
|
|
2544
2544
|
onClick: () => Y(R, F),
|
|
2545
2545
|
onKeyDown: (q) => ee(q, R, F)
|
|
@@ -2550,7 +2550,7 @@ function to({
|
|
|
2550
2550
|
}
|
|
2551
2551
|
),
|
|
2552
2552
|
/* @__PURE__ */ l("div", { className: "tokenpanel-color-picker-sliders", children: b === "oklch" ? oe.map((y) => /* @__PURE__ */ l(
|
|
2553
|
-
|
|
2553
|
+
ln,
|
|
2554
2554
|
{
|
|
2555
2555
|
config: y,
|
|
2556
2556
|
value: N[y.key] ?? 0,
|
|
@@ -2561,7 +2561,7 @@ function to({
|
|
|
2561
2561
|
},
|
|
2562
2562
|
y.key
|
|
2563
2563
|
)) : ye.map((y) => /* @__PURE__ */ l(
|
|
2564
|
-
|
|
2564
|
+
ln,
|
|
2565
2565
|
{
|
|
2566
2566
|
config: y,
|
|
2567
2567
|
value: v[y.key] ?? 0,
|
|
@@ -2586,9 +2586,9 @@ function to({
|
|
|
2586
2586
|
}
|
|
2587
2587
|
);
|
|
2588
2588
|
}
|
|
2589
|
-
const
|
|
2589
|
+
const qt = Ht(null);
|
|
2590
2590
|
function ie({ cssVar: e }) {
|
|
2591
|
-
const t =
|
|
2591
|
+
const t = Ft(qt);
|
|
2592
2592
|
if (t === null) return null;
|
|
2593
2593
|
const { state: n, toggle: o, matchCounts: r } = t, a = n.active[e], i = a !== void 0, s = i ? n.slots[a]?.color : void 0, d = r?.[e], c = G(() => {
|
|
2594
2594
|
o(e);
|
|
@@ -2635,11 +2635,11 @@ function ie({ cssVar: e }) {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
);
|
|
2637
2637
|
}
|
|
2638
|
-
function
|
|
2638
|
+
function Ra({
|
|
2639
2639
|
anchorRef: e,
|
|
2640
2640
|
onClose: t
|
|
2641
2641
|
}) {
|
|
2642
|
-
const n =
|
|
2642
|
+
const n = $o(qt), [o, r] = j(null), a = O(Array.from({ length: 10 }, () => null)), i = O(null), s = O(null);
|
|
2643
2643
|
if (eo(i, t), !n) return null;
|
|
2644
2644
|
const { state: d, setSlot: c, setOutlineWidth: u, reset: p, disableAll: h } = n, m = {};
|
|
2645
2645
|
for (const [b, x] of Object.entries(d.active))
|
|
@@ -2780,18 +2780,18 @@ function ao() {
|
|
|
2780
2780
|
function io() {
|
|
2781
2781
|
return `${Q().storagePrefix}-highlight-outline-width`;
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function za(e) {
|
|
2784
2784
|
const t = new Set(Object.values(e));
|
|
2785
2785
|
for (let n = 0; n < 10; n++)
|
|
2786
2786
|
if (!t.has(n)) return n;
|
|
2787
2787
|
return -1;
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Oa(e, t) {
|
|
2790
2790
|
if (t in e.active) {
|
|
2791
2791
|
const { [t]: o, ...r } = e.active;
|
|
2792
2792
|
return { ...e, active: r };
|
|
2793
2793
|
}
|
|
2794
|
-
const n =
|
|
2794
|
+
const n = za(e.active);
|
|
2795
2795
|
return n === -1 ? (console.warn(
|
|
2796
2796
|
"[zudo-design-token-panel] highlight: all 10 slots are in use; cannot highlight",
|
|
2797
2797
|
t
|
|
@@ -2800,26 +2800,26 @@ function Ra(e, t) {
|
|
|
2800
2800
|
active: { ...e.active, [t]: n }
|
|
2801
2801
|
};
|
|
2802
2802
|
}
|
|
2803
|
-
function
|
|
2803
|
+
function Da(e) {
|
|
2804
2804
|
return {
|
|
2805
2805
|
...e,
|
|
2806
2806
|
slots: no.map((t) => ({ ...t })),
|
|
2807
2807
|
outlineWidth: oo
|
|
2808
2808
|
};
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2810
|
+
function Va(e) {
|
|
2811
2811
|
return { ...e, active: {} };
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2813
|
+
function Ha(e, t, n) {
|
|
2814
2814
|
if (t < 0 || t >= e.slots.length) return e;
|
|
2815
2815
|
const o = e.slots.map((r, a) => a === t ? { ...r, ...n } : r);
|
|
2816
2816
|
return { ...e, slots: o };
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function Ba(e, t) {
|
|
2819
2819
|
const n = Math.max(1, t);
|
|
2820
2820
|
return { ...e, outlineWidth: n };
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function Fa() {
|
|
2823
2823
|
let e = no.map((o) => ({ ...o })), t = oo, n = {};
|
|
2824
2824
|
try {
|
|
2825
2825
|
const o = localStorage.getItem(ro());
|
|
@@ -2861,7 +2861,7 @@ function Oe(e) {
|
|
|
2861
2861
|
} catch {
|
|
2862
2862
|
}
|
|
2863
2863
|
}
|
|
2864
|
-
const
|
|
2864
|
+
const cn = {
|
|
2865
2865
|
color: {
|
|
2866
2866
|
sentinelA: "rgb(123, 234, 17)",
|
|
2867
2867
|
sentinelB: "rgb(231, 17, 234)",
|
|
@@ -3065,10 +3065,10 @@ const sn = {
|
|
|
3065
3065
|
longhands: ["mask-image"],
|
|
3066
3066
|
compounds: ["mask-image"]
|
|
3067
3067
|
}
|
|
3068
|
-
}, Ge = [null, "::before", "::after"],
|
|
3069
|
-
function
|
|
3068
|
+
}, Ge = [null, "::before", "::after"], lo = "tokenpanel-highlight-mount", so = "tokenpanel-elpath-mount", Gt = `.tokenpanel-shell, [data-design-token-panel-modal], #${lo}, #${so}`, ja = /^(transparent|currentcolor|currentColor|inherit|initial|unset|red|blue|green|black|white|gray|grey|silver|yellow|orange|purple|pink|brown|cyan|magenta|lime|olive|navy|maroon|teal|aqua|fuchsia|coral|salmon|gold|khaki|violet|indigo|crimson|lavender|beige|ivory|chocolate|tomato|orchid|plum|turquoise|tan|sienna|peru|papayawhip|peachpuff|moccasin|mistyrose|linen|lemonchiffon|honeydew|gainsboro)$/i, Ka = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, Wa = /^#/, Xa = /^-?\d+(\.\d+)?(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr)%?$/, Ya = /^-?\d+(\.\d+)?$/, qa = /^(cubic-bezier|steps|linear)\(/i, Ga = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, Ua = /^".*"$/, Ja = /^url\(/i;
|
|
3069
|
+
function Za(e, t) {
|
|
3070
3070
|
const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
3071
|
-
return n ?
|
|
3071
|
+
return n ? Ka.test(n) || Wa.test(n) || ja.test(n) ? "color" : Xa.test(n) ? "length" : Ya.test(n) ? "number" : qa.test(n) ? "easing" : Ga.test(n) ? "time" : Ua.test(n) ? "content" : (Ja.test(n) && t.push(
|
|
3072
3072
|
`type auto-detection inconclusive for ${e}: resolved value starts with url(); defaulting to text — supply kind:'cursor' or kind:'mask-image' explicitly if this is a cursor or mask-image token`
|
|
3073
3073
|
), "text") : (t.push(
|
|
3074
3074
|
`type auto-detection inconclusive for ${e}; defaulting to color — supply kind explicitly if this is incorrect`
|
|
@@ -3090,7 +3090,7 @@ function Ot(e, t, n) {
|
|
|
3090
3090
|
);
|
|
3091
3091
|
} else "cssRules" in o && o.cssRules && Ot(o.cssRules, t, n);
|
|
3092
3092
|
}
|
|
3093
|
-
function
|
|
3093
|
+
function Qa(e, t) {
|
|
3094
3094
|
const n = /* @__PURE__ */ new Set();
|
|
3095
3095
|
for (const o of document.styleSheets) {
|
|
3096
3096
|
let r;
|
|
@@ -3105,13 +3105,13 @@ function Ja(e, t) {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
return n;
|
|
3107
3107
|
}
|
|
3108
|
-
function
|
|
3108
|
+
function ei(e) {
|
|
3109
3109
|
const t = /* @__PURE__ */ new Set(), n = document.querySelectorAll("[style]");
|
|
3110
3110
|
for (const o of n)
|
|
3111
3111
|
o.style.getPropertyValue(e) !== "" && t.add(o);
|
|
3112
3112
|
return t;
|
|
3113
3113
|
}
|
|
3114
|
-
function
|
|
3114
|
+
function Lt(e, t, n, o, r) {
|
|
3115
3115
|
const a = [], i = document.documentElement, s = /* @__PURE__ */ new WeakSet();
|
|
3116
3116
|
a.push({
|
|
3117
3117
|
el: i,
|
|
@@ -3121,7 +3121,7 @@ function At(e, t, n, o, r) {
|
|
|
3121
3121
|
const d = (c) => {
|
|
3122
3122
|
if (!s.has(c)) {
|
|
3123
3123
|
try {
|
|
3124
|
-
if (c.closest(
|
|
3124
|
+
if (c.closest(Gt) !== null) return;
|
|
3125
3125
|
} catch {
|
|
3126
3126
|
}
|
|
3127
3127
|
a.push({
|
|
@@ -3144,13 +3144,13 @@ function At(e, t, n, o, r) {
|
|
|
3144
3144
|
for (const c of o) d(c);
|
|
3145
3145
|
return a;
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function Pt(e, t) {
|
|
3148
3148
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
3149
3149
|
const { el: o, original: r, originalPriority: a } = t[n];
|
|
3150
3150
|
r ? o.style.setProperty(e, r, a) : o.style.removeProperty(e);
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function dn(e, t, n) {
|
|
3154
3154
|
let o;
|
|
3155
3155
|
try {
|
|
3156
3156
|
o = getComputedStyle(e, t);
|
|
@@ -3162,18 +3162,18 @@ function cn(e, t, n) {
|
|
|
3162
3162
|
r[a] = o.getPropertyValue(a);
|
|
3163
3163
|
return r;
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function ti(e, t) {
|
|
3166
3166
|
if (!e || !t) return null;
|
|
3167
3167
|
for (const n in e)
|
|
3168
3168
|
if (e[n] !== t[n]) return n;
|
|
3169
3169
|
return null;
|
|
3170
3170
|
}
|
|
3171
|
-
function
|
|
3171
|
+
function un(e, t) {
|
|
3172
3172
|
let n = e.trim();
|
|
3173
3173
|
n.startsWith("var(") && (n = n.replace(/^var\(\s*/, "").replace(/\s*\)$/, "").trim());
|
|
3174
|
-
const o = [], r = t?.mode ?? "equality", a = t?.kind ??
|
|
3174
|
+
const o = [], r = t?.mode ?? "equality", a = t?.kind ?? Za(n, o), i = cn[a] ?? cn.color, s = Qa(n, o), d = ei(n), c = [document.body, ...document.body.querySelectorAll("*")], u = /* @__PURE__ */ new Set();
|
|
3175
3175
|
if (r === "equality") {
|
|
3176
|
-
const { sentinelA: h, longhands: m, compounds: $ } = i, b = i.needleA ?? h, x =
|
|
3176
|
+
const { sentinelA: h, longhands: m, compounds: $ } = i, b = i.needleA ?? h, x = Lt(
|
|
3177
3177
|
n,
|
|
3178
3178
|
h,
|
|
3179
3179
|
s,
|
|
@@ -3208,9 +3208,9 @@ function dn(e, t) {
|
|
|
3208
3208
|
break;
|
|
3209
3209
|
}
|
|
3210
3210
|
}
|
|
3211
|
-
|
|
3211
|
+
Pt(n, x);
|
|
3212
3212
|
} else {
|
|
3213
|
-
const { sentinelA: h, sentinelB: m, longhands: $, compounds: b } = i, x = [...$, ...b], f =
|
|
3213
|
+
const { sentinelA: h, sentinelB: m, longhands: $, compounds: b } = i, x = [...$, ...b], f = Lt(
|
|
3214
3214
|
n,
|
|
3215
3215
|
h,
|
|
3216
3216
|
s,
|
|
@@ -3220,9 +3220,9 @@ function dn(e, t) {
|
|
|
3220
3220
|
document.documentElement.offsetHeight;
|
|
3221
3221
|
const w = /* @__PURE__ */ new Map();
|
|
3222
3222
|
for (const E of c)
|
|
3223
|
-
w.set(E, Ge.map((N) =>
|
|
3224
|
-
|
|
3225
|
-
const C =
|
|
3223
|
+
w.set(E, Ge.map((N) => dn(E, N, x)));
|
|
3224
|
+
Pt(n, f);
|
|
3225
|
+
const C = Lt(
|
|
3226
3226
|
n,
|
|
3227
3227
|
m,
|
|
3228
3228
|
s,
|
|
@@ -3233,27 +3233,27 @@ function dn(e, t) {
|
|
|
3233
3233
|
for (const E of c) {
|
|
3234
3234
|
const N = w.get(E);
|
|
3235
3235
|
for (let v = 0; v < Ge.length; v++) {
|
|
3236
|
-
const g =
|
|
3237
|
-
if (
|
|
3236
|
+
const g = dn(E, Ge[v], x);
|
|
3237
|
+
if (ti(N[v], g) !== null) {
|
|
3238
3238
|
u.add(E);
|
|
3239
3239
|
break;
|
|
3240
3240
|
}
|
|
3241
3241
|
}
|
|
3242
3242
|
}
|
|
3243
|
-
|
|
3243
|
+
Pt(n, C);
|
|
3244
3244
|
}
|
|
3245
3245
|
const p = [];
|
|
3246
3246
|
for (const h of u) {
|
|
3247
3247
|
try {
|
|
3248
|
-
if (h.closest(
|
|
3248
|
+
if (h.closest(Gt) !== null) continue;
|
|
3249
3249
|
} catch {
|
|
3250
3250
|
}
|
|
3251
3251
|
p.push(h);
|
|
3252
3252
|
}
|
|
3253
3253
|
return { elements: p, warnings: o };
|
|
3254
3254
|
}
|
|
3255
|
-
const Te = 200,
|
|
3256
|
-
function
|
|
3255
|
+
const Te = 200, ni = 49;
|
|
3256
|
+
function pn(e, t) {
|
|
3257
3257
|
return {
|
|
3258
3258
|
position: "fixed",
|
|
3259
3259
|
top: `${e.top}px`,
|
|
@@ -3266,15 +3266,15 @@ function un(e, t) {
|
|
|
3266
3266
|
// box-shadow inset draws the same ring without relying on outline.
|
|
3267
3267
|
boxShadow: `inset 0 0 0 ${t.outlineWidth}px ${t.color}`,
|
|
3268
3268
|
pointerEvents: "none",
|
|
3269
|
-
zIndex: String(
|
|
3269
|
+
zIndex: String(ni),
|
|
3270
3270
|
boxSizing: "border-box"
|
|
3271
3271
|
};
|
|
3272
3272
|
}
|
|
3273
|
-
function
|
|
3273
|
+
function oi(e, t) {
|
|
3274
3274
|
for (const n of Object.keys(t))
|
|
3275
3275
|
e.style[n] = t[n];
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3277
|
+
function ri({ items: e }) {
|
|
3278
3278
|
const t = e.length > Te ? e.slice(0, Te) : e, n = le(!1);
|
|
3279
3279
|
e.length > Te && !n.current && (n.current = !0, console.warn(
|
|
3280
3280
|
`HighlightOverlay: received ${e.length} items (max ${Te}). Only the first ${Te} overlays will be rendered.`
|
|
@@ -3288,7 +3288,7 @@ function ni({ items: e }) {
|
|
|
3288
3288
|
const s = o.current[i];
|
|
3289
3289
|
if (!s) continue;
|
|
3290
3290
|
const d = t[i].element.getBoundingClientRect();
|
|
3291
|
-
|
|
3291
|
+
oi(s, pn(d, t[i].slot));
|
|
3292
3292
|
}
|
|
3293
3293
|
r = requestAnimationFrame(a);
|
|
3294
3294
|
}
|
|
@@ -3296,7 +3296,7 @@ function ni({ items: e }) {
|
|
|
3296
3296
|
cancelAnimationFrame(r);
|
|
3297
3297
|
};
|
|
3298
3298
|
}, [t]), t.length === 0 ? null : /* @__PURE__ */ l(re, { children: t.map((r, a) => {
|
|
3299
|
-
const i = r.element.getBoundingClientRect(), s =
|
|
3299
|
+
const i = r.element.getBoundingClientRect(), s = pn(i, r.slot);
|
|
3300
3300
|
return /* @__PURE__ */ l(
|
|
3301
3301
|
"div",
|
|
3302
3302
|
{
|
|
@@ -3311,7 +3311,7 @@ function ni({ items: e }) {
|
|
|
3311
3311
|
);
|
|
3312
3312
|
}) });
|
|
3313
3313
|
}
|
|
3314
|
-
function
|
|
3314
|
+
function co(e) {
|
|
3315
3315
|
const t = le(null), [, n] = we(0);
|
|
3316
3316
|
return se(() => {
|
|
3317
3317
|
function o() {
|
|
@@ -3330,7 +3330,7 @@ function lo(e) {
|
|
|
3330
3330
|
};
|
|
3331
3331
|
}, [e]), t.current;
|
|
3332
3332
|
}
|
|
3333
|
-
function
|
|
3333
|
+
function ai(e) {
|
|
3334
3334
|
if (e)
|
|
3335
3335
|
switch (e.kind) {
|
|
3336
3336
|
case "color":
|
|
@@ -3361,7 +3361,7 @@ function oi(e) {
|
|
|
3361
3361
|
return "mask-image";
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
3364
|
-
function
|
|
3364
|
+
function ii() {
|
|
3365
3365
|
const e = /* @__PURE__ */ new Map();
|
|
3366
3366
|
for (const t of Q().tabs)
|
|
3367
3367
|
for (const n of t.tiers)
|
|
@@ -3369,39 +3369,38 @@ function ri() {
|
|
|
3369
3369
|
e.set(o.cssVar, o.type);
|
|
3370
3370
|
return e;
|
|
3371
3371
|
}
|
|
3372
|
-
const
|
|
3373
|
-
function
|
|
3374
|
-
return e ? !
|
|
3372
|
+
const li = /* @__PURE__ */ new Set(["text", "cursor", "content", "mask-image"]);
|
|
3373
|
+
function si(e) {
|
|
3374
|
+
return e ? !li.has(e.kind) : !0;
|
|
3375
3375
|
}
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
return t ? Bt(/* @__PURE__ */ l(ni, { items: e }), t) : null;
|
|
3376
|
+
function ci({ items: e }) {
|
|
3377
|
+
const t = co(lo);
|
|
3378
|
+
return t ? Bt(/* @__PURE__ */ l(ri, { items: e }), t) : null;
|
|
3380
3379
|
}
|
|
3381
|
-
function
|
|
3382
|
-
const [t, n] = we(
|
|
3380
|
+
function di({ children: e }) {
|
|
3381
|
+
const [t, n] = we(Fa), [o, r] = we(0), [a, i] = we(0), s = le(/* @__PURE__ */ new Map()), d = G((x) => {
|
|
3383
3382
|
n((f) => {
|
|
3384
|
-
const w =
|
|
3383
|
+
const w = Oa(f, x);
|
|
3385
3384
|
return Oe(w), w;
|
|
3386
3385
|
});
|
|
3387
3386
|
}, []), c = G((x, f) => {
|
|
3388
3387
|
n((w) => {
|
|
3389
|
-
const C =
|
|
3388
|
+
const C = Ha(w, x, f);
|
|
3390
3389
|
return Oe(C), C;
|
|
3391
3390
|
});
|
|
3392
3391
|
}, []), u = G((x) => {
|
|
3393
3392
|
n((f) => {
|
|
3394
|
-
const w =
|
|
3393
|
+
const w = Ba(f, x);
|
|
3395
3394
|
return Oe(w), w;
|
|
3396
3395
|
});
|
|
3397
3396
|
}, []), p = G(() => {
|
|
3398
3397
|
n((x) => {
|
|
3399
|
-
const f =
|
|
3398
|
+
const f = Da(x);
|
|
3400
3399
|
return Oe(f), f;
|
|
3401
3400
|
});
|
|
3402
3401
|
}, []), h = G(() => {
|
|
3403
3402
|
n((x) => {
|
|
3404
|
-
const f =
|
|
3403
|
+
const f = Va(x);
|
|
3405
3404
|
return Oe(f), f;
|
|
3406
3405
|
});
|
|
3407
3406
|
}, []);
|
|
@@ -3411,12 +3410,12 @@ function ci({ children: e }) {
|
|
|
3411
3410
|
x && x.disconnect(), x = new MutationObserver((C) => {
|
|
3412
3411
|
for (const E of C) {
|
|
3413
3412
|
for (const N of E.addedNodes)
|
|
3414
|
-
if (
|
|
3413
|
+
if (fn(N)) {
|
|
3415
3414
|
r((v) => v + 1);
|
|
3416
3415
|
return;
|
|
3417
3416
|
}
|
|
3418
3417
|
for (const N of E.removedNodes)
|
|
3419
|
-
if (
|
|
3418
|
+
if (fn(N)) {
|
|
3420
3419
|
r((v) => v + 1);
|
|
3421
3420
|
return;
|
|
3422
3421
|
}
|
|
@@ -3440,22 +3439,22 @@ function ci({ children: e }) {
|
|
|
3440
3439
|
attributeFilter: ["data-theme", "class"]
|
|
3441
3440
|
}), () => x.disconnect();
|
|
3442
3441
|
}, []);
|
|
3443
|
-
const { items: m, matchCounts: $ } =
|
|
3444
|
-
const x =
|
|
3442
|
+
const { items: m, matchCounts: $ } = ot(() => {
|
|
3443
|
+
const x = ii();
|
|
3445
3444
|
function f(E) {
|
|
3446
3445
|
const N = `${E}|${o}|${a}`, v = s.current.get(N);
|
|
3447
3446
|
if (v) return v;
|
|
3448
|
-
const g = x.get(E), _ =
|
|
3447
|
+
const g = x.get(E), _ = ai(g), S = _ ? { kind: _ } : {}, B = un(E, S);
|
|
3449
3448
|
let K, Y;
|
|
3450
|
-
if (
|
|
3451
|
-
const pe =
|
|
3449
|
+
if (si(g)) {
|
|
3450
|
+
const pe = un(E, { ...S, mode: "differential" }), oe = new Set(B.elements);
|
|
3452
3451
|
for (const he of pe.elements) oe.add(he);
|
|
3453
3452
|
K = Array.from(oe);
|
|
3454
|
-
const ye = new Set(
|
|
3453
|
+
const ye = new Set(B.warnings);
|
|
3455
3454
|
for (const he of pe.warnings) ye.add(he);
|
|
3456
3455
|
Y = Array.from(ye);
|
|
3457
3456
|
} else
|
|
3458
|
-
K =
|
|
3457
|
+
K = B.elements, Y = B.warnings;
|
|
3459
3458
|
const ee = { elements: K, warnings: Y };
|
|
3460
3459
|
return s.current.set(N, ee), ee;
|
|
3461
3460
|
}
|
|
@@ -3473,38 +3472,38 @@ function ci({ children: e }) {
|
|
|
3473
3472
|
w.push({ element: S, slot: { color: _.color, outlineWidth: t.outlineWidth } });
|
|
3474
3473
|
}
|
|
3475
3474
|
return { items: w, matchCounts: C };
|
|
3476
|
-
}, [t.active, t.slots, t.outlineWidth, o, a]), b =
|
|
3475
|
+
}, [t.active, t.slots, t.outlineWidth, o, a]), b = ot(
|
|
3477
3476
|
() => ({ state: t, toggle: d, setSlot: c, setOutlineWidth: u, reset: p, disableAll: h, matchCounts: $ }),
|
|
3478
3477
|
[t, d, c, u, p, h, $]
|
|
3479
3478
|
);
|
|
3480
3479
|
return /* @__PURE__ */ k(re, { children: [
|
|
3481
|
-
/* @__PURE__ */ l(
|
|
3482
|
-
/* @__PURE__ */ l(
|
|
3480
|
+
/* @__PURE__ */ l(qt.Provider, { value: b, children: e }),
|
|
3481
|
+
/* @__PURE__ */ l(ci, { items: m })
|
|
3483
3482
|
] });
|
|
3484
3483
|
}
|
|
3485
|
-
function
|
|
3484
|
+
function fn(e) {
|
|
3486
3485
|
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
3487
3486
|
const t = e;
|
|
3488
3487
|
return t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
3489
3488
|
}
|
|
3490
|
-
const
|
|
3491
|
-
function
|
|
3489
|
+
const uo = Ht(null);
|
|
3490
|
+
function po() {
|
|
3492
3491
|
return `${Q().storagePrefix}-elpath-enabled`;
|
|
3493
3492
|
}
|
|
3494
|
-
function
|
|
3493
|
+
function ui() {
|
|
3495
3494
|
try {
|
|
3496
|
-
return localStorage.getItem(
|
|
3495
|
+
return localStorage.getItem(po()) === "1";
|
|
3497
3496
|
} catch {
|
|
3498
3497
|
return !1;
|
|
3499
3498
|
}
|
|
3500
3499
|
}
|
|
3501
|
-
function
|
|
3500
|
+
function hn(e) {
|
|
3502
3501
|
try {
|
|
3503
|
-
localStorage.setItem(
|
|
3502
|
+
localStorage.setItem(po(), e ? "1" : "0");
|
|
3504
3503
|
} catch {
|
|
3505
3504
|
}
|
|
3506
3505
|
}
|
|
3507
|
-
const
|
|
3506
|
+
const gn = 60, kn = 8, pi = [
|
|
3508
3507
|
"id",
|
|
3509
3508
|
"data-testid",
|
|
3510
3509
|
"data-test",
|
|
@@ -3516,7 +3515,7 @@ const hn = 60, gn = 8, ui = [
|
|
|
3516
3515
|
"alt",
|
|
3517
3516
|
"placeholder",
|
|
3518
3517
|
"title"
|
|
3519
|
-
],
|
|
3518
|
+
], fi = 5, hi = {
|
|
3520
3519
|
nav: "navigation",
|
|
3521
3520
|
main: "main",
|
|
3522
3521
|
header: "banner",
|
|
@@ -3540,7 +3539,7 @@ const hn = 60, gn = 8, ui = [
|
|
|
3540
3539
|
h5: "heading",
|
|
3541
3540
|
h6: "heading"
|
|
3542
3541
|
};
|
|
3543
|
-
function
|
|
3542
|
+
function Dt(e) {
|
|
3544
3543
|
if (typeof CSS < "u" && typeof CSS.escape == "function")
|
|
3545
3544
|
return CSS.escape(e);
|
|
3546
3545
|
let t = "";
|
|
@@ -3550,7 +3549,7 @@ function kn(e) {
|
|
|
3550
3549
|
}
|
|
3551
3550
|
return t;
|
|
3552
3551
|
}
|
|
3553
|
-
function
|
|
3552
|
+
function fo(e) {
|
|
3554
3553
|
const t = (e.getAttribute("class") ?? "").trim();
|
|
3555
3554
|
return t ? t.split(/\s+/).filter((n) => n.length > 0).filter((n) => !/__|^sc-|^css-[a-z0-9]{4,}/i.test(n)).filter((n) => !(/[a-z][0-9]|[0-9][a-z]/i.test(n) && n.length >= 6)) : [];
|
|
3556
3555
|
}
|
|
@@ -3564,20 +3563,20 @@ function Ue(e, t) {
|
|
|
3564
3563
|
return !1;
|
|
3565
3564
|
}
|
|
3566
3565
|
}
|
|
3567
|
-
function
|
|
3566
|
+
function gi(e) {
|
|
3568
3567
|
const t = e.parentElement;
|
|
3569
3568
|
if (!t) return "";
|
|
3570
3569
|
const n = e.tagName, o = Array.from(t.children).filter((a) => a.tagName === n);
|
|
3571
3570
|
return o.length <= 1 ? "" : `:nth-of-type(${o.indexOf(e) + 1})`;
|
|
3572
3571
|
}
|
|
3573
|
-
function gi(e) {
|
|
3574
|
-
return e.localName + hi(e);
|
|
3575
|
-
}
|
|
3576
3572
|
function ki(e) {
|
|
3573
|
+
return e.localName + gi(e);
|
|
3574
|
+
}
|
|
3575
|
+
function mi(e) {
|
|
3577
3576
|
if (e.tagName === "HTML") return "html";
|
|
3578
3577
|
const t = e.getAttribute("id");
|
|
3579
3578
|
if (t) {
|
|
3580
|
-
const r = `#${
|
|
3579
|
+
const r = `#${Dt(t)}`;
|
|
3581
3580
|
if (Ue(r, e)) return r;
|
|
3582
3581
|
}
|
|
3583
3582
|
const n = [];
|
|
@@ -3585,7 +3584,7 @@ function ki(e) {
|
|
|
3585
3584
|
for (; o && o.nodeType === 1 && o.tagName !== "HTML"; ) {
|
|
3586
3585
|
const r = o.getAttribute("id");
|
|
3587
3586
|
if (r) {
|
|
3588
|
-
const i = `#${
|
|
3587
|
+
const i = `#${Dt(r)}`;
|
|
3589
3588
|
if (Ue(i, o)) {
|
|
3590
3589
|
n.unshift(i);
|
|
3591
3590
|
const s = n.join(" > ");
|
|
@@ -3594,23 +3593,23 @@ function ki(e) {
|
|
|
3594
3593
|
continue;
|
|
3595
3594
|
}
|
|
3596
3595
|
}
|
|
3597
|
-
n.unshift(
|
|
3596
|
+
n.unshift(ki(o));
|
|
3598
3597
|
const a = n.join(" > ");
|
|
3599
3598
|
if (Ue(a, e)) return a;
|
|
3600
3599
|
o = o.parentElement;
|
|
3601
3600
|
}
|
|
3602
3601
|
return n.join(" > ");
|
|
3603
3602
|
}
|
|
3604
|
-
function
|
|
3603
|
+
function bi(e) {
|
|
3605
3604
|
const t = [];
|
|
3606
3605
|
let n = e;
|
|
3607
3606
|
for (; n && n.nodeType === 1 && n.tagName !== "HTML"; ) {
|
|
3608
|
-
const o = n.localName, r =
|
|
3607
|
+
const o = n.localName, r = fo(n)[0];
|
|
3609
3608
|
t.unshift(r ? `${o}.${r}` : o), n = n.parentElement;
|
|
3610
3609
|
}
|
|
3611
|
-
return t.length >
|
|
3610
|
+
return t.length > kn ? "… > " + t.slice(-kn).join(" > ") : t.join(" > ");
|
|
3612
3611
|
}
|
|
3613
|
-
function
|
|
3612
|
+
function vi(e) {
|
|
3614
3613
|
const t = e.getAttribute("role");
|
|
3615
3614
|
if (t && t.trim()) return t.trim();
|
|
3616
3615
|
const n = e.tagName.toLowerCase();
|
|
@@ -3620,16 +3619,16 @@ function bi(e) {
|
|
|
3620
3619
|
const o = (e.getAttribute("type") ?? "text").toLowerCase();
|
|
3621
3620
|
return o === "checkbox" ? "checkbox" : o === "radio" ? "radio" : o === "button" || o === "submit" || o === "reset" ? "button" : o === "range" ? "slider" : o === "hidden" ? null : "textbox";
|
|
3622
3621
|
}
|
|
3623
|
-
return
|
|
3622
|
+
return hi[n] ?? null;
|
|
3624
3623
|
}
|
|
3625
|
-
function
|
|
3624
|
+
function wi(e) {
|
|
3626
3625
|
const t = (e.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
3627
|
-
return t ? t.length <=
|
|
3626
|
+
return t ? t.length <= gn ? t : t.slice(0, gn - 1).trimEnd() + "…" : null;
|
|
3628
3627
|
}
|
|
3629
|
-
function
|
|
3628
|
+
function xi(e) {
|
|
3630
3629
|
const t = [];
|
|
3631
|
-
for (const n of
|
|
3632
|
-
if (t.length >=
|
|
3630
|
+
for (const n of pi) {
|
|
3631
|
+
if (t.length >= fi) break;
|
|
3633
3632
|
const o = e.getAttribute(n);
|
|
3634
3633
|
if (o === null) continue;
|
|
3635
3634
|
const r = o.replace(/\s+/g, " ").trim();
|
|
@@ -3639,38 +3638,38 @@ function wi(e) {
|
|
|
3639
3638
|
}
|
|
3640
3639
|
return t;
|
|
3641
3640
|
}
|
|
3642
|
-
function
|
|
3643
|
-
const t = e.localName, n = e.getAttribute("id"), o =
|
|
3641
|
+
function Vt(e) {
|
|
3642
|
+
const t = e.localName, n = e.getAttribute("id"), o = fo(e).slice(0, 2);
|
|
3644
3643
|
let r = t;
|
|
3645
|
-
n && (r += `#${n}`);
|
|
3644
|
+
n && (r += `#${Dt(n)}`);
|
|
3646
3645
|
for (const a of o) r += `.${a}`;
|
|
3647
3646
|
return r;
|
|
3648
3647
|
}
|
|
3649
|
-
function
|
|
3648
|
+
function yi(e) {
|
|
3650
3649
|
let t = { width: 0, height: 0 };
|
|
3651
3650
|
if (typeof e.getBoundingClientRect == "function") {
|
|
3652
3651
|
const n = e.getBoundingClientRect();
|
|
3653
3652
|
t = { width: Math.round(n.width), height: Math.round(n.height) };
|
|
3654
3653
|
}
|
|
3655
3654
|
return {
|
|
3656
|
-
summary:
|
|
3657
|
-
selector:
|
|
3658
|
-
breadcrumb:
|
|
3659
|
-
role:
|
|
3660
|
-
text:
|
|
3661
|
-
attrs:
|
|
3655
|
+
summary: Vt(e),
|
|
3656
|
+
selector: mi(e),
|
|
3657
|
+
breadcrumb: bi(e),
|
|
3658
|
+
role: vi(e),
|
|
3659
|
+
text: wi(e),
|
|
3660
|
+
attrs: xi(e),
|
|
3662
3661
|
size: t
|
|
3663
3662
|
};
|
|
3664
3663
|
}
|
|
3665
|
-
function
|
|
3664
|
+
function Ni(e) {
|
|
3666
3665
|
const t = [];
|
|
3667
3666
|
return t.push(`element: ${e.summary}`), t.push(`selector: ${e.selector}`), t.push(`path: ${e.breadcrumb}`), e.role && t.push(`role: ${e.role}`), e.text && t.push(`text: "${e.text}"`), e.attrs.length > 0 && t.push(`attrs: ${e.attrs.join(", ")}`), t.push(`size: ${e.size.width} × ${e.size.height}`), t.join(`
|
|
3668
3667
|
`);
|
|
3669
3668
|
}
|
|
3670
|
-
function
|
|
3671
|
-
return yi(
|
|
3669
|
+
function _i(e) {
|
|
3670
|
+
return Ni(yi(e));
|
|
3672
3671
|
}
|
|
3673
|
-
async function
|
|
3672
|
+
async function $i(e, t) {
|
|
3674
3673
|
try {
|
|
3675
3674
|
if (typeof navigator < "u" && navigator.clipboard?.writeText)
|
|
3676
3675
|
return await navigator.clipboard.writeText(e), !0;
|
|
@@ -3688,57 +3687,73 @@ async function _i(e, t) {
|
|
|
3688
3687
|
return !1;
|
|
3689
3688
|
}
|
|
3690
3689
|
}
|
|
3691
|
-
|
|
3692
|
-
|
|
3690
|
+
const Ci = 2147483001;
|
|
3691
|
+
function Ei({ message: e, ok: t }) {
|
|
3692
|
+
return e === null ? null : /* @__PURE__ */ l(
|
|
3693
3693
|
"div",
|
|
3694
3694
|
{
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3695
|
+
style: {
|
|
3696
|
+
position: "fixed",
|
|
3697
|
+
top: 0,
|
|
3698
|
+
left: 0,
|
|
3699
|
+
right: 0,
|
|
3700
|
+
zIndex: Ci,
|
|
3701
|
+
display: "flex",
|
|
3702
|
+
justifyContent: "center",
|
|
3703
|
+
pointerEvents: "none"
|
|
3704
|
+
},
|
|
3705
|
+
children: /* @__PURE__ */ k(
|
|
3706
|
+
"div",
|
|
3707
|
+
{
|
|
3708
|
+
className: t ? "tokenpanel-elpath-toast" : "tokenpanel-elpath-toast is-error",
|
|
3709
|
+
"aria-hidden": "true",
|
|
3710
|
+
children: [
|
|
3711
|
+
/* @__PURE__ */ l(
|
|
3712
|
+
"svg",
|
|
3713
|
+
{
|
|
3714
|
+
width: "14",
|
|
3715
|
+
height: "14",
|
|
3716
|
+
viewBox: "0 0 24 24",
|
|
3717
|
+
fill: "none",
|
|
3718
|
+
stroke: "currentColor",
|
|
3719
|
+
strokeWidth: "2",
|
|
3720
|
+
strokeLinecap: "round",
|
|
3721
|
+
strokeLinejoin: "round",
|
|
3722
|
+
"aria-hidden": "true",
|
|
3723
|
+
children: t ? /* @__PURE__ */ l("path", { d: "M20 6 9 17l-5-5" }) : /* @__PURE__ */ k(re, { children: [
|
|
3724
|
+
/* @__PURE__ */ l("circle", { cx: "12", cy: "12", r: "10" }),
|
|
3725
|
+
/* @__PURE__ */ l("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
3726
|
+
/* @__PURE__ */ l("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
3727
|
+
] })
|
|
3728
|
+
}
|
|
3729
|
+
),
|
|
3730
|
+
/* @__PURE__ */ l("span", { className: "tokenpanel-elpath-toast-text", children: e })
|
|
3731
|
+
]
|
|
3732
|
+
}
|
|
3733
|
+
)
|
|
3719
3734
|
}
|
|
3720
3735
|
);
|
|
3721
3736
|
}
|
|
3722
|
-
const mn = 2147483e3,
|
|
3723
|
-
function
|
|
3737
|
+
const mn = 2147483e3, Si = 2200, bn = 2;
|
|
3738
|
+
function Ti(e) {
|
|
3724
3739
|
try {
|
|
3725
|
-
return e.closest(
|
|
3740
|
+
return e.closest(Gt) !== null;
|
|
3726
3741
|
} catch {
|
|
3727
3742
|
return !1;
|
|
3728
3743
|
}
|
|
3729
3744
|
}
|
|
3730
|
-
function
|
|
3745
|
+
function Mi({ enabled: e }) {
|
|
3731
3746
|
const [t, n] = we(!1), [o, r] = we(null), [a, i] = we(null), s = le(!1);
|
|
3732
3747
|
s.current = t;
|
|
3733
3748
|
const d = le(null);
|
|
3734
3749
|
d.current = o;
|
|
3735
3750
|
const c = le(null), u = le(null), p = le(null), h = le(0), m = le(null), $ = G(async (w) => {
|
|
3736
|
-
const C =
|
|
3751
|
+
const C = _i(w), E = await $i(C);
|
|
3737
3752
|
h.current += 1, i({
|
|
3738
|
-
message: E ? `Copied path: ${
|
|
3753
|
+
message: E ? `Copied path: ${Vt(w)}` : "Copy failed — clipboard unavailable",
|
|
3739
3754
|
ok: E,
|
|
3740
3755
|
key: h.current
|
|
3741
|
-
}), p.current && clearTimeout(p.current), p.current = setTimeout(() => i(null),
|
|
3756
|
+
}), p.current && clearTimeout(p.current), p.current = setTimeout(() => i(null), Si);
|
|
3742
3757
|
}, []);
|
|
3743
3758
|
se(() => {
|
|
3744
3759
|
e || (n(!1), r(null));
|
|
@@ -3746,7 +3761,7 @@ function Ti({ enabled: e }) {
|
|
|
3746
3761
|
if (!e) return;
|
|
3747
3762
|
function w(g, _) {
|
|
3748
3763
|
const S = document.elementFromPoint(g, _);
|
|
3749
|
-
r(!S ||
|
|
3764
|
+
r(!S || Ti(S) ? null : S);
|
|
3750
3765
|
}
|
|
3751
3766
|
function C(g) {
|
|
3752
3767
|
m.current = { x: g.clientX, y: g.clientY }, s.current && w(g.clientX, g.clientY);
|
|
@@ -3764,8 +3779,8 @@ function Ti({ enabled: e }) {
|
|
|
3764
3779
|
function v() {
|
|
3765
3780
|
n(!1), r(null);
|
|
3766
3781
|
}
|
|
3767
|
-
return document.addEventListener("mousemove", C, !0), window.addEventListener("keydown", E, !0), window.addEventListener("keyup", N, !0), window.addEventListener("blur", v), () => {
|
|
3768
|
-
document.removeEventListener("mousemove", C
|
|
3782
|
+
return document.addEventListener("mousemove", C, { passive: !0 }), window.addEventListener("keydown", E, !0), window.addEventListener("keyup", N, !0), window.addEventListener("blur", v), () => {
|
|
3783
|
+
document.removeEventListener("mousemove", C), window.removeEventListener("keydown", E, !0), window.removeEventListener("keyup", N, !0), window.removeEventListener("blur", v);
|
|
3769
3784
|
};
|
|
3770
3785
|
}, [e]), se(() => {
|
|
3771
3786
|
if (!e || !t) return;
|
|
@@ -3810,7 +3825,10 @@ function Ti({ enabled: e }) {
|
|
|
3810
3825
|
}, [t, o]), se(() => () => {
|
|
3811
3826
|
p.current && clearTimeout(p.current);
|
|
3812
3827
|
}, []);
|
|
3813
|
-
const b = e && t && o !== null, x =
|
|
3828
|
+
const b = e && t && o !== null, x = ot(
|
|
3829
|
+
() => b && o ? Vt(o) : "",
|
|
3830
|
+
[b, o]
|
|
3831
|
+
), f = b && o ? o.getBoundingClientRect() : null;
|
|
3814
3832
|
return /* @__PURE__ */ k(re, { children: [
|
|
3815
3833
|
/* @__PURE__ */ l(
|
|
3816
3834
|
"div",
|
|
@@ -3872,48 +3890,32 @@ function Ti({ enabled: e }) {
|
|
|
3872
3890
|
}
|
|
3873
3891
|
)
|
|
3874
3892
|
] }),
|
|
3875
|
-
a && /* @__PURE__ */ l(
|
|
3876
|
-
"div",
|
|
3877
|
-
{
|
|
3878
|
-
style: {
|
|
3879
|
-
position: "fixed",
|
|
3880
|
-
top: 0,
|
|
3881
|
-
left: 0,
|
|
3882
|
-
right: 0,
|
|
3883
|
-
zIndex: Ci,
|
|
3884
|
-
display: "flex",
|
|
3885
|
-
justifyContent: "center",
|
|
3886
|
-
pointerEvents: "none"
|
|
3887
|
-
},
|
|
3888
|
-
children: /* @__PURE__ */ l($i, { message: a.message, ok: a.ok }, a.key)
|
|
3889
|
-
}
|
|
3890
|
-
)
|
|
3893
|
+
a && /* @__PURE__ */ l(Ei, { message: a.message, ok: a.ok }, a.key)
|
|
3891
3894
|
] });
|
|
3892
3895
|
}
|
|
3893
|
-
const Mi = "tokenpanel-elpath-mount";
|
|
3894
3896
|
function Ai({ enabled: e }) {
|
|
3895
|
-
const t =
|
|
3896
|
-
return t ? Bt(/* @__PURE__ */ l(
|
|
3897
|
+
const t = co(so);
|
|
3898
|
+
return t ? Bt(/* @__PURE__ */ l(Mi, { enabled: e }), t) : null;
|
|
3897
3899
|
}
|
|
3898
3900
|
function Li({ children: e }) {
|
|
3899
|
-
const [t, n] = we(
|
|
3900
|
-
n(i),
|
|
3901
|
+
const [t, n] = we(ui), o = G((i) => {
|
|
3902
|
+
n(i), hn(i);
|
|
3901
3903
|
}, []), r = G(() => {
|
|
3902
3904
|
n((i) => {
|
|
3903
3905
|
const s = !i;
|
|
3904
|
-
return
|
|
3906
|
+
return hn(s), s;
|
|
3905
3907
|
});
|
|
3906
|
-
}, []), a =
|
|
3908
|
+
}, []), a = ot(
|
|
3907
3909
|
() => ({ enabled: t, setEnabled: o, toggle: r }),
|
|
3908
3910
|
[t, o, r]
|
|
3909
3911
|
);
|
|
3910
3912
|
return /* @__PURE__ */ k(re, { children: [
|
|
3911
|
-
/* @__PURE__ */ l(
|
|
3913
|
+
/* @__PURE__ */ l(uo.Provider, { value: a, children: e }),
|
|
3912
3914
|
/* @__PURE__ */ l(Ai, { enabled: t })
|
|
3913
3915
|
] });
|
|
3914
3916
|
}
|
|
3915
3917
|
function Pi() {
|
|
3916
|
-
const e =
|
|
3918
|
+
const e = Ft(uo);
|
|
3917
3919
|
if (e === null) return null;
|
|
3918
3920
|
const { enabled: t, toggle: n } = e;
|
|
3919
3921
|
return /* @__PURE__ */ l(
|
|
@@ -3949,7 +3951,7 @@ function Pi() {
|
|
|
3949
3951
|
}
|
|
3950
3952
|
);
|
|
3951
3953
|
}
|
|
3952
|
-
const
|
|
3954
|
+
const ho = Ht(null);
|
|
3953
3955
|
function Ii({ state: e }) {
|
|
3954
3956
|
const t = le(null);
|
|
3955
3957
|
return se(() => {
|
|
@@ -3993,13 +3995,13 @@ function Ri({ children: e }) {
|
|
|
3993
3995
|
o.current && i();
|
|
3994
3996
|
}
|
|
3995
3997
|
return window.addEventListener("scroll", s, !0), () => window.removeEventListener("scroll", s, !0);
|
|
3996
|
-
}, [i]), /* @__PURE__ */ k(
|
|
3998
|
+
}, [i]), /* @__PURE__ */ k(ho.Provider, { value: { show: r, hide: a }, children: [
|
|
3997
3999
|
e,
|
|
3998
4000
|
typeof document < "u" && Bt(/* @__PURE__ */ l(Ii, { state: t }), document.body)
|
|
3999
4001
|
] });
|
|
4000
4002
|
}
|
|
4001
|
-
function
|
|
4002
|
-
const t =
|
|
4003
|
+
function Ut(e) {
|
|
4004
|
+
const t = Ft(ho), n = G(
|
|
4003
4005
|
(i) => {
|
|
4004
4006
|
t && t.show(i.currentTarget, e);
|
|
4005
4007
|
},
|
|
@@ -4067,7 +4069,7 @@ const vn = je(function({
|
|
|
4067
4069
|
n(o, m);
|
|
4068
4070
|
},
|
|
4069
4071
|
[n, o]
|
|
4070
|
-
), p = z(() => s((m) => !m), []), h =
|
|
4072
|
+
), p = z(() => s((m) => !m), []), h = Ut(`${r}: ${t}`);
|
|
4071
4073
|
return /* @__PURE__ */ k("div", { className: "tokenpanel-color-swatch-wrap", children: [
|
|
4072
4074
|
/* @__PURE__ */ l(
|
|
4073
4075
|
"div",
|
|
@@ -4114,7 +4116,7 @@ const vn = je(function({
|
|
|
4114
4116
|
}) {
|
|
4115
4117
|
const p = a ?? ((v) => `--zd-p${v}`), [h, m] = j(!1), $ = O(null), b = O(null), x = z(() => m(!1), []), f = z(() => m((v) => !v), []), w = o === "bg" ? d ?? "#000000" : o === "fg" ? c ?? "#ffffff" : r[o] ?? "#000000", C = o === "bg" ? "bg" : o === "fg" ? "fg" : `p${o}`;
|
|
4116
4118
|
zi($, x, h);
|
|
4117
|
-
const E =
|
|
4119
|
+
const E = Ut(`${t}: ${C}`);
|
|
4118
4120
|
function N(v) {
|
|
4119
4121
|
i(n, v), m(!1);
|
|
4120
4122
|
}
|
|
@@ -4220,7 +4222,7 @@ function Di({
|
|
|
4220
4222
|
secondaryState: r,
|
|
4221
4223
|
persistSecondary: a
|
|
4222
4224
|
}) {
|
|
4223
|
-
const i = Z(() =>
|
|
4225
|
+
const i = Z(() => nn(e), [e]), s = Z(
|
|
4224
4226
|
() => i ?? {
|
|
4225
4227
|
id: "stub",
|
|
4226
4228
|
paletteSize: 0,
|
|
@@ -4235,7 +4237,7 @@ function Di({
|
|
|
4235
4237
|
},
|
|
4236
4238
|
[i]
|
|
4237
4239
|
), d = Z(
|
|
4238
|
-
() => o ?
|
|
4240
|
+
() => o ? nn(o) ?? null : null,
|
|
4239
4241
|
[o]
|
|
4240
4242
|
), c = Q().colorPresets ?? {}, u = Z(
|
|
4241
4243
|
() => ({ ...c, ...s.colorSchemes }),
|
|
@@ -4250,7 +4252,7 @@ function Di({
|
|
|
4250
4252
|
(g, _) => {
|
|
4251
4253
|
n((S) => ({
|
|
4252
4254
|
...S,
|
|
4253
|
-
palette: S.palette.map((
|
|
4255
|
+
palette: S.palette.map((B, K) => K === g ? _ : B)
|
|
4254
4256
|
}));
|
|
4255
4257
|
},
|
|
4256
4258
|
[n]
|
|
@@ -4258,7 +4260,7 @@ function Di({
|
|
|
4258
4260
|
(g, _) => {
|
|
4259
4261
|
a((S) => S && {
|
|
4260
4262
|
...S,
|
|
4261
|
-
palette: S.palette.map((
|
|
4263
|
+
palette: S.palette.map((B, K) => K === g ? _ : B)
|
|
4262
4264
|
});
|
|
4263
4265
|
},
|
|
4264
4266
|
[a]
|
|
@@ -4288,7 +4290,7 @@ function Di({
|
|
|
4288
4290
|
const _ = u[g];
|
|
4289
4291
|
if (!_) return;
|
|
4290
4292
|
const S = $n(_);
|
|
4291
|
-
n(() => S),
|
|
4293
|
+
n(() => S), So(S.shikiTheme);
|
|
4292
4294
|
},
|
|
4293
4295
|
[n]
|
|
4294
4296
|
);
|
|
@@ -4454,11 +4456,11 @@ function Vi(e) {
|
|
|
4454
4456
|
function xn(e, t) {
|
|
4455
4457
|
return e.tiers.find((n) => n.id === t);
|
|
4456
4458
|
}
|
|
4457
|
-
function
|
|
4459
|
+
function Hi(e, t) {
|
|
4458
4460
|
return e.items.find((n) => n.id === t);
|
|
4459
4461
|
}
|
|
4460
|
-
function
|
|
4461
|
-
const s = xn(e, t)?.referencesTier ?? "", d = s ? xn(e, s) : void 0, c = d?.items ?? [], u = d &&
|
|
4462
|
+
function Bi({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueFor: a }) {
|
|
4463
|
+
const s = xn(e, t)?.referencesTier ?? "", d = s ? xn(e, s) : void 0, c = d?.items ?? [], u = d && Hi(d, o) ? o : c[0]?.id ?? "";
|
|
4462
4464
|
return /* @__PURE__ */ l("div", { className: "tokenpanel-tier-ref-selector", children: /* @__PURE__ */ k(
|
|
4463
4465
|
"select",
|
|
4464
4466
|
{
|
|
@@ -4483,9 +4485,9 @@ function Hi({ tab: e, tierId: t, itemId: n, value: o, onChange: r, previewValueF
|
|
|
4483
4485
|
}
|
|
4484
4486
|
) });
|
|
4485
4487
|
}
|
|
4486
|
-
const
|
|
4488
|
+
const pt = je(Bi);
|
|
4487
4489
|
function Fi({ cssVar: e, label: t, className: n }) {
|
|
4488
|
-
const o =
|
|
4490
|
+
const o = Ut(e);
|
|
4489
4491
|
return /* @__PURE__ */ k("span", { className: n ?? "tokenpanel-row-label", ...o, children: [
|
|
4490
4492
|
e,
|
|
4491
4493
|
t && t !== e && /* @__PURE__ */ l("span", { className: "tokenpanel-row-label-sub", children: t })
|
|
@@ -4634,7 +4636,7 @@ function ji({ item: e, value: t, onChange: n }) {
|
|
|
4634
4636
|
return null;
|
|
4635
4637
|
}
|
|
4636
4638
|
}
|
|
4637
|
-
const
|
|
4639
|
+
const Jt = je(ji);
|
|
4638
4640
|
function Ki({ tab: e, state: t, persistFont: n }) {
|
|
4639
4641
|
const o = z(
|
|
4640
4642
|
(a, i) => {
|
|
@@ -4699,7 +4701,7 @@ function Wi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4699
4701
|
children: [
|
|
4700
4702
|
/* @__PURE__ */ l(de, { cssVar: a.cssVar, label: a.label }),
|
|
4701
4703
|
/* @__PURE__ */ l(
|
|
4702
|
-
|
|
4704
|
+
pt,
|
|
4703
4705
|
{
|
|
4704
4706
|
tab: e,
|
|
4705
4707
|
tierId: t.id,
|
|
@@ -4719,7 +4721,7 @@ function Wi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4719
4721
|
},
|
|
4720
4722
|
a.id
|
|
4721
4723
|
) : /* @__PURE__ */ l(
|
|
4722
|
-
|
|
4724
|
+
Jt,
|
|
4723
4725
|
{
|
|
4724
4726
|
item: a,
|
|
4725
4727
|
value: i,
|
|
@@ -4794,7 +4796,7 @@ function Yi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4794
4796
|
children: [
|
|
4795
4797
|
/* @__PURE__ */ l(de, { cssVar: a.cssVar, label: a.label }),
|
|
4796
4798
|
/* @__PURE__ */ l(
|
|
4797
|
-
|
|
4799
|
+
pt,
|
|
4798
4800
|
{
|
|
4799
4801
|
tab: e,
|
|
4800
4802
|
tierId: t.id,
|
|
@@ -4814,7 +4816,7 @@ function Yi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4814
4816
|
},
|
|
4815
4817
|
a.id
|
|
4816
4818
|
) : /* @__PURE__ */ l(
|
|
4817
|
-
|
|
4819
|
+
Jt,
|
|
4818
4820
|
{
|
|
4819
4821
|
item: a,
|
|
4820
4822
|
value: i,
|
|
@@ -4889,7 +4891,7 @@ function Gi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4889
4891
|
children: [
|
|
4890
4892
|
/* @__PURE__ */ l(de, { cssVar: a.cssVar, label: a.label }),
|
|
4891
4893
|
/* @__PURE__ */ l(
|
|
4892
|
-
|
|
4894
|
+
pt,
|
|
4893
4895
|
{
|
|
4894
4896
|
tab: e,
|
|
4895
4897
|
tierId: t.id,
|
|
@@ -4909,7 +4911,7 @@ function Gi({ tab: e, tier: t, state: n, onChange: o }) {
|
|
|
4909
4911
|
},
|
|
4910
4912
|
a.id
|
|
4911
4913
|
) : /* @__PURE__ */ l(
|
|
4912
|
-
|
|
4914
|
+
Jt,
|
|
4913
4915
|
{
|
|
4914
4916
|
item: a,
|
|
4915
4917
|
value: i,
|
|
@@ -4926,7 +4928,7 @@ function Ui({ tab: e, tier: t, item: n, value: o, overrides: r, onChange: a }) {
|
|
|
4926
4928
|
return /* @__PURE__ */ k("div", { className: "tokenpanel-row", "data-testid": `tier-ref-row-${n.id}`, children: [
|
|
4927
4929
|
/* @__PURE__ */ l(de, { cssVar: n.cssVar, label: n.label }),
|
|
4928
4930
|
/* @__PURE__ */ l(
|
|
4929
|
-
|
|
4931
|
+
pt,
|
|
4930
4932
|
{
|
|
4931
4933
|
tab: e,
|
|
4932
4934
|
tierId: t.id,
|
|
@@ -5202,20 +5204,20 @@ function nl(e, t, n) {
|
|
|
5202
5204
|
function Ze() {
|
|
5203
5205
|
return {
|
|
5204
5206
|
color: Qe(),
|
|
5205
|
-
spacing:
|
|
5206
|
-
typography:
|
|
5207
|
-
size:
|
|
5207
|
+
spacing: xt(),
|
|
5208
|
+
typography: xt(),
|
|
5209
|
+
size: xt(),
|
|
5208
5210
|
secondary: Sn()
|
|
5209
5211
|
};
|
|
5210
5212
|
}
|
|
5211
5213
|
function ol() {
|
|
5212
|
-
const e =
|
|
5214
|
+
const e = ct(), [t, n] = j(!1), [o, r] = j(!1), [a, i] = j(!1), [s, d] = j(!1), [c, u] = j(!1), p = O(null), [h, m] = j(null), [$, b] = j(tl), [x, f] = j(Zt), [w, C] = j(To), [E, N] = j(Mo), [v, g] = j(!1), _ = O(null), S = O({
|
|
5213
5215
|
spacing: null,
|
|
5214
5216
|
font: null,
|
|
5215
5217
|
size: null,
|
|
5216
5218
|
color: null
|
|
5217
|
-
}),
|
|
5218
|
-
|
|
5219
|
+
}), B = O(Zt);
|
|
5220
|
+
B.current = x;
|
|
5219
5221
|
const K = O(w);
|
|
5220
5222
|
K.current = w;
|
|
5221
5223
|
const Y = O(null), ee = O(null), { persistColor: pe, persistSpacing: oe, persistFont: ye, persistSize: he, persistSecondary: Se, persistTab: A } = Qi(m);
|
|
@@ -5224,13 +5226,13 @@ function ol() {
|
|
|
5224
5226
|
localStorage.getItem(Ve()) === "1" && n(!0);
|
|
5225
5227
|
} catch {
|
|
5226
5228
|
}
|
|
5227
|
-
const T =
|
|
5228
|
-
f(T),
|
|
5229
|
-
const
|
|
5230
|
-
C(
|
|
5229
|
+
const T = Ao();
|
|
5230
|
+
f(T), B.current = T;
|
|
5231
|
+
const H = Lo();
|
|
5232
|
+
C(H), K.current = H, N(Po()), g(window.innerWidth < De);
|
|
5231
5233
|
}, []);
|
|
5232
5234
|
const D = z((T) => {
|
|
5233
|
-
N(T),
|
|
5235
|
+
N(T), Io(T);
|
|
5234
5236
|
}, []);
|
|
5235
5237
|
X(() => {
|
|
5236
5238
|
try {
|
|
@@ -5245,8 +5247,8 @@ function ol() {
|
|
|
5245
5247
|
}
|
|
5246
5248
|
}, [t]), X(() => {
|
|
5247
5249
|
if (!t) return;
|
|
5248
|
-
function T(
|
|
5249
|
-
|
|
5250
|
+
function T(H) {
|
|
5251
|
+
H.key === "Escape" && (o || a || s || (H.preventDefault(), n(!1)));
|
|
5250
5252
|
}
|
|
5251
5253
|
return document.addEventListener("keydown", T), () => {
|
|
5252
5254
|
document.removeEventListener("keydown", T);
|
|
@@ -5263,7 +5265,7 @@ function ol() {
|
|
|
5263
5265
|
};
|
|
5264
5266
|
}, []), X(() => {
|
|
5265
5267
|
function T() {
|
|
5266
|
-
|
|
5268
|
+
bt(), m(Ze());
|
|
5267
5269
|
}
|
|
5268
5270
|
return window.addEventListener("color-scheme-changed", T), () => window.removeEventListener("color-scheme-changed", T);
|
|
5269
5271
|
}, []), X(() => {
|
|
@@ -5278,20 +5280,20 @@ function ol() {
|
|
|
5278
5280
|
const te = z((T) => {
|
|
5279
5281
|
if (window.innerWidth < De || T.target.closest("button, select, option, [role='tab'], [role='button']")) return;
|
|
5280
5282
|
T.preventDefault();
|
|
5281
|
-
const V = T.clientX, U = T.clientY, I =
|
|
5283
|
+
const V = T.clientX, U = T.clientY, I = B.current.left, q = B.current.top, fe = _.current?.offsetWidth ?? 600;
|
|
5282
5284
|
_.current?.offsetHeight;
|
|
5283
5285
|
function ae(ve) {
|
|
5284
|
-
const Ne = ve.clientX - V,
|
|
5285
|
-
q +
|
|
5286
|
+
const Ne = ve.clientX - V, No = ve.clientY - U, mt = wt(
|
|
5287
|
+
q + No,
|
|
5286
5288
|
I + Ne,
|
|
5287
5289
|
fe
|
|
5288
5290
|
);
|
|
5289
|
-
_.current && (_.current.style.top = `${
|
|
5291
|
+
_.current && (_.current.style.top = `${mt.top}px`, _.current.style.left = `${mt.left}px`), B.current = mt;
|
|
5290
5292
|
}
|
|
5291
5293
|
function ce() {
|
|
5292
5294
|
document.removeEventListener("mousemove", ae), document.removeEventListener("mouseup", ce), Y.current = null;
|
|
5293
|
-
const ve =
|
|
5294
|
-
f(ve),
|
|
5295
|
+
const ve = B.current;
|
|
5296
|
+
f(ve), vt(ve);
|
|
5295
5297
|
}
|
|
5296
5298
|
document.addEventListener("mousemove", ae), document.addEventListener("mouseup", ce), Y.current = () => {
|
|
5297
5299
|
document.removeEventListener("mousemove", ae), document.removeEventListener("mouseup", ce);
|
|
@@ -5299,22 +5301,22 @@ function ol() {
|
|
|
5299
5301
|
}, []), be = z((T) => {
|
|
5300
5302
|
if (window.innerWidth < De) return;
|
|
5301
5303
|
T.preventDefault(), T.stopPropagation();
|
|
5302
|
-
const
|
|
5304
|
+
const H = T.clientX, V = T.clientY, U = K.current.width, I = K.current.height;
|
|
5303
5305
|
function q(ae) {
|
|
5304
|
-
const ce = ae.clientX -
|
|
5306
|
+
const ce = ae.clientX - H, ve = ae.clientY - V, Ne = tn(U + ce, I + ve);
|
|
5305
5307
|
_.current && (_.current.style.width = `${Ne.width}px`, _.current.style.height = `${Ne.height}px`), K.current = Ne;
|
|
5306
5308
|
}
|
|
5307
5309
|
function fe() {
|
|
5308
5310
|
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", fe), ee.current = null;
|
|
5309
5311
|
const ae = K.current;
|
|
5310
|
-
C(ae),
|
|
5311
|
-
const ce =
|
|
5312
|
-
|
|
5313
|
-
|
|
5312
|
+
C(ae), en(ae);
|
|
5313
|
+
const ce = wt(
|
|
5314
|
+
B.current.top,
|
|
5315
|
+
B.current.left,
|
|
5314
5316
|
ae.width,
|
|
5315
5317
|
ae.height
|
|
5316
5318
|
);
|
|
5317
|
-
(ce.top !==
|
|
5319
|
+
(ce.top !== B.current.top || ce.left !== B.current.left) && (f(ce), vt(ce));
|
|
5318
5320
|
}
|
|
5319
5321
|
document.addEventListener("mousemove", q), document.addEventListener("mouseup", fe), ee.current = () => {
|
|
5320
5322
|
document.removeEventListener("mousemove", q), document.removeEventListener("mouseup", fe);
|
|
@@ -5325,13 +5327,13 @@ function ol() {
|
|
|
5325
5327
|
}, []), X(() => {
|
|
5326
5328
|
function T() {
|
|
5327
5329
|
g(window.innerWidth < De), C((V) => {
|
|
5328
|
-
const U =
|
|
5329
|
-
return (U.width !== V.width || U.height !== V.height) &&
|
|
5330
|
+
const U = tn(V.width, V.height);
|
|
5331
|
+
return (U.width !== V.width || U.height !== V.height) && en(U), U;
|
|
5330
5332
|
});
|
|
5331
|
-
const
|
|
5333
|
+
const H = _.current?.offsetWidth ?? 600;
|
|
5332
5334
|
_.current?.offsetHeight, f((V) => {
|
|
5333
|
-
const U =
|
|
5334
|
-
return
|
|
5335
|
+
const U = wt(V.top, V.left, H);
|
|
5336
|
+
return vt(U), U;
|
|
5335
5337
|
});
|
|
5336
5338
|
}
|
|
5337
5339
|
return window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
@@ -5339,20 +5341,20 @@ function ol() {
|
|
|
5339
5341
|
const Ie = z((T) => {
|
|
5340
5342
|
nt(T), Cn(T), m(T);
|
|
5341
5343
|
}, []), y = z(() => {
|
|
5342
|
-
|
|
5344
|
+
Qt(), bt(), m(Ze());
|
|
5343
5345
|
}, []), R = z(() => {
|
|
5344
|
-
|
|
5346
|
+
Qt(), bt(), m(Ze());
|
|
5345
5347
|
}, []), J = Z(() => Q().tabs.map((T) => ({ id: T.id, label: T.label })), []), F = Z(() => {
|
|
5346
5348
|
const T = {};
|
|
5347
|
-
for (const
|
|
5348
|
-
T[
|
|
5349
|
+
for (const H of Q().tabs)
|
|
5350
|
+
T[H.id] = H;
|
|
5349
5351
|
return T;
|
|
5350
5352
|
}, []), W = z(
|
|
5351
5353
|
(T) => {
|
|
5352
|
-
const
|
|
5353
|
-
if (
|
|
5354
|
+
const H = J.findIndex((I) => I.id === $);
|
|
5355
|
+
if (H === -1) return;
|
|
5354
5356
|
let V = null;
|
|
5355
|
-
if (T.key === "ArrowRight" ? V = (
|
|
5357
|
+
if (T.key === "ArrowRight" ? V = (H + 1) % J.length : T.key === "ArrowLeft" ? V = (H - 1 + J.length) % J.length : T.key === "Home" ? V = 0 : T.key === "End" && (V = J.length - 1), V === null) return;
|
|
5356
5358
|
T.preventDefault();
|
|
5357
5359
|
const U = J[V];
|
|
5358
5360
|
b(U.id), window.requestAnimationFrame(() => {
|
|
@@ -5361,10 +5363,10 @@ function ol() {
|
|
|
5361
5363
|
},
|
|
5362
5364
|
[$, J]
|
|
5363
5365
|
);
|
|
5364
|
-
return /* @__PURE__ */ l(
|
|
5366
|
+
return /* @__PURE__ */ l(di, { children: /* @__PURE__ */ l(Li, { children: /* @__PURE__ */ l(Ri, { children: t && (() => {
|
|
5365
5367
|
const {
|
|
5366
5368
|
width: T,
|
|
5367
|
-
height:
|
|
5369
|
+
height: H,
|
|
5368
5370
|
narrow: V
|
|
5369
5371
|
} = nl(
|
|
5370
5372
|
typeof window < "u" ? window.innerWidth : 1024,
|
|
@@ -5386,12 +5388,12 @@ function ol() {
|
|
|
5386
5388
|
style: {
|
|
5387
5389
|
...U,
|
|
5388
5390
|
width: T,
|
|
5389
|
-
height:
|
|
5391
|
+
height: H,
|
|
5390
5392
|
maxHeight: "calc(100vh - 32px)",
|
|
5391
5393
|
// `--tokenpanel-grid-min` is read by .tokenpanel-tab-grid /
|
|
5392
5394
|
// .tokenpanel-tab-advanced-grid; switching the variable rewires the
|
|
5393
5395
|
// min-card-width without re-rendering the grids.
|
|
5394
|
-
"--tokenpanel-grid-min":
|
|
5396
|
+
"--tokenpanel-grid-min": Ro(E)
|
|
5395
5397
|
},
|
|
5396
5398
|
children: [
|
|
5397
5399
|
/* @__PURE__ */ k(
|
|
@@ -5631,7 +5633,7 @@ function ol() {
|
|
|
5631
5633
|
}
|
|
5632
5634
|
),
|
|
5633
5635
|
o && h && /* @__PURE__ */ l(
|
|
5634
|
-
|
|
5636
|
+
er,
|
|
5635
5637
|
{
|
|
5636
5638
|
onClose: () => r(!1),
|
|
5637
5639
|
state: h,
|
|
@@ -5639,7 +5641,7 @@ function ol() {
|
|
|
5639
5641
|
}
|
|
5640
5642
|
),
|
|
5641
5643
|
a && h && /* @__PURE__ */ l(
|
|
5642
|
-
|
|
5644
|
+
tr,
|
|
5643
5645
|
{
|
|
5644
5646
|
onClose: () => i(!1),
|
|
5645
5647
|
onLoad: Ie,
|
|
@@ -5647,7 +5649,7 @@ function ol() {
|
|
|
5647
5649
|
}
|
|
5648
5650
|
),
|
|
5649
5651
|
s && h && /* @__PURE__ */ l(
|
|
5650
|
-
|
|
5652
|
+
sr,
|
|
5651
5653
|
{
|
|
5652
5654
|
state: h,
|
|
5653
5655
|
open: s,
|
|
@@ -5657,7 +5659,7 @@ function ol() {
|
|
|
5657
5659
|
}
|
|
5658
5660
|
),
|
|
5659
5661
|
c && /* @__PURE__ */ l(
|
|
5660
|
-
|
|
5662
|
+
Ra,
|
|
5661
5663
|
{
|
|
5662
5664
|
anchorRef: p,
|
|
5663
5665
|
onClose: () => u(!1)
|
|
@@ -5691,28 +5693,28 @@ function Sl(e) {
|
|
|
5691
5693
|
function Tl(e) {
|
|
5692
5694
|
return e.kind === "color";
|
|
5693
5695
|
}
|
|
5694
|
-
function
|
|
5695
|
-
return
|
|
5696
|
+
function go() {
|
|
5697
|
+
return jo(Q());
|
|
5696
5698
|
}
|
|
5697
|
-
function
|
|
5699
|
+
function ko() {
|
|
5698
5700
|
return Tn(Q());
|
|
5699
5701
|
}
|
|
5700
|
-
const al = "toggle-design-token-panel", il = "toggle-color-tweak-panel",
|
|
5701
|
-
function
|
|
5702
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
5702
|
+
const al = "toggle-design-token-panel", il = "toggle-color-tweak-panel", mo = "__zdtp:open-state-changed";
|
|
5703
|
+
function ft() {
|
|
5704
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(mo));
|
|
5703
5705
|
}
|
|
5704
|
-
const Ml =
|
|
5705
|
-
function
|
|
5706
|
+
const Ml = mo;
|
|
5707
|
+
function ht(e) {
|
|
5706
5708
|
if (!(typeof window > "u"))
|
|
5707
5709
|
try {
|
|
5708
|
-
window.localStorage.setItem(
|
|
5710
|
+
window.localStorage.setItem(ko(), e ? "1" : "0");
|
|
5709
5711
|
} catch {
|
|
5710
5712
|
}
|
|
5711
5713
|
}
|
|
5712
|
-
function
|
|
5714
|
+
function bo() {
|
|
5713
5715
|
if (typeof window > "u") return !1;
|
|
5714
5716
|
try {
|
|
5715
|
-
return window.localStorage.getItem(
|
|
5717
|
+
return window.localStorage.getItem(ko()) === "1";
|
|
5716
5718
|
} catch {
|
|
5717
5719
|
return !1;
|
|
5718
5720
|
}
|
|
@@ -5721,12 +5723,12 @@ function ll() {
|
|
|
5721
5723
|
if (typeof window > "u") return !1;
|
|
5722
5724
|
try {
|
|
5723
5725
|
const e = window.localStorage;
|
|
5724
|
-
return e.getItem(
|
|
5726
|
+
return e.getItem(zo()) !== null || e.getItem(Oo()) !== null;
|
|
5725
5727
|
} catch {
|
|
5726
5728
|
return !1;
|
|
5727
5729
|
}
|
|
5728
5730
|
}
|
|
5729
|
-
function
|
|
5731
|
+
function vo() {
|
|
5730
5732
|
if (typeof window > "u") return !1;
|
|
5731
5733
|
try {
|
|
5732
5734
|
return window.localStorage.getItem(Ve()) === "1";
|
|
@@ -5734,7 +5736,7 @@ function mo() {
|
|
|
5734
5736
|
return !1;
|
|
5735
5737
|
}
|
|
5736
5738
|
}
|
|
5737
|
-
function
|
|
5739
|
+
function gt(e) {
|
|
5738
5740
|
if (!(typeof window > "u"))
|
|
5739
5741
|
try {
|
|
5740
5742
|
const t = Ve();
|
|
@@ -5743,7 +5745,7 @@ function ht(e) {
|
|
|
5743
5745
|
}
|
|
5744
5746
|
}
|
|
5745
5747
|
function We() {
|
|
5746
|
-
return typeof document > "u" ? null : document.getElementById(
|
|
5748
|
+
return typeof document > "u" ? null : document.getElementById(go());
|
|
5747
5749
|
}
|
|
5748
5750
|
const yn = "zudo-design-token-panel-styles";
|
|
5749
5751
|
function sl() {
|
|
@@ -5751,9 +5753,9 @@ function sl() {
|
|
|
5751
5753
|
const e = document.createElement("style");
|
|
5752
5754
|
e.id = yn, e.textContent = rl, document.head.appendChild(e);
|
|
5753
5755
|
}
|
|
5754
|
-
function
|
|
5756
|
+
function kt() {
|
|
5755
5757
|
if (typeof document > "u") return !1;
|
|
5756
|
-
const e =
|
|
5758
|
+
const e = go();
|
|
5757
5759
|
if (document.getElementById(e)) return !1;
|
|
5758
5760
|
sl();
|
|
5759
5761
|
const t = document.createElement("div");
|
|
@@ -5765,19 +5767,19 @@ function Al() {
|
|
|
5765
5767
|
function cl() {
|
|
5766
5768
|
if (typeof window > "u") return;
|
|
5767
5769
|
const e = !We();
|
|
5768
|
-
|
|
5770
|
+
gt(!0), kt(), ht(!0), !e && ft();
|
|
5769
5771
|
}
|
|
5770
5772
|
function dl() {
|
|
5771
5773
|
if (typeof window > "u") return;
|
|
5772
5774
|
const e = !We();
|
|
5773
|
-
|
|
5775
|
+
gt(!1), kt(), ht(!1), !e && ft();
|
|
5774
5776
|
}
|
|
5775
5777
|
function Ll() {
|
|
5776
5778
|
if (typeof window > "u") return;
|
|
5777
|
-
const e = !
|
|
5778
|
-
|
|
5779
|
+
const e = !vo(), t = !We();
|
|
5780
|
+
gt(e), kt(), ht(e), !t && ft();
|
|
5779
5781
|
}
|
|
5780
|
-
function
|
|
5782
|
+
function wo() {
|
|
5781
5783
|
if (!(typeof window > "u"))
|
|
5782
5784
|
try {
|
|
5783
5785
|
const e = En();
|
|
@@ -5785,20 +5787,20 @@ function bo() {
|
|
|
5785
5787
|
} catch {
|
|
5786
5788
|
}
|
|
5787
5789
|
}
|
|
5788
|
-
function
|
|
5790
|
+
function Be() {
|
|
5789
5791
|
const e = We();
|
|
5790
5792
|
if (!e) return;
|
|
5791
|
-
const t =
|
|
5792
|
-
_n(null, e), e.remove(), t &&
|
|
5793
|
+
const t = bo();
|
|
5794
|
+
_n(null, e), e.remove(), t && ht(!0);
|
|
5793
5795
|
}
|
|
5794
5796
|
function Le() {
|
|
5795
|
-
|
|
5797
|
+
wo(), bo() ? cl() : ll() && dl();
|
|
5796
5798
|
}
|
|
5797
5799
|
function Nn() {
|
|
5798
|
-
const e = !We(), t = e ? !0 : !
|
|
5799
|
-
|
|
5800
|
+
const e = !We(), t = e ? !0 : !vo();
|
|
5801
|
+
gt(t), kt(), !e && ft();
|
|
5800
5802
|
}
|
|
5801
|
-
function
|
|
5803
|
+
function xo() {
|
|
5802
5804
|
const e = window;
|
|
5803
5805
|
if (e.__zudoDesignTokenPanelLifecycle) return e.__zudoDesignTokenPanelLifecycle;
|
|
5804
5806
|
const t = { bound: !1, cleanups: [], adapter: null };
|
|
@@ -5813,15 +5815,15 @@ function ul(e) {
|
|
|
5813
5815
|
} catch {
|
|
5814
5816
|
}
|
|
5815
5817
|
}
|
|
5816
|
-
function
|
|
5817
|
-
typeof document > "u" || (document.addEventListener("astro:before-swap",
|
|
5818
|
-
() => document.removeEventListener("astro:before-swap",
|
|
5818
|
+
function yo(e) {
|
|
5819
|
+
typeof document > "u" || (document.addEventListener("astro:before-swap", Be), document.addEventListener("astro:page-load", Le), e.cleanups.push(
|
|
5820
|
+
() => document.removeEventListener("astro:before-swap", Be),
|
|
5819
5821
|
() => document.removeEventListener("astro:page-load", Le)
|
|
5820
5822
|
));
|
|
5821
5823
|
}
|
|
5822
5824
|
function pl(e, t) {
|
|
5823
|
-
if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(
|
|
5824
|
-
() => document.removeEventListener("astro:before-swap",
|
|
5825
|
+
if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(Be)) : (document.addEventListener("astro:before-swap", Be), e.cleanups.push(
|
|
5826
|
+
() => document.removeEventListener("astro:before-swap", Be)
|
|
5825
5827
|
)), t.onPageLoad ? e.cleanups.push(t.onPageLoad(Le)) : (document.addEventListener("astro:page-load", Le), e.cleanups.push(
|
|
5826
5828
|
() => document.removeEventListener("astro:page-load", Le)
|
|
5827
5829
|
)), !t.onBeforeSwap || !t.onPageLoad)) {
|
|
@@ -5836,22 +5838,22 @@ function pl(e, t) {
|
|
|
5836
5838
|
}
|
|
5837
5839
|
function Pl(e) {
|
|
5838
5840
|
if (typeof window > "u") return;
|
|
5839
|
-
const t =
|
|
5840
|
-
ul(t), t.adapter = e, e ? pl(t, e) :
|
|
5841
|
+
const t = xo();
|
|
5842
|
+
ul(t), t.adapter = e, e ? pl(t, e) : yo(t);
|
|
5841
5843
|
}
|
|
5842
5844
|
const fl = () => {
|
|
5843
|
-
|
|
5845
|
+
wo(), Le();
|
|
5844
5846
|
};
|
|
5845
5847
|
if (typeof window < "u") {
|
|
5846
|
-
const e =
|
|
5847
|
-
e.bound || (e.bound = !0, window.addEventListener(al, Nn), window.addEventListener(il, Nn),
|
|
5848
|
+
const e = xo();
|
|
5849
|
+
e.bound || (e.bound = !0, window.addEventListener(al, Nn), window.addEventListener(il, Nn), yo(e), Fo(fl));
|
|
5848
5850
|
}
|
|
5849
5851
|
export {
|
|
5850
5852
|
zl as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
|
|
5851
5853
|
Ml as __OPEN_STATE_CHANGED_EVENT_FOR_TEST,
|
|
5852
5854
|
Al as __panelConfigForTest,
|
|
5853
5855
|
Dl as configurePanel,
|
|
5854
|
-
|
|
5856
|
+
xt as emptyOverrides,
|
|
5855
5857
|
dl as hideDesignTokenPanel,
|
|
5856
5858
|
Tl as isColorKind,
|
|
5857
5859
|
El as isContentKind,
|
|
@@ -5861,7 +5863,7 @@ export {
|
|
|
5861
5863
|
Nl as isNumberKind,
|
|
5862
5864
|
_l as isSelectKind,
|
|
5863
5865
|
$l as isTextKind,
|
|
5864
|
-
|
|
5866
|
+
wo as reapplyPersistedOverrides,
|
|
5865
5867
|
Pl as setLifecycleAdapter,
|
|
5866
5868
|
Vl as setPanelColorPresets,
|
|
5867
5869
|
cl as showDesignTokenPanel,
|