@tempots/beatui 1.7.5 → 1.9.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/dist/{ar-Wr6gMs-M.cjs → ar-CEzAem0F.cjs} +1 -1
- package/dist/{ar-fdUqbCvM.js → ar-CQieaqsq.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-B8yr-E_b.cjs +1 -0
- package/dist/{auth-divider-D9KnNeyF.js → auth-divider-Byh5BWLc.js} +91 -88
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +27 -26
- package/dist/card-BkA7Wvbh.cjs +1 -0
- package/dist/card-DX1DwGbL.js +62 -0
- package/dist/{colors-C2sgnzFH.js → colors-CyMhfbJi.js} +64 -58
- package/dist/{colors-DPCHjRMj.cjs → colors-IXZF9U-s.cjs} +1 -1
- package/dist/control-hqEuMzyI.js +343 -0
- package/dist/control-muup9GF1.cjs +1 -0
- package/dist/custom-validation-BA9iJWl_.cjs +1 -0
- package/dist/custom-validation-BOBoUwHY.js +181 -0
- package/dist/{de-C5-k5Eov.js → de-CBIwvkAH.js} +1 -1
- package/dist/{de-DZqdSEta.cjs → de-DdfxrlT3.cjs} +1 -1
- package/dist/deep-merge-8fwp1z4X.js +1346 -0
- package/dist/deep-merge-VDGE_HQD.cjs +1 -0
- package/dist/duration-input-DmsljXl3.cjs +1 -0
- package/dist/{duration-input-D4V_PHIg.js → duration-input-ZQlcqdXU.js} +32 -31
- package/dist/{editor-toolbar-group-FpOHrmtx.js → editor-toolbar-group-BNTBMJCe.js} +2 -2
- package/dist/{editor-toolbar-group-C_ft_T8D.cjs → editor-toolbar-group-DiMzqYgz.cjs} +1 -1
- package/dist/{es-h6jmoF4X.js → es--9HaEj2D.js} +1 -1
- package/dist/{es-CJgYfRap.cjs → es-DSdljxFJ.cjs} +1 -1
- package/dist/{fa-BuxK837l.js → fa-1Z-akcW7.js} +1 -1
- package/dist/{fa-BQ5PzwNY.cjs → fa-BolmeWRT.cjs} +1 -1
- package/dist/flyout-CuKFh_T7.js +151 -0
- package/dist/flyout-DC_tKaTG.cjs +1 -0
- package/dist/{fr-Bv3TG44U.cjs → fr-CODgUuoZ.cjs} +1 -1
- package/dist/{fr-BwILQ9G2.js → fr-DhHM9rou.js} +1 -1
- package/dist/{he-yC9Sc7JD.js → he-CBamXbGJ.js} +1 -1
- package/dist/{he-5LbvgMCC.cjs → he-Juw-dr28.cjs} +1 -1
- package/dist/{hi-Da7rcCpP.js → hi-DvvcX-Ra.js} +1 -1
- package/dist/{hi-YWhWcG_L.cjs → hi-R749jeg-.cjs} +1 -1
- package/dist/{index-CvU9E9wd.js → index-BfQaT5Jy.js} +104 -104
- package/dist/{index-XogEKwdt.cjs → index-Dv7nPuwA.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6713 -9831
- package/dist/{input-container-CyOgiiQD.cjs → input-container-BaWQLWB6.cjs} +1 -1
- package/dist/{input-container-8JFB11xN.js → input-container-DCS5oJ4S.js} +4 -4
- package/dist/{it-BxOIJE45.cjs → it-DT5oRZDH.cjs} +1 -1
- package/dist/{it-Yeklau78.js → it-aV6i8Qxz.js} +1 -1
- package/dist/{ja-Dxj9Q5Yd.js → ja-CuLhGnJX.js} +1 -1
- package/dist/{ja-CNhjK06P.cjs → ja-CwKaCYLB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +83 -79
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +74 -72
- package/dist/{ko-DgkqcXTs.cjs → ko-Bucro9ID.cjs} +1 -1
- package/dist/{ko-gn_MsegK.js → ko-D-66BsEX.js} +1 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +5 -5
- package/dist/menu-BFLFKceF.cjs +1 -0
- package/dist/menu-BO6zqyfq.js +220 -0
- package/dist/modal-6Mq3vS5r.js +309 -0
- package/dist/modal-d77-TMc4.cjs +1 -0
- package/dist/{nl-vHNFtXXb.js → nl-CAny6wvm.js} +1 -1
- package/dist/{nl-Dy9lmbBO.cjs → nl-D7vHpehb.cjs} +1 -1
- package/dist/notice-BNGx86Yg.js +110 -0
- package/dist/notice-iF6zBMq9.cjs +1 -0
- package/dist/{oneof-branch-detection-Q_jxvJIA.js → oneof-branch-detection-Bm17RhC2.js} +27 -26
- package/dist/oneof-branch-detection-DZ4MrfBp.cjs +1 -0
- package/dist/openui/index.cjs.js +9 -0
- package/dist/openui/index.es.js +2174 -0
- package/dist/password-input-Bipt7Wsu.cjs +1 -0
- package/dist/password-input-mkRmrEPq.js +105 -0
- package/dist/{pl-BtYbtsmG.cjs → pl-CSiXoOKT.cjs} +1 -1
- package/dist/{pl-C0UdHla0.js → pl-rmZLgQ_V.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/{pt-CtNmqQ1X.cjs → pt-CJT-iq4y.cjs} +1 -1
- package/dist/{pt-DGKtfN0d.js → pt-DHnajqAi.js} +1 -1
- package/dist/{ru-CpXYLt-v.js → ru-C_E8OZNE.js} +1 -1
- package/dist/{ru-BaL_NPRU.cjs → ru-G3sr_ctV.cjs} +1 -1
- package/dist/slider-input-SLguFA0d.cjs +1 -0
- package/dist/slider-input-VYAMm7pE.js +285 -0
- package/dist/stepper-24p16Zsv.cjs +1 -0
- package/dist/stepper-TlzbfYWa.js +3222 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +38 -40
- package/dist/tailwind/vite-plugin.cjs.js +14 -12
- package/dist/tailwind/vite-plugin.es.js +317 -246
- package/dist/text-area-BdemKQ_w.cjs +1 -0
- package/dist/text-area-Br83-_PQ.js +431 -0
- package/dist/{text-input-NJypZSnE.js → text-input-ByuxdX8w.js} +5 -5
- package/dist/{text-input-DS5zlXb2.cjs → text-input-MjlUC_9u.cjs} +1 -1
- package/dist/{toolbar-BF2L6WKC.js → toolbar-CEBTTjHh.js} +1 -1
- package/dist/{toolbar-BBwfe8U9.cjs → toolbar-DWawYFFX.cjs} +1 -1
- package/dist/{tr-DwOd87oB.cjs → tr-DcxLHHTC.cjs} +1 -1
- package/dist/{tr-DIFZDFW_.js → tr-bVXwloKC.js} +1 -1
- package/dist/{translations-EwEmHe3v.cjs → translations-D3xqZUTA.cjs} +1 -1
- package/dist/{translations-BCMP-h52.js → translations-DU9wTV1y.js} +20 -19
- package/dist/{translations-5cXBrENb.js → translations-RT_UN8ny.js} +1 -1
- package/dist/{translations-BqWc0ZHz.cjs → translations-qljG2Chq.cjs} +1 -1
- package/dist/types/components/navigation/stepper.d.ts +4 -4
- package/dist/types/openui/index.d.ts +28 -0
- package/dist/types/openui/library/define-component.d.ts +15 -0
- package/dist/types/openui/library/library.d.ts +7 -0
- package/dist/types/openui/library/prompt-generator.d.ts +5 -0
- package/dist/types/openui/library/types.d.ts +33 -0
- package/dist/types/openui/parser/parser.d.ts +8 -0
- package/dist/types/openui/parser/streaming-parser.d.ts +14 -0
- package/dist/types/openui/parser/tokenizer.d.ts +9 -0
- package/dist/types/openui/parser/types.d.ts +46 -0
- package/dist/types/openui/registry/button.d.ts +148 -0
- package/dist/types/openui/registry/data.d.ts +177 -0
- package/dist/types/openui/registry/form.d.ts +65 -0
- package/dist/types/openui/registry/format.d.ts +67 -0
- package/dist/types/openui/registry/index.d.ts +9 -0
- package/dist/types/openui/registry/layout.d.ts +45 -0
- package/dist/types/openui/registry/navigation.d.ts +149 -0
- package/dist/types/openui/registry/overlay.d.ts +56 -0
- package/dist/types/openui/registry/typography.d.ts +17 -0
- package/dist/types/openui/renderer/action-context.d.ts +24 -0
- package/dist/types/openui/renderer/node-resolver.d.ts +9 -0
- package/dist/types/openui/renderer/openui-renderer.d.ts +32 -0
- package/dist/types/openui/renderer/skeleton.d.ts +2 -0
- package/dist/types/openui/streaming/from-fetch.d.ts +7 -0
- package/dist/types/openui/streaming/from-sse.d.ts +7 -0
- package/dist/types/openui/streaming/from-websocket.d.ts +10 -0
- package/dist/types/openui/streaming/types.d.ts +5 -0
- package/dist/types/tailwind/preset.d.ts +25 -4
- package/dist/types/tailwind/vite-plugin.d.ts +17 -5
- package/dist/types/tokens/colors.d.ts +87 -9
- package/dist/types/tokens/index.d.ts +7 -6
- package/dist/{ur-DBst-TXc.js → ur-Dls2qb4V.js} +1 -1
- package/dist/{ur-D9nLchps.cjs → ur-IRQoHh1E.cjs} +1 -1
- package/dist/use-form-BZ8vDYOv.cjs +2 -0
- package/dist/use-form-DsCzINfm.js +750 -0
- package/dist/utils-D3-NApSw.cjs +1 -0
- package/dist/utils-Nbh7yQ73.js +105 -0
- package/dist/{vi-Dg1aiMr5.cjs → vi-Bi9SvVCP.cjs} +1 -1
- package/dist/{vi-DQOJp32U.js → vi-C3mTzj50.js} +1 -1
- package/dist/widget-customization-BV6XB2v_.cjs +1 -0
- package/dist/widget-customization-Bso45ONQ.js +1198 -0
- package/dist/{zh-DPK4HXl2.js → zh-B4JRJBt2.js} +1 -1
- package/dist/{zh-tbwSTbmn.cjs → zh-BMU5rYu1.cjs} +1 -1
- package/package.json +31 -20
- package/dist/auth-divider-CjcrgXmq.cjs +0 -1
- package/dist/custom-validation-7por5nJN.js +0 -488
- package/dist/custom-validation-CLscGHY4.cjs +0 -1
- package/dist/deep-merge-D90SW1Ci.cjs +0 -1
- package/dist/deep-merge-DT2H9AGq.js +0 -1765
- package/dist/duration-input-4AQnQpyo.cjs +0 -1
- package/dist/menu-B60Q9j3-.cjs +0 -1
- package/dist/menu-BkqFGcXg.js +0 -366
- package/dist/notice-CQGJyZ8o.js +0 -211
- package/dist/notice-p2IqXS5-.cjs +0 -1
- package/dist/oneof-branch-detection-xDDDdYRk.cjs +0 -1
- package/dist/use-form-8NnZ-KHk.js +0 -1090
- package/dist/use-form-Dcra7GeE.cjs +0 -2
- package/dist/utils-DmEuG3Np.cjs +0 -1
- package/dist/utils-vUtP6iPG.js +0 -165
- package/dist/widget-customization-BIBva3f-.js +0 -1458
- package/dist/widget-customization-pqmtsraC.cjs +0 -1
|
@@ -1,1458 +0,0 @@
|
|
|
1
|
-
import { Value as h, prop as _t, computedOf as V, html as v, attr as u, svg as yt, svgAttr as st, Empty as T, on as $, When as Q, Fragment as Z, aria as E, emitValue as pt, Use as se, input as Ft, emitValueAsNullableDate as $t, emitValueAsNullableDateTime as kt, Repeat as le, emit as oe, style as ie, emitValueAsNumber as z } from "@tempots/dom";
|
|
2
|
-
import { F as ce, N as J, T as ue, U as he, a as pe } from "./deep-merge-DT2H9AGq.js";
|
|
3
|
-
import { decodeBase64 as de } from "@tempots/std";
|
|
4
|
-
import { I as X } from "./input-container-8JFB11xN.js";
|
|
5
|
-
import { C as Y, m as Ct, T as ge } from "./text-input-NJypZSnE.js";
|
|
6
|
-
import { B as be, I as ut, b as Mt, a as me } from "./translations-BCMP-h52.js";
|
|
7
|
-
import { AutoSelect as fe } from "@tempots/ui";
|
|
8
|
-
import { E as we, P as ye } from "./notice-CQGJyZ8o.js";
|
|
9
|
-
import { s as $e } from "./session-id-3KiilioY.js";
|
|
10
|
-
import { r as ke } from "./utils-vUtP6iPG.js";
|
|
11
|
-
async function Me(t) {
|
|
12
|
-
return new Promise((e, r) => {
|
|
13
|
-
const a = new FileReader();
|
|
14
|
-
a.readAsDataURL(t), a.onload = () => {
|
|
15
|
-
const n = a.result;
|
|
16
|
-
e(n.split(",")[1]);
|
|
17
|
-
}, a.onerror = (n) => r(n);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function ve(t) {
|
|
21
|
-
return Promise.all(t.map(Me));
|
|
22
|
-
}
|
|
23
|
-
function Ie(t) {
|
|
24
|
-
if (t.length >= 4) {
|
|
25
|
-
if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
|
|
26
|
-
return "image/png";
|
|
27
|
-
if (t[0] === 255 && t[1] === 216) return "image/jpeg";
|
|
28
|
-
if (t[0] === 71 && t[1] === 73 && t[2] === 70)
|
|
29
|
-
return "image/gif";
|
|
30
|
-
if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t.length >= 12 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
|
|
31
|
-
return "image/webp";
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
if (new TextDecoder("utf-8").decode(t.slice(0, 256)).includes("<svg")) return "image/svg+xml";
|
|
35
|
-
} catch {
|
|
36
|
-
}
|
|
37
|
-
return "application/octet-stream";
|
|
38
|
-
}
|
|
39
|
-
function xe(t) {
|
|
40
|
-
const e = de(t ?? ""), r = e.length, a = new Uint8Array(r);
|
|
41
|
-
for (let n = 0; n < r; n++) a[n] = e.charCodeAt(n);
|
|
42
|
-
return a;
|
|
43
|
-
}
|
|
44
|
-
function _e(t) {
|
|
45
|
-
const {
|
|
46
|
-
value: e,
|
|
47
|
-
onChange: r,
|
|
48
|
-
onInput: a,
|
|
49
|
-
...n
|
|
50
|
-
} = t, s = /* @__PURE__ */ new Map(), l = h.toSignal(e).map((w) => w.map((f, x) => {
|
|
51
|
-
const b = s.get(f), m = xe(f ?? ""), S = b?.type || Ie(m), N = b?.name ?? `file-${x}`, F = m.buffer.slice(
|
|
52
|
-
m.byteOffset,
|
|
53
|
-
m.byteOffset + m.byteLength
|
|
54
|
-
), y = new Blob([F], { type: S });
|
|
55
|
-
return new File([y], N, { type: S });
|
|
56
|
-
})), o = (w) => (f) => {
|
|
57
|
-
w && ve(f).then((x) => {
|
|
58
|
-
for (const [b, m] of x.entries())
|
|
59
|
-
s.set(m, { name: f[b].name, type: f[b].type });
|
|
60
|
-
w(x);
|
|
61
|
-
});
|
|
62
|
-
}, i = o(r), c = o(a);
|
|
63
|
-
return ce({
|
|
64
|
-
...n,
|
|
65
|
-
value: l,
|
|
66
|
-
onChange: i,
|
|
67
|
-
onInput: c
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function Xr(t) {
|
|
71
|
-
const {
|
|
72
|
-
value: e,
|
|
73
|
-
onInput: r,
|
|
74
|
-
onChange: a,
|
|
75
|
-
...n
|
|
76
|
-
} = t;
|
|
77
|
-
return _e({
|
|
78
|
-
...n,
|
|
79
|
-
maxFiles: 1,
|
|
80
|
-
value: h.map(e, (s) => s == null ? [] : [s]),
|
|
81
|
-
onChange: (s) => {
|
|
82
|
-
a?.(s[0]);
|
|
83
|
-
},
|
|
84
|
-
onInput: (s) => {
|
|
85
|
-
r?.(s[0]);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
let R = class extends Error {
|
|
90
|
-
constructor(e) {
|
|
91
|
-
super(e), this.name = "ParsingError";
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const d = (t, e, r) => Math.min(Math.max(t, e), r), j = (t, e, r) => Math.trunc(d(t, e, r)), B = (t, e) => {
|
|
95
|
-
const r = Math.pow(10, e);
|
|
96
|
-
return Math.round(t * r) / r;
|
|
97
|
-
}, U = (t, e) => (t = t % e, t < 0 && (t += e), t), dt = {
|
|
98
|
-
aliceblue: [240, 248, 255],
|
|
99
|
-
antiquewhite: [250, 235, 215],
|
|
100
|
-
aqua: [0, 255, 255],
|
|
101
|
-
aquamarine: [127, 255, 212],
|
|
102
|
-
azure: [240, 255, 255],
|
|
103
|
-
beige: [245, 245, 220],
|
|
104
|
-
bisque: [255, 228, 196],
|
|
105
|
-
black: [0, 0, 0],
|
|
106
|
-
blanchedalmond: [255, 235, 205],
|
|
107
|
-
blue: [0, 0, 255],
|
|
108
|
-
blueviolet: [138, 43, 226],
|
|
109
|
-
brown: [165, 42, 42],
|
|
110
|
-
burlywood: [222, 184, 135],
|
|
111
|
-
cadetblue: [95, 158, 160],
|
|
112
|
-
chartreuse: [127, 255, 0],
|
|
113
|
-
chocolate: [210, 105, 30],
|
|
114
|
-
coral: [255, 127, 80],
|
|
115
|
-
cornflowerblue: [100, 149, 237],
|
|
116
|
-
cornsilk: [255, 248, 220],
|
|
117
|
-
crimson: [220, 20, 60],
|
|
118
|
-
cyan: [0, 255, 255],
|
|
119
|
-
darkblue: [0, 0, 139],
|
|
120
|
-
darkcyan: [0, 139, 139],
|
|
121
|
-
darkgoldenrod: [184, 134, 11],
|
|
122
|
-
darkgray: [169, 169, 169],
|
|
123
|
-
darkgreen: [0, 100, 0],
|
|
124
|
-
darkgrey: [169, 169, 169],
|
|
125
|
-
darkkhaki: [189, 183, 107],
|
|
126
|
-
darkmagenta: [139, 0, 139],
|
|
127
|
-
darkolivegreen: [85, 107, 47],
|
|
128
|
-
darkorange: [255, 140, 0],
|
|
129
|
-
darkorchid: [153, 50, 204],
|
|
130
|
-
darkred: [139, 0, 0],
|
|
131
|
-
darksalmon: [233, 150, 122],
|
|
132
|
-
darkseagreen: [143, 188, 143],
|
|
133
|
-
darkslateblue: [72, 61, 139],
|
|
134
|
-
darkslategray: [47, 79, 79],
|
|
135
|
-
darkslategrey: [47, 79, 79],
|
|
136
|
-
darkturquoise: [0, 206, 209],
|
|
137
|
-
darkviolet: [148, 0, 211],
|
|
138
|
-
deeppink: [255, 20, 147],
|
|
139
|
-
deepskyblue: [0, 191, 255],
|
|
140
|
-
dimgray: [105, 105, 105],
|
|
141
|
-
dimgrey: [105, 105, 105],
|
|
142
|
-
dodgerblue: [30, 144, 255],
|
|
143
|
-
firebrick: [178, 34, 34],
|
|
144
|
-
floralwhite: [255, 250, 240],
|
|
145
|
-
forestgreen: [34, 139, 34],
|
|
146
|
-
fuchsia: [255, 0, 255],
|
|
147
|
-
gainsboro: [220, 220, 220],
|
|
148
|
-
ghostwhite: [248, 248, 255],
|
|
149
|
-
gold: [255, 215, 0],
|
|
150
|
-
goldenrod: [218, 165, 32],
|
|
151
|
-
gray: [128, 128, 128],
|
|
152
|
-
green: [0, 128, 0],
|
|
153
|
-
greenyellow: [173, 255, 47],
|
|
154
|
-
grey: [128, 128, 128],
|
|
155
|
-
honeydew: [240, 255, 240],
|
|
156
|
-
hotpink: [255, 105, 180],
|
|
157
|
-
indianred: [205, 92, 92],
|
|
158
|
-
indigo: [75, 0, 130],
|
|
159
|
-
ivory: [255, 255, 240],
|
|
160
|
-
khaki: [240, 230, 140],
|
|
161
|
-
lavender: [230, 230, 250],
|
|
162
|
-
lavenderblush: [255, 240, 245],
|
|
163
|
-
lawngreen: [124, 252, 0],
|
|
164
|
-
lemonchiffon: [255, 250, 205],
|
|
165
|
-
lightblue: [173, 216, 230],
|
|
166
|
-
lightcoral: [240, 128, 128],
|
|
167
|
-
lightcyan: [224, 255, 255],
|
|
168
|
-
lightgoldenrodyellow: [250, 250, 210],
|
|
169
|
-
lightgray: [211, 211, 211],
|
|
170
|
-
lightgreen: [144, 238, 144],
|
|
171
|
-
lightgrey: [211, 211, 211],
|
|
172
|
-
lightpink: [255, 182, 193],
|
|
173
|
-
lightsalmon: [255, 160, 122],
|
|
174
|
-
lightseagreen: [32, 178, 170],
|
|
175
|
-
lightskyblue: [135, 206, 250],
|
|
176
|
-
lightslategray: [119, 136, 153],
|
|
177
|
-
lightslategrey: [119, 136, 153],
|
|
178
|
-
lightsteelblue: [176, 196, 222],
|
|
179
|
-
lightyellow: [255, 255, 224],
|
|
180
|
-
lime: [0, 255, 0],
|
|
181
|
-
limegreen: [50, 205, 50],
|
|
182
|
-
linen: [250, 240, 230],
|
|
183
|
-
magenta: [255, 0, 255],
|
|
184
|
-
maroon: [128, 0, 0],
|
|
185
|
-
mediumaquamarine: [102, 205, 170],
|
|
186
|
-
mediumblue: [0, 0, 205],
|
|
187
|
-
mediumorchid: [186, 85, 211],
|
|
188
|
-
mediumpurple: [147, 112, 219],
|
|
189
|
-
mediumseagreen: [60, 179, 113],
|
|
190
|
-
mediumslateblue: [123, 104, 238],
|
|
191
|
-
mediumspringgreen: [0, 250, 154],
|
|
192
|
-
mediumturquoise: [72, 209, 204],
|
|
193
|
-
mediumvioletred: [199, 21, 133],
|
|
194
|
-
midnightblue: [25, 25, 112],
|
|
195
|
-
mintcream: [245, 255, 250],
|
|
196
|
-
mistyrose: [255, 228, 225],
|
|
197
|
-
moccasin: [255, 228, 181],
|
|
198
|
-
navajowhite: [255, 222, 173],
|
|
199
|
-
navy: [0, 0, 128],
|
|
200
|
-
oldlace: [253, 245, 230],
|
|
201
|
-
olive: [128, 128, 0],
|
|
202
|
-
olivedrab: [107, 142, 35],
|
|
203
|
-
orange: [255, 165, 0],
|
|
204
|
-
orangered: [255, 69, 0],
|
|
205
|
-
orchid: [218, 112, 214],
|
|
206
|
-
palegoldenrod: [238, 232, 170],
|
|
207
|
-
palegreen: [152, 251, 152],
|
|
208
|
-
paleturquoise: [175, 238, 238],
|
|
209
|
-
palevioletred: [219, 112, 147],
|
|
210
|
-
papayawhip: [255, 239, 213],
|
|
211
|
-
peachpuff: [255, 218, 185],
|
|
212
|
-
peru: [205, 133, 63],
|
|
213
|
-
pink: [255, 192, 203],
|
|
214
|
-
plum: [221, 160, 221],
|
|
215
|
-
powderblue: [176, 224, 230],
|
|
216
|
-
purple: [128, 0, 128],
|
|
217
|
-
rebeccapurple: [102, 51, 153],
|
|
218
|
-
red: [255, 0, 0],
|
|
219
|
-
rosybrown: [188, 143, 143],
|
|
220
|
-
royalblue: [65, 105, 225],
|
|
221
|
-
saddlebrown: [139, 69, 19],
|
|
222
|
-
salmon: [250, 128, 114],
|
|
223
|
-
sandybrown: [244, 164, 96],
|
|
224
|
-
seagreen: [46, 139, 87],
|
|
225
|
-
seashell: [255, 245, 238],
|
|
226
|
-
sienna: [160, 82, 45],
|
|
227
|
-
silver: [192, 192, 192],
|
|
228
|
-
skyblue: [135, 206, 235],
|
|
229
|
-
slateblue: [106, 90, 205],
|
|
230
|
-
slategray: [112, 128, 144],
|
|
231
|
-
slategrey: [112, 128, 144],
|
|
232
|
-
snow: [255, 250, 250],
|
|
233
|
-
springgreen: [0, 255, 127],
|
|
234
|
-
steelblue: [70, 130, 180],
|
|
235
|
-
tan: [210, 180, 140],
|
|
236
|
-
teal: [0, 128, 128],
|
|
237
|
-
thistle: [216, 191, 216],
|
|
238
|
-
tomato: [255, 99, 71],
|
|
239
|
-
turquoise: [64, 224, 208],
|
|
240
|
-
violet: [238, 130, 238],
|
|
241
|
-
wheat: [245, 222, 179],
|
|
242
|
-
white: [255, 255, 255],
|
|
243
|
-
whitesmoke: [245, 245, 245],
|
|
244
|
-
yellow: [255, 255, 0],
|
|
245
|
-
yellowgreen: [154, 205, 50]
|
|
246
|
-
}, Tt = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, St = /^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*(?:,\s*([\d.]+%?)\s*)?\)$/i, At = /^rgba?\(\s*(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, Fe = (t) => Tt.test(t.trim()), Ce = (t) => {
|
|
247
|
-
const e = t.trim(), r = Tt.exec(e);
|
|
248
|
-
if (!r) throw new R(`Invalid hex color: '${t}'`);
|
|
249
|
-
const a = r[1];
|
|
250
|
-
return a.length === 3 ? A(
|
|
251
|
-
parseInt(a[0] + a[0], 16),
|
|
252
|
-
parseInt(a[1] + a[1], 16),
|
|
253
|
-
parseInt(a[2] + a[2], 16)
|
|
254
|
-
) : a.length === 4 ? A(
|
|
255
|
-
parseInt(a[0] + a[0], 16),
|
|
256
|
-
parseInt(a[1] + a[1], 16),
|
|
257
|
-
parseInt(a[2] + a[2], 16),
|
|
258
|
-
parseInt(a[3] + a[3], 16) / 255
|
|
259
|
-
) : a.length === 6 ? A(
|
|
260
|
-
parseInt(a.slice(0, 2), 16),
|
|
261
|
-
parseInt(a.slice(2, 4), 16),
|
|
262
|
-
parseInt(a.slice(4, 6), 16)
|
|
263
|
-
) : A(
|
|
264
|
-
parseInt(a.slice(0, 2), 16),
|
|
265
|
-
parseInt(a.slice(2, 4), 16),
|
|
266
|
-
parseInt(a.slice(4, 6), 16),
|
|
267
|
-
parseInt(a.slice(6, 8), 16) / 255
|
|
268
|
-
);
|
|
269
|
-
}, Te = (t) => {
|
|
270
|
-
const e = t.trim();
|
|
271
|
-
return St.test(e) || At.test(e);
|
|
272
|
-
}, Se = (t) => {
|
|
273
|
-
const e = t.trim(), r = St.exec(e) ?? At.exec(e);
|
|
274
|
-
if (!r) throw new R(`Invalid rgb color: '${t}'`);
|
|
275
|
-
return A(
|
|
276
|
-
j(parseFloat(r[1]), 0, 255),
|
|
277
|
-
j(parseFloat(r[2]), 0, 255),
|
|
278
|
-
j(parseFloat(r[3]), 0, 255),
|
|
279
|
-
O(r[4])
|
|
280
|
-
);
|
|
281
|
-
}, Ae = (t) => t.trim().toLowerCase() in dt, Ne = (t) => {
|
|
282
|
-
const e = t.trim().toLowerCase(), r = dt[e];
|
|
283
|
-
if (!r) throw new R(`Unknown named color: '${t}'`);
|
|
284
|
-
return A(r[0], r[1], r[2]);
|
|
285
|
-
}, vt = (t) => t.alpha >= 1 ? `rgb(${t.r}, ${t.g}, ${t.b})` : `rgba(${t.r}, ${t.g}, ${t.b}, ${t.alpha})`, Nt = /^hsla?\(\s*(-?\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%\s*(?:,\s*([\d.]+%?)\s*)?\)$/i, Wt = /^hsla?\(\s*(-?\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, We = (t) => {
|
|
286
|
-
const e = t.trim();
|
|
287
|
-
return Nt.test(e) || Wt.test(e);
|
|
288
|
-
}, Be = (t) => {
|
|
289
|
-
const e = t.trim(), r = Nt.exec(e) ?? Wt.exec(e);
|
|
290
|
-
if (!r) throw new R(`Invalid hsl color: '${t}'`);
|
|
291
|
-
return ht(
|
|
292
|
-
parseFloat(r[1]),
|
|
293
|
-
d(parseFloat(r[2]) / 100, 0, 1),
|
|
294
|
-
d(parseFloat(r[3]) / 100, 0, 1),
|
|
295
|
-
O(r[4])
|
|
296
|
-
);
|
|
297
|
-
}, De = (t) => {
|
|
298
|
-
const e = t.r / 255, r = t.g / 255, a = t.b / 255, n = Math.max(e, r, a), s = Math.min(e, r, a), l = n - s, o = (n + s) / 2;
|
|
299
|
-
if (l === 0)
|
|
300
|
-
return ht(0, 0, o, t.alpha);
|
|
301
|
-
const i = l / (1 - Math.abs(2 * o - 1));
|
|
302
|
-
let c;
|
|
303
|
-
return n === e ? c = (r - a) / l % 6 : n === r ? c = (a - e) / l + 2 : c = (e - r) / l + 4, c *= 60, c < 0 && (c += 360), ht(c, i, o, t.alpha);
|
|
304
|
-
}, Ee = (t) => {
|
|
305
|
-
const e = t.s, r = t.l, a = U(t.h, 360), n = (1 - Math.abs(2 * r - 1)) * e, s = n * (1 - Math.abs(a / 60 % 2 - 1)), l = r - n / 2;
|
|
306
|
-
let o, i, c;
|
|
307
|
-
return a < 60 ? (o = n, i = s, c = 0) : a < 120 ? (o = s, i = n, c = 0) : a < 180 ? (o = 0, i = n, c = s) : a < 240 ? (o = 0, i = s, c = n) : a < 300 ? (o = s, i = 0, c = n) : (o = n, i = 0, c = s), A(
|
|
308
|
-
Math.round((o + l) * 255),
|
|
309
|
-
Math.round((i + l) * 255),
|
|
310
|
-
Math.round((c + l) * 255),
|
|
311
|
-
t.alpha
|
|
312
|
-
);
|
|
313
|
-
}, Re = (t) => {
|
|
314
|
-
const e = lt(t.h), r = lt(t.s * 100), a = lt(t.l * 100);
|
|
315
|
-
return t.alpha >= 1 ? `hsl(${e}, ${r}%, ${a}%)` : `hsla(${e}, ${r}%, ${a}%, ${t.alpha})`;
|
|
316
|
-
}, lt = (t) => Math.round(t * 100) / 100, Bt = /^hsva?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+%?)\s*)?\)$/i, Dt = /^hsva?\(\s*([\d.]+)\s+([\d.]+)%\s+([\d.]+)%\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, Pe = (t) => {
|
|
317
|
-
const e = t.trim();
|
|
318
|
-
return Bt.test(e) || Dt.test(e);
|
|
319
|
-
}, Ue = (t) => {
|
|
320
|
-
const e = t.trim(), r = Bt.exec(e) ?? Dt.exec(e);
|
|
321
|
-
if (!r) throw new R(`Invalid hsv color: '${t}'`);
|
|
322
|
-
return Qt(
|
|
323
|
-
U(parseFloat(r[1]), 360),
|
|
324
|
-
d(parseFloat(r[2]) / 100, 0, 1),
|
|
325
|
-
d(parseFloat(r[3]) / 100, 0, 1),
|
|
326
|
-
O(r[4])
|
|
327
|
-
);
|
|
328
|
-
}, Ve = (t) => {
|
|
329
|
-
const e = t.r / 255, r = t.g / 255, a = t.b / 255, n = Math.max(e, r, a), s = Math.min(e, r, a), l = n - s, o = n, i = n === 0 ? 0 : l / n;
|
|
330
|
-
let c = 0;
|
|
331
|
-
return l !== 0 && (n === e ? c = (r - a) / l % 6 : n === r ? c = (a - e) / l + 2 : c = (e - r) / l + 4, c *= 60, c < 0 && (c += 360)), Qt(c, i, o, t.alpha);
|
|
332
|
-
}, Oe = (t) => {
|
|
333
|
-
const e = t.s, r = t.v, a = r * e, n = a * (1 - Math.abs(t.h / 60 % 2 - 1)), s = r - a;
|
|
334
|
-
let l = 0, o = 0, i = 0;
|
|
335
|
-
const c = t.h;
|
|
336
|
-
return c < 60 ? (l = a, o = n) : c < 120 ? (l = n, o = a) : c < 180 ? (o = a, i = n) : c < 240 ? (o = n, i = a) : c < 300 ? (l = n, i = a) : (l = a, i = n), A(
|
|
337
|
-
Math.round((l + s) * 255),
|
|
338
|
-
Math.round((o + s) * 255),
|
|
339
|
-
Math.round((i + s) * 255),
|
|
340
|
-
t.alpha
|
|
341
|
-
);
|
|
342
|
-
}, qe = (t) => t.alpha >= 1 ? `hsv(${t.h}, ${t.s * 100}%, ${t.v * 100}%)` : `hsva(${t.h}, ${t.s * 100}%, ${t.v * 100}%, ${t.alpha})`, Et = /^hwb\(\s*(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, ze = (t) => Et.test(t.trim()), je = (t) => {
|
|
343
|
-
const e = t.trim(), r = Et.exec(e);
|
|
344
|
-
if (!r) throw new R(`Invalid hwb color: '${t}'`);
|
|
345
|
-
return Zt(
|
|
346
|
-
parseFloat(r[1]),
|
|
347
|
-
d(parseFloat(r[2]) / 100, 0, 1),
|
|
348
|
-
d(parseFloat(r[3]) / 100, 0, 1),
|
|
349
|
-
O(r[4])
|
|
350
|
-
);
|
|
351
|
-
}, Le = (t) => {
|
|
352
|
-
const e = t.r / 255, r = t.g / 255, a = t.b / 255, n = Math.max(e, r, a), s = Math.min(e, r, a), l = n - s;
|
|
353
|
-
let o;
|
|
354
|
-
l === 0 ? o = 0 : n === e ? o = (r - a) / l * 60 : n === r ? o = ((a - e) / l + 2) * 60 : o = ((e - r) / l + 4) * 60, o < 0 && (o += 360);
|
|
355
|
-
const i = s, c = 1 - n;
|
|
356
|
-
return Zt(o, i, c, t.alpha);
|
|
357
|
-
}, Xe = (t) => {
|
|
358
|
-
let e = t.w, r = t.b;
|
|
359
|
-
if (e + r >= 1) {
|
|
360
|
-
const b = 1 / (e + r);
|
|
361
|
-
e *= b, r *= b;
|
|
362
|
-
}
|
|
363
|
-
const a = U(t.h, 360) / 60, n = Math.floor(a) % 6, s = a - Math.floor(a);
|
|
364
|
-
let l, o, i;
|
|
365
|
-
switch (n) {
|
|
366
|
-
case 0:
|
|
367
|
-
l = 1, o = s, i = 0;
|
|
368
|
-
break;
|
|
369
|
-
case 1:
|
|
370
|
-
l = 1 - s, o = 1, i = 0;
|
|
371
|
-
break;
|
|
372
|
-
case 2:
|
|
373
|
-
l = 0, o = 1, i = s;
|
|
374
|
-
break;
|
|
375
|
-
case 3:
|
|
376
|
-
l = 0, o = 1 - s, i = 1;
|
|
377
|
-
break;
|
|
378
|
-
case 4:
|
|
379
|
-
l = s, o = 0, i = 1;
|
|
380
|
-
break;
|
|
381
|
-
default:
|
|
382
|
-
l = 1, o = 0, i = 1 - s;
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
const c = 1 - e - r, w = d(Math.round((l * c + e) * 255), 0, 255), f = d(Math.round((o * c + e) * 255), 0, 255), x = d(Math.round((i * c + e) * 255), 0, 255);
|
|
386
|
-
return A(w, f, x, t.alpha);
|
|
387
|
-
}, Ye = (t) => t.alpha >= 1 ? `hwb(${t.h} ${t.w * 100}% ${t.b * 100}%)` : `hwb(${t.h} ${t.w * 100}% ${t.b * 100}% / ${t.alpha})`, Rt = /^lab\(\s*([\d.]+%?)\s+([-\d.]+)\s+([-\d.]+)\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, Pt = /^lch\(\s*([\d.]+%?)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, ot = (t) => t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4), it = (t) => t <= 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 1 / 2.4) - 0.055, He = (t, e, r) => [
|
|
388
|
-
0.4124564 * t + 0.3575761 * e + 0.1804375 * r,
|
|
389
|
-
0.2126729 * t + 0.7151522 * e + 0.072175 * r,
|
|
390
|
-
0.0193339 * t + 0.119192 * e + 0.9503041 * r
|
|
391
|
-
], Ge = (t, e, r) => [
|
|
392
|
-
3.2404542 * t - 1.5371385 * e - 0.4985314 * r,
|
|
393
|
-
-0.969266 * t + 1.8760108 * e + 0.041556 * r,
|
|
394
|
-
0.0556434 * t - 0.2040259 * e + 1.0572252 * r
|
|
395
|
-
], Ut = 0.95047, Vt = 1, Ot = 1.08883, gt = 6 / 29, Ke = gt ** 3, qt = 3 * gt ** 2, Qe = (t, e, r) => {
|
|
396
|
-
const a = (o) => o > Ke ? Math.cbrt(o) : o / qt + 0.13793103448275862, n = a(t / Ut), s = a(e / Vt), l = a(r / Ot);
|
|
397
|
-
return [116 * s - 16, 500 * (n - s), 200 * (s - l)];
|
|
398
|
-
}, Ze = (t, e, r) => {
|
|
399
|
-
const a = (o) => o > gt ? o ** 3 : qt * (o - 0.13793103448275862), n = (t + 16) / 116, s = e / 500 + n, l = n - r / 200;
|
|
400
|
-
return [Ut * a(s), Vt * a(n), Ot * a(l)];
|
|
401
|
-
}, Je = (t, e, r) => {
|
|
402
|
-
const a = Math.sqrt(e * e + r * r);
|
|
403
|
-
let n = Math.atan2(r, e) * 180 / Math.PI;
|
|
404
|
-
return n < 0 && (n += 360), [t, a, n];
|
|
405
|
-
}, tr = (t, e, r) => {
|
|
406
|
-
const a = r * Math.PI / 180;
|
|
407
|
-
return [t, e * Math.cos(a), e * Math.sin(a)];
|
|
408
|
-
}, zt = (t) => (t.endsWith("%"), d(parseFloat(t), 0, 100) / 100), er = (t) => Rt.test(t.trim()), rr = (t) => {
|
|
409
|
-
const e = Rt.exec(t.trim());
|
|
410
|
-
if (!e) throw new R(`Invalid lab color: '${t}'`);
|
|
411
|
-
return bt(
|
|
412
|
-
zt(e[1]),
|
|
413
|
-
parseFloat(e[2]),
|
|
414
|
-
parseFloat(e[3]),
|
|
415
|
-
O(e[4])
|
|
416
|
-
);
|
|
417
|
-
}, ar = (t) => Pt.test(t.trim()), nr = (t) => {
|
|
418
|
-
const e = Pt.exec(t.trim());
|
|
419
|
-
if (!e) throw new R(`Invalid lch color: '${t}'`);
|
|
420
|
-
return Jt(
|
|
421
|
-
zt(e[1]),
|
|
422
|
-
Math.max(0, parseFloat(e[2])),
|
|
423
|
-
U(parseFloat(e[3]), 360),
|
|
424
|
-
O(e[4])
|
|
425
|
-
);
|
|
426
|
-
}, jt = (t) => {
|
|
427
|
-
const e = ot(t.r / 255), r = ot(t.g / 255), a = ot(t.b / 255), [n, s, l] = He(e, r, a), [o, i, c] = Qe(n, s, l);
|
|
428
|
-
return bt(o / 100, i, c, t.alpha);
|
|
429
|
-
}, Lt = (t) => {
|
|
430
|
-
const [e, r, a] = Ze(t.l * 100, t.a, t.b), [n, s, l] = Ge(e, r, a);
|
|
431
|
-
return A(
|
|
432
|
-
Math.round(d(it(n), 0, 1) * 255),
|
|
433
|
-
Math.round(d(it(s), 0, 1) * 255),
|
|
434
|
-
Math.round(d(it(l), 0, 1) * 255),
|
|
435
|
-
t.alpha
|
|
436
|
-
);
|
|
437
|
-
}, sr = (t) => {
|
|
438
|
-
const e = jt(t), [r, a, n] = Je(e.l * 100, e.a, e.b);
|
|
439
|
-
return Jt(r / 100, a, n, t.alpha);
|
|
440
|
-
}, lr = (t) => {
|
|
441
|
-
const [e, r, a] = tr(t.l * 100, t.c, t.h);
|
|
442
|
-
return Lt(bt(e / 100, r, a, t.alpha));
|
|
443
|
-
}, or = (t) => {
|
|
444
|
-
const e = B(t.l * 100, 2), r = B(t.a, 4), a = B(t.b, 4);
|
|
445
|
-
return t.alpha >= 1 ? `lab(${e} ${r} ${a})` : `lab(${e} ${r} ${a} / ${t.alpha})`;
|
|
446
|
-
}, ir = (t) => {
|
|
447
|
-
const e = B(t.l * 100, 2), r = B(t.c, 4), a = B(t.h, 4);
|
|
448
|
-
return t.alpha >= 1 ? `lch(${e} ${r} ${a})` : `lch(${e} ${r} ${a} / ${t.alpha})`;
|
|
449
|
-
}, Xt = /^oklab\(\s*([\d.]+%?)\s+([-\d.]+)\s+([-\d.]+)\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, Yt = /^oklch\(\s*([\d.]+%?)\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i, L = (t) => t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4), ct = (t) => t <= 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 1 / 2.4) - 0.055, Ht = (t, e, r) => {
|
|
450
|
-
const a = 0.4122214708 * t + 0.5363325363 * e + 0.0514459929 * r, n = 0.2119034982 * t + 0.6806995451 * e + 0.1073969566 * r, s = 0.0883024619 * t + 0.2817188376 * e + 0.6299787005 * r, l = Math.cbrt(a), o = Math.cbrt(n), i = Math.cbrt(s), c = 0.2104542553 * l + 0.793617785 * o - 0.0040720468 * i, w = 1.9779984951 * l - 2.428592205 * o + 0.4505937099 * i, f = 0.0259040371 * l + 0.7827717662 * o - 0.808675766 * i;
|
|
451
|
-
return [c, w, f];
|
|
452
|
-
}, cr = (t, e, r) => {
|
|
453
|
-
const a = t + 0.3963377774 * e + 0.2158037573 * r, n = t - 0.1055613458 * e - 0.0638541728 * r, s = t - 0.0894841775 * e - 1.291485548 * r, l = a * a * a, o = n * n * n, i = s * s * s, c = 4.0767416621 * l - 3.3077115913 * o + 0.2309699292 * i, w = -1.2684380046 * l + 2.6097574011 * o - 0.3413193965 * i, f = -0.0041960863 * l - 0.7034186147 * o + 1.707614701 * i;
|
|
454
|
-
return [c, w, f];
|
|
455
|
-
}, ur = (t, e, r) => {
|
|
456
|
-
const a = Math.sqrt(e * e + r * r);
|
|
457
|
-
let n = Math.atan2(r, e) * 180 / Math.PI;
|
|
458
|
-
return n < 0 && (n += 360), [t, a, n];
|
|
459
|
-
}, hr = (t, e, r) => {
|
|
460
|
-
const a = r * Math.PI / 180, n = e * Math.cos(a), s = e * Math.sin(a);
|
|
461
|
-
return [t, n, s];
|
|
462
|
-
}, Gt = (t) => t.endsWith("%") ? parseFloat(t) / 100 : parseFloat(t), pr = (t) => Xt.test(t.trim()), dr = (t) => {
|
|
463
|
-
const e = Xt.exec(t.trim());
|
|
464
|
-
if (!e) throw new R(`Invalid oklab color: '${t}'`);
|
|
465
|
-
return mt(
|
|
466
|
-
Gt(e[1]),
|
|
467
|
-
parseFloat(e[2]),
|
|
468
|
-
parseFloat(e[3]),
|
|
469
|
-
O(e[4])
|
|
470
|
-
);
|
|
471
|
-
}, gr = (t) => Yt.test(t.trim()), br = (t) => {
|
|
472
|
-
const e = Yt.exec(t.trim());
|
|
473
|
-
if (!e) throw new R(`Invalid oklch color: '${t}'`);
|
|
474
|
-
return te(
|
|
475
|
-
Gt(e[1]),
|
|
476
|
-
parseFloat(e[2]),
|
|
477
|
-
parseFloat(e[3]),
|
|
478
|
-
O(e[4])
|
|
479
|
-
);
|
|
480
|
-
}, mr = (t) => {
|
|
481
|
-
const e = L(t.r / 255), r = L(t.g / 255), a = L(t.b / 255), [n, s, l] = Ht(e, r, a);
|
|
482
|
-
return mt(n, s, l, t.alpha);
|
|
483
|
-
}, Kt = (t) => {
|
|
484
|
-
const [e, r, a] = cr(t.l, t.a, t.b);
|
|
485
|
-
return A(
|
|
486
|
-
Math.round(d(ct(e), 0, 1) * 255),
|
|
487
|
-
Math.round(d(ct(r), 0, 1) * 255),
|
|
488
|
-
Math.round(d(ct(a), 0, 1) * 255),
|
|
489
|
-
t.alpha
|
|
490
|
-
);
|
|
491
|
-
}, fr = (t) => {
|
|
492
|
-
const e = L(t.r / 255), r = L(t.g / 255), a = L(t.b / 255), [n, s, l] = Ht(e, r, a), [o, i, c] = ur(n, s, l);
|
|
493
|
-
return te(o, i, c, t.alpha);
|
|
494
|
-
}, wr = (t) => {
|
|
495
|
-
const [e, r, a] = hr(t.l, t.c, t.h);
|
|
496
|
-
return Kt(mt(e, r, a, t.alpha));
|
|
497
|
-
}, yr = (t) => {
|
|
498
|
-
const e = B(t.l, 5), r = B(t.a, 5), a = B(t.b, 5);
|
|
499
|
-
return t.alpha >= 1 ? `oklab(${e} ${r} ${a})` : `oklab(${e} ${r} ${a} / ${t.alpha})`;
|
|
500
|
-
}, $r = (t) => {
|
|
501
|
-
const e = B(t.l, 5), r = B(t.c, 5), a = B(t.h, 2);
|
|
502
|
-
return t.alpha >= 1 ? `oklch(${e} ${r} ${a})` : `oklch(${e} ${r} ${a} / ${t.alpha})`;
|
|
503
|
-
}, kr = (t, e, r, a = 1) => ({
|
|
504
|
-
space: "rgb",
|
|
505
|
-
r: d(t, 0, 1),
|
|
506
|
-
g: d(e, 0, 1),
|
|
507
|
-
b: d(r, 0, 1),
|
|
508
|
-
alpha: d(a, 0, 1)
|
|
509
|
-
}), A = (t, e, r, a = 1) => ({
|
|
510
|
-
space: "rgb8",
|
|
511
|
-
r: j(t, 0, 255),
|
|
512
|
-
g: j(e, 0, 255),
|
|
513
|
-
b: j(r, 0, 255),
|
|
514
|
-
alpha: d(a, 0, 1)
|
|
515
|
-
}), ht = (t, e, r, a = 1) => ({
|
|
516
|
-
space: "hsl",
|
|
517
|
-
h: U(t, 360),
|
|
518
|
-
s: d(e, 0, 1),
|
|
519
|
-
l: d(r, 0, 1),
|
|
520
|
-
alpha: d(a, 0, 1)
|
|
521
|
-
}), Qt = (t, e, r, a = 1) => ({
|
|
522
|
-
space: "hsv",
|
|
523
|
-
h: U(t, 360),
|
|
524
|
-
s: d(e, 0, 1),
|
|
525
|
-
v: d(r, 0, 1),
|
|
526
|
-
alpha: d(a, 0, 1)
|
|
527
|
-
}), Zt = (t, e, r, a = 1) => ({
|
|
528
|
-
space: "hwb",
|
|
529
|
-
h: U(t, 360),
|
|
530
|
-
w: d(e, 0, 1),
|
|
531
|
-
b: d(r, 0, 1),
|
|
532
|
-
alpha: d(a, 0, 1)
|
|
533
|
-
}), bt = (t, e, r, a = 1) => ({
|
|
534
|
-
space: "lab",
|
|
535
|
-
l: d(t, 0, 1),
|
|
536
|
-
a: e,
|
|
537
|
-
b: r,
|
|
538
|
-
alpha: d(a, 0, 1)
|
|
539
|
-
}), Jt = (t, e, r, a = 1) => ({
|
|
540
|
-
space: "lch",
|
|
541
|
-
l: d(t, 0, 1),
|
|
542
|
-
c: Math.max(0, e),
|
|
543
|
-
h: U(r, 360),
|
|
544
|
-
alpha: d(a, 0, 1)
|
|
545
|
-
}), mt = (t, e, r, a = 1) => ({
|
|
546
|
-
space: "oklab",
|
|
547
|
-
l: d(t, 0, 1),
|
|
548
|
-
a: e,
|
|
549
|
-
b: r,
|
|
550
|
-
alpha: d(a, 0, 1)
|
|
551
|
-
}), te = (t, e, r, a = 1) => ({
|
|
552
|
-
space: "oklch",
|
|
553
|
-
l: d(t, 0, 1),
|
|
554
|
-
c: Math.max(0, e),
|
|
555
|
-
h: U(r, 360),
|
|
556
|
-
alpha: d(a, 0, 1)
|
|
557
|
-
}), O = (t) => t == null ? 1 : t.endsWith("%") ? d(parseFloat(t) / 100, 0, 1) : d(parseFloat(t), 0, 1), ee = (t) => A(
|
|
558
|
-
Math.round(t.r * 255),
|
|
559
|
-
Math.round(t.g * 255),
|
|
560
|
-
Math.round(t.b * 255),
|
|
561
|
-
t.alpha
|
|
562
|
-
), Mr = (t) => kr(t.r / 255, t.g / 255, t.b / 255, t.alpha), re = (t) => {
|
|
563
|
-
const e = t.trim().toLowerCase();
|
|
564
|
-
if (e.startsWith("#") || e.startsWith("rgba") || e.startsWith("rgb(")) return "rgb8";
|
|
565
|
-
if (e.startsWith("hsla") || e.startsWith("hsl(")) return "hsl";
|
|
566
|
-
if (e.startsWith("hsva") || e.startsWith("hsv(")) return "hsv";
|
|
567
|
-
if (e.startsWith("hwb(")) return "hwb";
|
|
568
|
-
if (e.startsWith("oklab(")) return "oklab";
|
|
569
|
-
if (e.startsWith("oklch(")) return "oklch";
|
|
570
|
-
if (e.startsWith("lab(")) return "lab";
|
|
571
|
-
if (e.startsWith("lch(")) return "lch";
|
|
572
|
-
if (e in dt) return "rgb8";
|
|
573
|
-
}, Hr = (t) => {
|
|
574
|
-
const e = re(t);
|
|
575
|
-
if (e == null) return !1;
|
|
576
|
-
switch (e) {
|
|
577
|
-
case "rgb8":
|
|
578
|
-
return Fe(t) || Te(t) || Ae(t);
|
|
579
|
-
case "hsl":
|
|
580
|
-
return We(t);
|
|
581
|
-
case "hsv":
|
|
582
|
-
return Pe(t);
|
|
583
|
-
case "hwb":
|
|
584
|
-
return ze(t);
|
|
585
|
-
case "lab":
|
|
586
|
-
return er(t);
|
|
587
|
-
case "lch":
|
|
588
|
-
return ar(t);
|
|
589
|
-
case "oklab":
|
|
590
|
-
return pr(t);
|
|
591
|
-
case "oklch":
|
|
592
|
-
return gr(t);
|
|
593
|
-
default:
|
|
594
|
-
return !1;
|
|
595
|
-
}
|
|
596
|
-
}, ae = (t) => {
|
|
597
|
-
switch (re(t)) {
|
|
598
|
-
case "rgb8": {
|
|
599
|
-
const e = t.trim();
|
|
600
|
-
return e.startsWith("#") ? Ce(t) : /^rgba?\(/i.test(e) ? Se(t) : Ne(t);
|
|
601
|
-
}
|
|
602
|
-
case "hsl":
|
|
603
|
-
return Be(t);
|
|
604
|
-
case "hsv":
|
|
605
|
-
return Ue(t);
|
|
606
|
-
case "hwb":
|
|
607
|
-
return je(t);
|
|
608
|
-
case "lab":
|
|
609
|
-
return rr(t);
|
|
610
|
-
case "lch":
|
|
611
|
-
return nr(t);
|
|
612
|
-
case "oklab":
|
|
613
|
-
return dr(t);
|
|
614
|
-
case "oklch":
|
|
615
|
-
return br(t);
|
|
616
|
-
default:
|
|
617
|
-
throw new R(`Unrecognized color format: '${t}'`);
|
|
618
|
-
}
|
|
619
|
-
}, vr = (t) => {
|
|
620
|
-
switch (t.space) {
|
|
621
|
-
case "rgb":
|
|
622
|
-
return ee(t);
|
|
623
|
-
case "rgb8":
|
|
624
|
-
return t;
|
|
625
|
-
case "hsl":
|
|
626
|
-
return Ee(t);
|
|
627
|
-
case "hsv":
|
|
628
|
-
return Oe(t);
|
|
629
|
-
case "hwb":
|
|
630
|
-
return Xe(t);
|
|
631
|
-
case "lab":
|
|
632
|
-
return Lt(t);
|
|
633
|
-
case "lch":
|
|
634
|
-
return lr(t);
|
|
635
|
-
case "oklab":
|
|
636
|
-
return Kt(t);
|
|
637
|
-
case "oklch":
|
|
638
|
-
return wr(t);
|
|
639
|
-
}
|
|
640
|
-
}, Ir = (t, e) => {
|
|
641
|
-
switch (e) {
|
|
642
|
-
case "rgb":
|
|
643
|
-
return Mr(t);
|
|
644
|
-
case "rgb8":
|
|
645
|
-
return t;
|
|
646
|
-
case "hsl":
|
|
647
|
-
return De(t);
|
|
648
|
-
case "hsv":
|
|
649
|
-
return Ve(t);
|
|
650
|
-
case "hwb":
|
|
651
|
-
return Le(t);
|
|
652
|
-
case "lab":
|
|
653
|
-
return jt(t);
|
|
654
|
-
case "lch":
|
|
655
|
-
return sr(t);
|
|
656
|
-
case "oklab":
|
|
657
|
-
return mr(t);
|
|
658
|
-
case "oklch":
|
|
659
|
-
return fr(t);
|
|
660
|
-
}
|
|
661
|
-
}, ft = (t, e) => t.space === e ? t : Ir(vr(t), e), ne = (t) => {
|
|
662
|
-
switch (t.space) {
|
|
663
|
-
case "rgb":
|
|
664
|
-
return vt(ee(t));
|
|
665
|
-
case "rgb8":
|
|
666
|
-
return vt(t);
|
|
667
|
-
case "hsl":
|
|
668
|
-
return Re(t);
|
|
669
|
-
case "hsv":
|
|
670
|
-
return qe(t);
|
|
671
|
-
case "hwb":
|
|
672
|
-
return Ye(t);
|
|
673
|
-
case "lab":
|
|
674
|
-
return or(t);
|
|
675
|
-
case "lch":
|
|
676
|
-
return ir(t);
|
|
677
|
-
case "oklab":
|
|
678
|
-
return yr(t);
|
|
679
|
-
case "oklch":
|
|
680
|
-
return $r(t);
|
|
681
|
-
}
|
|
682
|
-
};
|
|
683
|
-
function xr(t) {
|
|
684
|
-
let e = t + 1831565813;
|
|
685
|
-
return function() {
|
|
686
|
-
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
function _r(t) {
|
|
690
|
-
try {
|
|
691
|
-
const e = ft(ae(t), "rgb8");
|
|
692
|
-
return [e.r, e.g, e.b, e.alpha];
|
|
693
|
-
} catch {
|
|
694
|
-
return [0, 0, 0, 1];
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
function It(t, e, r) {
|
|
698
|
-
return ne(A(t, e, r));
|
|
699
|
-
}
|
|
700
|
-
function xt(t) {
|
|
701
|
-
try {
|
|
702
|
-
const e = ft(ae(t), "rgb8");
|
|
703
|
-
return { r: e.r, g: e.g, b: e.b };
|
|
704
|
-
} catch {
|
|
705
|
-
return null;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
function Fr(t, e, r, a) {
|
|
709
|
-
return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(r)}, ${Math.max(0, Math.min(1, Math.round(a * 100) / 100))})`;
|
|
710
|
-
}
|
|
711
|
-
function G(t, e, r, a, n) {
|
|
712
|
-
const s = A(Math.round(t), Math.round(e), Math.round(r), a), o = ft(s, n === "hex" ? "rgb8" : n === "rgba" ? "rgb" : n === "hsla" ? "hsl" : n === "rgb" ? "rgb" : n);
|
|
713
|
-
return ne(o);
|
|
714
|
-
}
|
|
715
|
-
function K(t, e) {
|
|
716
|
-
return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
|
|
717
|
-
}
|
|
718
|
-
function Cr(t, e) {
|
|
719
|
-
const [r, a, n] = t, s = r << 16 ^ a << 8 ^ n, l = xr(s), o = 6 + Math.floor(l() * 5), i = 0.18 + l() * 0.06, c = [];
|
|
720
|
-
for (let b = 0; b < o; b++) {
|
|
721
|
-
const m = b / o * Math.PI * 2, S = e * (1 + (l() * 2 - 1) * i), N = Math.cos(m) * S, F = Math.sin(m) * S;
|
|
722
|
-
c.push({ x: N, y: F });
|
|
723
|
-
}
|
|
724
|
-
const w = (c[0].x + c[o - 1].x) / 2, f = (c[0].y + c[o - 1].y) / 2;
|
|
725
|
-
let x = `M ${w.toFixed(3)} ${f.toFixed(3)}`;
|
|
726
|
-
for (let b = 0; b < o; b++) {
|
|
727
|
-
const m = c[b], S = c[(b + 1) % o], N = (m.x + S.x) / 2, F = (m.y + S.y) / 2;
|
|
728
|
-
x += ` Q ${m.x.toFixed(3)} ${m.y.toFixed(3)} ${N.toFixed(3)} ${F.toFixed(3)}`;
|
|
729
|
-
}
|
|
730
|
-
return x += " Z", x;
|
|
731
|
-
}
|
|
732
|
-
const Gr = (t) => {
|
|
733
|
-
const {
|
|
734
|
-
value: e,
|
|
735
|
-
onBlur: r,
|
|
736
|
-
onChange: a,
|
|
737
|
-
onInput: n,
|
|
738
|
-
displayValue: s,
|
|
739
|
-
swatchSize: l,
|
|
740
|
-
withAlpha: o
|
|
741
|
-
} = t, i = {
|
|
742
|
-
xs: 20,
|
|
743
|
-
sm: 26,
|
|
744
|
-
md: 32,
|
|
745
|
-
lg: 40,
|
|
746
|
-
xl: 52
|
|
747
|
-
}, c = l != null ? h.map(l, (p) => Number(p)) : h.map(
|
|
748
|
-
t.size ?? "md",
|
|
749
|
-
(p) => i[p] ?? 32
|
|
750
|
-
), w = h.map(e, (p) => _r(p ?? "#000000")), f = h.map(
|
|
751
|
-
w,
|
|
752
|
-
([p, M, _]) => [p, M, _]
|
|
753
|
-
), x = h.map(w, ([, , , p]) => p), b = _t(h.get(x) ?? 1), m = h.map(o ?? !1, (p) => p), S = h.map(
|
|
754
|
-
t.colorTextFormat ?? "rgb",
|
|
755
|
-
(p) => p
|
|
756
|
-
), N = V(
|
|
757
|
-
f,
|
|
758
|
-
b,
|
|
759
|
-
S,
|
|
760
|
-
m
|
|
761
|
-
)(
|
|
762
|
-
([p, M, _], W, D, P) => G(p, M, _, W ?? 1, K(D, P))
|
|
763
|
-
), F = h.map(
|
|
764
|
-
t.colorTextFormat ?? "hex",
|
|
765
|
-
(p) => p
|
|
766
|
-
), y = h.map(c, (p) => `${-p / 2} ${-p / 2} ${p} ${p}`), g = V(
|
|
767
|
-
f,
|
|
768
|
-
c
|
|
769
|
-
)((p, M) => Cr(p, M / 2)), k = V(
|
|
770
|
-
f,
|
|
771
|
-
b,
|
|
772
|
-
m
|
|
773
|
-
)(
|
|
774
|
-
([p, M, _], W, D) => D || W < 1 ? Fr(p, M, _, W) : It(p, M, _)
|
|
775
|
-
), C = v.div(
|
|
776
|
-
u.class("bc-color-swatch-input__control"),
|
|
777
|
-
u.class(
|
|
778
|
-
h.map(
|
|
779
|
-
m,
|
|
780
|
-
(p) => p ? "bc-color-swatch-input__control--alpha" : ""
|
|
781
|
-
)
|
|
782
|
-
),
|
|
783
|
-
u.style(V(c)((p) => `width:${p + 2}px;height:${p + 2}px`)),
|
|
784
|
-
// The SVG blob preview
|
|
785
|
-
yt.svg(
|
|
786
|
-
u.class("bc-color-swatch-input__svg"),
|
|
787
|
-
st.viewBox(y),
|
|
788
|
-
yt.path(st.d(g), st.fill(k))
|
|
789
|
-
),
|
|
790
|
-
// Invisible native input overlays the blob for picker and accessibility
|
|
791
|
-
v.input(
|
|
792
|
-
u.type("color"),
|
|
793
|
-
Y(t),
|
|
794
|
-
// Native color input needs hex without alpha
|
|
795
|
-
u.value(h.map(f, ([p, M, _]) => It(p, M, _))),
|
|
796
|
-
u.class(
|
|
797
|
-
"bc-input bc-color-swatch-input bc-color-swatch-input__native"
|
|
798
|
-
),
|
|
799
|
-
r != null ? $.blur(r) : T,
|
|
800
|
-
a != null ? $.change((p) => {
|
|
801
|
-
const M = p.target.value;
|
|
802
|
-
if (!a) return;
|
|
803
|
-
const { r: _, g: W, b: D } = xt(M) ?? { r: 0, g: 0, b: 0 }, P = h.get(b) ?? 1, q = K(
|
|
804
|
-
h.get(F),
|
|
805
|
-
h.get(m)
|
|
806
|
-
), nt = G(_, W, D, P, q);
|
|
807
|
-
a(nt);
|
|
808
|
-
}) : T,
|
|
809
|
-
n != null ? $.input((p) => {
|
|
810
|
-
const M = p.target.value;
|
|
811
|
-
if (!n) return;
|
|
812
|
-
const { r: _, g: W, b: D } = xt(M) ?? { r: 0, g: 0, b: 0 }, P = h.get(b) ?? 1, q = K(
|
|
813
|
-
h.get(F),
|
|
814
|
-
h.get(m)
|
|
815
|
-
), nt = G(_, W, D, P, q);
|
|
816
|
-
n(nt);
|
|
817
|
-
}) : T
|
|
818
|
-
)
|
|
819
|
-
), I = Q(
|
|
820
|
-
m,
|
|
821
|
-
() => v.input(
|
|
822
|
-
u.type("range"),
|
|
823
|
-
u.class("bc-color-swatch-input__alpha"),
|
|
824
|
-
u.min(0),
|
|
825
|
-
u.max(1),
|
|
826
|
-
u.step(0.01),
|
|
827
|
-
u.value(h.map(b, (p) => String(p ?? 1))),
|
|
828
|
-
u.disabled(t.disabled),
|
|
829
|
-
$.input((p) => {
|
|
830
|
-
const M = parseFloat(p.target.value);
|
|
831
|
-
b.set(M);
|
|
832
|
-
const [_, W, D] = h.get(f), P = K(
|
|
833
|
-
h.get(F),
|
|
834
|
-
h.get(m)
|
|
835
|
-
), q = G(_, W, D, M, P);
|
|
836
|
-
n?.(q);
|
|
837
|
-
}),
|
|
838
|
-
$.change((p) => {
|
|
839
|
-
const M = parseFloat(p.target.value);
|
|
840
|
-
b.set(M);
|
|
841
|
-
const [_, W, D] = h.get(f), P = K(
|
|
842
|
-
h.get(F),
|
|
843
|
-
h.get(m)
|
|
844
|
-
), q = G(_, W, D, M, P);
|
|
845
|
-
a?.(q);
|
|
846
|
-
})
|
|
847
|
-
)
|
|
848
|
-
), {
|
|
849
|
-
swatchSize: tt,
|
|
850
|
-
displayValue: et,
|
|
851
|
-
withAlpha: at,
|
|
852
|
-
colorTextFormat: wt,
|
|
853
|
-
...rt
|
|
854
|
-
} = t;
|
|
855
|
-
return X({
|
|
856
|
-
baseContainer: !0,
|
|
857
|
-
...rt,
|
|
858
|
-
// ensure our control does not try to grow
|
|
859
|
-
growInput: !1,
|
|
860
|
-
input: C,
|
|
861
|
-
// If caller provided an `after`, append RGB before it
|
|
862
|
-
after: Z(
|
|
863
|
-
Q(
|
|
864
|
-
s ?? !1,
|
|
865
|
-
() => v.span(u.class("bc-color-swatch-input__rgb"), N)
|
|
866
|
-
),
|
|
867
|
-
I,
|
|
868
|
-
t.after
|
|
869
|
-
)
|
|
870
|
-
});
|
|
871
|
-
}, Tr = (t) => typeof t == "string" && t.trim() === "" ? null : t, Sr = (t) => t ?? "";
|
|
872
|
-
function H(t) {
|
|
873
|
-
return (e) => {
|
|
874
|
-
const { after: r, disabled: a } = e, n = Ct(e, Sr, Tr), s = J(
|
|
875
|
-
e.value,
|
|
876
|
-
a,
|
|
877
|
-
e.onChange ?? e.onInput
|
|
878
|
-
);
|
|
879
|
-
return t({
|
|
880
|
-
...n,
|
|
881
|
-
after: r != null ? Z(s, r) : s
|
|
882
|
-
});
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
const Kr = ({
|
|
886
|
-
startEditing: t,
|
|
887
|
-
value: e,
|
|
888
|
-
onChange: r,
|
|
889
|
-
placeholder: a,
|
|
890
|
-
disabled: n
|
|
891
|
-
}) => {
|
|
892
|
-
const s = h.deriveProp(t ?? !1), l = _t(!1), o = h.map(n ?? !1, (i) => i);
|
|
893
|
-
return v.div(
|
|
894
|
-
u.class("bc-editable-text"),
|
|
895
|
-
u.class(
|
|
896
|
-
h.map(
|
|
897
|
-
o,
|
|
898
|
-
(i) => i ? "bc-editable-text--disabled" : ""
|
|
899
|
-
)
|
|
900
|
-
),
|
|
901
|
-
E.disabled(o),
|
|
902
|
-
Q(
|
|
903
|
-
s,
|
|
904
|
-
() => v.input(
|
|
905
|
-
u.placeholder(a),
|
|
906
|
-
u.value(e),
|
|
907
|
-
u.class("bc-editable-text__input"),
|
|
908
|
-
fe(),
|
|
909
|
-
$.keydown((i) => {
|
|
910
|
-
i.key === "Enter" ? s.set(!1) : i.key === "Escape" && (l.set(!0), s.set(!1));
|
|
911
|
-
}),
|
|
912
|
-
$.blur(
|
|
913
|
-
pt((i) => {
|
|
914
|
-
if (s.set(!1), l.value) {
|
|
915
|
-
l.set(!1);
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
r(i);
|
|
919
|
-
})
|
|
920
|
-
)
|
|
921
|
-
),
|
|
922
|
-
() => v.span(
|
|
923
|
-
$.click(() => {
|
|
924
|
-
h.get(o) || s.set(!0);
|
|
925
|
-
}),
|
|
926
|
-
u.class("bc-editable-text__display"),
|
|
927
|
-
Q(
|
|
928
|
-
h.map(e, (i) => i != null && i.trim() !== ""),
|
|
929
|
-
() => v.span(u.class("bc-editable-text__text"), e),
|
|
930
|
-
() => v.span(
|
|
931
|
-
u.class("bc-editable-text__placeholder"),
|
|
932
|
-
a
|
|
933
|
-
)
|
|
934
|
-
),
|
|
935
|
-
Q(
|
|
936
|
-
h.map(o, (i) => !i),
|
|
937
|
-
() => v.button(
|
|
938
|
-
u.type("button"),
|
|
939
|
-
u.class("bc-editable-text__edit-button"),
|
|
940
|
-
se(be, (i) => E.label(i.$.editLabel)),
|
|
941
|
-
$.click(() => s.set(!0)),
|
|
942
|
-
ut({ icon: "line-md/pencil", color: "neutral" })
|
|
943
|
-
)
|
|
944
|
-
)
|
|
945
|
-
)
|
|
946
|
-
)
|
|
947
|
-
);
|
|
948
|
-
}, Qr = (t) => {
|
|
949
|
-
const { value: e, onBlur: r, onChange: a, onInput: n, after: s, disabled: l } = t, o = J(e, l, a ?? n);
|
|
950
|
-
return X({
|
|
951
|
-
...t,
|
|
952
|
-
input: Ft.date(
|
|
953
|
-
Y(t),
|
|
954
|
-
u.valueAsDate(e),
|
|
955
|
-
u.class("bc-input"),
|
|
956
|
-
r != null ? $.blur(pt(r)) : T,
|
|
957
|
-
a != null ? $.change($t(a)) : T,
|
|
958
|
-
n != null ? $.input($t(n)) : T
|
|
959
|
-
),
|
|
960
|
-
after: s != null ? Z(o, s) : o
|
|
961
|
-
});
|
|
962
|
-
}, Ar = (t) => {
|
|
963
|
-
const e = t.getFullYear(), r = t.getMonth() + 1, a = t.getDate(), n = t.getHours(), s = t.getMinutes(), l = t.getSeconds();
|
|
964
|
-
return `${e}-${r.toString().padStart(2, "0")}-${a.toString().padStart(2, "0")}T${n.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}`;
|
|
965
|
-
}, Zr = (t) => {
|
|
966
|
-
const { value: e, onBlur: r, onChange: a, onInput: n, after: s, disabled: l } = t, o = h.map(e, (c) => c != null ? Ar(c) : null), i = J(e, l, a ?? n);
|
|
967
|
-
return X({
|
|
968
|
-
...t,
|
|
969
|
-
input: Ft["datetime-local"](
|
|
970
|
-
Y(t),
|
|
971
|
-
u.value(h.map(o, (c) => c ?? null)),
|
|
972
|
-
u.class("bc-input"),
|
|
973
|
-
r != null ? $.blur(pt(r)) : T,
|
|
974
|
-
a != null ? $.change(kt(a)) : T,
|
|
975
|
-
n != null ? $.input(kt(n)) : T
|
|
976
|
-
),
|
|
977
|
-
after: s != null ? Z(i, s) : i
|
|
978
|
-
});
|
|
979
|
-
}, Jr = H(we), ta = H(ge), ea = H(ye), ra = H(
|
|
980
|
-
ue
|
|
981
|
-
), aa = ({
|
|
982
|
-
value: t,
|
|
983
|
-
onChange: e,
|
|
984
|
-
onInput: r,
|
|
985
|
-
onBlur: a,
|
|
986
|
-
offLabel: n,
|
|
987
|
-
onLabel: s,
|
|
988
|
-
disabled: l = !1,
|
|
989
|
-
size: o = "md",
|
|
990
|
-
id: i,
|
|
991
|
-
color: c = "primary",
|
|
992
|
-
tabIndex: w = 0,
|
|
993
|
-
matchInputHeight: f = !0,
|
|
994
|
-
ariaLabel: x
|
|
995
|
-
}) => {
|
|
996
|
-
const b = i ?? $e("switch");
|
|
997
|
-
function m(y, g) {
|
|
998
|
-
const k = [
|
|
999
|
-
"bc-switch",
|
|
1000
|
-
`bc-switch--size-${g}`,
|
|
1001
|
-
`bc-switch--${g}`
|
|
1002
|
-
];
|
|
1003
|
-
return f && k.push("bc-switch--match-input"), y && k.push("bc-switch--disabled"), k.join(" ");
|
|
1004
|
-
}
|
|
1005
|
-
function S(y) {
|
|
1006
|
-
const g = y ?? "primary", k = /* @__PURE__ */ new Map(), C = Mt(g, "solid", "light"), I = Mt(g, "solid", "dark");
|
|
1007
|
-
return k.set("--switch-track-on-bg", C.backgroundColor), k.set("--switch-track-on-label", C.textColor), k.set("--switch-track-on-bg-dark", I.backgroundColor), k.set("--switch-track-on-label-dark", I.textColor), k.set(
|
|
1008
|
-
"--switch-track-on-border-dark",
|
|
1009
|
-
me(g, "dark")
|
|
1010
|
-
), Array.from(k.entries()).map(([tt, et]) => `${tt}: ${et}`).join("; ");
|
|
1011
|
-
}
|
|
1012
|
-
const N = () => {
|
|
1013
|
-
h.get(l) || (e?.(!h.get(t)), r?.(!h.get(t)));
|
|
1014
|
-
}, F = (y) => {
|
|
1015
|
-
h.get(l) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), N());
|
|
1016
|
-
};
|
|
1017
|
-
return v.div(
|
|
1018
|
-
u.class(
|
|
1019
|
-
V(
|
|
1020
|
-
l ?? !1,
|
|
1021
|
-
o
|
|
1022
|
-
)(
|
|
1023
|
-
(y, g) => m(y ?? !1, g ?? "md")
|
|
1024
|
-
)
|
|
1025
|
-
),
|
|
1026
|
-
u.style(
|
|
1027
|
-
V(c)(
|
|
1028
|
-
(y) => S(y)
|
|
1029
|
-
)
|
|
1030
|
-
),
|
|
1031
|
-
u.id(b),
|
|
1032
|
-
u.role("switch"),
|
|
1033
|
-
u.tabindex(
|
|
1034
|
-
V(
|
|
1035
|
-
l ?? !1,
|
|
1036
|
-
w
|
|
1037
|
-
)((y, g) => y ? -1 : g ?? 0)
|
|
1038
|
-
),
|
|
1039
|
-
E.checked(t),
|
|
1040
|
-
E.disabled(l),
|
|
1041
|
-
x != null ? E.label(x) : null,
|
|
1042
|
-
$.click(N),
|
|
1043
|
-
$.keydown(F),
|
|
1044
|
-
a != null ? $.blur(a) : null,
|
|
1045
|
-
v.div(
|
|
1046
|
-
u.class("bc-switch__track"),
|
|
1047
|
-
u.class(
|
|
1048
|
-
h.map(
|
|
1049
|
-
t,
|
|
1050
|
-
(y) => y ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
1051
|
-
)
|
|
1052
|
-
),
|
|
1053
|
-
n != null ? v.div(
|
|
1054
|
-
E.hidden(!0),
|
|
1055
|
-
u.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
1056
|
-
u.class(
|
|
1057
|
-
h.map(
|
|
1058
|
-
t,
|
|
1059
|
-
(y) => y ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
|
|
1060
|
-
)
|
|
1061
|
-
),
|
|
1062
|
-
n
|
|
1063
|
-
) : null,
|
|
1064
|
-
s != null ? v.div(
|
|
1065
|
-
u.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
1066
|
-
u.class(
|
|
1067
|
-
h.map(
|
|
1068
|
-
t,
|
|
1069
|
-
(y) => y ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
|
|
1070
|
-
)
|
|
1071
|
-
),
|
|
1072
|
-
s
|
|
1073
|
-
) : null,
|
|
1074
|
-
v.div(
|
|
1075
|
-
u.class("bc-switch__thumb"),
|
|
1076
|
-
u.class(
|
|
1077
|
-
h.map(
|
|
1078
|
-
t,
|
|
1079
|
-
(y) => y ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
1080
|
-
)
|
|
1081
|
-
)
|
|
1082
|
-
)
|
|
1083
|
-
)
|
|
1084
|
-
);
|
|
1085
|
-
}, na = H(he), Nr = "line-md:star-alt-filled", Wr = "line-md:star-alt", Br = (t) => {
|
|
1086
|
-
const {
|
|
1087
|
-
value: e,
|
|
1088
|
-
onChange: r,
|
|
1089
|
-
onInput: a,
|
|
1090
|
-
disabled: n,
|
|
1091
|
-
max: s = 5,
|
|
1092
|
-
fullColor: l = "yellow",
|
|
1093
|
-
emptyColor: o = "neutral",
|
|
1094
|
-
activeIcon: i = Nr,
|
|
1095
|
-
inactiveIcon: c = Wr,
|
|
1096
|
-
size: w = "md",
|
|
1097
|
-
onBlur: f,
|
|
1098
|
-
rounding: x = 1
|
|
1099
|
-
} = t, b = () => {
|
|
1100
|
-
const g = h.get(x);
|
|
1101
|
-
return g > 0 ? g : 1;
|
|
1102
|
-
}, m = (g) => Math.min(Math.max(g, 0), h.get(s)), S = (g, k) => {
|
|
1103
|
-
if (h.get(n ?? !1)) return;
|
|
1104
|
-
const I = g.currentTarget.getBoundingClientRect(), tt = (g.clientX - I.left) / I.width, et = k - 1 + tt, at = b(), wt = Math.ceil(et / at) * at, rt = m(wt);
|
|
1105
|
-
r?.(rt), a?.(rt);
|
|
1106
|
-
}, N = (g) => {
|
|
1107
|
-
if (h.get(n ?? !1)) return;
|
|
1108
|
-
const k = b(), C = h.get(e) ?? 0;
|
|
1109
|
-
let I;
|
|
1110
|
-
switch (g.key) {
|
|
1111
|
-
case "ArrowRight":
|
|
1112
|
-
case "ArrowUp":
|
|
1113
|
-
I = m(C + k);
|
|
1114
|
-
break;
|
|
1115
|
-
case "ArrowLeft":
|
|
1116
|
-
case "ArrowDown":
|
|
1117
|
-
I = m(C - k);
|
|
1118
|
-
break;
|
|
1119
|
-
case "Home":
|
|
1120
|
-
I = 0;
|
|
1121
|
-
break;
|
|
1122
|
-
case "End":
|
|
1123
|
-
I = h.get(s);
|
|
1124
|
-
break;
|
|
1125
|
-
default:
|
|
1126
|
-
return;
|
|
1127
|
-
}
|
|
1128
|
-
g.preventDefault(), r?.(I), a?.(I);
|
|
1129
|
-
}, F = h.map(w, (g) => `bc-icon--${g}`), y = ({ index: g, counter: k }) => v.span(
|
|
1130
|
-
u.class("bc-rating-input__icon-container"),
|
|
1131
|
-
u.class(F),
|
|
1132
|
-
$.click(
|
|
1133
|
-
oe((C) => S(C, k), {
|
|
1134
|
-
preventDefault: !0,
|
|
1135
|
-
stopPropagation: !0
|
|
1136
|
-
})
|
|
1137
|
-
),
|
|
1138
|
-
ut(
|
|
1139
|
-
{
|
|
1140
|
-
icon: c,
|
|
1141
|
-
size: w,
|
|
1142
|
-
color: o,
|
|
1143
|
-
tone: "soft"
|
|
1144
|
-
},
|
|
1145
|
-
u.class("bc-rating-input__icon-empty")
|
|
1146
|
-
),
|
|
1147
|
-
v.span(
|
|
1148
|
-
u.class("bc-rating-input__icon-clipper"),
|
|
1149
|
-
u.class(F),
|
|
1150
|
-
ie.width(
|
|
1151
|
-
h.map(e, (C) => {
|
|
1152
|
-
const I = Math.floor(C);
|
|
1153
|
-
return I > g ? "100%" : I < g ? "0%" : `${(C - g) * 100}%`;
|
|
1154
|
-
})
|
|
1155
|
-
),
|
|
1156
|
-
ut(
|
|
1157
|
-
{
|
|
1158
|
-
icon: i,
|
|
1159
|
-
size: w,
|
|
1160
|
-
color: l,
|
|
1161
|
-
tone: "soft"
|
|
1162
|
-
},
|
|
1163
|
-
u.class("bc-rating-input__icon-full")
|
|
1164
|
-
)
|
|
1165
|
-
)
|
|
1166
|
-
);
|
|
1167
|
-
return X({
|
|
1168
|
-
baseContainer: !0,
|
|
1169
|
-
growInput: !1,
|
|
1170
|
-
focusableSelector: '[role="slider"]',
|
|
1171
|
-
...t,
|
|
1172
|
-
input: v.div(
|
|
1173
|
-
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
1174
|
-
Y(t),
|
|
1175
|
-
u.class("bc-rating-input"),
|
|
1176
|
-
// ARIA slider semantics
|
|
1177
|
-
u.role("slider"),
|
|
1178
|
-
u.tabindex(h.map(n ?? !1, (g) => g ? -1 : 0)),
|
|
1179
|
-
E.disabled(n ?? !1),
|
|
1180
|
-
E.valuemin(0),
|
|
1181
|
-
E.valuemax(h.map(s, (g) => g ?? 0)),
|
|
1182
|
-
E.valuenow(h.map(e, (g) => g ?? 0)),
|
|
1183
|
-
E.valuetext(
|
|
1184
|
-
V(
|
|
1185
|
-
e,
|
|
1186
|
-
s
|
|
1187
|
-
)((g, k) => {
|
|
1188
|
-
const C = g ?? 0, I = k ?? 0;
|
|
1189
|
-
return `${String(C)} / ${String(I)}`;
|
|
1190
|
-
})
|
|
1191
|
-
),
|
|
1192
|
-
// Keyboard & focus handlers
|
|
1193
|
-
$.keydown(N),
|
|
1194
|
-
f != null ? $.blur(f) : null,
|
|
1195
|
-
le(s, y)
|
|
1196
|
-
)
|
|
1197
|
-
});
|
|
1198
|
-
}, sa = (t) => {
|
|
1199
|
-
const { after: e, disabled: r } = t, a = Ct(
|
|
1200
|
-
t,
|
|
1201
|
-
(s) => s ?? 0,
|
|
1202
|
-
(s) => s
|
|
1203
|
-
), n = J(
|
|
1204
|
-
t.value,
|
|
1205
|
-
r,
|
|
1206
|
-
t.onChange ?? t.onInput
|
|
1207
|
-
);
|
|
1208
|
-
return Br({
|
|
1209
|
-
...a,
|
|
1210
|
-
after: e != null ? Z(n, e) : n
|
|
1211
|
-
});
|
|
1212
|
-
}, la = (t) => {
|
|
1213
|
-
const { value: e, step: r, min: a, max: n, onBlur: s, onChange: l, onInput: o } = t;
|
|
1214
|
-
return X({
|
|
1215
|
-
...t,
|
|
1216
|
-
// Make sure clicks anywhere focus the range input
|
|
1217
|
-
focusableSelector: 'input[type="range"]',
|
|
1218
|
-
input: v.input(
|
|
1219
|
-
u.type("range"),
|
|
1220
|
-
Y(t),
|
|
1221
|
-
u.min(a),
|
|
1222
|
-
u.max(n),
|
|
1223
|
-
u.step(r),
|
|
1224
|
-
// Using value as number to keep it in sync
|
|
1225
|
-
u.valueAsNumber(e),
|
|
1226
|
-
u.class("bc-input bc-slider-input"),
|
|
1227
|
-
s != null ? $.blur(z(s)) : T,
|
|
1228
|
-
l != null ? $.change(z(l)) : T,
|
|
1229
|
-
o != null ? $.input(z(o)) : T
|
|
1230
|
-
)
|
|
1231
|
-
});
|
|
1232
|
-
}, oa = (t) => {
|
|
1233
|
-
const { value: e, step: r, min: a, max: n, onBlur: s, onChange: l, onInput: o } = t, i = h.map(e, (w) => {
|
|
1234
|
-
if (w != null) return w;
|
|
1235
|
-
const f = a != null ? h.get(a) : void 0;
|
|
1236
|
-
return typeof f == "number" ? f : 0;
|
|
1237
|
-
}), c = J(
|
|
1238
|
-
e,
|
|
1239
|
-
t.disabled,
|
|
1240
|
-
l ?? o
|
|
1241
|
-
);
|
|
1242
|
-
return X({
|
|
1243
|
-
...t,
|
|
1244
|
-
focusableSelector: 'input[type="range"]',
|
|
1245
|
-
after: c,
|
|
1246
|
-
input: v.input(
|
|
1247
|
-
u.type("range"),
|
|
1248
|
-
Y(t),
|
|
1249
|
-
u.min(a),
|
|
1250
|
-
u.max(n),
|
|
1251
|
-
u.step(r),
|
|
1252
|
-
u.valueAsNumber(i),
|
|
1253
|
-
u.class("bc-input bc-slider-input"),
|
|
1254
|
-
s != null ? $.blur(z(s)) : T,
|
|
1255
|
-
l != null ? $.change(
|
|
1256
|
-
z((w) => {
|
|
1257
|
-
l(w);
|
|
1258
|
-
})
|
|
1259
|
-
) : T,
|
|
1260
|
-
o != null ? $.input(
|
|
1261
|
-
z((w) => {
|
|
1262
|
-
o(w);
|
|
1263
|
-
})
|
|
1264
|
-
) : T
|
|
1265
|
-
)
|
|
1266
|
-
});
|
|
1267
|
-
}, ia = H(pe);
|
|
1268
|
-
class Dr {
|
|
1269
|
-
widgets = /* @__PURE__ */ new Map();
|
|
1270
|
-
typeMapping = /* @__PURE__ */ new Map();
|
|
1271
|
-
// JSON Schema type -> widget names
|
|
1272
|
-
/**
|
|
1273
|
-
* Register a custom widget
|
|
1274
|
-
*/
|
|
1275
|
-
register(e, r) {
|
|
1276
|
-
if (this.widgets.set(e, r), r.supportedTypes)
|
|
1277
|
-
for (const a of r.supportedTypes)
|
|
1278
|
-
this.typeMapping.has(a) || this.typeMapping.set(a, []), this.typeMapping.get(a).push(e), this.typeMapping.get(a).sort((n, s) => {
|
|
1279
|
-
const l = this.widgets.get(n)?.priority || 0;
|
|
1280
|
-
return (this.widgets.get(s)?.priority || 0) - l;
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
/**
|
|
1284
|
-
* Unregister a widget
|
|
1285
|
-
*/
|
|
1286
|
-
unregister(e) {
|
|
1287
|
-
const r = this.widgets.get(e);
|
|
1288
|
-
if (r && (this.widgets.delete(e), r.supportedTypes))
|
|
1289
|
-
for (const a of r.supportedTypes) {
|
|
1290
|
-
const n = this.typeMapping.get(a);
|
|
1291
|
-
if (n) {
|
|
1292
|
-
const s = n.indexOf(e);
|
|
1293
|
-
s >= 0 && n.splice(s, 1), n.length === 0 && this.typeMapping.delete(a);
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
/**
|
|
1298
|
-
* Get a registered widget
|
|
1299
|
-
*/
|
|
1300
|
-
get(e) {
|
|
1301
|
-
return this.widgets.get(e);
|
|
1302
|
-
}
|
|
1303
|
-
/**
|
|
1304
|
-
* Get all registered widgets
|
|
1305
|
-
*/
|
|
1306
|
-
getAll() {
|
|
1307
|
-
return new Map(this.widgets);
|
|
1308
|
-
}
|
|
1309
|
-
/**
|
|
1310
|
-
* Get widgets that support a specific JSON Schema type
|
|
1311
|
-
*/
|
|
1312
|
-
getForType(e) {
|
|
1313
|
-
return (this.typeMapping.get(e) || []).map((a) => this.widgets.get(a)).filter(Boolean);
|
|
1314
|
-
}
|
|
1315
|
-
/**
|
|
1316
|
-
* Find the best widget for a schema context
|
|
1317
|
-
*/
|
|
1318
|
-
findBestWidget(e) {
|
|
1319
|
-
const r = ke(e.definition, e.name);
|
|
1320
|
-
if (r?.widget) {
|
|
1321
|
-
const n = this.widgets.get(r.widget);
|
|
1322
|
-
if (n)
|
|
1323
|
-
return { name: r.widget, registration: n, resolved: r };
|
|
1324
|
-
}
|
|
1325
|
-
const a = [];
|
|
1326
|
-
for (const [n, s] of this.widgets.entries())
|
|
1327
|
-
if (s.matcher)
|
|
1328
|
-
try {
|
|
1329
|
-
s.matcher(e) && a.push({
|
|
1330
|
-
name: n,
|
|
1331
|
-
registration: s,
|
|
1332
|
-
priority: s.priority ?? 0
|
|
1333
|
-
});
|
|
1334
|
-
} catch (l) {
|
|
1335
|
-
console.warn(`Error in matcher for widget "${n}":`, l);
|
|
1336
|
-
}
|
|
1337
|
-
if (a.length > 0) {
|
|
1338
|
-
a.sort((s, l) => l.priority - s.priority);
|
|
1339
|
-
const n = a[0];
|
|
1340
|
-
return {
|
|
1341
|
-
name: n.name,
|
|
1342
|
-
registration: n.registration,
|
|
1343
|
-
resolved: { widget: n.name, source: "heuristics" }
|
|
1344
|
-
};
|
|
1345
|
-
}
|
|
1346
|
-
if (typeof e.definition == "object" && e.definition.type) {
|
|
1347
|
-
const n = Array.isArray(e.definition.type) ? e.definition.type[0] : e.definition.type, s = this.getForType(n);
|
|
1348
|
-
if (s.length > 0) {
|
|
1349
|
-
const l = this.typeMapping.get(n)[0];
|
|
1350
|
-
return {
|
|
1351
|
-
name: l,
|
|
1352
|
-
registration: s[0],
|
|
1353
|
-
resolved: { widget: l, source: "type-fallback" }
|
|
1354
|
-
};
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
const ca = new Dr();
|
|
1361
|
-
function ua(t, e, r) {
|
|
1362
|
-
return {
|
|
1363
|
-
factory: e,
|
|
1364
|
-
matcher: (a) => {
|
|
1365
|
-
const s = a.definition["x:ui"];
|
|
1366
|
-
return s === t || typeof s == "object" && s !== null && s.widget === t;
|
|
1367
|
-
},
|
|
1368
|
-
displayName: r?.displayName ?? t,
|
|
1369
|
-
priority: r?.priority ?? 100,
|
|
1370
|
-
// High priority for explicit matches
|
|
1371
|
-
...r
|
|
1372
|
-
};
|
|
1373
|
-
}
|
|
1374
|
-
function ha(t, e, r) {
|
|
1375
|
-
return {
|
|
1376
|
-
factory: e,
|
|
1377
|
-
matcher: (a) => a.definition.format === t,
|
|
1378
|
-
displayName: r?.displayName ?? `${t} widget`,
|
|
1379
|
-
priority: r?.priority ?? 75,
|
|
1380
|
-
...r
|
|
1381
|
-
};
|
|
1382
|
-
}
|
|
1383
|
-
function pa(t, e, r, a) {
|
|
1384
|
-
return {
|
|
1385
|
-
factory: r,
|
|
1386
|
-
matcher: (n) => {
|
|
1387
|
-
const s = n.definition;
|
|
1388
|
-
return s.type === t && s.format === e;
|
|
1389
|
-
},
|
|
1390
|
-
displayName: a?.displayName ?? `${t}:${e} widget`,
|
|
1391
|
-
priority: a?.priority ?? 80,
|
|
1392
|
-
...a
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
function da(t) {
|
|
1396
|
-
const e = t?.logPrefix ?? "WIDGET_DIAG", r = t?.filterFn ?? (() => !0);
|
|
1397
|
-
return {
|
|
1398
|
-
factory: () => null,
|
|
1399
|
-
displayName: "Diagnostic Widget (never matches)",
|
|
1400
|
-
priority: -1e3,
|
|
1401
|
-
// Very low priority, should never actually match
|
|
1402
|
-
matcher: (a) => {
|
|
1403
|
-
if (!r(a)) return !1;
|
|
1404
|
-
const n = a.definition, s = {
|
|
1405
|
-
name: a.name,
|
|
1406
|
-
path: a.path.map(String),
|
|
1407
|
-
type: n?.type,
|
|
1408
|
-
hasRegistry: a.widgetRegistry !== void 0,
|
|
1409
|
-
definition: n
|
|
1410
|
-
};
|
|
1411
|
-
return console.log(
|
|
1412
|
-
`[${e}] name="${s.name ?? "ROOT"}" path=[${s.path.join(", ")}] type="${s.type ?? "unknown"}" hasRegistry=${s.hasRegistry}`
|
|
1413
|
-
), t?.onProcess?.(s), !1;
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
}
|
|
1417
|
-
export {
|
|
1418
|
-
_e as A,
|
|
1419
|
-
Xr as B,
|
|
1420
|
-
Gr as C,
|
|
1421
|
-
Me as D,
|
|
1422
|
-
Kr as E,
|
|
1423
|
-
mt as F,
|
|
1424
|
-
Qt as H,
|
|
1425
|
-
bt as I,
|
|
1426
|
-
Hr as M,
|
|
1427
|
-
ta as N,
|
|
1428
|
-
Br as R,
|
|
1429
|
-
la as S,
|
|
1430
|
-
ft as T,
|
|
1431
|
-
Dr as W,
|
|
1432
|
-
ra as a,
|
|
1433
|
-
na as b,
|
|
1434
|
-
ia as c,
|
|
1435
|
-
ea as d,
|
|
1436
|
-
Zr as e,
|
|
1437
|
-
Qr as f,
|
|
1438
|
-
ca as g,
|
|
1439
|
-
Jr as h,
|
|
1440
|
-
oa as i,
|
|
1441
|
-
sa as j,
|
|
1442
|
-
aa as k,
|
|
1443
|
-
da as l,
|
|
1444
|
-
ha as m,
|
|
1445
|
-
pa as n,
|
|
1446
|
-
ua as o,
|
|
1447
|
-
ht as p,
|
|
1448
|
-
Jt as q,
|
|
1449
|
-
te as r,
|
|
1450
|
-
A as s,
|
|
1451
|
-
Zt as t,
|
|
1452
|
-
kr as u,
|
|
1453
|
-
ne as v,
|
|
1454
|
-
ae as w,
|
|
1455
|
-
Tr as x,
|
|
1456
|
-
Sr as y,
|
|
1457
|
-
re as z
|
|
1458
|
-
};
|