@tempots/beatui 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/{2019-nWH_nAwT.cjs → 2019-BFDr925O.cjs} +1 -1
- package/dist/{2019-sCKLAY8c.js → 2019-DnG5Y5sm.js} +2 -2
- package/dist/{2020-B4xCW_nu.js → 2020-D0-tZTo7.js} +2 -2
- package/dist/{2020-D7RWX09D.cjs → 2020-gUs7l1CJ.cjs} +1 -1
- package/dist/{ar-D_4BfIJO.cjs → ar-BLgxAefV.cjs} +1 -1
- package/dist/{ar-i2uHmy8P.js → ar-DpQo8C31.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +4 -4
- package/dist/beatui.css +35 -22
- package/dist/beatui.tailwind.css +35 -22
- package/dist/{de-C0PZz9sE.cjs → de-Bv-qs--J.cjs} +1 -1
- package/dist/{de-CeLwmVZz.js → de-D1MQ4wen.js} +1 -1
- package/dist/{es-C8qT1ins.cjs → es-3r8Ko5Dn.cjs} +1 -1
- package/dist/{es-DxOgARww.js → es-DwPjonS7.js} +1 -1
- package/dist/{fa-BFV9MxMX.cjs → fa-Qw6uVZeX.cjs} +1 -1
- package/dist/{fa-B9pEff8A.js → fa-fxf_lWjh.js} +1 -1
- package/dist/{fr-Caeevx56.js → fr-BDDsMHRZ.js} +1 -1
- package/dist/{fr-BBx5IJ7G.cjs → fr-pVhG9qik.cjs} +1 -1
- package/dist/{he-DeN-WW3u.js → he-B4deK_wE.js} +1 -1
- package/dist/{he-CMOvd4Dr.cjs → he-D-fvzfe1.cjs} +1 -1
- package/dist/{hi-Dey2HxiD.js → hi-CxQT8nRD.js} +1 -1
- package/dist/{hi-IOU_PzvH.cjs → hi-DKgxHzmH.cjs} +1 -1
- package/dist/{index-HqWBd-jW.js → index-Acyxme63.js} +3 -3
- package/dist/{index-B0ff5lT-.cjs → index-BZ2AX5sk.cjs} +2 -2
- package/dist/{index-DJqo6Guq.js → index-BwEJlbG2.js} +1 -1
- package/dist/{index-BTZqW3-b.js → index-CWq36UAJ.js} +710 -710
- package/dist/{index-IQ3lRaL0.js → index-Clw0AwwJ.js} +1 -1
- package/dist/{index-C2VAPX2b.cjs → index-DRDJFYRb.cjs} +1 -1
- package/dist/{index-D8fg48Fv.cjs → index-Lj0QS2po.cjs} +1 -1
- package/dist/{index-Dtka01mK.cjs → index-nVVPqgLq.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +1862 -1865
- package/dist/{it-DghnQdZa.js → it-6QS5PWzQ.js} +1 -1
- package/dist/{it-uQF0jkDT.cjs → it-Ck0r9TO3.cjs} +1 -1
- package/dist/{ja-Kb7rxmFg.js → ja-D2VvVGEN.js} +1 -1
- package/dist/{ja-BJD6uPbl.cjs → ja-D6b9suYB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-53o5WJ-v.js → ko-CP_WopWz.js} +1 -1
- package/dist/{ko-B7bLdRnp.cjs → ko-CzvM2Bjv.cjs} +1 -1
- package/dist/{modal-BRUgTJG9.cjs → modal-BmSRMdY9.cjs} +1 -1
- package/dist/{modal-_2B8vIo0.js → modal-DMc-R2VT.js} +2 -2
- package/dist/{nl-DvUVT7xd.js → nl-DZ4dFolZ.js} +1 -1
- package/dist/{nl-CJE0fC8g.cjs → nl-_9vJc8JD.cjs} +1 -1
- package/dist/{notice-C4n5jXi6.js → notice-B5Yn_3Ay.js} +89 -89
- package/dist/{notice-CncwkUTy.cjs → notice-D3P0lewM.cjs} +2 -2
- package/dist/{pl-C3oYeTwf.js → pl-BE81iFSF.js} +1 -1
- package/dist/{pl-DUaY5slY.cjs → pl-DKcVCojx.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-BJGeScun.js → pt-BcCdXUA2.js} +1 -1
- package/dist/{pt-BAqNKCuy.cjs → pt-DNVS1_MF.cjs} +1 -1
- package/dist/{ru-2irv1YXp.js → ru-Bo_jc3s1.js} +1 -1
- package/dist/{ru-CAlgJm3K.cjs → ru-DTn9Rssv.cjs} +1 -1
- package/dist/{toolbar-CVDXVnje.js → toolbar-DhD5GmMa.js} +1 -1
- package/dist/{toolbar-B7HrL0vD.cjs → toolbar-jPGzdJGi.cjs} +1 -1
- package/dist/{tr-DMiXAhok.cjs → tr-BhTJYHQ3.cjs} +1 -1
- package/dist/{tr-CkHLE5u7.js → tr-CBw3FlOg.js} +1 -1
- package/dist/{translations-Q5C5LyIi.js → translations-B0HuWYIz.js} +1 -1
- package/dist/{translations-DRNj0YIi.cjs → translations-B7_3phoA.cjs} +1 -1
- package/dist/translations-C21osktO.cjs +1 -0
- package/dist/{translations-DEEflRUY.js → translations-D-fMB_IO.js} +195 -167
- package/dist/types/components/form/controller/color-controller.d.ts +1 -1
- package/dist/types/components/form/input/color-input.d.ts +2 -5
- package/dist/types/components/form/input/color-swatch-input.d.ts +9 -0
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +7 -0
- package/dist/types/utils/{color-validation.d.ts → color.d.ts} +13 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/{ur-BjiNs3SL.cjs → ur-BjuXyU8Z.cjs} +1 -1
- package/dist/{ur-bxBR_9Z-.js → ur-BsXnPgxd.js} +1 -1
- package/dist/utils-BOEQMy82.js +2512 -0
- package/dist/utils-DH-SYrQg.cjs +1 -0
- package/dist/{vi-CByOZvV2.cjs → vi-CvsTHMkK.cjs} +1 -1
- package/dist/{vi-CKknZqol.js → vi-D1rLo6MX.js} +1 -1
- package/dist/{zh-CmUgcP9o.js → zh-BoLsjdfz.js} +1 -1
- package/dist/{zh-C0QOebEA.cjs → zh-zh1FJ4Ud.cjs} +1 -1
- package/package.json +2 -2
- package/dist/translations-Dw1oO6Dh.cjs +0 -1
- package/dist/utils-BCbc19N0.js +0 -2427
- package/dist/utils-BJZipnfW.cjs +0 -1
package/dist/utils-BCbc19N0.js
DELETED
|
@@ -1,2427 +0,0 @@
|
|
|
1
|
-
import { Use as W, Value as u, prop as et, html as I, OnDispose as N, attr as a, on as C, WithElement as it, aria as z, bind as _t, computedOf as L, style as dt, When as E, NotEmpty as Gt, Fragment as B, ForEach as ft, svg as At, svgAttr as ht, Empty as T, emitValue as j, coalesce as Qt, Ensure as Jt, OneOfType as Kt, Repeat as Pt, signal as Ft, input as K, emitValueAsNullableDate as te, emitValueAsNullableDateTime as ee, emitValueAsNumber as G, emit as ne, Task as Bt } from "@tempots/dom";
|
|
2
|
-
import { f as se } from "./colors-WfmhQ5e1.js";
|
|
3
|
-
import { g as re } from "./timer-DzWb416P.js";
|
|
4
|
-
import { ElementRect as jt, AutoSelect as le } from "@tempots/ui";
|
|
5
|
-
import { a as X, b as P, f as ae, I as R, C as H, d as yt, T as oe, L as ce, c as Vt, e as ie, B as gt } from "./translations-DEEflRUY.js";
|
|
6
|
-
import { C as $t, m as ue, d as pe, I as Ht, E as de, P as fe, S as ct, s as me, e as bt, O as lt, f as Lt } from "./notice-C4n5jXi6.js";
|
|
7
|
-
class he extends Error {
|
|
8
|
-
constructor(e = "Missing implementation") {
|
|
9
|
-
super(e), this.name = "MissingImplementationError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const un = (t) => ge(t).split("_").join(" "), ge = (t) => (t = t.replace(/::/g, "/"), t = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), t = t.replace(/([a-z\d])([A-Z])/g, "$1_$2"), t = t.replace(/-/g, "_"), t.toLowerCase()), pn = (t) => t.substring(0, 1).toUpperCase() + t.substring(1), be = (t) => {
|
|
13
|
-
if (typeof Buffer < "u")
|
|
14
|
-
return Buffer.from(t, "base64").toString("utf8");
|
|
15
|
-
if (typeof atob < "u")
|
|
16
|
-
return atob(t);
|
|
17
|
-
throw new he(
|
|
18
|
-
"No implementation found for base64 decoding"
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
function Et({
|
|
22
|
-
onChange: t,
|
|
23
|
-
value: e,
|
|
24
|
-
accept: r = "*/*",
|
|
25
|
-
enableClick: n = !0,
|
|
26
|
-
content: s,
|
|
27
|
-
disabled: c = !1,
|
|
28
|
-
allowMultiple: l
|
|
29
|
-
}) {
|
|
30
|
-
return W(X, (i) => {
|
|
31
|
-
const o = u.deriveProp(e ?? []), p = et(!1), m = (g) => {
|
|
32
|
-
g.preventDefault(), g.stopPropagation(), p.value = !0;
|
|
33
|
-
}, f = (g) => {
|
|
34
|
-
g.preventDefault(), g.stopPropagation(), (!g.currentTarget || !g.currentTarget.contains(g.relatedTarget)) && (p.value = !1);
|
|
35
|
-
}, v = (g) => {
|
|
36
|
-
g.preventDefault(), g.stopPropagation(), p.value = !1;
|
|
37
|
-
const b = Array.from(g.dataTransfer?.files || []);
|
|
38
|
-
b.length > 0 && (o.value = b, t(b));
|
|
39
|
-
}, d = (g) => {
|
|
40
|
-
u.get(n) && g.currentTarget.querySelector(
|
|
41
|
-
'input[type="file"]'
|
|
42
|
-
)?.click();
|
|
43
|
-
};
|
|
44
|
-
let x = null;
|
|
45
|
-
const h = () => {
|
|
46
|
-
if (x == null) return;
|
|
47
|
-
const g = Array.from(x.files ?? []);
|
|
48
|
-
g.length > 0 && (o.value = g, t(g)), x.value = "";
|
|
49
|
-
}, y = (g) => {
|
|
50
|
-
u.get(n) && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), d(g));
|
|
51
|
-
};
|
|
52
|
-
return I.div(
|
|
53
|
-
N(() => u.dispose(o), p),
|
|
54
|
-
a.role("button"),
|
|
55
|
-
a.tabindex(
|
|
56
|
-
u.map(n, (g) => g ? 0 : -1)
|
|
57
|
-
),
|
|
58
|
-
a.style("position: relative;"),
|
|
59
|
-
C.dragover(m),
|
|
60
|
-
C.dragleave(f),
|
|
61
|
-
C.drop(v),
|
|
62
|
-
C.click(d),
|
|
63
|
-
C.keydown(y),
|
|
64
|
-
// Hidden file input
|
|
65
|
-
I.input(
|
|
66
|
-
a.type("file"),
|
|
67
|
-
a.disabled(c),
|
|
68
|
-
a.accept(r),
|
|
69
|
-
a.multiple(l),
|
|
70
|
-
a.style(
|
|
71
|
-
"position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
|
|
72
|
-
),
|
|
73
|
-
C.change(h),
|
|
74
|
-
it((g) => (x = g, N(
|
|
75
|
-
o.on((b) => {
|
|
76
|
-
const D = globalThis.DataTransfer;
|
|
77
|
-
if (D != null) {
|
|
78
|
-
const k = new D();
|
|
79
|
-
b.forEach((_) => k.items.add(_)), g.files = k.files;
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
)))
|
|
83
|
-
),
|
|
84
|
-
// Screen reader instructions
|
|
85
|
-
z.label(_t(i.$.dropZoneInstructions)(n)),
|
|
86
|
-
// Content
|
|
87
|
-
s({ files: o, clear: () => o.value = [], change: o.set })
|
|
88
|
-
);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function ve(t, e) {
|
|
92
|
-
return t.length === e.length && t.every((r, n) => r === e[n]);
|
|
93
|
-
}
|
|
94
|
-
function xe(t, e) {
|
|
95
|
-
const r = ["bc-segmented-control", `bc-segmented-control--size-${t}`];
|
|
96
|
-
return e && r.push("bc-segmented-control--disabled"), r.join(" ");
|
|
97
|
-
}
|
|
98
|
-
function dn({
|
|
99
|
-
options: t,
|
|
100
|
-
value: e,
|
|
101
|
-
onChange: r,
|
|
102
|
-
size: n = "md",
|
|
103
|
-
disabled: s = !1
|
|
104
|
-
}, ...c) {
|
|
105
|
-
const l = se(t).map(([i, o]) => ({
|
|
106
|
-
key: i,
|
|
107
|
-
label: o
|
|
108
|
-
}));
|
|
109
|
-
return it(() => {
|
|
110
|
-
const i = Object.fromEntries(
|
|
111
|
-
l.map((p, m) => [p.key, m])
|
|
112
|
-
), o = et(
|
|
113
|
-
l.map(() => ({ left: 0, width: 0 })),
|
|
114
|
-
ve
|
|
115
|
-
);
|
|
116
|
-
return I.div(
|
|
117
|
-
N(o),
|
|
118
|
-
a.class(
|
|
119
|
-
L(
|
|
120
|
-
n,
|
|
121
|
-
s
|
|
122
|
-
)(
|
|
123
|
-
(p, m) => xe(p ?? "md", m ?? !1)
|
|
124
|
-
)
|
|
125
|
-
),
|
|
126
|
-
I.div(
|
|
127
|
-
a.class("bc-segmented-control__container"),
|
|
128
|
-
I.div(
|
|
129
|
-
a.class("bc-segmented-control__indicator"),
|
|
130
|
-
dt.width(
|
|
131
|
-
L(
|
|
132
|
-
e,
|
|
133
|
-
o
|
|
134
|
-
)((p, m) => {
|
|
135
|
-
const { width: f } = m[i[p] ?? 0];
|
|
136
|
-
return `${f}px`;
|
|
137
|
-
})
|
|
138
|
-
),
|
|
139
|
-
dt.left(
|
|
140
|
-
L(
|
|
141
|
-
e,
|
|
142
|
-
o
|
|
143
|
-
)((p, m) => {
|
|
144
|
-
const { left: f } = m[i[p] ?? 0];
|
|
145
|
-
return `${f}px`;
|
|
146
|
-
})
|
|
147
|
-
)
|
|
148
|
-
),
|
|
149
|
-
// clickable buttons
|
|
150
|
-
l.map(({ label: p, key: m }, f) => I.button(
|
|
151
|
-
a.type("button"),
|
|
152
|
-
C.click((v) => {
|
|
153
|
-
v.preventDefault(), u.get(s) || r?.(m);
|
|
154
|
-
}),
|
|
155
|
-
a.disabled(s),
|
|
156
|
-
a.class("bc-segmented-control__segment"),
|
|
157
|
-
a.class(
|
|
158
|
-
u.map(e, (v) => v === m ? "bc-segmented-control__segment--active" : "bc-segmented-control__segment--inactive")
|
|
159
|
-
),
|
|
160
|
-
jt((v) => {
|
|
161
|
-
function d() {
|
|
162
|
-
o.update((h) => {
|
|
163
|
-
const y = [...h];
|
|
164
|
-
return y[f] = {
|
|
165
|
-
width: v.value.width,
|
|
166
|
-
left: v.value.localLeft
|
|
167
|
-
}, y;
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
const x = re(d);
|
|
171
|
-
return N(x, v.on(d));
|
|
172
|
-
}),
|
|
173
|
-
p
|
|
174
|
-
))
|
|
175
|
-
),
|
|
176
|
-
...c
|
|
177
|
-
);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function we(t) {
|
|
181
|
-
const e = t.type.toLowerCase();
|
|
182
|
-
return e.startsWith("image/") && (e.includes("jpeg") || e.includes("jpg") || e.includes("png") || e.includes("gif") || e.includes("webp") || e.includes("svg"));
|
|
183
|
-
}
|
|
184
|
-
function _e(t) {
|
|
185
|
-
const e = t.type.toLowerCase();
|
|
186
|
-
return e.startsWith("image/") ? "vscode-icons:file-type-image" : e.startsWith("video/") ? "vscode-icons:file-type-video" : e.startsWith("audio/") ? "vscode-icons:file-type-audio" : e.includes("pdf") ? "vscode-icons:file-type-pdf2" : e.includes("word") || e.includes("document") ? "vscode-icons:file-type-word" : e.includes("excel") || e.includes("spreadsheet") ? "vscode-icons:file-type-excel" : e.includes("powerpoint") || e.includes("presentation") ? "vscode-icons:file-type-powerpoint" : e.includes("zip") || e.includes("archive") ? "vscode-icons:file-type-zip" : e.includes("text") ? "vscode-icons:file-type-text" : e.includes("json") ? "vscode-icons:file-type-json-official" : e.includes("csv") ? "vscode-icons:file-type-csv" : e.includes("xml") ? "vscode-icons:file-type-xml" : e.includes("yaml") ? "vscode-icons:file-type-yaml-official" : "vscode-icons:file-type-binary";
|
|
187
|
-
}
|
|
188
|
-
function Ut(t) {
|
|
189
|
-
return E(
|
|
190
|
-
t.map(we),
|
|
191
|
-
() => {
|
|
192
|
-
const e = et(null);
|
|
193
|
-
return t.on((r) => {
|
|
194
|
-
e.value && URL.revokeObjectURL(e.value);
|
|
195
|
-
const n = URL.createObjectURL(r);
|
|
196
|
-
e.value = n;
|
|
197
|
-
}), I.div(
|
|
198
|
-
N(e, () => {
|
|
199
|
-
e.value && URL.revokeObjectURL(e.value);
|
|
200
|
-
}),
|
|
201
|
-
a.class("bc-file-input__thumbnail-container"),
|
|
202
|
-
I.img(
|
|
203
|
-
a.src(e),
|
|
204
|
-
a.alt(t.map((r) => r.name)),
|
|
205
|
-
a.class("bc-file-input__thumbnail")
|
|
206
|
-
)
|
|
207
|
-
);
|
|
208
|
-
},
|
|
209
|
-
() => R({ icon: t.map(_e) })
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
const ye = (t, ...e) => {
|
|
213
|
-
const {
|
|
214
|
-
value: r = et([]),
|
|
215
|
-
accept: n = "*/*",
|
|
216
|
-
maxFiles: s,
|
|
217
|
-
maxFileSize: c,
|
|
218
|
-
onChange: l,
|
|
219
|
-
onBlur: i,
|
|
220
|
-
disabled: o,
|
|
221
|
-
hasError: p,
|
|
222
|
-
mode: m = "default",
|
|
223
|
-
showFileList: f = !0,
|
|
224
|
-
...v
|
|
225
|
-
} = t, d = r, x = u.map(m, (k) => k === "compact"), h = (k) => {
|
|
226
|
-
let _ = k;
|
|
227
|
-
if (s != null) {
|
|
228
|
-
const w = u.get(s);
|
|
229
|
-
_ = _.slice(0, w);
|
|
230
|
-
}
|
|
231
|
-
if (c) {
|
|
232
|
-
const w = u.get(c);
|
|
233
|
-
_ = _.filter(($) => $.size <= w);
|
|
234
|
-
}
|
|
235
|
-
l?.(_);
|
|
236
|
-
}, y = (k) => {
|
|
237
|
-
const w = d.value.filter(($, M) => M !== k);
|
|
238
|
-
l?.(w);
|
|
239
|
-
}, g = () => {
|
|
240
|
-
l?.([]);
|
|
241
|
-
}, b = ({
|
|
242
|
-
files: k,
|
|
243
|
-
clear: _,
|
|
244
|
-
change: w
|
|
245
|
-
}) => W(
|
|
246
|
-
X,
|
|
247
|
-
($) => I.div(
|
|
248
|
-
a.class("bc-file-input__drop-zone"),
|
|
249
|
-
I.div(
|
|
250
|
-
a.class(
|
|
251
|
-
"bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"
|
|
252
|
-
),
|
|
253
|
-
R({ icon: "mdi:cloud-upload-outline", size: "xl" }),
|
|
254
|
-
I.div(
|
|
255
|
-
a.class("bc-file-input__drop-zone-text"),
|
|
256
|
-
_t($.$.filesInputInstructions)(
|
|
257
|
-
s,
|
|
258
|
-
c,
|
|
259
|
-
$.$.fileSizeUnits.value
|
|
260
|
-
)
|
|
261
|
-
)
|
|
262
|
-
)
|
|
263
|
-
)
|
|
264
|
-
), D = ({
|
|
265
|
-
files: k
|
|
266
|
-
}) => W(
|
|
267
|
-
X,
|
|
268
|
-
(_) => I.div(
|
|
269
|
-
a.class("bc-file-input__compact-input"),
|
|
270
|
-
E(
|
|
271
|
-
k.map((w) => w.length > 0),
|
|
272
|
-
() => I.span(
|
|
273
|
-
a.class("bc-file-input__compact-value"),
|
|
274
|
-
ft(
|
|
275
|
-
k,
|
|
276
|
-
(w) => I.span(
|
|
277
|
-
a.class("bc-file-input__compact-value-item"),
|
|
278
|
-
Ut(w),
|
|
279
|
-
I.span(
|
|
280
|
-
a.class("bc-file-input__compact-value-item-name"),
|
|
281
|
-
w.$.name
|
|
282
|
-
)
|
|
283
|
-
)
|
|
284
|
-
)
|
|
285
|
-
),
|
|
286
|
-
() => I.span(
|
|
287
|
-
a.class("bc-file-input__compact-placeholder"),
|
|
288
|
-
R({ icon: "mdi:cloud-upload-outline", size: "sm" }),
|
|
289
|
-
" ",
|
|
290
|
-
_t(_.$.filesInputInstructions)(
|
|
291
|
-
s,
|
|
292
|
-
c,
|
|
293
|
-
_.$.fileSizeUnits.value
|
|
294
|
-
)
|
|
295
|
-
)
|
|
296
|
-
)
|
|
297
|
-
)
|
|
298
|
-
);
|
|
299
|
-
return W(
|
|
300
|
-
X,
|
|
301
|
-
(k) => P(
|
|
302
|
-
{
|
|
303
|
-
baseContainer: u.map(x, (_) => !_),
|
|
304
|
-
disabled: o,
|
|
305
|
-
hasError: p,
|
|
306
|
-
after: E(
|
|
307
|
-
x,
|
|
308
|
-
() => E(
|
|
309
|
-
d.map(({ length: _ }) => _ > 0),
|
|
310
|
-
() => $t(
|
|
311
|
-
{
|
|
312
|
-
size: "sm",
|
|
313
|
-
label: k.$.clearAllFiles,
|
|
314
|
-
disabled: o,
|
|
315
|
-
onClick: g
|
|
316
|
-
},
|
|
317
|
-
a.class("bc-file-input__compact-clear")
|
|
318
|
-
)
|
|
319
|
-
)
|
|
320
|
-
),
|
|
321
|
-
...v,
|
|
322
|
-
input: E(
|
|
323
|
-
x,
|
|
324
|
-
() => I.div(
|
|
325
|
-
a.class("bc-file-input bc-file-input--compact"),
|
|
326
|
-
Et({
|
|
327
|
-
value: d,
|
|
328
|
-
accept: n,
|
|
329
|
-
enableClick: !0,
|
|
330
|
-
allowMultiple: u.map(s ?? 1 / 0, (_) => _ > 1),
|
|
331
|
-
disabled: o,
|
|
332
|
-
onChange: h,
|
|
333
|
-
content: D
|
|
334
|
-
})
|
|
335
|
-
),
|
|
336
|
-
() => I.div(
|
|
337
|
-
a.class("bc-file-input"),
|
|
338
|
-
Et({
|
|
339
|
-
value: d,
|
|
340
|
-
accept: n,
|
|
341
|
-
enableClick: !0,
|
|
342
|
-
allowMultiple: u.map(s ?? 1 / 0, (_) => _ > 1),
|
|
343
|
-
disabled: o,
|
|
344
|
-
onChange: h,
|
|
345
|
-
content: b
|
|
346
|
-
}),
|
|
347
|
-
E(
|
|
348
|
-
f,
|
|
349
|
-
() => Gt(
|
|
350
|
-
d,
|
|
351
|
-
() => B(
|
|
352
|
-
I.div(
|
|
353
|
-
a.class("bc-file-input__file-list"),
|
|
354
|
-
ft(d, (_, w) => {
|
|
355
|
-
const $ = w.index;
|
|
356
|
-
return I.div(
|
|
357
|
-
a.class("bc-file-input__file-item"),
|
|
358
|
-
I.div(
|
|
359
|
-
a.class("bc-file-input__file-icon"),
|
|
360
|
-
Ut(_)
|
|
361
|
-
),
|
|
362
|
-
I.div(
|
|
363
|
-
a.class("bc-file-input__file-info"),
|
|
364
|
-
I.div(
|
|
365
|
-
a.class("bc-file-input__file-name"),
|
|
366
|
-
a.title(_.$.name),
|
|
367
|
-
_.$.name
|
|
368
|
-
),
|
|
369
|
-
I.div(
|
|
370
|
-
a.class("bc-file-input__file-meta"),
|
|
371
|
-
L(
|
|
372
|
-
_.$.size,
|
|
373
|
-
k.$.fileSizeUnits
|
|
374
|
-
)(
|
|
375
|
-
(M, A) => ae(M, { units: A })
|
|
376
|
-
),
|
|
377
|
-
" • ",
|
|
378
|
-
L(
|
|
379
|
-
_.$.type,
|
|
380
|
-
k.$.unknownType
|
|
381
|
-
)((M, A) => M || A)
|
|
382
|
-
)
|
|
383
|
-
),
|
|
384
|
-
$t(
|
|
385
|
-
{
|
|
386
|
-
size: "sm",
|
|
387
|
-
label: k.$.removeFile,
|
|
388
|
-
disabled: o,
|
|
389
|
-
onClick: () => y($)
|
|
390
|
-
},
|
|
391
|
-
a.class("bc-file-input__remove-button")
|
|
392
|
-
)
|
|
393
|
-
);
|
|
394
|
-
})
|
|
395
|
-
),
|
|
396
|
-
E(
|
|
397
|
-
d.map(({ length: _ }) => _ > 1),
|
|
398
|
-
() => I.div(
|
|
399
|
-
a.class(
|
|
400
|
-
"bc-file-input__clear-all-button-container"
|
|
401
|
-
),
|
|
402
|
-
I.button(
|
|
403
|
-
a.type("button"),
|
|
404
|
-
a.class("bc-file-input__clear-all-button"),
|
|
405
|
-
a.disabled(o),
|
|
406
|
-
k.$.clearAllFiles,
|
|
407
|
-
C.click((_) => {
|
|
408
|
-
_.preventDefault(), _.stopPropagation(), g();
|
|
409
|
-
})
|
|
410
|
-
)
|
|
411
|
-
)
|
|
412
|
-
)
|
|
413
|
-
)
|
|
414
|
-
)
|
|
415
|
-
)
|
|
416
|
-
)
|
|
417
|
-
)
|
|
418
|
-
},
|
|
419
|
-
...e
|
|
420
|
-
)
|
|
421
|
-
);
|
|
422
|
-
};
|
|
423
|
-
async function $e(t) {
|
|
424
|
-
return new Promise((e, r) => {
|
|
425
|
-
const n = new FileReader();
|
|
426
|
-
n.readAsDataURL(t), n.onload = () => {
|
|
427
|
-
const s = n.result;
|
|
428
|
-
e(s.split(",")[1]);
|
|
429
|
-
}, n.onerror = (s) => r(s);
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
function ke(t) {
|
|
433
|
-
return Promise.all(t.map($e));
|
|
434
|
-
}
|
|
435
|
-
function Ie(t) {
|
|
436
|
-
if (t.length >= 4) {
|
|
437
|
-
if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
|
|
438
|
-
return "image/png";
|
|
439
|
-
if (t[0] === 255 && t[1] === 216) return "image/jpeg";
|
|
440
|
-
if (t[0] === 71 && t[1] === 73 && t[2] === 70)
|
|
441
|
-
return "image/gif";
|
|
442
|
-
if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t.length >= 12 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
|
|
443
|
-
return "image/webp";
|
|
444
|
-
}
|
|
445
|
-
try {
|
|
446
|
-
if (new TextDecoder("utf-8").decode(t.slice(0, 256)).includes("<svg")) return "image/svg+xml";
|
|
447
|
-
} catch {
|
|
448
|
-
}
|
|
449
|
-
return "application/octet-stream";
|
|
450
|
-
}
|
|
451
|
-
function Ce(t) {
|
|
452
|
-
const e = be(t ?? ""), r = e.length, n = new Uint8Array(r);
|
|
453
|
-
for (let s = 0; s < r; s++) n[s] = e.charCodeAt(s);
|
|
454
|
-
return n;
|
|
455
|
-
}
|
|
456
|
-
function Me(t) {
|
|
457
|
-
const {
|
|
458
|
-
value: e,
|
|
459
|
-
onChange: r,
|
|
460
|
-
onInput: n,
|
|
461
|
-
...s
|
|
462
|
-
} = t, c = /* @__PURE__ */ new Map(), l = u.toSignal(e).map((m) => m.map((f, v) => {
|
|
463
|
-
const d = c.get(f), x = Ce(f ?? ""), h = d?.type || Ie(x), y = d?.name ?? `file-${v}`, g = x.buffer.slice(
|
|
464
|
-
x.byteOffset,
|
|
465
|
-
x.byteOffset + x.byteLength
|
|
466
|
-
), b = new Blob([g], { type: h });
|
|
467
|
-
return new File([b], y, { type: h });
|
|
468
|
-
})), i = (m) => (f) => {
|
|
469
|
-
m && ke(f).then((v) => {
|
|
470
|
-
for (const [d, x] of v.entries())
|
|
471
|
-
c.set(x, { name: f[d].name, type: f[d].type });
|
|
472
|
-
m(v);
|
|
473
|
-
});
|
|
474
|
-
}, o = i(r), p = i(n);
|
|
475
|
-
return ye({
|
|
476
|
-
...s,
|
|
477
|
-
value: l,
|
|
478
|
-
onChange: o,
|
|
479
|
-
onInput: p
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
function fn(t) {
|
|
483
|
-
const {
|
|
484
|
-
value: e,
|
|
485
|
-
onInput: r,
|
|
486
|
-
onChange: n,
|
|
487
|
-
...s
|
|
488
|
-
} = t;
|
|
489
|
-
return Me({
|
|
490
|
-
...s,
|
|
491
|
-
maxFiles: 1,
|
|
492
|
-
value: u.map(e, (c) => c == null ? [] : [c]),
|
|
493
|
-
onChange: (c) => {
|
|
494
|
-
n?.(c[0]);
|
|
495
|
-
},
|
|
496
|
-
onInput: (c) => {
|
|
497
|
-
r?.(c[0]);
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
function kt(t) {
|
|
502
|
-
const e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
503
|
-
return e ? [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] : [0, 0, 0];
|
|
504
|
-
}
|
|
505
|
-
function It(t, e, r) {
|
|
506
|
-
const n = (s) => s.toString(16).padStart(2, "0");
|
|
507
|
-
return `#${n(Math.max(0, Math.min(255, t)))}${n(
|
|
508
|
-
Math.max(0, Math.min(255, e))
|
|
509
|
-
)}${n(Math.max(0, Math.min(255, r)))}`;
|
|
510
|
-
}
|
|
511
|
-
function De(t) {
|
|
512
|
-
if (!t) return [0, 0, 0, 1];
|
|
513
|
-
const r = t.trim().match(
|
|
514
|
-
/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
|
|
515
|
-
);
|
|
516
|
-
if (r) {
|
|
517
|
-
const f = r[1];
|
|
518
|
-
if (f.length === 8) {
|
|
519
|
-
const v = parseInt(f.slice(0, 2), 16), d = parseInt(f.slice(2, 4), 16), x = parseInt(f.slice(4, 6), 16), h = parseInt(f.slice(6, 8), 16) / 255;
|
|
520
|
-
return [v, d, x, h];
|
|
521
|
-
}
|
|
522
|
-
if (f.length === 6)
|
|
523
|
-
return [
|
|
524
|
-
parseInt(f.slice(0, 2), 16),
|
|
525
|
-
parseInt(f.slice(2, 4), 16),
|
|
526
|
-
parseInt(f.slice(4, 6), 16),
|
|
527
|
-
1
|
|
528
|
-
];
|
|
529
|
-
if (f.length === 4) {
|
|
530
|
-
const v = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), x = parseInt(f[2] + f[2], 16), h = parseInt(f[3] + f[3], 16) / 255;
|
|
531
|
-
return [v, d, x, h];
|
|
532
|
-
}
|
|
533
|
-
if (f.length === 3) {
|
|
534
|
-
const v = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), x = parseInt(f[2] + f[2], 16);
|
|
535
|
-
return [v, d, x, 1];
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
const n = t.match(
|
|
539
|
-
/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i
|
|
540
|
-
);
|
|
541
|
-
if (n)
|
|
542
|
-
return [
|
|
543
|
-
parseInt(n[1], 10),
|
|
544
|
-
parseInt(n[2], 10),
|
|
545
|
-
parseInt(n[3], 10),
|
|
546
|
-
parseFloat(n[4])
|
|
547
|
-
];
|
|
548
|
-
const s = t.match(
|
|
549
|
-
/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i
|
|
550
|
-
);
|
|
551
|
-
if (s)
|
|
552
|
-
return [parseInt(s[1], 10), parseInt(s[2], 10), parseInt(s[3], 10), 1];
|
|
553
|
-
const c = t.match(
|
|
554
|
-
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
555
|
-
);
|
|
556
|
-
if (c) {
|
|
557
|
-
const f = parseFloat(c[1]), v = parseFloat(c[2]), d = parseFloat(c[3]), x = c[4] != null ? parseFloat(c[4]) : 1, [h, y, g] = Wt(f, v / 100, d / 100);
|
|
558
|
-
return [h, y, g, x];
|
|
559
|
-
}
|
|
560
|
-
const l = t.match(
|
|
561
|
-
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
562
|
-
);
|
|
563
|
-
if (l) {
|
|
564
|
-
const f = parseFloat(l[1]), v = parseFloat(l[2]) / 100, d = parseFloat(l[3]) / 100, x = l[4] != null ? parseFloat(l[4]) : 1, [h, y, g] = Ae(f, v, d);
|
|
565
|
-
return [h, y, g, x];
|
|
566
|
-
}
|
|
567
|
-
const i = t.match(
|
|
568
|
-
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
569
|
-
);
|
|
570
|
-
if (i) {
|
|
571
|
-
const f = i[1], v = parseFloat(i[2]), d = parseFloat(i[3]), x = i[4] != null ? parseFloat(i[4]) : 1, h = f.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(f) / 100)) : Math.max(0, Math.min(1, parseFloat(f))), [y, g, b] = Be(h, v, d);
|
|
572
|
-
return [y, g, b, x];
|
|
573
|
-
}
|
|
574
|
-
const [o, p, m] = kt(t);
|
|
575
|
-
return [o, p, m, 1];
|
|
576
|
-
}
|
|
577
|
-
const Se = (t, e, r, n) => `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(r)}, ${Math.max(
|
|
578
|
-
0,
|
|
579
|
-
Math.min(1, Math.round(n * 100) / 100)
|
|
580
|
-
)})`;
|
|
581
|
-
function Te(t) {
|
|
582
|
-
let e = t + 1831565813;
|
|
583
|
-
return function() {
|
|
584
|
-
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
function Wt(t, e, r) {
|
|
588
|
-
t = (t % 360 + 360) % 360;
|
|
589
|
-
const n = (1 - Math.abs(2 * r - 1)) * e, s = n * (1 - Math.abs(t / 60 % 2 - 1)), c = r - n / 2;
|
|
590
|
-
let l = 0, i = 0, o = 0;
|
|
591
|
-
return 0 <= t && t < 60 ? [l, i, o] = [n, s, 0] : 60 <= t && t < 120 ? [l, i, o] = [s, n, 0] : 120 <= t && t < 180 ? [l, i, o] = [0, n, s] : 180 <= t && t < 240 ? [l, i, o] = [0, s, n] : 240 <= t && t < 300 ? [l, i, o] = [s, 0, n] : [l, i, o] = [n, 0, s], [
|
|
592
|
-
Math.round((l + c) * 255),
|
|
593
|
-
Math.round((i + c) * 255),
|
|
594
|
-
Math.round((o + c) * 255)
|
|
595
|
-
];
|
|
596
|
-
}
|
|
597
|
-
function Ae(t, e, r) {
|
|
598
|
-
t = (t % 360 + 360) % 360;
|
|
599
|
-
const n = e + r;
|
|
600
|
-
n > 1 && (e /= n, r /= n);
|
|
601
|
-
const [s, c, l] = Wt(t, 1, 0.5).map((f) => f / 255), i = 1 - e - r, o = s * i + e, p = c * i + e, m = l * i + e;
|
|
602
|
-
return [Math.round(o * 255), Math.round(p * 255), Math.round(m * 255)];
|
|
603
|
-
}
|
|
604
|
-
function Ct(t, e, r) {
|
|
605
|
-
t /= 255, e /= 255, r /= 255;
|
|
606
|
-
const n = Math.max(t, e, r), s = Math.min(t, e, r);
|
|
607
|
-
let c = 0, l = 0;
|
|
608
|
-
const i = (n + s) / 2, o = n - s;
|
|
609
|
-
if (o !== 0) {
|
|
610
|
-
switch (l = i > 0.5 ? o / (2 - n - s) : o / (n + s), n) {
|
|
611
|
-
case t:
|
|
612
|
-
c = (e - r) / o + (e < r ? 6 : 0);
|
|
613
|
-
break;
|
|
614
|
-
case e:
|
|
615
|
-
c = (r - t) / o + 2;
|
|
616
|
-
break;
|
|
617
|
-
default:
|
|
618
|
-
c = (t - e) / o + 4;
|
|
619
|
-
}
|
|
620
|
-
c *= 60;
|
|
621
|
-
}
|
|
622
|
-
return [Math.round(c), Math.round(l * 100), Math.round(i * 100)];
|
|
623
|
-
}
|
|
624
|
-
function Fe(t, e, r) {
|
|
625
|
-
const [n] = Ct(t, e, r), s = t / 255, c = e / 255, l = r / 255, i = Math.min(s, c, l), o = 1 - Math.max(s, c, l);
|
|
626
|
-
return [n, Math.round(i * 100), Math.round(o * 100)];
|
|
627
|
-
}
|
|
628
|
-
function vt(t) {
|
|
629
|
-
const e = t / 255;
|
|
630
|
-
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
631
|
-
}
|
|
632
|
-
function xt(t) {
|
|
633
|
-
const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
|
|
634
|
-
return Math.round(Math.max(0, Math.min(1, e)) * 255);
|
|
635
|
-
}
|
|
636
|
-
function Be(t, e, r) {
|
|
637
|
-
const n = r * Math.PI / 180, s = Math.cos(n) * e, c = Math.sin(n) * e, l = t + 0.3963377774 * s + 0.2158037573 * c, i = t - 0.1055613458 * s - 0.0638541728 * c, o = t - 0.0894841775 * s - 1.291485548 * c, p = l * l * l, m = i * i * i, f = o * o * o, v = 4.0767416621 * p - 3.3077115913 * m + 0.2309699292 * f, d = -1.2684380046 * p + 2.6097574011 * m - 0.3413193965 * f, x = -0.0041960863 * p - 0.7034186147 * m + 1.707614701 * f;
|
|
638
|
-
return [xt(v), xt(d), xt(x)];
|
|
639
|
-
}
|
|
640
|
-
function Ve(t, e, r) {
|
|
641
|
-
const n = vt(t), s = vt(e), c = vt(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * c, i = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * c, o = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * c, p = Math.cbrt(l), m = Math.cbrt(i), f = Math.cbrt(o), v = 0.2104542553 * p + 0.793617785 * m - 0.0040720468 * f, d = 1.9779984951 * p - 2.428592205 * m + 0.4505937099 * f, x = 0.0259040371 * p + 0.7827717662 * m - 0.808675766 * f, h = Math.sqrt(d * d + x * x);
|
|
642
|
-
let y = Math.atan2(x, d) * 180 / Math.PI;
|
|
643
|
-
return y < 0 && (y += 360), [v, h, y];
|
|
644
|
-
}
|
|
645
|
-
function at(t, e, r, n, s, c) {
|
|
646
|
-
switch (s) {
|
|
647
|
-
case "hex":
|
|
648
|
-
if (c) {
|
|
649
|
-
const l = (o) => o.toString(16).padStart(2, "0"), i = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
650
|
-
return `#${l(t)}${l(e)}${l(r)}${l(i)}`;
|
|
651
|
-
}
|
|
652
|
-
return It(t, e, r);
|
|
653
|
-
case "rgb":
|
|
654
|
-
return `rgb(${t}, ${e}, ${r})`;
|
|
655
|
-
case "rgba":
|
|
656
|
-
return `rgba(${t}, ${e}, ${r}, ${Math.round(n * 100) / 100})`;
|
|
657
|
-
case "hsl": {
|
|
658
|
-
const [l, i, o] = Ct(t, e, r);
|
|
659
|
-
return `hsl(${l}, ${i}%, ${o}%)`;
|
|
660
|
-
}
|
|
661
|
-
case "hsla": {
|
|
662
|
-
const [l, i, o] = Ct(t, e, r);
|
|
663
|
-
return `hsla(${l}, ${i}%, ${o}%, ${Math.round(n * 100) / 100})`;
|
|
664
|
-
}
|
|
665
|
-
case "hwb": {
|
|
666
|
-
const [l, i, o] = Fe(t, e, r);
|
|
667
|
-
return n < 1 ? `hwb(${l} ${i}% ${o}% / ${Math.round(n * 100) / 100})` : `hwb(${l} ${i}% ${o}%)`;
|
|
668
|
-
}
|
|
669
|
-
case "oklch": {
|
|
670
|
-
const [l, i, o] = Ve(t, e, r), p = (Math.round(l * 1e3) / 1e3).toFixed(3), m = (Math.round(i * 1e3) / 1e3).toFixed(3), f = (Math.round(o * 10) / 10).toFixed(1), v = Math.round(n * 100) / 100;
|
|
671
|
-
return c || n < 1 ? `oklch(${p} ${m} ${f} / ${v})` : `oklch(${p} ${m} ${f})`;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
function ot(t, e) {
|
|
676
|
-
return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
|
|
677
|
-
}
|
|
678
|
-
function Le(t, e) {
|
|
679
|
-
const [r, n, s] = t, c = r << 16 ^ n << 8 ^ s, l = Te(c), i = 6 + Math.floor(l() * 5), o = 0.18 + l() * 0.06, p = [];
|
|
680
|
-
for (let d = 0; d < i; d++) {
|
|
681
|
-
const x = d / i * Math.PI * 2, h = e * (1 + (l() * 2 - 1) * o), y = Math.cos(x) * h, g = Math.sin(x) * h;
|
|
682
|
-
p.push({ x: y, y: g });
|
|
683
|
-
}
|
|
684
|
-
const m = (p[0].x + p[i - 1].x) / 2, f = (p[0].y + p[i - 1].y) / 2;
|
|
685
|
-
let v = `M ${m.toFixed(3)} ${f.toFixed(3)}`;
|
|
686
|
-
for (let d = 0; d < i; d++) {
|
|
687
|
-
const x = p[d], h = p[(d + 1) % i], y = (x.x + h.x) / 2, g = (x.y + h.y) / 2;
|
|
688
|
-
v += ` Q ${x.x.toFixed(3)} ${x.y.toFixed(3)} ${y.toFixed(3)} ${g.toFixed(3)}`;
|
|
689
|
-
}
|
|
690
|
-
return v += " Z", v;
|
|
691
|
-
}
|
|
692
|
-
const mn = (t) => {
|
|
693
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, displayValue: c, size: l, withAlpha: i } = t, o = u.map(l ?? 32, (w) => w), p = u.map(e, (w) => De(w ?? "#000000")), m = u.map(
|
|
694
|
-
p,
|
|
695
|
-
([w, $, M]) => [w, $, M]
|
|
696
|
-
), f = u.map(p, ([, , , w]) => w), v = et(u.get(f) ?? 1), d = u.map(i ?? !1, (w) => w), x = u.map(
|
|
697
|
-
t.colorTextFormat ?? "rgb",
|
|
698
|
-
(w) => w
|
|
699
|
-
), h = L(
|
|
700
|
-
m,
|
|
701
|
-
v,
|
|
702
|
-
x,
|
|
703
|
-
d
|
|
704
|
-
)(
|
|
705
|
-
([w, $, M], A, F, S) => at(w, $, M, A ?? 1, ot(F, S), S)
|
|
706
|
-
), y = u.map(
|
|
707
|
-
t.colorTextFormat ?? "hex",
|
|
708
|
-
(w) => w
|
|
709
|
-
), g = u.map(o, (w) => `${-w / 2} ${-w / 2} ${w} ${w}`), b = L(
|
|
710
|
-
m,
|
|
711
|
-
o
|
|
712
|
-
)((w, $) => Le(w, $ / 2)), D = L(
|
|
713
|
-
m,
|
|
714
|
-
v,
|
|
715
|
-
d
|
|
716
|
-
)(
|
|
717
|
-
([w, $, M], A, F) => F || A < 1 ? Se(w, $, M, A) : It(w, $, M)
|
|
718
|
-
), k = I.div(
|
|
719
|
-
a.class("bc-color-input__control"),
|
|
720
|
-
a.class(
|
|
721
|
-
u.map(
|
|
722
|
-
d,
|
|
723
|
-
(w) => w ? "bc-color-input__control--alpha" : ""
|
|
724
|
-
)
|
|
725
|
-
),
|
|
726
|
-
a.style(
|
|
727
|
-
L(o)((w) => `min-width:${w + 2}px;height:${w + 2}px`)
|
|
728
|
-
),
|
|
729
|
-
// The SVG blob preview
|
|
730
|
-
At.svg(
|
|
731
|
-
a.class("bc-color-input__svg"),
|
|
732
|
-
ht.viewBox(g),
|
|
733
|
-
At.path(ht.d(b), ht.fill(D))
|
|
734
|
-
),
|
|
735
|
-
// Invisible native input overlays the blob for picker and accessibility
|
|
736
|
-
I.input(
|
|
737
|
-
a.type("color"),
|
|
738
|
-
H(t),
|
|
739
|
-
// Native color input needs hex without alpha
|
|
740
|
-
a.value(u.map(m, ([w, $, M]) => It(w, $, M))),
|
|
741
|
-
a.class("bc-input bc-color-input bc-color-input__native"),
|
|
742
|
-
r != null ? C.blur(r) : T,
|
|
743
|
-
n != null ? C.change((w) => {
|
|
744
|
-
const $ = w.target.value;
|
|
745
|
-
if (!n) return;
|
|
746
|
-
const [M, A, F] = kt($), S = u.get(v) ?? 1, V = ot(
|
|
747
|
-
u.get(y),
|
|
748
|
-
u.get(d)
|
|
749
|
-
), O = at(M, A, F, S, V, u.get(d));
|
|
750
|
-
n(O);
|
|
751
|
-
}) : T,
|
|
752
|
-
s != null ? C.input((w) => {
|
|
753
|
-
const $ = w.target.value;
|
|
754
|
-
if (!s) return;
|
|
755
|
-
const [M, A, F] = kt($), S = u.get(v) ?? 1, V = ot(
|
|
756
|
-
u.get(y),
|
|
757
|
-
u.get(d)
|
|
758
|
-
), O = at(M, A, F, S, V, u.get(d));
|
|
759
|
-
s(O);
|
|
760
|
-
}) : T
|
|
761
|
-
)
|
|
762
|
-
), _ = E(
|
|
763
|
-
d,
|
|
764
|
-
() => I.input(
|
|
765
|
-
a.type("range"),
|
|
766
|
-
a.class("bc-color-input__alpha"),
|
|
767
|
-
a.min(0),
|
|
768
|
-
a.max(1),
|
|
769
|
-
a.step(0.01),
|
|
770
|
-
a.value(u.map(v, (w) => String(w ?? 1))),
|
|
771
|
-
a.disabled(t.disabled),
|
|
772
|
-
C.input((w) => {
|
|
773
|
-
const $ = parseFloat(w.target.value);
|
|
774
|
-
v.set($);
|
|
775
|
-
const [M, A, F] = u.get(m), S = ot(
|
|
776
|
-
u.get(y),
|
|
777
|
-
u.get(d)
|
|
778
|
-
), V = at(M, A, F, $, S, u.get(d));
|
|
779
|
-
s?.(V);
|
|
780
|
-
}),
|
|
781
|
-
C.change((w) => {
|
|
782
|
-
const $ = parseFloat(w.target.value);
|
|
783
|
-
v.set($);
|
|
784
|
-
const [M, A, F] = u.get(m), S = ot(
|
|
785
|
-
u.get(y),
|
|
786
|
-
u.get(d)
|
|
787
|
-
), V = at(M, A, F, $, S, u.get(d));
|
|
788
|
-
n?.(V);
|
|
789
|
-
})
|
|
790
|
-
)
|
|
791
|
-
);
|
|
792
|
-
return P({
|
|
793
|
-
baseContainer: !0,
|
|
794
|
-
...t,
|
|
795
|
-
// ensure our control does not try to grow
|
|
796
|
-
growInput: !1,
|
|
797
|
-
input: k,
|
|
798
|
-
// If caller provided an `after`, append RGB before it
|
|
799
|
-
after: B(
|
|
800
|
-
E(
|
|
801
|
-
c ?? !1,
|
|
802
|
-
() => I.span(a.class("bc-color-input__rgb"), h)
|
|
803
|
-
),
|
|
804
|
-
_,
|
|
805
|
-
t.after
|
|
806
|
-
)
|
|
807
|
-
});
|
|
808
|
-
}, Dt = "$$tts-exp-", Ee = (t, e) => it((r) => {
|
|
809
|
-
const n = `${Dt}${t}`;
|
|
810
|
-
return N(u.on(e, (s) => Reflect.set(r, n, s)));
|
|
811
|
-
}), hn = (t, e) => {
|
|
812
|
-
const r = `${Dt}${t}`;
|
|
813
|
-
return (n) => {
|
|
814
|
-
e(Reflect.get(n.target, r));
|
|
815
|
-
};
|
|
816
|
-
}, Ue = (t, e) => {
|
|
817
|
-
const r = `${Dt}${t}`;
|
|
818
|
-
return (n) => {
|
|
819
|
-
const s = n.target, c = s.selectedIndex, l = s.options[c];
|
|
820
|
-
e(Reflect.get(l, r));
|
|
821
|
-
};
|
|
822
|
-
};
|
|
823
|
-
function Ne(t, e, r) {
|
|
824
|
-
const n = ["bc-card"];
|
|
825
|
-
return t !== "default" && n.push(`bc-card--${t}`), e !== "md" && n.push(`bc-card--padding-${e}`), r !== "lg" && n.push(`bc-card--rounded-${r}`), n.join(" ");
|
|
826
|
-
}
|
|
827
|
-
function gn({ variant: t = "default", size: e = "md", roundedness: r = "lg" } = {}, ...n) {
|
|
828
|
-
return I.div(
|
|
829
|
-
a.class(
|
|
830
|
-
L(
|
|
831
|
-
t,
|
|
832
|
-
e,
|
|
833
|
-
r
|
|
834
|
-
)(
|
|
835
|
-
(s, c, l) => Ne(
|
|
836
|
-
s ?? "default",
|
|
837
|
-
c ?? "md",
|
|
838
|
-
l ?? "lg"
|
|
839
|
-
)
|
|
840
|
-
)
|
|
841
|
-
),
|
|
842
|
-
...n
|
|
843
|
-
);
|
|
844
|
-
}
|
|
845
|
-
function pt(...t) {
|
|
846
|
-
return I.div(a.class("bc-group"), ...t);
|
|
847
|
-
}
|
|
848
|
-
const bn = ({
|
|
849
|
-
startEditing: t,
|
|
850
|
-
value: e,
|
|
851
|
-
onChange: r,
|
|
852
|
-
placeholder: n,
|
|
853
|
-
disabled: s
|
|
854
|
-
}) => {
|
|
855
|
-
const c = u.deriveProp(t ?? !1), l = et(!1), i = u.map(s ?? !1, (o) => o);
|
|
856
|
-
return I.div(
|
|
857
|
-
N(c, l, () => u.dispose(i)),
|
|
858
|
-
a.class("bc-editable-text"),
|
|
859
|
-
a.class(
|
|
860
|
-
u.map(
|
|
861
|
-
i,
|
|
862
|
-
(o) => o ? "bc-editable-text--disabled" : ""
|
|
863
|
-
)
|
|
864
|
-
),
|
|
865
|
-
z.disabled(i),
|
|
866
|
-
E(
|
|
867
|
-
c,
|
|
868
|
-
() => I.input(
|
|
869
|
-
a.placeholder(n),
|
|
870
|
-
a.value(e),
|
|
871
|
-
a.class("bc-editable-text__input"),
|
|
872
|
-
le(),
|
|
873
|
-
C.keydown((o) => {
|
|
874
|
-
o.key === "Enter" ? c.set(!1) : o.key === "Escape" && (l.set(!0), c.set(!1));
|
|
875
|
-
}),
|
|
876
|
-
C.blur(
|
|
877
|
-
j((o) => {
|
|
878
|
-
if (c.set(!1), l.value) {
|
|
879
|
-
l.set(!1);
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
r(o);
|
|
883
|
-
})
|
|
884
|
-
)
|
|
885
|
-
),
|
|
886
|
-
() => I.span(
|
|
887
|
-
C.click(() => {
|
|
888
|
-
u.get(i) || c.set(!0);
|
|
889
|
-
}),
|
|
890
|
-
a.class("bc-editable-text__display"),
|
|
891
|
-
E(
|
|
892
|
-
u.map(e, (o) => o != null && o.trim() !== ""),
|
|
893
|
-
() => I.span(a.class("bc-editable-text__text"), e),
|
|
894
|
-
() => I.span(
|
|
895
|
-
a.class("bc-editable-text__placeholder"),
|
|
896
|
-
n
|
|
897
|
-
)
|
|
898
|
-
),
|
|
899
|
-
E(
|
|
900
|
-
u.map(i, (o) => !o),
|
|
901
|
-
() => I.button(
|
|
902
|
-
a.type("button"),
|
|
903
|
-
a.class("bc-editable-text__edit-button"),
|
|
904
|
-
W(X, (o) => z.label(o.$.editLabel)),
|
|
905
|
-
C.click(() => c.set(!0)),
|
|
906
|
-
R({ icon: "line-md/pencil", color: "neutral" })
|
|
907
|
-
)
|
|
908
|
-
)
|
|
909
|
-
)
|
|
910
|
-
)
|
|
911
|
-
);
|
|
912
|
-
}, Zt = (t, e, r) => Jt(
|
|
913
|
-
t,
|
|
914
|
-
(n) => Kt(n, {
|
|
915
|
-
value: (s) => {
|
|
916
|
-
const c = L(
|
|
917
|
-
s,
|
|
918
|
-
r
|
|
919
|
-
)((l, i) => e(l.value, i));
|
|
920
|
-
return I.option(
|
|
921
|
-
N(c.dispose),
|
|
922
|
-
a.selected(c),
|
|
923
|
-
Ee("value", s.$.value),
|
|
924
|
-
s.$.label
|
|
925
|
-
);
|
|
926
|
-
},
|
|
927
|
-
group: (s) => I.optgroup(
|
|
928
|
-
a.label(s.$.group),
|
|
929
|
-
ft(
|
|
930
|
-
s.$.options,
|
|
931
|
-
(c) => Zt(
|
|
932
|
-
c,
|
|
933
|
-
e,
|
|
934
|
-
r
|
|
935
|
-
)
|
|
936
|
-
)
|
|
937
|
-
),
|
|
938
|
-
break: () => I.hr()
|
|
939
|
-
})
|
|
940
|
-
), ze = (t) => {
|
|
941
|
-
const {
|
|
942
|
-
value: e,
|
|
943
|
-
onBlur: r,
|
|
944
|
-
onChange: n,
|
|
945
|
-
options: s,
|
|
946
|
-
unselectedLabel: c,
|
|
947
|
-
equality: l = (p, m) => p === m,
|
|
948
|
-
after: i
|
|
949
|
-
} = t;
|
|
950
|
-
let o;
|
|
951
|
-
return P(
|
|
952
|
-
{
|
|
953
|
-
...t,
|
|
954
|
-
after: B(
|
|
955
|
-
R({
|
|
956
|
-
icon: "ph:caret-down-bold",
|
|
957
|
-
color: "neutral",
|
|
958
|
-
size: "sm"
|
|
959
|
-
}),
|
|
960
|
-
i
|
|
961
|
-
),
|
|
962
|
-
input: I.select(
|
|
963
|
-
it((p) => {
|
|
964
|
-
o = p;
|
|
965
|
-
const m = new MutationObserver((f) => {
|
|
966
|
-
const { removedNodes: v } = f[0];
|
|
967
|
-
v.length > 0 && (o.selectedIndex = 0);
|
|
968
|
-
});
|
|
969
|
-
return m.observe(p, { childList: !0 }), N(() => m.disconnect());
|
|
970
|
-
}),
|
|
971
|
-
H(t),
|
|
972
|
-
a.class("bc-native-select bc-input"),
|
|
973
|
-
W(
|
|
974
|
-
X,
|
|
975
|
-
(p) => I.option(
|
|
976
|
-
a.hidden("hidden"),
|
|
977
|
-
Qt(c, p.$.selectOne)
|
|
978
|
-
)
|
|
979
|
-
),
|
|
980
|
-
ft(s, (p) => Zt(p, l, e)),
|
|
981
|
-
r != null ? C.blur(r) : T,
|
|
982
|
-
n != null ? C.change(Ue("value", (p) => n(p))) : T
|
|
983
|
-
)
|
|
984
|
-
},
|
|
985
|
-
C.click(() => {
|
|
986
|
-
o?.focus(), typeof o?.showPicker == "function" && o.showPicker();
|
|
987
|
-
})
|
|
988
|
-
);
|
|
989
|
-
};
|
|
990
|
-
function Re(t) {
|
|
991
|
-
const { controller: e, onChange: r, onBlur: n, ...s } = t;
|
|
992
|
-
return ze({
|
|
993
|
-
...s,
|
|
994
|
-
value: e.signal,
|
|
995
|
-
onChange: pe(e, r),
|
|
996
|
-
onBlur: ue(e, n)
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
function vn(t) {
|
|
1000
|
-
return Ht({
|
|
1001
|
-
...t,
|
|
1002
|
-
content: Re(t)
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
function Oe(t, e, r) {
|
|
1006
|
-
const n = t.length.map((s) => s);
|
|
1007
|
-
return B(
|
|
1008
|
-
N(() => n.dispose()),
|
|
1009
|
-
Pt(
|
|
1010
|
-
n,
|
|
1011
|
-
(s) => {
|
|
1012
|
-
const c = t.item(s.index), l = [];
|
|
1013
|
-
return B(
|
|
1014
|
-
N(() => {
|
|
1015
|
-
c.dispose(), l.forEach((i) => i());
|
|
1016
|
-
}),
|
|
1017
|
-
e({
|
|
1018
|
-
list: t,
|
|
1019
|
-
item: c,
|
|
1020
|
-
position: s,
|
|
1021
|
-
remove: () => t.removeAt(s.index),
|
|
1022
|
-
move: (i) => {
|
|
1023
|
-
switch (i) {
|
|
1024
|
-
case "up":
|
|
1025
|
-
if (s.index === 0) return;
|
|
1026
|
-
t.move(s.index, s.index - 1);
|
|
1027
|
-
break;
|
|
1028
|
-
case "down":
|
|
1029
|
-
if (s.index === t.length.value - 1) return;
|
|
1030
|
-
t.move(s.index, s.index + 1);
|
|
1031
|
-
break;
|
|
1032
|
-
case "first":
|
|
1033
|
-
t.move(s.index, 0);
|
|
1034
|
-
break;
|
|
1035
|
-
case "last":
|
|
1036
|
-
t.move(s.index, t.length.value - 1);
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
|
-
canMove: (i) => {
|
|
1040
|
-
const o = (() => {
|
|
1041
|
-
switch (i) {
|
|
1042
|
-
case "up":
|
|
1043
|
-
return Ft(s.index > 0);
|
|
1044
|
-
case "down":
|
|
1045
|
-
return t.length.map((p) => s.index < p - 1);
|
|
1046
|
-
}
|
|
1047
|
-
})();
|
|
1048
|
-
return l.push(() => o.dispose()), o;
|
|
1049
|
-
},
|
|
1050
|
-
cannotMove: (i) => {
|
|
1051
|
-
const o = (() => {
|
|
1052
|
-
switch (i) {
|
|
1053
|
-
case "up":
|
|
1054
|
-
return Ft(s.index === 0);
|
|
1055
|
-
case "down":
|
|
1056
|
-
return t.length.map((p) => s.index === p - 1);
|
|
1057
|
-
}
|
|
1058
|
-
})();
|
|
1059
|
-
return l.push(() => o.dispose()), o;
|
|
1060
|
-
}
|
|
1061
|
-
})
|
|
1062
|
-
);
|
|
1063
|
-
},
|
|
1064
|
-
r
|
|
1065
|
-
)
|
|
1066
|
-
);
|
|
1067
|
-
}
|
|
1068
|
-
const Nt = {
|
|
1069
|
-
9: { pattern: /^[0-9]$/ },
|
|
1070
|
-
A: { pattern: /^[A-Za-z]$/, transform: (t) => t.toUpperCase() },
|
|
1071
|
-
"*": { pattern: /^.$/ }
|
|
1072
|
-
}, Pe = (t) => t instanceof RegExp;
|
|
1073
|
-
function Yt(t, e, r) {
|
|
1074
|
-
if (t == null) return [];
|
|
1075
|
-
const n = r ? { ...Nt, ...e } : e ?? Nt, s = (l, i) => {
|
|
1076
|
-
const o = n[i];
|
|
1077
|
-
o ? l.push({ type: "pattern", name: i, ...o }) : l.push({ type: "literal", char: i });
|
|
1078
|
-
}, c = [];
|
|
1079
|
-
if (typeof t == "string") {
|
|
1080
|
-
for (const l of t) s(c, l);
|
|
1081
|
-
return c;
|
|
1082
|
-
}
|
|
1083
|
-
for (const l of t)
|
|
1084
|
-
if (typeof l == "string")
|
|
1085
|
-
if (l.length <= 1) s(c, l);
|
|
1086
|
-
else for (const i of l) s(c, i);
|
|
1087
|
-
else Pe(l) ? c.push({ type: "pattern", pattern: l }) : typeof l == "object" && l && c.push(l);
|
|
1088
|
-
return c;
|
|
1089
|
-
}
|
|
1090
|
-
function je(t, e) {
|
|
1091
|
-
return (r) => {
|
|
1092
|
-
switch (t) {
|
|
1093
|
-
case "digits":
|
|
1094
|
-
return /[0-9]/.test(r);
|
|
1095
|
-
case "letters":
|
|
1096
|
-
return /[A-Za-z]/.test(r);
|
|
1097
|
-
case "alphanumeric":
|
|
1098
|
-
return /[A-Za-z0-9]/.test(r);
|
|
1099
|
-
case "custom":
|
|
1100
|
-
return e?.(r) ?? !0;
|
|
1101
|
-
default:
|
|
1102
|
-
return !0;
|
|
1103
|
-
}
|
|
1104
|
-
};
|
|
1105
|
-
}
|
|
1106
|
-
function zt(t, e, r, n, s, c) {
|
|
1107
|
-
const l = {
|
|
1108
|
-
raw: t,
|
|
1109
|
-
previousConformed: e,
|
|
1110
|
-
cursor: s ?? t.length,
|
|
1111
|
-
completed: !1
|
|
1112
|
-
}, i = n.definitions ?? {}, o = typeof r == "function" ? r(t, l) : r, p = Yt(
|
|
1113
|
-
o,
|
|
1114
|
-
i,
|
|
1115
|
-
n.useDefaultDefinitions ?? !0
|
|
1116
|
-
), m = je(n.allowMode, n.allow), f = /* @__PURE__ */ new Set();
|
|
1117
|
-
for (const S of p) S.type === "literal" && f.add(S.char);
|
|
1118
|
-
if (n.prefix) for (const S of n.prefix) f.add(S);
|
|
1119
|
-
if (n.suffix) for (const S of n.suffix) f.add(S);
|
|
1120
|
-
const v = Array.from(t).filter((S) => m(S) && !f.has(S));
|
|
1121
|
-
if (v.length === 0) return { value: "", cursor: 0, completed: !1 };
|
|
1122
|
-
const d = [], x = [];
|
|
1123
|
-
let h = 0, y = 0, g = 0, b = -1;
|
|
1124
|
-
for (const S of p) {
|
|
1125
|
-
if (S.type === "literal") {
|
|
1126
|
-
d.push(S.char), x.push({ kind: "literal", filled: !0 });
|
|
1127
|
-
continue;
|
|
1128
|
-
}
|
|
1129
|
-
y += S.optional ? 0 : 1;
|
|
1130
|
-
const V = v[h];
|
|
1131
|
-
if (V == null)
|
|
1132
|
-
break;
|
|
1133
|
-
if (S.type === "any") {
|
|
1134
|
-
g++, d.push(S.transform ? S.transform(V) : V), x.push({ kind: "slot", filled: !0 }), b = x.length - 1, h++;
|
|
1135
|
-
continue;
|
|
1136
|
-
}
|
|
1137
|
-
if (S.type === "pattern")
|
|
1138
|
-
if (S.pattern.test(V)) {
|
|
1139
|
-
g++;
|
|
1140
|
-
const O = S.transform ? S.transform(V) : V;
|
|
1141
|
-
d.push(O), x.push({ kind: "slot", filled: !0 }), b = x.length - 1, h++;
|
|
1142
|
-
} else {
|
|
1143
|
-
h++;
|
|
1144
|
-
continue;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
const D = d.join(""), k = (n.prefix ?? "") + D + (n.suffix ?? "");
|
|
1148
|
-
let w = (n.prefix ?? "").length;
|
|
1149
|
-
if (b >= 0) {
|
|
1150
|
-
let S = b + 1;
|
|
1151
|
-
if ((c?.policy ?? "smart") !== "sticky")
|
|
1152
|
-
for (; S < x.length && x[S].kind === "literal"; ) S++;
|
|
1153
|
-
w += S;
|
|
1154
|
-
}
|
|
1155
|
-
const $ = n.completion?.mode === "min" ? (n.completion.minChars ?? 0) <= g : n.completion?.mode === "custom" ? !!n.completion.isComplete?.(k) : y > 0 && g >= y, M = n.pipe?.(k, { ...l, completed: $ });
|
|
1156
|
-
let A, F = w;
|
|
1157
|
-
return M === !1 ? (A = e, F = e.length) : typeof M == "string" ? (A = M, F = M.length) : typeof M == "object" && M ? (A = M.value, F = M.cursor ?? M.value.length) : A = k, { value: A, cursor: F, completed: $ };
|
|
1158
|
-
}
|
|
1159
|
-
function He(t, e) {
|
|
1160
|
-
const r = e?.strategy ?? "none";
|
|
1161
|
-
return r === "custom" && e?.unmask ? e.unmask(t) : r === "strip" ? t.replace(/[^A-Za-z0-9]/g, "") : t;
|
|
1162
|
-
}
|
|
1163
|
-
const Xt = (t) => {
|
|
1164
|
-
const {
|
|
1165
|
-
value: e,
|
|
1166
|
-
onBlur: r,
|
|
1167
|
-
onChange: n,
|
|
1168
|
-
onInput: s,
|
|
1169
|
-
onAccept: c,
|
|
1170
|
-
onComplete: l,
|
|
1171
|
-
mask: i,
|
|
1172
|
-
definitions: o,
|
|
1173
|
-
useDefaultDefinitions: p,
|
|
1174
|
-
extraLiterals: m,
|
|
1175
|
-
prefix: f,
|
|
1176
|
-
suffix: v,
|
|
1177
|
-
autofix: d,
|
|
1178
|
-
pipe: x,
|
|
1179
|
-
completion: h,
|
|
1180
|
-
unmask: y,
|
|
1181
|
-
allowMode: g,
|
|
1182
|
-
allow: b,
|
|
1183
|
-
placeholder: D,
|
|
1184
|
-
placeholderOptions: k
|
|
1185
|
-
} = t, _ = L(
|
|
1186
|
-
e,
|
|
1187
|
-
i,
|
|
1188
|
-
o,
|
|
1189
|
-
p,
|
|
1190
|
-
m,
|
|
1191
|
-
f,
|
|
1192
|
-
v,
|
|
1193
|
-
d,
|
|
1194
|
-
h,
|
|
1195
|
-
y,
|
|
1196
|
-
g,
|
|
1197
|
-
D,
|
|
1198
|
-
k
|
|
1199
|
-
)(($, M, A, F, S, V, O, st, rt, tt, Q, ut, q) => M ? zt($ ?? "", "", M, {
|
|
1200
|
-
definitions: A ?? {},
|
|
1201
|
-
useDefaultDefinitions: F ?? !0,
|
|
1202
|
-
extraLiterals: S ?? [],
|
|
1203
|
-
autofix: st ?? "none",
|
|
1204
|
-
completion: rt ?? { mode: "mask" },
|
|
1205
|
-
pipe: x ?? ((U) => U),
|
|
1206
|
-
unmask: tt ?? { strategy: "none" },
|
|
1207
|
-
allowMode: Q ?? "all",
|
|
1208
|
-
allow: b,
|
|
1209
|
-
prefix: V,
|
|
1210
|
-
suffix: O
|
|
1211
|
-
}).value : $ ?? ""), w = ($, M) => {
|
|
1212
|
-
const A = $.value ?? "", F = u.get(e) ?? "", S = i != null ? u.get(i) : null, V = o != null ? u.get(o) : void 0, O = p != null ? u.get(p) : void 0, st = m != null ? u.get(m) : void 0, rt = d != null ? u.get(d) : void 0, tt = h != null ? u.get(h) : void 0, Q = y != null ? u.get(y) : void 0, ut = g != null ? u.get(g) : void 0, q = f != null ? u.get(f) : void 0, U = v != null ? u.get(v) : void 0, {
|
|
1213
|
-
value: J,
|
|
1214
|
-
cursor: mt,
|
|
1215
|
-
completed: St
|
|
1216
|
-
} = S ? zt(
|
|
1217
|
-
A,
|
|
1218
|
-
F,
|
|
1219
|
-
S,
|
|
1220
|
-
{
|
|
1221
|
-
definitions: V ?? {},
|
|
1222
|
-
useDefaultDefinitions: O ?? !0,
|
|
1223
|
-
extraLiterals: st ?? [],
|
|
1224
|
-
autofix: rt ?? "none",
|
|
1225
|
-
completion: tt ?? { mode: "mask" },
|
|
1226
|
-
pipe: x ?? ((qt) => qt),
|
|
1227
|
-
unmask: Q ?? { strategy: "none" },
|
|
1228
|
-
allowMode: ut ?? "all",
|
|
1229
|
-
allow: b,
|
|
1230
|
-
prefix: q,
|
|
1231
|
-
suffix: U
|
|
1232
|
-
},
|
|
1233
|
-
$.selectionStart ?? A.length,
|
|
1234
|
-
t.cursor ? u.get(t.cursor) : void 0
|
|
1235
|
-
) : { value: A, cursor: A.length, completed: !0 };
|
|
1236
|
-
if (J !== A) {
|
|
1237
|
-
$.value = J;
|
|
1238
|
-
try {
|
|
1239
|
-
$.setSelectionRange(mt, mt);
|
|
1240
|
-
} catch {
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
const Tt = He(J, Q);
|
|
1244
|
-
c?.({
|
|
1245
|
-
raw: Tt,
|
|
1246
|
-
conformed: J,
|
|
1247
|
-
completed: St,
|
|
1248
|
-
cursor: mt
|
|
1249
|
-
}), M === "input" ? s?.(J) : (n?.(J), St && l?.({ raw: Tt, conformed: J }));
|
|
1250
|
-
};
|
|
1251
|
-
return B(
|
|
1252
|
-
N(_),
|
|
1253
|
-
P({
|
|
1254
|
-
...t,
|
|
1255
|
-
input: K.text(
|
|
1256
|
-
H(t),
|
|
1257
|
-
a.value(_),
|
|
1258
|
-
a.class("bc-input"),
|
|
1259
|
-
r != null ? C.blur(r) : T,
|
|
1260
|
-
it(
|
|
1261
|
-
($) => $ instanceof HTMLInputElement ? B(
|
|
1262
|
-
C.input(() => w($, "input")),
|
|
1263
|
-
C.change(() => w($, "change")),
|
|
1264
|
-
C.keydown((M) => {
|
|
1265
|
-
if (M.key !== "Backspace" || !(t.cursor ? u.get(t.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
|
|
1266
|
-
const F = $.selectionStart ?? 0, S = $.selectionEnd ?? F;
|
|
1267
|
-
if (F !== S || F <= 0) return;
|
|
1268
|
-
const V = $.value ?? "", O = i != null ? u.get(i) : null;
|
|
1269
|
-
if (!O) return;
|
|
1270
|
-
const st = o != null ? u.get(o) : void 0, rt = p != null ? u.get(p) : !0, tt = f != null ? u.get(f) : void 0, Q = v != null ? u.get(v) : void 0, ut = Yt(
|
|
1271
|
-
typeof O == "function" ? O(V, {
|
|
1272
|
-
raw: V,
|
|
1273
|
-
previousConformed: V,
|
|
1274
|
-
cursor: F,
|
|
1275
|
-
completed: !1
|
|
1276
|
-
}) : O,
|
|
1277
|
-
st ?? {},
|
|
1278
|
-
rt ?? !0
|
|
1279
|
-
), q = /* @__PURE__ */ new Set();
|
|
1280
|
-
for (const U of ut)
|
|
1281
|
-
U.type === "literal" && q.add(U.char);
|
|
1282
|
-
if (tt) for (const U of tt) q.add(U);
|
|
1283
|
-
if (Q) for (const U of Q) q.add(U);
|
|
1284
|
-
if (q.has(V[F - 1])) {
|
|
1285
|
-
let U = F - 1;
|
|
1286
|
-
for (; U >= 0 && q.has(V[U]); ) U--;
|
|
1287
|
-
U >= 0 && (M.preventDefault(), M.stopPropagation(), $.value = V.slice(0, U) + V.slice(U + 1), w($, "input"));
|
|
1288
|
-
}
|
|
1289
|
-
})
|
|
1290
|
-
) : T
|
|
1291
|
-
)
|
|
1292
|
-
)
|
|
1293
|
-
})
|
|
1294
|
-
);
|
|
1295
|
-
};
|
|
1296
|
-
function Y(t, e, r) {
|
|
1297
|
-
const n = u.map(t, (c) => c != null), s = yt.clearValue;
|
|
1298
|
-
return B(
|
|
1299
|
-
N(() => u.dispose(n)),
|
|
1300
|
-
E(
|
|
1301
|
-
n,
|
|
1302
|
-
() => I.button(
|
|
1303
|
-
a.type("button"),
|
|
1304
|
-
a.class("bc-input-container__reset"),
|
|
1305
|
-
z.label(s),
|
|
1306
|
-
a.title(s),
|
|
1307
|
-
a.disabled(e ?? !1),
|
|
1308
|
-
R({ icon: "mdi:close", size: "sm" }),
|
|
1309
|
-
C.click((c) => {
|
|
1310
|
-
c.preventDefault(), c.stopPropagation(), r?.(null);
|
|
1311
|
-
})
|
|
1312
|
-
)
|
|
1313
|
-
)
|
|
1314
|
-
);
|
|
1315
|
-
}
|
|
1316
|
-
const xn = (t) => {
|
|
1317
|
-
const { value: e, onBlur: r, onChange: n, after: s, disabled: c } = t, l = Y(e, c, n);
|
|
1318
|
-
return P({
|
|
1319
|
-
...t,
|
|
1320
|
-
input: K.date(
|
|
1321
|
-
H(t),
|
|
1322
|
-
a.valueAsDate(e),
|
|
1323
|
-
a.class("bc-input"),
|
|
1324
|
-
r != null ? C.blur(j(r)) : T,
|
|
1325
|
-
n != null ? C.change(te(n)) : T
|
|
1326
|
-
),
|
|
1327
|
-
after: s != null ? B(l, s) : l
|
|
1328
|
-
});
|
|
1329
|
-
}, We = (t) => {
|
|
1330
|
-
const e = t.getFullYear(), r = t.getMonth() + 1, n = t.getDate(), s = t.getHours(), c = t.getMinutes(), l = t.getSeconds();
|
|
1331
|
-
return `${e}-${r.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${s.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}`;
|
|
1332
|
-
}, wn = (t) => {
|
|
1333
|
-
const { value: e, onBlur: r, onChange: n, after: s, disabled: c } = t, l = u.map(e, (o) => o != null ? We(o) : null), i = Y(e, c, n);
|
|
1334
|
-
return P({
|
|
1335
|
-
...t,
|
|
1336
|
-
input: K["datetime-local"](
|
|
1337
|
-
H(t),
|
|
1338
|
-
a.value(u.map(l, (o) => o ?? null)),
|
|
1339
|
-
a.class("bc-input"),
|
|
1340
|
-
r != null ? C.blur(j(r)) : T,
|
|
1341
|
-
n != null ? C.change(ee(n)) : T
|
|
1342
|
-
),
|
|
1343
|
-
after: s != null ? B(i, s) : i
|
|
1344
|
-
});
|
|
1345
|
-
}, Z = (t) => typeof t == "string" && t.trim() === "" ? null : t, nt = (t) => t ?? "", _n = (t) => {
|
|
1346
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
1347
|
-
return oe({
|
|
1348
|
-
...i,
|
|
1349
|
-
value: u.map(e, nt),
|
|
1350
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1351
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1352
|
-
onBlur: r,
|
|
1353
|
-
after: c != null ? B(o, c) : o
|
|
1354
|
-
});
|
|
1355
|
-
}, yn = (t) => {
|
|
1356
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
1357
|
-
return de({
|
|
1358
|
-
...i,
|
|
1359
|
-
value: u.map(e, nt),
|
|
1360
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1361
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1362
|
-
onBlur: r,
|
|
1363
|
-
after: c != null ? B(o, c) : o
|
|
1364
|
-
});
|
|
1365
|
-
}, $n = (t) => {
|
|
1366
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
1367
|
-
return fe({
|
|
1368
|
-
...i,
|
|
1369
|
-
value: u.map(e, nt),
|
|
1370
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1371
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1372
|
-
onBlur: r,
|
|
1373
|
-
after: c != null ? B(o, c) : o
|
|
1374
|
-
});
|
|
1375
|
-
}, Ze = (t) => {
|
|
1376
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, rows: c } = t;
|
|
1377
|
-
return P({
|
|
1378
|
-
...t,
|
|
1379
|
-
input: I.textarea(
|
|
1380
|
-
H(t),
|
|
1381
|
-
a.rows(c ?? 3),
|
|
1382
|
-
a.value(e),
|
|
1383
|
-
a.class("bc-input"),
|
|
1384
|
-
r != null ? C.blur(j(r)) : T,
|
|
1385
|
-
n != null ? C.change(j(n)) : T,
|
|
1386
|
-
s != null ? C.input(j(s)) : T
|
|
1387
|
-
)
|
|
1388
|
-
});
|
|
1389
|
-
}, kn = (t) => {
|
|
1390
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
1391
|
-
return Ze({
|
|
1392
|
-
...i,
|
|
1393
|
-
value: u.map(e, nt),
|
|
1394
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1395
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1396
|
-
onBlur: r,
|
|
1397
|
-
after: c != null ? B(o, c) : o
|
|
1398
|
-
});
|
|
1399
|
-
}, In = (t) => {
|
|
1400
|
-
const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i, after: o } = t, p = (v) => {
|
|
1401
|
-
const d = n != null ? u.get(n) : void 0, x = s != null ? u.get(s) : void 0;
|
|
1402
|
-
return d != null && v < d ? d : x != null && v > x ? x : v;
|
|
1403
|
-
}, m = r != null ? W(X, (v) => {
|
|
1404
|
-
const d = L(
|
|
1405
|
-
e,
|
|
1406
|
-
n
|
|
1407
|
-
)((g, b) => b == null ? !0 : (g ?? 0) > b), x = L(
|
|
1408
|
-
e,
|
|
1409
|
-
s
|
|
1410
|
-
)((g, b) => b == null ? !0 : (g ?? 0) < b), h = (g) => {
|
|
1411
|
-
const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b - D * k, w = n != null ? u.get(n) : void 0;
|
|
1412
|
-
if (w != null && _ < w)
|
|
1413
|
-
return;
|
|
1414
|
-
const $ = p(_);
|
|
1415
|
-
$ !== b && l && l($);
|
|
1416
|
-
}, y = (g) => {
|
|
1417
|
-
const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b + D * k, w = s != null ? u.get(s) : void 0;
|
|
1418
|
-
if (w != null && _ > w)
|
|
1419
|
-
return;
|
|
1420
|
-
const $ = p(_);
|
|
1421
|
-
$ !== b && l && l($);
|
|
1422
|
-
};
|
|
1423
|
-
return ct(
|
|
1424
|
-
a.class("bc-number-input-steppers"),
|
|
1425
|
-
// Increment second
|
|
1426
|
-
I.button(
|
|
1427
|
-
a.type("button"),
|
|
1428
|
-
a.class(
|
|
1429
|
-
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1430
|
-
),
|
|
1431
|
-
a.disabled(
|
|
1432
|
-
L(
|
|
1433
|
-
x,
|
|
1434
|
-
t.disabled ?? !1
|
|
1435
|
-
)((g, b) => !g || b)
|
|
1436
|
-
),
|
|
1437
|
-
C.click((g) => y(g)),
|
|
1438
|
-
z.label(v.$.incrementValue),
|
|
1439
|
-
R({ icon: "line-md:plus", size: "xs" })
|
|
1440
|
-
),
|
|
1441
|
-
// Decrement first (matches tests expecting first button to be decrement)
|
|
1442
|
-
I.button(
|
|
1443
|
-
a.type("button"),
|
|
1444
|
-
a.class(
|
|
1445
|
-
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1446
|
-
),
|
|
1447
|
-
a.disabled(
|
|
1448
|
-
L(
|
|
1449
|
-
d,
|
|
1450
|
-
t.disabled ?? !1
|
|
1451
|
-
)((g, b) => !g || b)
|
|
1452
|
-
),
|
|
1453
|
-
C.click((g) => h(g)),
|
|
1454
|
-
z.label(v.$.decrementValue),
|
|
1455
|
-
R({ icon: "line-md:minus", size: "xs" })
|
|
1456
|
-
)
|
|
1457
|
-
);
|
|
1458
|
-
}) : null, f = o != null && m != null ? B(m, o) : o ?? m;
|
|
1459
|
-
return P({
|
|
1460
|
-
...t,
|
|
1461
|
-
input: K.number(
|
|
1462
|
-
n != null ? B(
|
|
1463
|
-
a.min(n),
|
|
1464
|
-
N(
|
|
1465
|
-
u.on(n, (v) => {
|
|
1466
|
-
v < u.get(e);
|
|
1467
|
-
})
|
|
1468
|
-
)
|
|
1469
|
-
) : T,
|
|
1470
|
-
s != null ? B(
|
|
1471
|
-
a.max(s),
|
|
1472
|
-
N(
|
|
1473
|
-
u.on(s, (v) => {
|
|
1474
|
-
v > u.get(e);
|
|
1475
|
-
})
|
|
1476
|
-
)
|
|
1477
|
-
) : T,
|
|
1478
|
-
H(t),
|
|
1479
|
-
a.valueAsNumber(e),
|
|
1480
|
-
a.step(r),
|
|
1481
|
-
a.class("bc-input bc-number-input"),
|
|
1482
|
-
c != null ? C.blur(j(c)) : T,
|
|
1483
|
-
l != null ? C.change(G(l)) : T,
|
|
1484
|
-
i != null ? C.input(G(i)) : T,
|
|
1485
|
-
// Add wheel event support when step is defined
|
|
1486
|
-
r != null ? C.wheel((v) => {
|
|
1487
|
-
v.preventDefault();
|
|
1488
|
-
const d = u.get(e) ?? 0, x = u.get(r), h = v.shiftKey ? 10 : 1, y = v.deltaY < 0 ? x * h : -x * h, g = p(d + y);
|
|
1489
|
-
g !== d && l && l(g);
|
|
1490
|
-
}) : T
|
|
1491
|
-
),
|
|
1492
|
-
after: f
|
|
1493
|
-
});
|
|
1494
|
-
}, Rt = (t) => {
|
|
1495
|
-
if (t == null || t === "") return null;
|
|
1496
|
-
const e = Number(t);
|
|
1497
|
-
return Number.isNaN(e) ? null : e;
|
|
1498
|
-
}, Cn = (t) => {
|
|
1499
|
-
const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i, after: o } = t, p = (d) => {
|
|
1500
|
-
const x = n != null ? u.get(n) : void 0, h = s != null ? u.get(s) : void 0;
|
|
1501
|
-
return x != null && d < x ? x : h != null && d > h ? h : d;
|
|
1502
|
-
}, m = (() => {
|
|
1503
|
-
if (r == null) return null;
|
|
1504
|
-
const d = L(
|
|
1505
|
-
e,
|
|
1506
|
-
n
|
|
1507
|
-
)((b, D) => {
|
|
1508
|
-
const k = b ?? 0;
|
|
1509
|
-
return D == null ? !0 : k > D;
|
|
1510
|
-
}), x = L(
|
|
1511
|
-
e,
|
|
1512
|
-
s
|
|
1513
|
-
)((b, D) => {
|
|
1514
|
-
const k = b ?? 0;
|
|
1515
|
-
return D == null ? !0 : k < D;
|
|
1516
|
-
}), h = (b) => {
|
|
1517
|
-
const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D - k * _, $ = n != null ? u.get(n) : void 0;
|
|
1518
|
-
if ($ != null && w < $) return;
|
|
1519
|
-
const M = p(w);
|
|
1520
|
-
M !== D && l && l(M);
|
|
1521
|
-
}, y = (b) => {
|
|
1522
|
-
const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D + k * _, $ = s != null ? u.get(s) : void 0;
|
|
1523
|
-
if ($ != null && w > $) return;
|
|
1524
|
-
const M = p(w);
|
|
1525
|
-
M !== D && l && l(M);
|
|
1526
|
-
};
|
|
1527
|
-
return ((b, D) => ct(
|
|
1528
|
-
a.class("bc-number-input-steppers"),
|
|
1529
|
-
I.button(
|
|
1530
|
-
a.type("button"),
|
|
1531
|
-
a.class(
|
|
1532
|
-
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
|
|
1533
|
-
),
|
|
1534
|
-
a.disabled(
|
|
1535
|
-
L(
|
|
1536
|
-
x,
|
|
1537
|
-
t.disabled ?? !1
|
|
1538
|
-
)((k, _) => !k || _)
|
|
1539
|
-
),
|
|
1540
|
-
C.click((k) => y(k)),
|
|
1541
|
-
z.label(b),
|
|
1542
|
-
R({ icon: "line-md:plus", size: "xs" })
|
|
1543
|
-
),
|
|
1544
|
-
I.button(
|
|
1545
|
-
a.type("button"),
|
|
1546
|
-
a.class(
|
|
1547
|
-
"bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
|
|
1548
|
-
),
|
|
1549
|
-
a.disabled(
|
|
1550
|
-
L(
|
|
1551
|
-
d,
|
|
1552
|
-
t.disabled ?? !1
|
|
1553
|
-
)((k, _) => !k || _)
|
|
1554
|
-
),
|
|
1555
|
-
C.click((k) => h(k)),
|
|
1556
|
-
z.label(D),
|
|
1557
|
-
R({ icon: "line-md:minus", size: "xs" })
|
|
1558
|
-
)
|
|
1559
|
-
))(
|
|
1560
|
-
yt.incrementValue,
|
|
1561
|
-
yt.decrementValue
|
|
1562
|
-
);
|
|
1563
|
-
})(), f = Y(e, t.disabled, l), v = o != null && m != null ? B(m, f, o) : o != null ? B(f, o) : m != null ? B(m, f) : f;
|
|
1564
|
-
return P({
|
|
1565
|
-
...t,
|
|
1566
|
-
input: K.number(
|
|
1567
|
-
// min/max attributes and reactive watchers (no forced correction)
|
|
1568
|
-
n != null ? B(
|
|
1569
|
-
a.min(n),
|
|
1570
|
-
N(
|
|
1571
|
-
u.on(n, (d) => {
|
|
1572
|
-
})
|
|
1573
|
-
)
|
|
1574
|
-
) : T,
|
|
1575
|
-
s != null ? B(
|
|
1576
|
-
a.max(s),
|
|
1577
|
-
N(
|
|
1578
|
-
u.on(s, (d) => {
|
|
1579
|
-
})
|
|
1580
|
-
)
|
|
1581
|
-
) : T,
|
|
1582
|
-
H(t),
|
|
1583
|
-
// Represent null as empty string so the field can be cleared
|
|
1584
|
-
a.value(u.map(e, (d) => d == null ? "" : String(d))),
|
|
1585
|
-
a.step(r),
|
|
1586
|
-
a.class("bc-input bc-number-input"),
|
|
1587
|
-
c != null ? C.blur(j(c)) : T,
|
|
1588
|
-
l != null ? C.change(
|
|
1589
|
-
j((d) => {
|
|
1590
|
-
const x = Rt(d);
|
|
1591
|
-
l(x);
|
|
1592
|
-
})
|
|
1593
|
-
) : T,
|
|
1594
|
-
i != null ? C.input(
|
|
1595
|
-
j((d) => {
|
|
1596
|
-
const x = Rt(d);
|
|
1597
|
-
i(x);
|
|
1598
|
-
})
|
|
1599
|
-
) : T,
|
|
1600
|
-
// Wheel support when step is defined
|
|
1601
|
-
r != null ? C.wheel((d) => {
|
|
1602
|
-
d.preventDefault();
|
|
1603
|
-
const x = u.get(e) ?? 0, h = u.get(r), y = d.shiftKey ? 10 : 1, g = d.deltaY < 0 ? h * y : -h * y, b = p(x + g);
|
|
1604
|
-
b !== x && l && l(b);
|
|
1605
|
-
}) : T
|
|
1606
|
-
),
|
|
1607
|
-
after: v
|
|
1608
|
-
});
|
|
1609
|
-
}, Mn = ({
|
|
1610
|
-
value: t,
|
|
1611
|
-
onChange: e,
|
|
1612
|
-
onInput: r,
|
|
1613
|
-
onBlur: n,
|
|
1614
|
-
offLabel: s,
|
|
1615
|
-
onLabel: c,
|
|
1616
|
-
disabled: l = !1,
|
|
1617
|
-
size: i = "md",
|
|
1618
|
-
id: o,
|
|
1619
|
-
color: p = "primary"
|
|
1620
|
-
}) => {
|
|
1621
|
-
const m = o ?? me("switch");
|
|
1622
|
-
function f(h, y) {
|
|
1623
|
-
const g = [
|
|
1624
|
-
"bc-switch",
|
|
1625
|
-
`bc-switch--size-${y}`,
|
|
1626
|
-
`bc-switch--${y}`
|
|
1627
|
-
];
|
|
1628
|
-
return h && g.push("bc-switch--disabled"), g.join(" ");
|
|
1629
|
-
}
|
|
1630
|
-
function v(h) {
|
|
1631
|
-
const y = h ?? "primary", g = /* @__PURE__ */ new Map(), b = Vt(y, "solid", "light"), D = Vt(y, "solid", "dark");
|
|
1632
|
-
return g.set("--switch-track-on-bg", b.backgroundColor), g.set("--switch-track-on-label", b.textColor), g.set("--switch-track-on-bg-dark", D.backgroundColor), g.set("--switch-track-on-label-dark", D.textColor), g.set(
|
|
1633
|
-
"--switch-track-on-border-dark",
|
|
1634
|
-
ie(y, "dark")
|
|
1635
|
-
), Array.from(g.entries()).map(([k, _]) => `${k}: ${_}`).join("; ");
|
|
1636
|
-
}
|
|
1637
|
-
const d = () => {
|
|
1638
|
-
u.get(l) || (e?.(!u.get(t)), r?.(!u.get(t)));
|
|
1639
|
-
}, x = (h) => {
|
|
1640
|
-
u.get(l) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), d());
|
|
1641
|
-
};
|
|
1642
|
-
return I.div(
|
|
1643
|
-
a.class(
|
|
1644
|
-
L(
|
|
1645
|
-
l ?? !1,
|
|
1646
|
-
i
|
|
1647
|
-
)(
|
|
1648
|
-
(h, y) => f(h ?? !1, y ?? "md")
|
|
1649
|
-
)
|
|
1650
|
-
),
|
|
1651
|
-
a.style(
|
|
1652
|
-
L(p)(
|
|
1653
|
-
(h) => v(h)
|
|
1654
|
-
)
|
|
1655
|
-
),
|
|
1656
|
-
a.id(m),
|
|
1657
|
-
a.role("switch"),
|
|
1658
|
-
a.tabindex(
|
|
1659
|
-
u.map(l, (h) => h ? -1 : 0)
|
|
1660
|
-
),
|
|
1661
|
-
z.checked(t),
|
|
1662
|
-
z.disabled(l),
|
|
1663
|
-
C.click(d),
|
|
1664
|
-
C.keydown(x),
|
|
1665
|
-
n != null ? C.blur(n) : null,
|
|
1666
|
-
I.div(
|
|
1667
|
-
a.class("bc-switch__track"),
|
|
1668
|
-
a.class(
|
|
1669
|
-
u.map(
|
|
1670
|
-
t,
|
|
1671
|
-
(h) => h ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
1672
|
-
)
|
|
1673
|
-
),
|
|
1674
|
-
s != null ? I.div(
|
|
1675
|
-
z.hidden(!0),
|
|
1676
|
-
a.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
1677
|
-
a.class(
|
|
1678
|
-
u.map(
|
|
1679
|
-
t,
|
|
1680
|
-
(h) => h ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
1681
|
-
)
|
|
1682
|
-
),
|
|
1683
|
-
s
|
|
1684
|
-
) : null,
|
|
1685
|
-
c != null ? I.div(
|
|
1686
|
-
a.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
1687
|
-
a.class(
|
|
1688
|
-
u.map(
|
|
1689
|
-
t,
|
|
1690
|
-
(h) => h ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
1691
|
-
)
|
|
1692
|
-
),
|
|
1693
|
-
c
|
|
1694
|
-
) : null,
|
|
1695
|
-
jt(
|
|
1696
|
-
(h) => W(
|
|
1697
|
-
ce,
|
|
1698
|
-
({ direction: y }) => I.div(
|
|
1699
|
-
a.class("bc-switch__thumb"),
|
|
1700
|
-
a.class(
|
|
1701
|
-
u.map(
|
|
1702
|
-
t,
|
|
1703
|
-
(g) => g ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
1704
|
-
)
|
|
1705
|
-
),
|
|
1706
|
-
dt.transform(
|
|
1707
|
-
L(
|
|
1708
|
-
t,
|
|
1709
|
-
h,
|
|
1710
|
-
i,
|
|
1711
|
-
y
|
|
1712
|
-
)((g, { width: b }, D, k) => {
|
|
1713
|
-
const _ = (() => {
|
|
1714
|
-
switch (D) {
|
|
1715
|
-
case "xs":
|
|
1716
|
-
return 5;
|
|
1717
|
-
case "sm":
|
|
1718
|
-
return 5.5;
|
|
1719
|
-
case "md":
|
|
1720
|
-
return 6;
|
|
1721
|
-
case "lg":
|
|
1722
|
-
return 7;
|
|
1723
|
-
case "xl":
|
|
1724
|
-
return 8;
|
|
1725
|
-
}
|
|
1726
|
-
})(), w = k === "rtl" ? `calc((var(--spacing-base) * ${_}) - ${b}px)` : `calc(${b}px - (var(--spacing-base) * ${_}))`;
|
|
1727
|
-
return g ? `translateX(${w})` : "translateX(0)";
|
|
1728
|
-
})
|
|
1729
|
-
)
|
|
1730
|
-
)
|
|
1731
|
-
)
|
|
1732
|
-
)
|
|
1733
|
-
)
|
|
1734
|
-
);
|
|
1735
|
-
}, Ye = (t) => {
|
|
1736
|
-
const e = {
|
|
1737
|
-
type: "pattern",
|
|
1738
|
-
pattern: /[0-9A-Fa-f]/,
|
|
1739
|
-
transform: (n) => n.toLowerCase()
|
|
1740
|
-
};
|
|
1741
|
-
return Xt({
|
|
1742
|
-
...t,
|
|
1743
|
-
mask: [
|
|
1744
|
-
e,
|
|
1745
|
-
e,
|
|
1746
|
-
e,
|
|
1747
|
-
e,
|
|
1748
|
-
e,
|
|
1749
|
-
e,
|
|
1750
|
-
e,
|
|
1751
|
-
e,
|
|
1752
|
-
"-",
|
|
1753
|
-
e,
|
|
1754
|
-
e,
|
|
1755
|
-
e,
|
|
1756
|
-
e,
|
|
1757
|
-
"-",
|
|
1758
|
-
e,
|
|
1759
|
-
e,
|
|
1760
|
-
e,
|
|
1761
|
-
e,
|
|
1762
|
-
"-",
|
|
1763
|
-
e,
|
|
1764
|
-
e,
|
|
1765
|
-
e,
|
|
1766
|
-
e,
|
|
1767
|
-
"-",
|
|
1768
|
-
e,
|
|
1769
|
-
e,
|
|
1770
|
-
e,
|
|
1771
|
-
e,
|
|
1772
|
-
e,
|
|
1773
|
-
e,
|
|
1774
|
-
e,
|
|
1775
|
-
e,
|
|
1776
|
-
e,
|
|
1777
|
-
e,
|
|
1778
|
-
e,
|
|
1779
|
-
e
|
|
1780
|
-
],
|
|
1781
|
-
// Sensible default placeholder; can be overridden via options.placeholder
|
|
1782
|
-
placeholder: t.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
1783
|
-
});
|
|
1784
|
-
}, Dn = (t) => {
|
|
1785
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
1786
|
-
return Ye({
|
|
1787
|
-
...i,
|
|
1788
|
-
value: u.map(e, nt),
|
|
1789
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
1790
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
1791
|
-
onBlur: r,
|
|
1792
|
-
after: c != null ? B(o, c) : o
|
|
1793
|
-
});
|
|
1794
|
-
}, Xe = "line-md:star-alt-filled", qe = "line-md:star-alt", Ge = (t) => {
|
|
1795
|
-
const {
|
|
1796
|
-
value: e,
|
|
1797
|
-
onChange: r,
|
|
1798
|
-
disabled: n,
|
|
1799
|
-
max: s = 5,
|
|
1800
|
-
fullColor: c = "yellow",
|
|
1801
|
-
emptyColor: l = "neutral",
|
|
1802
|
-
fullIcon: i = Xe,
|
|
1803
|
-
emptyIcon: o = qe,
|
|
1804
|
-
size: p = "md",
|
|
1805
|
-
onBlur: m,
|
|
1806
|
-
rounding: f = 1
|
|
1807
|
-
} = t, v = () => {
|
|
1808
|
-
const b = u.get(f);
|
|
1809
|
-
return b > 0 ? b : 1;
|
|
1810
|
-
}, d = (b) => Math.min(Math.max(b, 0), u.get(s)), x = (b, D) => {
|
|
1811
|
-
if (u.get(n ?? !1)) return;
|
|
1812
|
-
const _ = b.currentTarget.getBoundingClientRect(), w = (b.clientX - _.left) / _.width, $ = D - 1 + w, M = v(), A = Math.ceil($ / M) * M, F = d(A);
|
|
1813
|
-
r?.(F);
|
|
1814
|
-
}, h = (b) => {
|
|
1815
|
-
if (u.get(n ?? !1)) return;
|
|
1816
|
-
const D = v(), k = u.get(e) ?? 0;
|
|
1817
|
-
let _;
|
|
1818
|
-
switch (b.key) {
|
|
1819
|
-
case "ArrowRight":
|
|
1820
|
-
case "ArrowUp":
|
|
1821
|
-
_ = d(k + D);
|
|
1822
|
-
break;
|
|
1823
|
-
case "ArrowLeft":
|
|
1824
|
-
case "ArrowDown":
|
|
1825
|
-
_ = d(k - D);
|
|
1826
|
-
break;
|
|
1827
|
-
case "Home":
|
|
1828
|
-
_ = 0;
|
|
1829
|
-
break;
|
|
1830
|
-
case "End":
|
|
1831
|
-
_ = u.get(s);
|
|
1832
|
-
break;
|
|
1833
|
-
default:
|
|
1834
|
-
return;
|
|
1835
|
-
}
|
|
1836
|
-
b.preventDefault(), r?.(_);
|
|
1837
|
-
}, y = u.map(p, (b) => `bc-icon--${b}`), g = ({ index: b, counter: D }) => I.span(
|
|
1838
|
-
a.class("bc-rating-input__icon-container"),
|
|
1839
|
-
a.class(y),
|
|
1840
|
-
R(
|
|
1841
|
-
{ icon: o, size: p, color: l, tone: "soft" },
|
|
1842
|
-
a.class("bc-rating-input__icon-empty")
|
|
1843
|
-
),
|
|
1844
|
-
I.span(
|
|
1845
|
-
a.class("bc-rating-input__icon-clipper"),
|
|
1846
|
-
a.class(y),
|
|
1847
|
-
dt.width(
|
|
1848
|
-
u.map(e, (k) => {
|
|
1849
|
-
const _ = Math.floor(k);
|
|
1850
|
-
return _ > b ? "100%" : _ < b ? "0%" : `${(k - b) * 100}%`;
|
|
1851
|
-
})
|
|
1852
|
-
),
|
|
1853
|
-
R(
|
|
1854
|
-
{ icon: i, size: p, color: c, tone: "soft" },
|
|
1855
|
-
a.class("bc-rating-input__icon-full")
|
|
1856
|
-
)
|
|
1857
|
-
),
|
|
1858
|
-
C.click(
|
|
1859
|
-
ne((k) => x(k, D), {
|
|
1860
|
-
preventDefault: !0,
|
|
1861
|
-
stopPropagation: !0
|
|
1862
|
-
})
|
|
1863
|
-
)
|
|
1864
|
-
);
|
|
1865
|
-
return P({
|
|
1866
|
-
baseContainer: !0,
|
|
1867
|
-
growInput: !1,
|
|
1868
|
-
focusableSelector: '[role="slider"]',
|
|
1869
|
-
...t,
|
|
1870
|
-
input: I.div(
|
|
1871
|
-
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
1872
|
-
H(t),
|
|
1873
|
-
a.class("bc-rating-input"),
|
|
1874
|
-
// ARIA slider semantics
|
|
1875
|
-
a.role("slider"),
|
|
1876
|
-
a.tabindex(u.map(n ?? !1, (b) => b ? -1 : 0)),
|
|
1877
|
-
z.disabled(n ?? !1),
|
|
1878
|
-
z.valuemin(0),
|
|
1879
|
-
z.valuemax(u.map(s, (b) => b ?? 0)),
|
|
1880
|
-
z.valuenow(u.map(e, (b) => b ?? 0)),
|
|
1881
|
-
z.valuetext(
|
|
1882
|
-
L(
|
|
1883
|
-
e,
|
|
1884
|
-
s
|
|
1885
|
-
)((b, D) => {
|
|
1886
|
-
const k = b ?? 0, _ = D ?? 0;
|
|
1887
|
-
return `${String(k)} / ${String(_)}`;
|
|
1888
|
-
})
|
|
1889
|
-
),
|
|
1890
|
-
// Keyboard & focus handlers
|
|
1891
|
-
C.keydown(h),
|
|
1892
|
-
m != null ? C.blur(m) : null,
|
|
1893
|
-
Pt(s, g)
|
|
1894
|
-
)
|
|
1895
|
-
});
|
|
1896
|
-
}, Sn = (t) => {
|
|
1897
|
-
const { value: e, onChange: r, onBlur: n, after: s, disabled: c, ...l } = t, i = Y(e, c, r);
|
|
1898
|
-
return Ge({
|
|
1899
|
-
...l,
|
|
1900
|
-
// Map null -> 0 for display so the control shows as empty when null
|
|
1901
|
-
value: u.map(e, (o) => o ?? 0),
|
|
1902
|
-
// Pass through numeric changes; clear button will call onChange(null)
|
|
1903
|
-
onChange: r,
|
|
1904
|
-
onBlur: n,
|
|
1905
|
-
after: s != null ? B(i, s) : i
|
|
1906
|
-
});
|
|
1907
|
-
}, Tn = (t) => {
|
|
1908
|
-
const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i } = t;
|
|
1909
|
-
return P({
|
|
1910
|
-
...t,
|
|
1911
|
-
// Make sure clicks anywhere focus the range input
|
|
1912
|
-
focusableSelector: 'input[type="range"]',
|
|
1913
|
-
input: I.input(
|
|
1914
|
-
a.type("range"),
|
|
1915
|
-
H(t),
|
|
1916
|
-
a.min(n),
|
|
1917
|
-
a.max(s),
|
|
1918
|
-
a.step(r),
|
|
1919
|
-
// Using value as number to keep it in sync
|
|
1920
|
-
a.valueAsNumber(e),
|
|
1921
|
-
a.class("bc-input bc-slider-input"),
|
|
1922
|
-
c != null ? C.blur(G(c)) : T,
|
|
1923
|
-
l != null ? C.change(G(l)) : T,
|
|
1924
|
-
i != null ? C.input(G(i)) : T
|
|
1925
|
-
)
|
|
1926
|
-
});
|
|
1927
|
-
}, An = (t) => {
|
|
1928
|
-
const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i } = t, o = u.map(e, (m) => {
|
|
1929
|
-
if (m != null) return m;
|
|
1930
|
-
const f = n != null ? u.get(n) : void 0;
|
|
1931
|
-
return typeof f == "number" ? f : 0;
|
|
1932
|
-
}), p = Y(e, t.disabled, (m) => {
|
|
1933
|
-
l?.(m);
|
|
1934
|
-
});
|
|
1935
|
-
return P(
|
|
1936
|
-
{
|
|
1937
|
-
...t,
|
|
1938
|
-
focusableSelector: 'input[type="range"]',
|
|
1939
|
-
after: p,
|
|
1940
|
-
input: I.input(
|
|
1941
|
-
a.type("range"),
|
|
1942
|
-
H(t),
|
|
1943
|
-
a.min(n),
|
|
1944
|
-
a.max(s),
|
|
1945
|
-
a.step(r),
|
|
1946
|
-
a.valueAsNumber(o),
|
|
1947
|
-
a.class("bc-input bc-slider-input"),
|
|
1948
|
-
c != null ? C.blur(G(c)) : T,
|
|
1949
|
-
l != null ? C.change(
|
|
1950
|
-
G((m) => {
|
|
1951
|
-
l(m);
|
|
1952
|
-
})
|
|
1953
|
-
) : T,
|
|
1954
|
-
i != null ? C.input(
|
|
1955
|
-
G((m) => {
|
|
1956
|
-
i(m);
|
|
1957
|
-
})
|
|
1958
|
-
) : T
|
|
1959
|
-
)
|
|
1960
|
-
},
|
|
1961
|
-
// Ensure container grows input naturally
|
|
1962
|
-
B()
|
|
1963
|
-
);
|
|
1964
|
-
};
|
|
1965
|
-
let wt = null;
|
|
1966
|
-
async function Mt() {
|
|
1967
|
-
const t = globalThis;
|
|
1968
|
-
return t.Temporal ? t.Temporal : (wt || (wt = import("./index.esm-DPNh6inz.js").then((e) => {
|
|
1969
|
-
const r = e.Temporal;
|
|
1970
|
-
return t.Temporal || (t.Temporal = r), r;
|
|
1971
|
-
})), wt);
|
|
1972
|
-
}
|
|
1973
|
-
const Qe = (t, e) => e ? Bt(Mt, {
|
|
1974
|
-
then: t,
|
|
1975
|
-
pending: e.pending,
|
|
1976
|
-
error: e.error
|
|
1977
|
-
}) : Bt(Mt, t), Je = /^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i, Ke = /^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;
|
|
1978
|
-
function tn(t) {
|
|
1979
|
-
return {
|
|
1980
|
-
mask: null,
|
|
1981
|
-
allowMode: "custom",
|
|
1982
|
-
allow: (e) => /[0-9ptwdhms]/i.test(e),
|
|
1983
|
-
pipe: (e) => {
|
|
1984
|
-
const r = e.toUpperCase();
|
|
1985
|
-
return r.length === 0 ? r : !r.startsWith("P") || !Je.test(r) ? !1 : r;
|
|
1986
|
-
},
|
|
1987
|
-
completion: {
|
|
1988
|
-
mode: "custom",
|
|
1989
|
-
isComplete: (e) => {
|
|
1990
|
-
const r = e.toUpperCase();
|
|
1991
|
-
if (!Ke.test(r)) return !1;
|
|
1992
|
-
try {
|
|
1993
|
-
return t(r), !0;
|
|
1994
|
-
} catch {
|
|
1995
|
-
return !1;
|
|
1996
|
-
}
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
|
-
const Ot = (t, e) => {
|
|
2002
|
-
if (t == null) return null;
|
|
2003
|
-
try {
|
|
2004
|
-
return t.Duration.from(e);
|
|
2005
|
-
} catch {
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
|
-
}, Fn = (t) => {
|
|
2009
|
-
const { value: e, onChange: r, after: n, disabled: s, onBlur: c } = t, l = () => {
|
|
2010
|
-
const p = Y(e, s, r);
|
|
2011
|
-
return n != null ? B(p, n) : p;
|
|
2012
|
-
}, i = t.placeholder != null ? T : a.placeholder("P0DT0H0M0S");
|
|
2013
|
-
return Qe(
|
|
2014
|
-
(p) => Xt({
|
|
2015
|
-
...t,
|
|
2016
|
-
value: u.map(e, (m) => m?.toString() ?? ""),
|
|
2017
|
-
onChange: r ? (m) => r(m === "" ? null : p.Duration.from(m)) : void 0,
|
|
2018
|
-
onInput: void 0,
|
|
2019
|
-
...tn(p.Duration.from),
|
|
2020
|
-
placeholder: "P0DT0H0M0S",
|
|
2021
|
-
after: l()
|
|
2022
|
-
}),
|
|
2023
|
-
{ pending: () => P({
|
|
2024
|
-
...t,
|
|
2025
|
-
input: K.text(
|
|
2026
|
-
H(t),
|
|
2027
|
-
a.value(u.map(e, (p) => p?.toString() ?? "")),
|
|
2028
|
-
a.class("bc-input"),
|
|
2029
|
-
i,
|
|
2030
|
-
c != null ? C.blur(() => c()) : T,
|
|
2031
|
-
r != null ? C.change((p) => {
|
|
2032
|
-
const f = p.currentTarget?.value ?? "";
|
|
2033
|
-
if (f === "") {
|
|
2034
|
-
r(null);
|
|
2035
|
-
return;
|
|
2036
|
-
}
|
|
2037
|
-
const v = globalThis.Temporal, d = Ot(v, f);
|
|
2038
|
-
if (d != null) {
|
|
2039
|
-
r(d);
|
|
2040
|
-
return;
|
|
2041
|
-
}
|
|
2042
|
-
Mt().then((x) => {
|
|
2043
|
-
const h = Ot(x, f);
|
|
2044
|
-
h != null && r(h);
|
|
2045
|
-
}).catch(() => {
|
|
2046
|
-
});
|
|
2047
|
-
}) : T
|
|
2048
|
-
),
|
|
2049
|
-
after: l()
|
|
2050
|
-
}) }
|
|
2051
|
-
);
|
|
2052
|
-
}, en = (t) => {
|
|
2053
|
-
const { value: e, onBlur: r, onChange: n, onInput: s } = t;
|
|
2054
|
-
return P({
|
|
2055
|
-
...t,
|
|
2056
|
-
input: K.url(
|
|
2057
|
-
H(t),
|
|
2058
|
-
a.value(e),
|
|
2059
|
-
a.class("bc-input"),
|
|
2060
|
-
r != null ? C.blur(j(r)) : T,
|
|
2061
|
-
n != null ? C.change(j(n)) : T,
|
|
2062
|
-
s != null ? C.input(j(s)) : T
|
|
2063
|
-
)
|
|
2064
|
-
});
|
|
2065
|
-
}, Bn = (t) => {
|
|
2066
|
-
const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
|
|
2067
|
-
return en({
|
|
2068
|
-
...i,
|
|
2069
|
-
value: u.map(e, nt),
|
|
2070
|
-
onChange: n != null ? (p) => n(Z(p)) : void 0,
|
|
2071
|
-
onInput: s != null ? (p) => s(Z(p)) : void 0,
|
|
2072
|
-
onBlur: r,
|
|
2073
|
-
after: c != null ? B(o, c) : o
|
|
2074
|
-
});
|
|
2075
|
-
}, nn = (t) => {
|
|
2076
|
-
const {
|
|
2077
|
-
controller: e,
|
|
2078
|
-
element: r,
|
|
2079
|
-
separator: n,
|
|
2080
|
-
showMove: s = !0,
|
|
2081
|
-
showRemove: c = !0,
|
|
2082
|
-
showAdd: l = !0,
|
|
2083
|
-
createItem: i,
|
|
2084
|
-
addLabel: o,
|
|
2085
|
-
controlsLayout: p = "aside",
|
|
2086
|
-
removeDisabled: m,
|
|
2087
|
-
addDisabled: f
|
|
2088
|
-
} = t, v = u.toSignal(p).map((h) => h === "aside"), d = (h) => {
|
|
2089
|
-
const y = E(
|
|
2090
|
-
s ?? !1,
|
|
2091
|
-
() => I.div(
|
|
2092
|
-
a.class("bc-group--align-center"),
|
|
2093
|
-
a.class(
|
|
2094
|
-
v.map(
|
|
2095
|
-
(b) => b ? "bc-group--direction-column bc-group--gap-1" : "bc-group--direction-row bc-group--gap-1"
|
|
2096
|
-
)
|
|
2097
|
-
),
|
|
2098
|
-
gt(
|
|
2099
|
-
{
|
|
2100
|
-
size: "xs",
|
|
2101
|
-
roundedness: "full",
|
|
2102
|
-
variant: "text",
|
|
2103
|
-
onClick: () => h.move("up"),
|
|
2104
|
-
disabled: h.cannotMove("up")
|
|
2105
|
-
},
|
|
2106
|
-
W(
|
|
2107
|
-
X,
|
|
2108
|
-
(b) => R({
|
|
2109
|
-
size: "xs",
|
|
2110
|
-
icon: "line-md:arrow-up",
|
|
2111
|
-
title: b.$.incrementValue
|
|
2112
|
-
})
|
|
2113
|
-
)
|
|
2114
|
-
),
|
|
2115
|
-
gt(
|
|
2116
|
-
{
|
|
2117
|
-
size: "xs",
|
|
2118
|
-
roundedness: "full",
|
|
2119
|
-
variant: "text",
|
|
2120
|
-
onClick: () => h.move("down"),
|
|
2121
|
-
disabled: h.cannotMove("down")
|
|
2122
|
-
},
|
|
2123
|
-
W(
|
|
2124
|
-
X,
|
|
2125
|
-
(b) => R({
|
|
2126
|
-
size: "xs",
|
|
2127
|
-
icon: "line-md:arrow-down",
|
|
2128
|
-
title: b.$.decrementValue
|
|
2129
|
-
})
|
|
2130
|
-
)
|
|
2131
|
-
)
|
|
2132
|
-
)
|
|
2133
|
-
), g = E(
|
|
2134
|
-
c,
|
|
2135
|
-
() => W(
|
|
2136
|
-
X,
|
|
2137
|
-
(b) => $t({
|
|
2138
|
-
size: "xs",
|
|
2139
|
-
// Use a lowercase label to satisfy tests that query with [aria-label*="remove"]
|
|
2140
|
-
label: u.map(b.$.removeItem, (D) => D.toLowerCase()),
|
|
2141
|
-
color: "danger",
|
|
2142
|
-
disabled: m,
|
|
2143
|
-
onClick: h.remove
|
|
2144
|
-
})
|
|
2145
|
-
)
|
|
2146
|
-
);
|
|
2147
|
-
return (b) => E(
|
|
2148
|
-
v,
|
|
2149
|
-
() => pt(
|
|
2150
|
-
a.class("bc-group--gap-1 bc-group--align-center"),
|
|
2151
|
-
ct(a.class("bc-stack--grow"), b),
|
|
2152
|
-
ct(
|
|
2153
|
-
a.class("bc-stack--align-center"),
|
|
2154
|
-
E(
|
|
2155
|
-
e.signal.map((D) => D.length > 1),
|
|
2156
|
-
() => y
|
|
2157
|
-
),
|
|
2158
|
-
g
|
|
2159
|
-
)
|
|
2160
|
-
),
|
|
2161
|
-
() => ct(
|
|
2162
|
-
a.class("bc-stack--gap-2"),
|
|
2163
|
-
b,
|
|
2164
|
-
pt(
|
|
2165
|
-
a.class("bc-group--gap-2 bc-group--justify-between"),
|
|
2166
|
-
E(
|
|
2167
|
-
e.signal.map((D) => D.length > 1),
|
|
2168
|
-
() => y,
|
|
2169
|
-
() => I.div()
|
|
2170
|
-
),
|
|
2171
|
-
g
|
|
2172
|
-
)
|
|
2173
|
-
)
|
|
2174
|
-
);
|
|
2175
|
-
}, x = E(
|
|
2176
|
-
L(l, i)((h, y) => h && y != null),
|
|
2177
|
-
() => pt(
|
|
2178
|
-
a.class(
|
|
2179
|
-
"bc-group--gap-2 bc-group--align-center bc-group--justify-center"
|
|
2180
|
-
),
|
|
2181
|
-
gt(
|
|
2182
|
-
{
|
|
2183
|
-
size: "sm",
|
|
2184
|
-
variant: "filled",
|
|
2185
|
-
onClick: () => e.push(i()),
|
|
2186
|
-
disabled: L(
|
|
2187
|
-
e.disabled,
|
|
2188
|
-
f ?? !1
|
|
2189
|
-
)(
|
|
2190
|
-
(h, y) => h || y
|
|
2191
|
-
)
|
|
2192
|
-
},
|
|
2193
|
-
W(
|
|
2194
|
-
X,
|
|
2195
|
-
(h) => pt(
|
|
2196
|
-
a.class("bc-group--gap-2"),
|
|
2197
|
-
R({ icon: "line-md:plus" }),
|
|
2198
|
-
o ?? h.$.addLabel
|
|
2199
|
-
)
|
|
2200
|
-
)
|
|
2201
|
-
)
|
|
2202
|
-
)
|
|
2203
|
-
);
|
|
2204
|
-
return B(
|
|
2205
|
-
Oe(
|
|
2206
|
-
e,
|
|
2207
|
-
(h) => d(h)(r(h)),
|
|
2208
|
-
n
|
|
2209
|
-
),
|
|
2210
|
-
x
|
|
2211
|
-
);
|
|
2212
|
-
}, Vn = (t, ...e) => {
|
|
2213
|
-
const {
|
|
2214
|
-
controller: r,
|
|
2215
|
-
element: n,
|
|
2216
|
-
separator: s,
|
|
2217
|
-
showMove: c,
|
|
2218
|
-
showRemove: l,
|
|
2219
|
-
showAdd: i,
|
|
2220
|
-
createItem: o,
|
|
2221
|
-
addLabel: p,
|
|
2222
|
-
controlsLayout: m,
|
|
2223
|
-
removeDisabled: f,
|
|
2224
|
-
addDisabled: v,
|
|
2225
|
-
...d
|
|
2226
|
-
} = t;
|
|
2227
|
-
return Ht(
|
|
2228
|
-
{
|
|
2229
|
-
...d,
|
|
2230
|
-
content: nn({
|
|
2231
|
-
controller: r,
|
|
2232
|
-
element: n,
|
|
2233
|
-
separator: s,
|
|
2234
|
-
showMove: c,
|
|
2235
|
-
showRemove: l,
|
|
2236
|
-
showAdd: i,
|
|
2237
|
-
createItem: o,
|
|
2238
|
-
addLabel: p,
|
|
2239
|
-
controlsLayout: m,
|
|
2240
|
-
removeDisabled: f,
|
|
2241
|
-
addDisabled: v
|
|
2242
|
-
})
|
|
2243
|
-
},
|
|
2244
|
-
...e
|
|
2245
|
-
);
|
|
2246
|
-
};
|
|
2247
|
-
class Ln extends bt {
|
|
2248
|
-
branches;
|
|
2249
|
-
activeBranch;
|
|
2250
|
-
#e;
|
|
2251
|
-
#t = /* @__PURE__ */ new Map();
|
|
2252
|
-
constructor(e, r, n, s, c, l, i = lt) {
|
|
2253
|
-
super(e, r, n, s, c, i), this.branches = l;
|
|
2254
|
-
const o = (m) => {
|
|
2255
|
-
for (const f of l)
|
|
2256
|
-
if (f.detect(m))
|
|
2257
|
-
return f.key;
|
|
2258
|
-
return l[0]?.key ?? "unknown";
|
|
2259
|
-
};
|
|
2260
|
-
this.activeBranch = n.map(o, lt);
|
|
2261
|
-
const p = (m) => {
|
|
2262
|
-
if (this.#t.has(m))
|
|
2263
|
-
return this.#t.get(m);
|
|
2264
|
-
const f = l.find((d) => d.key === m);
|
|
2265
|
-
if (!f)
|
|
2266
|
-
throw new Error(`Unknown branch: ${m}`);
|
|
2267
|
-
const v = new bt(
|
|
2268
|
-
[...e, m],
|
|
2269
|
-
(d) => {
|
|
2270
|
-
this.change(d);
|
|
2271
|
-
},
|
|
2272
|
-
this.signal.map(
|
|
2273
|
-
(d) => f.detect(d) ? d : f.defaultValue(),
|
|
2274
|
-
i
|
|
2275
|
-
),
|
|
2276
|
-
s.map(Lt([m])),
|
|
2277
|
-
{
|
|
2278
|
-
disabled: this.disabled,
|
|
2279
|
-
validationMode: this.parent.validationMode
|
|
2280
|
-
},
|
|
2281
|
-
i
|
|
2282
|
-
);
|
|
2283
|
-
return this.#t.set(m, v), v;
|
|
2284
|
-
};
|
|
2285
|
-
this.#e = this.activeBranch.map(
|
|
2286
|
-
(m) => p(m),
|
|
2287
|
-
lt
|
|
2288
|
-
), this.onDispose(() => {
|
|
2289
|
-
for (const m of this.#t.values())
|
|
2290
|
-
m.dispose();
|
|
2291
|
-
this.#t.clear(), this.activeBranch.dispose(), this.#e.dispose();
|
|
2292
|
-
});
|
|
2293
|
-
}
|
|
2294
|
-
/**
|
|
2295
|
-
* Get the controller for the currently active branch
|
|
2296
|
-
*/
|
|
2297
|
-
get activeController() {
|
|
2298
|
-
return u.get(this.#e);
|
|
2299
|
-
}
|
|
2300
|
-
/**
|
|
2301
|
-
* Get a controller for a specific branch
|
|
2302
|
-
*/
|
|
2303
|
-
getBranchController(e) {
|
|
2304
|
-
const r = this.branches.find((s) => s.key === e);
|
|
2305
|
-
if (!r)
|
|
2306
|
-
throw new Error(`Unknown branch: ${e}`);
|
|
2307
|
-
if (this.#t.has(e))
|
|
2308
|
-
return this.#t.get(e);
|
|
2309
|
-
const n = new bt(
|
|
2310
|
-
[...this.path, e],
|
|
2311
|
-
(s) => {
|
|
2312
|
-
this.change(s);
|
|
2313
|
-
},
|
|
2314
|
-
this.signal.map(
|
|
2315
|
-
(s) => r.detect(s) ? s : r.defaultValue(),
|
|
2316
|
-
lt
|
|
2317
|
-
),
|
|
2318
|
-
this.status.map(Lt([e])),
|
|
2319
|
-
{
|
|
2320
|
-
disabled: this.disabled,
|
|
2321
|
-
validationMode: this.parent.validationMode
|
|
2322
|
-
},
|
|
2323
|
-
lt
|
|
2324
|
-
);
|
|
2325
|
-
return this.#t.set(e, n), n;
|
|
2326
|
-
}
|
|
2327
|
-
/**
|
|
2328
|
-
* Switch to a different branch
|
|
2329
|
-
*/
|
|
2330
|
-
switchToBranch(e, r = !1) {
|
|
2331
|
-
const n = this.branches.find((l) => l.key === e);
|
|
2332
|
-
if (!n)
|
|
2333
|
-
throw new Error(`Unknown branch: ${e}`);
|
|
2334
|
-
const s = u.get(this.signal);
|
|
2335
|
-
if (n.detect(s))
|
|
2336
|
-
return !0;
|
|
2337
|
-
if (n.convert) {
|
|
2338
|
-
const l = n.convert(s);
|
|
2339
|
-
if (l.ok)
|
|
2340
|
-
return this.change(l.value), !0;
|
|
2341
|
-
}
|
|
2342
|
-
if (r && typeof window == "object" && typeof window.confirm == "function" && !window.confirm(
|
|
2343
|
-
"Changing type will clear the current value. Continue?"
|
|
2344
|
-
))
|
|
2345
|
-
return !1;
|
|
2346
|
-
const c = n.defaultValue();
|
|
2347
|
-
return this.change(c), !0;
|
|
2348
|
-
}
|
|
2349
|
-
/**
|
|
2350
|
-
* Get the current active branch definition
|
|
2351
|
-
*/
|
|
2352
|
-
get activeBranchDefinition() {
|
|
2353
|
-
const e = u.get(this.activeBranch);
|
|
2354
|
-
return this.branches.find((r) => r.key === e);
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
function En(t) {
|
|
2358
|
-
return t.transform(
|
|
2359
|
-
(e) => e ?? null,
|
|
2360
|
-
(e) => e ?? void 0
|
|
2361
|
-
);
|
|
2362
|
-
}
|
|
2363
|
-
function Un(t) {
|
|
2364
|
-
return t.transform(
|
|
2365
|
-
(e) => e ?? "",
|
|
2366
|
-
(e) => e === "" ? void 0 : e
|
|
2367
|
-
);
|
|
2368
|
-
}
|
|
2369
|
-
function Nn(t) {
|
|
2370
|
-
return t.transform(
|
|
2371
|
-
(e) => e ?? void 0,
|
|
2372
|
-
(e) => e ?? null
|
|
2373
|
-
);
|
|
2374
|
-
}
|
|
2375
|
-
export {
|
|
2376
|
-
Sn as A,
|
|
2377
|
-
nn as B,
|
|
2378
|
-
mn as C,
|
|
2379
|
-
Tn as D,
|
|
2380
|
-
Ee as E,
|
|
2381
|
-
ye as F,
|
|
2382
|
-
pt as G,
|
|
2383
|
-
An as H,
|
|
2384
|
-
Fn as I,
|
|
2385
|
-
en as J,
|
|
2386
|
-
Bn as K,
|
|
2387
|
-
Vn as L,
|
|
2388
|
-
Xt as M,
|
|
2389
|
-
ze as N,
|
|
2390
|
-
gn as O,
|
|
2391
|
-
hn as P,
|
|
2392
|
-
Ue as Q,
|
|
2393
|
-
Ge as R,
|
|
2394
|
-
dn as S,
|
|
2395
|
-
Ze as T,
|
|
2396
|
-
Et as U,
|
|
2397
|
-
Mt as V,
|
|
2398
|
-
Qe as W,
|
|
2399
|
-
un as X,
|
|
2400
|
-
pn as _,
|
|
2401
|
-
Y as a,
|
|
2402
|
-
Ln as b,
|
|
2403
|
-
Un as c,
|
|
2404
|
-
tn as d,
|
|
2405
|
-
Z as e,
|
|
2406
|
-
Nn as f,
|
|
2407
|
-
fn as g,
|
|
2408
|
-
$e as h,
|
|
2409
|
-
Me as i,
|
|
2410
|
-
bn as j,
|
|
2411
|
-
Oe as k,
|
|
2412
|
-
Re as l,
|
|
2413
|
-
vn as m,
|
|
2414
|
-
nt as n,
|
|
2415
|
-
xn as o,
|
|
2416
|
-
wn as p,
|
|
2417
|
-
yn as q,
|
|
2418
|
-
$n as r,
|
|
2419
|
-
kn as s,
|
|
2420
|
-
En as t,
|
|
2421
|
-
_n as u,
|
|
2422
|
-
In as v,
|
|
2423
|
-
Cn as w,
|
|
2424
|
-
Mn as x,
|
|
2425
|
-
Ye as y,
|
|
2426
|
-
Dn as z
|
|
2427
|
-
};
|