@takazudo/zdtp 0.5.2 → 0.6.0
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 +25 -0
- package/PORTABLE-CONTRACT.md +18 -0
- package/dist/apply/build-apply-overrides.d.ts +2 -2
- package/dist/apply/last-applied.d.ts +1 -1
- package/dist/apply/reconcile-applied.d.ts +2 -2
- package/dist/apply/route-tokens-to-files.d.ts +1 -1
- package/dist/apply/tier-resolver.d.ts +1 -1
- package/dist/apply-modal.d.ts +2 -2
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.d.ts +8 -8
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-BI4-9A58.js → autoload-state-CGnis85c.js} +1 -1
- package/dist/bulk/bulk-actions.d.ts +3 -3
- package/dist/bulk/index.d.ts +2 -2
- package/dist/chain/index.d.ts +2 -2
- package/dist/chain/token-chain-context.d.ts +3 -3
- package/dist/chain/token-chain-popover.d.ts +2 -2
- package/dist/changed/contribution.d.ts +5 -5
- package/dist/changed/footer-content.d.ts +4 -4
- package/dist/changed/index.d.ts +4 -4
- package/dist/components/color-picker/color-field.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/palette-chart/index.d.ts +2 -2
- package/dist/components/palette-chart/palette-chart.d.ts +4 -4
- package/dist/config/cluster-config.d.ts +4 -4
- package/dist/config/color-scheme-utils.d.ts +1 -1
- package/dist/config/panel-config.d.ts +5 -5
- package/dist/controls/tier-ref-selector.d.ts +1 -1
- package/dist/dom-tweaker/dom-tweaker-diff-action-link.d.ts +1 -1
- package/dist/dom-tweaker/dom-tweaker-orchestrator.d.ts +1 -1
- package/dist/dom-tweaker/dom-tweaker-state.d.ts +1 -1
- package/dist/dom-tweaker/lazy/class-editor-popup.d.ts +1 -1
- package/dist/dom-tweaker/lazy/diff-export-modal.d.ts +1 -1
- package/dist/dom-tweaker/lazy/index.d.ts +2 -2
- package/dist/element-inspect/element-inspect-context.d.ts +1 -1
- package/dist/element-inspect/element-inspect-orchestrator.d.ts +3 -3
- package/dist/element-inspect/element-inspect-overlay.d.ts +1 -1
- package/dist/element-inspect/find-tokens-for-element.d.ts +1 -1
- package/dist/element-inspect/index.d.ts +8 -8
- package/dist/element-path/element-path-state.d.ts +1 -1
- package/dist/element-path/index.d.ts +7 -7
- package/dist/export-modal.d.ts +2 -2
- package/dist/highlight/highlight-orchestrator.d.ts +2 -2
- package/dist/highlight/highlight-state.d.ts +1 -1
- package/dist/highlight/highlight-toggle-button.d.ts +2 -2
- package/dist/history/buttons.d.ts +1 -1
- package/dist/history/index.d.ts +3 -3
- package/dist/history/rail.d.ts +2 -2
- package/dist/history/snapshots.d.ts +2 -2
- package/dist/import-modal.d.ts +2 -2
- package/dist/{index-ChsJ5u4d.js → index-DWs1XPfy.js} +993 -993
- package/dist/{index-CAQf4HKm.js → index-LYsbHWcy.js} +2 -2
- package/dist/index.d.ts +14 -14
- package/dist/index.js +14 -13
- package/dist/{panel-config-CqbuB0nh.js → panel-config-Crn5QJGy.js} +243 -208
- package/dist/panel.d.ts +2 -2
- package/dist/picker/index.d.ts +4 -4
- package/dist/search/command-palette.d.ts +3 -3
- package/dist/search/contribution.d.ts +1 -1
- package/dist/search/index.d.ts +4 -4
- package/dist/search/match-bar.d.ts +1 -1
- package/dist/search/token-search.d.ts +3 -3
- package/dist/server/create-apply-handler.d.ts +2 -2
- package/dist/server/index.d.ts +6 -6
- package/dist/shell/dock-mode-switch.d.ts +1 -1
- package/dist/shell/regions.d.ts +1 -1
- package/dist/shell/tab-bar.d.ts +1 -1
- package/dist/shell/tab-overflow-popover.d.ts +1 -1
- package/dist/specimen/on-page-specimen.d.ts +3 -3
- package/dist/specimen/preview-glyphs.d.ts +1 -1
- package/dist/specimen/specimen-state.d.ts +1 -1
- package/dist/specimen/specimen-tab-body.d.ts +5 -5
- package/dist/specimen/specimen-toolbar.d.ts +1 -1
- package/dist/specimen/specimen-values.d.ts +1 -1
- package/dist/state/autoload-state.d.ts +1 -1
- package/dist/state/history.d.ts +1 -1
- package/dist/state/persist.d.ts +3 -3
- package/dist/state/transaction.d.ts +3 -3
- package/dist/state/tweak-state.d.ts +12 -12
- package/dist/tabs/_generic-item-editor.d.ts +1 -1
- package/dist/tabs/color-tab.d.ts +6 -6
- package/dist/tabs/flat/flat-tab.d.ts +5 -5
- package/dist/tabs/flat/index.d.ts +8 -8
- package/dist/tabs/flat/scroll-to-token-row.d.ts +1 -1
- package/dist/tabs/flat/tier-section.d.ts +3 -3
- package/dist/tabs/flat/token-controller.d.ts +1 -1
- package/dist/tabs/flat/token-row.d.ts +2 -2
- package/dist/tabs/flat/types.d.ts +1 -1
- package/dist/tabs/font-tab.d.ts +6 -6
- package/dist/tabs/generic-tab.d.ts +4 -4
- package/dist/tabs/notes-tab.d.ts +1 -1
- package/dist/tabs/palette/palette-check-view.d.ts +3 -3
- package/dist/tabs/palette/palette-edit-view.d.ts +3 -3
- package/dist/tabs/palette/palette-readout.d.ts +1 -1
- package/dist/tabs/palette/palette-tab.d.ts +3 -3
- package/dist/tabs/size-tab.d.ts +5 -5
- package/dist/tabs/spacing-tab.d.ts +5 -5
- package/dist/testing.d.ts +6 -6
- package/dist/testing.js +16 -15
- package/dist/tokens/tier-model.d.ts +2 -2
- package/dist/{tweak-state-c53KtLHq.js → tweak-state-Dzr5kDhX.js} +210 -207
- package/dist/utils/color-oklch.d.ts +2 -2
- package/dist/utils/design-token-serde.d.ts +2 -2
- package/dist/utils/token-diff.d.ts +3 -3
- package/dist/utils/token-graph.d.ts +4 -4
- package/dist/utils/token-index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as xt, g, k as Mt, l as kt, h as vt, d as St, n as
|
|
1
|
+
import { r as xt, g, k as Mt, l as kt, h as vt, d as St, n as V, o as ee, p as _e, q as Ee, t as wt, e as Nt, u as $t, v as Ct, w as Tt, x as q, f as It, y as De, z as Ot, A as At } from "./panel-config-Crn5QJGy.js";
|
|
2
2
|
const Le = (e, t) => {
|
|
3
3
|
if (typeof e == "number") {
|
|
4
4
|
if (t === 3)
|
|
@@ -32,7 +32,7 @@ const Le = (e, t) => {
|
|
|
32
32
|
alpha: (e & 255) / 255
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, Pt = {
|
|
36
36
|
aliceblue: 15792383,
|
|
37
37
|
antiquewhite: 16444375,
|
|
38
38
|
aqua: 65535,
|
|
@@ -183,13 +183,13 @@ const Le = (e, t) => {
|
|
|
183
183
|
whitesmoke: 16119285,
|
|
184
184
|
yellow: 16776960,
|
|
185
185
|
yellowgreen: 10145074
|
|
186
|
-
},
|
|
186
|
+
}, _t = (e) => Le(Pt[e.toLowerCase()], 6), Et = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Dt = (e) => {
|
|
187
187
|
let t;
|
|
188
|
-
return (t = e.match(
|
|
189
|
-
},
|
|
190
|
-
`^rgba?\\(\\s*${
|
|
188
|
+
return (t = e.match(Et)) ? Le(parseInt(t[1], 16), t[1].length) : void 0;
|
|
189
|
+
}, N = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", E = `${N}%`, Se = `(?:${N}%|${N})`, Ht = `(?:${N}(deg|grad|rad|turn)|${N})`, I = "\\s*,\\s*", Ft = new RegExp(
|
|
190
|
+
`^rgba?\\(\\s*${N}${I}${N}${I}${N}\\s*(?:,\\s*${Se}\\s*)?\\)$`
|
|
191
191
|
), Vt = new RegExp(
|
|
192
|
-
`^rgba?\\(\\s*${
|
|
192
|
+
`^rgba?\\(\\s*${E}${I}${E}${I}${E}\\s*(?:,\\s*${Se}\\s*)?\\)$`
|
|
193
193
|
), zt = (e) => {
|
|
194
194
|
let t = { mode: "rgb" }, n;
|
|
195
195
|
if (n = e.match(Ft))
|
|
@@ -199,7 +199,7 @@ const Le = (e, t) => {
|
|
|
199
199
|
else
|
|
200
200
|
return;
|
|
201
201
|
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;
|
|
202
|
-
},
|
|
202
|
+
}, J = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Ne(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, x = (e = "rgb") => (t) => (t = J(t, e)) !== void 0 ? (
|
|
203
203
|
// if the color's mode corresponds to our target mode
|
|
204
204
|
t.mode === e ? (
|
|
205
205
|
// then just return the color
|
|
@@ -222,7 +222,7 @@ const Le = (e, t) => {
|
|
|
222
222
|
)
|
|
223
223
|
)
|
|
224
224
|
)
|
|
225
|
-
) : void 0, M = {}, je = {},
|
|
225
|
+
) : void 0, M = {}, je = {}, W = [], Ke = {}, Rt = (e) => e, we = (e) => (M[e.mode] = {
|
|
226
226
|
...M[e.mode],
|
|
227
227
|
...e.toMode
|
|
228
228
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
@@ -235,13 +235,13 @@ const Le = (e, t) => {
|
|
|
235
235
|
}), e.interpolate[t].fixup || (e.interpolate[t].fixup = Rt);
|
|
236
236
|
}), je[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
237
237
|
Lt(t, e.mode);
|
|
238
|
-
}), x(e.mode)),
|
|
238
|
+
}), x(e.mode)), te = (e) => je[e], Lt = (e, t) => {
|
|
239
239
|
if (typeof e == "string") {
|
|
240
240
|
if (!t)
|
|
241
241
|
throw new Error("'mode' required when 'parser' is a string");
|
|
242
242
|
Ke[e] = t;
|
|
243
|
-
} else typeof e == "function" &&
|
|
244
|
-
},
|
|
243
|
+
} else typeof e == "function" && W.indexOf(e) < 0 && W.push(e);
|
|
244
|
+
}, ce = /[^\x00-\x7F]|[a-zA-Z_]/, jt = /[^\x00-\x7F]|[-\w]/, l = {
|
|
245
245
|
Function: "function",
|
|
246
246
|
Ident: "ident",
|
|
247
247
|
Number: "number",
|
|
@@ -252,21 +252,21 @@ const Le = (e, t) => {
|
|
|
252
252
|
Alpha: "alpha"
|
|
253
253
|
};
|
|
254
254
|
let c = 0;
|
|
255
|
-
function
|
|
255
|
+
function R(e) {
|
|
256
256
|
let t = e[c], n = e[c + 1];
|
|
257
257
|
return t === "-" || t === "+" ? /\d/.test(n) || n === "." && /\d/.test(e[c + 2]) : t === "." ? /\d/.test(n) : /\d/.test(t);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function de(e) {
|
|
260
260
|
if (c >= e.length)
|
|
261
261
|
return !1;
|
|
262
262
|
let t = e[c];
|
|
263
|
-
if (
|
|
263
|
+
if (ce.test(t))
|
|
264
264
|
return !0;
|
|
265
265
|
if (t === "-") {
|
|
266
266
|
if (e.length - c < 2)
|
|
267
267
|
return !1;
|
|
268
268
|
let n = e[c + 1];
|
|
269
|
-
return !!(n === "-" ||
|
|
269
|
+
return !!(n === "-" || ce.test(n));
|
|
270
270
|
}
|
|
271
271
|
return !1;
|
|
272
272
|
}
|
|
@@ -276,28 +276,28 @@ const Kt = {
|
|
|
276
276
|
grad: 9 / 10,
|
|
277
277
|
turn: 360
|
|
278
278
|
};
|
|
279
|
-
function
|
|
279
|
+
function P(e) {
|
|
280
280
|
let t = "";
|
|
281
|
-
if ((e[c] === "-" || e[c] === "+") && (t += e[c++]), t +=
|
|
282
|
-
let n =
|
|
281
|
+
if ((e[c] === "-" || e[c] === "+") && (t += e[c++]), t += L(e), e[c] === "." && /\d/.test(e[c + 1]) && (t += e[c++] + L(e)), (e[c] === "e" || e[c] === "E") && ((e[c + 1] === "-" || e[c + 1] === "+") && /\d/.test(e[c + 2]) ? t += e[c++] + e[c++] + L(e) : /\d/.test(e[c + 1]) && (t += e[c++] + L(e))), de(e)) {
|
|
282
|
+
let n = X(e);
|
|
283
283
|
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: l.Hue, value: t * Kt[n] } : void 0;
|
|
284
284
|
}
|
|
285
285
|
return e[c] === "%" ? (c++, { type: l.Percentage, value: +t }) : { type: l.Number, value: +t };
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function L(e) {
|
|
288
288
|
let t = "";
|
|
289
289
|
for (; /\d/.test(e[c]); )
|
|
290
290
|
t += e[c++];
|
|
291
291
|
return t;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function X(e) {
|
|
294
294
|
let t = "";
|
|
295
295
|
for (; c < e.length && jt.test(e[c]); )
|
|
296
296
|
t += e[c++];
|
|
297
297
|
return t;
|
|
298
298
|
}
|
|
299
299
|
function Bt(e) {
|
|
300
|
-
let t =
|
|
300
|
+
let t = X(e);
|
|
301
301
|
return e[c] === "(" ? (c++, { type: l.Function, value: t }) : t === "none" ? { type: l.None, value: void 0 } : { type: l.Ident, value: t };
|
|
302
302
|
}
|
|
303
303
|
function Gt(e = "") {
|
|
@@ -317,26 +317,26 @@ function Gt(e = "") {
|
|
|
317
317
|
continue;
|
|
318
318
|
}
|
|
319
319
|
if (r === "+") {
|
|
320
|
-
if (c--,
|
|
321
|
-
n.push(
|
|
320
|
+
if (c--, R(t)) {
|
|
321
|
+
n.push(P(t));
|
|
322
322
|
continue;
|
|
323
323
|
}
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
if (r === "-") {
|
|
327
|
-
if (c--,
|
|
328
|
-
n.push(
|
|
327
|
+
if (c--, R(t)) {
|
|
328
|
+
n.push(P(t));
|
|
329
329
|
continue;
|
|
330
330
|
}
|
|
331
|
-
if (
|
|
332
|
-
n.push({ type: l.Ident, value:
|
|
331
|
+
if (de(t)) {
|
|
332
|
+
n.push({ type: l.Ident, value: X(t) });
|
|
333
333
|
continue;
|
|
334
334
|
}
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
if (r === ".") {
|
|
338
|
-
if (c--,
|
|
339
|
-
n.push(
|
|
338
|
+
if (c--, R(t)) {
|
|
339
|
+
n.push(P(t));
|
|
340
340
|
continue;
|
|
341
341
|
}
|
|
342
342
|
return;
|
|
@@ -346,11 +346,11 @@ function Gt(e = "") {
|
|
|
346
346
|
` || t[c] === " " || t[c] === " "); )
|
|
347
347
|
c++;
|
|
348
348
|
let o;
|
|
349
|
-
if (
|
|
349
|
+
if (R(t) && (o = P(t), o.type !== l.Hue)) {
|
|
350
350
|
n.push({ type: l.Alpha, value: o });
|
|
351
351
|
continue;
|
|
352
352
|
}
|
|
353
|
-
if (
|
|
353
|
+
if (de(t) && X(t) === "none") {
|
|
354
354
|
n.push({
|
|
355
355
|
type: l.Alpha,
|
|
356
356
|
value: { type: l.None, value: void 0 }
|
|
@@ -360,10 +360,10 @@ function Gt(e = "") {
|
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
362
|
if (/\d/.test(r)) {
|
|
363
|
-
c--, n.push(
|
|
363
|
+
c--, n.push(P(t));
|
|
364
364
|
continue;
|
|
365
365
|
}
|
|
366
|
-
if (
|
|
366
|
+
if (ce.test(r)) {
|
|
367
367
|
c--, n.push(Bt(t));
|
|
368
368
|
continue;
|
|
369
369
|
}
|
|
@@ -382,7 +382,7 @@ function qt(e) {
|
|
|
382
382
|
const r = { mode: n }, o = Be(e, !1);
|
|
383
383
|
if (!o)
|
|
384
384
|
return;
|
|
385
|
-
const i =
|
|
385
|
+
const i = te(n).channels;
|
|
386
386
|
for (let a = 0, s, f; a < i.length; a++)
|
|
387
387
|
s = o[a], f = i[a], s.type !== l.None && (r[f] = s.type === l.Number ? s.value : s.value / 100, f === "alpha" && (r[f] = Math.max(0, Math.min(1, r[f]))));
|
|
388
388
|
return r;
|
|
@@ -424,9 +424,9 @@ const Ne = (e) => {
|
|
|
424
424
|
if (typeof e != "string")
|
|
425
425
|
return;
|
|
426
426
|
const t = Gt(e), n = t ? Jt(t, !0) : void 0;
|
|
427
|
-
let r, o = 0, i =
|
|
427
|
+
let r, o = 0, i = W.length;
|
|
428
428
|
for (; o < i; )
|
|
429
|
-
if ((r =
|
|
429
|
+
if ((r = W[o++](e, n)) !== void 0)
|
|
430
430
|
return r;
|
|
431
431
|
return t ? qt(t) : void 0;
|
|
432
432
|
};
|
|
@@ -464,9 +464,9 @@ const Xt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
464
464
|
channels: ["r", "g", "b", "alpha"],
|
|
465
465
|
parse: [
|
|
466
466
|
Wt,
|
|
467
|
-
|
|
467
|
+
Dt,
|
|
468
468
|
zt,
|
|
469
|
-
|
|
469
|
+
_t,
|
|
470
470
|
Xt,
|
|
471
471
|
"srgb"
|
|
472
472
|
],
|
|
@@ -480,42 +480,42 @@ const Xt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
480
480
|
gamut: !0,
|
|
481
481
|
white: { r: 1, g: 1, b: 1 },
|
|
482
482
|
black: { r: 0, g: 0, b: 0 }
|
|
483
|
-
},
|
|
483
|
+
}, oe = (e = 0) => {
|
|
484
484
|
const t = Math.abs(e);
|
|
485
485
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
486
486
|
}, Ge = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
487
487
|
let o = {
|
|
488
488
|
mode: "lrgb",
|
|
489
|
-
r:
|
|
490
|
-
g:
|
|
491
|
-
b:
|
|
489
|
+
r: oe(e),
|
|
490
|
+
g: oe(t),
|
|
491
|
+
b: oe(n)
|
|
492
492
|
};
|
|
493
493
|
return r !== void 0 && (o.alpha = r), o;
|
|
494
|
-
},
|
|
494
|
+
}, ie = (e = 0) => {
|
|
495
495
|
const t = Math.abs(e);
|
|
496
496
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
497
497
|
}, qe = ({ r: e, g: t, b: n, alpha: r }, o = "rgb") => {
|
|
498
498
|
let i = {
|
|
499
499
|
mode: o,
|
|
500
|
-
r:
|
|
501
|
-
g:
|
|
502
|
-
b:
|
|
500
|
+
r: ie(e),
|
|
501
|
+
g: ie(t),
|
|
502
|
+
b: ie(n)
|
|
503
503
|
};
|
|
504
504
|
return r !== void 0 && (i.alpha = r), i;
|
|
505
|
-
},
|
|
505
|
+
}, $ = (e) => (e = e % 360) < 0 ? e + 360 : e, en = (e, t) => e.map((n, r, o) => {
|
|
506
506
|
if (n === void 0)
|
|
507
507
|
return n;
|
|
508
|
-
let i =
|
|
509
|
-
return r === 0 || e[r - 1] === void 0 ? i : t(i -
|
|
508
|
+
let i = $(n);
|
|
509
|
+
return r === 0 || e[r - 1] === void 0 ? i : t(i - $(o[r - 1]));
|
|
510
510
|
}).reduce((n, r) => !n.length || r === void 0 || n[n.length - 1] === void 0 ? (n.push(r), n) : (n.push(r + n[n.length - 1]), n), []), Je = (e) => en(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), tn = (e, t) => {
|
|
511
511
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
|
|
512
512
|
return 0;
|
|
513
|
-
let n =
|
|
513
|
+
let n = $(e.h), r = $(t.h), o = Math.sin((r - n + 360) / 2 * Math.PI / 180);
|
|
514
514
|
return 2 * Math.sqrt(e.s * t.s) * o;
|
|
515
515
|
}, nn = (e, t) => {
|
|
516
516
|
if (e.h === void 0 || t.h === void 0 || !e.c || !t.c)
|
|
517
517
|
return 0;
|
|
518
|
-
let n =
|
|
518
|
+
let n = $(e.h), r = $(t.h), o = Math.sin((r - n + 360) / 2 * Math.PI / 180);
|
|
519
519
|
return 2 * Math.sqrt(e.c * t.c) * o;
|
|
520
520
|
}, We = (e) => {
|
|
521
521
|
let t = e.reduce(
|
|
@@ -529,11 +529,11 @@ const Xt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
529
529
|
{ sin: 0, cos: 0 }
|
|
530
530
|
), n = Math.atan2(t.sin, t.cos) * 180 / Math.PI;
|
|
531
531
|
return n < 0 ? 360 + n : n;
|
|
532
|
-
},
|
|
532
|
+
}, Y = ({ l: e, a: t, b: n, alpha: r }, o = "lch") => {
|
|
533
533
|
t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
534
534
|
let i = Math.sqrt(t * t + n * n), a = { mode: o, l: e, c: i };
|
|
535
|
-
return i && (a.h =
|
|
536
|
-
},
|
|
535
|
+
return i && (a.h = $(Math.atan2(n, t) * 180 / Math.PI)), r !== void 0 && (a.alpha = r), a;
|
|
536
|
+
}, U = ({ l: e, c: t, h: n, alpha: r }, o = "lab") => {
|
|
537
537
|
n === void 0 && (n = 0);
|
|
538
538
|
let i = {
|
|
539
539
|
mode: o,
|
|
@@ -548,7 +548,7 @@ const Xt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
548
548
|
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
549
549
|
};
|
|
550
550
|
function rn({ h: e, s: t, l: n, alpha: r }) {
|
|
551
|
-
e =
|
|
551
|
+
e = $(e !== void 0 ? e : 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
552
552
|
let o = n + t * (n < 0.5 ? n : 1 - n), i = o - (o - n) * 2 * Math.abs(e / 60 % 2 - 1), a;
|
|
553
553
|
switch (Math.floor(e / 60)) {
|
|
554
554
|
case 0:
|
|
@@ -595,7 +595,7 @@ const an = (e, t) => {
|
|
|
595
595
|
return e * 360;
|
|
596
596
|
}
|
|
597
597
|
}, sn = new RegExp(
|
|
598
|
-
`^hsla?\\(\\s*${Ht}${I}${
|
|
598
|
+
`^hsla?\\(\\s*${Ht}${I}${E}${I}${E}\\s*(?:,\\s*${Se}\\s*)?\\)$`
|
|
599
599
|
), fn = (e) => {
|
|
600
600
|
let t = e.match(sn);
|
|
601
601
|
if (!t) return;
|
|
@@ -657,14 +657,14 @@ const un = {
|
|
|
657
657
|
h: We
|
|
658
658
|
}
|
|
659
659
|
}, Xe = Math.pow(29, 3) / Math.pow(3, 3), Ye = Math.pow(6, 3) / Math.pow(29, 3);
|
|
660
|
-
let
|
|
660
|
+
let ae = (e) => Math.pow(e, 3) > Ye ? Math.pow(e, 3) : (116 * e - 16) / Xe;
|
|
661
661
|
const cn = ({ l: e, a: t, b: n, alpha: r }) => {
|
|
662
662
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
663
663
|
let o = (e + 16) / 116, i = t / 500 + o, a = o - n / 200, s = {
|
|
664
664
|
mode: "xyz50",
|
|
665
|
-
x:
|
|
666
|
-
y:
|
|
667
|
-
z:
|
|
665
|
+
x: ae(i) * T.X,
|
|
666
|
+
y: ae(o) * T.Y,
|
|
667
|
+
z: ae(a) * T.Z
|
|
668
668
|
};
|
|
669
669
|
return r !== void 0 && (s.alpha = r), s;
|
|
670
670
|
}, dn = ({ x: e, y: t, z: n, alpha: r }) => {
|
|
@@ -683,9 +683,9 @@ const cn = ({ l: e, a: t, b: n, alpha: r }) => {
|
|
|
683
683
|
z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * r
|
|
684
684
|
};
|
|
685
685
|
return o !== void 0 && (i.alpha = o), i;
|
|
686
|
-
},
|
|
686
|
+
}, se = (e) => e > Ye ? Math.cbrt(e) : (Xe * e + 16) / 116, gn = ({ x: e, y: t, z: n, alpha: r }) => {
|
|
687
687
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
688
|
-
let o =
|
|
688
|
+
let o = se(e / T.X), i = se(t / T.Y), a = se(n / T.Z), s = {
|
|
689
689
|
mode: "lab",
|
|
690
690
|
l: 116 * i - 16,
|
|
691
691
|
a: 500 * (o - i),
|
|
@@ -724,12 +724,12 @@ function yn(e, t) {
|
|
|
724
724
|
const bn = {
|
|
725
725
|
mode: "lch",
|
|
726
726
|
toMode: {
|
|
727
|
-
lab:
|
|
728
|
-
rgb: (e) => hn(
|
|
727
|
+
lab: U,
|
|
728
|
+
rgb: (e) => hn(U(e))
|
|
729
729
|
},
|
|
730
730
|
fromMode: {
|
|
731
|
-
rgb: (e) =>
|
|
732
|
-
lab:
|
|
731
|
+
rgb: (e) => Y(mn(e)),
|
|
732
|
+
lab: Y
|
|
733
733
|
},
|
|
734
734
|
channels: ["l", "c", "h", "alpha"],
|
|
735
735
|
ranges: {
|
|
@@ -811,12 +811,12 @@ const wn = {
|
|
|
811
811
|
...bn,
|
|
812
812
|
mode: "oklch",
|
|
813
813
|
toMode: {
|
|
814
|
-
oklab: (e) =>
|
|
815
|
-
rgb: (e) => vn(
|
|
814
|
+
oklab: (e) => U(e, "oklab"),
|
|
815
|
+
rgb: (e) => vn(U(e, "oklab"))
|
|
816
816
|
},
|
|
817
817
|
fromMode: {
|
|
818
|
-
rgb: (e) =>
|
|
819
|
-
oklab: (e) =>
|
|
818
|
+
rgb: (e) => Y(Mn(e), "oklch"),
|
|
819
|
+
oklab: (e) => Y(e, "oklch")
|
|
820
820
|
},
|
|
821
821
|
parse: [Sn],
|
|
822
822
|
serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
@@ -825,15 +825,15 @@ const wn = {
|
|
|
825
825
|
c: [0, 0.4],
|
|
826
826
|
h: [0, 360]
|
|
827
827
|
}
|
|
828
|
-
}, Nn = (e) => Math.max(0, Math.min(1, e || 0)),
|
|
828
|
+
}, Nn = (e) => Math.max(0, Math.min(1, e || 0)), K = (e) => Math.round(Nn(e) * 255), Ue = x("rgb"), Ze = (e) => {
|
|
829
829
|
if (e === void 0)
|
|
830
830
|
return;
|
|
831
|
-
let t =
|
|
831
|
+
let t = K(e.r), n = K(e.g), r = K(e.b);
|
|
832
832
|
return "#" + (1 << 24 | t << 16 | n << 8 | r).toString(16).slice(1);
|
|
833
833
|
}, $n = (e) => {
|
|
834
834
|
if (e === void 0)
|
|
835
835
|
return;
|
|
836
|
-
let t =
|
|
836
|
+
let t = K(e.alpha !== void 0 ? e.alpha : 1);
|
|
837
837
|
return Ze(e) + (256 | t).toString(16).slice(1);
|
|
838
838
|
}, Cn = (e) => Ze(Ue(e)), Tn = (e) => $n(Ue(e)), Qe = x("rgb"), et = (e) => {
|
|
839
839
|
const t = {
|
|
@@ -848,19 +848,19 @@ function On(e) {
|
|
|
848
848
|
return tt(Qe(e));
|
|
849
849
|
}
|
|
850
850
|
function Ce(e = "rgb") {
|
|
851
|
-
const { gamut: t } =
|
|
851
|
+
const { gamut: t } = te(e);
|
|
852
852
|
if (!t)
|
|
853
853
|
return (r) => !0;
|
|
854
854
|
const n = x(typeof t == "string" ? t : e);
|
|
855
855
|
return (r) => tt(n(r));
|
|
856
856
|
}
|
|
857
857
|
function An(e = "rgb") {
|
|
858
|
-
const { gamut: t } =
|
|
858
|
+
const { gamut: t } = te(e);
|
|
859
859
|
if (!t)
|
|
860
|
-
return (i) =>
|
|
860
|
+
return (i) => J(i);
|
|
861
861
|
const n = typeof t == "string" ? t : e, r = x(n), o = Ce(n);
|
|
862
862
|
return (i) => {
|
|
863
|
-
const a =
|
|
863
|
+
const a = J(i);
|
|
864
864
|
if (!a)
|
|
865
865
|
return;
|
|
866
866
|
const s = r(a);
|
|
@@ -870,8 +870,8 @@ function An(e = "rgb") {
|
|
|
870
870
|
return a.mode === f.mode ? f : x(a.mode)(f);
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
e =
|
|
873
|
+
function Pn(e, t = "lch", n = "rgb") {
|
|
874
|
+
e = J(e);
|
|
875
875
|
let r = n === "rgb" ? On : Ce(n), o = n === "rgb" ? In : An(n);
|
|
876
876
|
if (e === void 0 || r(e)) return e;
|
|
877
877
|
let i = x(e.mode);
|
|
@@ -879,7 +879,7 @@ function _n(e, t = "lch", n = "rgb") {
|
|
|
879
879
|
let a = { ...e, c: 0 };
|
|
880
880
|
if (!r(a))
|
|
881
881
|
return i(o(a));
|
|
882
|
-
let s = 0, f = e.c !== void 0 ? e.c : 0, u =
|
|
882
|
+
let s = 0, f = e.c !== void 0 ? e.c : 0, u = te(t).ranges.c, d = (u[1] - u[0]) / Math.pow(2, 13), h = a.c;
|
|
883
883
|
for (; f - s > d; )
|
|
884
884
|
a.c = s + (f - s) * 0.5, r(a) ? (h = a.c, s = a.c) : f = a.c;
|
|
885
885
|
return i(
|
|
@@ -889,8 +889,8 @@ function _n(e, t = "lch", n = "rgb") {
|
|
|
889
889
|
we(wn);
|
|
890
890
|
we(Qt);
|
|
891
891
|
we(un);
|
|
892
|
-
const yr = 0.37, Te = x("oklch"), nt = x("rgb"),
|
|
893
|
-
function
|
|
892
|
+
const yr = 0.37, Te = x("oklch"), nt = x("rgb"), _n = x("hsl"), En = Ce("rgb");
|
|
893
|
+
function ne(e) {
|
|
894
894
|
return {
|
|
895
895
|
mode: "oklch",
|
|
896
896
|
l: e.l / 100,
|
|
@@ -899,7 +899,7 @@ function te(e) {
|
|
|
899
899
|
alpha: e.a / 100
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function Dn(e) {
|
|
903
903
|
return {
|
|
904
904
|
l: (e.l ?? 0) * 100,
|
|
905
905
|
c: e.c ?? 0,
|
|
@@ -933,11 +933,11 @@ function xr(e) {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
function Mr(e, t) {
|
|
936
|
-
const n =
|
|
936
|
+
const n = ne(e), r = nt(n);
|
|
937
937
|
return r ? e.a < 100 ? Tn({ ...r, alpha: e.a / 100 }) ?? "#000000ff" : Cn(r) ?? "#000000" : "#000000";
|
|
938
938
|
}
|
|
939
939
|
function kr(e) {
|
|
940
|
-
const t =
|
|
940
|
+
const t = ne(e), n = _n(t);
|
|
941
941
|
return n ? {
|
|
942
942
|
h: n.h ?? 0,
|
|
943
943
|
s: (n.s ?? 0) * 100,
|
|
@@ -953,10 +953,10 @@ function vr(e) {
|
|
|
953
953
|
l: e.l / 100,
|
|
954
954
|
alpha: e.a / 100
|
|
955
955
|
}, n = Te(t);
|
|
956
|
-
return n ?
|
|
956
|
+
return n ? Dn(n) : { l: 0, c: 0, h: 0, a: e.a };
|
|
957
957
|
}
|
|
958
958
|
function Sr(e) {
|
|
959
|
-
const t =
|
|
959
|
+
const t = ne(e), n = Pn(t, "oklch", "rgb");
|
|
960
960
|
return n ? {
|
|
961
961
|
l: (n.l ?? e.l / 100) * 100,
|
|
962
962
|
c: n.c ?? 0,
|
|
@@ -965,14 +965,14 @@ function Sr(e) {
|
|
|
965
965
|
} : { l: e.l, c: 0, h: e.h, a: e.a };
|
|
966
966
|
}
|
|
967
967
|
function wr(e) {
|
|
968
|
-
const t = nt(
|
|
969
|
-
return t ?
|
|
968
|
+
const t = nt(ne(e));
|
|
969
|
+
return t ? En(t) : !1;
|
|
970
970
|
}
|
|
971
971
|
function Nr(e) {
|
|
972
972
|
const t = e.trim();
|
|
973
973
|
if (!t) return null;
|
|
974
974
|
if (/^oklch\s*\(/i.test(t))
|
|
975
|
-
return
|
|
975
|
+
return Z(t);
|
|
976
976
|
try {
|
|
977
977
|
const n = Ne(t.toLowerCase());
|
|
978
978
|
if (!n) return null;
|
|
@@ -1007,7 +1007,7 @@ function Hn(e, t) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
return (r % 360 + 360) % 360;
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function Z(e) {
|
|
1011
1011
|
const n = e.trim().match(/^oklch\(\s*(.*?)\s*\)$/i);
|
|
1012
1012
|
if (!n) return null;
|
|
1013
1013
|
const o = n[1].split("/");
|
|
@@ -1018,21 +1018,21 @@ function Y(e) {
|
|
|
1018
1018
|
if (m.toLowerCase() === "none") return { value: 0, isPercent: !1 };
|
|
1019
1019
|
const A = m.match(/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%?)$/i);
|
|
1020
1020
|
if (!A) return null;
|
|
1021
|
-
const
|
|
1022
|
-
return isNaN(
|
|
1021
|
+
const z = parseFloat(A[1]);
|
|
1022
|
+
return isNaN(z) ? null : { value: z, isPercent: A[2] === "%" };
|
|
1023
1023
|
}, u = f(s[0]);
|
|
1024
1024
|
if (!u) return null;
|
|
1025
1025
|
const d = u.isPercent ? u.value : u.value * 100, h = f(s[1]);
|
|
1026
1026
|
if (!h) return null;
|
|
1027
|
-
const p = h.isPercent ? h.value / 100 * 0.4 : h.value,
|
|
1028
|
-
let
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1027
|
+
const p = h.isPercent ? h.value / 100 * 0.4 : h.value, v = s[2];
|
|
1028
|
+
let S;
|
|
1029
|
+
if (v.toLowerCase() === "none")
|
|
1030
|
+
S = 0;
|
|
1031
1031
|
else {
|
|
1032
|
-
const m =
|
|
1032
|
+
const m = v.match(/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?$/i);
|
|
1033
1033
|
if (!m) return null;
|
|
1034
|
-
const A = m[1],
|
|
1035
|
-
|
|
1034
|
+
const A = m[1], z = m[2] ?? "deg";
|
|
1035
|
+
S = Hn(A, z);
|
|
1036
1036
|
}
|
|
1037
1037
|
let O = 100;
|
|
1038
1038
|
if (a !== null) {
|
|
@@ -1043,7 +1043,7 @@ function Y(e) {
|
|
|
1043
1043
|
return {
|
|
1044
1044
|
l: d,
|
|
1045
1045
|
c: p,
|
|
1046
|
-
h:
|
|
1046
|
+
h: S,
|
|
1047
1047
|
a: O
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
@@ -1071,7 +1071,7 @@ function st(e = g()) {
|
|
|
1071
1071
|
function ft(e = g()) {
|
|
1072
1072
|
return $t(e);
|
|
1073
1073
|
}
|
|
1074
|
-
const Fn = "float",
|
|
1074
|
+
const Fn = "float", fe = { right: 440, bottom: 340 };
|
|
1075
1075
|
function lt(e = g()) {
|
|
1076
1076
|
return Tt(e);
|
|
1077
1077
|
}
|
|
@@ -1099,13 +1099,13 @@ function Ir(e, t) {
|
|
|
1099
1099
|
if (n) {
|
|
1100
1100
|
const r = JSON.parse(n);
|
|
1101
1101
|
return {
|
|
1102
|
-
right: typeof r.right == "number" && Number.isFinite(r.right) && r.right > 0 ? Math.max(
|
|
1103
|
-
bottom: typeof r.bottom == "number" && Number.isFinite(r.bottom) && r.bottom > 0 ? r.bottom :
|
|
1102
|
+
right: typeof r.right == "number" && Number.isFinite(r.right) && r.right > 0 ? Math.max(he, r.right) : fe.right,
|
|
1103
|
+
bottom: typeof r.bottom == "number" && Number.isFinite(r.bottom) && r.bottom > 0 ? r.bottom : fe.bottom
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
1106
|
} catch {
|
|
1107
1107
|
}
|
|
1108
|
-
return { ...
|
|
1108
|
+
return { ...fe };
|
|
1109
1109
|
}
|
|
1110
1110
|
function Or(e, t, n) {
|
|
1111
1111
|
try {
|
|
@@ -1130,22 +1130,22 @@ function Ar(e, t = 0, n) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return zn(t, n);
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Pr(e, t) {
|
|
1134
1134
|
try {
|
|
1135
1135
|
localStorage.setItem(at(t), JSON.stringify(e));
|
|
1136
1136
|
} catch {
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
const
|
|
1139
|
+
const le = 60, he = 320, He = 240, pe = 1600, ge = 1200, Rn = { width: 1024 * 0.8, height: 768 * 0.8 };
|
|
1140
1140
|
function Ln() {
|
|
1141
1141
|
const { width: e, height: t } = ct();
|
|
1142
1142
|
return { width: e, height: t };
|
|
1143
1143
|
}
|
|
1144
1144
|
const Fe = 32;
|
|
1145
|
-
function
|
|
1146
|
-
const n = typeof window < "u" ? window.innerWidth :
|
|
1145
|
+
function me(e, t) {
|
|
1146
|
+
const n = typeof window < "u" ? window.innerWidth : pe, r = typeof window < "u" ? window.innerHeight : ge, o = Math.max(he, Math.min(pe, n - Fe)), i = Math.max(He, Math.min(ge, r - Fe));
|
|
1147
1147
|
return {
|
|
1148
|
-
width: Math.max(
|
|
1148
|
+
width: Math.max(he, Math.min(e, o)),
|
|
1149
1149
|
height: Math.max(He, Math.min(t, i))
|
|
1150
1150
|
};
|
|
1151
1151
|
}
|
|
@@ -1156,7 +1156,7 @@ function Kn(e) {
|
|
|
1156
1156
|
function ct(e = 0, t) {
|
|
1157
1157
|
if (typeof window > "u")
|
|
1158
1158
|
return { ...Vn, ...t ?? Rn };
|
|
1159
|
-
const { width: n, height: r } = t ?
|
|
1159
|
+
const { width: n, height: r } = t ? me(t.width, t.height) : me(
|
|
1160
1160
|
Math.min(1200, 0.8 * window.innerWidth),
|
|
1161
1161
|
Math.min(800, 0.8 * window.innerHeight)
|
|
1162
1162
|
), o = Math.max(0, Math.round((window.innerHeight - r) / 2)), i = Math.max(0, Math.round((window.innerWidth - n) / 2)), a = jn * Kn(e), { top: s, left: f } = Bn(
|
|
@@ -1168,32 +1168,32 @@ function ct(e = 0, t) {
|
|
|
1168
1168
|
return { top: s, left: f, width: n, height: r };
|
|
1169
1169
|
}
|
|
1170
1170
|
function Bn(e, t, n, r) {
|
|
1171
|
-
const o = typeof window < "u" ? window.innerWidth :
|
|
1171
|
+
const o = typeof window < "u" ? window.innerWidth : pe, i = typeof window < "u" ? window.innerHeight : ge;
|
|
1172
1172
|
return {
|
|
1173
1173
|
top: Math.min(Math.max(0, e), Math.max(0, i - r)),
|
|
1174
1174
|
left: Math.min(Math.max(0, t), Math.max(0, o - n))
|
|
1175
1175
|
};
|
|
1176
1176
|
}
|
|
1177
|
-
function
|
|
1177
|
+
function _r(e) {
|
|
1178
1178
|
try {
|
|
1179
1179
|
const t = localStorage.getItem(st(e));
|
|
1180
1180
|
if (t) {
|
|
1181
1181
|
const n = JSON.parse(t);
|
|
1182
1182
|
if (typeof n.width == "number" && typeof n.height == "number" && Number.isFinite(n.width) && Number.isFinite(n.height))
|
|
1183
|
-
return
|
|
1183
|
+
return me(n.width, n.height);
|
|
1184
1184
|
}
|
|
1185
1185
|
} catch {
|
|
1186
1186
|
}
|
|
1187
1187
|
return Ln();
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function Er(e, t) {
|
|
1190
1190
|
try {
|
|
1191
1191
|
localStorage.setItem(st(t), JSON.stringify(e));
|
|
1192
1192
|
} catch {
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
const Gn = 1;
|
|
1196
|
-
function
|
|
1196
|
+
function Dr(e) {
|
|
1197
1197
|
return e === 0 ? "192px" : e === 2 ? "100%" : "288px";
|
|
1198
1198
|
}
|
|
1199
1199
|
function Hr(e) {
|
|
@@ -1212,7 +1212,7 @@ function Fr(e, t) {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
1214
1214
|
function Vr(e, t, n, r) {
|
|
1215
|
-
const o = -(n -
|
|
1215
|
+
const o = -(n - le), i = window.innerWidth - le, a = -30, s = window.innerHeight - le, f = Math.max(s, a), u = Math.max(i, o);
|
|
1216
1216
|
return {
|
|
1217
1217
|
top: Math.max(a, Math.min(e, f)),
|
|
1218
1218
|
left: Math.max(o, Math.min(t, u))
|
|
@@ -1223,16 +1223,16 @@ async function zr(e) {
|
|
|
1223
1223
|
function qn(e) {
|
|
1224
1224
|
return typeof e == "number" || e === "bg" || e === "fg";
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function ye(e) {
|
|
1227
1227
|
return typeof e == "object" && e !== null && "literal" in e;
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1229
|
+
function be(e) {
|
|
1230
|
+
return ye(e) && typeof e.literal == "object" && e.literal !== null;
|
|
1231
1231
|
}
|
|
1232
1232
|
function Jn(e) {
|
|
1233
1233
|
return typeof e == "object" && e !== null && "ref" in e;
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function ue() {
|
|
1236
1236
|
return {};
|
|
1237
1237
|
}
|
|
1238
1238
|
const Wn = {
|
|
@@ -1251,7 +1251,7 @@ const Wn = {
|
|
|
1251
1251
|
function b(e = g()) {
|
|
1252
1252
|
return xt(e.tabs) ?? Wn;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function re(e) {
|
|
1255
1255
|
const t = e.paletteSize;
|
|
1256
1256
|
return {
|
|
1257
1257
|
palette: Array.from({ length: t }, (r, o) => {
|
|
@@ -1269,8 +1269,8 @@ function ne(e) {
|
|
|
1269
1269
|
};
|
|
1270
1270
|
}
|
|
1271
1271
|
function Rr(e) {
|
|
1272
|
-
const t =
|
|
1273
|
-
return t ?
|
|
1272
|
+
const t = ee(e);
|
|
1273
|
+
return t ? re(t) : void 0;
|
|
1274
1274
|
}
|
|
1275
1275
|
function Xn() {
|
|
1276
1276
|
try {
|
|
@@ -1298,8 +1298,8 @@ function Zn(e, t, n, r) {
|
|
|
1298
1298
|
const o = (a) => a.toString(16).padStart(2, "0"), i = `#${o(e)}${o(t)}${o(n)}`;
|
|
1299
1299
|
return r < 255 ? `${i}${o(r)}` : i;
|
|
1300
1300
|
}
|
|
1301
|
-
let
|
|
1302
|
-
function
|
|
1301
|
+
let w = null;
|
|
1302
|
+
function xe(e) {
|
|
1303
1303
|
if (!e || e === "initial" || e === "inherit") return "#000000";
|
|
1304
1304
|
const t = e.trim();
|
|
1305
1305
|
if (/^#[0-9a-fA-F]{6}$/.test(t) || /^#[0-9a-fA-F]{8}$/.test(t)) return t;
|
|
@@ -1311,15 +1311,15 @@ function be(e) {
|
|
|
1311
1311
|
if (n) return n;
|
|
1312
1312
|
if (!Yn) return "#000000";
|
|
1313
1313
|
try {
|
|
1314
|
-
if (
|
|
1315
|
-
|
|
1316
|
-
const [r, o, i, a] =
|
|
1314
|
+
if (w || (w = document.createElement("canvas").getContext("2d")), !w) return "#000000";
|
|
1315
|
+
w.fillStyle = "#000000", w.fillStyle = t, w.clearRect(0, 0, 1, 1), w.fillRect(0, 0, 1, 1);
|
|
1316
|
+
const [r, o, i, a] = w.getImageData(0, 0, 1, 1).data;
|
|
1317
1317
|
return Zn(r, o, i, a);
|
|
1318
1318
|
} catch {
|
|
1319
1319
|
return "#000000";
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function _(e, t) {
|
|
1323
1323
|
document.documentElement.style.setProperty(e, t);
|
|
1324
1324
|
}
|
|
1325
1325
|
function Qn(e, t) {
|
|
@@ -1331,19 +1331,19 @@ function C(e, t, n) {
|
|
|
1331
1331
|
if (typeof e == "number") return e;
|
|
1332
1332
|
const r = t.indexOf(e);
|
|
1333
1333
|
if (r >= 0) return r;
|
|
1334
|
-
const o =
|
|
1334
|
+
const o = Z(e);
|
|
1335
1335
|
if (o)
|
|
1336
1336
|
for (let h = 0; h < t.length; h++) {
|
|
1337
|
-
const p =
|
|
1337
|
+
const p = Z(t[h]);
|
|
1338
1338
|
if (p && Qn(o, p)) return h;
|
|
1339
1339
|
}
|
|
1340
|
-
const i =
|
|
1340
|
+
const i = xe(e), a = t.map((h) => xe(h)), s = a.indexOf(i);
|
|
1341
1341
|
if (s >= 0) return s;
|
|
1342
1342
|
const f = Ve(i);
|
|
1343
1343
|
let u = n, d = 1 / 0;
|
|
1344
1344
|
for (let h = 0; h < a.length; h++) {
|
|
1345
|
-
const p = Ve(a[h]),
|
|
1346
|
-
|
|
1345
|
+
const p = Ve(a[h]), v = (f.r - p.r) ** 2 + (f.g - p.g) ** 2 + (f.b - p.b) ** 2;
|
|
1346
|
+
v < d && (d = v, u = h);
|
|
1347
1347
|
}
|
|
1348
1348
|
return u;
|
|
1349
1349
|
}
|
|
@@ -1368,7 +1368,7 @@ function dt(e = b(), t) {
|
|
|
1368
1368
|
function er(e = b(), t) {
|
|
1369
1369
|
const n = e.colorSchemes;
|
|
1370
1370
|
if (Object.keys(n).length === 0)
|
|
1371
|
-
return
|
|
1371
|
+
return re(e);
|
|
1372
1372
|
const r = dt(e, t), o = n[r] ?? Object.values(n)[0];
|
|
1373
1373
|
return nr(o, e);
|
|
1374
1374
|
}
|
|
@@ -1376,13 +1376,13 @@ function Ie(e = b(), t) {
|
|
|
1376
1376
|
return dt(e, t);
|
|
1377
1377
|
}
|
|
1378
1378
|
function tr(e) {
|
|
1379
|
-
return
|
|
1379
|
+
return Z(e) ? e : xe(e);
|
|
1380
1380
|
}
|
|
1381
1381
|
function nr(e, t = b()) {
|
|
1382
1382
|
if (t.paletteSize === 0)
|
|
1383
1383
|
return console.warn(
|
|
1384
1384
|
`[tweak] Scheme/preset load ignored for palette-less cluster "${t.id}" (paletteSize: 0) — schemes cannot seed a tier with no palette.`
|
|
1385
|
-
),
|
|
1385
|
+
), re(t);
|
|
1386
1386
|
const n = e.palette.map(tr), r = {};
|
|
1387
1387
|
for (const [o, i] of Object.entries(t.semanticDefaults)) {
|
|
1388
1388
|
const a = e.semantic?.[o];
|
|
@@ -1424,16 +1424,16 @@ function nr(e, t = b()) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
function rr(e, t, n, r) {
|
|
1426
1426
|
const o = t.length;
|
|
1427
|
-
return e === "bg" ? t[
|
|
1427
|
+
return e === "bg" ? t[D(n, o)] ?? "#000000" : e === "fg" ? t[D(r, o)] ?? "#ffffff" : t[D(e, o)] ?? "#000000";
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function D(e, t) {
|
|
1430
1430
|
return e >= 0 && e < t ? e : 0;
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function Me(e, t, n, r, o, i, a) {
|
|
1433
1433
|
if (qn(e)) return rr(e, t, n, r);
|
|
1434
|
-
if (
|
|
1434
|
+
if (ye(e) && be(e))
|
|
1435
1435
|
return a ? e.literal[a] : `light-dark(${e.literal.light}, ${e.literal.dark})`;
|
|
1436
|
-
if (
|
|
1436
|
+
if (ye(e) && !be(e)) return e.literal;
|
|
1437
1437
|
if (Jn(e) && o)
|
|
1438
1438
|
try {
|
|
1439
1439
|
return `var(${At(e.ref, o, i ?? [o])})`;
|
|
@@ -1450,7 +1450,7 @@ function Lr(e, t) {
|
|
|
1450
1450
|
return e.literal[t];
|
|
1451
1451
|
}
|
|
1452
1452
|
function jr(e, t, n = b(), r, o) {
|
|
1453
|
-
return
|
|
1453
|
+
return Me(
|
|
1454
1454
|
e,
|
|
1455
1455
|
t.palette,
|
|
1456
1456
|
t.background,
|
|
@@ -1460,11 +1460,11 @@ function jr(e, t, n = b(), r, o) {
|
|
|
1460
1460
|
or(n)
|
|
1461
1461
|
) ?? "#000000";
|
|
1462
1462
|
}
|
|
1463
|
-
const
|
|
1464
|
-
function
|
|
1463
|
+
const k = "color-scheme", B = "light dark";
|
|
1464
|
+
function Q(e, t) {
|
|
1465
1465
|
for (const n of Object.keys(t.semanticCssNames)) {
|
|
1466
1466
|
const r = e.semanticMappings[n] ?? t.semanticDefaults[n];
|
|
1467
|
-
if (r !== void 0 &&
|
|
1467
|
+
if (r !== void 0 && be(r)) return !0;
|
|
1468
1468
|
}
|
|
1469
1469
|
return !1;
|
|
1470
1470
|
}
|
|
@@ -1473,14 +1473,14 @@ function ze(e, t = b(), n, r, o, i) {
|
|
|
1473
1473
|
if (n) {
|
|
1474
1474
|
const s = [];
|
|
1475
1475
|
for (let f = 0; f < a; f++)
|
|
1476
|
-
s.push([
|
|
1476
|
+
s.push([q(t, f), e.palette[f]]);
|
|
1477
1477
|
for (const [f, u] of Object.entries(t.baseRoles)) {
|
|
1478
1478
|
if (typeof u != "string" || u.length === 0) continue;
|
|
1479
1479
|
const d = e[f];
|
|
1480
|
-
typeof d == "number" && s.push([u, e.palette[
|
|
1480
|
+
typeof d == "number" && s.push([u, e.palette[D(d, a)]]);
|
|
1481
1481
|
}
|
|
1482
1482
|
for (const [f, u] of Object.entries(t.semanticCssNames)) {
|
|
1483
|
-
const d = e.semanticMappings[f] ?? t.semanticDefaults[f], h =
|
|
1483
|
+
const d = e.semanticMappings[f] ?? t.semanticDefaults[f], h = Me(
|
|
1484
1484
|
d,
|
|
1485
1485
|
e.palette,
|
|
1486
1486
|
e.background,
|
|
@@ -1490,7 +1490,7 @@ function ze(e, t = b(), n, r, o, i) {
|
|
|
1490
1490
|
);
|
|
1491
1491
|
h !== null && s.push([u, h]);
|
|
1492
1492
|
}
|
|
1493
|
-
|
|
1493
|
+
Q(e, t) && (s.push([k, B]), i && De(i));
|
|
1494
1494
|
try {
|
|
1495
1495
|
n.apply(s);
|
|
1496
1496
|
} catch (f) {
|
|
@@ -1499,14 +1499,14 @@ function ze(e, t = b(), n, r, o, i) {
|
|
|
1499
1499
|
return;
|
|
1500
1500
|
}
|
|
1501
1501
|
for (let s = 0; s < a; s++)
|
|
1502
|
-
|
|
1502
|
+
_(q(t, s), e.palette[s]);
|
|
1503
1503
|
for (const [s, f] of Object.entries(t.baseRoles)) {
|
|
1504
1504
|
if (typeof f != "string" || f.length === 0) continue;
|
|
1505
1505
|
const u = e[s];
|
|
1506
|
-
typeof u == "number" &&
|
|
1506
|
+
typeof u == "number" && _(f, e.palette[D(u, a)]);
|
|
1507
1507
|
}
|
|
1508
1508
|
for (const [s, f] of Object.entries(t.semanticCssNames)) {
|
|
1509
|
-
const u = e.semanticMappings[s] ?? t.semanticDefaults[s], d =
|
|
1509
|
+
const u = e.semanticMappings[s] ?? t.semanticDefaults[s], d = Me(
|
|
1510
1510
|
u,
|
|
1511
1511
|
e.palette,
|
|
1512
1512
|
e.background,
|
|
@@ -1514,14 +1514,17 @@ function ze(e, t = b(), n, r, o, i) {
|
|
|
1514
1514
|
r,
|
|
1515
1515
|
o
|
|
1516
1516
|
);
|
|
1517
|
-
d !== null &&
|
|
1517
|
+
d !== null && _(f, d);
|
|
1518
|
+
}
|
|
1519
|
+
if (Q(e, t)) {
|
|
1520
|
+
const s = document.documentElement.style, f = s.getPropertyValue(k), u = f === B && s.getPropertyPriority(k) === "";
|
|
1521
|
+
i && !u && V(i), f === "" && (_(k, B), i && De(i));
|
|
1518
1522
|
}
|
|
1519
|
-
U(e, t) && (P($, Me), i && Ee(i));
|
|
1520
1523
|
}
|
|
1521
1524
|
function ir(e, t, n) {
|
|
1522
1525
|
const r = n ?? g(), o = r.applySink, i = r.tabs.find((u) => u.id === "color"), a = b(r);
|
|
1523
1526
|
ze(e, a, o, i, r.tabs, r.storagePrefix);
|
|
1524
|
-
const s =
|
|
1527
|
+
const s = ee(r);
|
|
1525
1528
|
let f = !1;
|
|
1526
1529
|
if (s && t) {
|
|
1527
1530
|
const u = r.tabs.find((d) => d.id === "color-secondary");
|
|
@@ -1532,16 +1535,16 @@ function ir(e, t, n) {
|
|
|
1532
1535
|
u,
|
|
1533
1536
|
r.tabs,
|
|
1534
1537
|
r.storagePrefix
|
|
1535
|
-
), f =
|
|
1538
|
+
), f = Q(t, s);
|
|
1536
1539
|
}
|
|
1537
|
-
if (!
|
|
1540
|
+
if (!Q(e, a) && !f)
|
|
1538
1541
|
if (o) {
|
|
1539
1542
|
try {
|
|
1540
|
-
o.clear([
|
|
1543
|
+
o.clear([k]);
|
|
1541
1544
|
} catch (u) {
|
|
1542
1545
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", u);
|
|
1543
1546
|
}
|
|
1544
|
-
|
|
1547
|
+
V(r.storagePrefix);
|
|
1545
1548
|
} else
|
|
1546
1549
|
gt(r.storagePrefix);
|
|
1547
1550
|
}
|
|
@@ -1551,16 +1554,16 @@ function Kr(e, t) {
|
|
|
1551
1554
|
}
|
|
1552
1555
|
function ar(e, t) {
|
|
1553
1556
|
const n = t ?? g(), r = n.applySink;
|
|
1554
|
-
if (
|
|
1557
|
+
if (j(n.tabs, "spacing", e.spacing, r), j(n.tabs, "font", e.typography, r), j(n.tabs, "size", e.size, r), e.tabs)
|
|
1555
1558
|
for (const [o, i] of Object.entries(e.tabs)) {
|
|
1556
1559
|
const a = {};
|
|
1557
1560
|
for (const s of Object.values(i))
|
|
1558
1561
|
for (const [f, u] of Object.entries(s))
|
|
1559
1562
|
a[f] = u;
|
|
1560
|
-
|
|
1563
|
+
j(n.tabs, o, a, r);
|
|
1561
1564
|
}
|
|
1562
1565
|
}
|
|
1563
|
-
function
|
|
1566
|
+
function j(e, t, n, r) {
|
|
1564
1567
|
const o = e.find((s) => s.id === t);
|
|
1565
1568
|
if (!o) return;
|
|
1566
1569
|
const i = {};
|
|
@@ -1578,7 +1581,7 @@ function L(e, t, n, r) {
|
|
|
1578
1581
|
for (const d of u.items)
|
|
1579
1582
|
if (!d.readonly)
|
|
1580
1583
|
try {
|
|
1581
|
-
const h =
|
|
1584
|
+
const h = _e(o, u.id, d.id, i), p = Ee(h);
|
|
1582
1585
|
typeof n[d.id] == "string" && n[d.id].length > 0 || u.referencesTier !== void 0 ? s.push([d.cssVar, p]) : f.push(d.cssVar);
|
|
1583
1586
|
} catch {
|
|
1584
1587
|
f.push(d.cssVar);
|
|
@@ -1602,20 +1605,20 @@ function L(e, t, n, r) {
|
|
|
1602
1605
|
for (const f of s.items)
|
|
1603
1606
|
if (!f.readonly)
|
|
1604
1607
|
try {
|
|
1605
|
-
const u =
|
|
1606
|
-
typeof n[f.id] == "string" && n[f.id].length > 0 || s.referencesTier !== void 0 ?
|
|
1608
|
+
const u = _e(o, s.id, f.id, i), d = Ee(u);
|
|
1609
|
+
typeof n[f.id] == "string" && n[f.id].length > 0 || s.referencesTier !== void 0 ? _(f.cssVar, d) : a.style.removeProperty(f.cssVar);
|
|
1607
1610
|
} catch {
|
|
1608
1611
|
a.style.removeProperty(f.cssVar);
|
|
1609
1612
|
}
|
|
1610
1613
|
}
|
|
1611
1614
|
function ht(e) {
|
|
1612
|
-
const t = e ?? g(), n = b(t), r =
|
|
1615
|
+
const t = e ?? g(), n = b(t), r = ee(t);
|
|
1613
1616
|
return r ? [n, r] : [n];
|
|
1614
1617
|
}
|
|
1615
1618
|
function pt(e) {
|
|
1616
1619
|
const t = [];
|
|
1617
1620
|
for (let n = 0; n < e.paletteSize; n++)
|
|
1618
|
-
t.push(
|
|
1621
|
+
t.push(q(e, n));
|
|
1619
1622
|
for (const n of Object.values(e.baseRoles))
|
|
1620
1623
|
typeof n == "string" && n.length > 0 && t.push(n);
|
|
1621
1624
|
for (const n of Object.values(e.semanticCssNames))
|
|
@@ -1634,7 +1637,7 @@ function sr(e) {
|
|
|
1634
1637
|
function gt(e) {
|
|
1635
1638
|
if (!Ot(e)) return;
|
|
1636
1639
|
const t = document.documentElement;
|
|
1637
|
-
t.style.getPropertyValue(
|
|
1640
|
+
t.style.getPropertyValue(k) === B && t.style.getPropertyPriority(k) === "" && t.style.removeProperty(k), V(e);
|
|
1638
1641
|
}
|
|
1639
1642
|
function fr(e, t, n) {
|
|
1640
1643
|
const r = e ?? ht(n), o = n?.applySink, i = (n ?? g()).storagePrefix;
|
|
@@ -1645,19 +1648,19 @@ function lr(e, t, n) {
|
|
|
1645
1648
|
const o = [];
|
|
1646
1649
|
for (const i of e)
|
|
1647
1650
|
o.push(...pt(i));
|
|
1648
|
-
if (e.length > 0 && o.push(
|
|
1651
|
+
if (e.length > 0 && o.push(k), o.length > 0)
|
|
1649
1652
|
try {
|
|
1650
1653
|
t.clear(o);
|
|
1651
1654
|
} catch (i) {
|
|
1652
1655
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", i);
|
|
1653
1656
|
}
|
|
1654
|
-
n && e.length > 0 &&
|
|
1657
|
+
n && e.length > 0 && V(n);
|
|
1655
1658
|
return;
|
|
1656
1659
|
}
|
|
1657
1660
|
const r = document.documentElement;
|
|
1658
1661
|
for (const o of e) {
|
|
1659
1662
|
for (let i = 0; i < o.paletteSize; i++)
|
|
1660
|
-
r.style.removeProperty(
|
|
1663
|
+
r.style.removeProperty(q(o, i));
|
|
1661
1664
|
for (const i of Object.values(o.baseRoles))
|
|
1662
1665
|
r.style.removeProperty(i);
|
|
1663
1666
|
for (const i of Object.values(o.semanticCssNames))
|
|
@@ -1671,13 +1674,13 @@ function Br(e, t) {
|
|
|
1671
1674
|
const a = [];
|
|
1672
1675
|
for (const s of o)
|
|
1673
1676
|
a.push(...pt(s));
|
|
1674
|
-
if (o.length > 0 && a.push(
|
|
1677
|
+
if (o.length > 0 && a.push(k), a.push(...sr(n)), a.length > 0)
|
|
1675
1678
|
try {
|
|
1676
1679
|
r.clear(a);
|
|
1677
1680
|
} catch (s) {
|
|
1678
1681
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", s);
|
|
1679
1682
|
}
|
|
1680
|
-
o.length > 0 &&
|
|
1683
|
+
o.length > 0 && V(n.storagePrefix);
|
|
1681
1684
|
return;
|
|
1682
1685
|
}
|
|
1683
1686
|
fr(o, void 0, n);
|
|
@@ -1803,7 +1806,7 @@ function hr(e) {
|
|
|
1803
1806
|
}
|
|
1804
1807
|
function ve(e, t, n, r = g()) {
|
|
1805
1808
|
if (!e.color || typeof e.color != "object") return null;
|
|
1806
|
-
const o = n ??
|
|
1809
|
+
const o = n ?? Pe(t, r), i = e.typography !== void 0 ? e.typography : e.font, a = r.legacyIdRenameMap ?? {}, s = {
|
|
1807
1810
|
color: ke(e.color, o, t.paletteSize),
|
|
1808
1811
|
// New sections added after v1 migration — tolerate their absence so
|
|
1809
1812
|
// older v2 payloads (Color-only) still load cleanly.
|
|
@@ -1813,10 +1816,10 @@ function ve(e, t, n, r = g()) {
|
|
|
1813
1816
|
// host-driven id rename without losing the user's tweaks.
|
|
1814
1817
|
typography: dr(i, a),
|
|
1815
1818
|
size: Re(e.size)
|
|
1816
|
-
}, f =
|
|
1819
|
+
}, f = ee(r);
|
|
1817
1820
|
f && e.secondary && mt(e.secondary, f.paletteSize) && (s.secondary = ke(
|
|
1818
1821
|
e.secondary,
|
|
1819
|
-
|
|
1822
|
+
re(f),
|
|
1820
1823
|
f.paletteSize
|
|
1821
1824
|
));
|
|
1822
1825
|
const u = hr(e.tabs);
|
|
@@ -1825,12 +1828,12 @@ function ve(e, t, n, r = g()) {
|
|
|
1825
1828
|
function pr(e = localStorage, t, n = b(), r = g()) {
|
|
1826
1829
|
const o = rt(r), i = ot(r), a = it(r), s = H(e, a);
|
|
1827
1830
|
if (s !== null) {
|
|
1828
|
-
const d =
|
|
1831
|
+
const d = G(s);
|
|
1829
1832
|
if (d && typeof d == "object") {
|
|
1830
1833
|
const h = d, p = ve(h, n, t, r);
|
|
1831
1834
|
if (p !== null) {
|
|
1832
|
-
const
|
|
1833
|
-
if (
|
|
1835
|
+
const v = h.typography !== void 0 ? h.typography : h.font, S = JSON.stringify(v ?? {}) !== JSON.stringify(p.typography), O = h.color, m = Array.isArray(O?.palette) && O.palette.length !== n.paletteSize;
|
|
1836
|
+
if (S || h.typography === void 0 || m)
|
|
1834
1837
|
try {
|
|
1835
1838
|
e.setItem(a, JSON.stringify(p));
|
|
1836
1839
|
} catch {
|
|
@@ -1842,7 +1845,7 @@ function pr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1842
1845
|
}
|
|
1843
1846
|
const f = H(e, i);
|
|
1844
1847
|
if (f !== null) {
|
|
1845
|
-
const d =
|
|
1848
|
+
const d = G(f);
|
|
1846
1849
|
if (d && typeof d == "object") {
|
|
1847
1850
|
const p = ve(d, n, t, r);
|
|
1848
1851
|
if (p !== null) {
|
|
@@ -1857,21 +1860,21 @@ function pr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1857
1860
|
}
|
|
1858
1861
|
const u = H(e, o);
|
|
1859
1862
|
if (u !== null) {
|
|
1860
|
-
const d =
|
|
1863
|
+
const d = G(u);
|
|
1861
1864
|
if (d && typeof d == "object" && mt(d, n.paletteSize)) {
|
|
1862
|
-
const h = t ??
|
|
1865
|
+
const h = t ?? Pe(n, r), p = d;
|
|
1863
1866
|
p.shikiTheme || (p.shikiTheme = h.shikiTheme);
|
|
1864
|
-
const
|
|
1867
|
+
const S = {
|
|
1865
1868
|
color: ke(p, h, n.paletteSize),
|
|
1866
|
-
spacing:
|
|
1867
|
-
typography:
|
|
1868
|
-
size:
|
|
1869
|
+
spacing: ue(),
|
|
1870
|
+
typography: ue(),
|
|
1871
|
+
size: ue()
|
|
1869
1872
|
};
|
|
1870
1873
|
try {
|
|
1871
|
-
e.setItem(a, JSON.stringify(
|
|
1874
|
+
e.setItem(a, JSON.stringify(S)), e.removeItem(o);
|
|
1872
1875
|
} catch {
|
|
1873
1876
|
}
|
|
1874
|
-
return
|
|
1877
|
+
return S;
|
|
1875
1878
|
}
|
|
1876
1879
|
console.warn(`[tweak] Malformed ${o}; discarding and using fresh defaults`);
|
|
1877
1880
|
try {
|
|
@@ -1884,7 +1887,7 @@ function pr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1884
1887
|
function Oe(e, t) {
|
|
1885
1888
|
const n = H(e, F(t));
|
|
1886
1889
|
if (n === null) return null;
|
|
1887
|
-
const r =
|
|
1890
|
+
const r = G(n);
|
|
1888
1891
|
if (!r || typeof r != "object" || Array.isArray(r)) return null;
|
|
1889
1892
|
const o = r, i = o.color;
|
|
1890
1893
|
return !i || typeof i != "object" || Array.isArray(i) || Array.isArray(i.palette) ? null : o;
|
|
@@ -1898,7 +1901,7 @@ function yt(e) {
|
|
|
1898
1901
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
1899
1902
|
}
|
|
1900
1903
|
function gr(e, t, n, r) {
|
|
1901
|
-
const o = Ie(t, r), i = Ae(e)?.[o], a = i && typeof i == "object" && !Array.isArray(i) ? i : void 0, s = yt(e)?.[o], f = n ??
|
|
1904
|
+
const o = Ie(t, r), i = Ae(e)?.[o], a = i && typeof i == "object" && !Array.isArray(i) ? i : void 0, s = yt(e)?.[o], f = n ?? Pe(t, r), u = {
|
|
1902
1905
|
color: a ?? f,
|
|
1903
1906
|
secondary: s,
|
|
1904
1907
|
spacing: e.spacing,
|
|
@@ -1962,14 +1965,14 @@ function H(e, t) {
|
|
|
1962
1965
|
return null;
|
|
1963
1966
|
}
|
|
1964
1967
|
}
|
|
1965
|
-
function
|
|
1968
|
+
function G(e) {
|
|
1966
1969
|
try {
|
|
1967
1970
|
return JSON.parse(e);
|
|
1968
1971
|
} catch {
|
|
1969
1972
|
return null;
|
|
1970
1973
|
}
|
|
1971
1974
|
}
|
|
1972
|
-
function
|
|
1975
|
+
function Pe(e, t) {
|
|
1973
1976
|
try {
|
|
1974
1977
|
return er(e, t);
|
|
1975
1978
|
} catch {
|
|
@@ -1989,7 +1992,7 @@ function _e(e, t) {
|
|
|
1989
1992
|
}
|
|
1990
1993
|
}
|
|
1991
1994
|
export {
|
|
1992
|
-
|
|
1995
|
+
Er as $,
|
|
1993
1996
|
Kr as A,
|
|
1994
1997
|
Wr as B,
|
|
1995
1998
|
Ie as C,
|
|
@@ -1997,14 +2000,14 @@ export {
|
|
|
1997
2000
|
Ln as E,
|
|
1998
2001
|
Gn as F,
|
|
1999
2002
|
Fn as G,
|
|
2000
|
-
|
|
2001
|
-
|
|
2003
|
+
fe as H,
|
|
2004
|
+
_r as I,
|
|
2002
2005
|
Ar as J,
|
|
2003
2006
|
Vr as K,
|
|
2004
2007
|
Hr as L,
|
|
2005
2008
|
yr as M,
|
|
2006
2009
|
Ir as N,
|
|
2007
|
-
|
|
2010
|
+
he as O,
|
|
2008
2011
|
Cr as P,
|
|
2009
2012
|
Fr as Q,
|
|
2010
2013
|
Tr as R,
|
|
@@ -2013,20 +2016,20 @@ export {
|
|
|
2013
2016
|
Xr as U,
|
|
2014
2017
|
Br as V,
|
|
2015
2018
|
er as W,
|
|
2016
|
-
|
|
2019
|
+
Dr as X,
|
|
2017
2020
|
ir as Y,
|
|
2018
2021
|
Gr as Z,
|
|
2019
|
-
|
|
2022
|
+
Pr as _,
|
|
2020
2023
|
rt as a,
|
|
2021
2024
|
Or as a0,
|
|
2022
|
-
|
|
2023
|
-
|
|
2025
|
+
me as a1,
|
|
2026
|
+
ue as a2,
|
|
2024
2027
|
F as a3,
|
|
2025
2028
|
it as a4,
|
|
2026
2029
|
jr as a5,
|
|
2027
2030
|
ot as b,
|
|
2028
|
-
|
|
2029
|
-
|
|
2031
|
+
be as c,
|
|
2032
|
+
ye as d,
|
|
2030
2033
|
Jn as e,
|
|
2031
2034
|
b as f,
|
|
2032
2035
|
$r as g,
|
|
@@ -2041,9 +2044,9 @@ export {
|
|
|
2041
2044
|
Sr as p,
|
|
2042
2045
|
br as q,
|
|
2043
2046
|
vr as r,
|
|
2044
|
-
|
|
2047
|
+
D as s,
|
|
2045
2048
|
wr as t,
|
|
2046
|
-
|
|
2049
|
+
Z as u,
|
|
2047
2050
|
Nr as v,
|
|
2048
2051
|
Lr as w,
|
|
2049
2052
|
or as x,
|