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