xto-fronted 0.4.85 → 0.4.87

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