xto-fronted 0.4.81 → 0.4.83

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.
Files changed (87) hide show
  1. package/dist/assets/404-CrBiLyvr.js +1 -0
  2. package/dist/assets/404-Cw_4ZCL6.css +1 -0
  3. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  4. package/dist/assets/index-B58q1gWi.js +1 -0
  5. package/dist/assets/index-BRR97dc6.js +1 -0
  6. package/dist/assets/index-BlRslYYI.css +1 -0
  7. package/dist/assets/index-BudArKxR.css +1 -0
  8. package/dist/assets/index-BvJMwvx-.js +1 -0
  9. package/dist/assets/index-CFhWBbxk.css +1 -0
  10. package/dist/assets/index-CfMs36V8.js +1 -0
  11. package/dist/assets/index-CfpZmcpk.css +1 -0
  12. package/dist/assets/index-ChwM56sh.js +2 -0
  13. package/dist/assets/index-Cmf2-p8P.js +1 -0
  14. package/dist/assets/index-DkkuYBgT.css +1 -0
  15. package/dist/assets/index-DmrM_IuD.js +1 -0
  16. package/dist/assets/index-WcdktCzT.js +1 -0
  17. package/dist/assets/index-t-2Y0KhA.css +1 -0
  18. package/dist/assets/index-vfvEFrCH.css +1 -0
  19. package/dist/assets/vendor-CUVPinTg.js +13 -0
  20. package/dist/assets/vue-vendor-D8SAgT8u.js +29 -0
  21. package/dist/assets/xto-base-BD3OH0V6.js +1 -0
  22. package/dist/assets/xto-base-CojW9IFO.css +1 -0
  23. package/dist/assets/xto-business--V1F5Gwb.css +1 -0
  24. package/dist/assets/xto-core-Boim7B0B.js +1 -0
  25. package/dist/assets/xto-data-YheCZfV4.css +1 -0
  26. package/dist/assets/xto-data-_xzIYqb-.js +1 -0
  27. package/dist/assets/xto-feedback-C-ESp-Y1.css +1 -0
  28. package/dist/assets/xto-feedback-XZPSQcJN.js +1 -0
  29. package/dist/assets/xto-form-CpcozvK5.css +1 -0
  30. package/dist/assets/xto-form-X369Lz91.js +1 -0
  31. package/dist/assets/xto-layout-D1stVnJI.css +1 -0
  32. package/dist/assets/xto-navigation-BRzSCpAw.css +1 -0
  33. package/dist/assets/xto-navigation-CDWfzPP5.js +1 -0
  34. package/dist/index.html +28 -0
  35. package/package.json +1 -1
  36. package/src/components/Layout/Sidebar.vue +19 -22
  37. package/src/components/Layout/TopMenu.vue +37 -12
  38. package/dist/App.vue.d.ts +0 -2
  39. package/dist/api/auth.d.ts +0 -8
  40. package/dist/api/system.d.ts +0 -16
  41. package/dist/api/user.d.ts +0 -13
  42. package/dist/components/Layout/Footer.vue.d.ts +0 -2
  43. package/dist/components/Layout/Header.vue.d.ts +0 -5
  44. package/dist/components/Layout/MixTopMenu.vue.d.ts +0 -5
  45. package/dist/components/Layout/Sidebar.vue.d.ts +0 -11
  46. package/dist/components/Layout/SidebarMenuItem.vue.d.ts +0 -5
  47. package/dist/components/Layout/Tabs.vue.d.ts +0 -2
  48. package/dist/components/Layout/TopMenu.vue.d.ts +0 -5
  49. package/dist/components/Layout/index.vue.d.ts +0 -2
  50. package/dist/composables/useApp.d.ts +0 -29
  51. package/dist/composables/useAuth.d.ts +0 -6
  52. package/dist/composables/useForm.d.ts +0 -20
  53. package/dist/composables/useTable.d.ts +0 -29
  54. package/dist/directives/permission.d.ts +0 -4
  55. package/dist/enums/index.d.ts +0 -32
  56. package/dist/index-BIbDky4c.js +0 -189
  57. package/dist/index-BtIXVAVa.js +0 -479
  58. package/dist/index-Cm5czPiu.js +0 -515
  59. package/dist/index-DynapQge.js +0 -641
  60. package/dist/index-FOOV1KUl.js +0 -4128
  61. package/dist/index.d.ts +0 -54
  62. package/dist/index.es.js +0 -91
  63. package/dist/index.umd.js +0 -8
  64. package/dist/main.d.ts +0 -0
  65. package/dist/router/dynamicRoutes.d.ts +0 -30
  66. package/dist/router/guards.d.ts +0 -17
  67. package/dist/router/index.d.ts +0 -6
  68. package/dist/router/layoutRoute.d.ts +0 -18
  69. package/dist/router/staticRoutes.d.ts +0 -2
  70. package/dist/stores/app.d.ts +0 -93
  71. package/dist/stores/auth.d.ts +0 -41
  72. package/dist/stores/index.d.ts +0 -9
  73. package/dist/stores/menu.d.ts +0 -77
  74. package/dist/stores/user.d.ts +0 -92
  75. package/dist/style.css +0 -1
  76. package/dist/utils/auth.d.ts +0 -27
  77. package/dist/utils/config.d.ts +0 -30
  78. package/dist/utils/permission.d.ts +0 -18
  79. package/dist/utils/request.d.ts +0 -24
  80. package/dist/utils/storage.d.ts +0 -24
  81. package/dist/views/dashboard/index.vue.d.ts +0 -2
  82. package/dist/views/error/403.vue.d.ts +0 -2
  83. package/dist/views/error/404.vue.d.ts +0 -2
  84. package/dist/views/login/index.vue.d.ts +0 -4
  85. package/dist/views/system/menu/index.vue.d.ts +0 -4
  86. package/dist/views/system/role/index.vue.d.ts +0 -4
  87. package/dist/views/system/user/index.vue.d.ts +0 -4
@@ -1,4128 +0,0 @@
1
- import { ref as D, computed as j, watch as We, defineComponent as Ae, resolveComponent as Ut, openBlock as y, createBlock as me, unref as b, withCtx as Y, createElementBlock as N, Fragment as ve, renderList as ye, createElementVNode as n, toDisplayString as W, createCommentVNode as ie, normalizeClass as ge, withDirectives as at, vShow as Jt, createVNode as P, createTextVNode as Re, onMounted as gt, onUnmounted as _t, vModelText as wt, Transition as Ve, withModifiers as it, normalizeStyle as Xe, reactive as yt, createStaticVNode as tt, withKeys as Zt } from "vue";
2
- import { defineStore as lt } from "pinia";
3
- import { useRoute as qe, useRouter as De, createRouter as bt, createWebHistory as kt } from "vue-router";
4
- import { SubMenu as Bt, MenuItem as st, Menu as xt, Tabs as Qt, TabPane as es } from "@xto/navigation";
5
- import { Icon as Q, Button as je } from "@xto/base";
6
- import { Drawer as Ct, Message as Le } from "@xto/feedback";
7
- import { Form as ts, FormItem as mt, Input as At, Checkbox as ss } from "@xto/form";
8
- import ns from "axios";
9
- const nt = D(""), ot = D(""), rt = D("");
10
- function os(r) {
11
- r.appId && (nt.value = r.appId), r.clientId && (ot.value = r.clientId), r.apiBaseUrl && (rt.value = r.apiBaseUrl);
12
- }
13
- function ct() {
14
- if (nt.value)
15
- return nt.value;
16
- try {
17
- return "";
18
- } catch {
19
- return "";
20
- }
21
- }
22
- function Dt() {
23
- if (ot.value)
24
- return ot.value;
25
- try {
26
- return "";
27
- } catch {
28
- return "";
29
- }
30
- }
31
- function rs() {
32
- if (rt.value)
33
- return rt.value;
34
- try {
35
- return "";
36
- } catch {
37
- return "";
38
- }
39
- }
40
- const Na = {
41
- appId: nt,
42
- clientId: ot,
43
- apiBaseUrl: rt
44
- }, Ke = "xto_", Pt = (r) => ({
45
- get(f) {
46
- const v = r.getItem(Ke + f);
47
- if (!v) return null;
48
- try {
49
- return JSON.parse(v);
50
- } catch {
51
- return v;
52
- }
53
- },
54
- set(f, v) {
55
- if (v == null) {
56
- r.removeItem(Ke + f);
57
- return;
58
- }
59
- const p = typeof v == "string" ? v : JSON.stringify(v);
60
- r.setItem(Ke + f, p);
61
- },
62
- remove(f) {
63
- r.removeItem(Ke + f);
64
- },
65
- clear() {
66
- Object.keys(r).forEach((v) => {
67
- v.startsWith(Ke) && r.removeItem(v);
68
- });
69
- }
70
- }), Ze = Pt(window.localStorage), Qe = Pt(window.sessionStorage), H = {
71
- get: Ze.get,
72
- set: Ze.set,
73
- remove: Ze.remove,
74
- clear: Ze.clear
75
- }, $a = {
76
- get: Qe.get,
77
- set: Qe.set,
78
- remove: Qe.remove,
79
- clear: Qe.clear
80
- }, Pe = lt("app", () => {
81
- const r = D(H.get("appName") || "XTO App"), f = D(H.get("indexPath") || "/dashboard"), v = D(H.get("isDark") || !1), p = D(H.get("theme") || "light"), h = D(H.get("layout") || "sidebar"), k = D(H.get("isCollapsed") || !1), T = D(H.get("showTabs") ?? !0), g = D(H.get("showFooter") ?? !0), I = D(H.get("showBreadcrumb") ?? !0), _ = D(H.get("primaryColor") || "#409eff"), x = D([]), S = D([]), E = j(() => v.value ? "dark" : "light"), q = (z) => {
82
- r.value = z, H.set("appName", z);
83
- }, Z = (z) => {
84
- f.value = z, H.set("indexPath", z);
85
- }, O = () => {
86
- v.value = !v.value, p.value = v.value ? "dark" : "light", V();
87
- }, L = (z) => {
88
- p.value = z, v.value = z === "dark", V();
89
- }, V = () => {
90
- const z = document.documentElement;
91
- v.value ? z.classList.add("dark") : z.classList.remove("dark"), H.set("isDark", v.value), H.set("theme", p.value);
92
- }, M = () => {
93
- k.value = !k.value, H.set("isCollapsed", k.value);
94
- }, K = (z) => {
95
- h.value = z, H.set("layout", z);
96
- }, J = () => {
97
- T.value = !T.value, H.set("showTabs", T.value);
98
- }, oe = () => {
99
- g.value = !g.value, H.set("showFooter", g.value);
100
- }, U = () => {
101
- I.value = !I.value, H.set("showBreadcrumb", I.value);
102
- }, A = (z) => {
103
- _.value = z, document.documentElement.style.setProperty("--color-primary", z), H.set("primaryColor", z);
104
- }, X = (z) => {
105
- x.value.includes(z) || x.value.push(z);
106
- }, se = (z) => {
107
- const le = x.value.indexOf(z);
108
- le > -1 && x.value.splice(le, 1);
109
- }, $ = () => {
110
- x.value = [];
111
- }, re = (z) => {
112
- S.value = z;
113
- }, ee = () => {
114
- V(), _.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", _.value);
115
- };
116
- return We(v, V), {
117
- appName: r,
118
- indexPath: f,
119
- isDark: v,
120
- theme: p,
121
- layout: h,
122
- isCollapsed: k,
123
- showTabs: T,
124
- showFooter: g,
125
- showBreadcrumb: I,
126
- primaryColor: _,
127
- cachedViews: x,
128
- mixSubMenus: S,
129
- themeClass: E,
130
- setAppName: q,
131
- setIndexPath: Z,
132
- toggleTheme: O,
133
- toggleCollapse: M,
134
- setTheme: L,
135
- setLayout: K,
136
- toggleTabs: J,
137
- toggleFooter: oe,
138
- toggleBreadcrumb: U,
139
- setPrimaryColor: A,
140
- addCachedView: X,
141
- removeCachedView: se,
142
- clearCachedViews: $,
143
- setMixSubMenus: re,
144
- initTheme: ee
145
- };
146
- }), ht = "menu_list", as = {
147
- menuCode: "home",
148
- menuName: "首页",
149
- menuUrl: "/dashboard",
150
- icon: "home",
151
- closable: !1,
152
- isDefault: !1,
153
- isOut: !1
154
- }, ze = lt("menu", () => {
155
- const r = D(H.get(ht) || []), f = j(() => r.value.length > 0);
156
- return {
157
- menuList: r,
158
- hasMenu: f,
159
- setMenuList: (h) => {
160
- r.value = [as, ...h], H.set(ht, r.value);
161
- },
162
- clearMenu: () => {
163
- r.value = [], H.remove(ht);
164
- }
165
- };
166
- }), Et = "/vite.svg", vt = "user_info", $e = lt("user", () => {
167
- const r = D(H.get(vt)), f = j(() => !!r.value), v = j(() => {
168
- var S;
169
- return ((S = r.value) == null ? void 0 : S.userId) || "";
170
- }), p = j(() => {
171
- var S;
172
- return ((S = r.value) == null ? void 0 : S.userName) || "";
173
- }), h = j(() => {
174
- var S;
175
- return ((S = r.value) == null ? void 0 : S.departmentName) || "";
176
- }), k = j(() => {
177
- var S;
178
- return ((S = r.value) == null ? void 0 : S.email) || "";
179
- }), T = j(() => {
180
- var S;
181
- return ((S = r.value) == null ? void 0 : S.mobilePhone) || "";
182
- }), g = j(() => {
183
- var S;
184
- return ((S = r.value) == null ? void 0 : S.positionName) || "";
185
- }), I = j(() => {
186
- var S;
187
- return ((S = r.value) == null ? void 0 : S.avatar) || "";
188
- });
189
- return {
190
- userInfo: r,
191
- isLoggedIn: f,
192
- userId: v,
193
- userName: p,
194
- departmentName: h,
195
- email: k,
196
- mobilePhone: T,
197
- positionName: g,
198
- avatar: I,
199
- setUserInfo: (S) => {
200
- r.value = S, H.set(vt, S);
201
- },
202
- clearUserInfo: () => {
203
- r.value = null, H.remove(vt);
204
- }
205
- };
206
- }), Nt = "token", $t = "token_type", St = "refresh_token", Mt = "expires_time", It = "refresh_time", Lt = "code", ut = () => H.get(Nt), is = (r) => {
207
- H.set(Nt, r);
208
- }, ls = () => H.get($t), cs = (r) => {
209
- H.set($t, r);
210
- }, Sa = () => H.get(St), us = (r) => {
211
- H.set(St, r);
212
- }, ds = () => H.get(Mt), fs = (r) => {
213
- H.set(Mt, r);
214
- }, Ma = () => H.get(It), ps = (r) => {
215
- H.set(It, r);
216
- }, Ia = () => H.get(Lt), ms = (r) => {
217
- H.set(Lt, r);
218
- }, Rt = (r) => {
219
- is(r.access_token), cs(r.token_type || "Bearer"), us(r.refresh_token), fs(r.expires_time), ps(r.refresh_time), r.code && ms(r.code);
220
- }, He = () => {
221
- H.remove(Nt), H.remove($t), H.remove(St), H.remove(Mt), H.remove(It), H.remove(Lt);
222
- }, hs = () => {
223
- const r = ds();
224
- return r ? Date.now() > r : !0;
225
- }, zt = () => !!ut() && !hs(), Ye = lt("auth", () => {
226
- const r = D(ut()), f = j(() => zt()), v = D(""), p = D(""), h = D(""), k = D("/login");
227
- return {
228
- token: r,
229
- isLoggedIn: f,
230
- baseUrl: v,
231
- appId: p,
232
- clientId: h,
233
- loginPath: k,
234
- login: (E) => {
235
- r.value = E.access_token, Rt(E);
236
- },
237
- logout: () => {
238
- r.value = null, He();
239
- },
240
- setBaseUrl: (E) => {
241
- v.value = E;
242
- },
243
- setAppId: (E) => {
244
- p.value = E;
245
- },
246
- setClientId: (E) => {
247
- h.value = E;
248
- },
249
- setLoginPath: (E) => {
250
- k.value = E;
251
- }
252
- };
253
- }), vs = { class: "menu-item__content" }, gs = { class: "menu-item__icon" }, _s = {
254
- key: 1,
255
- class: "menu-item__char"
256
- }, ws = { class: "menu-item__text" }, ys = { class: "menu-item__content" }, bs = {
257
- key: 0,
258
- class: "menu-item__icon"
259
- }, ks = {
260
- key: 1,
261
- class: "menu-item__char"
262
- }, xs = { class: "menu-item__text" }, Cs = /* @__PURE__ */ Ae({
263
- __name: "SidebarMenuItem",
264
- props: {
265
- menu: {}
266
- },
267
- setup(r) {
268
- const f = r, v = /* @__PURE__ */ new Set([
269
- "arrow-up",
270
- "arrow-down",
271
- "arrow-left",
272
- "arrow-right",
273
- "caret-down",
274
- "caret-right",
275
- "plus",
276
- "minus",
277
- "close",
278
- "check",
279
- "edit",
280
- "delete",
281
- "copy",
282
- "download",
283
- "upload",
284
- "refresh",
285
- "search",
286
- "filter",
287
- "more",
288
- "setting",
289
- "share",
290
- "loading",
291
- "info",
292
- "success",
293
- "warning",
294
- "error",
295
- "question",
296
- "user",
297
- "user-add",
298
- "user-group",
299
- "logout",
300
- "login",
301
- "file",
302
- "folder",
303
- "folder-open",
304
- "document",
305
- "image",
306
- "video",
307
- "music",
308
- "camera",
309
- "mail",
310
- "phone",
311
- "chat",
312
- "bell",
313
- "message",
314
- "eye",
315
- "eye-off",
316
- "calendar",
317
- "clock",
318
- "history",
319
- "timer",
320
- "location",
321
- "map",
322
- "globe",
323
- "star",
324
- "heart",
325
- "thumb-up",
326
- "link",
327
- "external-link",
328
- "lock",
329
- "unlock",
330
- "key",
331
- "home",
332
- "menu",
333
- "menu-fold",
334
- "menu-unfold",
335
- "sidebar-fold",
336
- "sidebar-expand",
337
- "sidebar-left",
338
- "dashboard",
339
- "chart",
340
- "chart-pie",
341
- "chart-line",
342
- "report",
343
- "analytics",
344
- "system",
345
- "permission",
346
- "role",
347
- "user-manage",
348
- "log",
349
- "notification",
350
- "app",
351
- "list",
352
- "grid",
353
- "fullscreen",
354
- "fullscreen-exit",
355
- "zoom-in",
356
- "zoom-out",
357
- "print",
358
- "bookmark",
359
- "tag",
360
- "code",
361
- "terminal",
362
- "database",
363
- "server",
364
- "cloud",
365
- "gift",
366
- "moon",
367
- "sun",
368
- "theme",
369
- "skin"
370
- ]), p = (g) => {
371
- if (!g || g === "") return "";
372
- if (g.startsWith("tineco-icon-")) {
373
- const _ = g.replace("tineco-icon-", "");
374
- return {
375
- home: "home",
376
- dashboard: "dashboard",
377
- system: "system",
378
- user: "user",
379
- role: "role",
380
- menu: "list",
381
- setting: "setting",
382
- file: "file",
383
- folder: "folder",
384
- chart: "chart",
385
- report: "report",
386
- analytics: "analytics"
387
- }[_] || _;
388
- }
389
- return {
390
- dashboard: "dashboard",
391
- system: "system",
392
- user: "user",
393
- role: "role",
394
- menu: "list",
395
- setting: "setting",
396
- home: "home",
397
- chart: "chart",
398
- report: "report",
399
- analytics: "analytics",
400
- permission: "permission",
401
- log: "log",
402
- notification: "notification",
403
- app: "app",
404
- list: "list",
405
- grid: "grid"
406
- }[g] || g;
407
- }, h = (g) => g ? g.charAt(0) : "", k = (g) => v.has(g), T = j(() => f.menu.children && f.menu.children.length > 0);
408
- return (g, I) => {
409
- const _ = Ut("SidebarMenuItem", !0);
410
- return T.value ? (y(), me(b(Bt), {
411
- key: 0,
412
- index: r.menu.menuUrl
413
- }, {
414
- title: Y(() => [
415
- n("span", vs, [
416
- n("span", gs, [
417
- k(p(r.menu.icon)) ? (y(), me(b(Q), {
418
- key: 0,
419
- name: p(r.menu.icon),
420
- size: 16
421
- }, null, 8, ["name"])) : (y(), N("span", _s, W(h(r.menu.menuName)), 1))
422
- ]),
423
- n("span", ws, W(r.menu.menuName), 1)
424
- ])
425
- ]),
426
- default: Y(() => [
427
- (y(!0), N(ve, null, ye(r.menu.children, (x) => (y(), me(_, {
428
- key: x.menuUrl,
429
- menu: x
430
- }, null, 8, ["menu"]))), 128))
431
- ]),
432
- _: 1
433
- }, 8, ["index"])) : (y(), me(b(st), {
434
- key: 1,
435
- index: r.menu.menuUrl
436
- }, {
437
- default: Y(() => [
438
- n("span", ys, [
439
- r.menu.menuName !== "首页" ? (y(), N("span", bs, [
440
- k(p(r.menu.icon)) ? (y(), me(b(Q), {
441
- key: 0,
442
- name: p(r.menu.icon),
443
- size: 16
444
- }, null, 8, ["name"])) : (y(), N("span", ks, W(h(r.menu.menuName)), 1))
445
- ])) : ie("", !0),
446
- n("span", xs, W(r.menu.menuName), 1)
447
- ])
448
- ]),
449
- _: 1
450
- }, 8, ["index"]));
451
- };
452
- }
453
- }), Se = (r, f) => {
454
- const v = r.__vccOpts || r;
455
- for (const [p, h] of f)
456
- v[p] = h;
457
- return v;
458
- }, Es = /* @__PURE__ */ Se(Cs, [["__scopeId", "data-v-d160ae6a"]]), Ns = {
459
- key: 0,
460
- class: "sidebar__logo"
461
- }, $s = {
462
- key: 1,
463
- class: "sidebar__user"
464
- }, Ss = { class: "sidebar__user-info" }, Ms = { class: "sidebar__user-name" }, Is = { class: "sidebar__user-role" }, Tt = "sidebar_opened_menus", Ls = /* @__PURE__ */ Ae({
465
- __name: "Sidebar",
466
- props: {
467
- menuList: { default: () => [] },
468
- showLogo: { type: Boolean, default: !0 },
469
- showUser: { type: Boolean, default: !0 }
470
- },
471
- setup(r) {
472
- const f = r, v = qe(), p = De(), h = ze(), k = $e(), T = Ye(), g = Pe(), I = j(() => f.menuList.length > 0 ? f.menuList : h.menuList), _ = j(() => g.isCollapsed), x = j(() => v.path), S = D(H.get(Tt) || []);
473
- We(S, (M) => {
474
- H.set(Tt, M);
475
- }, { deep: !0 });
476
- const E = (M, K, J = []) => {
477
- var oe;
478
- for (const U of M)
479
- if ((oe = U.children) != null && oe.length) {
480
- if (U.children.some((X) => K === X.menuUrl || K.startsWith(X.menuUrl + "/"))) {
481
- for (const X of J)
482
- S.value.includes(X) || S.value.push(X);
483
- S.value.includes(U.menuUrl) || S.value.push(U.menuUrl);
484
- }
485
- E(U.children, K, [...J, U.menuUrl]);
486
- }
487
- };
488
- We([() => v.path, I], ([M, K]) => {
489
- K.length > 0 && E(K, M);
490
- }, { immediate: !0 });
491
- const q = j(() => g.isDark ? "#1d1e1f" : "#fff"), Z = j(() => g.isDark ? "#cfd3dc" : "#303133"), O = j(() => "#409eff"), L = (M) => {
492
- M && M !== v.path && p.push(M);
493
- }, V = () => {
494
- T.logout(), k.clearUserInfo(), h.clearMenu(), p.push("/login");
495
- };
496
- return (M, K) => (y(), N("div", {
497
- class: ge(["sidebar", { "sidebar--collapsed": _.value }])
498
- }, [
499
- f.showLogo ? (y(), N("div", Ns, [
500
- K[2] || (K[2] = n("img", {
501
- src: Et,
502
- alt: "Logo",
503
- class: "sidebar__logo-img"
504
- }, null, -1)),
505
- at(n("span", { class: "sidebar__logo-text" }, W(b(g).appName), 513), [
506
- [Jt, !_.value]
507
- ])
508
- ])) : ie("", !0),
509
- P(b(xt), {
510
- modelValue: x.value,
511
- "onUpdate:modelValue": K[0] || (K[0] = (J) => x.value = J),
512
- openeds: S.value,
513
- "onUpdate:openeds": K[1] || (K[1] = (J) => S.value = J),
514
- mode: "vertical",
515
- collapse: _.value,
516
- "collapse-transition": !1,
517
- "background-color": q.value,
518
- "text-color": Z.value,
519
- "active-text-color": O.value,
520
- class: "sidebar__menu",
521
- onSelect: L
522
- }, {
523
- default: Y(() => [
524
- (y(!0), N(ve, null, ye(I.value, (J) => (y(), me(Es, {
525
- key: J.menuUrl,
526
- menu: J
527
- }, null, 8, ["menu"]))), 128))
528
- ]),
529
- _: 1
530
- }, 8, ["modelValue", "openeds", "collapse", "background-color", "text-color", "active-text-color"]),
531
- f.showUser && !_.value ? (y(), N("div", $s, [
532
- n("div", Ss, [
533
- n("span", Ms, W(b(k).userName), 1),
534
- n("span", Is, W(b(k).departmentName), 1)
535
- ]),
536
- P(b(je), {
537
- type: "text",
538
- size: "small",
539
- onClick: V
540
- }, {
541
- default: Y(() => [...K[3] || (K[3] = [
542
- Re("退出", -1)
543
- ])]),
544
- _: 1
545
- })
546
- ])) : ie("", !0)
547
- ], 2));
548
- }
549
- }), Ot = /* @__PURE__ */ Se(Ls, [["__scopeId", "data-v-7a84fcaa"]]), As = { class: "header" }, Ts = { class: "header__left" }, Os = {
550
- key: 0,
551
- class: "header__breadcrumb"
552
- }, Us = {
553
- key: 0,
554
- class: "breadcrumb-separator"
555
- }, Bs = { class: "header__right" }, Ds = {
556
- key: 0,
557
- class: "header__search-dropdown"
558
- }, Ps = {
559
- key: 0,
560
- class: "header__search-results"
561
- }, Rs = ["onClick"], zs = {
562
- key: 0,
563
- class: "header__search-icon"
564
- }, Fs = {
565
- key: 1,
566
- class: "header__search-char"
567
- }, Vs = { class: "header__search-item-title" }, js = {
568
- key: 1,
569
- class: "header__search-item-parent"
570
- }, qs = {
571
- key: 1,
572
- class: "header__search-empty"
573
- }, Gs = ["title"], Ks = { class: "header__avatar" }, Hs = { class: "header__user-name" }, Ws = {
574
- key: 0,
575
- class: "header__dropdown"
576
- }, Xs = { class: "header__dropdown-header" }, Ys = { class: "header__dropdown-avatar" }, Js = { class: "header__dropdown-info" }, Zs = { class: "header__dropdown-name" }, Qs = { class: "header__dropdown-role" }, en = { class: "header__dropdown-menu" }, tn = { class: "settings-drawer" }, sn = { class: "settings-section" }, nn = { class: "settings-layout-options" }, on = ["onClick"], rn = { class: "layout-option__preview" }, an = {
577
- key: 0,
578
- class: "layout-preview-sidebar"
579
- }, ln = {
580
- key: 1,
581
- class: "layout-preview-top"
582
- }, cn = {
583
- key: 2,
584
- class: "layout-preview-mix"
585
- }, un = { class: "layout-option__label" }, dn = { class: "settings-section" }, fn = { class: "settings-color-options" }, pn = ["title", "onClick"], mn = { class: "settings-section" }, hn = { class: "settings-switch-list" }, vn = { class: "settings-switch-item" }, gn = { class: "settings-switch-item" }, _n = /* @__PURE__ */ Ae({
586
- __name: "Header",
587
- setup(r) {
588
- const f = qe(), v = De(), p = Pe(), h = $e(), k = Ye(), T = ze(), g = D(!1), I = D(!1), _ = D(null), x = D(!1), S = D(!1), E = D(""), q = D(null), Z = D(!1), O = [
589
- { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
590
- { value: "top", label: "顶部菜单", icon: "menu" },
591
- { value: "mix", label: "混合菜单", icon: "grid" }
592
- ], L = [
593
- { value: "#409eff", label: "默认蓝" },
594
- { value: "#1890ff", label: "科技蓝" },
595
- { value: "#52c41a", label: "极光绿" },
596
- { value: "#faad14", label: "日落橙" },
597
- { value: "#f5222d", label: "薄暮红" },
598
- { value: "#722ed1", label: "酱紫" }
599
- ], V = j(() => f.matched.filter((B) => B.meta && B.meta.title).map((B) => ({
600
- title: B.meta.title,
601
- path: B.path
602
- }))), M = (G, B = "") => {
603
- const t = [];
604
- return G.forEach((e) => {
605
- e.children && e.children.length > 0 ? t.push(...M(e.children, e.menuName)) : t.push({ ...e, parentTitle: B, title: e.menuName, path: e.menuUrl });
606
- }), t;
607
- }, K = /* @__PURE__ */ new Set([
608
- "arrow-up",
609
- "arrow-down",
610
- "arrow-left",
611
- "arrow-right",
612
- "caret-down",
613
- "caret-right",
614
- "plus",
615
- "minus",
616
- "close",
617
- "check",
618
- "edit",
619
- "delete",
620
- "copy",
621
- "download",
622
- "upload",
623
- "refresh",
624
- "search",
625
- "filter",
626
- "more",
627
- "setting",
628
- "share",
629
- "loading",
630
- "info",
631
- "success",
632
- "warning",
633
- "error",
634
- "question",
635
- "user",
636
- "user-add",
637
- "user-group",
638
- "logout",
639
- "login",
640
- "file",
641
- "folder",
642
- "folder-open",
643
- "document",
644
- "image",
645
- "video",
646
- "music",
647
- "camera",
648
- "mail",
649
- "phone",
650
- "chat",
651
- "bell",
652
- "message",
653
- "eye",
654
- "eye-off",
655
- "calendar",
656
- "clock",
657
- "history",
658
- "timer",
659
- "location",
660
- "map",
661
- "globe",
662
- "star",
663
- "heart",
664
- "thumb-up",
665
- "link",
666
- "external-link",
667
- "lock",
668
- "unlock",
669
- "key",
670
- "home",
671
- "menu",
672
- "menu-fold",
673
- "menu-unfold",
674
- "sidebar-fold",
675
- "sidebar-expand",
676
- "sidebar-left",
677
- "dashboard",
678
- "chart",
679
- "chart-pie",
680
- "chart-line",
681
- "report",
682
- "analytics",
683
- "system",
684
- "permission",
685
- "role",
686
- "user-manage",
687
- "log",
688
- "notification",
689
- "app",
690
- "list",
691
- "grid",
692
- "fullscreen",
693
- "fullscreen-exit",
694
- "zoom-in",
695
- "zoom-out",
696
- "print",
697
- "bookmark",
698
- "tag",
699
- "code",
700
- "terminal",
701
- "database",
702
- "server",
703
- "cloud",
704
- "gift",
705
- "moon",
706
- "sun",
707
- "theme",
708
- "skin"
709
- ]), J = (G) => {
710
- if (!G || G === "") return "";
711
- if (G.startsWith("tineco-icon-")) {
712
- const t = G.replace("tineco-icon-", "");
713
- return {
714
- home: "home",
715
- dashboard: "dashboard",
716
- system: "system",
717
- user: "user",
718
- role: "role",
719
- menu: "list",
720
- setting: "setting",
721
- file: "file",
722
- folder: "folder",
723
- chart: "chart",
724
- report: "report",
725
- analytics: "analytics"
726
- }[t] || t;
727
- }
728
- return {
729
- dashboard: "dashboard",
730
- system: "system",
731
- user: "user",
732
- role: "role",
733
- menu: "list",
734
- setting: "setting",
735
- home: "home",
736
- chart: "chart",
737
- report: "report",
738
- analytics: "analytics",
739
- permission: "permission",
740
- log: "log",
741
- notification: "notification",
742
- app: "app",
743
- list: "list",
744
- grid: "grid"
745
- }[G] || G;
746
- }, oe = (G) => G ? G.charAt(0) : "", U = (G) => K.has(G), A = j(() => E.value.trim() ? M(T.menuList).filter(
747
- (B) => B.title.toLowerCase().includes(E.value.toLowerCase())
748
- ) : []), X = j(() => p.layout), se = () => {
749
- p.toggleCollapse();
750
- }, $ = () => {
751
- p.toggleTheme();
752
- }, re = () => {
753
- I.value = !0;
754
- }, ee = (G) => {
755
- p.setLayout(G), I.value = !1;
756
- }, z = (G) => {
757
- Z.value = G;
758
- const B = document.documentElement;
759
- G ? B.classList.add("grey-mode") : B.classList.remove("grey-mode");
760
- }, le = () => {
761
- z(!Z.value), I.value = !1;
762
- }, ue = () => {
763
- p.toggleTheme(), I.value = !1;
764
- }, Ce = () => {
765
- document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
766
- }, de = () => {
767
- x.value = !!document.fullscreenElement;
768
- }, be = () => {
769
- g.value = !g.value;
770
- }, ke = () => {
771
- g.value = !1;
772
- }, _e = () => {
773
- S.value = !1, E.value = "";
774
- }, Te = (G) => {
775
- v.push(G), _e();
776
- }, Ee = (G) => {
777
- p.setPrimaryColor(G), I.value = !1;
778
- }, Oe = () => {
779
- ke(), v.push("/profile");
780
- }, C = () => {
781
- ke(), v.push("/change-password");
782
- }, Ue = () => {
783
- ke(), k.logout(), h.clearUserInfo(), T.clearMenu(), v.push("/login");
784
- }, Be = (G) => {
785
- _.value && !_.value.contains(G.target) && ke(), q.value && !q.value.contains(G.target) && _e();
786
- }, Me = (G) => {
787
- G.key === "Escape" && (_e(), ke());
788
- };
789
- return gt(() => {
790
- document.addEventListener("click", Be), document.addEventListener("fullscreenchange", de), document.addEventListener("keydown", Me), p.initTheme(), Z.value = document.documentElement.classList.contains("grey-mode");
791
- }), _t(() => {
792
- document.removeEventListener("click", Be), document.removeEventListener("fullscreenchange", de), document.removeEventListener("keydown", Me);
793
- }), (G, B) => {
794
- var t;
795
- return y(), N("div", As, [
796
- n("div", Ts, [
797
- n("div", {
798
- class: "header__collapse",
799
- onClick: se
800
- }, [
801
- P(b(Q), {
802
- name: b(p).isCollapsed ? "menu-unfold" : "menu-fold",
803
- size: 18
804
- }, null, 8, ["name"])
805
- ]),
806
- b(p).showBreadcrumb ? (y(), N("div", Os, [
807
- (y(!0), N(ve, null, ye(V.value, (e, o) => (y(), N("span", {
808
- key: e.path
809
- }, [
810
- o > 0 ? (y(), N("span", Us, "/")) : ie("", !0),
811
- n("span", {
812
- class: ge({ "is-current": o === V.value.length - 1 })
813
- }, W(e.title), 3)
814
- ]))), 128))
815
- ])) : ie("", !0)
816
- ]),
817
- n("div", Bs, [
818
- n("div", {
819
- class: "header__search",
820
- ref_key: "searchRef",
821
- ref: q
822
- }, [
823
- P(b(Q), {
824
- name: "search",
825
- size: 14,
826
- class: "header__search-icon"
827
- }),
828
- at(n("input", {
829
- "onUpdate:modelValue": B[0] || (B[0] = (e) => E.value = e),
830
- type: "text",
831
- class: "header__search-input",
832
- placeholder: "搜索菜单...",
833
- onFocus: B[1] || (B[1] = (e) => S.value = !0)
834
- }, null, 544), [
835
- [wt, E.value]
836
- ]),
837
- P(Ve, { name: "search-dropdown" }, {
838
- default: Y(() => [
839
- S.value && (A.value.length > 0 || E.value) ? (y(), N("div", Ds, [
840
- A.value.length > 0 ? (y(), N("div", Ps, [
841
- (y(!0), N(ve, null, ye(A.value, (e) => (y(), N("div", {
842
- key: e.path,
843
- class: "header__search-item",
844
- onClick: (o) => Te(e.path)
845
- }, [
846
- e.title !== "首页" ? (y(), N("span", zs, [
847
- U(J(e.icon)) ? (y(), me(b(Q), {
848
- key: 0,
849
- name: J(e.icon),
850
- size: 16
851
- }, null, 8, ["name"])) : (y(), N("span", Fs, W(oe(e.title)), 1))
852
- ])) : ie("", !0),
853
- n("span", Vs, W(e.title), 1),
854
- e.parentTitle ? (y(), N("span", js, W(e.parentTitle), 1)) : ie("", !0)
855
- ], 8, Rs))), 128))
856
- ])) : (y(), N("div", qs, " 未找到匹配的菜单 "))
857
- ])) : ie("", !0)
858
- ]),
859
- _: 1
860
- })
861
- ], 512),
862
- n("div", {
863
- class: "header__action",
864
- onClick: Ce,
865
- title: x.value ? "退出全屏" : "全屏"
866
- }, [
867
- P(b(Q), {
868
- name: x.value ? "fullscreen-exit" : "fullscreen",
869
- size: 16
870
- }, null, 8, ["name"])
871
- ], 8, Gs),
872
- n("div", {
873
- class: "header__action",
874
- onClick: re,
875
- title: "换肤设置"
876
- }, [
877
- P(b(Q), {
878
- name: "skin",
879
- size: 16
880
- })
881
- ]),
882
- n("div", {
883
- class: "header__action",
884
- onClick: $,
885
- title: "切换主题"
886
- }, [
887
- P(b(Q), {
888
- name: b(p).isDark ? "sun" : "moon",
889
- size: 16
890
- }, null, 8, ["name"])
891
- ]),
892
- n("div", {
893
- class: "header__user",
894
- ref_key: "dropdownRef",
895
- ref: _
896
- }, [
897
- n("div", {
898
- class: "header__user-trigger",
899
- onClick: it(be, ["stop"])
900
- }, [
901
- n("div", Ks, [
902
- n("span", null, W(((t = b(h).userName) == null ? void 0 : t.charAt(0)) || "U"), 1)
903
- ]),
904
- n("span", Hs, W(b(h).userName), 1),
905
- n("span", {
906
- class: ge(["header__user-arrow", { "is-active": g.value }])
907
- }, "▼", 2)
908
- ]),
909
- P(Ve, { name: "dropdown" }, {
910
- default: Y(() => {
911
- var e;
912
- return [
913
- g.value ? (y(), N("div", Ws, [
914
- n("div", Xs, [
915
- n("div", Ys, [
916
- n("span", null, W(((e = b(h).userName) == null ? void 0 : e.charAt(0)) || "U"), 1)
917
- ]),
918
- n("div", Js, [
919
- n("div", Zs, W(b(h).userName), 1),
920
- n("div", Qs, W(b(h).departmentName), 1)
921
- ])
922
- ]),
923
- B[7] || (B[7] = n("div", { class: "header__dropdown-divider" }, null, -1)),
924
- n("div", en, [
925
- n("div", {
926
- class: "header__dropdown-item",
927
- onClick: Oe
928
- }, [
929
- P(b(Q), {
930
- name: "user",
931
- size: 16
932
- }),
933
- B[3] || (B[3] = n("span", null, "个人信息", -1))
934
- ]),
935
- n("div", {
936
- class: "header__dropdown-item",
937
- onClick: C
938
- }, [
939
- P(b(Q), {
940
- name: "lock",
941
- size: 16
942
- }),
943
- B[4] || (B[4] = n("span", null, "修改密码", -1))
944
- ]),
945
- B[6] || (B[6] = n("div", { class: "header__dropdown-divider" }, null, -1)),
946
- n("div", {
947
- class: "header__dropdown-item header__dropdown-item--danger",
948
- onClick: Ue
949
- }, [
950
- P(b(Q), {
951
- name: "logout",
952
- size: 16
953
- }),
954
- B[5] || (B[5] = n("span", null, "退出登录", -1))
955
- ])
956
- ])
957
- ])) : ie("", !0)
958
- ];
959
- }),
960
- _: 1
961
- })
962
- ], 512)
963
- ]),
964
- P(b(Ct), {
965
- modelValue: I.value,
966
- "onUpdate:modelValue": B[2] || (B[2] = (e) => I.value = e),
967
- title: "换肤设置",
968
- direction: "rtl",
969
- size: "320px"
970
- }, {
971
- default: Y(() => [
972
- n("div", tn, [
973
- n("div", sn, [
974
- B[11] || (B[11] = n("div", { class: "settings-title" }, "布局模式", -1)),
975
- n("div", nn, [
976
- (y(), N(ve, null, ye(O, (e) => n("div", {
977
- key: e.value,
978
- class: ge(["layout-option", { "is-active": X.value === e.value }]),
979
- onClick: (o) => ee(e.value)
980
- }, [
981
- n("div", rn, [
982
- e.value === "sidebar" ? (y(), N("div", an, [...B[8] || (B[8] = [
983
- n("div", { class: "preview-aside" }, null, -1),
984
- n("div", { class: "preview-main" }, [
985
- n("div", { class: "preview-header" }),
986
- n("div", { class: "preview-content" })
987
- ], -1)
988
- ])])) : e.value === "top" ? (y(), N("div", ln, [...B[9] || (B[9] = [
989
- n("div", { class: "preview-header-full" }, null, -1),
990
- n("div", { class: "preview-content-full" }, null, -1)
991
- ])])) : (y(), N("div", cn, [...B[10] || (B[10] = [
992
- n("div", { class: "preview-header-mix" }, [
993
- n("div", { class: "preview-mix-left" })
994
- ], -1),
995
- n("div", { class: "preview-mix-body" }, [
996
- n("div", { class: "preview-mix-aside" }),
997
- n("div", { class: "preview-mix-content" })
998
- ], -1)
999
- ])]))
1000
- ]),
1001
- n("span", un, W(e.label), 1)
1002
- ], 10, on)), 64))
1003
- ])
1004
- ]),
1005
- n("div", dn, [
1006
- B[12] || (B[12] = n("div", { class: "settings-title" }, "主题色", -1)),
1007
- n("div", fn, [
1008
- (y(), N(ve, null, ye(L, (e) => n("div", {
1009
- key: e.value,
1010
- class: ge(["color-option", { "is-active": b(p).primaryColor === e.value }]),
1011
- style: Xe({ backgroundColor: e.value }),
1012
- title: e.label,
1013
- onClick: (o) => Ee(e.value)
1014
- }, [
1015
- b(p).primaryColor === e.value ? (y(), me(b(Q), {
1016
- key: 0,
1017
- name: "check",
1018
- size: 12,
1019
- color: "#fff"
1020
- })) : ie("", !0)
1021
- ], 14, pn)), 64))
1022
- ])
1023
- ]),
1024
- n("div", mn, [
1025
- B[17] || (B[17] = n("div", { class: "settings-title" }, "功能设置", -1)),
1026
- n("div", hn, [
1027
- n("div", vn, [
1028
- B[14] || (B[14] = n("span", null, "灰色模式", -1)),
1029
- n("div", {
1030
- class: ge(["switch-wrapper", { "is-checked": Z.value }]),
1031
- onClick: le
1032
- }, [...B[13] || (B[13] = [
1033
- n("span", { class: "switch-core" }, null, -1)
1034
- ])], 2)
1035
- ]),
1036
- n("div", gn, [
1037
- B[16] || (B[16] = n("span", null, "暗黑模式", -1)),
1038
- n("div", {
1039
- class: ge(["switch-wrapper", { "is-checked": b(p).isDark }]),
1040
- onClick: ue
1041
- }, [...B[15] || (B[15] = [
1042
- n("span", { class: "switch-core" }, null, -1)
1043
- ])], 2)
1044
- ])
1045
- ])
1046
- ])
1047
- ])
1048
- ]),
1049
- _: 1
1050
- }, 8, ["modelValue"])
1051
- ]);
1052
- };
1053
- }
1054
- }), wn = /* @__PURE__ */ Se(_n, [["__scopeId", "data-v-89179947"]]), yn = { class: "top-menu" }, bn = { class: "top-menu__logo" }, kn = { class: "top-menu__logo-text" }, xn = { class: "top-menu__menu-content" }, Cn = {
1055
- key: 0,
1056
- class: "top-menu__menu-icon"
1057
- }, En = {
1058
- key: 1,
1059
- class: "top-menu__menu-char"
1060
- }, Nn = { class: "top-menu__menu-text" }, $n = { class: "top-menu__menu-content" }, Sn = { class: "top-menu__menu-icon" }, Mn = {
1061
- key: 1,
1062
- class: "top-menu__menu-char"
1063
- }, In = { class: "top-menu__menu-text" }, Ln = { class: "top-menu__menu-content" }, An = {
1064
- key: 0,
1065
- class: "top-menu__menu-icon"
1066
- }, Tn = {
1067
- key: 1,
1068
- class: "top-menu__menu-char"
1069
- }, On = { class: "top-menu__menu-text" }, Un = { class: "top-menu__actions" }, Bn = {
1070
- key: 0,
1071
- class: "top-menu__search-dropdown"
1072
- }, Dn = {
1073
- key: 0,
1074
- class: "top-menu__search-results"
1075
- }, Pn = ["onClick"], Rn = {
1076
- key: 0,
1077
- class: "top-menu__search-icon-item"
1078
- }, zn = {
1079
- key: 1,
1080
- class: "top-menu__search-char"
1081
- }, Fn = { class: "top-menu__search-item-title" }, Vn = {
1082
- key: 1,
1083
- class: "top-menu__search-item-parent"
1084
- }, jn = {
1085
- key: 1,
1086
- class: "top-menu__search-empty"
1087
- }, qn = ["title"], Gn = { class: "top-menu__avatar" }, Kn = { class: "top-menu__user-name" }, Hn = {
1088
- key: 0,
1089
- class: "top-menu__dropdown"
1090
- }, Wn = { class: "top-menu__dropdown-header" }, Xn = { class: "top-menu__dropdown-avatar" }, Yn = { class: "top-menu__dropdown-info" }, Jn = { class: "top-menu__dropdown-name" }, Zn = { class: "top-menu__dropdown-role" }, Qn = { class: "top-menu__dropdown-menu" }, eo = { class: "settings-drawer" }, to = { class: "settings-section" }, so = { class: "settings-layout-options" }, no = ["onClick"], oo = { class: "layout-option__preview" }, ro = {
1091
- key: 0,
1092
- class: "layout-preview-sidebar"
1093
- }, ao = {
1094
- key: 1,
1095
- class: "layout-preview-top"
1096
- }, io = {
1097
- key: 2,
1098
- class: "layout-preview-mix"
1099
- }, lo = { class: "layout-option__label" }, co = { class: "settings-section" }, uo = { class: "settings-color-options" }, fo = ["title", "onClick"], po = { class: "settings-section" }, mo = { class: "settings-switch-list" }, ho = { class: "settings-switch-item" }, vo = { class: "settings-switch-item" }, go = /* @__PURE__ */ Ae({
1100
- __name: "TopMenu",
1101
- setup(r) {
1102
- const f = qe(), v = De(), p = ze(), h = Pe(), k = $e(), T = Ye(), g = j(() => f.path), I = (e, o = "") => {
1103
- const c = [];
1104
- return e.forEach((s) => {
1105
- s.children && s.children.length > 0 ? c.push(...I(s.children, s.menuName)) : c.push({ ...s, parentTitle: o, title: s.menuName, path: s.menuUrl });
1106
- }), c;
1107
- }, _ = j(() => K.value.trim() ? I(p.menuList).filter(
1108
- (o) => o.title.toLowerCase().includes(K.value.toLowerCase())
1109
- ) : []), x = j(() => h.isDark ? "#1d1e1f" : "#fff"), S = j(() => h.isDark ? "#cfd3dc" : "#303133"), E = j(() => "#409eff"), q = D(!1), Z = D(null), O = D(!1), L = D(!1), V = D(!1), M = D(!1), K = D(""), J = D(null), oe = (e) => {
1110
- e && e !== f.path && v.push(e);
1111
- }, U = /* @__PURE__ */ new Set([
1112
- "arrow-up",
1113
- "arrow-down",
1114
- "arrow-left",
1115
- "arrow-right",
1116
- "caret-down",
1117
- "caret-right",
1118
- "plus",
1119
- "minus",
1120
- "close",
1121
- "check",
1122
- "edit",
1123
- "delete",
1124
- "copy",
1125
- "download",
1126
- "upload",
1127
- "refresh",
1128
- "search",
1129
- "filter",
1130
- "more",
1131
- "setting",
1132
- "share",
1133
- "loading",
1134
- "info",
1135
- "success",
1136
- "warning",
1137
- "error",
1138
- "question",
1139
- "user",
1140
- "user-add",
1141
- "user-group",
1142
- "logout",
1143
- "login",
1144
- "file",
1145
- "folder",
1146
- "folder-open",
1147
- "document",
1148
- "image",
1149
- "video",
1150
- "music",
1151
- "camera",
1152
- "mail",
1153
- "phone",
1154
- "chat",
1155
- "bell",
1156
- "message",
1157
- "eye",
1158
- "eye-off",
1159
- "calendar",
1160
- "clock",
1161
- "history",
1162
- "timer",
1163
- "location",
1164
- "map",
1165
- "globe",
1166
- "star",
1167
- "heart",
1168
- "thumb-up",
1169
- "link",
1170
- "external-link",
1171
- "lock",
1172
- "unlock",
1173
- "key",
1174
- "home",
1175
- "menu",
1176
- "menu-fold",
1177
- "menu-unfold",
1178
- "sidebar-fold",
1179
- "sidebar-expand",
1180
- "sidebar-left",
1181
- "dashboard",
1182
- "chart",
1183
- "chart-pie",
1184
- "chart-line",
1185
- "report",
1186
- "analytics",
1187
- "system",
1188
- "permission",
1189
- "role",
1190
- "user-manage",
1191
- "log",
1192
- "notification",
1193
- "app",
1194
- "list",
1195
- "grid",
1196
- "fullscreen",
1197
- "fullscreen-exit",
1198
- "zoom-in",
1199
- "zoom-out",
1200
- "print",
1201
- "bookmark",
1202
- "tag",
1203
- "code",
1204
- "terminal",
1205
- "database",
1206
- "server",
1207
- "cloud",
1208
- "gift",
1209
- "moon",
1210
- "sun",
1211
- "theme",
1212
- "skin"
1213
- ]), A = (e) => {
1214
- if (!e || e === "") return "";
1215
- if (e.startsWith("tineco-icon-")) {
1216
- const c = e.replace("tineco-icon-", "");
1217
- return {
1218
- home: "home",
1219
- dashboard: "dashboard",
1220
- system: "system",
1221
- user: "user",
1222
- role: "role",
1223
- menu: "list",
1224
- setting: "setting",
1225
- file: "file",
1226
- folder: "folder",
1227
- chart: "chart",
1228
- report: "report",
1229
- analytics: "analytics"
1230
- }[c] || c;
1231
- }
1232
- return {
1233
- dashboard: "dashboard",
1234
- system: "system",
1235
- user: "user",
1236
- role: "role",
1237
- menu: "list",
1238
- setting: "setting",
1239
- home: "home",
1240
- chart: "chart",
1241
- report: "report",
1242
- analytics: "analytics",
1243
- permission: "permission",
1244
- log: "log",
1245
- notification: "notification",
1246
- app: "app",
1247
- list: "list",
1248
- grid: "grid"
1249
- }[e] || e;
1250
- }, X = (e) => e ? e.charAt(0) : "", se = (e) => U.has(e), $ = () => {
1251
- h.toggleTheme(), L.value = !1;
1252
- }, re = () => {
1253
- document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1254
- }, ee = () => {
1255
- O.value = !!document.fullscreenElement;
1256
- }, z = () => {
1257
- q.value = !q.value;
1258
- }, le = () => {
1259
- q.value = !1;
1260
- }, ue = () => {
1261
- M.value = !1, K.value = "";
1262
- }, Ce = (e) => {
1263
- v.push(e), ue();
1264
- }, de = () => {
1265
- L.value = !0;
1266
- }, be = (e) => {
1267
- V.value = e;
1268
- const o = document.documentElement;
1269
- e ? o.classList.add("grey-mode") : o.classList.remove("grey-mode");
1270
- }, ke = () => {
1271
- be(!V.value), L.value = !1;
1272
- }, _e = () => {
1273
- h.toggleTheme(), L.value = !1;
1274
- }, Te = [
1275
- { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1276
- { value: "top", label: "顶部菜单", icon: "menu" },
1277
- { value: "mix", label: "混合菜单", icon: "grid" }
1278
- ], Ee = j(() => h.layout), Oe = (e) => {
1279
- h.setLayout(e), L.value = !1;
1280
- }, C = [
1281
- { value: "#409eff", label: "默认蓝" },
1282
- { value: "#1890ff", label: "科技蓝" },
1283
- { value: "#52c41a", label: "极光绿" },
1284
- { value: "#faad14", label: "日落橙" },
1285
- { value: "#f5222d", label: "薄暮红" },
1286
- { value: "#722ed1", label: "酱紫" }
1287
- ], Ue = (e) => {
1288
- h.setPrimaryColor(e), L.value = !1;
1289
- }, Be = () => {
1290
- le(), v.push("/profile");
1291
- }, Me = () => {
1292
- le(), v.push("/change-password");
1293
- }, G = () => {
1294
- le(), T.logout(), k.clearUserInfo(), p.clearMenu(), v.push("/login");
1295
- }, B = (e) => {
1296
- Z.value && !Z.value.contains(e.target) && le(), J.value && !J.value.contains(e.target) && ue();
1297
- }, t = (e) => {
1298
- e.key === "Escape" && (ue(), le());
1299
- };
1300
- return gt(() => {
1301
- document.addEventListener("click", B), document.addEventListener("fullscreenchange", ee), document.addEventListener("keydown", t), V.value = document.documentElement.classList.contains("grey-mode");
1302
- }), _t(() => {
1303
- document.removeEventListener("click", B), document.removeEventListener("fullscreenchange", ee), document.removeEventListener("keydown", t);
1304
- }), (e, o) => {
1305
- var c;
1306
- return y(), N("div", yn, [
1307
- n("div", bn, [
1308
- o[3] || (o[3] = n("img", {
1309
- src: Et,
1310
- alt: "Logo",
1311
- class: "top-menu__logo-img"
1312
- }, null, -1)),
1313
- n("span", kn, W(b(h).appName), 1)
1314
- ]),
1315
- P(b(xt), {
1316
- "model-value": g.value,
1317
- mode: "horizontal",
1318
- "background-color": x.value,
1319
- "text-color": S.value,
1320
- "active-text-color": E.value,
1321
- class: "top-menu__menu",
1322
- onSelect: oe
1323
- }, {
1324
- default: Y(() => [
1325
- (y(!0), N(ve, null, ye(b(p).menuList, (s) => (y(), N(ve, {
1326
- key: s.menuUrl
1327
- }, [
1328
- s.children && s.children.length > 0 ? (y(), me(b(Bt), {
1329
- key: 0,
1330
- index: s.menuUrl
1331
- }, {
1332
- title: Y(() => [
1333
- n("span", xn, [
1334
- s.menuName !== "首页" ? (y(), N("span", Cn, [
1335
- se(A(s.icon)) ? (y(), me(b(Q), {
1336
- key: 0,
1337
- name: A(s.icon),
1338
- size: 16
1339
- }, null, 8, ["name"])) : (y(), N("span", En, W(X(s.menuName)), 1))
1340
- ])) : ie("", !0),
1341
- n("span", Nn, W(s.menuName), 1)
1342
- ])
1343
- ]),
1344
- default: Y(() => [
1345
- (y(!0), N(ve, null, ye(s.children, (i) => (y(), me(b(st), {
1346
- key: i.menuUrl,
1347
- index: i.menuUrl
1348
- }, {
1349
- default: Y(() => [
1350
- n("span", $n, [
1351
- n("span", Sn, [
1352
- se(A(i.icon)) ? (y(), me(b(Q), {
1353
- key: 0,
1354
- name: A(i.icon),
1355
- size: 16
1356
- }, null, 8, ["name"])) : (y(), N("span", Mn, W(X(i.menuName)), 1))
1357
- ]),
1358
- n("span", In, W(i.menuName), 1)
1359
- ])
1360
- ]),
1361
- _: 2
1362
- }, 1032, ["index"]))), 128))
1363
- ]),
1364
- _: 2
1365
- }, 1032, ["index"])) : (y(), me(b(st), {
1366
- key: 1,
1367
- index: s.menuUrl
1368
- }, {
1369
- default: Y(() => [
1370
- n("span", Ln, [
1371
- s.menuName !== "首页" ? (y(), N("span", An, [
1372
- se(A(s.icon)) ? (y(), me(b(Q), {
1373
- key: 0,
1374
- name: A(s.icon),
1375
- size: 16
1376
- }, null, 8, ["name"])) : (y(), N("span", Tn, W(X(s.menuName)), 1))
1377
- ])) : ie("", !0),
1378
- n("span", On, W(s.menuName), 1)
1379
- ])
1380
- ]),
1381
- _: 2
1382
- }, 1032, ["index"]))
1383
- ], 64))), 128))
1384
- ]),
1385
- _: 1
1386
- }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1387
- n("div", Un, [
1388
- n("div", {
1389
- class: "top-menu__search",
1390
- ref_key: "searchRef",
1391
- ref: J
1392
- }, [
1393
- P(b(Q), {
1394
- name: "search",
1395
- size: 14,
1396
- class: "top-menu__search-icon"
1397
- }),
1398
- at(n("input", {
1399
- "onUpdate:modelValue": o[0] || (o[0] = (s) => K.value = s),
1400
- type: "text",
1401
- class: "top-menu__search-input",
1402
- placeholder: "搜索菜单...",
1403
- onFocus: o[1] || (o[1] = (s) => M.value = !0)
1404
- }, null, 544), [
1405
- [wt, K.value]
1406
- ]),
1407
- P(Ve, { name: "search-dropdown" }, {
1408
- default: Y(() => [
1409
- M.value && (_.value.length > 0 || K.value) ? (y(), N("div", Bn, [
1410
- _.value.length > 0 ? (y(), N("div", Dn, [
1411
- (y(!0), N(ve, null, ye(_.value, (s) => (y(), N("div", {
1412
- key: s.path,
1413
- class: "top-menu__search-item",
1414
- onClick: (i) => Ce(s.path)
1415
- }, [
1416
- s.title !== "首页" ? (y(), N("span", Rn, [
1417
- se(A(s.icon)) ? (y(), me(b(Q), {
1418
- key: 0,
1419
- name: A(s.icon),
1420
- size: 16
1421
- }, null, 8, ["name"])) : (y(), N("span", zn, W(X(s.title)), 1))
1422
- ])) : ie("", !0),
1423
- n("span", Fn, W(s.title), 1),
1424
- s.parentTitle ? (y(), N("span", Vn, W(s.parentTitle), 1)) : ie("", !0)
1425
- ], 8, Pn))), 128))
1426
- ])) : (y(), N("div", jn, " 未找到匹配的菜单 "))
1427
- ])) : ie("", !0)
1428
- ]),
1429
- _: 1
1430
- })
1431
- ], 512),
1432
- n("div", {
1433
- class: "top-menu__action",
1434
- onClick: re,
1435
- title: O.value ? "退出全屏" : "全屏"
1436
- }, [
1437
- P(b(Q), {
1438
- name: O.value ? "fullscreen-exit" : "fullscreen",
1439
- size: 16
1440
- }, null, 8, ["name"])
1441
- ], 8, qn),
1442
- n("div", {
1443
- class: "top-menu__action",
1444
- onClick: de,
1445
- title: "换肤设置"
1446
- }, [
1447
- P(b(Q), {
1448
- name: "skin",
1449
- size: 16
1450
- })
1451
- ]),
1452
- n("div", {
1453
- class: "top-menu__action",
1454
- onClick: $,
1455
- title: "切换主题"
1456
- }, [
1457
- P(b(Q), {
1458
- name: b(h).isDark ? "sun" : "moon",
1459
- size: 16
1460
- }, null, 8, ["name"])
1461
- ]),
1462
- n("div", {
1463
- class: "top-menu__user",
1464
- ref_key: "dropdownRef",
1465
- ref: Z
1466
- }, [
1467
- n("div", {
1468
- class: "top-menu__user-trigger",
1469
- onClick: it(z, ["stop"])
1470
- }, [
1471
- n("div", Gn, [
1472
- n("span", null, W(((c = b(k).userName) == null ? void 0 : c.charAt(0)) || "U"), 1)
1473
- ]),
1474
- n("span", Kn, W(b(k).userName), 1),
1475
- n("span", {
1476
- class: ge(["top-menu__user-arrow", { "is-active": q.value }])
1477
- }, "▼", 2)
1478
- ]),
1479
- P(Ve, { name: "dropdown" }, {
1480
- default: Y(() => {
1481
- var s;
1482
- return [
1483
- q.value ? (y(), N("div", Hn, [
1484
- n("div", Wn, [
1485
- n("div", Xn, [
1486
- n("span", null, W(((s = b(k).userName) == null ? void 0 : s.charAt(0)) || "U"), 1)
1487
- ]),
1488
- n("div", Yn, [
1489
- n("div", Jn, W(b(k).userName), 1),
1490
- n("div", Zn, W(b(k).departmentName), 1)
1491
- ])
1492
- ]),
1493
- o[8] || (o[8] = n("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1494
- n("div", Qn, [
1495
- n("div", {
1496
- class: "top-menu__dropdown-item",
1497
- onClick: Be
1498
- }, [
1499
- P(b(Q), {
1500
- name: "user",
1501
- size: 16
1502
- }),
1503
- o[4] || (o[4] = n("span", null, "个人信息", -1))
1504
- ]),
1505
- n("div", {
1506
- class: "top-menu__dropdown-item",
1507
- onClick: Me
1508
- }, [
1509
- P(b(Q), {
1510
- name: "lock",
1511
- size: 16
1512
- }),
1513
- o[5] || (o[5] = n("span", null, "修改密码", -1))
1514
- ]),
1515
- o[7] || (o[7] = n("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1516
- n("div", {
1517
- class: "top-menu__dropdown-item top-menu__dropdown-item--danger",
1518
- onClick: G
1519
- }, [
1520
- P(b(Q), {
1521
- name: "logout",
1522
- size: 16
1523
- }),
1524
- o[6] || (o[6] = n("span", null, "退出登录", -1))
1525
- ])
1526
- ])
1527
- ])) : ie("", !0)
1528
- ];
1529
- }),
1530
- _: 1
1531
- })
1532
- ], 512)
1533
- ]),
1534
- P(b(Ct), {
1535
- modelValue: L.value,
1536
- "onUpdate:modelValue": o[2] || (o[2] = (s) => L.value = s),
1537
- title: "换肤设置",
1538
- direction: "rtl",
1539
- size: "320px"
1540
- }, {
1541
- default: Y(() => [
1542
- n("div", eo, [
1543
- n("div", to, [
1544
- o[12] || (o[12] = n("div", { class: "settings-title" }, "布局模式", -1)),
1545
- n("div", so, [
1546
- (y(), N(ve, null, ye(Te, (s) => n("div", {
1547
- key: s.value,
1548
- class: ge(["layout-option", { "is-active": Ee.value === s.value }]),
1549
- onClick: (i) => Oe(s.value)
1550
- }, [
1551
- n("div", oo, [
1552
- s.value === "sidebar" ? (y(), N("div", ro, [...o[9] || (o[9] = [
1553
- n("div", { class: "preview-aside" }, null, -1),
1554
- n("div", { class: "preview-main" }, [
1555
- n("div", { class: "preview-header" }),
1556
- n("div", { class: "preview-content" })
1557
- ], -1)
1558
- ])])) : s.value === "top" ? (y(), N("div", ao, [...o[10] || (o[10] = [
1559
- n("div", { class: "preview-header-full" }, null, -1),
1560
- n("div", { class: "preview-content-full" }, null, -1)
1561
- ])])) : (y(), N("div", io, [...o[11] || (o[11] = [
1562
- n("div", { class: "preview-header-mix" }, [
1563
- n("div", { class: "preview-mix-left" })
1564
- ], -1),
1565
- n("div", { class: "preview-mix-body" }, [
1566
- n("div", { class: "preview-mix-aside" }),
1567
- n("div", { class: "preview-mix-content" })
1568
- ], -1)
1569
- ])]))
1570
- ]),
1571
- n("span", lo, W(s.label), 1)
1572
- ], 10, no)), 64))
1573
- ])
1574
- ]),
1575
- n("div", co, [
1576
- o[13] || (o[13] = n("div", { class: "settings-title" }, "主题色", -1)),
1577
- n("div", uo, [
1578
- (y(), N(ve, null, ye(C, (s) => n("div", {
1579
- key: s.value,
1580
- class: ge(["color-option", { "is-active": b(h).primaryColor === s.value }]),
1581
- style: Xe({ backgroundColor: s.value }),
1582
- title: s.label,
1583
- onClick: (i) => Ue(s.value)
1584
- }, [
1585
- b(h).primaryColor === s.value ? (y(), me(b(Q), {
1586
- key: 0,
1587
- name: "check",
1588
- size: 12,
1589
- color: "#fff"
1590
- })) : ie("", !0)
1591
- ], 14, fo)), 64))
1592
- ])
1593
- ]),
1594
- n("div", po, [
1595
- o[18] || (o[18] = n("div", { class: "settings-title" }, "功能设置", -1)),
1596
- n("div", mo, [
1597
- n("div", ho, [
1598
- o[15] || (o[15] = n("span", null, "灰色模式", -1)),
1599
- n("div", {
1600
- class: ge(["switch-wrapper", { "is-checked": V.value }]),
1601
- onClick: ke
1602
- }, [...o[14] || (o[14] = [
1603
- n("span", { class: "switch-core" }, null, -1)
1604
- ])], 2)
1605
- ]),
1606
- n("div", vo, [
1607
- o[17] || (o[17] = n("span", null, "暗黑模式", -1)),
1608
- n("div", {
1609
- class: ge(["switch-wrapper", { "is-checked": b(h).isDark }]),
1610
- onClick: _e
1611
- }, [...o[16] || (o[16] = [
1612
- n("span", { class: "switch-core" }, null, -1)
1613
- ])], 2)
1614
- ])
1615
- ])
1616
- ])
1617
- ])
1618
- ]),
1619
- _: 1
1620
- }, 8, ["modelValue"])
1621
- ]);
1622
- };
1623
- }
1624
- }), _o = /* @__PURE__ */ Se(go, [["__scopeId", "data-v-ff5f8764"]]), wo = { class: "mix-top-menu" }, yo = { class: "mix-top-menu__logo" }, bo = { class: "mix-top-menu__logo-text" }, ko = { class: "mix-top-menu__menu-content" }, xo = {
1625
- key: 0,
1626
- class: "mix-top-menu__menu-icon"
1627
- }, Co = {
1628
- key: 1,
1629
- class: "mix-top-menu__menu-char"
1630
- }, Eo = { class: "mix-top-menu__menu-text" }, No = { class: "mix-top-menu__actions" }, $o = {
1631
- key: 0,
1632
- class: "mix-top-menu__search-dropdown"
1633
- }, So = {
1634
- key: 0,
1635
- class: "mix-top-menu__search-results"
1636
- }, Mo = ["onClick"], Io = {
1637
- key: 0,
1638
- class: "mix-top-menu__search-icon-item"
1639
- }, Lo = {
1640
- key: 1,
1641
- class: "mix-top-menu__search-char"
1642
- }, Ao = { class: "mix-top-menu__search-item-title" }, To = {
1643
- key: 1,
1644
- class: "mix-top-menu__search-item-parent"
1645
- }, Oo = {
1646
- key: 1,
1647
- class: "mix-top-menu__search-empty"
1648
- }, Uo = ["title"], Bo = { class: "mix-top-menu__avatar" }, Do = { class: "mix-top-menu__user-name" }, Po = {
1649
- key: 0,
1650
- class: "mix-top-menu__dropdown"
1651
- }, Ro = { class: "mix-top-menu__dropdown-header" }, zo = { class: "mix-top-menu__dropdown-avatar" }, Fo = { class: "mix-top-menu__dropdown-info" }, Vo = { class: "mix-top-menu__dropdown-name" }, jo = { class: "mix-top-menu__dropdown-role" }, qo = { class: "mix-top-menu__dropdown-menu" }, Go = { class: "settings-drawer" }, Ko = { class: "settings-section" }, Ho = { class: "settings-layout-options" }, Wo = ["onClick"], Xo = { class: "layout-option__preview" }, Yo = {
1652
- key: 0,
1653
- class: "layout-preview-sidebar"
1654
- }, Jo = {
1655
- key: 1,
1656
- class: "layout-preview-top"
1657
- }, Zo = {
1658
- key: 2,
1659
- class: "layout-preview-mix"
1660
- }, Qo = { class: "layout-option__label" }, er = { class: "settings-section" }, tr = { class: "settings-color-options" }, sr = ["title", "onClick"], nr = { class: "settings-section" }, or = { class: "settings-switch-list" }, rr = { class: "settings-switch-item" }, ar = { class: "settings-switch-item" }, ir = /* @__PURE__ */ Ae({
1661
- __name: "MixTopMenu",
1662
- setup(r) {
1663
- const f = qe(), v = De(), p = ze(), h = Pe(), k = $e(), T = Ye(), g = D(""), I = (s, i = "") => {
1664
- const u = [];
1665
- return s.forEach((a) => {
1666
- a.children && a.children.length > 0 ? u.push(...I(a.children, a.menuName)) : u.push({ ...a, parentTitle: i, title: a.menuName, path: a.menuUrl });
1667
- }), u;
1668
- }, _ = j(() => A.value.trim() ? I(p.menuList).filter(
1669
- (i) => i.title.toLowerCase().includes(A.value.toLowerCase())
1670
- ) : []), x = j(() => {
1671
- const s = p.menuList.find((i) => i.menuUrl === g.value);
1672
- return (s == null ? void 0 : s.children) || [];
1673
- }), S = j(() => p.menuList.find((s) => !!(f.path === s.menuUrl || s.children && s.children.some((i) => f.path.startsWith(i.menuUrl) || f.path === i.menuUrl)))), E = () => {
1674
- S.value ? g.value = S.value.menuUrl : p.menuList.length > 0 && (g.value = p.menuList[0].menuUrl);
1675
- }, q = (s) => {
1676
- g.value = s;
1677
- const i = p.menuList.find((u) => u.menuUrl === s);
1678
- if (i)
1679
- if (i.children && i.children.length > 0) {
1680
- const u = i.children[0].menuUrl;
1681
- f.path !== u && v.push(u);
1682
- } else
1683
- f.path !== s && v.push(s);
1684
- }, Z = j(() => h.isDark ? "#1d1e1f" : "#fff"), O = j(() => h.isDark ? "#cfd3dc" : "#303133"), L = j(() => "#409eff"), V = D(!1), M = D(null), K = D(!1), J = D(!1), oe = D(!1), U = D(!1), A = D(""), X = D(null);
1685
- We(() => f.path, () => {
1686
- E(), h.setMixSubMenus(x.value);
1687
- }), We(() => p.menuList, (s) => {
1688
- s && s.length > 0 && (E(), h.setMixSubMenus(x.value));
1689
- }, { immediate: !0 });
1690
- const se = /* @__PURE__ */ new Set([
1691
- "arrow-up",
1692
- "arrow-down",
1693
- "arrow-left",
1694
- "arrow-right",
1695
- "caret-down",
1696
- "caret-right",
1697
- "plus",
1698
- "minus",
1699
- "close",
1700
- "check",
1701
- "edit",
1702
- "delete",
1703
- "copy",
1704
- "download",
1705
- "upload",
1706
- "refresh",
1707
- "search",
1708
- "filter",
1709
- "more",
1710
- "setting",
1711
- "share",
1712
- "loading",
1713
- "info",
1714
- "success",
1715
- "warning",
1716
- "error",
1717
- "question",
1718
- "user",
1719
- "user-add",
1720
- "user-group",
1721
- "logout",
1722
- "login",
1723
- "file",
1724
- "folder",
1725
- "folder-open",
1726
- "document",
1727
- "image",
1728
- "video",
1729
- "music",
1730
- "camera",
1731
- "mail",
1732
- "phone",
1733
- "chat",
1734
- "bell",
1735
- "message",
1736
- "eye",
1737
- "eye-off",
1738
- "calendar",
1739
- "clock",
1740
- "history",
1741
- "timer",
1742
- "location",
1743
- "map",
1744
- "globe",
1745
- "star",
1746
- "heart",
1747
- "thumb-up",
1748
- "link",
1749
- "external-link",
1750
- "lock",
1751
- "unlock",
1752
- "key",
1753
- "home",
1754
- "menu",
1755
- "menu-fold",
1756
- "menu-unfold",
1757
- "sidebar-fold",
1758
- "sidebar-expand",
1759
- "sidebar-left",
1760
- "dashboard",
1761
- "chart",
1762
- "chart-pie",
1763
- "chart-line",
1764
- "report",
1765
- "analytics",
1766
- "system",
1767
- "permission",
1768
- "role",
1769
- "user-manage",
1770
- "log",
1771
- "notification",
1772
- "app",
1773
- "list",
1774
- "grid",
1775
- "fullscreen",
1776
- "fullscreen-exit",
1777
- "zoom-in",
1778
- "zoom-out",
1779
- "print",
1780
- "bookmark",
1781
- "tag",
1782
- "code",
1783
- "terminal",
1784
- "database",
1785
- "server",
1786
- "cloud",
1787
- "gift",
1788
- "moon",
1789
- "sun",
1790
- "theme",
1791
- "skin"
1792
- ]), $ = (s) => {
1793
- if (!s || s === "") return "";
1794
- if (s.startsWith("tineco-icon-")) {
1795
- const u = s.replace("tineco-icon-", "");
1796
- return {
1797
- home: "home",
1798
- dashboard: "dashboard",
1799
- system: "system",
1800
- user: "user",
1801
- role: "role",
1802
- menu: "list",
1803
- setting: "setting",
1804
- file: "file",
1805
- folder: "folder",
1806
- chart: "chart",
1807
- report: "report",
1808
- analytics: "analytics"
1809
- }[u] || u;
1810
- }
1811
- return {
1812
- dashboard: "dashboard",
1813
- system: "system",
1814
- user: "user",
1815
- role: "role",
1816
- menu: "list",
1817
- setting: "setting",
1818
- home: "home",
1819
- chart: "chart",
1820
- report: "report",
1821
- analytics: "analytics",
1822
- permission: "permission",
1823
- log: "log",
1824
- notification: "notification",
1825
- app: "app",
1826
- list: "list",
1827
- grid: "grid"
1828
- }[s] || s;
1829
- }, re = (s) => s ? s.charAt(0) : "", ee = (s) => se.has(s), z = () => {
1830
- h.toggleTheme(), J.value = !1;
1831
- }, le = () => {
1832
- document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1833
- }, ue = () => {
1834
- K.value = !!document.fullscreenElement;
1835
- }, Ce = () => {
1836
- V.value = !V.value;
1837
- }, de = () => {
1838
- V.value = !1;
1839
- }, be = () => {
1840
- U.value = !1, A.value = "";
1841
- }, ke = (s) => {
1842
- v.push(s), be();
1843
- }, _e = () => {
1844
- J.value = !0;
1845
- }, Te = (s) => {
1846
- oe.value = s;
1847
- const i = document.documentElement;
1848
- s ? i.classList.add("grey-mode") : i.classList.remove("grey-mode");
1849
- }, Ee = () => {
1850
- Te(!oe.value), J.value = !1;
1851
- }, Oe = () => {
1852
- h.toggleTheme(), J.value = !1;
1853
- }, C = [
1854
- { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1855
- { value: "top", label: "顶部菜单", icon: "menu" },
1856
- { value: "mix", label: "混合菜单", icon: "grid" }
1857
- ], Ue = j(() => h.layout), Be = (s) => {
1858
- h.setLayout(s), J.value = !1;
1859
- }, Me = [
1860
- { value: "#409eff", label: "默认蓝" },
1861
- { value: "#1890ff", label: "科技蓝" },
1862
- { value: "#52c41a", label: "极光绿" },
1863
- { value: "#faad14", label: "日落橙" },
1864
- { value: "#f5222d", label: "薄暮红" },
1865
- { value: "#722ed1", label: "酱紫" }
1866
- ], G = (s) => {
1867
- h.setPrimaryColor(s), J.value = !1;
1868
- }, B = () => {
1869
- de(), v.push("/profile");
1870
- }, t = () => {
1871
- de(), v.push("/change-password");
1872
- }, e = () => {
1873
- de(), T.logout(), k.clearUserInfo(), p.clearMenu(), v.push("/login");
1874
- }, o = (s) => {
1875
- M.value && !M.value.contains(s.target) && de(), X.value && !X.value.contains(s.target) && be();
1876
- }, c = (s) => {
1877
- s.key === "Escape" && (be(), de());
1878
- };
1879
- return gt(() => {
1880
- document.addEventListener("click", o), document.addEventListener("fullscreenchange", ue), document.addEventListener("keydown", c), oe.value = document.documentElement.classList.contains("grey-mode"), E();
1881
- }), _t(() => {
1882
- document.removeEventListener("click", o), document.removeEventListener("fullscreenchange", ue), document.removeEventListener("keydown", c);
1883
- }), (s, i) => {
1884
- var u;
1885
- return y(), N("div", wo, [
1886
- n("div", yo, [
1887
- i[3] || (i[3] = n("img", {
1888
- src: Et,
1889
- alt: "Logo",
1890
- class: "mix-top-menu__logo-img"
1891
- }, null, -1)),
1892
- n("span", bo, W(b(h).appName), 1)
1893
- ]),
1894
- P(b(xt), {
1895
- "model-value": g.value,
1896
- mode: "horizontal",
1897
- "background-color": Z.value,
1898
- "text-color": O.value,
1899
- "active-text-color": L.value,
1900
- class: "mix-top-menu__menu",
1901
- onSelect: q
1902
- }, {
1903
- default: Y(() => [
1904
- (y(!0), N(ve, null, ye(b(p).menuList, (a) => (y(), me(b(st), {
1905
- key: a.menuUrl,
1906
- index: a.menuUrl
1907
- }, {
1908
- default: Y(() => [
1909
- n("span", ko, [
1910
- a.menuName !== "首页" ? (y(), N("span", xo, [
1911
- ee($(a.icon)) ? (y(), me(b(Q), {
1912
- key: 0,
1913
- name: $(a.icon),
1914
- size: 16
1915
- }, null, 8, ["name"])) : (y(), N("span", Co, W(re(a.menuName)), 1))
1916
- ])) : ie("", !0),
1917
- n("span", Eo, W(a.menuName), 1)
1918
- ])
1919
- ]),
1920
- _: 2
1921
- }, 1032, ["index"]))), 128))
1922
- ]),
1923
- _: 1
1924
- }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1925
- n("div", No, [
1926
- n("div", {
1927
- class: "mix-top-menu__search",
1928
- ref_key: "searchRef",
1929
- ref: X
1930
- }, [
1931
- P(b(Q), {
1932
- name: "search",
1933
- size: 14,
1934
- class: "mix-top-menu__search-icon"
1935
- }),
1936
- at(n("input", {
1937
- "onUpdate:modelValue": i[0] || (i[0] = (a) => A.value = a),
1938
- type: "text",
1939
- class: "mix-top-menu__search-input",
1940
- placeholder: "搜索菜单...",
1941
- onFocus: i[1] || (i[1] = (a) => U.value = !0)
1942
- }, null, 544), [
1943
- [wt, A.value]
1944
- ]),
1945
- P(Ve, { name: "search-dropdown" }, {
1946
- default: Y(() => [
1947
- U.value && (_.value.length > 0 || A.value) ? (y(), N("div", $o, [
1948
- _.value.length > 0 ? (y(), N("div", So, [
1949
- (y(!0), N(ve, null, ye(_.value, (a) => (y(), N("div", {
1950
- key: a.path,
1951
- class: "mix-top-menu__search-item",
1952
- onClick: (l) => ke(a.path)
1953
- }, [
1954
- a.title !== "首页" ? (y(), N("span", Io, [
1955
- ee($(a.icon)) ? (y(), me(b(Q), {
1956
- key: 0,
1957
- name: $(a.icon),
1958
- size: 16
1959
- }, null, 8, ["name"])) : (y(), N("span", Lo, W(re(a.title)), 1))
1960
- ])) : ie("", !0),
1961
- n("span", Ao, W(a.title), 1),
1962
- a.parentTitle ? (y(), N("span", To, W(a.parentTitle), 1)) : ie("", !0)
1963
- ], 8, Mo))), 128))
1964
- ])) : (y(), N("div", Oo, " 未找到匹配的菜单 "))
1965
- ])) : ie("", !0)
1966
- ]),
1967
- _: 1
1968
- })
1969
- ], 512),
1970
- n("div", {
1971
- class: "mix-top-menu__action",
1972
- onClick: le,
1973
- title: K.value ? "退出全屏" : "全屏"
1974
- }, [
1975
- P(b(Q), {
1976
- name: K.value ? "fullscreen-exit" : "fullscreen",
1977
- size: 16
1978
- }, null, 8, ["name"])
1979
- ], 8, Uo),
1980
- n("div", {
1981
- class: "mix-top-menu__action",
1982
- onClick: _e,
1983
- title: "换肤设置"
1984
- }, [
1985
- P(b(Q), {
1986
- name: "skin",
1987
- size: 16
1988
- })
1989
- ]),
1990
- n("div", {
1991
- class: "mix-top-menu__action",
1992
- onClick: z,
1993
- title: "切换主题"
1994
- }, [
1995
- P(b(Q), {
1996
- name: b(h).isDark ? "sun" : "moon",
1997
- size: 16
1998
- }, null, 8, ["name"])
1999
- ]),
2000
- n("div", {
2001
- class: "mix-top-menu__user",
2002
- ref_key: "dropdownRef",
2003
- ref: M
2004
- }, [
2005
- n("div", {
2006
- class: "mix-top-menu__user-trigger",
2007
- onClick: it(Ce, ["stop"])
2008
- }, [
2009
- n("div", Bo, [
2010
- n("span", null, W(((u = b(k).userName) == null ? void 0 : u.charAt(0)) || "U"), 1)
2011
- ]),
2012
- n("span", Do, W(b(k).userName), 1),
2013
- n("span", {
2014
- class: ge(["mix-top-menu__user-arrow", { "is-active": V.value }])
2015
- }, "▼", 2)
2016
- ]),
2017
- P(Ve, { name: "dropdown" }, {
2018
- default: Y(() => {
2019
- var a;
2020
- return [
2021
- V.value ? (y(), N("div", Po, [
2022
- n("div", Ro, [
2023
- n("div", zo, [
2024
- n("span", null, W(((a = b(k).userName) == null ? void 0 : a.charAt(0)) || "U"), 1)
2025
- ]),
2026
- n("div", Fo, [
2027
- n("div", Vo, W(b(k).userName), 1),
2028
- n("div", jo, W(b(k).departmentName), 1)
2029
- ])
2030
- ]),
2031
- i[8] || (i[8] = n("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2032
- n("div", qo, [
2033
- n("div", {
2034
- class: "mix-top-menu__dropdown-item",
2035
- onClick: B
2036
- }, [
2037
- P(b(Q), {
2038
- name: "user",
2039
- size: 16
2040
- }),
2041
- i[4] || (i[4] = n("span", null, "个人信息", -1))
2042
- ]),
2043
- n("div", {
2044
- class: "mix-top-menu__dropdown-item",
2045
- onClick: t
2046
- }, [
2047
- P(b(Q), {
2048
- name: "lock",
2049
- size: 16
2050
- }),
2051
- i[5] || (i[5] = n("span", null, "修改密码", -1))
2052
- ]),
2053
- i[7] || (i[7] = n("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2054
- n("div", {
2055
- class: "mix-top-menu__dropdown-item mix-top-menu__dropdown-item--danger",
2056
- onClick: e
2057
- }, [
2058
- P(b(Q), {
2059
- name: "logout",
2060
- size: 16
2061
- }),
2062
- i[6] || (i[6] = n("span", null, "退出登录", -1))
2063
- ])
2064
- ])
2065
- ])) : ie("", !0)
2066
- ];
2067
- }),
2068
- _: 1
2069
- })
2070
- ], 512)
2071
- ]),
2072
- P(b(Ct), {
2073
- modelValue: J.value,
2074
- "onUpdate:modelValue": i[2] || (i[2] = (a) => J.value = a),
2075
- title: "换肤设置",
2076
- direction: "rtl",
2077
- size: "320px"
2078
- }, {
2079
- default: Y(() => [
2080
- n("div", Go, [
2081
- n("div", Ko, [
2082
- i[12] || (i[12] = n("div", { class: "settings-title" }, "布局模式", -1)),
2083
- n("div", Ho, [
2084
- (y(), N(ve, null, ye(C, (a) => n("div", {
2085
- key: a.value,
2086
- class: ge(["layout-option", { "is-active": Ue.value === a.value }]),
2087
- onClick: (l) => Be(a.value)
2088
- }, [
2089
- n("div", Xo, [
2090
- a.value === "sidebar" ? (y(), N("div", Yo, [...i[9] || (i[9] = [
2091
- n("div", { class: "preview-aside" }, null, -1),
2092
- n("div", { class: "preview-main" }, [
2093
- n("div", { class: "preview-header" }),
2094
- n("div", { class: "preview-content" })
2095
- ], -1)
2096
- ])])) : a.value === "top" ? (y(), N("div", Jo, [...i[10] || (i[10] = [
2097
- n("div", { class: "preview-header-full" }, null, -1),
2098
- n("div", { class: "preview-content-full" }, null, -1)
2099
- ])])) : (y(), N("div", Zo, [...i[11] || (i[11] = [
2100
- n("div", { class: "preview-header-mix" }, [
2101
- n("div", { class: "preview-mix-left" })
2102
- ], -1),
2103
- n("div", { class: "preview-mix-body" }, [
2104
- n("div", { class: "preview-mix-aside" }),
2105
- n("div", { class: "preview-mix-content" })
2106
- ], -1)
2107
- ])]))
2108
- ]),
2109
- n("span", Qo, W(a.label), 1)
2110
- ], 10, Wo)), 64))
2111
- ])
2112
- ]),
2113
- n("div", er, [
2114
- i[13] || (i[13] = n("div", { class: "settings-title" }, "主题色", -1)),
2115
- n("div", tr, [
2116
- (y(), N(ve, null, ye(Me, (a) => n("div", {
2117
- key: a.value,
2118
- class: ge(["color-option", { "is-active": b(h).primaryColor === a.value }]),
2119
- style: Xe({ backgroundColor: a.value }),
2120
- title: a.label,
2121
- onClick: (l) => G(a.value)
2122
- }, [
2123
- b(h).primaryColor === a.value ? (y(), me(b(Q), {
2124
- key: 0,
2125
- name: "check",
2126
- size: 12,
2127
- color: "#fff"
2128
- })) : ie("", !0)
2129
- ], 14, sr)), 64))
2130
- ])
2131
- ]),
2132
- n("div", nr, [
2133
- i[18] || (i[18] = n("div", { class: "settings-title" }, "功能设置", -1)),
2134
- n("div", or, [
2135
- n("div", rr, [
2136
- i[15] || (i[15] = n("span", null, "灰色模式", -1)),
2137
- n("div", {
2138
- class: ge(["switch-wrapper", { "is-checked": oe.value }]),
2139
- onClick: Ee
2140
- }, [...i[14] || (i[14] = [
2141
- n("span", { class: "switch-core" }, null, -1)
2142
- ])], 2)
2143
- ]),
2144
- n("div", ar, [
2145
- i[17] || (i[17] = n("span", null, "暗黑模式", -1)),
2146
- n("div", {
2147
- class: ge(["switch-wrapper", { "is-checked": b(h).isDark }]),
2148
- onClick: Oe
2149
- }, [...i[16] || (i[16] = [
2150
- n("span", { class: "switch-core" }, null, -1)
2151
- ])], 2)
2152
- ])
2153
- ])
2154
- ])
2155
- ])
2156
- ]),
2157
- _: 1
2158
- }, 8, ["modelValue"])
2159
- ]);
2160
- };
2161
- }
2162
- }), lr = /* @__PURE__ */ Se(ir, [["__scopeId", "data-v-25806305"]]), cr = {
2163
- key: 0,
2164
- class: "layout layout--sidebar"
2165
- }, ur = { class: "layout__main" }, dr = { class: "layout__header" }, fr = { class: "layout__content" }, pr = {
2166
- key: 1,
2167
- class: "layout layout--top"
2168
- }, mr = { class: "layout__top-menu" }, hr = { class: "layout__main" }, vr = { class: "layout__content" }, gr = {
2169
- key: 2,
2170
- class: "layout layout--mix"
2171
- }, _r = { class: "layout__mix-top-menu" }, wr = { class: "layout__mix-body" }, yr = { class: "layout__content" }, br = /* @__PURE__ */ Ae({
2172
- __name: "index",
2173
- setup(r) {
2174
- const f = Pe(), v = ze(), p = j(
2175
- () => f.isCollapsed ? "64px" : "210px"
2176
- ), h = j(() => f.layout), k = j(() => h.value === "mix"), T = j(() => h.value === "sidebar" ? v.menuList : h.value === "mix" ? f.mixSubMenus : []), g = j(() => k.value ? T.value.length > 0 : !1);
2177
- return (I, _) => {
2178
- const x = Ut("router-view");
2179
- return y(), N(ve, null, [
2180
- h.value === "sidebar" ? (y(), N("div", cr, [
2181
- n("aside", {
2182
- class: "layout__aside",
2183
- style: Xe({ width: p.value })
2184
- }, [
2185
- P(Ot, {
2186
- "menu-list": T.value,
2187
- "show-logo": !0,
2188
- "show-user": !0
2189
- }, null, 8, ["menu-list"])
2190
- ], 4),
2191
- n("div", ur, [
2192
- n("header", dr, [
2193
- P(wn)
2194
- ]),
2195
- n("main", fr, [
2196
- P(x)
2197
- ])
2198
- ])
2199
- ])) : ie("", !0),
2200
- h.value === "top" ? (y(), N("div", pr, [
2201
- n("div", mr, [
2202
- P(_o)
2203
- ]),
2204
- n("div", hr, [
2205
- n("main", vr, [
2206
- P(x)
2207
- ])
2208
- ])
2209
- ])) : ie("", !0),
2210
- h.value === "mix" ? (y(), N("div", gr, [
2211
- n("div", _r, [
2212
- P(lr)
2213
- ]),
2214
- n("div", wr, [
2215
- g.value ? (y(), N("aside", {
2216
- key: 0,
2217
- class: "layout__aside",
2218
- style: Xe({ width: p.value })
2219
- }, [
2220
- P(Ot, {
2221
- "menu-list": T.value,
2222
- "show-logo": !1,
2223
- "show-user": !1
2224
- }, null, 8, ["menu-list"])
2225
- ], 4)) : ie("", !0),
2226
- n("main", yr, [
2227
- P(x)
2228
- ])
2229
- ])
2230
- ])) : ie("", !0)
2231
- ], 64);
2232
- };
2233
- }
2234
- }), Ft = /* @__PURE__ */ Se(br, [["__scopeId", "data-v-fb6a0b14"]]), kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2235
- __proto__: null,
2236
- default: Ft
2237
- }, Symbol.toStringTag, { value: "Module" })), xr = { class: "tabs-wrapper" }, Cr = { class: "tab-label" }, Er = ["onClick"], Nr = /* @__PURE__ */ Ae({
2238
- __name: "Tabs",
2239
- setup(r) {
2240
- const f = qe(), v = De(), p = j(() => {
2241
- const g = [];
2242
- return f.matched.forEach((I) => {
2243
- var _;
2244
- (_ = I.meta) != null && _.affix && g.push({
2245
- name: I.name,
2246
- title: I.meta.title,
2247
- path: I.path,
2248
- affix: !0
2249
- });
2250
- }), g;
2251
- }), h = j(() => f.path), k = (g) => {
2252
- v.push(g);
2253
- }, T = (g) => {
2254
- const I = p.value.find((_) => _.path === g);
2255
- if (!(I != null && I.affix) && g === h.value) {
2256
- const _ = p.value.findIndex((S) => S.path === g), x = p.value[_ - 1] || p.value[_ + 1];
2257
- x && v.push(x.path);
2258
- }
2259
- };
2260
- return (g, I) => (y(), N("div", xr, [
2261
- P(b(Qt), {
2262
- modelValue: h.value,
2263
- "onUpdate:modelValue": I[0] || (I[0] = (_) => h.value = _),
2264
- type: "card",
2265
- onTabClick: k
2266
- }, {
2267
- default: Y(() => [
2268
- (y(!0), N(ve, null, ye(p.value, (_) => (y(), me(b(es), {
2269
- key: _.path,
2270
- name: _.path,
2271
- label: _.title,
2272
- closable: !_.affix
2273
- }, {
2274
- label: Y(() => [
2275
- n("span", Cr, [
2276
- Re(W(_.title) + " ", 1),
2277
- _.affix ? ie("", !0) : (y(), N("span", {
2278
- key: 0,
2279
- class: "tab-close",
2280
- onClick: it((x) => T(_.path), ["stop"])
2281
- }, " ✕ ", 8, Er))
2282
- ])
2283
- ]),
2284
- _: 2
2285
- }, 1032, ["name", "label", "closable"]))), 128))
2286
- ]),
2287
- _: 1
2288
- }, 8, ["modelValue"])
2289
- ]));
2290
- }
2291
- }), La = /* @__PURE__ */ Se(Nr, [["__scopeId", "data-v-9156d8cd"]]), $r = {}, Sr = { class: "footer" };
2292
- function Mr(r, f) {
2293
- return y(), N("div", Sr, [...f[0] || (f[0] = [
2294
- n("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
2295
- ])]);
2296
- }
2297
- const Aa = /* @__PURE__ */ Se($r, [["render", Mr], ["__scopeId", "data-v-4852826a"]]);
2298
- var Ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2299
- function Lr(r) {
2300
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
2301
- }
2302
- var dt = { exports: {} }, Vt = { exports: {} }, jt = { exports: {} };
2303
- (function(r) {
2304
- (function(f) {
2305
- var v, p = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, h = Math.ceil, k = Math.floor, T = "[BigNumber Error] ", g = T + "Number primitive has more than 15 significant digits: ", I = 1e14, _ = 14, x = 9007199254740991, S = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], E = 1e7, q = 1e9;
2306
- function Z(U) {
2307
- var A, X, se, $ = C.prototype = { constructor: C, toString: null, valueOf: null }, re = new C(1), ee = 20, z = 4, le = -7, ue = 21, Ce = -1e7, de = 1e7, be = !1, ke = 1, _e = 0, Te = {
2308
- prefix: "",
2309
- groupSize: 3,
2310
- secondaryGroupSize: 0,
2311
- groupSeparator: ",",
2312
- decimalSeparator: ".",
2313
- fractionGroupSize: 0,
2314
- fractionGroupSeparator: " ",
2315
- // non-breaking space
2316
- suffix: ""
2317
- }, Ee = "0123456789abcdefghijklmnopqrstuvwxyz", Oe = !0;
2318
- function C(t, e) {
2319
- var o, c, s, i, u, a, l, m, d = this;
2320
- if (!(d instanceof C)) return new C(t, e);
2321
- if (e == null) {
2322
- if (t && t._isBigNumber === !0) {
2323
- d.s = t.s, !t.c || t.e > de ? d.c = d.e = null : t.e < Ce ? d.c = [d.e = 0] : (d.e = t.e, d.c = t.c.slice());
2324
- return;
2325
- }
2326
- if ((a = typeof t == "number") && t * 0 == 0) {
2327
- if (d.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
2328
- for (i = 0, u = t; u >= 10; u /= 10, i++) ;
2329
- i > de ? d.c = d.e = null : (d.e = i, d.c = [t]);
2330
- return;
2331
- }
2332
- m = String(t);
2333
- } else {
2334
- if (!p.test(m = String(t))) return se(d, m, a);
2335
- d.s = m.charCodeAt(0) == 45 ? (m = m.slice(1), -1) : 1;
2336
- }
2337
- (i = m.indexOf(".")) > -1 && (m = m.replace(".", "")), (u = m.search(/e/i)) > 0 ? (i < 0 && (i = u), i += +m.slice(u + 1), m = m.substring(0, u)) : i < 0 && (i = m.length);
2338
- } else {
2339
- if (M(e, 2, Ee.length, "Base"), e == 10 && Oe)
2340
- return d = new C(t), G(d, ee + d.e + 1, z);
2341
- if (m = String(t), a = typeof t == "number") {
2342
- if (t * 0 != 0) return se(d, m, a, e);
2343
- if (d.s = 1 / t < 0 ? (m = m.slice(1), -1) : 1, C.DEBUG && m.replace(/^0\.0*|\./, "").length > 15)
2344
- throw Error(g + t);
2345
- } else
2346
- d.s = m.charCodeAt(0) === 45 ? (m = m.slice(1), -1) : 1;
2347
- for (o = Ee.slice(0, e), i = u = 0, l = m.length; u < l; u++)
2348
- if (o.indexOf(c = m.charAt(u)) < 0) {
2349
- if (c == ".") {
2350
- if (u > i) {
2351
- i = l;
2352
- continue;
2353
- }
2354
- } else if (!s && (m == m.toUpperCase() && (m = m.toLowerCase()) || m == m.toLowerCase() && (m = m.toUpperCase()))) {
2355
- s = !0, u = -1, i = 0;
2356
- continue;
2357
- }
2358
- return se(d, String(t), a, e);
2359
- }
2360
- a = !1, m = X(m, e, 10, d.s), (i = m.indexOf(".")) > -1 ? m = m.replace(".", "") : i = m.length;
2361
- }
2362
- for (u = 0; m.charCodeAt(u) === 48; u++) ;
2363
- for (l = m.length; m.charCodeAt(--l) === 48; ) ;
2364
- if (m = m.slice(u, ++l)) {
2365
- if (l -= u, a && C.DEBUG && l > 15 && (t > x || t !== k(t)))
2366
- throw Error(g + d.s * t);
2367
- if ((i = i - u - 1) > de)
2368
- d.c = d.e = null;
2369
- else if (i < Ce)
2370
- d.c = [d.e = 0];
2371
- else {
2372
- if (d.e = i, d.c = [], u = (i + 1) % _, i < 0 && (u += _), u < l) {
2373
- for (u && d.c.push(+m.slice(0, u)), l -= _; u < l; )
2374
- d.c.push(+m.slice(u, u += _));
2375
- u = _ - (m = m.slice(u)).length;
2376
- } else
2377
- u -= l;
2378
- for (; u--; m += "0") ;
2379
- d.c.push(+m);
2380
- }
2381
- } else
2382
- d.c = [d.e = 0];
2383
- }
2384
- C.clone = Z, C.ROUND_UP = 0, C.ROUND_DOWN = 1, C.ROUND_CEIL = 2, C.ROUND_FLOOR = 3, C.ROUND_HALF_UP = 4, C.ROUND_HALF_DOWN = 5, C.ROUND_HALF_EVEN = 6, C.ROUND_HALF_CEIL = 7, C.ROUND_HALF_FLOOR = 8, C.EUCLID = 9, C.config = C.set = function(t) {
2385
- var e, o;
2386
- if (t != null)
2387
- if (typeof t == "object") {
2388
- if (t.hasOwnProperty(e = "DECIMAL_PLACES") && (o = t[e], M(o, 0, q, e), ee = o), t.hasOwnProperty(e = "ROUNDING_MODE") && (o = t[e], M(o, 0, 8, e), z = o), t.hasOwnProperty(e = "EXPONENTIAL_AT") && (o = t[e], o && o.pop ? (M(o[0], -q, 0, e), M(o[1], 0, q, e), le = o[0], ue = o[1]) : (M(o, -q, q, e), le = -(ue = o < 0 ? -o : o))), t.hasOwnProperty(e = "RANGE"))
2389
- if (o = t[e], o && o.pop)
2390
- M(o[0], -q, -1, e), M(o[1], 1, q, e), Ce = o[0], de = o[1];
2391
- else if (M(o, -q, q, e), o)
2392
- Ce = -(de = o < 0 ? -o : o);
2393
- else
2394
- throw Error(T + e + " cannot be zero: " + o);
2395
- if (t.hasOwnProperty(e = "CRYPTO"))
2396
- if (o = t[e], o === !!o)
2397
- if (o)
2398
- if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
2399
- be = o;
2400
- else
2401
- throw be = !o, Error(T + "crypto unavailable");
2402
- else
2403
- be = o;
2404
- else
2405
- throw Error(T + e + " not true or false: " + o);
2406
- if (t.hasOwnProperty(e = "MODULO_MODE") && (o = t[e], M(o, 0, 9, e), ke = o), t.hasOwnProperty(e = "POW_PRECISION") && (o = t[e], M(o, 0, q, e), _e = o), t.hasOwnProperty(e = "FORMAT"))
2407
- if (o = t[e], typeof o == "object") Te = o;
2408
- else throw Error(T + e + " not an object: " + o);
2409
- if (t.hasOwnProperty(e = "ALPHABET"))
2410
- if (o = t[e], typeof o == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(o))
2411
- Oe = o.slice(0, 10) == "0123456789", Ee = o;
2412
- else
2413
- throw Error(T + e + " invalid: " + o);
2414
- } else
2415
- throw Error(T + "Object expected: " + t);
2416
- return {
2417
- DECIMAL_PLACES: ee,
2418
- ROUNDING_MODE: z,
2419
- EXPONENTIAL_AT: [le, ue],
2420
- RANGE: [Ce, de],
2421
- CRYPTO: be,
2422
- MODULO_MODE: ke,
2423
- POW_PRECISION: _e,
2424
- FORMAT: Te,
2425
- ALPHABET: Ee
2426
- };
2427
- }, C.isBigNumber = function(t) {
2428
- if (!t || t._isBigNumber !== !0) return !1;
2429
- if (!C.DEBUG) return !0;
2430
- var e, o, c = t.c, s = t.e, i = t.s;
2431
- e: if ({}.toString.call(c) == "[object Array]") {
2432
- if ((i === 1 || i === -1) && s >= -q && s <= q && s === k(s)) {
2433
- if (c[0] === 0) {
2434
- if (s === 0 && c.length === 1) return !0;
2435
- break e;
2436
- }
2437
- if (e = (s + 1) % _, e < 1 && (e += _), String(c[0]).length == e) {
2438
- for (e = 0; e < c.length; e++)
2439
- if (o = c[e], o < 0 || o >= I || o !== k(o)) break e;
2440
- if (o !== 0) return !0;
2441
- }
2442
- }
2443
- } else if (c === null && s === null && (i === null || i === 1 || i === -1))
2444
- return !0;
2445
- throw Error(T + "Invalid BigNumber: " + t);
2446
- }, C.maximum = C.max = function() {
2447
- return Be(arguments, -1);
2448
- }, C.minimum = C.min = function() {
2449
- return Be(arguments, 1);
2450
- }, C.random = function() {
2451
- var t = 9007199254740992, e = Math.random() * t & 2097151 ? function() {
2452
- return k(Math.random() * t);
2453
- } : function() {
2454
- return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
2455
- };
2456
- return function(o) {
2457
- var c, s, i, u, a, l = 0, m = [], d = new C(re);
2458
- if (o == null ? o = ee : M(o, 0, q), u = h(o / _), be)
2459
- if (crypto.getRandomValues) {
2460
- for (c = crypto.getRandomValues(new Uint32Array(u *= 2)); l < u; )
2461
- a = c[l] * 131072 + (c[l + 1] >>> 11), a >= 9e15 ? (s = crypto.getRandomValues(new Uint32Array(2)), c[l] = s[0], c[l + 1] = s[1]) : (m.push(a % 1e14), l += 2);
2462
- l = u / 2;
2463
- } else if (crypto.randomBytes) {
2464
- for (c = crypto.randomBytes(u *= 7); l < u; )
2465
- a = (c[l] & 31) * 281474976710656 + c[l + 1] * 1099511627776 + c[l + 2] * 4294967296 + c[l + 3] * 16777216 + (c[l + 4] << 16) + (c[l + 5] << 8) + c[l + 6], a >= 9e15 ? crypto.randomBytes(7).copy(c, l) : (m.push(a % 1e14), l += 7);
2466
- l = u / 7;
2467
- } else
2468
- throw be = !1, Error(T + "crypto unavailable");
2469
- if (!be)
2470
- for (; l < u; )
2471
- a = e(), a < 9e15 && (m[l++] = a % 1e14);
2472
- for (u = m[--l], o %= _, u && o && (a = S[_ - o], m[l] = k(u / a) * a); m[l] === 0; m.pop(), l--) ;
2473
- if (l < 0)
2474
- m = [i = 0];
2475
- else {
2476
- for (i = -1; m[0] === 0; m.splice(0, 1), i -= _) ;
2477
- for (l = 1, a = m[0]; a >= 10; a /= 10, l++) ;
2478
- l < _ && (i -= _ - l);
2479
- }
2480
- return d.e = i, d.c = m, d;
2481
- };
2482
- }(), C.sum = function() {
2483
- for (var t = 1, e = arguments, o = new C(e[0]); t < e.length; ) o = o.plus(e[t++]);
2484
- return o;
2485
- }, X = /* @__PURE__ */ function() {
2486
- var t = "0123456789";
2487
- function e(o, c, s, i) {
2488
- for (var u, a = [0], l, m = 0, d = o.length; m < d; ) {
2489
- for (l = a.length; l--; a[l] *= c) ;
2490
- for (a[0] += i.indexOf(o.charAt(m++)), u = 0; u < a.length; u++)
2491
- a[u] > s - 1 && (a[u + 1] == null && (a[u + 1] = 0), a[u + 1] += a[u] / s | 0, a[u] %= s);
2492
- }
2493
- return a.reverse();
2494
- }
2495
- return function(o, c, s, i, u) {
2496
- var a, l, m, d, w, R, F, ne, fe = o.indexOf("."), he = ee, te = z;
2497
- for (fe >= 0 && (d = _e, _e = 0, o = o.replace(".", ""), ne = new C(c), R = ne.pow(o.length - fe), _e = d, ne.c = e(
2498
- oe(L(R.c), R.e, "0"),
2499
- 10,
2500
- s,
2501
- t
2502
- ), ne.e = ne.c.length), F = e(o, c, s, u ? (a = Ee, t) : (a = t, Ee)), m = d = F.length; F[--d] == 0; F.pop()) ;
2503
- if (!F[0]) return a.charAt(0);
2504
- if (fe < 0 ? --m : (R.c = F, R.e = m, R.s = i, R = A(R, ne, he, te, s), F = R.c, w = R.r, m = R.e), l = m + he + 1, fe = F[l], d = s / 2, w = w || l < 0 || F[l + 1] != null, w = te < 4 ? (fe != null || w) && (te == 0 || te == (R.s < 0 ? 3 : 2)) : fe > d || fe == d && (te == 4 || w || te == 6 && F[l - 1] & 1 || te == (R.s < 0 ? 8 : 7)), l < 1 || !F[0])
2505
- o = w ? oe(a.charAt(1), -he, a.charAt(0)) : a.charAt(0);
2506
- else {
2507
- if (F.length = l, w)
2508
- for (--s; ++F[--l] > s; )
2509
- F[l] = 0, l || (++m, F = [1].concat(F));
2510
- for (d = F.length; !F[--d]; ) ;
2511
- for (fe = 0, o = ""; fe <= d; o += a.charAt(F[fe++])) ;
2512
- o = oe(o, m, a.charAt(0));
2513
- }
2514
- return o;
2515
- };
2516
- }(), A = /* @__PURE__ */ function() {
2517
- function t(c, s, i) {
2518
- var u, a, l, m, d = 0, w = c.length, R = s % E, F = s / E | 0;
2519
- for (c = c.slice(); w--; )
2520
- l = c[w] % E, m = c[w] / E | 0, u = F * l + m * R, a = R * l + u % E * E + d, d = (a / i | 0) + (u / E | 0) + F * m, c[w] = a % i;
2521
- return d && (c = [d].concat(c)), c;
2522
- }
2523
- function e(c, s, i, u) {
2524
- var a, l;
2525
- if (i != u)
2526
- l = i > u ? 1 : -1;
2527
- else
2528
- for (a = l = 0; a < i; a++)
2529
- if (c[a] != s[a]) {
2530
- l = c[a] > s[a] ? 1 : -1;
2531
- break;
2532
- }
2533
- return l;
2534
- }
2535
- function o(c, s, i, u) {
2536
- for (var a = 0; i--; )
2537
- c[i] -= a, a = c[i] < s[i] ? 1 : 0, c[i] = a * u + c[i] - s[i];
2538
- for (; !c[0] && c.length > 1; c.splice(0, 1)) ;
2539
- }
2540
- return function(c, s, i, u, a) {
2541
- var l, m, d, w, R, F, ne, fe, he, te, ae, we, Je, ft, pt, Ie, Ge, Ne = c.s == s.s ? 1 : -1, xe = c.c, pe = s.c;
2542
- if (!xe || !xe[0] || !pe || !pe[0])
2543
- return new C(
2544
- // Return NaN if either NaN, or both Infinity or 0.
2545
- !c.s || !s.s || (xe ? pe && xe[0] == pe[0] : !pe) ? NaN : (
2546
- // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
2547
- xe && xe[0] == 0 || !pe ? Ne * 0 : Ne / 0
2548
- )
2549
- );
2550
- for (fe = new C(Ne), he = fe.c = [], m = c.e - s.e, Ne = i + m + 1, a || (a = I, m = O(c.e / _) - O(s.e / _), Ne = Ne / _ | 0), d = 0; pe[d] == (xe[d] || 0); d++) ;
2551
- if (pe[d] > (xe[d] || 0) && m--, Ne < 0)
2552
- he.push(1), w = !0;
2553
- else {
2554
- for (ft = xe.length, Ie = pe.length, d = 0, Ne += 2, R = k(a / (pe[0] + 1)), R > 1 && (pe = t(pe, R, a), xe = t(xe, R, a), Ie = pe.length, ft = xe.length), Je = Ie, te = xe.slice(0, Ie), ae = te.length; ae < Ie; te[ae++] = 0) ;
2555
- Ge = pe.slice(), Ge = [0].concat(Ge), pt = pe[0], pe[1] >= a / 2 && pt++;
2556
- do {
2557
- if (R = 0, l = e(pe, te, Ie, ae), l < 0) {
2558
- if (we = te[0], Ie != ae && (we = we * a + (te[1] || 0)), R = k(we / pt), R > 1)
2559
- for (R >= a && (R = a - 1), F = t(pe, R, a), ne = F.length, ae = te.length; e(F, te, ne, ae) == 1; )
2560
- R--, o(F, Ie < ne ? Ge : pe, ne, a), ne = F.length, l = 1;
2561
- else
2562
- R == 0 && (l = R = 1), F = pe.slice(), ne = F.length;
2563
- if (ne < ae && (F = [0].concat(F)), o(te, F, ae, a), ae = te.length, l == -1)
2564
- for (; e(pe, te, Ie, ae) < 1; )
2565
- R++, o(te, Ie < ae ? Ge : pe, ae, a), ae = te.length;
2566
- } else l === 0 && (R++, te = [0]);
2567
- he[d++] = R, te[0] ? te[ae++] = xe[Je] || 0 : (te = [xe[Je]], ae = 1);
2568
- } while ((Je++ < ft || te[0] != null) && Ne--);
2569
- w = te[0] != null, he[0] || he.splice(0, 1);
2570
- }
2571
- if (a == I) {
2572
- for (d = 1, Ne = he[0]; Ne >= 10; Ne /= 10, d++) ;
2573
- G(fe, i + (fe.e = d + m * _ - 1) + 1, u, w);
2574
- } else
2575
- fe.e = m, fe.r = +w;
2576
- return fe;
2577
- };
2578
- }();
2579
- function Ue(t, e, o, c) {
2580
- var s, i, u, a, l;
2581
- if (o == null ? o = z : M(o, 0, 8), !t.c) return t.toString();
2582
- if (s = t.c[0], u = t.e, e == null)
2583
- l = L(t.c), l = c == 1 || c == 2 && (u <= le || u >= ue) ? J(l, u) : oe(l, u, "0");
2584
- else if (t = G(new C(t), e, o), i = t.e, l = L(t.c), a = l.length, c == 1 || c == 2 && (e <= i || i <= le)) {
2585
- for (; a < e; l += "0", a++) ;
2586
- l = J(l, i);
2587
- } else if (e -= u + (c === 2 && i > u), l = oe(l, i, "0"), i + 1 > a) {
2588
- if (--e > 0) for (l += "."; e--; l += "0") ;
2589
- } else if (e += i - a, e > 0)
2590
- for (i + 1 == a && (l += "."); e--; l += "0") ;
2591
- return t.s < 0 && s ? "-" + l : l;
2592
- }
2593
- function Be(t, e) {
2594
- for (var o, c, s = 1, i = new C(t[0]); s < t.length; s++)
2595
- c = new C(t[s]), (!c.s || (o = V(i, c)) === e || o === 0 && i.s === e) && (i = c);
2596
- return i;
2597
- }
2598
- function Me(t, e, o) {
2599
- for (var c = 1, s = e.length; !e[--s]; e.pop()) ;
2600
- for (s = e[0]; s >= 10; s /= 10, c++) ;
2601
- return (o = c + o * _ - 1) > de ? t.c = t.e = null : o < Ce ? t.c = [t.e = 0] : (t.e = o, t.c = e), t;
2602
- }
2603
- se = /* @__PURE__ */ function() {
2604
- var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, e = /^([^.]+)\.$/, o = /^\.([^.]+)$/, c = /^-?(Infinity|NaN)$/, s = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
2605
- return function(i, u, a, l) {
2606
- var m, d = a ? u : u.replace(s, "");
2607
- if (c.test(d))
2608
- i.s = isNaN(d) ? null : d < 0 ? -1 : 1;
2609
- else {
2610
- if (!a && (d = d.replace(t, function(w, R, F) {
2611
- return m = (F = F.toLowerCase()) == "x" ? 16 : F == "b" ? 2 : 8, !l || l == m ? R : w;
2612
- }), l && (m = l, d = d.replace(e, "$1").replace(o, "0.$1")), u != d))
2613
- return new C(d, m);
2614
- if (C.DEBUG)
2615
- throw Error(T + "Not a" + (l ? " base " + l : "") + " number: " + u);
2616
- i.s = null;
2617
- }
2618
- i.c = i.e = null;
2619
- };
2620
- }();
2621
- function G(t, e, o, c) {
2622
- var s, i, u, a, l, m, d, w = t.c, R = S;
2623
- if (w) {
2624
- e: {
2625
- for (s = 1, a = w[0]; a >= 10; a /= 10, s++) ;
2626
- if (i = e - s, i < 0)
2627
- i += _, u = e, l = w[m = 0], d = k(l / R[s - u - 1] % 10);
2628
- else if (m = h((i + 1) / _), m >= w.length)
2629
- if (c) {
2630
- for (; w.length <= m; w.push(0)) ;
2631
- l = d = 0, s = 1, i %= _, u = i - _ + 1;
2632
- } else
2633
- break e;
2634
- else {
2635
- for (l = a = w[m], s = 1; a >= 10; a /= 10, s++) ;
2636
- i %= _, u = i - _ + s, d = u < 0 ? 0 : k(l / R[s - u - 1] % 10);
2637
- }
2638
- if (c = c || e < 0 || // Are there any non-zero digits after the rounding digit?
2639
- // The expression n % pows10[d - j - 1] returns all digits of n to the right
2640
- // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
2641
- w[m + 1] != null || (u < 0 ? l : l % R[s - u - 1]), c = o < 4 ? (d || c) && (o == 0 || o == (t.s < 0 ? 3 : 2)) : d > 5 || d == 5 && (o == 4 || c || o == 6 && // Check whether the digit to the left of the rounding digit is odd.
2642
- (i > 0 ? u > 0 ? l / R[s - u] : 0 : w[m - 1]) % 10 & 1 || o == (t.s < 0 ? 8 : 7)), e < 1 || !w[0])
2643
- return w.length = 0, c ? (e -= t.e + 1, w[0] = R[(_ - e % _) % _], t.e = -e || 0) : w[0] = t.e = 0, t;
2644
- if (i == 0 ? (w.length = m, a = 1, m--) : (w.length = m + 1, a = R[_ - i], w[m] = u > 0 ? k(l / R[s - u] % R[u]) * a : 0), c)
2645
- for (; ; )
2646
- if (m == 0) {
2647
- for (i = 1, u = w[0]; u >= 10; u /= 10, i++) ;
2648
- for (u = w[0] += a, a = 1; u >= 10; u /= 10, a++) ;
2649
- i != a && (t.e++, w[0] == I && (w[0] = 1));
2650
- break;
2651
- } else {
2652
- if (w[m] += a, w[m] != I) break;
2653
- w[m--] = 0, a = 1;
2654
- }
2655
- for (i = w.length; w[--i] === 0; w.pop()) ;
2656
- }
2657
- t.e > de ? t.c = t.e = null : t.e < Ce && (t.c = [t.e = 0]);
2658
- }
2659
- return t;
2660
- }
2661
- function B(t) {
2662
- var e, o = t.e;
2663
- return o === null ? t.toString() : (e = L(t.c), e = o <= le || o >= ue ? J(e, o) : oe(e, o, "0"), t.s < 0 ? "-" + e : e);
2664
- }
2665
- return $.absoluteValue = $.abs = function() {
2666
- var t = new C(this);
2667
- return t.s < 0 && (t.s = 1), t;
2668
- }, $.comparedTo = function(t, e) {
2669
- return V(this, new C(t, e));
2670
- }, $.decimalPlaces = $.dp = function(t, e) {
2671
- var o, c, s, i = this;
2672
- if (t != null)
2673
- return M(t, 0, q), e == null ? e = z : M(e, 0, 8), G(new C(i), t + i.e + 1, e);
2674
- if (!(o = i.c)) return null;
2675
- if (c = ((s = o.length - 1) - O(this.e / _)) * _, s = o[s]) for (; s % 10 == 0; s /= 10, c--) ;
2676
- return c < 0 && (c = 0), c;
2677
- }, $.dividedBy = $.div = function(t, e) {
2678
- return A(this, new C(t, e), ee, z);
2679
- }, $.dividedToIntegerBy = $.idiv = function(t, e) {
2680
- return A(this, new C(t, e), 0, 1);
2681
- }, $.exponentiatedBy = $.pow = function(t, e) {
2682
- var o, c, s, i, u, a, l, m, d, w = this;
2683
- if (t = new C(t), t.c && !t.isInteger())
2684
- throw Error(T + "Exponent not an integer: " + B(t));
2685
- if (e != null && (e = new C(e)), a = t.e > 14, !w.c || !w.c[0] || w.c[0] == 1 && !w.e && w.c.length == 1 || !t.c || !t.c[0])
2686
- return d = new C(Math.pow(+B(w), a ? t.s * (2 - K(t)) : +B(t))), e ? d.mod(e) : d;
2687
- if (l = t.s < 0, e) {
2688
- if (e.c ? !e.c[0] : !e.s) return new C(NaN);
2689
- c = !l && w.isInteger() && e.isInteger(), c && (w = w.mod(e));
2690
- } else {
2691
- if (t.e > 9 && (w.e > 0 || w.e < -1 || (w.e == 0 ? w.c[0] > 1 || a && w.c[1] >= 24e7 : w.c[0] < 8e13 || a && w.c[0] <= 9999975e7)))
2692
- return i = w.s < 0 && K(t) ? -0 : 0, w.e > -1 && (i = 1 / i), new C(l ? 1 / i : i);
2693
- _e && (i = h(_e / _ + 2));
2694
- }
2695
- for (a ? (o = new C(0.5), l && (t.s = 1), m = K(t)) : (s = Math.abs(+B(t)), m = s % 2), d = new C(re); ; ) {
2696
- if (m) {
2697
- if (d = d.times(w), !d.c) break;
2698
- i ? d.c.length > i && (d.c.length = i) : c && (d = d.mod(e));
2699
- }
2700
- if (s) {
2701
- if (s = k(s / 2), s === 0) break;
2702
- m = s % 2;
2703
- } else if (t = t.times(o), G(t, t.e + 1, 1), t.e > 14)
2704
- m = K(t);
2705
- else {
2706
- if (s = +B(t), s === 0) break;
2707
- m = s % 2;
2708
- }
2709
- w = w.times(w), i ? w.c && w.c.length > i && (w.c.length = i) : c && (w = w.mod(e));
2710
- }
2711
- return c ? d : (l && (d = re.div(d)), e ? d.mod(e) : i ? G(d, _e, z, u) : d);
2712
- }, $.integerValue = function(t) {
2713
- var e = new C(this);
2714
- return t == null ? t = z : M(t, 0, 8), G(e, e.e + 1, t);
2715
- }, $.isEqualTo = $.eq = function(t, e) {
2716
- return V(this, new C(t, e)) === 0;
2717
- }, $.isFinite = function() {
2718
- return !!this.c;
2719
- }, $.isGreaterThan = $.gt = function(t, e) {
2720
- return V(this, new C(t, e)) > 0;
2721
- }, $.isGreaterThanOrEqualTo = $.gte = function(t, e) {
2722
- return (e = V(this, new C(t, e))) === 1 || e === 0;
2723
- }, $.isInteger = function() {
2724
- return !!this.c && O(this.e / _) > this.c.length - 2;
2725
- }, $.isLessThan = $.lt = function(t, e) {
2726
- return V(this, new C(t, e)) < 0;
2727
- }, $.isLessThanOrEqualTo = $.lte = function(t, e) {
2728
- return (e = V(this, new C(t, e))) === -1 || e === 0;
2729
- }, $.isNaN = function() {
2730
- return !this.s;
2731
- }, $.isNegative = function() {
2732
- return this.s < 0;
2733
- }, $.isPositive = function() {
2734
- return this.s > 0;
2735
- }, $.isZero = function() {
2736
- return !!this.c && this.c[0] == 0;
2737
- }, $.minus = function(t, e) {
2738
- var o, c, s, i, u = this, a = u.s;
2739
- if (t = new C(t, e), e = t.s, !a || !e) return new C(NaN);
2740
- if (a != e)
2741
- return t.s = -e, u.plus(t);
2742
- var l = u.e / _, m = t.e / _, d = u.c, w = t.c;
2743
- if (!l || !m) {
2744
- if (!d || !w) return d ? (t.s = -e, t) : new C(w ? u : NaN);
2745
- if (!d[0] || !w[0])
2746
- return w[0] ? (t.s = -e, t) : new C(d[0] ? u : (
2747
- // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
2748
- z == 3 ? -0 : 0
2749
- ));
2750
- }
2751
- if (l = O(l), m = O(m), d = d.slice(), a = l - m) {
2752
- for ((i = a < 0) ? (a = -a, s = d) : (m = l, s = w), s.reverse(), e = a; e--; s.push(0)) ;
2753
- s.reverse();
2754
- } else
2755
- for (c = (i = (a = d.length) < (e = w.length)) ? a : e, a = e = 0; e < c; e++)
2756
- if (d[e] != w[e]) {
2757
- i = d[e] < w[e];
2758
- break;
2759
- }
2760
- if (i && (s = d, d = w, w = s, t.s = -t.s), e = (c = w.length) - (o = d.length), e > 0) for (; e--; d[o++] = 0) ;
2761
- for (e = I - 1; c > a; ) {
2762
- if (d[--c] < w[c]) {
2763
- for (o = c; o && !d[--o]; d[o] = e) ;
2764
- --d[o], d[c] += I;
2765
- }
2766
- d[c] -= w[c];
2767
- }
2768
- for (; d[0] == 0; d.splice(0, 1), --m) ;
2769
- return d[0] ? Me(t, d, m) : (t.s = z == 3 ? -1 : 1, t.c = [t.e = 0], t);
2770
- }, $.modulo = $.mod = function(t, e) {
2771
- var o, c, s = this;
2772
- return t = new C(t, e), !s.c || !t.s || t.c && !t.c[0] ? new C(NaN) : !t.c || s.c && !s.c[0] ? new C(s) : (ke == 9 ? (c = t.s, t.s = 1, o = A(s, t, 0, 3), t.s = c, o.s *= c) : o = A(s, t, 0, ke), t = s.minus(o.times(t)), !t.c[0] && ke == 1 && (t.s = s.s), t);
2773
- }, $.multipliedBy = $.times = function(t, e) {
2774
- var o, c, s, i, u, a, l, m, d, w, R, F, ne, fe, he, te = this, ae = te.c, we = (t = new C(t, e)).c;
2775
- if (!ae || !we || !ae[0] || !we[0])
2776
- return !te.s || !t.s || ae && !ae[0] && !we || we && !we[0] && !ae ? t.c = t.e = t.s = null : (t.s *= te.s, !ae || !we ? t.c = t.e = null : (t.c = [0], t.e = 0)), t;
2777
- for (c = O(te.e / _) + O(t.e / _), t.s *= te.s, l = ae.length, w = we.length, l < w && (ne = ae, ae = we, we = ne, s = l, l = w, w = s), s = l + w, ne = []; s--; ne.push(0)) ;
2778
- for (fe = I, he = E, s = w; --s >= 0; ) {
2779
- for (o = 0, R = we[s] % he, F = we[s] / he | 0, u = l, i = s + u; i > s; )
2780
- m = ae[--u] % he, d = ae[u] / he | 0, a = F * m + d * R, m = R * m + a % he * he + ne[i] + o, o = (m / fe | 0) + (a / he | 0) + F * d, ne[i--] = m % fe;
2781
- ne[i] = o;
2782
- }
2783
- return o ? ++c : ne.splice(0, 1), Me(t, ne, c);
2784
- }, $.negated = function() {
2785
- var t = new C(this);
2786
- return t.s = -t.s || null, t;
2787
- }, $.plus = function(t, e) {
2788
- var o, c = this, s = c.s;
2789
- if (t = new C(t, e), e = t.s, !s || !e) return new C(NaN);
2790
- if (s != e)
2791
- return t.s = -e, c.minus(t);
2792
- var i = c.e / _, u = t.e / _, a = c.c, l = t.c;
2793
- if (!i || !u) {
2794
- if (!a || !l) return new C(s / 0);
2795
- if (!a[0] || !l[0]) return l[0] ? t : new C(a[0] ? c : s * 0);
2796
- }
2797
- if (i = O(i), u = O(u), a = a.slice(), s = i - u) {
2798
- for (s > 0 ? (u = i, o = l) : (s = -s, o = a), o.reverse(); s--; o.push(0)) ;
2799
- o.reverse();
2800
- }
2801
- for (s = a.length, e = l.length, s - e < 0 && (o = l, l = a, a = o, e = s), s = 0; e; )
2802
- s = (a[--e] = a[e] + l[e] + s) / I | 0, a[e] = I === a[e] ? 0 : a[e] % I;
2803
- return s && (a = [s].concat(a), ++u), Me(t, a, u);
2804
- }, $.precision = $.sd = function(t, e) {
2805
- var o, c, s, i = this;
2806
- if (t != null && t !== !!t)
2807
- return M(t, 1, q), e == null ? e = z : M(e, 0, 8), G(new C(i), t, e);
2808
- if (!(o = i.c)) return null;
2809
- if (s = o.length - 1, c = s * _ + 1, s = o[s]) {
2810
- for (; s % 10 == 0; s /= 10, c--) ;
2811
- for (s = o[0]; s >= 10; s /= 10, c++) ;
2812
- }
2813
- return t && i.e + 1 > c && (c = i.e + 1), c;
2814
- }, $.shiftedBy = function(t) {
2815
- return M(t, -x, x), this.times("1e" + t);
2816
- }, $.squareRoot = $.sqrt = function() {
2817
- var t, e, o, c, s, i = this, u = i.c, a = i.s, l = i.e, m = ee + 4, d = new C("0.5");
2818
- if (a !== 1 || !u || !u[0])
2819
- return new C(!a || a < 0 && (!u || u[0]) ? NaN : u ? i : 1 / 0);
2820
- if (a = Math.sqrt(+B(i)), a == 0 || a == 1 / 0 ? (e = L(u), (e.length + l) % 2 == 0 && (e += "0"), a = Math.sqrt(+e), l = O((l + 1) / 2) - (l < 0 || l % 2), a == 1 / 0 ? e = "5e" + l : (e = a.toExponential(), e = e.slice(0, e.indexOf("e") + 1) + l), o = new C(e)) : o = new C(a + ""), o.c[0]) {
2821
- for (l = o.e, a = l + m, a < 3 && (a = 0); ; )
2822
- if (s = o, o = d.times(s.plus(A(i, s, m, 1))), L(s.c).slice(0, a) === (e = L(o.c)).slice(0, a))
2823
- if (o.e < l && --a, e = e.slice(a - 3, a + 1), e == "9999" || !c && e == "4999") {
2824
- if (!c && (G(s, s.e + ee + 2, 0), s.times(s).eq(i))) {
2825
- o = s;
2826
- break;
2827
- }
2828
- m += 4, a += 4, c = 1;
2829
- } else {
2830
- (!+e || !+e.slice(1) && e.charAt(0) == "5") && (G(o, o.e + ee + 2, 1), t = !o.times(o).eq(i));
2831
- break;
2832
- }
2833
- }
2834
- return G(o, o.e + ee + 1, z, t);
2835
- }, $.toExponential = function(t, e) {
2836
- return t != null && (M(t, 0, q), t++), Ue(this, t, e, 1);
2837
- }, $.toFixed = function(t, e) {
2838
- return t != null && (M(t, 0, q), t = t + this.e + 1), Ue(this, t, e);
2839
- }, $.toFormat = function(t, e, o) {
2840
- var c, s = this;
2841
- if (o == null)
2842
- t != null && e && typeof e == "object" ? (o = e, e = null) : t && typeof t == "object" ? (o = t, t = e = null) : o = Te;
2843
- else if (typeof o != "object")
2844
- throw Error(T + "Argument not an object: " + o);
2845
- if (c = s.toFixed(t, e), s.c) {
2846
- var i, u = c.split("."), a = +o.groupSize, l = +o.secondaryGroupSize, m = o.groupSeparator || "", d = u[0], w = u[1], R = s.s < 0, F = R ? d.slice(1) : d, ne = F.length;
2847
- if (l && (i = a, a = l, l = i, ne -= i), a > 0 && ne > 0) {
2848
- for (i = ne % a || a, d = F.substr(0, i); i < ne; i += a) d += m + F.substr(i, a);
2849
- l > 0 && (d += m + F.slice(i)), R && (d = "-" + d);
2850
- }
2851
- c = w ? d + (o.decimalSeparator || "") + ((l = +o.fractionGroupSize) ? w.replace(
2852
- new RegExp("\\d{" + l + "}\\B", "g"),
2853
- "$&" + (o.fractionGroupSeparator || "")
2854
- ) : w) : d;
2855
- }
2856
- return (o.prefix || "") + c + (o.suffix || "");
2857
- }, $.toFraction = function(t) {
2858
- var e, o, c, s, i, u, a, l, m, d, w, R, F = this, ne = F.c;
2859
- if (t != null && (a = new C(t), !a.isInteger() && (a.c || a.s !== 1) || a.lt(re)))
2860
- throw Error(T + "Argument " + (a.isInteger() ? "out of range: " : "not an integer: ") + B(a));
2861
- if (!ne) return new C(F);
2862
- for (e = new C(re), m = o = new C(re), c = l = new C(re), R = L(ne), i = e.e = R.length - F.e - 1, e.c[0] = S[(u = i % _) < 0 ? _ + u : u], t = !t || a.comparedTo(e) > 0 ? i > 0 ? e : m : a, u = de, de = 1 / 0, a = new C(R), l.c[0] = 0; d = A(a, e, 0, 1), s = o.plus(d.times(c)), s.comparedTo(t) != 1; )
2863
- o = c, c = s, m = l.plus(d.times(s = m)), l = s, e = a.minus(d.times(s = e)), a = s;
2864
- return s = A(t.minus(o), c, 0, 1), l = l.plus(s.times(m)), o = o.plus(s.times(c)), l.s = m.s = F.s, i = i * 2, w = A(m, c, i, z).minus(F).abs().comparedTo(
2865
- A(l, o, i, z).minus(F).abs()
2866
- ) < 1 ? [m, c] : [l, o], de = u, w;
2867
- }, $.toNumber = function() {
2868
- return +B(this);
2869
- }, $.toPrecision = function(t, e) {
2870
- return t != null && M(t, 1, q), Ue(this, t, e, 2);
2871
- }, $.toString = function(t) {
2872
- var e, o = this, c = o.s, s = o.e;
2873
- return s === null ? c ? (e = "Infinity", c < 0 && (e = "-" + e)) : e = "NaN" : (t == null ? e = s <= le || s >= ue ? J(L(o.c), s) : oe(L(o.c), s, "0") : t === 10 && Oe ? (o = G(new C(o), ee + s + 1, z), e = oe(L(o.c), o.e, "0")) : (M(t, 2, Ee.length, "Base"), e = X(oe(L(o.c), s, "0"), 10, t, c, !0)), c < 0 && o.c[0] && (e = "-" + e)), e;
2874
- }, $.valueOf = $.toJSON = function() {
2875
- return B(this);
2876
- }, $._isBigNumber = !0, U != null && C.set(U), C;
2877
- }
2878
- function O(U) {
2879
- var A = U | 0;
2880
- return U > 0 || U === A ? A : A - 1;
2881
- }
2882
- function L(U) {
2883
- for (var A, X, se = 1, $ = U.length, re = U[0] + ""; se < $; ) {
2884
- for (A = U[se++] + "", X = _ - A.length; X--; A = "0" + A) ;
2885
- re += A;
2886
- }
2887
- for ($ = re.length; re.charCodeAt(--$) === 48; ) ;
2888
- return re.slice(0, $ + 1 || 1);
2889
- }
2890
- function V(U, A) {
2891
- var X, se, $ = U.c, re = A.c, ee = U.s, z = A.s, le = U.e, ue = A.e;
2892
- if (!ee || !z) return null;
2893
- if (X = $ && !$[0], se = re && !re[0], X || se) return X ? se ? 0 : -z : ee;
2894
- if (ee != z) return ee;
2895
- if (X = ee < 0, se = le == ue, !$ || !re) return se ? 0 : !$ ^ X ? 1 : -1;
2896
- if (!se) return le > ue ^ X ? 1 : -1;
2897
- for (z = (le = $.length) < (ue = re.length) ? le : ue, ee = 0; ee < z; ee++) if ($[ee] != re[ee]) return $[ee] > re[ee] ^ X ? 1 : -1;
2898
- return le == ue ? 0 : le > ue ^ X ? 1 : -1;
2899
- }
2900
- function M(U, A, X, se) {
2901
- if (U < A || U > X || U !== k(U))
2902
- throw Error(T + (se || "Argument") + (typeof U == "number" ? U < A || U > X ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(U));
2903
- }
2904
- function K(U) {
2905
- var A = U.c.length - 1;
2906
- return O(U.e / _) == A && U.c[A] % 2 != 0;
2907
- }
2908
- function J(U, A) {
2909
- return (U.length > 1 ? U.charAt(0) + "." + U.slice(1) : U) + (A < 0 ? "e" : "e+") + A;
2910
- }
2911
- function oe(U, A, X) {
2912
- var se, $;
2913
- if (A < 0) {
2914
- for ($ = X + "."; ++A; $ += X) ;
2915
- U = $ + U;
2916
- } else if (se = U.length, ++A > se) {
2917
- for ($ = X, A -= se; --A; $ += X) ;
2918
- U += $;
2919
- } else A < se && (U = U.slice(0, A) + "." + U.slice(A));
2920
- return U;
2921
- }
2922
- v = Z(), v.default = v.BigNumber = v, r.exports ? r.exports = v : (f || (f = typeof self < "u" && self ? self : window), f.BigNumber = v);
2923
- })(Ir);
2924
- })(jt);
2925
- var qt = jt.exports;
2926
- (function(r) {
2927
- var f = qt, v = r.exports;
2928
- (function() {
2929
- var p = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, h, k, T = {
2930
- // table of character substitutions
2931
- "\b": "\\b",
2932
- " ": "\\t",
2933
- "\n": "\\n",
2934
- "\f": "\\f",
2935
- "\r": "\\r",
2936
- '"': '\\"',
2937
- "\\": "\\\\"
2938
- }, g;
2939
- function I(x) {
2940
- return p.lastIndex = 0, p.test(x) ? '"' + x.replace(p, function(S) {
2941
- var E = T[S];
2942
- return typeof E == "string" ? E : "\\u" + ("0000" + S.charCodeAt(0).toString(16)).slice(-4);
2943
- }) + '"' : '"' + x + '"';
2944
- }
2945
- function _(x, S) {
2946
- var E, q, Z, O, L = h, V, M = S[x], K = M != null && (M instanceof f || f.isBigNumber(M));
2947
- switch (M && typeof M == "object" && typeof M.toJSON == "function" && (M = M.toJSON(x)), typeof g == "function" && (M = g.call(S, x, M)), typeof M) {
2948
- case "string":
2949
- return K ? M : I(M);
2950
- case "number":
2951
- return isFinite(M) ? String(M) : "null";
2952
- case "boolean":
2953
- case "null":
2954
- case "bigint":
2955
- return String(M);
2956
- case "object":
2957
- if (!M)
2958
- return "null";
2959
- if (h += k, V = [], Object.prototype.toString.apply(M) === "[object Array]") {
2960
- for (O = M.length, E = 0; E < O; E += 1)
2961
- V[E] = _(E, M) || "null";
2962
- return Z = V.length === 0 ? "[]" : h ? `[
2963
- ` + h + V.join(`,
2964
- ` + h) + `
2965
- ` + L + "]" : "[" + V.join(",") + "]", h = L, Z;
2966
- }
2967
- if (g && typeof g == "object")
2968
- for (O = g.length, E = 0; E < O; E += 1)
2969
- typeof g[E] == "string" && (q = g[E], Z = _(q, M), Z && V.push(I(q) + (h ? ": " : ":") + Z));
2970
- else
2971
- Object.keys(M).forEach(function(J) {
2972
- var oe = _(J, M);
2973
- oe && V.push(I(J) + (h ? ": " : ":") + oe);
2974
- });
2975
- return Z = V.length === 0 ? "{}" : h ? `{
2976
- ` + h + V.join(`,
2977
- ` + h) + `
2978
- ` + L + "}" : "{" + V.join(",") + "}", h = L, Z;
2979
- }
2980
- }
2981
- typeof v.stringify != "function" && (v.stringify = function(x, S, E) {
2982
- var q;
2983
- if (h = "", k = "", typeof E == "number")
2984
- for (q = 0; q < E; q += 1)
2985
- k += " ";
2986
- else typeof E == "string" && (k = E);
2987
- if (g = S, S && typeof S != "function" && (typeof S != "object" || typeof S.length != "number"))
2988
- throw new Error("JSON.stringify");
2989
- return _("", { "": x });
2990
- });
2991
- })();
2992
- })(Vt);
2993
- var Ar = Vt.exports, et = null;
2994
- const Tr = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, Or = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
2995
- var Ur = function(r) {
2996
- var f = {
2997
- strict: !1,
2998
- // not being strict means do not generate syntax errors for "duplicate key"
2999
- storeAsString: !1,
3000
- // toggles whether the values should be stored as BigNumber (default) or a string
3001
- alwaysParseAsBig: !1,
3002
- // toggles whether all numbers should be Big
3003
- useNativeBigInt: !1,
3004
- // toggles whether to use native BigInt instead of bignumber.js
3005
- protoAction: "error",
3006
- constructorAction: "error"
3007
- };
3008
- if (r != null) {
3009
- if (r.strict === !0 && (f.strict = !0), r.storeAsString === !0 && (f.storeAsString = !0), f.alwaysParseAsBig = r.alwaysParseAsBig === !0 ? r.alwaysParseAsBig : !1, f.useNativeBigInt = r.useNativeBigInt === !0 ? r.useNativeBigInt : !1, typeof r.constructorAction < "u")
3010
- if (r.constructorAction === "error" || r.constructorAction === "ignore" || r.constructorAction === "preserve")
3011
- f.constructorAction = r.constructorAction;
3012
- else
3013
- throw new Error(
3014
- `Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${r.constructorAction}`
3015
- );
3016
- if (typeof r.protoAction < "u")
3017
- if (r.protoAction === "error" || r.protoAction === "ignore" || r.protoAction === "preserve")
3018
- f.protoAction = r.protoAction;
3019
- else
3020
- throw new Error(
3021
- `Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${r.protoAction}`
3022
- );
3023
- }
3024
- var v, p, h = {
3025
- '"': '"',
3026
- "\\": "\\",
3027
- "/": "/",
3028
- b: "\b",
3029
- f: "\f",
3030
- n: `
3031
- `,
3032
- r: "\r",
3033
- t: " "
3034
- }, k, T = function(O) {
3035
- throw {
3036
- name: "SyntaxError",
3037
- message: O,
3038
- at: v,
3039
- text: k
3040
- };
3041
- }, g = function(O) {
3042
- return O && O !== p && T("Expected '" + O + "' instead of '" + p + "'"), p = k.charAt(v), v += 1, p;
3043
- }, I = function() {
3044
- var O, L = "";
3045
- for (p === "-" && (L = "-", g("-")); p >= "0" && p <= "9"; )
3046
- L += p, g();
3047
- if (p === ".")
3048
- for (L += "."; g() && p >= "0" && p <= "9"; )
3049
- L += p;
3050
- if (p === "e" || p === "E")
3051
- for (L += p, g(), (p === "-" || p === "+") && (L += p, g()); p >= "0" && p <= "9"; )
3052
- L += p, g();
3053
- if (O = +L, !isFinite(O))
3054
- T("Bad number");
3055
- else
3056
- return et == null && (et = qt), L.length > 15 ? f.storeAsString ? L : f.useNativeBigInt ? BigInt(L) : new et(L) : f.alwaysParseAsBig ? f.useNativeBigInt ? BigInt(O) : new et(O) : O;
3057
- }, _ = function() {
3058
- var O, L, V = "", M;
3059
- if (p === '"')
3060
- for (var K = v; g(); ) {
3061
- if (p === '"')
3062
- return v - 1 > K && (V += k.substring(K, v - 1)), g(), V;
3063
- if (p === "\\") {
3064
- if (v - 1 > K && (V += k.substring(K, v - 1)), g(), p === "u") {
3065
- for (M = 0, L = 0; L < 4 && (O = parseInt(g(), 16), !!isFinite(O)); L += 1)
3066
- M = M * 16 + O;
3067
- V += String.fromCharCode(M);
3068
- } else if (typeof h[p] == "string")
3069
- V += h[p];
3070
- else
3071
- break;
3072
- K = v;
3073
- }
3074
- }
3075
- T("Bad string");
3076
- }, x = function() {
3077
- for (; p && p <= " "; )
3078
- g();
3079
- }, S = function() {
3080
- switch (p) {
3081
- case "t":
3082
- return g("t"), g("r"), g("u"), g("e"), !0;
3083
- case "f":
3084
- return g("f"), g("a"), g("l"), g("s"), g("e"), !1;
3085
- case "n":
3086
- return g("n"), g("u"), g("l"), g("l"), null;
3087
- }
3088
- T("Unexpected '" + p + "'");
3089
- }, E, q = function() {
3090
- var O = [];
3091
- if (p === "[") {
3092
- if (g("["), x(), p === "]")
3093
- return g("]"), O;
3094
- for (; p; ) {
3095
- if (O.push(E()), x(), p === "]")
3096
- return g("]"), O;
3097
- g(","), x();
3098
- }
3099
- }
3100
- T("Bad array");
3101
- }, Z = function() {
3102
- var O, L = /* @__PURE__ */ Object.create(null);
3103
- if (p === "{") {
3104
- if (g("{"), x(), p === "}")
3105
- return g("}"), L;
3106
- for (; p; ) {
3107
- if (O = _(), x(), g(":"), f.strict === !0 && Object.hasOwnProperty.call(L, O) && T('Duplicate key "' + O + '"'), Tr.test(O) === !0 ? f.protoAction === "error" ? T("Object contains forbidden prototype property") : f.protoAction === "ignore" ? E() : L[O] = E() : Or.test(O) === !0 ? f.constructorAction === "error" ? T("Object contains forbidden constructor property") : f.constructorAction === "ignore" ? E() : L[O] = E() : L[O] = E(), x(), p === "}")
3108
- return g("}"), L;
3109
- g(","), x();
3110
- }
3111
- }
3112
- T("Bad object");
3113
- };
3114
- return E = function() {
3115
- switch (x(), p) {
3116
- case "{":
3117
- return Z();
3118
- case "[":
3119
- return q();
3120
- case '"':
3121
- return _();
3122
- case "-":
3123
- return I();
3124
- default:
3125
- return p >= "0" && p <= "9" ? I() : S();
3126
- }
3127
- }, function(O, L) {
3128
- var V;
3129
- return k = O + "", v = 0, p = " ", V = E(), x(), p && T("Syntax error"), typeof L == "function" ? function M(K, J) {
3130
- var oe, U = K[J];
3131
- return U && typeof U == "object" && Object.keys(U).forEach(function(A) {
3132
- oe = M(U, A), oe !== void 0 ? U[A] = oe : delete U[A];
3133
- }), L.call(K, J, U);
3134
- }({ "": V }, "") : V;
3135
- };
3136
- }, Br = Ur, Gt = Ar.stringify, Kt = Br;
3137
- dt.exports = function(r) {
3138
- return {
3139
- parse: Kt(r),
3140
- stringify: Gt
3141
- };
3142
- };
3143
- dt.exports.parse = Kt();
3144
- dt.exports.stringify = Gt;
3145
- var Dr = dt.exports;
3146
- const Pr = /* @__PURE__ */ Lr(Dr), Rr = Pr({ storeAsString: !0 }), zr = () => {
3147
- const r = ns.create({
3148
- baseURL: void 0,
3149
- timeout: 3e4,
3150
- headers: {
3151
- "Content-Type": "application/json"
3152
- },
3153
- // 使用 json-bigint 解析响应数据,避免大整数精度丢失
3154
- transformResponse: [
3155
- (f) => {
3156
- if (typeof f == "string")
3157
- try {
3158
- return Rr.parse(f);
3159
- } catch {
3160
- return f;
3161
- }
3162
- return f;
3163
- }
3164
- ]
3165
- });
3166
- return r.interceptors.request.use(
3167
- (f) => {
3168
- const v = ut(), p = ls() || "Bearer";
3169
- return v && (f.headers.Authorization = `${p} ${v}`), f;
3170
- },
3171
- (f) => Promise.reject(f)
3172
- ), r.interceptors.response.use(
3173
- (f) => {
3174
- const { data: v } = f;
3175
- return v.code === 200 || v.code === 0 ? v.data : v.code === 9121 ? (Le.error("登录已过期,请重新登录"), He(), window.location.href = "/login", Promise.reject(new Error(v.message || "EXPIRED OR INVALID TOKEN"))) : (Le.error(v.message || "请求失败"), Promise.reject(new Error(v.message || "请求失败")));
3176
- },
3177
- (f) => {
3178
- var p;
3179
- const { response: v } = f;
3180
- if (v) {
3181
- const { data: h } = v;
3182
- if ((h == null ? void 0 : h.code) === 9121)
3183
- return Le.error("登录已过期,请重新登录"), He(), window.location.href = "/login", Promise.reject(f);
3184
- switch (v.status) {
3185
- case 401:
3186
- Le.error("登录已过期,请重新登录"), He(), window.location.href = "/login";
3187
- break;
3188
- case 403:
3189
- Le.error("没有权限访问");
3190
- break;
3191
- case 404:
3192
- Le.error("请求资源不存在");
3193
- break;
3194
- case 500:
3195
- Le.error("服务器错误");
3196
- break;
3197
- default:
3198
- Le.error(((p = v.data) == null ? void 0 : p.message) || "请求失败");
3199
- }
3200
- } else
3201
- Le.error("网络连接失败");
3202
- return Promise.reject(f);
3203
- }
3204
- ), r;
3205
- }, Fe = zr(), ce = {
3206
- get(r, f) {
3207
- return Fe.get(r, f);
3208
- },
3209
- post(r, f, v) {
3210
- return Fe.post(r, f, v);
3211
- },
3212
- put(r, f, v) {
3213
- return Fe.put(r, f, v);
3214
- },
3215
- patch(r, f, v) {
3216
- return Fe.patch(r, f, v);
3217
- },
3218
- delete(r, f) {
3219
- return Fe.delete(r, f);
3220
- },
3221
- // 文件下载 - 返回 Blob 对象
3222
- download(r, f) {
3223
- return Fe.get(r, { ...f, responseType: "blob" });
3224
- }
3225
- };
3226
- function Fr(r) {
3227
- return ce.post("/user/v1.0/login/by-domain", r);
3228
- }
3229
- function Ta() {
3230
- return ce.put("/user/v1.0/user/logout");
3231
- }
3232
- function Vr() {
3233
- return ce.get("/user/v1.0/user/get-me");
3234
- }
3235
- function Oa(r) {
3236
- return ce.post("/user/v1.0/refresh", { refreshToken: r });
3237
- }
3238
- const jr = { class: "login-page" }, qr = { class: "login-form-section" }, Gr = { class: "form-container" }, Kr = { class: "input-wrapper" }, Hr = { class: "input-wrapper" }, Wr = { class: "form-options" }, Xr = { key: 0 }, Yr = { key: 1 }, Jr = /* @__PURE__ */ Ae({
3239
- __name: "index",
3240
- setup(r) {
3241
- const f = De(), v = qe(), p = D(!1), h = D(!1), k = yt({
3242
- uid: "",
3243
- password: ""
3244
- }), T = {
3245
- uid: [
3246
- { required: !0, message: "请输入用户名", trigger: "blur" }
3247
- ],
3248
- password: [
3249
- { required: !0, message: "请输入密码", trigger: "blur" },
3250
- { min: 6, message: "密码长度至少6位", trigger: "blur" }
3251
- ]
3252
- }, g = D(), I = async () => {
3253
- var _;
3254
- try {
3255
- await ((_ = g.value) == null ? void 0 : _.validate()), p.value = !0;
3256
- const x = await Fr({
3257
- appId: ct(),
3258
- clientId: Dt(),
3259
- uid: k.uid,
3260
- password: k.password,
3261
- code: !0
3262
- });
3263
- Rt(x), Le.success("登录成功");
3264
- const S = v.query.redirect || "/";
3265
- f.push(S);
3266
- } catch (x) {
3267
- console.error("登录失败:", x);
3268
- } finally {
3269
- p.value = !1;
3270
- }
3271
- };
3272
- return (_, x) => (y(), N("div", jr, [
3273
- x[10] || (x[10] = tt('<div class="login-brand" data-v-102cb5d3><div class="brand-content" data-v-102cb5d3><div class="brand-logo" data-v-102cb5d3><div class="logo-icon" data-v-102cb5d3><svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-102cb5d3><rect width="48" height="48" rx="12" fill="currentColor" data-v-102cb5d3></rect><path d="M14 24L20 30L34 16" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-102cb5d3></path></svg></div><span class="logo-text" data-v-102cb5d3>XTO</span></div><div class="brand-slogan" data-v-102cb5d3><h1 data-v-102cb5d3>企业级后台管理解决方案</h1><p data-v-102cb5d3>开箱即用的中后台前端/设计解决方案</p></div><div class="brand-features" data-v-102cb5d3><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>高性能</h4><p data-v-102cb5d3>极致的渲染性能与响应速度</p></div></div><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><rect x="3" y="3" width="18" height="18" rx="2" data-v-102cb5d3></rect><path d="M9 9h6M9 12h6M9 15h4" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>丰富组件</h4><p data-v-102cb5d3>60+ 高质量业务组件</p></div></div><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><circle cx="12" cy="12" r="10" data-v-102cb5d3></circle><path d="M12 6v6l4 2" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>持续更新</h4><p data-v-102cb5d3>活跃的社区与快速迭代</p></div></div></div><div class="brand-decoration" data-v-102cb5d3><div class="decoration-line" data-v-102cb5d3></div><div class="decoration-dots" data-v-102cb5d3><span data-v-102cb5d3></span><span data-v-102cb5d3></span><span data-v-102cb5d3></span></div></div></div><div class="brand-bg" data-v-102cb5d3><div class="bg-grid" data-v-102cb5d3></div><div class="bg-glow" data-v-102cb5d3></div><div class="bg-pattern" data-v-102cb5d3></div></div></div>', 1)),
3274
- n("div", qr, [
3275
- n("div", Gr, [
3276
- x[7] || (x[7] = n("div", { class: "form-header" }, [
3277
- n("h2", null, "欢迎登录"),
3278
- n("p", null, "请输入您的账户信息")
3279
- ], -1)),
3280
- P(b(ts), {
3281
- ref_key: "formRef",
3282
- ref: g,
3283
- model: k,
3284
- rules: T,
3285
- class: "login-form",
3286
- "label-width": "0"
3287
- }, {
3288
- default: Y(() => [
3289
- P(b(mt), { prop: "uid" }, {
3290
- default: Y(() => [
3291
- n("div", Kr, [
3292
- x[3] || (x[3] = n("label", { class: "input-label" }, "用户名", -1)),
3293
- P(b(At), {
3294
- modelValue: k.uid,
3295
- "onUpdate:modelValue": x[0] || (x[0] = (S) => k.uid = S),
3296
- placeholder: "请输入用户名",
3297
- size: "large"
3298
- }, {
3299
- prefix: Y(() => [
3300
- P(b(Q), {
3301
- name: "user",
3302
- size: 18
3303
- })
3304
- ]),
3305
- _: 1
3306
- }, 8, ["modelValue"])
3307
- ])
3308
- ]),
3309
- _: 1
3310
- }),
3311
- P(b(mt), { prop: "password" }, {
3312
- default: Y(() => [
3313
- n("div", Hr, [
3314
- x[4] || (x[4] = n("label", { class: "input-label" }, "密码", -1)),
3315
- P(b(At), {
3316
- modelValue: k.password,
3317
- "onUpdate:modelValue": x[1] || (x[1] = (S) => k.password = S),
3318
- type: "password",
3319
- placeholder: "请输入密码",
3320
- size: "large",
3321
- "show-password": "",
3322
- onKeyup: Zt(I, ["enter"])
3323
- }, {
3324
- prefix: Y(() => [
3325
- P(b(Q), {
3326
- name: "lock",
3327
- size: 18
3328
- })
3329
- ]),
3330
- _: 1
3331
- }, 8, ["modelValue"])
3332
- ])
3333
- ]),
3334
- _: 1
3335
- }),
3336
- n("div", Wr, [
3337
- P(b(ss), {
3338
- modelValue: h.value,
3339
- "onUpdate:modelValue": x[2] || (x[2] = (S) => h.value = S)
3340
- }, {
3341
- default: Y(() => [...x[5] || (x[5] = [
3342
- Re("记住我", -1)
3343
- ])]),
3344
- _: 1
3345
- }, 8, ["modelValue"]),
3346
- x[6] || (x[6] = n("a", {
3347
- href: "#",
3348
- class: "forgot-link"
3349
- }, "忘记密码?", -1))
3350
- ]),
3351
- P(b(mt), null, {
3352
- default: Y(() => [
3353
- P(b(je), {
3354
- type: "primary",
3355
- size: "large",
3356
- loading: p.value,
3357
- class: "login-btn",
3358
- onClick: I
3359
- }, {
3360
- default: Y(() => [
3361
- p.value ? (y(), N("span", Yr, "登录中...")) : (y(), N("span", Xr, "登 录"))
3362
- ]),
3363
- _: 1
3364
- }, 8, ["loading"])
3365
- ]),
3366
- _: 1
3367
- })
3368
- ]),
3369
- _: 1
3370
- }, 8, ["model"]),
3371
- x[8] || (x[8] = tt('<div class="form-footer" data-v-102cb5d3><p data-v-102cb5d3>其他登录方式</p><div class="social-login" data-v-102cb5d3><button class="social-btn" title="企业微信" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" data-v-102cb5d3></path></svg></button><button class="social-btn" title="钉钉" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 00-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.73-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06.01.24 0 .38z" data-v-102cb5d3></path></svg></button><button class="social-btn" title="飞书" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" data-v-102cb5d3></path></svg></button></div></div>', 1))
3372
- ]),
3373
- x[9] || (x[9] = n("div", { class: "copyright" }, [
3374
- n("p", null, "© 2024 XTO Team. All rights reserved.")
3375
- ], -1))
3376
- ])
3377
- ]));
3378
- }
3379
- }), Zr = /* @__PURE__ */ Se(Jr, [["__scopeId", "data-v-102cb5d3"]]), Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3380
- __proto__: null,
3381
- default: Zr
3382
- }, Symbol.toStringTag, { value: "Module" })), ea = { class: "error-page" }, ta = { class: "error-container" }, sa = { class: "error-content" }, na = { class: "error-actions" }, oa = /* @__PURE__ */ Ae({
3383
- __name: "404",
3384
- setup(r) {
3385
- const f = De(), v = () => {
3386
- f.push("/");
3387
- };
3388
- return (p, h) => (y(), N("div", ea, [
3389
- n("div", ta, [
3390
- h[7] || (h[7] = n("div", { class: "error-bg" }, [
3391
- n("div", { class: "bg-circle circle-1" }),
3392
- n("div", { class: "bg-circle circle-2" }),
3393
- n("div", { class: "bg-circle circle-3" })
3394
- ], -1)),
3395
- n("div", sa, [
3396
- h[5] || (h[5] = tt('<div class="error-code" data-v-1b083153><span class="code-digit" data-v-1b083153>4</span><span class="code-zero" data-v-1b083153><span class="zero-inner" data-v-1b083153>0</span></span><span class="code-digit" data-v-1b083153>4</span></div><div class="error-illustration" data-v-1b083153><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-1b083153><rect x="40" y="20" width="120" height="80" rx="8" fill="var(--color-fill)" stroke="var(--color-border)" stroke-width="2" data-v-1b083153></rect><rect x="50" y="30" width="100" height="60" rx="4" fill="var(--bg-color)" data-v-1b083153></rect><line x1="60" y1="45" x2="140" y2="45" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><line x1="60" y1="55" x2="120" y2="55" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><line x1="60" y1="65" x2="100" y2="65" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><text x="100" y="75" text-anchor="middle" fill="var(--color-primary)" font-size="24" font-weight="600" data-v-1b083153>?</text><circle cx="150" cy="35" r="12" stroke="var(--color-primary)" stroke-width="2" fill="none" data-v-1b083153></circle><line x1="158" y1="43" x2="168" y2="53" stroke="var(--color-primary)" stroke-width="2" stroke-linecap="round" data-v-1b083153></line></svg></div><h1 class="error-title" data-v-1b083153>页面不存在</h1><p class="error-desc" data-v-1b083153>抱歉,您访问的页面不存在或已被删除</p>', 4)),
3397
- n("div", na, [
3398
- P(b(je), {
3399
- type: "primary",
3400
- size: "large",
3401
- onClick: v
3402
- }, {
3403
- icon: Y(() => [...h[1] || (h[1] = [
3404
- n("svg", {
3405
- viewBox: "0 0 24 24",
3406
- fill: "none",
3407
- stroke: "currentColor",
3408
- "stroke-width": "2"
3409
- }, [
3410
- n("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
3411
- n("polyline", { points: "9,22 9,12 15,12 15,22" })
3412
- ], -1)
3413
- ])]),
3414
- default: Y(() => [
3415
- h[2] || (h[2] = Re(" 返回首页 ", -1))
3416
- ]),
3417
- _: 1
3418
- }),
3419
- P(b(je), {
3420
- size: "large",
3421
- onClick: h[0] || (h[0] = (k) => b(f).go(-1))
3422
- }, {
3423
- icon: Y(() => [...h[3] || (h[3] = [
3424
- n("svg", {
3425
- viewBox: "0 0 24 24",
3426
- fill: "none",
3427
- stroke: "currentColor",
3428
- "stroke-width": "2"
3429
- }, [
3430
- n("path", { d: "M19 12H5M12 19l-7-7 7-7" })
3431
- ], -1)
3432
- ])]),
3433
- default: Y(() => [
3434
- h[4] || (h[4] = Re(" 返回上一页 ", -1))
3435
- ]),
3436
- _: 1
3437
- })
3438
- ]),
3439
- h[6] || (h[6] = n("div", { class: "error-tip" }, [
3440
- n("p", null, "您可以尝试:"),
3441
- n("ul", null, [
3442
- n("li", null, "检查您输入的网址是否正确"),
3443
- n("li", null, "返回首页重新浏览"),
3444
- n("li", null, "联系管理员反馈问题")
3445
- ])
3446
- ], -1))
3447
- ])
3448
- ])
3449
- ]));
3450
- }
3451
- }), ra = /* @__PURE__ */ Se(oa, [["__scopeId", "data-v-1b083153"]]), Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3452
- __proto__: null,
3453
- default: ra
3454
- }, Symbol.toStringTag, { value: "Module" })), aa = { class: "error-page" }, ia = { class: "error-container" }, la = { class: "error-content" }, ca = { class: "error-actions" }, ua = /* @__PURE__ */ Ae({
3455
- __name: "403",
3456
- setup(r) {
3457
- const f = De(), v = () => {
3458
- f.push("/");
3459
- };
3460
- return (p, h) => (y(), N("div", aa, [
3461
- n("div", ia, [
3462
- h[7] || (h[7] = n("div", { class: "error-bg" }, [
3463
- n("div", { class: "bg-circle circle-1" }),
3464
- n("div", { class: "bg-circle circle-2" }),
3465
- n("div", { class: "bg-circle circle-3" })
3466
- ], -1)),
3467
- n("div", la, [
3468
- h[5] || (h[5] = tt('<div class="error-code" data-v-d167f981><span class="code-digit" data-v-d167f981>4</span><span class="code-zero warning" data-v-d167f981><span class="zero-inner" data-v-d167f981>0</span></span><span class="code-digit" data-v-d167f981>3</span></div><div class="error-illustration" data-v-d167f981><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-d167f981><path d="M100 15 L150 35 L150 70 C150 95 100 110 100 110 C100 110 50 95 50 70 L50 35 Z" fill="var(--color-warning-lighter)" stroke="var(--color-warning)" stroke-width="2" data-v-d167f981></path><rect x="85" y="55" width="30" height="25" rx="4" fill="var(--color-warning)" data-v-d167f981></rect><path d="M92 55 V48 A8 8 0 0 1 108 48 V55" fill="none" stroke="var(--color-warning)" stroke-width="3" data-v-d167f981></path><circle cx="100" cy="67" r="6" fill="none" stroke="#fff" stroke-width="2" data-v-d167f981></circle><line x1="96" y1="63" x2="104" y2="71" stroke="#fff" stroke-width="2" data-v-d167f981></line></svg></div><h1 class="error-title" data-v-d167f981>无访问权限</h1><p class="error-desc" data-v-d167f981>抱歉,您没有权限访问此页面,请联系管理员获取权限</p>', 4)),
3469
- n("div", ca, [
3470
- P(b(je), {
3471
- type: "primary",
3472
- size: "large",
3473
- onClick: v
3474
- }, {
3475
- icon: Y(() => [...h[1] || (h[1] = [
3476
- n("svg", {
3477
- viewBox: "0 0 24 24",
3478
- fill: "none",
3479
- stroke: "currentColor",
3480
- "stroke-width": "2"
3481
- }, [
3482
- n("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
3483
- n("polyline", { points: "9,22 9,12 15,12 15,22" })
3484
- ], -1)
3485
- ])]),
3486
- default: Y(() => [
3487
- h[2] || (h[2] = Re(" 返回首页 ", -1))
3488
- ]),
3489
- _: 1
3490
- }),
3491
- P(b(je), {
3492
- size: "large",
3493
- onClick: h[0] || (h[0] = (k) => b(f).go(-1))
3494
- }, {
3495
- icon: Y(() => [...h[3] || (h[3] = [
3496
- n("svg", {
3497
- viewBox: "0 0 24 24",
3498
- fill: "none",
3499
- stroke: "currentColor",
3500
- "stroke-width": "2"
3501
- }, [
3502
- n("path", { d: "M19 12H5M12 19l-7-7 7-7" })
3503
- ], -1)
3504
- ])]),
3505
- default: Y(() => [
3506
- h[4] || (h[4] = Re(" 返回上一页 ", -1))
3507
- ]),
3508
- _: 1
3509
- })
3510
- ]),
3511
- h[6] || (h[6] = n("div", { class: "error-tip" }, [
3512
- n("p", null, "可能的原因:"),
3513
- n("ul", null, [
3514
- n("li", null, "您的账号权限不足"),
3515
- n("li", null, "该页面需要特定角色才能访问"),
3516
- n("li", null, "您的登录状态已过期")
3517
- ])
3518
- ], -1))
3519
- ])
3520
- ])
3521
- ]));
3522
- }
3523
- }), Ua = /* @__PURE__ */ Se(ua, [["__scopeId", "data-v-d167f981"]]);
3524
- function Ba() {
3525
- const r = Pe(), f = $e(), v = Ye(), p = j(() => f.userName || ""), h = j(() => f.userInfo), k = j(() => r.appName), T = j(() => v.isLoggedIn), g = j(() => r.isDark), I = j(() => r.theme), _ = j(() => r.isCollapsed), x = j(() => r.layout);
3526
- return {
3527
- userName: p,
3528
- userInfo: h,
3529
- appName: k,
3530
- isLoggedIn: T,
3531
- isDark: g,
3532
- theme: I,
3533
- isCollapsed: _,
3534
- layout: x,
3535
- toggleTheme: () => {
3536
- r.toggleTheme();
3537
- },
3538
- toggleCollapse: () => {
3539
- r.toggleCollapse();
3540
- }
3541
- };
3542
- }
3543
- function Da() {
3544
- const r = $e();
3545
- return {
3546
- isLoggedIn: j(() => r.isLoggedIn)
3547
- };
3548
- }
3549
- function Pa(r, f = {}) {
3550
- const { rules: v, onSubmit: p } = f, h = D(), k = yt({ ...r }), T = D(!1), g = D(!1), I = D(!1), _ = () => {
3551
- E(), I.value = !1, g.value = !0;
3552
- }, x = (Z) => {
3553
- Object.assign(k, Z), I.value = !0, g.value = !0;
3554
- }, S = () => {
3555
- g.value = !1, E();
3556
- }, E = () => {
3557
- var Z;
3558
- Object.keys(r).forEach((O) => {
3559
- k[O] = r[O];
3560
- }), (Z = h.value) == null || Z.resetFields();
3561
- };
3562
- return {
3563
- formRef: h,
3564
- formData: k,
3565
- rules: v,
3566
- loading: T,
3567
- visible: g,
3568
- isEdit: I,
3569
- openAdd: _,
3570
- openEdit: x,
3571
- close: S,
3572
- resetForm: E,
3573
- handleSubmit: async () => {
3574
- var Z;
3575
- try {
3576
- await ((Z = h.value) == null ? void 0 : Z.validate()), T.value = !0, await (p == null ? void 0 : p(k)), S();
3577
- } catch (O) {
3578
- console.error(O);
3579
- } finally {
3580
- T.value = !1;
3581
- }
3582
- }
3583
- };
3584
- }
3585
- function Ra(r) {
3586
- const { fetchData: f, defaultPageSize: v = 10 } = r, p = D(!1), h = D([]), k = D(0), T = D(1), g = D(v), I = yt({}), _ = async () => {
3587
- p.value = !0;
3588
- try {
3589
- const L = {
3590
- ...I,
3591
- page: T.value,
3592
- pageSize: g.value
3593
- }, V = await f(L);
3594
- h.value = V.list, k.value = V.total;
3595
- } catch (L) {
3596
- console.error(L);
3597
- } finally {
3598
- p.value = !1;
3599
- }
3600
- }, x = () => {
3601
- T.value = 1, _();
3602
- }, S = () => {
3603
- Object.keys(I).forEach((L) => {
3604
- I[L] = void 0;
3605
- }), T.value = 1, _();
3606
- }, E = (L) => {
3607
- T.value = L, _();
3608
- }, q = (L) => {
3609
- g.value = L, T.value = 1, _();
3610
- }, Z = () => {
3611
- _();
3612
- }, O = j(() => ({
3613
- current: T.value,
3614
- pageSize: g.value,
3615
- total: k.value
3616
- }));
3617
- return {
3618
- loading: p,
3619
- data: h,
3620
- total: k,
3621
- currentPage: T,
3622
- pageSize: g,
3623
- searchParams: I,
3624
- pagination: O,
3625
- getData: _,
3626
- handleSearch: x,
3627
- handleReset: S,
3628
- handlePageChange: E,
3629
- handleSizeChange: q,
3630
- refresh: Z
3631
- };
3632
- }
3633
- function za(r) {
3634
- return $e().isLoggedIn;
3635
- }
3636
- function Fa(r) {
3637
- return $e().isLoggedIn;
3638
- }
3639
- function Va() {
3640
- return !0;
3641
- }
3642
- const Wt = [
3643
- {
3644
- path: "/login",
3645
- name: "Login",
3646
- component: () => Promise.resolve().then(() => Qr),
3647
- meta: {
3648
- title: "登录",
3649
- hidden: !0
3650
- }
3651
- }
3652
- ], Xt = {
3653
- path: "/",
3654
- name: "Layout",
3655
- component: () => Promise.resolve().then(() => kr),
3656
- redirect: "/dashboard",
3657
- children: [
3658
- {
3659
- path: "/dashboard",
3660
- name: "Dashboard",
3661
- component: () => import("./index-BIbDky4c.js"),
3662
- meta: {
3663
- title: "仪表盘",
3664
- icon: "dashboard",
3665
- keepAlive: !0,
3666
- affix: !0
3667
- }
3668
- },
3669
- {
3670
- path: "/system/user",
3671
- name: "SystemUser",
3672
- component: () => import("./index-Cm5czPiu.js"),
3673
- meta: {
3674
- title: "用户管理",
3675
- icon: "user",
3676
- keepAlive: !0
3677
- }
3678
- },
3679
- {
3680
- path: "/system/role",
3681
- name: "SystemRole",
3682
- component: () => import("./index-BtIXVAVa.js"),
3683
- meta: {
3684
- title: "角色管理",
3685
- icon: "role",
3686
- keepAlive: !0
3687
- }
3688
- },
3689
- {
3690
- path: "/system/menu",
3691
- name: "SystemMenu",
3692
- component: () => import("./index-DynapQge.js"),
3693
- meta: {
3694
- title: "菜单管理",
3695
- icon: "menu",
3696
- keepAlive: !0
3697
- }
3698
- },
3699
- // catch-all 路由:让 404 在 Layout 内部渲染,保持左侧菜单显示
3700
- {
3701
- path: "/:pathMatch(.*)*",
3702
- name: "CatchAll",
3703
- component: () => Promise.resolve().then(() => Ht),
3704
- meta: {
3705
- title: "404",
3706
- hidden: !0
3707
- }
3708
- }
3709
- ]
3710
- }, ja = [
3711
- {
3712
- path: "/dashboard",
3713
- name: "Dashboard",
3714
- component: () => import("./index-BIbDky4c.js"),
3715
- meta: {
3716
- title: "仪表盘",
3717
- icon: "dashboard",
3718
- keepAlive: !0,
3719
- affix: !0
3720
- }
3721
- },
3722
- {
3723
- path: "/system",
3724
- name: "System",
3725
- redirect: "/system/user",
3726
- meta: {
3727
- title: "系统管理",
3728
- icon: "setting"
3729
- },
3730
- children: [
3731
- {
3732
- path: "user",
3733
- name: "SystemUser",
3734
- component: () => import("./index-Cm5czPiu.js"),
3735
- meta: {
3736
- title: "用户管理",
3737
- icon: "user",
3738
- keepAlive: !0
3739
- }
3740
- },
3741
- {
3742
- path: "role",
3743
- name: "SystemRole",
3744
- component: () => import("./index-BtIXVAVa.js"),
3745
- meta: {
3746
- title: "角色管理",
3747
- icon: "role",
3748
- keepAlive: !0
3749
- }
3750
- },
3751
- {
3752
- path: "menu",
3753
- name: "SystemMenu",
3754
- component: () => import("./index-DynapQge.js"),
3755
- meta: {
3756
- title: "菜单管理",
3757
- icon: "menu",
3758
- keepAlive: !0
3759
- }
3760
- }
3761
- ]
3762
- }
3763
- ], da = [
3764
- {
3765
- menuCode: "dashboard",
3766
- menuName: "仪表盘",
3767
- menuUrl: "/dashboard",
3768
- icon: "dashboard",
3769
- closable: !0,
3770
- isDefault: !0,
3771
- isOut: !1
3772
- },
3773
- {
3774
- menuCode: "system",
3775
- menuName: "系统管理",
3776
- menuUrl: "/system",
3777
- icon: "setting",
3778
- closable: !1,
3779
- isDefault: !1,
3780
- isOut: !1,
3781
- children: [
3782
- {
3783
- menuCode: "system_user",
3784
- menuName: "用户管理",
3785
- menuUrl: "/system/user",
3786
- icon: "user",
3787
- closable: !0,
3788
- isDefault: !1,
3789
- isOut: !1
3790
- },
3791
- {
3792
- menuCode: "system_role",
3793
- menuName: "角色管理",
3794
- menuUrl: "/system/role",
3795
- icon: "role",
3796
- closable: !0,
3797
- isDefault: !1,
3798
- isOut: !1
3799
- },
3800
- {
3801
- menuCode: "system_menu",
3802
- menuName: "菜单管理",
3803
- menuUrl: "/system/menu",
3804
- icon: "menu",
3805
- closable: !0,
3806
- isDefault: !1,
3807
- isOut: !1
3808
- }
3809
- ]
3810
- }
3811
- ], Yt = bt({
3812
- history: kt(),
3813
- routes: [...Wt, Xt],
3814
- scrollBehavior: () => ({ left: 0, top: 0 })
3815
- }), fa = ["/login"];
3816
- Yt.beforeEach(async (r, f, v) => {
3817
- const p = Pe();
3818
- if (p.initTheme(), zt())
3819
- if (r.path === "/login")
3820
- v({ path: "/" });
3821
- else {
3822
- const h = $e();
3823
- h.isLoggedIn || (h.setUserInfo({
3824
- appId: ct(),
3825
- userId: "1",
3826
- userName: "管理员",
3827
- departmentName: "技术部",
3828
- email: "admin@example.com",
3829
- mobilePhone: "13800138000",
3830
- positionName: "管理员",
3831
- avatar: ""
3832
- }), ze().setMenuList(da)), r.name && r.meta.keepAlive && p.addCachedView(r.name), v();
3833
- }
3834
- else
3835
- fa.includes(r.path) ? v() : v("/login");
3836
- });
3837
- function qa() {
3838
- const r = bt({
3839
- history: kt(),
3840
- routes: [...Wt, Xt]
3841
- });
3842
- Yt.matcher = r.matcher;
3843
- }
3844
- function Ga(r, f = {}) {
3845
- const v = f.indexPath || "/dashboard", p = {
3846
- path: "/:pathMatch(.*)*",
3847
- name: "CatchAll",
3848
- component: () => Promise.resolve().then(() => Ht),
3849
- meta: {
3850
- title: "404"
3851
- }
3852
- };
3853
- return {
3854
- path: "/",
3855
- name: "Layout",
3856
- component: Ft,
3857
- redirect: v,
3858
- children: [...r, p]
3859
- };
3860
- }
3861
- function Ka(r) {
3862
- return bt({
3863
- history: kt(),
3864
- routes: r,
3865
- scrollBehavior: () => ({ left: 0, top: 0 })
3866
- });
3867
- }
3868
- function Ha(r) {
3869
- return ce.get("/role/list", { params: r });
3870
- }
3871
- function Wa(r) {
3872
- return ce.get(`/role/${r}`);
3873
- }
3874
- function Xa(r) {
3875
- return ce.post("/role", r);
3876
- }
3877
- function Ya(r, f) {
3878
- return ce.put(`/role/${r}`, f);
3879
- }
3880
- function Ja(r) {
3881
- return ce.delete(`/role/${r}`);
3882
- }
3883
- function Za(r, f) {
3884
- return ce.patch(`/role/${r}/status`, { status: f });
3885
- }
3886
- function Qa() {
3887
- return ce.get("/user/v1.0/menu/list");
3888
- }
3889
- function pa(r) {
3890
- const f = r || ct();
3891
- return ce.get(`/user/v1.0/menu/get-menu?appId=${f}`);
3892
- }
3893
- function ei(r) {
3894
- return ce.post("/menu", r);
3895
- }
3896
- function ti(r, f) {
3897
- return ce.put(`/menu/${r}`, f);
3898
- }
3899
- function si(r) {
3900
- return ce.delete(`/menu/${r}`);
3901
- }
3902
- const ma = ["/login", "/404", "/403"];
3903
- function ni(r, f = {}) {
3904
- const v = f.whiteList || ma, p = f.loginPath || "/login", h = f.homePath || "/";
3905
- r.beforeEach(async (k, T, g) => {
3906
- const I = Pe(), _ = $e(), x = ze();
3907
- if (I.initTheme(), ut())
3908
- if (k.path === p)
3909
- g({ path: h });
3910
- else if (_.isLoggedIn)
3911
- k.name && k.meta.keepAlive && I.addCachedView(k.name), g();
3912
- else
3913
- try {
3914
- if (f.fetchUserInfo) {
3915
- const E = await f.fetchUserInfo();
3916
- _.setUserInfo(E);
3917
- } else {
3918
- const E = await Vr();
3919
- _.setUserInfo(E);
3920
- }
3921
- if (f.fetchMenu) {
3922
- const E = await f.fetchMenu();
3923
- x.setMenuList(E);
3924
- } else {
3925
- const E = await pa(f.appId);
3926
- x.setMenuList(E);
3927
- }
3928
- f.onLoginSuccess && f.onLoginSuccess(), k.name && k.meta.keepAlive && I.addCachedView(k.name), g({ ...k, replace: !0 });
3929
- } catch (E) {
3930
- console.error("获取用户信息失败:", E), _.clearUserInfo(), x.clearMenu(), He(), g({ path: p, query: { redirect: k.fullPath } });
3931
- }
3932
- else
3933
- v.includes(k.path) ? g() : g({ path: p, query: { redirect: k.fullPath } });
3934
- }), r.afterEach(() => {
3935
- });
3936
- }
3937
- function oi(r) {
3938
- return ce.get("/user/list", { params: r });
3939
- }
3940
- function ri(r) {
3941
- return ce.get(`/user/${r}`);
3942
- }
3943
- function ai(r) {
3944
- return ce.post("/user", r);
3945
- }
3946
- function ii(r, f) {
3947
- return ce.put(`/user/${r}`, f);
3948
- }
3949
- function li(r) {
3950
- return ce.delete(`/user/${r}`);
3951
- }
3952
- function ci(r) {
3953
- return ce.post("/user/batch-delete", { ids: r });
3954
- }
3955
- function ui(r, f) {
3956
- return ce.patch(`/user/${r}/status`, { status: f });
3957
- }
3958
- function di(r) {
3959
- return ce.post(`/user/${r}/reset-password`);
3960
- }
3961
- var ha = /* @__PURE__ */ ((r) => (r[r.ENABLED = 1] = "ENABLED", r[r.DISABLED = 0] = "DISABLED", r))(ha || {}), va = /* @__PURE__ */ ((r) => (r[r.UNKNOWN = 0] = "UNKNOWN", r[r.MALE = 1] = "MALE", r[r.FEMALE = 2] = "FEMALE", r))(va || {}), ga = /* @__PURE__ */ ((r) => (r[r.DIRECTORY = 0] = "DIRECTORY", r[r.MENU = 1] = "MENU", r[r.BUTTON = 2] = "BUTTON", r))(ga || {});
3962
- const fi = {
3963
- 1: "启用",
3964
- 0: "禁用"
3965
- }, pi = {
3966
- 0: "未知",
3967
- 1: "男",
3968
- 2: "女"
3969
- }, mi = {
3970
- 0: "目录",
3971
- 1: "菜单",
3972
- 2: "按钮"
3973
- }, hi = [
3974
- {
3975
- label: "启用",
3976
- value: 1
3977
- /* ENABLED */
3978
- },
3979
- {
3980
- label: "禁用",
3981
- value: 0
3982
- /* DISABLED */
3983
- }
3984
- ], vi = [
3985
- {
3986
- label: "未知",
3987
- value: 0
3988
- /* UNKNOWN */
3989
- },
3990
- {
3991
- label: "男",
3992
- value: 1
3993
- /* MALE */
3994
- },
3995
- {
3996
- label: "女",
3997
- value: 2
3998
- /* FEMALE */
3999
- }
4000
- ], gi = [
4001
- {
4002
- label: "目录",
4003
- value: 0
4004
- /* DIRECTORY */
4005
- },
4006
- {
4007
- label: "菜单",
4008
- value: 1
4009
- /* MENU */
4010
- },
4011
- {
4012
- label: "按钮",
4013
- value: 2
4014
- /* BUTTON */
4015
- }
4016
- ], _i = {
4017
- mounted(r, f) {
4018
- var p;
4019
- $e().isLoggedIn || (p = r.parentNode) == null || p.removeChild(r);
4020
- }
4021
- };
4022
- function wi(r) {
4023
- return os({
4024
- appId: r.appId,
4025
- clientId: r.clientId,
4026
- apiBaseUrl: r.apiBaseUrl
4027
- }), {
4028
- config: {
4029
- appName: r.appName || "XTO App",
4030
- appId: ct(),
4031
- clientId: Dt(),
4032
- apiBaseUrl: rs(),
4033
- indexPath: r.indexPath || "/dashboard",
4034
- loginPath: r.loginPath || "/login"
4035
- }
4036
- };
4037
- }
4038
- export {
4039
- hs as $,
4040
- Ia as A,
4041
- Qa as B,
4042
- pa as C,
4043
- Ma as D,
4044
- Sa as E,
4045
- Aa as F,
4046
- va as G,
4047
- wn as H,
4048
- Wa as I,
4049
- Ha as J,
4050
- ut as K,
4051
- Ft as L,
4052
- ga as M,
4053
- ds as N,
4054
- ls as O,
4055
- ri as P,
4056
- Vr as Q,
4057
- oi as R,
4058
- ha as S,
4059
- La as T,
4060
- za as U,
4061
- Fa as V,
4062
- zt as W,
4063
- ce as X,
4064
- os as Y,
4065
- Va as Z,
4066
- Se as _,
4067
- hi as a,
4068
- Xt as a0,
4069
- H as a1,
4070
- Ze as a2,
4071
- Fr as a3,
4072
- Ta as a4,
4073
- da as a5,
4074
- _i as a6,
4075
- Oa as a7,
4076
- di as a8,
4077
- qa as a9,
4078
- Yt as aa,
4079
- $a as ab,
4080
- Qe as ac,
4081
- ms as ad,
4082
- ps as ae,
4083
- us as af,
4084
- is as ag,
4085
- fs as ah,
4086
- Rt as ai,
4087
- cs as aj,
4088
- ni as ak,
4089
- Wt as al,
4090
- ti as am,
4091
- Ya as an,
4092
- Za as ao,
4093
- ii as ap,
4094
- ui as aq,
4095
- Ba as ar,
4096
- Pe as as,
4097
- Da as at,
4098
- Ye as au,
4099
- Pa as av,
4100
- ze as aw,
4101
- Ra as ax,
4102
- $e as ay,
4103
- gi as b,
4104
- Ua as c,
4105
- vi as d,
4106
- pi as e,
4107
- mi as f,
4108
- ra as g,
4109
- Ot as h,
4110
- Zr as i,
4111
- fi as j,
4112
- Na as k,
4113
- ci as l,
4114
- He as m,
4115
- Ga as n,
4116
- ei as o,
4117
- Xa as p,
4118
- Ka as q,
4119
- ai as r,
4120
- wi as s,
4121
- ja as t,
4122
- si as u,
4123
- Ja as v,
4124
- li as w,
4125
- rs as x,
4126
- ct as y,
4127
- Dt as z
4128
- };