@bluepic/embed 0.4.0-next.111 → 0.4.0-next.113

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/dist/theme.mjs ADDED
@@ -0,0 +1,1299 @@
1
+ const sr = [
2
+ /* mode */
3
+ "color-scheme",
4
+ // 'dark' | 'light' — feeds the CSS `color-scheme` property
5
+ /* surfaces (elevation ladder; each step is guaranteed to be distinguishable from the previous) */
6
+ "surface",
7
+ // page / editor background (the user's "background" choice)
8
+ "surface-rgb",
9
+ "surface-1",
10
+ // cards, gallery cards, popups
11
+ "surface-1-rgb",
12
+ "surface-2",
13
+ // popovers, menus, dropdowns, tooltips' neighbours
14
+ "surface-2-rgb",
15
+ "surface-3",
16
+ // nested/raised elements inside popovers
17
+ "surface-inverse",
18
+ // tooltips, toasts
19
+ "scrim",
20
+ // modal backdrop
21
+ /* ink = the text colour family; alpha-based so it works on every surface step */
22
+ "ink",
23
+ // solid ink colour (white in dark, near-black in light)
24
+ "ink-rgb",
25
+ "text",
26
+ // primary text
27
+ "text-muted",
28
+ // labels, descriptions
29
+ "text-faint",
30
+ // placeholders, disabled
31
+ "text-inverse",
32
+ // text on surface-inverse
33
+ "text-on-surface-rgb",
34
+ // legacy `--text-color-base` triplet (= ink-rgb)
35
+ "text-on-inverse-rgb",
36
+ // legacy `--text-color-alt` triplet
37
+ /* borders & dividers */
38
+ "border",
39
+ // subtle component borders
40
+ "border-strong",
41
+ // outlined buttons, bordered inputs
42
+ "divider",
43
+ "border-rgb",
44
+ // legacy `--border-color-base` triplet
45
+ /* neutral interaction fills (buttons, list hover, inputs) */
46
+ "fill",
47
+ // tonal neutral fill (secondary button, tag, segment)
48
+ "fill-hover",
49
+ "fill-active",
50
+ "field",
51
+ // input / select background
52
+ "field-hover",
53
+ "field-focus",
54
+ "hover",
55
+ // transparent→tint hover for ghost elements / list rows
56
+ "pressed",
57
+ /* primary / brand */
58
+ "primary",
59
+ "primary-rgb",
60
+ "primary-hover",
61
+ "primary-active",
62
+ "on-primary",
63
+ // text/icon on solid primary — auto black/white
64
+ "primary-text",
65
+ // primary used AS text on `surface` (contrast-corrected)
66
+ "primary-border",
67
+ // primary used as a 1px border/indicator on `surface` (≥ 3:1)
68
+ "primary-soft",
69
+ // tinted background (selected menu item, active tab, soft button)
70
+ "primary-soft-hover",
71
+ "focus-ring",
72
+ "focus-ring-width",
73
+ "focus-ring-offset",
74
+ // derived shades (kept for the component tier's `rgba(var(--primary-color-light), a)` habit)
75
+ "primary-dark",
76
+ "primary-dark-rgb",
77
+ "primary-light",
78
+ "primary-light-rgb",
79
+ "primary-bright",
80
+ "primary-bright-rgb",
81
+ /* status — each: base (solid), on (text on solid), text (as text on surface), soft (tint bg), border, + shades */
82
+ "success",
83
+ "success-rgb",
84
+ "on-success",
85
+ "success-text",
86
+ "success-soft",
87
+ "success-border",
88
+ "success-dark-rgb",
89
+ "success-light-rgb",
90
+ "success-darker-rgb",
91
+ "warning",
92
+ "warning-rgb",
93
+ "on-warning",
94
+ "warning-text",
95
+ "warning-soft",
96
+ "warning-border",
97
+ "warning-dark-rgb",
98
+ "warning-light-rgb",
99
+ "warning-darker-rgb",
100
+ "error",
101
+ "error-rgb",
102
+ "on-error",
103
+ "error-text",
104
+ "error-soft",
105
+ "error-border",
106
+ "error-dark-rgb",
107
+ "error-light-rgb",
108
+ "error-darker-rgb",
109
+ "info",
110
+ "info-rgb",
111
+ "on-info",
112
+ "info-text",
113
+ "info-soft",
114
+ "info-border",
115
+ "info-dark-rgb",
116
+ "info-light-rgb",
117
+ "info-bright-rgb",
118
+ /* elevation shadows */
119
+ "shadow-1",
120
+ "shadow-2",
121
+ "shadow-3",
122
+ /* shape & typography */
123
+ "radius-sm",
124
+ "radius-md",
125
+ "radius-lg",
126
+ "radius-full",
127
+ "font-family",
128
+ // UI font (controls)
129
+ "font-family-heading",
130
+ // heading / content font ("real text")
131
+ "font-size",
132
+ // e.g. 14px
133
+ "root-font-size",
134
+ // legacy unitless number (14)
135
+ /* canvas (the template preview area) */
136
+ "canvas",
137
+ "canvas-image",
138
+ "canvas-control",
139
+ "canvas-control-hover",
140
+ "on-canvas-control",
141
+ /* disabled */
142
+ "disabled-opacity"
143
+ ], ir = "--bx-", Ao = [
144
+ { label: "Surfaces", tokens: ["surface", "surface-1", "surface-2", "surface-3", "surface-inverse", "scrim"] },
145
+ { label: "Text", tokens: ["text", "text-muted", "text-faint", "text-inverse"] },
146
+ { label: "Borders", tokens: ["border", "border-strong", "divider"] },
147
+ { label: "Neutral fills", tokens: ["fill", "fill-hover", "fill-active", "field", "field-hover", "field-focus", "hover", "pressed"] },
148
+ { label: "Primary", tokens: ["primary", "primary-hover", "primary-active", "on-primary", "primary-text", "primary-border", "primary-soft", "primary-soft-hover", "focus-ring"] },
149
+ { label: "Success", tokens: ["success", "on-success", "success-text", "success-soft", "success-border"] },
150
+ { label: "Warning", tokens: ["warning", "on-warning", "warning-text", "warning-soft", "warning-border"] },
151
+ { label: "Error", tokens: ["error", "on-error", "error-text", "error-soft", "error-border"] },
152
+ { label: "Info", tokens: ["info", "on-info", "info-text", "info-soft", "info-border"] },
153
+ { label: "Shape & type", tokens: ["radius-sm", "radius-md", "radius-lg", "radius-full", "font-family", "font-family-heading", "font-size"] },
154
+ { label: "Canvas", tokens: ["canvas", "canvas-control", "on-canvas-control"] }
155
+ ], no = {
156
+ // Same surfaces as the historical presets so existing campaigns keep their background.
157
+ dark: { surface: "#27262e", primary: "#4472c7" },
158
+ light: { surface: "#f2f2f2", primary: "#124bba" }
159
+ }, No = [
160
+ { key: "light", label: "Light", description: "Neutral light surfaces, Bluepic blue.", input: { version: 2, preset: "light" } },
161
+ { key: "dark", label: "Dark", description: "Neutral dark surfaces, Bluepic blue.", input: { version: 2, preset: "dark" } },
162
+ { key: "midnight", label: "Midnight", description: "Near-black with cool, slightly tinted surfaces.", input: { version: 2, surface: "#0f1117", primary: "#7da8f7", tint: 0.35 } },
163
+ { key: "paper", label: "Paper", description: "Warm off-white, ink-black actions, crisp corners.", input: { version: 2, surface: "#fbf8f1", primary: "#1f1f1f", radius: "sm" } },
164
+ { key: "slate", label: "Slate", description: "Blue-grey dark surfaces with a teal accent.", input: { version: 2, surface: "#1e2530", primary: "#4fd1c5", tint: 0.4 } },
165
+ { key: "sand", label: "Sand", description: "Soft sand surfaces with a terracotta accent, rounded.", input: { version: 2, surface: "#f3ede3", primary: "#b5562c", radius: "lg" } },
166
+ { key: "forest", label: "Forest", description: "Deep green surfaces with a mint accent.", input: { version: 2, surface: "#0e1f17", primary: "#7ad39a", tint: 0.5 } },
167
+ { key: "ocean", label: "Ocean", description: "Cool light surfaces with a deep blue accent, pill shapes.", input: { version: 2, surface: "#eef4fb", primary: "#0b5cad", tint: 0.3, radius: "full" } }
168
+ ], ao = {
169
+ success: "#28a552",
170
+ warning: "#d9a400",
171
+ error: "#dc2f2f",
172
+ info: "#3b82f6"
173
+ }, I = Object.freeze({ r: 255, g: 255, b: 255, a: 1 }), Z = Object.freeze({ r: 0, g: 0, b: 0, a: 1 }), _r = [I, Object.freeze({ r: 17, g: 17, b: 17, a: 1 })], dr = (o, e, t) => o < e ? e : o > t ? t : o, w = (o) => dr(o, 0, 1), m = (o, e = 0) => Number.isFinite(o) ? o : e, k = (o, e, t, a = 1) => ({ r: o, g: e, b: t, a }), O = (o) => Math.round(dr(m(o), 0, 255)), cr = (o) => O(o).toString(16).padStart(2, "0"), co = {
174
+ aliceblue: 15792383,
175
+ antiquewhite: 16444375,
176
+ aqua: 65535,
177
+ aquamarine: 8388564,
178
+ azure: 15794175,
179
+ beige: 16119260,
180
+ bisque: 16770244,
181
+ black: 0,
182
+ blanchedalmond: 16772045,
183
+ blue: 255,
184
+ blueviolet: 9055202,
185
+ brown: 10824234,
186
+ burlywood: 14596231,
187
+ cadetblue: 6266528,
188
+ chartreuse: 8388352,
189
+ chocolate: 13789470,
190
+ coral: 16744272,
191
+ cornflowerblue: 6591981,
192
+ cornsilk: 16775388,
193
+ crimson: 14423100,
194
+ cyan: 65535,
195
+ darkblue: 139,
196
+ darkcyan: 35723,
197
+ darkgoldenrod: 12092939,
198
+ darkgray: 11119017,
199
+ darkgreen: 25600,
200
+ darkgrey: 11119017,
201
+ darkkhaki: 12433259,
202
+ darkmagenta: 9109643,
203
+ darkolivegreen: 5597999,
204
+ darkorange: 16747520,
205
+ darkorchid: 10040012,
206
+ darkred: 9109504,
207
+ darksalmon: 15308410,
208
+ darkseagreen: 9419919,
209
+ darkslateblue: 4734347,
210
+ darkslategray: 3100495,
211
+ darkslategrey: 3100495,
212
+ darkturquoise: 52945,
213
+ darkviolet: 9699539,
214
+ deeppink: 16716947,
215
+ deepskyblue: 49151,
216
+ dimgray: 6908265,
217
+ dimgrey: 6908265,
218
+ dodgerblue: 2003199,
219
+ firebrick: 11674146,
220
+ floralwhite: 16775920,
221
+ forestgreen: 2263842,
222
+ fuchsia: 16711935,
223
+ gainsboro: 14474460,
224
+ ghostwhite: 16316671,
225
+ gold: 16766720,
226
+ goldenrod: 14329120,
227
+ gray: 8421504,
228
+ green: 32768,
229
+ greenyellow: 11403055,
230
+ grey: 8421504,
231
+ honeydew: 15794160,
232
+ hotpink: 16738740,
233
+ indianred: 13458524,
234
+ indigo: 4915330,
235
+ ivory: 16777200,
236
+ khaki: 15787660,
237
+ lavender: 15132410,
238
+ lavenderblush: 16773365,
239
+ lawngreen: 8190976,
240
+ lemonchiffon: 16775885,
241
+ lightblue: 11393254,
242
+ lightcoral: 15761536,
243
+ lightcyan: 14745599,
244
+ lightgoldenrodyellow: 16448210,
245
+ lightgray: 13882323,
246
+ lightgreen: 9498256,
247
+ lightgrey: 13882323,
248
+ lightpink: 16758465,
249
+ lightsalmon: 16752762,
250
+ lightseagreen: 2142890,
251
+ lightskyblue: 8900346,
252
+ lightslategray: 7833753,
253
+ lightslategrey: 7833753,
254
+ lightsteelblue: 11584734,
255
+ lightyellow: 16777184,
256
+ lime: 65280,
257
+ limegreen: 3329330,
258
+ linen: 16445670,
259
+ magenta: 16711935,
260
+ maroon: 8388608,
261
+ mediumaquamarine: 6737322,
262
+ mediumblue: 205,
263
+ mediumorchid: 12211667,
264
+ mediumpurple: 9662683,
265
+ mediumseagreen: 3978097,
266
+ mediumslateblue: 8087790,
267
+ mediumspringgreen: 64154,
268
+ mediumturquoise: 4772300,
269
+ mediumvioletred: 13047173,
270
+ midnightblue: 1644912,
271
+ mintcream: 16121850,
272
+ mistyrose: 16770273,
273
+ moccasin: 16770229,
274
+ navajowhite: 16768685,
275
+ navy: 128,
276
+ oldlace: 16643558,
277
+ olive: 8421376,
278
+ olivedrab: 7048739,
279
+ orange: 16753920,
280
+ orangered: 16729344,
281
+ orchid: 14315734,
282
+ palegoldenrod: 15657130,
283
+ palegreen: 10025880,
284
+ paleturquoise: 11529966,
285
+ palevioletred: 14381203,
286
+ papayawhip: 16773077,
287
+ peachpuff: 16767673,
288
+ peru: 13468991,
289
+ pink: 16761035,
290
+ plum: 14524637,
291
+ powderblue: 11591910,
292
+ purple: 8388736,
293
+ rebeccapurple: 6697881,
294
+ red: 16711680,
295
+ rosybrown: 12357519,
296
+ royalblue: 4286945,
297
+ saddlebrown: 9127187,
298
+ salmon: 16416882,
299
+ sandybrown: 16032864,
300
+ seagreen: 3050327,
301
+ seashell: 16774638,
302
+ sienna: 10506797,
303
+ silver: 12632256,
304
+ skyblue: 8900331,
305
+ slateblue: 6970061,
306
+ slategray: 7372944,
307
+ slategrey: 7372944,
308
+ snow: 16775930,
309
+ springgreen: 65407,
310
+ steelblue: 4620980,
311
+ tan: 13808780,
312
+ teal: 32896,
313
+ thistle: 14204888,
314
+ tomato: 16737095,
315
+ turquoise: 4251856,
316
+ violet: 15631086,
317
+ wheat: 16113331,
318
+ white: 16777215,
319
+ whitesmoke: 16119285,
320
+ yellow: 16776960,
321
+ yellowgreen: 10145074
322
+ }, Ur = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/, so = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/, io = /^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;
323
+ function mr(o) {
324
+ if (o === "none") return { value: 0, percent: !1 };
325
+ const e = o.endsWith("%"), t = e ? o.slice(0, -1) : o;
326
+ if (!Ur.test(t)) return null;
327
+ const a = Number(t);
328
+ return Number.isFinite(a) ? { value: a, percent: e } : null;
329
+ }
330
+ function gr(o) {
331
+ const e = mr(o);
332
+ return e ? dr(e.percent ? e.value * 255 / 100 : e.value, 0, 255) : null;
333
+ }
334
+ function lo(o) {
335
+ const e = mr(o);
336
+ return e ? w(e.percent ? e.value / 100 : e.value) : null;
337
+ }
338
+ function Dr(o) {
339
+ const e = mr(o);
340
+ return e ? w(e.value / 100) : null;
341
+ }
342
+ function uo(o) {
343
+ if (o === "none") return 0;
344
+ const e = so.exec(o);
345
+ if (!e) return null;
346
+ let t = Number(e[1]);
347
+ if (!Number.isFinite(t)) return null;
348
+ switch (e[2]) {
349
+ case "turn":
350
+ t *= 360;
351
+ break;
352
+ case "rad":
353
+ t *= 180 / Math.PI;
354
+ break;
355
+ case "grad":
356
+ t *= 0.9;
357
+ break;
358
+ }
359
+ return t %= 360, t < 0 && (t += 360), t;
360
+ }
361
+ function bo(o) {
362
+ if (o.includes(",")) {
363
+ if (o.includes("/")) return null;
364
+ const n = o.split(",").map((c) => c.trim());
365
+ return n.length !== 3 && n.length !== 4 || n.some((c) => c === "" || /\s/.test(c)) ? null : { ch: [n[0], n[1], n[2]], alpha: n[3] };
366
+ }
367
+ const e = o.split("/");
368
+ if (e.length > 2) return null;
369
+ const t = e[0].trim().split(/\s+/);
370
+ if (t.length !== 3) return null;
371
+ let a;
372
+ return e.length === 2 && (a = e[1].trim(), a === "" || /\s/.test(a)) ? null : { ch: [t[0], t[1], t[2]], alpha: a };
373
+ }
374
+ function go(o, e, t) {
375
+ const a = (n) => {
376
+ const c = (n + o / 30) % 12, s = e * Math.min(t, 1 - t);
377
+ return t - s * Math.max(-1, Math.min(c - 3, 9 - c, 1));
378
+ };
379
+ return [a(0) * 255, a(8) * 255, a(4) * 255];
380
+ }
381
+ function _(o) {
382
+ if (typeof o != "string") return null;
383
+ const e = o.trim().toLowerCase();
384
+ if (!e) return null;
385
+ if (e === "transparent") return k(0, 0, 0, 0);
386
+ const t = co[e];
387
+ if (t !== void 0) return k(t >> 16, t >> 8 & 255, t & 255, 1);
388
+ if (e[0] === "#") {
389
+ const n = e.slice(1);
390
+ if (!/^[0-9a-f]+$/.test(n)) return null;
391
+ const c = (i) => parseInt(n[i], 16), s = (i) => parseInt(n.slice(i, i + 2), 16);
392
+ switch (n.length) {
393
+ case 3:
394
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, 1);
395
+ case 4:
396
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, c(3) * 17 / 255);
397
+ case 6:
398
+ return k(s(0), s(2), s(4), 1);
399
+ case 8:
400
+ return k(s(0), s(2), s(4), s(6) / 255);
401
+ default:
402
+ return null;
403
+ }
404
+ }
405
+ const a = io.exec(e);
406
+ if (a) {
407
+ const n = bo(a[2]);
408
+ if (!n) return null;
409
+ const c = n.alpha === void 0 ? 1 : lo(n.alpha);
410
+ if (c === null) return null;
411
+ if (a[1] === "rgb" || a[1] === "rgba") {
412
+ const v = gr(n.ch[0]), P = gr(n.ch[1]), p = gr(n.ch[2]);
413
+ return v === null || P === null || p === null ? null : k(v, P, p, c);
414
+ }
415
+ const s = uo(n.ch[0]), i = Dr(n.ch[1]), d = Dr(n.ch[2]);
416
+ if (s === null || i === null || d === null) return null;
417
+ const [b, C, g] = go(s, i, d);
418
+ return k(b, C, g, c);
419
+ }
420
+ if (e.includes(",")) {
421
+ const n = e.split(",").map((d) => d.trim());
422
+ if (n.length !== 3 || !n.every((d) => Ur.test(d))) return null;
423
+ const [c, s, i] = n.map((d) => dr(Number(d), 0, 255));
424
+ return k(c, s, i, 1);
425
+ }
426
+ return null;
427
+ }
428
+ function q(o) {
429
+ const e = w(o);
430
+ return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
431
+ }
432
+ function fr(o) {
433
+ const e = w(o);
434
+ return e <= 31308e-7 ? e * 12.92 : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
435
+ }
436
+ function fo(o, e, t) {
437
+ const a = 0.4122214708 * o + 0.5363325363 * e + 0.0514459929 * t, n = 0.2119034982 * o + 0.6806995451 * e + 0.1073969566 * t, c = 0.0883024619 * o + 0.2817188376 * e + 0.6299787005 * t, s = Math.cbrt(a), i = Math.cbrt(n), d = Math.cbrt(c);
438
+ return {
439
+ L: 0.2104542553 * s + 0.793617785 * i - 0.0040720468 * d,
440
+ a: 1.9779984951 * s - 2.428592205 * i + 0.4505937099 * d,
441
+ b: 0.0259040371 * s + 0.7827717662 * i - 0.808675766 * d
442
+ };
443
+ }
444
+ function pr(o, e, t) {
445
+ const a = o + 0.3963377774 * e + 0.2158037573 * t, n = o - 0.1055613458 * e - 0.0638541728 * t, c = o - 0.0894841775 * e - 1.291485548 * t, s = a * a * a, i = n * n * n, d = c * c * c;
446
+ return [
447
+ 4.0767416621 * s - 3.3077115913 * i + 0.2309699292 * d,
448
+ -1.2684380046 * s + 2.6097574011 * i - 0.3413193965 * d,
449
+ -0.0041960863 * s - 0.7034186147 * i + 1.707614701 * d
450
+ ];
451
+ }
452
+ function lr(o) {
453
+ return fo(q(o.r / 255), q(o.g / 255), q(o.b / 255));
454
+ }
455
+ const po = 1e-6;
456
+ function Or(o) {
457
+ const e = Math.hypot(o.a, o.b);
458
+ let t = e < po ? 0 : Math.atan2(o.b, o.a) * 180 / Math.PI;
459
+ return t < 0 && (t += 360), t >= 360 && (t -= 360), { l: o.L, c: e, h: t };
460
+ }
461
+ function hr(o, e, t) {
462
+ const a = t * Math.PI / 180;
463
+ return { L: o, a: e * Math.cos(a), b: e * Math.sin(a) };
464
+ }
465
+ const W = 1e-6, Pr = (o) => o[0] >= -W && o[0] <= 1 + W && o[1] >= -W && o[1] <= 1 + W && o[2] >= -W && o[2] <= 1 + W;
466
+ function rr(o, e, t, a) {
467
+ const n = w(m(o));
468
+ let c = Math.max(0, m(e));
469
+ const s = m(t);
470
+ let i = hr(n, c, s), d = pr(i.L, i.a, i.b);
471
+ if (!Pr(d)) {
472
+ let b = 0, C = c;
473
+ for (let g = 0; g < 24; g++) {
474
+ const v = (b + C) / 2, P = hr(n, v, s);
475
+ Pr(pr(P.L, P.a, P.b)) ? b = v : C = v;
476
+ }
477
+ c = b, i = hr(n, c, s), d = pr(i.L, i.a, i.b);
478
+ }
479
+ return k(fr(d[0]) * 255, fr(d[1]) * 255, fr(d[2]) * 255, w(m(a, 1)));
480
+ }
481
+ function J(o) {
482
+ const e = Or(lr(o));
483
+ return { l: e.l, c: e.c, h: e.h, a: w(m(o.a, 1)) };
484
+ }
485
+ function ur(o) {
486
+ return rr(o.l, o.c, o.h, o.a);
487
+ }
488
+ function ho(o) {
489
+ const e = w(m(o.a, 1)), t = `#${cr(o.r)}${cr(o.g)}${cr(o.b)}`;
490
+ return e < 1 ? `${t}${cr(e * 255)}` : t;
491
+ }
492
+ function vr(o) {
493
+ const e = w(m(o.a, 1)), t = O(o.r), a = O(o.g), n = O(o.b);
494
+ return e >= 1 ? `rgb(${t}, ${a}, ${n})` : `rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`;
495
+ }
496
+ function Br(o) {
497
+ return `${O(o.r)}, ${O(o.g)}, ${O(o.b)}`;
498
+ }
499
+ function Q(o) {
500
+ return 0.2126 * q(m(o.r) / 255) + 0.7152 * q(m(o.g) / 255) + 0.0722 * q(m(o.b) / 255);
501
+ }
502
+ function y(o, e) {
503
+ const t = e.a >= 1 ? e : k(e.r, e.g, e.b, 1), a = o.a < 1 ? br(o, t) : o, n = Q(a), c = Q(t), s = Math.max(n, c), i = Math.min(n, c);
504
+ return (s + 0.05) / (i + 0.05);
505
+ }
506
+ function br(o, e) {
507
+ const t = w(m(o.a, 1)), a = w(m(e.a, 1)), n = t + a * (1 - t);
508
+ if (n <= 0) return k(0, 0, 0, 0);
509
+ const c = a * (1 - t) / n, s = t / n;
510
+ return k(o.r * s + e.r * c, o.g * s + e.g * c, o.b * s + e.b * c, n);
511
+ }
512
+ function X(o, e, t) {
513
+ const a = w(m(t));
514
+ if (a <= 0) return k(o.r, o.g, o.b, w(m(o.a, 1)));
515
+ if (a >= 1) return k(e.r, e.g, e.b, w(m(e.a, 1)));
516
+ const n = w(m(o.a, 1)), c = w(m(e.a, 1)), s = lr(o), i = lr(e), d = n + (c - n) * a, b = d > 0 ? n * (1 - a) / d : 1 - a, C = d > 0 ? c * a / d : a, g = { L: s.L * b + i.L * C, a: s.a * b + i.a * C, b: s.b * b + i.b * C }, v = Or(g);
517
+ return rr(v.l, v.c, v.h, d);
518
+ }
519
+ function D(o, e) {
520
+ return k(o.r, o.g, o.b, w(m(e, 1)));
521
+ }
522
+ function mo(o) {
523
+ return lr(o).L;
524
+ }
525
+ function E(o, e) {
526
+ const t = J(o);
527
+ return rr(w(t.l + m(e)), t.c, t.h, t.a);
528
+ }
529
+ function vo(o, e) {
530
+ const t = J(o);
531
+ return rr(w(m(e)), t.c, t.h, t.a);
532
+ }
533
+ const yo = [1, 0.75, 0.5, 0.25, 0], xo = 24;
534
+ function G(o, e, t, a = "auto") {
535
+ const n = m(t, 1);
536
+ if (y(o, e) >= n) return o;
537
+ const c = J(o), s = k(e.r, e.g, e.b, 1), i = Q(s), d = (f, T) => rr(f, T, c.h, c.a), b = (f) => y(f, s), C = (f) => Q(f.a < 1 ? br(f, s) : f), g = (f) => k(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), v = (f) => {
538
+ const T = f === "lighter" ? 1 : 0, j = (L) => f === "lighter" ? C(L) >= i : C(L) <= i, H = (L) => j(L) && b(L) >= n, Y = (L) => H(L) && H(g(L));
539
+ let R = null;
540
+ for (const L of yo) {
541
+ const U = c.c * L, K = d(T, U), or = b(K);
542
+ if ((!R || or > R.ratio) && (R = { color: K, ratio: or }), !Y(K)) continue;
543
+ let er = c.l, V = T;
544
+ for (let nr = 0; nr < xo; nr++) {
545
+ const B = (er + V) / 2;
546
+ Y(d(B, U)) ? V = B : er = B;
547
+ }
548
+ const tr = d(V, U);
549
+ return { color: tr, ratio: b(tr) };
550
+ }
551
+ return R;
552
+ };
553
+ if (a === "lighter" || a === "darker") return v(a).color;
554
+ const P = b(d(1, 0)), p = b(d(0, 0));
555
+ return v(P >= p ? "lighter" : "darker").color;
556
+ }
557
+ function Fr(o) {
558
+ return y(I, o) >= y(Z, o);
559
+ }
560
+ function Wr(o, e = _r) {
561
+ const t = e.length ? e : _r;
562
+ let a = t[0], n = -1;
563
+ for (const c of t) {
564
+ const s = y(c, o);
565
+ s > n && (n = s, a = c);
566
+ }
567
+ return k(a.r, a.g, a.b, a.a);
568
+ }
569
+ const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
570
+ __proto__: null,
571
+ BLACK: Z,
572
+ WHITE: I,
573
+ adjustL: E,
574
+ bestOn: Wr,
575
+ composite: br,
576
+ contrastRatio: y,
577
+ ensureContrast: G,
578
+ formatHex: ho,
579
+ formatRgb: vr,
580
+ formatTriplet: Br,
581
+ fromOklch: ur,
582
+ isDarkSurface: Fr,
583
+ lightness: mo,
584
+ mix: X,
585
+ parseColor: _,
586
+ relativeLuminance: Q,
587
+ setL: vo,
588
+ toOklch: J,
589
+ withAlpha: D
590
+ }, Symbol.toStringTag, { value: "Module" })), ko = {
591
+ none: ["0px", "0px", "0px", "0px"],
592
+ sm: ["3px", "4px", "6px", "9999px"],
593
+ md: ["4px", "6px", "10px", "9999px"],
594
+ lg: ["6px", "10px", "16px", "9999px"],
595
+ full: ["10px", "16px", "24px", "9999px"]
596
+ }, wo = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMik7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iMCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjIpOyIgLz4KICA8cmVjdCB4PSIwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgo8L3N2Zz4=')", Io = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMSk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMCwgMCwgMCwgMC4xKTsiIC8+Cjwvc3ZnPg==')";
597
+ function Mo(o, e) {
598
+ const t = o === "dark", a = e ? 0.06 : 0;
599
+ return {
600
+ text: e ? 1 : t ? 0.92 : 0.88,
601
+ textMuted: e ? 0.85 : t ? 0.66 : 0.62,
602
+ textFaint: e ? 0.68 : t ? 0.46 : 0.42,
603
+ border: (t ? 0.12 : 0.1) + (e ? 0.18 : 0),
604
+ borderStrong: (t ? 0.28 : 0.22) + (e ? 0.25 : 0),
605
+ divider: (t ? 0.1 : 0.08) + (e ? 0.15 : 0),
606
+ fill: (t ? 0.09 : 0.06) + a,
607
+ fillHover: (t ? 0.14 : 0.1) + a,
608
+ fillActive: (t ? 0.2 : 0.15) + a,
609
+ field: (t ? 0.07 : 0.04) + a,
610
+ fieldHover: (t ? 0.1 : 0.06) + a,
611
+ fieldFocus: (t ? 0.1 : 0.05) + a,
612
+ hover: (t ? 0.07 : 0.05) + a,
613
+ pressed: (t ? 0.12 : 0.09) + a,
614
+ soft: (t ? 0.18 : 0.12) + (e ? 0.08 : 0),
615
+ softHover: (t ? 0.26 : 0.2) + (e ? 0.08 : 0),
616
+ elevationMin: e ? 1.3 : t ? 1.18 : 1.06
617
+ };
618
+ }
619
+ const h = (o) => vr(o), M = (o) => Br(o), $ = (o, e) => vr(D(o, e)), jr = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
620
+ function z(o, e, t, a, n = (c) => c) {
621
+ let c = t, s = jr(n(X(o, e, c))), i = 0;
622
+ for (; y(s, o) < a && c < 1 && i++ < 40; )
623
+ c = Math.min(1, c + 0.02), s = jr(n(X(o, e, c)));
624
+ return D(s, 1);
625
+ }
626
+ function Rr(o, e, t) {
627
+ if (t <= 0) return o;
628
+ const a = J(o), n = J(e);
629
+ return ur({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
630
+ }
631
+ function Eo(o) {
632
+ var Sr, $r, Tr, Ar, Nr, Cr, Er;
633
+ const e = { version: 2, ...o ?? {} }, t = no[e.preset ?? "dark"], a = [];
634
+ let n = _(e.surface) ?? null;
635
+ n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = D(n, 1);
636
+ let c = _(e.primary) ?? null;
637
+ c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = D(c, 1);
638
+ const s = Fr(n) ? "dark" : "light", i = s === "dark", d = e.contrast === "high", b = Mo(s, d), C = Math.max(0, Math.min(1, e.tint ?? 0)), g = d ? 7 : 4.5, v = d ? 4.5 : 3, p = Rr(i ? I : { r: 17, g: 17, b: 17, a: 1 }, c, C);
639
+ let f, T, j;
640
+ const H = (l) => Rr(l, c, C);
641
+ if (i) {
642
+ const l = y(I, n) >= 6 ? I : Z;
643
+ f = z(n, l, 0.07, b.elevationMin, H), T = z(f, l, 0.05, 1.12, H), j = z(T, l, 0.05, 1.12, H);
644
+ } else {
645
+ const l = y(I, n);
646
+ if (l >= b.elevationMin * 1.01) {
647
+ const u = l >= 1.149995 ? 1.1 : b.elevationMin;
648
+ f = z(n, I, 0.5, u, H), T = y(I, f) >= 1.03 ? z(f, I, 0.6, 1.03, H) : D(I, 1), j = H(X(T, Z, 0.035));
649
+ }
650
+ (!f || y(f, n) < b.elevationMin) && (f = z(n, Z, 0.03, b.elevationMin, H), T = D(I, 1), j = H(X(T, Z, 0.05)));
651
+ }
652
+ if (!f || !T || !j) throw new Error("theme: elevation ladder not resolved");
653
+ const Y = ur(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), R = Wr(Y), L = (l) => [n, f, T, j].reduce((u, N) => y(l, N) < y(l, u) ? N : u, n), U = (l, u, N) => {
654
+ let S = l, F = 0;
655
+ for (; y(D(p, S), L(D(p, S))) < u && S < 1 && F++ < 25; ) S = Math.min(1, S + 0.04);
656
+ return S !== l && a.push({ token: N, reason: `raised opacity ${l}→${S.toFixed(2)} to reach ${u}:1 on surfaces` }), S;
657
+ }, K = U(b.text, g, "text"), or = U(b.textMuted, g, "text-muted"), er = U(b.textFaint, v, "text-faint"), V = (() => {
658
+ const l = y(I, c), u = y({ r: 17, g: 17, b: 17, a: 1 }, c);
659
+ if (l >= g) return I;
660
+ const N = u > l ? { r: 17, g: 17, b: 17, a: 1 } : I;
661
+ return Math.max(l, u) < g && a.push({ token: "on-primary", reason: `neither white nor black reaches ${g}:1 on primary (best ${Math.max(l, u).toFixed(2)}:1)` }), N;
662
+ })(), tr = E(c, i ? 0.06 : -0.06), nr = E(c, i ? 0.1 : -0.1), B = G(c, n, g, "auto");
663
+ y(B, n) > y(c, n) + 0.01 && a.push({ token: "primary-text", reason: `primary lightened/darkened to reach ${g}:1 as text on surface` });
664
+ const Gr = G(c, n, v, "auto"), Zr = G(c, n, v, "auto"), ar = (l) => {
665
+ const u = _(ao[l]), N = y(I, u), S = y({ r: 17, g: 17, b: 17, a: 1 }, u), F = N >= g ? I : S > N ? { r: 17, g: 17, b: 17, a: 1 } : I;
666
+ return {
667
+ base: u,
668
+ on: F,
669
+ text: G(u, n, g, "auto"),
670
+ soft: D(u, b.soft),
671
+ border: G(u, n, v, "auto"),
672
+ dark: E(u, -0.1),
673
+ light: E(u, 0.12),
674
+ darker: E(u, -0.18),
675
+ bright: E(u, 0.22)
676
+ };
677
+ }, qr = ar("success"), Jr = ar("warning"), Yr = ar("error"), Kr = ar("info"), [Vr, Qr, Xr, ro] = ko[e.radius ?? "md"], yr = "'Inter', sans-serif", xr = (l) => {
678
+ var u;
679
+ return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${yr}` : yr;
680
+ }, kr = xr((Sr = e.fonts) == null ? void 0 : Sr.ui), oo = ($r = e.fonts) != null && $r.heading ? xr(e.fonts.heading) : kr, eo = Array.from(new Set([(Ar = (Tr = e.fonts) == null ? void 0 : Tr.ui) == null ? void 0 : Ar.src, (Cr = (Nr = e.fonts) == null ? void 0 : Nr.heading) == null ? void 0 : Cr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), wr = (Er = e.font) != null && Er.size && e.font.size > 0 ? e.font.size : 14, A = {
681
+ "color-scheme": s,
682
+ surface: h(n),
683
+ "surface-rgb": M(n),
684
+ "surface-1": h(f),
685
+ "surface-1-rgb": M(f),
686
+ "surface-2": h(T),
687
+ "surface-2-rgb": M(T),
688
+ "surface-3": h(j),
689
+ "surface-inverse": h(Y),
690
+ scrim: "rgba(0, 0, 0, 0.5)",
691
+ ink: h(p),
692
+ "ink-rgb": M(p),
693
+ text: $(p, K),
694
+ "text-muted": $(p, or),
695
+ "text-faint": $(p, er),
696
+ "text-inverse": h(R),
697
+ "text-on-surface-rgb": M(p),
698
+ "text-on-inverse-rgb": M(R),
699
+ border: $(p, b.border),
700
+ "border-strong": $(p, b.borderStrong),
701
+ divider: $(p, b.divider),
702
+ "border-rgb": M(p),
703
+ fill: $(p, b.fill),
704
+ "fill-hover": $(p, b.fillHover),
705
+ "fill-active": $(p, b.fillActive),
706
+ field: $(p, b.field),
707
+ "field-hover": $(p, b.fieldHover),
708
+ "field-focus": $(p, b.fieldFocus),
709
+ hover: $(p, b.hover),
710
+ pressed: $(p, b.pressed),
711
+ primary: h(c),
712
+ "primary-rgb": M(c),
713
+ "primary-hover": h(tr),
714
+ "primary-active": h(nr),
715
+ "on-primary": h(V),
716
+ "primary-text": h(B),
717
+ "primary-border": h(Gr),
718
+ "primary-soft": $(c, b.soft),
719
+ "primary-soft-hover": $(c, b.softHover),
720
+ "focus-ring": h(Zr),
721
+ "focus-ring-width": d ? "3px" : "2px",
722
+ "focus-ring-offset": "2px",
723
+ "primary-dark": h(E(c, -0.1)),
724
+ "primary-dark-rgb": M(E(c, -0.1)),
725
+ "primary-light": h(E(c, 0.1)),
726
+ "primary-light-rgb": M(E(c, 0.1)),
727
+ "primary-bright": h(E(c, 0.2)),
728
+ "primary-bright-rgb": M(E(c, 0.2)),
729
+ "shadow-1": i ? "0 1px 2px rgba(0, 0, 0, 0.4)" : "0 1px 2px rgba(0, 0, 0, 0.08)",
730
+ "shadow-2": i ? "0 6px 20px rgba(0, 0, 0, 0.45)" : "0 6px 20px rgba(0, 0, 0, 0.12)",
731
+ "shadow-3": i ? "0 12px 40px rgba(0, 0, 0, 0.5)" : "0 12px 40px rgba(0, 0, 0, 0.16)",
732
+ "radius-sm": Vr,
733
+ "radius-md": Qr,
734
+ "radius-lg": Xr,
735
+ "radius-full": ro,
736
+ "font-family": kr,
737
+ "font-family-heading": oo,
738
+ "font-size": `${wr}px`,
739
+ "root-font-size": String(wr),
740
+ canvas: i ? "rgba(0, 0, 0, 0.25)" : "rgba(0, 0, 0, 0.04)",
741
+ "canvas-image": i ? wo : Io,
742
+ // Controls float over arbitrary artwork → mode-independent dark glass + white glyphs.
743
+ "canvas-control": "rgba(0, 0, 0, 0.45)",
744
+ "canvas-control-hover": "rgba(0, 0, 0, 0.6)",
745
+ "on-canvas-control": "#ffffff",
746
+ "disabled-opacity": "0.55"
747
+ };
748
+ for (const [l, u] of [
749
+ ["success", qr],
750
+ ["warning", Jr],
751
+ ["error", Yr],
752
+ ["info", Kr]
753
+ ])
754
+ A[l] = h(u.base), A[`${l}-rgb`] = M(u.base), A[`on-${l}`] = h(u.on), A[`${l}-text`] = h(u.text), A[`${l}-soft`] = h(u.soft), A[`${l}-border`] = h(u.border), A[`${l}-dark-rgb`] = M(u.dark), A[`${l}-light-rgb`] = M(u.light), l === "info" ? A["info-bright-rgb"] = M(u.bright) : A[`${l}-darker-rgb`] = M(u.darker);
755
+ if (e.overrides)
756
+ for (const [l, u] of Object.entries(e.overrides)) {
757
+ if (!u || !sr.includes(l)) continue;
758
+ A[l] = u;
759
+ const N = `${l}-rgb`;
760
+ if (sr.includes(N)) {
761
+ const S = _(u);
762
+ S && (A[N] = M(S));
763
+ }
764
+ }
765
+ for (const l of sr) A[l] === void 0 && (A[l] = "");
766
+ const Ir = A, Mr = (l) => _(Ir[l]), x = (l, u, N, S) => {
767
+ const F = Mr(u), Lr = Mr(N), Hr = F && Lr ? y(F, br(Lr, n)) : 0;
768
+ return { label: l, fg: u, bg: N, ratio: Math.round(Hr * 100) / 100, min: S, pass: Hr >= S };
769
+ }, to = [
770
+ x("Text on surface", "text", "surface", g),
771
+ x("Muted text on surface", "text-muted", "surface", g),
772
+ x("Faint text on surface", "text-faint", "surface", v),
773
+ x("Text on cards (surface-1)", "text", "surface-1", g),
774
+ x("Text on popovers (surface-2)", "text", "surface-2", g),
775
+ x("Cards distinguishable from surface", "surface-1", "surface", b.elevationMin),
776
+ x("Popovers distinguishable from cards", "surface-2", "surface-1", i ? 1.12 : 1),
777
+ x("Strong border on surface", "border-strong", "surface", d ? 3 : 1.5),
778
+ x("Text on primary", "on-primary", "primary", g),
779
+ x("Primary as text on surface", "primary-text", "surface", g),
780
+ x("Primary border on surface", "primary-border", "surface", v),
781
+ x("Focus ring on surface", "focus-ring", "surface", v),
782
+ x("Success text on surface", "success-text", "surface", g),
783
+ x("Warning text on surface", "warning-text", "surface", g),
784
+ x("Error text on surface", "error-text", "surface", g),
785
+ x("Info text on surface", "info-text", "surface", g),
786
+ x("Text on success", "on-success", "success", g),
787
+ x("Text on warning", "on-warning", "warning", g),
788
+ x("Text on error", "on-error", "error", g),
789
+ x("Text on tooltip", "text-inverse", "surface-inverse", g)
790
+ ];
791
+ return { input: e, mode: s, tokens: Ir, report: { mode: s, checks: to, adjustments: a }, fontUrls: eo };
792
+ }
793
+ const r = (o) => `var(${ir}${o})`, zr = {
794
+ /* ------------------------------------------------------------------ */
795
+ /* Typography & focus ring */
796
+ /* ------------------------------------------------------------------ */
797
+ "root-font-size": r("root-font-size"),
798
+ "font-family": r("font-family"),
799
+ "bx-focus-ring-color": r("focus-ring"),
800
+ // NOTE: the two below are identical to the semantic tokens (`--bx-focus-ring-width/-offset`).
801
+ // Kept for coverage; emitters must skip them (see LEGACY_BRIDGE_IDENTITY_KEYS).
802
+ "bx-focus-ring-width": r("focus-ring-width"),
803
+ "bx-focus-ring-offset": r("focus-ring-offset"),
804
+ /* ------------------------------------------------------------------ */
805
+ /* App shell / views */
806
+ /* ------------------------------------------------------------------ */
807
+ "app-background-color": r("surface"),
808
+ "app-background-color-rgb": r("surface-rgb"),
809
+ "app-divider-color": r("divider"),
810
+ "secondary-color-rgb": r("surface-2-rgb"),
811
+ "editor-view-background-color": r("surface"),
812
+ "fields-view-background-color": "transparent",
813
+ "live-view-background-color": "transparent",
814
+ "popup-background-color": r("surface-1"),
815
+ "bluepic-embed-editor-border": `1px solid ${r("border")}`,
816
+ "bluepic-embed-editor-border-radius": r("radius-lg"),
817
+ /* ------------------------------------------------------------------ */
818
+ /* Colour triplets (legacy `rgba(var(--x), a)` habit) */
819
+ /* ------------------------------------------------------------------ */
820
+ "primary-color-base": r("primary-rgb"),
821
+ "primary-color-dark": r("primary-dark-rgb"),
822
+ "primary-color-light": r("primary-light-rgb"),
823
+ "primary-color-bright": r("primary-bright-rgb"),
824
+ "info-color-base": r("info-rgb"),
825
+ "info-color-dark": r("info-dark-rgb"),
826
+ "info-color-light": r("info-light-rgb"),
827
+ "info-color-bright": r("info-bright-rgb"),
828
+ "success-color-base": r("success-rgb"),
829
+ "success-color-light": r("success-light-rgb"),
830
+ "success-color-dark": r("success-dark-rgb"),
831
+ "success-color-darker": r("success-darker-rgb"),
832
+ "error-color-base": r("error-rgb"),
833
+ "error-color-light": r("error-light-rgb"),
834
+ "error-color-dark": r("error-dark-rgb"),
835
+ "error-color-darker": r("error-darker-rgb"),
836
+ "warning-color-base": r("warning-rgb"),
837
+ "warning-color-light": r("warning-light-rgb"),
838
+ "warning-color-dark": r("warning-dark-rgb"),
839
+ "warning-color-darker": r("warning-darker-rgb"),
840
+ "text-color-base": r("text-on-surface-rgb"),
841
+ "text-color-alt": r("text-on-inverse-rgb"),
842
+ "border-color-base": r("border-rgb"),
843
+ "background-color-base": r("surface-rgb"),
844
+ // Historical typos that components still reference — alias them to the intended triplets.
845
+ "priinfomary-color-base": r("info-rgb"),
846
+ "primainfory-color-bright": r("primary-bright-rgb"),
847
+ /* ------------------------------------------------------------------ */
848
+ /* Undefined-today aliases (referenced by components, never preset) */
849
+ /* ------------------------------------------------------------------ */
850
+ "primary-color": r("primary"),
851
+ "info-color": r("info"),
852
+ "bx-primary-color": r("primary"),
853
+ "bx-text-color": r("text"),
854
+ "bx-modal-color": r("surface-1"),
855
+ "bx-card-color": r("surface-1"),
856
+ "upload-background-color": r("field"),
857
+ "upload-text-color-title": r("text"),
858
+ "upload-text-color-description": r("text-muted"),
859
+ /* ------------------------------------------------------------------ */
860
+ /* Input */
861
+ /* ------------------------------------------------------------------ */
862
+ "input-background-color": r("field"),
863
+ "input-background-color-hover": r("field-hover"),
864
+ "input-background-color-focus": r("field-focus"),
865
+ "input-border-color": "transparent",
866
+ "input-border-color-hover": "transparent",
867
+ "input-border-color-focus": r("primary-border"),
868
+ "input-shadow-focus-color": r("focus-ring"),
869
+ "input-bordered-border-color": r("border-strong"),
870
+ "input-bordered-border-color-hover": r("border-strong"),
871
+ "input-bordered-border-color-focus": r("primary-border"),
872
+ "input-outline-color-focus": r("focus-ring"),
873
+ "input-border-color-disabled": r("border"),
874
+ "input-opacity-disabled": r("disabled-opacity"),
875
+ "input-ghost-border-color-hover": r("border"),
876
+ "input-ghost-border-color-focus": r("primary-border"),
877
+ "input-number-ctrl-separator-color": r("divider"),
878
+ "input-number-ctrl-color": r("text-muted"),
879
+ "input-number-ctrl-color-hover": r("text"),
880
+ "input-number-ctrl-background-color-hover": r("hover"),
881
+ /* Input states ('active' = primary tokens, others = status tokens) */
882
+ "input-state-active-background-color": r("primary-soft"),
883
+ "input-state-active-background-color-hover": r("primary-soft"),
884
+ "input-state-active-background-color-focus": r("primary-soft"),
885
+ "input-state-active-border-color": r("primary-border"),
886
+ "input-state-active-border-color-hover": r("primary-border"),
887
+ "input-state-active-border-color-focus": r("primary-border"),
888
+ "input-state-success-background-color": r("success-soft"),
889
+ "input-state-success-background-color-hover": r("success-soft"),
890
+ "input-state-success-background-color-focus": r("success-soft"),
891
+ "input-state-success-border-color": r("success-border"),
892
+ "input-state-success-border-color-hover": r("success-border"),
893
+ "input-state-success-border-color-focus": r("success-border"),
894
+ "input-state-error-background-color": r("error-soft"),
895
+ "input-state-error-background-color-hover": r("error-soft"),
896
+ "input-state-error-background-color-focus": r("error-soft"),
897
+ "input-state-error-border-color": r("error-border"),
898
+ "input-state-error-border-color-hover": r("error-border"),
899
+ "input-state-error-border-color-focus": r("error-border"),
900
+ "input-state-warning-background-color": r("warning-soft"),
901
+ "input-state-warning-background-color-hover": r("warning-soft"),
902
+ "input-state-warning-background-color-focus": r("warning-soft"),
903
+ "input-state-warning-border-color": r("warning-border"),
904
+ "input-state-warning-border-color-hover": r("warning-border"),
905
+ "input-state-warning-border-color-focus": r("warning-border"),
906
+ /* ------------------------------------------------------------------ */
907
+ /* Card */
908
+ /* ------------------------------------------------------------------ */
909
+ "card-background-color": r("surface-1"),
910
+ "card-background-color-hover": r("surface-2"),
911
+ "card-border-color": r("border"),
912
+ "card-header-divider-color": r("divider"),
913
+ "card-footer-divider-color": r("divider"),
914
+ "card-footer-background-color": r("hover"),
915
+ /* ------------------------------------------------------------------ */
916
+ /* Select */
917
+ /* ------------------------------------------------------------------ */
918
+ "select-background-color": r("field"),
919
+ "select-background-color-hover": r("field-hover"),
920
+ "select-background-color-focus": r("field-focus"),
921
+ "select-border": "1px solid transparent",
922
+ "select-border-hover": "1px solid transparent",
923
+ "select-border-focus": `1px solid ${r("primary-border")}`,
924
+ "select-color": r("text"),
925
+ "select-color-hover": r("text"),
926
+ "select-color-focus": r("text"),
927
+ "select-button-background-color": r("fill"),
928
+ "select-button-background-color-hover": r("fill-hover"),
929
+ "select-item-border": `2px solid ${r("primary-border")}`,
930
+ /* ------------------------------------------------------------------ */
931
+ /* Checkbox */
932
+ /* ------------------------------------------------------------------ */
933
+ "checkbox-background-color": r("field"),
934
+ "checkbox-border-color": r("border-strong"),
935
+ "checkbox-border-color-hover": r("primary-border"),
936
+ "checkbox-outline-color-focus": r("focus-ring"),
937
+ "checkbox-border-color-focus": r("primary-border"),
938
+ "checkbox-background-color-checked": r("primary"),
939
+ "checkbox-border-color-checked": "transparent",
940
+ "checkbox-background-color-checked-hover": r("primary-hover"),
941
+ "checkbox-border-color-checked-hover": "transparent",
942
+ "checkbox-symbol-color": r("text-faint"),
943
+ "checkbox-symbol-color-checked": r("on-primary"),
944
+ /* Checkbox, secondary (tonal) look */
945
+ "checkbox-secondary-background-color": r("fill"),
946
+ "checkbox-secondary-background-color-hover": r("fill-hover"),
947
+ "checkbox-secondary-background-color-checked": r("fill-active"),
948
+ "checkbox-secondary-border": `1px solid ${r("border")}`,
949
+ "checkbox-secondary-border-hover": `1px solid ${r("border-strong")}`,
950
+ "checkbox-secondary-border-checked": `1px solid ${r("border-strong")}`,
951
+ "checkbox-secondary-symbol-color": r("text-muted"),
952
+ "checkbox-secondary-symbol-color-checked": r("primary-text"),
953
+ /* ------------------------------------------------------------------ */
954
+ /* Popover / tooltip */
955
+ /* ------------------------------------------------------------------ */
956
+ "popover-background-color": r("surface-2"),
957
+ "popover-border-color": r("border"),
958
+ "popover-border": `1px solid ${r("border")}`,
959
+ "popover-arrow-border-color": r("border"),
960
+ "popover-without-darkened-bg-background-color": r("surface-2-rgb"),
961
+ "popover-without-darkened-bg-box-shadow": r("shadow-2"),
962
+ "tooltip-background-color": r("surface-inverse"),
963
+ "tooltip-text-color": r("text-inverse"),
964
+ "tooltip-border-color": "transparent",
965
+ /* ------------------------------------------------------------------ */
966
+ /* Menu / label / list / empty */
967
+ /* ------------------------------------------------------------------ */
968
+ "menu-item-color": r("text"),
969
+ "menu-item-color-active": r("primary-text"),
970
+ "menu-item-background-color": "transparent",
971
+ "menu-item-background-color-active": r("primary-soft"),
972
+ "menu-item-background-color-hover": r("hover"),
973
+ "menu-item-background-color-active-hover": r("primary-soft-hover"),
974
+ "menu-divider": `1px solid ${r("divider")}`,
975
+ "labeled-text-color": r("text-muted"),
976
+ "label-background-color": r("fill"),
977
+ "list-divider": `1px solid ${r("divider")}`,
978
+ "list-item-background-color-hover": r("hover"),
979
+ "empty-text-color": r("text-faint"),
980
+ /* ------------------------------------------------------------------ */
981
+ /* Tag */
982
+ /* ------------------------------------------------------------------ */
983
+ "tag-background-color": r("fill"),
984
+ "tag-color": r("text"),
985
+ "tag-border-color": r("border"),
986
+ "tag-error-background-color": r("error-soft"),
987
+ "tag-error-color": r("error-text"),
988
+ "tag-error-border-color": r("error-border"),
989
+ "tag-success-background-color": r("success-soft"),
990
+ "tag-success-color": r("success-text"),
991
+ "tag-success-border-color": r("success-border"),
992
+ "tag-warning-background-color": r("warning-soft"),
993
+ "tag-warning-color": r("warning-text"),
994
+ "tag-warning-border-color": r("warning-border"),
995
+ "tag-info-background-color": r("info-soft"),
996
+ "tag-info-color": r("info-text"),
997
+ "tag-info-border-color": r("info-border"),
998
+ /* ------------------------------------------------------------------ */
999
+ /* Alert */
1000
+ /* ------------------------------------------------------------------ */
1001
+ "alert-background-color": r("fill"),
1002
+ "alert-color": r("text"),
1003
+ "alert-border-color": r("border"),
1004
+ "alert-icon-color": r("text-muted"),
1005
+ "alert-info-background-color": r("info-soft"),
1006
+ "alert-info-color": r("info-text"),
1007
+ "alert-info-icon-color": r("info-text"),
1008
+ "alert-info-border-color": r("info-border"),
1009
+ "alert-success-background-color": r("success-soft"),
1010
+ "alert-success-color": r("success-text"),
1011
+ "alert-success-icon-color": r("success-text"),
1012
+ "alert-success-border-color": r("success-border"),
1013
+ "alert-warning-background-color": r("warning-soft"),
1014
+ "alert-warning-color": r("warning-text"),
1015
+ "alert-warning-icon-color": r("warning-text"),
1016
+ "alert-warning-border-color": r("warning-border"),
1017
+ "alert-error-background-color": r("error-soft"),
1018
+ "alert-error-color": r("error-text"),
1019
+ "alert-error-icon-color": r("error-text"),
1020
+ "alert-error-border-color": r("error-border"),
1021
+ /* ------------------------------------------------------------------ */
1022
+ /* Slider / progress */
1023
+ /* ------------------------------------------------------------------ */
1024
+ "slider-body-background-color": r("fill-active"),
1025
+ "slider-body-background-color-hover": r("fill-active"),
1026
+ "slider-body-background-color-focus": r("fill-active"),
1027
+ "slider-thumb-background-color": r("primary"),
1028
+ "slider-thumb-background-color-hover": r("primary-hover"),
1029
+ "slider-thumb-background-color-focus": r("primary-hover"),
1030
+ "slider-thumb-box-shadow": r("shadow-1"),
1031
+ "slider-value-background-color": r("primary"),
1032
+ "slider-value-background-color-hover": r("primary"),
1033
+ "slider-value-background-color-focus": r("primary"),
1034
+ "progress-background-color": r("fill"),
1035
+ "progress-value-color": r("primary"),
1036
+ /* ------------------------------------------------------------------ */
1037
+ /* Tabs */
1038
+ /* ------------------------------------------------------------------ */
1039
+ "tab-color": r("text-muted"),
1040
+ "tab-color-active": r("primary-text"),
1041
+ "tab-segment-background-color": r("fill"),
1042
+ "tab-segment-background-color-active": r("surface-2"),
1043
+ "tab-segment-color": r("text-muted"),
1044
+ "tab-segment-color-active": r("text"),
1045
+ "tab-inline-item-background-color-hover": r("hover"),
1046
+ "tab-item-active-box-shadow": r("shadow-1"),
1047
+ /* ------------------------------------------------------------------ */
1048
+ /* Switch */
1049
+ /* ------------------------------------------------------------------ */
1050
+ "switch-background-color": r("fill-active"),
1051
+ "switch-border": "none",
1052
+ "switch-thumb-background-color": r("surface-3"),
1053
+ "switch-thumb-border": "none",
1054
+ "switch-thumb-shadow": r("shadow-1"),
1055
+ "switch-border-hover": "none",
1056
+ "switch-background-color-hover": r("fill-active"),
1057
+ // no stronger neutral step exists; acceptable
1058
+ "switch-thumb-background-color-hover": r("surface-3"),
1059
+ "switch-thumb-border-hover": "none",
1060
+ "switch-active-background-color": r("primary"),
1061
+ "switch-active-border": "none",
1062
+ "switch-active-thumb-background-color": r("on-primary"),
1063
+ "switch-active-thumb-border": "none",
1064
+ "switch-active-thumb-shadow": r("shadow-1"),
1065
+ "switch-active-background-color-hover": r("primary-hover"),
1066
+ "switch-active-border-hover": "none",
1067
+ "switch-active-thumb-background-color-hover": r("on-primary"),
1068
+ "switch-active-thumb-border-hover": "none",
1069
+ /* ------------------------------------------------------------------ */
1070
+ /* Radio */
1071
+ /* ------------------------------------------------------------------ */
1072
+ "radio-background-color": "transparent",
1073
+ "radio-background-color-active": r("primary"),
1074
+ "radio-background-color-hover": "transparent",
1075
+ "radio-border": `1px solid ${r("border-strong")}`,
1076
+ "radio-border-active": `1px solid ${r("primary")}`,
1077
+ "radio-border-color-hover": r("primary-border"),
1078
+ "radio-symbol-color": r("on-primary"),
1079
+ "radio-label-color": r("text"),
1080
+ "radio-label-color-active": r("text"),
1081
+ /* ------------------------------------------------------------------ */
1082
+ /* Button — default variant (ghost; `.active` = solid primary) */
1083
+ /* ------------------------------------------------------------------ */
1084
+ "button-background-color": "transparent",
1085
+ "button-background-color-hover": r("hover"),
1086
+ "button-background-color-focus": r("hover"),
1087
+ "button-border": "none",
1088
+ "button-border-hover": "none",
1089
+ "button-border-focus": "none",
1090
+ "button-text-color": r("text"),
1091
+ "button-text-color-hover": r("text"),
1092
+ "button-text-color-focus": r("text"),
1093
+ "button-box-shadow": "none",
1094
+ "button-box-shadow-hover": "none",
1095
+ "button-border-radius": r("radius-md"),
1096
+ "button-active-background-color": r("primary"),
1097
+ "button-active-text-color": r("on-primary"),
1098
+ "button-active-border": "none",
1099
+ "button-active-box-shadow": "none",
1100
+ "button-active-background-color-hover": r("primary-hover"),
1101
+ "button-active-text-color-hover": r("on-primary"),
1102
+ "button-active-border-hover": "none",
1103
+ "button-active-box-shadow-hover": "none",
1104
+ /* ------------------------------------------------------------------ */
1105
+ /* Button — secondary (tonal neutral in both modes) */
1106
+ /* ------------------------------------------------------------------ */
1107
+ "button-secondary-background-color": r("fill"),
1108
+ "button-secondary-background-color-hover": r("fill-hover"),
1109
+ "button-secondary-background-color-focus": r("fill-hover"),
1110
+ "button-secondary-border": "1px solid transparent",
1111
+ "button-secondary-border-hover": "1px solid transparent",
1112
+ "button-secondary-border-focus": "1px solid transparent",
1113
+ "button-secondary-text-color": r("text"),
1114
+ "button-secondary-text-color-hover": r("text"),
1115
+ "button-secondary-text-color-focus": r("text"),
1116
+ "button-secondary-box-shadow": "none",
1117
+ "button-secondary-box-shadow-hover": "none",
1118
+ "button-secondary-active-background-color": r("fill-active"),
1119
+ "button-secondary-active-background-color-hover": r("fill-active"),
1120
+ "button-secondary-active-background-color-focus": r("fill-active"),
1121
+ "button-secondary-active-border": "1px solid transparent",
1122
+ "button-secondary-active-border-hover": "1px solid transparent",
1123
+ "button-secondary-active-border-focus": "1px solid transparent",
1124
+ "button-secondary-active-text-color": r("text"),
1125
+ "button-secondary-active-text-color-hover": r("text"),
1126
+ "button-secondary-active-text-color-focus": r("text"),
1127
+ "button-secondary-active-box-shadow": "none",
1128
+ "button-secondary-active-box-shadow-hover": "none",
1129
+ /* ------------------------------------------------------------------ */
1130
+ /* Button — tertiary (outlined; `.active` = solid primary) */
1131
+ /* ------------------------------------------------------------------ */
1132
+ "button-tertiary-background-color": "transparent",
1133
+ "button-tertiary-background-color-hover": r("hover"),
1134
+ "button-tertiary-background-color-focus": r("hover"),
1135
+ "button-tertiary-border": `1px solid ${r("border-strong")}`,
1136
+ "button-tertiary-border-hover": `1px solid ${r("border-strong")}`,
1137
+ "button-tertiary-border-focus": `1px solid ${r("border-strong")}`,
1138
+ "button-tertiary-text-color": r("text"),
1139
+ "button-tertiary-text-color-hover": r("text"),
1140
+ "button-tertiary-text-color-focus": r("text"),
1141
+ "button-tertiary-box-shadow": "none",
1142
+ "button-tertiary-box-shadow-hover": "none",
1143
+ "button-tertiary-box-shadow-focus": "none",
1144
+ "button-tertiary-active-background-color": r("primary"),
1145
+ "button-tertiary-active-background-color-hover": r("primary-hover"),
1146
+ "button-tertiary-active-background-color-focus": r("primary-hover"),
1147
+ "button-tertiary-active-border": `1px solid ${r("primary")}`,
1148
+ "button-tertiary-active-border-hover": `1px solid ${r("primary")}`,
1149
+ "button-tertiary-active-border-focus": `1px solid ${r("primary")}`,
1150
+ "button-tertiary-active-text-color": r("on-primary"),
1151
+ "button-tertiary-active-text-color-hover": r("on-primary"),
1152
+ "button-tertiary-active-text-color-focus": r("on-primary"),
1153
+ "button-tertiary-active-box-shadow": "none",
1154
+ "button-tertiary-active-box-shadow-hover": "none",
1155
+ "button-tertiary-active-box-shadow-focus": "none",
1156
+ /* ------------------------------------------------------------------ */
1157
+ /* Button — quaternary (text only) */
1158
+ /* ------------------------------------------------------------------ */
1159
+ "button-quaternary-background-color": "transparent",
1160
+ // `-background-color-hover` was never defined by any preset (→ initial = transparent); keep it.
1161
+ "button-quaternary-background-color-hover": "transparent",
1162
+ "button-quaternary-text-color": r("text-muted"),
1163
+ "button-quaternary-text-color-hover": r("text"),
1164
+ "button-quaternary-active-background-color": "transparent",
1165
+ "button-quaternary-active-background-color-hover": "transparent",
1166
+ "button-quaternary-active-text-color": r("text"),
1167
+ "button-quaternary-active-text-color-hover": r("text"),
1168
+ /* ------------------------------------------------------------------ */
1169
+ /* Button states (active = primary tokens, success/error/warning = */
1170
+ /* status tokens). See BxButton.vue `@each $state` block: */
1171
+ /* -background-color / -hover tinted bg (secondary, hovers) */
1172
+ /* -background-color-active / -hover stronger tint (sec./tert. .active)*/
1173
+ /* -background-color-solid / -hover solid fill (default .active) */
1174
+ /* -border-color / -hover coloured border (tertiary) */
1175
+ /* -text-color text on EVERY variant */
1176
+ /* -text-color-tertiary text on the outlined variant */
1177
+ /* LIMITATION: `-text-color` is applied by BxButton on both the tinted */
1178
+ /* (soft) and the solid fills. We pick `<X>-text` (contrast-correct on */
1179
+ /* surface + soft); on the solid `.active` default fill the ideal would */
1180
+ /* be `on-<X>` — BxButton needs a dedicated var for that to be perfect. */
1181
+ /* Status tokens have no `-soft-hover` / `-hover` step: hovers reuse */
1182
+ /* `<status>-soft` / `<status>` (only `active` has primary-soft-hover */
1183
+ /* and primary-hover). */
1184
+ /* ------------------------------------------------------------------ */
1185
+ "button-state-active-background-color": r("primary-soft"),
1186
+ "button-state-active-background-color-hover": r("primary-soft-hover"),
1187
+ "button-state-active-background-color-active": r("primary-soft"),
1188
+ "button-state-active-background-color-active-hover": r("primary-soft-hover"),
1189
+ "button-state-active-background-color-solid": r("primary"),
1190
+ "button-state-active-background-color-solid-hover": r("primary-hover"),
1191
+ "button-state-active-border-color": r("primary-border"),
1192
+ "button-state-active-border-color-hover": r("primary-border"),
1193
+ "button-state-active-text-color": r("primary-text"),
1194
+ "button-state-active-text-color-tertiary": r("primary-text"),
1195
+ "button-state-success-background-color": r("success-soft"),
1196
+ "button-state-success-background-color-hover": r("success-soft"),
1197
+ "button-state-success-background-color-active": r("success-soft"),
1198
+ "button-state-success-background-color-active-hover": r("success-soft"),
1199
+ "button-state-success-background-color-solid": r("success"),
1200
+ "button-state-success-background-color-solid-hover": r("success"),
1201
+ "button-state-success-border-color": r("success-border"),
1202
+ "button-state-success-border-color-hover": r("success-border"),
1203
+ "button-state-success-text-color": r("success-text"),
1204
+ "button-state-success-text-color-tertiary": r("success-text"),
1205
+ "button-state-error-background-color": r("error-soft"),
1206
+ "button-state-error-background-color-hover": r("error-soft"),
1207
+ "button-state-error-background-color-active": r("error-soft"),
1208
+ "button-state-error-background-color-active-hover": r("error-soft"),
1209
+ "button-state-error-background-color-solid": r("error"),
1210
+ "button-state-error-background-color-solid-hover": r("error"),
1211
+ "button-state-error-border-color": r("error-border"),
1212
+ "button-state-error-border-color-hover": r("error-border"),
1213
+ "button-state-error-text-color": r("error-text"),
1214
+ "button-state-error-text-color-tertiary": r("error-text"),
1215
+ "button-state-warning-background-color": r("warning-soft"),
1216
+ "button-state-warning-background-color-hover": r("warning-soft"),
1217
+ "button-state-warning-background-color-active": r("warning-soft"),
1218
+ "button-state-warning-background-color-active-hover": r("warning-soft"),
1219
+ "button-state-warning-background-color-solid": r("warning"),
1220
+ "button-state-warning-background-color-solid-hover": r("warning"),
1221
+ "button-state-warning-border-color": r("warning-border"),
1222
+ "button-state-warning-border-color-hover": r("warning-border"),
1223
+ "button-state-warning-text-color": r("warning-text"),
1224
+ "button-state-warning-text-color-tertiary": r("warning-text"),
1225
+ /* ------------------------------------------------------------------ */
1226
+ /* Message */
1227
+ /* ------------------------------------------------------------------ */
1228
+ "message-body-background-color": r("surface-2"),
1229
+ "message-body-text-color": r("text"),
1230
+ "message-body-border": `1px solid ${r("border")}`,
1231
+ /* ------------------------------------------------------------------ */
1232
+ /* Canvas (template preview area) */
1233
+ /* ------------------------------------------------------------------ */
1234
+ "canvas-background-color": r("canvas"),
1235
+ "canvas-background-image": r("canvas-image"),
1236
+ "canvas-btn-background-color": r("canvas-control"),
1237
+ "canvas-btn-background-color-hover": r("canvas-control-hover"),
1238
+ "canvas-btn-color": r("on-canvas-control"),
1239
+ "btn-color": r("on-canvas-control"),
1240
+ /* ------------------------------------------------------------------ */
1241
+ /* Gallery (bx-template) */
1242
+ /* ------------------------------------------------------------------ */
1243
+ "gallery-card-background-color": r("surface-1"),
1244
+ "gallery-card-background-color-hover": r("surface-2"),
1245
+ "gallery-card-border": `1px solid ${r("border")}`,
1246
+ "gallery-action-btn-background-color": r("scrim"),
1247
+ // The ONLY colour literal in the bridge: the action button sits on `scrim`, which is dark in
1248
+ // every mode, so white text is correct regardless of theme.
1249
+ "gallery-action-btn-color": "#ffffff",
1250
+ "gallery-card-name-text-color": r("text"),
1251
+ "gallery-card-description-text-color": r("text-muted"),
1252
+ /* ------------------------------------------------------------------ */
1253
+ /* Misc */
1254
+ /* ------------------------------------------------------------------ */
1255
+ "spinner-color": r("text")
1256
+ }, So = new Set(
1257
+ Object.keys(zr).filter(
1258
+ (o) => `--${o}`.startsWith(ir) && sr.includes(`--${o}`.slice(ir.length))
1259
+ )
1260
+ ), $o = Object.entries(
1261
+ zr
1262
+ ).filter(([o]) => !So.has(o));
1263
+ function To(o) {
1264
+ const e = {};
1265
+ for (const [t, a] of Object.entries(o.tokens))
1266
+ a !== "" && (e[`${ir}${t}`] = a);
1267
+ for (const [t, a] of $o)
1268
+ e[`--${t}`] = a;
1269
+ if (o.input.customStyle)
1270
+ for (const [t, a] of Object.entries(o.input.customStyle))
1271
+ t === "key" || a == null || a === "" || (e[t.startsWith("--") ? t : `--${t}`] = String(a));
1272
+ return e;
1273
+ }
1274
+ function Lo(o, e) {
1275
+ const t = Array.isArray(e) ? e.join(", ") : e, a = To(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1276
+ return `${t} { color-scheme: ${o.mode}; ${n} }`;
1277
+ }
1278
+ function Ho(o) {
1279
+ return !!o && typeof o == "object" && o.version === 2;
1280
+ }
1281
+ function _o(o) {
1282
+ const e = o ?? {}, t = e["editor-view-background-color"] || (e["app-background-color-rgb"] ? `rgb(${e["app-background-color-rgb"]})` : void 0) || e["popup-background-color"], a = e["primary-color-base"] ? `rgb(${e["primary-color-base"]})` : void 0, n = _(t) ? t : void 0, c = _(a) ? a : void 0, s = typeof e.key == "string" && e.key.endsWith("-wcag"), i = { version: 2 };
1283
+ return n && (i.surface = n), c && (i.primary = c), s && (i.contrast = "high"), typeof e.key == "string" && (i.preset = e.key.startsWith("light") ? "light" : "dark"), i;
1284
+ }
1285
+ export {
1286
+ zr as LEGACY_BRIDGE,
1287
+ ir as SEMANTIC_PREFIX,
1288
+ Ao as SEMANTIC_TOKEN_GROUPS,
1289
+ sr as SEMANTIC_TOKEN_NAMES,
1290
+ ao as STATUS_BASES,
1291
+ No as THEME_HOUSE_PRESETS,
1292
+ no as THEME_PRESETS,
1293
+ Ho as looksLikeThemeInput,
1294
+ Eo as resolveTheme,
1295
+ Co as themeColor,
1296
+ _o as themeInputFromLegacyCustomStyle,
1297
+ Lo as themeToCssText,
1298
+ To as themeToCssVars
1299
+ };