@roku-ui/vue 0.7.0 → 0.7.2
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/components/AspectRatio.vue.d.ts +44 -0
- package/dist/components/Avatar.vue.d.ts +41 -0
- package/dist/components/Btn.vue.d.ts +77 -0
- package/dist/components/ChatContainer.vue.d.ts +9 -0
- package/dist/components/ChatMessage.vue.d.ts +51 -0
- package/dist/components/ChatSystem.vue.d.ts +45 -0
- package/dist/components/Chip.vue.d.ts +61 -0
- package/dist/components/ColorInput.vue.d.ts +6 -0
- package/dist/components/ColorSwatch.vue.d.ts +36 -0
- package/dist/components/Drawer.vue.d.ts +41 -0
- package/dist/components/Dropzone.vue.d.ts +45 -0
- package/dist/components/FullscreenOverlay.vue.d.ts +38 -0
- package/dist/components/Image.vue.d.ts +49 -0
- package/dist/components/Indicator.vue.d.ts +49 -0
- package/dist/components/Modal.vue.d.ts +32 -0
- package/dist/components/Notification.vue.d.ts +66 -0
- package/dist/components/NotificationSystem.vue.d.ts +2 -0
- package/dist/components/Overlay.vue.d.ts +52 -0
- package/dist/components/Paper.vue.d.ts +51 -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/SchemeSwitch.vue.d.ts +2 -0
- package/dist/components/Select.vue.d.ts +60 -0
- package/dist/components/Slider.vue.d.ts +88 -0
- package/dist/components/Switch.vue.d.ts +85 -0
- package/dist/components/TabItem.vue.d.ts +38 -0
- package/dist/components/Tabs.vue.d.ts +29 -0
- package/dist/components/TextField.vue.d.ts +66 -0
- package/dist/components/ThemeProvider.vue.d.ts +23 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/composables/index.d.ts +64 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3217 -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 +1 -0
- package/dist/utils/classGenerator.d.ts +6 -0
- package/dist/utils/index.d.ts +23 -0
- package/dist/utils/notifications.d.ts +12 -0
- package/dist/utils/symbols.d.ts +2 -0
- package/dist/utils/theme.d.ts +35 -0
- package/package.json +13 -12
package/dist/index.js
ADDED
|
@@ -0,0 +1,3217 @@
|
|
|
1
|
+
import { defineComponent as x, openBlock as h, createElementBlock as b, normalizeStyle as C, renderSlot as k, computed as m, ref as g, onMounted as ee, Fragment as K, createBlock as P, resolveDynamicComponent as ue, mergeProps as xe, unref as u, createCommentVNode as T, getCurrentScope as xt, onScopeDispose as kt, nextTick as et, getCurrentInstance as tt, watch as de, shallowRef as St, readonly as Mt, watchEffect as X, withCtx as L, normalizeClass as y, createElementVNode as w, mergeModels as W, useModel as j, inject as be, provide as ge, useAttrs as $t, withDirectives as Te, vModelText as Ct, createVNode as Z, Teleport as At, Transition as rt, useSlots as nt, toDisplayString as se, renderList as ye, vModelDynamic as Tt, withModifiers as ot, withKeys as zt, reactive as Et, vModelCheckbox as Rt, isRef as Bt, createTextVNode as Ot } from "vue";
|
|
2
|
+
const In = /* @__PURE__ */ x({
|
|
3
|
+
__name: "AspectRatio",
|
|
4
|
+
props: {
|
|
5
|
+
ratio: { default: 1 },
|
|
6
|
+
width: {},
|
|
7
|
+
maxWidth: {},
|
|
8
|
+
height: {},
|
|
9
|
+
maxHeight: {}
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
return (t, r) => (h(), b("div", {
|
|
13
|
+
style: C({
|
|
14
|
+
"--ar-ratio": t.ratio,
|
|
15
|
+
width: t.width,
|
|
16
|
+
"max-width": t.maxWidth,
|
|
17
|
+
height: t.height,
|
|
18
|
+
"max-height": t.maxHeight
|
|
19
|
+
}),
|
|
20
|
+
class: "relative children:absolute children:top-0 before:block before:h-0 children:h-full children:w-full before:pb-[calc((1/var(--ar-ratio,1))*100%)] before:content-['']"
|
|
21
|
+
}, [
|
|
22
|
+
k(t.$slots, "default")
|
|
23
|
+
], 4));
|
|
24
|
+
}
|
|
25
|
+
}), Ht = /* @__PURE__ */ x({
|
|
26
|
+
__name: "Avatar",
|
|
27
|
+
props: {
|
|
28
|
+
is: { default: "img" },
|
|
29
|
+
src: {},
|
|
30
|
+
size: { default: "md" },
|
|
31
|
+
style: {},
|
|
32
|
+
class: {}
|
|
33
|
+
},
|
|
34
|
+
setup(e) {
|
|
35
|
+
const t = e, r = m(() => {
|
|
36
|
+
switch (t.size) {
|
|
37
|
+
case "sm":
|
|
38
|
+
return "--size: 1.5rem;";
|
|
39
|
+
case "md":
|
|
40
|
+
return "--size: 2rem;";
|
|
41
|
+
case "lg":
|
|
42
|
+
return "--size: 3rem;";
|
|
43
|
+
default:
|
|
44
|
+
return typeof t.size == "number" || !Number.isNaN(Number(t.size)) ? `--size: ${t.size}rem;` : `--size: ${t.size};`;
|
|
45
|
+
}
|
|
46
|
+
}), n = g(!1), a = g(null);
|
|
47
|
+
function o() {
|
|
48
|
+
n.value = !0;
|
|
49
|
+
}
|
|
50
|
+
return ee(() => {
|
|
51
|
+
var s;
|
|
52
|
+
(s = a.value) != null && s.complete && o();
|
|
53
|
+
}), (s, i) => (h(), b(K, null, [
|
|
54
|
+
s.src ? (h(), P(ue(s.is), xe({
|
|
55
|
+
key: 0,
|
|
56
|
+
ref_key: "img",
|
|
57
|
+
ref: a,
|
|
58
|
+
style: [s.style, u(r)],
|
|
59
|
+
placeholder: "",
|
|
60
|
+
src: s.src,
|
|
61
|
+
class: ["h-[var(--size)] w-[var(--size)] rounded-full object-cover", [{ hidden: !u(n) }, t.class]]
|
|
62
|
+
}, s.$attrs, { onLoad: o }), null, 16, ["style", "src", "class"])) : T("", !0),
|
|
63
|
+
u(n) ? T("", !0) : (h(), b("div", {
|
|
64
|
+
key: 1,
|
|
65
|
+
class: "h-[var(--size)] w-[var(--size)] animate-pulse border-transparent rounded-full bg-surface-high object-cover",
|
|
66
|
+
style: C([s.style, u(r)])
|
|
67
|
+
}, null, 4))
|
|
68
|
+
], 64));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
function U(e) {
|
|
72
|
+
return m(
|
|
73
|
+
() => ({ style: Nt(e.rounded), class: "rounded-[var(--r-rounded)]" })
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function Nt(e) {
|
|
77
|
+
const t = /^-?\d*\.?\d+(px|em|rem|vh|vw|in|cm|mm|pt|pc|%)?$/;
|
|
78
|
+
switch (e) {
|
|
79
|
+
case "none":
|
|
80
|
+
return "--r-rounded: 0";
|
|
81
|
+
case "sm":
|
|
82
|
+
return "--r-rounded: 0.125rem";
|
|
83
|
+
case "md":
|
|
84
|
+
return "--r-rounded: 0.25rem";
|
|
85
|
+
case "lg":
|
|
86
|
+
return "--r-rounded: 0.5rem";
|
|
87
|
+
case "full":
|
|
88
|
+
return "--r-rounded: 9999px";
|
|
89
|
+
default:
|
|
90
|
+
return typeof e == "string" && t.test(e) ? `--r-rounded: ${e};` : typeof e == "number" || !Number.isNaN(Number(e)) ? `--r-rounded: ${e}rem;` : "rounded-[var(--r-rounded)]";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function ke(e) {
|
|
94
|
+
return xt() ? (kt(e), !0) : !1;
|
|
95
|
+
}
|
|
96
|
+
function Pt() {
|
|
97
|
+
const e = /* @__PURE__ */ new Set(), t = (a) => {
|
|
98
|
+
e.delete(a);
|
|
99
|
+
};
|
|
100
|
+
return {
|
|
101
|
+
on: (a) => {
|
|
102
|
+
e.add(a);
|
|
103
|
+
const o = () => t(a);
|
|
104
|
+
return ke(o), {
|
|
105
|
+
off: o
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
off: t,
|
|
109
|
+
trigger: (...a) => Promise.all(Array.from(e).map((o) => o(...a)))
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function ze(e) {
|
|
113
|
+
return typeof e == "function" ? e() : u(e);
|
|
114
|
+
}
|
|
115
|
+
const Q = typeof window < "u" && typeof document < "u";
|
|
116
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
117
|
+
const It = (e) => e != null, Vt = Object.prototype.toString, Dt = (e) => Vt.call(e) === "[object Object]", Ft = () => {
|
|
118
|
+
}, Lt = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
119
|
+
function Wt(e) {
|
|
120
|
+
return e || tt();
|
|
121
|
+
}
|
|
122
|
+
function jt(e, t = !0, r) {
|
|
123
|
+
Wt() ? ee(e, r) : t ? e() : et(e);
|
|
124
|
+
}
|
|
125
|
+
function re(e) {
|
|
126
|
+
var t;
|
|
127
|
+
const r = ze(e);
|
|
128
|
+
return (t = r == null ? void 0 : r.$el) != null ? t : r;
|
|
129
|
+
}
|
|
130
|
+
const fe = Q ? window : void 0, Ut = Q ? window.document : void 0;
|
|
131
|
+
function N(...e) {
|
|
132
|
+
let t, r, n, a;
|
|
133
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, n, a] = e, t = fe) : [t, r, n, a] = e, !t)
|
|
134
|
+
return Ft;
|
|
135
|
+
Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]);
|
|
136
|
+
const o = [], s = () => {
|
|
137
|
+
o.forEach((d) => d()), o.length = 0;
|
|
138
|
+
}, i = (d, f, v, S) => (d.addEventListener(f, v, S), () => d.removeEventListener(f, v, S)), l = de(
|
|
139
|
+
() => [re(t), ze(a)],
|
|
140
|
+
([d, f]) => {
|
|
141
|
+
if (s(), !d)
|
|
142
|
+
return;
|
|
143
|
+
const v = Dt(f) ? { ...f } : f;
|
|
144
|
+
o.push(
|
|
145
|
+
...r.flatMap((S) => n.map((A) => i(d, S, A, v)))
|
|
146
|
+
);
|
|
147
|
+
},
|
|
148
|
+
{ immediate: !0, flush: "post" }
|
|
149
|
+
), c = () => {
|
|
150
|
+
l(), s();
|
|
151
|
+
};
|
|
152
|
+
return ke(c), c;
|
|
153
|
+
}
|
|
154
|
+
function Gt(e) {
|
|
155
|
+
return typeof e == "function" ? e : typeof e == "string" ? (t) => t.key === e : Array.isArray(e) ? (t) => e.includes(t.key) : () => !0;
|
|
156
|
+
}
|
|
157
|
+
function te(...e) {
|
|
158
|
+
let t, r, n = {};
|
|
159
|
+
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]);
|
|
160
|
+
const {
|
|
161
|
+
target: a = fe,
|
|
162
|
+
eventName: o = "keydown",
|
|
163
|
+
passive: s = !1,
|
|
164
|
+
dedupe: i = !1
|
|
165
|
+
} = n, l = Gt(t);
|
|
166
|
+
return N(a, o, (d) => {
|
|
167
|
+
d.repeat && ze(i) || l(d) && r(d);
|
|
168
|
+
}, s);
|
|
169
|
+
}
|
|
170
|
+
function qt() {
|
|
171
|
+
const e = g(!1);
|
|
172
|
+
return tt() && ee(() => {
|
|
173
|
+
e.value = !0;
|
|
174
|
+
}), e;
|
|
175
|
+
}
|
|
176
|
+
function De(e) {
|
|
177
|
+
const t = qt();
|
|
178
|
+
return m(() => (t.value, !!e()));
|
|
179
|
+
}
|
|
180
|
+
function Ue(e, t = {}) {
|
|
181
|
+
const { window: r = fe } = t, n = De(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
|
|
182
|
+
let a;
|
|
183
|
+
const o = g(!1), s = (c) => {
|
|
184
|
+
o.value = c.matches;
|
|
185
|
+
}, i = () => {
|
|
186
|
+
a && ("removeEventListener" in a ? a.removeEventListener("change", s) : a.removeListener(s));
|
|
187
|
+
}, l = X(() => {
|
|
188
|
+
n.value && (i(), a = r.matchMedia(ze(e)), "addEventListener" in a ? a.addEventListener("change", s) : a.addListener(s), o.value = a.matches);
|
|
189
|
+
});
|
|
190
|
+
return ke(() => {
|
|
191
|
+
l(), i(), a = void 0;
|
|
192
|
+
}), o;
|
|
193
|
+
}
|
|
194
|
+
function Xt(e, t, r = {}) {
|
|
195
|
+
const { window: n = fe, ...a } = r;
|
|
196
|
+
let o;
|
|
197
|
+
const s = De(() => n && "MutationObserver" in n), i = () => {
|
|
198
|
+
o && (o.disconnect(), o = void 0);
|
|
199
|
+
}, l = de(
|
|
200
|
+
() => re(e),
|
|
201
|
+
(f) => {
|
|
202
|
+
i(), s.value && n && f && (o = new MutationObserver(t), o.observe(f, a));
|
|
203
|
+
},
|
|
204
|
+
{ immediate: !0 }
|
|
205
|
+
), c = () => o == null ? void 0 : o.takeRecords(), d = () => {
|
|
206
|
+
i(), l();
|
|
207
|
+
};
|
|
208
|
+
return ke(d), {
|
|
209
|
+
isSupported: s,
|
|
210
|
+
stop: d,
|
|
211
|
+
takeRecords: c
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function Yt(e, t = {}) {
|
|
215
|
+
const r = g(!1), n = St(null);
|
|
216
|
+
let a = 0, o = !0;
|
|
217
|
+
if (Q) {
|
|
218
|
+
const s = typeof t == "function" ? { onDrop: t } : t, i = (l) => {
|
|
219
|
+
var c, d;
|
|
220
|
+
const f = Array.from((d = (c = l.dataTransfer) == null ? void 0 : c.files) != null ? d : []);
|
|
221
|
+
return n.value = f.length === 0 ? null : f;
|
|
222
|
+
};
|
|
223
|
+
N(e, "dragenter", (l) => {
|
|
224
|
+
var c, d;
|
|
225
|
+
const f = Array.from(((c = l == null ? void 0 : l.dataTransfer) == null ? void 0 : c.items) || []).map((v) => v.kind === "file" ? v.type : null).filter(It);
|
|
226
|
+
if (s.dataTypes && l.dataTransfer) {
|
|
227
|
+
const v = u(s.dataTypes);
|
|
228
|
+
if (o = typeof v == "function" ? v(f) : v ? v.some((S) => f.includes(S)) : !0, !o)
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
l.preventDefault(), a += 1, r.value = !0, (d = s.onEnter) == null || d.call(s, i(l), l);
|
|
232
|
+
}), N(e, "dragover", (l) => {
|
|
233
|
+
var c;
|
|
234
|
+
o && (l.preventDefault(), (c = s.onOver) == null || c.call(s, i(l), l));
|
|
235
|
+
}), N(e, "dragleave", (l) => {
|
|
236
|
+
var c;
|
|
237
|
+
o && (l.preventDefault(), a -= 1, a === 0 && (r.value = !1), (c = s.onLeave) == null || c.call(s, i(l), l));
|
|
238
|
+
}), N(e, "drop", (l) => {
|
|
239
|
+
var c;
|
|
240
|
+
l.preventDefault(), a = 0, r.value = !1, (c = s.onDrop) == null || c.call(s, i(l), l);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
files: n,
|
|
245
|
+
isOverDropZone: r
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function Zt(e, t, r = {}) {
|
|
249
|
+
const { window: n = fe, ...a } = r;
|
|
250
|
+
let o;
|
|
251
|
+
const s = De(() => n && "ResizeObserver" in n), i = () => {
|
|
252
|
+
o && (o.disconnect(), o = void 0);
|
|
253
|
+
}, l = m(() => Array.isArray(e) ? e.map((f) => re(f)) : [re(e)]), c = de(
|
|
254
|
+
l,
|
|
255
|
+
(f) => {
|
|
256
|
+
if (i(), s.value && n) {
|
|
257
|
+
o = new ResizeObserver(t);
|
|
258
|
+
for (const v of f)
|
|
259
|
+
v && o.observe(v, a);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{ immediate: !0, flush: "post", deep: !0 }
|
|
263
|
+
), d = () => {
|
|
264
|
+
i(), c();
|
|
265
|
+
};
|
|
266
|
+
return ke(d), {
|
|
267
|
+
isSupported: s,
|
|
268
|
+
stop: d
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function Kt(e, t = {}) {
|
|
272
|
+
const {
|
|
273
|
+
reset: r = !0,
|
|
274
|
+
windowResize: n = !0,
|
|
275
|
+
windowScroll: a = !0,
|
|
276
|
+
immediate: o = !0
|
|
277
|
+
} = t, s = g(0), i = g(0), l = g(0), c = g(0), d = g(0), f = g(0), v = g(0), S = g(0);
|
|
278
|
+
function A() {
|
|
279
|
+
const z = re(e);
|
|
280
|
+
if (!z) {
|
|
281
|
+
r && (s.value = 0, i.value = 0, l.value = 0, c.value = 0, d.value = 0, f.value = 0, v.value = 0, S.value = 0);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const E = z.getBoundingClientRect();
|
|
285
|
+
s.value = E.height, i.value = E.bottom, l.value = E.left, c.value = E.right, d.value = E.top, f.value = E.width, v.value = E.x, S.value = E.y;
|
|
286
|
+
}
|
|
287
|
+
return Zt(e, A), de(() => re(e), (z) => !z && A()), Xt(e, A, {
|
|
288
|
+
attributeFilter: ["style", "class"]
|
|
289
|
+
}), a && N("scroll", A, { capture: !0, passive: !0 }), n && N("resize", A, { passive: !0 }), jt(() => {
|
|
290
|
+
o && A();
|
|
291
|
+
}), {
|
|
292
|
+
height: s,
|
|
293
|
+
bottom: i,
|
|
294
|
+
left: l,
|
|
295
|
+
right: c,
|
|
296
|
+
top: d,
|
|
297
|
+
width: f,
|
|
298
|
+
x: v,
|
|
299
|
+
y: S,
|
|
300
|
+
update: A
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function Qt(e, t = {}) {
|
|
304
|
+
const {
|
|
305
|
+
delayEnter: r = 0,
|
|
306
|
+
delayLeave: n = 0,
|
|
307
|
+
window: a = fe
|
|
308
|
+
} = t, o = g(!1);
|
|
309
|
+
let s;
|
|
310
|
+
const i = (l) => {
|
|
311
|
+
const c = l ? r : n;
|
|
312
|
+
s && (clearTimeout(s), s = void 0), c ? s = setTimeout(() => o.value = l, c) : o.value = l;
|
|
313
|
+
};
|
|
314
|
+
return a && (N(e, "mouseenter", () => i(!0), { passive: !0 }), N(e, "mouseleave", () => i(!1), { passive: !0 })), o;
|
|
315
|
+
}
|
|
316
|
+
const Jt = {
|
|
317
|
+
multiple: !0,
|
|
318
|
+
accept: "*",
|
|
319
|
+
reset: !1,
|
|
320
|
+
directory: !1
|
|
321
|
+
};
|
|
322
|
+
function er(e = {}) {
|
|
323
|
+
const {
|
|
324
|
+
document: t = Ut
|
|
325
|
+
} = e, r = g(null), { on: n, trigger: a } = Pt();
|
|
326
|
+
let o;
|
|
327
|
+
t && (o = t.createElement("input"), o.type = "file", o.onchange = (l) => {
|
|
328
|
+
const c = l.target;
|
|
329
|
+
r.value = c.files, a(r.value);
|
|
330
|
+
});
|
|
331
|
+
const s = () => {
|
|
332
|
+
r.value = null, o && (o.value = "", a(null));
|
|
333
|
+
}, i = (l) => {
|
|
334
|
+
if (!o)
|
|
335
|
+
return;
|
|
336
|
+
const c = {
|
|
337
|
+
...Jt,
|
|
338
|
+
...e,
|
|
339
|
+
...l
|
|
340
|
+
};
|
|
341
|
+
o.multiple = c.multiple, o.accept = c.accept, o.webkitdirectory = c.directory, Lt(c, "capture") && (o.capture = c.capture), c.reset && s(), o.click();
|
|
342
|
+
};
|
|
343
|
+
return {
|
|
344
|
+
files: Mt(r),
|
|
345
|
+
open: i,
|
|
346
|
+
reset: s,
|
|
347
|
+
onChange: n
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function tr(e, t = {}) {
|
|
351
|
+
const { initialValue: r = !1, focusVisible: n = !1 } = t, a = g(!1), o = m(() => re(e));
|
|
352
|
+
N(o, "focus", (i) => {
|
|
353
|
+
var l, c;
|
|
354
|
+
(!n || (c = (l = i.target).matches) != null && c.call(l, ":focus-visible")) && (a.value = !0);
|
|
355
|
+
}), N(o, "blur", () => a.value = !1);
|
|
356
|
+
const s = m({
|
|
357
|
+
get: () => a.value,
|
|
358
|
+
set(i) {
|
|
359
|
+
var l, c;
|
|
360
|
+
!i && a.value ? (l = o.value) == null || l.blur() : i && !a.value && ((c = o.value) == null || c.focus());
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
return de(
|
|
364
|
+
o,
|
|
365
|
+
() => {
|
|
366
|
+
s.value = r;
|
|
367
|
+
},
|
|
368
|
+
{ immediate: !0, flush: "post" }
|
|
369
|
+
), { focused: s };
|
|
370
|
+
}
|
|
371
|
+
function rr(e) {
|
|
372
|
+
const t = Ue("(prefers-color-scheme: light)", e), r = Ue("(prefers-color-scheme: dark)", e);
|
|
373
|
+
return m(() => r.value ? "dark" : t.value ? "light" : "no-preference");
|
|
374
|
+
}
|
|
375
|
+
const at = /* @__PURE__ */ x({
|
|
376
|
+
__name: "Btn",
|
|
377
|
+
props: {
|
|
378
|
+
type: { default: "button" },
|
|
379
|
+
size: { default: "md" },
|
|
380
|
+
is: { default: "button" },
|
|
381
|
+
icon: { type: Boolean, default: !1 },
|
|
382
|
+
pressEffect: { default: "translate" },
|
|
383
|
+
variant: {},
|
|
384
|
+
hoverVariant: {},
|
|
385
|
+
color: {},
|
|
386
|
+
animate: { type: Boolean },
|
|
387
|
+
rounded: { default: "md" },
|
|
388
|
+
disabled: { type: Boolean, default: !1 }
|
|
389
|
+
},
|
|
390
|
+
setup(e) {
|
|
391
|
+
const t = e, r = U(t), n = m(() => {
|
|
392
|
+
switch (t.size) {
|
|
393
|
+
case "sm":
|
|
394
|
+
return {
|
|
395
|
+
normalContent: "min-w-16 h-6 px-2 py-1 text-xs",
|
|
396
|
+
iconContent: "h-6 w-6 p-1"
|
|
397
|
+
};
|
|
398
|
+
case "md":
|
|
399
|
+
return {
|
|
400
|
+
normalContent: "min-w-20 h-8 px-3 py-1 text-sm",
|
|
401
|
+
iconContent: "h-8 w-8 p-2"
|
|
402
|
+
};
|
|
403
|
+
case "lg":
|
|
404
|
+
return {
|
|
405
|
+
normalContent: "min-w-24 h-10 px-4 py-2 text-base",
|
|
406
|
+
iconContent: "h-10 w-10 p-3"
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}), a = g(null), o = Qt(a), s = m(() => t.hoverVariant && o.value ? t.hoverVariant : t.variant), i = m(() => {
|
|
410
|
+
switch (s.value) {
|
|
411
|
+
case "filled":
|
|
412
|
+
switch (t.color) {
|
|
413
|
+
case "secondary":
|
|
414
|
+
return "btn-filled-secondary";
|
|
415
|
+
case "tertiary":
|
|
416
|
+
return "btn-filled-tertiary";
|
|
417
|
+
case "error":
|
|
418
|
+
return "btn-filled-error";
|
|
419
|
+
default:
|
|
420
|
+
return "btn-filled-primary";
|
|
421
|
+
}
|
|
422
|
+
case "ghost":
|
|
423
|
+
case "light":
|
|
424
|
+
switch (t.color) {
|
|
425
|
+
case "secondary":
|
|
426
|
+
return "btn-light-secondary";
|
|
427
|
+
case "tertiary":
|
|
428
|
+
return "btn-light-tertiary";
|
|
429
|
+
case "error":
|
|
430
|
+
return "btn-light-error";
|
|
431
|
+
default:
|
|
432
|
+
return "btn-light-primary";
|
|
433
|
+
}
|
|
434
|
+
case "constrast":
|
|
435
|
+
switch (t.color) {
|
|
436
|
+
case "secondary":
|
|
437
|
+
return "btn-constrast-secondary";
|
|
438
|
+
case "tertiary":
|
|
439
|
+
return "btn-constrast-tertiary";
|
|
440
|
+
case "error":
|
|
441
|
+
return "btn-constrast-error";
|
|
442
|
+
default:
|
|
443
|
+
return "btn-constrast-primary";
|
|
444
|
+
}
|
|
445
|
+
case "outline":
|
|
446
|
+
switch (t.color) {
|
|
447
|
+
case "secondary":
|
|
448
|
+
return "btn-outline-secondary";
|
|
449
|
+
case "tertiary":
|
|
450
|
+
return "btn-outline-tertiary";
|
|
451
|
+
case "error":
|
|
452
|
+
return "btn-outline-error";
|
|
453
|
+
default:
|
|
454
|
+
return "btn-outline-primary";
|
|
455
|
+
}
|
|
456
|
+
case "subtle":
|
|
457
|
+
switch (t.color) {
|
|
458
|
+
case "secondary":
|
|
459
|
+
return "btn-subtle-secondary";
|
|
460
|
+
case "tertiary":
|
|
461
|
+
return "btn-subtle-tertiary";
|
|
462
|
+
case "error":
|
|
463
|
+
return "btn-subtle-error";
|
|
464
|
+
default:
|
|
465
|
+
return "btn-subtle-primary";
|
|
466
|
+
}
|
|
467
|
+
case "transparent":
|
|
468
|
+
switch (t.color) {
|
|
469
|
+
case "secondary":
|
|
470
|
+
return "btn-transparent-secondary";
|
|
471
|
+
case "tertiary":
|
|
472
|
+
return "btn-transparent-tertiary";
|
|
473
|
+
case "error":
|
|
474
|
+
return "btn-transparent-error";
|
|
475
|
+
default:
|
|
476
|
+
return "btn-transparent-primary";
|
|
477
|
+
}
|
|
478
|
+
default:
|
|
479
|
+
return "btn-default";
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
return (l, c) => (h(), P(ue(l.is), xe({
|
|
483
|
+
ref_key: "btn",
|
|
484
|
+
ref: a,
|
|
485
|
+
"data-size": l.size,
|
|
486
|
+
type: l.type,
|
|
487
|
+
class: ["flex items-center justify-center gap-1 decoration-none", [
|
|
488
|
+
u(i),
|
|
489
|
+
u(r).class,
|
|
490
|
+
l.icon ? u(n).iconContent : u(n).normalContent,
|
|
491
|
+
{
|
|
492
|
+
"filter-grayscale pointer-events-none": l.disabled,
|
|
493
|
+
"active:translate-y-0.25": l.pressEffect === "translate",
|
|
494
|
+
"active:scale-98": l.pressEffect === "scale",
|
|
495
|
+
"transition-all": l.animate
|
|
496
|
+
}
|
|
497
|
+
]],
|
|
498
|
+
style: [
|
|
499
|
+
u(r).style
|
|
500
|
+
],
|
|
501
|
+
disabled: l.disabled
|
|
502
|
+
}, l.$attrs), {
|
|
503
|
+
default: L(() => [
|
|
504
|
+
l.$slots.leftSection ? k(l.$slots, "leftSection", { key: 0 }) : T("", !0),
|
|
505
|
+
k(l.$slots, "default"),
|
|
506
|
+
l.$slots.rightSection ? k(l.$slots, "rightSection", { key: 1 }) : T("", !0)
|
|
507
|
+
]),
|
|
508
|
+
_: 3
|
|
509
|
+
}, 16, ["data-size", "type", "style", "class", "disabled"]));
|
|
510
|
+
}
|
|
511
|
+
}), nr = (e, t) => {
|
|
512
|
+
const r = e.__vccOpts || e;
|
|
513
|
+
for (const [n, a] of t)
|
|
514
|
+
r[n] = a;
|
|
515
|
+
return r;
|
|
516
|
+
}, or = {}, ar = { class: "flex flex-col gap-4 container" };
|
|
517
|
+
function sr(e, t) {
|
|
518
|
+
return h(), b("div", ar, [
|
|
519
|
+
k(e.$slots, "default")
|
|
520
|
+
]);
|
|
521
|
+
}
|
|
522
|
+
const Vn = /* @__PURE__ */ nr(or, [["render", sr]]), Dn = /* @__PURE__ */ x({
|
|
523
|
+
__name: "ChatMessage",
|
|
524
|
+
props: {
|
|
525
|
+
avatar: {},
|
|
526
|
+
position: { default: "left" },
|
|
527
|
+
color: {},
|
|
528
|
+
variant: { default: "default" },
|
|
529
|
+
withBorder: { type: Boolean, default: !1 }
|
|
530
|
+
},
|
|
531
|
+
setup(e) {
|
|
532
|
+
const t = e, r = m(() => {
|
|
533
|
+
switch (t.variant) {
|
|
534
|
+
case "default":
|
|
535
|
+
return "bg-surface-base";
|
|
536
|
+
case "filled":
|
|
537
|
+
switch (t.color) {
|
|
538
|
+
case "secondary":
|
|
539
|
+
return "bg-secondary-container text-secondary-on";
|
|
540
|
+
case "tertiary":
|
|
541
|
+
return "bg-tertiary-container text-tertiary-on";
|
|
542
|
+
case "error":
|
|
543
|
+
return "bg-error-container text-error-on";
|
|
544
|
+
default:
|
|
545
|
+
return "bg-primary-container text-primary-on";
|
|
546
|
+
}
|
|
547
|
+
case "transparent":
|
|
548
|
+
return "bg-transparent";
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
return (n, a) => {
|
|
552
|
+
const o = Ht;
|
|
553
|
+
return h(), b("div", {
|
|
554
|
+
class: y(["flex gap-2", [
|
|
555
|
+
{
|
|
556
|
+
"flex-row-reverse": n.position === "right",
|
|
557
|
+
"flex-row": n.position === "left"
|
|
558
|
+
}
|
|
559
|
+
]])
|
|
560
|
+
}, [
|
|
561
|
+
n.$slots.avatar ? k(n.$slots, "avatar", { key: 0 }) : n.avatar ? (h(), P(o, {
|
|
562
|
+
key: 1,
|
|
563
|
+
src: n.avatar
|
|
564
|
+
}, null, 8, ["src"])) : T("", !0),
|
|
565
|
+
w("div", {
|
|
566
|
+
class: y(["rounded-xl px-3 py-2 transition-background-color,border-color", [
|
|
567
|
+
{
|
|
568
|
+
"rounded-tr": n.position === "right",
|
|
569
|
+
"rounded-tl": n.position === "left",
|
|
570
|
+
border: n.withBorder
|
|
571
|
+
},
|
|
572
|
+
u(r)
|
|
573
|
+
]])
|
|
574
|
+
}, [
|
|
575
|
+
k(n.$slots, "default")
|
|
576
|
+
], 2)
|
|
577
|
+
], 2);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}), lr = { class: "w-full flex self-center gap-2 text-center" }, Fn = /* @__PURE__ */ x({
|
|
581
|
+
__name: "ChatSystem",
|
|
582
|
+
props: {
|
|
583
|
+
position: {},
|
|
584
|
+
color: {},
|
|
585
|
+
variant: { default: "default" },
|
|
586
|
+
withBorder: { type: Boolean, default: !1 }
|
|
587
|
+
},
|
|
588
|
+
setup(e) {
|
|
589
|
+
const t = e, r = m(() => {
|
|
590
|
+
switch (t.variant) {
|
|
591
|
+
case "default":
|
|
592
|
+
return "bg-surface-base";
|
|
593
|
+
case "fill":
|
|
594
|
+
switch (t.color) {
|
|
595
|
+
case "secondary":
|
|
596
|
+
return "bg-secondary-container text-secondary-on";
|
|
597
|
+
case "tertiary":
|
|
598
|
+
return "bg-tertiary-container text-tertiary-on";
|
|
599
|
+
case "error":
|
|
600
|
+
return "bg-error-container text-error-on";
|
|
601
|
+
default:
|
|
602
|
+
return "bg-primary-container text-primary-on";
|
|
603
|
+
}
|
|
604
|
+
case "transparent":
|
|
605
|
+
return "bg-transparent";
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
return (n, a) => (h(), b("div", lr, [
|
|
609
|
+
w("div", {
|
|
610
|
+
class: y(["w-full rounded-xl px-3 py-2 transition-background-color,border-color", [
|
|
611
|
+
u(r)
|
|
612
|
+
]])
|
|
613
|
+
}, [
|
|
614
|
+
k(n.$slots, "default")
|
|
615
|
+
], 2)
|
|
616
|
+
]));
|
|
617
|
+
}
|
|
618
|
+
}), Ln = /* @__PURE__ */ x({
|
|
619
|
+
__name: "Chip",
|
|
620
|
+
props: /* @__PURE__ */ W({
|
|
621
|
+
is: { default: "img" },
|
|
622
|
+
src: {},
|
|
623
|
+
size: { default: "md" },
|
|
624
|
+
style: {},
|
|
625
|
+
class: {},
|
|
626
|
+
rounded: { default: "full" }
|
|
627
|
+
}, {
|
|
628
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
629
|
+
modelModifiers: {}
|
|
630
|
+
}),
|
|
631
|
+
emits: ["update:modelValue"],
|
|
632
|
+
setup(e) {
|
|
633
|
+
const t = e, r = j(e, "modelValue"), n = U(t), a = m(() => {
|
|
634
|
+
switch (t.size) {
|
|
635
|
+
case "sm":
|
|
636
|
+
return "px-3 text-sm h-6";
|
|
637
|
+
case "md":
|
|
638
|
+
return "px-6 h-8 text-base";
|
|
639
|
+
case "lg":
|
|
640
|
+
return "px-8 h-10 text-lg";
|
|
641
|
+
}
|
|
642
|
+
}), o = m(() => r.value ? "container-filled-primary border-transparent" : "container-base"), s = m(() => r.value !== void 0), i = m(() => s.value ? "cursor-pointer" : "");
|
|
643
|
+
return (l, c) => (h(), b("span", {
|
|
644
|
+
class: y(["inline-flex items-center gap-1", [u(n).class, u(a), u(o), u(i)]]),
|
|
645
|
+
style: C([u(n).style]),
|
|
646
|
+
onPointerup: c[0] || (c[0] = (d) => u(s) && (r.value = !r.value))
|
|
647
|
+
}, [
|
|
648
|
+
l.$slots.leftSection ? k(l.$slots, "leftSection", { key: 0 }) : T("", !0),
|
|
649
|
+
k(l.$slots, "default"),
|
|
650
|
+
l.$slots.rightSection ? k(l.$slots, "rightSection", { key: 1 }) : T("", !0)
|
|
651
|
+
], 38));
|
|
652
|
+
}
|
|
653
|
+
}), ir = /* @__PURE__ */ x({
|
|
654
|
+
__name: "ColorSwatch",
|
|
655
|
+
props: {
|
|
656
|
+
color: {},
|
|
657
|
+
is: { default: "div" },
|
|
658
|
+
withBorder: { type: Boolean, default: !1 }
|
|
659
|
+
},
|
|
660
|
+
setup(e) {
|
|
661
|
+
return (t, r) => (h(), P(ue(t.is), {
|
|
662
|
+
class: y(["h-6 w-6 border rounded-full", [{
|
|
663
|
+
"border border-surface-border-base": t.withBorder,
|
|
664
|
+
"border border-transparent": !t.withBorder
|
|
665
|
+
}]]),
|
|
666
|
+
style: C({
|
|
667
|
+
backgroundColor: t.color
|
|
668
|
+
})
|
|
669
|
+
}, null, 8, ["class", "style"]));
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
function $e(e) {
|
|
673
|
+
"@babel/helpers - typeof";
|
|
674
|
+
return $e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
675
|
+
return typeof t;
|
|
676
|
+
} : function(t) {
|
|
677
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
678
|
+
}, $e(e);
|
|
679
|
+
}
|
|
680
|
+
var cr = /^\s+/, ur = /\s+$/;
|
|
681
|
+
function p(e, t) {
|
|
682
|
+
if (e = e || "", t = t || {}, e instanceof p)
|
|
683
|
+
return e;
|
|
684
|
+
if (!(this instanceof p))
|
|
685
|
+
return new p(e, t);
|
|
686
|
+
var r = dr(e);
|
|
687
|
+
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;
|
|
688
|
+
}
|
|
689
|
+
p.prototype = {
|
|
690
|
+
isDark: function() {
|
|
691
|
+
return this.getBrightness() < 128;
|
|
692
|
+
},
|
|
693
|
+
isLight: function() {
|
|
694
|
+
return !this.isDark();
|
|
695
|
+
},
|
|
696
|
+
isValid: function() {
|
|
697
|
+
return this._ok;
|
|
698
|
+
},
|
|
699
|
+
getOriginalInput: function() {
|
|
700
|
+
return this._originalInput;
|
|
701
|
+
},
|
|
702
|
+
getFormat: function() {
|
|
703
|
+
return this._format;
|
|
704
|
+
},
|
|
705
|
+
getAlpha: function() {
|
|
706
|
+
return this._a;
|
|
707
|
+
},
|
|
708
|
+
getBrightness: function() {
|
|
709
|
+
var t = this.toRgb();
|
|
710
|
+
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
|
|
711
|
+
},
|
|
712
|
+
getLuminance: function() {
|
|
713
|
+
var t = this.toRgb(), r, n, a, o, s, i;
|
|
714
|
+
return r = t.r / 255, n = t.g / 255, a = t.b / 255, r <= 0.03928 ? o = r / 12.92 : o = Math.pow((r + 0.055) / 1.055, 2.4), n <= 0.03928 ? s = n / 12.92 : s = Math.pow((n + 0.055) / 1.055, 2.4), a <= 0.03928 ? i = a / 12.92 : i = Math.pow((a + 0.055) / 1.055, 2.4), 0.2126 * o + 0.7152 * s + 0.0722 * i;
|
|
715
|
+
},
|
|
716
|
+
setAlpha: function(t) {
|
|
717
|
+
return this._a = st(t), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
718
|
+
},
|
|
719
|
+
toHsv: function() {
|
|
720
|
+
var t = qe(this._r, this._g, this._b);
|
|
721
|
+
return {
|
|
722
|
+
h: t.h * 360,
|
|
723
|
+
s: t.s,
|
|
724
|
+
v: t.v,
|
|
725
|
+
a: this._a
|
|
726
|
+
};
|
|
727
|
+
},
|
|
728
|
+
toHsvString: function() {
|
|
729
|
+
var t = qe(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), a = Math.round(t.v * 100);
|
|
730
|
+
return this._a == 1 ? "hsv(" + r + ", " + n + "%, " + a + "%)" : "hsva(" + r + ", " + n + "%, " + a + "%, " + this._roundA + ")";
|
|
731
|
+
},
|
|
732
|
+
toHsl: function() {
|
|
733
|
+
var t = Ge(this._r, this._g, this._b);
|
|
734
|
+
return {
|
|
735
|
+
h: t.h * 360,
|
|
736
|
+
s: t.s,
|
|
737
|
+
l: t.l,
|
|
738
|
+
a: this._a
|
|
739
|
+
};
|
|
740
|
+
},
|
|
741
|
+
toHslString: function() {
|
|
742
|
+
var t = Ge(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), a = Math.round(t.l * 100);
|
|
743
|
+
return this._a == 1 ? "hsl(" + r + ", " + n + "%, " + a + "%)" : "hsla(" + r + ", " + n + "%, " + a + "%, " + this._roundA + ")";
|
|
744
|
+
},
|
|
745
|
+
toHex: function(t) {
|
|
746
|
+
return Xe(this._r, this._g, this._b, t);
|
|
747
|
+
},
|
|
748
|
+
toHexString: function(t) {
|
|
749
|
+
return "#" + this.toHex(t);
|
|
750
|
+
},
|
|
751
|
+
toHex8: function(t) {
|
|
752
|
+
return mr(this._r, this._g, this._b, this._a, t);
|
|
753
|
+
},
|
|
754
|
+
toHex8String: function(t) {
|
|
755
|
+
return "#" + this.toHex8(t);
|
|
756
|
+
},
|
|
757
|
+
toRgb: function() {
|
|
758
|
+
return {
|
|
759
|
+
r: Math.round(this._r),
|
|
760
|
+
g: Math.round(this._g),
|
|
761
|
+
b: Math.round(this._b),
|
|
762
|
+
a: this._a
|
|
763
|
+
};
|
|
764
|
+
},
|
|
765
|
+
toRgbString: function() {
|
|
766
|
+
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 + ")";
|
|
767
|
+
},
|
|
768
|
+
toPercentageRgb: function() {
|
|
769
|
+
return {
|
|
770
|
+
r: Math.round(M(this._r, 255) * 100) + "%",
|
|
771
|
+
g: Math.round(M(this._g, 255) * 100) + "%",
|
|
772
|
+
b: Math.round(M(this._b, 255) * 100) + "%",
|
|
773
|
+
a: this._a
|
|
774
|
+
};
|
|
775
|
+
},
|
|
776
|
+
toPercentageRgbString: function() {
|
|
777
|
+
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 + ")";
|
|
778
|
+
},
|
|
779
|
+
toName: function() {
|
|
780
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : Cr[Xe(this._r, this._g, this._b, !0)] || !1;
|
|
781
|
+
},
|
|
782
|
+
toFilter: function(t) {
|
|
783
|
+
var r = "#" + Ye(this._r, this._g, this._b, this._a), n = r, a = this._gradientType ? "GradientType = 1, " : "";
|
|
784
|
+
if (t) {
|
|
785
|
+
var o = p(t);
|
|
786
|
+
n = "#" + Ye(o._r, o._g, o._b, o._a);
|
|
787
|
+
}
|
|
788
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + a + "startColorstr=" + r + ",endColorstr=" + n + ")";
|
|
789
|
+
},
|
|
790
|
+
toString: function(t) {
|
|
791
|
+
var r = !!t;
|
|
792
|
+
t = t || this._format;
|
|
793
|
+
var n = !1, a = this._a < 1 && this._a >= 0, o = !r && a && (t === "hex" || t === "hex6" || t === "hex3" || t === "hex4" || t === "hex8" || t === "name");
|
|
794
|
+
return o ? 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());
|
|
795
|
+
},
|
|
796
|
+
clone: function() {
|
|
797
|
+
return p(this.toString());
|
|
798
|
+
},
|
|
799
|
+
_applyModification: function(t, r) {
|
|
800
|
+
var n = t.apply(null, [this].concat([].slice.call(r)));
|
|
801
|
+
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
802
|
+
},
|
|
803
|
+
lighten: function() {
|
|
804
|
+
return this._applyModification(yr, arguments);
|
|
805
|
+
},
|
|
806
|
+
brighten: function() {
|
|
807
|
+
return this._applyModification(wr, arguments);
|
|
808
|
+
},
|
|
809
|
+
darken: function() {
|
|
810
|
+
return this._applyModification(_r, arguments);
|
|
811
|
+
},
|
|
812
|
+
desaturate: function() {
|
|
813
|
+
return this._applyModification(vr, arguments);
|
|
814
|
+
},
|
|
815
|
+
saturate: function() {
|
|
816
|
+
return this._applyModification(br, arguments);
|
|
817
|
+
},
|
|
818
|
+
greyscale: function() {
|
|
819
|
+
return this._applyModification(gr, arguments);
|
|
820
|
+
},
|
|
821
|
+
spin: function() {
|
|
822
|
+
return this._applyModification(xr, arguments);
|
|
823
|
+
},
|
|
824
|
+
_applyCombination: function(t, r) {
|
|
825
|
+
return t.apply(null, [this].concat([].slice.call(r)));
|
|
826
|
+
},
|
|
827
|
+
analogous: function() {
|
|
828
|
+
return this._applyCombination(Mr, arguments);
|
|
829
|
+
},
|
|
830
|
+
complement: function() {
|
|
831
|
+
return this._applyCombination(kr, arguments);
|
|
832
|
+
},
|
|
833
|
+
monochromatic: function() {
|
|
834
|
+
return this._applyCombination($r, arguments);
|
|
835
|
+
},
|
|
836
|
+
splitcomplement: function() {
|
|
837
|
+
return this._applyCombination(Sr, arguments);
|
|
838
|
+
},
|
|
839
|
+
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
840
|
+
// polyad: function (number) {
|
|
841
|
+
// return this._applyCombination(polyad, [number]);
|
|
842
|
+
// },
|
|
843
|
+
triad: function() {
|
|
844
|
+
return this._applyCombination(Ze, [3]);
|
|
845
|
+
},
|
|
846
|
+
tetrad: function() {
|
|
847
|
+
return this._applyCombination(Ze, [4]);
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
p.fromRatio = function(e, t) {
|
|
851
|
+
if ($e(e) == "object") {
|
|
852
|
+
var r = {};
|
|
853
|
+
for (var n in e)
|
|
854
|
+
e.hasOwnProperty(n) && (n === "a" ? r[n] = e[n] : r[n] = me(e[n]));
|
|
855
|
+
e = r;
|
|
856
|
+
}
|
|
857
|
+
return p(e, t);
|
|
858
|
+
};
|
|
859
|
+
function dr(e) {
|
|
860
|
+
var t = {
|
|
861
|
+
r: 0,
|
|
862
|
+
g: 0,
|
|
863
|
+
b: 0
|
|
864
|
+
}, r = 1, n = null, a = null, o = null, s = !1, i = !1;
|
|
865
|
+
return typeof e == "string" && (e = Er(e)), $e(e) == "object" && (G(e.r) && G(e.g) && G(e.b) ? (t = fr(e.r, e.g, e.b), s = !0, i = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : G(e.h) && G(e.s) && G(e.v) ? (n = me(e.s), a = me(e.v), t = pr(e.h, n, a), s = !0, i = "hsv") : G(e.h) && G(e.s) && G(e.l) && (n = me(e.s), o = me(e.l), t = hr(e.h, n, o), s = !0, i = "hsl"), e.hasOwnProperty("a") && (r = e.a)), r = st(r), {
|
|
866
|
+
ok: s,
|
|
867
|
+
format: e.format || i,
|
|
868
|
+
r: Math.min(255, Math.max(t.r, 0)),
|
|
869
|
+
g: Math.min(255, Math.max(t.g, 0)),
|
|
870
|
+
b: Math.min(255, Math.max(t.b, 0)),
|
|
871
|
+
a: r
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function fr(e, t, r) {
|
|
875
|
+
return {
|
|
876
|
+
r: M(e, 255) * 255,
|
|
877
|
+
g: M(t, 255) * 255,
|
|
878
|
+
b: M(r, 255) * 255
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
function Ge(e, t, r) {
|
|
882
|
+
e = M(e, 255), t = M(t, 255), r = M(r, 255);
|
|
883
|
+
var n = Math.max(e, t, r), a = Math.min(e, t, r), o, s, i = (n + a) / 2;
|
|
884
|
+
if (n == a)
|
|
885
|
+
o = s = 0;
|
|
886
|
+
else {
|
|
887
|
+
var l = n - a;
|
|
888
|
+
switch (s = i > 0.5 ? l / (2 - n - a) : l / (n + a), n) {
|
|
889
|
+
case e:
|
|
890
|
+
o = (t - r) / l + (t < r ? 6 : 0);
|
|
891
|
+
break;
|
|
892
|
+
case t:
|
|
893
|
+
o = (r - e) / l + 2;
|
|
894
|
+
break;
|
|
895
|
+
case r:
|
|
896
|
+
o = (e - t) / l + 4;
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
o /= 6;
|
|
900
|
+
}
|
|
901
|
+
return {
|
|
902
|
+
h: o,
|
|
903
|
+
s,
|
|
904
|
+
l: i
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function hr(e, t, r) {
|
|
908
|
+
var n, a, o;
|
|
909
|
+
e = M(e, 360), t = M(t, 100), r = M(r, 100);
|
|
910
|
+
function s(c, d, f) {
|
|
911
|
+
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 1 / 6 ? c + (d - c) * 6 * f : f < 1 / 2 ? d : f < 2 / 3 ? c + (d - c) * (2 / 3 - f) * 6 : c;
|
|
912
|
+
}
|
|
913
|
+
if (t === 0)
|
|
914
|
+
n = a = o = r;
|
|
915
|
+
else {
|
|
916
|
+
var i = r < 0.5 ? r * (1 + t) : r + t - r * t, l = 2 * r - i;
|
|
917
|
+
n = s(l, i, e + 1 / 3), a = s(l, i, e), o = s(l, i, e - 1 / 3);
|
|
918
|
+
}
|
|
919
|
+
return {
|
|
920
|
+
r: n * 255,
|
|
921
|
+
g: a * 255,
|
|
922
|
+
b: o * 255
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function qe(e, t, r) {
|
|
926
|
+
e = M(e, 255), t = M(t, 255), r = M(r, 255);
|
|
927
|
+
var n = Math.max(e, t, r), a = Math.min(e, t, r), o, s, i = n, l = n - a;
|
|
928
|
+
if (s = n === 0 ? 0 : l / n, n == a)
|
|
929
|
+
o = 0;
|
|
930
|
+
else {
|
|
931
|
+
switch (n) {
|
|
932
|
+
case e:
|
|
933
|
+
o = (t - r) / l + (t < r ? 6 : 0);
|
|
934
|
+
break;
|
|
935
|
+
case t:
|
|
936
|
+
o = (r - e) / l + 2;
|
|
937
|
+
break;
|
|
938
|
+
case r:
|
|
939
|
+
o = (e - t) / l + 4;
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
o /= 6;
|
|
943
|
+
}
|
|
944
|
+
return {
|
|
945
|
+
h: o,
|
|
946
|
+
s,
|
|
947
|
+
v: i
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function pr(e, t, r) {
|
|
951
|
+
e = M(e, 360) * 6, t = M(t, 100), r = M(r, 100);
|
|
952
|
+
var n = Math.floor(e), a = e - n, o = r * (1 - t), s = r * (1 - a * t), i = r * (1 - (1 - a) * t), l = n % 6, c = [r, s, o, o, i, r][l], d = [i, r, r, s, o, o][l], f = [o, o, i, r, r, s][l];
|
|
953
|
+
return {
|
|
954
|
+
r: c * 255,
|
|
955
|
+
g: d * 255,
|
|
956
|
+
b: f * 255
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function Xe(e, t, r, n) {
|
|
960
|
+
var a = [D(Math.round(e).toString(16)), D(Math.round(t).toString(16)), D(Math.round(r).toString(16))];
|
|
961
|
+
return n && 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[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
|
|
962
|
+
}
|
|
963
|
+
function mr(e, t, r, n, a) {
|
|
964
|
+
var o = [D(Math.round(e).toString(16)), D(Math.round(t).toString(16)), D(Math.round(r).toString(16)), D(lt(n))];
|
|
965
|
+
return a && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) == o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) && o[3].charAt(0) == o[3].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join("");
|
|
966
|
+
}
|
|
967
|
+
function Ye(e, t, r, n) {
|
|
968
|
+
var a = [D(lt(n)), D(Math.round(e).toString(16)), D(Math.round(t).toString(16)), D(Math.round(r).toString(16))];
|
|
969
|
+
return a.join("");
|
|
970
|
+
}
|
|
971
|
+
p.equals = function(e, t) {
|
|
972
|
+
return !e || !t ? !1 : p(e).toRgbString() == p(t).toRgbString();
|
|
973
|
+
};
|
|
974
|
+
p.random = function() {
|
|
975
|
+
return p.fromRatio({
|
|
976
|
+
r: Math.random(),
|
|
977
|
+
g: Math.random(),
|
|
978
|
+
b: Math.random()
|
|
979
|
+
});
|
|
980
|
+
};
|
|
981
|
+
function vr(e, t) {
|
|
982
|
+
t = t === 0 ? 0 : t || 10;
|
|
983
|
+
var r = p(e).toHsl();
|
|
984
|
+
return r.s -= t / 100, r.s = Ee(r.s), p(r);
|
|
985
|
+
}
|
|
986
|
+
function br(e, t) {
|
|
987
|
+
t = t === 0 ? 0 : t || 10;
|
|
988
|
+
var r = p(e).toHsl();
|
|
989
|
+
return r.s += t / 100, r.s = Ee(r.s), p(r);
|
|
990
|
+
}
|
|
991
|
+
function gr(e) {
|
|
992
|
+
return p(e).desaturate(100);
|
|
993
|
+
}
|
|
994
|
+
function yr(e, t) {
|
|
995
|
+
t = t === 0 ? 0 : t || 10;
|
|
996
|
+
var r = p(e).toHsl();
|
|
997
|
+
return r.l += t / 100, r.l = Ee(r.l), p(r);
|
|
998
|
+
}
|
|
999
|
+
function wr(e, t) {
|
|
1000
|
+
t = t === 0 ? 0 : t || 10;
|
|
1001
|
+
var r = p(e).toRgb();
|
|
1002
|
+
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)))), p(r);
|
|
1003
|
+
}
|
|
1004
|
+
function _r(e, t) {
|
|
1005
|
+
t = t === 0 ? 0 : t || 10;
|
|
1006
|
+
var r = p(e).toHsl();
|
|
1007
|
+
return r.l -= t / 100, r.l = Ee(r.l), p(r);
|
|
1008
|
+
}
|
|
1009
|
+
function xr(e, t) {
|
|
1010
|
+
var r = p(e).toHsl(), n = (r.h + t) % 360;
|
|
1011
|
+
return r.h = n < 0 ? 360 + n : n, p(r);
|
|
1012
|
+
}
|
|
1013
|
+
function kr(e) {
|
|
1014
|
+
var t = p(e).toHsl();
|
|
1015
|
+
return t.h = (t.h + 180) % 360, p(t);
|
|
1016
|
+
}
|
|
1017
|
+
function Ze(e, t) {
|
|
1018
|
+
if (isNaN(t) || t <= 0)
|
|
1019
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
1020
|
+
for (var r = p(e).toHsl(), n = [p(e)], a = 360 / t, o = 1; o < t; o++)
|
|
1021
|
+
n.push(p({
|
|
1022
|
+
h: (r.h + o * a) % 360,
|
|
1023
|
+
s: r.s,
|
|
1024
|
+
l: r.l
|
|
1025
|
+
}));
|
|
1026
|
+
return n;
|
|
1027
|
+
}
|
|
1028
|
+
function Sr(e) {
|
|
1029
|
+
var t = p(e).toHsl(), r = t.h;
|
|
1030
|
+
return [p(e), p({
|
|
1031
|
+
h: (r + 72) % 360,
|
|
1032
|
+
s: t.s,
|
|
1033
|
+
l: t.l
|
|
1034
|
+
}), p({
|
|
1035
|
+
h: (r + 216) % 360,
|
|
1036
|
+
s: t.s,
|
|
1037
|
+
l: t.l
|
|
1038
|
+
})];
|
|
1039
|
+
}
|
|
1040
|
+
function Mr(e, t, r) {
|
|
1041
|
+
t = t || 6, r = r || 30;
|
|
1042
|
+
var n = p(e).toHsl(), a = 360 / r, o = [p(e)];
|
|
1043
|
+
for (n.h = (n.h - (a * t >> 1) + 720) % 360; --t; )
|
|
1044
|
+
n.h = (n.h + a) % 360, o.push(p(n));
|
|
1045
|
+
return o;
|
|
1046
|
+
}
|
|
1047
|
+
function $r(e, t) {
|
|
1048
|
+
t = t || 6;
|
|
1049
|
+
for (var r = p(e).toHsv(), n = r.h, a = r.s, o = r.v, s = [], i = 1 / t; t--; )
|
|
1050
|
+
s.push(p({
|
|
1051
|
+
h: n,
|
|
1052
|
+
s: a,
|
|
1053
|
+
v: o
|
|
1054
|
+
})), o = (o + i) % 1;
|
|
1055
|
+
return s;
|
|
1056
|
+
}
|
|
1057
|
+
p.mix = function(e, t, r) {
|
|
1058
|
+
r = r === 0 ? 0 : r || 50;
|
|
1059
|
+
var n = p(e).toRgb(), a = p(t).toRgb(), o = r / 100, s = {
|
|
1060
|
+
r: (a.r - n.r) * o + n.r,
|
|
1061
|
+
g: (a.g - n.g) * o + n.g,
|
|
1062
|
+
b: (a.b - n.b) * o + n.b,
|
|
1063
|
+
a: (a.a - n.a) * o + n.a
|
|
1064
|
+
};
|
|
1065
|
+
return p(s);
|
|
1066
|
+
};
|
|
1067
|
+
p.readability = function(e, t) {
|
|
1068
|
+
var r = p(e), n = p(t);
|
|
1069
|
+
return (Math.max(r.getLuminance(), n.getLuminance()) + 0.05) / (Math.min(r.getLuminance(), n.getLuminance()) + 0.05);
|
|
1070
|
+
};
|
|
1071
|
+
p.isReadable = function(e, t, r) {
|
|
1072
|
+
var n = p.readability(e, t), a, o;
|
|
1073
|
+
switch (o = !1, a = Rr(r), a.level + a.size) {
|
|
1074
|
+
case "AAsmall":
|
|
1075
|
+
case "AAAlarge":
|
|
1076
|
+
o = n >= 4.5;
|
|
1077
|
+
break;
|
|
1078
|
+
case "AAlarge":
|
|
1079
|
+
o = n >= 3;
|
|
1080
|
+
break;
|
|
1081
|
+
case "AAAsmall":
|
|
1082
|
+
o = n >= 7;
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
return o;
|
|
1086
|
+
};
|
|
1087
|
+
p.mostReadable = function(e, t, r) {
|
|
1088
|
+
var n = null, a = 0, o, s, i, l;
|
|
1089
|
+
r = r || {}, s = r.includeFallbackColors, i = r.level, l = r.size;
|
|
1090
|
+
for (var c = 0; c < t.length; c++)
|
|
1091
|
+
o = p.readability(e, t[c]), o > a && (a = o, n = p(t[c]));
|
|
1092
|
+
return p.isReadable(e, n, {
|
|
1093
|
+
level: i,
|
|
1094
|
+
size: l
|
|
1095
|
+
}) || !s ? n : (r.includeFallbackColors = !1, p.mostReadable(e, ["#fff", "#000"], r));
|
|
1096
|
+
};
|
|
1097
|
+
var He = p.names = {
|
|
1098
|
+
aliceblue: "f0f8ff",
|
|
1099
|
+
antiquewhite: "faebd7",
|
|
1100
|
+
aqua: "0ff",
|
|
1101
|
+
aquamarine: "7fffd4",
|
|
1102
|
+
azure: "f0ffff",
|
|
1103
|
+
beige: "f5f5dc",
|
|
1104
|
+
bisque: "ffe4c4",
|
|
1105
|
+
black: "000",
|
|
1106
|
+
blanchedalmond: "ffebcd",
|
|
1107
|
+
blue: "00f",
|
|
1108
|
+
blueviolet: "8a2be2",
|
|
1109
|
+
brown: "a52a2a",
|
|
1110
|
+
burlywood: "deb887",
|
|
1111
|
+
burntsienna: "ea7e5d",
|
|
1112
|
+
cadetblue: "5f9ea0",
|
|
1113
|
+
chartreuse: "7fff00",
|
|
1114
|
+
chocolate: "d2691e",
|
|
1115
|
+
coral: "ff7f50",
|
|
1116
|
+
cornflowerblue: "6495ed",
|
|
1117
|
+
cornsilk: "fff8dc",
|
|
1118
|
+
crimson: "dc143c",
|
|
1119
|
+
cyan: "0ff",
|
|
1120
|
+
darkblue: "00008b",
|
|
1121
|
+
darkcyan: "008b8b",
|
|
1122
|
+
darkgoldenrod: "b8860b",
|
|
1123
|
+
darkgray: "a9a9a9",
|
|
1124
|
+
darkgreen: "006400",
|
|
1125
|
+
darkgrey: "a9a9a9",
|
|
1126
|
+
darkkhaki: "bdb76b",
|
|
1127
|
+
darkmagenta: "8b008b",
|
|
1128
|
+
darkolivegreen: "556b2f",
|
|
1129
|
+
darkorange: "ff8c00",
|
|
1130
|
+
darkorchid: "9932cc",
|
|
1131
|
+
darkred: "8b0000",
|
|
1132
|
+
darksalmon: "e9967a",
|
|
1133
|
+
darkseagreen: "8fbc8f",
|
|
1134
|
+
darkslateblue: "483d8b",
|
|
1135
|
+
darkslategray: "2f4f4f",
|
|
1136
|
+
darkslategrey: "2f4f4f",
|
|
1137
|
+
darkturquoise: "00ced1",
|
|
1138
|
+
darkviolet: "9400d3",
|
|
1139
|
+
deeppink: "ff1493",
|
|
1140
|
+
deepskyblue: "00bfff",
|
|
1141
|
+
dimgray: "696969",
|
|
1142
|
+
dimgrey: "696969",
|
|
1143
|
+
dodgerblue: "1e90ff",
|
|
1144
|
+
firebrick: "b22222",
|
|
1145
|
+
floralwhite: "fffaf0",
|
|
1146
|
+
forestgreen: "228b22",
|
|
1147
|
+
fuchsia: "f0f",
|
|
1148
|
+
gainsboro: "dcdcdc",
|
|
1149
|
+
ghostwhite: "f8f8ff",
|
|
1150
|
+
gold: "ffd700",
|
|
1151
|
+
goldenrod: "daa520",
|
|
1152
|
+
gray: "808080",
|
|
1153
|
+
green: "008000",
|
|
1154
|
+
greenyellow: "adff2f",
|
|
1155
|
+
grey: "808080",
|
|
1156
|
+
honeydew: "f0fff0",
|
|
1157
|
+
hotpink: "ff69b4",
|
|
1158
|
+
indianred: "cd5c5c",
|
|
1159
|
+
indigo: "4b0082",
|
|
1160
|
+
ivory: "fffff0",
|
|
1161
|
+
khaki: "f0e68c",
|
|
1162
|
+
lavender: "e6e6fa",
|
|
1163
|
+
lavenderblush: "fff0f5",
|
|
1164
|
+
lawngreen: "7cfc00",
|
|
1165
|
+
lemonchiffon: "fffacd",
|
|
1166
|
+
lightblue: "add8e6",
|
|
1167
|
+
lightcoral: "f08080",
|
|
1168
|
+
lightcyan: "e0ffff",
|
|
1169
|
+
lightgoldenrodyellow: "fafad2",
|
|
1170
|
+
lightgray: "d3d3d3",
|
|
1171
|
+
lightgreen: "90ee90",
|
|
1172
|
+
lightgrey: "d3d3d3",
|
|
1173
|
+
lightpink: "ffb6c1",
|
|
1174
|
+
lightsalmon: "ffa07a",
|
|
1175
|
+
lightseagreen: "20b2aa",
|
|
1176
|
+
lightskyblue: "87cefa",
|
|
1177
|
+
lightslategray: "789",
|
|
1178
|
+
lightslategrey: "789",
|
|
1179
|
+
lightsteelblue: "b0c4de",
|
|
1180
|
+
lightyellow: "ffffe0",
|
|
1181
|
+
lime: "0f0",
|
|
1182
|
+
limegreen: "32cd32",
|
|
1183
|
+
linen: "faf0e6",
|
|
1184
|
+
magenta: "f0f",
|
|
1185
|
+
maroon: "800000",
|
|
1186
|
+
mediumaquamarine: "66cdaa",
|
|
1187
|
+
mediumblue: "0000cd",
|
|
1188
|
+
mediumorchid: "ba55d3",
|
|
1189
|
+
mediumpurple: "9370db",
|
|
1190
|
+
mediumseagreen: "3cb371",
|
|
1191
|
+
mediumslateblue: "7b68ee",
|
|
1192
|
+
mediumspringgreen: "00fa9a",
|
|
1193
|
+
mediumturquoise: "48d1cc",
|
|
1194
|
+
mediumvioletred: "c71585",
|
|
1195
|
+
midnightblue: "191970",
|
|
1196
|
+
mintcream: "f5fffa",
|
|
1197
|
+
mistyrose: "ffe4e1",
|
|
1198
|
+
moccasin: "ffe4b5",
|
|
1199
|
+
navajowhite: "ffdead",
|
|
1200
|
+
navy: "000080",
|
|
1201
|
+
oldlace: "fdf5e6",
|
|
1202
|
+
olive: "808000",
|
|
1203
|
+
olivedrab: "6b8e23",
|
|
1204
|
+
orange: "ffa500",
|
|
1205
|
+
orangered: "ff4500",
|
|
1206
|
+
orchid: "da70d6",
|
|
1207
|
+
palegoldenrod: "eee8aa",
|
|
1208
|
+
palegreen: "98fb98",
|
|
1209
|
+
paleturquoise: "afeeee",
|
|
1210
|
+
palevioletred: "db7093",
|
|
1211
|
+
papayawhip: "ffefd5",
|
|
1212
|
+
peachpuff: "ffdab9",
|
|
1213
|
+
peru: "cd853f",
|
|
1214
|
+
pink: "ffc0cb",
|
|
1215
|
+
plum: "dda0dd",
|
|
1216
|
+
powderblue: "b0e0e6",
|
|
1217
|
+
purple: "800080",
|
|
1218
|
+
rebeccapurple: "663399",
|
|
1219
|
+
red: "f00",
|
|
1220
|
+
rosybrown: "bc8f8f",
|
|
1221
|
+
royalblue: "4169e1",
|
|
1222
|
+
saddlebrown: "8b4513",
|
|
1223
|
+
salmon: "fa8072",
|
|
1224
|
+
sandybrown: "f4a460",
|
|
1225
|
+
seagreen: "2e8b57",
|
|
1226
|
+
seashell: "fff5ee",
|
|
1227
|
+
sienna: "a0522d",
|
|
1228
|
+
silver: "c0c0c0",
|
|
1229
|
+
skyblue: "87ceeb",
|
|
1230
|
+
slateblue: "6a5acd",
|
|
1231
|
+
slategray: "708090",
|
|
1232
|
+
slategrey: "708090",
|
|
1233
|
+
snow: "fffafa",
|
|
1234
|
+
springgreen: "00ff7f",
|
|
1235
|
+
steelblue: "4682b4",
|
|
1236
|
+
tan: "d2b48c",
|
|
1237
|
+
teal: "008080",
|
|
1238
|
+
thistle: "d8bfd8",
|
|
1239
|
+
tomato: "ff6347",
|
|
1240
|
+
turquoise: "40e0d0",
|
|
1241
|
+
violet: "ee82ee",
|
|
1242
|
+
wheat: "f5deb3",
|
|
1243
|
+
white: "fff",
|
|
1244
|
+
whitesmoke: "f5f5f5",
|
|
1245
|
+
yellow: "ff0",
|
|
1246
|
+
yellowgreen: "9acd32"
|
|
1247
|
+
}, Cr = p.hexNames = Ar(He);
|
|
1248
|
+
function Ar(e) {
|
|
1249
|
+
var t = {};
|
|
1250
|
+
for (var r in e)
|
|
1251
|
+
e.hasOwnProperty(r) && (t[e[r]] = r);
|
|
1252
|
+
return t;
|
|
1253
|
+
}
|
|
1254
|
+
function st(e) {
|
|
1255
|
+
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1256
|
+
}
|
|
1257
|
+
function M(e, t) {
|
|
1258
|
+
Tr(e) && (e = "100%");
|
|
1259
|
+
var r = zr(e);
|
|
1260
|
+
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);
|
|
1261
|
+
}
|
|
1262
|
+
function Ee(e) {
|
|
1263
|
+
return Math.min(1, Math.max(0, e));
|
|
1264
|
+
}
|
|
1265
|
+
function H(e) {
|
|
1266
|
+
return parseInt(e, 16);
|
|
1267
|
+
}
|
|
1268
|
+
function Tr(e) {
|
|
1269
|
+
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
1270
|
+
}
|
|
1271
|
+
function zr(e) {
|
|
1272
|
+
return typeof e == "string" && e.indexOf("%") != -1;
|
|
1273
|
+
}
|
|
1274
|
+
function D(e) {
|
|
1275
|
+
return e.length == 1 ? "0" + e : "" + e;
|
|
1276
|
+
}
|
|
1277
|
+
function me(e) {
|
|
1278
|
+
return e <= 1 && (e = e * 100 + "%"), e;
|
|
1279
|
+
}
|
|
1280
|
+
function lt(e) {
|
|
1281
|
+
return Math.round(parseFloat(e) * 255).toString(16);
|
|
1282
|
+
}
|
|
1283
|
+
function Ke(e) {
|
|
1284
|
+
return H(e) / 255;
|
|
1285
|
+
}
|
|
1286
|
+
var V = function() {
|
|
1287
|
+
var e = "[-\\+]?\\d+%?", t = "[-\\+]?\\d*\\.\\d+%?", r = "(?:" + t + ")|(?:" + e + ")", n = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?", a = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?";
|
|
1288
|
+
return {
|
|
1289
|
+
CSS_UNIT: new RegExp(r),
|
|
1290
|
+
rgb: new RegExp("rgb" + n),
|
|
1291
|
+
rgba: new RegExp("rgba" + a),
|
|
1292
|
+
hsl: new RegExp("hsl" + n),
|
|
1293
|
+
hsla: new RegExp("hsla" + a),
|
|
1294
|
+
hsv: new RegExp("hsv" + n),
|
|
1295
|
+
hsva: new RegExp("hsva" + a),
|
|
1296
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1297
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
1298
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1299
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1300
|
+
};
|
|
1301
|
+
}();
|
|
1302
|
+
function G(e) {
|
|
1303
|
+
return !!V.CSS_UNIT.exec(e);
|
|
1304
|
+
}
|
|
1305
|
+
function Er(e) {
|
|
1306
|
+
e = e.replace(cr, "").replace(ur, "").toLowerCase();
|
|
1307
|
+
var t = !1;
|
|
1308
|
+
if (He[e])
|
|
1309
|
+
e = He[e], t = !0;
|
|
1310
|
+
else if (e == "transparent")
|
|
1311
|
+
return {
|
|
1312
|
+
r: 0,
|
|
1313
|
+
g: 0,
|
|
1314
|
+
b: 0,
|
|
1315
|
+
a: 0,
|
|
1316
|
+
format: "name"
|
|
1317
|
+
};
|
|
1318
|
+
var r;
|
|
1319
|
+
return (r = V.rgb.exec(e)) ? {
|
|
1320
|
+
r: r[1],
|
|
1321
|
+
g: r[2],
|
|
1322
|
+
b: r[3]
|
|
1323
|
+
} : (r = V.rgba.exec(e)) ? {
|
|
1324
|
+
r: r[1],
|
|
1325
|
+
g: r[2],
|
|
1326
|
+
b: r[3],
|
|
1327
|
+
a: r[4]
|
|
1328
|
+
} : (r = V.hsl.exec(e)) ? {
|
|
1329
|
+
h: r[1],
|
|
1330
|
+
s: r[2],
|
|
1331
|
+
l: r[3]
|
|
1332
|
+
} : (r = V.hsla.exec(e)) ? {
|
|
1333
|
+
h: r[1],
|
|
1334
|
+
s: r[2],
|
|
1335
|
+
l: r[3],
|
|
1336
|
+
a: r[4]
|
|
1337
|
+
} : (r = V.hsv.exec(e)) ? {
|
|
1338
|
+
h: r[1],
|
|
1339
|
+
s: r[2],
|
|
1340
|
+
v: r[3]
|
|
1341
|
+
} : (r = V.hsva.exec(e)) ? {
|
|
1342
|
+
h: r[1],
|
|
1343
|
+
s: r[2],
|
|
1344
|
+
v: r[3],
|
|
1345
|
+
a: r[4]
|
|
1346
|
+
} : (r = V.hex8.exec(e)) ? {
|
|
1347
|
+
r: H(r[1]),
|
|
1348
|
+
g: H(r[2]),
|
|
1349
|
+
b: H(r[3]),
|
|
1350
|
+
a: Ke(r[4]),
|
|
1351
|
+
format: t ? "name" : "hex8"
|
|
1352
|
+
} : (r = V.hex6.exec(e)) ? {
|
|
1353
|
+
r: H(r[1]),
|
|
1354
|
+
g: H(r[2]),
|
|
1355
|
+
b: H(r[3]),
|
|
1356
|
+
format: t ? "name" : "hex"
|
|
1357
|
+
} : (r = V.hex4.exec(e)) ? {
|
|
1358
|
+
r: H(r[1] + "" + r[1]),
|
|
1359
|
+
g: H(r[2] + "" + r[2]),
|
|
1360
|
+
b: H(r[3] + "" + r[3]),
|
|
1361
|
+
a: Ke(r[4] + "" + r[4]),
|
|
1362
|
+
format: t ? "name" : "hex8"
|
|
1363
|
+
} : (r = V.hex3.exec(e)) ? {
|
|
1364
|
+
r: H(r[1] + "" + r[1]),
|
|
1365
|
+
g: H(r[2] + "" + r[2]),
|
|
1366
|
+
b: H(r[3] + "" + r[3]),
|
|
1367
|
+
format: t ? "name" : "hex"
|
|
1368
|
+
} : !1;
|
|
1369
|
+
}
|
|
1370
|
+
function Rr(e) {
|
|
1371
|
+
var t, r;
|
|
1372
|
+
return e = e || {
|
|
1373
|
+
level: "AA",
|
|
1374
|
+
size: "small"
|
|
1375
|
+
}, t = (e.level || "AA").toUpperCase(), r = (e.size || "small").toLowerCase(), t !== "AA" && t !== "AAA" && (t = "AA"), r !== "small" && r !== "large" && (r = "small"), {
|
|
1376
|
+
level: t,
|
|
1377
|
+
size: r
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
function Br() {
|
|
1381
|
+
if (!Q)
|
|
1382
|
+
return g("dark");
|
|
1383
|
+
const e = g(document.documentElement.dataset.scheme);
|
|
1384
|
+
return new MutationObserver((r) => {
|
|
1385
|
+
r.forEach((n) => {
|
|
1386
|
+
n.type === "attributes" && n.attributeName === "data-scheme" && (e.value = document.documentElement.dataset.scheme);
|
|
1387
|
+
});
|
|
1388
|
+
}).observe(document.documentElement, {
|
|
1389
|
+
attributes: !0,
|
|
1390
|
+
attributeFilter: ["data-scheme"]
|
|
1391
|
+
}), e;
|
|
1392
|
+
}
|
|
1393
|
+
function Wn() {
|
|
1394
|
+
return be("currentThemeScheme", null);
|
|
1395
|
+
}
|
|
1396
|
+
function Or() {
|
|
1397
|
+
return be("currentTheme", g(Ie));
|
|
1398
|
+
}
|
|
1399
|
+
function it(e, t = !0) {
|
|
1400
|
+
const r = g(e), n = g(e.scheme), a = Br();
|
|
1401
|
+
X(() => {
|
|
1402
|
+
a.value && (n.value = a.value);
|
|
1403
|
+
}), ge("currentTheme", r), ge("currentThemeScheme", n);
|
|
1404
|
+
const s = {
|
|
1405
|
+
...Object.keys(r.value.colors).map((c) => {
|
|
1406
|
+
const d = c;
|
|
1407
|
+
return r.value.colors[d].reduce((v, S, A) => {
|
|
1408
|
+
const z = p(S).toRgb();
|
|
1409
|
+
return v[`--r-color-${d}-${A}`] = `${z.r} ${z.g} ${z.b}`, v;
|
|
1410
|
+
}, {});
|
|
1411
|
+
}).reduce((c, d) => ({
|
|
1412
|
+
...c,
|
|
1413
|
+
...d
|
|
1414
|
+
}), {})
|
|
1415
|
+
}, i = {
|
|
1416
|
+
"font-family": "'Roboto', sans-serif",
|
|
1417
|
+
"background-color": "rgb(var(--r-color-surface-lowest))",
|
|
1418
|
+
color: "rgb(var(--r-color-surface-on))"
|
|
1419
|
+
}, l = m(() => {
|
|
1420
|
+
if (t)
|
|
1421
|
+
return {};
|
|
1422
|
+
const { scheme: c } = e;
|
|
1423
|
+
switch (c) {
|
|
1424
|
+
case "dark":
|
|
1425
|
+
return {
|
|
1426
|
+
colorScheme: "dark",
|
|
1427
|
+
"--r-color-surface-on": "var(--r-color-surface-3)",
|
|
1428
|
+
"--r-color-surface-oninverted": "var(--r-color-surface-8)",
|
|
1429
|
+
"--r-color-surface-onlow": "var(--r-color-surface-4)",
|
|
1430
|
+
"--r-color-surface-onlowinverted": "var(--r-color-surface-7)",
|
|
1431
|
+
"--r-color-surface-lowest": "var(--r-color-surface-10)",
|
|
1432
|
+
"--r-color-surface-low": "var(--r-color-surface-9)",
|
|
1433
|
+
"--r-color-surface-base": "var(--r-color-surface-8)",
|
|
1434
|
+
"--r-color-surface-high": "var(--r-color-surface-7)",
|
|
1435
|
+
"--r-color-surface-highest": "var(--r-color-surface-6)",
|
|
1436
|
+
"--r-color-surface-border": "var(--r-color-surface-7)",
|
|
1437
|
+
"--r-color-primary-container": "var(--r-color-primary-8)",
|
|
1438
|
+
"--r-color-secondary-container": "var(--r-color-secondary-8)",
|
|
1439
|
+
"--r-color-tertiary-container": "var(--r-color-tertiary-8)",
|
|
1440
|
+
"--r-color-error-container": "var(--r-color-error-8)",
|
|
1441
|
+
"--r-color-primary-containerd": "var(--r-color-primary-9)",
|
|
1442
|
+
"--r-color-secondary-containerd": "var(--r-color-secondary-9)",
|
|
1443
|
+
"--r-color-tertiary-containerd": "var(--r-color-tertiary-9)",
|
|
1444
|
+
"--r-color-error-containerd": "var(--r-color-error-9)",
|
|
1445
|
+
"--r-color-primary-containerl": "var(--r-color-primary-6)",
|
|
1446
|
+
"--r-color-secondary-containerl": "var(--r-color-secondary-6)",
|
|
1447
|
+
"--r-color-tertiary-containerl": "var(--r-color-tertiary-6)",
|
|
1448
|
+
"--r-color-error-containerl": "var(--r-color-error-6)"
|
|
1449
|
+
};
|
|
1450
|
+
case "light":
|
|
1451
|
+
return {
|
|
1452
|
+
colorScheme: "light",
|
|
1453
|
+
"--r-color-surface-on": "var(--r-color-surface-7)",
|
|
1454
|
+
"--r-color-surface-oninverted": "var(--r-color-surface-2)",
|
|
1455
|
+
"--r-color-surface-onlow": "var(--r-color-surface-6)",
|
|
1456
|
+
"--r-color-surface-onlowinverted": "var(--r-color-surface-3)",
|
|
1457
|
+
"--r-color-surface-lowest": "var(--r-color-surface-3)",
|
|
1458
|
+
"--r-color-surface-low": "var(--r-color-surface-2)",
|
|
1459
|
+
"--r-color-surface-base": "var(--r-color-surface-1)",
|
|
1460
|
+
"--r-color-surface-high": "var(--r-color-surface-0)",
|
|
1461
|
+
"--r-color-surface-highest": "var(--r-color-surface-0)",
|
|
1462
|
+
"--r-color-surface-border": "var(--r-color-surface-4)",
|
|
1463
|
+
"--r-color-primary-container": "var(--r-color-primary-6)",
|
|
1464
|
+
"--r-color-secondary-container": "var(--r-color-secondary-6)",
|
|
1465
|
+
"--r-color-tertiary-container": "var(--r-color-tertiary-6)",
|
|
1466
|
+
"--r-color-error-container": "var(--r-color-error-6)",
|
|
1467
|
+
"--r-color-primary-containerd": "var(--r-color-primary-7)",
|
|
1468
|
+
"--r-color-secondary-containerd": "var(--r-color-secondary-7)",
|
|
1469
|
+
"--r-color-tertiary-containerd": "var(--r-color-tertiary-7)",
|
|
1470
|
+
"--r-color-error-containerd": "var(--r-color-error-7)",
|
|
1471
|
+
"--r-color-primary-containerl": "var(--r-color-primary-4)",
|
|
1472
|
+
"--r-color-secondary-containerl": "var(--r-color-secondary-4)",
|
|
1473
|
+
"--r-color-tertiary-containerl": "var(--r-color-tertiary-4)",
|
|
1474
|
+
"--r-color-error-containerl": "var(--r-color-error-4)"
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
return {
|
|
1479
|
+
...s,
|
|
1480
|
+
...i,
|
|
1481
|
+
...l.value
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
function ct(e) {
|
|
1485
|
+
const t = g("");
|
|
1486
|
+
return ee(() => {
|
|
1487
|
+
e.id ? t.value = e.id : t.value = `switch-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`;
|
|
1488
|
+
}), t;
|
|
1489
|
+
}
|
|
1490
|
+
const ut = Symbol("scheme");
|
|
1491
|
+
function Hr() {
|
|
1492
|
+
return be(ut, g("dark"));
|
|
1493
|
+
}
|
|
1494
|
+
const Nr = ["id"], Pr = ["for"], jn = /* @__PURE__ */ x({
|
|
1495
|
+
__name: "ColorInput",
|
|
1496
|
+
props: {
|
|
1497
|
+
modelValue: {},
|
|
1498
|
+
modelModifiers: {}
|
|
1499
|
+
},
|
|
1500
|
+
emits: ["update:modelValue"],
|
|
1501
|
+
setup(e) {
|
|
1502
|
+
const t = j(e, "modelValue"), r = $t(), n = ct(r), a = g(null);
|
|
1503
|
+
return (o, s) => {
|
|
1504
|
+
const i = ir;
|
|
1505
|
+
return h(), b("div", null, [
|
|
1506
|
+
Te(w("input", {
|
|
1507
|
+
id: u(n),
|
|
1508
|
+
ref_key: "input",
|
|
1509
|
+
ref: a,
|
|
1510
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => t.value = l),
|
|
1511
|
+
type: "color",
|
|
1512
|
+
class: "pointer-events-none absolute opacity-0"
|
|
1513
|
+
}, null, 8, Nr), [
|
|
1514
|
+
[Ct, t.value]
|
|
1515
|
+
]),
|
|
1516
|
+
w("label", { for: u(n) }, [
|
|
1517
|
+
Z(i, {
|
|
1518
|
+
class: "cursor-pointer",
|
|
1519
|
+
color: t.value ?? "#222"
|
|
1520
|
+
}, null, 8, ["color"])
|
|
1521
|
+
], 8, Pr)
|
|
1522
|
+
]);
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
}), Ir = ["data-scheme", "data-theme"], Vr = /* @__PURE__ */ x({
|
|
1526
|
+
__name: "ThemeProvider",
|
|
1527
|
+
props: {
|
|
1528
|
+
theme: {}
|
|
1529
|
+
},
|
|
1530
|
+
setup(e) {
|
|
1531
|
+
const r = it(e.theme, !1);
|
|
1532
|
+
return (n, a) => (h(), b("div", {
|
|
1533
|
+
style: C([u(r)]),
|
|
1534
|
+
"data-scheme": n.theme.scheme,
|
|
1535
|
+
"data-theme": n.theme.name
|
|
1536
|
+
}, [
|
|
1537
|
+
k(n.$slots, "default")
|
|
1538
|
+
], 12, Ir));
|
|
1539
|
+
}
|
|
1540
|
+
}), dt = /* @__PURE__ */ x({
|
|
1541
|
+
__name: "FullscreenOverlay",
|
|
1542
|
+
props: /* @__PURE__ */ W({
|
|
1543
|
+
persistent: { type: Boolean, default: !1 },
|
|
1544
|
+
blur: { type: [String, Boolean], default: !1 },
|
|
1545
|
+
wrapperClass: {}
|
|
1546
|
+
}, {
|
|
1547
|
+
modelValue: { type: Boolean },
|
|
1548
|
+
modelModifiers: {}
|
|
1549
|
+
}),
|
|
1550
|
+
emits: ["update:modelValue"],
|
|
1551
|
+
setup(e) {
|
|
1552
|
+
const t = e, r = j(e, "modelValue"), n = g(null);
|
|
1553
|
+
function a(c) {
|
|
1554
|
+
t.persistent || c.target === n.value && (r.value = !1);
|
|
1555
|
+
}
|
|
1556
|
+
const o = m(() => {
|
|
1557
|
+
switch (t.blur) {
|
|
1558
|
+
case "sm":
|
|
1559
|
+
return "backdrop-blur-sm";
|
|
1560
|
+
case "md":
|
|
1561
|
+
case !0:
|
|
1562
|
+
return "backdrop-blur-md";
|
|
1563
|
+
case "lg":
|
|
1564
|
+
return "backdrop-blur-lg";
|
|
1565
|
+
default:
|
|
1566
|
+
return "";
|
|
1567
|
+
}
|
|
1568
|
+
}), s = g(0);
|
|
1569
|
+
X(() => {
|
|
1570
|
+
r.value ? (document.body.style.overflow = "hidden", document.body.style.marginRight = `${s.value}px`) : setTimeout(() => {
|
|
1571
|
+
document.querySelector(".modal-wrapper.op100") || (document.body.style.overflow = "", document.body.style.marginRight = "");
|
|
1572
|
+
}, 300);
|
|
1573
|
+
}), new ResizeObserver(() => {
|
|
1574
|
+
const c = window.innerWidth - document.body.clientWidth;
|
|
1575
|
+
c !== 0 && (s.value = c);
|
|
1576
|
+
}).observe(document.body);
|
|
1577
|
+
const l = Or();
|
|
1578
|
+
return (c, d) => {
|
|
1579
|
+
const f = Vr;
|
|
1580
|
+
return h(), P(At, { to: "body" }, [
|
|
1581
|
+
Z(f, { theme: u(l) }, {
|
|
1582
|
+
default: L(() => [
|
|
1583
|
+
w("div", {
|
|
1584
|
+
ref_key: "wrapperRef",
|
|
1585
|
+
ref: n,
|
|
1586
|
+
class: y(["modal-wrapper fixed left-0 top-0 z-100 h-full w-full bg-surface-lowest/50 transition-all duration-300 md:items-center", [o.value, c.wrapperClass, {
|
|
1587
|
+
"op0 pointer-events-none": !r.value,
|
|
1588
|
+
op100: r.value
|
|
1589
|
+
}]]),
|
|
1590
|
+
onClick: a
|
|
1591
|
+
}, [
|
|
1592
|
+
k(c.$slots, "default")
|
|
1593
|
+
], 2)
|
|
1594
|
+
]),
|
|
1595
|
+
_: 3
|
|
1596
|
+
}, 8, ["theme"])
|
|
1597
|
+
]);
|
|
1598
|
+
};
|
|
1599
|
+
}
|
|
1600
|
+
}), Dr = { class: "flex justify-end p-4 md:px-6 md:py-4 md:pb-0" }, Fr = /* @__PURE__ */ w("i", { class: "i-tabler-x" }, null, -1), Lr = { class: "h-full flex flex-col items-center justify-center px-4 md:px-6" }, Un = /* @__PURE__ */ x({
|
|
1601
|
+
__name: "Drawer",
|
|
1602
|
+
props: /* @__PURE__ */ W({
|
|
1603
|
+
persistent: { type: Boolean, default: !1 },
|
|
1604
|
+
blur: { type: [String, Boolean], default: !1 },
|
|
1605
|
+
position: { default: "left" }
|
|
1606
|
+
}, {
|
|
1607
|
+
modelValue: { type: Boolean },
|
|
1608
|
+
modelModifiers: {}
|
|
1609
|
+
}),
|
|
1610
|
+
emits: ["update:modelValue"],
|
|
1611
|
+
setup(e) {
|
|
1612
|
+
const t = e, r = j(e, "modelValue");
|
|
1613
|
+
return (n, a) => {
|
|
1614
|
+
const o = at, s = dt;
|
|
1615
|
+
return h(), P(s, {
|
|
1616
|
+
modelValue: r.value,
|
|
1617
|
+
"onUpdate:modelValue": a[1] || (a[1] = (i) => r.value = i),
|
|
1618
|
+
blur: t.blur,
|
|
1619
|
+
persistent: t.persistent
|
|
1620
|
+
}, {
|
|
1621
|
+
default: L(() => [
|
|
1622
|
+
Z(rt, {
|
|
1623
|
+
"enter-from-class": n.position === "left" ? "-translate-x-1/1" : "translate-x-1/1",
|
|
1624
|
+
"enter-to-class": (n.position === "left", "translate-x-0"),
|
|
1625
|
+
"leave-from-class": (n.position === "left", "translate-x-0"),
|
|
1626
|
+
"leave-to-class": n.position === "left" ? "-translate-x-1/1" : "translate-x-1/1",
|
|
1627
|
+
"enter-active-class": "transition ease-out duration-300",
|
|
1628
|
+
"leave-active-class": "transition ease-in duration-200"
|
|
1629
|
+
}, {
|
|
1630
|
+
default: L(() => [
|
|
1631
|
+
r.value ? (h(), b("div", {
|
|
1632
|
+
key: 0,
|
|
1633
|
+
class: y(["fixed h-full w-full bg-surface-low md:w-md", n.position === "left" ? "left-0" : "right-0"])
|
|
1634
|
+
}, [
|
|
1635
|
+
w("div", Dr, [
|
|
1636
|
+
Z(o, {
|
|
1637
|
+
icon: "",
|
|
1638
|
+
variant: "transparent",
|
|
1639
|
+
class: "text-surface-on hover:text-surface-on",
|
|
1640
|
+
onPointerup: a[0] || (a[0] = (i) => r.value = !1)
|
|
1641
|
+
}, {
|
|
1642
|
+
default: L(() => [
|
|
1643
|
+
Fr
|
|
1644
|
+
]),
|
|
1645
|
+
_: 1
|
|
1646
|
+
})
|
|
1647
|
+
]),
|
|
1648
|
+
w("div", Lr, [
|
|
1649
|
+
k(n.$slots, "default")
|
|
1650
|
+
])
|
|
1651
|
+
], 2)) : T("", !0)
|
|
1652
|
+
]),
|
|
1653
|
+
_: 3
|
|
1654
|
+
}, 8, ["enter-from-class", "enter-to-class", "leave-from-class", "leave-to-class"])
|
|
1655
|
+
]),
|
|
1656
|
+
_: 3
|
|
1657
|
+
}, 8, ["modelValue", "blur", "persistent"]);
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
}), Gn = /* @__PURE__ */ x({
|
|
1661
|
+
__name: "Dropzone",
|
|
1662
|
+
props: {
|
|
1663
|
+
dashed: { type: Boolean, default: !0 },
|
|
1664
|
+
accept: { default: "*" }
|
|
1665
|
+
},
|
|
1666
|
+
emits: ["drop"],
|
|
1667
|
+
setup(e, { emit: t }) {
|
|
1668
|
+
const r = e, n = t, a = g(), { onChange: o, open: s } = er({
|
|
1669
|
+
accept: r.accept
|
|
1670
|
+
});
|
|
1671
|
+
o((l) => {
|
|
1672
|
+
l ? n("drop", Array.from(l)) : n("drop", null);
|
|
1673
|
+
});
|
|
1674
|
+
const { isOverDropZone: i } = Yt(a, {
|
|
1675
|
+
onDrop: (l) => {
|
|
1676
|
+
n("drop", l);
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
return (l, c) => (h(), b("div", {
|
|
1680
|
+
ref_key: "dropZoneRef",
|
|
1681
|
+
ref: a,
|
|
1682
|
+
class: y([{
|
|
1683
|
+
"": u(i),
|
|
1684
|
+
" bg-surface-low": !u(i),
|
|
1685
|
+
"border-dashed": l.dashed
|
|
1686
|
+
}, "h-full w-full flex cursor-pointer items-center justify-center rounded"]),
|
|
1687
|
+
onPointerup: c[0] || (c[0] = () => u(s)())
|
|
1688
|
+
}, [
|
|
1689
|
+
k(l.$slots, "default")
|
|
1690
|
+
], 34));
|
|
1691
|
+
}
|
|
1692
|
+
}), qn = /* @__PURE__ */ x({
|
|
1693
|
+
__name: "Image",
|
|
1694
|
+
props: {
|
|
1695
|
+
is: { default: "img" },
|
|
1696
|
+
src: {},
|
|
1697
|
+
style: {},
|
|
1698
|
+
class: {},
|
|
1699
|
+
width: {},
|
|
1700
|
+
maxWidth: {},
|
|
1701
|
+
height: {},
|
|
1702
|
+
maxHeight: {},
|
|
1703
|
+
rounded: { default: "md" }
|
|
1704
|
+
},
|
|
1705
|
+
setup(e) {
|
|
1706
|
+
const t = e, r = g(!1), n = g(null);
|
|
1707
|
+
function a() {
|
|
1708
|
+
r.value = !0;
|
|
1709
|
+
}
|
|
1710
|
+
ee(() => {
|
|
1711
|
+
var s;
|
|
1712
|
+
(s = n.value) != null && s.complete && a();
|
|
1713
|
+
});
|
|
1714
|
+
const o = U(t);
|
|
1715
|
+
return (s, i) => (h(), b("div", {
|
|
1716
|
+
style: C({
|
|
1717
|
+
height: s.height,
|
|
1718
|
+
width: s.width,
|
|
1719
|
+
maxHeight: s.maxHeight,
|
|
1720
|
+
maxWidth: s.maxWidth
|
|
1721
|
+
})
|
|
1722
|
+
}, [
|
|
1723
|
+
s.src ? (h(), P(ue(s.is), xe({
|
|
1724
|
+
key: 0,
|
|
1725
|
+
ref_key: "img",
|
|
1726
|
+
ref: n,
|
|
1727
|
+
style: [
|
|
1728
|
+
s.style,
|
|
1729
|
+
u(o).style
|
|
1730
|
+
],
|
|
1731
|
+
src: s.src,
|
|
1732
|
+
class: ["h-full w-full object-cover", [
|
|
1733
|
+
t.class,
|
|
1734
|
+
u(o).class,
|
|
1735
|
+
{
|
|
1736
|
+
hidden: !u(r)
|
|
1737
|
+
}
|
|
1738
|
+
]]
|
|
1739
|
+
}, s.$attrs, { onLoad: a }), null, 16, ["style", "src", "class"])) : T("", !0),
|
|
1740
|
+
u(r) ? T("", !0) : (h(), b("div", {
|
|
1741
|
+
key: 1,
|
|
1742
|
+
class: y(["h-full w-full animate-pulse border-transparent bg-surface-high object-cover", [
|
|
1743
|
+
t.class,
|
|
1744
|
+
u(o).class
|
|
1745
|
+
]]),
|
|
1746
|
+
style: C([
|
|
1747
|
+
s.style,
|
|
1748
|
+
u(o).style
|
|
1749
|
+
])
|
|
1750
|
+
}, null, 6))
|
|
1751
|
+
], 4));
|
|
1752
|
+
}
|
|
1753
|
+
}), Wr = { class: "relative" }, Xn = /* @__PURE__ */ x({
|
|
1754
|
+
__name: "Indicator",
|
|
1755
|
+
props: {
|
|
1756
|
+
color: { default: "primary" },
|
|
1757
|
+
size: { default: "md" },
|
|
1758
|
+
position: { default: "top-right" },
|
|
1759
|
+
ping: { type: Boolean }
|
|
1760
|
+
},
|
|
1761
|
+
setup(e) {
|
|
1762
|
+
const t = e, r = m(() => {
|
|
1763
|
+
switch (t.size) {
|
|
1764
|
+
case "sm":
|
|
1765
|
+
return "w-2 h-2";
|
|
1766
|
+
case "md":
|
|
1767
|
+
return "w-3 h-3";
|
|
1768
|
+
case "lg":
|
|
1769
|
+
return "w-4 h-4";
|
|
1770
|
+
default:
|
|
1771
|
+
return typeof t.size == "number" || !Number.isNaN(Number(t.size)) ? `w-${t.size} h-${t.size}` : t.size;
|
|
1772
|
+
}
|
|
1773
|
+
}), n = nt(), a = m(() => {
|
|
1774
|
+
if (!n.label)
|
|
1775
|
+
return "";
|
|
1776
|
+
switch (t.size) {
|
|
1777
|
+
case "sm":
|
|
1778
|
+
return "text-sm children:px-1.5";
|
|
1779
|
+
case "md":
|
|
1780
|
+
return "text-md children:px-2";
|
|
1781
|
+
case "lg":
|
|
1782
|
+
return "text-lg children:px-2.5";
|
|
1783
|
+
}
|
|
1784
|
+
}), o = m(() => {
|
|
1785
|
+
switch (t.position) {
|
|
1786
|
+
case "top-left":
|
|
1787
|
+
return "top-0 left-0 -translate-x-1/2 -translate-y-1/2";
|
|
1788
|
+
case "top-right":
|
|
1789
|
+
return "top-0 right-0 translate-x-1/2 -translate-y-1/2";
|
|
1790
|
+
case "bottom-left":
|
|
1791
|
+
return "bottom-0 left-0 -translate-x-1/2 translate-y-1/2";
|
|
1792
|
+
case "bottom-right":
|
|
1793
|
+
return "bottom-0 right-0 translate-x-1/2 translate-y-1/2";
|
|
1794
|
+
}
|
|
1795
|
+
}), s = m(() => {
|
|
1796
|
+
switch (t.color) {
|
|
1797
|
+
case "primary":
|
|
1798
|
+
return "bg-primary-container text-primary-on";
|
|
1799
|
+
case "secondary":
|
|
1800
|
+
return "bg-secondary-container text-secondary-on";
|
|
1801
|
+
case "tertiary":
|
|
1802
|
+
return "bg-tertiary-container text-tertiary-on";
|
|
1803
|
+
case "error":
|
|
1804
|
+
return "bg-error-container text-error-on";
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
return (i, l) => (h(), b("div", Wr, [
|
|
1808
|
+
w("div", {
|
|
1809
|
+
class: y([[u(o), u(a)], "absolute z-1"])
|
|
1810
|
+
}, [
|
|
1811
|
+
t.ping ? (h(), b("div", {
|
|
1812
|
+
key: 0,
|
|
1813
|
+
class: y(["absolute box-content animate-ping border-2 border-transparent rounded-full", [
|
|
1814
|
+
{
|
|
1815
|
+
[u(r)]: !i.$slots.label
|
|
1816
|
+
},
|
|
1817
|
+
u(s)
|
|
1818
|
+
]])
|
|
1819
|
+
}, [
|
|
1820
|
+
i.$slots.label ? k(i.$slots, "label", { key: 0 }) : T("", !0)
|
|
1821
|
+
], 2)) : T("", !0),
|
|
1822
|
+
w("div", {
|
|
1823
|
+
class: y(["top-0 box-content border-2 border-surface-low rounded-full", [
|
|
1824
|
+
{
|
|
1825
|
+
[u(r)]: !i.$slots.label
|
|
1826
|
+
},
|
|
1827
|
+
u(s)
|
|
1828
|
+
]])
|
|
1829
|
+
}, [
|
|
1830
|
+
i.$slots.label ? k(i.$slots, "label", { key: 0 }) : T("", !0)
|
|
1831
|
+
], 2)
|
|
1832
|
+
], 2),
|
|
1833
|
+
k(i.$slots, "default")
|
|
1834
|
+
]));
|
|
1835
|
+
}
|
|
1836
|
+
}), Yn = /* @__PURE__ */ x({
|
|
1837
|
+
__name: "Modal",
|
|
1838
|
+
props: /* @__PURE__ */ W({
|
|
1839
|
+
persistent: { type: Boolean, default: !1 },
|
|
1840
|
+
blur: { type: [String, Boolean], default: !1 }
|
|
1841
|
+
}, {
|
|
1842
|
+
modelValue: { type: Boolean },
|
|
1843
|
+
modelModifiers: {}
|
|
1844
|
+
}),
|
|
1845
|
+
emits: ["update:modelValue"],
|
|
1846
|
+
setup(e) {
|
|
1847
|
+
const t = e, r = j(e, "modelValue");
|
|
1848
|
+
return (n, a) => {
|
|
1849
|
+
const o = dt;
|
|
1850
|
+
return h(), P(o, {
|
|
1851
|
+
modelValue: r.value,
|
|
1852
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => r.value = s),
|
|
1853
|
+
blur: t.blur,
|
|
1854
|
+
persistent: t.persistent,
|
|
1855
|
+
"wrapper-class": "flex items-end justify-center"
|
|
1856
|
+
}, {
|
|
1857
|
+
default: L(() => [
|
|
1858
|
+
Z(rt, {
|
|
1859
|
+
"enter-from-class": "translate-y-1/2",
|
|
1860
|
+
"enter-to-class": "translate-y-0",
|
|
1861
|
+
"leave-from-class": "translate-y-0",
|
|
1862
|
+
"leave-to-class": "translate-y-1/2",
|
|
1863
|
+
"enter-active-class": "transition ease-out duration-300",
|
|
1864
|
+
"leave-active-class": "transition ease-in duration-200"
|
|
1865
|
+
}, {
|
|
1866
|
+
default: L(() => [
|
|
1867
|
+
r.value ? k(n.$slots, "default", { key: 0 }) : T("", !0)
|
|
1868
|
+
]),
|
|
1869
|
+
_: 3
|
|
1870
|
+
})
|
|
1871
|
+
]),
|
|
1872
|
+
_: 3
|
|
1873
|
+
}, 8, ["modelValue", "blur", "persistent"]);
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
}), jr = {
|
|
1877
|
+
key: 0,
|
|
1878
|
+
class: "h-container w-container i-tabler-loader-2 shrink-0 animate-spin"
|
|
1879
|
+
}, Ur = { key: 1 }, Gr = { class: "grow-1" }, qr = {
|
|
1880
|
+
key: 2,
|
|
1881
|
+
class: "text-sm text-surface-onlow"
|
|
1882
|
+
}, Xr = /* @__PURE__ */ w("i", { class: "i-tabler-x" }, null, -1), Yr = /* @__PURE__ */ x({
|
|
1883
|
+
__name: "Notification",
|
|
1884
|
+
props: {
|
|
1885
|
+
title: {},
|
|
1886
|
+
message: {},
|
|
1887
|
+
icon: {},
|
|
1888
|
+
loading: { type: Boolean },
|
|
1889
|
+
withBorder: { type: Boolean },
|
|
1890
|
+
closeable: { type: Boolean },
|
|
1891
|
+
rounded: { default: "md" },
|
|
1892
|
+
block: { type: Boolean, default: !1 },
|
|
1893
|
+
color: { default: "primary" }
|
|
1894
|
+
},
|
|
1895
|
+
emits: ["close"],
|
|
1896
|
+
setup(e) {
|
|
1897
|
+
const t = e, r = U(t), n = m(() => {
|
|
1898
|
+
switch (t.color) {
|
|
1899
|
+
case "secondary":
|
|
1900
|
+
return "bg-secondary-container";
|
|
1901
|
+
case "tertiary":
|
|
1902
|
+
return "bg-tertiary-container";
|
|
1903
|
+
case "error":
|
|
1904
|
+
return "bg-error-container";
|
|
1905
|
+
default:
|
|
1906
|
+
return "bg-primary-container";
|
|
1907
|
+
}
|
|
1908
|
+
}), a = m(() => {
|
|
1909
|
+
switch (t.color) {
|
|
1910
|
+
case "secondary":
|
|
1911
|
+
return "text-secondary-container";
|
|
1912
|
+
case "tertiary":
|
|
1913
|
+
return "text-tertiary-container";
|
|
1914
|
+
case "error":
|
|
1915
|
+
return "text-error-container";
|
|
1916
|
+
default:
|
|
1917
|
+
return "text-primary-container";
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
return (o, s) => {
|
|
1921
|
+
const i = at;
|
|
1922
|
+
return h(), b("div", {
|
|
1923
|
+
class: y(["relative min-h-16 min-w-80 w-full flex items-center gap-2 container-low p-3", [
|
|
1924
|
+
{ "border-0": !o.withBorder },
|
|
1925
|
+
u(r).class,
|
|
1926
|
+
{
|
|
1927
|
+
"max-w-100": !o.block,
|
|
1928
|
+
"w-full": o.block
|
|
1929
|
+
}
|
|
1930
|
+
]]),
|
|
1931
|
+
style: C(u(r).style)
|
|
1932
|
+
}, [
|
|
1933
|
+
o.icon ? (h(), b("div", {
|
|
1934
|
+
key: 0,
|
|
1935
|
+
class: y(["leading-0", u(a)])
|
|
1936
|
+
}, [
|
|
1937
|
+
o.loading ? (h(), b("i", jr)) : (h(), b("i", {
|
|
1938
|
+
key: 1,
|
|
1939
|
+
class: y(["h-container w-container shrink-0", o.icon])
|
|
1940
|
+
}, null, 2))
|
|
1941
|
+
], 2)) : (h(), b("div", Ur, [
|
|
1942
|
+
w("div", {
|
|
1943
|
+
class: y(["absolute left-[0.25rem] top-[0.25rem] h-[calc(100%-0.5rem)] w-1 rounded-full", [{
|
|
1944
|
+
"animate-pulse": o.loading
|
|
1945
|
+
}, u(n)]])
|
|
1946
|
+
}, null, 2)
|
|
1947
|
+
])),
|
|
1948
|
+
w("div", Gr, [
|
|
1949
|
+
o.title ? (h(), b("div", {
|
|
1950
|
+
key: 0,
|
|
1951
|
+
class: y([u(a), "text-base"])
|
|
1952
|
+
}, se(o.title), 3)) : T("", !0),
|
|
1953
|
+
o.$slots.message ? k(o.$slots, "message", { key: 1 }) : o.message ? (h(), b("div", qr, se(o.message), 1)) : T("", !0)
|
|
1954
|
+
]),
|
|
1955
|
+
o.closeable ? (h(), P(i, {
|
|
1956
|
+
key: 2,
|
|
1957
|
+
icon: "",
|
|
1958
|
+
variant: "transparent",
|
|
1959
|
+
class: "text-surface-on hover:text-surface-on",
|
|
1960
|
+
onClick: s[0] || (s[0] = (l) => o.$emit("close"))
|
|
1961
|
+
}, {
|
|
1962
|
+
default: L(() => [
|
|
1963
|
+
Xr
|
|
1964
|
+
]),
|
|
1965
|
+
_: 1
|
|
1966
|
+
})) : T("", !0)
|
|
1967
|
+
], 6);
|
|
1968
|
+
};
|
|
1969
|
+
}
|
|
1970
|
+
}), ft = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakSet();
|
|
1971
|
+
let J, Fe = 0, Le = 0;
|
|
1972
|
+
const q = "__aa_tgt", we = "__aa_del", Ae = "__aa_new", Kr = (e) => {
|
|
1973
|
+
const t = rn(e);
|
|
1974
|
+
t && t.forEach((r) => nn(r));
|
|
1975
|
+
}, Qr = (e) => {
|
|
1976
|
+
e.forEach((t) => {
|
|
1977
|
+
t.target === J && en(), O.has(t.target) && oe(t.target);
|
|
1978
|
+
});
|
|
1979
|
+
};
|
|
1980
|
+
function Jr(e) {
|
|
1981
|
+
const t = Ne.get(e);
|
|
1982
|
+
t == null || t.disconnect();
|
|
1983
|
+
let r = O.get(e), n = 0;
|
|
1984
|
+
const a = 5;
|
|
1985
|
+
r || (r = ce(e), O.set(e, r));
|
|
1986
|
+
const { offsetWidth: o, offsetHeight: s } = J, l = [
|
|
1987
|
+
r.top - a,
|
|
1988
|
+
o - (r.left + a + r.width),
|
|
1989
|
+
s - (r.top + a + r.height),
|
|
1990
|
+
r.left - a
|
|
1991
|
+
].map((d) => `${-1 * Math.floor(d)}px`).join(" "), c = new IntersectionObserver(() => {
|
|
1992
|
+
++n > 1 && oe(e);
|
|
1993
|
+
}, {
|
|
1994
|
+
root: J,
|
|
1995
|
+
threshold: 1,
|
|
1996
|
+
rootMargin: l
|
|
1997
|
+
});
|
|
1998
|
+
c.observe(e), Ne.set(e, c);
|
|
1999
|
+
}
|
|
2000
|
+
function oe(e) {
|
|
2001
|
+
clearTimeout(Ce.get(e));
|
|
2002
|
+
const t = Re(e), r = _e(t) ? 500 : t.duration;
|
|
2003
|
+
Ce.set(e, setTimeout(async () => {
|
|
2004
|
+
const n = ne.get(e);
|
|
2005
|
+
try {
|
|
2006
|
+
await (n == null ? void 0 : n.finished), O.set(e, ce(e)), Jr(e);
|
|
2007
|
+
} catch {
|
|
2008
|
+
}
|
|
2009
|
+
}, r));
|
|
2010
|
+
}
|
|
2011
|
+
function en() {
|
|
2012
|
+
clearTimeout(Ce.get(J)), Ce.set(J, setTimeout(() => {
|
|
2013
|
+
ft.forEach((e) => vt(e, (t) => ht(() => oe(t))));
|
|
2014
|
+
}, 100));
|
|
2015
|
+
}
|
|
2016
|
+
function tn(e) {
|
|
2017
|
+
setTimeout(() => {
|
|
2018
|
+
Zr.set(e, setInterval(() => ht(oe.bind(null, e)), 2e3));
|
|
2019
|
+
}, Math.round(2e3 * Math.random()));
|
|
2020
|
+
}
|
|
2021
|
+
function ht(e) {
|
|
2022
|
+
typeof requestIdleCallback == "function" ? requestIdleCallback(() => e()) : requestAnimationFrame(() => e());
|
|
2023
|
+
}
|
|
2024
|
+
let Pe, ae;
|
|
2025
|
+
typeof window < "u" && (J = document.documentElement, Pe = new MutationObserver(Kr), ae = new ResizeObserver(Qr), window.addEventListener("scroll", () => {
|
|
2026
|
+
Le = window.scrollY, Fe = window.scrollX;
|
|
2027
|
+
}), ae.observe(J));
|
|
2028
|
+
function rn(e) {
|
|
2029
|
+
return e.reduce((n, a) => [
|
|
2030
|
+
...n,
|
|
2031
|
+
...Array.from(a.addedNodes),
|
|
2032
|
+
...Array.from(a.removedNodes)
|
|
2033
|
+
], []).every((n) => n.nodeName === "#comment") ? !1 : e.reduce((n, a) => {
|
|
2034
|
+
if (n === !1)
|
|
2035
|
+
return !1;
|
|
2036
|
+
if (a.target instanceof Element) {
|
|
2037
|
+
if (Oe(a.target), !n.has(a.target)) {
|
|
2038
|
+
n.add(a.target);
|
|
2039
|
+
for (let o = 0; o < a.target.children.length; o++) {
|
|
2040
|
+
const s = a.target.children.item(o);
|
|
2041
|
+
if (s) {
|
|
2042
|
+
if (we in s)
|
|
2043
|
+
return !1;
|
|
2044
|
+
Oe(a.target, s), n.add(s);
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
if (a.removedNodes.length)
|
|
2049
|
+
for (let o = 0; o < a.removedNodes.length; o++) {
|
|
2050
|
+
const s = a.removedNodes[o];
|
|
2051
|
+
if (we in s)
|
|
2052
|
+
return !1;
|
|
2053
|
+
s instanceof Element && (n.add(s), Oe(a.target, s), le.set(s, [
|
|
2054
|
+
a.previousSibling,
|
|
2055
|
+
a.nextSibling
|
|
2056
|
+
]));
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
return n;
|
|
2060
|
+
}, /* @__PURE__ */ new Set());
|
|
2061
|
+
}
|
|
2062
|
+
function Oe(e, t) {
|
|
2063
|
+
!t && !(q in e) ? Object.defineProperty(e, q, { value: e }) : t && !(q in t) && Object.defineProperty(t, q, { value: e });
|
|
2064
|
+
}
|
|
2065
|
+
function nn(e) {
|
|
2066
|
+
var t;
|
|
2067
|
+
const r = e.isConnected, n = O.has(e);
|
|
2068
|
+
r && le.has(e) && le.delete(e), ne.has(e) && ((t = ne.get(e)) === null || t === void 0 || t.cancel()), Ae in e ? Qe(e) : n && r ? an(e) : n && !r ? sn(e) : Qe(e);
|
|
2069
|
+
}
|
|
2070
|
+
function F(e) {
|
|
2071
|
+
return Number(e.replace(/[^0-9.\-]/g, ""));
|
|
2072
|
+
}
|
|
2073
|
+
function on(e) {
|
|
2074
|
+
let t = e.parentElement;
|
|
2075
|
+
for (; t; ) {
|
|
2076
|
+
if (t.scrollLeft || t.scrollTop)
|
|
2077
|
+
return { x: t.scrollLeft, y: t.scrollTop };
|
|
2078
|
+
t = t.parentElement;
|
|
2079
|
+
}
|
|
2080
|
+
return { x: 0, y: 0 };
|
|
2081
|
+
}
|
|
2082
|
+
function ce(e) {
|
|
2083
|
+
const t = e.getBoundingClientRect(), { x: r, y: n } = on(e);
|
|
2084
|
+
return {
|
|
2085
|
+
top: t.top + n,
|
|
2086
|
+
left: t.left + r,
|
|
2087
|
+
width: t.width,
|
|
2088
|
+
height: t.height
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
function pt(e, t, r) {
|
|
2092
|
+
let n = t.width, a = t.height, o = r.width, s = r.height;
|
|
2093
|
+
const i = getComputedStyle(e);
|
|
2094
|
+
if (i.getPropertyValue("box-sizing") === "content-box") {
|
|
2095
|
+
const c = F(i.paddingTop) + F(i.paddingBottom) + F(i.borderTopWidth) + F(i.borderBottomWidth), d = F(i.paddingLeft) + F(i.paddingRight) + F(i.borderRightWidth) + F(i.borderLeftWidth);
|
|
2096
|
+
n -= d, o -= d, a -= c, s -= c;
|
|
2097
|
+
}
|
|
2098
|
+
return [n, o, a, s].map(Math.round);
|
|
2099
|
+
}
|
|
2100
|
+
function Re(e) {
|
|
2101
|
+
return q in e && ie.has(e[q]) ? ie.get(e[q]) : { duration: 250, easing: "ease-in-out" };
|
|
2102
|
+
}
|
|
2103
|
+
function mt(e) {
|
|
2104
|
+
if (q in e)
|
|
2105
|
+
return e[q];
|
|
2106
|
+
}
|
|
2107
|
+
function We(e) {
|
|
2108
|
+
const t = mt(e);
|
|
2109
|
+
return t ? ve.has(t) : !1;
|
|
2110
|
+
}
|
|
2111
|
+
function vt(e, ...t) {
|
|
2112
|
+
t.forEach((r) => r(e, ie.has(e)));
|
|
2113
|
+
for (let r = 0; r < e.children.length; r++) {
|
|
2114
|
+
const n = e.children.item(r);
|
|
2115
|
+
n && t.forEach((a) => a(n, ie.has(n)));
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
function je(e) {
|
|
2119
|
+
return Array.isArray(e) ? e : [e];
|
|
2120
|
+
}
|
|
2121
|
+
function _e(e) {
|
|
2122
|
+
return typeof e == "function";
|
|
2123
|
+
}
|
|
2124
|
+
function an(e) {
|
|
2125
|
+
const t = O.get(e), r = ce(e);
|
|
2126
|
+
if (!We(e))
|
|
2127
|
+
return O.set(e, r);
|
|
2128
|
+
let n;
|
|
2129
|
+
if (!t)
|
|
2130
|
+
return;
|
|
2131
|
+
const a = Re(e);
|
|
2132
|
+
if (typeof a != "function") {
|
|
2133
|
+
const o = t.left - r.left, s = t.top - r.top, [i, l, c, d] = pt(e, t, r), f = {
|
|
2134
|
+
transform: `translate(${o}px, ${s}px)`
|
|
2135
|
+
}, v = {
|
|
2136
|
+
transform: "translate(0, 0)"
|
|
2137
|
+
};
|
|
2138
|
+
i !== l && (f.width = `${i}px`, v.width = `${l}px`), c !== d && (f.height = `${c}px`, v.height = `${d}px`), n = e.animate([f, v], {
|
|
2139
|
+
duration: a.duration,
|
|
2140
|
+
easing: a.easing
|
|
2141
|
+
});
|
|
2142
|
+
} else {
|
|
2143
|
+
const [o] = je(a(e, "remain", t, r));
|
|
2144
|
+
n = new Animation(o), n.play();
|
|
2145
|
+
}
|
|
2146
|
+
ne.set(e, n), O.set(e, r), n.addEventListener("finish", oe.bind(null, e));
|
|
2147
|
+
}
|
|
2148
|
+
function Qe(e) {
|
|
2149
|
+
Ae in e && delete e[Ae];
|
|
2150
|
+
const t = ce(e);
|
|
2151
|
+
O.set(e, t);
|
|
2152
|
+
const r = Re(e);
|
|
2153
|
+
if (!We(e))
|
|
2154
|
+
return;
|
|
2155
|
+
let n;
|
|
2156
|
+
if (typeof r != "function")
|
|
2157
|
+
n = e.animate([
|
|
2158
|
+
{ transform: "scale(.98)", opacity: 0 },
|
|
2159
|
+
{ transform: "scale(0.98)", opacity: 0, offset: 0.5 },
|
|
2160
|
+
{ transform: "scale(1)", opacity: 1 }
|
|
2161
|
+
], {
|
|
2162
|
+
duration: r.duration * 1.5,
|
|
2163
|
+
easing: "ease-in"
|
|
2164
|
+
});
|
|
2165
|
+
else {
|
|
2166
|
+
const [a] = je(r(e, "add", t));
|
|
2167
|
+
n = new Animation(a), n.play();
|
|
2168
|
+
}
|
|
2169
|
+
ne.set(e, n), n.addEventListener("finish", oe.bind(null, e));
|
|
2170
|
+
}
|
|
2171
|
+
function Je(e, t) {
|
|
2172
|
+
var r;
|
|
2173
|
+
e.remove(), O.delete(e), le.delete(e), ne.delete(e), (r = Ne.get(e)) === null || r === void 0 || r.disconnect(), setTimeout(() => {
|
|
2174
|
+
if (we in e && delete e[we], Object.defineProperty(e, Ae, { value: !0, configurable: !0 }), t && e instanceof HTMLElement)
|
|
2175
|
+
for (const n in t)
|
|
2176
|
+
e.style[n] = "";
|
|
2177
|
+
}, 0);
|
|
2178
|
+
}
|
|
2179
|
+
function sn(e) {
|
|
2180
|
+
var t;
|
|
2181
|
+
if (!le.has(e) || !O.has(e))
|
|
2182
|
+
return;
|
|
2183
|
+
const [r, n] = le.get(e);
|
|
2184
|
+
Object.defineProperty(e, we, { value: !0, configurable: !0 });
|
|
2185
|
+
const a = window.scrollX, o = window.scrollY;
|
|
2186
|
+
if (n && n.parentNode && n.parentNode instanceof Element ? n.parentNode.insertBefore(e, n) : r && r.parentNode ? r.parentNode.appendChild(e) : (t = mt(e)) === null || t === void 0 || t.appendChild(e), !We(e))
|
|
2187
|
+
return Je(e);
|
|
2188
|
+
const [s, i, l, c] = cn(e), d = Re(e), f = O.get(e);
|
|
2189
|
+
(a !== Fe || o !== Le) && ln(e, a, o, d);
|
|
2190
|
+
let v, S = {
|
|
2191
|
+
position: "absolute",
|
|
2192
|
+
top: `${s}px`,
|
|
2193
|
+
left: `${i}px`,
|
|
2194
|
+
width: `${l}px`,
|
|
2195
|
+
height: `${c}px`,
|
|
2196
|
+
margin: "0",
|
|
2197
|
+
pointerEvents: "none",
|
|
2198
|
+
transformOrigin: "center",
|
|
2199
|
+
zIndex: "100"
|
|
2200
|
+
};
|
|
2201
|
+
if (!_e(d))
|
|
2202
|
+
Object.assign(e.style, S), v = e.animate([
|
|
2203
|
+
{
|
|
2204
|
+
transform: "scale(1)",
|
|
2205
|
+
opacity: 1
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
transform: "scale(.98)",
|
|
2209
|
+
opacity: 0
|
|
2210
|
+
}
|
|
2211
|
+
], { duration: d.duration, easing: "ease-out" });
|
|
2212
|
+
else {
|
|
2213
|
+
const [A, z] = je(d(e, "remove", f));
|
|
2214
|
+
(z == null ? void 0 : z.styleReset) !== !1 && (S = (z == null ? void 0 : z.styleReset) || S, Object.assign(e.style, S)), v = new Animation(A), v.play();
|
|
2215
|
+
}
|
|
2216
|
+
ne.set(e, v), v.addEventListener("finish", Je.bind(null, e, S));
|
|
2217
|
+
}
|
|
2218
|
+
function ln(e, t, r, n) {
|
|
2219
|
+
const a = Fe - t, o = Le - r, s = document.documentElement.style.scrollBehavior;
|
|
2220
|
+
if (getComputedStyle(J).scrollBehavior === "smooth" && (document.documentElement.style.scrollBehavior = "auto"), window.scrollTo(window.scrollX + a, window.scrollY + o), !e.parentElement)
|
|
2221
|
+
return;
|
|
2222
|
+
const l = e.parentElement;
|
|
2223
|
+
let c = l.clientHeight, d = l.clientWidth;
|
|
2224
|
+
const f = performance.now();
|
|
2225
|
+
function v() {
|
|
2226
|
+
requestAnimationFrame(() => {
|
|
2227
|
+
if (!_e(n)) {
|
|
2228
|
+
const S = c - l.clientHeight, A = d - l.clientWidth;
|
|
2229
|
+
f + n.duration > performance.now() ? (window.scrollTo({
|
|
2230
|
+
left: window.scrollX - A,
|
|
2231
|
+
top: window.scrollY - S
|
|
2232
|
+
}), c = l.clientHeight, d = l.clientWidth, v()) : document.documentElement.style.scrollBehavior = s;
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
v();
|
|
2237
|
+
}
|
|
2238
|
+
function cn(e) {
|
|
2239
|
+
const t = O.get(e), [r, , n] = pt(e, t, ce(e));
|
|
2240
|
+
let a = e.parentElement;
|
|
2241
|
+
for (; a && (getComputedStyle(a).position === "static" || a instanceof HTMLBodyElement); )
|
|
2242
|
+
a = a.parentElement;
|
|
2243
|
+
a || (a = document.body);
|
|
2244
|
+
const o = getComputedStyle(a), s = O.get(a) || ce(a), i = Math.round(t.top - s.top) - F(o.borderTopWidth), l = Math.round(t.left - s.left) - F(o.borderLeftWidth);
|
|
2245
|
+
return [i, l, r, n];
|
|
2246
|
+
}
|
|
2247
|
+
function un(e, t = {}) {
|
|
2248
|
+
return Pe && ae && (window.matchMedia("(prefers-reduced-motion: reduce)").matches && !_e(t) && !t.disrespectUserMotionPreference || (ve.add(e), getComputedStyle(e).position === "static" && Object.assign(e.style, { position: "relative" }), vt(e, oe, tn, (a) => ae == null ? void 0 : ae.observe(a)), _e(t) ? ie.set(e, t) : ie.set(e, { duration: 250, easing: "ease-in-out", ...t }), Pe.observe(e, { childList: !0 }), ft.add(e))), Object.freeze({
|
|
2249
|
+
parent: e,
|
|
2250
|
+
enable: () => {
|
|
2251
|
+
ve.add(e);
|
|
2252
|
+
},
|
|
2253
|
+
disable: () => {
|
|
2254
|
+
ve.delete(e);
|
|
2255
|
+
},
|
|
2256
|
+
isEnabled: () => ve.has(e)
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
const dn = {
|
|
2260
|
+
mounted: (e, t) => {
|
|
2261
|
+
un(e, t.value || {});
|
|
2262
|
+
},
|
|
2263
|
+
// ignore ssr see #96:
|
|
2264
|
+
getSSRProps: () => ({})
|
|
2265
|
+
}, fn = { class: "fixed z-20 flex flex-col gap-2 p-2" }, Zn = /* @__PURE__ */ x({
|
|
2266
|
+
__name: "NotificationSystem",
|
|
2267
|
+
setup(e) {
|
|
2268
|
+
const t = gn();
|
|
2269
|
+
return (r, n) => {
|
|
2270
|
+
const a = Yr;
|
|
2271
|
+
return Te((h(), b("div", fn, [
|
|
2272
|
+
(h(!0), b(K, null, ye(u(t), (o) => (h(), P(a, {
|
|
2273
|
+
key: o.hash,
|
|
2274
|
+
closeable: "",
|
|
2275
|
+
"with-border": "",
|
|
2276
|
+
title: o.title,
|
|
2277
|
+
message: o.message,
|
|
2278
|
+
icon: o.icon,
|
|
2279
|
+
loading: o.loading,
|
|
2280
|
+
color: o.color,
|
|
2281
|
+
onClose: (s) => u(t).splice(u(t).indexOf(o), 1)
|
|
2282
|
+
}, null, 8, ["title", "message", "icon", "loading", "color", "onClose"]))), 128))
|
|
2283
|
+
])), [
|
|
2284
|
+
[u(dn)]
|
|
2285
|
+
]);
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2288
|
+
}), hn = { class: "relative" }, Kn = /* @__PURE__ */ x({
|
|
2289
|
+
__name: "Overlay",
|
|
2290
|
+
props: {
|
|
2291
|
+
blur: { type: [Boolean, String], default: !1 },
|
|
2292
|
+
rounded: { default: "none" },
|
|
2293
|
+
opacity: { default: 30 },
|
|
2294
|
+
color: { default: "black" }
|
|
2295
|
+
},
|
|
2296
|
+
setup(e) {
|
|
2297
|
+
const t = e, r = m(() => {
|
|
2298
|
+
switch (t.blur) {
|
|
2299
|
+
case "sm":
|
|
2300
|
+
return "backdrop-blur-sm";
|
|
2301
|
+
case "md":
|
|
2302
|
+
case !0:
|
|
2303
|
+
return "backdrop-blur-md";
|
|
2304
|
+
case "lg":
|
|
2305
|
+
return "backdrop-blur-lg";
|
|
2306
|
+
default:
|
|
2307
|
+
return "";
|
|
2308
|
+
}
|
|
2309
|
+
}), n = U(t), a = g(null), o = p(t.color).toRgb(), s = m(() => ({
|
|
2310
|
+
backgroundColor: `rgba(${o.r}, ${o.g}, ${o.b}, ${t.opacity / 100})`
|
|
2311
|
+
}));
|
|
2312
|
+
return (i, l) => (h(), b("div", hn, [
|
|
2313
|
+
k(i.$slots, "default"),
|
|
2314
|
+
w("div", xe(i.$attrs, {
|
|
2315
|
+
ref_key: "wrapperRef",
|
|
2316
|
+
ref: a,
|
|
2317
|
+
class: [[u(r), u(n).class], "absolute left-0 top-0 h-full w-full overflow-hidden md:items-center"],
|
|
2318
|
+
style: [u(n).style, u(s)]
|
|
2319
|
+
}), [
|
|
2320
|
+
k(i.$slots, "content")
|
|
2321
|
+
], 16)
|
|
2322
|
+
]));
|
|
2323
|
+
}
|
|
2324
|
+
}), Qn = /* @__PURE__ */ x({
|
|
2325
|
+
__name: "Paper",
|
|
2326
|
+
props: {
|
|
2327
|
+
size: { default: "md" },
|
|
2328
|
+
rounded: { default: "md" },
|
|
2329
|
+
withBorder: { type: Boolean, default: !1 },
|
|
2330
|
+
is: { default: "div" }
|
|
2331
|
+
},
|
|
2332
|
+
setup(e) {
|
|
2333
|
+
const r = U(e);
|
|
2334
|
+
return (n, a) => (h(), P(ue(n.is), {
|
|
2335
|
+
class: y(["container-low rounded-lg p-4", [
|
|
2336
|
+
{
|
|
2337
|
+
"border-transparent": !n.withBorder
|
|
2338
|
+
},
|
|
2339
|
+
u(r).class
|
|
2340
|
+
]]),
|
|
2341
|
+
style: C([u(r).style])
|
|
2342
|
+
}, {
|
|
2343
|
+
default: L(() => [
|
|
2344
|
+
k(n.$slots, "default")
|
|
2345
|
+
]),
|
|
2346
|
+
_: 3
|
|
2347
|
+
}, 8, ["class", "style"]));
|
|
2348
|
+
}
|
|
2349
|
+
}), pn = ["placeholder", "type"], mn = /* @__PURE__ */ x({
|
|
2350
|
+
__name: "TextField",
|
|
2351
|
+
props: /* @__PURE__ */ W({
|
|
2352
|
+
onChange: {},
|
|
2353
|
+
color: { default: "primary" },
|
|
2354
|
+
error: { type: Boolean },
|
|
2355
|
+
disabled: { type: Boolean },
|
|
2356
|
+
rounded: { default: "md" },
|
|
2357
|
+
size: { default: "md" },
|
|
2358
|
+
password: { type: Boolean },
|
|
2359
|
+
placeholder: {}
|
|
2360
|
+
}, {
|
|
2361
|
+
modelValue: {},
|
|
2362
|
+
modelModifiers: {}
|
|
2363
|
+
}),
|
|
2364
|
+
emits: ["update:modelValue"],
|
|
2365
|
+
setup(e, { expose: t }) {
|
|
2366
|
+
const r = e, n = j(e, "modelValue"), a = m(() => {
|
|
2367
|
+
switch (r.size) {
|
|
2368
|
+
case "sm":
|
|
2369
|
+
return {
|
|
2370
|
+
base: "h-6 px-2 py-1 text-xs"
|
|
2371
|
+
};
|
|
2372
|
+
case "md":
|
|
2373
|
+
return {
|
|
2374
|
+
base: "h-8 px-3 py-1 text-sm"
|
|
2375
|
+
};
|
|
2376
|
+
case "lg":
|
|
2377
|
+
return {
|
|
2378
|
+
base: "h-10 px-4 py-2 text-base"
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
}), o = m(() => {
|
|
2382
|
+
if (r.error)
|
|
2383
|
+
return "text-error-container bg-surface-base border-error-container focus:border-error-container";
|
|
2384
|
+
switch (r.color) {
|
|
2385
|
+
case "secondary":
|
|
2386
|
+
return "text-surface-on bg-surface-base border-surface-border-base focus:border-secondary-container";
|
|
2387
|
+
case "tertiary":
|
|
2388
|
+
return "text-surface-on bg-surface-base border-surface-border-base focus:border-tertiary-container";
|
|
2389
|
+
case "error":
|
|
2390
|
+
return "text-surface-on bg-surface-base border-surface-border-base focus:border-error-container";
|
|
2391
|
+
case "primary":
|
|
2392
|
+
default:
|
|
2393
|
+
return "text-surface-on bg-surface-base border-surface-border-base focus:border-primary-container";
|
|
2394
|
+
}
|
|
2395
|
+
}), s = m(() => r.disabled ? "pointer-events-none filter grayscale opacity-60" : ""), i = U(r), l = g(null);
|
|
2396
|
+
return t({
|
|
2397
|
+
el: l
|
|
2398
|
+
}), (c, d) => Te((h(), b("input", {
|
|
2399
|
+
ref_key: "input",
|
|
2400
|
+
ref: l,
|
|
2401
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => n.value = f),
|
|
2402
|
+
class: y(["bg-back-2 border px-2 py-1 outline-none transition-background-color,border-color,color", [u(o), u(s), u(i).class, u(a).base]]),
|
|
2403
|
+
style: C([u(i).style]),
|
|
2404
|
+
placeholder: c.placeholder,
|
|
2405
|
+
type: r.password ? "password" : "text"
|
|
2406
|
+
}, null, 14, pn)), [
|
|
2407
|
+
[Tt, n.value]
|
|
2408
|
+
]);
|
|
2409
|
+
}
|
|
2410
|
+
}), vn = { class: "flex gap-2" }, Jn = /* @__PURE__ */ x({
|
|
2411
|
+
__name: "PinInput",
|
|
2412
|
+
props: {
|
|
2413
|
+
modelValue: {},
|
|
2414
|
+
length: { default: 6 },
|
|
2415
|
+
size: {},
|
|
2416
|
+
password: { type: Boolean }
|
|
2417
|
+
},
|
|
2418
|
+
setup(e) {
|
|
2419
|
+
const t = e, r = g([]);
|
|
2420
|
+
function n(o) {
|
|
2421
|
+
o.preventDefault(), o.stopPropagation();
|
|
2422
|
+
const s = r.value.findIndex((l) => l.el === o.target), i = o.target.value ?? "";
|
|
2423
|
+
o.target.value = "", Array.from(i).forEach((l, c) => {
|
|
2424
|
+
s + c >= r.value.length || (r.value[s + c].el.value = l, s + c + 1 < r.value.length ? (r.value[s + c + 1].el.focus(), r.value[s + c + 1].el.select()) : r.value[s + c].el.blur());
|
|
2425
|
+
});
|
|
2426
|
+
}
|
|
2427
|
+
function a(o) {
|
|
2428
|
+
o.preventDefault(), o.stopPropagation();
|
|
2429
|
+
const s = o.target.value !== "";
|
|
2430
|
+
o.target.value = "";
|
|
2431
|
+
const i = r.value.findIndex((l) => l.el === o.target);
|
|
2432
|
+
i !== 0 && (r.value[i - 1].el.focus(), r.value[i - 1].el.select(), s || (r.value[i - 1].el.value = ""));
|
|
2433
|
+
}
|
|
2434
|
+
return (o, s) => (h(), b("div", vn, [
|
|
2435
|
+
(h(!0), b(K, null, ye(t.length, (i) => (h(), P(mn, {
|
|
2436
|
+
ref_for: !0,
|
|
2437
|
+
ref_key: "inputs",
|
|
2438
|
+
ref: r,
|
|
2439
|
+
key: i,
|
|
2440
|
+
class: "w-8 text-center",
|
|
2441
|
+
style: { padding: "0" },
|
|
2442
|
+
password: t.password,
|
|
2443
|
+
onPointerup: s[0] || (s[0] = (l) => l.target.select()),
|
|
2444
|
+
onInput: ot(n, ["stop", "prevent"]),
|
|
2445
|
+
onKeydown: zt(a, ["backspace"])
|
|
2446
|
+
}, null, 8, ["password"]))), 128))
|
|
2447
|
+
]));
|
|
2448
|
+
}
|
|
2449
|
+
}), eo = /* @__PURE__ */ x({
|
|
2450
|
+
__name: "Progress",
|
|
2451
|
+
props: {
|
|
2452
|
+
value: { default: 0 },
|
|
2453
|
+
max: { default: 100 },
|
|
2454
|
+
min: { default: 0 },
|
|
2455
|
+
size: { default: "md" },
|
|
2456
|
+
color: { default: "primary" },
|
|
2457
|
+
rounded: { default: "full" },
|
|
2458
|
+
loading: { type: Boolean, default: !1 }
|
|
2459
|
+
},
|
|
2460
|
+
setup(e) {
|
|
2461
|
+
const t = e, r = m(() => {
|
|
2462
|
+
switch (t.size) {
|
|
2463
|
+
case "sm":
|
|
2464
|
+
return "h-0.25";
|
|
2465
|
+
case "md":
|
|
2466
|
+
return "h-0.5";
|
|
2467
|
+
case "lg":
|
|
2468
|
+
return "h-1";
|
|
2469
|
+
}
|
|
2470
|
+
}), n = m(() => {
|
|
2471
|
+
switch (t.color) {
|
|
2472
|
+
case "primary":
|
|
2473
|
+
return "bg-primary-container";
|
|
2474
|
+
case "secondary":
|
|
2475
|
+
return "bg-secondary-7";
|
|
2476
|
+
case "tertiary":
|
|
2477
|
+
return "bg-tertiary-7";
|
|
2478
|
+
case "error":
|
|
2479
|
+
return "bg-error-7";
|
|
2480
|
+
}
|
|
2481
|
+
}), a = U(t);
|
|
2482
|
+
return (o, s) => (h(), b("div", {
|
|
2483
|
+
class: y(["relative w-full self-center overflow-hidden bg-surface-high transition-background-color,border-color,color", [u(r), u(a).class]]),
|
|
2484
|
+
style: C([u(a).style])
|
|
2485
|
+
}, [
|
|
2486
|
+
o.loading ? (h(), b("div", {
|
|
2487
|
+
key: 1,
|
|
2488
|
+
class: y(["loading-progress h-full", [u(n)]])
|
|
2489
|
+
}, null, 2)) : (h(), b("div", {
|
|
2490
|
+
key: 0,
|
|
2491
|
+
class: y(["h-full", [u(n)]]),
|
|
2492
|
+
style: C([{
|
|
2493
|
+
width: `${(Number(o.value) - Number(o.min)) / (Number(o.max) - Number(o.min)) * 100}%`
|
|
2494
|
+
}])
|
|
2495
|
+
}, null, 6))
|
|
2496
|
+
], 6));
|
|
2497
|
+
}
|
|
2498
|
+
}), bt = {
|
|
2499
|
+
primary: ["#e5f7ff", "#d3ebfa", "#a9d4f1", "#7cbde9", "#57a9e0", "#3f9cdc", "#3096dc", "#1f82c4", "#0f73b0", "#00649c", "#082f49"],
|
|
2500
|
+
secondary: ["#e9fbf0", "#dcf1e3", "#badfc7", "#96cea9", "#77bf90", "#63b580", "#58b077", "#479a64", "#3b8a58", "#2c7749", "#022c22"],
|
|
2501
|
+
tertiary: ["#fff7e1", "#ffedcd", "#fcd99e", "#f9c46b", "#f7b23f", "#f6a724", "#f5a113", "#da8c04", "#c37d00", "#aa6a00", "#572508"],
|
|
2502
|
+
error: ["#ffeaea", "#fcd5d5", "#f2a8a9", "#ea7a7a", "#e25353", "#de3939", "#dd2b2b", "#c41e1f", "#af171a", "#9a0913", "#450a0a"],
|
|
2503
|
+
surface: ["#fefefe", "#fafafa", "#f2f2f2", "#e8e8e8", "#c6c6c6", "#737373", "#525252", "#343434", "#262626", "#171717", "#121212"]
|
|
2504
|
+
}, Ie = {
|
|
2505
|
+
name: "dark",
|
|
2506
|
+
scheme: "dark",
|
|
2507
|
+
colors: bt
|
|
2508
|
+
}, bn = {
|
|
2509
|
+
name: "light",
|
|
2510
|
+
scheme: "light",
|
|
2511
|
+
colors: bt
|
|
2512
|
+
}, to = Symbol("Notifications"), gt = Et([]);
|
|
2513
|
+
function gn() {
|
|
2514
|
+
return gt;
|
|
2515
|
+
}
|
|
2516
|
+
class ro {
|
|
2517
|
+
static show(t) {
|
|
2518
|
+
t.hash = Math.random().toString(36), gt.push(t);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
const yt = Symbol("tabCurrent"), wt = Symbol("direction"), Ve = [0.96, 0.96, 0.907, 0.805, 0.697, 0.547, 0.518, 0.445, 0.395, 0.34, 0.28];
|
|
2522
|
+
function yn(e) {
|
|
2523
|
+
const t = p(e).toHsl().l;
|
|
2524
|
+
return Ve.reduce(
|
|
2525
|
+
(r, n) => Math.abs(n - t) < Math.abs(r - t) ? n : r
|
|
2526
|
+
);
|
|
2527
|
+
}
|
|
2528
|
+
function wn(e) {
|
|
2529
|
+
const t = p(e), r = yn(t), n = Ve.findIndex((o) => o === r), a = Ve.map((o) => {
|
|
2530
|
+
const s = p({ h: t.toHsl().h, s: t.toHsl().s, l: o });
|
|
2531
|
+
return s.saturate(0 * 100), s;
|
|
2532
|
+
});
|
|
2533
|
+
return { baseColorIndex: n, colors: a.map((o) => o.toHexString()) };
|
|
2534
|
+
}
|
|
2535
|
+
function no(e) {
|
|
2536
|
+
return wn(e).colors;
|
|
2537
|
+
}
|
|
2538
|
+
const oo = /* @__PURE__ */ x({
|
|
2539
|
+
__name: "RokuProvider",
|
|
2540
|
+
props: {
|
|
2541
|
+
is: { default: "div" },
|
|
2542
|
+
theme: { default() {
|
|
2543
|
+
return typeof window > "u" || document.documentElement.dataset.scheme === "dark" ? Ie : bn;
|
|
2544
|
+
} }
|
|
2545
|
+
},
|
|
2546
|
+
setup(e) {
|
|
2547
|
+
const t = e, r = g(t.theme.scheme);
|
|
2548
|
+
Q && new MutationObserver(() => {
|
|
2549
|
+
r.value !== document.documentElement.dataset.scheme && (r.value = document.documentElement.dataset.scheme);
|
|
2550
|
+
}).observe(document.documentElement, {
|
|
2551
|
+
attributes: !0,
|
|
2552
|
+
attributeFilter: ["data-scheme"]
|
|
2553
|
+
});
|
|
2554
|
+
const n = rr();
|
|
2555
|
+
X(() => {
|
|
2556
|
+
if (!Q)
|
|
2557
|
+
return "dark";
|
|
2558
|
+
r.value === "dark" ? document.documentElement.dataset.scheme = "dark" : r.value === "light" ? document.documentElement.dataset.scheme = "light" : n.value === "dark" ? document.documentElement.dataset.scheme = "dark" : document.documentElement.dataset.scheme = "light", localStorage.setItem("scheme", document.documentElement.dataset.scheme);
|
|
2559
|
+
}), ge(ut, r);
|
|
2560
|
+
const a = it(t.theme);
|
|
2561
|
+
return (o, s) => (h(), P(ue(o.is), {
|
|
2562
|
+
style: C([
|
|
2563
|
+
u(a)
|
|
2564
|
+
]),
|
|
2565
|
+
class: "text-surface-on transition-background-color,border-color,color"
|
|
2566
|
+
}, {
|
|
2567
|
+
default: L(() => [
|
|
2568
|
+
k(o.$slots, "default")
|
|
2569
|
+
]),
|
|
2570
|
+
_: 3
|
|
2571
|
+
}, 8, ["style"]));
|
|
2572
|
+
}
|
|
2573
|
+
}), _n = ["id"], xn = ["for"], kn = ["for"], Sn = /* @__PURE__ */ x({
|
|
2574
|
+
inheritAttrs: !1,
|
|
2575
|
+
__name: "Switch",
|
|
2576
|
+
props: /* @__PURE__ */ W({
|
|
2577
|
+
size: { default: "md" },
|
|
2578
|
+
animate: { type: Boolean, default: !0 },
|
|
2579
|
+
options: {},
|
|
2580
|
+
label: {},
|
|
2581
|
+
id: {},
|
|
2582
|
+
rounded: { default: "full" },
|
|
2583
|
+
color: { default: "primary" },
|
|
2584
|
+
disabled: { type: Boolean },
|
|
2585
|
+
offIcon: {},
|
|
2586
|
+
onIcon: {},
|
|
2587
|
+
value: { type: Boolean }
|
|
2588
|
+
}, {
|
|
2589
|
+
modelValue: { type: Boolean },
|
|
2590
|
+
modelModifiers: {}
|
|
2591
|
+
}),
|
|
2592
|
+
emits: ["update:modelValue"],
|
|
2593
|
+
setup(e) {
|
|
2594
|
+
const t = e, r = j(e, "modelValue");
|
|
2595
|
+
t.value && (r.value = t.value);
|
|
2596
|
+
const n = g(null), a = g(!1), o = m(() => {
|
|
2597
|
+
switch (t.size) {
|
|
2598
|
+
case "sm":
|
|
2599
|
+
return {
|
|
2600
|
+
icon: "text-xs mx-0.5",
|
|
2601
|
+
wrapper: "h-4 w-8",
|
|
2602
|
+
indicator: a.value ? "h-3 w-4" : "h-3 w-3",
|
|
2603
|
+
inactive: "left-[calc(0.125rem-1px)]",
|
|
2604
|
+
active: a.value ? "left-[calc(0.875rem-1px)]" : "left-[calc(1.125rem-1px)]"
|
|
2605
|
+
};
|
|
2606
|
+
case "md":
|
|
2607
|
+
return {
|
|
2608
|
+
icon: "text-sm mx-1",
|
|
2609
|
+
wrapper: "h-6 w-12",
|
|
2610
|
+
indicator: a.value ? "h-4 w-5" : "h-4 w-4",
|
|
2611
|
+
inactive: "left-[calc(0.25rem-1px)]",
|
|
2612
|
+
active: a.value ? "left-[calc(1.5rem-1px)]" : "left-[calc(1.75rem-1px)]"
|
|
2613
|
+
};
|
|
2614
|
+
case "lg":
|
|
2615
|
+
return {
|
|
2616
|
+
icon: "text-lg mx-2",
|
|
2617
|
+
wrapper: "h-8 w-16",
|
|
2618
|
+
indicator: a.value ? "h-6 w-8" : "h-6 w-6",
|
|
2619
|
+
inactive: "left-[calc(0.25rem-1px)]",
|
|
2620
|
+
active: a.value ? "left-[calc(1.75rem-1px)]" : "left-[calc(2.25rem-1px)]"
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2623
|
+
}), s = m(() => t.animate ? {
|
|
2624
|
+
indicator: "transition-all",
|
|
2625
|
+
progress: "transition-width"
|
|
2626
|
+
} : {
|
|
2627
|
+
indicator: "",
|
|
2628
|
+
progress: ""
|
|
2629
|
+
}), i = ct(t), l = m(() => {
|
|
2630
|
+
let d = "bg-primary-container";
|
|
2631
|
+
switch (t.color) {
|
|
2632
|
+
case "secondary":
|
|
2633
|
+
d = "bg-secondary-7";
|
|
2634
|
+
break;
|
|
2635
|
+
case "tertiary":
|
|
2636
|
+
d = "bg-tertiary-7";
|
|
2637
|
+
break;
|
|
2638
|
+
case "error":
|
|
2639
|
+
d = "bg-error-7";
|
|
2640
|
+
break;
|
|
2641
|
+
}
|
|
2642
|
+
return {
|
|
2643
|
+
wrapper: r.value ? `border border-transparent ${d}` : "bg-surface-lowest border border-surface-border-base",
|
|
2644
|
+
indicator: t.disabled ? "bg-surface-high" : "bg-white text-primary-container"
|
|
2645
|
+
};
|
|
2646
|
+
}), c = U(t);
|
|
2647
|
+
return (d, f) => (h(), b("div", {
|
|
2648
|
+
role: "switch",
|
|
2649
|
+
class: y(["relative flex items-center gap-2", {
|
|
2650
|
+
"pointer-events-none filter-grayscale op60": t.disabled
|
|
2651
|
+
}])
|
|
2652
|
+
}, [
|
|
2653
|
+
Te(w("input", xe({
|
|
2654
|
+
id: u(i),
|
|
2655
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => r.value = v)
|
|
2656
|
+
}, d.$attrs, {
|
|
2657
|
+
class: "hidden",
|
|
2658
|
+
type: "checkbox"
|
|
2659
|
+
}), null, 16, _n), [
|
|
2660
|
+
[Rt, r.value]
|
|
2661
|
+
]),
|
|
2662
|
+
w("label", {
|
|
2663
|
+
class: "leading-0 cursor-pointer!",
|
|
2664
|
+
for: u(i)
|
|
2665
|
+
}, [
|
|
2666
|
+
w("div", {
|
|
2667
|
+
ref_key: "wrapper",
|
|
2668
|
+
ref: n,
|
|
2669
|
+
class: y([[u(o).wrapper, u(l).wrapper, u(c).class], "relative inline-block transition-all"]),
|
|
2670
|
+
style: C([u(c).style]),
|
|
2671
|
+
onPointerdown: f[1] || (f[1] = (v) => a.value = !0),
|
|
2672
|
+
onPointerup: f[2] || (f[2] = (v) => a.value = !1),
|
|
2673
|
+
onPointerleave: f[3] || (f[3] = (v) => a.value = !1),
|
|
2674
|
+
onPointerenter: f[4] || (f[4] = (v) => v.buttons === 1 && (a.value = !0))
|
|
2675
|
+
}, [
|
|
2676
|
+
w("div", {
|
|
2677
|
+
class: y(["absolute top-50% -translate-y-50%", [u(o).indicator, u(l).indicator, u(s).indicator, r.value ? u(o).active : u(o).inactive, u(c).class]]),
|
|
2678
|
+
style: C([u(c).style])
|
|
2679
|
+
}, null, 6),
|
|
2680
|
+
w("i", {
|
|
2681
|
+
class: y(["absolute top-1/2 -translate-y-50%", [u(o).icon, {
|
|
2682
|
+
[`left-0 text-${d.color}-on`]: r.value,
|
|
2683
|
+
"right-0 text-surface-on ": !r.value,
|
|
2684
|
+
[d.onIcon ?? ""]: r.value && d.onIcon,
|
|
2685
|
+
[d.offIcon ?? ""]: !r.value && d.offIcon
|
|
2686
|
+
}]])
|
|
2687
|
+
}, null, 2)
|
|
2688
|
+
], 38)
|
|
2689
|
+
], 8, xn),
|
|
2690
|
+
d.label ? (h(), b("label", {
|
|
2691
|
+
key: 0,
|
|
2692
|
+
for: u(i)
|
|
2693
|
+
}, se(d.label), 9, kn)) : T("", !0)
|
|
2694
|
+
], 2));
|
|
2695
|
+
}
|
|
2696
|
+
}), Mn = { class: "dark:hidden" }, $n = { class: "light:hidden" }, ao = /* @__PURE__ */ x({
|
|
2697
|
+
__name: "SchemeSwitch",
|
|
2698
|
+
setup(e) {
|
|
2699
|
+
const t = Hr(), r = m({
|
|
2700
|
+
get() {
|
|
2701
|
+
return t.value === "dark";
|
|
2702
|
+
},
|
|
2703
|
+
set(o) {
|
|
2704
|
+
t.value = o ? "dark" : "light";
|
|
2705
|
+
}
|
|
2706
|
+
});
|
|
2707
|
+
X(() => {
|
|
2708
|
+
Q && (r.value === !0 ? (document.documentElement.setAttribute("data-scheme", "dark"), localStorage.setItem("scheme", "dark")) : r.value === !1 && (document.documentElement.setAttribute("data-scheme", "light"), localStorage.setItem("scheme", "light")));
|
|
2709
|
+
});
|
|
2710
|
+
const n = g(!0), a = g(!1);
|
|
2711
|
+
return ee(() => {
|
|
2712
|
+
if (Q) {
|
|
2713
|
+
const o = localStorage.getItem("scheme");
|
|
2714
|
+
o === "dark" ? r.value = !0 : o === "light" ? r.value = !1 : r.value = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2715
|
+
}
|
|
2716
|
+
n.value = !1;
|
|
2717
|
+
}), et(() => {
|
|
2718
|
+
a.value = !0;
|
|
2719
|
+
}), (o, s) => {
|
|
2720
|
+
const i = Sn;
|
|
2721
|
+
return h(), b(K, null, [
|
|
2722
|
+
w("div", {
|
|
2723
|
+
class: y({ hidden: !u(n) })
|
|
2724
|
+
}, [
|
|
2725
|
+
w("div", Mn, [
|
|
2726
|
+
Z(i, {
|
|
2727
|
+
value: !1,
|
|
2728
|
+
"on-icon": "i-line-md-moon-twotone-alt-loop",
|
|
2729
|
+
"off-icon": "i-line-md-sunny-outline-twotone-loop"
|
|
2730
|
+
})
|
|
2731
|
+
]),
|
|
2732
|
+
w("div", $n, [
|
|
2733
|
+
Z(i, {
|
|
2734
|
+
value: !0,
|
|
2735
|
+
color: "secondary",
|
|
2736
|
+
"on-icon": "i-line-md-moon-twotone-alt-loop",
|
|
2737
|
+
"off-icon": "i-line-md-sunny-outline-twotone-loop"
|
|
2738
|
+
})
|
|
2739
|
+
])
|
|
2740
|
+
], 2),
|
|
2741
|
+
w("div", {
|
|
2742
|
+
class: y({ hidden: u(n) })
|
|
2743
|
+
}, [
|
|
2744
|
+
Z(i, {
|
|
2745
|
+
modelValue: u(r),
|
|
2746
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => Bt(r) ? r.value = l : null),
|
|
2747
|
+
animate: u(a),
|
|
2748
|
+
color: "secondary",
|
|
2749
|
+
"on-icon": "i-line-md-moon-twotone-alt-loop",
|
|
2750
|
+
"off-icon": "i-line-md-sunny-outline-twotone-loop"
|
|
2751
|
+
}, null, 8, ["modelValue", "animate"])
|
|
2752
|
+
], 2)
|
|
2753
|
+
], 64);
|
|
2754
|
+
};
|
|
2755
|
+
}
|
|
2756
|
+
}), Cn = { class: "w-full flex items-center" }, An = ["placeholder", "value"], Tn = /* @__PURE__ */ w("i", { class: "i-tabler-chevron-down pointer-events-none absolute right-2" }, null, -1), zn = {
|
|
2757
|
+
key: 0,
|
|
2758
|
+
class: "flex cursor-default items-center justify-between gap-2 rounded p-1 px-2"
|
|
2759
|
+
}, En = ["onPointerdown", "onHover"], Rn = { key: 0 }, Bn = /* @__PURE__ */ w("i", { class: "i-tabler-check h-3 w-3" }, null, -1), On = [
|
|
2760
|
+
Bn
|
|
2761
|
+
], so = /* @__PURE__ */ x({
|
|
2762
|
+
__name: "Select",
|
|
2763
|
+
props: /* @__PURE__ */ W({
|
|
2764
|
+
options: { default() {
|
|
2765
|
+
return [];
|
|
2766
|
+
} },
|
|
2767
|
+
size: { default: "md" },
|
|
2768
|
+
noneText: { default: "No options" },
|
|
2769
|
+
rounded: { default: "md" },
|
|
2770
|
+
placeholder: { default: "" }
|
|
2771
|
+
}, {
|
|
2772
|
+
modelValue: { default: void 0 },
|
|
2773
|
+
modelModifiers: {}
|
|
2774
|
+
}),
|
|
2775
|
+
emits: /* @__PURE__ */ W(["change"], ["update:modelValue"]),
|
|
2776
|
+
setup(e, { emit: t }) {
|
|
2777
|
+
const r = e, n = t, a = U(r), o = j(e, "modelValue"), s = g(null), i = g(null), { focused: l } = tr(s), c = m(() => r.options.map((_) => E(_)).indexOf(o.value)), d = g(-1), f = g(-1);
|
|
2778
|
+
X(() => {
|
|
2779
|
+
l.value || (f.value = -1);
|
|
2780
|
+
}), X(() => {
|
|
2781
|
+
o.value = E(r.options[c.value]);
|
|
2782
|
+
}), de(o, () => {
|
|
2783
|
+
n("change", o.value);
|
|
2784
|
+
});
|
|
2785
|
+
const v = r.options, S = m(() => v[c.value]), A = m(() => z(S.value));
|
|
2786
|
+
function z(_) {
|
|
2787
|
+
if (_)
|
|
2788
|
+
return typeof _ == "string" || typeof _ == "symbol" || typeof _ == "number" ? _ : _.label;
|
|
2789
|
+
}
|
|
2790
|
+
function E(_) {
|
|
2791
|
+
if (_)
|
|
2792
|
+
return typeof _ == "string" || typeof _ == "symbol" || typeof _ == "number" ? _ : _.id;
|
|
2793
|
+
}
|
|
2794
|
+
te("ArrowDown", (_) => {
|
|
2795
|
+
l.value && (_.preventDefault(), f.value = (f.value + 1) % v.length);
|
|
2796
|
+
}), te("ArrowUp", (_) => {
|
|
2797
|
+
l.value && (_.preventDefault(), f.value = (f.value - 1 + v.length) % v.length);
|
|
2798
|
+
}), te("Enter", () => {
|
|
2799
|
+
l.value && f.value !== -1 && (o.value = E(v[f.value]), l.value = !1);
|
|
2800
|
+
});
|
|
2801
|
+
function he(_) {
|
|
2802
|
+
if (!l.value) {
|
|
2803
|
+
l.value = !0;
|
|
2804
|
+
return;
|
|
2805
|
+
}
|
|
2806
|
+
o.value = E(_), l.value = !1;
|
|
2807
|
+
}
|
|
2808
|
+
const Se = m(() => ({
|
|
2809
|
+
input: "container-base focus:border-primary-container"
|
|
2810
|
+
})), Me = m(() => {
|
|
2811
|
+
switch (r.size) {
|
|
2812
|
+
case "sm":
|
|
2813
|
+
return {
|
|
2814
|
+
wrapper: "h-6 w-full py-1 pl-1.5 pr-6 text-sm",
|
|
2815
|
+
dropdown: "text-sm children:py-1"
|
|
2816
|
+
};
|
|
2817
|
+
case "lg":
|
|
2818
|
+
return {
|
|
2819
|
+
wrapper: "h-10 w-full py-2 pl-3 pr-10 text-lg",
|
|
2820
|
+
dropdown: "text-lg children:py-2"
|
|
2821
|
+
};
|
|
2822
|
+
default:
|
|
2823
|
+
return {
|
|
2824
|
+
wrapper: "h-8 w-full py-1 pl-2 pr-8 text-base",
|
|
2825
|
+
dropdown: "text-base children:py-1"
|
|
2826
|
+
};
|
|
2827
|
+
}
|
|
2828
|
+
});
|
|
2829
|
+
return (_, pe) => (h(), b("div", {
|
|
2830
|
+
ref_key: "wrapperRef",
|
|
2831
|
+
ref: i,
|
|
2832
|
+
class: "r-select-wrapper relative"
|
|
2833
|
+
}, [
|
|
2834
|
+
w("div", Cn, [
|
|
2835
|
+
w("input", {
|
|
2836
|
+
ref_key: "inputRef",
|
|
2837
|
+
ref: s,
|
|
2838
|
+
class: y([[u(Se).input, u(Me).wrapper, u(a).class], "r-select-input cursor-pointer border outline-none outline-none focus-visible:outline-2"]),
|
|
2839
|
+
placeholder: _.placeholder,
|
|
2840
|
+
style: C([u(a).style]),
|
|
2841
|
+
readonly: "",
|
|
2842
|
+
value: u(A),
|
|
2843
|
+
"aria-haspopup": "listbox",
|
|
2844
|
+
autocomplete: "off",
|
|
2845
|
+
onFocus: pe[0] || (pe[0] = ($) => l.value = !0)
|
|
2846
|
+
}, null, 46, An),
|
|
2847
|
+
Tn
|
|
2848
|
+
]),
|
|
2849
|
+
u(l) ? (h(), b("div", {
|
|
2850
|
+
key: 0,
|
|
2851
|
+
class: y([u(Me).dropdown, "absolute z-10 mt-2 w-full flex-col overflow-hidden border container-base rounded p-1"])
|
|
2852
|
+
}, [
|
|
2853
|
+
u(v).length === 0 ? (h(), b("div", zn, se(_.noneText), 1)) : (h(!0), b(K, { key: 1 }, ye(u(v), ($, R) => (h(), b("div", {
|
|
2854
|
+
key: E($),
|
|
2855
|
+
class: y([{
|
|
2856
|
+
"hover:bg-surface-high border-transparent": u(f) !== R,
|
|
2857
|
+
"container-filled-primary": u(f) === R
|
|
2858
|
+
}, "flex cursor-pointer items-center justify-between gap-2 border rounded p-1 px-2"]),
|
|
2859
|
+
onPointerdown: (B) => he($),
|
|
2860
|
+
onHover: (B) => d.value = R
|
|
2861
|
+
}, [
|
|
2862
|
+
Ot(se(z($)) + " ", 1),
|
|
2863
|
+
$ === u(S) ? (h(), b("div", Rn, On)) : T("", !0)
|
|
2864
|
+
], 42, En))), 128))
|
|
2865
|
+
], 2)) : T("", !0)
|
|
2866
|
+
], 512));
|
|
2867
|
+
}
|
|
2868
|
+
}), Hn = { class: "relative inline-block w-full" }, lo = /* @__PURE__ */ x({
|
|
2869
|
+
__name: "Slider",
|
|
2870
|
+
props: /* @__PURE__ */ W({
|
|
2871
|
+
size: { default: "md" },
|
|
2872
|
+
animate: { type: Boolean, default: !1 },
|
|
2873
|
+
width: {},
|
|
2874
|
+
options: {},
|
|
2875
|
+
min: { default: 0 },
|
|
2876
|
+
max: { default: 100 },
|
|
2877
|
+
step: { default: 1 },
|
|
2878
|
+
tickNum: {},
|
|
2879
|
+
color: { default: "primary" },
|
|
2880
|
+
minWidth: { default: 12 }
|
|
2881
|
+
}, {
|
|
2882
|
+
modelValue: {
|
|
2883
|
+
default: void 0
|
|
2884
|
+
},
|
|
2885
|
+
modelModifiers: {}
|
|
2886
|
+
}),
|
|
2887
|
+
emits: ["update:modelValue"],
|
|
2888
|
+
setup(e) {
|
|
2889
|
+
const t = e;
|
|
2890
|
+
function r($, R, B) {
|
|
2891
|
+
const I = [];
|
|
2892
|
+
for (let Y = $; Y <= R; Y += B)
|
|
2893
|
+
I.push(Y);
|
|
2894
|
+
return I[I.length - 1] !== R && I.push(R), I;
|
|
2895
|
+
}
|
|
2896
|
+
function n($, R) {
|
|
2897
|
+
const B = [];
|
|
2898
|
+
B.push(R[0]);
|
|
2899
|
+
const I = (R.length - 1) / ($ - 1);
|
|
2900
|
+
for (let Y = 1; Y < $ - 1; Y++)
|
|
2901
|
+
B.push(R[Math.round(Y * I)]);
|
|
2902
|
+
return B.push(R[R.length - 1]), B;
|
|
2903
|
+
}
|
|
2904
|
+
const a = m(() => t.options ? t.options.length : t.tickNum ?? 0), o = m(() => t.options === void 0 ? r(t.min, t.max, t.step) : t.options), s = m(() => n(a.value, o.value)), i = j(e, "modelValue"), l = m(() => o.value.length ?? 0), c = g(o.value.includes(i.value) ? o.value.indexOf(i.value) : 0);
|
|
2905
|
+
function d($) {
|
|
2906
|
+
return o.value.indexOf($);
|
|
2907
|
+
}
|
|
2908
|
+
const f = m(() => {
|
|
2909
|
+
switch (t.color) {
|
|
2910
|
+
case "primary":
|
|
2911
|
+
return "bg-primary-container";
|
|
2912
|
+
case "secondary":
|
|
2913
|
+
return "bg-secondary-container";
|
|
2914
|
+
case "tertiary":
|
|
2915
|
+
return "bg-tertiary-container";
|
|
2916
|
+
case "error":
|
|
2917
|
+
return "bg-error-container";
|
|
2918
|
+
}
|
|
2919
|
+
}), v = m(() => `dark:bg-white bg-${t.color}-container`), S = m(() => {
|
|
2920
|
+
switch (t.color) {
|
|
2921
|
+
case "primary":
|
|
2922
|
+
return "dark:bg-primary-container bg-white";
|
|
2923
|
+
case "secondary":
|
|
2924
|
+
return "dark:bg-secondary-container bg-white";
|
|
2925
|
+
case "tertiary":
|
|
2926
|
+
return "dark:bg-tertiary-container bg-white";
|
|
2927
|
+
case "error":
|
|
2928
|
+
return "dark:bg-error-container bg-white";
|
|
2929
|
+
}
|
|
2930
|
+
});
|
|
2931
|
+
X(() => {
|
|
2932
|
+
i.value = o.value[c.value];
|
|
2933
|
+
});
|
|
2934
|
+
const A = g(), z = g(), E = Kt(A), he = g(!1);
|
|
2935
|
+
function Se($) {
|
|
2936
|
+
if (!he.value)
|
|
2937
|
+
return;
|
|
2938
|
+
if (!($.buttons === 1)) {
|
|
2939
|
+
he.value = !1;
|
|
2940
|
+
return;
|
|
2941
|
+
}
|
|
2942
|
+
$.preventDefault(), $.stopPropagation();
|
|
2943
|
+
const { clientX: B } = $, I = E.left.value, _t = E.right.value - I, Be = Math.round((B - I) / _t * (l.value - 1));
|
|
2944
|
+
if (Be < 0) {
|
|
2945
|
+
c.value = 0;
|
|
2946
|
+
return;
|
|
2947
|
+
}
|
|
2948
|
+
if (Be > l.value - 1) {
|
|
2949
|
+
c.value = l.value - 1;
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
c.value = Be;
|
|
2953
|
+
}
|
|
2954
|
+
X(() => {
|
|
2955
|
+
c.value = d(i.value);
|
|
2956
|
+
});
|
|
2957
|
+
function Me($) {
|
|
2958
|
+
$.preventDefault(), $.stopPropagation(), he.value = !0, Se($);
|
|
2959
|
+
}
|
|
2960
|
+
N(A, "pointerdown", Me), ee(() => {
|
|
2961
|
+
N(document, "pointermove", Se), c.value = Math.max(0, d(i.value));
|
|
2962
|
+
});
|
|
2963
|
+
const _ = m(() => {
|
|
2964
|
+
switch (t.size) {
|
|
2965
|
+
case "sm":
|
|
2966
|
+
return {
|
|
2967
|
+
wrapper: "h-2",
|
|
2968
|
+
innerWrapper: "px-0.5 h-1",
|
|
2969
|
+
content: "h-1",
|
|
2970
|
+
tick: "h-0.5 w-0.5 -translate-x-0.25 -translate-y-0.25",
|
|
2971
|
+
indicator: "h-2 w-2 -translate-x-1 -translate-y-1",
|
|
2972
|
+
indicatorInner: "h-1 w-1 -translate-x-0.5 -translate-y-0.5",
|
|
2973
|
+
progress: "-mx-0.5"
|
|
2974
|
+
};
|
|
2975
|
+
case "md":
|
|
2976
|
+
return {
|
|
2977
|
+
wrapper: "h-4",
|
|
2978
|
+
innerWrapper: "px-1 h-2",
|
|
2979
|
+
content: "h-2",
|
|
2980
|
+
tick: "h-1 w-1 -translate-x-0.5 -translate-y-0.5",
|
|
2981
|
+
indicator: "h-4 w-4 -translate-x-2 -translate-y-2",
|
|
2982
|
+
indicatorInner: "h-2 w-2 -translate-x-1 -translate-y-1",
|
|
2983
|
+
progress: "-mx-1"
|
|
2984
|
+
};
|
|
2985
|
+
case "lg":
|
|
2986
|
+
return {
|
|
2987
|
+
wrapper: "h-6",
|
|
2988
|
+
innerWrapper: "px-1.5 h-3",
|
|
2989
|
+
content: "h-3",
|
|
2990
|
+
tick: "h-1.5 w-1.5 -translate-x-0.75 -translate-y-0.75",
|
|
2991
|
+
indicator: "h-6 w-6 -translate-x-3 -translate-y-3",
|
|
2992
|
+
indicatorInner: "h-3 w-3 -translate-x-1.5 -translate-y-1.5",
|
|
2993
|
+
progress: "-mx-1.5"
|
|
2994
|
+
};
|
|
2995
|
+
}
|
|
2996
|
+
}), pe = m(() => t.animate ? {
|
|
2997
|
+
indicator: "transition-left",
|
|
2998
|
+
progress: "transition-width"
|
|
2999
|
+
} : {
|
|
3000
|
+
indicator: "",
|
|
3001
|
+
progress: ""
|
|
3002
|
+
});
|
|
3003
|
+
return ($, R) => (h(), b("div", Hn, [
|
|
3004
|
+
w("div", {
|
|
3005
|
+
ref_key: "wrapper",
|
|
3006
|
+
ref: A,
|
|
3007
|
+
type: "size",
|
|
3008
|
+
class: y(["w-full flex cursor-pointer items-center", u(_).wrapper]),
|
|
3009
|
+
onTouchmove: R[0] || (R[0] = ot(() => {
|
|
3010
|
+
}, ["prevent"]))
|
|
3011
|
+
}, [
|
|
3012
|
+
w("div", {
|
|
3013
|
+
class: y(["w-full rounded-full bg-surface-lowest transition-background-color,border-color,color", u(_).innerWrapper])
|
|
3014
|
+
}, [
|
|
3015
|
+
w("div", {
|
|
3016
|
+
class: y(["relative flex", u(_).content]),
|
|
3017
|
+
style: C({
|
|
3018
|
+
width: `${t.width}rem`,
|
|
3019
|
+
minWidth: `${t.minWidth}rem`
|
|
3020
|
+
})
|
|
3021
|
+
}, [
|
|
3022
|
+
(h(!0), b(K, null, ye(u(s), (B) => (h(), b("div", {
|
|
3023
|
+
key: B,
|
|
3024
|
+
style: C({
|
|
3025
|
+
left: `${d(B) / (u(l) - 1) * 100}%`
|
|
3026
|
+
}),
|
|
3027
|
+
class: y(["absolute top-50% rounded-full bg-white", u(_).tick])
|
|
3028
|
+
}, null, 6))), 128)),
|
|
3029
|
+
u(c) !== -1 ? (h(), b("div", {
|
|
3030
|
+
key: 0,
|
|
3031
|
+
ref_key: "indicator",
|
|
3032
|
+
ref: z,
|
|
3033
|
+
class: y(["absolute top-50% cursor-pointer rounded-full transition-background-color,border-color,color", [u(_).indicator, u(pe).indicator, u(v)]]),
|
|
3034
|
+
style: C({
|
|
3035
|
+
left: `${u(c) / (u(l) - 1) * 100}%`
|
|
3036
|
+
})
|
|
3037
|
+
}, [
|
|
3038
|
+
w("div", {
|
|
3039
|
+
class: y(["pointer-events-none absolute left-50% top-50% rounded-full transition-background-color,border-color,color", [u(_).indicatorInner, u(S)]])
|
|
3040
|
+
}, null, 2)
|
|
3041
|
+
], 6)) : T("", !0),
|
|
3042
|
+
w("div", {
|
|
3043
|
+
class: y(["pointer-events-none h-full rounded-full", [u(_).progress, u(pe).progress, u(f)]]),
|
|
3044
|
+
style: C({
|
|
3045
|
+
width: `${u(c) / (u(l) - 1) * 100}%`
|
|
3046
|
+
})
|
|
3047
|
+
}, null, 6)
|
|
3048
|
+
], 6)
|
|
3049
|
+
], 2)
|
|
3050
|
+
], 34),
|
|
3051
|
+
w("div", {
|
|
3052
|
+
class: "relative mx-1 h-1em text-xs text-surface-onlow",
|
|
3053
|
+
style: C({
|
|
3054
|
+
width: `${t.width}rem`
|
|
3055
|
+
})
|
|
3056
|
+
}, [
|
|
3057
|
+
(h(!0), b(K, null, ye(u(s), (B, I) => (h(), b("div", {
|
|
3058
|
+
key: I,
|
|
3059
|
+
style: C({
|
|
3060
|
+
left: `${d(B) / (u(l) - 1) * 100}%`
|
|
3061
|
+
}),
|
|
3062
|
+
class: y(["absolute w-auto flex rounded-full -translate-x-50%", u(_).tick])
|
|
3063
|
+
}, se(B), 7))), 128))
|
|
3064
|
+
], 4)
|
|
3065
|
+
]));
|
|
3066
|
+
}
|
|
3067
|
+
}), Nn = { class: "h-full py-2" }, io = /* @__PURE__ */ x({
|
|
3068
|
+
__name: "TabItem",
|
|
3069
|
+
props: {
|
|
3070
|
+
value: {},
|
|
3071
|
+
color: { default: "primary" }
|
|
3072
|
+
},
|
|
3073
|
+
setup(e) {
|
|
3074
|
+
const t = e, r = be(yt, g("")), n = be(wt, m(() => "horizontal")), a = m(() => r.value === t.value);
|
|
3075
|
+
function o() {
|
|
3076
|
+
r.value = t.value;
|
|
3077
|
+
}
|
|
3078
|
+
const s = m(() => {
|
|
3079
|
+
switch (n.value) {
|
|
3080
|
+
case "horizontal":
|
|
3081
|
+
return "flex-col";
|
|
3082
|
+
case "vertical":
|
|
3083
|
+
return "flex-row-reverse";
|
|
3084
|
+
}
|
|
3085
|
+
}), i = m(() => {
|
|
3086
|
+
switch (n.value) {
|
|
3087
|
+
case "horizontal":
|
|
3088
|
+
return "absolute inset-0 top-100% h-2px w-full transition-background-color,border-color,color";
|
|
3089
|
+
case "vertical":
|
|
3090
|
+
return "absolute inset-0 right-100% h-full w-2px bg-primary-container transition-background-color,border-color,color";
|
|
3091
|
+
}
|
|
3092
|
+
}), l = m(() => a.value ? "bg-primary-container" : "bg-surface-lowest");
|
|
3093
|
+
return (c, d) => (h(), b("button", {
|
|
3094
|
+
type: "button",
|
|
3095
|
+
class: y(["relative min-w-20 flex items-center justify-center", [u(s)]]),
|
|
3096
|
+
onClick: o
|
|
3097
|
+
}, [
|
|
3098
|
+
u(a) ? (h(), b("div", {
|
|
3099
|
+
key: 0,
|
|
3100
|
+
class: y([u(i), u(l)])
|
|
3101
|
+
}, null, 2)) : (h(), b("div", {
|
|
3102
|
+
key: 1,
|
|
3103
|
+
class: y([u(i), u(l)])
|
|
3104
|
+
}, null, 2)),
|
|
3105
|
+
w("div", Nn, [
|
|
3106
|
+
k(c.$slots, "default")
|
|
3107
|
+
])
|
|
3108
|
+
], 2));
|
|
3109
|
+
}
|
|
3110
|
+
}), co = /* @__PURE__ */ x({
|
|
3111
|
+
__name: "Tabs",
|
|
3112
|
+
props: /* @__PURE__ */ W({
|
|
3113
|
+
defaultValue: {},
|
|
3114
|
+
direction: { default: "horizontal" }
|
|
3115
|
+
}, {
|
|
3116
|
+
modelValue: {},
|
|
3117
|
+
modelModifiers: {}
|
|
3118
|
+
}),
|
|
3119
|
+
emits: ["update:modelValue"],
|
|
3120
|
+
setup(e) {
|
|
3121
|
+
const t = e, r = nt(), n = m(() => {
|
|
3122
|
+
var c;
|
|
3123
|
+
const i = (c = r.default) == null ? void 0 : c.call(r);
|
|
3124
|
+
return (i == null ? void 0 : i.flatMap((d) => d.type === K ? d.children : d).filter((d) => {
|
|
3125
|
+
var f;
|
|
3126
|
+
return ((f = d == null ? void 0 : d.props) == null ? void 0 : f.value) !== void 0;
|
|
3127
|
+
}).map((d) => d.props.value)) ?? [];
|
|
3128
|
+
}), a = j(e, "modelValue");
|
|
3129
|
+
!a.value && n.value.length > 0 && (a.value = n.value[0]), ee(() => {
|
|
3130
|
+
t.defaultValue && (a.value = t.defaultValue);
|
|
3131
|
+
}), ge(yt, a);
|
|
3132
|
+
const o = m(() => t.direction);
|
|
3133
|
+
ge(wt, o), te("left", () => {
|
|
3134
|
+
if (t.direction !== "horizontal")
|
|
3135
|
+
return;
|
|
3136
|
+
const i = a.value ? n.value.indexOf(a.value) : 0;
|
|
3137
|
+
i > 0 ? a.value = n.value[i - 1] : a.value = n.value[n.value.length - 1];
|
|
3138
|
+
}), te("right", () => {
|
|
3139
|
+
if (t.direction !== "horizontal")
|
|
3140
|
+
return;
|
|
3141
|
+
const i = a.value ? n.value.indexOf(a.value) : 0;
|
|
3142
|
+
i < n.value.length - 1 ? a.value = n.value[i + 1] : a.value = n.value[0];
|
|
3143
|
+
}), te("up", () => {
|
|
3144
|
+
if (t.direction !== "vertical")
|
|
3145
|
+
return;
|
|
3146
|
+
const i = a.value ? n.value.indexOf(a.value) : 0;
|
|
3147
|
+
i > 0 ? a.value = n.value[i - 1] : a.value = n.value[n.value.length - 1];
|
|
3148
|
+
}), te("down", () => {
|
|
3149
|
+
if (t.direction !== "vertical")
|
|
3150
|
+
return;
|
|
3151
|
+
const i = a.value ? n.value.indexOf(a.value) : 0;
|
|
3152
|
+
i < n.value.length - 1 ? a.value = n.value[i + 1] : a.value = n.value[0];
|
|
3153
|
+
});
|
|
3154
|
+
const s = m(() => {
|
|
3155
|
+
switch (t.direction) {
|
|
3156
|
+
case "horizontal":
|
|
3157
|
+
return "flex-row";
|
|
3158
|
+
case "vertical":
|
|
3159
|
+
return "flex-col";
|
|
3160
|
+
}
|
|
3161
|
+
});
|
|
3162
|
+
return (i, l) => (h(), b("div", {
|
|
3163
|
+
class: y(["flex", [u(s)]])
|
|
3164
|
+
}, [
|
|
3165
|
+
k(i.$slots, "default")
|
|
3166
|
+
], 2));
|
|
3167
|
+
}
|
|
3168
|
+
});
|
|
3169
|
+
export {
|
|
3170
|
+
In as AspectRatio,
|
|
3171
|
+
Ht as Avatar,
|
|
3172
|
+
at as Btn,
|
|
3173
|
+
Vn as ChatContainer,
|
|
3174
|
+
Dn as ChatMessage,
|
|
3175
|
+
Fn as ChatSystem,
|
|
3176
|
+
Ln as Chip,
|
|
3177
|
+
jn as ColorInput,
|
|
3178
|
+
ir as ColorSwatch,
|
|
3179
|
+
Un as Drawer,
|
|
3180
|
+
Gn as Dropzone,
|
|
3181
|
+
dt as FullscreenOverlay,
|
|
3182
|
+
qn as Image,
|
|
3183
|
+
Xn as Indicator,
|
|
3184
|
+
Yn as Modal,
|
|
3185
|
+
Yr as Notification,
|
|
3186
|
+
Zn as NotificationSystem,
|
|
3187
|
+
ro as Notifications,
|
|
3188
|
+
Kn as Overlay,
|
|
3189
|
+
Qn as Paper,
|
|
3190
|
+
Jn as PinInput,
|
|
3191
|
+
eo as Progress,
|
|
3192
|
+
oo as RokuProvider,
|
|
3193
|
+
ao as SchemeSwitch,
|
|
3194
|
+
so as Select,
|
|
3195
|
+
lo as Slider,
|
|
3196
|
+
Sn as Switch,
|
|
3197
|
+
io as TabItem,
|
|
3198
|
+
co as Tabs,
|
|
3199
|
+
mn as TextField,
|
|
3200
|
+
Vr as ThemeProvider,
|
|
3201
|
+
Ie as darkTheme,
|
|
3202
|
+
wt as directionSymbol,
|
|
3203
|
+
no as generateColors,
|
|
3204
|
+
wn as generateColorsMap,
|
|
3205
|
+
bn as lightTheme,
|
|
3206
|
+
to as notificationsSymbol,
|
|
3207
|
+
ut as schemeSymbol,
|
|
3208
|
+
yt as tabCurrentSymbol,
|
|
3209
|
+
bt as themeColors,
|
|
3210
|
+
Or as useCurrentTheme,
|
|
3211
|
+
Wn as useCurrentThemeScheme,
|
|
3212
|
+
ct as useId,
|
|
3213
|
+
gn as useNotifications,
|
|
3214
|
+
Br as useRootTheme,
|
|
3215
|
+
Hr as useScheme,
|
|
3216
|
+
it as useThemeStyles
|
|
3217
|
+
};
|