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