@tempots/beatui 1.0.0 → 1.0.1

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.
@@ -1,44 +1,44 @@
1
- import { Value as p, prop as lt, computedOf as D, html as _, attr as u, svg as rt, svgAttr as Q, Empty as S, on as I, When as H, Fragment as j, aria as B, emitValue as st, Use as gt, input as ut, emitValueAsNullableDate as ot, emitValueAsNullableDateTime as ct, Repeat as ft, style as mt, emit as bt, emitValueAsNumber as E } from "@tempots/dom";
2
- import { F as wt, N as X, T as yt, U as Mt, a as It } from "./deep-merge-BzIheQtH.js";
3
- import { decodeBase64 as $t } from "@tempots/std";
4
- import { I as L } from "./input-container-BvEcp7FU.js";
5
- import { C as O, m as pt, T as xt } from "./text-input-DfqXolVe.js";
6
- import { B as _t, I as tt, b as it, a as kt } from "./translations-B1_yyDUK.js";
7
- import { AutoSelect as Ft } from "@tempots/ui";
8
- import { N as Ct, P as Tt } from "./notice-E19wu9lA.js";
9
- import { s as St } from "./session-id-3KiilioY.js";
10
- import { r as At } from "./utils-vUtP6iPG.js";
11
- function dt(t) {
1
+ import { Value as p, prop as ut, computedOf as D, html as x, attr as u, svg as ot, svgAttr as Q, Empty as S, on as I, When as z, Fragment as j, aria as B, emitValue as st, Use as ft, input as pt, emitValueAsNullableDate as ct, emitValueAsNullableDateTime as it, Repeat as mt, emit as bt, style as wt, emitValueAsNumber as E } from "@tempots/dom";
2
+ import { F as yt, N as X, T as Mt, U as It, a as $t } from "./deep-merge-BzIheQtH.js";
3
+ import { decodeBase64 as xt } from "@tempots/std";
4
+ import { I as P } from "./input-container-BvEcp7FU.js";
5
+ import { C as L, m as dt, T as _t } from "./text-input-DfqXolVe.js";
6
+ import { B as kt, I as tt, b as lt, a as Ft } from "./translations-B1_yyDUK.js";
7
+ import { AutoSelect as Ct } from "@tempots/ui";
8
+ import { E as Tt, P as St } from "./notice-BKcyJD5w.js";
9
+ import { s as At } from "./session-id-3KiilioY.js";
10
+ import { r as vt } from "./utils-vUtP6iPG.js";
11
+ function ht(t) {
12
12
  if (typeof t != "string") return !1;
13
13
  const e = t.startsWith("#") ? t.slice(1) : t;
14
14
  return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e);
15
15
  }
16
- function vt(t) {
16
+ function Nt(t) {
17
17
  if (typeof t != "string") return !1;
18
18
  const e = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i, a = t.match(e);
19
19
  if (!a) return !1;
20
20
  const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
21
21
  return o >= 0 && o <= 255 && c >= 0 && c <= 255 && i >= 0 && i <= 255;
22
22
  }
23
- function Nt(t) {
23
+ function Rt(t) {
24
24
  if (typeof t != "string") return !1;
25
25
  const e = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i, a = t.match(e);
26
26
  if (!a) return !1;
27
27
  const [, n, r, s, o] = a, c = parseInt(n, 10), i = parseInt(r, 10), l = parseInt(s, 10), d = parseFloat(o);
28
28
  return c >= 0 && c <= 255 && i >= 0 && i <= 255 && l >= 0 && l <= 255 && d >= 0 && d <= 1;
29
29
  }
30
- function Rt(t) {
30
+ function Bt(t) {
31
31
  if (typeof t != "string") return !1;
32
32
  const e = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i, a = t.match(e);
33
33
  if (!a) return !1;
34
34
  const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
35
35
  return o >= 0 && o <= 360 && c >= 0 && c <= 100 && i >= 0 && i <= 100;
36
36
  }
37
- function pe(t) {
38
- return dt(t) || vt(t) || Nt(t) || Rt(t);
37
+ function de(t) {
38
+ return ht(t) || Nt(t) || Rt(t) || Bt(t);
39
39
  }
40
- function Bt(t) {
41
- if (!dt(t)) return null;
40
+ function Dt(t) {
41
+ if (!ht(t)) return null;
42
42
  let e = t.startsWith("#") ? t.slice(1) : t;
43
43
  return e.length === 3 && (e = e.split("").map((a) => a + a).join("")), `#${e.toLowerCase()}`;
44
44
  }
@@ -49,8 +49,8 @@ function et(t, e, a) {
49
49
  };
50
50
  return `#${n(t)}${n(e)}${n(a)}`;
51
51
  }
52
- function z(t) {
53
- const e = Bt(t);
52
+ function H(t) {
53
+ const e = Dt(t);
54
54
  if (!e) return null;
55
55
  const a = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
56
56
  return a ? {
@@ -59,16 +59,16 @@ function z(t) {
59
59
  b: parseInt(a[3], 16)
60
60
  } : null;
61
61
  }
62
- function de(t, e) {
63
- const a = z(t), n = z(e);
62
+ function he(t, e) {
63
+ const a = H(t), n = H(e);
64
64
  if (!a || !n) return null;
65
- const r = (l, d, g) => {
66
- const [m, h, b] = [l, d, g].map((M) => (M = M / 255, M <= 0.03928 ? M / 12.92 : Math.pow((M + 0.055) / 1.055, 2.4)));
67
- return 0.2126 * m + 0.7152 * h + 0.0722 * b;
65
+ const r = (l, d, h) => {
66
+ const [y, f, g] = [l, d, h].map((M) => (M = M / 255, M <= 0.03928 ? M / 12.92 : Math.pow((M + 0.055) / 1.055, 2.4)));
67
+ return 0.2126 * y + 0.7152 * f + 0.0722 * g;
68
68
  }, s = r(a.r, a.g, a.b), o = r(n.r, n.g, n.b), c = Math.max(s, o), i = Math.min(s, o);
69
69
  return (c + 0.05) / (i + 0.05);
70
70
  }
71
- function Dt(t) {
71
+ function Vt(t) {
72
72
  if (!t) return [0, 0, 0, 1];
73
73
  const a = t.trim().match(
74
74
  /^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
@@ -76,8 +76,8 @@ function Dt(t) {
76
76
  if (a) {
77
77
  const l = a[1];
78
78
  if (l.length === 8) {
79
- const d = parseInt(l.slice(0, 2), 16), g = parseInt(l.slice(2, 4), 16), m = parseInt(l.slice(4, 6), 16), h = parseInt(l.slice(6, 8), 16) / 255;
80
- return [d, g, m, h];
79
+ const d = parseInt(l.slice(0, 2), 16), h = parseInt(l.slice(2, 4), 16), y = parseInt(l.slice(4, 6), 16), f = parseInt(l.slice(6, 8), 16) / 255;
80
+ return [d, h, y, f];
81
81
  }
82
82
  if (l.length === 6)
83
83
  return [
@@ -87,12 +87,12 @@ function Dt(t) {
87
87
  1
88
88
  ];
89
89
  if (l.length === 4) {
90
- const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16), h = parseInt(l[3] + l[3], 16) / 255;
91
- return [d, g, m, h];
90
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), y = parseInt(l[2] + l[2], 16), f = parseInt(l[3] + l[3], 16) / 255;
91
+ return [d, h, y, f];
92
92
  }
93
93
  if (l.length === 3) {
94
- const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16);
95
- return [d, g, m, 1];
94
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), y = parseInt(l[2] + l[2], 16);
95
+ return [d, h, y, 1];
96
96
  }
97
97
  }
98
98
  const n = t.match(
@@ -114,39 +114,39 @@ function Dt(t) {
114
114
  /^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
115
115
  );
116
116
  if (s) {
117
- const l = parseFloat(s[1]), d = parseFloat(s[2]), g = parseFloat(s[3]), m = s[4] != null ? parseFloat(s[4]) : 1, [h, b, M] = ht(l, d / 100, g / 100);
118
- return [h, b, M, m];
117
+ const l = parseFloat(s[1]), d = parseFloat(s[2]), h = parseFloat(s[3]), y = s[4] != null ? parseFloat(s[4]) : 1, [f, g, M] = gt(l, d / 100, h / 100);
118
+ return [f, g, M, y];
119
119
  }
120
120
  const o = t.match(
121
121
  /^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
122
122
  );
123
123
  if (o) {
124
- const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, g = parseFloat(o[3]) / 100, m = o[4] != null ? parseFloat(o[4]) : 1, [h, b, M] = Lt(l, d, g);
125
- return [h, b, M, m];
124
+ const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, y = o[4] != null ? parseFloat(o[4]) : 1, [f, g, M] = Lt(l, d, h);
125
+ return [f, g, M, y];
126
126
  }
127
127
  const c = t.match(
128
128
  /^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
129
129
  );
130
130
  if (c) {
131
- const l = c[1], d = parseFloat(c[2]), g = parseFloat(c[3]), m = c[4] != null ? parseFloat(c[4]) : 1, h = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [b, M, $] = Pt(h, d, g);
132
- return [b, M, $, m];
131
+ const l = c[1], d = parseFloat(c[2]), h = parseFloat(c[3]), y = c[4] != null ? parseFloat(c[4]) : 1, f = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [g, M, k] = Ut(f, d, h);
132
+ return [g, M, k, y];
133
133
  }
134
- const i = z(t);
134
+ const i = H(t);
135
135
  return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
136
136
  }
137
- function Vt(t, e, a, n) {
137
+ function Et(t, e, a, n) {
138
138
  return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(a)}, ${Math.max(
139
139
  0,
140
140
  Math.min(1, Math.round(n * 100) / 100)
141
141
  )})`;
142
142
  }
143
- function Et(t) {
143
+ function Pt(t) {
144
144
  let e = t + 1831565813;
145
145
  return function() {
146
146
  return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
147
147
  };
148
148
  }
149
- function ht(t, e, a) {
149
+ function gt(t, e, a) {
150
150
  t = (t % 360 + 360) % 360;
151
151
  const n = (1 - Math.abs(2 * a - 1)) * e, r = n * (1 - Math.abs(t / 60 % 2 - 1)), s = a - n / 2;
152
152
  let o, c, i;
@@ -160,7 +160,7 @@ function Lt(t, e, a) {
160
160
  t = (t % 360 + 360) % 360;
161
161
  const n = e + a;
162
162
  n > 1 && (e /= n, a /= n);
163
- const [r, s, o] = ht(t, 1, 0.5).map((g) => g / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
163
+ const [r, s, o] = gt(t, 1, 0.5).map((h) => h / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
164
164
  return [Math.round(i * 255), Math.round(l * 255), Math.round(d * 255)];
165
165
  }
166
166
  function nt(t, e, a) {
@@ -195,14 +195,14 @@ function Z(t) {
195
195
  const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
196
196
  return Math.round(Math.max(0, Math.min(1, e)) * 255);
197
197
  }
198
- function Pt(t, e, a) {
199
- const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, g = i * i * i, m = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * g, h = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * g, b = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * g;
200
- return [Z(m), Z(h), Z(b)];
201
- }
202
198
  function Ut(t, e, a) {
203
- const n = J(t), r = J(e), s = J(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), g = Math.cbrt(i), m = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * g, h = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * g, b = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * g, M = Math.sqrt(h * h + b * b);
204
- let $ = Math.atan2(b, h) * 180 / Math.PI;
205
- return $ < 0 && ($ += 360), [m, M, $];
199
+ const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, h = i * i * i, y = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * h, f = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * h, g = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * h;
200
+ return [Z(y), Z(f), Z(g)];
201
+ }
202
+ function Wt(t, e, a) {
203
+ const n = J(t), r = J(e), s = J(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), h = Math.cbrt(i), y = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * h, f = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * h, g = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * h, M = Math.sqrt(f * f + g * g);
204
+ let k = Math.atan2(g, f) * 180 / Math.PI;
205
+ return k < 0 && (k += 360), [y, M, k];
206
206
  }
207
207
  function U(t, e, a, n, r, s) {
208
208
  switch (r) {
@@ -229,15 +229,15 @@ function U(t, e, a, n, r, s) {
229
229
  return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
230
230
  }
231
231
  case "oklch": {
232
- const [o, c, i] = Ut(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), g = (Math.round(i * 10) / 10).toFixed(1), m = Math.round(n * 100) / 100;
233
- return s || n < 1 ? `oklch(${l} ${d} ${g} / ${m})` : `oklch(${l} ${d} ${g})`;
232
+ const [o, c, i] = Wt(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 10) / 10).toFixed(1), y = Math.round(n * 100) / 100;
233
+ return s || n < 1 ? `oklch(${l} ${d} ${h} / ${y})` : `oklch(${l} ${d} ${h})`;
234
234
  }
235
235
  }
236
236
  }
237
237
  function W(t, e) {
238
238
  return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
239
239
  }
240
- async function Wt(t) {
240
+ async function zt(t) {
241
241
  return new Promise((e, a) => {
242
242
  const n = new FileReader();
243
243
  n.readAsDataURL(t), n.onload = () => {
@@ -247,9 +247,9 @@ async function Wt(t) {
247
247
  });
248
248
  }
249
249
  function Ht(t) {
250
- return Promise.all(t.map(Wt));
250
+ return Promise.all(t.map(zt));
251
251
  }
252
- function zt(t) {
252
+ function jt(t) {
253
253
  if (t.length >= 4) {
254
254
  if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
255
255
  return "image/png";
@@ -265,45 +265,45 @@ function zt(t) {
265
265
  }
266
266
  return "application/octet-stream";
267
267
  }
268
- function jt(t) {
269
- const e = $t(t ?? ""), a = e.length, n = new Uint8Array(a);
268
+ function Xt(t) {
269
+ const e = xt(t ?? ""), a = e.length, n = new Uint8Array(a);
270
270
  for (let r = 0; r < a; r++) n[r] = e.charCodeAt(r);
271
271
  return n;
272
272
  }
273
- function Xt(t) {
273
+ function Yt(t) {
274
274
  const {
275
275
  value: e,
276
276
  onChange: a,
277
277
  onInput: n,
278
278
  ...r
279
- } = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((g, m) => {
280
- const h = s.get(g), b = jt(g ?? ""), M = h?.type || zt(b), $ = h?.name ?? `file-${m}`, y = b.buffer.slice(
281
- b.byteOffset,
282
- b.byteOffset + b.byteLength
283
- ), F = new Blob([y], { type: M });
284
- return new File([F], $, { type: M });
285
- })), c = (d) => (g) => {
286
- d && Ht(g).then((m) => {
287
- for (const [h, b] of m.entries())
288
- s.set(b, { name: g[h].name, type: g[h].type });
289
- d(m);
279
+ } = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((h, y) => {
280
+ const f = s.get(h), g = Xt(h ?? ""), M = f?.type || jt(g), k = f?.name ?? `file-${y}`, w = g.buffer.slice(
281
+ g.byteOffset,
282
+ g.byteOffset + g.byteLength
283
+ ), F = new Blob([w], { type: M });
284
+ return new File([F], k, { type: M });
285
+ })), c = (d) => (h) => {
286
+ d && Ht(h).then((y) => {
287
+ for (const [f, g] of y.entries())
288
+ s.set(g, { name: h[f].name, type: h[f].type });
289
+ d(y);
290
290
  });
291
291
  }, i = c(a), l = c(n);
292
- return wt({
292
+ return yt({
293
293
  ...r,
294
294
  value: o,
295
295
  onChange: i,
296
296
  onInput: l
297
297
  });
298
298
  }
299
- function he(t) {
299
+ function ge(t) {
300
300
  const {
301
301
  value: e,
302
302
  onInput: a,
303
303
  onChange: n,
304
304
  ...r
305
305
  } = t;
306
- return Xt({
306
+ return Yt({
307
307
  ...r,
308
308
  maxFiles: 1,
309
309
  value: p.map(e, (s) => s == null ? [] : [s]),
@@ -315,21 +315,21 @@ function he(t) {
315
315
  }
316
316
  });
317
317
  }
318
- function Yt(t, e) {
319
- const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Et(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
320
- for (let h = 0; h < c; h++) {
321
- const b = h / c * Math.PI * 2, M = e * (1 + (o() * 2 - 1) * i), $ = Math.cos(b) * M, y = Math.sin(b) * M;
322
- l.push({ x: $, y });
318
+ function Gt(t, e) {
319
+ const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Pt(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
320
+ for (let f = 0; f < c; f++) {
321
+ const g = f / c * Math.PI * 2, M = e * (1 + (o() * 2 - 1) * i), k = Math.cos(g) * M, w = Math.sin(g) * M;
322
+ l.push({ x: k, y: w });
323
323
  }
324
- const d = (l[0].x + l[c - 1].x) / 2, g = (l[0].y + l[c - 1].y) / 2;
325
- let m = `M ${d.toFixed(3)} ${g.toFixed(3)}`;
326
- for (let h = 0; h < c; h++) {
327
- const b = l[h], M = l[(h + 1) % c], $ = (b.x + M.x) / 2, y = (b.y + M.y) / 2;
328
- m += ` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${$.toFixed(3)} ${y.toFixed(3)}`;
324
+ const d = (l[0].x + l[c - 1].x) / 2, h = (l[0].y + l[c - 1].y) / 2;
325
+ let y = `M ${d.toFixed(3)} ${h.toFixed(3)}`;
326
+ for (let f = 0; f < c; f++) {
327
+ const g = l[f], M = l[(f + 1) % c], k = (g.x + M.x) / 2, w = (g.y + M.y) / 2;
328
+ y += ` Q ${g.x.toFixed(3)} ${g.y.toFixed(3)} ${k.toFixed(3)} ${w.toFixed(3)}`;
329
329
  }
330
- return m += " Z", m;
330
+ return y += " Z", y;
331
331
  }
332
- const ge = (t) => {
332
+ const fe = (t) => {
333
333
  const {
334
334
  value: e,
335
335
  onBlur: a,
@@ -338,133 +338,139 @@ const ge = (t) => {
338
338
  displayValue: s,
339
339
  swatchSize: o,
340
340
  withAlpha: c
341
- } = t, i = p.map(o ?? 32, (f) => f), l = p.map(e, (f) => Dt(f ?? "#000000")), d = p.map(
342
- l,
343
- ([f, x, C]) => [f, x, C]
344
- ), g = p.map(l, ([, , , f]) => f), m = lt(p.get(g) ?? 1), h = p.map(c ?? !1, (f) => f), b = p.map(
345
- t.colorTextFormat ?? "rgb",
346
- (f) => f
347
- ), M = D(
341
+ } = t, i = {
342
+ xs: 20,
343
+ sm: 26,
344
+ md: 32,
345
+ lg: 40,
346
+ xl: 52
347
+ }, l = o != null ? p.map(o, (m) => Number(m)) : p.map(t.size ?? "md", (m) => i[m] ?? 32), d = p.map(e, (m) => Vt(m ?? "#000000")), h = p.map(
348
348
  d,
349
- m,
350
- b,
351
- h
349
+ ([m, $, C]) => [m, $, C]
350
+ ), y = p.map(d, ([, , , m]) => m), f = ut(p.get(y) ?? 1), g = p.map(c ?? !1, (m) => m), M = p.map(
351
+ t.colorTextFormat ?? "rgb",
352
+ (m) => m
353
+ ), k = D(
354
+ h,
355
+ f,
356
+ M,
357
+ g
352
358
  )(
353
- ([f, x, C], v, N, R) => U(f, x, C, v ?? 1, W(N, R), R)
354
- ), $ = p.map(
359
+ ([m, $, C], v, N, R) => U(m, $, C, v ?? 1, W(N, R), R)
360
+ ), w = p.map(
355
361
  t.colorTextFormat ?? "hex",
356
- (f) => f
357
- ), y = p.map(i, (f) => `${-f / 2} ${-f / 2} ${f} ${f}`), F = D(
358
- d,
359
- i
360
- )((f, x) => Yt(f, x / 2)), w = D(
361
- d,
362
- m,
363
- h
362
+ (m) => m
363
+ ), F = p.map(l, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), b = D(
364
+ h,
365
+ l
366
+ )((m, $) => Gt(m, $ / 2)), A = D(
367
+ h,
368
+ f,
369
+ g
364
370
  )(
365
- ([f, x, C], v, N) => N || v < 1 ? Vt(f, x, C, v) : et(f, x, C)
366
- ), A = _.div(
371
+ ([m, $, C], v, N) => N || v < 1 ? Et(m, $, C, v) : et(m, $, C)
372
+ ), T = x.div(
367
373
  u.class("bc-color-swatch-input__control"),
368
374
  u.class(
369
375
  p.map(
370
- h,
371
- (f) => f ? "bc-color-swatch-input__control--alpha" : ""
376
+ g,
377
+ (m) => m ? "bc-color-swatch-input__control--alpha" : ""
372
378
  )
373
379
  ),
374
380
  u.style(
375
- D(i)((f) => `min-width:${f + 2}px;height:${f + 2}px`)
381
+ D(l)((m) => `width:${m + 2}px;height:${m + 2}px`)
376
382
  ),
377
383
  // The SVG blob preview
378
- rt.svg(
384
+ ot.svg(
379
385
  u.class("bc-color-swatch-input__svg"),
380
- Q.viewBox(y),
381
- rt.path(Q.d(F), Q.fill(w))
386
+ Q.viewBox(F),
387
+ ot.path(Q.d(b), Q.fill(A))
382
388
  ),
383
389
  // Invisible native input overlays the blob for picker and accessibility
384
- _.input(
390
+ x.input(
385
391
  u.type("color"),
386
- O(t),
392
+ L(t),
387
393
  // Native color input needs hex without alpha
388
- u.value(p.map(d, ([f, x, C]) => et(f, x, C))),
394
+ u.value(p.map(h, ([m, $, C]) => et(m, $, C))),
389
395
  u.class(
390
396
  "bc-input bc-color-swatch-input bc-color-swatch-input__native"
391
397
  ),
392
398
  a != null ? I.blur(a) : S,
393
- n != null ? I.change((f) => {
394
- const x = f.target.value;
399
+ n != null ? I.change((m) => {
400
+ const $ = m.target.value;
395
401
  if (!n) return;
396
- const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
397
- p.get($),
398
- p.get(h)
399
- ), q = U(C, v, N, R, V, p.get(h));
402
+ const { r: C, g: v, b: N } = H($) ?? { r: 0, g: 0, b: 0 }, R = p.get(f) ?? 1, V = W(
403
+ p.get(w),
404
+ p.get(g)
405
+ ), q = U(C, v, N, R, V, p.get(g));
400
406
  n(q);
401
407
  }) : S,
402
- r != null ? I.input((f) => {
403
- const x = f.target.value;
408
+ r != null ? I.input((m) => {
409
+ const $ = m.target.value;
404
410
  if (!r) return;
405
- const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
406
- p.get($),
407
- p.get(h)
408
- ), q = U(C, v, N, R, V, p.get(h));
411
+ const { r: C, g: v, b: N } = H($) ?? { r: 0, g: 0, b: 0 }, R = p.get(f) ?? 1, V = W(
412
+ p.get(w),
413
+ p.get(g)
414
+ ), q = U(C, v, N, R, V, p.get(g));
409
415
  r(q);
410
416
  }) : S
411
417
  )
412
- ), T = H(
413
- h,
414
- () => _.input(
418
+ ), _ = z(
419
+ g,
420
+ () => x.input(
415
421
  u.type("range"),
416
422
  u.class("bc-color-swatch-input__alpha"),
417
423
  u.min(0),
418
424
  u.max(1),
419
425
  u.step(0.01),
420
- u.value(p.map(m, (f) => String(f ?? 1))),
426
+ u.value(p.map(f, (m) => String(m ?? 1))),
421
427
  u.disabled(t.disabled),
422
- I.input((f) => {
423
- const x = parseFloat(f.target.value);
424
- m.set(x);
425
- const [C, v, N] = p.get(d), R = W(
426
- p.get($),
427
- p.get(h)
428
- ), V = U(C, v, N, x, R, p.get(h));
428
+ I.input((m) => {
429
+ const $ = parseFloat(m.target.value);
430
+ f.set($);
431
+ const [C, v, N] = p.get(h), R = W(
432
+ p.get(w),
433
+ p.get(g)
434
+ ), V = U(C, v, N, $, R, p.get(g));
429
435
  r?.(V);
430
436
  }),
431
- I.change((f) => {
432
- const x = parseFloat(f.target.value);
433
- m.set(x);
434
- const [C, v, N] = p.get(d), R = W(
435
- p.get($),
436
- p.get(h)
437
- ), V = U(C, v, N, x, R, p.get(h));
437
+ I.change((m) => {
438
+ const $ = parseFloat(m.target.value);
439
+ f.set($);
440
+ const [C, v, N] = p.get(h), R = W(
441
+ p.get(w),
442
+ p.get(g)
443
+ ), V = U(C, v, N, $, R, p.get(g));
438
444
  n?.(V);
439
445
  })
440
446
  )
441
447
  ), {
442
- swatchSize: k,
443
- displayValue: Y,
444
- withAlpha: at,
445
- colorTextFormat: G,
446
- ...K
448
+ swatchSize: Y,
449
+ displayValue: at,
450
+ withAlpha: K,
451
+ colorTextFormat: rt,
452
+ ...G
447
453
  } = t;
448
- return L({
454
+ return P({
449
455
  baseContainer: !0,
450
- ...K,
456
+ ...G,
451
457
  // ensure our control does not try to grow
452
458
  growInput: !1,
453
- input: A,
459
+ input: T,
454
460
  // If caller provided an `after`, append RGB before it
455
461
  after: j(
456
- H(
462
+ z(
457
463
  s ?? !1,
458
- () => _.span(u.class("bc-color-swatch-input__rgb"), M)
464
+ () => x.span(u.class("bc-color-swatch-input__rgb"), k)
459
465
  ),
460
- T,
466
+ _,
461
467
  t.after
462
468
  )
463
469
  });
464
- }, Gt = (t) => typeof t == "string" && t.trim() === "" ? null : t, Kt = (t) => t ?? "";
465
- function P(t) {
470
+ }, Kt = (t) => typeof t == "string" && t.trim() === "" ? null : t, qt = (t) => t ?? "";
471
+ function O(t) {
466
472
  return (e) => {
467
- const { after: a, disabled: n } = e, r = pt(e, Kt, Gt), s = X(
473
+ const { after: a, disabled: n } = e, r = dt(e, qt, Kt), s = X(
468
474
  e.value,
469
475
  n,
470
476
  e.onChange ?? e.onInput
@@ -475,15 +481,15 @@ function P(t) {
475
481
  });
476
482
  };
477
483
  }
478
- const fe = ({
484
+ const me = ({
479
485
  startEditing: t,
480
486
  value: e,
481
487
  onChange: a,
482
488
  placeholder: n,
483
489
  disabled: r
484
490
  }) => {
485
- const s = p.deriveProp(t ?? !1), o = lt(!1), c = p.map(r ?? !1, (i) => i);
486
- return _.div(
491
+ const s = p.deriveProp(t ?? !1), o = ut(!1), c = p.map(r ?? !1, (i) => i);
492
+ return x.div(
487
493
  u.class("bc-editable-text"),
488
494
  u.class(
489
495
  p.map(
@@ -492,13 +498,13 @@ const fe = ({
492
498
  )
493
499
  ),
494
500
  B.disabled(c),
495
- H(
501
+ z(
496
502
  s,
497
- () => _.input(
503
+ () => x.input(
498
504
  u.placeholder(n),
499
505
  u.value(e),
500
506
  u.class("bc-editable-text__input"),
501
- Ft(),
507
+ Ct(),
502
508
  I.keydown((i) => {
503
509
  i.key === "Enter" ? s.set(!1) : i.key === "Escape" && (o.set(!0), s.set(!1));
504
510
  }),
@@ -512,25 +518,25 @@ const fe = ({
512
518
  })
513
519
  )
514
520
  ),
515
- () => _.span(
521
+ () => x.span(
516
522
  I.click(() => {
517
523
  p.get(c) || s.set(!0);
518
524
  }),
519
525
  u.class("bc-editable-text__display"),
520
- H(
526
+ z(
521
527
  p.map(e, (i) => i != null && i.trim() !== ""),
522
- () => _.span(u.class("bc-editable-text__text"), e),
523
- () => _.span(
528
+ () => x.span(u.class("bc-editable-text__text"), e),
529
+ () => x.span(
524
530
  u.class("bc-editable-text__placeholder"),
525
531
  n
526
532
  )
527
533
  ),
528
- H(
534
+ z(
529
535
  p.map(c, (i) => !i),
530
- () => _.button(
536
+ () => x.button(
531
537
  u.type("button"),
532
538
  u.class("bc-editable-text__edit-button"),
533
- gt(_t, (i) => B.label(i.$.editLabel)),
539
+ ft(kt, (i) => B.label(i.$.editLabel)),
534
540
  I.click(() => s.set(!0)),
535
541
  tt({ icon: "line-md/pencil", color: "neutral" })
536
542
  )
@@ -538,40 +544,40 @@ const fe = ({
538
544
  )
539
545
  )
540
546
  );
541
- }, me = (t) => {
547
+ }, be = (t) => {
542
548
  const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = X(e, o, n ?? r);
543
- return L({
549
+ return P({
544
550
  ...t,
545
- input: ut.date(
546
- O(t),
551
+ input: pt.date(
552
+ L(t),
547
553
  u.valueAsDate(e),
548
554
  u.class("bc-input"),
549
555
  a != null ? I.blur(st(a)) : S,
550
- n != null ? I.change(ot(n)) : S,
551
- r != null ? I.input(ot(r)) : S
556
+ n != null ? I.change(ct(n)) : S,
557
+ r != null ? I.input(ct(r)) : S
552
558
  ),
553
559
  after: s != null ? j(c, s) : c
554
560
  });
555
- }, qt = (t) => {
561
+ }, Qt = (t) => {
556
562
  const e = t.getFullYear(), a = t.getMonth() + 1, n = t.getDate(), r = t.getHours(), s = t.getMinutes(), o = t.getSeconds();
557
563
  return `${e}-${a.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${r.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
558
- }, be = (t) => {
559
- const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? qt(l) : null), i = X(e, o, n ?? r);
560
- return L({
564
+ }, we = (t) => {
565
+ const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? Qt(l) : null), i = X(e, o, n ?? r);
566
+ return P({
561
567
  ...t,
562
- input: ut["datetime-local"](
563
- O(t),
568
+ input: pt["datetime-local"](
569
+ L(t),
564
570
  u.value(p.map(c, (l) => l ?? null)),
565
571
  u.class("bc-input"),
566
572
  a != null ? I.blur(st(a)) : S,
567
- n != null ? I.change(ct(n)) : S,
568
- r != null ? I.input(ct(r)) : S
573
+ n != null ? I.change(it(n)) : S,
574
+ r != null ? I.input(it(r)) : S
569
575
  ),
570
576
  after: s != null ? j(i, s) : i
571
577
  });
572
- }, we = P(Ct), ye = P(xt), Me = P(Tt), Ie = P(
573
- yt
574
- ), $e = ({
578
+ }, ye = O(Tt), Me = O(_t), Ie = O(St), $e = O(
579
+ Mt
580
+ ), xe = ({
575
581
  value: t,
576
582
  onChange: e,
577
583
  onInput: a,
@@ -583,97 +589,97 @@ const fe = ({
583
589
  id: i,
584
590
  color: l = "primary",
585
591
  tabIndex: d = 0,
586
- matchInputHeight: g = !0
592
+ matchInputHeight: h = !0
587
593
  }) => {
588
- const m = i ?? St("switch");
589
- function h(y, F) {
590
- const w = [
594
+ const y = i ?? At("switch");
595
+ function f(w, F) {
596
+ const b = [
591
597
  "bc-switch",
592
598
  `bc-switch--size-${F}`,
593
599
  `bc-switch--${F}`
594
600
  ];
595
- return g && w.push("bc-switch--match-input"), y && w.push("bc-switch--disabled"), w.join(" ");
601
+ return h && b.push("bc-switch--match-input"), w && b.push("bc-switch--disabled"), b.join(" ");
596
602
  }
597
- function b(y) {
598
- const F = y ?? "primary", w = /* @__PURE__ */ new Map(), A = it(F, "solid", "light"), T = it(F, "solid", "dark");
599
- return w.set("--switch-track-on-bg", A.backgroundColor), w.set("--switch-track-on-label", A.textColor), w.set("--switch-track-on-bg-dark", T.backgroundColor), w.set("--switch-track-on-label-dark", T.textColor), w.set(
603
+ function g(w) {
604
+ const F = w ?? "primary", b = /* @__PURE__ */ new Map(), A = lt(F, "solid", "light"), T = lt(F, "solid", "dark");
605
+ return b.set("--switch-track-on-bg", A.backgroundColor), b.set("--switch-track-on-label", A.textColor), b.set("--switch-track-on-bg-dark", T.backgroundColor), b.set("--switch-track-on-label-dark", T.textColor), b.set(
600
606
  "--switch-track-on-border-dark",
601
- kt(F, "dark")
602
- ), Array.from(w.entries()).map(([k, Y]) => `${k}: ${Y}`).join("; ");
607
+ Ft(F, "dark")
608
+ ), Array.from(b.entries()).map(([_, Y]) => `${_}: ${Y}`).join("; ");
603
609
  }
604
610
  const M = () => {
605
611
  p.get(o) || (e?.(!p.get(t)), a?.(!p.get(t)));
606
- }, $ = (y) => {
607
- p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), M());
612
+ }, k = (w) => {
613
+ p.get(o) || (w.key === " " || w.key === "Enter") && (w.preventDefault(), M());
608
614
  };
609
- return _.div(
615
+ return x.div(
610
616
  u.class(
611
617
  D(
612
618
  o ?? !1,
613
619
  c
614
620
  )(
615
- (y, F) => h(y ?? !1, F ?? "md")
621
+ (w, F) => f(w ?? !1, F ?? "md")
616
622
  )
617
623
  ),
618
624
  u.style(
619
625
  D(l)(
620
- (y) => b(y)
626
+ (w) => g(w)
621
627
  )
622
628
  ),
623
- u.id(m),
629
+ u.id(y),
624
630
  u.role("switch"),
625
631
  u.tabindex(
626
632
  D(
627
633
  o ?? !1,
628
634
  d
629
- )((y, F) => y ? -1 : F ?? 0)
635
+ )((w, F) => w ? -1 : F ?? 0)
630
636
  ),
631
637
  B.checked(t),
632
638
  B.disabled(o),
633
639
  I.click(M),
634
- I.keydown($),
640
+ I.keydown(k),
635
641
  n != null ? I.blur(n) : null,
636
- _.div(
642
+ x.div(
637
643
  u.class("bc-switch__track"),
638
644
  u.class(
639
645
  p.map(
640
646
  t,
641
- (y) => y ? "bc-switch__track--on" : "bc-switch__track--off"
647
+ (w) => w ? "bc-switch__track--on" : "bc-switch__track--off"
642
648
  )
643
649
  ),
644
- r != null ? _.div(
650
+ r != null ? x.div(
645
651
  B.hidden(!0),
646
652
  u.class("bc-switch__track-label bc-switch__track-label--off"),
647
653
  u.class(
648
654
  p.map(
649
655
  t,
650
- (y) => y ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
656
+ (w) => w ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
651
657
  )
652
658
  ),
653
659
  r
654
660
  ) : null,
655
- s != null ? _.div(
661
+ s != null ? x.div(
656
662
  u.class("bc-switch__track-label bc-switch__track-label--on"),
657
663
  u.class(
658
664
  p.map(
659
665
  t,
660
- (y) => y ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
666
+ (w) => w ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
661
667
  )
662
668
  ),
663
669
  s
664
670
  ) : null,
665
- _.div(
671
+ x.div(
666
672
  u.class("bc-switch__thumb"),
667
673
  u.class(
668
674
  p.map(
669
675
  t,
670
- (y) => y ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
676
+ (w) => w ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
671
677
  )
672
678
  )
673
679
  )
674
680
  )
675
681
  );
676
- }, xe = P(Mt), Qt = "line-md:star-alt-filled", Jt = "line-md:star-alt", Zt = (t) => {
682
+ }, _e = O(It), Jt = "line-md:star-alt-filled", Zt = "line-md:star-alt", te = (t) => {
677
683
  const {
678
684
  value: e,
679
685
  onChange: a,
@@ -682,44 +688,50 @@ const fe = ({
682
688
  max: s = 5,
683
689
  fullColor: o = "yellow",
684
690
  emptyColor: c = "neutral",
685
- activeIcon: i = Qt,
686
- inactiveIcon: l = Jt,
691
+ activeIcon: i = Jt,
692
+ inactiveIcon: l = Zt,
687
693
  size: d = "md",
688
- onBlur: g,
689
- rounding: m = 1
690
- } = t, h = () => {
691
- const w = p.get(m);
692
- return w > 0 ? w : 1;
693
- }, b = (w) => Math.min(Math.max(w, 0), p.get(s)), M = (w, A) => {
694
+ onBlur: h,
695
+ rounding: y = 1
696
+ } = t, f = () => {
697
+ const b = p.get(y);
698
+ return b > 0 ? b : 1;
699
+ }, g = (b) => Math.min(Math.max(b, 0), p.get(s)), M = (b, A) => {
694
700
  if (p.get(r ?? !1)) return;
695
- const k = w.currentTarget.getBoundingClientRect(), Y = (w.clientX - k.left) / k.width, at = A - 1 + Y, G = h(), K = Math.ceil(at / G) * G, f = b(K);
696
- a?.(f), n?.(f);
697
- }, $ = (w) => {
701
+ const _ = b.currentTarget.getBoundingClientRect(), Y = (b.clientX - _.left) / _.width, at = A - 1 + Y, K = f(), rt = Math.ceil(at / K) * K, G = g(rt);
702
+ a?.(G), n?.(G);
703
+ }, k = (b) => {
698
704
  if (p.get(r ?? !1)) return;
699
- const A = h(), T = p.get(e) ?? 0;
700
- let k;
701
- switch (w.key) {
705
+ const A = f(), T = p.get(e) ?? 0;
706
+ let _;
707
+ switch (b.key) {
702
708
  case "ArrowRight":
703
709
  case "ArrowUp":
704
- k = b(T + A);
710
+ _ = g(T + A);
705
711
  break;
706
712
  case "ArrowLeft":
707
713
  case "ArrowDown":
708
- k = b(T - A);
714
+ _ = g(T - A);
709
715
  break;
710
716
  case "Home":
711
- k = 0;
717
+ _ = 0;
712
718
  break;
713
719
  case "End":
714
- k = p.get(s);
720
+ _ = p.get(s);
715
721
  break;
716
722
  default:
717
723
  return;
718
724
  }
719
- w.preventDefault(), a?.(k), n?.(k);
720
- }, y = p.map(d, (w) => `bc-icon--${w}`), F = ({ index: w, counter: A }) => _.span(
725
+ b.preventDefault(), a?.(_), n?.(_);
726
+ }, w = p.map(d, (b) => `bc-icon--${b}`), F = ({ index: b, counter: A }) => x.span(
721
727
  u.class("bc-rating-input__icon-container"),
722
- u.class(y),
728
+ u.class(w),
729
+ I.click(
730
+ bt((T) => M(T, A), {
731
+ preventDefault: !0,
732
+ stopPropagation: !0
733
+ })
734
+ ),
723
735
  tt(
724
736
  {
725
737
  icon: l,
@@ -729,13 +741,13 @@ const fe = ({
729
741
  },
730
742
  u.class("bc-rating-input__icon-empty")
731
743
  ),
732
- _.span(
744
+ x.span(
733
745
  u.class("bc-rating-input__icon-clipper"),
734
- u.class(y),
735
- mt.width(
746
+ u.class(w),
747
+ wt.width(
736
748
  p.map(e, (T) => {
737
- const k = Math.floor(T);
738
- return k > w ? "100%" : k < w ? "0%" : `${(T - w) * 100}%`;
749
+ const _ = Math.floor(T);
750
+ return _ > b ? "100%" : _ < b ? "0%" : `${(T - b) * 100}%`;
739
751
  })
740
752
  ),
741
753
  tt(
@@ -747,47 +759,41 @@ const fe = ({
747
759
  },
748
760
  u.class("bc-rating-input__icon-full")
749
761
  )
750
- ),
751
- I.click(
752
- bt((T) => M(T, A), {
753
- preventDefault: !0,
754
- stopPropagation: !0
755
- })
756
762
  )
757
763
  );
758
- return L({
764
+ return P({
759
765
  baseContainer: !0,
760
766
  growInput: !1,
761
767
  focusableSelector: '[role="slider"]',
762
768
  ...t,
763
- input: _.div(
769
+ input: x.div(
764
770
  // Common input attributes (id, required, invalid, custom classes, etc.)
765
- O(t),
771
+ L(t),
766
772
  u.class("bc-rating-input"),
767
773
  // ARIA slider semantics
768
774
  u.role("slider"),
769
- u.tabindex(p.map(r ?? !1, (w) => w ? -1 : 0)),
775
+ u.tabindex(p.map(r ?? !1, (b) => b ? -1 : 0)),
770
776
  B.disabled(r ?? !1),
771
777
  B.valuemin(0),
772
- B.valuemax(p.map(s, (w) => w ?? 0)),
773
- B.valuenow(p.map(e, (w) => w ?? 0)),
778
+ B.valuemax(p.map(s, (b) => b ?? 0)),
779
+ B.valuenow(p.map(e, (b) => b ?? 0)),
774
780
  B.valuetext(
775
781
  D(
776
782
  e,
777
783
  s
778
- )((w, A) => {
779
- const T = w ?? 0, k = A ?? 0;
780
- return `${String(T)} / ${String(k)}`;
784
+ )((b, A) => {
785
+ const T = b ?? 0, _ = A ?? 0;
786
+ return `${String(T)} / ${String(_)}`;
781
787
  })
782
788
  ),
783
789
  // Keyboard & focus handlers
784
- I.keydown($),
785
- g != null ? I.blur(g) : null,
786
- ft(s, F)
790
+ I.keydown(k),
791
+ h != null ? I.blur(h) : null,
792
+ mt(s, F)
787
793
  )
788
794
  });
789
- }, _e = (t) => {
790
- const { after: e, disabled: a } = t, n = pt(
795
+ }, ke = (t) => {
796
+ const { after: e, disabled: a } = t, n = dt(
791
797
  t,
792
798
  (s) => s ?? 0,
793
799
  (s) => s
@@ -796,19 +802,19 @@ const fe = ({
796
802
  a,
797
803
  t.onChange ?? t.onInput
798
804
  );
799
- return Zt({
805
+ return te({
800
806
  ...n,
801
807
  after: e != null ? j(r, e) : r
802
808
  });
803
- }, ke = (t) => {
809
+ }, Fe = (t) => {
804
810
  const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t;
805
- return L({
811
+ return P({
806
812
  ...t,
807
813
  // Make sure clicks anywhere focus the range input
808
814
  focusableSelector: 'input[type="range"]',
809
- input: _.input(
815
+ input: x.input(
810
816
  u.type("range"),
811
- O(t),
817
+ L(t),
812
818
  u.min(n),
813
819
  u.max(r),
814
820
  u.step(a),
@@ -820,23 +826,23 @@ const fe = ({
820
826
  c != null ? I.input(E(c)) : S
821
827
  )
822
828
  });
823
- }, Fe = (t) => {
829
+ }, Ce = (t) => {
824
830
  const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t, i = p.map(e, (d) => {
825
831
  if (d != null) return d;
826
- const g = n != null ? p.get(n) : void 0;
827
- return typeof g == "number" ? g : 0;
832
+ const h = n != null ? p.get(n) : void 0;
833
+ return typeof h == "number" ? h : 0;
828
834
  }), l = X(
829
835
  e,
830
836
  t.disabled,
831
837
  o ?? c
832
838
  );
833
- return L({
839
+ return P({
834
840
  ...t,
835
841
  focusableSelector: 'input[type="range"]',
836
842
  after: l,
837
- input: _.input(
843
+ input: x.input(
838
844
  u.type("range"),
839
- O(t),
845
+ L(t),
840
846
  u.min(n),
841
847
  u.max(r),
842
848
  u.step(a),
@@ -855,8 +861,8 @@ const fe = ({
855
861
  ) : S
856
862
  )
857
863
  });
858
- }, Ce = P(It);
859
- class te {
864
+ }, Te = O($t);
865
+ class ee {
860
866
  widgets = /* @__PURE__ */ new Map();
861
867
  typeMapping = /* @__PURE__ */ new Map();
862
868
  // JSON Schema type -> widget names
@@ -907,7 +913,7 @@ class te {
907
913
  * Find the best widget for a schema context
908
914
  */
909
915
  findBestWidget(e) {
910
- const a = At(e.definition, e.name);
916
+ const a = vt(e.definition, e.name);
911
917
  if (a?.widget) {
912
918
  const r = this.widgets.get(a.widget);
913
919
  if (r)
@@ -948,8 +954,8 @@ class te {
948
954
  return null;
949
955
  }
950
956
  }
951
- const Te = new te();
952
- function Se(t, e, a) {
957
+ const Se = new ee();
958
+ function Ae(t, e, a) {
953
959
  return {
954
960
  factory: e,
955
961
  matcher: (n) => {
@@ -962,7 +968,7 @@ function Se(t, e, a) {
962
968
  ...a
963
969
  };
964
970
  }
965
- function Ae(t, e, a) {
971
+ function ve(t, e, a) {
966
972
  return {
967
973
  factory: e,
968
974
  matcher: (n) => n.definition.format === t,
@@ -971,7 +977,7 @@ function Ae(t, e, a) {
971
977
  ...a
972
978
  };
973
979
  }
974
- function ve(t, e, a, n) {
980
+ function Ne(t, e, a, n) {
975
981
  return {
976
982
  factory: a,
977
983
  matcher: (r) => {
@@ -983,7 +989,7 @@ function ve(t, e, a, n) {
983
989
  ...n
984
990
  };
985
991
  }
986
- function Ne(t) {
992
+ function Re(t) {
987
993
  const e = t?.logPrefix ?? "WIDGET_DIAG", a = t?.filterFn ?? (() => !0);
988
994
  return {
989
995
  factory: () => null,
@@ -1007,51 +1013,51 @@ function Ne(t) {
1007
1013
  }
1008
1014
  export {
1009
1015
  Lt as A,
1010
- he as B,
1011
- ge as C,
1012
- Rt as D,
1013
- fe as E,
1014
- vt as F,
1015
- Nt as G,
1016
+ ge as B,
1017
+ fe as C,
1018
+ Bt as D,
1019
+ me as E,
1020
+ Nt as F,
1021
+ Rt as G,
1016
1022
  Z as H,
1017
- Et as I,
1018
- Pt as J,
1019
- Dt as K,
1023
+ Pt as I,
1024
+ Ut as J,
1025
+ Vt as K,
1020
1026
  W as L,
1021
1027
  et as M,
1022
- ye as N,
1028
+ Me as N,
1023
1029
  nt as O,
1024
1030
  Ot as P,
1025
- Ut as Q,
1026
- Zt as R,
1027
- ke as S,
1031
+ Wt as Q,
1032
+ te as R,
1033
+ Fe as S,
1028
1034
  J as T,
1029
- Vt as U,
1030
- te as W,
1031
- Ie as a,
1032
- xe as b,
1033
- Ce as c,
1034
- Me as d,
1035
- be as e,
1036
- me as f,
1037
- Te as g,
1038
- we as h,
1039
- Fe as i,
1040
- _e as j,
1041
- $e as k,
1042
- Ne as l,
1043
- Ae as m,
1044
- ve as n,
1045
- Se as o,
1046
- Gt as p,
1047
- Kt as q,
1048
- pe as r,
1049
- dt as s,
1050
- Bt as t,
1051
- Xt as u,
1052
- Wt as v,
1035
+ Et as U,
1036
+ ee as W,
1037
+ $e as a,
1038
+ _e as b,
1039
+ Te as c,
1040
+ Ie as d,
1041
+ we as e,
1042
+ be as f,
1043
+ Se as g,
1044
+ ye as h,
1045
+ Ce as i,
1046
+ ke as j,
1047
+ xe as k,
1048
+ Re as l,
1049
+ ve as m,
1050
+ Ne as n,
1051
+ Ae as o,
1052
+ Kt as p,
1053
+ qt as q,
1054
+ de as r,
1055
+ ht as s,
1056
+ Dt as t,
1057
+ Yt as u,
1058
+ zt as v,
1053
1059
  U as w,
1054
- de as x,
1055
- z as y,
1056
- ht as z
1060
+ he as x,
1061
+ H as y,
1062
+ gt as z
1057
1063
  };