x-essential-lib 0.9.22 → 0.9.24

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.js CHANGED
@@ -1,1006 +1,896 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="x-essential-lib",a.appendChild(document.createTextNode('.fade-leave-active[data-v-99c4198b]{transition:opacity .5s ease}.fade-leave-to[data-v-99c4198b]{opacity:0}.x-cont[data-v-99c4198b]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-99c4198b]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-99c4198b]{transform-origin:20px 20px;animation:lds-spinner-99c4198b 1.2s linear infinite}.lds-spinner div[data-v-99c4198b]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-99c4198b]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-99c4198b]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-99c4198b]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-99c4198b]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-99c4198b]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-99c4198b]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-99c4198b]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-99c4198b]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-99c4198b]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-99c4198b]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-99c4198b]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-99c4198b]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-99c4198b{0%{opacity:1}to{opacity:0}}.x-item[data-v-5b5f6d09]{width:600px}@media(max-width:600px){.x-item[data-v-5b5f6d09]{width:calc(100vw - 16px)}}.x-cont[data-v-b482df18]{position:fixed;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { computed as V, provide as U, inject as K, ref as p, watchEffect as ne, onMounted as W, onBeforeUnmount as N, onBeforeMount as De, defineComponent as $, watch as J, resolveComponent as m, createBlock as A, openBlock as q, withKeys as F, unref as E, withModifiers as I, isRef as X, withCtx as v, createVNode as h, createTextVNode as M, toDisplayString as S, Transition as Ce, createElementBlock as ee, createCommentVNode as te, normalizeStyle as se, createElementVNode as D, Fragment as je, renderList as Ve, useTemplateRef as pe } from "vue";
3
- import { useI18n as z } from "vue-i18n";
4
- import { useTheme as _e, useDisplay as qe } from "vuetify";
5
- import { useRouter as de, useRoute as Oe } from "vue-router";
6
- import Se from "axios";
7
- import { a as T, m as Re, u as Le, t as re } from "./vendor.l8hyykei.js";
8
- function Te() {
9
- const e = _e(), t = V(() => e.global.current.value.colors.primary), a = V(() => e.global.current.value.colors.secondary), o = V(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), l = V(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = V(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), s = V(() => e.current.value.dark ? "#303030" : "#f6f6f6"), n = V(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
10
- return {
11
- primaryColor: t,
12
- secondaryColor: a,
13
- backgroundColor0: o,
14
- backgroundColor1: l,
15
- backgroundColor2: r,
16
- highlightColor: s,
17
- borderColor: n
18
- };
19
- }
20
- function Ct(e) {
21
- const t = Se.create({
22
- timeout: 6e3
23
- });
24
- return t.defaults.baseURL = e.baseUrl, t.interceptors.request.use(
25
- (a) => Ae(a),
26
- (a) => {
27
- Me(a, e.onError);
28
- }
29
- ), t.interceptors.response.use(
30
- (a) => Be(a),
31
- (a) => Ie(a, e.onError)
32
- ), t;
33
- }
34
- function Ae(e) {
35
- const t = T.get("accessToken") ?? "";
36
- return e.headers.Authorization = "Basic " + t, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
37
- }
38
- function Me(e, t) {
39
- console.error(e), t("request timeout");
40
- }
41
- function Be(e) {
42
- return e.data;
43
- }
44
- function Ie(e, t) {
45
- const o = e.response;
46
- return o && (o.status === 401 && $e(), o.data?.message ? t(o.data?.message) : t({
47
- code: o.status,
48
- message: o.statusText
49
- })), Promise.reject(e);
50
- }
51
- function $e() {
52
- T.remove("accessToken"), T.remove("refreshToken"), T.remove("userId"), T.remove("userName"), T.remove("phone"), T.remove("activeOrg"), de().replace({ path: "/passport/login" });
53
- }
54
- const jt = (function() {
55
- return window.globalObjects || (window.globalObjects = {
56
- router: null,
57
- i18n: null
58
- }, console.log("globalObjects created")), window.globalObjects;
59
- })(), u = (function() {
60
- return window.eventBus || (window.eventBus = Re(), console.log("eventBus created")), window.eventBus;
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.id=`x-essential-lib`,e.appendChild(document.createTextNode(`.fade-leave-active[data-v-99c4198b]{transition:opacity .5s}.fade-leave-to[data-v-99c4198b]{opacity:0}.x-cont[data-v-99c4198b]{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.lds-spinner[data-v-99c4198b]{color:official;width:40px;height:40px;display:inline-block;position:relative}.lds-spinner div[data-v-99c4198b]{transform-origin:20px 20px;animation:1.2s linear infinite lds-spinner-99c4198b}.lds-spinner div[data-v-99c4198b]:after{content:" ";background:#9e9e9e;border-radius:5%;width:2px;height:6px;display:block;position:absolute;top:3px;left:18px}.lds-spinner div[data-v-99c4198b]:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner div[data-v-99c4198b]:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner div[data-v-99c4198b]:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner div[data-v-99c4198b]:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner div[data-v-99c4198b]:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner div[data-v-99c4198b]:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner div[data-v-99c4198b]:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner div[data-v-99c4198b]:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner div[data-v-99c4198b]:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner div[data-v-99c4198b]:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner div[data-v-99c4198b]:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner div[data-v-99c4198b]:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes lds-spinner-99c4198b{0%{opacity:1}to{opacity:0}}.x-item[data-v-5b5f6d09]{width:600px}@media (max-width:600px){.x-item[data-v-5b5f6d09]{width:calc(100vw - 16px)}}.x-cont[data-v-b482df18]{z-index:9999;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}
2
+ /*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { i as usePreferredDark, n as mitt_default, r as api, t as toLower_default } from "./vendor.nojbp8i6.js";
3
+ import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, resolveComponent, toDisplayString, unref, useTemplateRef, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+ import { useDisplay, useTheme } from "vuetify";
6
+ import { useRoute, useRouter } from "vue-router";
7
+ import axios from "axios";
8
+ function useColor() {
9
+ let e = useTheme();
10
+ return {
11
+ primaryColor: computed(() => e.global.current.value.colors.primary),
12
+ secondaryColor: computed(() => e.global.current.value.colors.secondary),
13
+ backgroundColor0: computed(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"),
14
+ backgroundColor1: computed(() => e.current.value.dark ? "#272727" : "#eeeeee"),
15
+ backgroundColor2: computed(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"),
16
+ highlightColor: computed(() => e.current.value.dark ? "#303030" : "#f6f6f6"),
17
+ borderColor: computed(() => e.current.value.dark ? "#ffffff1f" : "#0000001f")
18
+ };
19
+ }
20
+ function createAxios(e) {
21
+ let T = axios.create({ timeout: 6e3 });
22
+ return T.defaults.baseURL = e.baseUrl, T.interceptors.request.use((e) => onReqFulfilled(e), (T) => {
23
+ onReqRejected(T, e.onError);
24
+ }), T.interceptors.response.use((e) => onRespFullfilled(e), (T) => onRespRejected(T, e.onError)), T;
25
+ }
26
+ function onReqFulfilled(e) {
27
+ let T = api.get("accessToken") ?? "";
28
+ return e.headers.Authorization = "Basic " + T, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
29
+ }
30
+ function onReqRejected(e, T) {
31
+ console.error(e), T("request timeout");
32
+ }
33
+ function onRespFullfilled(e) {
34
+ return e.data;
35
+ }
36
+ function onRespRejected(e, T) {
37
+ let E = e.response;
38
+ return E ? (E.status === 401 && onUnauthorized(), E.data?.message ? T(E.data?.message) : T({
39
+ code: E.status,
40
+ message: E.statusText
41
+ }), Promise.reject(e)) : Promise.reject(e);
42
+ }
43
+ function onUnauthorized() {
44
+ api.remove("accessToken"), api.remove("refreshToken"), api.remove("userId"), api.remove("userName"), api.remove("phone"), api.remove("activeOrg"), useRouter().replace({ path: "/passport/login" });
45
+ }
46
+ const globalObjects = (function() {
47
+ return window.globalObjects || (window.globalObjects = {
48
+ router: null,
49
+ i18n: null
50
+ }, console.log("globalObjects created")), window.globalObjects;
51
+ })(), eventBus = (function() {
52
+ return window.eventBus || (window.eventBus = mitt_default(), console.log("eventBus created")), window.eventBus;
61
53
  })();
62
- async function Vt(e) {
63
- return new Promise((t) => {
64
- setTimeout(t, e);
65
- });
66
- }
67
- async function H(e, t, a) {
68
- const o = Date.now();
69
- return new Promise((l) => {
70
- const r = async () => {
71
- e() ? l(!0) : t && Date.now() - o > t ? l(!1) : setTimeout(r, a ?? 30);
72
- };
73
- r();
74
- });
75
- }
76
- function Ee(e, t) {
77
- const a = document.getElementById("single-spa-application:" + e);
78
- a && (a.classList.remove("app-left", "app-right", "app-reset"), t ? a.classList.add("app-left") : a.classList.add("app-right"), setTimeout(() => {
79
- a.classList.add("app-reset");
80
- }, 50));
81
- }
82
- let ue = Date.now();
83
- function ae() {
84
- const e = Date.now();
85
- return e - ue > 500 ? (ue = e, !0) : !1;
86
- }
87
- let Ue = 0;
88
- function oe() {
89
- return ++Ue;
90
- }
91
- async function qt(e) {
92
- if (!ae())
93
- return;
94
- let t = !1, a;
95
- const o = (r) => {
96
- a = r, t = !0;
97
- }, l = oe();
98
- return u.on("confirmDlgResult" + l, o), u.emit("confirmDlg", { ...e, seq: l }), await H(() => t), u.off("confirmDlgResult" + l, o), a;
99
- }
100
- async function Ot(e) {
101
- if (!ae())
102
- return;
103
- let t = !1, a;
104
- const o = (r) => {
105
- a = r, t = !0;
106
- }, l = oe();
107
- return u.on("numberDlgResult" + l, o), u.emit("numberDlg", { ...e, seq: l }), await H(() => t), u.off("numberDlgResult" + l, o), a;
108
- }
109
- async function St(e) {
110
- if (!ae())
111
- return;
112
- let t = !1, a;
113
- const o = (r) => {
114
- a = r, t = !0;
115
- }, l = oe();
116
- return u.on("promptDlgResult" + l, o), u.emit("promptDlg", { ...e, seq: l }), await H(() => t), u.off("promptDlgResult" + l, o), a;
117
- }
118
- function Rt(e) {
119
- u.emit("waitDlg", { text: e });
120
- }
121
- function Lt() {
122
- u.emit("closeWaitDlg");
123
- }
124
- function Tt(e, t) {
125
- u.emit("message", { type: "error", text: e, timeout: t });
126
- }
127
- function At(e, t) {
128
- u.emit("message", { type: "info", text: e, timeout: t });
129
- }
130
- function Mt(e, t) {
131
- u.emit("message", { type: "success", text: e, timeout: t });
132
- }
133
- function Bt(e, t) {
134
- u.emit("message", { type: "warning", text: e, timeout: t });
135
- }
136
- var Ke = /* @__PURE__ */ ((e) => (e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_app", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_compute_space = "list_compute_space", e.get_compute_space = "get_compute_space", e.create_compute_space = "create_compute_space", e.delete_compute_space = "delete_compute_space", e.update_compute_space = "update_compute_space", e.arrange_compute_space = "arrange_compute_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.debug_flow = "debug_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_compute_layer = "open_compute_layer", e.list_data_space = "list_data_space", e.get_data_space = "get_data_space", e.create_data_space = "create_data_space", e.delete_data_space = "delete_data_space", e.update_data_space = "update_data_space", e.arrange_data_space = "arrange_data_space", e.list_table_group = "list_table_group", e.create_table_group = "create_table_group", e.delete_table_group = "delete_table_group", e.update_table_group = "update_table_group", e.arrange_table_group = "arrange_table_group", e.list_table = "list_table", e.get_table = "get_table", e.create_table = "create_table", e.delete_table = "delete_table", e.update_table = "update_table", e.get_data = "get_data", e.create_data = "create_data", e.delete_data = "delete_data", e.update_data = "update_data", e.get_relation_graph = "get_relation_graph", e.update_relation_graph = "update_relation_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_resource_space = "list_resource_space", e.get_resource_space = "get_resource_space", e.create_resource_space = "create_resource_space", e.delete_resource_space = "delete_resource_space", e.update_resource_space = "update_resource_space", e.arrange_resource_space = "arrange_resource_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_resource = "list_resource", e.get_resource = "get_resource", e.create_resource = "create_resource", e.delete_resource = "delete_resource", e.update_resource = "update_resource", e.move_resource = "move_resource", e.open_resource_layer = "open_resource_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role_group = "list_org_role_group", e.create_org_role_group = "create_org_role_group", e.delete_org_role_group = "delete_org_role_group", e.update_org_role_group = "update_org_role_group", e.arrange_org_role_group = "arrange_org_role_group", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_table = "filter_table", e))(Ke || {});
137
- function ce(e, t) {
138
- if (!e)
139
- return !1;
140
- let a = e;
141
- return Object.keys(a).length <= 0 || (t.split("/").forEach((l) => {
142
- if (Object.keys(a).length <= 0)
143
- return !0;
144
- if (a[l])
145
- a = a[l];
146
- else
147
- return !1;
148
- }), Object.keys(a).length <= 0);
149
- }
150
- function Ne(e, t, a) {
151
- const o = e[t];
152
- return o ? a ? !(!ce(o.includes, a) || ce(o.excludes, a)) : !0 : !1;
153
- }
154
- const ie = "essentialDark", fe = "essentialLocale", ge = "essentialPermissionObjects", ve = "essentialPermissionChecksum", me = "essentialLastAppPath", be = "essentialViews";
155
- function We(e) {
156
- U(ie, e);
157
- }
158
- function It() {
159
- return K(ie);
160
- }
161
- function Xe(e) {
162
- U(fe, e);
163
- }
164
- function $t() {
165
- return K(fe);
166
- }
167
- function ze(e) {
168
- U(ge, e);
169
- }
170
- function He() {
171
- return K(ge);
172
- }
173
- function Fe(e) {
174
- U(ve, e);
175
- }
176
- function Et() {
177
- return K(ve);
178
- }
179
- function Ge(e) {
180
- U(me, e);
181
- }
182
- function Ut() {
183
- return K(me);
184
- }
185
- function Je(e) {
186
- U(be, e);
187
- }
188
- function Qe() {
189
- return K(be);
190
- }
191
- const Ye = [
192
- {
193
- app: "x-passport-mf",
194
- path: "/passport/login",
195
- level: 0,
196
- mainActive: 1
197
- },
198
- {
199
- app: "x-passport-mf",
200
- path: "/passport/loginAccount",
201
- level: 1,
202
- mainActive: 1
203
- },
204
- {
205
- app: "x-passport-mf",
206
- path: "/passport/register",
207
- level: 1,
208
- mainActive: 1
209
- },
210
- {
211
- app: "x-org-mf",
212
- path: "/org/joinOrCreate",
213
- level: 1,
214
- requiredState: "auth"
215
- },
216
- {
217
- app: "x-org-mf",
218
- path: "/org/manager",
219
- level: 1,
220
- requiredState: "org",
221
- mainActive: 2
222
- },
223
- {
224
- app: "x-main-mf",
225
- path: "/main",
226
- level: 0,
227
- requiredState: "org"
228
- },
229
- {
230
- app: "x-mine-mf",
231
- path: "/mine/personalInfo",
232
- level: 1,
233
- requiredState: "org",
234
- mainActive: 4
235
- },
236
- {
237
- app: "x-mine-mf",
238
- path: "/mine/accountSecurity",
239
- level: 2,
240
- requiredState: "org"
241
- },
242
- {
243
- app: "x-mine-mf",
244
- path: "/mine/settings",
245
- level: 1,
246
- requiredState: "org",
247
- mainActive: 4
248
- },
249
- {
250
- app: "x-mine-mf",
251
- path: "/mine/general",
252
- level: 2,
253
- requiredState: "org"
254
- },
255
- {
256
- app: "x-mine-mf",
257
- path: "/mine/general/darkMode",
258
- level: 3,
259
- requiredState: "org"
260
- },
261
- {
262
- app: "x-mine-mf",
263
- path: "/mine/general/language",
264
- level: 3,
265
- requiredState: "org"
266
- },
267
- {
268
- app: "x-app-mf",
269
- path: "/app/manager",
270
- level: 1,
271
- requiredState: "org",
272
- mainActive: 2
273
- },
274
- {
275
- app: "x-app-mf",
276
- path: "/app/editor",
277
- level: 2,
278
- requiredState: "org"
279
- },
280
- {
281
- app: "x-compute-mf",
282
- path: "/compute",
283
- level: 1,
284
- requiredState: "org",
285
- mainActive: 2
286
- },
287
- {
288
- app: "x-data-mf",
289
- path: "/data",
290
- level: 1,
291
- requiredState: "org",
292
- mainActive: 2
293
- },
294
- {
295
- app: "x-resource-mf",
296
- path: "/resource",
297
- level: 1,
298
- requiredState: "org",
299
- mainActive: 2
300
- }
54
+ async function waitMs(e) {
55
+ return new Promise((T) => {
56
+ setTimeout(T, e);
57
+ });
58
+ }
59
+ async function waitUtil(e, T, E) {
60
+ let D = Date.now();
61
+ return new Promise((O) => {
62
+ let k = async () => {
63
+ e() ? O(!0) : T && Date.now() - D > T ? O(!1) : setTimeout(k, E ?? 30);
64
+ };
65
+ k();
66
+ });
67
+ }
68
+ function appAppear(e, T) {
69
+ let E = document.getElementById("single-spa-application:" + e);
70
+ E && (E.classList.remove("app-left", "app-right", "app-reset"), T ? E.classList.add("app-left") : E.classList.add("app-right"), setTimeout(() => {
71
+ E.classList.add("app-reset");
72
+ }, 50));
73
+ }
74
+ var lastTime = Date.now();
75
+ function tryCooldown() {
76
+ let e = Date.now();
77
+ return e - lastTime > 500 ? (lastTime = e, !0) : !1;
78
+ }
79
+ var sequence = 0;
80
+ function getSequence() {
81
+ return ++sequence;
82
+ }
83
+ async function openConfirmDlg(e) {
84
+ if (!tryCooldown()) return;
85
+ let T = !1, E, D = (e) => {
86
+ E = e, T = !0;
87
+ }, O = getSequence();
88
+ return eventBus.on("confirmDlgResult" + O, D), eventBus.emit("confirmDlg", {
89
+ ...e,
90
+ seq: O
91
+ }), await waitUtil(() => T), eventBus.off("confirmDlgResult" + O, D), E;
92
+ }
93
+ async function openNumberDlg(e) {
94
+ if (!tryCooldown()) return;
95
+ let T = !1, E, D = (e) => {
96
+ E = e, T = !0;
97
+ }, O = getSequence();
98
+ return eventBus.on("numberDlgResult" + O, D), eventBus.emit("numberDlg", {
99
+ ...e,
100
+ seq: O
101
+ }), await waitUtil(() => T), eventBus.off("numberDlgResult" + O, D), E;
102
+ }
103
+ async function openPromptDlg(e) {
104
+ if (!tryCooldown()) return;
105
+ let T = !1, E, D = (e) => {
106
+ E = e, T = !0;
107
+ }, O = getSequence();
108
+ return eventBus.on("promptDlgResult" + O, D), eventBus.emit("promptDlg", {
109
+ ...e,
110
+ seq: O
111
+ }), await waitUtil(() => T), eventBus.off("promptDlgResult" + O, D), E;
112
+ }
113
+ function openWaitDlg(e) {
114
+ eventBus.emit("waitDlg", { text: e });
115
+ }
116
+ function closeWaitDlg() {
117
+ eventBus.emit("closeWaitDlg");
118
+ }
119
+ function messageError(e, T) {
120
+ eventBus.emit("message", {
121
+ type: "error",
122
+ text: e,
123
+ timeout: T
124
+ });
125
+ }
126
+ function messageInfo(e, T) {
127
+ eventBus.emit("message", {
128
+ type: "info",
129
+ text: e,
130
+ timeout: T
131
+ });
132
+ }
133
+ function messageSuccess(e, T) {
134
+ eventBus.emit("message", {
135
+ type: "success",
136
+ text: e,
137
+ timeout: T
138
+ });
139
+ }
140
+ function messageWarning(e, T) {
141
+ eventBus.emit("message", {
142
+ type: "warning",
143
+ text: e,
144
+ timeout: T
145
+ });
146
+ }
147
+ let Permission = /* @__PURE__ */ function(e) {
148
+ return e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_app", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_compute_space = "list_compute_space", e.get_compute_space = "get_compute_space", e.create_compute_space = "create_compute_space", e.delete_compute_space = "delete_compute_space", e.update_compute_space = "update_compute_space", e.arrange_compute_space = "arrange_compute_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.debug_flow = "debug_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_compute_layer = "open_compute_layer", e.list_data_space = "list_data_space", e.get_data_space = "get_data_space", e.create_data_space = "create_data_space", e.delete_data_space = "delete_data_space", e.update_data_space = "update_data_space", e.arrange_data_space = "arrange_data_space", e.list_table_group = "list_table_group", e.create_table_group = "create_table_group", e.delete_table_group = "delete_table_group", e.update_table_group = "update_table_group", e.arrange_table_group = "arrange_table_group", e.list_table = "list_table", e.get_table = "get_table", e.create_table = "create_table", e.delete_table = "delete_table", e.update_table = "update_table", e.get_data = "get_data", e.create_data = "create_data", e.delete_data = "delete_data", e.update_data = "update_data", e.get_relation_graph = "get_relation_graph", e.update_relation_graph = "update_relation_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_resource_space = "list_resource_space", e.get_resource_space = "get_resource_space", e.create_resource_space = "create_resource_space", e.delete_resource_space = "delete_resource_space", e.update_resource_space = "update_resource_space", e.arrange_resource_space = "arrange_resource_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_resource = "list_resource", e.get_resource = "get_resource", e.create_resource = "create_resource", e.delete_resource = "delete_resource", e.update_resource = "update_resource", e.move_resource = "move_resource", e.open_resource_layer = "open_resource_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role_group = "list_org_role_group", e.create_org_role_group = "create_org_role_group", e.delete_org_role_group = "delete_org_role_group", e.update_org_role_group = "update_org_role_group", e.arrange_org_role_group = "arrange_org_role_group", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_table = "filter_table", e;
149
+ }({});
150
+ function isExist(e, T) {
151
+ if (!e) return !1;
152
+ let E = e;
153
+ return Object.keys(E).length <= 0 || (T.split("/").forEach((e) => {
154
+ if (Object.keys(E).length <= 0) return !0;
155
+ if (E[e]) E = E[e];
156
+ else return !1;
157
+ }), Object.keys(E).length <= 0);
158
+ }
159
+ function verifyPermission(e, T, E) {
160
+ let D = e[T];
161
+ return D ? E ? !(!isExist(D.includes, E) || isExist(D.excludes, E)) : !0 : !1;
162
+ }
163
+ var darkKey = "essentialDark", localeKey = "essentialLocale", permissionObjectsKey = "essentialPermissionObjects", permissionChecksumKey = "essentialPermissionChecksum", lastAppPathKey = "essentialLastAppPath", viewsKey = "essentialViews";
164
+ function provideDark(e) {
165
+ provide(darkKey, e);
166
+ }
167
+ function injectDark() {
168
+ return inject(darkKey);
169
+ }
170
+ function provideLocale(e) {
171
+ provide(localeKey, e);
172
+ }
173
+ function injectLocale() {
174
+ return inject(localeKey);
175
+ }
176
+ function providePermissionObjects(e) {
177
+ provide(permissionObjectsKey, e);
178
+ }
179
+ function injectPermissionObjects() {
180
+ return inject(permissionObjectsKey);
181
+ }
182
+ function providePermissionChecksum(e) {
183
+ provide(permissionChecksumKey, e);
184
+ }
185
+ function injectPermissionChecksum() {
186
+ return inject(permissionChecksumKey);
187
+ }
188
+ function provideLastAppPath(e) {
189
+ provide(lastAppPathKey, e);
190
+ }
191
+ function injectLastAppPath() {
192
+ return inject(lastAppPathKey);
193
+ }
194
+ function provideViews(e) {
195
+ provide(viewsKey, e);
196
+ }
197
+ function injectViews() {
198
+ return inject(viewsKey);
199
+ }
200
+ var routeMetas = [
201
+ {
202
+ app: "x-passport-mf",
203
+ path: "/passport/login",
204
+ level: 0,
205
+ mainActive: 1
206
+ },
207
+ {
208
+ app: "x-passport-mf",
209
+ path: "/passport/loginAccount",
210
+ level: 1,
211
+ mainActive: 1
212
+ },
213
+ {
214
+ app: "x-passport-mf",
215
+ path: "/passport/register",
216
+ level: 1,
217
+ mainActive: 1
218
+ },
219
+ {
220
+ app: "x-org-mf",
221
+ path: "/org/joinOrCreate",
222
+ level: 1,
223
+ requiredState: "auth"
224
+ },
225
+ {
226
+ app: "x-org-mf",
227
+ path: "/org/manager",
228
+ level: 1,
229
+ requiredState: "org",
230
+ mainActive: 2
231
+ },
232
+ {
233
+ app: "x-main-mf",
234
+ path: "/main",
235
+ level: 0,
236
+ requiredState: "org"
237
+ },
238
+ {
239
+ app: "x-mine-mf",
240
+ path: "/mine/personalInfo",
241
+ level: 1,
242
+ requiredState: "org",
243
+ mainActive: 4
244
+ },
245
+ {
246
+ app: "x-mine-mf",
247
+ path: "/mine/accountSecurity",
248
+ level: 2,
249
+ requiredState: "org"
250
+ },
251
+ {
252
+ app: "x-mine-mf",
253
+ path: "/mine/settings",
254
+ level: 1,
255
+ requiredState: "org",
256
+ mainActive: 4
257
+ },
258
+ {
259
+ app: "x-mine-mf",
260
+ path: "/mine/general",
261
+ level: 2,
262
+ requiredState: "org"
263
+ },
264
+ {
265
+ app: "x-mine-mf",
266
+ path: "/mine/general/darkMode",
267
+ level: 3,
268
+ requiredState: "org"
269
+ },
270
+ {
271
+ app: "x-mine-mf",
272
+ path: "/mine/general/language",
273
+ level: 3,
274
+ requiredState: "org"
275
+ },
276
+ {
277
+ app: "x-app-mf",
278
+ path: "/app/manager",
279
+ level: 1,
280
+ requiredState: "org",
281
+ mainActive: 2
282
+ },
283
+ {
284
+ app: "x-app-mf",
285
+ path: "/app/editor",
286
+ level: 2,
287
+ requiredState: "org"
288
+ },
289
+ {
290
+ app: "x-compute-mf",
291
+ path: "/compute",
292
+ level: 1,
293
+ requiredState: "org",
294
+ mainActive: 2
295
+ },
296
+ {
297
+ app: "x-data-mf",
298
+ path: "/data",
299
+ level: 1,
300
+ requiredState: "org",
301
+ mainActive: 2
302
+ },
303
+ {
304
+ app: "x-resource-mf",
305
+ path: "/resource",
306
+ level: 1,
307
+ requiredState: "org",
308
+ mainActive: 2
309
+ }
301
310
  ];
302
- function G(e) {
303
- let t, a = 0;
304
- const o = e.split("/").filter((l) => l.trim() !== "");
305
- return Ye.forEach((l) => {
306
- const r = l.path.split("/").filter((n) => n.trim() !== "");
307
- let s = 0;
308
- for (let n = 0; n < o.length && !(n >= r.length || o[n] !== r[n]); n++)
309
- s++;
310
- s > 0 && s > a && (t = l, a = s);
311
- }), t;
312
- }
313
- const P = p("");
314
- function L(e, t, a) {
315
- t === "/" && (t = a);
316
- const o = G(e), l = G(t);
317
- if (!o) {
318
- console.assert(!1);
319
- return;
320
- }
321
- if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !l)
322
- return;
323
- const r = o.app === l.app, s = o.path === l.path, n = o.level >= l.level;
324
- r ? s ? P.value = "" : P.value = n ? "inner-left" : "inner-right" : (P.value = "", Ee(o.app, n));
325
- }
326
- function Ze() {
327
- return !!T.get("accessToken");
328
- }
329
- function Pe() {
330
- return !!T.get("activeOrg");
331
- }
332
- function Kt(e, t, a, o) {
333
- const l = Ze(), r = Pe(), s = G(e.path);
334
- if (!s) {
335
- console.assert(!1), a();
336
- return;
337
- }
338
- if (s.requiredState === "auth")
339
- if (l)
340
- if (r) {
341
- const n = "/main";
342
- L(n, t.path, o), a({ path: n });
343
- } else
344
- L(e.path, t.path, o), a();
345
- else {
346
- const n = "/passport/login";
347
- L(n, t.path, o), a({ path: n });
348
- }
349
- else if (s.requiredState === "org")
350
- if (l)
351
- if (r)
352
- L(e.path, t.path, o), a();
353
- else {
354
- const n = "/org/joinOrCreate";
355
- L(n, t.path, o), a({ path: n });
356
- }
357
- else {
358
- const n = "/passport/login";
359
- L(n, t.path, o), a({ path: n });
360
- }
361
- else if (l)
362
- if (r) {
363
- const n = "/main";
364
- L(n, t.path, o), a({ path: n });
365
- } else {
366
- const n = "/org/joinOrCreate";
367
- L(n, t.path, o), a({ path: n });
368
- }
369
- else
370
- L(e.path, t.path, o), a();
371
- }
372
- const Nt = [
373
- "string",
374
- "number",
375
- "boolean",
376
- "array",
377
- "object",
378
- "any"
311
+ function matchRouteMeta(e) {
312
+ let T, E = 0, D = e.split("/").filter((e) => e.trim() !== "");
313
+ return routeMetas.forEach((e) => {
314
+ let O = e.path.split("/").filter((e) => e.trim() !== ""), k = 0;
315
+ for (let e = 0; e < D.length && !(e >= O.length || D[e] !== O[e]); e++) k++;
316
+ k > 0 && k > E && (T = e, E = k);
317
+ }), T;
318
+ }
319
+ const routeTransName = ref("");
320
+ function onBeforeChange(e, T, E) {
321
+ T === "/" && (T = E);
322
+ let D = matchRouteMeta(e), O = matchRouteMeta(T);
323
+ if (!D) {
324
+ console.assert(!1);
325
+ return;
326
+ }
327
+ if (console.info(`~~~~routeChange~~~~ ${T} -> ${e}`), !O) return;
328
+ let k = D.app === O.app, A = D.path === O.path, j = D.level >= O.level;
329
+ k ? A ? routeTransName.value = "" : routeTransName.value = j ? "inner-left" : "inner-right" : (routeTransName.value = "", appAppear(D.app, j));
330
+ }
331
+ function isHasAccessToken() {
332
+ return !!api.get("accessToken");
333
+ }
334
+ function isHasActiveOrg() {
335
+ return !!api.get("activeOrg");
336
+ }
337
+ function onBeforeEach(e, T, E, D) {
338
+ let O = isHasAccessToken(), k = isHasActiveOrg(), A = matchRouteMeta(e.path);
339
+ if (!A) {
340
+ console.assert(!1), E();
341
+ return;
342
+ }
343
+ if (A.requiredState === "auth") if (O) if (k) {
344
+ let e = "/main";
345
+ onBeforeChange(e, T.path, D), E({ path: e });
346
+ } else onBeforeChange(e.path, T.path, D), E();
347
+ else {
348
+ let e = "/passport/login";
349
+ onBeforeChange(e, T.path, D), E({ path: e });
350
+ }
351
+ else if (A.requiredState === "org") if (O) if (k) onBeforeChange(e.path, T.path, D), E();
352
+ else {
353
+ let e = "/org/joinOrCreate";
354
+ onBeforeChange(e, T.path, D), E({ path: e });
355
+ }
356
+ else {
357
+ let e = "/passport/login";
358
+ onBeforeChange(e, T.path, D), E({ path: e });
359
+ }
360
+ else if (O) if (k) {
361
+ let e = "/main";
362
+ onBeforeChange(e, T.path, D), E({ path: e });
363
+ } else {
364
+ let e = "/org/joinOrCreate";
365
+ onBeforeChange(e, T.path, D), E({ path: e });
366
+ }
367
+ else onBeforeChange(e.path, T.path, D), E();
368
+ }
369
+ const types = [
370
+ "string",
371
+ "number",
372
+ "boolean",
373
+ "array",
374
+ "object",
375
+ "any"
379
376
  ];
380
- function Wt(e) {
381
- switch (e) {
382
- case "string":
383
- return "#5ba58c";
384
- case "number":
385
- return "#5b67a5";
386
- case "boolean":
387
- return "#5b80a5";
388
- case "array":
389
- return "#745ba5";
390
- case "object":
391
- return "#80a55b";
392
- case "any":
393
- return "#9e9e9e";
394
- }
395
- }
396
- function et(e) {
397
- return e.value.length <= 0;
398
- }
399
- function Xt(e) {
400
- if (e.value.length > 0)
401
- return e.value[e.value.length - 1];
402
- }
403
- function ye(e, t) {
404
- return !!e.value.find((a) => a === t);
405
- }
406
- function tt(e, t) {
407
- const a = e.value.findIndex((o) => o === t);
408
- a >= 0 && e.value.splice(a, 1), e.value.push(t);
409
- }
410
- function at(e, t) {
411
- const a = e.value.findIndex((o) => o === t);
412
- a >= 0 && e.value.splice(a, 1);
413
- }
414
- function ot(e) {
415
- console.assert(e.value.length > 0), e.value.pop();
416
- }
417
- function zt(e) {
418
- e.value = [];
419
- }
420
- function Ht(e, t, a, o, l, r) {
421
- const s = Oe(), n = de(), d = Le(), c = p(!1);
422
- ne(() => {
423
- let g = !1;
424
- typeof e.value == "boolean" ? g = e.value : g = d.value, c.value = g;
425
- }), We(c), Xe(t), ze(a), Fe(o), Ge(l), Je(r);
426
- const _ = _e();
427
- ne(() => {
428
- _.change(c.value ? "dark" : "light");
429
- });
430
- const w = () => {
431
- if (!et(r)) {
432
- ye(r, "waitDlg") || ot(r);
433
- return;
434
- }
435
- const g = G(s.path);
436
- if (!g) {
437
- console.assert(!1);
438
- return;
439
- }
440
- g.level === 0 ? navigator?.Backbutton?.goHome(
441
- () => {
442
- },
443
- () => {
444
- }
445
- ) : n.back();
446
- }, b = (g) => {
447
- if (g.key === "Escape") {
448
- w();
449
- return;
450
- }
451
- }, y = () => {
452
- w();
453
- };
454
- W(() => {
455
- window.addEventListener("keydown", b), u.on("backbutton", y);
456
- }), N(() => {
457
- window.removeEventListener("keydown", b), u.off("backbutton", y);
458
- });
459
- const f = (g) => {
460
- e.value = g;
461
- }, j = (g) => {
462
- t.value = g;
463
- }, k = (g) => {
464
- const R = g;
465
- a.value = R[0], o.value = R[1];
466
- }, i = (g) => {
467
- l.value = g;
468
- };
469
- De(() => {
470
- u.on("updateDark", f), u.on("updateLocale", j), u.on("updatePermission", k), u.on("updateLastAppPath", i), u.emit("syncGlobalState");
471
- }), N(() => {
472
- u.off("updateDark", f), u.off("updateLocale", j), u.off("updatePermission", k), u.off("updateLastAppPath", i);
473
- });
474
- }
475
- function Ft() {
476
- const e = He();
477
- function t(a, o) {
478
- return Ne(
479
- e.value,
480
- a,
481
- o ?? ""
482
- );
483
- }
484
- return { verifyPermission: t };
485
- }
486
- function Gt() {
487
- const { locale: e, t } = z(), a = V(() => !!window.cordova), o = qe(), l = V(() => o.width.value <= 1280 ? o.width.value + "px" : o.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px"), r = V(() => o.xs.value);
488
- return {
489
- sysBarAvail: a,
490
- compactWidth: l,
491
- isCurvedScreen: r,
492
- isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
493
- navigator.userAgent
494
- ),
495
- nameList: (c, _) => {
496
- let w = "";
497
- const b = c.map((y) => t(y));
498
- return _ ? w = `${b.join("/")} <${_.join("/")}>` : e.value === "en" ? w = b.join(" ") : w = b.join(""), w;
499
- },
500
- sentenceOfAsk: (c, _, w) => e.value === "en" ? t("dlg.common.ask", {
501
- verb: re(t(c)),
502
- object: re(t(_)),
503
- name: w
504
- }) : t("dlg.common.ask", { verb: t(c), object: t(_), name: w })
505
- };
506
- }
507
- function Q(e, t) {
508
- const a = Qe(), o = V({
509
- get() {
510
- return ye(a, e);
511
- },
512
- set(r) {
513
- r ? tt(a, e) : at(a, e);
514
- }
515
- }), l = (r) => {
516
- t?.(r), o.value = !0;
517
- };
518
- return W(() => {
519
- u.on(e, l);
520
- }), N(() => {
521
- u.off(e, l);
522
- }), { open: o };
523
- }
524
- const lt = /* @__PURE__ */ $({
525
- __name: "index",
526
- setup(e) {
527
- const { t } = z(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(""), n = p(""), d = p("");
528
- let c = 0, _ = !1;
529
- const w = (f) => {
530
- a.value = f.title, o.value = f.subtitle ?? "", l.value = f.text, r.value = f.cancel?.color ?? "primary", s.value = f.cancel?.text ?? t("dlg.common.cancel"), n.value = f.confirm?.color ?? "primary", d.value = f.confirm?.text ?? t("dlg.common.confirm"), c = f.seq, _ = !1, b.value = !0;
531
- }, { open: b } = Q("confirmDlg", w), y = () => {
532
- b.value = !1, _ || (u.emit("confirmDlgResult" + c, !0), _ = !0);
533
- };
534
- return J(b, (f) => {
535
- !f && !_ && (u.emit("confirmDlgResult" + c, !1), _ = !0);
536
- }), (f, j) => {
537
- const k = m("v-card-text"), i = m("v-btn"), g = m("v-card-actions"), R = m("v-card"), x = m("v-dialog");
538
- return q(), A(x, {
539
- modelValue: E(b),
540
- "onUpdate:modelValue": j[1] || (j[1] = (C) => X(b) ? b.value = C : null),
541
- attach: "",
542
- "max-width": "600px",
543
- transition: "dialog-top-transition",
544
- onKeydown: [
545
- F(I(y, ["stop", "prevent"]), ["enter"]),
546
- j[2] || (j[2] = F(I((C) => b.value = !1, ["stop", "prevent"]), ["esc"]))
547
- ]
548
- }, {
549
- default: v(() => [
550
- h(R, {
551
- subtitle: o.value,
552
- title: a.value
553
- }, {
554
- default: v(() => [
555
- h(k, null, {
556
- default: v(() => [
557
- M(S(l.value), 1)
558
- ]),
559
- _: 1
560
- }),
561
- h(g, { class: "d-flex justify-end" }, {
562
- default: v(() => [
563
- h(i, {
564
- color: r.value,
565
- variant: "text",
566
- onClick: j[0] || (j[0] = (C) => b.value = !1)
567
- }, {
568
- default: v(() => [
569
- M(S(s.value), 1)
570
- ]),
571
- _: 1
572
- }, 8, ["color"]),
573
- h(i, {
574
- color: n.value,
575
- variant: "text",
576
- onClick: y
577
- }, {
578
- default: v(() => [
579
- M(S(d.value), 1)
580
- ]),
581
- _: 1
582
- }, 8, ["color"])
583
- ]),
584
- _: 1
585
- })
586
- ]),
587
- _: 1
588
- }, 8, ["subtitle", "title"])
589
- ]),
590
- _: 1
591
- }, 8, ["modelValue", "onKeydown"]);
592
- };
593
- }
594
- }), nt = /* @__PURE__ */ $({
595
- __name: "index",
596
- props: {
597
- open: { type: Boolean, default: !0 },
598
- zIndex: { default: 1 }
599
- },
600
- setup(e) {
601
- const { backgroundColor2: t } = Te(), a = V(() => ({
602
- background: t.value,
603
- zIndex: e.zIndex
604
- }));
605
- let o = 0;
606
- return (l, r) => (q(), A(Ce, { name: "fade" }, {
607
- default: v(() => [
608
- e.open ? (q(), ee("div", {
609
- key: X(o) ? ++o.value : ++o,
610
- class: "x-cont",
611
- style: se(a.value)
612
- }, [...r[0] || (r[0] = [
613
- D("div", { class: "lds-spinner" }, [
614
- D("div"),
615
- D("div"),
616
- D("div"),
617
- D("div"),
618
- D("div"),
619
- D("div"),
620
- D("div"),
621
- D("div"),
622
- D("div"),
623
- D("div"),
624
- D("div"),
625
- D("div")
626
- ], -1)
627
- ])], 4)) : te("", !0)
628
- ]),
629
- _: 1
630
- }));
631
- }
632
- }), le = (e, t) => {
633
- const a = e.__vccOpts || e;
634
- for (const [o, l] of t)
635
- a[o] = l;
636
- return a;
637
- }, rt = /* @__PURE__ */ le(nt, [["__scopeId", "data-v-99c4198b"]]), ut = /* @__PURE__ */ $({
638
- __name: "item",
639
- props: {
640
- id: {},
641
- type: {},
642
- text: {},
643
- timeout: { default: 5e3 }
644
- },
645
- emits: ["timeout"],
646
- setup(e, { emit: t }) {
647
- const a = V(() => ({
648
- width: "calc(100% - 64px)",
649
- overflowWrap: "break-word"
650
- })), o = V(() => {
651
- switch (e.type) {
652
- case "success":
653
- return "mdi-check-circle";
654
- case "info":
655
- return "mdi-information";
656
- case "error":
657
- return "mdi-close-circle";
658
- case "warning":
659
- return "mdi-alert-circle";
660
- default:
661
- return "";
662
- }
663
- }), l = p(!0), r = t;
664
- return W(() => {
665
- setTimeout(() => {
666
- r("timeout", e.id);
667
- }, e.timeout);
668
- }), J(l, (s) => {
669
- s || r("timeout", e.id);
670
- }), (s, n) => {
671
- const d = m("v-icon"), c = m("v-sheet");
672
- return q(), A(c, {
673
- class: "x-item d-flex align-center py-2 mb-2",
674
- color: e.type,
675
- elevation: 1
676
- }, {
677
- default: v(() => [
678
- o.value ? (q(), A(d, {
679
- key: 0,
680
- class: "mx-1",
681
- icon: o.value
682
- }, null, 8, ["icon"])) : te("", !0),
683
- D("div", {
684
- style: se(a.value)
685
- }, S(e.text), 5),
686
- h(d, {
687
- class: "mx-1",
688
- icon: "mdi-close",
689
- onClick: n[0] || (n[0] = (_) => r("timeout", e.id))
690
- })
691
- ]),
692
- _: 1
693
- }, 8, ["color"]);
694
- };
695
- }
696
- }), ct = /* @__PURE__ */ le(ut, [["__scopeId", "data-v-5b5f6d09"]]), st = /* @__PURE__ */ $({
697
- __name: "index",
698
- setup(e) {
699
- const t = p([]);
700
- W(() => {
701
- u.on("message", a);
702
- }), N(() => {
703
- u.off("message", a);
704
- });
705
- const a = (n) => {
706
- const { type: d, text: c, timeout: _ } = n;
707
- r(d, c, _);
708
- }, o = (n) => {
709
- s(n);
710
- };
711
- let l = 0;
712
- const r = (n, d, c) => {
713
- const _ = l++;
714
- t.value.push({ id: _, type: n, text: d, timeout: c });
715
- }, s = (n) => {
716
- const d = t.value.findIndex((c) => c.id === n);
717
- d >= 0 && t.value.splice(d, 1);
718
- };
719
- return (n, d) => (q(), ee("div", {
720
- class: "x-cont d-flex flex-column-reverse align-center",
721
- onClick: d[0] || (d[0] = I(() => {
722
- }, ["stop"]))
723
- }, [
724
- (q(!0), ee(je, null, Ve(t.value, (c) => (q(), A(ct, {
725
- id: c.id,
726
- key: c.id,
727
- text: c.text,
728
- timeout: c.timeout,
729
- type: c.type,
730
- onTimeout: o
731
- }, null, 8, ["id", "text", "timeout", "type"]))), 128))
732
- ]));
733
- }
734
- }), pt = /* @__PURE__ */ le(st, [["__scopeId", "data-v-b482df18"]]), _t = /* @__PURE__ */ $({
735
- __name: "index",
736
- setup(e) {
737
- const { t } = z(), a = p(""), o = p(""), l = p(0), r = p(), s = p(-1 / 0), n = p(1 / 0), d = p(1);
738
- let c = 0, _ = !1;
739
- const w = pe("target"), b = async (k) => {
740
- a.value = k.title, o.value = k.subtitle ?? "", l.value = k.value, r.value = k.precision, s.value = k.min, n.value = k.max, d.value = k.step, c = k.seq, _ = !1, y.value = !0, await H(() => !!w.value), w.value.focus();
741
- }, { open: y } = Q("numberDlg", b), f = p(!1), j = () => {
742
- y.value = !1, _ || (u.emit(`numberDlgResult${c}`, l.value), _ = !0);
743
- };
744
- return J(y, (k) => {
745
- !k && !_ && (u.emit(`numberDlgResult${c}`, void 0), _ = !0);
746
- }), (k, i) => {
747
- const g = m("v-number-input"), R = m("v-btn"), x = m("v-card-actions"), C = m("v-form"), Y = m("v-card"), Z = m("v-dialog");
748
- return q(), A(Z, {
749
- modelValue: E(y),
750
- "onUpdate:modelValue": i[3] || (i[3] = (O) => X(y) ? y.value = O : null),
751
- attach: "",
752
- "max-width": "600px",
753
- transition: "dialog-top-transition",
754
- onKeydown: i[4] || (i[4] = F(I((O) => y.value = !1, ["stop", "prevent"]), ["esc"]))
755
- }, {
756
- default: v(() => [
757
- h(Y, { title: a.value }, {
758
- default: v(() => [
759
- h(C, {
760
- modelValue: f.value,
761
- "onUpdate:modelValue": i[2] || (i[2] = (O) => f.value = O),
762
- class: "mx-3",
763
- onSubmit: I(j, ["prevent"])
764
- }, {
765
- default: v(() => [
766
- h(g, {
767
- ref_key: "target",
768
- ref: w,
769
- modelValue: l.value,
770
- "onUpdate:modelValue": i[0] || (i[0] = (O) => l.value = O),
771
- "control-variant": "stacked",
772
- max: n.value,
773
- min: s.value,
774
- precision: r.value,
775
- step: d.value
776
- }, null, 8, ["modelValue", "max", "min", "precision", "step"]),
777
- h(x, { class: "d-flex justify-end" }, {
778
- default: v(() => [
779
- h(R, {
780
- color: "primary",
781
- variant: "text",
782
- onClick: i[1] || (i[1] = (O) => y.value = !1)
783
- }, {
784
- default: v(() => [
785
- M(S(E(t)("dlg.common.cancel")), 1)
786
- ]),
787
- _: 1
788
- }),
789
- h(R, {
790
- color: "primary",
791
- disabled: !f.value,
792
- type: "submit",
793
- variant: "text"
794
- }, {
795
- default: v(() => [
796
- M(S(E(t)("dlg.common.confirm")), 1)
797
- ]),
798
- _: 1
799
- }, 8, ["disabled"])
800
- ]),
801
- _: 1
802
- })
803
- ]),
804
- _: 1
805
- }, 8, ["modelValue"])
806
- ]),
807
- _: 1
808
- }, 8, ["title"])
809
- ]),
810
- _: 1
811
- }, 8, ["modelValue"]);
812
- };
813
- }
814
- }), dt = /* @__PURE__ */ $({
815
- __name: "index",
816
- setup(e) {
817
- const { t } = z(), a = p(""), o = p(""), l = p(""), r = p(""), s = p(""), n = p(), d = p(""), c = p(""), _ = p(""), w = p(""), b = p("");
818
- let y = 0, f = !1;
819
- const j = pe("target"), k = async (x) => {
820
- a.value = x.title, o.value = x.subtitle ?? "", l.value = x.text, r.value = x.label, s.value = x.placeholder, n.value = x.rules, d.value = x.value, c.value = x.cancel?.color ?? "primary", _.value = x.cancel?.text ?? t("dlg.common.cancel"), w.value = x.confirm?.color ?? "primary", b.value = x.confirm?.text ?? t("dlg.common.confirm"), y = x.seq, f = !1, i.value = !0, await H(() => !!j.value), j.value.focus();
821
- }, { open: i } = Q("promptDlg", k), g = p(!1), R = () => {
822
- i.value = !1, f || (u.emit("promptDlgResult" + y, d.value ?? ""), f = !0);
823
- };
824
- return J(i, (x) => {
825
- !x && !f && (u.emit("promptDlgResult" + y, void 0), f = !0);
826
- }), (x, C) => {
827
- const Y = m("v-card-text"), Z = m("v-text-field"), O = m("v-btn"), we = m("v-card-actions"), xe = m("v-form"), he = m("v-card"), ke = m("v-dialog");
828
- return q(), A(ke, {
829
- modelValue: E(i),
830
- "onUpdate:modelValue": C[3] || (C[3] = (B) => X(i) ? i.value = B : null),
831
- attach: "",
832
- "max-width": "600px",
833
- transition: "dialog-top-transition",
834
- onKeydown: C[4] || (C[4] = F(I((B) => i.value = !1, ["stop", "prevent"]), ["esc"]))
835
- }, {
836
- default: v(() => [
837
- h(he, {
838
- subtitle: o.value,
839
- title: a.value
840
- }, {
841
- default: v(() => [
842
- l.value ? (q(), A(Y, { key: 0 }, {
843
- default: v(() => [
844
- M(S(l.value), 1)
845
- ]),
846
- _: 1
847
- })) : te("", !0),
848
- h(xe, {
849
- modelValue: g.value,
850
- "onUpdate:modelValue": C[2] || (C[2] = (B) => g.value = B),
851
- class: "mx-3",
852
- onSubmit: I(R, ["prevent"])
853
- }, {
854
- default: v(() => [
855
- h(Z, {
856
- ref_key: "target",
857
- ref: j,
858
- modelValue: d.value,
859
- "onUpdate:modelValue": C[0] || (C[0] = (B) => d.value = B),
860
- label: r.value,
861
- placeholder: s.value,
862
- rules: n.value
863
- }, null, 8, ["modelValue", "label", "placeholder", "rules"]),
864
- h(we, { class: "d-flex justify-end" }, {
865
- default: v(() => [
866
- h(O, {
867
- color: c.value,
868
- variant: "text",
869
- onClick: C[1] || (C[1] = (B) => i.value = !1)
870
- }, {
871
- default: v(() => [
872
- M(S(_.value), 1)
873
- ]),
874
- _: 1
875
- }, 8, ["color"]),
876
- h(O, {
877
- color: w.value,
878
- disabled: !g.value,
879
- type: "submit",
880
- variant: "text"
881
- }, {
882
- default: v(() => [
883
- M(S(b.value), 1)
884
- ]),
885
- _: 1
886
- }, 8, ["color", "disabled"])
887
- ]),
888
- _: 1
889
- })
890
- ]),
891
- _: 1
892
- }, 8, ["modelValue"])
893
- ]),
894
- _: 1
895
- }, 8, ["subtitle", "title"])
896
- ]),
897
- _: 1
898
- }, 8, ["modelValue"]);
899
- };
900
- }
901
- }), it = { class: "ma-auto" }, ft = { class: "w-100 h-100 d-flex align-center justify-center" }, gt = { class: "text-body-1" }, vt = /* @__PURE__ */ $({
902
- __name: "index",
903
- setup(e) {
904
- const { t } = z(), a = p(""), o = (s) => {
905
- const n = s;
906
- a.value = n.text ?? t("dlg.common.responding"), r.value = !0;
907
- }, l = () => {
908
- r.value = !1;
909
- }, { open: r } = Q("waitDlg", o);
910
- return W(() => {
911
- u.on("closeWaitDlg", l);
912
- }), N(() => {
913
- u.off("closeWaitDlg", l);
914
- }), (s, n) => {
915
- const d = m("v-card"), c = m("v-dialog");
916
- return q(), A(c, {
917
- modelValue: E(r),
918
- "onUpdate:modelValue": n[0] || (n[0] = (_) => X(r) ? r.value = _ : null),
919
- attach: "",
920
- fullscreen: "",
921
- "no-click-animation": "",
922
- persistent: ""
923
- }, {
924
- default: v(() => [
925
- D("div", it, [
926
- h(d, {
927
- height: "80px",
928
- loading: "",
929
- width: "300px"
930
- }, {
931
- default: v(() => [
932
- D("div", ft, [
933
- D("span", gt, S(a.value), 1)
934
- ])
935
- ]),
936
- _: 1
937
- })
938
- ])
939
- ]),
940
- _: 1
941
- }, 8, ["modelValue"]);
942
- };
943
- }
944
- }), mt = (e) => {
945
- e.component("XConfirmDlg", lt), e.component("XLoading", rt), e.component("XMessage", pt), e.component("XNumberDlg", _t), e.component("XPromptDlg", dt), e.component("XWaitDlg", vt);
946
- }, bt = (e, t, a) => {
947
- const o = e[t];
948
- return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((l, r) => {
949
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== a ? ". Note that variables only represent file names one level deep." : ""))));
950
- });
377
+ function getTypeColor(e) {
378
+ switch (e) {
379
+ case "string": return "#5ba58c";
380
+ case "number": return "#5b67a5";
381
+ case "boolean": return "#5b80a5";
382
+ case "array": return "#745ba5";
383
+ case "object": return "#80a55b";
384
+ case "any": return "#9e9e9e";
385
+ }
386
+ }
387
+ function getTypeDefault(e) {
388
+ switch (e) {
389
+ case "string": return "";
390
+ case "number": return 0;
391
+ case "boolean": return !1;
392
+ case "array": return [];
393
+ case "object": return {};
394
+ case "any": return null;
395
+ }
396
+ }
397
+ function isEmpty(e) {
398
+ return e.value.length <= 0;
399
+ }
400
+ function lastView(e) {
401
+ if (e.value.length > 0) return e.value[e.value.length - 1];
402
+ }
403
+ function hasView(e, T) {
404
+ return !!e.value.find((e) => e === T);
405
+ }
406
+ function addView(e, T) {
407
+ let E = e.value.findIndex((e) => e === T);
408
+ E >= 0 && e.value.splice(E, 1), e.value.push(T);
409
+ }
410
+ function delView(e, T) {
411
+ let E = e.value.findIndex((e) => e === T);
412
+ E >= 0 && e.value.splice(E, 1);
413
+ }
414
+ function popView(e) {
415
+ console.assert(e.value.length > 0), e.value.pop();
416
+ }
417
+ function clearViews(e) {
418
+ e.value = [];
419
+ }
420
+ function useMicroApp(T, E, D, O, k, A) {
421
+ let j = useRoute(), M = useRouter(), N = usePreferredDark(), P = ref(!1);
422
+ watchEffect(() => {
423
+ let e = !1;
424
+ e = typeof T.value == "boolean" ? T.value : N.value, P.value = e;
425
+ }), provideDark(P), provideLocale(E), providePermissionObjects(D), providePermissionChecksum(O), provideLastAppPath(k), provideViews(A);
426
+ let F = useTheme();
427
+ watchEffect(() => {
428
+ F.change(P.value ? "dark" : "light");
429
+ });
430
+ let I = () => {
431
+ if (!isEmpty(A)) {
432
+ hasView(A, "waitDlg") || popView(A);
433
+ return;
434
+ }
435
+ let e = matchRouteMeta(j.path);
436
+ if (!e) {
437
+ console.assert(!1);
438
+ return;
439
+ }
440
+ e.level === 0 ? navigator?.Backbutton?.goHome(() => {}, () => {}) : M.back();
441
+ }, L = (e) => {
442
+ if (e.key === "Escape") {
443
+ I();
444
+ return;
445
+ }
446
+ }, R = () => {
447
+ I();
448
+ };
449
+ onMounted(() => {
450
+ window.addEventListener("keydown", L), eventBus.on("backbutton", R);
451
+ }), onBeforeUnmount(() => {
452
+ window.removeEventListener("keydown", L), eventBus.off("backbutton", R);
453
+ });
454
+ let z = (e) => {
455
+ T.value = e;
456
+ }, B = (e) => {
457
+ E.value = e;
458
+ }, W = (e) => {
459
+ let T = e;
460
+ D.value = T[0], O.value = T[1];
461
+ }, G = (e) => {
462
+ k.value = e;
463
+ };
464
+ onBeforeMount(() => {
465
+ eventBus.on("updateDark", z), eventBus.on("updateLocale", B), eventBus.on("updatePermission", W), eventBus.on("updateLastAppPath", G), eventBus.emit("syncGlobalState");
466
+ }), onBeforeUnmount(() => {
467
+ eventBus.off("updateDark", z), eventBus.off("updateLocale", B), eventBus.off("updatePermission", W), eventBus.off("updateLastAppPath", G);
468
+ });
469
+ }
470
+ function usePermission() {
471
+ let e = injectPermissionObjects();
472
+ function T(T, E) {
473
+ return verifyPermission(e.value, T, E ?? "");
474
+ }
475
+ return { verifyPermission: T };
476
+ }
477
+ function useSystem() {
478
+ let { locale: e, t: T } = useI18n(), E = computed(() => !!window.cordova), O = useDisplay();
479
+ return {
480
+ sysBarAvail: E,
481
+ compactWidth: computed(() => O.width.value <= 1280 ? O.width.value + "px" : O.width.value <= 1920 ? "768px" : "1024px"),
482
+ isCurvedScreen: computed(() => O.xs.value),
483
+ isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
484
+ nameList: (E, D) => {
485
+ let O = "", k = E.map((e) => T(e));
486
+ return O = D ? `${k.join("/")} <${D.join("/")}>` : e.value === "en" ? k.join(" ") : k.join(""), O;
487
+ },
488
+ sentenceOfAsk: (E, O, k) => e.value === "en" ? T("dlg.common.ask", {
489
+ verb: toLower_default(T(E)),
490
+ object: toLower_default(T(O)),
491
+ name: k
492
+ }) : T("dlg.common.ask", {
493
+ verb: T(E),
494
+ object: T(O),
495
+ name: k
496
+ })
497
+ };
498
+ }
499
+ function useViewStack(e, T) {
500
+ let E = injectViews(), D = computed({
501
+ get() {
502
+ return hasView(E, e);
503
+ },
504
+ set(T) {
505
+ T ? addView(E, e) : delView(E, e);
506
+ }
507
+ }), O = (e) => {
508
+ T?.(e), D.value = !0;
509
+ };
510
+ return onMounted(() => {
511
+ eventBus.on(e, O);
512
+ }), onBeforeUnmount(() => {
513
+ eventBus.off(e, O);
514
+ }), { open: D };
515
+ }
516
+ var confirmDlg_default = /* @__PURE__ */ defineComponent({
517
+ __name: "index",
518
+ setup(e) {
519
+ let { t: T } = useI18n(), E = ref(""), D = ref(""), O = ref(""), k = ref(""), A = ref(""), M = ref(""), N = ref(""), P = 0, L = !1, { open: R } = useViewStack("confirmDlg", (e) => {
520
+ E.value = e.title, D.value = e.subtitle ?? "", O.value = e.text, k.value = e.cancel?.color ?? "primary", A.value = e.cancel?.text ?? T("dlg.common.cancel"), M.value = e.confirm?.color ?? "primary", N.value = e.confirm?.text ?? T("dlg.common.confirm"), P = e.seq, L = !1, R.value = !0;
521
+ }), B = () => {
522
+ R.value = !1, L ||= (eventBus.emit("confirmDlgResult" + P, !0), !0);
523
+ };
524
+ return watch(R, (e) => {
525
+ !e && !L && (eventBus.emit("confirmDlgResult" + P, !1), L = !0);
526
+ }), (e, T) => {
527
+ let P = resolveComponent("v-card-text"), L = resolveComponent("v-btn"), V = resolveComponent("v-card-actions"), H = resolveComponent("v-card"), U = resolveComponent("v-dialog");
528
+ return openBlock(), createBlock(U, {
529
+ modelValue: unref(R),
530
+ "onUpdate:modelValue": T[1] ||= (e) => isRef(R) ? R.value = e : null,
531
+ attach: "",
532
+ "max-width": "600px",
533
+ transition: "dialog-top-transition",
534
+ onKeydown: [withKeys(withModifiers(B, ["stop", "prevent"]), ["enter"]), T[2] ||= withKeys(withModifiers((e) => R.value = !1, ["stop", "prevent"]), ["esc"])]
535
+ }, {
536
+ default: withCtx(() => [createVNode(H, {
537
+ subtitle: D.value,
538
+ title: E.value
539
+ }, {
540
+ default: withCtx(() => [createVNode(P, null, {
541
+ default: withCtx(() => [createTextVNode(toDisplayString(O.value), 1)]),
542
+ _: 1
543
+ }), createVNode(V, { class: "d-flex justify-end" }, {
544
+ default: withCtx(() => [createVNode(L, {
545
+ color: k.value,
546
+ variant: "text",
547
+ onClick: T[0] ||= (e) => R.value = !1
548
+ }, {
549
+ default: withCtx(() => [createTextVNode(toDisplayString(A.value), 1)]),
550
+ _: 1
551
+ }, 8, ["color"]), createVNode(L, {
552
+ color: M.value,
553
+ variant: "text",
554
+ onClick: B
555
+ }, {
556
+ default: withCtx(() => [createTextVNode(toDisplayString(N.value), 1)]),
557
+ _: 1
558
+ }, 8, ["color"])]),
559
+ _: 1
560
+ })]),
561
+ _: 1
562
+ }, 8, ["subtitle", "title"])]),
563
+ _: 1
564
+ }, 8, ["modelValue", "onKeydown"]);
565
+ };
566
+ }
567
+ }), index_vue_vue_type_script_setup_true_lang_default$4 = /* @__PURE__ */ defineComponent({
568
+ __name: "index",
569
+ props: {
570
+ open: {
571
+ type: Boolean,
572
+ default: !0
573
+ },
574
+ zIndex: { default: 1 }
575
+ },
576
+ setup(e) {
577
+ let { backgroundColor2: T } = useColor(), E = computed(() => ({
578
+ background: T.value,
579
+ zIndex: e.zIndex
580
+ })), D = 0;
581
+ return (T, O) => (openBlock(), createBlock(Transition, { name: "fade" }, {
582
+ default: withCtx(() => [e.open ? (openBlock(), createElementBlock("div", {
583
+ key: isRef(D) ? ++D.value : ++D,
584
+ class: "x-cont",
585
+ style: normalizeStyle(E.value)
586
+ }, [...O[0] ||= [createElementVNode("div", { class: "lds-spinner" }, [
587
+ createElementVNode("div"),
588
+ createElementVNode("div"),
589
+ createElementVNode("div"),
590
+ createElementVNode("div"),
591
+ createElementVNode("div"),
592
+ createElementVNode("div"),
593
+ createElementVNode("div"),
594
+ createElementVNode("div"),
595
+ createElementVNode("div"),
596
+ createElementVNode("div"),
597
+ createElementVNode("div"),
598
+ createElementVNode("div")
599
+ ], -1)]], 4)) : createCommentVNode("", !0)]),
600
+ _: 1
601
+ }));
602
+ }
603
+ }), __plugin_vue_export_helper_default = (e, T) => {
604
+ let E = e.__vccOpts || e;
605
+ for (let [e, D] of T) E[e] = D;
606
+ return E;
607
+ }, loading_default = /* @__PURE__ */ __plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default$4, [["__scopeId", "data-v-99c4198b"]]), item_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
608
+ __name: "item",
609
+ props: {
610
+ id: {},
611
+ type: {},
612
+ text: {},
613
+ timeout: { default: 5e3 }
614
+ },
615
+ emits: ["timeout"],
616
+ setup(e, { emit: T }) {
617
+ let E = computed(() => ({
618
+ width: "calc(100% - 64px)",
619
+ overflowWrap: "break-word"
620
+ })), D = computed(() => {
621
+ switch (e.type) {
622
+ case "success": return "mdi-check-circle";
623
+ case "info": return "mdi-information";
624
+ case "error": return "mdi-close-circle";
625
+ case "warning": return "mdi-alert-circle";
626
+ default: return "";
627
+ }
628
+ }), O = ref(!0), k = T;
629
+ return onMounted(() => {
630
+ setTimeout(() => {
631
+ k("timeout", e.id);
632
+ }, e.timeout);
633
+ }), watch(O, (T) => {
634
+ T || k("timeout", e.id);
635
+ }), (T, O) => {
636
+ let A = resolveComponent("v-icon"), N = resolveComponent("v-sheet");
637
+ return openBlock(), createBlock(N, {
638
+ class: "x-item d-flex align-center py-2 mb-2",
639
+ color: e.type,
640
+ elevation: 1
641
+ }, {
642
+ default: withCtx(() => [
643
+ D.value ? (openBlock(), createBlock(A, {
644
+ key: 0,
645
+ class: "mx-1",
646
+ icon: D.value
647
+ }, null, 8, ["icon"])) : createCommentVNode("", !0),
648
+ createElementVNode("div", { style: normalizeStyle(E.value) }, toDisplayString(e.text), 5),
649
+ createVNode(A, {
650
+ class: "mx-1",
651
+ icon: "mdi-close",
652
+ onClick: O[0] ||= (T) => k("timeout", e.id)
653
+ })
654
+ ]),
655
+ _: 1
656
+ }, 8, ["color"]);
657
+ };
658
+ }
659
+ }), [["__scopeId", "data-v-5b5f6d09"]]), message_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
660
+ __name: "index",
661
+ setup(e) {
662
+ let T = ref([]);
663
+ onMounted(() => {
664
+ eventBus.on("message", E);
665
+ }), onBeforeUnmount(() => {
666
+ eventBus.off("message", E);
667
+ });
668
+ let E = (e) => {
669
+ let { type: T, text: E, timeout: D } = e;
670
+ A(T, E, D);
671
+ }, D = (e) => {
672
+ M(e);
673
+ }, k = 0, A = (e, E, D) => {
674
+ let O = k++;
675
+ T.value.push({
676
+ id: O,
677
+ type: e,
678
+ text: E,
679
+ timeout: D
680
+ });
681
+ }, M = (e) => {
682
+ let E = T.value.findIndex((T) => T.id === e);
683
+ E >= 0 && T.value.splice(E, 1);
684
+ };
685
+ return (e, E) => (openBlock(), createElementBlock("div", {
686
+ class: "x-cont d-flex flex-column-reverse align-center",
687
+ onClick: E[0] ||= withModifiers(() => {}, ["stop"])
688
+ }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(T.value, (e) => (openBlock(), createBlock(item_default, {
689
+ id: e.id,
690
+ key: e.id,
691
+ text: e.text,
692
+ timeout: e.timeout,
693
+ type: e.type,
694
+ onTimeout: D
695
+ }, null, 8, [
696
+ "id",
697
+ "text",
698
+ "timeout",
699
+ "type"
700
+ ]))), 128))]));
701
+ }
702
+ }), [["__scopeId", "data-v-b482df18"]]), numberDlg_default = /* @__PURE__ */ defineComponent({
703
+ __name: "index",
704
+ setup(e) {
705
+ let { t: T } = useI18n(), E = ref(""), D = ref(""), O = ref(0), k = ref(), A = ref(-Infinity), M = ref(Infinity), N = ref(1), P = 0, L = !1, R = useTemplateRef("target"), { open: B } = useViewStack("numberDlg", async (e) => {
706
+ E.value = e.title, D.value = e.subtitle ?? "", O.value = e.value, k.value = e.precision, A.value = e.min, M.value = e.max, N.value = e.step, P = e.seq, L = !1, B.value = !0, await waitUtil(() => !!R.value), R.value.focus();
707
+ }), V = ref(!1), H = () => {
708
+ B.value = !1, L ||= (eventBus.emit(`numberDlgResult${P}`, O.value), !0);
709
+ };
710
+ return watch(B, (e) => {
711
+ !e && !L && (eventBus.emit(`numberDlgResult${P}`, void 0), L = !0);
712
+ }), (e, D) => {
713
+ let P = resolveComponent("v-number-input"), L = resolveComponent("v-btn"), U = resolveComponent("v-card-actions"), G = resolveComponent("v-form"), K = resolveComponent("v-card"), q = resolveComponent("v-dialog");
714
+ return openBlock(), createBlock(q, {
715
+ modelValue: unref(B),
716
+ "onUpdate:modelValue": D[3] ||= (e) => isRef(B) ? B.value = e : null,
717
+ attach: "",
718
+ "max-width": "600px",
719
+ transition: "dialog-top-transition",
720
+ onKeydown: D[4] ||= withKeys(withModifiers((e) => B.value = !1, ["stop", "prevent"]), ["esc"])
721
+ }, {
722
+ default: withCtx(() => [createVNode(K, { title: E.value }, {
723
+ default: withCtx(() => [createVNode(G, {
724
+ modelValue: V.value,
725
+ "onUpdate:modelValue": D[2] ||= (e) => V.value = e,
726
+ class: "mx-3",
727
+ onSubmit: withModifiers(H, ["prevent"])
728
+ }, {
729
+ default: withCtx(() => [createVNode(P, {
730
+ ref_key: "target",
731
+ ref: R,
732
+ modelValue: O.value,
733
+ "onUpdate:modelValue": D[0] ||= (e) => O.value = e,
734
+ "control-variant": "stacked",
735
+ max: M.value,
736
+ min: A.value,
737
+ precision: k.value,
738
+ step: N.value
739
+ }, null, 8, [
740
+ "modelValue",
741
+ "max",
742
+ "min",
743
+ "precision",
744
+ "step"
745
+ ]), createVNode(U, { class: "d-flex justify-end" }, {
746
+ default: withCtx(() => [createVNode(L, {
747
+ color: "primary",
748
+ variant: "text",
749
+ onClick: D[1] ||= (e) => B.value = !1
750
+ }, {
751
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(T)("dlg.common.cancel")), 1)]),
752
+ _: 1
753
+ }), createVNode(L, {
754
+ color: "primary",
755
+ disabled: !V.value,
756
+ type: "submit",
757
+ variant: "text"
758
+ }, {
759
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(T)("dlg.common.confirm")), 1)]),
760
+ _: 1
761
+ }, 8, ["disabled"])]),
762
+ _: 1
763
+ })]),
764
+ _: 1
765
+ }, 8, ["modelValue"])]),
766
+ _: 1
767
+ }, 8, ["title"])]),
768
+ _: 1
769
+ }, 8, ["modelValue"]);
770
+ };
771
+ }
772
+ }), promptDlg_default = /* @__PURE__ */ defineComponent({
773
+ __name: "index",
774
+ setup(e) {
775
+ let { t: T } = useI18n(), E = ref(""), D = ref(""), O = ref(""), k = ref(""), A = ref(""), N = ref(), P = ref(""), L = ref(""), R = ref(""), B = ref(""), V = ref(""), H = 0, U = !1, G = useTemplateRef("target"), { open: q } = useViewStack("promptDlg", async (e) => {
776
+ E.value = e.title, D.value = e.subtitle ?? "", O.value = e.text, k.value = e.label, A.value = e.placeholder, N.value = e.rules, P.value = e.value, L.value = e.cancel?.color ?? "primary", R.value = e.cancel?.text ?? T("dlg.common.cancel"), B.value = e.confirm?.color ?? "primary", V.value = e.confirm?.text ?? T("dlg.common.confirm"), H = e.seq, U = !1, q.value = !0, await waitUtil(() => !!G.value), G.value.focus();
777
+ }), X = ref(!1), Q = () => {
778
+ q.value = !1, U ||= (eventBus.emit("promptDlgResult" + H, P.value ?? ""), !0);
779
+ };
780
+ return watch(q, (e) => {
781
+ !e && !U && (eventBus.emit("promptDlgResult" + H, void 0), U = !0);
782
+ }), (e, T) => {
783
+ let H = resolveComponent("v-card-text"), U = resolveComponent("v-text-field"), K = resolveComponent("v-btn"), J = resolveComponent("v-card-actions"), Y = resolveComponent("v-form"), Z = resolveComponent("v-card"), $ = resolveComponent("v-dialog");
784
+ return openBlock(), createBlock($, {
785
+ modelValue: unref(q),
786
+ "onUpdate:modelValue": T[3] ||= (e) => isRef(q) ? q.value = e : null,
787
+ attach: "",
788
+ "max-width": "600px",
789
+ transition: "dialog-top-transition",
790
+ onKeydown: T[4] ||= withKeys(withModifiers((e) => q.value = !1, ["stop", "prevent"]), ["esc"])
791
+ }, {
792
+ default: withCtx(() => [createVNode(Z, {
793
+ subtitle: D.value,
794
+ title: E.value
795
+ }, {
796
+ default: withCtx(() => [O.value ? (openBlock(), createBlock(H, { key: 0 }, {
797
+ default: withCtx(() => [createTextVNode(toDisplayString(O.value), 1)]),
798
+ _: 1
799
+ })) : createCommentVNode("", !0), createVNode(Y, {
800
+ modelValue: X.value,
801
+ "onUpdate:modelValue": T[2] ||= (e) => X.value = e,
802
+ class: "mx-3",
803
+ onSubmit: withModifiers(Q, ["prevent"])
804
+ }, {
805
+ default: withCtx(() => [createVNode(U, {
806
+ ref_key: "target",
807
+ ref: G,
808
+ modelValue: P.value,
809
+ "onUpdate:modelValue": T[0] ||= (e) => P.value = e,
810
+ label: k.value,
811
+ placeholder: A.value,
812
+ rules: N.value
813
+ }, null, 8, [
814
+ "modelValue",
815
+ "label",
816
+ "placeholder",
817
+ "rules"
818
+ ]), createVNode(J, { class: "d-flex justify-end" }, {
819
+ default: withCtx(() => [createVNode(K, {
820
+ color: L.value,
821
+ variant: "text",
822
+ onClick: T[1] ||= (e) => q.value = !1
823
+ }, {
824
+ default: withCtx(() => [createTextVNode(toDisplayString(R.value), 1)]),
825
+ _: 1
826
+ }, 8, ["color"]), createVNode(K, {
827
+ color: B.value,
828
+ disabled: !X.value,
829
+ type: "submit",
830
+ variant: "text"
831
+ }, {
832
+ default: withCtx(() => [createTextVNode(toDisplayString(V.value), 1)]),
833
+ _: 1
834
+ }, 8, ["color", "disabled"])]),
835
+ _: 1
836
+ })]),
837
+ _: 1
838
+ }, 8, ["modelValue"])]),
839
+ _: 1
840
+ }, 8, ["subtitle", "title"])]),
841
+ _: 1
842
+ }, 8, ["modelValue"]);
843
+ };
844
+ }
845
+ }), _hoisted_1 = { class: "ma-auto" }, _hoisted_2 = { class: "w-100 h-100 d-flex align-center justify-center" }, _hoisted_3 = { class: "text-body-1" }, waitDlg_default = /* @__PURE__ */ defineComponent({
846
+ __name: "index",
847
+ setup(e) {
848
+ let { t: T } = useI18n(), E = ref(""), D = (e) => {
849
+ E.value = e.text ?? T("dlg.common.responding"), k.value = !0;
850
+ }, O = () => {
851
+ k.value = !1;
852
+ }, { open: k } = useViewStack("waitDlg", D);
853
+ return onMounted(() => {
854
+ eventBus.on("closeWaitDlg", O);
855
+ }), onBeforeUnmount(() => {
856
+ eventBus.off("closeWaitDlg", O);
857
+ }), (e, T) => {
858
+ let D = resolveComponent("v-card"), O = resolveComponent("v-dialog");
859
+ return openBlock(), createBlock(O, {
860
+ modelValue: unref(k),
861
+ "onUpdate:modelValue": T[0] ||= (e) => isRef(k) ? k.value = e : null,
862
+ attach: "",
863
+ fullscreen: "",
864
+ "no-click-animation": "",
865
+ persistent: ""
866
+ }, {
867
+ default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(D, {
868
+ height: "80px",
869
+ loading: "",
870
+ width: "300px"
871
+ }, {
872
+ default: withCtx(() => [createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(E.value), 1)])]),
873
+ _: 1
874
+ })])]),
875
+ _: 1
876
+ }, 8, ["modelValue"]);
877
+ };
878
+ }
879
+ });
880
+ const install = (e) => {
881
+ e.component("XConfirmDlg", confirmDlg_default), e.component("XLoading", loading_default), e.component("XMessage", message_default), e.component("XNumberDlg", numberDlg_default), e.component("XPromptDlg", promptDlg_default), e.component("XWaitDlg", waitDlg_default);
951
882
  };
952
- async function Jt(e) {
953
- return (await bt(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.i529k39u.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.mx7z5jvj.js") }), `./locales/${e}/index.ts`, 4)).default;
954
- }
955
- const Qt = { install: mt };
956
- export {
957
- Ke as Permission,
958
- tt as addView,
959
- Ee as appAppear,
960
- zt as clearViews,
961
- Lt as closeWaitDlg,
962
- Ct as createAxios,
963
- Qt as default,
964
- at as delView,
965
- u as eventBus,
966
- Wt as getTypeColor,
967
- jt as globalObjects,
968
- ye as hasView,
969
- It as injectDark,
970
- Ut as injectLastAppPath,
971
- $t as injectLocale,
972
- Et as injectPermissionChecksum,
973
- He as injectPermissionObjects,
974
- Qe as injectViews,
975
- et as isEmpty,
976
- ce as isExist,
977
- Xt as lastView,
978
- Jt as loadLocaleMessageEssential,
979
- G as matchRouteMeta,
980
- Tt as messageError,
981
- At as messageInfo,
982
- Mt as messageSuccess,
983
- Bt as messageWarning,
984
- Kt as onBeforeEach,
985
- qt as openConfirmDlg,
986
- Ot as openNumberDlg,
987
- St as openPromptDlg,
988
- Rt as openWaitDlg,
989
- ot as popView,
990
- We as provideDark,
991
- Ge as provideLastAppPath,
992
- Xe as provideLocale,
993
- Fe as providePermissionChecksum,
994
- ze as providePermissionObjects,
995
- Je as provideViews,
996
- P as routeTransName,
997
- Nt as types,
998
- Te as useColor,
999
- Ht as useMicroApp,
1000
- Ft as usePermission,
1001
- Gt as useSystem,
1002
- Q as useViewStack,
1003
- Ne as verifyPermission,
1004
- Vt as waitMs,
1005
- H as waitUtil
883
+ var __rolldown_dynamic_import_helper_default = (e, T, E) => {
884
+ let D = T.lastIndexOf("?"), O = e[D === -1 || D < T.lastIndexOf("/") ? T : T.slice(0, D)];
885
+ return O ? typeof O == "function" ? O() : Promise.resolve(O) : new Promise((e, D) => {
886
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(D.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + T + (T.split("/").length === E ? "" : ". Note that variables only represent file names one level deep."))));
887
+ });
1006
888
  };
889
+ async function loadLocaleMessageEssential(e) {
890
+ return (await __rolldown_dynamic_import_helper_default({
891
+ "./locales/en/index.ts": () => import("./en.lh9n40a2.js"),
892
+ "./locales/zhHans/index.ts": () => import("./zhHans.k0vi0ko0.js")
893
+ }, `./locales/${e}/index.ts`, 4)).default;
894
+ }
895
+ var src_default = { install };
896
+ export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };