@takazudo/zdtp 0.3.1 → 0.3.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 +8 -0
- package/dist/astro/host-adapter.js +2 -2
- package/dist/astro/index.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +338 -326
- package/dist/{panel-config-BOyB8Egg.js → panel-config-066BPYJD.js} +2 -2
- package/dist/panel.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/{tweak-state-DMwBHPow.js → tweak-state-Do5gj6Nw.js} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as k, jsx as s, Fragment as ae } from "preact/jsx-runtime";
|
|
2
2
|
import { createContext as jt, render as Kt } from "preact";
|
|
3
|
-
import { useState as K, useRef as B, useMemo as Z, useEffect as X, useId as ht, useCallback as R, useLayoutEffect as
|
|
4
|
-
import { b as ge, i as
|
|
5
|
-
import { Z as
|
|
6
|
-
import { g as
|
|
7
|
-
import { c as
|
|
3
|
+
import { useState as K, useRef as B, useMemo as Z, useEffect as X, useId as ht, useCallback as R, useLayoutEffect as zo, useContext as Ro, createPortal as Wt, memo as Ge } from "preact/compat";
|
|
4
|
+
import { b as ge, i as Pn, s as Oo, r as Ue, e as Do, c as Vo, d as lt, f as In, D as ln, h as Bo, j as Ho, k as We, m as Fo, n as jo, o as Ko, p as Wo, l as zn, q as sn, t as cn, u as Rt, v as Xo, w as je, x as Yo, y as yt, z as dn, A as Nt, B as un, C as _t, E as qo, a as Go } from "./tweak-state-Do5gj6Nw.js";
|
|
5
|
+
import { Z as es } from "./tweak-state-Do5gj6Nw.js";
|
|
6
|
+
import { g as Y, k as ve, n as Uo, o as P, p as Jo, r as Zo, q as Qo, t as pn, a as Rn, u as On, v as er, w as tr, x as nr, D as or, y as Dn, z as rr } from "./panel-config-066BPYJD.js";
|
|
7
|
+
import { c as ns, s as os } from "./panel-config-066BPYJD.js";
|
|
8
8
|
import { c as ar } from "./color-schemes-CgzOBqGO.js";
|
|
9
9
|
import { r as ir } from "./route-tokens-to-files-1DvmWBdj.js";
|
|
10
|
-
import { useContext as Xt, useCallback as
|
|
11
|
-
function xe(e, t =
|
|
10
|
+
import { useContext as Xt, useCallback as q, useRef as de, useEffect as ue, useState as $e, useMemo as st } from "preact/hooks";
|
|
11
|
+
function xe(e, t = Y()) {
|
|
12
12
|
const n = t.tabs.find((r) => r.id === e);
|
|
13
13
|
if (!n) return [];
|
|
14
14
|
const o = [];
|
|
@@ -17,7 +17,7 @@ function xe(e, t = q()) {
|
|
|
17
17
|
o.push(a);
|
|
18
18
|
return o;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const Vn = /* @__PURE__ */ new Set([
|
|
21
21
|
"color",
|
|
22
22
|
"color-secondary",
|
|
23
23
|
"spacing",
|
|
@@ -41,20 +41,20 @@ function sr(e, t) {
|
|
|
41
41
|
return n;
|
|
42
42
|
}
|
|
43
43
|
const at = "zudo-design-tokens/v2", $t = "zudo-design-tokens/v1";
|
|
44
|
-
function
|
|
44
|
+
function Bn() {
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
47
|
-
function cr(e =
|
|
47
|
+
function cr(e = Y()) {
|
|
48
48
|
return e.schemaId;
|
|
49
49
|
}
|
|
50
|
-
class
|
|
50
|
+
class Pe extends Error {
|
|
51
51
|
reason;
|
|
52
52
|
actualSchema;
|
|
53
53
|
constructor(t, n, o) {
|
|
54
|
-
super(n), this.name = "DesignTokenSchemaError", this.reason = t, this.actualSchema = o, Object.setPrototypeOf(this,
|
|
54
|
+
super(n), this.name = "DesignTokenSchemaError", this.reason = t, this.actualSchema = o, Object.setPrototypeOf(this, Pe.prototype);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Hn(e, t = {}, n = Y()) {
|
|
58
58
|
const o = t.now ? t.now() : /* @__PURE__ */ new Date(), r = {
|
|
59
59
|
$schema: at,
|
|
60
60
|
exportedAt: o.toISOString()
|
|
@@ -67,7 +67,7 @@ function Bn(e, t = {}, n = q()) {
|
|
|
67
67
|
const d = Je(xe("size", n), e.size, t);
|
|
68
68
|
d && (a.size = d);
|
|
69
69
|
for (const u of n.tabs) {
|
|
70
|
-
if (
|
|
70
|
+
if (Vn.has(u.id)) continue;
|
|
71
71
|
const p = lr(e.tabs?.[u.id]), m = Je(xe(u.id, n), p, t);
|
|
72
72
|
m && (a[u.id] = m);
|
|
73
73
|
}
|
|
@@ -110,12 +110,12 @@ function Je(e, t, n) {
|
|
|
110
110
|
}
|
|
111
111
|
return a ? { raw: r } : void 0;
|
|
112
112
|
}
|
|
113
|
-
function ur(e, t = {}, n =
|
|
113
|
+
function ur(e, t = {}, n = Y()) {
|
|
114
114
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
115
|
-
throw new
|
|
115
|
+
throw new Pe("not-object", "Input is not a JSON object.");
|
|
116
116
|
const o = e, r = o.$schema;
|
|
117
117
|
if (r === void 0)
|
|
118
|
-
throw new
|
|
118
|
+
throw new Pe(
|
|
119
119
|
"schema-missing",
|
|
120
120
|
`Missing "$schema" key. Expected "${at}" or "${$t}".`
|
|
121
121
|
);
|
|
@@ -123,17 +123,17 @@ function ur(e, t = {}, n = q()) {
|
|
|
123
123
|
return pr(o, t, n);
|
|
124
124
|
if (r === $t)
|
|
125
125
|
return hr(o, t, n);
|
|
126
|
-
throw new
|
|
126
|
+
throw new Pe(
|
|
127
127
|
"schema-mismatch",
|
|
128
128
|
`Unsupported "$schema" value: ${JSON.stringify(r)}. Expected "${at}" or "${$t}".`,
|
|
129
129
|
r
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
function pr(e, t, n) {
|
|
133
|
-
const o = [], r = [], a = t.colorDefaults ??
|
|
133
|
+
const o = [], r = [], a = t.colorDefaults ?? Fn(n), i = ge(n), l = e.tabs && typeof e.tabs == "object" && !Array.isArray(e.tabs) ? e.tabs : {}, c = l.color, d = fr(c, a, i, o), u = l.spacing, p = u && typeof u == "object" ? u.raw : void 0, m = Ct(p, xe("spacing", n), "spacing", r, o), h = l.font, v = h && typeof h == "object" ? h.raw : void 0, C = Ct(v, xe("font", n), "font.raw", r, o), b = l.size, N = b && typeof b == "object" ? b.raw : void 0, g = Ct(N, xe("size", n), "size", r, o);
|
|
134
134
|
let y;
|
|
135
135
|
for (const w of n.tabs) {
|
|
136
|
-
if (
|
|
136
|
+
if (Vn.has(w.id)) continue;
|
|
137
137
|
const _ = l[w.id], x = _ && typeof _ == "object" && !Array.isArray(_) ? _.raw : void 0;
|
|
138
138
|
if (!x || typeof x != "object" || Array.isArray(x)) continue;
|
|
139
139
|
const f = sr(w.id, n), E = {};
|
|
@@ -198,7 +198,7 @@ function fr(e, t, n, o) {
|
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
function Ct(e, t, n, o, r) {
|
|
201
|
-
if (!e || typeof e != "object") return
|
|
201
|
+
if (!e || typeof e != "object") return Bn();
|
|
202
202
|
const a = /* @__PURE__ */ new Map();
|
|
203
203
|
for (const l of t)
|
|
204
204
|
l.readonly || a.set(l.cssVar, l);
|
|
@@ -218,7 +218,7 @@ function Ct(e, t, n, o, r) {
|
|
|
218
218
|
return i;
|
|
219
219
|
}
|
|
220
220
|
function hr(e, t, n) {
|
|
221
|
-
const o = [], r = [], a = t.colorDefaults ??
|
|
221
|
+
const o = [], r = [], a = t.colorDefaults ?? Fn(n), i = gr(e.color, a, o), l = Et(e.spacing, xe("spacing", n), "spacing", r, o), c = Et(e.typography, xe("font", n), "typography", r, o), d = Et(e.size, xe("size", n), "size", r, o);
|
|
222
222
|
return {
|
|
223
223
|
state: { color: i, spacing: l, typography: c, size: d },
|
|
224
224
|
unknownTokens: r,
|
|
@@ -266,7 +266,7 @@ function gr(e, t, n) {
|
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
268
|
function Et(e, t, n, o, r) {
|
|
269
|
-
if (!e || typeof e != "object") return
|
|
269
|
+
if (!e || typeof e != "object") return Bn();
|
|
270
270
|
const a = /* @__PURE__ */ new Map();
|
|
271
271
|
for (const l of t)
|
|
272
272
|
l.readonly || a.set(l.cssVar, l);
|
|
@@ -288,7 +288,7 @@ function Et(e, t, n, o, r) {
|
|
|
288
288
|
function Ve(e, t) {
|
|
289
289
|
return typeof e == "number" && Number.isFinite(e) ? e : t;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Fn(e = Y()) {
|
|
292
292
|
const t = ge(e), n = t && t.paletteSize > 0 ? t.paletteSize : 16, o = n - 1, r = Array.from({ length: n }, (i, l) => l === 0 ? "#000000" : l === o ? "#ffffff" : "#808080"), a = (i) => Math.min(Math.max(i, 0), o);
|
|
293
293
|
return {
|
|
294
294
|
palette: r,
|
|
@@ -304,11 +304,11 @@ function Hn(e = q()) {
|
|
|
304
304
|
function kr(e, t) {
|
|
305
305
|
if (t) return t;
|
|
306
306
|
const n = Object.values(ar)[0];
|
|
307
|
-
return n ?
|
|
307
|
+
return n ? Pn(n) : e;
|
|
308
308
|
}
|
|
309
309
|
function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
310
|
-
const [r, a] = K("Copy"), [i, l] = K(!1), c = B(null), d = B(null), u = B(null), p = o ??
|
|
311
|
-
const g = kr(t.color, n), y =
|
|
310
|
+
const [r, a] = K("Copy"), [i, l] = K(!1), c = B(null), d = B(null), u = B(null), p = o ?? Y(), m = Uo(p), h = Z(() => {
|
|
311
|
+
const g = kr(t.color, n), y = Hn(
|
|
312
312
|
t,
|
|
313
313
|
{
|
|
314
314
|
includeDefaults: i,
|
|
@@ -366,17 +366,17 @@ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
366
366
|
ref: c,
|
|
367
367
|
onClick: v,
|
|
368
368
|
"aria-labelledby": N,
|
|
369
|
-
className: `${
|
|
369
|
+
className: `${P(p, "")} ${P(p, "--export")}`,
|
|
370
370
|
"data-design-token-panel-modal": "",
|
|
371
371
|
"data-design-token-panel-modal-variant": "export",
|
|
372
372
|
children: [
|
|
373
|
-
/* @__PURE__ */ s("div", { id: N, role: "heading", "aria-level": 2, className:
|
|
374
|
-
/* @__PURE__ */ k("div", { className:
|
|
373
|
+
/* @__PURE__ */ s("div", { id: N, role: "heading", "aria-level": 2, className: P(p, "__title"), children: "Export Design Tokens" }),
|
|
374
|
+
/* @__PURE__ */ k("div", { className: P(p, "__hint"), children: [
|
|
375
375
|
"Save as ",
|
|
376
376
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: m }),
|
|
377
377
|
" to feed this blob back into the panel (or hand to an AI assistant)."
|
|
378
378
|
] }),
|
|
379
|
-
/* @__PURE__ */ k("label", { className:
|
|
379
|
+
/* @__PURE__ */ k("label", { className: P(p, "__toggle"), children: [
|
|
380
380
|
/* @__PURE__ */ s(
|
|
381
381
|
"input",
|
|
382
382
|
{
|
|
@@ -387,8 +387,8 @@ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
387
387
|
),
|
|
388
388
|
"Show defaults too"
|
|
389
389
|
] }),
|
|
390
|
-
/* @__PURE__ */ s("div", { role: "none", className:
|
|
391
|
-
/* @__PURE__ */ k("div", { className:
|
|
390
|
+
/* @__PURE__ */ s("div", { role: "none", className: P(p, "__json"), children: h }),
|
|
391
|
+
/* @__PURE__ */ k("div", { className: P(p, "__actions"), children: [
|
|
392
392
|
/* @__PURE__ */ s(
|
|
393
393
|
"div",
|
|
394
394
|
{
|
|
@@ -399,7 +399,7 @@ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
399
399
|
onKeyDown: (g) => {
|
|
400
400
|
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), C());
|
|
401
401
|
},
|
|
402
|
-
className: `${
|
|
402
|
+
className: `${P(p, "__button")} ${P(p, "__button--primary")}`,
|
|
403
403
|
children: r
|
|
404
404
|
}
|
|
405
405
|
),
|
|
@@ -412,7 +412,7 @@ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
412
412
|
onKeyDown: (g) => {
|
|
413
413
|
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), c.current?.close());
|
|
414
414
|
},
|
|
415
|
-
className:
|
|
415
|
+
className: P(p, "__button"),
|
|
416
416
|
children: "Close"
|
|
417
417
|
}
|
|
418
418
|
)
|
|
@@ -422,7 +422,7 @@ function mr({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
422
422
|
);
|
|
423
423
|
}
|
|
424
424
|
function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
425
|
-
const [r, a] = K(""), [i, l] = K(null), c = B(null), d = B(null), u = o ??
|
|
425
|
+
const [r, a] = K(""), [i, l] = K(null), c = B(null), d = B(null), u = o ?? Y(), p = cr(u);
|
|
426
426
|
X(() => {
|
|
427
427
|
const b = c.current;
|
|
428
428
|
if (b)
|
|
@@ -477,7 +477,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
477
477
|
console.groupEnd();
|
|
478
478
|
}
|
|
479
479
|
w.length > 0 && console.warn("[design-token-serde] warnings:", w), t(g);
|
|
480
|
-
const _ = Object.keys(g.spacing).length + Object.keys(g.typography).length + Object.keys(g.size).length, x =
|
|
480
|
+
const _ = Object.keys(g.spacing).length + Object.keys(g.typography).length + Object.keys(g.size).length, x = Jo(g.color, n);
|
|
481
481
|
_ === 0 && x && y.length > 0 ? l({
|
|
482
482
|
kind: "error",
|
|
483
483
|
text: `Nothing applied — all ${y.length} token${y.length === 1 ? "" : "s"} in the payload were unknown. See console for the list.`
|
|
@@ -486,7 +486,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
486
486
|
text: `Loaded. ${y.length} unknown token${y.length === 1 ? "" : "s"} ignored — see console for the list.`
|
|
487
487
|
}) : l({ kind: "info", text: "Loaded." });
|
|
488
488
|
} catch (g) {
|
|
489
|
-
if (g instanceof
|
|
489
|
+
if (g instanceof Pe) {
|
|
490
490
|
g.reason === "schema-mismatch" ? l({
|
|
491
491
|
kind: "error",
|
|
492
492
|
text: `Schema mismatch: this panel expects "${p}".`
|
|
@@ -507,12 +507,12 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
507
507
|
ref: c,
|
|
508
508
|
onClick: m,
|
|
509
509
|
"aria-labelledby": C,
|
|
510
|
-
className: `${
|
|
510
|
+
className: `${P(u, "")} ${P(u, "--import")}`,
|
|
511
511
|
"data-design-token-panel-modal": "",
|
|
512
512
|
"data-design-token-panel-modal-variant": "import",
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */ s("div", { id: C, role: "heading", "aria-level": 2, className:
|
|
515
|
-
/* @__PURE__ */ k("div", { className:
|
|
514
|
+
/* @__PURE__ */ s("div", { id: C, role: "heading", "aria-level": 2, className: P(u, "__title"), children: "Load Design Tokens" }),
|
|
515
|
+
/* @__PURE__ */ k("div", { className: P(u, "__hint"), children: [
|
|
516
516
|
"Paste a ",
|
|
517
517
|
/* @__PURE__ */ s("span", { className: "tokenpanel-code", children: p }),
|
|
518
518
|
" JSON blob. Unknown tokens are ignored; schema mismatch aborts the load."
|
|
@@ -524,7 +524,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
524
524
|
value: r,
|
|
525
525
|
onChange: (b) => a(b.currentTarget.value),
|
|
526
526
|
spellcheck: !1,
|
|
527
|
-
className:
|
|
527
|
+
className: P(u, "__textarea"),
|
|
528
528
|
placeholder: `{ "$schema": "${p}", ... }`
|
|
529
529
|
}
|
|
530
530
|
),
|
|
@@ -532,11 +532,11 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
532
532
|
"div",
|
|
533
533
|
{
|
|
534
534
|
role: i.kind === "error" ? "alert" : "status",
|
|
535
|
-
className: `${
|
|
535
|
+
className: `${P(u, "__status")} ${P(u, `__status--${i.kind}`)}`,
|
|
536
536
|
children: i.text
|
|
537
537
|
}
|
|
538
538
|
),
|
|
539
|
-
/* @__PURE__ */ k("div", { className:
|
|
539
|
+
/* @__PURE__ */ k("div", { className: P(u, "__actions"), children: [
|
|
540
540
|
/* @__PURE__ */ s(
|
|
541
541
|
"div",
|
|
542
542
|
{
|
|
@@ -546,7 +546,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
546
546
|
onKeyDown: (b) => {
|
|
547
547
|
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), h());
|
|
548
548
|
},
|
|
549
|
-
className: `${
|
|
549
|
+
className: `${P(u, "__button")} ${P(u, "__button--primary")}`,
|
|
550
550
|
children: "Load"
|
|
551
551
|
}
|
|
552
552
|
),
|
|
@@ -559,7 +559,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
559
559
|
onKeyDown: (b) => {
|
|
560
560
|
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), c.current?.close());
|
|
561
561
|
},
|
|
562
|
-
className:
|
|
562
|
+
className: P(u, "__button"),
|
|
563
563
|
children: "Close"
|
|
564
564
|
}
|
|
565
565
|
)
|
|
@@ -568,7 +568,7 @@ function br({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
568
568
|
}
|
|
569
569
|
);
|
|
570
570
|
}
|
|
571
|
-
function fn(e, t, n = ge(), o =
|
|
571
|
+
function fn(e, t, n = ge(), o = Y().tabs) {
|
|
572
572
|
const r = {}, a = e.color, i = a.palette.length;
|
|
573
573
|
for (let c = 0; c < i; c++) {
|
|
574
574
|
const d = a.palette[c];
|
|
@@ -583,7 +583,7 @@ function fn(e, t, n = ge(), o = q().tabs) {
|
|
|
583
583
|
if (!(t === void 0 || u !== p)) continue;
|
|
584
584
|
const h = wr(u, a);
|
|
585
585
|
if (h === null) continue;
|
|
586
|
-
const v =
|
|
586
|
+
const v = Oo(h, a.palette.length);
|
|
587
587
|
v !== h && console.error(
|
|
588
588
|
`[design-token-panel] paletteIndex ${h} for ${d} is out of range (palette length ${a.palette.length}); clamping to ${v}.`
|
|
589
589
|
), r[d] = `var(${ve(n, v)})`;
|
|
@@ -617,7 +617,7 @@ function vr(e, t, n) {
|
|
|
617
617
|
if (!(typeof i != "string" || i.length === 0))
|
|
618
618
|
try {
|
|
619
619
|
const l = Ue(e, r.id, a.id, o);
|
|
620
|
-
n[a.cssVar] =
|
|
620
|
+
n[a.cssVar] = Do(l);
|
|
621
621
|
} catch {
|
|
622
622
|
}
|
|
623
623
|
}
|
|
@@ -627,7 +627,7 @@ function wr(e, t) {
|
|
|
627
627
|
}
|
|
628
628
|
const xr = 2e3, St = { kind: "preview" };
|
|
629
629
|
function yr(e, t, n) {
|
|
630
|
-
return JSON.stringify(
|
|
630
|
+
return JSON.stringify(Hn(e, { colorDefaults: t }, n), null, 2);
|
|
631
631
|
}
|
|
632
632
|
function Nr(e) {
|
|
633
633
|
if (Array.isArray(e.updated)) return e.updated;
|
|
@@ -644,28 +644,28 @@ function Nr(e) {
|
|
|
644
644
|
}
|
|
645
645
|
function _r(e) {
|
|
646
646
|
return {
|
|
647
|
-
dialog: `${
|
|
648
|
-
header:
|
|
649
|
-
title:
|
|
650
|
-
closeButton:
|
|
651
|
-
hint:
|
|
652
|
-
sectionHeading:
|
|
653
|
-
list:
|
|
654
|
-
listItem:
|
|
655
|
-
actions:
|
|
656
|
-
primaryButton: `${
|
|
657
|
-
neutralButton:
|
|
658
|
-
statusWarning: `${
|
|
659
|
-
statusSuccess: `${
|
|
660
|
-
statusError: `${
|
|
661
|
-
applying:
|
|
662
|
-
spinner:
|
|
663
|
-
revertHint:
|
|
664
|
-
jsonBlock:
|
|
647
|
+
dialog: `${P(e, "")} ${P(e, "--apply")}`,
|
|
648
|
+
header: P(e, "__header"),
|
|
649
|
+
title: P(e, "__title"),
|
|
650
|
+
closeButton: P(e, "__close-button"),
|
|
651
|
+
hint: P(e, "__hint"),
|
|
652
|
+
sectionHeading: P(e, "__section-heading"),
|
|
653
|
+
list: P(e, "__list"),
|
|
654
|
+
listItem: P(e, "__list-item"),
|
|
655
|
+
actions: P(e, "__actions"),
|
|
656
|
+
primaryButton: `${P(e, "__button")} ${P(e, "__button--primary")}`,
|
|
657
|
+
neutralButton: P(e, "__button"),
|
|
658
|
+
statusWarning: `${P(e, "__status")} ${P(e, "__status--warning")}`,
|
|
659
|
+
statusSuccess: `${P(e, "__status")} ${P(e, "__status--success")}`,
|
|
660
|
+
statusError: `${P(e, "__status")} ${P(e, "__status--error")}`,
|
|
661
|
+
applying: P(e, "__applying"),
|
|
662
|
+
spinner: P(e, "__spinner"),
|
|
663
|
+
revertHint: P(e, "__revert-hint"),
|
|
664
|
+
jsonBlock: P(e, "__json")
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
667
|
function $r(e) {
|
|
668
|
-
const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a, instanceConfig: i } = e, l = B(null), c = B(null), d = i ??
|
|
668
|
+
const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a, instanceConfig: i } = e, l = B(null), c = B(null), d = i ?? Y(), u = Z(() => _r(d), [d]), p = ht(), m = `${d.modalClassPrefix}-apply-title-${p}`, [h, v] = K(St), [C, b] = K("Copy pre-apply state to clipboard");
|
|
669
669
|
X(() => {
|
|
670
670
|
const A = l.current;
|
|
671
671
|
if (!A) return;
|
|
@@ -684,14 +684,14 @@ function $r(e) {
|
|
|
684
684
|
return () => window.clearTimeout(A);
|
|
685
685
|
}, [C]);
|
|
686
686
|
const N = Z(() => {
|
|
687
|
-
const A = ge(d), H = fn(t, r, A, d.tabs), ee =
|
|
687
|
+
const A = ge(d), H = fn(t, r, A, d.tabs), ee = Zo(d), be = ee && t.secondary ? fn(
|
|
688
688
|
{ ...t, color: t.secondary },
|
|
689
689
|
void 0,
|
|
690
690
|
ee,
|
|
691
691
|
d.tabs
|
|
692
692
|
) : {};
|
|
693
693
|
return { ...H, ...be };
|
|
694
|
-
}, [t, r, d]), g = Z(() =>
|
|
694
|
+
}, [t, r, d]), g = Z(() => Qo(d), [d]), { groups: y, rejected: w, rejectedReasons: _ } = Z(
|
|
695
695
|
() => ir(N, g),
|
|
696
696
|
[N, g]
|
|
697
697
|
), x = Z(() => Object.keys(N).length, [N]), f = x === 0, E = y.length > 0, S = d.applyEndpoint, O = !!S && Object.keys(g).length > 0;
|
|
@@ -714,13 +714,13 @@ function $r(e) {
|
|
|
714
714
|
if (!H.ok) {
|
|
715
715
|
let be = "";
|
|
716
716
|
try {
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
717
|
+
const I = await H.text();
|
|
718
|
+
if (I)
|
|
719
719
|
try {
|
|
720
|
-
const re = JSON.parse(
|
|
721
|
-
be = re.error ?? re.message ??
|
|
720
|
+
const re = JSON.parse(I);
|
|
721
|
+
be = re.error ?? re.message ?? I;
|
|
722
722
|
} catch {
|
|
723
|
-
be =
|
|
723
|
+
be = I;
|
|
724
724
|
}
|
|
725
725
|
} catch {
|
|
726
726
|
}
|
|
@@ -1082,7 +1082,7 @@ function Lr(e) {
|
|
|
1082
1082
|
const t = e.toLowerCase();
|
|
1083
1083
|
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]}` : "";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Pr(e) {
|
|
1086
1086
|
const t = Lr(e);
|
|
1087
1087
|
if (!t) return { ...Ar };
|
|
1088
1088
|
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), l = Math.min(n, o, r), c = (i + l) / 2;
|
|
@@ -1091,7 +1091,7 @@ function Ir(e) {
|
|
|
1091
1091
|
let p = 0;
|
|
1092
1092
|
return i === n ? p = ((o - r) / d + (o < r ? 6 : 0)) / 6 : i === o ? p = ((r - n) / d + 2) / 6 : p = ((n - o) / d + 4) / 6, { h: Math.round(p * 360), s: Math.round(u * 100), l: Math.round(c * 100), a };
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Ir(e, t, n, o) {
|
|
1095
1095
|
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;
|
|
1096
1096
|
const r = t / 100, a = n / 100, i = (1 - Math.abs(2 * a - 1)) * r, l = i * (1 - Math.abs(e / 60 % 2 - 1)), c = a - i / 2;
|
|
1097
1097
|
let d = 0, u = 0, p = 0;
|
|
@@ -1101,7 +1101,7 @@ function Pr(e, t, n, o) {
|
|
|
1101
1101
|
const v = Math.round(o / 100 * 255).toString(16).padStart(2, "0");
|
|
1102
1102
|
return `${h}${v}`;
|
|
1103
1103
|
}
|
|
1104
|
-
const
|
|
1104
|
+
const jn = (e, t) => {
|
|
1105
1105
|
if (typeof e == "number") {
|
|
1106
1106
|
if (t === 3)
|
|
1107
1107
|
return {
|
|
@@ -1285,9 +1285,9 @@ const Fn = (e, t) => {
|
|
|
1285
1285
|
whitesmoke: 16119285,
|
|
1286
1286
|
yellow: 16776960,
|
|
1287
1287
|
yellowgreen: 10145074
|
|
1288
|
-
}, Rr = (e) =>
|
|
1288
|
+
}, Rr = (e) => jn(zr[e.toLowerCase()], 6), Or = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Dr = (e) => {
|
|
1289
1289
|
let t;
|
|
1290
|
-
return (t = e.match(Or)) ?
|
|
1290
|
+
return (t = e.match(Or)) ? jn(parseInt(t[1], 16), t[1].length) : void 0;
|
|
1291
1291
|
}, Te = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", Xe = `${Te}%`, Yt = `(?:${Te}%|${Te})`, Vr = `(?:${Te}(deg|grad|rad|turn)|${Te})`, Re = "\\s*,\\s*", Br = new RegExp(
|
|
1292
1292
|
`^rgba?\\(\\s*${Te}${Re}${Te}${Re}${Te}\\s*(?:,\\s*${Yt}\\s*)?\\)$`
|
|
1293
1293
|
), Hr = new RegExp(
|
|
@@ -1301,7 +1301,7 @@ const Fn = (e, t) => {
|
|
|
1301
1301
|
else
|
|
1302
1302
|
return;
|
|
1303
1303
|
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;
|
|
1304
|
-
}, ct = (e, t) => e === void 0 ? void 0 : typeof e != "object" ?
|
|
1304
|
+
}, ct = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Yn(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, ye = (e = "rgb") => (t) => (t = ct(t, e)) !== void 0 ? (
|
|
1305
1305
|
// if the color's mode corresponds to our target mode
|
|
1306
1306
|
t.mode === e ? (
|
|
1307
1307
|
// then just return the color
|
|
@@ -1324,7 +1324,7 @@ const Fn = (e, t) => {
|
|
|
1324
1324
|
)
|
|
1325
1325
|
)
|
|
1326
1326
|
)
|
|
1327
|
-
) : void 0, we = {},
|
|
1327
|
+
) : void 0, we = {}, Kn = {}, dt = [], Wn = {}, jr = (e) => e, qt = (e) => (we[e.mode] = {
|
|
1328
1328
|
...we[e.mode],
|
|
1329
1329
|
...e.toMode
|
|
1330
1330
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
@@ -1335,13 +1335,13 @@ const Fn = (e, t) => {
|
|
|
1335
1335
|
typeof e.interpolate[t] == "function" && (e.interpolate[t] = {
|
|
1336
1336
|
use: e.interpolate[t]
|
|
1337
1337
|
}), e.interpolate[t].fixup || (e.interpolate[t].fixup = jr);
|
|
1338
|
-
}),
|
|
1338
|
+
}), Kn[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
1339
1339
|
Kr(t, e.mode);
|
|
1340
|
-
}), ye(e.mode)), gt = (e) =>
|
|
1340
|
+
}), ye(e.mode)), gt = (e) => Kn[e], Kr = (e, t) => {
|
|
1341
1341
|
if (typeof e == "string") {
|
|
1342
1342
|
if (!t)
|
|
1343
1343
|
throw new Error("'mode' required when 'parser' is a string");
|
|
1344
|
-
|
|
1344
|
+
Wn[e] = t;
|
|
1345
1345
|
} else typeof e == "function" && dt.indexOf(e) < 0 && dt.push(e);
|
|
1346
1346
|
}, Ot = /[^\x00-\x7F]|[a-zA-Z_]/, Wr = /[^\x00-\x7F]|[-\w]/, M = {
|
|
1347
1347
|
Function: "function",
|
|
@@ -1478,10 +1478,10 @@ function Gr(e) {
|
|
|
1478
1478
|
let t = e[e._i++];
|
|
1479
1479
|
if (!t || t.type !== M.Function || t.value !== "color" || (t = e[e._i++], t.type !== M.Ident))
|
|
1480
1480
|
return;
|
|
1481
|
-
const n =
|
|
1481
|
+
const n = Wn[t.value];
|
|
1482
1482
|
if (!n)
|
|
1483
1483
|
return;
|
|
1484
|
-
const o = { mode: n }, r =
|
|
1484
|
+
const o = { mode: n }, r = Xn(e, !1);
|
|
1485
1485
|
if (!r)
|
|
1486
1486
|
return;
|
|
1487
1487
|
const a = gt(n).channels;
|
|
@@ -1489,7 +1489,7 @@ function Gr(e) {
|
|
|
1489
1489
|
l = r[i], c = a[i], l.type !== M.None && (o[c] = l.type === M.Number ? l.value : l.value / 100, c === "alpha" && (o[c] = Math.max(0, Math.min(1, o[c]))));
|
|
1490
1490
|
return o;
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function Xn(e, t) {
|
|
1493
1493
|
const n = [];
|
|
1494
1494
|
let o;
|
|
1495
1495
|
for (; e._i < e.length; ) {
|
|
@@ -1518,11 +1518,11 @@ function Ur(e, t) {
|
|
|
1518
1518
|
let n = e[e._i++];
|
|
1519
1519
|
if (!n || n.type !== M.Function)
|
|
1520
1520
|
return;
|
|
1521
|
-
let o =
|
|
1521
|
+
let o = Xn(e, t);
|
|
1522
1522
|
if (o)
|
|
1523
1523
|
return o.unshift(n.value), o;
|
|
1524
1524
|
}
|
|
1525
|
-
const
|
|
1525
|
+
const Yn = (e) => {
|
|
1526
1526
|
if (typeof e != "string")
|
|
1527
1527
|
return;
|
|
1528
1528
|
const t = qr(e), n = t ? Ur(t, !0) : void 0;
|
|
@@ -1585,7 +1585,7 @@ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1585
1585
|
}, Mt = (e = 0) => {
|
|
1586
1586
|
const t = Math.abs(e);
|
|
1587
1587
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
1588
|
-
},
|
|
1588
|
+
}, qn = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1589
1589
|
let r = {
|
|
1590
1590
|
mode: "lrgb",
|
|
1591
1591
|
r: Mt(e),
|
|
@@ -1596,7 +1596,7 @@ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1596
1596
|
}, At = (e = 0) => {
|
|
1597
1597
|
const t = Math.abs(e);
|
|
1598
1598
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
1599
|
-
},
|
|
1599
|
+
}, Gn = ({ r: e, g: t, b: n, alpha: o }, r = "rgb") => {
|
|
1600
1600
|
let a = {
|
|
1601
1601
|
mode: r,
|
|
1602
1602
|
r: At(e),
|
|
@@ -1609,7 +1609,7 @@ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1609
1609
|
return n;
|
|
1610
1610
|
let a = Me(n);
|
|
1611
1611
|
return o === 0 || e[o - 1] === void 0 ? a : t(a - Me(r[o - 1]));
|
|
1612
|
-
}).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), []),
|
|
1612
|
+
}).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), []), Un = (e) => oa(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), ra = (e, t) => {
|
|
1613
1613
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
|
|
1614
1614
|
return 0;
|
|
1615
1615
|
let n = Me(e.h), o = Me(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
@@ -1619,7 +1619,7 @@ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1619
1619
|
return 0;
|
|
1620
1620
|
let n = Me(e.h), o = Me(t.h), r = Math.sin((o - n + 360) / 2 * Math.PI / 180);
|
|
1621
1621
|
return 2 * Math.sqrt(e.c * t.c) * r;
|
|
1622
|
-
},
|
|
1622
|
+
}, Jn = (e) => {
|
|
1623
1623
|
let t = e.reduce(
|
|
1624
1624
|
(o, r) => {
|
|
1625
1625
|
if (r !== void 0) {
|
|
@@ -1644,7 +1644,7 @@ const Zr = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
1644
1644
|
b: t ? t * Math.sin(n / 180 * Math.PI) : 0
|
|
1645
1645
|
};
|
|
1646
1646
|
return o !== void 0 && (a.alpha = o), a;
|
|
1647
|
-
},
|
|
1647
|
+
}, Ie = {
|
|
1648
1648
|
X: 0.3457 / 0.3585,
|
|
1649
1649
|
Y: 1,
|
|
1650
1650
|
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
@@ -1747,7 +1747,7 @@ const pa = {
|
|
|
1747
1747
|
parse: [ua, da],
|
|
1748
1748
|
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}` : ""})`,
|
|
1749
1749
|
interpolate: {
|
|
1750
|
-
h: { use: he, fixup:
|
|
1750
|
+
h: { use: he, fixup: Un },
|
|
1751
1751
|
s: he,
|
|
1752
1752
|
l: he,
|
|
1753
1753
|
alpha: { use: he, fixup: Gt }
|
|
@@ -1756,38 +1756,38 @@ const pa = {
|
|
|
1756
1756
|
h: ra
|
|
1757
1757
|
},
|
|
1758
1758
|
average: {
|
|
1759
|
-
h:
|
|
1759
|
+
h: Jn
|
|
1760
1760
|
}
|
|
1761
|
-
},
|
|
1762
|
-
let Lt = (e) => Math.pow(e, 3) >
|
|
1761
|
+
}, Zn = Math.pow(29, 3) / Math.pow(3, 3), Qn = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1762
|
+
let Lt = (e) => Math.pow(e, 3) > Qn ? Math.pow(e, 3) : (116 * e - 16) / Zn;
|
|
1763
1763
|
const fa = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1764
1764
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1765
1765
|
let r = (e + 16) / 116, a = t / 500 + r, i = r - n / 200, l = {
|
|
1766
1766
|
mode: "xyz50",
|
|
1767
|
-
x: Lt(a) *
|
|
1768
|
-
y: Lt(r) *
|
|
1769
|
-
z: Lt(i) *
|
|
1767
|
+
x: Lt(a) * Ie.X,
|
|
1768
|
+
y: Lt(r) * Ie.Y,
|
|
1769
|
+
z: Lt(i) * Ie.Z
|
|
1770
1770
|
};
|
|
1771
1771
|
return o !== void 0 && (l.alpha = o), l;
|
|
1772
1772
|
}, ha = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1773
1773
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1774
|
-
let r =
|
|
1774
|
+
let r = Gn({
|
|
1775
1775
|
r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * n,
|
|
1776
1776
|
g: e * -0.978795502912089 + t * 1.916254567259524 + 0.03344273116131949 * n,
|
|
1777
1777
|
b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * n
|
|
1778
1778
|
});
|
|
1779
1779
|
return o !== void 0 && (r.alpha = o), r;
|
|
1780
1780
|
}, ga = (e) => ha(fa(e)), ka = (e) => {
|
|
1781
|
-
let { r: t, g: n, b: o, alpha: r } =
|
|
1781
|
+
let { r: t, g: n, b: o, alpha: r } = qn(e), a = {
|
|
1782
1782
|
mode: "xyz50",
|
|
1783
1783
|
x: 0.436065742824811 * t + 0.3851514688337912 * n + 0.14307845442264197 * o,
|
|
1784
1784
|
y: 0.22249319175623702 * t + 0.7168870538238823 * n + 0.06061979053616537 * o,
|
|
1785
1785
|
z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * o
|
|
1786
1786
|
};
|
|
1787
1787
|
return r !== void 0 && (a.alpha = r), a;
|
|
1788
|
-
},
|
|
1788
|
+
}, Pt = (e) => e > Qn ? Math.cbrt(e) : (Zn * e + 16) / 116, ma = ({ x: e, y: t, z: n, alpha: o }) => {
|
|
1789
1789
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
1790
|
-
let r =
|
|
1790
|
+
let r = Pt(e / Ie.X), a = Pt(t / Ie.Y), i = Pt(n / Ie.Z), l = {
|
|
1791
1791
|
mode: "lab",
|
|
1792
1792
|
l: 116 * a - 16,
|
|
1793
1793
|
a: 500 * (r - a),
|
|
@@ -1842,7 +1842,7 @@ const wa = {
|
|
|
1842
1842
|
parse: [va],
|
|
1843
1843
|
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}` : ""})`,
|
|
1844
1844
|
interpolate: {
|
|
1845
|
-
h: { use: he, fixup:
|
|
1845
|
+
h: { use: he, fixup: Un },
|
|
1846
1846
|
c: he,
|
|
1847
1847
|
l: he,
|
|
1848
1848
|
alpha: { use: he, fixup: Gt }
|
|
@@ -1851,7 +1851,7 @@ const wa = {
|
|
|
1851
1851
|
h: aa
|
|
1852
1852
|
},
|
|
1853
1853
|
average: {
|
|
1854
|
-
h:
|
|
1854
|
+
h: Jn
|
|
1855
1855
|
}
|
|
1856
1856
|
}, xa = ({ r: e, g: t, b: n, alpha: o }) => {
|
|
1857
1857
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
@@ -1869,7 +1869,7 @@ const wa = {
|
|
|
1869
1869
|
};
|
|
1870
1870
|
return o !== void 0 && (l.alpha = o), l;
|
|
1871
1871
|
}, ya = (e) => {
|
|
1872
|
-
let t = xa(
|
|
1872
|
+
let t = xa(qn(e));
|
|
1873
1873
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
1874
1874
|
}, Na = ({ l: e, a: t, b: n, alpha: o }) => {
|
|
1875
1875
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
@@ -1880,7 +1880,7 @@ const wa = {
|
|
|
1880
1880
|
b: -0.0041960761386756 * r - 0.7034186179359362 * a + 1.7076146940746117 * i
|
|
1881
1881
|
};
|
|
1882
1882
|
return o !== void 0 && (l.alpha = o), l;
|
|
1883
|
-
}, _a = (e) =>
|
|
1883
|
+
}, _a = (e) => Gn(Na(e));
|
|
1884
1884
|
function $a(e, t) {
|
|
1885
1885
|
if (!t || t[0] !== "oklch")
|
|
1886
1886
|
return;
|
|
@@ -1927,7 +1927,7 @@ const Ca = {
|
|
|
1927
1927
|
c: [0, 0.4],
|
|
1928
1928
|
h: [0, 360]
|
|
1929
1929
|
}
|
|
1930
|
-
}, Ea = (e) => Math.max(0, Math.min(1, e || 0)), it = (e) => Math.round(Ea(e) * 255),
|
|
1930
|
+
}, Ea = (e) => Math.max(0, Math.min(1, e || 0)), it = (e) => Math.round(Ea(e) * 255), eo = ye("rgb"), to = (e) => {
|
|
1931
1931
|
if (e === void 0)
|
|
1932
1932
|
return;
|
|
1933
1933
|
let t = it(e.r), n = it(e.g), o = it(e.b);
|
|
@@ -1936,8 +1936,8 @@ const Ca = {
|
|
|
1936
1936
|
if (e === void 0)
|
|
1937
1937
|
return;
|
|
1938
1938
|
let t = it(e.alpha !== void 0 ? e.alpha : 1);
|
|
1939
|
-
return
|
|
1940
|
-
}, Ta = (e) => eo(
|
|
1939
|
+
return to(e) + (256 | t).toString(16).slice(1);
|
|
1940
|
+
}, Ta = (e) => to(eo(e)), Ma = (e) => Sa(eo(e)), no = ye("rgb"), oo = (e) => {
|
|
1941
1941
|
const t = {
|
|
1942
1942
|
mode: e.mode,
|
|
1943
1943
|
r: Math.max(0, Math.min(e.r !== void 0 ? e.r : 0, 1)),
|
|
@@ -1945,18 +1945,18 @@ const Ca = {
|
|
|
1945
1945
|
b: Math.max(0, Math.min(e.b !== void 0 ? e.b : 0, 1))
|
|
1946
1946
|
};
|
|
1947
1947
|
return e.alpha !== void 0 && (t.alpha = e.alpha), t;
|
|
1948
|
-
}, Aa = (e) => no(
|
|
1948
|
+
}, Aa = (e) => oo(no(e)), ro = (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);
|
|
1949
1949
|
function La(e) {
|
|
1950
|
-
return
|
|
1950
|
+
return ro(no(e));
|
|
1951
1951
|
}
|
|
1952
1952
|
function Ut(e = "rgb") {
|
|
1953
1953
|
const { gamut: t } = gt(e);
|
|
1954
1954
|
if (!t)
|
|
1955
1955
|
return (o) => !0;
|
|
1956
1956
|
const n = ye(typeof t == "string" ? t : e);
|
|
1957
|
-
return (o) =>
|
|
1957
|
+
return (o) => ro(n(o));
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function Pa(e = "rgb") {
|
|
1960
1960
|
const { gamut: t } = gt(e);
|
|
1961
1961
|
if (!t)
|
|
1962
1962
|
return (a) => ct(a);
|
|
@@ -1968,13 +1968,13 @@ function Ia(e = "rgb") {
|
|
|
1968
1968
|
const l = o(i);
|
|
1969
1969
|
if (r(l))
|
|
1970
1970
|
return i;
|
|
1971
|
-
const c =
|
|
1971
|
+
const c = oo(l);
|
|
1972
1972
|
return i.mode === c.mode ? c : ye(i.mode)(c);
|
|
1973
1973
|
};
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function Ia(e, t = "lch", n = "rgb") {
|
|
1976
1976
|
e = ct(e);
|
|
1977
|
-
let o = n === "rgb" ? La : Ut(n), r = n === "rgb" ? Aa :
|
|
1977
|
+
let o = n === "rgb" ? La : Ut(n), r = n === "rgb" ? Aa : Pa(n);
|
|
1978
1978
|
if (e === void 0 || o(e)) return e;
|
|
1979
1979
|
let a = ye(e.mode);
|
|
1980
1980
|
e = ye(t)(e);
|
|
@@ -1991,7 +1991,7 @@ function Pa(e, t = "lch", n = "rgb") {
|
|
|
1991
1991
|
qt(Ca);
|
|
1992
1992
|
qt(na);
|
|
1993
1993
|
qt(pa);
|
|
1994
|
-
const
|
|
1994
|
+
const ao = 0.37, io = ye("oklch"), lo = ye("rgb"), za = Ut("rgb");
|
|
1995
1995
|
function Jt(e) {
|
|
1996
1996
|
return {
|
|
1997
1997
|
mode: "oklch",
|
|
@@ -2019,9 +2019,9 @@ function ne(e) {
|
|
|
2019
2019
|
function Oa(e) {
|
|
2020
2020
|
const t = { l: 0, c: 0, h: 0, a: 100 };
|
|
2021
2021
|
try {
|
|
2022
|
-
const n =
|
|
2022
|
+
const n = Yn(e);
|
|
2023
2023
|
if (!n) return t;
|
|
2024
|
-
const o =
|
|
2024
|
+
const o = io(n);
|
|
2025
2025
|
if (!o) return t;
|
|
2026
2026
|
const r = o.alpha === void 0 ? 1 : o.alpha;
|
|
2027
2027
|
return {
|
|
@@ -2035,7 +2035,7 @@ function Oa(e) {
|
|
|
2035
2035
|
}
|
|
2036
2036
|
}
|
|
2037
2037
|
function hn(e, t) {
|
|
2038
|
-
const n = Jt(e), o =
|
|
2038
|
+
const n = Jt(e), o = lo(n);
|
|
2039
2039
|
return o ? e.a < 100 ? Ma({ ...o, alpha: e.a / 100 }) ?? "#000000ff" : Ta(o) ?? "#000000" : "#000000";
|
|
2040
2040
|
}
|
|
2041
2041
|
function Ee(e) {
|
|
@@ -2045,11 +2045,11 @@ function Ee(e) {
|
|
|
2045
2045
|
s: e.s / 100,
|
|
2046
2046
|
l: e.l / 100,
|
|
2047
2047
|
alpha: e.a / 100
|
|
2048
|
-
}, n =
|
|
2048
|
+
}, n = io(t);
|
|
2049
2049
|
return n ? Ra(n) : { l: 0, c: 0, h: 0, a: e.a };
|
|
2050
2050
|
}
|
|
2051
2051
|
function gn(e) {
|
|
2052
|
-
const t = Jt(e), n =
|
|
2052
|
+
const t = Jt(e), n = Ia(t, "oklch", "rgb");
|
|
2053
2053
|
return n ? {
|
|
2054
2054
|
l: (n.l ?? e.l / 100) * 100,
|
|
2055
2055
|
c: n.c ?? 0,
|
|
@@ -2058,7 +2058,7 @@ function gn(e) {
|
|
|
2058
2058
|
} : { l: e.l, c: 0, h: e.h, a: e.a };
|
|
2059
2059
|
}
|
|
2060
2060
|
function Da(e) {
|
|
2061
|
-
const t =
|
|
2061
|
+
const t = lo(Jt(e));
|
|
2062
2062
|
return t ? za(t) : !1;
|
|
2063
2063
|
}
|
|
2064
2064
|
function et(e, t, n) {
|
|
@@ -2200,7 +2200,7 @@ function kn({
|
|
|
2200
2200
|
/* @__PURE__ */ s("span", { className: "tokenpanel-color-picker-slider-value", children: p(t) })
|
|
2201
2201
|
] });
|
|
2202
2202
|
}
|
|
2203
|
-
const
|
|
2203
|
+
const so = "tokenpanel.colorPicker.mode", Vt = [95, 78, 61, 44, 27, 10], Ba = [0, 60, 120, 180, 240, 300], Ha = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Fa = 0.18, ja = 320, Ka = 400, Wa = 520, Xa = 440;
|
|
2204
2204
|
function Ya() {
|
|
2205
2205
|
return [
|
|
2206
2206
|
{
|
|
@@ -2217,7 +2217,7 @@ function Ya() {
|
|
|
2217
2217
|
label: "C",
|
|
2218
2218
|
ariaLabel: "Chroma",
|
|
2219
2219
|
min: 0,
|
|
2220
|
-
max:
|
|
2220
|
+
max: ao,
|
|
2221
2221
|
step: 1e-3,
|
|
2222
2222
|
format: (e) => e.toFixed(3)
|
|
2223
2223
|
},
|
|
@@ -2292,7 +2292,7 @@ function mn(e, t, n, o) {
|
|
|
2292
2292
|
function Ga(e) {
|
|
2293
2293
|
if (typeof window > "u") return e;
|
|
2294
2294
|
try {
|
|
2295
|
-
const t = window.localStorage.getItem(
|
|
2295
|
+
const t = window.localStorage.getItem(so);
|
|
2296
2296
|
if (t === "oklch" || t === "hsl") return t;
|
|
2297
2297
|
} catch {
|
|
2298
2298
|
}
|
|
@@ -2301,7 +2301,7 @@ function Ga(e) {
|
|
|
2301
2301
|
function Ua(e) {
|
|
2302
2302
|
if (!(typeof window > "u"))
|
|
2303
2303
|
try {
|
|
2304
|
-
window.localStorage.setItem(
|
|
2304
|
+
window.localStorage.setItem(so, e);
|
|
2305
2305
|
} catch {
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
@@ -2311,7 +2311,7 @@ function Ja(e, t) {
|
|
|
2311
2311
|
t.current || o(e);
|
|
2312
2312
|
}, [e, t]), [n, o];
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2314
|
+
function co(e, t, n) {
|
|
2315
2315
|
if (!e) return { position: "fixed" };
|
|
2316
2316
|
const o = e.getBoundingClientRect(), r = 4, a = 8, i = window.innerWidth, l = window.innerHeight, c = l - o.bottom - r - a, d = o.top - r - a, u = c < n && d > c;
|
|
2317
2317
|
let p = o.left;
|
|
@@ -2321,7 +2321,7 @@ function so(e, t, n) {
|
|
|
2321
2321
|
const h = { position: "fixed", left: p, top: m };
|
|
2322
2322
|
return n > l - 2 * a && (h.top = a, h.maxHeight = l - 2 * a, h.overflowY = "auto"), h;
|
|
2323
2323
|
}
|
|
2324
|
-
function
|
|
2324
|
+
function uo(e, t) {
|
|
2325
2325
|
const n = B(t);
|
|
2326
2326
|
n.current = t, X(() => {
|
|
2327
2327
|
function o(a) {
|
|
@@ -2335,7 +2335,7 @@ function co(e, t) {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
}, []);
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function po({
|
|
2339
2339
|
color: e,
|
|
2340
2340
|
onChange: t,
|
|
2341
2341
|
label: n,
|
|
@@ -2350,54 +2350,54 @@ function uo({
|
|
|
2350
2350
|
), [N, g] = K("mini"), [y, w] = K(d);
|
|
2351
2351
|
X(() => {
|
|
2352
2352
|
(/^#[0-9a-fA-F]{6}$/.test(y) || /^#[0-9a-fA-F]{8}$/.test(y)) && w(d);
|
|
2353
|
-
}, [d]),
|
|
2354
|
-
const _ = Z(() => Oa(d), [d]), x = Z(() =>
|
|
2353
|
+
}, [d]), uo(i, a);
|
|
2354
|
+
const _ = Z(() => Oa(d), [d]), x = Z(() => Pr(d), [d]), f = R(
|
|
2355
2355
|
($) => {
|
|
2356
|
-
const
|
|
2357
|
-
u(
|
|
2356
|
+
const I = $.toLowerCase();
|
|
2357
|
+
u(I), w(I), t(I);
|
|
2358
2358
|
},
|
|
2359
2359
|
[u, t]
|
|
2360
2360
|
), E = R(
|
|
2361
2361
|
($) => {
|
|
2362
|
-
const
|
|
2362
|
+
const I = {
|
|
2363
2363
|
l: $.l ?? _.l,
|
|
2364
2364
|
c: $.c ?? _.c,
|
|
2365
2365
|
h: $.h ?? _.h,
|
|
2366
2366
|
a: $.a ?? _.a
|
|
2367
2367
|
};
|
|
2368
|
-
f(hn(
|
|
2368
|
+
f(hn(I));
|
|
2369
2369
|
},
|
|
2370
2370
|
[_, f]
|
|
2371
2371
|
), S = R(
|
|
2372
2372
|
($) => {
|
|
2373
|
-
const
|
|
2373
|
+
const I = {
|
|
2374
2374
|
h: $.h ?? x.h,
|
|
2375
2375
|
s: $.s ?? x.s,
|
|
2376
2376
|
l: $.l ?? x.l,
|
|
2377
2377
|
a: $.a ?? x.a
|
|
2378
2378
|
};
|
|
2379
|
-
f(
|
|
2379
|
+
f(Ir(I.h, I.s, I.l, I.a));
|
|
2380
2380
|
},
|
|
2381
2381
|
[x, f]
|
|
2382
2382
|
), O = ($) => {
|
|
2383
2383
|
w($), (/^#[0-9a-fA-F]{6}$/.test($) || /^#[0-9a-fA-F]{8}$/.test($)) && f($);
|
|
2384
2384
|
}, j = N === "expanded" ? Ha : Ba, D = R(
|
|
2385
|
-
($,
|
|
2386
|
-
const re = mn($,
|
|
2385
|
+
($, I) => {
|
|
2386
|
+
const re = mn($, I, _.a, j), Q = gn(re);
|
|
2387
2387
|
f(hn(Q));
|
|
2388
2388
|
},
|
|
2389
2389
|
[_.a, j, f]
|
|
2390
2390
|
), G = R(
|
|
2391
|
-
($,
|
|
2392
|
-
let Q =
|
|
2391
|
+
($, I, re) => {
|
|
2392
|
+
let Q = I, V = re;
|
|
2393
2393
|
if ($.key === "ArrowRight")
|
|
2394
2394
|
V = Math.min(j.length - 1, re + 1);
|
|
2395
2395
|
else if ($.key === "ArrowLeft") V = Math.max(0, re - 1);
|
|
2396
2396
|
else if ($.key === "ArrowDown")
|
|
2397
|
-
Q = Math.min(Vt.length - 1,
|
|
2398
|
-
else if ($.key === "ArrowUp") Q = Math.max(0,
|
|
2397
|
+
Q = Math.min(Vt.length - 1, I + 1);
|
|
2398
|
+
else if ($.key === "ArrowUp") Q = Math.max(0, I - 1);
|
|
2399
2399
|
else if ($.key === "Enter" || $.key === " ") {
|
|
2400
|
-
$.preventDefault(), D(
|
|
2400
|
+
$.preventDefault(), D(I, re);
|
|
2401
2401
|
return;
|
|
2402
2402
|
} else return;
|
|
2403
2403
|
$.preventDefault(), i.current?.querySelector(
|
|
@@ -2409,7 +2409,7 @@ function uo({
|
|
|
2409
2409
|
Ua($), b($);
|
|
2410
2410
|
}, ke = Z(() => Ya(), []), oe = Z(() => qa(), []), me = Z(() => C === "oklch" ? {
|
|
2411
2411
|
l: `linear-gradient(90deg in oklch, ${ne({ l: 0, c: _.c, h: _.h, a: 100 })}, ${ne({ l: 100, c: _.c, h: _.h, a: 100 })})`,
|
|
2412
|
-
c: `linear-gradient(90deg in oklch, ${ne({ l: _.l, c: 0, h: _.h, a: 100 })}, ${ne({ l: _.l, c:
|
|
2412
|
+
c: `linear-gradient(90deg in oklch, ${ne({ l: _.l, c: 0, h: _.h, a: 100 })}, ${ne({ l: _.l, c: ao, h: _.h, a: 100 })})`,
|
|
2413
2413
|
h: `linear-gradient(90deg in oklch longer hue, ${ne({ l: _.l, c: _.c, h: 0, a: 100 })}, ${ne({ l: _.l, c: _.c, h: 360, a: 100 })})`,
|
|
2414
2414
|
a: `linear-gradient(90deg in oklch, ${ne({ ..._, a: 0 })}, ${ne({ ..._, a: 100 })})`
|
|
2415
2415
|
} : {
|
|
@@ -2421,14 +2421,14 @@ function uo({
|
|
|
2421
2421
|
position: "fixed",
|
|
2422
2422
|
visibility: "hidden"
|
|
2423
2423
|
}));
|
|
2424
|
-
|
|
2424
|
+
zo(() => {
|
|
2425
2425
|
const $ = r.current;
|
|
2426
2426
|
if (!$) {
|
|
2427
2427
|
Ae({ position: "fixed", visibility: "hidden" });
|
|
2428
2428
|
return;
|
|
2429
2429
|
}
|
|
2430
2430
|
Ae(
|
|
2431
|
-
|
|
2431
|
+
co(
|
|
2432
2432
|
$,
|
|
2433
2433
|
N === "mini" ? ja : Wa,
|
|
2434
2434
|
N === "mini" ? Ka : Xa
|
|
@@ -2437,7 +2437,7 @@ function uo({
|
|
|
2437
2437
|
}, [r, N]), X(() => {
|
|
2438
2438
|
const $ = l.current;
|
|
2439
2439
|
if (!$) return;
|
|
2440
|
-
function
|
|
2440
|
+
function I(V) {
|
|
2441
2441
|
V.preventDefault(), V.stopPropagation();
|
|
2442
2442
|
const U = i.current;
|
|
2443
2443
|
if (!U) return;
|
|
@@ -2477,8 +2477,8 @@ function uo({
|
|
|
2477
2477
|
);
|
|
2478
2478
|
m({ left: J, top: z });
|
|
2479
2479
|
}
|
|
2480
|
-
return $.addEventListener("pointerdown",
|
|
2481
|
-
$.removeEventListener("pointerdown",
|
|
2480
|
+
return $.addEventListener("pointerdown", I), $.addEventListener("pointermove", re), $.addEventListener("pointerup", Q), $.addEventListener("pointercancel", Q), () => {
|
|
2481
|
+
$.removeEventListener("pointerdown", I), $.removeEventListener("pointermove", re), $.removeEventListener("pointerup", Q), $.removeEventListener("pointercancel", Q);
|
|
2482
2482
|
};
|
|
2483
2483
|
}, []);
|
|
2484
2484
|
const A = /^#[0-9a-fA-F]{8}$/.test(d), H = R(() => {
|
|
@@ -2591,26 +2591,26 @@ function uo({
|
|
|
2591
2591
|
className: "tokenpanel-color-picker-grid",
|
|
2592
2592
|
role: "grid",
|
|
2593
2593
|
"aria-label": "Color presets",
|
|
2594
|
-
children: Vt.map(($,
|
|
2595
|
-
const V = mn(
|
|
2594
|
+
children: Vt.map(($, I) => /* @__PURE__ */ s("div", { role: "row", children: j.map((re, Q) => {
|
|
2595
|
+
const V = mn(I, Q, _.a, j), U = Da(V), ce = ne(gn(V)), T = Math.abs(_.h - V.h) % 360, F = Math.min(T, 360 - T), W = Math.abs(_.l - V.l) < 2 && F < 5 && Math.abs(_.c - V.c) < 0.05;
|
|
2596
2596
|
return /* @__PURE__ */ s(
|
|
2597
2597
|
"div",
|
|
2598
2598
|
{
|
|
2599
2599
|
role: "gridcell",
|
|
2600
|
-
"data-grid-row":
|
|
2600
|
+
"data-grid-row": I,
|
|
2601
2601
|
"data-grid-col": Q,
|
|
2602
2602
|
"data-oog": U ? "false" : "true",
|
|
2603
2603
|
"aria-selected": W,
|
|
2604
2604
|
"aria-label": `Preset L ${V.l}% H ${V.h}°`,
|
|
2605
2605
|
className: "tokenpanel-color-picker-grid-cell",
|
|
2606
2606
|
style: { background: ce },
|
|
2607
|
-
tabIndex:
|
|
2608
|
-
onClick: () => D(
|
|
2609
|
-
onKeyDown: (J) => G(J,
|
|
2607
|
+
tabIndex: I === 0 && Q === 0 ? 0 : -1,
|
|
2608
|
+
onClick: () => D(I, Q),
|
|
2609
|
+
onKeyDown: (J) => G(J, I, Q)
|
|
2610
2610
|
},
|
|
2611
|
-
`${
|
|
2611
|
+
`${I}-${Q}`
|
|
2612
2612
|
);
|
|
2613
|
-
}) }, `row-${
|
|
2613
|
+
}) }, `row-${I}`))
|
|
2614
2614
|
}
|
|
2615
2615
|
),
|
|
2616
2616
|
/* @__PURE__ */ s("div", { className: "tokenpanel-color-picker-sliders", children: C === "oklch" ? ke.map(($) => /* @__PURE__ */ s(
|
|
@@ -2619,7 +2619,7 @@ function uo({
|
|
|
2619
2619
|
config: $,
|
|
2620
2620
|
value: _[$.key] ?? 0,
|
|
2621
2621
|
gradient: me[$.key] ?? "",
|
|
2622
|
-
onChange: (
|
|
2622
|
+
onChange: (I) => E({ [$.key]: I }),
|
|
2623
2623
|
onDragStart: H,
|
|
2624
2624
|
onDragEnd: ee
|
|
2625
2625
|
},
|
|
@@ -2630,7 +2630,7 @@ function uo({
|
|
|
2630
2630
|
config: $,
|
|
2631
2631
|
value: x[$.key] ?? 0,
|
|
2632
2632
|
gradient: me[$.key] ?? "",
|
|
2633
|
-
onChange: (
|
|
2633
|
+
onChange: (I) => S({ [$.key]: I }),
|
|
2634
2634
|
onDragStart: H,
|
|
2635
2635
|
onDragEnd: ee
|
|
2636
2636
|
},
|
|
@@ -2654,7 +2654,7 @@ const Zt = jt(null);
|
|
|
2654
2654
|
function se({ cssVar: e }) {
|
|
2655
2655
|
const t = Xt(Zt);
|
|
2656
2656
|
if (t === null) return null;
|
|
2657
|
-
const { state: n, toggle: o, matchCounts: r } = t, a = n.active[e], i = a !== void 0, l = i ? n.slots[a]?.color : void 0, c = r?.[e], d =
|
|
2657
|
+
const { state: n, toggle: o, matchCounts: r } = t, a = n.active[e], i = a !== void 0, l = i ? n.slots[a]?.color : void 0, c = r?.[e], d = q(() => {
|
|
2658
2658
|
o(e);
|
|
2659
2659
|
}, [o, e]), u = i ? `Stop highlighting ${e}` + (c !== void 0 ? ` (${c} elements)` : "") : `Highlight elements using ${e}`;
|
|
2660
2660
|
return /* @__PURE__ */ s(
|
|
@@ -2703,12 +2703,12 @@ function Za({
|
|
|
2703
2703
|
anchorRef: e,
|
|
2704
2704
|
onClose: t
|
|
2705
2705
|
}) {
|
|
2706
|
-
const n =
|
|
2707
|
-
if (
|
|
2706
|
+
const n = Ro(Zt), [o, r] = K(null), a = B(Array.from({ length: 10 }, () => null)), i = B(null), l = B(null);
|
|
2707
|
+
if (uo(i, t), !n) return null;
|
|
2708
2708
|
const { state: c, setSlot: d, setOutlineWidth: u, reset: p, disableAll: m } = n, h = {};
|
|
2709
2709
|
for (const [C, b] of Object.entries(c.active))
|
|
2710
2710
|
b in h || (h[b] = C);
|
|
2711
|
-
const v =
|
|
2711
|
+
const v = co(e.current ?? null, 370, 520);
|
|
2712
2712
|
return o !== null && (l.current = a.current[o] ?? null), /* @__PURE__ */ k(
|
|
2713
2713
|
"div",
|
|
2714
2714
|
{
|
|
@@ -2798,7 +2798,7 @@ function Za({
|
|
|
2798
2798
|
)
|
|
2799
2799
|
] }),
|
|
2800
2800
|
o !== null && /* @__PURE__ */ s(
|
|
2801
|
-
|
|
2801
|
+
po,
|
|
2802
2802
|
{
|
|
2803
2803
|
color: c.slots[o]?.color ?? "#ffffff",
|
|
2804
2804
|
onChange: (C) => {
|
|
@@ -2813,7 +2813,7 @@ function Za({
|
|
|
2813
2813
|
}
|
|
2814
2814
|
);
|
|
2815
2815
|
}
|
|
2816
|
-
const
|
|
2816
|
+
const fo = [
|
|
2817
2817
|
{ color: "#ff2d2d" },
|
|
2818
2818
|
// red
|
|
2819
2819
|
{ color: "#ff2dcf" },
|
|
@@ -2834,15 +2834,15 @@ const po = [
|
|
|
2834
2834
|
// yellow
|
|
2835
2835
|
{ color: "#2d6eff" }
|
|
2836
2836
|
// blue
|
|
2837
|
-
],
|
|
2838
|
-
function ho() {
|
|
2839
|
-
return `${q().storagePrefix}-highlight-slots`;
|
|
2840
|
-
}
|
|
2837
|
+
], ho = 2;
|
|
2841
2838
|
function go() {
|
|
2842
|
-
return `${
|
|
2839
|
+
return `${Y().storagePrefix}-highlight-slots`;
|
|
2843
2840
|
}
|
|
2844
2841
|
function ko() {
|
|
2845
|
-
return `${
|
|
2842
|
+
return `${Y().storagePrefix}-highlight-active`;
|
|
2843
|
+
}
|
|
2844
|
+
function mo() {
|
|
2845
|
+
return `${Y().storagePrefix}-highlight-outline-width`;
|
|
2846
2846
|
}
|
|
2847
2847
|
function Qa(e) {
|
|
2848
2848
|
const t = new Set(Object.values(e));
|
|
@@ -2867,8 +2867,8 @@ function ei(e, t) {
|
|
|
2867
2867
|
function ti(e) {
|
|
2868
2868
|
return {
|
|
2869
2869
|
...e,
|
|
2870
|
-
slots:
|
|
2871
|
-
outlineWidth:
|
|
2870
|
+
slots: fo.map((t) => ({ ...t })),
|
|
2871
|
+
outlineWidth: ho
|
|
2872
2872
|
};
|
|
2873
2873
|
}
|
|
2874
2874
|
function ni(e) {
|
|
@@ -2884,9 +2884,9 @@ function ri(e, t) {
|
|
|
2884
2884
|
return { ...e, outlineWidth: n };
|
|
2885
2885
|
}
|
|
2886
2886
|
function ai() {
|
|
2887
|
-
let e =
|
|
2887
|
+
let e = fo.map((o) => ({ ...o })), t = ho, n = {};
|
|
2888
2888
|
try {
|
|
2889
|
-
const o = localStorage.getItem(
|
|
2889
|
+
const o = localStorage.getItem(go());
|
|
2890
2890
|
if (o !== null) {
|
|
2891
2891
|
const r = JSON.parse(o);
|
|
2892
2892
|
Array.isArray(r) && r.length === 10 && (e = r.map((a) => ({ color: a.color })));
|
|
@@ -2894,7 +2894,7 @@ function ai() {
|
|
|
2894
2894
|
} catch {
|
|
2895
2895
|
}
|
|
2896
2896
|
try {
|
|
2897
|
-
const o = localStorage.getItem(
|
|
2897
|
+
const o = localStorage.getItem(mo());
|
|
2898
2898
|
if (o !== null) {
|
|
2899
2899
|
const r = JSON.parse(o);
|
|
2900
2900
|
typeof r == "number" && r >= 1 && (t = r);
|
|
@@ -2902,7 +2902,7 @@ function ai() {
|
|
|
2902
2902
|
} catch {
|
|
2903
2903
|
}
|
|
2904
2904
|
try {
|
|
2905
|
-
const o = sessionStorage.getItem(
|
|
2905
|
+
const o = sessionStorage.getItem(ko());
|
|
2906
2906
|
if (o !== null) {
|
|
2907
2907
|
const r = JSON.parse(o);
|
|
2908
2908
|
r !== null && typeof r == "object" && !Array.isArray(r) && (n = r);
|
|
@@ -2913,15 +2913,15 @@ function ai() {
|
|
|
2913
2913
|
}
|
|
2914
2914
|
function He(e) {
|
|
2915
2915
|
try {
|
|
2916
|
-
localStorage.setItem(
|
|
2916
|
+
localStorage.setItem(go(), JSON.stringify(e.slots));
|
|
2917
2917
|
} catch {
|
|
2918
2918
|
}
|
|
2919
2919
|
try {
|
|
2920
|
-
localStorage.setItem(
|
|
2920
|
+
localStorage.setItem(mo(), JSON.stringify(e.outlineWidth));
|
|
2921
2921
|
} catch {
|
|
2922
2922
|
}
|
|
2923
2923
|
try {
|
|
2924
|
-
sessionStorage.setItem(
|
|
2924
|
+
sessionStorage.setItem(ko(), JSON.stringify(e.active));
|
|
2925
2925
|
} catch {
|
|
2926
2926
|
}
|
|
2927
2927
|
}
|
|
@@ -3129,7 +3129,7 @@ const bn = {
|
|
|
3129
3129
|
longhands: ["mask-image"],
|
|
3130
3130
|
compounds: ["mask-image"]
|
|
3131
3131
|
}
|
|
3132
|
-
}, tt = [null, "::before", "::after"],
|
|
3132
|
+
}, tt = [null, "::before", "::after"], bo = "tokenpanel-highlight-mount", vo = "tokenpanel-elpath-mount", Qt = `.tokenpanel-shell, [data-design-token-panel-modal], #${bo}, #${vo}`, ii = /^(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, li = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, si = /^#/, ci = /^-?\d+(\.\d+)?(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr)%?$/, di = /^-?\d+(\.\d+)?$/, ui = /^(cubic-bezier|steps|linear)\(/i, pi = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, fi = /^".*"$/, hi = /^url\(/i;
|
|
3133
3133
|
function gi(e, t) {
|
|
3134
3134
|
const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
3135
3135
|
return n ? li.test(n) || si.test(n) || ii.test(n) ? "color" : ci.test(n) ? "length" : di.test(n) ? "number" : ui.test(n) ? "easing" : pi.test(n) ? "time" : fi.test(n) ? "content" : (hi.test(n) && t.push(
|
|
@@ -3175,7 +3175,7 @@ function mi(e) {
|
|
|
3175
3175
|
o.style.getPropertyValue(e) !== "" && t.add(o);
|
|
3176
3176
|
return t;
|
|
3177
3177
|
}
|
|
3178
|
-
function
|
|
3178
|
+
function It(e, t, n, o, r) {
|
|
3179
3179
|
const a = [], i = document.documentElement, l = /* @__PURE__ */ new WeakSet();
|
|
3180
3180
|
a.push({
|
|
3181
3181
|
el: i,
|
|
@@ -3237,7 +3237,7 @@ function wn(e, t) {
|
|
|
3237
3237
|
n.startsWith("var(") && (n = n.replace(/^var\(\s*/, "").replace(/\s*\)$/, "").trim());
|
|
3238
3238
|
const o = [], r = t?.mode ?? "equality", a = t?.kind ?? gi(n, o), i = bn[a] ?? bn.color, l = ki(n, o), c = mi(n), d = [document.body, ...document.body.querySelectorAll("*")], u = /* @__PURE__ */ new Set();
|
|
3239
3239
|
if (r === "equality") {
|
|
3240
|
-
const { sentinelA: m, longhands: h, compounds: v } = i, C = i.needleA ?? m, b =
|
|
3240
|
+
const { sentinelA: m, longhands: h, compounds: v } = i, C = i.needleA ?? m, b = It(
|
|
3241
3241
|
n,
|
|
3242
3242
|
m,
|
|
3243
3243
|
l,
|
|
@@ -3274,7 +3274,7 @@ function wn(e, t) {
|
|
|
3274
3274
|
}
|
|
3275
3275
|
zt(n, b);
|
|
3276
3276
|
} else {
|
|
3277
|
-
const { sentinelA: m, sentinelB: h, longhands: v, compounds: C } = i, b = [...v, ...C], N =
|
|
3277
|
+
const { sentinelA: m, sentinelB: h, longhands: v, compounds: C } = i, b = [...v, ...C], N = It(
|
|
3278
3278
|
n,
|
|
3279
3279
|
m,
|
|
3280
3280
|
l,
|
|
@@ -3286,7 +3286,7 @@ function wn(e, t) {
|
|
|
3286
3286
|
for (const w of d)
|
|
3287
3287
|
g.set(w, tt.map((_) => vn(w, _, b)));
|
|
3288
3288
|
zt(n, N);
|
|
3289
|
-
const y =
|
|
3289
|
+
const y = It(
|
|
3290
3290
|
n,
|
|
3291
3291
|
h,
|
|
3292
3292
|
l,
|
|
@@ -3375,7 +3375,7 @@ function xi({ items: e }) {
|
|
|
3375
3375
|
);
|
|
3376
3376
|
}) });
|
|
3377
3377
|
}
|
|
3378
|
-
function
|
|
3378
|
+
function wo(e) {
|
|
3379
3379
|
const t = de(null), [, n] = $e(0);
|
|
3380
3380
|
return ue(() => {
|
|
3381
3381
|
function o() {
|
|
@@ -3427,7 +3427,7 @@ function yi(e) {
|
|
|
3427
3427
|
}
|
|
3428
3428
|
function Ni() {
|
|
3429
3429
|
const e = /* @__PURE__ */ new Map();
|
|
3430
|
-
for (const t of
|
|
3430
|
+
for (const t of Y().tabs)
|
|
3431
3431
|
for (const n of t.tiers)
|
|
3432
3432
|
for (const o of n.items)
|
|
3433
3433
|
e.set(o.cssVar, o.type);
|
|
@@ -3438,31 +3438,31 @@ function $i(e) {
|
|
|
3438
3438
|
return e ? !_i.has(e.kind) : !0;
|
|
3439
3439
|
}
|
|
3440
3440
|
function Ci({ items: e }) {
|
|
3441
|
-
const t =
|
|
3441
|
+
const t = wo(bo);
|
|
3442
3442
|
return t ? Wt(/* @__PURE__ */ s(xi, { items: e }), t) : null;
|
|
3443
3443
|
}
|
|
3444
3444
|
function Ei({ children: e }) {
|
|
3445
|
-
const [t, n] = $e(ai), [o, r] = $e(0), [a, i] = $e(0), l = de(/* @__PURE__ */ new Map()), c =
|
|
3445
|
+
const [t, n] = $e(ai), [o, r] = $e(0), [a, i] = $e(0), l = de(/* @__PURE__ */ new Map()), c = q((b) => {
|
|
3446
3446
|
n((N) => {
|
|
3447
3447
|
const g = ei(N, b);
|
|
3448
3448
|
return He(g), g;
|
|
3449
3449
|
});
|
|
3450
|
-
}, []), d =
|
|
3450
|
+
}, []), d = q((b, N) => {
|
|
3451
3451
|
n((g) => {
|
|
3452
3452
|
const y = oi(g, b, N);
|
|
3453
3453
|
return He(y), y;
|
|
3454
3454
|
});
|
|
3455
|
-
}, []), u =
|
|
3455
|
+
}, []), u = q((b) => {
|
|
3456
3456
|
n((N) => {
|
|
3457
3457
|
const g = ri(N, b);
|
|
3458
3458
|
return He(g), g;
|
|
3459
3459
|
});
|
|
3460
|
-
}, []), p =
|
|
3460
|
+
}, []), p = q(() => {
|
|
3461
3461
|
n((b) => {
|
|
3462
3462
|
const N = ti(b);
|
|
3463
3463
|
return He(N), N;
|
|
3464
3464
|
});
|
|
3465
|
-
}, []), m =
|
|
3465
|
+
}, []), m = q(() => {
|
|
3466
3466
|
n((b) => {
|
|
3467
3467
|
const N = ni(b);
|
|
3468
3468
|
return He(N), N;
|
|
@@ -3550,20 +3550,20 @@ function yn(e) {
|
|
|
3550
3550
|
const t = e;
|
|
3551
3551
|
return t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
3552
3552
|
}
|
|
3553
|
-
const
|
|
3554
|
-
function
|
|
3555
|
-
return `${
|
|
3553
|
+
const xo = jt(null);
|
|
3554
|
+
function yo() {
|
|
3555
|
+
return `${Y().storagePrefix}-elpath-enabled`;
|
|
3556
3556
|
}
|
|
3557
3557
|
function Si() {
|
|
3558
3558
|
try {
|
|
3559
|
-
return localStorage.getItem(
|
|
3559
|
+
return localStorage.getItem(yo()) === "1";
|
|
3560
3560
|
} catch {
|
|
3561
3561
|
return !1;
|
|
3562
3562
|
}
|
|
3563
3563
|
}
|
|
3564
3564
|
function Nn(e) {
|
|
3565
3565
|
try {
|
|
3566
|
-
localStorage.setItem(
|
|
3566
|
+
localStorage.setItem(yo(), e ? "1" : "0");
|
|
3567
3567
|
} catch {
|
|
3568
3568
|
}
|
|
3569
3569
|
}
|
|
@@ -3613,7 +3613,7 @@ function Ht(e) {
|
|
|
3613
3613
|
}
|
|
3614
3614
|
return t;
|
|
3615
3615
|
}
|
|
3616
|
-
function
|
|
3616
|
+
function No(e) {
|
|
3617
3617
|
const t = (e.getAttribute("class") ?? "").trim();
|
|
3618
3618
|
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)) : [];
|
|
3619
3619
|
}
|
|
@@ -3633,10 +3633,10 @@ function Li(e) {
|
|
|
3633
3633
|
const n = e.tagName, o = Array.from(t.children).filter((a) => a.tagName === n);
|
|
3634
3634
|
return o.length <= 1 ? "" : `:nth-of-type(${o.indexOf(e) + 1})`;
|
|
3635
3635
|
}
|
|
3636
|
-
function
|
|
3636
|
+
function Pi(e) {
|
|
3637
3637
|
return e.localName + Li(e);
|
|
3638
3638
|
}
|
|
3639
|
-
function
|
|
3639
|
+
function Ii(e) {
|
|
3640
3640
|
if (e.tagName === "HTML") return "html";
|
|
3641
3641
|
const t = e.getAttribute("id");
|
|
3642
3642
|
if (t) {
|
|
@@ -3657,7 +3657,7 @@ function Pi(e) {
|
|
|
3657
3657
|
continue;
|
|
3658
3658
|
}
|
|
3659
3659
|
}
|
|
3660
|
-
n.unshift(
|
|
3660
|
+
n.unshift(Pi(o));
|
|
3661
3661
|
const a = n.join(" > ");
|
|
3662
3662
|
if (nt(a, e)) return a;
|
|
3663
3663
|
o = o.parentElement;
|
|
@@ -3668,7 +3668,7 @@ function zi(e) {
|
|
|
3668
3668
|
const t = [];
|
|
3669
3669
|
let n = e;
|
|
3670
3670
|
for (; n && n.nodeType === 1 && n.tagName !== "HTML"; ) {
|
|
3671
|
-
const o = n.localName, r =
|
|
3671
|
+
const o = n.localName, r = No(n)[0];
|
|
3672
3672
|
t.unshift(r ? `${o}.${r}` : o), n = n.parentElement;
|
|
3673
3673
|
}
|
|
3674
3674
|
return t.length > $n ? "… > " + t.slice(-$n).join(" > ") : t.join(" > ");
|
|
@@ -3703,7 +3703,7 @@ function Di(e) {
|
|
|
3703
3703
|
return t;
|
|
3704
3704
|
}
|
|
3705
3705
|
function Ft(e) {
|
|
3706
|
-
const t = e.localName, n = e.getAttribute("id"), o =
|
|
3706
|
+
const t = e.localName, n = e.getAttribute("id"), o = No(e).slice(0, 2);
|
|
3707
3707
|
let r = t;
|
|
3708
3708
|
n && (r += `#${Ht(n)}`);
|
|
3709
3709
|
for (const a of o) r += `.${a}`;
|
|
@@ -3717,7 +3717,7 @@ function Vi(e) {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
return {
|
|
3719
3719
|
summary: Ft(e),
|
|
3720
|
-
selector:
|
|
3720
|
+
selector: Ii(e),
|
|
3721
3721
|
breadcrumb: zi(e),
|
|
3722
3722
|
role: Ri(e),
|
|
3723
3723
|
text: Oi(e),
|
|
@@ -3811,7 +3811,7 @@ function Yi({ enabled: e }) {
|
|
|
3811
3811
|
l.current = t;
|
|
3812
3812
|
const c = de(null);
|
|
3813
3813
|
c.current = o;
|
|
3814
|
-
const d = de(null), u = de(null), p = de(null), m = de(0), h = de(null), v =
|
|
3814
|
+
const d = de(null), u = de(null), p = de(null), m = de(0), h = de(null), v = q(async (g) => {
|
|
3815
3815
|
const y = Hi(g), w = await Fi(y);
|
|
3816
3816
|
m.current += 1, i({
|
|
3817
3817
|
message: w ? `Copied path: ${Ft(g)}` : "Copy failed — clipboard unavailable",
|
|
@@ -3958,13 +3958,13 @@ function Yi({ enabled: e }) {
|
|
|
3958
3958
|
] });
|
|
3959
3959
|
}
|
|
3960
3960
|
function qi({ enabled: e }) {
|
|
3961
|
-
const t = vo
|
|
3961
|
+
const t = wo(vo);
|
|
3962
3962
|
return t ? Wt(/* @__PURE__ */ s(Yi, { enabled: e }), t) : null;
|
|
3963
3963
|
}
|
|
3964
3964
|
function Gi({ children: e }) {
|
|
3965
|
-
const [t, n] = $e(Si), o =
|
|
3965
|
+
const [t, n] = $e(Si), o = q((i) => {
|
|
3966
3966
|
n(i), Nn(i);
|
|
3967
|
-
}, []), r =
|
|
3967
|
+
}, []), r = q(() => {
|
|
3968
3968
|
n((i) => {
|
|
3969
3969
|
const l = !i;
|
|
3970
3970
|
return Nn(l), l;
|
|
@@ -3974,12 +3974,12 @@ function Gi({ children: e }) {
|
|
|
3974
3974
|
[t, o, r]
|
|
3975
3975
|
);
|
|
3976
3976
|
return /* @__PURE__ */ k(ae, { children: [
|
|
3977
|
-
/* @__PURE__ */ s(
|
|
3977
|
+
/* @__PURE__ */ s(xo.Provider, { value: a, children: e }),
|
|
3978
3978
|
/* @__PURE__ */ s(qi, { enabled: t })
|
|
3979
3979
|
] });
|
|
3980
3980
|
}
|
|
3981
3981
|
function Ui() {
|
|
3982
|
-
const e = Xt(
|
|
3982
|
+
const e = Xt(xo);
|
|
3983
3983
|
if (e === null) return null;
|
|
3984
3984
|
const { enabled: t, toggle: n } = e;
|
|
3985
3985
|
return /* @__PURE__ */ s(
|
|
@@ -4015,7 +4015,7 @@ function Ui() {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
);
|
|
4017
4017
|
}
|
|
4018
|
-
const
|
|
4018
|
+
const _o = jt(null);
|
|
4019
4019
|
function Ji({ state: e }) {
|
|
4020
4020
|
const t = de(null);
|
|
4021
4021
|
return ue(() => {
|
|
@@ -4042,11 +4042,11 @@ function Zi({ children: e }) {
|
|
|
4042
4042
|
visible: !1,
|
|
4043
4043
|
text: "",
|
|
4044
4044
|
triggerEl: null
|
|
4045
|
-
}), o = de(null), r =
|
|
4045
|
+
}), o = de(null), r = q((l, c) => {
|
|
4046
4046
|
o.current = l, n({ visible: !0, text: c, triggerEl: l });
|
|
4047
|
-
}, []), a =
|
|
4047
|
+
}, []), a = q((l) => {
|
|
4048
4048
|
o.current === l && (o.current = null, n({ visible: !1, text: "", triggerEl: null }));
|
|
4049
|
-
}, []), i =
|
|
4049
|
+
}, []), i = q(() => {
|
|
4050
4050
|
o.current = null, n({ visible: !1, text: "", triggerEl: null });
|
|
4051
4051
|
}, []);
|
|
4052
4052
|
return ue(() => {
|
|
@@ -4059,28 +4059,28 @@ function Zi({ children: e }) {
|
|
|
4059
4059
|
o.current && i();
|
|
4060
4060
|
}
|
|
4061
4061
|
return window.addEventListener("scroll", l, !0), () => window.removeEventListener("scroll", l, !0);
|
|
4062
|
-
}, [i]), /* @__PURE__ */ k(
|
|
4062
|
+
}, [i]), /* @__PURE__ */ k(_o.Provider, { value: { show: r, hide: a }, children: [
|
|
4063
4063
|
e,
|
|
4064
4064
|
typeof document < "u" && Wt(/* @__PURE__ */ s(Ji, { state: t }), document.body)
|
|
4065
4065
|
] });
|
|
4066
4066
|
}
|
|
4067
4067
|
function en(e) {
|
|
4068
|
-
const t = Xt(
|
|
4068
|
+
const t = Xt(_o), n = q(
|
|
4069
4069
|
(i) => {
|
|
4070
4070
|
t && t.show(i.currentTarget, e);
|
|
4071
4071
|
},
|
|
4072
4072
|
[t, e]
|
|
4073
|
-
), o =
|
|
4073
|
+
), o = q(
|
|
4074
4074
|
(i) => {
|
|
4075
4075
|
t && t.hide(i.currentTarget);
|
|
4076
4076
|
},
|
|
4077
4077
|
[t, e]
|
|
4078
|
-
), r =
|
|
4078
|
+
), r = q(
|
|
4079
4079
|
(i) => {
|
|
4080
4080
|
t && t.show(i.currentTarget, e);
|
|
4081
4081
|
},
|
|
4082
4082
|
[t, e]
|
|
4083
|
-
), a =
|
|
4083
|
+
), a = q(
|
|
4084
4084
|
(i) => {
|
|
4085
4085
|
t && t.hide(i.currentTarget);
|
|
4086
4086
|
},
|
|
@@ -4153,7 +4153,7 @@ const Sn = Ge(function({
|
|
|
4153
4153
|
}
|
|
4154
4154
|
),
|
|
4155
4155
|
i && /* @__PURE__ */ s(
|
|
4156
|
-
|
|
4156
|
+
po,
|
|
4157
4157
|
{
|
|
4158
4158
|
color: t,
|
|
4159
4159
|
onChange: u,
|
|
@@ -4303,7 +4303,7 @@ function tl({
|
|
|
4303
4303
|
), c = Z(
|
|
4304
4304
|
() => o ? pn(o) ?? null : null,
|
|
4305
4305
|
[o]
|
|
4306
|
-
), d =
|
|
4306
|
+
), d = Y().colorPresets ?? {}, u = Z(
|
|
4307
4307
|
() => ({ ...d, ...l.colorSchemes }),
|
|
4308
4308
|
[d, l.colorSchemes]
|
|
4309
4309
|
), p = Z(() => Object.keys(l.colorSchemes), [l.colorSchemes]), m = Z(() => Object.keys(d).sort(), [d]), h = l.label ?? l.id.toUpperCase(), v = c?.label ?? c?.id.toUpperCase() ?? "", C = R(
|
|
@@ -4353,8 +4353,8 @@ function tl({
|
|
|
4353
4353
|
(f) => {
|
|
4354
4354
|
const E = u[f];
|
|
4355
4355
|
if (!E) return;
|
|
4356
|
-
const S =
|
|
4357
|
-
n(() => S),
|
|
4356
|
+
const S = Pn(E);
|
|
4357
|
+
n(() => S), Vo(S.shikiTheme);
|
|
4358
4358
|
},
|
|
4359
4359
|
[n]
|
|
4360
4360
|
);
|
|
@@ -5174,18 +5174,18 @@ function gl({ tab: e, overrides: t, onChange: n }) {
|
|
|
5174
5174
|
}) });
|
|
5175
5175
|
}
|
|
5176
5176
|
function kl(e, t) {
|
|
5177
|
-
const n =
|
|
5177
|
+
const n = q(
|
|
5178
5178
|
(u) => {
|
|
5179
5179
|
e((p) => {
|
|
5180
5180
|
if (!p) return p;
|
|
5181
5181
|
const m = u(p);
|
|
5182
|
-
return lt(m, t),
|
|
5182
|
+
return lt(m, t), In(m, void 0, t), m;
|
|
5183
5183
|
});
|
|
5184
5184
|
},
|
|
5185
5185
|
// cfg is intentionally included so the callback re-binds when the
|
|
5186
5186
|
// config reference changes (e.g. hot-reload in dev).
|
|
5187
5187
|
[e, t]
|
|
5188
|
-
), o =
|
|
5188
|
+
), o = q(
|
|
5189
5189
|
(u, p) => {
|
|
5190
5190
|
n((m) => {
|
|
5191
5191
|
const h = m.tabs?.[u] ?? {}, v = p(h);
|
|
@@ -5199,32 +5199,32 @@ function kl(e, t) {
|
|
|
5199
5199
|
});
|
|
5200
5200
|
},
|
|
5201
5201
|
[n]
|
|
5202
|
-
), r =
|
|
5202
|
+
), r = q(
|
|
5203
5203
|
(u) => {
|
|
5204
5204
|
n((p) => ({ ...p, color: u(p.color) }));
|
|
5205
5205
|
},
|
|
5206
5206
|
[n]
|
|
5207
|
-
), a =
|
|
5207
|
+
), a = q(
|
|
5208
5208
|
(u) => {
|
|
5209
5209
|
n((p) => ({ ...p, spacing: u(p.spacing) }));
|
|
5210
5210
|
},
|
|
5211
5211
|
[n]
|
|
5212
|
-
), i =
|
|
5212
|
+
), i = q(
|
|
5213
5213
|
(u) => {
|
|
5214
5214
|
n((p) => ({ ...p, typography: u(p.typography) }));
|
|
5215
5215
|
},
|
|
5216
5216
|
[n]
|
|
5217
|
-
), l =
|
|
5217
|
+
), l = q(
|
|
5218
5218
|
(u) => {
|
|
5219
5219
|
n((p) => ({ ...p, size: u(p.size) }));
|
|
5220
5220
|
},
|
|
5221
5221
|
[n]
|
|
5222
|
-
), c =
|
|
5222
|
+
), c = q(
|
|
5223
5223
|
(u) => {
|
|
5224
5224
|
n((p) => ({ ...p, panelPosition: u(p.panelPosition) }));
|
|
5225
5225
|
},
|
|
5226
5226
|
[n]
|
|
5227
|
-
), d =
|
|
5227
|
+
), d = q(
|
|
5228
5228
|
(u) => {
|
|
5229
5229
|
n((p) => {
|
|
5230
5230
|
const m = u(p.secondary);
|
|
@@ -5280,9 +5280,9 @@ function wl({
|
|
|
5280
5280
|
instanceConfig: e
|
|
5281
5281
|
} = {}) {
|
|
5282
5282
|
const t = Z(
|
|
5283
|
-
() => e ??
|
|
5283
|
+
() => e ?? Y(),
|
|
5284
5284
|
[e]
|
|
5285
|
-
), n = ht(), [o, r] = K(!1), [a, i] = K(!1), [l, c] = K(!1), [d, u] = K(!1), [p, m] = K(!1), h = B(null), [v, C] = K(null), [b, N] = K(bl), [g, y] = K(ln), [w, _] = K(
|
|
5285
|
+
), n = ht(), [o, r] = K(!1), [a, i] = K(!1), [l, c] = K(!1), [d, u] = K(!1), [p, m] = K(!1), h = B(null), [v, C] = K(null), [b, N] = K(bl), [g, y] = K(ln), [w, _] = K(Bo), [x, f] = K(Ho), [E, S] = K(!1), O = B(null), j = B({
|
|
5286
5286
|
spacing: null,
|
|
5287
5287
|
font: null,
|
|
5288
5288
|
size: null,
|
|
@@ -5297,14 +5297,14 @@ function wl({
|
|
|
5297
5297
|
localStorage.getItem(We(t)) === "1" && r(!0);
|
|
5298
5298
|
} catch {
|
|
5299
5299
|
}
|
|
5300
|
-
const T =
|
|
5300
|
+
const T = Fo(t);
|
|
5301
5301
|
y(T), D.current = T;
|
|
5302
|
-
const F =
|
|
5303
|
-
_(F), G.current = F, f(
|
|
5302
|
+
const F = jo(t);
|
|
5303
|
+
_(F), G.current = F, f(Ko(t)), S(window.innerWidth < Ke);
|
|
5304
5304
|
}, []);
|
|
5305
5305
|
const ee = R(
|
|
5306
5306
|
(T) => {
|
|
5307
|
-
f(T),
|
|
5307
|
+
f(T), Wo(T, t);
|
|
5308
5308
|
},
|
|
5309
5309
|
[t]
|
|
5310
5310
|
);
|
|
@@ -5340,7 +5340,7 @@ function wl({
|
|
|
5340
5340
|
};
|
|
5341
5341
|
}, [t]), X(() => {
|
|
5342
5342
|
function T() {
|
|
5343
|
-
|
|
5343
|
+
Yo(void 0, void 0, t), C(
|
|
5344
5344
|
(F) => F ? {
|
|
5345
5345
|
...F,
|
|
5346
5346
|
color: je(ge(t)),
|
|
@@ -5424,9 +5424,9 @@ function wl({
|
|
|
5424
5424
|
}
|
|
5425
5425
|
return window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
5426
5426
|
}, [t]);
|
|
5427
|
-
const
|
|
5427
|
+
const I = R(
|
|
5428
5428
|
(T) => {
|
|
5429
|
-
lt(T, t),
|
|
5429
|
+
lt(T, t), In(T, void 0, t), C(T);
|
|
5430
5430
|
},
|
|
5431
5431
|
[t]
|
|
5432
5432
|
), re = R(() => {
|
|
@@ -5438,7 +5438,7 @@ function wl({
|
|
|
5438
5438
|
for (const F of t.tabs)
|
|
5439
5439
|
T[F.id] = F;
|
|
5440
5440
|
return T;
|
|
5441
|
-
}, []), ce = R(
|
|
5441
|
+
}, [t]), ce = R(
|
|
5442
5442
|
(T) => {
|
|
5443
5443
|
const F = V.findIndex((z) => z.id === b);
|
|
5444
5444
|
if (F === -1) return;
|
|
@@ -5482,7 +5482,7 @@ function wl({
|
|
|
5482
5482
|
// `--tokenpanel-grid-min` is read by .tokenpanel-tab-grid /
|
|
5483
5483
|
// .tokenpanel-tab-advanced-grid; switching the variable rewires the
|
|
5484
5484
|
// min-card-width without re-rendering the grids.
|
|
5485
|
-
"--tokenpanel-grid-min":
|
|
5485
|
+
"--tokenpanel-grid-min": Xo(x)
|
|
5486
5486
|
},
|
|
5487
5487
|
children: [
|
|
5488
5488
|
/* @__PURE__ */ k(
|
|
@@ -5734,7 +5734,7 @@ function wl({
|
|
|
5734
5734
|
br,
|
|
5735
5735
|
{
|
|
5736
5736
|
onClose: () => c(!1),
|
|
5737
|
-
onLoad:
|
|
5737
|
+
onLoad: I,
|
|
5738
5738
|
colorDefaults: je(ge(t)),
|
|
5739
5739
|
instanceConfig: t
|
|
5740
5740
|
}
|
|
@@ -5761,34 +5761,34 @@ function wl({
|
|
|
5761
5761
|
})() }) }) });
|
|
5762
5762
|
}
|
|
5763
5763
|
const xl = ':where(.tokenpanel-shell,[data-design-token-panel-modal],.tokenpanel-highlight-settings-popover,.tokenpanel-color-picker,.tokenpanel-tooltip,.tokenpanel-elpath-label,.tokenpanel-elpath-toast){--tokentweak-color-fg: #b8b8b8;--tokentweak-color-bg: #181818;--tokentweak-color-muted: #888888;--tokentweak-color-surface: #1c1c1c;--tokentweak-color-accent: #d69a66;--tokentweak-color-accent-hover: #a7c0e3;--tokentweak-color-code-bg: #383838;--tokentweak-color-code-fg: #e0e0e0;--tokentweak-color-success: #93bb77;--tokentweak-color-danger: #da6871;--tokentweak-color-warning: #dfbb77;--tokentweak-font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--tokentweak-pad-2xs: .125rem;--tokentweak-pad-xs: .375rem;--tokentweak-pad-sm: .5rem;--tokentweak-pad-md: .75rem;--tokentweak-pad-lg: 1rem;--tokentweak-pad-xl: 1.5rem;--tokentweak-pad-2xl: 2rem;--tokentweak-gap-2xs: .4375rem;--tokentweak-gap-xs: .875rem;--tokentweak-gap-sm: 1.25rem;--tokentweak-gap-md: 1.5rem;--tokentweak-gap-lg: 1.75rem;--tokentweak-gap-xl: 2.5rem;--tokentweak-gap-2xl: 3.5rem;--tokentweak-text-micro: .75rem;--tokentweak-text-caption: .875rem;--tokentweak-text-small: 1rem;--tokentweak-text-body: 1.2rem;--tokentweak-text-subheading: 1.4rem;--tokentweak-text-heading: 3rem;--tokentweak-text-display: 3.75rem;--radius-tokentweak: .25rem}.tokenpanel-color-picker{position:fixed;width:320px;padding:var(--tokentweak-pad-md);background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);box-shadow:0 8px 24px #0006;display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs);z-index:70;color:var(--tokentweak-color-fg);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker[data-mode-shell=expanded]{width:520px;padding:var(--tokentweak-pad-lg);gap:var(--tokentweak-gap-xs)}.tokenpanel-color-picker-header{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-drag-handle{flex-shrink:0;cursor:grab;color:var(--tokentweak-color-muted);font-size:var(--tokentweak-text-caption);line-height:1;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-drag-handle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-drag-handle:active{cursor:grabbing}.tokenpanel-color-picker-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption)}.tokenpanel-color-picker-mode-toggle{display:flex;align-items:center;gap:2px;background:var(--tokentweak-color-bg);border:1px solid var(--tokentweak-color-muted);border-radius:999px;padding:2px;flex-shrink:0}.tokenpanel-color-picker-mode-btn{border-radius:999px;padding-inline:var(--tokentweak-pad-xs);padding-block:var(--tokentweak-pad-2xs);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .12s ease,color .12s ease;white-space:nowrap}.tokenpanel-color-picker-mode-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn[aria-pressed=true]{background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-mode-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-expand-btn{flex-shrink:0;color:var(--tokentweak-color-muted);cursor:pointer;-webkit-user-select:none;user-select:none;padding:var(--tokentweak-pad-2xs);border-radius:var(--radius-tokentweak);transition:color .12s ease}.tokenpanel-color-picker-expand-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-expand-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-top-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-preview{position:relative;flex-shrink:0;width:3rem;height:3rem;border-radius:var(--radius-tokentweak);border:1px solid var(--tokentweak-color-muted);overflow:hidden}.tokenpanel-color-picker-preview-checkerboard{position:absolute;inset:0;background-image:repeating-conic-gradient(gray 0% 25%,silver 0% 50%);background-size:10px 10px}.tokenpanel-color-picker-preview-color{position:absolute;inset:0}.tokenpanel-color-picker-hex-input{flex:1;min-width:0;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-caption);background:var(--tokentweak-color-bg);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding:var(--tokentweak-pad-2xs) var(--tokentweak-pad-xs);transition:border-color .12s ease}.tokenpanel-color-picker-hex-input:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-hex-input:focus{border-color:var(--tokentweak-color-accent);outline:none}.tokenpanel-color-picker-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:2px}.tokenpanel-color-picker-grid>[role=row]{display:contents}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-grid{grid-template-columns:repeat(12,1fr)}.tokenpanel-color-picker-grid-cell{position:relative;aspect-ratio:1;border-radius:var(--radius-tokentweak);cursor:pointer;transition:box-shadow .12s ease}.tokenpanel-color-picker-grid-cell:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-color-picker-grid-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-color-picker-grid-cell:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-picker-grid-cell[data-oog=true]:after{content:"";position:absolute;inset:1px;border:1px dashed oklch(98% 0 0 / .4);border-radius:var(--radius-tokentweak);pointer-events:none}.tokenpanel-color-picker-sliders{display:flex;flex-direction:column;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-row{display:flex;align-items:center;gap:var(--tokentweak-gap-2xs)}.tokenpanel-color-picker-slider-label{flex-shrink:0;width:1.25rem;font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);-webkit-user-select:none;user-select:none}.tokenpanel-color-picker-slider{flex:1;position:relative;height:18px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.tokenpanel-color-picker-slider:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:var(--radius-tokentweak)}.tokenpanel-color-picker-slider-track{width:100%;height:18px;border-radius:9px;overflow:hidden;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-color-picker-slider-thumb{position:absolute;top:50%;transform:translate(-50%,-50%);width:14px;height:14px;border-radius:50%;background:var(--tokentweak-color-fg);border:2px solid var(--tokentweak-color-bg);box-shadow:0 0 0 1px var(--tokentweak-color-muted);pointer-events:none}.tokenpanel-color-picker-slider-value{flex-shrink:0;width:3rem;text-align:right;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-fg)}.tokenpanel-color-picker-readout{display:none;font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-micro);color:var(--tokentweak-color-muted);padding-top:var(--tokentweak-pad-2xs);border-top:1px solid var(--tokentweak-color-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tokenpanel-color-picker[data-mode-shell=expanded] .tokenpanel-color-picker-readout{display:block}.tokenpanel-shell{z-index:50;display:flex;flex-direction:column;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);border-radius:var(--radius-tokentweak);box-shadow:0 4px 24px #00000040}.tokenpanel-resize-handle{position:absolute;right:2px;bottom:2px;width:16px;height:16px;cursor:nwse-resize;-webkit-user-select:none;user-select:none;background-image:repeating-linear-gradient(-45deg,transparent 0,transparent 2px,var(--tokentweak-color-muted) 2px,var(--tokentweak-color-muted) 3px);-webkit-mask-image:linear-gradient(135deg,transparent 50%,#000 50%);mask-image:linear-gradient(135deg,transparent 50%,#000 50%);border-bottom-right-radius:var(--radius-tokentweak);transition:opacity .15s ease;opacity:.7}.tokenpanel-resize-handle:hover,.tokenpanel-resize-handle:focus-visible{opacity:1}.tokenpanel-header{display:flex;align-items:center;gap:var(--tokentweak-pad-md);padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-xs);border-bottom:1px solid var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-title{color:var(--tokentweak-color-fg);font-weight:600;font-size:.875rem;flex-shrink:0}.tokenpanel-action-link{color:var(--tokentweak-color-accent);font-size:.75rem;background:none;border:none;padding:0;cursor:pointer;transition:color .15s ease}.tokenpanel-action-link:hover{color:var(--tokentweak-color-accent-hover)}.tokenpanel-spacer{flex:1}.tokenpanel-close-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-close-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-tabbar{display:flex;align-items:center;border-bottom:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-xl);flex-shrink:0;gap:var(--tokentweak-pad-md)}.tokenpanel-tabbar-tabs{display:flex;align-items:center;gap:2px;flex:1;min-width:0}.tokenpanel-tab-button{border:none;background:none;padding-inline:var(--tokentweak-pad-md);padding-block:var(--tokentweak-gap-xs);font-size:.875rem;cursor:pointer;border-bottom:2px solid transparent;color:var(--tokentweak-color-muted);transition:color .15s ease,border-color .15s ease}.tokenpanel-tab-button:hover,.tokenpanel-tab-button:focus-visible{color:var(--tokentweak-color-fg);text-decoration:underline}.tokenpanel-tab-button.is-active{color:var(--tokentweak-color-fg);border-bottom-color:var(--tokentweak-color-accent);text-decoration:none}.tokenpanel-density{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);flex-shrink:0}.tokenpanel-density-label{color:var(--tokentweak-color-muted);font-size:.6875rem;text-transform:uppercase;letter-spacing:.05em;-webkit-user-select:none;user-select:none;cursor:pointer}.tokenpanel-density-slider{width:5rem;accent-color:var(--tokentweak-color-accent);cursor:pointer}.tokenpanel-body{flex:1;min-height:0;overflow-y:auto;padding-inline:var(--tokentweak-pad-xl);padding-block:var(--tokentweak-gap-sm)}.tokenpanel-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:12rem;padding-block:var(--tokentweak-gap-md);padding-inline:var(--tokentweak-pad-xl)}.tokenpanel-empty-state-text{color:var(--tokentweak-color-muted, #a8a8a8);font-size:.8125rem;line-height:1.5;max-width:32rem;margin:0}.tokenpanel-empty-state-text code{font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:.8125rem;color:var(--tokentweak-color-fg)}.tokenpanel-empty-state-link{color:var(--tokentweak-color-accent);text-decoration:underline;transition:color .15s ease}.tokenpanel-empty-state-link:hover,.tokenpanel-empty-state-link:focus-visible{color:var(--tokentweak-color-accent-hover)}.tokenpanel-tab-content{display:flex;flex-direction:column;gap:var(--tokentweak-gap-sm)}.tokenpanel-tab-actions{display:flex;align-items:center;gap:var(--tokentweak-pad-md)}.tokenpanel-tab-section{position:relative;flex-shrink:0;border:1px solid var(--tokentweak-color-muted);border-radius:.5rem;padding:18px 14px 14px}.tokenpanel-tab-section-heading{position:absolute;top:-.625rem;left:12px;background:var(--tokentweak-color-surface);padding:0 8px;margin:0;color:var(--tokentweak-color-fg);font-family:inherit;font-weight:600;font-size:.8125rem;line-height:1.25rem;text-transform:none;letter-spacing:normal}.tokenpanel-tab-section-heading--color{font-size:.875rem}.tokenpanel-tab-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 18rem),1fr));gap:var(--tokentweak-gap-xs)}.tokenpanel-color-preset-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:2px;font-size:.75rem;border-radius:var(--radius-tokentweak);max-width:14rem;cursor:pointer;transition:border-color .15s ease}.tokenpanel-color-preset-select:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-palette-grid,.tokenpanel-color-palette-grid--secondary{display:grid;grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr));gap:var(--tokentweak-pad-sm)}.tokenpanel-color-base-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--tokenpanel-grid-min, 11rem),1fr));gap:6px}.tokenpanel-color-swatch-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:100%}.tokenpanel-color-swatch-button{display:block;border:1px solid var(--tokentweak-color-muted);cursor:pointer;width:3.5rem;height:3.5rem;border-radius:var(--radius-tokentweak);background:none;padding:0;transition:border-color .15s ease}.tokenpanel-color-swatch-button:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-color-swatch-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-color-swatch-label-row{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}.tokenpanel-color-swatch-label{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.6875rem;line-height:1.1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-tooltip{position:fixed;z-index:9999;pointer-events:none;background:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:4px;padding:4px 8px;font-family:var(--tokentweak-font-mono);font-size:11px;line-height:1.3;white-space:nowrap;box-shadow:0 4px 12px #00000080;opacity:0;transform:translateY(2px);transition:opacity 90ms ease,transform 90ms ease}.tokenpanel-tooltip[data-show=true]{opacity:1;transform:translateY(0)}.tokenpanel-popover{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:12px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-selector{position:relative;width:100%;display:flex;align-items:center;gap:6px}.tokenpanel-palette-trigger{display:flex;align-items:center;gap:4px;flex:1;min-width:0;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding-inline:6px;padding-block:4px;font-size:.75rem;border-radius:var(--radius-tokentweak);cursor:pointer;transition:border-color .15s ease}.tokenpanel-palette-trigger:hover{border-color:var(--tokentweak-color-fg)}.tokenpanel-palette-trigger:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-palette-trigger-label{flex:1;min-width:0;text-align:left;color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-palette-trigger-color{flex-shrink:0;border:1px solid var(--tokentweak-color-muted);width:14px;height:14px;border-radius:2px}.tokenpanel-palette-trigger-value{flex-shrink:0;color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);width:2.5em}.tokenpanel-palette-trigger-icon{color:var(--tokentweak-color-muted);flex-shrink:0}.tokenpanel-palette-options{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);padding:10px;border-radius:var(--radius-tokentweak);box-shadow:0 4px 12px #0000004d}.tokenpanel-palette-options-extras{display:flex;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-option{display:flex;align-items:center;gap:6px;padding-inline:8px;padding-block:4px;border-radius:4px;font-size:1rem;background:none;border:none;cursor:pointer;transition:background-color .15s ease}.tokenpanel-palette-extra-option:hover{background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-palette-extra-option.is-selected{background-color:rgb(from var(--tokentweak-color-accent) r g b / .2)}.tokenpanel-palette-extra-color{width:1.75rem;height:1.75rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted)}.tokenpanel-palette-extra-label{color:var(--tokentweak-color-fg)}.tokenpanel-palette-options-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.tokenpanel-palette-option-button{width:3rem;height:3rem;border-radius:3px;border:1px solid var(--tokentweak-color-muted);cursor:pointer;padding:0;transition:box-shadow .15s ease}.tokenpanel-palette-option-button:hover{box-shadow:0 0 0 2px var(--tokentweak-color-fg)}.tokenpanel-palette-option-button.is-selected{box-shadow:0 0 0 2px var(--tokentweak-color-accent)}.tokenpanel-row{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row--stacked{display:flex;flex-direction:column;gap:2px}.tokenpanel-row--column{display:flex;flex-direction:column;gap:4px}.tokenpanel-row-head{display:flex;align-items:center;gap:var(--tokentweak-pad-sm)}.tokenpanel-row-label{color:var(--tokentweak-color-fg);font-family:var(--tokentweak-font-mono);flex:1;min-width:0;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-row-input-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-row-number-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);text-align:right;font-size:.75rem;width:5rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-number-input:disabled{opacity:.6}.tokenpanel-row-number-input--invalid{border-color:#e05252;color:#e05252}.tokenpanel-row-unit{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);-webkit-user-select:none;user-select:none;font-size:.75rem;width:2rem}.tokenpanel-row-select{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;width:7rem;border-radius:var(--radius-tokentweak)}.tokenpanel-row-select:disabled{opacity:.6}.tokenpanel-row-text-input{background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);padding-inline:6px;padding-block:2px;font-family:var(--tokentweak-font-mono);font-size:.75rem;flex:1;min-width:0;border-radius:var(--radius-tokentweak)}.tokenpanel-row-text-input:disabled{opacity:.6}.tokenpanel-pill-toggle{display:flex;align-items:center;gap:var(--tokentweak-pad-xs);flex-shrink:0;cursor:pointer}.tokenpanel-pill-toggle-checkbox{accent-color:var(--tokentweak-color-accent)}.tokenpanel-pill-toggle-text{color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);font-size:.75rem}[data-design-token-panel-modal]{margin-inline:auto;width:100%;max-width:46rem;max-height:80vh;overflow-y:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);padding:var(--tokentweak-pad-xl);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-user-select:text;user-select:text}[data-design-token-panel-modal]::backdrop{background-color:rgb(from var(--tokentweak-color-bg) r g b / .8)}[data-design-token-panel-modal] [class*=__header]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--tokentweak-pad-md);margin-bottom:var(--tokentweak-gap-sm)}[data-design-token-panel-modal] [class*=__title]{font-size:var(--tokentweak-text-subheading);font-weight:700;color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__hint]{font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-muted);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__section-heading]{font-size:var(--tokentweak-text-small);font-weight:700;color:var(--tokentweak-color-fg);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__list]:not([class*=__list-item]){overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__list-item]{font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__actions]{display:flex;align-items:center;gap:var(--tokentweak-pad-md);margin-top:var(--tokentweak-gap-md)}[data-design-token-panel-modal] [class*=__toggle]{display:inline-flex;align-items:center;gap:var(--tokentweak-pad-xs);font-size:var(--tokentweak-text-small);color:var(--tokentweak-color-fg);cursor:pointer;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__textarea]{width:100%;min-height:12rem;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-family:var(--tokentweak-font-mono);font-size:var(--tokentweak-text-small);resize:vertical;margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__json]{overflow-x:auto;border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-code-fg);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small);white-space:pre;font-family:var(--tokentweak-font-mono)}[data-design-token-panel-modal] [class*=__status]{font-size:var(--tokentweak-text-small);margin-bottom:var(--tokentweak-gap-xs)}[data-design-token-panel-modal] [class*=__status--info]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__status--error]{color:var(--tokentweak-color-danger)}[data-design-token-panel-modal] [class*=__status--warning]{color:var(--tokentweak-color-warning)}[data-design-token-panel-modal] [class*=__status--success]{color:var(--tokentweak-color-success)}[data-design-token-panel-modal] [class*=__applying]{display:flex;align-items:center;gap:var(--tokentweak-pad-sm);border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-code-bg);color:var(--tokentweak-color-muted);padding:var(--tokentweak-pad-sm);font-size:var(--tokentweak-text-small)}[data-design-token-panel-modal] [class*=__spinner]{display:inline-block;width:1rem;height:1rem;border:2px solid var(--tokentweak-color-muted);border-top-color:var(--tokentweak-color-fg);border-radius:50%;animation:design-token-panel-modal-spin .75s linear infinite}@keyframes design-token-panel-modal-spin{to{transform:rotate(360deg)}}[data-design-token-panel-modal] [class*=__revert-hint]{font-size:var(--tokentweak-text-small);font-style:italic;color:var(--tokentweak-color-muted);margin-top:var(--tokentweak-gap-sm);margin-bottom:var(--tokentweak-gap-2xs)}[data-design-token-panel-modal] [class*=__button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-lg);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease,background-color .15s ease}[data-design-token-panel-modal] [class*=__button]:hover,[data-design-token-panel-modal] [class*=__button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}[data-design-token-panel-modal] [class*=__button]:disabled{cursor:not-allowed;opacity:.5}[data-design-token-panel-modal] [class*=__button--primary]{border-color:var(--tokentweak-color-accent);background-color:var(--tokentweak-color-accent);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__button--primary]:hover,[data-design-token-panel-modal] [class*=__button--primary]:focus-visible{border-color:var(--tokentweak-color-accent-hover);background-color:var(--tokentweak-color-accent-hover);color:var(--tokentweak-color-bg)}[data-design-token-panel-modal] [class*=__close-button]{border:1px solid var(--tokentweak-color-muted);background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-muted);padding-inline:var(--tokentweak-pad-sm);padding-block:var(--tokentweak-gap-2xs);font-size:var(--tokentweak-text-small);cursor:pointer;transition:color .15s ease,border-color .15s ease}[data-design-token-panel-modal] [class*=__close-button]:hover,[data-design-token-panel-modal] [class*=__close-button]:focus-visible{color:var(--tokentweak-color-fg);border-color:var(--tokentweak-color-fg)}.tokenpanel-tier-ref-selector{flex:1;min-width:0}select.tokenpanel-tier-ref-select{width:100%;background-color:var(--tokentweak-color-surface);color:var(--tokentweak-color-fg);border:1px solid var(--tokentweak-color-muted);border-radius:var(--radius-tokentweak);padding-inline:var(--tokentweak-pad-sm);padding-block:4px;font-family:var(--tokentweak-font-mono);font-size:.75rem;cursor:pointer}select.tokenpanel-tier-ref-select:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-row-label-sub{display:block;font-size:var(--tokentweak-text-micro, .6875rem);color:var(--tokentweak-color-muted);font-family:var(--tokentweak-font-mono);line-height:1.2}.tokenpanel-tab-section [role=heading]{display:block}.tokenpanel-code{font-family:var(--tokentweak-font-mono);font-size:inherit;background:none;color:inherit;padding:0;border:none;border-radius:0;white-space:pre-wrap}[data-design-token-panel-modal] [class*=__button][aria-disabled=true]{cursor:not-allowed;opacity:.5;pointer-events:none}[data-design-token-panel-modal] [role=button]:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-action-link:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-close-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-tab-button:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-overlay{margin:0;padding:0;border:0;background:transparent;display:block}.tokenpanel-highlight-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;color:var(--tokentweak-color-muted);cursor:pointer;vertical-align:middle;border-radius:2px;transition:background-color .15s ease,color .15s ease}.tokenpanel-highlight-toggle:hover{color:var(--tokentweak-color-fg);background-color:rgb(from var(--tokentweak-color-fg) r g b / .1)}.tokenpanel-highlight-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-highlight-toggle.is-active{opacity:1}:where(.tokenpanel-shell) svg{fill:currentColor;pointer-events:none;display:inline-block;overflow:visible}:where(.tokenpanel-shell) .tokenpanel-highlight-toggle svg{fill:none;stroke:currentColor}.tokenpanel-highlight-settings-popover{width:370px;background:var(--tokentweak-color-surface);border:1px solid var(--tokentweak-color-muted);border-radius:6px;box-shadow:0 8px 32px #00000080}.tokenpanel-highlight-settings-header{padding:10px 16px;border-bottom:1px solid var(--tokentweak-color-muted);font-weight:600;font-size:.8125rem;color:var(--tokentweak-color-fg);display:flex;align-items:center;justify-content:space-between;gap:12px}.tokenpanel-highlight-settings-header-label{flex:1;min-width:0}.tokenpanel-highlight-settings-outline-control{display:flex;align-items:center;gap:4px;flex-shrink:0}.tokenpanel-highlight-settings-outline-input{width:44px;background:#222;border:1px solid var(--tokentweak-color-muted);border-radius:3px;color:var(--tokentweak-color-fg);font-size:12px;font-variant-numeric:tabular-nums;padding:3px 6px;text-align:right}.tokenpanel-highlight-settings-outline-px{color:var(--tokentweak-color-muted);font-size:12px;font-weight:400}.tokenpanel-highlight-settings-list{padding:4px 0;display:grid;grid-template-columns:1fr 1fr}.tokenpanel-highlight-settings-row{display:grid;grid-template-columns:22px 32px 1fr;gap:8px;align-items:center;padding:8px 12px}.tokenpanel-highlight-settings-row:hover{background:#ffffff08}.tokenpanel-highlight-settings-num{color:var(--tokentweak-color-muted);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.tokenpanel-highlight-settings-ring{width:28px;height:28px;border-radius:3px;background:transparent;box-sizing:border-box;cursor:pointer;flex-shrink:0}.tokenpanel-highlight-settings-ring:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px}.tokenpanel-highlight-settings-name{font-family:var(--tokentweak-font-mono);font-size:12px;color:var(--tokentweak-color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-highlight-settings-name.is-active{color:var(--tokentweak-color-fg)}.tokenpanel-highlight-settings-footer{padding:12px 16px;border-top:1px solid var(--tokentweak-color-muted);display:flex;justify-content:flex-end;gap:var(--tokentweak-pad-sm)}.tokenpanel-highlight-settings-reset-btn{padding:6px 12px;background:#333;border:1px solid var(--tokentweak-color-muted);border-radius:3px;cursor:pointer;font-size:12px;color:var(--tokentweak-color-fg);transition:background .15s ease}.tokenpanel-highlight-settings-reset-btn:hover{background:#404040}.tokenpanel-highlight-settings-reset-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:3px}.tokenpanel-gear-btn{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-gear-btn:hover{color:var(--tokentweak-color-fg)}.tokenpanel-gear-btn:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle{color:var(--tokentweak-color-muted);background:none;border:none;padding:0;cursor:pointer;flex-shrink:0;transition:color .15s ease;display:inline-flex;align-items:center;justify-content:center}.tokenpanel-elpath-toggle:hover{color:var(--tokentweak-color-fg)}.tokenpanel-elpath-toggle:focus-visible{outline:2px solid var(--tokentweak-color-accent);outline-offset:2px;border-radius:2px}.tokenpanel-elpath-toggle.is-active{color:var(--tokentweak-color-accent)}:where(.tokenpanel-shell) .tokenpanel-elpath-toggle svg{fill:none;stroke:currentColor}html.tokenpanel-elpath-inspecting,html.tokenpanel-elpath-inspecting *{cursor:crosshair!important;-webkit-user-select:none!important;user-select:none!important}.tokenpanel-elpath-box{margin:0;padding:0;border:0;pointer-events:none;box-sizing:border-box;background:#6fa8dc40;outline:1px solid rgb(111 168 220 / .9);outline-offset:-1px;box-shadow:inset 0 0 0 1px #6fa8dce6}.tokenpanel-elpath-label{pointer-events:none;display:inline-flex;align-items:baseline;gap:8px;max-width:90vw;padding:2px 6px;border-radius:3px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 1px 3px #0006}.tokenpanel-elpath-label-name{color:var(--tokentweak-color-accent, #d69a66);font-weight:600;overflow:hidden;text-overflow:ellipsis}.tokenpanel-elpath-label-size{color:var(--tokentweak-color-muted, #888888);flex-shrink:0}.tokenpanel-elpath-toast{pointer-events:none;display:inline-flex;align-items:center;gap:8px;margin:12px auto 0;padding:8px 14px;border-radius:6px;background:var(--tokentweak-color-surface, #1c1c1c);color:var(--tokentweak-color-fg, #b8b8b8);font-family:var(--tokentweak-font-mono, Menlo, Monaco, Consolas, monospace);font-size:12px;line-height:1.4;max-width:min(90vw,520px);box-shadow:0 4px 16px #00000073;border:1px solid rgb(255 255 255 / .08)}.tokenpanel-elpath-toast .tokenpanel-elpath-toast-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tokenpanel-elpath-toast svg{flex-shrink:0;fill:none;stroke:var(--tokentweak-color-success, #93bb77);pointer-events:none;display:inline-block;overflow:visible}.tokenpanel-elpath-toast.is-error svg{stroke:var(--tokentweak-color-danger, #da6871)}';
|
|
5764
|
-
function
|
|
5764
|
+
function Dl(e) {
|
|
5765
5765
|
return e.kind === "length";
|
|
5766
5766
|
}
|
|
5767
|
-
function
|
|
5767
|
+
function Vl(e) {
|
|
5768
5768
|
return e.kind === "number";
|
|
5769
5769
|
}
|
|
5770
|
-
function
|
|
5770
|
+
function Bl(e) {
|
|
5771
5771
|
return e.kind === "select";
|
|
5772
5772
|
}
|
|
5773
|
-
function
|
|
5773
|
+
function Hl(e) {
|
|
5774
5774
|
return e.kind === "text";
|
|
5775
5775
|
}
|
|
5776
|
-
function
|
|
5776
|
+
function Fl(e) {
|
|
5777
5777
|
return e.kind === "cursor";
|
|
5778
5778
|
}
|
|
5779
|
-
function
|
|
5779
|
+
function jl(e) {
|
|
5780
5780
|
return e.kind === "content";
|
|
5781
5781
|
}
|
|
5782
|
-
function
|
|
5782
|
+
function Kl(e) {
|
|
5783
5783
|
return e.kind === "mask-image";
|
|
5784
5784
|
}
|
|
5785
|
-
function
|
|
5785
|
+
function Wl(e) {
|
|
5786
5786
|
return e.kind === "color";
|
|
5787
5787
|
}
|
|
5788
|
-
function _o(e) {
|
|
5789
|
-
return or(e);
|
|
5790
|
-
}
|
|
5791
5788
|
function $o(e) {
|
|
5789
|
+
return rr(e);
|
|
5790
|
+
}
|
|
5791
|
+
function Co(e) {
|
|
5792
5792
|
return Rn(e);
|
|
5793
5793
|
}
|
|
5794
5794
|
const An = "toggle-color-tweak-panel";
|
|
@@ -5798,14 +5798,14 @@ function mt(e) {
|
|
|
5798
5798
|
function bt(e, t) {
|
|
5799
5799
|
if (!(typeof window > "u"))
|
|
5800
5800
|
try {
|
|
5801
|
-
window.localStorage.setItem(
|
|
5801
|
+
window.localStorage.setItem(Co(e), t ? "1" : "0");
|
|
5802
5802
|
} catch {
|
|
5803
5803
|
}
|
|
5804
5804
|
}
|
|
5805
|
-
function
|
|
5805
|
+
function Eo(e) {
|
|
5806
5806
|
if (typeof window > "u") return !1;
|
|
5807
5807
|
try {
|
|
5808
|
-
return window.localStorage.getItem(
|
|
5808
|
+
return window.localStorage.getItem(Co(e)) === "1";
|
|
5809
5809
|
} catch {
|
|
5810
5810
|
return !1;
|
|
5811
5811
|
}
|
|
@@ -5814,12 +5814,12 @@ function yl(e) {
|
|
|
5814
5814
|
if (typeof window > "u") return !1;
|
|
5815
5815
|
try {
|
|
5816
5816
|
const t = window.localStorage;
|
|
5817
|
-
return t.getItem(
|
|
5817
|
+
return t.getItem(qo(e)) !== null || t.getItem(Go(e)) !== null;
|
|
5818
5818
|
} catch {
|
|
5819
5819
|
return !1;
|
|
5820
5820
|
}
|
|
5821
5821
|
}
|
|
5822
|
-
function
|
|
5822
|
+
function So(e) {
|
|
5823
5823
|
if (typeof window > "u") return !1;
|
|
5824
5824
|
try {
|
|
5825
5825
|
return window.localStorage.getItem(We(e)) === "1";
|
|
@@ -5836,7 +5836,7 @@ function vt(e, t) {
|
|
|
5836
5836
|
}
|
|
5837
5837
|
}
|
|
5838
5838
|
function Oe(e) {
|
|
5839
|
-
return typeof document > "u" ? null : document.getElementById(
|
|
5839
|
+
return typeof document > "u" ? null : document.getElementById($o(e));
|
|
5840
5840
|
}
|
|
5841
5841
|
const Ln = "zudo-design-token-panel-styles";
|
|
5842
5842
|
function Nl() {
|
|
@@ -5847,7 +5847,7 @@ function Nl() {
|
|
|
5847
5847
|
function wt(e) {
|
|
5848
5848
|
if (typeof document > "u") return !1;
|
|
5849
5849
|
an(e);
|
|
5850
|
-
const t =
|
|
5850
|
+
const t = $o(e);
|
|
5851
5851
|
if (document.getElementById(t)) return !1;
|
|
5852
5852
|
Nl();
|
|
5853
5853
|
const n = document.createElement("div");
|
|
@@ -5857,8 +5857,8 @@ function _l(e) {
|
|
|
5857
5857
|
const t = Oe(e);
|
|
5858
5858
|
t && (Kt(null, t), t.remove());
|
|
5859
5859
|
}
|
|
5860
|
-
function
|
|
5861
|
-
return
|
|
5860
|
+
function Xl() {
|
|
5861
|
+
return Y();
|
|
5862
5862
|
}
|
|
5863
5863
|
function nn(e) {
|
|
5864
5864
|
if (typeof window > "u") return;
|
|
@@ -5870,21 +5870,21 @@ function on(e) {
|
|
|
5870
5870
|
const t = !Oe(e);
|
|
5871
5871
|
vt(e, !1), wt(e), bt(e, !1), !t && mt(e);
|
|
5872
5872
|
}
|
|
5873
|
-
function
|
|
5873
|
+
function To(e) {
|
|
5874
5874
|
if (typeof window > "u") return;
|
|
5875
|
-
const t = !
|
|
5875
|
+
const t = !So(e), n = !Oe(e);
|
|
5876
5876
|
vt(e, t), wt(e), bt(e, t), !n && mt(e);
|
|
5877
5877
|
}
|
|
5878
|
-
function Xl() {
|
|
5879
|
-
nn(q());
|
|
5880
|
-
}
|
|
5881
5878
|
function Yl() {
|
|
5882
|
-
|
|
5879
|
+
nn(Y());
|
|
5883
5880
|
}
|
|
5884
5881
|
function ql() {
|
|
5885
|
-
|
|
5882
|
+
on(Y());
|
|
5883
|
+
}
|
|
5884
|
+
function Gl() {
|
|
5885
|
+
To(Y());
|
|
5886
5886
|
}
|
|
5887
|
-
function
|
|
5887
|
+
function Mo() {
|
|
5888
5888
|
if (!(typeof window > "u"))
|
|
5889
5889
|
try {
|
|
5890
5890
|
const e = zn();
|
|
@@ -5893,17 +5893,17 @@ function To() {
|
|
|
5893
5893
|
}
|
|
5894
5894
|
}
|
|
5895
5895
|
function Ye() {
|
|
5896
|
-
const e =
|
|
5896
|
+
const e = Y(), t = Oe(e);
|
|
5897
5897
|
if (!t) return;
|
|
5898
|
-
const n =
|
|
5898
|
+
const n = Eo(e);
|
|
5899
5899
|
Kt(null, t), t.remove(), n && bt(e, !0);
|
|
5900
5900
|
}
|
|
5901
5901
|
function ze() {
|
|
5902
|
-
const e =
|
|
5903
|
-
|
|
5902
|
+
const e = Y();
|
|
5903
|
+
Mo(), Eo(e) ? nn(e) : yl(e) && on(e);
|
|
5904
5904
|
}
|
|
5905
5905
|
function $l(e) {
|
|
5906
|
-
const t = !Oe(e), n = t ? !0 : !
|
|
5906
|
+
const t = !Oe(e), n = t ? !0 : !So(e);
|
|
5907
5907
|
vt(e, n), wt(e), !t && mt(e);
|
|
5908
5908
|
}
|
|
5909
5909
|
function rn() {
|
|
@@ -5912,16 +5912,28 @@ function rn() {
|
|
|
5912
5912
|
const t = /* @__PURE__ */ new Map();
|
|
5913
5913
|
return e.__zudoDesignTokenPanelInstanceBindings = t, t;
|
|
5914
5914
|
}
|
|
5915
|
+
function Cl(e, t, n) {
|
|
5916
|
+
const o = Dn(e);
|
|
5917
|
+
if (o) return o;
|
|
5918
|
+
if (t) {
|
|
5919
|
+
const r = Y();
|
|
5920
|
+
if (r.storagePrefix !== e) return r;
|
|
5921
|
+
}
|
|
5922
|
+
return n;
|
|
5923
|
+
}
|
|
5915
5924
|
function an(e) {
|
|
5916
5925
|
if (typeof window > "u") return;
|
|
5917
5926
|
const t = rn();
|
|
5918
5927
|
if (t.has(e.storagePrefix)) return;
|
|
5919
|
-
const n =
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5928
|
+
const n = e.storagePrefix, o = nr(e), r = o === or, a = (l) => {
|
|
5929
|
+
const c = Cl(n, r, e), d = l, u = d.__zdtpToggledPrefixes ?? /* @__PURE__ */ new Set();
|
|
5930
|
+
u.has(c.storagePrefix) || (u.add(c.storagePrefix), d.__zdtpToggledPrefixes = u, $l(c));
|
|
5931
|
+
};
|
|
5932
|
+
window.addEventListener(o, a);
|
|
5933
|
+
const i = [() => window.removeEventListener(o, a)];
|
|
5934
|
+
r && (window.addEventListener(An, a), i.push(() => window.removeEventListener(An, a))), t.set(n, { cleanups: i });
|
|
5923
5935
|
}
|
|
5924
|
-
function
|
|
5936
|
+
function Ao(e) {
|
|
5925
5937
|
if (typeof window > "u") return;
|
|
5926
5938
|
const t = rn(), n = t.get(e);
|
|
5927
5939
|
if (n) {
|
|
@@ -5933,19 +5945,19 @@ function Mo(e) {
|
|
|
5933
5945
|
t.delete(e);
|
|
5934
5946
|
}
|
|
5935
5947
|
}
|
|
5936
|
-
function
|
|
5948
|
+
function Ul() {
|
|
5937
5949
|
if (typeof window > "u") return;
|
|
5938
5950
|
const e = rn();
|
|
5939
5951
|
for (const t of [...e.keys()])
|
|
5940
|
-
|
|
5952
|
+
Ao(t);
|
|
5941
5953
|
}
|
|
5942
5954
|
function Fe(e) {
|
|
5943
|
-
const t =
|
|
5955
|
+
const t = Dn(e);
|
|
5944
5956
|
if (t) return t;
|
|
5945
|
-
const n =
|
|
5957
|
+
const n = Y();
|
|
5946
5958
|
return n.storagePrefix === e ? n : { ...n, storagePrefix: e };
|
|
5947
5959
|
}
|
|
5948
|
-
|
|
5960
|
+
er({
|
|
5949
5961
|
// Fires once per `configurePanel` (every instance, incl. the 2nd+). Bind the
|
|
5950
5962
|
// instance's toggle-event channel now so a host-dispatched
|
|
5951
5963
|
// `toggle-${storagePrefix}` window event works immediately, before any
|
|
@@ -5953,19 +5965,19 @@ Qo({
|
|
|
5953
5965
|
configured: (e) => an(Fe(e)),
|
|
5954
5966
|
open: (e) => nn(Fe(e)),
|
|
5955
5967
|
close: (e) => on(Fe(e)),
|
|
5956
|
-
toggle: (e) =>
|
|
5968
|
+
toggle: (e) => To(Fe(e)),
|
|
5957
5969
|
destroy: (e) => {
|
|
5958
5970
|
const t = Fe(e);
|
|
5959
|
-
|
|
5971
|
+
Ao(e), _l(t);
|
|
5960
5972
|
}
|
|
5961
5973
|
});
|
|
5962
|
-
function
|
|
5974
|
+
function Lo() {
|
|
5963
5975
|
const e = window;
|
|
5964
5976
|
if (e.__zudoDesignTokenPanelLifecycle) return e.__zudoDesignTokenPanelLifecycle;
|
|
5965
5977
|
const t = { bound: !1, cleanups: [], adapter: null };
|
|
5966
5978
|
return e.__zudoDesignTokenPanelLifecycle = t, t;
|
|
5967
5979
|
}
|
|
5968
|
-
function
|
|
5980
|
+
function El(e) {
|
|
5969
5981
|
const t = e.cleanups;
|
|
5970
5982
|
e.cleanups = [];
|
|
5971
5983
|
for (const n of t)
|
|
@@ -5974,13 +5986,13 @@ function Cl(e) {
|
|
|
5974
5986
|
} catch {
|
|
5975
5987
|
}
|
|
5976
5988
|
}
|
|
5977
|
-
function
|
|
5989
|
+
function Po(e) {
|
|
5978
5990
|
typeof document > "u" || (document.addEventListener("astro:before-swap", Ye), document.addEventListener("astro:page-load", ze), e.cleanups.push(
|
|
5979
5991
|
() => document.removeEventListener("astro:before-swap", Ye),
|
|
5980
5992
|
() => document.removeEventListener("astro:page-load", ze)
|
|
5981
5993
|
));
|
|
5982
5994
|
}
|
|
5983
|
-
function
|
|
5995
|
+
function Sl(e, t) {
|
|
5984
5996
|
if (!(typeof document > "u") && (t.onBeforeSwap ? e.cleanups.push(t.onBeforeSwap(Ye)) : (document.addEventListener("astro:before-swap", Ye), e.cleanups.push(
|
|
5985
5997
|
() => document.removeEventListener("astro:before-swap", Ye)
|
|
5986
5998
|
)), t.onPageLoad ? e.cleanups.push(t.onPageLoad(ze)) : (document.addEventListener("astro:page-load", ze), e.cleanups.push(
|
|
@@ -5995,36 +6007,36 @@ function El(e, t) {
|
|
|
5995
6007
|
);
|
|
5996
6008
|
}
|
|
5997
6009
|
}
|
|
5998
|
-
function
|
|
6010
|
+
function Jl(e) {
|
|
5999
6011
|
if (typeof window > "u") return;
|
|
6000
|
-
const t =
|
|
6001
|
-
|
|
6012
|
+
const t = Lo();
|
|
6013
|
+
El(t), t.adapter = e, e ? Sl(t, e) : Po(t);
|
|
6002
6014
|
}
|
|
6003
|
-
const
|
|
6004
|
-
|
|
6015
|
+
const Tl = () => {
|
|
6016
|
+
Mo(), ze();
|
|
6005
6017
|
};
|
|
6006
6018
|
if (typeof window < "u") {
|
|
6007
|
-
const e =
|
|
6008
|
-
an(
|
|
6019
|
+
const e = Lo();
|
|
6020
|
+
an(Y()), e.bound || (e.bound = !0, Po(e), tr(Tl));
|
|
6009
6021
|
}
|
|
6010
6022
|
export {
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6023
|
+
es as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
|
|
6024
|
+
Xl as __panelConfigForTest,
|
|
6025
|
+
Ul as __resetInstanceBindingsForTests,
|
|
6026
|
+
ns as configurePanel,
|
|
6015
6027
|
_t as emptyOverrides,
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6028
|
+
ql as hideDesignTokenPanel,
|
|
6029
|
+
Wl as isColorKind,
|
|
6030
|
+
jl as isContentKind,
|
|
6031
|
+
Fl as isCursorKind,
|
|
6032
|
+
Dl as isLengthKind,
|
|
6033
|
+
Kl as isMaskImageKind,
|
|
6034
|
+
Vl as isNumberKind,
|
|
6035
|
+
Bl as isSelectKind,
|
|
6036
|
+
Hl as isTextKind,
|
|
6037
|
+
Mo as reapplyPersistedOverrides,
|
|
6038
|
+
Jl as setLifecycleAdapter,
|
|
6039
|
+
os as setPanelColorPresets,
|
|
6040
|
+
Yl as showDesignTokenPanel,
|
|
6041
|
+
Gl as toggleDesignPanel
|
|
6030
6042
|
};
|