@roku-ui/vue 0.1.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 +33 -0
- package/dist/components/Avatar.vue.d.ts +40 -0
- package/dist/components/Btn.vue.d.ts +71 -0
- package/dist/components/Chip.vue.d.ts +60 -0
- package/dist/components/Indicator.vue.d.ts +49 -0
- package/dist/components/Modal.vue.d.ts +47 -0
- package/dist/components/Notification.vue.d.ts +49 -0
- package/dist/components/NotificationSystem.vue.d.ts +2 -0
- package/dist/components/PinInput.vue.d.ts +35 -0
- package/dist/components/Progress.vue.d.ts +59 -0
- package/dist/components/RokuProvider.vue.d.ts +42 -0
- package/dist/components/Select.vue.d.ts +54 -0
- package/dist/components/Slider.vue.d.ts +47 -0
- package/dist/components/Switch.vue.d.ts +58 -0
- package/dist/components/TextField.vue.d.ts +62 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2230 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/dist/test/index.test.d.ts +1 -0
- package/dist/test.d.ts +0 -0
- package/dist/utils/classGenerator.d.ts +6 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/notifications.d.ts +12 -0
- package/dist/utils/theme.d.ts +33 -0
- package/dist/vite.svg +1 -0
- package/package.json +59 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2230 @@
|
|
|
1
|
+
import { defineComponent as R, computed as m, openBlock as g, createBlock as L, resolveDynamicComponent as xe, normalizeClass as w, unref as c, withCtx as ce, renderSlot as P, createCommentVNode as $, getCurrentScope as Ke, onScopeDispose as Qe, onMounted as de, nextTick as Ze, getCurrentInstance as Ve, watch as ae, ref as k, watchEffect as oe, createElementBlock as y, createElementVNode as S, withModifiers as Oe, normalizeStyle as C, Fragment as X, renderList as te, toDisplayString as q, withDirectives as Ie, isRef as Je, vModelCheckbox as et, reactive as tt, provide as rt, createTextVNode as nt, Teleport as at, createVNode as st, Transition as ot, withKeys as it, useSlots as lt, inject as ut } from "vue";
|
|
2
|
+
const ct = /* @__PURE__ */ R({
|
|
3
|
+
__name: "Btn",
|
|
4
|
+
props: {
|
|
5
|
+
type: { default: "button" },
|
|
6
|
+
size: { default: "md" },
|
|
7
|
+
is: { default: "button" },
|
|
8
|
+
icon: { type: Boolean, default: !1 },
|
|
9
|
+
pressEffect: { default: "translate" },
|
|
10
|
+
variant: {},
|
|
11
|
+
color: {},
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
animate: { type: Boolean },
|
|
14
|
+
rounded: { default: "md" }
|
|
15
|
+
},
|
|
16
|
+
setup(e) {
|
|
17
|
+
const t = e, r = m(() => {
|
|
18
|
+
switch (t.rounded) {
|
|
19
|
+
case "none":
|
|
20
|
+
return "rounded-none";
|
|
21
|
+
case "sm":
|
|
22
|
+
return "rounded-sm";
|
|
23
|
+
case "md":
|
|
24
|
+
return "rounded-md";
|
|
25
|
+
case "lg":
|
|
26
|
+
return "rounded-lg";
|
|
27
|
+
case "full":
|
|
28
|
+
return "rounded-full";
|
|
29
|
+
}
|
|
30
|
+
}), n = m(() => {
|
|
31
|
+
switch (t.size) {
|
|
32
|
+
case "sm":
|
|
33
|
+
return {
|
|
34
|
+
normalContent: "min-w-16 h-6 px-2 py-1 text-xs",
|
|
35
|
+
iconContent: "h-6 w-6 p-1"
|
|
36
|
+
};
|
|
37
|
+
case "md":
|
|
38
|
+
return {
|
|
39
|
+
normalContent: "min-w-20 h-8 px-3 py-1 text-sm",
|
|
40
|
+
iconContent: "h-8 w-8 p-2"
|
|
41
|
+
};
|
|
42
|
+
case "lg":
|
|
43
|
+
return {
|
|
44
|
+
normalContent: "min-w-24 h-10 px-4 py-2 text-base",
|
|
45
|
+
iconContent: "h-10 w-10 p-3"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}), s = m(() => {
|
|
49
|
+
switch (t.variant) {
|
|
50
|
+
case "filled":
|
|
51
|
+
switch (t.color) {
|
|
52
|
+
case "secondary":
|
|
53
|
+
return "btn-filled-secondary";
|
|
54
|
+
case "tertiary":
|
|
55
|
+
return "btn-filled-tertiary";
|
|
56
|
+
case "error":
|
|
57
|
+
return "btn-filled-error";
|
|
58
|
+
default:
|
|
59
|
+
return "btn-filled-primary";
|
|
60
|
+
}
|
|
61
|
+
case "ghost":
|
|
62
|
+
case "light":
|
|
63
|
+
switch (t.color) {
|
|
64
|
+
case "secondary":
|
|
65
|
+
return "btn-light-secondary";
|
|
66
|
+
case "tertiary":
|
|
67
|
+
return "btn-light-tertiary";
|
|
68
|
+
case "error":
|
|
69
|
+
return "btn-light-error";
|
|
70
|
+
default:
|
|
71
|
+
return "btn-light-primary";
|
|
72
|
+
}
|
|
73
|
+
case "constrast":
|
|
74
|
+
switch (t.color) {
|
|
75
|
+
case "secondary":
|
|
76
|
+
return "btn-constrast-secondary";
|
|
77
|
+
case "tertiary":
|
|
78
|
+
return "btn-constrast-tertiary";
|
|
79
|
+
case "error":
|
|
80
|
+
return "btn-constrast-error";
|
|
81
|
+
default:
|
|
82
|
+
return "btn-constrast-primary";
|
|
83
|
+
}
|
|
84
|
+
case "outline":
|
|
85
|
+
switch (t.color) {
|
|
86
|
+
case "secondary":
|
|
87
|
+
return "btn-outline-secondary";
|
|
88
|
+
case "tertiary":
|
|
89
|
+
return "btn-outline-tertiary";
|
|
90
|
+
case "error":
|
|
91
|
+
return "btn-outline-error";
|
|
92
|
+
default:
|
|
93
|
+
return "btn-outline-primary";
|
|
94
|
+
}
|
|
95
|
+
case "subtle":
|
|
96
|
+
switch (t.color) {
|
|
97
|
+
case "secondary":
|
|
98
|
+
return "btn-subtle-secondary";
|
|
99
|
+
case "tertiary":
|
|
100
|
+
return "btn-subtle-tertiary";
|
|
101
|
+
case "error":
|
|
102
|
+
return "btn-subtle-error";
|
|
103
|
+
default:
|
|
104
|
+
return "btn-subtle-primary";
|
|
105
|
+
}
|
|
106
|
+
case "transparent":
|
|
107
|
+
switch (t.color) {
|
|
108
|
+
case "secondary":
|
|
109
|
+
return "btn-transparent-secondary";
|
|
110
|
+
case "tertiary":
|
|
111
|
+
return "btn-transparent-tertiary";
|
|
112
|
+
case "error":
|
|
113
|
+
return "btn-transparent-error";
|
|
114
|
+
default:
|
|
115
|
+
return "btn-transparent-primary";
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
return "btn-default";
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return (a, o) => (g(), L(xe(a.is), {
|
|
122
|
+
"data-size": a.size,
|
|
123
|
+
type: a.type,
|
|
124
|
+
class: w(["flex items-center justify-center gap-1 decoration-none", [
|
|
125
|
+
c(s),
|
|
126
|
+
c(r),
|
|
127
|
+
a.icon ? c(n).iconContent : c(n).normalContent,
|
|
128
|
+
{
|
|
129
|
+
"filter-grayscale": a.disabled,
|
|
130
|
+
"active:translate-y-0.25": !a.disabled && a.pressEffect === "translate",
|
|
131
|
+
"active:scale-98": !a.disabled && a.pressEffect === "scale",
|
|
132
|
+
"transition-all": a.animate
|
|
133
|
+
}
|
|
134
|
+
]]),
|
|
135
|
+
disabled: a.disabled
|
|
136
|
+
}, {
|
|
137
|
+
default: ce(() => [
|
|
138
|
+
a.$slots.leftSection ? P(a.$slots, "leftSection", { key: 0 }) : $("", !0),
|
|
139
|
+
P(a.$slots, "default"),
|
|
140
|
+
a.$slots.rightSection ? P(a.$slots, "rightSection", { key: 1 }) : $("", !0)
|
|
141
|
+
]),
|
|
142
|
+
_: 3
|
|
143
|
+
}, 8, ["data-size", "type", "class", "disabled"]));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
function Fe(e) {
|
|
147
|
+
return Ke() ? (Qe(e), !0) : !1;
|
|
148
|
+
}
|
|
149
|
+
function ke(e) {
|
|
150
|
+
return typeof e == "function" ? e() : c(e);
|
|
151
|
+
}
|
|
152
|
+
const dt = typeof window < "u" && typeof document < "u";
|
|
153
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
154
|
+
const ft = Object.prototype.toString, ht = (e) => ft.call(e) === "[object Object]", pt = () => {
|
|
155
|
+
};
|
|
156
|
+
function gt(e) {
|
|
157
|
+
return e || Ve();
|
|
158
|
+
}
|
|
159
|
+
function mt(e, t = !0, r) {
|
|
160
|
+
const n = gt(r);
|
|
161
|
+
n ? de(e, n) : t ? e() : Ze(e);
|
|
162
|
+
}
|
|
163
|
+
function U(e) {
|
|
164
|
+
var t;
|
|
165
|
+
const r = ke(e);
|
|
166
|
+
return (t = r == null ? void 0 : r.$el) != null ? t : r;
|
|
167
|
+
}
|
|
168
|
+
const Me = dt ? window : void 0;
|
|
169
|
+
function F(...e) {
|
|
170
|
+
let t, r, n, s;
|
|
171
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, n, s] = e, t = Me) : [t, r, n, s] = e, !t)
|
|
172
|
+
return pt;
|
|
173
|
+
Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]);
|
|
174
|
+
const a = [], o = () => {
|
|
175
|
+
a.forEach((u) => u()), a.length = 0;
|
|
176
|
+
}, i = (u, f, p, v) => (u.addEventListener(f, p, v), () => u.removeEventListener(f, p, v)), l = ae(
|
|
177
|
+
() => [U(t), ke(s)],
|
|
178
|
+
([u, f]) => {
|
|
179
|
+
if (o(), !u)
|
|
180
|
+
return;
|
|
181
|
+
const p = ht(f) ? { ...f } : f;
|
|
182
|
+
a.push(
|
|
183
|
+
...r.flatMap((v) => n.map((b) => i(u, v, b, p)))
|
|
184
|
+
);
|
|
185
|
+
},
|
|
186
|
+
{ immediate: !0, flush: "post" }
|
|
187
|
+
), d = () => {
|
|
188
|
+
l(), o();
|
|
189
|
+
};
|
|
190
|
+
return Fe(d), d;
|
|
191
|
+
}
|
|
192
|
+
function bt(e) {
|
|
193
|
+
return typeof e == "function" ? e : typeof e == "string" ? (t) => t.key === e : Array.isArray(e) ? (t) => e.includes(t.key) : () => !0;
|
|
194
|
+
}
|
|
195
|
+
function be(...e) {
|
|
196
|
+
let t, r, n = {};
|
|
197
|
+
e.length === 3 ? (t = e[0], r = e[1], n = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (t = !0, r = e[0], n = e[1]) : (t = e[0], r = e[1]) : (t = !0, r = e[0]);
|
|
198
|
+
const {
|
|
199
|
+
target: s = Me,
|
|
200
|
+
eventName: a = "keydown",
|
|
201
|
+
passive: o = !1,
|
|
202
|
+
dedupe: i = !1
|
|
203
|
+
} = n, l = bt(t);
|
|
204
|
+
return F(s, a, (u) => {
|
|
205
|
+
u.repeat && ke(i) || l(u) && r(u);
|
|
206
|
+
}, o);
|
|
207
|
+
}
|
|
208
|
+
function vt() {
|
|
209
|
+
const e = k(!1);
|
|
210
|
+
return Ve() && de(() => {
|
|
211
|
+
e.value = !0;
|
|
212
|
+
}), e;
|
|
213
|
+
}
|
|
214
|
+
function yt(e) {
|
|
215
|
+
const t = vt();
|
|
216
|
+
return m(() => (t.value, !!e()));
|
|
217
|
+
}
|
|
218
|
+
function wt(e, t, r = {}) {
|
|
219
|
+
const { window: n = Me, ...s } = r;
|
|
220
|
+
let a;
|
|
221
|
+
const o = yt(() => n && "ResizeObserver" in n), i = () => {
|
|
222
|
+
a && (a.disconnect(), a = void 0);
|
|
223
|
+
}, l = m(() => Array.isArray(e) ? e.map((f) => U(f)) : [U(e)]), d = ae(
|
|
224
|
+
l,
|
|
225
|
+
(f) => {
|
|
226
|
+
if (i(), o.value && n) {
|
|
227
|
+
a = new ResizeObserver(t);
|
|
228
|
+
for (const p of f)
|
|
229
|
+
p && a.observe(p, s);
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{ immediate: !0, flush: "post", deep: !0 }
|
|
233
|
+
), u = () => {
|
|
234
|
+
i(), d();
|
|
235
|
+
};
|
|
236
|
+
return Fe(u), {
|
|
237
|
+
isSupported: o,
|
|
238
|
+
stop: u
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function _t(e, t = {}) {
|
|
242
|
+
const {
|
|
243
|
+
reset: r = !0,
|
|
244
|
+
windowResize: n = !0,
|
|
245
|
+
windowScroll: s = !0,
|
|
246
|
+
immediate: a = !0
|
|
247
|
+
} = t, o = k(0), i = k(0), l = k(0), d = k(0), u = k(0), f = k(0), p = k(0), v = k(0);
|
|
248
|
+
function b() {
|
|
249
|
+
const _ = U(e);
|
|
250
|
+
if (!_) {
|
|
251
|
+
r && (o.value = 0, i.value = 0, l.value = 0, d.value = 0, u.value = 0, f.value = 0, p.value = 0, v.value = 0);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const A = _.getBoundingClientRect();
|
|
255
|
+
o.value = A.height, i.value = A.bottom, l.value = A.left, d.value = A.right, u.value = A.top, f.value = A.width, p.value = A.x, v.value = A.y;
|
|
256
|
+
}
|
|
257
|
+
return wt(e, b), ae(() => U(e), (_) => !_ && b()), s && F("scroll", b, { capture: !0, passive: !0 }), n && F("resize", b, { passive: !0 }), mt(() => {
|
|
258
|
+
a && b();
|
|
259
|
+
}), {
|
|
260
|
+
height: o,
|
|
261
|
+
bottom: i,
|
|
262
|
+
left: l,
|
|
263
|
+
right: d,
|
|
264
|
+
top: u,
|
|
265
|
+
width: f,
|
|
266
|
+
x: p,
|
|
267
|
+
y: v,
|
|
268
|
+
update: b
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function xt(e, t = {}) {
|
|
272
|
+
const { initialValue: r = !1, focusVisible: n = !1 } = t, s = k(!1), a = m(() => U(e));
|
|
273
|
+
F(a, "focus", (i) => {
|
|
274
|
+
var l, d;
|
|
275
|
+
(!n || (d = (l = i.target).matches) != null && d.call(l, ":focus-visible")) && (s.value = !0);
|
|
276
|
+
}), F(a, "blur", () => s.value = !1);
|
|
277
|
+
const o = m({
|
|
278
|
+
get: () => s.value,
|
|
279
|
+
set(i) {
|
|
280
|
+
var l, d;
|
|
281
|
+
!i && s.value ? (l = a.value) == null || l.blur() : i && !s.value && ((d = a.value) == null || d.focus());
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
return ae(
|
|
285
|
+
a,
|
|
286
|
+
() => {
|
|
287
|
+
o.value = r;
|
|
288
|
+
},
|
|
289
|
+
{ immediate: !0, flush: "post" }
|
|
290
|
+
), { focused: o };
|
|
291
|
+
}
|
|
292
|
+
const kt = { class: "relative inline-block" }, Hr = /* @__PURE__ */ R({
|
|
293
|
+
__name: "Slider",
|
|
294
|
+
props: {
|
|
295
|
+
modelValue: {},
|
|
296
|
+
size: { default: "md" },
|
|
297
|
+
animate: { type: Boolean, default: !0 },
|
|
298
|
+
options: {},
|
|
299
|
+
width: { default: 12 }
|
|
300
|
+
},
|
|
301
|
+
emits: ["update:modelValue"],
|
|
302
|
+
setup(e, { emit: t }) {
|
|
303
|
+
const r = e, n = t, s = m(() => r.options.length ?? 0), a = k(r.options.includes(r.modelValue) ? r.options.indexOf(r.modelValue) : 0);
|
|
304
|
+
oe(() => {
|
|
305
|
+
n("update:modelValue", r.options[a.value]);
|
|
306
|
+
});
|
|
307
|
+
const o = k(), i = k(), l = _t(o), d = k(!1);
|
|
308
|
+
function u(b) {
|
|
309
|
+
if (!d.value)
|
|
310
|
+
return;
|
|
311
|
+
if (!(b.buttons === 1)) {
|
|
312
|
+
d.value = !1;
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
b.preventDefault(), b.stopPropagation();
|
|
316
|
+
const { clientX: A } = b, O = l.left.value, x = l.right.value - O, j = Math.round((A - O) / x * (s.value - 1));
|
|
317
|
+
j < 0 || j > s.value - 1 || (a.value = j);
|
|
318
|
+
}
|
|
319
|
+
function f(b) {
|
|
320
|
+
b.preventDefault(), b.stopPropagation(), d.value = !0, u(b);
|
|
321
|
+
}
|
|
322
|
+
F(o, "pointerdown", f), de(() => {
|
|
323
|
+
F(document, "pointermove", u);
|
|
324
|
+
});
|
|
325
|
+
const p = m(() => {
|
|
326
|
+
switch (r.size) {
|
|
327
|
+
case "sm":
|
|
328
|
+
return {
|
|
329
|
+
wrapper: "h-2",
|
|
330
|
+
innerWrapper: "px-0.5 h-1",
|
|
331
|
+
content: "h-1",
|
|
332
|
+
tick: "h-0.5 w-0.5 -translate-x-0.25 -translate-y-0.25",
|
|
333
|
+
indicator: "h-2 w-2 -translate-x-1 -translate-y-1",
|
|
334
|
+
indicatorInner: "h-1 w-1 -translate-x-0.5 -translate-y-0.5",
|
|
335
|
+
progress: "-mx-0.5"
|
|
336
|
+
};
|
|
337
|
+
case "md":
|
|
338
|
+
return {
|
|
339
|
+
wrapper: "h-4",
|
|
340
|
+
innerWrapper: "px-1 h-2",
|
|
341
|
+
content: "h-2",
|
|
342
|
+
tick: "h-1 w-1 -translate-x-0.5 -translate-y-0.5",
|
|
343
|
+
indicator: "h-4 w-4 -translate-x-2 -translate-y-2",
|
|
344
|
+
indicatorInner: "h-2 w-2 -translate-x-1 -translate-y-1",
|
|
345
|
+
progress: "-mx-1"
|
|
346
|
+
};
|
|
347
|
+
case "lg":
|
|
348
|
+
return {
|
|
349
|
+
wrapper: "h-6",
|
|
350
|
+
innerWrapper: "px-1.5 h-3",
|
|
351
|
+
content: "h-3",
|
|
352
|
+
tick: "h-1.5 w-1.5 -translate-x-0.75 -translate-y-0.75",
|
|
353
|
+
indicator: "h-6 w-6 -translate-x-3 -translate-y-3",
|
|
354
|
+
indicatorInner: "h-3 w-3 -translate-x-1.5 -translate-y-1.5",
|
|
355
|
+
progress: "-mx-1.5"
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
}), v = m(() => r.animate ? {
|
|
359
|
+
indicator: "transition-left",
|
|
360
|
+
progress: "transition-width"
|
|
361
|
+
} : {
|
|
362
|
+
indicator: "",
|
|
363
|
+
progress: ""
|
|
364
|
+
});
|
|
365
|
+
return (b, _) => (g(), y("div", kt, [
|
|
366
|
+
S("div", {
|
|
367
|
+
ref_key: "wrapper",
|
|
368
|
+
ref: o,
|
|
369
|
+
type: "size",
|
|
370
|
+
class: w(["flex cursor-pointer items-center", c(p).wrapper]),
|
|
371
|
+
onTouchmove: _[0] || (_[0] = Oe(() => {
|
|
372
|
+
}, ["prevent"]))
|
|
373
|
+
}, [
|
|
374
|
+
S("div", {
|
|
375
|
+
class: w(["rounded-full bg-neutral-7", c(p).innerWrapper])
|
|
376
|
+
}, [
|
|
377
|
+
S("div", {
|
|
378
|
+
class: w(["relative flex", c(p).content]),
|
|
379
|
+
style: C({
|
|
380
|
+
width: `${r.width}rem`
|
|
381
|
+
})
|
|
382
|
+
}, [
|
|
383
|
+
(g(!0), y(X, null, te(b.options, (A, O) => (g(), y("div", {
|
|
384
|
+
key: A,
|
|
385
|
+
style: C({
|
|
386
|
+
left: `${O / (c(s) - 1) * 100}%`
|
|
387
|
+
}),
|
|
388
|
+
class: w(["absolute top-50% rounded-full bg-white", c(p).tick])
|
|
389
|
+
}, null, 6))), 128)),
|
|
390
|
+
S("div", {
|
|
391
|
+
ref_key: "indicator",
|
|
392
|
+
ref: i,
|
|
393
|
+
class: w(["absolute top-50% cursor-pointer rounded-full bg-white", [c(p).indicator, c(v).indicator]]),
|
|
394
|
+
style: C({
|
|
395
|
+
left: `${c(a) / (c(s) - 1) * 100}%`
|
|
396
|
+
})
|
|
397
|
+
}, [
|
|
398
|
+
S("div", {
|
|
399
|
+
class: w(["pointer-events-none absolute left-50% top-50% rounded-full bg-sky-5", c(p).indicatorInner])
|
|
400
|
+
}, null, 2)
|
|
401
|
+
], 6),
|
|
402
|
+
S("div", {
|
|
403
|
+
class: w(["pointer-events-none h-full rounded-full bg-sky-5", [c(p).progress, c(v).progress]]),
|
|
404
|
+
style: C({
|
|
405
|
+
width: `${c(a) / (c(s) - 1) * 100}%`
|
|
406
|
+
})
|
|
407
|
+
}, null, 6)
|
|
408
|
+
], 6)
|
|
409
|
+
], 2)
|
|
410
|
+
], 34),
|
|
411
|
+
S("div", {
|
|
412
|
+
class: "relative mx-1 h-1em text-xs op56",
|
|
413
|
+
style: C({
|
|
414
|
+
width: `${r.width}rem`
|
|
415
|
+
})
|
|
416
|
+
}, [
|
|
417
|
+
(g(!0), y(X, null, te(b.options, (A, O) => (g(), y("div", {
|
|
418
|
+
key: A,
|
|
419
|
+
style: C({
|
|
420
|
+
left: `${O / (c(s) - 1) * 100}%`
|
|
421
|
+
}),
|
|
422
|
+
class: w(["absolute w-auto flex rounded-full -translate-x-50%", c(p).tick])
|
|
423
|
+
}, q(A), 7))), 128))
|
|
424
|
+
], 4)
|
|
425
|
+
]));
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
function fe(e) {
|
|
429
|
+
return m(
|
|
430
|
+
() => ({ style: Mt(e.rounded), class: "rounded-[var(--r-rounded)]" })
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
function Mt(e) {
|
|
434
|
+
switch (e) {
|
|
435
|
+
case "none":
|
|
436
|
+
return "--r-rounded: 0";
|
|
437
|
+
case "sm":
|
|
438
|
+
return "--r-rounded: 0.125rem";
|
|
439
|
+
case "md":
|
|
440
|
+
return "--r-rounded: 0.25rem";
|
|
441
|
+
case "lg":
|
|
442
|
+
return "--r-rounded: 0.5rem";
|
|
443
|
+
case "full":
|
|
444
|
+
return "--r-rounded: 9999px";
|
|
445
|
+
default:
|
|
446
|
+
return typeof e == "number" || !Number.isNaN(Number(e)) ? `--r-rounded: ${e}rem;` : "rounded-[var(--r-rounded)]";
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
const St = ["id"], At = ["for"], $t = ["for"], Br = /* @__PURE__ */ R({
|
|
450
|
+
__name: "Switch",
|
|
451
|
+
props: {
|
|
452
|
+
modelValue: {},
|
|
453
|
+
size: { default: "md" },
|
|
454
|
+
animate: { type: Boolean, default: !0 },
|
|
455
|
+
options: {},
|
|
456
|
+
label: {},
|
|
457
|
+
id: {},
|
|
458
|
+
rounded: { default: "full" },
|
|
459
|
+
color: { default: "primary" },
|
|
460
|
+
disabled: { type: Boolean }
|
|
461
|
+
},
|
|
462
|
+
emits: ["update:modelValue"],
|
|
463
|
+
setup(e, { emit: t }) {
|
|
464
|
+
const r = e, n = t, s = k(null), a = k(!1), o = m(() => {
|
|
465
|
+
switch (r.size) {
|
|
466
|
+
case "sm":
|
|
467
|
+
return {
|
|
468
|
+
wrapper: "h-4 w-8",
|
|
469
|
+
indicator: a.value ? "h-3 w-4" : "h-3 w-3",
|
|
470
|
+
inactive: "left-[calc(0.125rem-1px)]",
|
|
471
|
+
active: a.value ? "left-[calc(0.875rem-1px)]" : "left-[calc(1.125rem-1px)]"
|
|
472
|
+
};
|
|
473
|
+
case "md":
|
|
474
|
+
return {
|
|
475
|
+
wrapper: "h-6 w-12",
|
|
476
|
+
indicator: a.value ? "h-4 w-5" : "h-4 w-4",
|
|
477
|
+
inactive: "left-[calc(0.25rem-1px)]",
|
|
478
|
+
active: a.value ? "left-[calc(1.5rem-1px)]" : "left-[calc(1.75rem-1px)]"
|
|
479
|
+
};
|
|
480
|
+
case "lg":
|
|
481
|
+
return {
|
|
482
|
+
wrapper: "h-8 w-16",
|
|
483
|
+
indicator: a.value ? "h-6 w-8" : "h-6 w-6",
|
|
484
|
+
inactive: "left-[calc(0.25rem-1px)]",
|
|
485
|
+
active: a.value ? "left-[calc(1.75rem-1px)]" : "left-[calc(2.25rem-1px)]"
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}), i = m(() => r.animate ? {
|
|
489
|
+
indicator: "transition-all",
|
|
490
|
+
progress: "transition-width"
|
|
491
|
+
} : {
|
|
492
|
+
indicator: "",
|
|
493
|
+
progress: ""
|
|
494
|
+
}), l = r.modelValue !== void 0 ? m({
|
|
495
|
+
get() {
|
|
496
|
+
return r.modelValue;
|
|
497
|
+
},
|
|
498
|
+
set(v) {
|
|
499
|
+
n("update:modelValue", v);
|
|
500
|
+
}
|
|
501
|
+
}) : k(!1);
|
|
502
|
+
function d() {
|
|
503
|
+
const v = k("");
|
|
504
|
+
return de(() => {
|
|
505
|
+
r.id ? v.value = r.id : v.value = `switch-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`;
|
|
506
|
+
}), v;
|
|
507
|
+
}
|
|
508
|
+
const u = d(), f = m(() => {
|
|
509
|
+
let v = "bg-primary-7";
|
|
510
|
+
switch (r.color) {
|
|
511
|
+
case "secondary":
|
|
512
|
+
v = "bg-secondary-7";
|
|
513
|
+
break;
|
|
514
|
+
case "tertiary":
|
|
515
|
+
v = "bg-tertiary-7";
|
|
516
|
+
break;
|
|
517
|
+
case "error":
|
|
518
|
+
v = "bg-error-7";
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
return {
|
|
522
|
+
wrapper: l.value ? `border border-transparent ${v}` : "bg-surface-8 border border-surface-7",
|
|
523
|
+
indicator: r.disabled ? "bg-surface-7" : "bg-white"
|
|
524
|
+
};
|
|
525
|
+
}), p = fe(r);
|
|
526
|
+
return (v, b) => (g(), y("div", {
|
|
527
|
+
role: "switch",
|
|
528
|
+
class: w(["relative flex items-center gap-2", {
|
|
529
|
+
"pointer-events-none filter-grayscale": r.disabled
|
|
530
|
+
}])
|
|
531
|
+
}, [
|
|
532
|
+
Ie(S("input", {
|
|
533
|
+
id: c(u),
|
|
534
|
+
"onUpdate:modelValue": b[0] || (b[0] = (_) => Je(l) ? l.value = _ : null),
|
|
535
|
+
class: "hidden",
|
|
536
|
+
type: "checkbox"
|
|
537
|
+
}, null, 8, St), [
|
|
538
|
+
[et, c(l)]
|
|
539
|
+
]),
|
|
540
|
+
S("label", {
|
|
541
|
+
class: "leading-0 cursor-pointer!",
|
|
542
|
+
for: c(u)
|
|
543
|
+
}, [
|
|
544
|
+
S("div", {
|
|
545
|
+
ref_key: "wrapper",
|
|
546
|
+
ref: s,
|
|
547
|
+
class: w([[c(o).wrapper, c(f).wrapper, c(p).class], "relative inline-block transition-all"]),
|
|
548
|
+
style: C([c(p).style]),
|
|
549
|
+
onPointerdown: b[1] || (b[1] = (_) => a.value = !0),
|
|
550
|
+
onPointerup: b[2] || (b[2] = (_) => a.value = !1),
|
|
551
|
+
onPointerleave: b[3] || (b[3] = (_) => a.value = !1),
|
|
552
|
+
onPointerenter: b[4] || (b[4] = (_) => _.buttons === 1 && (a.value = !0))
|
|
553
|
+
}, [
|
|
554
|
+
S("div", {
|
|
555
|
+
class: w(["absolute top-50% -translate-y-50%", [c(o).indicator, c(f).indicator, c(i).indicator, c(l) ? c(o).active : c(o).inactive, c(p).class]]),
|
|
556
|
+
style: C([c(p).style])
|
|
557
|
+
}, null, 6)
|
|
558
|
+
], 38)
|
|
559
|
+
], 8, At),
|
|
560
|
+
v.label ? (g(), y("label", {
|
|
561
|
+
key: 0,
|
|
562
|
+
for: c(u)
|
|
563
|
+
}, q(v.label), 9, $t)) : $("", !0)
|
|
564
|
+
], 2));
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
function ie(e) {
|
|
568
|
+
"@babel/helpers - typeof";
|
|
569
|
+
return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
570
|
+
return typeof t;
|
|
571
|
+
} : function(t) {
|
|
572
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
573
|
+
}, ie(e);
|
|
574
|
+
}
|
|
575
|
+
var Ct = /^\s+/, zt = /\s+$/;
|
|
576
|
+
function h(e, t) {
|
|
577
|
+
if (e = e || "", t = t || {}, e instanceof h)
|
|
578
|
+
return e;
|
|
579
|
+
if (!(this instanceof h))
|
|
580
|
+
return new h(e, t);
|
|
581
|
+
var r = Rt(e);
|
|
582
|
+
this._originalInput = e, this._r = r.r, this._g = r.g, this._b = r.b, this._a = r.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || r.format, this._gradientType = t.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = r.ok;
|
|
583
|
+
}
|
|
584
|
+
h.prototype = {
|
|
585
|
+
isDark: function() {
|
|
586
|
+
return this.getBrightness() < 128;
|
|
587
|
+
},
|
|
588
|
+
isLight: function() {
|
|
589
|
+
return !this.isDark();
|
|
590
|
+
},
|
|
591
|
+
isValid: function() {
|
|
592
|
+
return this._ok;
|
|
593
|
+
},
|
|
594
|
+
getOriginalInput: function() {
|
|
595
|
+
return this._originalInput;
|
|
596
|
+
},
|
|
597
|
+
getFormat: function() {
|
|
598
|
+
return this._format;
|
|
599
|
+
},
|
|
600
|
+
getAlpha: function() {
|
|
601
|
+
return this._a;
|
|
602
|
+
},
|
|
603
|
+
getBrightness: function() {
|
|
604
|
+
var t = this.toRgb();
|
|
605
|
+
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
|
|
606
|
+
},
|
|
607
|
+
getLuminance: function() {
|
|
608
|
+
var t = this.toRgb(), r, n, s, a, o, i;
|
|
609
|
+
return r = t.r / 255, n = t.g / 255, s = t.b / 255, r <= 0.03928 ? a = r / 12.92 : a = Math.pow((r + 0.055) / 1.055, 2.4), n <= 0.03928 ? o = n / 12.92 : o = Math.pow((n + 0.055) / 1.055, 2.4), s <= 0.03928 ? i = s / 12.92 : i = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * o + 0.0722 * i;
|
|
610
|
+
},
|
|
611
|
+
setAlpha: function(t) {
|
|
612
|
+
return this._a = De(t), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
613
|
+
},
|
|
614
|
+
toHsv: function() {
|
|
615
|
+
var t = Re(this._r, this._g, this._b);
|
|
616
|
+
return {
|
|
617
|
+
h: t.h * 360,
|
|
618
|
+
s: t.s,
|
|
619
|
+
v: t.v,
|
|
620
|
+
a: this._a
|
|
621
|
+
};
|
|
622
|
+
},
|
|
623
|
+
toHsvString: function() {
|
|
624
|
+
var t = Re(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), s = Math.round(t.v * 100);
|
|
625
|
+
return this._a == 1 ? "hsv(" + r + ", " + n + "%, " + s + "%)" : "hsva(" + r + ", " + n + "%, " + s + "%, " + this._roundA + ")";
|
|
626
|
+
},
|
|
627
|
+
toHsl: function() {
|
|
628
|
+
var t = ze(this._r, this._g, this._b);
|
|
629
|
+
return {
|
|
630
|
+
h: t.h * 360,
|
|
631
|
+
s: t.s,
|
|
632
|
+
l: t.l,
|
|
633
|
+
a: this._a
|
|
634
|
+
};
|
|
635
|
+
},
|
|
636
|
+
toHslString: function() {
|
|
637
|
+
var t = ze(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), s = Math.round(t.l * 100);
|
|
638
|
+
return this._a == 1 ? "hsl(" + r + ", " + n + "%, " + s + "%)" : "hsla(" + r + ", " + n + "%, " + s + "%, " + this._roundA + ")";
|
|
639
|
+
},
|
|
640
|
+
toHex: function(t) {
|
|
641
|
+
return Te(this._r, this._g, this._b, t);
|
|
642
|
+
},
|
|
643
|
+
toHexString: function(t) {
|
|
644
|
+
return "#" + this.toHex(t);
|
|
645
|
+
},
|
|
646
|
+
toHex8: function(t) {
|
|
647
|
+
return Pt(this._r, this._g, this._b, this._a, t);
|
|
648
|
+
},
|
|
649
|
+
toHex8String: function(t) {
|
|
650
|
+
return "#" + this.toHex8(t);
|
|
651
|
+
},
|
|
652
|
+
toRgb: function() {
|
|
653
|
+
return {
|
|
654
|
+
r: Math.round(this._r),
|
|
655
|
+
g: Math.round(this._g),
|
|
656
|
+
b: Math.round(this._b),
|
|
657
|
+
a: this._a
|
|
658
|
+
};
|
|
659
|
+
},
|
|
660
|
+
toRgbString: function() {
|
|
661
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
662
|
+
},
|
|
663
|
+
toPercentageRgb: function() {
|
|
664
|
+
return {
|
|
665
|
+
r: Math.round(M(this._r, 255) * 100) + "%",
|
|
666
|
+
g: Math.round(M(this._g, 255) * 100) + "%",
|
|
667
|
+
b: Math.round(M(this._b, 255) * 100) + "%",
|
|
668
|
+
a: this._a
|
|
669
|
+
};
|
|
670
|
+
},
|
|
671
|
+
toPercentageRgbString: function() {
|
|
672
|
+
return this._a == 1 ? "rgb(" + Math.round(M(this._r, 255) * 100) + "%, " + Math.round(M(this._g, 255) * 100) + "%, " + Math.round(M(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(M(this._r, 255) * 100) + "%, " + Math.round(M(this._g, 255) * 100) + "%, " + Math.round(M(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
673
|
+
},
|
|
674
|
+
toName: function() {
|
|
675
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : Xt[Te(this._r, this._g, this._b, !0)] || !1;
|
|
676
|
+
},
|
|
677
|
+
toFilter: function(t) {
|
|
678
|
+
var r = "#" + Ee(this._r, this._g, this._b, this._a), n = r, s = this._gradientType ? "GradientType = 1, " : "";
|
|
679
|
+
if (t) {
|
|
680
|
+
var a = h(t);
|
|
681
|
+
n = "#" + Ee(a._r, a._g, a._b, a._a);
|
|
682
|
+
}
|
|
683
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + s + "startColorstr=" + r + ",endColorstr=" + n + ")";
|
|
684
|
+
},
|
|
685
|
+
toString: function(t) {
|
|
686
|
+
var r = !!t;
|
|
687
|
+
t = t || this._format;
|
|
688
|
+
var n = !1, s = this._a < 1 && this._a >= 0, a = !r && s && (t === "hex" || t === "hex6" || t === "hex3" || t === "hex4" || t === "hex8" || t === "name");
|
|
689
|
+
return a ? t === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (n = this.toRgbString()), t === "prgb" && (n = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (n = this.toHexString()), t === "hex3" && (n = this.toHexString(!0)), t === "hex4" && (n = this.toHex8String(!0)), t === "hex8" && (n = this.toHex8String()), t === "name" && (n = this.toName()), t === "hsl" && (n = this.toHslString()), t === "hsv" && (n = this.toHsvString()), n || this.toHexString());
|
|
690
|
+
},
|
|
691
|
+
clone: function() {
|
|
692
|
+
return h(this.toString());
|
|
693
|
+
},
|
|
694
|
+
_applyModification: function(t, r) {
|
|
695
|
+
var n = t.apply(null, [this].concat([].slice.call(r)));
|
|
696
|
+
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
697
|
+
},
|
|
698
|
+
lighten: function() {
|
|
699
|
+
return this._applyModification(Ot, arguments);
|
|
700
|
+
},
|
|
701
|
+
brighten: function() {
|
|
702
|
+
return this._applyModification(It, arguments);
|
|
703
|
+
},
|
|
704
|
+
darken: function() {
|
|
705
|
+
return this._applyModification(Ft, arguments);
|
|
706
|
+
},
|
|
707
|
+
desaturate: function() {
|
|
708
|
+
return this._applyModification(Ht, arguments);
|
|
709
|
+
},
|
|
710
|
+
saturate: function() {
|
|
711
|
+
return this._applyModification(Bt, arguments);
|
|
712
|
+
},
|
|
713
|
+
greyscale: function() {
|
|
714
|
+
return this._applyModification(Vt, arguments);
|
|
715
|
+
},
|
|
716
|
+
spin: function() {
|
|
717
|
+
return this._applyModification(Dt, arguments);
|
|
718
|
+
},
|
|
719
|
+
_applyCombination: function(t, r) {
|
|
720
|
+
return t.apply(null, [this].concat([].slice.call(r)));
|
|
721
|
+
},
|
|
722
|
+
analogous: function() {
|
|
723
|
+
return this._applyCombination(jt, arguments);
|
|
724
|
+
},
|
|
725
|
+
complement: function() {
|
|
726
|
+
return this._applyCombination(Lt, arguments);
|
|
727
|
+
},
|
|
728
|
+
monochromatic: function() {
|
|
729
|
+
return this._applyCombination(Gt, arguments);
|
|
730
|
+
},
|
|
731
|
+
splitcomplement: function() {
|
|
732
|
+
return this._applyCombination(Wt, arguments);
|
|
733
|
+
},
|
|
734
|
+
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
735
|
+
// polyad: function (number) {
|
|
736
|
+
// return this._applyCombination(polyad, [number]);
|
|
737
|
+
// },
|
|
738
|
+
triad: function() {
|
|
739
|
+
return this._applyCombination(Ne, [3]);
|
|
740
|
+
},
|
|
741
|
+
tetrad: function() {
|
|
742
|
+
return this._applyCombination(Ne, [4]);
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
h.fromRatio = function(e, t) {
|
|
746
|
+
if (ie(e) == "object") {
|
|
747
|
+
var r = {};
|
|
748
|
+
for (var n in e)
|
|
749
|
+
e.hasOwnProperty(n) && (n === "a" ? r[n] = e[n] : r[n] = J(e[n]));
|
|
750
|
+
e = r;
|
|
751
|
+
}
|
|
752
|
+
return h(e, t);
|
|
753
|
+
};
|
|
754
|
+
function Rt(e) {
|
|
755
|
+
var t = {
|
|
756
|
+
r: 0,
|
|
757
|
+
g: 0,
|
|
758
|
+
b: 0
|
|
759
|
+
}, r = 1, n = null, s = null, a = null, o = !1, i = !1;
|
|
760
|
+
return typeof e == "string" && (e = Kt(e)), ie(e) == "object" && (B(e.r) && B(e.g) && B(e.b) ? (t = Tt(e.r, e.g, e.b), o = !0, i = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : B(e.h) && B(e.s) && B(e.v) ? (n = J(e.s), s = J(e.v), t = Nt(e.h, n, s), o = !0, i = "hsv") : B(e.h) && B(e.s) && B(e.l) && (n = J(e.s), a = J(e.l), t = Et(e.h, n, a), o = !0, i = "hsl"), e.hasOwnProperty("a") && (r = e.a)), r = De(r), {
|
|
761
|
+
ok: o,
|
|
762
|
+
format: e.format || i,
|
|
763
|
+
r: Math.min(255, Math.max(t.r, 0)),
|
|
764
|
+
g: Math.min(255, Math.max(t.g, 0)),
|
|
765
|
+
b: Math.min(255, Math.max(t.b, 0)),
|
|
766
|
+
a: r
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function Tt(e, t, r) {
|
|
770
|
+
return {
|
|
771
|
+
r: M(e, 255) * 255,
|
|
772
|
+
g: M(t, 255) * 255,
|
|
773
|
+
b: M(r, 255) * 255
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
function ze(e, t, r) {
|
|
777
|
+
e = M(e, 255), t = M(t, 255), r = M(r, 255);
|
|
778
|
+
var n = Math.max(e, t, r), s = Math.min(e, t, r), a, o, i = (n + s) / 2;
|
|
779
|
+
if (n == s)
|
|
780
|
+
a = o = 0;
|
|
781
|
+
else {
|
|
782
|
+
var l = n - s;
|
|
783
|
+
switch (o = i > 0.5 ? l / (2 - n - s) : l / (n + s), n) {
|
|
784
|
+
case e:
|
|
785
|
+
a = (t - r) / l + (t < r ? 6 : 0);
|
|
786
|
+
break;
|
|
787
|
+
case t:
|
|
788
|
+
a = (r - e) / l + 2;
|
|
789
|
+
break;
|
|
790
|
+
case r:
|
|
791
|
+
a = (e - t) / l + 4;
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
a /= 6;
|
|
795
|
+
}
|
|
796
|
+
return {
|
|
797
|
+
h: a,
|
|
798
|
+
s: o,
|
|
799
|
+
l: i
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function Et(e, t, r) {
|
|
803
|
+
var n, s, a;
|
|
804
|
+
e = M(e, 360), t = M(t, 100), r = M(r, 100);
|
|
805
|
+
function o(d, u, f) {
|
|
806
|
+
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 1 / 6 ? d + (u - d) * 6 * f : f < 1 / 2 ? u : f < 2 / 3 ? d + (u - d) * (2 / 3 - f) * 6 : d;
|
|
807
|
+
}
|
|
808
|
+
if (t === 0)
|
|
809
|
+
n = s = a = r;
|
|
810
|
+
else {
|
|
811
|
+
var i = r < 0.5 ? r * (1 + t) : r + t - r * t, l = 2 * r - i;
|
|
812
|
+
n = o(l, i, e + 1 / 3), s = o(l, i, e), a = o(l, i, e - 1 / 3);
|
|
813
|
+
}
|
|
814
|
+
return {
|
|
815
|
+
r: n * 255,
|
|
816
|
+
g: s * 255,
|
|
817
|
+
b: a * 255
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
function Re(e, t, r) {
|
|
821
|
+
e = M(e, 255), t = M(t, 255), r = M(r, 255);
|
|
822
|
+
var n = Math.max(e, t, r), s = Math.min(e, t, r), a, o, i = n, l = n - s;
|
|
823
|
+
if (o = n === 0 ? 0 : l / n, n == s)
|
|
824
|
+
a = 0;
|
|
825
|
+
else {
|
|
826
|
+
switch (n) {
|
|
827
|
+
case e:
|
|
828
|
+
a = (t - r) / l + (t < r ? 6 : 0);
|
|
829
|
+
break;
|
|
830
|
+
case t:
|
|
831
|
+
a = (r - e) / l + 2;
|
|
832
|
+
break;
|
|
833
|
+
case r:
|
|
834
|
+
a = (e - t) / l + 4;
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
a /= 6;
|
|
838
|
+
}
|
|
839
|
+
return {
|
|
840
|
+
h: a,
|
|
841
|
+
s: o,
|
|
842
|
+
v: i
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function Nt(e, t, r) {
|
|
846
|
+
e = M(e, 360) * 6, t = M(t, 100), r = M(r, 100);
|
|
847
|
+
var n = Math.floor(e), s = e - n, a = r * (1 - t), o = r * (1 - s * t), i = r * (1 - (1 - s) * t), l = n % 6, d = [r, o, a, a, i, r][l], u = [i, r, r, o, a, a][l], f = [a, a, i, r, r, o][l];
|
|
848
|
+
return {
|
|
849
|
+
r: d * 255,
|
|
850
|
+
g: u * 255,
|
|
851
|
+
b: f * 255
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
function Te(e, t, r, n) {
|
|
855
|
+
var s = [N(Math.round(e).toString(16)), N(Math.round(t).toString(16)), N(Math.round(r).toString(16))];
|
|
856
|
+
return n && s[0].charAt(0) == s[0].charAt(1) && s[1].charAt(0) == s[1].charAt(1) && s[2].charAt(0) == s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join("");
|
|
857
|
+
}
|
|
858
|
+
function Pt(e, t, r, n, s) {
|
|
859
|
+
var a = [N(Math.round(e).toString(16)), N(Math.round(t).toString(16)), N(Math.round(r).toString(16)), N(Le(n))];
|
|
860
|
+
return s && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
861
|
+
}
|
|
862
|
+
function Ee(e, t, r, n) {
|
|
863
|
+
var s = [N(Le(n)), N(Math.round(e).toString(16)), N(Math.round(t).toString(16)), N(Math.round(r).toString(16))];
|
|
864
|
+
return s.join("");
|
|
865
|
+
}
|
|
866
|
+
h.equals = function(e, t) {
|
|
867
|
+
return !e || !t ? !1 : h(e).toRgbString() == h(t).toRgbString();
|
|
868
|
+
};
|
|
869
|
+
h.random = function() {
|
|
870
|
+
return h.fromRatio({
|
|
871
|
+
r: Math.random(),
|
|
872
|
+
g: Math.random(),
|
|
873
|
+
b: Math.random()
|
|
874
|
+
});
|
|
875
|
+
};
|
|
876
|
+
function Ht(e, t) {
|
|
877
|
+
t = t === 0 ? 0 : t || 10;
|
|
878
|
+
var r = h(e).toHsl();
|
|
879
|
+
return r.s -= t / 100, r.s = he(r.s), h(r);
|
|
880
|
+
}
|
|
881
|
+
function Bt(e, t) {
|
|
882
|
+
t = t === 0 ? 0 : t || 10;
|
|
883
|
+
var r = h(e).toHsl();
|
|
884
|
+
return r.s += t / 100, r.s = he(r.s), h(r);
|
|
885
|
+
}
|
|
886
|
+
function Vt(e) {
|
|
887
|
+
return h(e).desaturate(100);
|
|
888
|
+
}
|
|
889
|
+
function Ot(e, t) {
|
|
890
|
+
t = t === 0 ? 0 : t || 10;
|
|
891
|
+
var r = h(e).toHsl();
|
|
892
|
+
return r.l += t / 100, r.l = he(r.l), h(r);
|
|
893
|
+
}
|
|
894
|
+
function It(e, t) {
|
|
895
|
+
t = t === 0 ? 0 : t || 10;
|
|
896
|
+
var r = h(e).toRgb();
|
|
897
|
+
return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(t / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(t / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(t / 100)))), h(r);
|
|
898
|
+
}
|
|
899
|
+
function Ft(e, t) {
|
|
900
|
+
t = t === 0 ? 0 : t || 10;
|
|
901
|
+
var r = h(e).toHsl();
|
|
902
|
+
return r.l -= t / 100, r.l = he(r.l), h(r);
|
|
903
|
+
}
|
|
904
|
+
function Dt(e, t) {
|
|
905
|
+
var r = h(e).toHsl(), n = (r.h + t) % 360;
|
|
906
|
+
return r.h = n < 0 ? 360 + n : n, h(r);
|
|
907
|
+
}
|
|
908
|
+
function Lt(e) {
|
|
909
|
+
var t = h(e).toHsl();
|
|
910
|
+
return t.h = (t.h + 180) % 360, h(t);
|
|
911
|
+
}
|
|
912
|
+
function Ne(e, t) {
|
|
913
|
+
if (isNaN(t) || t <= 0)
|
|
914
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
915
|
+
for (var r = h(e).toHsl(), n = [h(e)], s = 360 / t, a = 1; a < t; a++)
|
|
916
|
+
n.push(h({
|
|
917
|
+
h: (r.h + a * s) % 360,
|
|
918
|
+
s: r.s,
|
|
919
|
+
l: r.l
|
|
920
|
+
}));
|
|
921
|
+
return n;
|
|
922
|
+
}
|
|
923
|
+
function Wt(e) {
|
|
924
|
+
var t = h(e).toHsl(), r = t.h;
|
|
925
|
+
return [h(e), h({
|
|
926
|
+
h: (r + 72) % 360,
|
|
927
|
+
s: t.s,
|
|
928
|
+
l: t.l
|
|
929
|
+
}), h({
|
|
930
|
+
h: (r + 216) % 360,
|
|
931
|
+
s: t.s,
|
|
932
|
+
l: t.l
|
|
933
|
+
})];
|
|
934
|
+
}
|
|
935
|
+
function jt(e, t, r) {
|
|
936
|
+
t = t || 6, r = r || 30;
|
|
937
|
+
var n = h(e).toHsl(), s = 360 / r, a = [h(e)];
|
|
938
|
+
for (n.h = (n.h - (s * t >> 1) + 720) % 360; --t; )
|
|
939
|
+
n.h = (n.h + s) % 360, a.push(h(n));
|
|
940
|
+
return a;
|
|
941
|
+
}
|
|
942
|
+
function Gt(e, t) {
|
|
943
|
+
t = t || 6;
|
|
944
|
+
for (var r = h(e).toHsv(), n = r.h, s = r.s, a = r.v, o = [], i = 1 / t; t--; )
|
|
945
|
+
o.push(h({
|
|
946
|
+
h: n,
|
|
947
|
+
s,
|
|
948
|
+
v: a
|
|
949
|
+
})), a = (a + i) % 1;
|
|
950
|
+
return o;
|
|
951
|
+
}
|
|
952
|
+
h.mix = function(e, t, r) {
|
|
953
|
+
r = r === 0 ? 0 : r || 50;
|
|
954
|
+
var n = h(e).toRgb(), s = h(t).toRgb(), a = r / 100, o = {
|
|
955
|
+
r: (s.r - n.r) * a + n.r,
|
|
956
|
+
g: (s.g - n.g) * a + n.g,
|
|
957
|
+
b: (s.b - n.b) * a + n.b,
|
|
958
|
+
a: (s.a - n.a) * a + n.a
|
|
959
|
+
};
|
|
960
|
+
return h(o);
|
|
961
|
+
};
|
|
962
|
+
h.readability = function(e, t) {
|
|
963
|
+
var r = h(e), n = h(t);
|
|
964
|
+
return (Math.max(r.getLuminance(), n.getLuminance()) + 0.05) / (Math.min(r.getLuminance(), n.getLuminance()) + 0.05);
|
|
965
|
+
};
|
|
966
|
+
h.isReadable = function(e, t, r) {
|
|
967
|
+
var n = h.readability(e, t), s, a;
|
|
968
|
+
switch (a = !1, s = Qt(r), s.level + s.size) {
|
|
969
|
+
case "AAsmall":
|
|
970
|
+
case "AAAlarge":
|
|
971
|
+
a = n >= 4.5;
|
|
972
|
+
break;
|
|
973
|
+
case "AAlarge":
|
|
974
|
+
a = n >= 3;
|
|
975
|
+
break;
|
|
976
|
+
case "AAAsmall":
|
|
977
|
+
a = n >= 7;
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
return a;
|
|
981
|
+
};
|
|
982
|
+
h.mostReadable = function(e, t, r) {
|
|
983
|
+
var n = null, s = 0, a, o, i, l;
|
|
984
|
+
r = r || {}, o = r.includeFallbackColors, i = r.level, l = r.size;
|
|
985
|
+
for (var d = 0; d < t.length; d++)
|
|
986
|
+
a = h.readability(e, t[d]), a > s && (s = a, n = h(t[d]));
|
|
987
|
+
return h.isReadable(e, n, {
|
|
988
|
+
level: i,
|
|
989
|
+
size: l
|
|
990
|
+
}) || !o ? n : (r.includeFallbackColors = !1, h.mostReadable(e, ["#fff", "#000"], r));
|
|
991
|
+
};
|
|
992
|
+
var ye = h.names = {
|
|
993
|
+
aliceblue: "f0f8ff",
|
|
994
|
+
antiquewhite: "faebd7",
|
|
995
|
+
aqua: "0ff",
|
|
996
|
+
aquamarine: "7fffd4",
|
|
997
|
+
azure: "f0ffff",
|
|
998
|
+
beige: "f5f5dc",
|
|
999
|
+
bisque: "ffe4c4",
|
|
1000
|
+
black: "000",
|
|
1001
|
+
blanchedalmond: "ffebcd",
|
|
1002
|
+
blue: "00f",
|
|
1003
|
+
blueviolet: "8a2be2",
|
|
1004
|
+
brown: "a52a2a",
|
|
1005
|
+
burlywood: "deb887",
|
|
1006
|
+
burntsienna: "ea7e5d",
|
|
1007
|
+
cadetblue: "5f9ea0",
|
|
1008
|
+
chartreuse: "7fff00",
|
|
1009
|
+
chocolate: "d2691e",
|
|
1010
|
+
coral: "ff7f50",
|
|
1011
|
+
cornflowerblue: "6495ed",
|
|
1012
|
+
cornsilk: "fff8dc",
|
|
1013
|
+
crimson: "dc143c",
|
|
1014
|
+
cyan: "0ff",
|
|
1015
|
+
darkblue: "00008b",
|
|
1016
|
+
darkcyan: "008b8b",
|
|
1017
|
+
darkgoldenrod: "b8860b",
|
|
1018
|
+
darkgray: "a9a9a9",
|
|
1019
|
+
darkgreen: "006400",
|
|
1020
|
+
darkgrey: "a9a9a9",
|
|
1021
|
+
darkkhaki: "bdb76b",
|
|
1022
|
+
darkmagenta: "8b008b",
|
|
1023
|
+
darkolivegreen: "556b2f",
|
|
1024
|
+
darkorange: "ff8c00",
|
|
1025
|
+
darkorchid: "9932cc",
|
|
1026
|
+
darkred: "8b0000",
|
|
1027
|
+
darksalmon: "e9967a",
|
|
1028
|
+
darkseagreen: "8fbc8f",
|
|
1029
|
+
darkslateblue: "483d8b",
|
|
1030
|
+
darkslategray: "2f4f4f",
|
|
1031
|
+
darkslategrey: "2f4f4f",
|
|
1032
|
+
darkturquoise: "00ced1",
|
|
1033
|
+
darkviolet: "9400d3",
|
|
1034
|
+
deeppink: "ff1493",
|
|
1035
|
+
deepskyblue: "00bfff",
|
|
1036
|
+
dimgray: "696969",
|
|
1037
|
+
dimgrey: "696969",
|
|
1038
|
+
dodgerblue: "1e90ff",
|
|
1039
|
+
firebrick: "b22222",
|
|
1040
|
+
floralwhite: "fffaf0",
|
|
1041
|
+
forestgreen: "228b22",
|
|
1042
|
+
fuchsia: "f0f",
|
|
1043
|
+
gainsboro: "dcdcdc",
|
|
1044
|
+
ghostwhite: "f8f8ff",
|
|
1045
|
+
gold: "ffd700",
|
|
1046
|
+
goldenrod: "daa520",
|
|
1047
|
+
gray: "808080",
|
|
1048
|
+
green: "008000",
|
|
1049
|
+
greenyellow: "adff2f",
|
|
1050
|
+
grey: "808080",
|
|
1051
|
+
honeydew: "f0fff0",
|
|
1052
|
+
hotpink: "ff69b4",
|
|
1053
|
+
indianred: "cd5c5c",
|
|
1054
|
+
indigo: "4b0082",
|
|
1055
|
+
ivory: "fffff0",
|
|
1056
|
+
khaki: "f0e68c",
|
|
1057
|
+
lavender: "e6e6fa",
|
|
1058
|
+
lavenderblush: "fff0f5",
|
|
1059
|
+
lawngreen: "7cfc00",
|
|
1060
|
+
lemonchiffon: "fffacd",
|
|
1061
|
+
lightblue: "add8e6",
|
|
1062
|
+
lightcoral: "f08080",
|
|
1063
|
+
lightcyan: "e0ffff",
|
|
1064
|
+
lightgoldenrodyellow: "fafad2",
|
|
1065
|
+
lightgray: "d3d3d3",
|
|
1066
|
+
lightgreen: "90ee90",
|
|
1067
|
+
lightgrey: "d3d3d3",
|
|
1068
|
+
lightpink: "ffb6c1",
|
|
1069
|
+
lightsalmon: "ffa07a",
|
|
1070
|
+
lightseagreen: "20b2aa",
|
|
1071
|
+
lightskyblue: "87cefa",
|
|
1072
|
+
lightslategray: "789",
|
|
1073
|
+
lightslategrey: "789",
|
|
1074
|
+
lightsteelblue: "b0c4de",
|
|
1075
|
+
lightyellow: "ffffe0",
|
|
1076
|
+
lime: "0f0",
|
|
1077
|
+
limegreen: "32cd32",
|
|
1078
|
+
linen: "faf0e6",
|
|
1079
|
+
magenta: "f0f",
|
|
1080
|
+
maroon: "800000",
|
|
1081
|
+
mediumaquamarine: "66cdaa",
|
|
1082
|
+
mediumblue: "0000cd",
|
|
1083
|
+
mediumorchid: "ba55d3",
|
|
1084
|
+
mediumpurple: "9370db",
|
|
1085
|
+
mediumseagreen: "3cb371",
|
|
1086
|
+
mediumslateblue: "7b68ee",
|
|
1087
|
+
mediumspringgreen: "00fa9a",
|
|
1088
|
+
mediumturquoise: "48d1cc",
|
|
1089
|
+
mediumvioletred: "c71585",
|
|
1090
|
+
midnightblue: "191970",
|
|
1091
|
+
mintcream: "f5fffa",
|
|
1092
|
+
mistyrose: "ffe4e1",
|
|
1093
|
+
moccasin: "ffe4b5",
|
|
1094
|
+
navajowhite: "ffdead",
|
|
1095
|
+
navy: "000080",
|
|
1096
|
+
oldlace: "fdf5e6",
|
|
1097
|
+
olive: "808000",
|
|
1098
|
+
olivedrab: "6b8e23",
|
|
1099
|
+
orange: "ffa500",
|
|
1100
|
+
orangered: "ff4500",
|
|
1101
|
+
orchid: "da70d6",
|
|
1102
|
+
palegoldenrod: "eee8aa",
|
|
1103
|
+
palegreen: "98fb98",
|
|
1104
|
+
paleturquoise: "afeeee",
|
|
1105
|
+
palevioletred: "db7093",
|
|
1106
|
+
papayawhip: "ffefd5",
|
|
1107
|
+
peachpuff: "ffdab9",
|
|
1108
|
+
peru: "cd853f",
|
|
1109
|
+
pink: "ffc0cb",
|
|
1110
|
+
plum: "dda0dd",
|
|
1111
|
+
powderblue: "b0e0e6",
|
|
1112
|
+
purple: "800080",
|
|
1113
|
+
rebeccapurple: "663399",
|
|
1114
|
+
red: "f00",
|
|
1115
|
+
rosybrown: "bc8f8f",
|
|
1116
|
+
royalblue: "4169e1",
|
|
1117
|
+
saddlebrown: "8b4513",
|
|
1118
|
+
salmon: "fa8072",
|
|
1119
|
+
sandybrown: "f4a460",
|
|
1120
|
+
seagreen: "2e8b57",
|
|
1121
|
+
seashell: "fff5ee",
|
|
1122
|
+
sienna: "a0522d",
|
|
1123
|
+
silver: "c0c0c0",
|
|
1124
|
+
skyblue: "87ceeb",
|
|
1125
|
+
slateblue: "6a5acd",
|
|
1126
|
+
slategray: "708090",
|
|
1127
|
+
slategrey: "708090",
|
|
1128
|
+
snow: "fffafa",
|
|
1129
|
+
springgreen: "00ff7f",
|
|
1130
|
+
steelblue: "4682b4",
|
|
1131
|
+
tan: "d2b48c",
|
|
1132
|
+
teal: "008080",
|
|
1133
|
+
thistle: "d8bfd8",
|
|
1134
|
+
tomato: "ff6347",
|
|
1135
|
+
turquoise: "40e0d0",
|
|
1136
|
+
violet: "ee82ee",
|
|
1137
|
+
wheat: "f5deb3",
|
|
1138
|
+
white: "fff",
|
|
1139
|
+
whitesmoke: "f5f5f5",
|
|
1140
|
+
yellow: "ff0",
|
|
1141
|
+
yellowgreen: "9acd32"
|
|
1142
|
+
}, Xt = h.hexNames = qt(ye);
|
|
1143
|
+
function qt(e) {
|
|
1144
|
+
var t = {};
|
|
1145
|
+
for (var r in e)
|
|
1146
|
+
e.hasOwnProperty(r) && (t[e[r]] = r);
|
|
1147
|
+
return t;
|
|
1148
|
+
}
|
|
1149
|
+
function De(e) {
|
|
1150
|
+
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1151
|
+
}
|
|
1152
|
+
function M(e, t) {
|
|
1153
|
+
Ut(e) && (e = "100%");
|
|
1154
|
+
var r = Yt(e);
|
|
1155
|
+
return e = Math.min(t, Math.max(0, parseFloat(e))), r && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
|
|
1156
|
+
}
|
|
1157
|
+
function he(e) {
|
|
1158
|
+
return Math.min(1, Math.max(0, e));
|
|
1159
|
+
}
|
|
1160
|
+
function T(e) {
|
|
1161
|
+
return parseInt(e, 16);
|
|
1162
|
+
}
|
|
1163
|
+
function Ut(e) {
|
|
1164
|
+
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
1165
|
+
}
|
|
1166
|
+
function Yt(e) {
|
|
1167
|
+
return typeof e == "string" && e.indexOf("%") != -1;
|
|
1168
|
+
}
|
|
1169
|
+
function N(e) {
|
|
1170
|
+
return e.length == 1 ? "0" + e : "" + e;
|
|
1171
|
+
}
|
|
1172
|
+
function J(e) {
|
|
1173
|
+
return e <= 1 && (e = e * 100 + "%"), e;
|
|
1174
|
+
}
|
|
1175
|
+
function Le(e) {
|
|
1176
|
+
return Math.round(parseFloat(e) * 255).toString(16);
|
|
1177
|
+
}
|
|
1178
|
+
function Pe(e) {
|
|
1179
|
+
return T(e) / 255;
|
|
1180
|
+
}
|
|
1181
|
+
var E = function() {
|
|
1182
|
+
var e = "[-\\+]?\\d+%?", t = "[-\\+]?\\d*\\.\\d+%?", r = "(?:" + t + ")|(?:" + e + ")", n = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?", s = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?";
|
|
1183
|
+
return {
|
|
1184
|
+
CSS_UNIT: new RegExp(r),
|
|
1185
|
+
rgb: new RegExp("rgb" + n),
|
|
1186
|
+
rgba: new RegExp("rgba" + s),
|
|
1187
|
+
hsl: new RegExp("hsl" + n),
|
|
1188
|
+
hsla: new RegExp("hsla" + s),
|
|
1189
|
+
hsv: new RegExp("hsv" + n),
|
|
1190
|
+
hsva: new RegExp("hsva" + s),
|
|
1191
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1192
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
1193
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1194
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1195
|
+
};
|
|
1196
|
+
}();
|
|
1197
|
+
function B(e) {
|
|
1198
|
+
return !!E.CSS_UNIT.exec(e);
|
|
1199
|
+
}
|
|
1200
|
+
function Kt(e) {
|
|
1201
|
+
e = e.replace(Ct, "").replace(zt, "").toLowerCase();
|
|
1202
|
+
var t = !1;
|
|
1203
|
+
if (ye[e])
|
|
1204
|
+
e = ye[e], t = !0;
|
|
1205
|
+
else if (e == "transparent")
|
|
1206
|
+
return {
|
|
1207
|
+
r: 0,
|
|
1208
|
+
g: 0,
|
|
1209
|
+
b: 0,
|
|
1210
|
+
a: 0,
|
|
1211
|
+
format: "name"
|
|
1212
|
+
};
|
|
1213
|
+
var r;
|
|
1214
|
+
return (r = E.rgb.exec(e)) ? {
|
|
1215
|
+
r: r[1],
|
|
1216
|
+
g: r[2],
|
|
1217
|
+
b: r[3]
|
|
1218
|
+
} : (r = E.rgba.exec(e)) ? {
|
|
1219
|
+
r: r[1],
|
|
1220
|
+
g: r[2],
|
|
1221
|
+
b: r[3],
|
|
1222
|
+
a: r[4]
|
|
1223
|
+
} : (r = E.hsl.exec(e)) ? {
|
|
1224
|
+
h: r[1],
|
|
1225
|
+
s: r[2],
|
|
1226
|
+
l: r[3]
|
|
1227
|
+
} : (r = E.hsla.exec(e)) ? {
|
|
1228
|
+
h: r[1],
|
|
1229
|
+
s: r[2],
|
|
1230
|
+
l: r[3],
|
|
1231
|
+
a: r[4]
|
|
1232
|
+
} : (r = E.hsv.exec(e)) ? {
|
|
1233
|
+
h: r[1],
|
|
1234
|
+
s: r[2],
|
|
1235
|
+
v: r[3]
|
|
1236
|
+
} : (r = E.hsva.exec(e)) ? {
|
|
1237
|
+
h: r[1],
|
|
1238
|
+
s: r[2],
|
|
1239
|
+
v: r[3],
|
|
1240
|
+
a: r[4]
|
|
1241
|
+
} : (r = E.hex8.exec(e)) ? {
|
|
1242
|
+
r: T(r[1]),
|
|
1243
|
+
g: T(r[2]),
|
|
1244
|
+
b: T(r[3]),
|
|
1245
|
+
a: Pe(r[4]),
|
|
1246
|
+
format: t ? "name" : "hex8"
|
|
1247
|
+
} : (r = E.hex6.exec(e)) ? {
|
|
1248
|
+
r: T(r[1]),
|
|
1249
|
+
g: T(r[2]),
|
|
1250
|
+
b: T(r[3]),
|
|
1251
|
+
format: t ? "name" : "hex"
|
|
1252
|
+
} : (r = E.hex4.exec(e)) ? {
|
|
1253
|
+
r: T(r[1] + "" + r[1]),
|
|
1254
|
+
g: T(r[2] + "" + r[2]),
|
|
1255
|
+
b: T(r[3] + "" + r[3]),
|
|
1256
|
+
a: Pe(r[4] + "" + r[4]),
|
|
1257
|
+
format: t ? "name" : "hex8"
|
|
1258
|
+
} : (r = E.hex3.exec(e)) ? {
|
|
1259
|
+
r: T(r[1] + "" + r[1]),
|
|
1260
|
+
g: T(r[2] + "" + r[2]),
|
|
1261
|
+
b: T(r[3] + "" + r[3]),
|
|
1262
|
+
format: t ? "name" : "hex"
|
|
1263
|
+
} : !1;
|
|
1264
|
+
}
|
|
1265
|
+
function Qt(e) {
|
|
1266
|
+
var t, r;
|
|
1267
|
+
return e = e || {
|
|
1268
|
+
level: "AA",
|
|
1269
|
+
size: "small"
|
|
1270
|
+
}, t = (e.level || "AA").toUpperCase(), r = (e.size || "small").toLowerCase(), t !== "AA" && t !== "AAA" && (t = "AA"), r !== "small" && r !== "large" && (r = "small"), {
|
|
1271
|
+
level: t,
|
|
1272
|
+
size: r
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
const Zt = {
|
|
1276
|
+
primary: ["#f0f9ff", "#e0f2fe", "#bae6fd", "#7dd3fc", "#38bdf8", "#0ea5e9", "#0284c7", "#0369a1", "#075985", "#0c4a6e", "#082f49"],
|
|
1277
|
+
secondary: ["#f0fdf4", "#dcfce7", "#bbf7d0", "#86efac", "#4ade80", "#22c55e", "#059669", "#047857", "#065f46", "#064e3b", "#033d2f"],
|
|
1278
|
+
tertiary: ["#fffbeb", "#fef3c7", "#fde68a", "#fcd34d", "#fbbf24", "#f59e0b", "#d97706", "#b45309", "#92400e", "#78350f", "#572508"],
|
|
1279
|
+
error: ["#fff5f5", "#fed7d7", "#feb2b2", "#fc8181", "#f56565", "#e53e3e", "#9b2c2c", "#7c1d1d", "#6b1616", "#581414", "#450a0a"],
|
|
1280
|
+
surface: ["#fafafa", "#f5f5f5", "#e5e5e5", "#d4d4d4", "#a3a3a3", "#737373", "#525252", "#404040", "#262626", "#171717", "#0a0a0a"]
|
|
1281
|
+
}, se = {
|
|
1282
|
+
theme: "dark",
|
|
1283
|
+
colors: Zt
|
|
1284
|
+
}, Vr = Symbol("Notifications"), We = tt([]);
|
|
1285
|
+
function Jt() {
|
|
1286
|
+
return We;
|
|
1287
|
+
}
|
|
1288
|
+
class Or {
|
|
1289
|
+
static show(t) {
|
|
1290
|
+
t.hash = Math.random().toString(36), We.push(t);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
const Ir = /* @__PURE__ */ R({
|
|
1294
|
+
__name: "RokuProvider",
|
|
1295
|
+
props: {
|
|
1296
|
+
is: { default: "div" },
|
|
1297
|
+
theme: { default() {
|
|
1298
|
+
return se;
|
|
1299
|
+
} }
|
|
1300
|
+
},
|
|
1301
|
+
setup(e) {
|
|
1302
|
+
const t = e, r = Object.keys(se.colors).map((s) => {
|
|
1303
|
+
const a = s;
|
|
1304
|
+
return se.colors[a].reduce((i, l, d) => {
|
|
1305
|
+
const u = h(l).toRgb();
|
|
1306
|
+
return i[`--r-color-${a}-${d}`] = `${u.r} ${u.g} ${u.b}`, i;
|
|
1307
|
+
}, {});
|
|
1308
|
+
}).reduce((s, a) => ({
|
|
1309
|
+
...s,
|
|
1310
|
+
...a
|
|
1311
|
+
}), {}), n = {
|
|
1312
|
+
"--r-color-theme": se.theme,
|
|
1313
|
+
...r,
|
|
1314
|
+
"color-scheme": "dark light",
|
|
1315
|
+
"font-family": "'Roboto', sans-serif",
|
|
1316
|
+
"background-color": "rgb(var(--r-color-surface-9))"
|
|
1317
|
+
};
|
|
1318
|
+
return rt("theme", t.theme), (s, a) => (g(), L(xe(s.is), { style: n }, {
|
|
1319
|
+
default: ce(() => [
|
|
1320
|
+
P(s.$slots, "default")
|
|
1321
|
+
]),
|
|
1322
|
+
_: 3
|
|
1323
|
+
}));
|
|
1324
|
+
}
|
|
1325
|
+
}), er = { class: "w-full flex items-center" }, tr = ["value"], rr = /* @__PURE__ */ S("i", { class: "i-tabler-chevron-down pointer-events-none absolute right-2" }, null, -1), nr = {
|
|
1326
|
+
key: 0,
|
|
1327
|
+
class: "flex cursor-default items-center justify-between gap-2 rounded p-1 px-2"
|
|
1328
|
+
}, ar = ["onPointerdown", "onHover"], sr = { key: 0 }, or = /* @__PURE__ */ S("i", { class: "i-tabler-check h-3 w-3" }, null, -1), ir = [
|
|
1329
|
+
or
|
|
1330
|
+
], Fr = /* @__PURE__ */ R({
|
|
1331
|
+
__name: "Select",
|
|
1332
|
+
props: {
|
|
1333
|
+
options: { default() {
|
|
1334
|
+
return [];
|
|
1335
|
+
} },
|
|
1336
|
+
modelValue: { default: void 0 },
|
|
1337
|
+
size: { default: "md" },
|
|
1338
|
+
noneText: { default: "No options" }
|
|
1339
|
+
},
|
|
1340
|
+
emits: ["update:modelValue", "change"],
|
|
1341
|
+
setup(e, { emit: t }) {
|
|
1342
|
+
const r = e, n = t, s = m({
|
|
1343
|
+
get() {
|
|
1344
|
+
return r.modelValue;
|
|
1345
|
+
},
|
|
1346
|
+
set(x) {
|
|
1347
|
+
n("update:modelValue", x);
|
|
1348
|
+
}
|
|
1349
|
+
}), a = k(null), o = k(null), { focused: i } = xt(a), l = m(() => r.options.map((x) => _(x)).indexOf(s.value)), d = k(-1), u = k(-1);
|
|
1350
|
+
oe(() => {
|
|
1351
|
+
i.value || (u.value = -1);
|
|
1352
|
+
}), oe(() => {
|
|
1353
|
+
s.value = _(r.options[l.value]);
|
|
1354
|
+
}), ae(s, () => {
|
|
1355
|
+
n("change", s.value);
|
|
1356
|
+
});
|
|
1357
|
+
const f = r.options, p = m(() => f[l.value]), v = m(() => b(p.value));
|
|
1358
|
+
function b(x) {
|
|
1359
|
+
if (x)
|
|
1360
|
+
return typeof x == "string" || typeof x == "symbol" || typeof x == "number" ? x : x.label;
|
|
1361
|
+
}
|
|
1362
|
+
function _(x) {
|
|
1363
|
+
if (x)
|
|
1364
|
+
return typeof x == "string" || typeof x == "symbol" || typeof x == "number" ? x : x.id;
|
|
1365
|
+
}
|
|
1366
|
+
be("ArrowDown", (x) => {
|
|
1367
|
+
i.value && (x.preventDefault(), u.value = (u.value + 1) % f.length);
|
|
1368
|
+
}), be("ArrowUp", (x) => {
|
|
1369
|
+
i.value && (x.preventDefault(), u.value = (u.value - 1 + f.length) % f.length);
|
|
1370
|
+
}), be("Enter", () => {
|
|
1371
|
+
i.value && u.value !== -1 && (s.value = _(f[u.value]), i.value = !1);
|
|
1372
|
+
});
|
|
1373
|
+
function A(x) {
|
|
1374
|
+
if (!i.value) {
|
|
1375
|
+
i.value = !0;
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
s.value = _(x), i.value = !1;
|
|
1379
|
+
}
|
|
1380
|
+
const O = m(() => ({
|
|
1381
|
+
input: "container-default focus:border-primary-7"
|
|
1382
|
+
})), ge = m(() => {
|
|
1383
|
+
switch (r.size) {
|
|
1384
|
+
case "sm":
|
|
1385
|
+
return {
|
|
1386
|
+
wrapper: "h-6 w-full py-1 pl-1.5 pr-6 text-sm",
|
|
1387
|
+
dropdown: "text-sm children:py-1"
|
|
1388
|
+
};
|
|
1389
|
+
case "lg":
|
|
1390
|
+
return {
|
|
1391
|
+
wrapper: "h-10 w-full py-2 pl-3 pr-10 text-lg",
|
|
1392
|
+
dropdown: "text-lg children:py-2"
|
|
1393
|
+
};
|
|
1394
|
+
default:
|
|
1395
|
+
return {
|
|
1396
|
+
wrapper: "h-8 w-full py-1 pl-2 pr-8 text-base",
|
|
1397
|
+
dropdown: "text-base children:py-1"
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
return (x, j) => (g(), y("div", {
|
|
1402
|
+
ref_key: "wrapperRef",
|
|
1403
|
+
ref: o,
|
|
1404
|
+
class: "r-select-wrapper relative"
|
|
1405
|
+
}, [
|
|
1406
|
+
S("div", er, [
|
|
1407
|
+
S("input", {
|
|
1408
|
+
ref_key: "inputRef",
|
|
1409
|
+
ref: a,
|
|
1410
|
+
class: w([[c(O).input, c(ge).wrapper], "r-select-input cursor-pointer border rounded outline-none"]),
|
|
1411
|
+
placeholder: "Select",
|
|
1412
|
+
readonly: "",
|
|
1413
|
+
value: c(v),
|
|
1414
|
+
"aria-haspopup": "listbox",
|
|
1415
|
+
autocomplete: "off",
|
|
1416
|
+
onFocus: j[0] || (j[0] = (Z) => i.value = !0)
|
|
1417
|
+
}, null, 42, tr),
|
|
1418
|
+
rr
|
|
1419
|
+
]),
|
|
1420
|
+
c(i) ? (g(), y("div", {
|
|
1421
|
+
key: 0,
|
|
1422
|
+
class: w([c(ge).dropdown, "absolute z-1 mt-2 w-full flex-col overflow-hidden border container-default rounded p-1"])
|
|
1423
|
+
}, [
|
|
1424
|
+
c(f).length === 0 ? (g(), y("div", nr, q(x.noneText), 1)) : (g(!0), y(X, { key: 1 }, te(c(f), (Z, me) => (g(), y("div", {
|
|
1425
|
+
key: _(Z),
|
|
1426
|
+
class: w([{
|
|
1427
|
+
"hover:bg-surface-7": c(u) !== me,
|
|
1428
|
+
"container-filled-primary": c(u) === me
|
|
1429
|
+
}, "flex cursor-pointer items-center justify-between gap-2 rounded p-1 px-2"]),
|
|
1430
|
+
onPointerdown: (Ye) => A(Z),
|
|
1431
|
+
onHover: (Ye) => d.value = me
|
|
1432
|
+
}, [
|
|
1433
|
+
nt(q(b(Z)) + " ", 1),
|
|
1434
|
+
Z === c(p) ? (g(), y("div", sr, ir)) : $("", !0)
|
|
1435
|
+
], 42, ar))), 128))
|
|
1436
|
+
], 2)) : $("", !0)
|
|
1437
|
+
], 512));
|
|
1438
|
+
}
|
|
1439
|
+
}), lr = ["value", "placeholder", "type"], ur = /* @__PURE__ */ R({
|
|
1440
|
+
__name: "TextField",
|
|
1441
|
+
props: {
|
|
1442
|
+
modelValue: {},
|
|
1443
|
+
onChange: {},
|
|
1444
|
+
color: { default: "primary" },
|
|
1445
|
+
error: { type: Boolean },
|
|
1446
|
+
disabled: { type: Boolean },
|
|
1447
|
+
rounded: { default: "md" },
|
|
1448
|
+
password: { type: Boolean },
|
|
1449
|
+
placeholder: {}
|
|
1450
|
+
},
|
|
1451
|
+
emits: ["change", "update:modelValue", "input", "click", "pointerdown", "pointerup"],
|
|
1452
|
+
setup(e, { expose: t, emit: r }) {
|
|
1453
|
+
const n = e, s = r, a = m(() => {
|
|
1454
|
+
if (n.error)
|
|
1455
|
+
return "text-error-5 bg-error-10 border-error-5 focus:border-error-5";
|
|
1456
|
+
switch (n.color) {
|
|
1457
|
+
case "secondary":
|
|
1458
|
+
return "text-surface-2 bg-surface-8 border-surface-6 focus:border-secondary-5";
|
|
1459
|
+
case "tertiary":
|
|
1460
|
+
return "text-surface-2 bg-surface-8 border-surface-6 focus:border-tertiary-5";
|
|
1461
|
+
case "error":
|
|
1462
|
+
return "text-surface-2 bg-surface-8 border-surface-6 focus:border-error-5";
|
|
1463
|
+
case "primary":
|
|
1464
|
+
default:
|
|
1465
|
+
return "text-surface-2 bg-surface-8 border-surface-6 focus:border-primary-5";
|
|
1466
|
+
}
|
|
1467
|
+
}), o = m(() => n.disabled ? "pointer-events-none filter grayscale opacity-60" : ""), i = fe(n), l = k(null);
|
|
1468
|
+
function d(u) {
|
|
1469
|
+
var f;
|
|
1470
|
+
s("update:modelValue", ((f = u.target) == null ? void 0 : f.value) ?? ""), s("input", u);
|
|
1471
|
+
}
|
|
1472
|
+
return t({
|
|
1473
|
+
el: l
|
|
1474
|
+
}), (u, f) => (g(), y("input", {
|
|
1475
|
+
ref_key: "input",
|
|
1476
|
+
ref: l,
|
|
1477
|
+
value: u.modelValue,
|
|
1478
|
+
class: w(["bg-back-2 border px-2 py-1 outline-none", [c(a), c(o), c(i).class]]),
|
|
1479
|
+
style: C([c(i).style]),
|
|
1480
|
+
placeholder: u.placeholder,
|
|
1481
|
+
type: n.password ? "password" : "text",
|
|
1482
|
+
onChange: f[0] || (f[0] = (p) => u.$emit("change", p)),
|
|
1483
|
+
onInput: d,
|
|
1484
|
+
onClick: f[1] || (f[1] = (p) => u.$emit("click", p)),
|
|
1485
|
+
onPointerdown: f[2] || (f[2] = (p) => u.$emit("pointerdown", p)),
|
|
1486
|
+
onPointerup: f[3] || (f[3] = (p) => u.$emit("pointerup", p))
|
|
1487
|
+
}, null, 46, lr));
|
|
1488
|
+
}
|
|
1489
|
+
}), cr = {
|
|
1490
|
+
key: 0,
|
|
1491
|
+
class: "i-tabler-loader-2 h-5 w-5 shrink-0 animate-spin"
|
|
1492
|
+
}, dr = { key: 1 }, fr = { class: "grow-1" }, hr = {
|
|
1493
|
+
key: 1,
|
|
1494
|
+
class: "text-sm text-surface-4"
|
|
1495
|
+
}, pr = /* @__PURE__ */ S("i", { class: "i-tabler-x" }, null, -1), gr = /* @__PURE__ */ R({
|
|
1496
|
+
__name: "Notification",
|
|
1497
|
+
props: {
|
|
1498
|
+
title: {},
|
|
1499
|
+
message: {},
|
|
1500
|
+
icon: {},
|
|
1501
|
+
loading: { type: Boolean },
|
|
1502
|
+
withBorder: { type: Boolean },
|
|
1503
|
+
closeable: { type: Boolean },
|
|
1504
|
+
color: { default: "primary" }
|
|
1505
|
+
},
|
|
1506
|
+
emits: ["close"],
|
|
1507
|
+
setup(e) {
|
|
1508
|
+
const t = e, r = m(() => {
|
|
1509
|
+
switch (t.color) {
|
|
1510
|
+
case "secondary":
|
|
1511
|
+
return "bg-secondary-5";
|
|
1512
|
+
case "tertiary":
|
|
1513
|
+
return "bg-tertiary-5";
|
|
1514
|
+
case "error":
|
|
1515
|
+
return "bg-error-5";
|
|
1516
|
+
default:
|
|
1517
|
+
return "bg-primary-5";
|
|
1518
|
+
}
|
|
1519
|
+
}), n = m(() => {
|
|
1520
|
+
switch (t.color) {
|
|
1521
|
+
case "secondary":
|
|
1522
|
+
return "text-secondary-5";
|
|
1523
|
+
case "tertiary":
|
|
1524
|
+
return "text-tertiary-5";
|
|
1525
|
+
case "error":
|
|
1526
|
+
return "text-error-5";
|
|
1527
|
+
default:
|
|
1528
|
+
return "text-primary-5";
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
return (s, a) => {
|
|
1532
|
+
const o = ct;
|
|
1533
|
+
return g(), y("div", {
|
|
1534
|
+
class: w(["relative max-w-100 min-h-16 min-w-80 w-full flex items-center gap-2 container-default rounded p-3", [
|
|
1535
|
+
{ "border-0": !s.withBorder }
|
|
1536
|
+
]])
|
|
1537
|
+
}, [
|
|
1538
|
+
s.icon ? (g(), y("div", {
|
|
1539
|
+
key: 0,
|
|
1540
|
+
class: w(["leading-0", c(n)])
|
|
1541
|
+
}, [
|
|
1542
|
+
s.loading ? (g(), y("i", cr)) : (g(), y("i", {
|
|
1543
|
+
key: 1,
|
|
1544
|
+
class: w(["h-5 w-5 shrink-0", s.icon])
|
|
1545
|
+
}, null, 2))
|
|
1546
|
+
], 2)) : (g(), y("div", dr, [
|
|
1547
|
+
S("div", {
|
|
1548
|
+
class: w(["absolute left-[0.25rem] top-[0.25rem] h-[calc(100%-0.5rem)] w-1 rounded-full", [{
|
|
1549
|
+
"animate-pulse": s.loading
|
|
1550
|
+
}, c(r)]])
|
|
1551
|
+
}, null, 2)
|
|
1552
|
+
])),
|
|
1553
|
+
S("div", fr, [
|
|
1554
|
+
s.title ? (g(), y("div", {
|
|
1555
|
+
key: 0,
|
|
1556
|
+
class: w([c(n), "text-base"])
|
|
1557
|
+
}, q(s.title), 3)) : $("", !0),
|
|
1558
|
+
s.message ? (g(), y("div", hr, q(s.message), 1)) : $("", !0)
|
|
1559
|
+
]),
|
|
1560
|
+
s.closeable ? (g(), L(o, {
|
|
1561
|
+
key: 2,
|
|
1562
|
+
icon: "",
|
|
1563
|
+
variant: "transparent",
|
|
1564
|
+
class: "text-white hover:text-white",
|
|
1565
|
+
onClick: a[0] || (a[0] = (i) => s.$emit("close"))
|
|
1566
|
+
}, {
|
|
1567
|
+
default: ce(() => [
|
|
1568
|
+
pr
|
|
1569
|
+
]),
|
|
1570
|
+
_: 1
|
|
1571
|
+
})) : $("", !0)
|
|
1572
|
+
], 2);
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
}), Dr = /* @__PURE__ */ R({
|
|
1576
|
+
__name: "Modal",
|
|
1577
|
+
props: {
|
|
1578
|
+
modelValue: { type: Boolean, default: !1 },
|
|
1579
|
+
persistent: { type: Boolean, default: !1 },
|
|
1580
|
+
blur: { type: [String, Boolean] }
|
|
1581
|
+
},
|
|
1582
|
+
emits: ["update:modelValue"],
|
|
1583
|
+
setup(e, { emit: t }) {
|
|
1584
|
+
const r = e, n = t, s = m({
|
|
1585
|
+
get() {
|
|
1586
|
+
return r.modelValue;
|
|
1587
|
+
},
|
|
1588
|
+
set(l) {
|
|
1589
|
+
n("update:modelValue", l);
|
|
1590
|
+
}
|
|
1591
|
+
}), a = k(null);
|
|
1592
|
+
function o(l) {
|
|
1593
|
+
r.persistent || l.target === a.value && (s.value = !1);
|
|
1594
|
+
}
|
|
1595
|
+
const i = m(() => {
|
|
1596
|
+
switch (r.blur) {
|
|
1597
|
+
case "sm":
|
|
1598
|
+
return "backdrop-blur-sm";
|
|
1599
|
+
case "md":
|
|
1600
|
+
case !0:
|
|
1601
|
+
return "backdrop-blur-md";
|
|
1602
|
+
case "lg":
|
|
1603
|
+
return "backdrop-blur-lg";
|
|
1604
|
+
default:
|
|
1605
|
+
return "";
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
return oe(() => {
|
|
1609
|
+
r.modelValue ? (document.body.style.overflow = "hidden", document.body.style.marginRight = "15px") : setTimeout(() => {
|
|
1610
|
+
document.body.style.overflow = "", document.body.style.marginRight = "";
|
|
1611
|
+
}, 300);
|
|
1612
|
+
}), (l, d) => (g(), L(at, { to: "body" }, [
|
|
1613
|
+
S("div", {
|
|
1614
|
+
ref_key: "wrapperRef",
|
|
1615
|
+
ref: a,
|
|
1616
|
+
class: w(["fixed left-0 top-0 z-100 h-full w-full flex items-end justify-center bg-surface-10/50 transition-all duration-300 md:items-center", [i.value, {
|
|
1617
|
+
"opacity-0 pointer-events-none": !s.value,
|
|
1618
|
+
"opacity-100": s.value
|
|
1619
|
+
}]]),
|
|
1620
|
+
onClick: o
|
|
1621
|
+
}, [
|
|
1622
|
+
st(ot, {
|
|
1623
|
+
"enter-from-class": "translate-y-1/2",
|
|
1624
|
+
"enter-to-class": "translate-y-0",
|
|
1625
|
+
"leave-from-class": "translate-y-0",
|
|
1626
|
+
"leave-to-class": "translate-y-1/2",
|
|
1627
|
+
"enter-active-class": "transition ease-out duration-300",
|
|
1628
|
+
"leave-active-class": "transition ease-in duration-200"
|
|
1629
|
+
}, {
|
|
1630
|
+
default: ce(() => [
|
|
1631
|
+
s.value ? P(l.$slots, "default", { key: 0 }) : $("", !0)
|
|
1632
|
+
]),
|
|
1633
|
+
_: 3
|
|
1634
|
+
})
|
|
1635
|
+
], 2)
|
|
1636
|
+
]));
|
|
1637
|
+
}
|
|
1638
|
+
}), je = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakSet();
|
|
1639
|
+
let I, Se = 0, Ae = 0;
|
|
1640
|
+
const V = "__aa_tgt", re = "__aa_del", ue = "__aa_new", br = (e) => {
|
|
1641
|
+
const t = xr(e);
|
|
1642
|
+
t && t.forEach((r) => kr(r));
|
|
1643
|
+
}, vr = (e) => {
|
|
1644
|
+
e.forEach((t) => {
|
|
1645
|
+
t.target === I && wr(), z.has(t.target) && W(t.target);
|
|
1646
|
+
});
|
|
1647
|
+
};
|
|
1648
|
+
function yr(e) {
|
|
1649
|
+
const t = we.get(e);
|
|
1650
|
+
t == null || t.disconnect();
|
|
1651
|
+
let r = z.get(e), n = 0;
|
|
1652
|
+
const s = 5;
|
|
1653
|
+
r || (r = Q(e), z.set(e, r));
|
|
1654
|
+
const { offsetWidth: a, offsetHeight: o } = I, l = [
|
|
1655
|
+
r.top - s,
|
|
1656
|
+
a - (r.left + s + r.width),
|
|
1657
|
+
o - (r.top + s + r.height),
|
|
1658
|
+
r.left - s
|
|
1659
|
+
].map((u) => `${-1 * Math.floor(u)}px`).join(" "), d = new IntersectionObserver(() => {
|
|
1660
|
+
++n > 1 && W(e);
|
|
1661
|
+
}, {
|
|
1662
|
+
root: I,
|
|
1663
|
+
threshold: 1,
|
|
1664
|
+
rootMargin: l
|
|
1665
|
+
});
|
|
1666
|
+
d.observe(e), we.set(e, d);
|
|
1667
|
+
}
|
|
1668
|
+
function W(e) {
|
|
1669
|
+
clearTimeout(le.get(e));
|
|
1670
|
+
const t = pe(e), r = ne(t) ? 500 : t.duration;
|
|
1671
|
+
le.set(e, setTimeout(async () => {
|
|
1672
|
+
const n = D.get(e);
|
|
1673
|
+
try {
|
|
1674
|
+
await (n == null ? void 0 : n.finished), z.set(e, Q(e)), yr(e);
|
|
1675
|
+
} catch {
|
|
1676
|
+
}
|
|
1677
|
+
}, r));
|
|
1678
|
+
}
|
|
1679
|
+
function wr() {
|
|
1680
|
+
clearTimeout(le.get(I)), le.set(I, setTimeout(() => {
|
|
1681
|
+
je.forEach((e) => Ue(e, (t) => Ge(() => W(t))));
|
|
1682
|
+
}, 100));
|
|
1683
|
+
}
|
|
1684
|
+
function _r(e) {
|
|
1685
|
+
setTimeout(() => {
|
|
1686
|
+
mr.set(e, setInterval(() => Ge(W.bind(null, e)), 2e3));
|
|
1687
|
+
}, Math.round(2e3 * Math.random()));
|
|
1688
|
+
}
|
|
1689
|
+
function Ge(e) {
|
|
1690
|
+
typeof requestIdleCallback == "function" ? requestIdleCallback(() => e()) : requestAnimationFrame(() => e());
|
|
1691
|
+
}
|
|
1692
|
+
let _e, G;
|
|
1693
|
+
typeof window < "u" && (I = document.documentElement, _e = new MutationObserver(br), G = new ResizeObserver(vr), window.addEventListener("scroll", () => {
|
|
1694
|
+
Ae = window.scrollY, Se = window.scrollX;
|
|
1695
|
+
}), G.observe(I));
|
|
1696
|
+
function xr(e) {
|
|
1697
|
+
return e.reduce((n, s) => [
|
|
1698
|
+
...n,
|
|
1699
|
+
...Array.from(s.addedNodes),
|
|
1700
|
+
...Array.from(s.removedNodes)
|
|
1701
|
+
], []).every((n) => n.nodeName === "#comment") ? !1 : e.reduce((n, s) => {
|
|
1702
|
+
if (n === !1)
|
|
1703
|
+
return !1;
|
|
1704
|
+
if (s.target instanceof Element) {
|
|
1705
|
+
if (ve(s.target), !n.has(s.target)) {
|
|
1706
|
+
n.add(s.target);
|
|
1707
|
+
for (let a = 0; a < s.target.children.length; a++) {
|
|
1708
|
+
const o = s.target.children.item(a);
|
|
1709
|
+
if (o) {
|
|
1710
|
+
if (re in o)
|
|
1711
|
+
return !1;
|
|
1712
|
+
ve(s.target, o), n.add(o);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
if (s.removedNodes.length)
|
|
1717
|
+
for (let a = 0; a < s.removedNodes.length; a++) {
|
|
1718
|
+
const o = s.removedNodes[a];
|
|
1719
|
+
if (re in o)
|
|
1720
|
+
return !1;
|
|
1721
|
+
o instanceof Element && (n.add(o), ve(s.target, o), Y.set(o, [
|
|
1722
|
+
s.previousSibling,
|
|
1723
|
+
s.nextSibling
|
|
1724
|
+
]));
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return n;
|
|
1728
|
+
}, /* @__PURE__ */ new Set());
|
|
1729
|
+
}
|
|
1730
|
+
function ve(e, t) {
|
|
1731
|
+
!t && !(V in e) ? Object.defineProperty(e, V, { value: e }) : t && !(V in t) && Object.defineProperty(t, V, { value: e });
|
|
1732
|
+
}
|
|
1733
|
+
function kr(e) {
|
|
1734
|
+
var t;
|
|
1735
|
+
const r = e.isConnected, n = z.has(e);
|
|
1736
|
+
r && Y.has(e) && Y.delete(e), D.has(e) && ((t = D.get(e)) === null || t === void 0 || t.cancel()), ue in e ? He(e) : n && r ? Sr(e) : n && !r ? Ar(e) : He(e);
|
|
1737
|
+
}
|
|
1738
|
+
function H(e) {
|
|
1739
|
+
return Number(e.replace(/[^0-9.\-]/g, ""));
|
|
1740
|
+
}
|
|
1741
|
+
function Mr(e) {
|
|
1742
|
+
let t = e.parentElement;
|
|
1743
|
+
for (; t; ) {
|
|
1744
|
+
if (t.scrollLeft || t.scrollTop)
|
|
1745
|
+
return { x: t.scrollLeft, y: t.scrollTop };
|
|
1746
|
+
t = t.parentElement;
|
|
1747
|
+
}
|
|
1748
|
+
return { x: 0, y: 0 };
|
|
1749
|
+
}
|
|
1750
|
+
function Q(e) {
|
|
1751
|
+
const t = e.getBoundingClientRect(), { x: r, y: n } = Mr(e);
|
|
1752
|
+
return {
|
|
1753
|
+
top: t.top + n,
|
|
1754
|
+
left: t.left + r,
|
|
1755
|
+
width: t.width,
|
|
1756
|
+
height: t.height
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1759
|
+
function Xe(e, t, r) {
|
|
1760
|
+
let n = t.width, s = t.height, a = r.width, o = r.height;
|
|
1761
|
+
const i = getComputedStyle(e);
|
|
1762
|
+
if (i.getPropertyValue("box-sizing") === "content-box") {
|
|
1763
|
+
const d = H(i.paddingTop) + H(i.paddingBottom) + H(i.borderTopWidth) + H(i.borderBottomWidth), u = H(i.paddingLeft) + H(i.paddingRight) + H(i.borderRightWidth) + H(i.borderLeftWidth);
|
|
1764
|
+
n -= u, a -= u, s -= d, o -= d;
|
|
1765
|
+
}
|
|
1766
|
+
return [n, a, s, o].map(Math.round);
|
|
1767
|
+
}
|
|
1768
|
+
function pe(e) {
|
|
1769
|
+
return V in e && K.has(e[V]) ? K.get(e[V]) : { duration: 250, easing: "ease-in-out" };
|
|
1770
|
+
}
|
|
1771
|
+
function qe(e) {
|
|
1772
|
+
if (V in e)
|
|
1773
|
+
return e[V];
|
|
1774
|
+
}
|
|
1775
|
+
function $e(e) {
|
|
1776
|
+
const t = qe(e);
|
|
1777
|
+
return t ? ee.has(t) : !1;
|
|
1778
|
+
}
|
|
1779
|
+
function Ue(e, ...t) {
|
|
1780
|
+
t.forEach((r) => r(e, K.has(e)));
|
|
1781
|
+
for (let r = 0; r < e.children.length; r++) {
|
|
1782
|
+
const n = e.children.item(r);
|
|
1783
|
+
n && t.forEach((s) => s(n, K.has(n)));
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
function Ce(e) {
|
|
1787
|
+
return Array.isArray(e) ? e : [e];
|
|
1788
|
+
}
|
|
1789
|
+
function ne(e) {
|
|
1790
|
+
return typeof e == "function";
|
|
1791
|
+
}
|
|
1792
|
+
function Sr(e) {
|
|
1793
|
+
const t = z.get(e), r = Q(e);
|
|
1794
|
+
if (!$e(e))
|
|
1795
|
+
return z.set(e, r);
|
|
1796
|
+
let n;
|
|
1797
|
+
if (!t)
|
|
1798
|
+
return;
|
|
1799
|
+
const s = pe(e);
|
|
1800
|
+
if (typeof s != "function") {
|
|
1801
|
+
const a = t.left - r.left, o = t.top - r.top, [i, l, d, u] = Xe(e, t, r), f = {
|
|
1802
|
+
transform: `translate(${a}px, ${o}px)`
|
|
1803
|
+
}, p = {
|
|
1804
|
+
transform: "translate(0, 0)"
|
|
1805
|
+
};
|
|
1806
|
+
i !== l && (f.width = `${i}px`, p.width = `${l}px`), d !== u && (f.height = `${d}px`, p.height = `${u}px`), n = e.animate([f, p], {
|
|
1807
|
+
duration: s.duration,
|
|
1808
|
+
easing: s.easing
|
|
1809
|
+
});
|
|
1810
|
+
} else {
|
|
1811
|
+
const [a] = Ce(s(e, "remain", t, r));
|
|
1812
|
+
n = new Animation(a), n.play();
|
|
1813
|
+
}
|
|
1814
|
+
D.set(e, n), z.set(e, r), n.addEventListener("finish", W.bind(null, e));
|
|
1815
|
+
}
|
|
1816
|
+
function He(e) {
|
|
1817
|
+
ue in e && delete e[ue];
|
|
1818
|
+
const t = Q(e);
|
|
1819
|
+
z.set(e, t);
|
|
1820
|
+
const r = pe(e);
|
|
1821
|
+
if (!$e(e))
|
|
1822
|
+
return;
|
|
1823
|
+
let n;
|
|
1824
|
+
if (typeof r != "function")
|
|
1825
|
+
n = e.animate([
|
|
1826
|
+
{ transform: "scale(.98)", opacity: 0 },
|
|
1827
|
+
{ transform: "scale(0.98)", opacity: 0, offset: 0.5 },
|
|
1828
|
+
{ transform: "scale(1)", opacity: 1 }
|
|
1829
|
+
], {
|
|
1830
|
+
duration: r.duration * 1.5,
|
|
1831
|
+
easing: "ease-in"
|
|
1832
|
+
});
|
|
1833
|
+
else {
|
|
1834
|
+
const [s] = Ce(r(e, "add", t));
|
|
1835
|
+
n = new Animation(s), n.play();
|
|
1836
|
+
}
|
|
1837
|
+
D.set(e, n), n.addEventListener("finish", W.bind(null, e));
|
|
1838
|
+
}
|
|
1839
|
+
function Be(e, t) {
|
|
1840
|
+
var r;
|
|
1841
|
+
e.remove(), z.delete(e), Y.delete(e), D.delete(e), (r = we.get(e)) === null || r === void 0 || r.disconnect(), setTimeout(() => {
|
|
1842
|
+
if (re in e && delete e[re], Object.defineProperty(e, ue, { value: !0, configurable: !0 }), t && e instanceof HTMLElement)
|
|
1843
|
+
for (const n in t)
|
|
1844
|
+
e.style[n] = "";
|
|
1845
|
+
}, 0);
|
|
1846
|
+
}
|
|
1847
|
+
function Ar(e) {
|
|
1848
|
+
var t;
|
|
1849
|
+
if (!Y.has(e) || !z.has(e))
|
|
1850
|
+
return;
|
|
1851
|
+
const [r, n] = Y.get(e);
|
|
1852
|
+
Object.defineProperty(e, re, { value: !0, configurable: !0 });
|
|
1853
|
+
const s = window.scrollX, a = window.scrollY;
|
|
1854
|
+
if (n && n.parentNode && n.parentNode instanceof Element ? n.parentNode.insertBefore(e, n) : r && r.parentNode ? r.parentNode.appendChild(e) : (t = qe(e)) === null || t === void 0 || t.appendChild(e), !$e(e))
|
|
1855
|
+
return Be(e);
|
|
1856
|
+
const [o, i, l, d] = Cr(e), u = pe(e), f = z.get(e);
|
|
1857
|
+
(s !== Se || a !== Ae) && $r(e, s, a, u);
|
|
1858
|
+
let p, v = {
|
|
1859
|
+
position: "absolute",
|
|
1860
|
+
top: `${o}px`,
|
|
1861
|
+
left: `${i}px`,
|
|
1862
|
+
width: `${l}px`,
|
|
1863
|
+
height: `${d}px`,
|
|
1864
|
+
margin: "0",
|
|
1865
|
+
pointerEvents: "none",
|
|
1866
|
+
transformOrigin: "center",
|
|
1867
|
+
zIndex: "100"
|
|
1868
|
+
};
|
|
1869
|
+
if (!ne(u))
|
|
1870
|
+
Object.assign(e.style, v), p = e.animate([
|
|
1871
|
+
{
|
|
1872
|
+
transform: "scale(1)",
|
|
1873
|
+
opacity: 1
|
|
1874
|
+
},
|
|
1875
|
+
{
|
|
1876
|
+
transform: "scale(.98)",
|
|
1877
|
+
opacity: 0
|
|
1878
|
+
}
|
|
1879
|
+
], { duration: u.duration, easing: "ease-out" });
|
|
1880
|
+
else {
|
|
1881
|
+
const [b, _] = Ce(u(e, "remove", f));
|
|
1882
|
+
(_ == null ? void 0 : _.styleReset) !== !1 && (v = (_ == null ? void 0 : _.styleReset) || v, Object.assign(e.style, v)), p = new Animation(b), p.play();
|
|
1883
|
+
}
|
|
1884
|
+
D.set(e, p), p.addEventListener("finish", Be.bind(null, e, v));
|
|
1885
|
+
}
|
|
1886
|
+
function $r(e, t, r, n) {
|
|
1887
|
+
const s = Se - t, a = Ae - r, o = document.documentElement.style.scrollBehavior;
|
|
1888
|
+
if (getComputedStyle(I).scrollBehavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), window.scrollTo(window.scrollX + s, window.scrollY + a), !e.parentElement)
|
|
1889
|
+
return;
|
|
1890
|
+
const l = e.parentElement;
|
|
1891
|
+
let d = l.clientHeight, u = l.clientWidth;
|
|
1892
|
+
const f = performance.now();
|
|
1893
|
+
function p() {
|
|
1894
|
+
requestAnimationFrame(() => {
|
|
1895
|
+
if (!ne(n)) {
|
|
1896
|
+
const v = d - l.clientHeight, b = u - l.clientWidth;
|
|
1897
|
+
f + n.duration > performance.now() ? (window.scrollTo({
|
|
1898
|
+
left: window.scrollX - b,
|
|
1899
|
+
top: window.scrollY - v
|
|
1900
|
+
}), d = l.clientHeight, u = l.clientWidth, p()) : document.documentElement.style.scrollBehavior = o;
|
|
1901
|
+
}
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
p();
|
|
1905
|
+
}
|
|
1906
|
+
function Cr(e) {
|
|
1907
|
+
const t = z.get(e), [r, , n] = Xe(e, t, Q(e));
|
|
1908
|
+
let s = e.parentElement;
|
|
1909
|
+
for (; s && (getComputedStyle(s).position === "static" || s instanceof HTMLBodyElement); )
|
|
1910
|
+
s = s.parentElement;
|
|
1911
|
+
s || (s = document.body);
|
|
1912
|
+
const a = getComputedStyle(s), o = z.get(s) || Q(s), i = Math.round(t.top - o.top) - H(a.borderTopWidth), l = Math.round(t.left - o.left) - H(a.borderLeftWidth);
|
|
1913
|
+
return [i, l, r, n];
|
|
1914
|
+
}
|
|
1915
|
+
function zr(e, t = {}) {
|
|
1916
|
+
return _e && G && (window.matchMedia("(prefers-reduced-motion: reduce)").matches && !ne(t) && !t.disrespectUserMotionPreference || (ee.add(e), getComputedStyle(e).position === "static" && Object.assign(e.style, { position: "relative" }), Ue(e, W, _r, (s) => G == null ? void 0 : G.observe(s)), ne(t) ? K.set(e, t) : K.set(e, { duration: 250, easing: "ease-in-out", ...t }), _e.observe(e, { childList: !0 }), je.add(e))), Object.freeze({
|
|
1917
|
+
parent: e,
|
|
1918
|
+
enable: () => {
|
|
1919
|
+
ee.add(e);
|
|
1920
|
+
},
|
|
1921
|
+
disable: () => {
|
|
1922
|
+
ee.delete(e);
|
|
1923
|
+
},
|
|
1924
|
+
isEnabled: () => ee.has(e)
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
const Rr = {
|
|
1928
|
+
mounted: (e, t) => {
|
|
1929
|
+
zr(e, t.value || {});
|
|
1930
|
+
},
|
|
1931
|
+
// ignore ssr see #96:
|
|
1932
|
+
getSSRProps: () => ({})
|
|
1933
|
+
}, Tr = { class: "absolute z-20 flex flex-col gap-2 p-2" }, Lr = /* @__PURE__ */ R({
|
|
1934
|
+
__name: "NotificationSystem",
|
|
1935
|
+
setup(e) {
|
|
1936
|
+
const t = Jt();
|
|
1937
|
+
return (r, n) => {
|
|
1938
|
+
const s = gr;
|
|
1939
|
+
return Ie((g(), y("div", Tr, [
|
|
1940
|
+
(g(!0), y(X, null, te(c(t), (a) => (g(), L(s, {
|
|
1941
|
+
key: a.hash,
|
|
1942
|
+
"with-border": "",
|
|
1943
|
+
closeable: "",
|
|
1944
|
+
title: a.title,
|
|
1945
|
+
message: a.message,
|
|
1946
|
+
icon: a.icon,
|
|
1947
|
+
loading: a.loading,
|
|
1948
|
+
color: a.color,
|
|
1949
|
+
onClose: (o) => c(t).splice(c(t).indexOf(a), 1)
|
|
1950
|
+
}, null, 8, ["title", "message", "icon", "loading", "color", "onClose"]))), 128))
|
|
1951
|
+
])), [
|
|
1952
|
+
[c(Rr)]
|
|
1953
|
+
]);
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
}), Er = { class: "flex gap-2" }, Wr = /* @__PURE__ */ R({
|
|
1957
|
+
__name: "PinInput",
|
|
1958
|
+
props: {
|
|
1959
|
+
modelValue: {},
|
|
1960
|
+
length: { default: 6 },
|
|
1961
|
+
size: {},
|
|
1962
|
+
password: { type: Boolean }
|
|
1963
|
+
},
|
|
1964
|
+
setup(e) {
|
|
1965
|
+
const t = e, r = k([]);
|
|
1966
|
+
function n(a) {
|
|
1967
|
+
a.preventDefault(), a.stopPropagation();
|
|
1968
|
+
const o = r.value.findIndex((l) => l.el === a.target), i = a.target.value ?? "";
|
|
1969
|
+
a.target.value = "", Array.from(i).forEach((l, d) => {
|
|
1970
|
+
o + d >= r.value.length || (r.value[o + d].el.value = l, o + d + 1 < r.value.length ? (r.value[o + d + 1].el.focus(), r.value[o + d + 1].el.select()) : r.value[o + d].el.blur());
|
|
1971
|
+
});
|
|
1972
|
+
}
|
|
1973
|
+
function s(a) {
|
|
1974
|
+
a.preventDefault(), a.stopPropagation();
|
|
1975
|
+
const o = a.target.value !== "";
|
|
1976
|
+
a.target.value = "";
|
|
1977
|
+
const i = r.value.findIndex((l) => l.el === a.target);
|
|
1978
|
+
i !== 0 && (r.value[i - 1].el.focus(), r.value[i - 1].el.select(), o || (r.value[i - 1].el.value = ""));
|
|
1979
|
+
}
|
|
1980
|
+
return (a, o) => (g(), y("div", Er, [
|
|
1981
|
+
(g(!0), y(X, null, te(t.length, (i) => (g(), L(c(ur), {
|
|
1982
|
+
ref_for: !0,
|
|
1983
|
+
ref_key: "inputs",
|
|
1984
|
+
ref: r,
|
|
1985
|
+
key: i,
|
|
1986
|
+
class: "h-8 w-8 text-center",
|
|
1987
|
+
password: t.password,
|
|
1988
|
+
onPointerup: o[0] || (o[0] = (l) => l.target.select()),
|
|
1989
|
+
onInput: Oe(n, ["stop", "prevent"]),
|
|
1990
|
+
onKeydown: it(s, ["backspace"])
|
|
1991
|
+
}, null, 8, ["password"]))), 128))
|
|
1992
|
+
]));
|
|
1993
|
+
}
|
|
1994
|
+
}), jr = /* @__PURE__ */ R({
|
|
1995
|
+
__name: "Progress",
|
|
1996
|
+
props: {
|
|
1997
|
+
value: { default: 0 },
|
|
1998
|
+
max: { default: 100 },
|
|
1999
|
+
min: { default: 0 },
|
|
2000
|
+
size: { default: "md" },
|
|
2001
|
+
color: { default: "primary" },
|
|
2002
|
+
rounded: { default: "full" },
|
|
2003
|
+
loading: { type: Boolean, default: !1 }
|
|
2004
|
+
},
|
|
2005
|
+
setup(e) {
|
|
2006
|
+
const t = e, r = m(() => {
|
|
2007
|
+
switch (t.size) {
|
|
2008
|
+
case "sm":
|
|
2009
|
+
return "h-0.5";
|
|
2010
|
+
case "md":
|
|
2011
|
+
return "h-1";
|
|
2012
|
+
case "lg":
|
|
2013
|
+
return "h-2";
|
|
2014
|
+
}
|
|
2015
|
+
}), n = m(() => {
|
|
2016
|
+
switch (t.color) {
|
|
2017
|
+
case "primary":
|
|
2018
|
+
return "bg-primary-7";
|
|
2019
|
+
case "secondary":
|
|
2020
|
+
return "bg-secondary-7";
|
|
2021
|
+
case "tertiary":
|
|
2022
|
+
return "bg-tertiary-7";
|
|
2023
|
+
case "error":
|
|
2024
|
+
return "bg-error-7";
|
|
2025
|
+
}
|
|
2026
|
+
}), s = fe(t);
|
|
2027
|
+
return (a, o) => (g(), y("div", {
|
|
2028
|
+
class: w(["relative w-full self-center overflow-hidden bg-surface-7", [c(r), c(s).class]]),
|
|
2029
|
+
style: C([c(s).style])
|
|
2030
|
+
}, [
|
|
2031
|
+
a.loading ? (g(), y("div", {
|
|
2032
|
+
key: 1,
|
|
2033
|
+
class: w(["loading-progress h-full", [c(n)]])
|
|
2034
|
+
}, null, 2)) : (g(), y("div", {
|
|
2035
|
+
key: 0,
|
|
2036
|
+
class: w(["h-full", [c(n)]]),
|
|
2037
|
+
style: C([{
|
|
2038
|
+
width: `${(a.value - a.min) / (a.max - a.min) * 100}%`
|
|
2039
|
+
}])
|
|
2040
|
+
}, null, 6))
|
|
2041
|
+
], 6));
|
|
2042
|
+
}
|
|
2043
|
+
});
|
|
2044
|
+
const Nr = { class: "relative" }, Gr = /* @__PURE__ */ R({
|
|
2045
|
+
__name: "Indicator",
|
|
2046
|
+
props: {
|
|
2047
|
+
color: { default: "primary" },
|
|
2048
|
+
size: { default: "md" },
|
|
2049
|
+
position: { default: "top-right" },
|
|
2050
|
+
ping: { type: Boolean }
|
|
2051
|
+
},
|
|
2052
|
+
setup(e) {
|
|
2053
|
+
const t = e, r = m(() => {
|
|
2054
|
+
switch (t.size) {
|
|
2055
|
+
case "sm":
|
|
2056
|
+
return "w-2 h-2";
|
|
2057
|
+
case "md":
|
|
2058
|
+
return "w-3 h-3";
|
|
2059
|
+
case "lg":
|
|
2060
|
+
return "w-4 h-4";
|
|
2061
|
+
default:
|
|
2062
|
+
return typeof t.size == "number" || !Number.isNaN(Number(t.size)) ? `w-${t.size} h-${t.size}` : t.size;
|
|
2063
|
+
}
|
|
2064
|
+
}), n = lt(), s = m(() => {
|
|
2065
|
+
if (!n.label)
|
|
2066
|
+
return "";
|
|
2067
|
+
switch (t.size) {
|
|
2068
|
+
case "sm":
|
|
2069
|
+
return "text-sm children:px-1.5";
|
|
2070
|
+
case "md":
|
|
2071
|
+
return "text-md children:px-2";
|
|
2072
|
+
case "lg":
|
|
2073
|
+
return "text-lg children:px-2.5";
|
|
2074
|
+
}
|
|
2075
|
+
}), a = m(() => {
|
|
2076
|
+
switch (t.position) {
|
|
2077
|
+
case "top-left":
|
|
2078
|
+
return "top-0 left-0 -translate-x-1/2 -translate-y-1/2";
|
|
2079
|
+
case "top-right":
|
|
2080
|
+
return "top-0 right-0 translate-x-1/2 -translate-y-1/2";
|
|
2081
|
+
case "bottom-left":
|
|
2082
|
+
return "bottom-0 left-0 -translate-x-1/2 translate-y-1/2";
|
|
2083
|
+
case "bottom-right":
|
|
2084
|
+
return "bottom-0 right-0 translate-x-1/2 translate-y-1/2";
|
|
2085
|
+
}
|
|
2086
|
+
}), o = m(() => {
|
|
2087
|
+
switch (t.color) {
|
|
2088
|
+
case "primary":
|
|
2089
|
+
return "bg-primary-7";
|
|
2090
|
+
case "secondary":
|
|
2091
|
+
return "bg-secondary-7";
|
|
2092
|
+
case "tertiary":
|
|
2093
|
+
return "bg-tertiary-7";
|
|
2094
|
+
case "error":
|
|
2095
|
+
return "bg-error-7";
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
return (i, l) => (g(), y("div", Nr, [
|
|
2099
|
+
S("div", {
|
|
2100
|
+
class: w([[c(a), c(s)], "absolute z-1"])
|
|
2101
|
+
}, [
|
|
2102
|
+
t.ping ? (g(), y("div", {
|
|
2103
|
+
key: 0,
|
|
2104
|
+
class: w(["absolute animate-ping rounded-full", [
|
|
2105
|
+
{
|
|
2106
|
+
[c(r)]: !i.$slots.label
|
|
2107
|
+
},
|
|
2108
|
+
c(o)
|
|
2109
|
+
]])
|
|
2110
|
+
}, [
|
|
2111
|
+
i.$slots.label ? P(i.$slots, "label", { key: 0 }) : $("", !0)
|
|
2112
|
+
], 2)) : $("", !0),
|
|
2113
|
+
S("div", {
|
|
2114
|
+
class: w(["top-0 rounded-full", [
|
|
2115
|
+
{
|
|
2116
|
+
[c(r)]: !i.$slots.label
|
|
2117
|
+
},
|
|
2118
|
+
c(o)
|
|
2119
|
+
]])
|
|
2120
|
+
}, [
|
|
2121
|
+
i.$slots.label ? P(i.$slots, "label", { key: 0 }) : $("", !0)
|
|
2122
|
+
], 2)
|
|
2123
|
+
], 2),
|
|
2124
|
+
P(i.$slots, "default")
|
|
2125
|
+
]));
|
|
2126
|
+
}
|
|
2127
|
+
}), Xr = /* @__PURE__ */ R({
|
|
2128
|
+
__name: "Chip",
|
|
2129
|
+
props: {
|
|
2130
|
+
is: { default: "img" },
|
|
2131
|
+
src: {},
|
|
2132
|
+
size: { default: "md" },
|
|
2133
|
+
style: {},
|
|
2134
|
+
class: {},
|
|
2135
|
+
modelValue: { type: Boolean },
|
|
2136
|
+
rounded: { default: "full" }
|
|
2137
|
+
},
|
|
2138
|
+
emits: ["update:modelValue"],
|
|
2139
|
+
setup(e, { emit: t }) {
|
|
2140
|
+
const r = e, n = t, s = m({
|
|
2141
|
+
get() {
|
|
2142
|
+
return r.modelValue;
|
|
2143
|
+
},
|
|
2144
|
+
set(u) {
|
|
2145
|
+
n("update:modelValue", u);
|
|
2146
|
+
}
|
|
2147
|
+
}), a = fe(r), o = m(() => {
|
|
2148
|
+
switch (r.size) {
|
|
2149
|
+
case "sm":
|
|
2150
|
+
return "px-3 text-sm h-6";
|
|
2151
|
+
case "md":
|
|
2152
|
+
return "px-6 h-8 text-base";
|
|
2153
|
+
case "lg":
|
|
2154
|
+
return "px-8 h-10 text-lg";
|
|
2155
|
+
}
|
|
2156
|
+
}), i = m(() => s.value ? "container-filled-primary" : "container-default"), l = m(() => s.value !== void 0), d = m(() => l.value ? "cursor-pointer" : "");
|
|
2157
|
+
return (u, f) => (g(), y("span", {
|
|
2158
|
+
class: w(["inline-flex items-center gap-1", [c(a).class, c(o), c(i), c(d)]]),
|
|
2159
|
+
style: C([c(a).style]),
|
|
2160
|
+
onPointerup: f[0] || (f[0] = (p) => u.$emit("update:modelValue", !u.modelValue))
|
|
2161
|
+
}, [
|
|
2162
|
+
u.$slots.leftSection ? P(u.$slots, "leftSection", { key: 0 }) : $("", !0),
|
|
2163
|
+
P(u.$slots, "default"),
|
|
2164
|
+
u.$slots.rightSection ? P(u.$slots, "rightSection", { key: 1 }) : $("", !0)
|
|
2165
|
+
], 38));
|
|
2166
|
+
}
|
|
2167
|
+
}), qr = /* @__PURE__ */ R({
|
|
2168
|
+
__name: "Avatar",
|
|
2169
|
+
props: {
|
|
2170
|
+
is: { default: "img" },
|
|
2171
|
+
src: {},
|
|
2172
|
+
size: { default: "md" },
|
|
2173
|
+
style: {},
|
|
2174
|
+
class: {}
|
|
2175
|
+
},
|
|
2176
|
+
setup(e) {
|
|
2177
|
+
const t = e, r = m(() => {
|
|
2178
|
+
switch (t.size) {
|
|
2179
|
+
case "sm":
|
|
2180
|
+
return "--size: 1.5rem;";
|
|
2181
|
+
case "md":
|
|
2182
|
+
return "--size: 2rem;";
|
|
2183
|
+
case "lg":
|
|
2184
|
+
return "--size: 3rem;";
|
|
2185
|
+
default:
|
|
2186
|
+
return typeof t.size == "number" || !Number.isNaN(Number(t.size)) ? `--size: ${t.size}rem;` : `--size: ${t.size};`;
|
|
2187
|
+
}
|
|
2188
|
+
}), n = k(!1);
|
|
2189
|
+
return (s, a) => (g(), y(X, null, [
|
|
2190
|
+
s.src ? (g(), L(xe(s.is), {
|
|
2191
|
+
key: 0,
|
|
2192
|
+
style: C([s.style, c(r)]),
|
|
2193
|
+
placeholder: "",
|
|
2194
|
+
src: s.src,
|
|
2195
|
+
class: w(["h-[var(--size)] w-[var(--size)] rounded-full object-cover", [{ hidden: !c(n) }, t.class]]),
|
|
2196
|
+
onLoad: a[0] || (a[0] = (o) => n.value = !0)
|
|
2197
|
+
}, null, 40, ["style", "src", "class"])) : $("", !0),
|
|
2198
|
+
c(n) ? $("", !0) : (g(), y("img", {
|
|
2199
|
+
key: 1,
|
|
2200
|
+
class: "h-[var(--size)] w-[var(--size)] animate-pulse rounded-full bg-surface-5 object-cover",
|
|
2201
|
+
style: C([s.style, c(r)])
|
|
2202
|
+
}, null, 4))
|
|
2203
|
+
], 64));
|
|
2204
|
+
}
|
|
2205
|
+
});
|
|
2206
|
+
function Ur() {
|
|
2207
|
+
return ut("theme");
|
|
2208
|
+
}
|
|
2209
|
+
export {
|
|
2210
|
+
qr as Avatar,
|
|
2211
|
+
ct as Btn,
|
|
2212
|
+
Xr as Chip,
|
|
2213
|
+
Gr as Indicator,
|
|
2214
|
+
Dr as Modal,
|
|
2215
|
+
gr as Notification,
|
|
2216
|
+
Lr as NotificationSystem,
|
|
2217
|
+
Or as Notifications,
|
|
2218
|
+
Wr as PinInput,
|
|
2219
|
+
jr as Progress,
|
|
2220
|
+
Ir as RokuProvider,
|
|
2221
|
+
Fr as Select,
|
|
2222
|
+
Hr as Slider,
|
|
2223
|
+
Br as Switch,
|
|
2224
|
+
ur as TextField,
|
|
2225
|
+
se as darkTheme,
|
|
2226
|
+
Vr as notificationsSymbol,
|
|
2227
|
+
Zt as themeColors,
|
|
2228
|
+
Jt as useNotifications,
|
|
2229
|
+
Ur as useTheme
|
|
2230
|
+
};
|