@bluepic/embed 0.4.0-next.158 → 0.4.0-next.159

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.
Files changed (59) hide show
  1. package/dist/bluepic-embed.iife.js +241 -203
  2. package/dist/bluepic-embed.umd.js +241 -203
  3. package/dist/c-B4BAHWS4.cjs +1 -0
  4. package/dist/{c-Bz1-FJiA.js → c-C0DTNf68.js} +122 -63
  5. package/dist/components/BxDatePickerPopover.vue.d.ts +1 -1
  6. package/dist/components/BxInput.vue.d.ts +1 -1
  7. package/dist/components/BxPopover.vue.d.ts +7 -0
  8. package/dist/components/BxTag.vue.d.ts +1 -1
  9. package/dist/components/PopoverElement.vue.d.ts +7 -0
  10. package/dist/components/TemplateEditor/BxTemplateEditor.vue.d.ts +64 -80
  11. package/dist/components/TemplateEditor/TemplateView.vue.d.ts +16 -20
  12. package/dist/components/directives/usePopup.d.ts +5 -0
  13. package/dist/cpp-BfO2fOQK.cjs +1 -0
  14. package/dist/{cpp-Cx0NomaW.js → cpp-DxGBPWa5.js} +65 -48
  15. package/dist/{css-BCTOmdxR.js → css-Cx1gP-zj.js} +17 -6
  16. package/dist/css-DTF39MN3.cjs +1 -0
  17. package/dist/embed/embed.d.ts +2314 -5218
  18. package/dist/{go-BpetKc7b.cjs → go-By8nj0Vi.cjs} +1 -1
  19. package/dist/{go-CkZ9_bn0.js → go-C8VcBUsu.js} +7 -2
  20. package/dist/{java-BicX26Pg.js → java-BoRJOXvw.js} +48 -39
  21. package/dist/java-DFXAwvvK.cjs +1 -0
  22. package/dist/javascript-C2jY0XE6.cjs +1 -0
  23. package/dist/{javascript-DII1YQGr.js → javascript-CgRUYx2b.js} +4 -2
  24. package/dist/json-C4rahuoJ.cjs +1 -0
  25. package/dist/{json-C_6Prymp.js → json-DYK-YbD3.js} +15 -9
  26. package/dist/main.cjs +180 -142
  27. package/dist/main.mjs +27239 -24738
  28. package/dist/markdown-BmL9j9cU.cjs +1 -0
  29. package/dist/{markdown-ga2-2-T7.js → markdown-D19noYwn.js} +9 -10
  30. package/dist/{python-CymlFLB0.js → python-BBUuE3AY.js} +20 -15
  31. package/dist/python-Clt6L10q.cjs +1 -0
  32. package/dist/{rust-BocnJ3Ns.js → rust-DY-oA2gr.js} +40 -26
  33. package/dist/rust-_vvcEGSJ.cjs +1 -0
  34. package/dist/{scss-CknrYxoA.js → scss-BWo_aR1L.js} +36 -25
  35. package/dist/scss-ex7iHSUb.cjs +1 -0
  36. package/dist/style.css +1 -1
  37. package/dist/theme.cjs +1 -1
  38. package/dist/theme.mjs +289 -282
  39. package/dist/{typescript-SNUkGeOU.js → typescript-BHqLHF13.js} +4 -2
  40. package/dist/typescript-DYRnLHqF.cjs +1 -0
  41. package/dist/unzipit.module-4zGfAuq6.cjs +1 -0
  42. package/dist/unzipit.module-qN5XWVVT.js +649 -0
  43. package/dist/util/scrollPassthrough.d.ts +9 -0
  44. package/dist/{xml-B7THKYqr.js → xml-Bse49fPV.js} +9 -16
  45. package/dist/{xml-CII3FKiI.cjs → xml-CVmug_x4.cjs} +1 -1
  46. package/package.json +2 -2
  47. package/dist/c-C_Sx7N-F.cjs +0 -1
  48. package/dist/cpp-DaPzgJ_t.cjs +0 -1
  49. package/dist/css-UgpohNaw.cjs +0 -1
  50. package/dist/java-BIk0G-rH.cjs +0 -1
  51. package/dist/javascript-C_6NC1K7.cjs +0 -1
  52. package/dist/json-DEcHyC5F.cjs +0 -1
  53. package/dist/markdown-BbPYOuo6.cjs +0 -1
  54. package/dist/python-B6_9AjJr.cjs +0 -1
  55. package/dist/rust-DKnYCg2f.cjs +0 -1
  56. package/dist/scss-DpqvoUEp.cjs +0 -1
  57. package/dist/typescript-Cjpf3bLL.cjs +0 -1
  58. package/dist/unzipit.module-B5yfSJfb.js +0 -556
  59. package/dist/unzipit.module-TGsYEkT7.cjs +0 -1
package/dist/theme.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const sr = [
1
+ const dr = [
2
2
  /* mode */
3
3
  "color-scheme",
4
4
  // 'dark' | 'light' — feeds the CSS `color-scheme` property
@@ -140,7 +140,7 @@ const sr = [
140
140
  "on-canvas-control",
141
141
  /* disabled */
142
142
  "disabled-opacity"
143
- ], ir = "--bx-", To = [
143
+ ], br = "--bx-", Lo = [
144
144
  { label: "Surfaces", tokens: ["surface", "surface-1", "surface-2", "surface-3", "surface-inverse", "scrim"] },
145
145
  { label: "Text", tokens: ["text", "text-muted", "text-faint", "text-inverse"] },
146
146
  { label: "Borders", tokens: ["border", "border-strong", "divider"] },
@@ -152,11 +152,11 @@ const sr = [
152
152
  { label: "Info", tokens: ["info", "on-info", "info-text", "info-soft", "info-border"] },
153
153
  { label: "Shape & type", tokens: ["radius-sm", "radius-md", "radius-lg", "radius-full", "font-family", "font-family-heading", "font-size"] },
154
154
  { label: "Canvas", tokens: ["canvas", "canvas-control", "on-canvas-control"] }
155
- ], no = {
155
+ ], io = {
156
156
  // Same surfaces as the historical presets so existing campaigns keep their background.
157
157
  dark: { surface: "#27262e", primary: "#4472c7" },
158
158
  light: { surface: "#f2f2f2", primary: "#124bba" }
159
- }, No = [
159
+ }, Ho = [
160
160
  { key: "light", label: "Light", description: "Neutral light surfaces, Bluepic blue.", input: { version: 2, preset: "light" } },
161
161
  { key: "dark", label: "Dark", description: "Neutral dark surfaces, Bluepic blue.", input: { version: 2, preset: "dark" } },
162
162
  { key: "midnight", label: "Midnight", description: "Near-black with cool, slightly tinted surfaces.", input: { version: 2, surface: "#0f1117", primary: "#7da8f7", tint: 0.35 } },
@@ -168,12 +168,12 @@ const sr = [
168
168
  { key: "graphite", label: "Graphite", description: "Pure black, high contrast, sharp corners — signage and dark brands.", input: { version: 2, surface: "#000000", primary: "#ffffff", radius: "none", contrast: "high" } },
169
169
  { key: "plum", label: "Plum", description: "Deep aubergine surfaces with a warm coral accent.", input: { version: 2, surface: "#1f1423", primary: "#ff7a59", tint: 0.45, radius: "lg" } },
170
170
  { key: "linen", label: "Linen", description: "Soft white linen with a muted navy accent, rounded.", input: { version: 2, surface: "#f7f7f4", primary: "#2f3e5c", tint: 0.15, radius: "lg" } }
171
- ], ao = {
171
+ ], lo = {
172
172
  success: "#28a552",
173
173
  warning: "#d9a400",
174
174
  error: "#dc2f2f",
175
175
  info: "#3b82f6"
176
- }, 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, x = (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 = {
176
+ }, I = Object.freeze({ r: 255, g: 255, b: 255, a: 1 }), Z = Object.freeze({ r: 0, g: 0, b: 0, a: 1 }), Pr = [I, Object.freeze({ r: 17, g: 17, b: 17, a: 1 })], pr = (o, e, t) => o < e ? e : o > t ? t : o, w = (o) => pr(o, 0, 1), y = (o, e = 0) => Number.isFinite(o) ? o : e, k = (o, e, t, a = 1) => ({ r: o, g: e, b: t, a }), B = (o) => Math.round(pr(y(o), 0, 255)), ur = (o) => B(o).toString(16).padStart(2, "0"), uo = {
177
177
  aliceblue: 15792383,
178
178
  antiquewhite: 16444375,
179
179
  aqua: 65535,
@@ -322,29 +322,29 @@ const sr = [
322
322
  whitesmoke: 16119285,
323
323
  yellow: 16776960,
324
324
  yellowgreen: 10145074
325
- }, Ur = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/, so = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/, io = /^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;
326
- function mr(o) {
325
+ }, Br = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/, bo = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/, go = /^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;
326
+ function xr(o) {
327
327
  if (o === "none") return { value: 0, percent: !1 };
328
328
  const e = o.endsWith("%"), t = e ? o.slice(0, -1) : o;
329
- if (!Ur.test(t)) return null;
329
+ if (!Br.test(t)) return null;
330
330
  const a = Number(t);
331
331
  return Number.isFinite(a) ? { value: a, percent: e } : null;
332
332
  }
333
- function gr(o) {
334
- const e = mr(o);
335
- return e ? dr(e.percent ? e.value * 255 / 100 : e.value, 0, 255) : null;
333
+ function hr(o) {
334
+ const e = xr(o);
335
+ return e ? pr(e.percent ? e.value * 255 / 100 : e.value, 0, 255) : null;
336
336
  }
337
- function lo(o) {
338
- const e = mr(o);
337
+ function fo(o) {
338
+ const e = xr(o);
339
339
  return e ? w(e.percent ? e.value / 100 : e.value) : null;
340
340
  }
341
- function Dr(o) {
342
- const e = mr(o);
341
+ function jr(o) {
342
+ const e = xr(o);
343
343
  return e ? w(e.value / 100) : null;
344
344
  }
345
- function uo(o) {
345
+ function po(o) {
346
346
  if (o === "none") return 0;
347
- const e = so.exec(o);
347
+ const e = bo.exec(o);
348
348
  if (!e) return null;
349
349
  let t = Number(e[1]);
350
350
  if (!Number.isFinite(t)) return null;
@@ -361,7 +361,7 @@ function uo(o) {
361
361
  }
362
362
  return t %= 360, t < 0 && (t += 360), t;
363
363
  }
364
- function bo(o) {
364
+ function ho(o) {
365
365
  if (o.includes(",")) {
366
366
  if (o.includes("/")) return null;
367
367
  const n = o.split(",").map((c) => c.trim());
@@ -374,7 +374,7 @@ function bo(o) {
374
374
  let a;
375
375
  return e.length === 2 && (a = e[1].trim(), a === "" || /\s/.test(a)) ? null : { ch: [t[0], t[1], t[2]], alpha: a };
376
376
  }
377
- function go(o, e, t) {
377
+ function mo(o, e, t) {
378
378
  const a = (n) => {
379
379
  const c = (n + o / 30) % 12, s = e * Math.min(t, 1 - t);
380
380
  return t - s * Math.max(-1, Math.min(c - 3, 9 - c, 1));
@@ -385,46 +385,46 @@ function _(o) {
385
385
  if (typeof o != "string") return null;
386
386
  const e = o.trim().toLowerCase();
387
387
  if (!e) return null;
388
- if (e === "transparent") return x(0, 0, 0, 0);
389
- const t = co[e];
390
- if (t !== void 0) return x(t >> 16, t >> 8 & 255, t & 255, 1);
388
+ if (e === "transparent") return k(0, 0, 0, 0);
389
+ const t = uo[e];
390
+ if (t !== void 0) return k(t >> 16, t >> 8 & 255, t & 255, 1);
391
391
  if (e[0] === "#") {
392
392
  const n = e.slice(1);
393
393
  if (!/^[0-9a-f]+$/.test(n)) return null;
394
394
  const c = (i) => parseInt(n[i], 16), s = (i) => parseInt(n.slice(i, i + 2), 16);
395
395
  switch (n.length) {
396
396
  case 3:
397
- return x(c(0) * 17, c(1) * 17, c(2) * 17, 1);
397
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, 1);
398
398
  case 4:
399
- return x(c(0) * 17, c(1) * 17, c(2) * 17, c(3) * 17 / 255);
399
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, c(3) * 17 / 255);
400
400
  case 6:
401
- return x(s(0), s(2), s(4), 1);
401
+ return k(s(0), s(2), s(4), 1);
402
402
  case 8:
403
- return x(s(0), s(2), s(4), s(6) / 255);
403
+ return k(s(0), s(2), s(4), s(6) / 255);
404
404
  default:
405
405
  return null;
406
406
  }
407
407
  }
408
- const a = io.exec(e);
408
+ const a = go.exec(e);
409
409
  if (a) {
410
- const n = bo(a[2]);
410
+ const n = ho(a[2]);
411
411
  if (!n) return null;
412
- const c = n.alpha === void 0 ? 1 : lo(n.alpha);
412
+ const c = n.alpha === void 0 ? 1 : fo(n.alpha);
413
413
  if (c === null) return null;
414
414
  if (a[1] === "rgb" || a[1] === "rgba") {
415
- const v = gr(n.ch[0]), P = gr(n.ch[1]), p = gr(n.ch[2]);
416
- return v === null || P === null || p === null ? null : x(v, P, p, c);
415
+ const x = hr(n.ch[0]), P = hr(n.ch[1]), p = hr(n.ch[2]);
416
+ return x === null || P === null || p === null ? null : k(x, P, p, c);
417
417
  }
418
- const s = uo(n.ch[0]), i = Dr(n.ch[1]), d = Dr(n.ch[2]);
418
+ const s = po(n.ch[0]), i = jr(n.ch[1]), d = jr(n.ch[2]);
419
419
  if (s === null || i === null || d === null) return null;
420
- const [b, C, g] = go(s, i, d);
421
- return x(b, C, g, c);
420
+ const [g, C, b] = mo(s, i, d);
421
+ return k(g, C, b, c);
422
422
  }
423
423
  if (e.includes(",")) {
424
424
  const n = e.split(",").map((d) => d.trim());
425
- if (n.length !== 3 || !n.every((d) => Ur.test(d))) return null;
426
- const [c, s, i] = n.map((d) => dr(Number(d), 0, 255));
427
- return x(c, s, i, 1);
425
+ if (n.length !== 3 || !n.every((d) => Br.test(d))) return null;
426
+ const [c, s, i] = n.map((d) => pr(Number(d), 0, 255));
427
+ return k(c, s, i, 1);
428
428
  }
429
429
  return null;
430
430
  }
@@ -432,11 +432,11 @@ function q(o) {
432
432
  const e = w(o);
433
433
  return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
434
434
  }
435
- function fr(o) {
435
+ function mr(o) {
436
436
  const e = w(o);
437
437
  return e <= 31308e-7 ? e * 12.92 : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
438
438
  }
439
- function fo(o, e, t) {
439
+ function vo(o, e, t) {
440
440
  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);
441
441
  return {
442
442
  L: 0.2104542553 * s + 0.793617785 * i - 0.0040720468 * d,
@@ -444,7 +444,7 @@ function fo(o, e, t) {
444
444
  b: 0.0259040371 * s + 0.7827717662 * i - 0.808675766 * d
445
445
  };
446
446
  }
447
- function pr(o, e, t) {
447
+ function vr(o, e, t) {
448
448
  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;
449
449
  return [
450
450
  4.0767416621 * s - 3.3077115913 * i + 0.2309699292 * d,
@@ -452,152 +452,152 @@ function pr(o, e, t) {
452
452
  -0.0041960863 * s - 0.7034186147 * i + 1.707614701 * d
453
453
  ];
454
454
  }
455
- function lr(o) {
456
- return fo(q(o.r / 255), q(o.g / 255), q(o.b / 255));
455
+ function gr(o) {
456
+ return vo(q(o.r / 255), q(o.g / 255), q(o.b / 255));
457
457
  }
458
- const po = 1e-6;
459
- function Or(o) {
458
+ const yo = 1e-6;
459
+ function Fr(o) {
460
460
  const e = Math.hypot(o.a, o.b);
461
- let t = e < po ? 0 : Math.atan2(o.b, o.a) * 180 / Math.PI;
461
+ let t = e < yo ? 0 : Math.atan2(o.b, o.a) * 180 / Math.PI;
462
462
  return t < 0 && (t += 360), t >= 360 && (t -= 360), { l: o.L, c: e, h: t };
463
463
  }
464
- function hr(o, e, t) {
464
+ function yr(o, e, t) {
465
465
  const a = t * Math.PI / 180;
466
466
  return { L: o, a: e * Math.cos(a), b: e * Math.sin(a) };
467
467
  }
468
- 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;
469
- function rr(o, e, t, a) {
470
- const n = w(m(o));
471
- let c = Math.max(0, m(e));
472
- const s = m(t);
473
- let i = hr(n, c, s), d = pr(i.L, i.a, i.b);
474
- if (!Pr(d)) {
475
- let b = 0, C = c;
476
- for (let g = 0; g < 24; g++) {
477
- const v = (b + C) / 2, P = hr(n, v, s);
478
- Pr(pr(P.L, P.a, P.b)) ? b = v : C = v;
468
+ const z = 1e-6, Rr = (o) => o[0] >= -z && o[0] <= 1 + z && o[1] >= -z && o[1] <= 1 + z && o[2] >= -z && o[2] <= 1 + z;
469
+ function nr(o, e, t, a) {
470
+ const n = w(y(o));
471
+ let c = Math.max(0, y(e));
472
+ const s = y(t);
473
+ let i = yr(n, c, s), d = vr(i.L, i.a, i.b);
474
+ if (!Rr(d)) {
475
+ let g = 0, C = c;
476
+ for (let b = 0; b < 24; b++) {
477
+ const x = (g + C) / 2, P = yr(n, x, s);
478
+ Rr(vr(P.L, P.a, P.b)) ? g = x : C = x;
479
479
  }
480
- c = b, i = hr(n, c, s), d = pr(i.L, i.a, i.b);
480
+ c = g, i = yr(n, c, s), d = vr(i.L, i.a, i.b);
481
481
  }
482
- return x(fr(d[0]) * 255, fr(d[1]) * 255, fr(d[2]) * 255, w(m(a, 1)));
482
+ return k(mr(d[0]) * 255, mr(d[1]) * 255, mr(d[2]) * 255, w(y(a, 1)));
483
483
  }
484
484
  function J(o) {
485
- const e = Or(lr(o));
486
- return { l: e.l, c: e.c, h: e.h, a: w(m(o.a, 1)) };
485
+ const e = Fr(gr(o));
486
+ return { l: e.l, c: e.c, h: e.h, a: w(y(o.a, 1)) };
487
487
  }
488
- function ur(o) {
489
- return rr(o.l, o.c, o.h, o.a);
488
+ function fr(o) {
489
+ return nr(o.l, o.c, o.h, o.a);
490
490
  }
491
- function ho(o) {
492
- const e = w(m(o.a, 1)), t = `#${cr(o.r)}${cr(o.g)}${cr(o.b)}`;
493
- return e < 1 ? `${t}${cr(e * 255)}` : t;
491
+ function xo(o) {
492
+ const e = w(y(o.a, 1)), t = `#${ur(o.r)}${ur(o.g)}${ur(o.b)}`;
493
+ return e < 1 ? `${t}${ur(e * 255)}` : t;
494
494
  }
495
- function vr(o) {
496
- const e = w(m(o.a, 1)), t = O(o.r), a = O(o.g), n = O(o.b);
495
+ function kr(o) {
496
+ const e = w(y(o.a, 1)), t = B(o.r), a = B(o.g), n = B(o.b);
497
497
  return e >= 1 ? `rgb(${t}, ${a}, ${n})` : `rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`;
498
498
  }
499
- function Br(o) {
500
- return `${O(o.r)}, ${O(o.g)}, ${O(o.b)}`;
499
+ function Wr(o) {
500
+ return `${B(o.r)}, ${B(o.g)}, ${B(o.b)}`;
501
501
  }
502
- function Q(o) {
503
- return 0.2126 * q(m(o.r) / 255) + 0.7152 * q(m(o.g) / 255) + 0.0722 * q(m(o.b) / 255);
502
+ function or(o) {
503
+ return 0.2126 * q(y(o.r) / 255) + 0.7152 * q(y(o.g) / 255) + 0.0722 * q(y(o.b) / 255);
504
504
  }
505
- function y(o, e) {
506
- const t = e.a >= 1 ? e : x(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);
505
+ function m(o, e) {
506
+ const t = e.a >= 1 ? e : k(e.r, e.g, e.b, 1), a = o.a < 1 ? er(o, t) : o, n = or(a), c = or(t), s = Math.max(n, c), i = Math.min(n, c);
507
507
  return (s + 0.05) / (i + 0.05);
508
508
  }
509
- function br(o, e) {
510
- const t = w(m(o.a, 1)), a = w(m(e.a, 1)), n = t + a * (1 - t);
511
- if (n <= 0) return x(0, 0, 0, 0);
509
+ function er(o, e) {
510
+ const t = w(y(o.a, 1)), a = w(y(e.a, 1)), n = t + a * (1 - t);
511
+ if (n <= 0) return k(0, 0, 0, 0);
512
512
  const c = a * (1 - t) / n, s = t / n;
513
- return x(o.r * s + e.r * c, o.g * s + e.g * c, o.b * s + e.b * c, n);
513
+ return k(o.r * s + e.r * c, o.g * s + e.g * c, o.b * s + e.b * c, n);
514
514
  }
515
- function X(o, e, t) {
516
- const a = w(m(t));
517
- if (a <= 0) return x(o.r, o.g, o.b, w(m(o.a, 1)));
518
- if (a >= 1) return x(e.r, e.g, e.b, w(m(e.a, 1)));
519
- 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);
520
- return rr(v.l, v.c, v.h, d);
515
+ function tr(o, e, t) {
516
+ const a = w(y(t));
517
+ if (a <= 0) return k(o.r, o.g, o.b, w(y(o.a, 1)));
518
+ if (a >= 1) return k(e.r, e.g, e.b, w(y(e.a, 1)));
519
+ const n = w(y(o.a, 1)), c = w(y(e.a, 1)), s = gr(o), i = gr(e), d = n + (c - n) * a, g = d > 0 ? n * (1 - a) / d : 1 - a, C = d > 0 ? c * a / d : a, b = { L: s.L * g + i.L * C, a: s.a * g + i.a * C, b: s.b * g + i.b * C }, x = Fr(b);
520
+ return nr(x.l, x.c, x.h, d);
521
521
  }
522
522
  function D(o, e) {
523
- return x(o.r, o.g, o.b, w(m(e, 1)));
523
+ return k(o.r, o.g, o.b, w(y(e, 1)));
524
524
  }
525
- function mo(o) {
526
- return lr(o).L;
525
+ function ko(o) {
526
+ return gr(o).L;
527
527
  }
528
- function L(o, e) {
528
+ function E(o, e) {
529
529
  const t = J(o);
530
- return rr(w(t.l + m(e)), t.c, t.h, t.a);
530
+ return nr(w(t.l + y(e)), t.c, t.h, t.a);
531
531
  }
532
- function vo(o, e) {
532
+ function wo(o, e) {
533
533
  const t = J(o);
534
- return rr(w(m(e)), t.c, t.h, t.a);
534
+ return nr(w(y(e)), t.c, t.h, t.a);
535
535
  }
536
- const yo = [1, 0.75, 0.5, 0.25, 0], ko = 24;
537
- function G(o, e, t, a = "auto") {
538
- const n = m(t, 1);
539
- if (y(o, e) >= n) return o;
540
- const c = J(o), s = x(e.r, e.g, e.b, 1), i = Q(s), d = (f, A) => rr(f, A, c.h, c.a), b = (f) => y(f, s), C = (f) => Q(f.a < 1 ? br(f, s) : f), g = (f) => x(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), v = (f) => {
541
- const A = f === "lighter" ? 1 : 0, j = (E) => f === "lighter" ? C(E) >= i : C(E) <= i, H = (E) => j(E) && b(E) >= n, Y = (E) => H(E) && H(g(E));
542
- let R = null;
543
- for (const E of yo) {
544
- const U = c.c * E, K = d(A, U), or = b(K);
545
- if ((!R || or > R.ratio) && (R = { color: K, ratio: or }), !Y(K)) continue;
546
- let er = c.l, V = A;
547
- for (let nr = 0; nr < ko; nr++) {
548
- const B = (er + V) / 2;
549
- Y(d(B, U)) ? V = B : er = B;
536
+ const Io = [1, 0.75, 0.5, 0.25, 0], Mo = 24;
537
+ function R(o, e, t, a = "auto") {
538
+ const n = y(t, 1);
539
+ if (m(o, e) >= n) return o;
540
+ const c = J(o), s = k(e.r, e.g, e.b, 1), i = or(s), d = (f, A) => nr(f, A, c.h, c.a), g = (f) => m(f, s), C = (f) => or(f.a < 1 ? er(f, s) : f), b = (f) => k(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), x = (f) => {
541
+ const A = f === "lighter" ? 1 : 0, j = (L) => f === "lighter" ? C(L) >= i : C(L) <= i, H = (L) => j(L) && g(L) >= n, Y = (L) => H(L) && H(b(L));
542
+ let U = null;
543
+ for (const L of Io) {
544
+ const O = c.c * L, K = d(A, O), ar = g(K);
545
+ if ((!U || ar > U.ratio) && (U = { color: K, ratio: ar }), !Y(K)) continue;
546
+ let cr = c.l, V = A;
547
+ for (let ir = 0; ir < Mo; ir++) {
548
+ const F = (cr + V) / 2;
549
+ Y(d(F, O)) ? V = F : cr = F;
550
550
  }
551
- const tr = d(V, U);
552
- return { color: tr, ratio: b(tr) };
551
+ const sr = d(V, O);
552
+ return { color: sr, ratio: g(sr) };
553
553
  }
554
- return R;
554
+ return U;
555
555
  };
556
- if (a === "lighter" || a === "darker") return v(a).color;
557
- const P = b(d(1, 0)), p = b(d(0, 0));
558
- return v(P >= p ? "lighter" : "darker").color;
556
+ if (a === "lighter" || a === "darker") return x(a).color;
557
+ const P = g(d(1, 0)), p = g(d(0, 0));
558
+ return x(P >= p ? "lighter" : "darker").color;
559
559
  }
560
- function Fr(o) {
561
- return y(I, o) >= y(Z, o);
560
+ function zr(o) {
561
+ return m(I, o) >= m(Z, o);
562
562
  }
563
- function Wr(o, e = _r) {
564
- const t = e.length ? e : _r;
563
+ function Gr(o, e = Pr) {
564
+ const t = e.length ? e : Pr;
565
565
  let a = t[0], n = -1;
566
566
  for (const c of t) {
567
- const s = y(c, o);
567
+ const s = m(c, o);
568
568
  s > n && (n = s, a = c);
569
569
  }
570
- return x(a.r, a.g, a.b, a.a);
570
+ return k(a.r, a.g, a.b, a.a);
571
571
  }
572
- const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
572
+ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
573
573
  __proto__: null,
574
574
  BLACK: Z,
575
575
  WHITE: I,
576
- adjustL: L,
577
- bestOn: Wr,
578
- composite: br,
579
- contrastRatio: y,
580
- ensureContrast: G,
581
- formatHex: ho,
582
- formatRgb: vr,
583
- formatTriplet: Br,
584
- fromOklch: ur,
585
- isDarkSurface: Fr,
586
- lightness: mo,
587
- mix: X,
576
+ adjustL: E,
577
+ bestOn: Gr,
578
+ composite: er,
579
+ contrastRatio: m,
580
+ ensureContrast: R,
581
+ formatHex: xo,
582
+ formatRgb: kr,
583
+ formatTriplet: Wr,
584
+ fromOklch: fr,
585
+ isDarkSurface: zr,
586
+ lightness: ko,
587
+ mix: tr,
588
588
  parseColor: _,
589
- relativeLuminance: Q,
590
- setL: vo,
589
+ relativeLuminance: or,
590
+ setL: wo,
591
591
  toOklch: J,
592
592
  withAlpha: D
593
- }, Symbol.toStringTag, { value: "Module" })), xo = {
593
+ }, Symbol.toStringTag, { value: "Module" })), So = {
594
594
  none: ["0px", "0px", "0px", "0px"],
595
595
  sm: ["3px", "4px", "6px", "9999px"],
596
596
  md: ["4px", "6px", "10px", "9999px"],
597
597
  lg: ["6px", "10px", "16px", "9999px"],
598
598
  full: ["10px", "16px", "24px", "9999px"]
599
- }, wo = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')", Io = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";
600
- function Mo(o, e) {
599
+ }, $o = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')", Ao = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";
600
+ function To(o, e) {
601
601
  const t = o === "dark", a = e ? 0.06 : 0;
602
602
  return {
603
603
  text: e ? 1 : t ? 0.92 : 0.88,
@@ -619,129 +619,131 @@ function Mo(o, e) {
619
619
  elevationMin: e ? 1.3 : t ? 1.18 : 1.06
620
620
  };
621
621
  }
622
- 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 });
623
- function z(o, e, t, a, n = (c) => c) {
624
- let c = t, s = jr(n(X(o, e, c))), i = 0;
625
- for (; y(s, o) < a && c < 1 && i++ < 40; )
626
- c = Math.min(1, c + 0.02), s = jr(n(X(o, e, c)));
622
+ const v = (o) => kr(o), M = (o) => Wr(o), $ = (o, e) => kr(D(o, e)), Ur = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
623
+ function G(o, e, t, a, n = (c) => c) {
624
+ let c = t, s = Ur(n(tr(o, e, c))), i = 0;
625
+ for (; m(s, o) < a && c < 1 && i++ < 40; )
626
+ c = Math.min(1, c + 0.02), s = Ur(n(tr(o, e, c)));
627
627
  return D(s, 1);
628
628
  }
629
- function Rr(o, e, t) {
629
+ function Or(o, e, t) {
630
630
  if (t <= 0) return o;
631
631
  const a = J(o), n = J(e);
632
- return ur({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
632
+ return fr({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
633
633
  }
634
- function Lo(o) {
635
- var Sr, $r, Ar, Tr, Nr, Cr, Lr;
636
- const e = { version: 2, ...o ?? {} }, t = no[e.preset ?? "dark"], a = [];
634
+ function Do(o) {
635
+ var Tr, Nr, Cr, Er, Lr, Hr, _r;
636
+ const e = { version: 2, ...o ?? {} }, t = io[e.preset ?? "dark"], a = [];
637
637
  let n = _(e.surface) ?? null;
638
638
  n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = D(n, 1);
639
639
  let c = _(e.primary) ?? null;
640
640
  c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = D(c, 1);
641
- 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);
641
+ const s = zr(n) ? "dark" : "light", i = s === "dark", d = e.contrast === "high", g = To(s, d), C = Math.max(0, Math.min(1, e.tint ?? 0)), b = d ? 7 : 4.5, x = d ? 4.5 : 3, p = Or(i ? I : { r: 17, g: 17, b: 17, a: 1 }, c, C);
642
642
  let f, A, j;
643
- const H = (l) => Rr(l, c, C);
643
+ const H = (l) => Or(l, c, C);
644
644
  if (i) {
645
- const l = y(I, n) >= 6 ? I : Z;
646
- f = z(n, l, 0.07, b.elevationMin, H), A = z(f, l, 0.05, 1.12, H), j = z(A, l, 0.05, 1.12, H);
645
+ const l = m(I, n) >= 6 ? I : Z;
646
+ f = G(n, l, 0.07, g.elevationMin, H), A = G(f, l, 0.05, 1.12, H), j = G(A, l, 0.05, 1.12, H);
647
647
  } else {
648
- const l = y(I, n);
649
- if (l >= b.elevationMin * 1.01) {
650
- const u = l >= 1.149995 ? 1.1 : b.elevationMin;
651
- f = z(n, I, 0.5, u, H), A = y(I, f) >= 1.03 ? z(f, I, 0.6, 1.03, H) : D(I, 1), j = H(X(A, Z, 0.035));
648
+ const l = m(I, n);
649
+ if (l >= g.elevationMin * 1.01) {
650
+ const u = l >= 1.149995 ? 1.1 : g.elevationMin;
651
+ f = G(n, I, 0.5, u, H), A = m(I, f) >= 1.03 ? G(f, I, 0.6, 1.03, H) : D(I, 1), j = H(tr(A, Z, 0.035));
652
652
  }
653
- (!f || y(f, n) < b.elevationMin) && (f = z(n, Z, 0.03, b.elevationMin, H), A = D(I, 1), j = H(X(A, Z, 0.05)));
653
+ (!f || m(f, n) < g.elevationMin) && (f = G(n, Z, 0.03, g.elevationMin, H), A = D(I, 1), j = H(tr(A, Z, 0.05)));
654
654
  }
655
655
  if (!f || !A || !j) throw new Error("theme: elevation ladder not resolved");
656
- 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), E = (l) => [n, f, A, j].reduce((u, N) => y(l, N) < y(l, u) ? N : u, n), U = (l, u, N) => {
657
- let S = l, F = 0;
658
- for (; y(D(p, S), E(D(p, S))) < u && S < 1 && F++ < 25; ) S = Math.min(1, S + 0.04);
656
+ const Y = fr(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), U = Gr(Y), L = (l) => [n, f, A, j].reduce((u, N) => m(l, N) < m(l, u) ? N : u, n), O = (l, u, N) => {
657
+ let S = l, W = 0;
658
+ for (; m(D(p, S), L(D(p, S))) < u && S < 1 && W++ < 25; ) S = Math.min(1, S + 0.04);
659
659
  return S !== l && a.push({ token: N, reason: `raised opacity ${l}→${S.toFixed(2)} to reach ${u}:1 on surfaces` }), S;
660
- }, K = U(b.text, g, "text"), or = U(b.textMuted, g, "text-muted"), er = U(b.textFaint, v, "text-faint"), V = (() => {
661
- const l = y(I, c), u = y({ r: 17, g: 17, b: 17, a: 1 }, c);
662
- if (l >= g) return I;
660
+ }, K = O(g.text, b, "text"), ar = O(g.textMuted, b, "text-muted"), cr = O(g.textFaint, x, "text-faint"), V = (() => {
661
+ const l = m(I, c), u = m({ r: 17, g: 17, b: 17, a: 1 }, c);
662
+ if (l >= b) return I;
663
663
  const N = u > l ? { r: 17, g: 17, b: 17, a: 1 } : I;
664
- 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;
665
- })(), tr = L(c, i ? 0.06 : -0.06), nr = L(c, i ? 0.1 : -0.1), B = G(c, n, g, "auto");
666
- 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` });
667
- const Gr = G(c, n, v, "auto"), Zr = G(c, n, v, "auto"), ar = (l) => {
668
- 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;
664
+ return Math.max(l, u) < b && a.push({ token: "on-primary", reason: `neither white nor black reaches ${b}:1 on primary (best ${Math.max(l, u).toFixed(2)}:1)` }), N;
665
+ })(), sr = E(c, i ? 0.06 : -0.06), ir = E(c, i ? 0.1 : -0.1), F = R(c, n, b, "auto");
666
+ m(F, n) > m(c, n) + 0.01 && a.push({ token: "primary-text", reason: `primary lightened/darkened to reach ${b}:1 as text on surface` });
667
+ const qr = R(c, n, x, "auto"), Jr = R(c, n, x, "auto"), lr = (l) => {
668
+ const u = _(lo[l]), N = m(I, u), S = m({ r: 17, g: 17, b: 17, a: 1 }, u), W = N >= b ? I : S > N ? { r: 17, g: 17, b: 17, a: 1 } : I, Q = D(u, g.soft), X = er(Q, n), Dr = (rr) => R(R(u, n, b, rr), X, b, rr), co = R(u, n, b, "auto"), so = [Dr("darker"), Dr("lighter")].find(
669
+ (rr) => m(rr, n) >= b && m(rr, X) >= b
670
+ );
669
671
  return {
670
672
  base: u,
671
- on: F,
672
- text: G(u, n, g, "auto"),
673
- soft: D(u, b.soft),
674
- border: G(u, n, v, "auto"),
675
- dark: L(u, -0.1),
676
- light: L(u, 0.12),
677
- darker: L(u, -0.18),
678
- bright: L(u, 0.22)
673
+ on: W,
674
+ text: so ?? co,
675
+ soft: Q,
676
+ border: R(u, n, x, "auto"),
677
+ dark: E(u, -0.1),
678
+ light: E(u, 0.12),
679
+ darker: E(u, -0.18),
680
+ bright: E(u, 0.22)
679
681
  };
680
- }, qr = ar("success"), Jr = ar("warning"), Yr = ar("error"), Kr = ar("info"), [Vr, Qr, Xr, ro] = xo[e.radius ?? "md"], yr = "'Inter', sans-serif", kr = (l) => {
682
+ }, Yr = lr("success"), Kr = lr("warning"), Vr = lr("error"), Qr = lr("info"), [Xr, ro, oo, eo] = So[e.radius ?? "md"], wr = "'Inter', sans-serif", Ir = (l) => {
681
683
  var u;
682
- return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${yr}` : yr;
683
- }, xr = kr((Sr = e.fonts) == null ? void 0 : Sr.ui), oo = ($r = e.fonts) != null && $r.heading ? kr(e.fonts.heading) : xr, eo = Array.from(new Set([(Tr = (Ar = e.fonts) == null ? void 0 : Ar.ui) == null ? void 0 : Tr.src, (Cr = (Nr = e.fonts) == null ? void 0 : Nr.heading) == null ? void 0 : Cr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), wr = (Lr = e.font) != null && Lr.size && e.font.size > 0 ? e.font.size : 14, T = {
684
+ return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${wr}` : wr;
685
+ }, Mr = Ir((Tr = e.fonts) == null ? void 0 : Tr.ui), to = (Nr = e.fonts) != null && Nr.heading ? Ir(e.fonts.heading) : Mr, no = Array.from(new Set([(Er = (Cr = e.fonts) == null ? void 0 : Cr.ui) == null ? void 0 : Er.src, (Hr = (Lr = e.fonts) == null ? void 0 : Lr.heading) == null ? void 0 : Hr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), Sr = (_r = e.font) != null && _r.size && e.font.size > 0 ? e.font.size : 14, T = {
684
686
  "color-scheme": s,
685
- surface: h(n),
687
+ surface: v(n),
686
688
  "surface-rgb": M(n),
687
- "surface-1": h(f),
689
+ "surface-1": v(f),
688
690
  "surface-1-rgb": M(f),
689
- "surface-2": h(A),
691
+ "surface-2": v(A),
690
692
  "surface-2-rgb": M(A),
691
- "surface-3": h(j),
692
- "surface-inverse": h(Y),
693
+ "surface-3": v(j),
694
+ "surface-inverse": v(Y),
693
695
  scrim: "rgba(0, 0, 0, 0.5)",
694
- ink: h(p),
696
+ ink: v(p),
695
697
  "ink-rgb": M(p),
696
698
  text: $(p, K),
697
- "text-muted": $(p, or),
698
- "text-faint": $(p, er),
699
- "text-inverse": h(R),
699
+ "text-muted": $(p, ar),
700
+ "text-faint": $(p, cr),
701
+ "text-inverse": v(U),
700
702
  "text-on-surface-rgb": M(p),
701
- "text-on-inverse-rgb": M(R),
702
- border: $(p, b.border),
703
- "border-strong": $(p, b.borderStrong),
704
- divider: $(p, b.divider),
703
+ "text-on-inverse-rgb": M(U),
704
+ border: $(p, g.border),
705
+ "border-strong": $(p, g.borderStrong),
706
+ divider: $(p, g.divider),
705
707
  "border-rgb": M(p),
706
- fill: $(p, b.fill),
707
- "fill-hover": $(p, b.fillHover),
708
- "fill-active": $(p, b.fillActive),
709
- field: $(p, b.field),
710
- "field-hover": $(p, b.fieldHover),
711
- "field-focus": $(p, b.fieldFocus),
712
- hover: $(p, b.hover),
713
- pressed: $(p, b.pressed),
714
- primary: h(c),
708
+ fill: $(p, g.fill),
709
+ "fill-hover": $(p, g.fillHover),
710
+ "fill-active": $(p, g.fillActive),
711
+ field: $(p, g.field),
712
+ "field-hover": $(p, g.fieldHover),
713
+ "field-focus": $(p, g.fieldFocus),
714
+ hover: $(p, g.hover),
715
+ pressed: $(p, g.pressed),
716
+ primary: v(c),
715
717
  "primary-rgb": M(c),
716
- "primary-hover": h(tr),
717
- "primary-active": h(nr),
718
- "on-primary": h(V),
719
- "primary-text": h(B),
720
- "primary-border": h(Gr),
721
- "primary-soft": $(c, b.soft),
722
- "primary-soft-hover": $(c, b.softHover),
723
- "focus-ring": h(Zr),
718
+ "primary-hover": v(sr),
719
+ "primary-active": v(ir),
720
+ "on-primary": v(V),
721
+ "primary-text": v(F),
722
+ "primary-border": v(qr),
723
+ "primary-soft": $(c, g.soft),
724
+ "primary-soft-hover": $(c, g.softHover),
725
+ "focus-ring": v(Jr),
724
726
  "focus-ring-width": d ? "3px" : "2px",
725
727
  "focus-ring-offset": "2px",
726
- "primary-dark": h(L(c, -0.1)),
727
- "primary-dark-rgb": M(L(c, -0.1)),
728
- "primary-light": h(L(c, 0.1)),
729
- "primary-light-rgb": M(L(c, 0.1)),
730
- "primary-bright": h(L(c, 0.2)),
731
- "primary-bright-rgb": M(L(c, 0.2)),
728
+ "primary-dark": v(E(c, -0.1)),
729
+ "primary-dark-rgb": M(E(c, -0.1)),
730
+ "primary-light": v(E(c, 0.1)),
731
+ "primary-light-rgb": M(E(c, 0.1)),
732
+ "primary-bright": v(E(c, 0.2)),
733
+ "primary-bright-rgb": M(E(c, 0.2)),
732
734
  "shadow-1": i ? "0 1px 2px rgba(0, 0, 0, 0.4)" : "0 1px 2px rgba(0, 0, 0, 0.08)",
733
735
  "shadow-2": i ? "0 6px 20px rgba(0, 0, 0, 0.45)" : "0 6px 20px rgba(0, 0, 0, 0.12)",
734
736
  "shadow-3": i ? "0 12px 40px rgba(0, 0, 0, 0.5)" : "0 12px 40px rgba(0, 0, 0, 0.16)",
735
- "radius-sm": Vr,
736
- "radius-md": Qr,
737
- "radius-lg": Xr,
738
- "radius-full": ro,
739
- "font-family": xr,
740
- "font-family-heading": oo,
741
- "font-size": `${wr}px`,
742
- "root-font-size": String(wr),
737
+ "radius-sm": Xr,
738
+ "radius-md": ro,
739
+ "radius-lg": oo,
740
+ "radius-full": eo,
741
+ "font-family": Mr,
742
+ "font-family-heading": to,
743
+ "font-size": `${Sr}px`,
744
+ "root-font-size": String(Sr),
743
745
  canvas: i ? "rgba(0, 0, 0, 0.25)" : "rgba(0, 0, 0, 0.04)",
744
- "canvas-image": i ? wo : Io,
746
+ "canvas-image": i ? $o : Ao,
745
747
  // Controls float over arbitrary artwork → mode-independent dark glass + white glyphs.
746
748
  "canvas-control": "rgba(0, 0, 0, 0.45)",
747
749
  "canvas-control-hover": "rgba(0, 0, 0, 0.6)",
@@ -749,51 +751,56 @@ function Lo(o) {
749
751
  "disabled-opacity": "0.55"
750
752
  };
751
753
  for (const [l, u] of [
752
- ["success", qr],
753
- ["warning", Jr],
754
- ["error", Yr],
755
- ["info", Kr]
754
+ ["success", Yr],
755
+ ["warning", Kr],
756
+ ["error", Vr],
757
+ ["info", Qr]
756
758
  ])
757
- T[l] = h(u.base), T[`${l}-rgb`] = M(u.base), T[`on-${l}`] = h(u.on), T[`${l}-text`] = h(u.text), T[`${l}-soft`] = h(u.soft), T[`${l}-border`] = h(u.border), T[`${l}-dark-rgb`] = M(u.dark), T[`${l}-light-rgb`] = M(u.light), l === "info" ? T["info-bright-rgb"] = M(u.bright) : T[`${l}-darker-rgb`] = M(u.darker);
759
+ T[l] = v(u.base), T[`${l}-rgb`] = M(u.base), T[`on-${l}`] = v(u.on), T[`${l}-text`] = v(u.text), T[`${l}-soft`] = v(u.soft), T[`${l}-border`] = v(u.border), T[`${l}-dark-rgb`] = M(u.dark), T[`${l}-light-rgb`] = M(u.light), l === "info" ? T["info-bright-rgb"] = M(u.bright) : T[`${l}-darker-rgb`] = M(u.darker);
758
760
  if (e.overrides)
759
761
  for (const [l, u] of Object.entries(e.overrides)) {
760
- if (!u || !sr.includes(l)) continue;
762
+ if (!u || !dr.includes(l)) continue;
761
763
  T[l] = u;
762
764
  const N = `${l}-rgb`;
763
- if (sr.includes(N)) {
765
+ if (dr.includes(N)) {
764
766
  const S = _(u);
765
767
  S && (T[N] = M(S));
766
768
  }
767
769
  }
768
- for (const l of sr) T[l] === void 0 && (T[l] = "");
769
- const Ir = T, Mr = (l) => _(Ir[l]), k = (l, u, N, S) => {
770
- const F = Mr(u), Er = Mr(N), Hr = F && Er ? y(F, br(Er, n)) : 0;
771
- return { label: l, fg: u, bg: N, ratio: Math.round(Hr * 100) / 100, min: S, pass: Hr >= S };
772
- }, to = [
773
- k("Text on surface", "text", "surface", g),
774
- k("Muted text on surface", "text-muted", "surface", g),
775
- k("Faint text on surface", "text-faint", "surface", v),
776
- k("Text on cards (surface-1)", "text", "surface-1", g),
777
- k("Text on popovers (surface-2)", "text", "surface-2", g),
778
- k("Cards distinguishable from surface", "surface-1", "surface", b.elevationMin),
779
- k("Popovers distinguishable from cards", "surface-2", "surface-1", i ? 1.12 : 1),
780
- k("Strong border on surface", "border-strong", "surface", d ? 3 : 1.5),
781
- k("Text on primary", "on-primary", "primary", g),
782
- k("Primary as text on surface", "primary-text", "surface", g),
783
- k("Primary border on surface", "primary-border", "surface", v),
784
- k("Focus ring on surface", "focus-ring", "surface", v),
785
- k("Success text on surface", "success-text", "surface", g),
786
- k("Warning text on surface", "warning-text", "surface", g),
787
- k("Error text on surface", "error-text", "surface", g),
788
- k("Info text on surface", "info-text", "surface", g),
789
- k("Text on success", "on-success", "success", g),
790
- k("Text on warning", "on-warning", "warning", g),
791
- k("Text on error", "on-error", "error", g),
792
- k("Text on tooltip", "text-inverse", "surface-inverse", g)
770
+ for (const l of dr) T[l] === void 0 && (T[l] = "");
771
+ const $r = T, Ar = (l) => _($r[l]), h = (l, u, N, S) => {
772
+ const W = Ar(u), Q = Ar(N), X = W && Q ? m(W, er(Q, n)) : 0;
773
+ return { label: l, fg: u, bg: N, ratio: Math.round(X * 100) / 100, min: S, pass: X >= S };
774
+ }, ao = [
775
+ h("Text on surface", "text", "surface", b),
776
+ h("Muted text on surface", "text-muted", "surface", b),
777
+ h("Faint text on surface", "text-faint", "surface", x),
778
+ h("Text on cards (surface-1)", "text", "surface-1", b),
779
+ h("Text on popovers (surface-2)", "text", "surface-2", b),
780
+ h("Cards distinguishable from surface", "surface-1", "surface", g.elevationMin),
781
+ h("Popovers distinguishable from cards", "surface-2", "surface-1", i ? 1.12 : 1),
782
+ h("Strong border on surface", "border-strong", "surface", d ? 3 : 1.5),
783
+ h("Text on primary", "on-primary", "primary", b),
784
+ h("Primary as text on surface", "primary-text", "surface", b),
785
+ h("Primary border on surface", "primary-border", "surface", x),
786
+ h("Focus ring on surface", "focus-ring", "surface", x),
787
+ h("Success text on surface", "success-text", "surface", b),
788
+ h("Warning text on surface", "warning-text", "surface", b),
789
+ h("Error text on surface", "error-text", "surface", b),
790
+ h("Info text on surface", "info-text", "surface", b),
791
+ // Where status text is actually read: on its own tint (alerts, tags, banners).
792
+ h("Success text on success tint", "success-text", "success-soft", b),
793
+ h("Warning text on warning tint", "warning-text", "warning-soft", b),
794
+ h("Error text on error tint", "error-text", "error-soft", b),
795
+ h("Info text on info tint", "info-text", "info-soft", b),
796
+ h("Text on success", "on-success", "success", b),
797
+ h("Text on warning", "on-warning", "warning", b),
798
+ h("Text on error", "on-error", "error", b),
799
+ h("Text on tooltip", "text-inverse", "surface-inverse", b)
793
800
  ];
794
- return { input: e, mode: s, tokens: Ir, report: { mode: s, checks: to, adjustments: a }, fontUrls: eo };
801
+ return { input: e, mode: s, tokens: $r, report: { mode: s, checks: ao, adjustments: a }, fontUrls: no };
795
802
  }
796
- const r = (o) => `var(${ir}${o})`, zr = {
803
+ const r = (o) => `var(${br}${o})`, Zr = {
797
804
  /* ------------------------------------------------------------------ */
798
805
  /* Typography & focus ring */
799
806
  /* ------------------------------------------------------------------ */
@@ -1256,47 +1263,47 @@ const r = (o) => `var(${ir}${o})`, zr = {
1256
1263
  /* Misc */
1257
1264
  /* ------------------------------------------------------------------ */
1258
1265
  "spinner-color": r("text")
1259
- }, So = new Set(
1260
- Object.keys(zr).filter(
1261
- (o) => `--${o}`.startsWith(ir) && sr.includes(`--${o}`.slice(ir.length))
1266
+ }, No = new Set(
1267
+ Object.keys(Zr).filter(
1268
+ (o) => `--${o}`.startsWith(br) && dr.includes(`--${o}`.slice(br.length))
1262
1269
  )
1263
- ), $o = Object.entries(
1264
- zr
1265
- ).filter(([o]) => !So.has(o));
1266
- function Ao(o) {
1270
+ ), Co = Object.entries(
1271
+ Zr
1272
+ ).filter(([o]) => !No.has(o));
1273
+ function Eo(o) {
1267
1274
  const e = {};
1268
1275
  for (const [t, a] of Object.entries(o.tokens))
1269
- a !== "" && (e[`${ir}${t}`] = a);
1270
- for (const [t, a] of $o)
1276
+ a !== "" && (e[`${br}${t}`] = a);
1277
+ for (const [t, a] of Co)
1271
1278
  e[`--${t}`] = a;
1272
1279
  if (o.input.customStyle)
1273
1280
  for (const [t, a] of Object.entries(o.input.customStyle))
1274
1281
  t === "key" || a == null || a === "" || (e[t.startsWith("--") ? t : `--${t}`] = String(a));
1275
1282
  return e;
1276
1283
  }
1277
- function Eo(o, e) {
1278
- const t = Array.isArray(e) ? e.join(", ") : e, a = Ao(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1284
+ function Po(o, e) {
1285
+ const t = Array.isArray(e) ? e.join(", ") : e, a = Eo(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1279
1286
  return `${t} { color-scheme: ${o.mode}; ${n} }`;
1280
1287
  }
1281
- function Ho(o) {
1288
+ function jo(o) {
1282
1289
  return !!o && typeof o == "object" && o.version === 2;
1283
1290
  }
1284
- function _o(o) {
1291
+ function Ro(o) {
1285
1292
  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 };
1286
1293
  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;
1287
1294
  }
1288
1295
  export {
1289
- zr as LEGACY_BRIDGE,
1290
- ir as SEMANTIC_PREFIX,
1291
- To as SEMANTIC_TOKEN_GROUPS,
1292
- sr as SEMANTIC_TOKEN_NAMES,
1293
- ao as STATUS_BASES,
1294
- No as THEME_HOUSE_PRESETS,
1295
- no as THEME_PRESETS,
1296
- Ho as looksLikeThemeInput,
1297
- Lo as resolveTheme,
1298
- Co as themeColor,
1299
- _o as themeInputFromLegacyCustomStyle,
1300
- Eo as themeToCssText,
1301
- Ao as themeToCssVars
1296
+ Zr as LEGACY_BRIDGE,
1297
+ br as SEMANTIC_PREFIX,
1298
+ Lo as SEMANTIC_TOKEN_GROUPS,
1299
+ dr as SEMANTIC_TOKEN_NAMES,
1300
+ lo as STATUS_BASES,
1301
+ Ho as THEME_HOUSE_PRESETS,
1302
+ io as THEME_PRESETS,
1303
+ jo as looksLikeThemeInput,
1304
+ Do as resolveTheme,
1305
+ _o as themeColor,
1306
+ Ro as themeInputFromLegacyCustomStyle,
1307
+ Po as themeToCssText,
1308
+ Eo as themeToCssVars
1302
1309
  };