vuesp-components 2.1.9 → 2.2.1

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/index.es.js CHANGED
@@ -1,3716 +1,32 @@
1
- import { getDataValue as dt } from "./dashboard/index.es.js";
2
- import { dashboardCards as ni, getFunction as li, getParamsData as si, getStateItem as oi, setStateItem as ai } from "./dashboard/index.es.js";
3
- import { openBlock as f, createElementBlock as v, createStaticVNode as ut, createElementVNode as a, defineComponent as V, resolveComponent as Pe, Fragment as O, createCommentVNode as E, normalizeClass as B, createVNode as b, withCtx as y, createBlock as M, renderSlot as $, markRaw as F, computed as L, resolveDynamicComponent as de, mergeProps as N, shallowRef as Me, Teleport as He, Transition as ae, unref as T, withModifiers as H, normalizeStyle as Q, ref as D, resolveDirective as ft, withDirectives as Ce, renderList as R, createTextVNode as I, toDisplayString as k, TransitionGroup as Ne, watch as ue, normalizeProps as U, guardReactiveProps as K, withKeys as mt, createPropsRestProxy as vt, onMounted as fe, onUnmounted as Fe, reactive as pt, useTemplateRef as Re, vShow as ht, vModelText as gt, createSlots as bt } from "vue";
4
- import { u as Ue, a as yt, b as Ke, c as We, d as ze, e as xt, o as $t } from "./useSwipeDown-BctVX4c1.js";
5
- import { f as kt, t as _t, g as wt, u as pe, s as Ct, d as zt } from "./app-CG8zhRFf.js";
6
- const St = {
7
- mounted(e, n) {
8
- e.clickOutsideEvent = function(l) {
9
- e === l.target || e.contains(l.target) || n.value(l, e);
10
- }, document.addEventListener("click", e.clickOutsideEvent);
11
- },
12
- unmounted(e) {
13
- document.removeEventListener("click", e.clickOutsideEvent), delete e.clickOutsideEvent;
14
- }
15
- }, Vt = [{ name: "outside", directive: St }], ge = (e, n) => {
16
- const l = e.__vccOpts || e;
17
- for (const [s, t] of n)
18
- l[s] = t;
19
- return l;
20
- }, Bt = {}, Et = {
21
- viewBox: "0 0 179 40",
22
- fill: "currentColor"
23
- };
24
- function Tt(e, n) {
25
- return f(), v("svg", Et, [...n[0] || (n[0] = [
26
- ut('<g transform="matrix(0.13287749,0,0,0.13643171,26.823508,13.407673)"><path d="m -19.25933,-16.057909 c 0,39.1906 -14.287,86.055995 -38.669,116.999999 -7.898,10.024 -30.4718,32.819 -43.7731,17.695 -9.4823,-10.781 -3.53183,-36.917714 -0.86893,-48.907714 9.1618,-41.251693 19.72123,-78.8733849 30.31103,-119.787285 -27.50968,14.537655 -68.26323,-24.154322 -70.36602,-2.214449 -12.32038,69.23655 -28.82323,204.245118 16.36602,215.925448 81.802,10.63 120.333,-82.698004 129.4249996,-148.710999 2.182,-15.84009991 4.123,-31.9832 2.401,-48 -2.342,-21.78506 -24.7959996,-32.68227 -43.7859996,-21.58643 -11.424,6.67523 -12.148,29.93713 -1.935,38.01393 5.462,4.3199 14.927,3.091 20.895,0.5725 z"></path><path d="m 104.76548,-63.374174 0.008,91.15236 -26.35225,25.003926 26.35676,25.415735 4.8e-4,91.161403 4.03033,0.0237 c 0,0 0.0729,-90.913243 -0.0476,-91.163063 l 26.24012,-24.776315 -26.23835,-25.66073 0.007,-91.147024 z"></path><path d="m 803.85444,82.816565 c -5.5092,-1.69169 -15.7197,-2.12913 -19.9329,1.03114 -5.56,4.548 -0.63,22.670005 -0.76,28.973005 0.3943,19.76599 20.7146,30.35978 36.02,33 0,0 45.06,4.77 68,-5.439 35.89996,-15.975 40.75996,-63.180005 13.91,-89.457 -15.2385,-18.333755 -72.7584,-32.66908 -78.91,-50.10399958 -6.54,-7.52040002 -2.52,-22.38120042 5.1,-27.89120042 10.47,-7.5605 25.91,-7.3647 37.9,-5.017 13.11,2.5659 14.15,13.6285 18,24.9082004 1.48,4.3522 2.88,12.3564 8.1,13.6674 2.25,0.5623 4.67,-0.1094 6.9,-0.3827 16.42996,-2.011 11.28456,-11.418391 12.09456,-24.2037914 0.38,-6.0219 2.2254,-16.238609 -1.1246,-21.752209 -5.98996,-9.87979 -17.48276,-9.960049 -30.96996,-15.3287 -11.9944,-2.919504 -32.57,-5.50288 -50,-1.25772 -13.92,3.39017 -28.5,10.49772 -37.24,22.25772 -16.31,21.9622 -9.6,57.1861 10.26,74.6998 22.17,19.5582 58.4,21.7732 76.41,46.304195 16.9,23.013005 -18.71,37.732005 -37.1,36.158005 -39.9169,-0.34531 -23.6297,-30.723925 -36.6571,-40.166145 z"></path><path d="m 321.18154,-32.17929 21,9 -46,120.999995 c -13.02939,-49.349215 -25.65589,-93.5184936 -37,-121.999995 5.741,-1.2008 17.946,-4.1139 20.397,-10.1049 2.328,-5.6934 -1.142,-13.0456 -1.397,-18.8951 -9.12189,0.745226 -79.43846,-2.275099 -82.411,2.3179 -1.02172,5.2378 -3.84926,12.95938 -1.985,17.2878 4.036,8.5605 18.82154,3.517306 23.75154,13.866906 25.90475,54.255645 38.51776,106.713979 60.87446,156.527394 37.33703,54.02331 63.06896,-92.52485 72.275,-119 4.089,-11.8192996 7.212,-30.0265 15.194,-39.7724 15.1599,-17.433642 28.97616,-5.381825 21.868,-28.07945 -5.23694,-5.944366 -63.1086,-2.739072 -64.389,-1.54476 -3.452,4.31661 -7.5289,7.804293 -2.178,19.39661 z"></path><path d="m 401.18154,-53.17929 c -0.998,4.83681 -4.908,16.1206 -1.357,20.3511 4.914,5.8555 20.341,3.7676 21.463,12.689 3.596,28.5694004 -0.4,58.2962 0.855,86.9599 0.882,20.149995 3.491,41.865 17.134,57.961 36.351,42.885 114.137,25.661 128.322,-27.961005 9.142,-34.561995 3.01191,-80.803507 3.08491,-116.292007 0.033,-15.7886 15.53509,-3.553988 22.46909,-13.356888 3.337,-4.7169 -1.212,-15.187 -1.971,-20.3511 -20.45735,-0.261837 -40.85188,-0.262234 -61.258,1.02779 l -3.742,11.97221 c 0.84877,13.898543 11.37685,10.038234 23.90801,11.758642 0.32053,9.189207 0.091,48.923358 0.092,71.241358 10e-4,19.4 0.471,40.338995 -8.89,58 -15.56,29.358 -61.659,29.409 -74.878,-2.000005 -10.636,-25.273 -6.147,-56.234995 -6.233,-82.999995 -0.035,-10.9870996 -2.501,-25.3419996 0.319,-35.9568 2.549,-9.5978 16.626,-6.4297 22.064,-12.6921 3.287,-3.7858 -0.52,-15.71299 -1.382,-20.3511 z"></path><path d="m 760.05964,143.05268 c -5.1123,-31.58627 4.9497,-52.437285 -1.4781,-59.628975 -3.17,-3.163 -17.48,-3.877 -20.39,-0.285 -7.636,9.412 -6.012,27.571005 -14.737,36.079005 -3.136,3.058 -10.272,1.461 -14.273,1.689 -13.102,0.746 -25.895,-0.086 -39,-0.086 l -1,-68 c 7.223,0.913 21.685,-1.996 27.722,1.269 6.665,3.604 3.577,17.035995 10.556,20.532995 5.15472,-0.0642 13.05488,0.47604 17.494,-1.405 5.21328,-7.758815 3.74312,-60.612259 -0.015,-62.640795 -5.5141,-0.237113 -13.29293,-2.8563906 -17.543,-1.1527996 -6.595,2.8734996 -5.002,15.2292996 -10.608,19.7931996 -5.233,4.2609 -21.417,2.0768 -27.606,0.6034 l 0.018,-19.9999996 0.982,-42.0000004 h 36 c 4.195,0 11.017,-1.271 14.725,1.0278 9.479,5.8759 5.235,25.2669004 13.705,30.94060042 4.66,3.12049998 14.21,-2.03520002 19.57,-1.96840002 -1.7258,-10.0332024 5.1749,-44.7657364 -0.6,-49.9722104 -8.573,-0.17431 -123.95249,0.09746 -142.26,0.5756 -2.813,3.26479 -4.226,15.59871 -1.533,19.00621 4.834,6.1168 16.163,4.3646 20.481,9.9544 4.51586,28.5714044 7.89004,96.377815 0.594,132.328 -2.185,7.787 -16.181,5.969 -20.654,11.832 -1.59611,5.22999 -0.7409,13.33851 1.536,18.048 5.16025,7.51372 110.02916,3.17366 148.3141,3.45997 z"></path><path d="m 964.1815,-23.17929 c 0,43.4127 3.83,88.767 -0.06,131.985 -0.8,8.923 -14.88,7.544 -20.62,12.09 -4.2,3.326 -1.95,14.442 -0.17,18.777 15.7137,4.67091 86.3037,9.27518 89.39,-4.852 0.57,-3.057 2.36,-9.582 0.42,-12.297 -5.77,-8.041 -28.93,-2.391 -30.81,-13.747 -0.063,-55.41713 -0.3488,-55.25935 -0.15,-140.956 16.19,0 34.24,-2.9842 46.98,9.0934 18.26,17.2977004 11.94,53.4098 -8.98,65.6236 -7.67,4.477 -18.44,3.283 -27,3.283 v 23 c 23.19,0 50.85,-0.216 69,-17.093 28.42,-26.4403 19.73,-83.9314 -16,-99.7334 -4.6952,-8.320027 -96.8662,-17.196078 -120.68,-4.43208 -2.7,1.3721 -3.6701,5.98455 -3.17,8.34798 -3.3313,17.201533 8.54,18.6194 21.85,20.9105 z"></path></g>', 1)
27
- ])]);
28
- }
29
- const Se = /* @__PURE__ */ ge(Bt, [["render", Tt]]), Lt = {}, Mt = {
30
- width: "40",
31
- height: "40",
32
- viewBox: "0 0 40 40",
33
- fill: "currentColor"
34
- };
35
- function At(e, n) {
36
- return f(), v("svg", Mt, [...n[0] || (n[0] = [
37
- a("g", { transform: "matrix(0.13287749,0,0,0.13643171,26.823508,13.407673)" }, [
38
- a("path", { d: "m -19.25933,-16.057909 c 0,39.1906 -14.287,86.055995 -38.669,116.999999 -7.898,10.024 -30.4718,32.819 -43.7731,17.695 -9.4823,-10.781 -3.53183,-36.917714 -0.86893,-48.907714 9.1618,-41.251693 19.72123,-78.8733849 30.31103,-119.787285 -27.50968,14.537655 -68.26323,-24.154322 -70.36602,-2.214449 -12.32038,69.23655 -28.82323,204.245118 16.36602,215.925448 81.802,10.63 120.333,-82.698004 129.4249996,-148.710999 2.182,-15.84009991 4.123,-31.9832 2.401,-48 -2.342,-21.78506 -24.7959996,-32.68227 -43.7859996,-21.58643 -11.424,6.67523 -12.148,29.93713 -1.935,38.01393 5.462,4.3199 14.927,3.091 20.895,0.5725 z" })
39
- ], -1)
40
- ])]);
41
- }
42
- const qe = /* @__PURE__ */ ge(Lt, [["render", At]]), Dt = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, Sa = /* @__PURE__ */ V({
43
- __name: "AppAside",
44
- props: {
45
- isSidebar: { type: Boolean, default: !1 }
46
- },
47
- emits: ["sidebar"],
48
- setup(e, { emit: n }) {
49
- const l = n, s = () => {
50
- e.isSidebar && l("sidebar", !e.isSidebar);
51
- };
52
- return (t, o) => {
53
- const i = Pe("router-link");
54
- return f(), v(O, null, [
55
- e.isSidebar ? (f(), v("div", {
56
- key: 0,
57
- class: "lg:hidden overlay fixed left-0 top-0 h-full w-full bg-black/40 z-10 bg-blur",
58
- onClick: s
59
- })) : E("", !0),
60
- a("aside", {
61
- class: B([e.isSidebar ? "translate-x-0 lg:w-[90px]" : "-translate-x-full", "overflow-x-hidden fixed top-0 left-0 z-10 flex lg:static h-full w-[290px] flex-col overflow-y-auto border-r border-gray-200 px-5 transition-all duration-350 lg:translate-x-0 dark:border-gray-800 bg-white dark:bg-gray-900"])
62
- }, [
63
- a("div", {
64
- class: B([e.isSidebar ? "justify-center" : "justify-between", "sidebar-header flex items-center gap-2 pt-6 pb-6 justify-between"])
65
- }, [
66
- b(i, { to: "/" }, {
67
- default: y(() => [
68
- e.isSidebar ? (f(), M(qe, {
69
- key: 0,
70
- class: "h-[30px] text-primary"
71
- })) : (f(), M(Se, {
72
- key: 1,
73
- class: "h-[30px] text-primary"
74
- }))
75
- ]),
76
- _: 1
77
- })
78
- ], 2),
79
- a("div", Dt, [
80
- $(t.$slots, "default")
81
- ])
82
- ], 2)
83
- ], 64);
84
- };
85
- }
86
- }), It = {
87
- viewBox: "0 0 24 24",
88
- width: "1.2em",
89
- height: "1.2em"
90
- };
91
- function Ot(e, n) {
92
- return f(), v("svg", It, [...n[0] || (n[0] = [
93
- a("path", {
94
- fill: "currentColor",
95
- d: "M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"
96
- }, null, -1)
97
- ])]);
98
- }
99
- const Ge = F({ name: "ri-more-line", render: Ot }), jt = {
100
- viewBox: "0 0 24 24",
101
- width: "1.2em",
102
- height: "1.2em"
103
- };
104
- function Pt(e, n) {
105
- return f(), v("svg", jt, [...n[0] || (n[0] = [
106
- a("path", {
107
- fill: "currentColor",
108
- d: "M4 18h2v2h12V4H6v2H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm2-7h7v2H6v3l-5-4l5-4z"
109
- }, null, -1)
110
- ])]);
111
- }
112
- const Ht = F({ name: "ri-logout-box-line", render: Pt }), Nt = {
113
- viewBox: "0 0 24 24",
114
- width: "1.2em",
115
- height: "1.2em"
116
- };
117
- function Ft(e, n) {
118
- return f(), v("svg", Nt, [...n[0] || (n[0] = [
119
- a("path", {
120
- fill: "currentColor",
121
- d: "M5 18h14v-6.969C19 7.148 15.866 4 12 4s-7 3.148-7 7.031zm7-16c4.97 0 9 4.043 9 9.031V20H3v-8.969C3 6.043 7.03 2 12 2M9.5 21h5a2.5 2.5 0 0 1-5 0"
122
- }, null, -1)
123
- ])]);
124
- }
125
- const Je = F({ name: "ri-notification-line", render: Ft }), Rt = {
126
- viewBox: "0 0 24 24",
127
- width: "1.2em",
128
- height: "1.2em"
129
- };
130
- function Ut(e, n) {
131
- return f(), v("svg", Rt, [...n[0] || (n[0] = [
132
- a("path", {
133
- fill: "currentColor",
134
- d: "M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2h.1A6.98 6.98 0 0 0 10 7m-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938A8 8 0 0 0 4 12"
135
- }, null, -1)
136
- ])]);
137
- }
138
- const Kt = F({ name: "ri-moon-line", render: Ut }), Wt = {
139
- viewBox: "0 0 24 24",
140
- width: "1.2em",
141
- height: "1.2em"
142
- };
143
- function qt(e, n) {
144
- return f(), v("svg", Wt, [...n[0] || (n[0] = [
145
- a("path", {
146
- fill: "currentColor",
147
- d: "M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12m0-2a4 4 0 1 0 0-8a4 4 0 0 0 0 8M11 1h2v3h-2zm0 19h2v3h-2zM3.515 4.929l1.414-1.414L7.05 5.636L5.636 7.05zM16.95 18.364l1.414-1.414l2.121 2.121l-1.414 1.414zm2.121-14.85l1.414 1.415l-2.121 2.121l-1.414-1.414zM5.636 16.95l1.414 1.414l-2.121 2.121l-1.414-1.414zM23 11v2h-3v-2zM4 11v2H1v-2z"
148
- }, null, -1)
149
- ])]);
150
- }
151
- const Gt = F({ name: "ri-sun-line", render: qt }), Jt = {
152
- viewBox: "0 0 24 24",
153
- width: "1.2em",
154
- height: "1.2em"
155
- };
156
- function Xt(e, n) {
157
- return f(), v("svg", Jt, [...n[0] || (n[0] = [
158
- a("path", {
159
- fill: "currentColor",
160
- d: "M3 4h18v2H3zm0 7h18v2H3zm0 7h18v2H3z"
161
- }, null, -1)
162
- ])]);
163
- }
164
- const Yt = F({ name: "ri-menu-line", render: Xt }), Zt = {}, Qt = {
165
- class: "animate-spin h-6 w-6",
166
- fill: "none",
167
- viewBox: "0 0 24 24"
168
- };
169
- function en(e, n) {
170
- return f(), v("svg", Qt, [...n[0] || (n[0] = [
171
- a("circle", {
172
- class: "opacity-25",
173
- cx: "12",
174
- cy: "12",
175
- r: "10",
176
- stroke: "currentColor",
177
- "stroke-width": "2"
178
- }, null, -1),
179
- a("path", {
180
- class: "opacity-75",
181
- fill: "currentColor",
182
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
183
- }, null, -1)
184
- ])]);
185
- }
186
- const Ve = /* @__PURE__ */ ge(Zt, [["render", en]]), tn = "relative flex justify-center items-center transition not-disabled:cursor-pointer not-disabled:hover:opacity-90 disabled:opacity-40 rounded", A = /* @__PURE__ */ V({
187
- __name: "VButton",
188
- props: {
189
- outline: { type: Boolean, default: !1 },
190
- color: { default: "transparent" },
191
- size: { default: "md" },
192
- type: { default: "button" },
193
- href: { default: "" },
194
- to: { default: "" },
195
- loading: { type: Boolean, default: !1 }
196
- },
197
- emits: ["click"],
198
- setup(e, { emit: n }) {
199
- const l = n, s = (C) => l("click", C), t = e.outline ? "dark:text-white border border-green-600 text-green-600" : "text-white bg-green-600 dark:bg-green-800", o = e.outline ? "dark:text-white border border-red-600 text-red-600" : "text-white bg-red-600 dark:bg-red-800", i = e.outline ? "dark:text-white border border-gray-600 text-gray-600" : "bg-gray-100 dark:bg-gray-800", d = e.outline ? "dark:text-white border border-blue-600 text-blue-600" : "text-white bg-blue-700 dark:bg-blue-800", u = (e.outline, ""), r = { green: t, red: o, gray: i, blue: d, transparent: u }, c = {
200
- button: "px-3",
201
- icon: "rounded-full border border-gray-200 dark:border-gray-800"
202
- }, m = {
203
- button: { sm: "h-8", md: "h-10", lg: "h-12", xl: "h-14" },
204
- icon: { sm: "size-8", md: "size-10", lg: "size-12", xl: "size-14" }
205
- }, p = L(() => [tn, _(e.color), x(e.type), h(e.type, e.size)]), g = L(() => e.href || e.to ? "router-link" : "button"), h = (C, z) => {
206
- var j;
207
- return ((j = m[C]) == null ? void 0 : j[z]) || "";
208
- }, x = (C) => (c == null ? void 0 : c[C]) || "", _ = (C) => r == null ? void 0 : r[C];
209
- return (C, z) => (f(), M(de(g.value), N(C.$attrs, {
210
- href: e.href,
211
- to: e.to,
212
- class: p.value,
213
- onClick: s
214
- }), {
215
- default: y(() => [
216
- a("span", {
217
- class: B(e.loading ? "opacity-0" : "")
218
- }, [
219
- $(C.$slots, "default")
220
- ], 2),
221
- e.loading ? (f(), M(Ve, {
222
- key: 0,
223
- class: "absolute left-1/2 -translate-x-1/2"
224
- })) : E("", !0)
225
- ]),
226
- _: 3
227
- }, 16, ["href", "to", "class"]));
228
- }
229
- }), nn = {
230
- viewBox: "0 0 24 24",
231
- width: "1.2em",
232
- height: "1.2em"
233
- };
234
- function ln(e, n) {
235
- return f(), v("svg", nn, [...n[0] || (n[0] = [
236
- a("path", {
237
- fill: "currentColor",
238
- d: "m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"
239
- }, null, -1)
240
- ])]);
241
- }
242
- const ne = F({ name: "ri-close-line", render: ln }), sn = { class: "flex items-center absolute right-3 top-5 z-10" }, Xe = /* @__PURE__ */ V({
243
- __name: "VPopup",
244
- props: {
245
- hiddenCloser: { type: Boolean },
246
- size: { default: "auto" }
247
- },
248
- emits: ["close", "click", "open"],
249
- setup(e, { emit: n }) {
250
- const l = n, { show: s, overlay: t, onClose: o, onOpen: i } = Ue(l), d = Me(null), u = Me(null), { opacity: r, transform: c } = yt(d, u, o), g = { click: (_) => {
251
- l("click", _);
252
- }, open: i, set: (_) => {
253
- _ ? i() : o(new Event("hide"));
254
- } }, h = L(() => ({
255
- auto: "max-h-[calc(100dvh-50px)]",
256
- full: "h-[calc(100dvh-24px)] md:h-[calc(100dvh-100px)]",
257
- screen: "h-dvh"
258
- })), x = L(() => ({
259
- auto: "max-h-[calc(100dvh-50px-16px)]",
260
- full: "h-[calc(100dvh-24px-16px)] md:h-[calc(100dvh-100px-16px)]",
261
- screen: "h-[calc(100dvh-16px)]"
262
- }));
263
- return (_, C) => {
264
- const z = ne, j = A;
265
- return f(), M(He, { to: "body" }, [
266
- b(ae, {
267
- "enter-active-class": "duration-300 ease-out",
268
- "enter-from-class": "transform opacity-0 translate-y-full xl:-translate-y-2",
269
- "enter-to-class": "opacity-100 translate-y-0",
270
- "leave-active-class": "duration-200 ease-in",
271
- "leave-from-class": "opacity-100 translate-y-0",
272
- "leave-to-class": "transform opacity-0 translate-y-full xl:-translate-y-2"
273
- }, {
274
- default: y(() => [
275
- T(s) ? (f(), v("div", {
276
- key: 0,
277
- ref_key: "container",
278
- ref: u,
279
- class: "fixed bottom-0 left-0 w-full z-15"
280
- }, [
281
- T(t) ? (f(), v("div", {
282
- key: 0,
283
- class: "fixed h-full w-full top-0 left-0 bg-black/40 bg-blur xl:hidden animate-opacity overscroll-contain",
284
- style: Q({ opacity: T(r) }),
285
- onClick: C[0] || (C[0] = //@ts-ignore
286
- (...X) => T(o) && T(o)(...X)),
287
- onWheel: C[1] || (C[1] = H(() => {
288
- }, ["prevent"])),
289
- onTouchmove: C[2] || (C[2] = H(() => {
290
- }, ["prevent"]))
291
- }, null, 36)) : E("", !0),
292
- a("div", {
293
- class: B(["bg-white dark:bg-gray-900 w-full shadow-nav relative", h.value[e.size]]),
294
- style: Q({ transform: T(c) })
295
- }, [
296
- a("div", {
297
- ref_key: "target",
298
- ref: d,
299
- class: "flex justify-center py-3 md:pb-6",
300
- onWheel: C[3] || (C[3] = H(() => {
301
- }, ["prevent"])),
302
- onTouchmove: C[4] || (C[4] = H(() => {
303
- }, ["prevent"]))
304
- }, [...C[5] || (C[5] = [
305
- a("div", { class: "self-end h-1 w-12 bg-gray-400" }, null, -1)
306
- ])], 544),
307
- a("div", sn, [
308
- $(_.$slots, "button", { close: T(o) }),
309
- b(j, {
310
- class: "size-5 md:size-6",
311
- color: "transparent",
312
- size: "none",
313
- icon: "",
314
- "aria-label": "Close",
315
- onClick: T(o)
316
- }, {
317
- default: y(() => [
318
- b(z, { class: "size-5" })
319
- ]),
320
- _: 1
321
- }, 8, ["onClick"])
322
- ]),
323
- a("div", {
324
- class: B(["overflow-y-auto max-h-[calc(100dvh-24px-16px)] overscroll-contain scrollbar", x.value[e.size]])
325
- }, [
326
- $(_.$slots, "default", {
327
- close: T(o),
328
- on: g
329
- })
330
- ], 2)
331
- ], 6)
332
- ], 512)) : E("", !0)
333
- ]),
334
- _: 3
335
- })
336
- ]);
337
- };
338
- }
339
- }), on = { class: "relative" }, an = { class: "flex items-center cursor-pointer" }, be = /* @__PURE__ */ V({
340
- __name: "VDropdown",
341
- props: {
342
- title: { default: "" },
343
- top: { default: "calc(100% + 8px)" },
344
- left: { default: "" },
345
- right: { default: "0" },
346
- bottom: { default: "" },
347
- height: { default: "200px" },
348
- hideOnClick: { type: Boolean, default: !0 },
349
- disabled: { type: Boolean, default: !1 },
350
- isPopup: { type: Boolean }
351
- },
352
- emits: ["click", "show", "close"],
353
- setup(e, { emit: n }) {
354
- const l = n, t = Ke(We).greaterOrEqual("lg"), o = D(!1), i = L(() => ({ top: e.top, left: e.left, right: e.right, bottom: e.bottom, "max-height": e.height })), d = (h) => {
355
- t.value && o.value && c(h);
356
- }, u = (h) => {
357
- l("click", o.value), !e.disabled && (o.value ? e.hideOnClick && c(h) : r(h));
358
- }, r = (h) => {
359
- o.value = !0, l("show", h);
360
- }, c = (h) => {
361
- o.value = !1, l("close", h);
362
- }, m = (h) => {
363
- h ? r(new Event("show")) : c(new Event("hide"));
364
- }, p = () => {
365
- c(new Event("hide"));
366
- }, g = { click: u, open: r, set: m };
367
- return (h, x) => {
368
- const _ = ft("outside");
369
- return Ce((f(), v("div", on, [
370
- a("div", an, [
371
- $(h.$slots, "activator", {
372
- on: g,
373
- isShow: o.value
374
- })
375
- ]),
376
- T(t) ? (f(), M(ae, {
377
- key: 0,
378
- "enter-active-class": "duration-300 ease-out",
379
- "enter-from-class": "transform opacity-0 -translate-y-2",
380
- "enter-to-class": "opacity-100 translate-y-0",
381
- "leave-active-class": "duration-200 ease-in",
382
- "leave-from-class": "opacity-100 translate-y-0",
383
- "leave-to-class": "transform opacity-0 -translate-y-2"
384
- }, {
385
- default: y(() => [
386
- o.value ? (f(), v("div", {
387
- key: 0,
388
- class: "z-30 min-w-full absolute",
389
- style: Q(i.value)
390
- }, [
391
- $(h.$slots, "default", {
392
- on: g,
393
- show: r,
394
- hide: c,
395
- isShow: o.value
396
- })
397
- ], 4)) : E("", !0)
398
- ]),
399
- _: 3
400
- })) : E("", !0),
401
- !T(t) && o.value ? (f(), M(Xe, {
402
- key: 1,
403
- title: e.title,
404
- onClose: p
405
- }, {
406
- default: y(({ on: C }) => [
407
- $(h.$slots, "default", {
408
- on: C,
409
- show: r,
410
- hide: c,
411
- isShow: o.value
412
- })
413
- ]),
414
- _: 3
415
- }, 8, ["title"])) : E("", !0)
416
- ])), [
417
- [_, d]
418
- ]);
419
- };
420
- }
421
- }), rn = { class: "bg-white dark:bg-gray-900 ring-1 ring-gray-200 dark:ring-gray-800" }, cn = ["onClick"], me = /* @__PURE__ */ V({
422
- __name: "VList",
423
- props: {
424
- items: {}
425
- },
426
- emits: ["click"],
427
- setup(e, { emit: n }) {
428
- const l = n, s = (t, o) => l("click", t, o);
429
- return (t, o) => (f(), v("ul", rn, [
430
- (f(!0), v(O, null, R(e.items, (i) => (f(), v("li", {
431
- key: i.name,
432
- class: "whitespace-nowrap cursor-pointer flex items-center min-h-[40px] border-b last:border-b-0 dark:border-gray-700 border-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700/30 w-full px-4",
433
- onClick: (d) => s(i, d)
434
- }, [
435
- $(t.$slots, "default", { item: i }, () => [
436
- I(k(i.name), 1)
437
- ])
438
- ], 8, cn))), 128))
439
- ]));
440
- }
441
- }), dn = { class: "bg-white dark:bg-gray-900 border-b border-gray-300 dark:border-gray-700 left-0 w-full z-10 sticky top-0" }, un = { class: "px-4 py-4 sm:px-6 lg:px-8" }, fn = { class: "container mx-auto flex flex-auto items-center" }, mn = { class: "lg:hidden h-[30px]" }, vn = { class: "gap-4 hidden lg:flex" }, pn = { class: "lg:hidden flex gap-4" }, hn = { class: "ms-2" }, Va = /* @__PURE__ */ V({
442
- __name: "AppHeader",
443
- props: {
444
- changeTheme: { type: Function },
445
- notifications: {}
446
- },
447
- emits: ["sidebar", "notif"],
448
- setup(e, { emit: n }) {
449
- const l = n, s = [
450
- { name: "Theme", value: 1 },
451
- { name: "Notification", value: 2 },
452
- { name: "Logout", value: 3 }
453
- ], t = L(() => !!e.notifications.find((c) => c.isNew)), o = (c) => l("sidebar", c), i = (c) => l("notif", c), d = async () => await fetch("/", { headers: { Authorization: "Basic AAAAAAAAAAAAAAAAAAA=" } }), u = () => {
454
- e.changeTheme && e.changeTheme();
455
- }, r = ({ value: c }, m) => {
456
- c == 1 && u(), c == 2 && i(m), c == 3 && d();
457
- };
458
- return (c, m) => {
459
- const p = Yt, g = Pe("router-link"), h = Gt, x = Kt, _ = Je, C = Ht, z = Ge;
460
- return f(), v("header", dn, [
461
- a("div", un, [
462
- a("div", fn, [
463
- b(A, {
464
- type: "icon",
465
- onClick: o
466
- }, {
467
- default: y(() => [
468
- b(p, { class: "size-5" })
469
- ]),
470
- _: 1
471
- }),
472
- m[1] || (m[1] = a("div", { class: "lg:hidden flex-auto" }, null, -1)),
473
- a("div", mn, [
474
- b(g, { to: "/" }, {
475
- default: y(() => [
476
- b(Se, { class: "h-[30px] text-primary" })
477
- ]),
478
- _: 1
479
- })
480
- ]),
481
- m[2] || (m[2] = a("div", { class: "flex-auto" }, null, -1)),
482
- a("div", vn, [
483
- b(A, {
484
- type: "icon",
485
- onClick: u
486
- }, {
487
- default: y(() => [
488
- b(h, { class: "dark:hidden" }),
489
- b(x, { class: "hidden dark:flex" })
490
- ]),
491
- _: 1
492
- }),
493
- b(A, {
494
- type: "icon",
495
- onClick: i
496
- }, {
497
- default: y(() => [
498
- a("span", {
499
- class: B([t.value ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
500
- }, [...m[0] || (m[0] = [
501
- a("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
502
- ])], 2),
503
- b(_, { class: "size-5" })
504
- ]),
505
- _: 1
506
- }),
507
- b(A, {
508
- type: "icon",
509
- onClick: H(d, ["prevent"])
510
- }, {
511
- default: y(() => [
512
- b(C, { class: "size-5" })
513
- ]),
514
- _: 1
515
- })
516
- ]),
517
- a("div", pn, [
518
- b(be, {
519
- left: "unset",
520
- right: "0",
521
- top: "0"
522
- }, {
523
- activator: y(({ on: j }) => [
524
- b(A, {
525
- type: "icon",
526
- class: "flex",
527
- onClick: j.click
528
- }, {
529
- default: y(() => [
530
- b(z)
531
- ]),
532
- _: 1
533
- }, 8, ["onClick"])
534
- ]),
535
- default: y(() => [
536
- b(me, {
537
- items: s,
538
- onClick: r
539
- }, {
540
- default: y(({ item: j }) => [
541
- a("span", hn, k(j.name), 1)
542
- ]),
543
- _: 1
544
- })
545
- ]),
546
- _: 1
547
- })
548
- ])
549
- ])
550
- ])
551
- ]);
552
- };
553
- }
554
- }), gn = { class: "relative flex items-center gap-2 w-full p-2 overflow-hidden" }, bn = { class: "flex-auto text-xs" }, yn = { class: "text-gray-500 dark:text-gray-400 mt-1" }, xn = /* @__PURE__ */ V({
555
- __name: "CardNotification",
556
- props: {
557
- empty: {},
558
- key: {},
559
- isNew: {},
560
- color: {},
561
- timeout: {},
562
- date: {},
563
- text: {}
564
- },
565
- emits: ["remove", "read"],
566
- setup(e, { emit: n }) {
567
- const l = e, s = n, t = ["", "bg-green-500", "bg-red-500", "bg-yellow-500", "bg-blue-500"], o = (u) => t[u], i = (u) => s("remove", u), d = (u) => s("read", u);
568
- return (u, r) => {
569
- const c = Je, m = ne;
570
- return f(), v("div", gn, [
571
- a("div", {
572
- class: B(["absolute left-0 top-0 w-[3px] h-full", o(l.color)])
573
- }, null, 2),
574
- b(A, {
575
- class: "shrink-0",
576
- type: "icon",
577
- onClick: d
578
- }, {
579
- default: y(() => [
580
- a("span", {
581
- class: B([l.isNew ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
582
- }, [...r[0] || (r[0] = [
583
- a("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
584
- ])], 2),
585
- b(c, { class: "size-5" })
586
- ]),
587
- _: 1
588
- }),
589
- a("div", bn, [
590
- a("div", null, k(l.text), 1),
591
- a("div", yn, k(T(kt)(l.date)) + " (" + k(T(_t)(l.date)) + ")", 1)
592
- ]),
593
- b(A, {
594
- class: "shrink-0",
595
- type: "icon",
596
- size: "sm",
597
- onClick: i
598
- }, {
599
- default: y(() => [
600
- b(m, { class: "size-4" })
601
- ]),
602
- _: 1
603
- })
604
- ]);
605
- };
606
- }
607
- }), $n = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, kn = {
608
- key: 0,
609
- class: "flex flex-col gap-2 p-2"
610
- }, Ba = /* @__PURE__ */ V({
611
- __name: "AppNotification",
612
- props: {
613
- value: { type: Boolean },
614
- notifications: {}
615
- },
616
- emits: ["close", "remove", "read"],
617
- setup(e, { emit: n }) {
618
- const l = e, s = n, t = L(() => !!l.notifications.find((r) => r.isNew)), o = L(() => !!l.notifications.length), i = (r) => s("close", r), d = (r) => s("remove", r), u = (r) => s("read", r);
619
- return (r, c) => (f(), v(O, null, [
620
- l.value ? (f(), v("div", {
621
- key: 0,
622
- class: "overlay fixed left-0 top-0 h-full w-full bg-black/40 bg-blur",
623
- onClick: i
624
- })) : E("", !0),
625
- a("aside", {
626
- class: B([l.value ? "translate-x-0 " : "translate-x-full", "overflow-x-hidden fixed top-[73px] right-0 flex h-[calc(100%-73px)] w-[290px] md:w-80 border-l border-gray-200 flex-col overflow-y-auto transition-all duration-350 dark:border-gray-800 bg-white dark:bg-gray-900"])
627
- }, [
628
- a("div", $n, [
629
- $(r.$slots, "header", { isNew: t.value }),
630
- o.value ? (f(), v("div", kn, [
631
- b(Ne, {
632
- "enter-active-class": "transition-all duration-300 ",
633
- "enter-from-class": "opacity-0 translate-x-1/2",
634
- "enter-to-class": "opacity-100 translate-x-0",
635
- "leave-active-class": "transition-all duration-300 absolute",
636
- "leave-from-class": "opacity-100 translate-x-0",
637
- "leave-to-class": "opacity-0 translate-x-1/2"
638
- }, {
639
- default: y(() => [
640
- (f(!0), v(O, null, R(l.notifications, (m) => (f(), v("div", {
641
- key: m.date,
642
- class: "relative"
643
- }, [
644
- $(r.$slots, "card", { item: m }, () => [
645
- b(xn, N({ ref_for: !0 }, m, {
646
- class: "bg-gray-200/50 dark:bg-gray-800/50 rounded-md",
647
- onRemove: (p) => d(m),
648
- onRead: (p) => u(m)
649
- }), null, 16, ["onRemove", "onRead"])
650
- ])
651
- ]))), 128))
652
- ]),
653
- _: 3
654
- })
655
- ])) : $(r.$slots, "empty", {}, void 0, void 0, 1)
656
- ])
657
- ], 2)
658
- ], 64));
659
- }
660
- }), _n = {}, wn = { class: "fixed h-full w-full top-0 left-0 z-20" }, Cn = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" };
661
- function zn(e, n) {
662
- return f(), v("div", wn, [
663
- n[0] || (n[0] = a("div", { class: "absolute h-full w-full top-0 left-0 bg-black/60 bg-blur" }, null, -1)),
664
- a("div", Cn, [
665
- $(e.$slots, "default")
666
- ])
667
- ]);
668
- }
669
- const Ea = /* @__PURE__ */ ge(_n, [["render", zn]]), Sn = {
670
- viewBox: "0 0 24 24",
671
- width: "1.2em",
672
- height: "1.2em"
673
- };
674
- function Vn(e, n) {
675
- return f(), v("svg", Sn, [...n[0] || (n[0] = [
676
- a("path", {
677
- fill: "currentColor",
678
- d: "m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"
679
- }, null, -1)
680
- ])]);
681
- }
682
- const Bn = F({ name: "ri-arrow-right-s-line", render: Vn }), En = { class: "mb-4 flex flex-col gap-2" }, Tn = { class: "size-6 flex-[0_0_24px] opacity-60" }, Ln = ["onClick"], Mn = { class: "flex flex-col gap-2" }, An = { class: "flex gap-2 ms-8" }, Dn = { class: "size-5 flex-[0_0_24px]" }, In = { class: "flex-1 first-letter:uppercase text-sm" }, Ta = /* @__PURE__ */ V({
683
- __name: "AppNav",
684
- props: {
685
- menu: { default: () => [] },
686
- fullPath: { default: "" },
687
- isSidebar: { type: Boolean, default: !1 }
688
- },
689
- emits: ["sidebar"],
690
- setup(e, { emit: n }) {
691
- const l = n, s = D(""), t = ({ name: i }) => {
692
- e.isSidebar && l("sidebar", !e.isSidebar), s.value !== i && (s.value = s.value === i ? "" : i);
693
- }, o = (i) => e.fullPath === i;
694
- return ue(
695
- () => e.menu,
696
- () => {
697
- var i;
698
- return s.value = ((i = wt(e.menu, e.fullPath)) == null ? void 0 : i.name) || "";
699
- }
700
- ), (i, d) => {
701
- const u = Bn;
702
- return f(), v("nav", null, [
703
- a("ul", En, [
704
- (f(!0), v(O, null, R(e.menu, (r) => (f(), v("li", {
705
- key: r.name
706
- }, [
707
- (f(), M(de(r.path ? "router-link" : "span"), {
708
- to: r.path,
709
- class: B(["flex gap-2 items-center px-3 py-2 rounded", o(r.path) ? "bg-blue-500/10" : "hover:bg-gray-500/10"]),
710
- onClick: H((c) => t(r), ["prevent", "stop"])
711
- }, {
712
- default: y(() => [
713
- a("div", Tn, [
714
- $(i.$slots, "icon", { item: r })
715
- ]),
716
- a("span", {
717
- class: B(["flex-1 first-letter:uppercase text-sm", e.isSidebar ? "lg:hidden" : ""])
718
- }, k(r.name), 3),
719
- a("button", {
720
- class: B(["cursor-pointer", [e.isSidebar ? "lg:hidden" : ""]]),
721
- onClick: H((c) => t(r), ["prevent", "stop"])
722
- }, [
723
- r.children ? (f(), M(u, { key: 0 })) : E("", !0)
724
- ], 10, Ln)
725
- ]),
726
- _: 2
727
- }, 1032, ["to", "class", "onClick"])),
728
- r.children ? (f(), v("div", {
729
- key: 0,
730
- class: B(["translate transform overflow-hidden mt-2", [e.isSidebar ? "lg:hidden" : "", s.value === r.name ? "block" : "hidden"]])
731
- }, [
732
- a("ul", Mn, [
733
- (f(!0), v(O, null, R(r.children, ({ name: c, path: m, icon: p }) => (f(), v("li", { key: c }, [
734
- (f(), M(de(m ? "router-link" : "span"), {
735
- to: m,
736
- class: B(["flex gap-2 items-center px-3 py-2 rounded", o(m) ? "bg-blue-500/10" : "hover:bg-gray-500/10"])
737
- }, {
738
- default: y(() => [
739
- a("div", An, [
740
- a("div", Dn, [
741
- $(i.$slots, "icon-children", {
742
- item: { name: c, path: m, icon: p }
743
- })
744
- ]),
745
- a("span", In, k(c), 1)
746
- ])
747
- ]),
748
- _: 2
749
- }, 1032, ["to", "class"]))
750
- ]))), 128))
751
- ])
752
- ], 2)) : E("", !0)
753
- ]))), 128))
754
- ])
755
- ]);
756
- };
757
- }
758
- }), On = {
759
- key: 0,
760
- class: "w-full min-w-[260px] max-w-xs p-4 bg-white rounded shadow-lg dark:bg-gray-800",
761
- role: "alert"
762
- }, jn = { class: "flex items-center gap-4 text-sm" }, Pn = {
763
- key: 0,
764
- class: "text-green-600"
765
- }, Hn = {
766
- key: 1,
767
- class: "relative block h-4 w-full rounded overflow-hidden bg-gray-200 dark:bg-gray-900/50 select-none mt-2"
768
- }, Nn = { class: "absolute left-[140px] top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, Fn = { class: "absolute left-[140px] top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, La = /* @__PURE__ */ V({
769
- __name: "AppProgress",
770
- props: {
771
- timeout: { default: 5e3 },
772
- key: {},
773
- status: { default: 0 },
774
- empty: {},
775
- size: { default: 0 },
776
- length: { default: 0 }
777
- },
778
- setup(e) {
779
- const n = D(!1), l = L(() => !!e.length), s = L(() => !!(l.value && t.value === 100 && !e.status)), t = L(() => e.status ? Math.ceil(e.size * 100 / e.length) : 100), o = ze(() => {
780
- n.value = !1;
781
- }, e.timeout);
782
- return ue(
783
- () => [e.size, e.status],
784
- () => {
785
- n.value = !0, o();
786
- }
787
- ), (i, d) => {
788
- const u = ne;
789
- return f(), M(ae, {
790
- "enter-active-class": "duration-300 ease-out",
791
- "enter-from-class": "transform opacity-0 translate-x-full",
792
- "enter-to-class": "opacity-100 translate-x-0",
793
- "leave-active-class": "duration-200 ease-in",
794
- "leave-from-class": "opacity-100 translate-y-0",
795
- "leave-to-class": "transform opacity-0 -translate-y-8"
796
- }, {
797
- default: y(() => [
798
- n.value ? (f(), v("div", On, [
799
- a("div", jn, [
800
- $(i.$slots, "default", { isDone: s.value }, () => [
801
- d[1] || (d[1] = a("div", { class: "flex-auto" }, "Progress...", -1)),
802
- s.value ? (f(), v("span", Pn, "Done")) : E("", !0)
803
- ]),
804
- a("button", {
805
- class: "cursor-pointer transition text-gray-700 dark:text-gray-400 self-start hover:text-gray-600",
806
- onClick: d[0] || (d[0] = (r) => n.value = !1)
807
- }, [
808
- b(u, { class: "size-4" })
809
- ])
810
- ]),
811
- l.value ? (f(), v("div", {
812
- key: 0,
813
- class: "h-[2px] fixed top-0 left-0 w-full bg-blue-600 transition-all duration-500",
814
- style: Q(`width: ${t.value}%`)
815
- }, null, 4)) : E("", !0),
816
- l.value ? (f(), v("div", Hn, [
817
- a("div", Nn, k(t.value) + "%", 1),
818
- a("div", {
819
- class: "bg-blue-600 rounded h-4 overflow-hidden relative transition-all duration-500",
820
- style: Q(`width: ${t.value}%`)
821
- }, [
822
- a("div", Fn, k(t.value) + "%", 1)
823
- ], 4)
824
- ])) : E("", !0)
825
- ])) : E("", !0)
826
- ]),
827
- _: 3
828
- });
829
- };
830
- }
831
- }), Rn = { class: "my-4 text-gray-700 dark:text-gray-400" }, Un = { class: "flex flex-col md:flex-row flex-wrap md:gap-4 text-sm" }, Kn = { class: "flex gap-2" }, Wn = { class: "text-gray-700 dark:text-gray-400" }, qn = { class: "flex gap-2" }, Gn = { class: "flex gap-2" }, Jn = { class: "text-gray-700 dark:text-gray-400" }, Xn = { class: "flex gap-2" }, Yn = { class: "text-gray-700 dark:text-gray-400" }, Zn = { class: "flex flex-col gap-4 text-sm" }, Qn = { class: "flex gap-4" }, Ma = /* @__PURE__ */ V({
832
- __name: "BlockInfo",
833
- props: {
834
- pkg: {},
835
- key: {},
836
- id: { default: 0 },
837
- firmware: { default: () => [] },
838
- totalBytes: {},
839
- usedBytes: {},
840
- uptime: {},
841
- name: {},
842
- board: {}
843
- },
844
- setup(e) {
845
- const n = L(() => e.firmware.join(".")), l = L(() => {
846
- var t, o, i, d, u, r, c;
847
- const s = [];
848
- return (t = e.pkg) != null && t.homepage && s.push({ name: "homepage", href: e.pkg.homepage }), (i = (o = e.pkg) == null ? void 0 : o.repository) != null && i.url && s.push({ name: "repository", href: e.pkg.repository.url }), (u = (d = e.pkg) == null ? void 0 : d.bugs) != null && u.url && s.push({ name: "bugs", href: e.pkg.bugs.url }), (r = e.pkg) != null && r.author && s.push({ name: "author", href: `mailto:${(c = e.pkg) == null ? void 0 : c.author}` }), s;
849
- });
850
- return (s, t) => {
851
- var o, i;
852
- return f(), v("div", null, [
853
- a("p", Rn, k((o = e.pkg) == null ? void 0 : o.description), 1),
854
- a("div", Un, [
855
- a("div", Kn, [
856
- t[0] || (t[0] = I(" Firmware (hw): ", -1)),
857
- a("span", Wn, k(n.value), 1)
858
- ]),
859
- a("div", qn, [
860
- a("div", Gn, [
861
- t[1] || (t[1] = I(" Version (web): ", -1)),
862
- a("span", Jn, k((i = e.pkg) == null ? void 0 : i.version), 1)
863
- ])
864
- ]),
865
- t[3] || (t[3] = a("div", { class: "flex-auto" }, null, -1)),
866
- a("div", Xn, [
867
- t[2] || (t[2] = I(" ID: ", -1)),
868
- a("span", Yn, k(e.id.toString(16)), 1)
869
- ])
870
- ]),
871
- t[4] || (t[4] = a("hr", { class: "dark:text-gray-700 text-gray-200 my-2" }, null, -1)),
872
- a("div", Zn, [
873
- a("div", Qn, [
874
- $(s.$slots, "links", { links: l.value })
875
- ])
876
- ])
877
- ]);
878
- };
879
- }
880
- }), el = { class: "relative flex items-end gap-0.5 w-10" }, tl = ["title"], nl = { class: "absolute -top-1 -left-1 text-xs text-gray-600 dark:text-gray-300" }, Ye = /* @__PURE__ */ V({
881
- __name: "VWifiIcon",
882
- props: {
883
- rssi: { default: 0 },
884
- channel: { default: 0 }
885
- },
886
- setup(e) {
887
- const n = 2 * (e.rssi + 100), l = (s) => s < n;
888
- return (s, t) => (f(), v("div", el, [
889
- (f(), v(O, null, R([10, 15, 25, 40, 70], (o, i) => a("div", {
890
- key: o,
891
- class: B(["w-1 h-5 rounded-lg", [l(o) ? "bg-gray-900 dark:bg-gray-100" : "bg-gray-300 dark:bg-gray-700"]]),
892
- style: Q(`height: ${(i + 1) * 5}px`),
893
- title: `rssi: ${e.rssi} channel: ${e.channel}`
894
- }, null, 14, tl)), 64)),
895
- a("div", nl, k(e.channel), 1)
896
- ]));
897
- }
898
- }), ll = ["onClick"], sl = { class: "mr-2" }, ol = { class: "text-sm" }, al = { class: "text-gray-400 text-xs" }, il = {
899
- key: 0,
900
- class: "flex justify-center"
901
- }, rl = { class: "flex justify-end mt-4" }, Aa = /* @__PURE__ */ V({
902
- __name: "BlockScan",
903
- props: {
904
- items: { default: () => [] }
905
- },
906
- emits: ["scan", "select"],
907
- setup(e, { emit: n }) {
908
- const l = n, s = ["OPEN", "WEP", "WPA_PSK", "WPA2_PSK", "WPA_WPA2_PSK", "MAX", "", "NO", "AUTO"], t = (i) => l("select", i), o = (i) => l("scan", i);
909
- return (i, d) => {
910
- const u = Ye, r = me, c = Ve, m = A;
911
- return f(), v("div", null, [
912
- b(r, {
913
- items: e.items,
914
- class: "bg-transparent! ring-0!"
915
- }, {
916
- default: y(({ item: p }) => [
917
- a("div", {
918
- class: "flex items-center w-full",
919
- onClick: (g) => t(p)
920
- }, [
921
- a("div", sl, [
922
- b(u, U(K(p)), null, 16)
923
- ]),
924
- a("div", null, [
925
- a("div", ol, k(p.ssid), 1),
926
- a("div", al, k(i.$t("security")) + " : " + k(s[p.encryptionType] || "unknown"), 1)
927
- ])
928
- ], 8, ll)
929
- ]),
930
- _: 1
931
- }, 8, ["items"]),
932
- e.items.length ? E("", !0) : (f(), v("div", il, [
933
- b(c, { class: "text-primary" })
934
- ])),
935
- a("div", rl, [
936
- b(m, {
937
- color: "blue",
938
- onClick: o
939
- }, {
940
- default: y(() => [
941
- I(k(i.$t("scan")), 1)
942
- ]),
943
- _: 1
944
- })
945
- ])
946
- ]);
947
- };
948
- }
949
- }), cl = {
950
- viewBox: "0 0 24 24",
951
- width: "1.2em",
952
- height: "1.2em"
953
- };
954
- function dl(e, n) {
955
- return f(), v("svg", cl, [...n[0] || (n[0] = [
956
- a("path", {
957
- fill: "currentColor",
958
- d: "m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"
959
- }, null, -1)
960
- ])]);
961
- }
962
- const ul = F({ name: "ri-arrow-up-s-line", render: dl }), fl = { class: "w-full relative" }, ml = ["disabled"], vl = {
963
- key: 0,
964
- class: "text-red-400 h-[24px] px-2 text-xs"
965
- }, pl = "after:absolute after:h-1 after:w-full after:left-0 after:translate-y-[6px] after:-z-10 dark:after:bg-gray-800 after:bg-white after:transition-all", J = /* @__PURE__ */ V({
966
- __name: "VTextField",
967
- props: {
968
- modelValue: { default: null },
969
- label: { default: "" },
970
- component: { default: "input" },
971
- type: { default: "text" },
972
- message: { default: "" },
973
- readonly: { type: Boolean },
974
- disabled: { type: [Boolean, Number], default: !1 },
975
- active: { type: Boolean, default: !1 },
976
- hideMessage: { type: Boolean, default: !1 }
977
- },
978
- emits: ["update:modelValue", "click", "on-icon", "enter", "blur", "focus"],
979
- setup(e, { emit: n }) {
980
- const l = n, s = {
981
- input: "w-full h-full px-4 outline-none overflow-ellipsis flex-auto overflow-hidden w-[calc(100% - 20px)] bg-transparent",
982
- textarea: "h-full w-full px-4 py-2 outline-none flex-auto bg-transparent"
983
- }, t = D(!1), o = L(() => [
984
- e.component === "input" ? "h-[40px]" : "min-h-[40px]",
985
- e.message ? "border-red-500 hover:border-red-400" : "",
986
- e.disabled ? "border-gray-400 opacity-40" : "border-gray-300 hover:border-gray-400 dark:border-gray-700/50 hover:dark:border-gray-600/50"
987
- ]), i = L(() => s[e.component]), d = (_) => _ || _ === 0, u = L(() => [pl, t.value || d(e.modelValue) || e.active ? "top-0 left-3 text-xs" : "top-1/2"]), r = L(() => e.component === "input"), c = (_) => {
988
- t.value = !1, l("blur", _);
989
- }, m = (_) => {
990
- t.value = !0, l("focus", _);
991
- }, p = ({ target: _ }) => l("update:modelValue", _.value), g = (_) => l("enter", _), h = (_) => l("click", _), x = (_) => {
992
- e.disabled || l("on-icon", _);
993
- };
994
- return (_, C) => (f(), v("div", fl, [
995
- a("label", {
996
- class: B(["relative w-full border border-gray-300 dark:border-gray-700 flex items-center rounded transition bg-white dark:bg-gray-800", o.value])
997
- }, [
998
- a("span", {
999
- class: B(["absolute left-4 transition-all rounded -translate-y-1/2 text-gray-600 dark:text-gray-400", u.value])
1000
- }, k(e.label), 3),
1001
- (f(), M(de(e.component), N(_.$attrs, {
1002
- value: e.modelValue,
1003
- disabled: !!e.disabled,
1004
- type: e.type,
1005
- readonly: e.readonly,
1006
- rows: r.value ? null : "2",
1007
- wrap: r.value ? null : "soft",
1008
- class: i.value,
1009
- onFocus: m,
1010
- onBlur: c,
1011
- onInput: p,
1012
- onClick: h,
1013
- onKeypress: mt(g, ["enter"])
1014
- }), null, 16, ["value", "disabled", "type", "readonly", "rows", "wrap", "class"])),
1015
- _.$slots.icon ? (f(), v("button", {
1016
- key: 0,
1017
- disabled: !!e.disabled,
1018
- class: B([{ "cursor-pointer": !e.disabled }, "flex-[0_0_50px] h-full flex items-center justify-center text-gray-400 border-l border-gray-300 dark:border-gray-700/50"]),
1019
- onClick: x
1020
- }, [
1021
- $(_.$slots, "icon")
1022
- ], 10, ml)) : E("", !0)
1023
- ], 2),
1024
- e.hideMessage ? E("", !0) : (f(), v("div", vl, [
1025
- $(_.$slots, "message", {}, () => [
1026
- I(k(e.message), 1)
1027
- ])
1028
- ]))
1029
- ]));
1030
- }
1031
- }), hl = { class: "bg-white dark:bg-gray-900 rounded min-w-50 shadow-nav transition-all duration-400 dark:shadow-lg dark:shadow-primary/20 pb-6 lg:pb-0" }, gl = {
1032
- key: 0,
1033
- class: "lg:hidden text-title-md font-bold mb-4 uppercase px-4 sticky top-0"
1034
- }, bl = { class: "h-full h-hull lg:max-h-44 lg:overflow-auto scrollbar lg:overscroll-contain" }, te = /* @__PURE__ */ V({
1035
- inheritAttrs: !1,
1036
- __name: "VSelect",
1037
- props: {
1038
- modelValue: {},
1039
- label: {},
1040
- disabled: { type: Boolean },
1041
- items: {},
1042
- title: {},
1043
- top: {},
1044
- left: {},
1045
- right: {},
1046
- bottom: {},
1047
- height: {},
1048
- hideOnClick: { type: Boolean },
1049
- isPopup: { type: Boolean }
1050
- },
1051
- emits: ["change"],
1052
- setup(e, { emit: n }) {
1053
- const l = vt(e, ["modelValue", "label", "items", "disabled"]), s = n;
1054
- function t(o, i) {
1055
- s("change", o), i == null || i.set(!1);
1056
- }
1057
- return (o, i) => {
1058
- const d = ul;
1059
- return f(), M(be, N(l, {
1060
- "hide-on-click": !1,
1061
- class: "relative"
1062
- }), {
1063
- activator: y(({ on: u, isShow: r }) => [
1064
- $(o.$slots, "activator", U(K({ on: u, isShow: r })), () => [
1065
- b(J, {
1066
- "model-value": e.modelValue,
1067
- disabled: e.disabled,
1068
- label: e.label,
1069
- readonly: "",
1070
- hideMessage: "",
1071
- active: "",
1072
- onClick: u.click,
1073
- onOnIcon: u.click
1074
- }, {
1075
- icon: y(() => [
1076
- b(d, {
1077
- class: B(["transition duration-300", r ? "rotate-x-180" : ""])
1078
- }, null, 8, ["class"])
1079
- ]),
1080
- _: 2
1081
- }, 1032, ["model-value", "disabled", "label", "onClick", "onOnIcon"])
1082
- ])
1083
- ]),
1084
- default: y(({ on: u }) => [
1085
- a("div", hl, [
1086
- e.label ? (f(), v("h4", gl, k(e.label), 1)) : E("", !0),
1087
- a("div", bl, [
1088
- b(me, {
1089
- items: e.items,
1090
- onClick: (r) => t(r, u)
1091
- }, {
1092
- default: y(({ item: r }) => [
1093
- $(o.$slots, "item", { item: r }, () => [
1094
- I(k(r.name), 1)
1095
- ])
1096
- ]),
1097
- _: 3
1098
- }, 8, ["items", "onClick"])
1099
- ])
1100
- ])
1101
- ]),
1102
- _: 3
1103
- }, 16);
1104
- };
1105
- }
1106
- }), yl = { class: "md:flex items-center mb-4" }, xl = { class: "flex-auto text-gray-600 bg:text-gray-400 mb-2" }, $l = { class: "md:max-w-50" }, kl = { class: "flex items-center mb-4" }, _l = { class: "flex-auto text-gray-600 bg:text-gray-400" }, wl = { class: "flex items-center mb-4" }, Cl = { class: "flex-auto text-gray-600 bg:text-gray-400" }, Da = /* @__PURE__ */ V({
1107
- __name: "BlockService",
1108
- props: {
1109
- locale: {},
1110
- locales: {}
1111
- },
1112
- emits: ["reboot", "reset", "locale"],
1113
- setup(e, { emit: n }) {
1114
- const l = n, s = (o) => l("locale", o), t = (o) => {
1115
- var i;
1116
- return (i = e.locales.find((d) => d.value === o)) == null ? void 0 : i.name;
1117
- };
1118
- return (o, i) => {
1119
- const d = te, u = A;
1120
- return f(), v(O, null, [
1121
- a("div", yl, [
1122
- a("div", xl, k(o.$t("selectLang")), 1),
1123
- a("div", $l, [
1124
- b(d, {
1125
- "model-value": t(e.locale),
1126
- label: o.$t("lang"),
1127
- items: e.locales,
1128
- onChange: s
1129
- }, null, 8, ["model-value", "label", "items"])
1130
- ])
1131
- ]),
1132
- a("div", kl, [
1133
- a("div", _l, k(o.$t("rebootDev")), 1),
1134
- b(u, {
1135
- class: "min-w-[100px]",
1136
- color: "red",
1137
- outline: "",
1138
- onClick: i[0] || (i[0] = (r) => l("reboot", r))
1139
- }, {
1140
- default: y(() => [
1141
- I(k(o.$t("reboot")), 1)
1142
- ]),
1143
- _: 1
1144
- })
1145
- ]),
1146
- a("div", wl, [
1147
- a("div", Cl, k(o.$t("resetConf")), 1),
1148
- b(u, {
1149
- class: "min-w-[100px]",
1150
- color: "red",
1151
- onClick: i[1] || (i[1] = (r) => l("reset", r))
1152
- }, {
1153
- default: y(() => [
1154
- I(k(o.$t("reset")), 1)
1155
- ]),
1156
- _: 1
1157
- })
1158
- ])
1159
- ], 64);
1160
- };
1161
- }
1162
- }), zl = { class: "grid grid-cols-1 gap-4 lg:max-w-[360px] min-w-[250px]" }, Sl = { class: "flex flex-col w-full items-center gap-2" }, Vl = ["title"], Bl = { class: "absolute left-[110px] top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, El = { class: "absolute left-[110px] top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, Tl = { class: "flex justify-between w-full text-xs" }, Ll = { class: "text-gray-500 dark:text-gray-400" }, Ml = { class: "text-sm" }, Al = { class: "text-gray-500 dark:text-gray-400 text-left" }, Dl = { class: "text-right text-xs" }, Ia = /* @__PURE__ */ V({
1163
- __name: "BlockStatus",
1164
- props: {
1165
- pkg: {},
1166
- key: {},
1167
- id: { default: 0 },
1168
- firmware: { default: () => [] },
1169
- totalBytes: { default: 0 },
1170
- usedBytes: { default: 0 },
1171
- uptime: { default: 0 },
1172
- name: {},
1173
- board: {}
1174
- },
1175
- setup(e) {
1176
- const n = D(e.uptime);
1177
- let l = null;
1178
- const s = L(() => e.firmware.join(".")), t = L(() => [
1179
- { name: "used", value: pe(e.usedBytes) },
1180
- { name: "available", value: pe(e.totalBytes - e.usedBytes) },
1181
- { name: "total", value: pe(e.totalBytes) }
1182
- ]), o = L(() => {
1183
- var u;
1184
- return [
1185
- { name: "uptime", value: Ct(n.value) },
1186
- { name: "id", value: `${e.id.toString(16)} (${e.id})` },
1187
- { name: "firmware", value: s.value },
1188
- { name: "version", value: (u = e.pkg) == null ? void 0 : u.version }
1189
- ];
1190
- }), i = L(() => e.usedBytes ? Math.round(e.usedBytes * 100 / e.totalBytes) : 0), d = () => {
1191
- n.value++, l = setTimeout(d, 1e3);
1192
- };
1193
- return fe(() => {
1194
- d();
1195
- }), Fe(() => {
1196
- n.value = 0, l && clearTimeout(l);
1197
- }), (u, r) => {
1198
- var c, m, p;
1199
- return f(), v("div", zl, [
1200
- a("div", Sl, [
1201
- a("div", {
1202
- class: "relative block h-4 w-full rounded overflow-hidden bg-gray-200 dark:bg-gray-800 select-none",
1203
- title: `${i.value}%`
1204
- }, [
1205
- a("div", Bl, k(i.value) + "%", 1),
1206
- a("div", {
1207
- class: "bg-blue-600 rounded h-4 overflow-hidden relative transition-all duration-500",
1208
- style: Q(`width: ${i.value}%`)
1209
- }, [
1210
- a("div", El, k(i.value) + "%", 1)
1211
- ], 4)
1212
- ], 8, Vl),
1213
- a("div", Tl, [
1214
- (f(!0), v(O, null, R(t.value, (g) => (f(), v("div", {
1215
- key: g.name,
1216
- class: "flex-auto"
1217
- }, [
1218
- a("div", Ll, [
1219
- $(u.$slots, "name", { item: g })
1220
- ]),
1221
- a("div", null, k(g.value), 1)
1222
- ]))), 128))
1223
- ])
1224
- ]),
1225
- a("div", Ml, [
1226
- (f(!0), v(O, null, R(o.value, (g) => (f(), v("div", {
1227
- key: g.name,
1228
- class: "flex justify-between items-center"
1229
- }, [
1230
- a("div", Al, [
1231
- $(u.$slots, "name", { item: g })
1232
- ]),
1233
- a("div", Dl, k(g.value), 1)
1234
- ]))), 128))
1235
- ]),
1236
- a("div", null, [
1237
- $(u.$slots, "default", {
1238
- home: (c = e.pkg) == null ? void 0 : c.homepage,
1239
- repo: (p = (m = e.pkg) == null ? void 0 : m.repository) == null ? void 0 : p.url
1240
- })
1241
- ])
1242
- ]);
1243
- };
1244
- }
1245
- }), Il = { class: "flex items-center cursor-pointer" }, Ol = /* @__PURE__ */ V({
1246
- __name: "VFile",
1247
- emits: ["change"],
1248
- setup(e, { emit: n }) {
1249
- const l = n, s = async (t) => {
1250
- const o = t.target;
1251
- o.files && l("change", o.files);
1252
- };
1253
- return (t, o) => (f(), v("label", Il, [
1254
- a("input", N({
1255
- type: "file",
1256
- class: "hidden"
1257
- }, t.$attrs, { onChange: s }), null, 16),
1258
- $(t.$slots, "default")
1259
- ]));
1260
- }
1261
- }), jl = { class: "md:flex" }, Pl = { class: "text-gray-600 bg:text-gray-400 first-letter:uppercase min-w-19" }, Oa = /* @__PURE__ */ V({
1262
- __name: "BlockUpdate",
1263
- emits: ["update"],
1264
- setup(e, { emit: n }) {
1265
- const l = n, s = pt({ firmware: null, littlefs: null }), t = (d) => d ? Array.from(d).map((u) => `${u.name} (${pe(u.size)})`).join("") : "", o = (d, u) => {
1266
- const r = new FormData();
1267
- for (let c = 0; c < d.length; c++) {
1268
- const m = d.item(c);
1269
- if (!m) return;
1270
- r.append(`file[${c}]`, m, u);
1271
- }
1272
- return r;
1273
- }, i = (d, u) => {
1274
- if (!u) return;
1275
- const r = o(u, d);
1276
- r && l("update", d, r);
1277
- };
1278
- return (d, u) => {
1279
- const r = A;
1280
- return f(), v("div", null, [
1281
- (f(!0), v(O, null, R(s, (c, m) => (f(), v("div", {
1282
- key: m,
1283
- class: "mb-4 flex items-center"
1284
- }, [
1285
- b(Ol, {
1286
- accept: ".bin",
1287
- onChange: (p) => s[m] = p,
1288
- class: "flex-auto"
1289
- }, {
1290
- default: y(() => [
1291
- a("div", jl, [
1292
- a("h6", Pl, k(m) + ":", 1),
1293
- $(d.$slots, "default", {
1294
- file: t(c)
1295
- })
1296
- ])
1297
- ]),
1298
- _: 2
1299
- }, 1032, ["onChange"]),
1300
- b(r, {
1301
- class: "min-w-[100px]",
1302
- color: "blue",
1303
- disabled: !c,
1304
- onClick: (p) => i(`${m}.bin`, c)
1305
- }, {
1306
- default: y(() => [
1307
- I(k(d.$t("btnUpdate")), 1)
1308
- ]),
1309
- _: 1
1310
- }, 8, ["disabled", "onClick"])
1311
- ]))), 128))
1312
- ]);
1313
- };
1314
- }
1315
- }), Hl = {
1316
- viewBox: "0 0 24 24",
1317
- width: "1.2em",
1318
- height: "1.2em"
1319
- };
1320
- function Nl(e, n) {
1321
- return f(), v("svg", Hl, [...n[0] || (n[0] = [
1322
- a("path", {
1323
- fill: "currentColor",
1324
- d: "M12.172 12L9.343 9.173l1.415-1.414L15 12l-4.242 4.242l-1.415-1.414z"
1325
- }, null, -1)
1326
- ])]);
1327
- }
1328
- const Ze = F({ name: "ri-arrow-drop-right-line", render: Nl }), Fl = { class: "flex items-center gap-1.5" }, ja = /* @__PURE__ */ V({
1329
- __name: "BlockBreadcrumb",
1330
- props: {
1331
- items: { default: () => [] }
1332
- },
1333
- emits: ["click"],
1334
- setup(e, { emit: n }) {
1335
- const l = n, s = (t) => l("click", t);
1336
- return (t, o) => {
1337
- const i = Ze;
1338
- return f(), v("nav", null, [
1339
- a("ol", Fl, [
1340
- (f(!0), v(O, null, R(e.items, (d, u) => (f(), v("li", {
1341
- key: u,
1342
- class: B(["inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400", d.path ? "" : "text-gray-800 dark:text-white/90"])
1343
- }, [
1344
- $(t.$slots, "default", { item: d }, () => [
1345
- (f(), M(de(d.path ? "a" : "span"), {
1346
- href: d.path,
1347
- onClick: (r) => s(d)
1348
- }, {
1349
- default: y(() => [
1350
- I(k(d.name), 1)
1351
- ]),
1352
- _: 2
1353
- }, 1032, ["href", "onClick"]))
1354
- ]),
1355
- d.path ? (f(), M(i, {
1356
- key: 0,
1357
- class: "rotate-270"
1358
- })) : E("", !0)
1359
- ], 2))), 128))
1360
- ])
1361
- ]);
1362
- };
1363
- }
1364
- }), Rl = {
1365
- key: 0,
1366
- class: "loader-line w-full absolute top-0 left-0 h-[3px] bg-gray-100 dark:bg-gray-800 before:bg-blue-600 dark:before:bg-blue-800 before:h-1 rounded-xl z-20 before:absolute before:w-[40%] before:-left-1/2 before:content-[''] before:animate-[lineAnim_1s_linear_infinite]"
1367
- }, Ul = {
1368
- key: 1,
1369
- class: "absolute top-0 left-0 w-full h-full bg-gray-50 dark:bg-gray-900 z-10 opacity-50"
1370
- }, Kl = {
1371
- key: 2,
1372
- class: "mb-4 flex items-center justify-between"
1373
- }, Wl = { class: "text-lg font-semibold text-gray-800 dark:text-white/90 mb-0" }, ql = { class: "max-w-full" }, Gl = /* @__PURE__ */ V({
1374
- __name: "CardMain",
1375
- props: {
1376
- title: {},
1377
- loading: { type: Boolean }
1378
- },
1379
- setup(e) {
1380
- return (n, l) => (f(), v("div", {
1381
- class: B(["relative rounded-md border border-gray-200 dark:border-gray-800 bg-white dark:bg-white/[0.03] p-5 sm:p-6 hover-effect", { "overflow-hidden": e.loading }])
1382
- }, [
1383
- e.loading ? (f(), v("div", Rl)) : E("", !0),
1384
- e.loading ? (f(), v("div", Ul)) : E("", !0),
1385
- e.title ? (f(), v("div", Kl, [
1386
- a("h3", Wl, k(e.title), 1),
1387
- a("div", null, [
1388
- $(n.$slots, "header")
1389
- ])
1390
- ])) : E("", !0),
1391
- a("div", ql, [
1392
- $(n.$slots, "default")
1393
- ])
1394
- ], 2));
1395
- }
1396
- }), Jl = {
1397
- viewBox: "0 0 24 24",
1398
- width: "1.2em",
1399
- height: "1.2em"
1400
- };
1401
- function Xl(e, n) {
1402
- return f(), v("svg", Jl, [...n[0] || (n[0] = [
1403
- a("path", {
1404
- fill: "currentColor",
1405
- d: "M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9zm-2 5h6v2H7zm0 4h6v2H7z"
1406
- }, null, -1)
1407
- ])]);
1408
- }
1409
- const Yl = F({ name: "ri-file-copy2-line", render: Xl }), Zl = { class: "text-title-md uppercase font-bold flex-auto" }, Ql = { class: "px-4 pb-4 md:px-6" }, es = {
1410
- key: 0,
1411
- class: "text-title-md uppercase font-bold"
1412
- }, Be = /* @__PURE__ */ V({
1413
- __name: "VDialog",
1414
- props: {
1415
- title: {},
1416
- size: { default: "md" },
1417
- popupSize: { default: "auto" },
1418
- color: { default: "white" },
1419
- type: {},
1420
- hiddenCloser: { type: Boolean },
1421
- isOnlyDialog: { type: Boolean },
1422
- timeout: {}
1423
- },
1424
- emits: ["close", "click", "open"],
1425
- setup(e, { expose: n, emit: l }) {
1426
- const s = l, t = Ke(We), { show: o, onClose: i, onOpen: d } = Ue(s, e.timeout), u = {
1427
- sm: "max-w-full md:max-w-[330px] h-full md:h-[unset]",
1428
- md: "max-w-full md:max-w-[672px] h-full md:h-[unset]",
1429
- lg: "max-w-full md:max-w-[960px] h-full md:h-[unset]",
1430
- full: "relative max-w-full w-full h-3/4 "
1431
- }, r = {
1432
- none: "",
1433
- white: "bg-white dark:bg-gray-900",
1434
- gray: ""
1435
- }, c = L(() => [u[e.size], r[e.color]]), m = t.greaterOrEqual("lg");
1436
- return n({
1437
- show: o,
1438
- onClose: i
1439
- }), (p, g) => {
1440
- const h = ne;
1441
- return e.isOnlyDialog || T(m) ? (f(), M(He, {
1442
- key: 0,
1443
- to: "body"
1444
- }, [
1445
- b(ae, {
1446
- "enter-active-class": "duration-300 ease-out",
1447
- "enter-from-class": "transform opacity-0 -translate-y-2",
1448
- "enter-to-class": "opacity-100 translate-y-0",
1449
- "leave-active-class": "duration-200 ease-in",
1450
- "leave-from-class": "opacity-100 translate-y-0",
1451
- "leave-to-class": "transform opacity-0 -translate-y-2",
1452
- onAfterEnter: T(d)
1453
- }, {
1454
- default: y(() => [
1455
- T(o) ? (f(), v("div", {
1456
- key: 0,
1457
- class: "z-20 fixed top-0 h-dvh w-full left-0 flex flex-col",
1458
- onWheel: g[4] || (g[4] = H(() => {
1459
- }, ["stop"]))
1460
- }, [
1461
- a("div", {
1462
- class: "absolute h-full w-full top-0 left-0 bg-black/40 bg-blur",
1463
- onClick: g[0] || (g[0] = //@ts-ignore
1464
- (...x) => T(i) && T(i)(...x))
1465
- }),
1466
- a("div", {
1467
- class: B(["flex-auto flex align-center overflow-y-auto overscroll-contain", (e.size === "full", "")])
1468
- }, [
1469
- a("div", {
1470
- class: B(["m-auto w-full flex flex-col z-20 overflow-auto h-full scrollbar overscroll-contain bg-gray-50 dark:bg-gray-900 shadow-lg rounded-sm", c.value])
1471
- }, [
1472
- a("div", {
1473
- class: B(["flex items-center min-h-14 ps-6 pe-3", e.size === "full" ? "absolute top-0 right-4" : ""]),
1474
- onWheel: g[1] || (g[1] = H(() => {
1475
- }, ["prevent"])),
1476
- onTouchmove: g[2] || (g[2] = H(() => {
1477
- }, ["prevent"]))
1478
- }, [
1479
- a("h4", Zl, k(e.title), 1),
1480
- $(p.$slots, "header-btn", { close: T(i) }),
1481
- b(A, {
1482
- color: "transparent",
1483
- size: "md",
1484
- onClick: T(i)
1485
- }, {
1486
- default: y(() => [
1487
- b(h)
1488
- ]),
1489
- _: 1
1490
- }, 8, ["onClick"])
1491
- ], 34),
1492
- a("div", {
1493
- class: B(["relative overflow-auto h-full md:h-auto max-h-dvh scrollbar overflow-y-auto overscroll-contain", e.size === "full" ? "flex-auto" : "md:max-h-147.5 px-6 pb-6"]),
1494
- onClose: g[3] || (g[3] = //@ts-ignore
1495
- (...x) => T(i) && T(i)(...x))
1496
- }, [
1497
- $(p.$slots, "default", { close: T(i) })
1498
- ], 34)
1499
- ], 2)
1500
- ], 2)
1501
- ], 32)) : E("", !0)
1502
- ]),
1503
- _: 3
1504
- }, 8, ["onAfterEnter"])
1505
- ])) : (f(), M(Xe, {
1506
- key: 1,
1507
- size: e.popupSize,
1508
- onClose: T(i)
1509
- }, {
1510
- button: y(() => [
1511
- $(p.$slots, "header-btn", { close: T(i) })
1512
- ]),
1513
- default: y(({ close: x }) => [
1514
- a("div", Ql, [
1515
- a("div", {
1516
- class: B(["flex items-center mb-4", e.size === "full" ? "absolute top-0 right-4" : ""]),
1517
- onWheel: g[5] || (g[5] = H(() => {
1518
- }, ["prevent"])),
1519
- onTouchmove: g[6] || (g[6] = H(() => {
1520
- }, ["prevent"]))
1521
- }, [
1522
- e.title ? (f(), v("h4", es, k(e.title), 1)) : E("", !0)
1523
- ], 34),
1524
- $(p.$slots, "default", { close: x })
1525
- ])
1526
- ]),
1527
- _: 3
1528
- }, 8, ["size", "onClose"]));
1529
- };
1530
- }
1531
- }), ts = { class: "flex-auto flex justify-between" }, ns = { class: "text-sm text-gray-500 font-medium line-clamp-2 overflow-hidden" }, ls = { class: "text-sm text-ellipsis overflow-hidden text-nowrap" }, ss = {
1532
- key: 0,
1533
- class: "absolute left-1/2 top-1/2 size-[calc(50%)] text-gray-200/30 dark:text-gray-800/30 -translate-1/2"
1534
- }, os = { class: "min-h-60 relative" }, as = { class: "pt-6" }, is = { class: "text-center text-3xl text-ellipsis overflow-hidden" }, rs = { class: "text-center text-xl mt-4" }, ie = /* @__PURE__ */ V({
1535
- __name: "CardBase",
1536
- props: {
1537
- size: {},
1538
- id: {},
1539
- name: {},
1540
- type: {},
1541
- icon: {},
1542
- value: {},
1543
- valueTo: {},
1544
- opts: {},
1545
- args: {},
1546
- set: {},
1547
- get: {},
1548
- getTo: {}
1549
- },
1550
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1551
- setup(e, { emit: n }) {
1552
- const l = e, s = n, t = D(!1), o = L(() => ["button", "dimmer"].includes(l.type || "") && l.value ? "text-amber-500" : "text-gray-400"), i = (m) => s("edit", m), d = (m) => s("clone", m), u = () => t.value = !0, r = (m) => s("open", m), c = (m) => {
1553
- t.value = !1, s("close", m);
1554
- };
1555
- return (m, p) => {
1556
- const g = Ge, h = Yl;
1557
- return f(), v("div", {
1558
- class: "flex flex-col border relative aspect-square rounded-md bg-white dark:bg-gray-900 border-b border-gray-300 dark:border-gray-700 p-2 hover-effect transition-all cursor-pointer",
1559
- onClick: u
1560
- }, [
1561
- a("div", ts, [
1562
- a("div", {
1563
- class: B([o.value, "size-8 animate-shake"])
1564
- }, [
1565
- $(m.$slots, "icon", U(K(l)))
1566
- ], 2),
1567
- $(m.$slots, "header", U(K(l)))
1568
- ]),
1569
- a("div", null, [
1570
- $(m.$slots, "body", U(K(l)), () => [
1571
- a("h6", ns, [
1572
- $(m.$slots, "name", U(K(l)), () => [
1573
- I(k(l.name), 1)
1574
- ])
1575
- ]),
1576
- a("div", ls, [
1577
- $(m.$slots, "value", U(K(l)), () => [
1578
- I(k(l.valueTo || l.value), 1)
1579
- ])
1580
- ])
1581
- ])
1582
- ]),
1583
- l.icon ? (f(), v("div", ss, [
1584
- $(m.$slots, "icon", U(K(l)))
1585
- ])) : E("", !0),
1586
- t.value ? (f(), M(Be, {
1587
- key: 1,
1588
- size: l.size || "sm",
1589
- title: e.name,
1590
- onClose: c,
1591
- onOpen: r
1592
- }, {
1593
- "header-btn": y(() => [
1594
- b(A, {
1595
- color: "transparent",
1596
- onClick: i
1597
- }, {
1598
- default: y(() => [
1599
- b(g)
1600
- ]),
1601
- _: 1
1602
- }),
1603
- b(A, {
1604
- color: "transparent",
1605
- onClick: d
1606
- }, {
1607
- default: y(() => [
1608
- b(h, { class: "size-4 text-gray-500" })
1609
- ]),
1610
- _: 1
1611
- })
1612
- ]),
1613
- default: y(() => [
1614
- a("div", os, [
1615
- a("div", as, [
1616
- a("h3", is, [
1617
- $(m.$slots, "dialog-name", U(K(l)), () => [
1618
- I(k(l.name), 1)
1619
- ])
1620
- ]),
1621
- $(m.$slots, "dialog", U(K(l))),
1622
- a("p", rs, [
1623
- $(m.$slots, "dialog-value", U(K(l)), () => [
1624
- I(k(l.valueTo || l.value), 1)
1625
- ])
1626
- ])
1627
- ])
1628
- ])
1629
- ]),
1630
- _: 3
1631
- }, 8, ["size", "title"])) : E("", !0)
1632
- ]);
1633
- };
1634
- }
1635
- }), cs = {
1636
- viewBox: "0 0 24 24",
1637
- width: "1.2em",
1638
- height: "1.2em"
1639
- };
1640
- function ds(e, n) {
1641
- return f(), v("svg", cs, [...n[0] || (n[0] = [
1642
- a("path", {
1643
- fill: "currentColor",
1644
- d: "m6.265 3.807l1.147 1.639a8 8 0 1 0 9.176 0l1.147-1.639A9.99 9.99 0 0 1 22 12c0 5.523-4.477 10-10 10S2 17.523 2 12a9.99 9.99 0 0 1 4.265-8.193M11 12V2h2v10z"
1645
- }, null, -1)
1646
- ])]);
1647
- }
1648
- const us = F({ name: "ri-shut-down-line", render: ds }), fs = { class: "flex justify-end" }, ms = { class: "flex justify-center py-4" }, Pa = /* @__PURE__ */ V({
1649
- __name: "CardButton",
1650
- props: {
1651
- size: {},
1652
- id: {},
1653
- name: {},
1654
- type: {},
1655
- icon: {},
1656
- value: {},
1657
- valueTo: {},
1658
- opts: {},
1659
- args: {},
1660
- set: {},
1661
- get: {},
1662
- getTo: {}
1663
- },
1664
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1665
- setup(e, { emit: n }) {
1666
- const l = e, s = n, t = ({ opts: i = {} }) => {
1667
- const { disabled: d } = i;
1668
- return { disabled: d };
1669
- }, o = () => s("setState", !l.value);
1670
- return (i, d) => {
1671
- const u = us;
1672
- return f(), M(ie, N(l, {
1673
- onClick: d[0] || (d[0] = (r) => s("click", r)),
1674
- onEdit: d[1] || (d[1] = (r) => s("edit", r)),
1675
- onClone: d[2] || (d[2] = (r) => s("clone", r))
1676
- }), {
1677
- icon: y((r) => [
1678
- $(i.$slots, "icon", U(K(r)))
1679
- ]),
1680
- header: y((r) => [
1681
- a("div", fs, [
1682
- b(A, N(t(r), {
1683
- type: "icon",
1684
- class: l.value ? "text-amber-500" : "text-gray-500",
1685
- onClick: H(o, ["stop"])
1686
- }), {
1687
- default: y(() => [
1688
- b(u, { class: "size-8" })
1689
- ]),
1690
- _: 1
1691
- }, 16, ["class"])
1692
- ])
1693
- ]),
1694
- dialog: y((r) => [
1695
- a("div", ms, [
1696
- b(A, N(t(r), {
1697
- type: "icon",
1698
- class: ["size-18", l.value ? "text-amber-500" : "text-gray-500"],
1699
- onClick: H(o, ["stop"])
1700
- }), {
1701
- default: y(() => [
1702
- b(u, { class: "size-16" })
1703
- ]),
1704
- _: 1
1705
- }, 16, ["class"])
1706
- ])
1707
- ]),
1708
- _: 3
1709
- }, 16);
1710
- };
1711
- }
1712
- }), vs = {
1713
- viewBox: "0 0 24 24",
1714
- width: "1.2em",
1715
- height: "1.2em"
1716
- };
1717
- function ps(e, n) {
1718
- return f(), v("svg", vs, [...n[0] || (n[0] = [
1719
- a("path", {
1720
- fill: "currentColor",
1721
- d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"
1722
- }, null, -1)
1723
- ])]);
1724
- }
1725
- const hs = F({ name: "ri-time-line", render: ps }), gs = { class: "flex justify-center relative mx-2 my-6" }, Ha = /* @__PURE__ */ V({
1726
- __name: "CardDate",
1727
- props: {
1728
- size: {},
1729
- id: {},
1730
- name: {},
1731
- type: {},
1732
- icon: {},
1733
- value: {},
1734
- valueTo: {},
1735
- opts: {},
1736
- args: {},
1737
- set: {},
1738
- get: {},
1739
- getTo: {}
1740
- },
1741
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1742
- setup(e, { emit: n }) {
1743
- const l = e, s = n, t = Re("time"), o = (r) => new Date(+r * 1e3).toISOString().slice(0, 16), i = (r) => {
1744
- var m;
1745
- const c = (m = r == null ? void 0 : r.target) == null ? void 0 : m.valueAsNumber;
1746
- c && s("setState", c / 1e3);
1747
- }, d = ({ name: r, value: c, opts: m = {} }) => {
1748
- const { disabled: p } = m;
1749
- return { label: r, modelValue: o(c), disabled: p };
1750
- }, u = () => {
1751
- var c, m;
1752
- const r = (m = (c = t.value) == null ? void 0 : c.$el) == null ? void 0 : m.querySelector("input");
1753
- r != null && r.showPicker && r.showPicker();
1754
- };
1755
- return (r, c) => {
1756
- const m = hs;
1757
- return f(), M(ie, N(l, {
1758
- onClick: c[0] || (c[0] = (p) => s("click", p)),
1759
- onEdit: c[1] || (c[1] = (p) => s("edit", p)),
1760
- onClone: c[2] || (c[2] = (p) => s("clone", p))
1761
- }), {
1762
- icon: y((p) => [
1763
- $(r.$slots, "icon", U(K(p)))
1764
- ]),
1765
- header: y((p) => [
1766
- a("div", null, [
1767
- b(A, {
1768
- type: "icon",
1769
- class: "text-gray-500",
1770
- onClick: H(u, ["stop"])
1771
- }, {
1772
- default: y(() => [
1773
- b(m, { class: "size-7" })
1774
- ]),
1775
- _: 1
1776
- }),
1777
- b(J, N({
1778
- ref_key: "time",
1779
- ref: t
1780
- }, d(p), {
1781
- type: "datetime-local",
1782
- class: "size-0",
1783
- hidden: "",
1784
- onChange: i
1785
- }), null, 16)
1786
- ])
1787
- ]),
1788
- dialog: y((p) => [
1789
- a("div", gs, [
1790
- b(J, N(d(p), {
1791
- type: "datetime-local",
1792
- onChange: i
1793
- }), null, 16)
1794
- ])
1795
- ]),
1796
- _: 3
1797
- }, 16);
1798
- };
1799
- }
1800
- }), bs = { class: "flex justify-end" }, ys = { class: "flex justify-end" }, xs = {
1801
- class: /* @__PURE__ */ B("text-blue-600 dark:text-blue-400")
1802
- }, $s = {
1803
- width: "30",
1804
- height: "30",
1805
- viewBox: "-7.5 -7.5 75 75",
1806
- version: "1.1",
1807
- style: { transform: "rotate(-90deg)" }
1808
- }, ks = ["stroke-dashoffset"], _s = { class: "absolute top-1/2 left-1/2 -translate-1/2 text-white z-10 font-bold text-xl" }, Na = /* @__PURE__ */ V({
1809
- __name: "CardDimmer",
1810
- props: {
1811
- size: {},
1812
- id: {},
1813
- name: {},
1814
- type: {},
1815
- icon: {},
1816
- value: {},
1817
- valueTo: {},
1818
- opts: {},
1819
- args: {},
1820
- set: {},
1821
- get: {},
1822
- getTo: {}
1823
- },
1824
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1825
- setup(e, { emit: n }) {
1826
- const l = e, s = n, t = D(0), o = ({ opts: c, value: m }) => Math.round(100 * +m / ((c == null ? void 0 : c.max) || 255)), i = ({ opts: c, value: m }) => Math.round(187 - +m / ((c == null ? void 0 : c.max) || 255) * 187), d = ({ value: c, opts: m }) => {
1827
- const { min: p = 0, max: g = 255, step: h = 1, disabled: x } = m || {};
1828
- return { min: p, max: g, step: h, value: c, disabled: !!x, class: x ? "" : "cursor-pointer" };
1829
- }, u = (c) => s("setState", +c.target.value || 0), r = ({ value: c }) => {
1830
- +c != 0 ? (t.value = +c, s("setState", 0)) : s("setState", c ? 0 : t.value || 255);
1831
- };
1832
- return (c, m) => (f(), M(ie, N(l, {
1833
- onClick: m[0] || (m[0] = (p) => s("click", p)),
1834
- onEdit: m[1] || (m[1] = (p) => s("edit", p)),
1835
- onClone: m[2] || (m[2] = (p) => s("clone", p))
1836
- }), {
1837
- icon: y((p) => [
1838
- $(c.$slots, "icon", U(K(p)))
1839
- ]),
1840
- header: y((p) => [
1841
- a("div", bs, [
1842
- a("div", ys, [
1843
- b(A, N(d(p), {
1844
- type: "icon",
1845
- onClick: H((g) => r(p), ["stop"])
1846
- }), {
1847
- default: y(() => [
1848
- a("div", xs, [
1849
- (f(), v("svg", $s, [
1850
- m[3] || (m[3] = a("circle", {
1851
- class: "stroke-gray-300 dark:stroke-gray-700",
1852
- r: "30",
1853
- cx: "30",
1854
- cy: "30",
1855
- fill: "transparent",
1856
- "stroke-width": "10"
1857
- }, null, -1)),
1858
- a("circle", {
1859
- r: "30",
1860
- cx: "30",
1861
- cy: "30",
1862
- stroke: "currentColor",
1863
- "stroke-width": "8",
1864
- "stroke-linecap": "butt",
1865
- "stroke-dashoffset": i(p),
1866
- fill: "transparent",
1867
- "stroke-dasharray": "187"
1868
- }, null, 8, ks)
1869
- ]))
1870
- ])
1871
- ]),
1872
- _: 2
1873
- }, 1040, ["onClick"])
1874
- ])
1875
- ])
1876
- ]),
1877
- dialog: y((p) => [
1878
- a("div", {
1879
- class: B(["flex justify-center relative mx-2 my-6", d(p).disabled ? "opacity-40" : ""])
1880
- }, [
1881
- m[4] || (m[4] = a("div", { class: "absolute h-10 w-full top-0 left-0 bg-gray-400 dark:bg-gray-700 z-0 rounded-md" }, null, -1)),
1882
- a("div", {
1883
- class: "absolute h-10 top-0 left-0 bg-blue-600 dark:bg-blue-400 z-0 rounded-md transition-[width_0.3s_linear]",
1884
- style: Q(`width: ${o(p)}%`)
1885
- }, null, 4),
1886
- a("div", _s, k(o(p)) + " %", 1),
1887
- a("input", N({ type: "range" }, d(p), {
1888
- class: "w-full h-10 z-10 appearance-none opacity-0",
1889
- onChange: u
1890
- }), null, 16)
1891
- ], 2)
1892
- ]),
1893
- _: 3
1894
- }, 16));
1895
- }
1896
- }), Fa = /* @__PURE__ */ V({
1897
- __name: "CardInfo",
1898
- props: {
1899
- size: {},
1900
- id: {},
1901
- name: {},
1902
- type: {},
1903
- icon: {},
1904
- value: {},
1905
- valueTo: {},
1906
- opts: {},
1907
- args: {},
1908
- set: {},
1909
- get: {},
1910
- getTo: {}
1911
- },
1912
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1913
- setup(e, { emit: n }) {
1914
- const l = e, s = n;
1915
- return (t, o) => (f(), M(ie, N(l, {
1916
- onClick: o[0] || (o[0] = (i) => s("click", i)),
1917
- onEdit: o[1] || (o[1] = (i) => s("edit", i)),
1918
- onClone: o[2] || (o[2] = (i) => s("clone", i))
1919
- }), {
1920
- icon: y((i) => [
1921
- $(t.$slots, "icon", U(K(i)))
1922
- ]),
1923
- default: y(() => [
1924
- $(t.$slots, "dialog")
1925
- ]),
1926
- _: 3
1927
- }, 16));
1928
- }
1929
- }), ws = { class: "flex justify-center relative mx-2 my-6" }, Ra = /* @__PURE__ */ V({
1930
- __name: "CardInput",
1931
- props: {
1932
- size: {},
1933
- id: {},
1934
- name: {},
1935
- type: {},
1936
- icon: {},
1937
- value: {},
1938
- valueTo: {},
1939
- opts: {},
1940
- args: {},
1941
- set: {},
1942
- get: {},
1943
- getTo: {}
1944
- },
1945
- emits: ["edit", "close", "click", "clone", "open", "setState"],
1946
- setup(e, { emit: n }) {
1947
- const l = e, s = n, t = D(l.value || ""), o = ({ name: d, opts: u = {} }) => {
1948
- const { disabled: r } = u;
1949
- return { label: d, disabled: r };
1950
- }, i = (d) => s("setState", d.target.value);
1951
- return ue(
1952
- () => l.value,
1953
- (d) => {
1954
- t.value = d;
1955
- }
1956
- ), (d, u) => {
1957
- const r = Ze;
1958
- return f(), M(ie, N(l, {
1959
- onClick: u[1] || (u[1] = (c) => s("click", c)),
1960
- onEdit: u[2] || (u[2] = (c) => s("edit", c)),
1961
- onClone: u[3] || (u[3] = (c) => s("clone", c))
1962
- }), {
1963
- icon: y((c) => [
1964
- $(d.$slots, "icon", U(K(c)))
1965
- ]),
1966
- dialog: y((c) => [
1967
- a("div", ws, [
1968
- b(J, N({
1969
- modelValue: t.value,
1970
- "onUpdate:modelValue": u[0] || (u[0] = (m) => t.value = m)
1971
- }, o(c), {
1972
- onEnter: i,
1973
- onBlur: i
1974
- }), {
1975
- icon: y(() => [
1976
- b(r, { class: "size-8" })
1977
- ]),
1978
- _: 1
1979
- }, 16, ["modelValue"])
1980
- ])
1981
- ]),
1982
- _: 3
1983
- }, 16);
1984
- };
1985
- }
1986
- }), Cs = {
1987
- viewBox: "0 0 24 24",
1988
- width: "1.2em",
1989
- height: "1.2em"
1990
- };
1991
- function zs(e, n) {
1992
- return f(), v("svg", Cs, [...n[0] || (n[0] = [
1993
- a("path", {
1994
- fill: "currentColor",
1995
- d: "M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"
1996
- }, null, -1)
1997
- ])]);
1998
- }
1999
- const Ss = F({ name: "ri-list-check", render: zs }), Vs = { class: "flex justify-center py-4" }, Ua = /* @__PURE__ */ V({
2000
- __name: "CardList",
2001
- props: {
2002
- size: {},
2003
- id: {},
2004
- name: {},
2005
- type: {},
2006
- icon: {},
2007
- value: {},
2008
- valueTo: {},
2009
- opts: {},
2010
- args: {},
2011
- set: {},
2012
- get: {},
2013
- getTo: {}
2014
- },
2015
- emits: ["edit", "close", "click", "clone", "open", "setState"],
2016
- setup(e, { emit: n }) {
2017
- const l = e, s = n, t = ({ value: d }) => s("setState", d), o = ({ opts: d, value: u }) => {
2018
- var r;
2019
- return Array.isArray(d == null ? void 0 : d.items) && ((r = d == null ? void 0 : d.items.find((c) => c.value == u)) == null ? void 0 : r.name) || u;
2020
- }, i = ({ name: d, value: u, opts: r = {} }) => {
2021
- var g;
2022
- const { items: c = [], disabled: m } = r, p = ((g = c.find((h) => h.value == u)) == null ? void 0 : g.name) || u;
2023
- return { label: d, modelValue: p, items: c, disabled: !!m };
2024
- };
2025
- return (d, u) => {
2026
- const r = Ss;
2027
- return f(), M(ie, N(l, {
2028
- onClick: u[1] || (u[1] = (c) => s("click", c)),
2029
- onEdit: u[2] || (u[2] = (c) => s("edit", c)),
2030
- onClone: u[3] || (u[3] = (c) => s("clone", c))
2031
- }), {
2032
- icon: y((c) => [
2033
- $(d.$slots, "icon", U(K(c)))
2034
- ]),
2035
- value: y((c) => [
2036
- I(k(o(c)), 1)
2037
- ]),
2038
- "dialog-value": y((c) => [
2039
- I(k(o(c)), 1)
2040
- ]),
2041
- header: y((c) => [
2042
- a("div", {
2043
- onClick: u[0] || (u[0] = H(() => {
2044
- }, ["prevent", "stop"]))
2045
- }, [
2046
- b(te, N(i(c), {
2047
- "is-popup": "",
2048
- top: "0",
2049
- left: "-115px",
2050
- onChange: t
2051
- }), {
2052
- activator: y(({ on: m }) => [
2053
- b(A, {
2054
- type: "icon",
2055
- class: "text-gray-500",
2056
- onClick: H(m.click, ["stop"])
2057
- }, {
2058
- default: y(() => [
2059
- b(r, { class: "size-6" })
2060
- ]),
2061
- _: 1
2062
- }, 8, ["onClick"])
2063
- ]),
2064
- _: 1
2065
- }, 16)
2066
- ])
2067
- ]),
2068
- dialog: y((c) => [
2069
- a("div", Vs, [
2070
- b(te, N(i(c), {
2071
- top: "-50%",
2072
- left: "50%",
2073
- onChange: t
2074
- }), null, 16)
2075
- ])
2076
- ]),
2077
- _: 3
2078
- }, 16);
2079
- };
2080
- }
2081
- }), Bs = {
2082
- viewBox: "0 0 24 24",
2083
- width: "1.2em",
2084
- height: "1.2em"
2085
- };
2086
- function Es(e, n) {
2087
- return f(), v("svg", Bs, [...n[0] || (n[0] = [
2088
- a("path", {
2089
- fill: "currentColor",
2090
- d: "M15.5 5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7M10 8.5a5.5 5.5 0 1 1 10.032 3.117l2.675 2.676l-1.414 1.414l-2.675-2.675A5.5 5.5 0 0 1 10 8.5M3 4h5v2H3zm0 7h5v2H3zm18 7v2H3v-2z"
2091
- }, null, -1)
2092
- ])]);
2093
- }
2094
- const Ts = F({ name: "ri-menu-search-line", render: Es }), Ls = {
2095
- viewBox: "0 0 24 24",
2096
- width: "1.2em",
2097
- height: "1.2em"
2098
- };
2099
- function Ms(e, n) {
2100
- return f(), v("svg", Ls, [...n[0] || (n[0] = [
2101
- a("path", {
2102
- fill: "currentColor",
2103
- d: "M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"
2104
- }, null, -1)
2105
- ])]);
2106
- }
2107
- const ye = F({ name: "ri-add-line", render: Ms }), As = { class: "flex w-full relative" }, Ds = { class: "flex gap-2 flex-wrap flex-auto px-2 py-1" }, Is = ["disabled"], Qe = /* @__PURE__ */ V({
2108
- __name: "VTextWrapper",
2109
- props: {
2110
- active: { type: Boolean },
2111
- label: { default: "label" },
2112
- disabled: { type: Boolean, default: !1 },
2113
- hideIcon: { type: Boolean, default: !1 }
2114
- },
2115
- emits: ["icon"],
2116
- setup(e, { emit: n }) {
2117
- const l = n, s = L(() => e.active ? "top-0 left-3 text-xs" : "top-1/2"), t = L(() => [e.disabled ? "border-gray-400 opacity-40" : "border-gray-300 hover:border-gray-400 dark:border-gray-700/50 hover:dark:border-gray-600/50"]);
2118
- return (o, i) => {
2119
- const d = ye;
2120
- return f(), v("div", As, [
2121
- a("div", {
2122
- class: B(["relative w-full min-h-[40px] border border-gray-300 dark:border-gray-700 flex items-center rounded transition bg-white dark:bg-gray-800", t.value])
2123
- }, [
2124
- a("span", {
2125
- class: B(["absolute left-4 transition-all rounded -translate-y-1/2 text-gray-600 dark:text-gray-400", s.value])
2126
- }, k(e.label), 3),
2127
- a("div", Ds, [
2128
- $(o.$slots, "default")
2129
- ]),
2130
- e.hideIcon ? E("", !0) : (f(), v("button", {
2131
- key: 0,
2132
- disabled: e.disabled,
2133
- class: B([{ "cursor-pointer": !e.disabled }, "h-full flex items-center justify-center text-gray-400 border-l border-gray-300 dark:border-gray-700/50 flex-[0_0_50px]"]),
2134
- onClick: i[0] || (i[0] = (u) => l("icon", u))
2135
- }, [
2136
- $(o.$slots, "icon", {}, () => [
2137
- b(d, { class: "size-4" })
2138
- ])
2139
- ], 10, Is))
2140
- ], 2)
2141
- ]);
2142
- };
2143
- }
2144
- }), Os = {
2145
- viewBox: "0 0 24 24",
2146
- width: "1.2em",
2147
- height: "1.2em"
2148
- };
2149
- function js(e, n) {
2150
- return f(), v("svg", Os, [...n[0] || (n[0] = [
2151
- a("path", {
2152
- fill: "currentColor",
2153
- d: "M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"
2154
- }, null, -1)
2155
- ])]);
2156
- }
2157
- const Ps = F({ name: "ri-file-copy-line", render: js }), Hs = {
2158
- viewBox: "0 0 24 24",
2159
- width: "1.2em",
2160
- height: "1.2em"
2161
- };
2162
- function Ns(e, n) {
2163
- return f(), v("svg", Hs, [...n[0] || (n[0] = [
2164
- a("path", {
2165
- fill: "currentColor",
2166
- d: "M2 4a1 1 0 0 1 1-1h7.414l2 2H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3c-.55 0-1-.45-1-1zm8.586 2l-1-1H4v2h5.586zM4 9v10h16V7h-7.586l-2 2z"
2167
- }, null, -1)
2168
- ])]);
2169
- }
2170
- const Fs = F({ name: "ri-folder6-line", render: Ns }), Rs = ["onClick"], Us = {
2171
- key: 0,
2172
- class: "me-1"
2173
- }, Ks = { class: "dark:text-gray-300" }, Ws = { class: "flex gap-3 items-center z-10" }, qs = {
2174
- key: 0,
2175
- class: "flex ps-5"
2176
- }, Gs = { class: "font-medium dark:text-gray-300" }, et = /* @__PURE__ */ V({
2177
- __name: "VListObject",
2178
- props: {
2179
- items: { default: () => ({}) },
2180
- path: { default: "" },
2181
- onlyValue: { type: Boolean, default: !1 }
2182
- },
2183
- emits: ["click"],
2184
- setup(e, { emit: n }) {
2185
- const l = n, s = () => "before:absolute before:w-full before:h-8 before:t-0 before:left-0 before:border-b before:border-gray-200 dark:before:border-gray-800/50 hover:before:bg-gray-400/10", t = D({}), { text: o, copy: i, copied: d, isSupported: u } = xt(), r = (g) => {
2186
- t.value[g] = !t.value[g];
2187
- }, c = (g) => typeof g == "object", m = (g) => `${e.path ? e.path + "." : ""}${g}`, p = (g, h) => {
2188
- l("click", { key: g, path: m(g), isObject: h });
2189
- };
2190
- return (g, h) => {
2191
- const x = Fs, _ = Ps, C = ye;
2192
- return f(), v("ul", null, [
2193
- (f(!0), v(O, null, R(e.items, (z, j) => (f(), v("li", {
2194
- key: j,
2195
- class: B(c(z) ? "" : `flex items-center ${s()}`)
2196
- }, [
2197
- a("div", {
2198
- class: B(["flex items-center cursor-pointer ps-2 h-8", c(z) ? `${s()}` : ""]),
2199
- onClick: (X) => r(j)
2200
- }, [
2201
- c(z) ? (f(), v("div", Us, [
2202
- b(x, { class: "size-5" })
2203
- ])) : E("", !0),
2204
- a("div", Ks, k(j), 1),
2205
- T(u) ? (f(), M(A, {
2206
- key: 1,
2207
- class: "opacity-20 hover:opacity-70 transition-all",
2208
- color: "transparent",
2209
- size: "sm",
2210
- onClick: H((X) => T(i)(m(j)), ["stop"])
2211
- }, {
2212
- default: y(() => [
2213
- b(_, { class: "size-5" })
2214
- ]),
2215
- _: 1
2216
- }, 8, ["onClick"])) : E("", !0),
2217
- T(o) === m(j) ? (f(), v("span", {
2218
- key: 2,
2219
- class: B(["text-gray-500 transition-all duration-1000 text-sm", T(d) ? "opacity-100" : "opacity-0"])
2220
- }, k(g.$t("copied")), 3)) : E("", !0),
2221
- !e.onlyValue && c(z) ? (f(), v(O, { key: 3 }, [
2222
- h[1] || (h[1] = a("div", { class: "flex-auto" }, null, -1)),
2223
- a("div", Ws, [
2224
- b(A, {
2225
- class: "opacity-20 hover:opacity-70 transition-all",
2226
- color: "transparent",
2227
- size: "sm",
2228
- title: g.$t("add"),
2229
- onClick: H((X) => p(j, c(z)), ["stop"])
2230
- }, {
2231
- default: y(() => [
2232
- b(C, { class: "size-5" })
2233
- ]),
2234
- _: 1
2235
- }, 8, ["title", "onClick"])
2236
- ])
2237
- ], 64)) : E("", !0)
2238
- ], 10, Rs),
2239
- c(z) ? (f(), v("div", qs, [
2240
- Ce(b(et, {
2241
- class: "flex-auto",
2242
- path: m(j),
2243
- items: z,
2244
- onlyValue: e.onlyValue,
2245
- onClick: h[0] || (h[0] = (X) => l("click", X))
2246
- }, null, 8, ["path", "items", "onlyValue"]), [
2247
- [ht, t.value[j]]
2248
- ])
2249
- ])) : (f(), v(O, { key: 1 }, [
2250
- h[2] || (h[2] = a("div", { class: "flex-auto gap-3" }, null, -1)),
2251
- a("div", Gs, k(z), 1),
2252
- b(A, {
2253
- class: "opacity-20 hover:opacity-70 transition-all",
2254
- color: "gray",
2255
- size: "sm",
2256
- title: g.$t("add"),
2257
- onClick: H((X) => p(j, c(z)), ["stop"])
2258
- }, {
2259
- default: y(() => [
2260
- b(C, { class: "size-5" })
2261
- ]),
2262
- _: 1
2263
- }, 8, ["title", "onClick"])
2264
- ], 64))
2265
- ], 2))), 128))
2266
- ]);
2267
- };
2268
- }
2269
- }), Js = { class: "" }, Xs = { class: "flex border-b border-gray-200 dark:border-gray-700" }, Ys = ["onClick"], Zs = { class: "px-4 py-2" }, Qs = { class: "relative my-4" }, eo = { key: 0 }, to = /* @__PURE__ */ V({
2270
- __name: "VTabs",
2271
- props: {
2272
- value: {},
2273
- items: {}
2274
- },
2275
- emits: ["click"],
2276
- setup(e, { expose: n, emit: l }) {
2277
- const s = l, t = D(e.value || 0), o = (d) => [t.value === d ? "" : "before:hidden"], i = (d) => {
2278
- t.value = d, s("click", d);
2279
- };
2280
- return n({
2281
- setActiveTab: i,
2282
- activeTab: t
2283
- }), (d, u) => (f(), v("div", Js, [
2284
- a("div", Xs, [
2285
- (f(!0), v(O, null, R(e.items, (r, c) => (f(), v("div", {
2286
- key: c,
2287
- class: "relative flex-auto"
2288
- }, [
2289
- a("button", {
2290
- class: "w-full",
2291
- onClick: (m) => i(c)
2292
- }, [
2293
- a("div", {
2294
- class: B([o(c), "font-medium text-lg transition cursor-pointer before:h-[2px] before:absolute before:w-full before:bg-blue-700 before:left-0 before:bottom-0"])
2295
- }, [
2296
- $(d.$slots, "header", {
2297
- tab: r,
2298
- i: c
2299
- }, () => [
2300
- a("div", Zs, k(r.title), 1)
2301
- ])
2302
- ], 2)
2303
- ], 8, Ys)
2304
- ]))), 128))
2305
- ]),
2306
- a("div", Qs, [
2307
- (f(!0), v(O, null, R(e.items, (r, c) => (f(), v("div", {
2308
- key: c,
2309
- class: "tab-panel"
2310
- }, [
2311
- b(ae, {
2312
- "enter-active-class": "transition-all duration-300 ease-out",
2313
- "enter-from-class": "transform opacity-0 translate-x-2",
2314
- "enter-to-class": "transform opacity-100 translate-x-0",
2315
- "leave-active-class": "transition-all duration-0 ease-in absolute inset-0",
2316
- "leave-from-class": "transform opacity-100 translate-x-0",
2317
- "leave-to-class": "transform opacity-0 -translate-x-2"
2318
- }, {
2319
- default: y(() => [
2320
- t.value === c ? (f(), v("div", eo, [
2321
- $(d.$slots, `tab-${c}`)
2322
- ])) : E("", !0)
2323
- ]),
2324
- _: 2
2325
- }, 1024)
2326
- ]))), 128))
2327
- ])
2328
- ]));
2329
- }
2330
- }), no = { class: "flex gap-1 text-amber-500 self-start text-nowrap select-none" }, lo = ["title", "onMouseenter", "onMouseleave"], so = { class: "flex flex-auto" }, oo = ["disabled"], $e = /* @__PURE__ */ V({
2331
- __name: "VFunc",
2332
- props: {
2333
- label: {},
2334
- args: {},
2335
- value: {},
2336
- disabled: { type: Boolean, default: !1 },
2337
- hideIcon: { type: Boolean, default: !1 }
2338
- },
2339
- emits: ["change", "icon", "hover"],
2340
- setup(e, { emit: n }) {
2341
- const l = n, s = ["v", "a", "b", "c"], t = D(e.value || ""), o = (u) => {
2342
- try {
2343
- return new Function(u), !0;
2344
- } catch (r) {
2345
- return console.warn(r), !1;
2346
- }
2347
- }, i = ze((u) => {
2348
- const r = u.target;
2349
- o(r.value) && l("change", r.value);
2350
- }, 500), d = (u) => l("icon", u);
2351
- return ue(
2352
- () => e.value,
2353
- () => {
2354
- e.value && (t.value = e.value);
2355
- }
2356
- ), (u, r) => {
2357
- const c = ne, m = ye;
2358
- return f(), M(Qe, {
2359
- active: !!e.value,
2360
- disabled: e.disabled,
2361
- label: e.label,
2362
- hideIcon: e.hideIcon,
2363
- onIcon: d
2364
- }, {
2365
- icon: y(() => [
2366
- e.value ? (f(), M(c, {
2367
- key: 0,
2368
- class: "size-4"
2369
- })) : (f(), M(m, {
2370
- key: 1,
2371
- class: "size-4"
2372
- }))
2373
- ]),
2374
- default: y(() => [
2375
- e.value ? (f(), v(O, { key: 0 }, [
2376
- a("div", no, [
2377
- r[3] || (r[3] = I(" ( ", -1)),
2378
- (f(!0), v(O, null, R(e.args, (p, g) => (f(), v(O, { key: p }, [
2379
- a("span", {
2380
- class: "text-blue-400/80",
2381
- title: p,
2382
- onMouseenter: (h) => l("hover", "enter", g),
2383
- onMouseleave: (h) => l("hover", "leave", g)
2384
- }, k(s[g]), 41, lo),
2385
- r[2] || (r[2] = a("span", { class: "last:hidden" }, ",", -1))
2386
- ], 64))), 128)),
2387
- r[4] || (r[4] = I(" ) => ", -1))
2388
- ]),
2389
- a("div", so, [
2390
- Ce(a("textarea", {
2391
- "onUpdate:modelValue": r[0] || (r[0] = (p) => t.value = p),
2392
- class: "outline-0 w-full resize-none field-sizing-content",
2393
- type: "text",
2394
- disabled: e.disabled,
2395
- onInput: r[1] || (r[1] = //@ts-ignore
2396
- (...p) => T(i) && T(i)(...p))
2397
- }, null, 40, oo), [
2398
- [gt, t.value]
2399
- ])
2400
- ])
2401
- ], 64)) : E("", !0)
2402
- ]),
2403
- _: 1
2404
- }, 8, ["active", "disabled", "label", "hideIcon"]);
2405
- };
2406
- }
2407
- }), ao = ["checked", "disabled"], io = { class: "text-sm ms-2 peer-disabled:opacity-40" }, ro = /* @__PURE__ */ V({
2408
- __name: "VCheckbox",
2409
- props: {
2410
- modelValue: { type: [Number, Boolean], default: !1 },
2411
- disabled: { type: Boolean, default: !1 }
2412
- },
2413
- emits: ["update:modelValue", "click"],
2414
- setup(e, { emit: n }) {
2415
- const l = n, s = (o) => {
2416
- const i = o.target;
2417
- l("update:modelValue", i.checked);
2418
- }, t = (o) => l("click", o);
2419
- return (o, i) => (f(), v("label", {
2420
- class: B(["inline-flex items-center relative", { "cursor-pointer": !e.disabled }]),
2421
- onClick: t
2422
- }, [
2423
- a("input", {
2424
- type: "checkbox",
2425
- checked: !!e.modelValue,
2426
- disabled: e.disabled,
2427
- class: "peer size-5 transition-all appearance-none rounded border border-gray-300 dark:border-gray-700 disabled:opacity-40 not-disabled:cursor-pointer",
2428
- onChange: s
2429
- }, null, 40, ao),
2430
- i[0] || (i[0] = a("button", { class: "absolute opacity-0 peer-checked:opacity-100 peer-disabled:opacity-40 top-1/2 left-[10px] transform -translate-x-1/2 -translate-y-1/2 pointer-events-none" }, [
2431
- a("svg", {
2432
- class: "h-3.5 w-3.5",
2433
- viewBox: "0 0 20 20",
2434
- fill: "currentColor",
2435
- stroke: "currentColor",
2436
- "stroke-width": "1"
2437
- }, [
2438
- a("path", {
2439
- "fill-rule": "evenodd",
2440
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
2441
- "clip-rule": "evenodd"
2442
- })
2443
- ])
2444
- ], -1)),
2445
- a("span", io, [
2446
- $(o.$slots, "default")
2447
- ])
2448
- ], 2));
2449
- }
2450
- }), co = { class: "flex flex-col" }, uo = { class: "flex gap-4 mb-6" }, fo = {
2451
- key: 0,
2452
- class: "flex gap-4"
2453
- }, mo = {
2454
- key: 1,
2455
- class: ""
2456
- }, vo = { class: "flex flex-col md:flex-row gap-4" }, po = { class: "flex gap-4" }, ho = { class: "flex justify-between flex-auto" }, go = ["onClick"], bo = /* @__PURE__ */ V({
2457
- __name: "ItemOptions",
2458
- props: {
2459
- min: { default: 0 },
2460
- max: { default: 255 },
2461
- step: { default: 1 },
2462
- disabled: {},
2463
- items: { default: () => [] },
2464
- value: {},
2465
- type: {}
2466
- },
2467
- emits: ["update"],
2468
- setup(e, { emit: n }) {
2469
- const l = n, s = L(() => e.items.map((h, x) => ({ ...h, id: ++x }))), t = D({ name: "", value: "" }), o = L(() => e.items.length + 1), i = L(() => {
2470
- var h;
2471
- return !((h = t.value) != null && h.id);
2472
- }), d = (h) => e.type === h, u = (h, x) => l("update", h, x), r = (h) => h.map(({ name: x, value: _ }) => ({ name: x, value: _ })), c = ({ id: h, name: x, value: _ }) => t.value = { id: h, name: x, value: _ }, m = () => {
2473
- const h = o.value;
2474
- t.value = { name: `New_${h}`, value: `${h}`, id: h }, u("items", r([...s.value, t.value]));
2475
- }, p = (h) => {
2476
- t.value.name === h.name && (t.value = { name: "", value: "" }), u("items", r(s.value.filter((x) => x.value !== h.value)));
2477
- }, g = ze(() => {
2478
- const h = t.value;
2479
- if (!h.name || !h.value) return;
2480
- const x = s.value.map((_) => _.id === h.id ? h : _);
2481
- u("items", r(x));
2482
- }, 300);
2483
- return (h, x) => {
2484
- const _ = ne, C = ye;
2485
- return f(), v("div", co, [
2486
- a("div", uo, [
2487
- b(ro, {
2488
- modelValue: e.disabled,
2489
- "onUpdate:modelValue": x[0] || (x[0] = (z) => u("disabled", z ? 1 : 0))
2490
- }, {
2491
- default: y(() => [...x[6] || (x[6] = [
2492
- I("Disabled", -1)
2493
- ])]),
2494
- _: 1
2495
- }, 8, ["modelValue"])
2496
- ]),
2497
- d("dimmer") ? (f(), v("div", fo, [
2498
- b(J, {
2499
- modelValue: e.min,
2500
- label: "Min",
2501
- "onUpdate:modelValue": x[1] || (x[1] = (z) => u("min", +z))
2502
- }, null, 8, ["modelValue"]),
2503
- b(J, {
2504
- modelValue: e.max,
2505
- label: "Max",
2506
- "onUpdate:modelValue": x[2] || (x[2] = (z) => u("max", +z))
2507
- }, null, 8, ["modelValue"]),
2508
- b(J, {
2509
- modelValue: e.step,
2510
- label: "Step",
2511
- "onUpdate:modelValue": x[3] || (x[3] = (z) => u("step", +z))
2512
- }, null, 8, ["modelValue"])
2513
- ])) : E("", !0),
2514
- d("list") ? (f(), v("div", mo, [
2515
- a("div", vo, [
2516
- b(J, {
2517
- modelValue: t.value.name,
2518
- "onUpdate:modelValue": [
2519
- x[4] || (x[4] = (z) => t.value.name = z),
2520
- T(g)
2521
- ],
2522
- disabled: i.value,
2523
- label: "Name"
2524
- }, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"]),
2525
- b(J, {
2526
- modelValue: t.value.value,
2527
- "onUpdate:modelValue": [
2528
- x[5] || (x[5] = (z) => t.value.value = z),
2529
- T(g)
2530
- ],
2531
- disabled: i.value,
2532
- label: "Value"
2533
- }, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"])
2534
- ]),
2535
- a("div", po, [
2536
- b(te, {
2537
- "model-value": t.value.value,
2538
- label: "List",
2539
- items: s.value,
2540
- top: "unset",
2541
- bottom: "0",
2542
- onChange: c
2543
- }, {
2544
- item: y(({ item: z }) => [
2545
- a("div", ho, [
2546
- a("span", null, k(z.name), 1),
2547
- a("button", {
2548
- class: "cursor-pointer size-4",
2549
- onClick: H((j) => p(z), ["prevent", "stop"])
2550
- }, [
2551
- b(_)
2552
- ], 8, go)
2553
- ])
2554
- ]),
2555
- _: 1
2556
- }, 8, ["model-value", "items"]),
2557
- b(A, {
2558
- class: "px-4",
2559
- color: "blue",
2560
- onClick: m
2561
- }, {
2562
- default: y(() => [
2563
- b(C)
2564
- ]),
2565
- _: 1
2566
- })
2567
- ])
2568
- ])) : E("", !0)
2569
- ]);
2570
- };
2571
- }
2572
- }), yo = { class: "flex flex-col" }, xo = { class: "flex flex-col md:flex-row gap-6 min-h-[300px]" }, $o = { class: "flex-auto order-1" }, ko = { class: "flex-auto gap-x-2 order-1" }, _o = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, wo = { class: "flex gap-2 items-center" }, Co = { class: "flex flex-col gap-4" }, zo = { class: "flex gap-2 flex-wrap flex-auto px-2 py-1" }, So = { class: "relative group" }, Vo = { class: "select-none" }, Bo = ["onClick"], Eo = { class: "flex justify-center order-0 md:order-1 md:mt-11" }, To = { class: "flex-[0_0_130px] size-[130px]" }, Lo = { class: "flex gap-4 justify-end" }, Mo = { class: "relative min-h-[200px] max-h-100dvh overflow-auto scrollbar" }, Ka = /* @__PURE__ */ V({
2573
- __name: "ItemEdit",
2574
- props: {
2575
- items: {},
2576
- item: {},
2577
- object: {},
2578
- listDashboard: {},
2579
- listIcons: {}
2580
- },
2581
- emits: ["button"],
2582
- setup(e, { emit: n }) {
2583
- const l = n, s = [{ title: "Main" }, { title: "Data" }, { title: "Options" }], t = D({
2584
- id: "",
2585
- name: "",
2586
- type: "button",
2587
- icon: "bulb",
2588
- value: "",
2589
- args: [],
2590
- set: "",
2591
- get: "",
2592
- getTo: ""
2593
- }), o = D(!1), i = L(() => {
2594
- var w;
2595
- return !((w = e.item) != null && w.id);
2596
- }), d = L(() => !!e.items.filter((w) => {
2597
- var S;
2598
- return w.id !== ((S = e.item) == null ? void 0 : S.id);
2599
- }).find((w) => w.id === (t == null ? void 0 : t.value.id))), u = L(() => t.value.type === "info"), r = L(() => {
2600
- var w;
2601
- return (w = t.value.args) == null ? void 0 : w.length;
2602
- }), c = L(() => t.value.args.length > 3), m = L(() => {
2603
- if (d.value) return !0;
2604
- const { id: w, args: S } = t.value;
2605
- return !w || !S.length;
2606
- }), p = ({ value: w }) => t.value.icon = w, g = ({ value: w }) => {
2607
- const S = w;
2608
- t.value.type = S, delete t.value.opts, ["button", "list", "dimmer"].includes(S) && (w === "button" && (t.value.opts = {}), w === "list" && (t.value.opts = { items: [] }), w === "dimmer" && (t.value.opts = { min: 0, max: 255, step: 1 }));
2609
- }, h = (w) => {
2610
- w === "get" && (t.value.get ? delete t.value.get : t.value.get = "v"), w === "set" && (t.value.set ? delete t.value.set : t.value.set = "v"), w === "getTo" && (t.value.getTo ? delete t.value.getTo : t.value.getTo = "v");
2611
- }, x = (w) => l("button", w, t.value), _ = (w) => t.value.args = t.value.args.filter((S) => S !== w), C = ({ path: w }) => {
2612
- !t.value.args.length && !t.value.id && (t.value.id = w), t.value.args.push(w), o.value = !1;
2613
- }, z = D(-1), j = (w) => z.value === w, X = (w, S) => {
2614
- w === "enter" && (z.value = S), w === "leave" && (z.value = -1);
2615
- }, xe = (w, S) => {
2616
- w === "set" && (t.value.set = S), w === "get" && (t.value.get = S), w === "getTo" && (t.value.getTo = S), S || delete t.value[w];
2617
- }, at = () => {
2618
- o.value = !0;
2619
- }, it = (w, S) => {
2620
- t.value.opts || (t.value.opts = {}), t.value.opts[w] = S, w === "disabled" && !S && delete t.value.opts[w];
2621
- };
2622
- return fe(() => {
2623
- var w;
2624
- (w = e.item) != null && w.id && (t.value = zt(e.item));
2625
- }), (w, S) => {
2626
- const rt = Ts, ct = ne;
2627
- return f(), v("div", yo, [
2628
- a("div", xo, [
2629
- a("div", $o, [
2630
- b(to, {
2631
- class: "flex-auto min-h-75",
2632
- value: 0,
2633
- items: s
2634
- }, {
2635
- "tab-0": y(() => [
2636
- a("div", ko, [
2637
- b(J, {
2638
- modelValue: t.value.id,
2639
- "onUpdate:modelValue": S[0] || (S[0] = (P) => t.value.id = P),
2640
- label: "ID",
2641
- message: d.value ? w.$t("used") : ""
2642
- }, bt({ _: 2 }, [
2643
- r.value ? void 0 : {
2644
- name: "icon",
2645
- fn: y(() => [
2646
- b(A, {
2647
- color: "transparent",
2648
- onClick: at
2649
- }, {
2650
- default: y(() => [
2651
- b(rt)
2652
- ]),
2653
- _: 1
2654
- })
2655
- ]),
2656
- key: "0"
2657
- }
2658
- ]), 1032, ["modelValue", "message"]),
2659
- b(J, {
2660
- modelValue: t.value.name,
2661
- "onUpdate:modelValue": S[1] || (S[1] = (P) => t.value.name = P),
2662
- label: "Name"
2663
- }, null, 8, ["modelValue"]),
2664
- a("div", _o, [
2665
- b(te, {
2666
- "model-value": t.value.icon,
2667
- bottom: "0",
2668
- top: "unset",
2669
- label: "Icon",
2670
- class: "mb-6",
2671
- items: e.listIcons,
2672
- onChange: p
2673
- }, {
2674
- item: y(({ item: P }) => [
2675
- a("div", wo, [
2676
- $(w.$slots, "icon", {
2677
- icon: P.value
2678
- }),
2679
- a("div", null, k(P.name), 1)
2680
- ])
2681
- ]),
2682
- _: 3
2683
- }, 8, ["model-value", "items"]),
2684
- b(te, {
2685
- "model-value": t.value.type,
2686
- bottom: "0",
2687
- top: "unset",
2688
- label: "Type",
2689
- items: e.listDashboard,
2690
- onChange: g
2691
- }, null, 8, ["model-value", "items"])
2692
- ])
2693
- ])
2694
- ]),
2695
- "tab-1": y(() => [
2696
- a("div", Co, [
2697
- b(Qe, {
2698
- active: !!t.value.args.length,
2699
- disabled: c.value,
2700
- label: "Arguments",
2701
- onIcon: S[2] || (S[2] = (P) => o.value = !0)
2702
- }, {
2703
- default: y(() => [
2704
- a("div", zo, [
2705
- (f(!0), v(O, null, R(t.value.args, (P, Le) => (f(), v("div", {
2706
- key: P,
2707
- class: "flex items-center rounded-full bg-gray-200 dark:bg-gray-900/50 px-2 py-[2px] text-xs"
2708
- }, [
2709
- a("div", So, [
2710
- a("span", Vo, k(P), 1),
2711
- a("div", {
2712
- class: B(["fixed left-1/2 top-1/2 p-4 text-white bg-gray-900 rounded-md group-hover:visible invisible opacity-0 group-hover:opacity-100 z-50 transition-all -translate-1/2", j(Le) ? "visible opacity-100" : ""])
2713
- }, [
2714
- a("pre", null, k(T(dt)(P, e.object)), 1)
2715
- ], 2)
2716
- ]),
2717
- Le || t.value.args.length < 2 ? (f(), v("button", {
2718
- key: 0,
2719
- class: "cursor-pointer ms-1",
2720
- onClick: (ka) => _(P)
2721
- }, [
2722
- b(ct, { class: "size-5" })
2723
- ], 8, Bo)) : E("", !0)
2724
- ]))), 128))
2725
- ])
2726
- ]),
2727
- _: 1
2728
- }, 8, ["active", "disabled"]),
2729
- b($e, {
2730
- value: t.value.set,
2731
- args: t.value.args,
2732
- disabled: !r.value || u.value,
2733
- label: "Set",
2734
- onIcon: S[3] || (S[3] = (P) => h("set")),
2735
- onHover: X,
2736
- onChange: S[4] || (S[4] = (P) => xe("set", P))
2737
- }, null, 8, ["value", "args", "disabled"]),
2738
- b($e, {
2739
- value: t.value.get,
2740
- args: t.value.args,
2741
- disabled: !r.value,
2742
- label: "Get",
2743
- onIcon: S[5] || (S[5] = (P) => h("get")),
2744
- onHover: X,
2745
- onChange: S[6] || (S[6] = (P) => xe("get", P))
2746
- }, null, 8, ["value", "args", "disabled"]),
2747
- b($e, {
2748
- value: t.value.getTo,
2749
- args: t.value.args,
2750
- disabled: !r.value,
2751
- label: "GetTo",
2752
- onIcon: S[7] || (S[7] = (P) => h("getTo")),
2753
- onHover: X,
2754
- onChange: S[8] || (S[8] = (P) => xe("getTo", P))
2755
- }, null, 8, ["value", "args", "disabled"])
2756
- ])
2757
- ]),
2758
- "tab-2": y(() => [
2759
- b(bo, N(t.value.opts, {
2760
- value: t.value.value,
2761
- type: t.value.type,
2762
- onUpdate: it
2763
- }), null, 16, ["value", "type"])
2764
- ]),
2765
- _: 3
2766
- })
2767
- ]),
2768
- a("div", Eo, [
2769
- a("div", To, [
2770
- $(w.$slots, "default", { item: t.value })
2771
- ])
2772
- ])
2773
- ]),
2774
- a("div", Lo, [
2775
- b(A, {
2776
- class: "px-4",
2777
- color: "blue",
2778
- disabled: m.value,
2779
- onClick: S[9] || (S[9] = (P) => x(i.value ? "add" : "save"))
2780
- }, {
2781
- default: y(() => [
2782
- I(k(i.value ? w.$t("add") : w.$t("save")), 1)
2783
- ]),
2784
- _: 1
2785
- }, 8, ["disabled"]),
2786
- b(A, {
2787
- class: "px-4",
2788
- color: "red",
2789
- outline: "",
2790
- onClick: S[10] || (S[10] = (P) => x("remove"))
2791
- }, {
2792
- default: y(() => [
2793
- I(k(w.$t("remove")), 1)
2794
- ]),
2795
- _: 1
2796
- })
2797
- ]),
2798
- o.value ? (f(), M(Be, {
2799
- key: 0,
2800
- size: "md",
2801
- title: w.$t("select"),
2802
- onClose: S[11] || (S[11] = (P) => o.value = !1)
2803
- }, {
2804
- default: y(() => [
2805
- a("div", Mo, [
2806
- b(et, {
2807
- items: e.object,
2808
- onlyValue: !r.value,
2809
- onClick: C
2810
- }, null, 8, ["items", "onlyValue"])
2811
- ])
2812
- ]),
2813
- _: 1
2814
- }, 8, ["title"])) : E("", !0)
2815
- ]);
2816
- };
2817
- }
2818
- }), Ae = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' }, Ao = { lineHeight: "inherit", whiteSpace: "pre-wrap", wordBreak: "keep-all", overflowWrap: "break-word", background: "none", position: "absolute", width: "100%", height: "100%", zIndex: "1", resize: "none", caretColor: "currentColor", padding: "inherit", outline: "none", fontSize: "inherit", fontFamily: "inherit", letterSpacing: "inherit", boxSizing: "border-box", border: "none", top: "0px", left: "0px", color: "inherit", overflow: "hidden", "-webkit-font-smoothing": "antialiased", "-webkit-text-fill-color": "transparent" }, Do = { lineHeight: "inherit", position: "relative", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "0", width: "100%", margin: "0", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, Io = { lineHeight: "inherit", position: "absolute", width: "100%", height: "100%", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "inherit", margin: "0", top: "0px", left: "0px", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, tt = (e) => nt(e);
2819
- function De(e) {
2820
- const n = Array.isArray(e) ? e : [e];
2821
- return n.length === 0 ? tt : (l) => n.reduce((s, t, o) => t(s, { html: o > 0 }), l);
2822
- }
2823
- class Oo {
2824
- constructor(n, l = {}) {
2825
- if (this.lines = null, !n) throw new Error("selector is not defined");
2826
- if (this.root = n instanceof Node ? n : document.querySelector(n), !this.root) throw new Error(`element with "${n}" selector is not exist`);
2827
- const s = { value: "", styles: {}, plugins: [], highlighter: tt }, { highlighters: t, ...o } = l;
2828
- this.options = { ...s, ...o, highlighter: t ? De(t) : s.highlighter }, this.options.value = this.options.value == null ? "" : String(this.options.value), this.init();
2829
- }
2830
- init() {
2831
- this.textarea = document.createElement("textarea"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocomplete", "off"), this.pre = document.createElement("pre");
2832
- const n = Object.keys(Ae).concat(Object.keys(this.options.styles)).concat(["paddingLeft"]);
2833
- this.initialRootStyles = {};
2834
- const l = this.root.style;
2835
- n.forEach((s) => {
2836
- this.initialRootStyles[s] = l[s] || "";
2837
- }), Object.assign(this.root.style, Ae, this.options.styles), Object.assign(this.textarea.style, Ao), Object.assign(this.pre.style, Do), this.basePaddingLeft = this.root.style.paddingLeft || "", this.root.appendChild(this.textarea), this.root.appendChild(this.pre), this.addTextareaEvents(), this.update({ value: this.options.value }), this.updateLines();
2838
- }
2839
- addTextareaEvents() {
2840
- this.handleEvent = (n) => {
2841
- if (n.type === "keydown" && this.textarea.readOnly) return;
2842
- const l = n;
2843
- if (l.isComposing || l.keyCode === 229) return;
2844
- const s = function(t, o) {
2845
- const { value: i, selectionStart: d, selectionEnd: u } = o.target;
2846
- return t.reduce((r, c) => ({ ...r, ...c(r, o) }), { value: i, selectionStart: d, selectionEnd: u });
2847
- }(this.options.plugins, n);
2848
- this.update(s);
2849
- }, this.textarea.addEventListener("input", this.handleEvent), this.textarea.addEventListener("keydown", this.handleEvent), this.textarea.addEventListener("compositionend", this.handleEvent);
2850
- }
2851
- update(n) {
2852
- if (!this.textarea) return;
2853
- let { value: l, selectionStart: s, selectionEnd: t } = n;
2854
- l != null && (l = String(l), s == null && (s = this.textarea.selectionStart), t == null && (t = this.textarea.selectionEnd), this.textarea.value !== l && (this.textarea.value = l)), s != null && (this.textarea.selectionStart = s), t != null && (this.textarea.selectionEnd = t), l !== this.value && l != null && (this.value = l, this.render(), this.updateCallback && this.updateCallback(l));
2855
- }
2856
- updateOptions(n) {
2857
- if (!this.textarea) return;
2858
- const { highlighters: l, ...s } = n;
2859
- if (this.options = { ...this.options, ...s, highlighter: l ? De(l) : this.options.highlighter }, n.styles) {
2860
- const t = this.root.style;
2861
- Object.keys(n.styles).forEach((o) => {
2862
- o in this.initialRootStyles || (this.initialRootStyles[o] = t[o] || "");
2863
- }), Object.assign(this.root.style, n.styles), ("paddingLeft" in n.styles || "padding" in n.styles) && (this.basePaddingLeft = this.root.style.paddingLeft || "");
2864
- }
2865
- this.lines && !this.options.lineNumbers && (ve(this.lines), this.lines = null, this.root.style.paddingLeft = this.basePaddingLeft), n.value != null && this.update({ value: n.value }), this.render();
2866
- }
2867
- render() {
2868
- const n = this.options.highlighter(this.value);
2869
- this.pre.innerHTML = n + "<br/>", this.updateLines();
2870
- }
2871
- updateLines() {
2872
- if (!this.options.lineNumbers) return;
2873
- this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style, Io));
2874
- const n = this.value.split(`
2875
- `), l = n.length.toString().length;
2876
- this.root.style.paddingLeft = `${l + 1}ch`, this.lines.innerHTML = n.map((s, t) => `${`<span class="yace-line" style="position: absolute; opacity: .3; left: 0; width: ${l}ch; text-align: right">${1 + t}</span>`}${`<span style="color: transparent; pointer-events: none">${nt(s)}</span>`}`).join(`
2877
- `);
2878
- }
2879
- destroy() {
2880
- this.textarea && (this.textarea.removeEventListener("input", this.handleEvent), this.textarea.removeEventListener("keydown", this.handleEvent), this.textarea.removeEventListener("compositionend", this.handleEvent), ve(this.textarea), ve(this.pre), ve(this.lines), Object.assign(this.root.style, this.initialRootStyles), Object.assign(this, { textarea: null, pre: null, lines: null, updateCallback: null, handleEvent: null, initialRootStyles: null, options: null, root: null }));
2881
- }
2882
- onUpdate(n) {
2883
- this.updateCallback = n;
2884
- }
2885
- }
2886
- function ve(e) {
2887
- e && e.parentNode && e.parentNode.removeChild(e);
2888
- }
2889
- function nt(e) {
2890
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
2891
- }
2892
- const Ie = { alt: "altKey", control: "ctrlKey", ctrl: "ctrlKey", meta: "metaKey", shift: "shiftKey", "ctrl/cmd": typeof window < "u" && window.navigator && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform) ? "metaKey" : "ctrlKey" }, jo = { add: "=" }, Po = { ";": "semicolon", "=": "equal", ",": "comma", "-": "minus", ".": "period", "/": "slash", "`": "backquote", "[": "bracketleft", "\\": "backslash", "]": "bracketright", "'": "quote" };
2893
- function ce(e, n) {
2894
- const l = e.split("+").reduce((u, r) => Ie[r] ? (u.modifiers[Ie[r]] = !0, u) : { ...u, key: jo[r] || r.toLowerCase() }, { modifiers: { altKey: !1, ctrlKey: !1, metaKey: !1, shiftKey: !1 }, key: null }), s = Object.keys(l.modifiers).every((u) => l.modifiers[u] ? n[u] : !n[u]);
2895
- if (!l.key) return s;
2896
- const t = n.key != null && n.key.toLowerCase() === l.key, o = (i = l.key, /^[a-z]$/.test(i) ? `key${i}` : /^[0-9]$/.test(i) ? `digit${i}` : Po[i] || null);
2897
- var i;
2898
- const d = !n.isComposing && o != null && n.code != null && n.code.toLowerCase() === o;
2899
- return s && (t || d);
2900
- }
2901
- function Ho(e = {}) {
2902
- const n = Math.max(1, e.limit == null ? 300 : e.limit), l = e.coalesceMs == null ? 300 : e.coalesceMs;
2903
- let s = [], t = null, o = null;
2904
- const i = (d) => {
2905
- s = s.slice(0, t + 1), s.push(d), s.length > n && (s = s.slice(s.length - n)), t = s.length - 1;
2906
- };
2907
- return (d, u) => {
2908
- const r = u.type === "keydown" && ce("ctrl/cmd+z", u), c = u.type === "keydown" && (ce("ctrl/cmd+shift+z", u) || ce("ctrl+y", u));
2909
- if ((r || c) && u.preventDefault(), t === null) return s = [d], void (t = 0);
2910
- if (r) return o = null, s[t].value !== d.value ? i(d) : s[t] = d, t = Math.max(0, t - 1), s[t];
2911
- if (c) return o = null, s[t].value !== d.value ? void i(d) : (t = Math.min(s.length - 1, t + 1), s[t]);
2912
- if (u.type === "keydown") return s[t].value !== d.value ? (o = null, void i(d)) : void (s[t] = d);
2913
- if (u.type === "input") {
2914
- const m = u.timeStamp, p = m != null && o != null && m - o <= l;
2915
- if (o = m ?? null, p) return void (s[t] = d);
2916
- i(d);
2917
- }
2918
- };
2919
- }
2920
- const No = () => (e, n) => {
2921
- const { value: l, selectionStart: s, selectionEnd: t } = e;
2922
- if (!ce("enter", n) || n.type !== "keydown") return;
2923
- const o = l.substring(0, s).split(`
2924
- `).pop(), i = /^\s+/.exec(o);
2925
- if (!i) return;
2926
- n.preventDefault();
2927
- const d = `
2928
- ` + i[0];
2929
- return { value: l.substring(0, s) + d + l.substring(t), selectionStart: s + d.length, selectionEnd: s + d.length };
2930
- }, Fo = () => (e, n) => {
2931
- if (!(n instanceof KeyboardEvent) || n.key !== "Enter")
2932
- return;
2933
- const { value: l, selectionStart: s, selectionEnd: t } = e;
2934
- if (s !== t)
2935
- return;
2936
- const o = l.lastIndexOf(`
2937
- `, s - 1) + 1, i = l.indexOf(`
2938
- `, s), d = i === -1 ? l.length : i;
2939
- if (l.slice(s, d).trim().length > 0)
2940
- return;
2941
- const c = l.substring(o, d).trimEnd();
2942
- if (c.endsWith(";") || c.length === 0)
2943
- return;
2944
- const m = l.slice(0, d) + ";" + l.slice(d), p = s + 1;
2945
- return {
2946
- value: m,
2947
- selectionStart: p,
2948
- selectionEnd: p
2949
- };
2950
- };
2951
- let Ee = [], q = null, W = 0, Y = [], ee = null, le = null, Te, lt, G = null, oe = null;
2952
- const Ro = (e) => {
2953
- const { customSuggestions: n = [], minPrefixLength: l = 1, maxSuggestions: s = 20, tabSize: t = 2, tooltip: o = { enabled: !0 }, i18n: i, renderMenu: d, renderTooltip: u } = e;
2954
- if (!d || !u)
2955
- throw new Error("renderMenu and renderTooltip are required");
2956
- return Ee = [...n].map((r) => i(r)), Te = d, lt = u, (r, c) => {
2957
- if (!(c instanceof KeyboardEvent))
2958
- return;
2959
- const { value: m, selectionStart: p } = r, g = c.target;
2960
- if (le = g, o.enabled !== !1 && !g.dataset.tooltipInitialized && (g.dataset.tooltipInitialized = "true", g.addEventListener("mouseup", () => {
2961
- setTimeout(() => Oe(g), 100);
2962
- }), g.addEventListener("keyup", () => {
2963
- setTimeout(() => Oe(g), 100);
2964
- })), q) {
2965
- switch (c.key) {
2966
- case "ArrowDown":
2967
- return c.preventDefault(), W < Y.length - 1 && (W++, se()), { ...r };
2968
- case "ArrowUp":
2969
- return c.preventDefault(), W > 0 && (W--, se()), { ...r };
2970
- case "Enter":
2971
- if (c.preventDefault(), Y[W]) {
2972
- const h = _e(r, Y[W]);
2973
- return Z(), h;
2974
- }
2975
- return;
2976
- case "Tab":
2977
- if (c.preventDefault(), Y[W]) {
2978
- const h = _e(r, Y[W]);
2979
- return Z(), h;
2980
- }
2981
- return;
2982
- case "Escape":
2983
- return c.preventDefault(), Z(), { ...r };
2984
- case "Backspace":
2985
- setTimeout(() => {
2986
- if (le) {
2987
- const h = le.value, x = le.selectionStart, _ = he(h, x), C = h.slice(_, x);
2988
- if (C.length < l)
2989
- Z();
2990
- else {
2991
- const z = ke(C).slice(0, s);
2992
- z.length === 0 ? Z() : (Y = z, W = 0, se());
2993
- }
2994
- }
2995
- }, 0);
2996
- return;
2997
- }
2998
- if (["ArrowDown", "ArrowUp", "Enter", "Tab", "Escape", "Backspace"].includes(c.key))
2999
- return { ...r };
3000
- }
3001
- if (ce("tab", c)) {
3002
- c.preventDefault();
3003
- const h = he(m, p), x = m.slice(h, p);
3004
- if (x.length > 0) {
3005
- const j = ke(x);
3006
- if (j.length > 0)
3007
- return _e(r, j[0]);
3008
- }
3009
- const _ = " ".repeat(t), C = m.slice(0, p) + _ + m.slice(p), z = p + t;
3010
- return {
3011
- value: C,
3012
- selectionStart: z,
3013
- selectionEnd: z
3014
- };
3015
- }
3016
- if (!(c.key.length !== 1 || c.ctrlKey || c.metaKey || c.altKey))
3017
- return ee && clearTimeout(ee), ee = setTimeout(() => {
3018
- ee = null;
3019
- const h = g.value, x = g.selectionStart, _ = he(h, x), C = h.slice(_, x);
3020
- if (C.length < l) {
3021
- Z();
3022
- return;
3023
- }
3024
- let z = ke(C);
3025
- if (z = z.slice(0, s), z.length === 0) {
3026
- Z();
3027
- return;
3028
- }
3029
- Y = z, W = 0, q ? se() : Uo(g, z);
3030
- }, 0), { ...r };
3031
- };
3032
- };
3033
- function ke(e) {
3034
- const n = e.toLowerCase();
3035
- return Ee.filter((l) => {
3036
- const s = l.label.toLowerCase();
3037
- return s.startsWith(n) || s.includes(n) || s.split("_").map((t) => t[0]).join("").startsWith(n);
3038
- }).sort((l, s) => {
3039
- const t = l.label.toLowerCase(), o = s.label.toLowerCase(), i = t.startsWith(n), d = o.startsWith(n);
3040
- if (i && !d) return -1;
3041
- if (!i && d) return 1;
3042
- const u = t.indexOf(n), r = o.indexOf(n);
3043
- return u !== r ? u - r : t.length !== o.length ? t.length - o.length : t.localeCompare(o);
3044
- });
3045
- }
3046
- function he(e, n) {
3047
- let l = n;
3048
- for (; l > 0 && /[a-zA-Z0-9_$]/.test(e[l - 1]); )
3049
- l--;
3050
- return l;
3051
- }
3052
- function Uo(e, n) {
3053
- Z(), Y = n, W = 0;
3054
- const l = st(e);
3055
- q = Te(n, W, (s) => {
3056
- W = s, se();
3057
- }), Object.assign(q.style, {
3058
- position: "fixed",
3059
- left: `${l.left}px`,
3060
- top: `${l.top + 24}px`,
3061
- zIndex: "10000"
3062
- }), document.body.appendChild(q);
3063
- }
3064
- function se() {
3065
- if (!q || !le) return;
3066
- const e = Te(Y, W, (l) => {
3067
- W = l, se();
3068
- }), n = q.getBoundingClientRect();
3069
- q.replaceWith(e), q = e, Object.assign(q.style, {
3070
- position: "fixed",
3071
- left: `${n.left}px`,
3072
- top: `${n.top}px`,
3073
- zIndex: "10000"
3074
- });
3075
- }
3076
- function _e(e, n) {
3077
- const { value: l, selectionStart: s } = e, t = he(l, s), o = n.insert || n.label, i = /\$\{([^}]*)\}/g;
3078
- let d = o;
3079
- const u = [];
3080
- let r;
3081
- for (; (r = i.exec(o)) !== null; ) {
3082
- const h = r[1], x = r.index, _ = r[0].length;
3083
- u.push({ index: x, text: h, length: _ });
3084
- }
3085
- d = o.replace(/\$\{([^}]*)\}/g, "$1");
3086
- const c = u[0];
3087
- let m = t + d.length, p = t + d.length;
3088
- if (c) {
3089
- let h = 0, x = 0, _ = !1;
3090
- for (; x < o.length && !_; ) {
3091
- const C = u.find((z) => z.index === x);
3092
- C ? (h += C.text.length, x += C.length, C === c && (m = t + h - C.text.length, p = t + h, _ = !0)) : (h++, x++);
3093
- }
3094
- }
3095
- return {
3096
- value: l.slice(0, t) + d + l.slice(s),
3097
- selectionStart: m,
3098
- selectionEnd: p
3099
- };
3100
- }
3101
- function Z() {
3102
- ee && (clearTimeout(ee), ee = null), q && (q.remove(), q = null, Y = [], W = 0, le = null);
3103
- }
3104
- function st(e) {
3105
- const n = e.getBoundingClientRect(), { value: l, selectionStart: s } = e, o = l.substring(0, s).split(`
3106
- `), i = o.length, d = o[o.length - 1] || "", u = parseInt(getComputedStyle(e).lineHeight) || 20;
3107
- return {
3108
- left: n.left + 10 + d.length * 8,
3109
- top: n.top + (i - 1) * u
3110
- };
3111
- }
3112
- function Oe(e) {
3113
- oe && clearTimeout(oe), oe = setTimeout(() => {
3114
- const n = e.selectionStart, l = e.selectionEnd;
3115
- if (n === l) {
3116
- re();
3117
- return;
3118
- }
3119
- const s = e.value.substring(n, l).trim();
3120
- if (!s) {
3121
- re();
3122
- return;
3123
- }
3124
- const t = Ee.find((d) => d.label === s);
3125
- if (!t) {
3126
- re();
3127
- return;
3128
- }
3129
- const o = st(e), i = lt(t, o);
3130
- i.style.opacity = "0", G && G.remove(), G = i, document.body.appendChild(G), requestAnimationFrame(() => {
3131
- G && (G.style.opacity = "1");
3132
- }), setTimeout(() => re(), 3e3);
3133
- }, 300);
3134
- }
3135
- function re() {
3136
- oe && (clearTimeout(oe), oe = null), G && (G.style.opacity = "0", setTimeout(() => {
3137
- G && (G.remove(), G = null);
3138
- }, 150));
3139
- }
3140
- document.addEventListener("mousedown", (e) => {
3141
- const n = e.target;
3142
- q && !q.contains(n) && Z(), G && !G.contains(n) && re();
3143
- });
3144
- const we = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Ko = ["else", "end", "call", "fade"], Wo = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), qo = (e) => {
3145
- const n = e.filter((d) => d.type !== "var").map((d) => d.label), i = `(\\/\\/[^\\n]*)|('[^'\\n]*')|(\\b\\d+(?:\\.\\d+)?\\b)|(\\b(?:${Array.from(/* @__PURE__ */ new Set([...Ko, ...n])).map(Wo).join("|")})\\b)|(\\$[a-zA-Z_][a-zA-Z0-9_]*)|(\\b(?:btn_\\d+(?:_\\d+)?)\\b)|([;:(){}])`;
3146
- return new RegExp(i, "g");
3147
- }, Go = (e) => (n) => {
3148
- const l = qo(e);
3149
- let s = "", t = 0;
3150
- for (const o of n.matchAll(l)) {
3151
- const [i, d, u, r, c, m, p, g] = o;
3152
- let h = "";
3153
- d ? h = "comment" : u ? h = "str" : r ? h = "num" : c ? h = "word" : m ? h = "var" : p ? h = "event" : g && (h = "operator"), s += we(n.slice(t, o.index)), s += `<span class="tok--${h}">${we(i)}</span>`, t = o.index + i.length;
3154
- }
3155
- return s += we(n.slice(t)), s;
3156
- }, ot = {
3157
- word: "text-blue-600 dark:text-blue-400",
3158
- func: "text-yellow-600 dark:text-yellow-400",
3159
- var: "text-cyan-600 dark:text-cyan-400",
3160
- event: "text-purple-600 dark:text-purple-400"
3161
- }, Jo = (e, n, l) => {
3162
- const s = document.createElement("div");
3163
- return s.className = `
3164
- fixed z-[10000] min-w-[250px] max-w-[400px] max-h-[250px]
3165
- overflow-y-auto p-1 rounded-lg shadow-lg border
3166
- border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800
3167
- text-sm font-mono scrollbar pointer-events-none
3168
- `, e.forEach((t, o) => {
3169
- const i = o === n, d = document.createElement("div");
3170
- d.className = `
3171
- flex items-center justify-between gap-2 px-3 py-1.5 cursor-pointer
3172
- rounded transition-colors duration-100 border-l-2
3173
- ${i ? "border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-900/30" : "border-transparent hover:bg-gray-100 dark:hover:bg-gray-700"}
3174
- `;
3175
- const u = ot[t.type] || "text-gray-700 dark:text-gray-300";
3176
- d.innerHTML = `
3177
- <div class="flex items-center gap-2 flex-1">
3178
- <span class="${u} font-medium">${t.label}</span>
3179
- ${t.detail ? `<span class="text-xs text-gray-500 dark:text-gray-400 ml-2">${t.detail}</span>` : ""}
3180
- </div>
3181
- ${t.description ? `<span class="text-xs text-gray-400 dark:text-gray-500">${t.description}</span>` : ""}
3182
- `, d.addEventListener("click", () => l(o)), s.appendChild(d);
3183
- }), s;
3184
- }, Xo = (e, n) => {
3185
- const l = document.createElement("div");
3186
- l.className = `
3187
- fixed z-[10001] px-3 py-2 font-mono text-sm max-w-[300px]
3188
- min-w-[50px] min-h-[20px] rounded-lg shadow-lg border
3189
- pointer-events-none transition-opacity duration-150
3190
- bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700
3191
- text-gray-700 dark:text-gray-300 pointer-events-none
3192
- `, l.style.cssText = `
3193
- left: ${n.left + 40}px; top: ${n.top - 10}px;
3194
- transform: translateX(-50%) translateY(-100%); opacity: 0;
3195
- `;
3196
- let t = `<div class="font-medium ${ot[e.type] || "text-gray-700 dark:text-gray-300"}">${e.label}</div>`;
3197
- e.detail && (t += `<div class="text-gray-500 dark:text-gray-400 mt-0.5 text-xs">${e.detail}</div>`), e.description && (t += `<div class="text-gray-400 dark:text-gray-500 text-xs mt-1 pt-1 border-t border-gray-200 dark:border-gray-700">${e.description}</div>`), l.innerHTML = t;
3198
- const o = document.createElement("div");
3199
- return o.className = `
3200
- absolute bottom-[-6px] left-1/2 w-2.5 h-2.5 -translate-x-1/2 rotate-45
3201
- bg-white dark:bg-gray-800 border-r border-b border-gray-200 dark:border-gray-700
3202
- `, l.appendChild(o), l;
3203
- }, Yo = [
3204
- { label: "if", type: "word", insert: `if:\${$v0<10};
3205
-
3206
- else;
3207
-
3208
- end;`, detail: "if:${$v0<10};else;end;" },
3209
- { label: "while", type: "word", insert: `$v0=0;
3210
- while:\${$v0<10};
3211
- log($v0);
3212
- $v0=$v0+1;
3213
- wait(1s);
3214
- end;`, detail: "while:${$v0<2}; end;" },
3215
- { label: "udp", type: "func", insert: "udp(${},'call(1)')", detail: "udp(id:number, text:string)" },
3216
- { label: "on", type: "func", insert: `on('\${event}');
3217
-
3218
- end;`, detail: "event(name: string)" },
3219
- { label: "wait", type: "func", insert: "wait(${1s});", detail: "wait(10ms | 1s | 1m | 1h)" },
3220
- { label: "log", type: "func", insert: "log(${});", detail: "log(text: string | number)" },
3221
- { label: "len", type: "func", insert: "len(${$a0});", detail: "len(arr: array)" },
3222
- { label: "set", type: "func", insert: "set(${$a0},${2},${10});", detail: "set(arr: array, index: number, value: number)" },
3223
- { label: "get", type: "func", insert: "get(${$a0},${0});", detail: "get(arr: array, index: number)" },
3224
- { label: "ord", type: "func", insert: "ord(${$s0});", detail: "ord(char: string)" },
3225
- { label: "chr", type: "func", insert: "chr(${65});", detail: "chr(v: number)" },
3226
- { label: "btn", type: "event", detail: "Change state " },
3227
- { label: "btn_c", type: "event", detail: "Count click button <br>$e0=gpio:number<br>$e1=value:number<br>$e2=type?:number" },
3228
- { label: "btn_l", type: "event", detail: "Long press of the button <br>$e0=gpio:number<br>$e1=value:number" },
3229
- { label: "btn_r", type: "event", detail: "Repeat while holding the button <br>$e0=gpio:number<br>$e1=value:number" },
3230
- { label: "$u", type: "var", insert: "$u${0}", detail: "var (uint) " },
3231
- { label: "$i", type: "var", insert: "$i${0}", detail: "var (int)" },
3232
- { label: "$f", type: "var", insert: "$f${0}", detail: "var (float)" },
3233
- { label: "$s", type: "var", insert: "$s${0}", detail: "var (string)" },
3234
- { label: "$a", type: "var", insert: "$a${0}", detail: "var (array)" },
3235
- { label: "$e", type: "var", insert: "$e${0}", detail: "var event" },
3236
- { label: "$c", type: "var", insert: "$c${0}", detail: "var call" },
3237
- { label: "$p", type: "var", insert: "$p${0}", detail: "gpio" }
3238
- ], Wa = /* @__PURE__ */ V({
3239
- __name: "ScriptEditor",
3240
- props: {
3241
- modelValue: {},
3242
- suggestions: { default: () => [] }
3243
- },
3244
- emits: ["update:modelValue", "update"],
3245
- setup(e, { emit: n }) {
3246
- const l = n;
3247
- let s;
3248
- const t = [...Yo, ...e.suggestions];
3249
- return ue(
3250
- () => e.modelValue,
3251
- (o) => {
3252
- s.update({ value: o });
3253
- }
3254
- ), fe(() => {
3255
- s = new Oo("#editor", {
3256
- value: e.modelValue,
3257
- lineNumbers: !0,
3258
- highlighters: [Go(t)],
3259
- plugins: [
3260
- Ho(),
3261
- No(),
3262
- Ro({
3263
- customSuggestions: t,
3264
- minPrefixLength: 1,
3265
- maxSuggestions: 20,
3266
- i18n: (o) => o,
3267
- tooltip: {
3268
- enabled: !0
3269
- },
3270
- renderMenu: Jo,
3271
- renderTooltip: Xo
3272
- }),
3273
- Fo()
3274
- ],
3275
- styles: { fontSize: "14px" }
3276
- }), s.onUpdate((o) => {
3277
- l("update:modelValue", o);
3278
- });
3279
- }), Fe(() => {
3280
- s.destroy();
3281
- }), (o, i) => (f(), v("div", null, [...i[0] || (i[0] = [
3282
- a("div", {
3283
- class: "",
3284
- id: "editor"
3285
- }, null, -1)
3286
- ])]));
3287
- }
3288
- }), Zo = { class: "max-w-4xl mx-auto" }, Qo = {
3289
- key: 0,
3290
- class: "text-sm"
3291
- }, ea = {
3292
- key: 0,
3293
- class: "text-gray-500"
3294
- }, ta = {
3295
- key: 1,
3296
- class: "text-red-600"
3297
- }, na = ["innerHTML"], la = "https://raw.githubusercontent.com/bondrogeen/vuesp/refs/heads/master/github/docs/scriptrunner/", sa = "https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js", qa = /* @__PURE__ */ V({
3298
- __name: "ScriptViewDocs",
3299
- props: {
3300
- lang: { default: "en" }
3301
- },
3302
- setup(e) {
3303
- const n = D(""), l = D(""), s = D(null), t = D(!1), o = D(null);
3304
- let i = null;
3305
- const d = () => new Promise((c, m) => {
3306
- if (window.marked) {
3307
- window.marked.setOptions({
3308
- gfm: !0,
3309
- breaks: !0,
3310
- headerIds: !1
3311
- }), c(window.marked);
3312
- return;
3313
- }
3314
- const p = document.createElement("script");
3315
- p.src = sa, p.async = !0, p.onload = () => {
3316
- window.marked ? (window.marked.setOptions({
3317
- gfm: !0,
3318
- breaks: !0,
3319
- headerIds: !1
3320
- }), c(window.marked)) : m(new Error("Marked library not found after loading"));
3321
- }, p.onerror = () => {
3322
- m(new Error("Failed to load Marked library from CDN"));
3323
- }, document.head.appendChild(p);
3324
- }), u = (c) => {
3325
- const m = c.split(`
3326
- `), p = {};
3327
- let g = !0;
3328
- for (const h of m) {
3329
- if (g && h.startsWith("#")) {
3330
- g = !1;
3331
- continue;
3332
- }
3333
- if (g && h.includes(":")) {
3334
- const [x, _] = h.split(":").map((C) => C.trim());
3335
- x && _ && (x.toLowerCase().includes("version") && (p.version = _), (x.toLowerCase().includes("обновлено") || x.toLowerCase().includes("updated")) && (p.updated = _));
3336
- }
3337
- }
3338
- return p;
3339
- }, r = async (c) => {
3340
- if (!i) {
3341
- o.value = "error";
3342
- return;
3343
- }
3344
- t.value = !0, o.value = null, l.value = "";
3345
- try {
3346
- const m = `${la}${c}.md`, p = await fetch(m);
3347
- if (!p.ok)
3348
- throw new Error(`HTTP ${p.status}: ${p.statusText}`);
3349
- const g = await p.text();
3350
- n.value = g, s.value = u(g), l.value = i.parse(g);
3351
- } catch (m) {
3352
- const p = m instanceof Error ? m.message : "";
3353
- o.value = p, console.error("Error loading docs:", m);
3354
- } finally {
3355
- t.value = !1;
3356
- }
3357
- };
3358
- return fe(async () => {
3359
- try {
3360
- i = await d();
3361
- const c = e.lang ? "ru" : "en";
3362
- await r(c);
3363
- } catch (c) {
3364
- const m = c instanceof Error ? c.message : "";
3365
- o.value = m, console.error("Initialization error:", c);
3366
- }
3367
- }), (c, m) => (f(), v("div", Zo, [
3368
- t.value || o.value ? (f(), v("div", Qo, [
3369
- t.value ? (f(), v("span", ea, "⏳")) : E("", !0),
3370
- o.value ? (f(), v("span", ta, "❌ " + k(o.value), 1)) : E("", !0)
3371
- ])) : E("", !0),
3372
- a("div", {
3373
- class: "docs-content",
3374
- innerHTML: l.value
3375
- }, null, 8, na)
3376
- ]));
3377
- }
3378
- }), Ga = /* @__PURE__ */ V({
3379
- __name: "VAutocomplete",
3380
- props: {
3381
- modelValue: { default: "" },
3382
- label: {},
3383
- name: { default: "" },
3384
- message: { default: "" },
3385
- items: {}
3386
- },
3387
- emits: ["update:modelValue", "select"],
3388
- setup(e, { emit: n }) {
3389
- const l = n, s = (o) => l("update:modelValue", o), t = (o, i) => {
3390
- o.click(new Event("click")), l("select", i);
3391
- };
3392
- return (o, i) => (f(), M(be, N(o.$attrs, {
3393
- top: "50px",
3394
- "hide-on-click": ""
3395
- }), {
3396
- activator: y(({ on: d }) => [
3397
- b(J, {
3398
- "model-value": e.modelValue,
3399
- name: e.name,
3400
- message: e.message,
3401
- label: e.label,
3402
- "onUpdate:modelValue": s,
3403
- onClick: d.open
3404
- }, null, 8, ["model-value", "name", "message", "label", "onClick"])
3405
- ]),
3406
- default: y(({ on: d }) => [
3407
- b(me, {
3408
- items: e.items,
3409
- onClick: (u) => t(d, u)
3410
- }, {
3411
- default: y(({ item: u }) => [
3412
- $(o.$slots, "default", { item: u }, () => [
3413
- I(k(u.name), 1)
3414
- ])
3415
- ]),
3416
- _: 3
3417
- }, 8, ["items", "onClick"])
3418
- ]),
3419
- _: 3
3420
- }, 16));
3421
- }
3422
- }), oa = {
3423
- viewBox: "0 0 24 24",
3424
- width: "1.2em",
3425
- height: "1.2em"
3426
- };
3427
- function aa(e, n) {
3428
- return f(), v("svg", oa, [...n[0] || (n[0] = [
3429
- a("path", {
3430
- fill: "currentColor",
3431
- d: "m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"
3432
- }, null, -1)
3433
- ])]);
3434
- }
3435
- const ia = F({ name: "ri-arrow-drop-down-line", render: aa }), ra = { class: "v-expansion__content max-h-0 overflow-hidden transition-all duration-300" }, ca = { class: "p-4" }, Ja = /* @__PURE__ */ V({
3436
- __name: "VExpansion",
3437
- props: {
3438
- label: { default: "" },
3439
- value: { type: Boolean, default: !1 }
3440
- },
3441
- setup(e) {
3442
- const n = D(null), l = D(e.value), s = () => {
3443
- if (!n.value) return;
3444
- const o = n.value.querySelector(".v-expansion__content");
3445
- o && (o.style.maxHeight = l.value ? `${o.scrollHeight}px` : "0");
3446
- }, t = () => {
3447
- l.value = !l.value, s();
3448
- };
3449
- return fe(() => {
3450
- s();
3451
- }), (o, i) => {
3452
- const d = ia;
3453
- return f(), v("div", {
3454
- ref_key: "root",
3455
- ref: n,
3456
- class: "border-b dark:border-gray-700 border-gray-200"
3457
- }, [
3458
- a("div", {
3459
- class: "cursor-pointer min-h-[60px] px-4 flex items-center justify-between",
3460
- onClick: t
3461
- }, [
3462
- a("h4", null, k(e.label), 1),
3463
- a("div", {
3464
- class: B(["transition text-gray-400", { "rotate-x-180": l.value }])
3465
- }, [
3466
- b(d, { class: "size-6" })
3467
- ], 2)
3468
- ]),
3469
- a("div", ra, [
3470
- a("div", ca, [
3471
- $(o.$slots, "default")
3472
- ])
3473
- ])
3474
- ], 512);
3475
- };
3476
- }
3477
- }), da = ["onDragstart", "onDragenter"], ua = {
3478
- key: 0,
3479
- class: "absolute inset-0 border border-dashed border-blue-600 rounded"
3480
- }, Xa = /* @__PURE__ */ V({
3481
- __name: "VDragDrop",
3482
- props: {
3483
- items: {},
3484
- itemKey: { default: "id" }
3485
- },
3486
- emits: ["update:items", "order-change"],
3487
- setup(e, { emit: n }) {
3488
- const l = n, s = D(null), t = D(0), o = D(-1), i = ({ id: m }) => ({
3489
- "opacity-30 scale-105 z-10": s.value === m,
3490
- "transition-transform duration-200": s.value !== m
3491
- }), d = (m, p, g) => {
3492
- s.value = p, t.value = g, m.dataTransfer.effectAllowed = "move";
3493
- }, u = (m) => {
3494
- s.value !== null && (o.value = m);
3495
- }, r = () => {
3496
- s.value = null, o.value = -1;
3497
- }, c = (m) => {
3498
- if (m.preventDefault(), s.value && o.value !== -1) {
3499
- const p = e.items.findIndex((h) => h[e.itemKey] === s.value), g = o.value;
3500
- if (p !== g && g !== -1) {
3501
- const h = [...e.items], [x] = h.splice(p, 1);
3502
- h.splice(g, 0, x), l("update:items", h), l("order-change", { fromIndex: p, toIndex: g, movedItem: x, newOrder: h });
3503
- }
3504
- }
3505
- o.value = -1;
3506
- };
3507
- return (m, p) => (f(), v("div", {
3508
- onDragover: p[1] || (p[1] = H(() => {
3509
- }, ["prevent"])),
3510
- onDrop: c
3511
- }, [
3512
- b(Ne, {
3513
- "enter-active-class": "transition-all duration-300 ease",
3514
- "enter-from-class": "opacity-0 translate-x-8",
3515
- "enter-to-class": "opacity-100 translate-x-0",
3516
- "leave-active-class": "transition-all duration-300 ease absolute",
3517
- "leave-from-class": "opacity-100 translate-x-0",
3518
- "leave-to-class": "opacity-0 translate-x-8",
3519
- "move-class": "transition-all duration-300 ease"
3520
- }, {
3521
- default: y(() => [
3522
- (f(!0), v(O, null, R(e.items, (g, h) => (f(), v("div", {
3523
- key: `${g.id}_drug`,
3524
- class: B(["relative group", i(g)]),
3525
- draggable: "true",
3526
- onDragstart: (x) => d(x, g.id, h),
3527
- onDragenter: (x) => u(h),
3528
- onDragend: r,
3529
- onDragover: p[0] || (p[0] = H(() => {
3530
- }, ["prevent"]))
3531
- }, [
3532
- $(m.$slots, "default", {
3533
- item: g,
3534
- key: g.id,
3535
- index: h,
3536
- isDragging: s.value === g.id
3537
- }),
3538
- o.value === h && s.value !== g.id ? (f(), v("div", ua)) : E("", !0)
3539
- ], 42, da))), 128))
3540
- ]),
3541
- _: 3
3542
- })
3543
- ], 32));
3544
- }
3545
- }), fa = { class: "min-w-full" }, ma = { class: "border-y border-gray-200 py-3 dark:border-gray-800" }, va = { class: "bg-gray-200 dark:bg-gray-800" }, pa = { class: "flex items-center" }, ha = { class: "divide-y divide-gray-100 dark:divide-gray-800" }, ga = ["onClick"], ba = { class: "flex items-center text-gray-700 dark:text-gray-400" }, ya = { key: 1 }, xa = {
3546
- class: "py-3 whitespace-nowrap",
3547
- colspan: "9"
3548
- }, $a = { class: "flex items-center justify-center text-theme-sm text-gray-700 dark:text-gray-400 px-2" }, Ya = /* @__PURE__ */ V({
3549
- __name: "VTable",
3550
- props: {
3551
- headers: { default: () => [] },
3552
- items: { default: () => [] }
3553
- },
3554
- emits: ["click"],
3555
- setup(e, { emit: n }) {
3556
- const l = n, s = (i, d) => l("click", i, d), t = (i) => (i == null ? void 0 : i.className) || "", o = (i, { key: d }) => i == null ? void 0 : i[d];
3557
- return (i, d) => (f(), v("table", fa, [
3558
- a("thead", ma, [
3559
- a("tr", va, [
3560
- (f(!0), v(O, null, R(e.headers, (u, r) => (f(), v("th", {
3561
- key: r,
3562
- class: B(["py-2 whitespace-nowrap text-gray-500 dark:text-gray-400 font-normal px-4", t(u)])
3563
- }, [
3564
- $(i.$slots, "header", {
3565
- item: u,
3566
- i: r
3567
- }, () => [
3568
- a("div", pa, k(u.name), 1)
3569
- ])
3570
- ], 2))), 128))
3571
- ])
3572
- ]),
3573
- a("tbody", ha, [
3574
- e.items.length ? (f(!0), v(O, { key: 0 }, R(e.items, (u, r) => (f(), v("tr", {
3575
- key: r,
3576
- class: "hover:bg-gray-50/50 dark:hover:bg-gray-800/50",
3577
- onClick: (c) => s(u, c)
3578
- }, [
3579
- (f(!0), v(O, null, R(e.headers, (c, m) => (f(), v("td", {
3580
- key: m,
3581
- class: "py-2 px-4"
3582
- }, [
3583
- a("div", ba, [
3584
- $(i.$slots, c.key, {
3585
- item: u,
3586
- i: r
3587
- }, () => [
3588
- I(k(o(u, c)), 1)
3589
- ])
3590
- ])
3591
- ]))), 128))
3592
- ], 8, ga))), 128)) : (f(), v("tr", ya, [
3593
- a("td", xa, [
3594
- a("div", $a, [
3595
- $(i.$slots, "empty", {}, () => [
3596
- d[0] || (d[0] = I("The list is empty", -1))
3597
- ])
3598
- ])
3599
- ])
3600
- ]))
3601
- ])
3602
- ]));
3603
- }
3604
- }), Za = /* @__PURE__ */ V({
3605
- __name: "VTooltip",
3606
- props: {
3607
- timeout: {},
3608
- disabled: { type: Boolean }
3609
- },
3610
- setup(e) {
3611
- const n = D(!1), l = () => {
3612
- e.disabled || (n.value = !0);
3613
- }, s = () => {
3614
- n.value = !1;
3615
- }, t = Re("tooltip");
3616
- return $t(t, () => s()), (o, i) => (f(), v("div", {
3617
- ref: "tooltip",
3618
- class: "relative v-tooltip",
3619
- onMouseenter: l,
3620
- onMouseleave: s
3621
- }, [
3622
- a("button", {
3623
- type: "button",
3624
- onClick: l
3625
- }, [
3626
- $(o.$slots, "activator")
3627
- ]),
3628
- b(ae, {
3629
- "enter-active-class": "duration-300 ease-out",
3630
- "enter-from-class": "transform opacity-0 -translate-y-2",
3631
- "enter-to-class": "opacity-100 translate-y-0",
3632
- "leave-active-class": "duration-200 ease-in",
3633
- "leave-from-class": "opacity-100 translate-y-0",
3634
- "leave-to-class": "transform opacity-0 -translate-y-2"
3635
- }, {
3636
- default: y(() => [
3637
- $(o.$slots, "default", { show: n.value })
3638
- ]),
3639
- _: 3
3640
- })
3641
- ], 544));
3642
- }
3643
- }), je = {
3644
- VButton: A,
3645
- VLoader: Ve,
3646
- VDropdown: be,
3647
- VList: me,
3648
- VTextField: J,
3649
- VSelect: te,
3650
- VWifiIcon: Ye,
3651
- CardMain: Gl,
3652
- VIconLogoMini: qe,
3653
- VIconLogo: Se,
3654
- VDialog: Be
3655
- }, Qa = {
3656
- install: (e) => {
3657
- Object.keys(je).forEach((n) => {
3658
- e.component(n, je[n]);
3659
- }), Vt.forEach(({ name: n, directive: l }) => e.directive(n, l));
1
+ import { _ as s, V as e, a, b as o, c as d, d as m, e as r, f as _, g as f, h as u, i as V } from "./VDialog.vue_vue_type_script_setup_true_lang-BLLrcXdW.js";
2
+ const l = {
3
+ mounted(c, i) {
4
+ c.clickOutsideEvent = function(t) {
5
+ c === t.target || c.contains(t.target) || i.value(t, c);
6
+ }, document.addEventListener("click", c.clickOutsideEvent);
7
+ },
8
+ unmounted(c) {
9
+ document.removeEventListener("click", c.clickOutsideEvent), delete c.clickOutsideEvent;
10
+ }
11
+ }, v = [{ name: "outside", directive: l }], n = {
12
+ VButton: V,
13
+ VLoader: u,
14
+ VDropdown: f,
15
+ VList: _,
16
+ VTextField: r,
17
+ VSelect: m,
18
+ VWifiIcon: d,
19
+ CardMain: o,
20
+ VIconLogoMini: a,
21
+ VIconLogo: e,
22
+ VDialog: s
23
+ }, E = {
24
+ install: (c) => {
25
+ Object.keys(n).forEach((i) => {
26
+ c.component(i, n[i]);
27
+ }), v.forEach(({ name: i, directive: t }) => c.directive(i, t));
3660
28
  }
3661
29
  };
3662
30
  export {
3663
- Sa as AppAside,
3664
- Va as AppHeader,
3665
- Ta as AppNav,
3666
- Ba as AppNotification,
3667
- Ea as AppOverlay,
3668
- La as AppProgress,
3669
- ja as BlockBreadcrumb,
3670
- Ma as BlockInfo,
3671
- Aa as BlockScan,
3672
- Da as BlockService,
3673
- Ia as BlockStatus,
3674
- Oa as BlockUpdate,
3675
- ie as CardBase,
3676
- Pa as CardButton,
3677
- Ha as CardDate,
3678
- Na as CardDimmer,
3679
- Fa as CardInfo,
3680
- Ra as CardInput,
3681
- Ua as CardList,
3682
- Gl as CardMain,
3683
- xn as CardNotification,
3684
- Ka as ItemEdit,
3685
- Wa as ScriptEditor,
3686
- qa as ScriptViewDocs,
3687
- Ga as VAutocomplete,
3688
- A as VButton,
3689
- ro as VCheckbox,
3690
- Be as VDialog,
3691
- Xa as VDragDrop,
3692
- be as VDropdown,
3693
- Ja as VExpansion,
3694
- Ol as VFile,
3695
- $e as VFunc,
3696
- Se as VIconLogo,
3697
- qe as VIconLogoMini,
3698
- me as VList,
3699
- et as VListObject,
3700
- Ve as VLoader,
3701
- Xe as VPopup,
3702
- te as VSelect,
3703
- Ya as VTable,
3704
- to as VTabs,
3705
- J as VTextField,
3706
- Qe as VTextWrapper,
3707
- Za as VTooltip,
3708
- Ye as VWifiIcon,
3709
- ni as dashboardCards,
3710
- Qa as default,
3711
- dt as getDataValue,
3712
- li as getFunction,
3713
- si as getParamsData,
3714
- oi as getStateItem,
3715
- ai as setStateItem
31
+ E as default
3716
32
  };