@ithinkdt/ui 4.0.15 → 4.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.js CHANGED
@@ -1 +1,1209 @@
1
- export * from '../dist/index.js'
1
+ import { n as e, t } from "./use-i18n-BUP_StIp.js";
2
+ import n, { c as r, cB as i, cE as a, cM as o } from "./use-style.js";
3
+ import { i as s, n as c, r as l, t as u } from "./directives-Chz4DK1u.js";
4
+ import { Fragment as d, computed as f, createVNode as p, defineComponent as m, inject as h, isVNode as g, mergeProps as _, provide as v, reactive as y, ref as b, renderSlot as x, shallowRef as S, toRef as C, toValue as w, unref as T, useTemplateRef as E, watch as D, withDirectives as O } from "vue";
5
+ import { computedAsync as ee, promiseTimeout as k, useElementHover as A, useElementSize as te, useEventListener as ne, watchDebounced as re } from "@vueuse/core";
6
+ import { NAvatar as j, NBadge as ie, NBreadcrumb as ae, NBreadcrumbItem as oe, NButton as M, NDrawer as se, NDrawerContent as ce, NDropdown as N, NEmpty as le, NIcon as P, NInput as F, NList as I, NListItem as L, NMenu as R, NPagination as z, NPopover as B, NScrollbar as V, NText as H, NThing as U, useThemeVars as W } from "ithinkdt-ui";
7
+ import { debounce as ue } from "@ithinkdt/common/fn";
8
+ import { useAtomicBroadcast as de } from "@ithinkdt/common/composables";
9
+ import { RouterLink as fe, useRouter as G } from "vue-router";
10
+ import { walkTree as pe } from "@ithinkdt/common/tree";
11
+ import { isNullish as me } from "@ithinkdt/common/object";
12
+ import { getOpaqueColor as he } from "@ithinkdt/common/color";
13
+ import { format as ge } from "date-fns";
14
+ //#region src/design/Account.jsx
15
+ function K(e) {
16
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
17
+ }
18
+ var _e = /* @__PURE__ */ m({
19
+ name: "AppAccount",
20
+ props: {
21
+ username: String,
22
+ nickname: String,
23
+ head: String,
24
+ showLogoutButton: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ showChangePwd: {
29
+ type: Boolean,
30
+ default: !0
31
+ }
32
+ },
33
+ emit: ["logout", "change-pwd"],
34
+ setup(t, { emit: n, slots: r }) {
35
+ let i = f(() => /^[\u4E00-\u9FA5]+$/.test(t.nickname) ? t.nickname?.slice(t.nickname?.length > 3 ? 2 : 1) : t.nickname?.split(" ")[0]), { t: a } = e(), o = p(P, { size: "28" }, { default: () => [p("svg", {
36
+ xmlns: "http://www.w3.org/2000/svg",
37
+ width: "1em",
38
+ height: "1em",
39
+ viewBox: "-4 -4 32 32"
40
+ }, [p("path", {
41
+ fill: "currentColor",
42
+ d: "M12 12q-1.65 0-2.825-1.175T8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12m-8 6v-.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2v.8q0 .825-.587 1.413T18 20H6q-.825 0-1.412-.587T4 18"
43
+ }, null)])] }), c = p("svg", {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: "1em",
46
+ height: "1em",
47
+ viewBox: "0 0 24 24"
48
+ }, [p("path", {
49
+ fill: "currentColor",
50
+ d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.99 9.99 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.99 9.99 0 0 1 12 22m7-6v-3h-8v-2h8V8l5 4z"
51
+ }, null)]);
52
+ return () => {
53
+ let e;
54
+ return p("div", { style: "display: flex; align-items: center" }, [
55
+ p(B, { style: "padding: 4px" }, {
56
+ trigger: () => p(M, {
57
+ quaternary: !0,
58
+ style: "--n-padding: 0 12px"
59
+ }, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(j, {
60
+ key: t.head ? "head" : "no-head",
61
+ src: t.head,
62
+ round: !0,
63
+ size: "small",
64
+ radix: .78,
65
+ color: "var(--color-primary-hover)"
66
+ }, {
67
+ fallback: () => o,
68
+ placeholder: () => o,
69
+ default: t.head ? void 0 : () => i.value
70
+ }), p("span", { style: "font-size: 14px" }, [t.username ?? ""])])] }),
71
+ default: () => {
72
+ let e = () => t.showChangePwd ? p(M, {
73
+ quaternary: !0,
74
+ style: "justify-content: left",
75
+ onClick: () => n("change-pwd")
76
+ }, {
77
+ icon: () => p(P, null, { default: () => [p("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: "1em",
80
+ height: "1em",
81
+ viewBox: "0 0 32 32"
82
+ }, [p("path", {
83
+ fill: "currentColor",
84
+ d: "M21 2a8.998 8.998 0 0 0-8.612 11.612L2 24v6h6l10.388-10.388A9 9 0 1 0 21 2m0 16a7 7 0 0 1-2.032-.302l-1.147-.348l-.847.847l-3.181 3.181L12.414 20L11 21.414l1.379 1.379l-1.586 1.586L9.414 23L8 24.414l1.379 1.379L7.172 28H4v-3.172l9.802-9.802l.848-.847l-.348-1.147A7 7 0 1 1 21 18"
85
+ }, null), p("circle", {
86
+ cx: "22",
87
+ cy: "10",
88
+ r: "2",
89
+ fill: "currentColor"
90
+ }, null)])] }),
91
+ default: () => a("common.account.changePwd")
92
+ }) : void 0, i = () => t.showLogoutButton ? void 0 : p(M, {
93
+ quaternary: !0,
94
+ style: "justify-content: left",
95
+ onClick: () => n("logout")
96
+ }, {
97
+ icon: () => p(P, null, K(c) ? c : { default: () => [c] }),
98
+ default: () => [a("common.account.logout")]
99
+ });
100
+ return x(r, "dropdown", {
101
+ pwd: e,
102
+ logout: i
103
+ }, () => [p("div", { style: "display: flex; flex-direction: column" }, [
104
+ e(),
105
+ x(r, "dropdownExtra"),
106
+ i()
107
+ ])]);
108
+ }
109
+ }),
110
+ x(r, "extra"),
111
+ t.showLogoutButton ? O(p(M, {
112
+ quaternary: !0,
113
+ style: "--n-padding: 0 12px",
114
+ onClick: () => t.username && n("logout")
115
+ }, K(e = x(r, "logoutButton", void 0, () => [p(P, { size: "16" }, K(c) ? c : { default: () => [c] })])) ? e : { default: () => [e] }), [[
116
+ s,
117
+ a("common.account.logout"),
118
+ void 0,
119
+ { "bottom-end": !0 }
120
+ ]]) : void 0
121
+ ]);
122
+ };
123
+ }
124
+ }), ve = /* @__PURE__ */ m({
125
+ name: "AppAppearance",
126
+ props: { mode: String },
127
+ emit: ["update:mode"],
128
+ setup(t, { emit: n }) {
129
+ let { t: r } = e();
130
+ return () => O(p(M, {
131
+ quaternary: !0,
132
+ style: "--n-padding: 0 12px",
133
+ onClick: () => {
134
+ n("update:mode", t.mode === "light" ? "dark" : t.mode === "dark" ? "auto" : "light");
135
+ }
136
+ }, { default: () => [p(P, { size: "18" }, { default: () => [t.mode === "light" ? p("svg", {
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
139
+ role: "img",
140
+ width: "1em",
141
+ height: "1em",
142
+ viewBox: "0 0 24 24"
143
+ }, [p("path", {
144
+ fill: "currentColor",
145
+ d: "M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15Zm0 2q-2.075 0-3.537-1.463Q7 14.075 7 12t1.463-3.538Q9.925 7 12 7t3.538 1.462Q17 9.925 17 12q0 2.075-1.462 3.537Q14.075 17 12 17ZM1 13v-2h4v2Zm18 0v-2h4v2Zm-8-8V1h2v4Zm0 18v-4h2v4ZM6.35 7.75L3.875 5.275l1.4-1.4L7.75 6.35Zm12.375 12.375L16.25 17.65l1.4-1.4l2.475 2.475ZM17.65 7.75l-1.4-1.4l2.475-2.475l1.4 1.4ZM5.275 20.125l-1.4-1.4L6.35 16.25l1.4 1.4ZM12 12Z"
146
+ }, null)]) : t.mode === "dark" ? p("svg", {
147
+ xmlns: "http://www.w3.org/2000/svg",
148
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
149
+ role: "img",
150
+ width: "1em",
151
+ height: "1em",
152
+ viewBox: "0 0 24 24"
153
+ }, [p("path", {
154
+ fill: "currentColor",
155
+ d: "M12 21q-3.75 0-6.375-2.625T3 12q0-3.75 2.625-6.375T12 3q.35 0 .688.025q.337.025.662.075q-1.025.725-1.637 1.887Q11.1 6.15 11.1 7.5q0 2.25 1.575 3.825Q14.25 12.9 16.5 12.9q1.375 0 2.525-.613q1.15-.612 1.875-1.637q.05.325.075.662Q21 11.65 21 12q0 3.75-2.625 6.375T12 21Zm0-2q2.2 0 3.95-1.212q1.75-1.213 2.55-3.163q-.5.125-1 .2q-.5.075-1 .075q-3.075 0-5.238-2.162Q9.1 10.575 9.1 7.5q0-.5.075-1t.2-1q-1.95.8-3.162 2.55Q5 9.8 5 12q0 2.9 2.05 4.95Q9.1 19 12 19Zm-.25-6.75Z"
156
+ }, null)]) : p("svg", {
157
+ xmlns: "http://www.w3.org/2000/svg",
158
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
159
+ role: "img",
160
+ width: "1em",
161
+ height: "1em",
162
+ viewBox: "0 0 24 24"
163
+ }, [p("path", {
164
+ fill: "currentColor",
165
+ d: "M11 19q1.35 0 2.513-.538q1.162-.537 1.987-1.487q-3.15-.2-5.325-2.488Q8 12.2 8 9q0-.325.025-.638q.025-.312.075-.612q-1.4.775-2.25 2.162Q5 11.3 5 13q0 2.5 1.75 4.25T11 19Zm0 2q-3.35 0-5.675-2.325Q3 16.35 3 13q0-3.35 2.325-5.675Q7.65 5 11 5q.125 0 .25.012q.125.013.25.013q-.725.8-1.113 1.812Q10 7.85 10 9q0 2.5 1.75 4.25T16 15q.8 0 1.525-.2q.725-.2 1.375-.55q-.45 2.875-2.662 4.812Q14.025 21 11 21Zm2.8-10L17 2h2l3.2 9h-1.9l-.7-2h-3.2l-.7 2Zm3.05-3.35h2.3L18 4Z"
166
+ }, null)])] })] }), [[
167
+ s,
168
+ t.mode === "light" ? r("common.layout.mode.light") : t.mode === "dark" ? r("common.layout.mode.dark") : r("common.layout.mode.auto"),
169
+ void 0,
170
+ { bottom: !0 }
171
+ ]]);
172
+ }
173
+ }), q = "APP_SIDEBAR_COLLAPSED", J = () => p("svg", {
174
+ xmlns: "http://www.w3.org/2000/svg",
175
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
176
+ role: "img",
177
+ width: "1em",
178
+ height: "1em",
179
+ viewBox: "0 0 24 24"
180
+ }, [p("path", {
181
+ fill: "currentColor",
182
+ d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
183
+ }, null)]), Y = "__APP_CTX__", X = () => h(Y);
184
+ //#endregion
185
+ //#region src/design/Breadcrumb.jsx
186
+ function ye(e) {
187
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
188
+ }
189
+ var be = /* @__PURE__ */ m({
190
+ name: "AppBreadcrumb",
191
+ props: {
192
+ items: {
193
+ type: Array,
194
+ default: () => []
195
+ },
196
+ getIcon: {
197
+ type: Function,
198
+ default: void 0
199
+ }
200
+ },
201
+ setup(e) {
202
+ let t = G(), n = Symbol(), r = Symbol();
203
+ return D(() => e.items, (t) => {
204
+ pe(t, (t) => {
205
+ t.icon && (typeof t.icon == "string" ? (t[n] = e.getIcon?.(t.icon), t[r] = () => t[n]?.() || J()) : t[r] = t.icon);
206
+ });
207
+ }, { immediate: !0 }), () => {
208
+ let n;
209
+ return p(ae, null, ye(n = e.items.map((e) => p(oe, {
210
+ clickable: e.href?.length > 0,
211
+ separator: e.separator,
212
+ onClick: e.href && ((n) => {
213
+ n.stopPropagation(), t.push(e.href);
214
+ })
215
+ }, { default: () => [e.icon ? p(d, null, [p(P, { component: e[r] }, null), " "]) : void 0, w(e.title)] }))) ? n : { default: () => [n] });
216
+ };
217
+ }
218
+ }), xe = /* @__PURE__ */ m({
219
+ name: "AppLanguage",
220
+ props: {
221
+ lang: String,
222
+ supports: Array
223
+ },
224
+ emit: ["update:lang"],
225
+ setup(e, { emit: t }) {
226
+ return () => p(N, {
227
+ options: e.supports,
228
+ keyField: "value",
229
+ showArrow: !0,
230
+ onSelect: (e) => t("update:lang", e)
231
+ }, { default: () => [p(M, {
232
+ quaternary: !0,
233
+ style: "--n-padding: 0 12px"
234
+ }, { default: () => [p(P, { size: "18" }, { default: () => [p("svg", {
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
237
+ role: "img",
238
+ width: "1em",
239
+ height: "1em",
240
+ viewBox: "0 0 24 24"
241
+ }, [p("g", {
242
+ fill: "none",
243
+ stroke: "currentColor",
244
+ "stroke-linecap": "round",
245
+ "stroke-linejoin": "round",
246
+ "stroke-width": "1.5"
247
+ }, [p("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), p("path", { d: "M13 2.05S16 6 16 12c0 6-3 9.95-3 9.95m-2 0S8 18 8 12c0-6 3-9.95 3-9.95M2.63 15.5h18.74m-18.74-7h18.74" }, null)])])] })] })] });
248
+ }
249
+ }), Se = /* @__PURE__ */ r([
250
+ i("layout", {
251
+ display: "grid",
252
+ gridTemplateAreas: "\n 'sidebar header'\n 'sidebar content'\n 'sidebar footer'\n ",
253
+ gridTemplateRows: "auto 1fr auto",
254
+ gridTemplateColumns: "auto 1fr",
255
+ position: "relative",
256
+ top: "0",
257
+ left: "0",
258
+ transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
259
+ "--app-content-height": "calc(100vh - var(--app-header-height) - var(--app-footer-height))"
260
+ }, [o("full-header", { gridTemplateAreas: "\n 'header header'\n 'sidebar content'\n 'sidebar footer'\n " }), o("full-content", {
261
+ width: "calc(100% + var(--app-sidebar-width))",
262
+ height: "calc(100% + var(--app-header-height))",
263
+ left: "calc(-1 * var(--app-sidebar-width))",
264
+ top: "calc(-1 * var(--app-header-height))"
265
+ })]),
266
+ i("header", {
267
+ gridArea: "header",
268
+ overflow: "hidden",
269
+ zIndex: "2",
270
+ height: "var(--app-header-height, 44px)"
271
+ }),
272
+ i("sidebar", {
273
+ gridArea: "sidebar",
274
+ width: "var(--app-sidebar-width, 220px)",
275
+ display: "flex",
276
+ flexDirection: "column",
277
+ overflow: "auto",
278
+ position: "relative",
279
+ transition: "width 0.2s ease-in-out",
280
+ zIndex: "3"
281
+ }, [a("collapse-btn", {
282
+ "--n-padding": "0 12px",
283
+ position: "absolute",
284
+ zIndex: "2",
285
+ bottom: "8px",
286
+ right: "8px",
287
+ "backdrop-filter": "blur(4px)"
288
+ })]),
289
+ i("content", {
290
+ gridArea: "content",
291
+ position: "relative",
292
+ overflow: "hidden",
293
+ zIndex: "1"
294
+ }),
295
+ i("footer", {
296
+ gridArea: "footer",
297
+ lineHeight: "32px",
298
+ textAlign: "center",
299
+ color: "gray"
300
+ })
301
+ ]), Ce = () => p("svg", {
302
+ xmlns: "http://www.w3.org/2000/svg",
303
+ width: "1em",
304
+ height: "1em",
305
+ viewBox: "0 0 24 24"
306
+ }, [p("path", {
307
+ fill: "none",
308
+ stroke: "currentColor",
309
+ "stroke-linecap": "round",
310
+ "stroke-linejoin": "round",
311
+ "stroke-width": "1.5",
312
+ d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
313
+ color: "currentColor"
314
+ }, null)]), we = () => p("svg", {
315
+ xmlns: "http://www.w3.org/2000/svg",
316
+ width: "1em",
317
+ height: "1em",
318
+ viewBox: "0 0 24 24"
319
+ }, [p("path", {
320
+ fill: "none",
321
+ stroke: "currentColor",
322
+ "stroke-linecap": "round",
323
+ "stroke-linejoin": "round",
324
+ "stroke-width": "1.5",
325
+ d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
326
+ color: "currentColor"
327
+ }, null)]), Te = /* @__PURE__ */ m({
328
+ name: "AppLayout",
329
+ props: {
330
+ layout: {
331
+ type: String,
332
+ default: "left2right"
333
+ },
334
+ fullContent: Boolean
335
+ },
336
+ setup(e, { slots: t }) {
337
+ n("-layout", Se, b("app"), !1);
338
+ let r = y({
339
+ sidebarWidth: "0px",
340
+ headerHeight: "0px",
341
+ footerHeight: "0px",
342
+ hasMultiTab: !1
343
+ });
344
+ return v(Y, r), () => {
345
+ let { layout: n } = e;
346
+ return p("div", {
347
+ class: {
348
+ "app-layout": !0,
349
+ "app-layout--full-header": n === "top2bottom",
350
+ "app-layout--full-content": e.fullContent
351
+ },
352
+ style: {
353
+ "--app-sidebar-width": r.sidebarWidth,
354
+ "--app-header-height": r.headerHeight,
355
+ "--app-footer-height": r.footerHeight
356
+ }
357
+ }, [x(t, "default")]);
358
+ };
359
+ }
360
+ }), Ee = /* @__PURE__ */ m({
361
+ name: "AppHeader",
362
+ props: { height: {
363
+ type: Number,
364
+ default: 44
365
+ } },
366
+ setup(e, { slots: t }) {
367
+ let n = X();
368
+ return () => (n.headerHeight = e.height + "px", p("div", { class: "app-header" }, [x(t, "default")]));
369
+ }
370
+ }), De = /* @__PURE__ */ m({
371
+ name: "AppSidebar",
372
+ props: {
373
+ showCollapseBtn: {
374
+ type: Boolean,
375
+ default: !0
376
+ },
377
+ collapsed: Boolean,
378
+ width: {
379
+ type: Number,
380
+ default: 220
381
+ },
382
+ collapsedWidth: {
383
+ type: Number,
384
+ default: 60
385
+ }
386
+ },
387
+ emits: { "update:collapsed": () => !0 },
388
+ setup(t, { emit: n, slots: r }) {
389
+ v(q, C(t, "collapsed"));
390
+ let { t: i } = e(), a = X();
391
+ return () => (a.sidebarWidth = (t.collapsed ? t.collapsedWidth : t.width) + "px", p("div", { class: "app-sidebar" }, [x(r, "default"), t.showCollapseBtn ? O(p(M, {
392
+ class: "app-sidebar__collapse-btn",
393
+ quaternary: !0,
394
+ onClick: () => {
395
+ n("update:collapsed", !t.collapsed);
396
+ }
397
+ }, { default: () => [p(P, { size: "20" }, { default: () => [t.collapsed ? p(we, null, null) : p(Ce, null, null)] })] }), [[s, t.collapsed ? i("common.layout.sidebar.expand") : i("common.layout.sidebar.collapse")]]) : void 0]));
398
+ }
399
+ }), Oe = /* @__PURE__ */ m({
400
+ name: "AppContent",
401
+ setup(e, { slots: t }) {
402
+ return () => p("div", { class: "app-content" }, [x(t, "default")]);
403
+ }
404
+ }), ke = /* @__PURE__ */ m({
405
+ name: "AppFooter",
406
+ props: { height: {
407
+ type: Number,
408
+ default: 30
409
+ } },
410
+ setup(e, { slots: t }) {
411
+ let n = X();
412
+ return () => (n.footerHeight = e.height + "px", p("div", { class: "app-footer" }, [x(t, "default")]));
413
+ }
414
+ });
415
+ //#endregion
416
+ //#region src/design/Logo.jsx
417
+ function Ae(e) {
418
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
419
+ }
420
+ var je = /* @__PURE__ */ m({
421
+ name: "AppLogo",
422
+ props: {
423
+ src: [String, Function],
424
+ name: String,
425
+ collapsed: {
426
+ type: Boolean,
427
+ default: void 0
428
+ },
429
+ center: {
430
+ type: Boolean,
431
+ default: !1
432
+ },
433
+ link: {
434
+ type: Boolean,
435
+ default: !0
436
+ }
437
+ },
438
+ setup(e, { slots: t }) {
439
+ let n = ee(() => typeof e.src == "function" ? e.src() : e.src), r = h(q, !1);
440
+ return () => {
441
+ let { name: i, collapsed: a, center: o, link: s } = e;
442
+ a ??= T(r);
443
+ let c = a ? 1 : 1 / 1.1;
444
+ return p("div", {
445
+ class: "app-logo",
446
+ style: {
447
+ "--app-logo-img-size": "32px",
448
+ "--app-logo-name-size": "22px",
449
+ width: o ? "100%" : "auto",
450
+ overflow: "hidden",
451
+ display: "flex",
452
+ alignItems: "center",
453
+ justifyContent: o ? "center" : "flex-start",
454
+ cursor: s ? "pointer" : void 0
455
+ }
456
+ }, [x(t, "default", void 0, () => [p("div", {
457
+ class: "app-logo__img",
458
+ style: `
459
+ width: ${a ? "var(--app-sidebar-width, 60px)" : "56px"};
460
+ font-size: ${a ? "calc(var(--app-sidebar-width, 60px) - 24px)" : "32px"};
461
+ transition: width 0.2s ease-in-out 0.1s;
462
+ flex: 0 0 auto;
463
+ display: flex;
464
+ justify-content: center
465
+ `
466
+ }, [x(t, "icon", void 0, () => [p("img", {
467
+ src: n.value,
468
+ alt: "App Logo",
469
+ style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${c})`
470
+ }, null)])])]), i ? p(H, {
471
+ class: "app-logo__name",
472
+ style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
473
+ }, Ae(i) ? i : { default: () => [i] }) : void 0]);
474
+ };
475
+ }
476
+ });
477
+ //#endregion
478
+ //#region src/design/Menu.jsx
479
+ function Z(e) {
480
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
481
+ }
482
+ var Me = /* @__PURE__ */ m({
483
+ name: "AppMenu",
484
+ props: {
485
+ menus: Array,
486
+ getIcon: Function,
487
+ current: String,
488
+ horizontal: Boolean,
489
+ single: Boolean,
490
+ accordion: Boolean,
491
+ collapsed: {
492
+ type: Boolean,
493
+ default: void 0
494
+ },
495
+ renderLabel: Function,
496
+ width: {
497
+ type: Number,
498
+ default: 220
499
+ },
500
+ collapsedWidth: {
501
+ type: Number,
502
+ default: 60
503
+ }
504
+ },
505
+ setup(e) {
506
+ let t = S([]);
507
+ D([() => e.menus, () => e.single], ([n, r]) => {
508
+ if (t.value = [], !n?.length) return;
509
+ let i = (t, n = 0) => {
510
+ let a = [];
511
+ for (let o of t) {
512
+ if (o.type === "action") continue;
513
+ let t = o.type === "view" ? void 0 : i(o.children ?? [], n + 1), s = {
514
+ _: o,
515
+ key: o.key,
516
+ label: () => e.renderLabel?.(o) ?? o.name,
517
+ icon: n === 0 || o.icon ? me(o.icon) || typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
518
+ children: r ? void 0 : t,
519
+ path: o.path || (r ? t?.[0]?.path : void 0),
520
+ depth: n
521
+ };
522
+ delete s.type, a.push(s);
523
+ }
524
+ return a;
525
+ };
526
+ t.value = i(n);
527
+ }, { immediate: !0 }), D([E("menu"), () => e.current], ([e, t]) => {
528
+ e?.showOption(t);
529
+ }, { immediate: !0 });
530
+ let n = h(q, !1), r = (t) => {
531
+ let r = e.collapsed ?? T(n), i;
532
+ if (t._.type === "view") if (t.isExternal && t.externalEmbed) i = p("a", {
533
+ href: t.externalLink,
534
+ target: "_blank",
535
+ onClick: (e) => e.stopPropagation()
536
+ }, [t.label()]);
537
+ else {
538
+ let e;
539
+ i = p(fe, { to: t.path }, Z(e = t.label()) ? e : { default: () => [e] });
540
+ }
541
+ else i = p("span", null, [t.label()]);
542
+ return i.key = `${t.key}:${+!!r}`, t.depth === 0 && !r && (i = O(p("div", null, [i]), [[
543
+ s,
544
+ t.label(),
545
+ void 0,
546
+ {
547
+ auto: !0,
548
+ right: !0
549
+ }
550
+ ]])), t.isNew && (i = p("div", { style: "display: flex; width: 100%" }, [p("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [i]), p("svg", {
551
+ xmlns: "http://www.w3.org/2000/svg",
552
+ width: "24",
553
+ height: "24",
554
+ viewBox: "0 0 1024 1024",
555
+ style: "margin-left: 8px; flex: 0 0 auto;"
556
+ }, [p("path", {
557
+ d: "M245.76 286.72h552.96c124.928 0 225.28 100.352 225.28 225.28s-100.352 225.28-225.28 225.28H0V532.48c0-135.168 110.592-245.76 245.76-245.76z m133.12 348.16V401.408H348.16v178.176l-112.64-178.176H204.8V634.88h30.72v-178.176L348.16 634.88h30.72z m182.272-108.544v-24.576h-96.256v-75.776h110.592v-24.576h-141.312V634.88h143.36v-24.576h-112.64v-83.968h96.256z m100.352 28.672l-34.816-151.552h-34.816l55.296 233.472H675.84l47.104-161.792 4.096-20.48 4.096 20.48 47.104 161.792h28.672l57.344-233.472h-34.816l-32.768 151.552-4.096 30.72-6.144-30.72-40.96-151.552h-30.72l-40.96 151.552-6.144 30.72-6.144-30.72z",
558
+ fill: "var(--color-danger)"
559
+ }, null)])])), i;
560
+ };
561
+ return () => {
562
+ let i = p(R, {
563
+ ref: "menu",
564
+ options: t.value,
565
+ rootIndent: 16,
566
+ accordion: e.accordion,
567
+ collapsed: e.collapsed ?? T(n),
568
+ dropdownProps: { showArrow: !0 },
569
+ mode: e.horizontal ? "horizontal" : "vertical",
570
+ value: e.current ?? null,
571
+ renderLabel: r,
572
+ responsive: !0,
573
+ collapsedWidth: e.collapsedWidth,
574
+ width: e.width
575
+ }, null);
576
+ return e.horizontal ? i : p(V, null, Z(i) ? i : { default: () => [i] });
577
+ };
578
+ }
579
+ });
580
+ //#endregion
581
+ //#region src/design/MultiTabs.jsx
582
+ function Ne(e) {
583
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
584
+ }
585
+ function Pe(t, n, r) {
586
+ let { t: i } = e(), a = y({
587
+ visible: !1,
588
+ x: 0,
589
+ y: 0
590
+ }), o = async (e, t) => {
591
+ e.preventDefault(), e.stopPropagation(), !(a.visible && a.tab === t) && (a.tab = t, a.visible && (a.visible = !1, await k(130)), a.visible = !0, a.x = e.clientX, a.y = e.clientY);
592
+ }, s = async () => {
593
+ requestIdleCallback(() => {
594
+ a.visible = !1;
595
+ }, { timeout: 30 });
596
+ }, c = G();
597
+ return {
598
+ ctx: a,
599
+ onCtx: o,
600
+ onClickOutside: s,
601
+ options: f(() => [
602
+ {
603
+ key: "reload",
604
+ label: i("common.layout.tabs.reloadTab"),
605
+ disabled: !a.tab || a.tab.key !== n.value,
606
+ icon: () => p(P, { size: 20 }, { default: () => [p("svg", {
607
+ xmlns: "http://www.w3.org/2000/svg",
608
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
609
+ role: "img",
610
+ width: "1em",
611
+ height: "1em",
612
+ viewBox: "0 0 24 24"
613
+ }, [p("path", {
614
+ fill: "currentColor",
615
+ d: "M17.65 6.35A7.958 7.958 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35Z"
616
+ }, null)])] })
617
+ },
618
+ {
619
+ key: "fullTab",
620
+ label: i("common.layout.tabs.fullTab"),
621
+ icon: () => p(P, { size: 16 }, { default: () => [p("svg", {
622
+ xmlns: "http://www.w3.org/2000/svg",
623
+ width: "1em",
624
+ height: "1em",
625
+ viewBox: "0 0 24 24"
626
+ }, [p("path", {
627
+ fill: "currentColor",
628
+ "fill-rule": "evenodd",
629
+ d: "M18.29 2.89c-1.028-.138-2.383-.14-4.29-.14a.75.75 0 0 1 0-1.5h.056c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433V10a.75.75 0 0 1-1.5 0c0-1.907-.002-3.261-.14-4.29c-.135-1.005-.389-1.585-.812-2.008s-1.003-.677-2.009-.812M2 13.25a.75.75 0 0 1 .75.75c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14a.75.75 0 0 1 0 1.5h-.056c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V14a.75.75 0 0 1 .75-.75",
630
+ "clip-rule": "evenodd"
631
+ }, null), p("path", {
632
+ fill: "currentColor",
633
+ d: "M9.944 1.25H10a.75.75 0 0 1 0 1.5c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S3.025 4.705 2.89 5.71c-.138 1.029-.14 2.383-.14 4.29a.75.75 0 0 1-1.5 0v-.056c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153M22 13.25a.75.75 0 0 1 .75.75v.056c0 1.838 0 3.294-.153 4.433c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H14a.75.75 0 0 1 0-1.5c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812s.677-1.003.812-2.009c.138-1.027.14-2.382.14-4.289a.75.75 0 0 1 .75-.75",
634
+ opacity: ".5"
635
+ }, null)])] })
636
+ },
637
+ {
638
+ key: "open",
639
+ label: i("common.layout.tabs.openTabBlank"),
640
+ disabled: !a.tab,
641
+ icon: () => p(P, { size: 20 }, { default: () => [p("svg", {
642
+ xmlns: "http://www.w3.org/2000/svg",
643
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
644
+ role: "img",
645
+ width: "1em",
646
+ height: "1em",
647
+ viewBox: "0 0 15 15"
648
+ }, [p("path", {
649
+ fill: "currentColor",
650
+ "clip-rule": "evenodd",
651
+ "fill-rule": "evenodd",
652
+ d: "M12 13a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v3.5a.5.5 0 0 0 1 0V3h9v9H8.5a.5.5 0 0 0 0 1H12ZM9 6.5v3a.5.5 0 0 1-1 0V7.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 7H5.5a.5.5 0 0 1 0-1h3a.498.498 0 0 1 .5.497"
653
+ }, null)])] })
654
+ },
655
+ {
656
+ key: "closeAll",
657
+ label: i("common.layout.tabs.closeAllTabs"),
658
+ icon: () => p(P, { size: 20 }, { default: () => [p("svg", {
659
+ xmlns: "http://www.w3.org/2000/svg",
660
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
661
+ role: "img",
662
+ width: "1em",
663
+ height: "1em",
664
+ viewBox: "0 0 24 24"
665
+ }, [p("path", {
666
+ fill: "currentColor",
667
+ d: "M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6L6.4 19Z"
668
+ }, null)])] })
669
+ },
670
+ {
671
+ key: "closeLeft",
672
+ label: i("common.layout.tabs.closeLeftTabs"),
673
+ disabled: !a.tab,
674
+ icon: () => p(P, { size: 20 }, { default: () => [p("svg", {
675
+ xmlns: "http://www.w3.org/2000/svg",
676
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
677
+ role: "img",
678
+ width: "1em",
679
+ height: "1em",
680
+ viewBox: "0 0 24 24"
681
+ }, [p("path", {
682
+ fill: "currentColor",
683
+ d: "M11 16v-3h10v-2H11V8l-4 4l4 4m-8 4h2V4H3v16Z"
684
+ }, null)])] })
685
+ },
686
+ {
687
+ key: "closeRight",
688
+ label: i("common.layout.tabs.closeRightTabs"),
689
+ disabled: !a.tab,
690
+ icon: () => p(P, { size: 20 }, { default: () => [p("svg", {
691
+ xmlns: "http://www.w3.org/2000/svg",
692
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
693
+ role: "img",
694
+ width: "1em",
695
+ height: "1em",
696
+ viewBox: "0 0 24 24"
697
+ }, [p("path", {
698
+ fill: "currentColor",
699
+ d: "M13 8v3H3v2h10v3l4-4l-4-4m6 12h2V4h-2v16Z"
700
+ }, null)])] })
701
+ },
702
+ {
703
+ key: "closeOther",
704
+ label: i("common.layout.tabs.closeOtherTabs"),
705
+ disabled: !a.tab,
706
+ icon: () => p(P, { size: 20 }, { default: () => [" ", p("svg", {
707
+ xmlns: "http://www.w3.org/2000/svg",
708
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
709
+ role: "img",
710
+ width: "1em",
711
+ height: "1em",
712
+ viewBox: "0 0 1024 1024"
713
+ }, [p("path", {
714
+ fill: "currentColor",
715
+ d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 0 0-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 0 0 0 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
716
+ }, null)])] })
717
+ }
718
+ ]),
719
+ onSelect: async (e) => {
720
+ a.visible = !1;
721
+ let i = [...t.value];
722
+ if (e === "closeAll") {
723
+ await c.push("/");
724
+ for (let e of i) e.key !== n.value && e.close(!1);
725
+ return;
726
+ }
727
+ if (e === "fullTab") {
728
+ r();
729
+ return;
730
+ }
731
+ if (a.tab) switch (e) {
732
+ case "open":
733
+ window.open(a.tab.href, "_blank");
734
+ break;
735
+ case "reload":
736
+ a.tab.reloading || (a.tab.reloading = !0, await k(220), a.tab.reloading = !1);
737
+ break;
738
+ case "close":
739
+ a.tab?.close();
740
+ break;
741
+ case "closeOther":
742
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
743
+ for (let e of i) e.key !== a.tab.key && e.close(!1);
744
+ break;
745
+ case "closeLeft":
746
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
747
+ for (let e of t.value.slice(0, i.indexOf(a.tab))) e.close(!1);
748
+ break;
749
+ case "closeRight":
750
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
751
+ for (let e of t.value.slice(i.indexOf(a.tab) + 1)) e.close(!1);
752
+ break;
753
+ }
754
+ }
755
+ };
756
+ }
757
+ function Fe(e, t, n) {
758
+ function r(n) {
759
+ if (n === -1 || !t.value?.children.length) return;
760
+ let r = t.value.children[n];
761
+ e.value.scrollTo({
762
+ behavior: "smooth",
763
+ left: Math.max(0, t.value.offsetLeft + r.offsetLeft - e.value.clientWidth / 2 + r.clientWidth / 2 + 10)
764
+ });
765
+ }
766
+ return re(A(e), (e) => {
767
+ e || r(n.value);
768
+ }, { debounce: 333 }), D(n, r, { flush: "post" }), ne(e, "wheel", (t) => {
769
+ t.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (t.preventDefault(), e.value.scrollBy({ left: t.deltaY }));
770
+ }, { passive: !1 }), {
771
+ el: e,
772
+ content: t
773
+ };
774
+ }
775
+ var Q = (e) => p("svg", e, [
776
+ p("defs", null, [
777
+ p("symbol", {
778
+ id: "geometry-left",
779
+ viewBox: "0 0 214 36"
780
+ }, [p("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }, null)]),
781
+ p("symbol", {
782
+ id: "geometry-right",
783
+ viewBox: "0 0 214 36"
784
+ }, [p("use", { "xlink:href": "#geometry-left" }, null)]),
785
+ p("clipPath", null, [p("rect", {
786
+ width: "100%",
787
+ height: "100%",
788
+ x: "0"
789
+ }, null)])
790
+ ]),
791
+ p("svg", {
792
+ width: "50%",
793
+ height: "100%"
794
+ }, [p("use", {
795
+ "xlink:href": "#geometry-left",
796
+ width: "214",
797
+ height: "36",
798
+ fill: "currentColor"
799
+ }, null)]),
800
+ p("g", { transform: "scale(-1, 1)" }, [p("svg", {
801
+ width: "50%",
802
+ height: "100%",
803
+ x: "-100%",
804
+ y: "0"
805
+ }, [p("use", {
806
+ "xlink:href": "#geometry-right",
807
+ width: "214",
808
+ height: "36",
809
+ fill: "currentColor"
810
+ }, null)])])
811
+ ]), Ie = /* @__PURE__ */ m({
812
+ name: "AppTab",
813
+ props: {
814
+ path: String,
815
+ isCurrent: Boolean,
816
+ isLast: Boolean,
817
+ closable: Boolean,
818
+ dark: Boolean
819
+ },
820
+ emits: ["close"],
821
+ setup(e, { emit: t, slots: n }) {
822
+ let r = b(), i = A(r), a = b(), o = b(), { width: s } = te(o);
823
+ D(s, async () => {
824
+ await k(1), a.value.style.width = o.value.scrollWidth + "px";
825
+ });
826
+ let c = W(), l = f(() => ({
827
+ fontSize: "14px",
828
+ color: e.isCurrent ? c.value.primaryColor : c.value.textColor3,
829
+ maxWidth: "355px",
830
+ overflow: "hidden"
831
+ })), u = f(() => ({
832
+ width: "calc(100% + 27px)",
833
+ height: "100%",
834
+ position: "absolute",
835
+ top: "0",
836
+ left: "-14px",
837
+ zIndex: e.isCurrent ? -1 : -2,
838
+ color: e.isCurrent ? he(c.value.primaryColor, e.dark ? .3 : .12, e.dark ? "#000" : "#fff") : i.value ? c.value.borderColor : "transparent"
839
+ }));
840
+ return () => p("div", {
841
+ ref: r,
842
+ style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
843
+ }, [
844
+ p("div", {
845
+ ref: a,
846
+ style: "transition: width 300ms; overflow: hidden"
847
+ }, [p("div", {
848
+ ref: o,
849
+ style: "display: flex; align-items: center; gap: 4px; width: fit-content"
850
+ }, [p("span", { style: l.value }, [x(n, "default")]), e.closable !== !1 && (e.isCurrent || i.value) ? p("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [p(M, {
851
+ text: !0,
852
+ onClick: (e) => {
853
+ e.stopPropagation(), t("close");
854
+ }
855
+ }, { default: () => [p(P, { size: 18 }, { default: () => [p("svg", {
856
+ xmlns: "http://www.w3.org/2000/svg",
857
+ width: "1em",
858
+ height: "1em",
859
+ viewBox: "0 0 24 24"
860
+ }, [p("path", {
861
+ fill: "currentColor",
862
+ d: "m6.4 18.308l-.708-.708l5.6-5.6l-5.6-5.6l.708-.708l5.6 5.6l5.6-5.6l.708.708l-5.6 5.6l5.6 5.6l-.708.708l-5.6-5.6z"
863
+ }, null)])] })] })]) : void 0])]),
864
+ p("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
865
+ p(Q, { style: u.value }, null)
866
+ ]);
867
+ }
868
+ }), Le = /* @__PURE__ */ m({
869
+ name: "AppMultiTabs",
870
+ props: {
871
+ fullTab: Boolean,
872
+ showBreadcrumb: Boolean,
873
+ tabs: Array,
874
+ current: Object,
875
+ dark: Boolean
876
+ },
877
+ emits: ["update:fullTab"],
878
+ setup(e, { emit: t, slots: n }) {
879
+ let r = X();
880
+ r.hasMultiTab = !0;
881
+ let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } = Pe(C(e, "tabs"), f(() => e.current?.key), () => t("update:fullTab", !e.fullTab)), u = f(() => e.current ? e.tabs.findIndex((t) => t.key === e.current?.key) : -1), d = b(), m = b();
882
+ return Fe(d, m, u), () => p("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [p("div", {
883
+ ref: d,
884
+ style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
885
+ }, [
886
+ p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
887
+ p("div", {
888
+ ref: m,
889
+ style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
890
+ onContextmenu: (e) => o(e)
891
+ }, [e.tabs.map((t, r, a) => {
892
+ let s, c = e.current?.key === t.key, l = t.title ?? t.path;
893
+ return p(Ie, {
894
+ key: t.key,
895
+ isCurrent: c,
896
+ isLast: r === a.length - 1,
897
+ onClose: t.close,
898
+ closable: t.closable,
899
+ dark: e.dark,
900
+ onClick: () => {
901
+ c || i.push(t.fullPath);
902
+ },
903
+ onContextmenu: (e) => o(e, t)
904
+ }, Ne(s = x(n, "name", {
905
+ isCurrent: c,
906
+ name: l,
907
+ tab: t
908
+ }, () => [l])) ? s : { default: () => [s] });
909
+ })]),
910
+ p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
911
+ ]), p(N, {
912
+ placement: "bottom-start",
913
+ trigger: "manual",
914
+ show: a.visible,
915
+ x: a.x,
916
+ y: a.y,
917
+ options: c.value,
918
+ onClickoutside: s,
919
+ onSelect: l
920
+ }, null)]);
921
+ }
922
+ });
923
+ //#endregion
924
+ //#region src/design/Notification.jsx
925
+ function $(e) {
926
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
927
+ }
928
+ var Re = /* @__PURE__ */ m({
929
+ name: "AppNotification",
930
+ inheritAttrs: !1,
931
+ props: {
932
+ getUnreadCount: Function,
933
+ getPage: Function,
934
+ markRead: Function,
935
+ markDelete: Function,
936
+ interval: {
937
+ type: Number,
938
+ default: 3e4
939
+ },
940
+ drawerTo: [String, Object]
941
+ },
942
+ setup(t, { slots: n, attrs: r }) {
943
+ let { t: i } = e(), a = b(!1), o = b("unread"), l = y({
944
+ page: 1,
945
+ size: 10,
946
+ loading: !1,
947
+ records: [],
948
+ total: 0,
949
+ unread: 0,
950
+ filteredTotal: 0
951
+ }), u = b(""), f = () => {
952
+ l.loading = !0, l.filteredTotal = 0;
953
+ let e = u.value?.trim() || void 0;
954
+ Promise.resolve(t.getPage?.(o.value, l.page, l.size, e) ?? []).then(({ records: t, total: n }) => {
955
+ l.records = t, l.filteredTotal = n, !e && (o.value === "unread" ? (l.unread = n, h(l.unread)) : l.total = n);
956
+ }).finally(() => {
957
+ l.loading = !1;
958
+ });
959
+ }, { sync: m, post: h } = de({
960
+ channel: "__ithinkdt_mc_shared_channel",
961
+ onMsg: (e) => {
962
+ l.unread = e;
963
+ },
964
+ getMsg: () => t.getUnreadCount?.() ?? 0,
965
+ timeout: () => t.interval,
966
+ immediate: !0
967
+ }), g = ue(() => {
968
+ l.page = 1, f();
969
+ }, 300), v = (e) => {
970
+ u.value = e, g();
971
+ }, S = () => {
972
+ let e;
973
+ return O(p(M, _(r, {
974
+ quaternary: !0,
975
+ style: "--n-padding: 0 12px",
976
+ onClick: () => {
977
+ o.value = l.unread > 0 ? "unread" : "all", u.value = void 0, a.value = !0, f();
978
+ }
979
+ }), $(e = x(n, "icon", void 0, () => [p(ie, {
980
+ show: l.unread > 0,
981
+ dot: !0,
982
+ offset: [-2, 5],
983
+ processing: !0
984
+ }, { default: () => [p(P, { size: "18" }, { default: () => [p("svg", {
985
+ xmlns: "http://www.w3.org/2000/svg",
986
+ width: "1em",
987
+ height: "1em",
988
+ viewBox: "0 0 24 24"
989
+ }, [p("g", {
990
+ fill: "none",
991
+ stroke: "currentColor",
992
+ "stroke-linecap": "round",
993
+ "stroke-linejoin": "round",
994
+ "stroke-width": "1.5",
995
+ color: "currentColor"
996
+ }, [p("path", { d: "M2.53 14.77c-.213 1.394.738 2.361 1.902 2.843c4.463 1.85 10.673 1.85 15.136 0c1.164-.482 2.115-1.45 1.902-2.843c-.13-.857-.777-1.57-1.256-2.267c-.627-.924-.689-1.931-.69-3.003C19.525 5.358 16.157 2 12 2S4.475 5.358 4.475 9.5c0 1.072-.062 2.08-.69 3.003c-.478.697-1.124 1.41-1.255 2.267" }, null), p("path", { d: "M8 19c.458 1.725 2.076 3 4 3c1.925 0 3.541-1.275 4-3" }, null)])])] })] })])) ? e : { default: () => [e] }), [[
997
+ s,
998
+ i("common.notification.tip", { count: l.unread }),
999
+ void 0,
1000
+ { bottom: !0 }
1001
+ ]]);
1002
+ }, C = () => {
1003
+ let e, t;
1004
+ return p("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
1005
+ p("div", { style: "padding-right: 12px" }, [i("common.notification.title")]),
1006
+ p(M, {
1007
+ text: !0,
1008
+ type: o.value === "all" ? "primary" : "default",
1009
+ onClick: () => {
1010
+ o.value = "all", f();
1011
+ }
1012
+ }, $(e = i("common.notification.all")) ? e : { default: () => [e] }),
1013
+ p(M, {
1014
+ text: !0,
1015
+ type: o.value === "unread" ? "primary" : "default",
1016
+ onClick: () => {
1017
+ o.value = "unread", m();
1018
+ }
1019
+ }, $(t = i("common.notification.unread", { count: l.unread > 99 ? "99+" : l.unread.toString() })) ? t : { default: () => [t] })
1020
+ ]);
1021
+ }, w = (e) => p(L, {
1022
+ key: e.key,
1023
+ onClick: () => {
1024
+ e.status === "unread" && (t.markRead?.([e.key]).then(() => {
1025
+ e.status = "read";
1026
+ }), l.unread--), e.link && window.open(e.link, "_target");
1027
+ }
1028
+ }, { default: () => [p(U, {
1029
+ bordered: !1,
1030
+ closable: !0,
1031
+ contentIndented: !0,
1032
+ size: "small",
1033
+ onMouseenter: () => e.hover = !0,
1034
+ onMouseleave: () => e.hover = !1,
1035
+ style: "padding: 0 4px; position: relative"
1036
+ }, {
1037
+ avatar: () => p(P, {
1038
+ size: 22,
1039
+ color: e.status === "unread" ? "var(--color-primary)" : void 0
1040
+ }, { default: () => [p("svg", {
1041
+ xmlns: "http://www.w3.org/2000/svg",
1042
+ width: "1em",
1043
+ height: "1em",
1044
+ viewBox: "0 0 24 24"
1045
+ }, [p("path", {
1046
+ fill: "currentColor",
1047
+ d: "M12.3 7.29c.2-.18.44-.29.7-.29c.27 0 .5.11.71.29c.19.21.29.45.29.71c0 .27-.1.5-.29.71c-.21.19-.44.29-.71.29c-.26 0-.5-.1-.7-.29c-.19-.21-.3-.44-.3-.71c0-.26.11-.5.3-.71m-2.5 4.68s2.17-1.72 2.96-1.79c.74-.06.59.79.52 1.23l-.01.06c-.14.53-.31 1.17-.48 1.78c-.38 1.39-.75 2.75-.66 3c.1.34.72-.09 1.17-.39c.06-.04.11-.08.16-.11c0 0 .08-.08.16.03c.02.03.04.06.06.08c.09.14.14.19.02.27l-.04.02c-.22.15-1.16.81-1.54 1.05c-.41.27-1.98 1.17-1.74-.58c.21-1.23.49-2.29.71-3.12c.41-1.5.59-2.18-.33-1.59c-.37.22-.59.36-.72.45c-.11.08-.12.08-.19-.05l-.03-.06l-.05-.08c-.07-.1-.07-.11.03-.2M22 12c0 5.5-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2s10 4.5 10 10m-2 0c0-4.42-3.58-8-8-8s-8 3.58-8 8s3.58 8 8 8s8-3.58 8-8"
1048
+ }, null)])] }),
1049
+ header: () => e.title,
1050
+ default: e.content,
1051
+ footer: () => {
1052
+ let n, r;
1053
+ return p("div", { style: "display: flex; align-items: center; justify-content: space-between" }, [p("span", { style: "color: gray" }, [e.hover ? ge(e.date, i("common.notification.time")) : i("common.timeago", { time: e.date })]), e.hover ? p("div", {
1054
+ style: "display: flex; gap: 12px",
1055
+ onClick: (e) => {
1056
+ e.preventDefault(), e.stopPropagation();
1057
+ }
1058
+ }, [e.status === "unread" ? p(M, {
1059
+ text: !0,
1060
+ type: "primary",
1061
+ onClick: () => {
1062
+ t.markRead?.([e.key]).then(() => {
1063
+ e.status = "read", l.unread--;
1064
+ });
1065
+ }
1066
+ }, $(n = i("common.notification.markRead")) ? n : { default: () => [n] }) : void 0, p(M, {
1067
+ text: !0,
1068
+ type: "error",
1069
+ onClick: () => {
1070
+ l.records === 1 ? (l.records = [], m()) : l.records.splice(l.records.findIndex((t) => t.key == e.key), 1), t.markDelete?.([e.key]);
1071
+ }
1072
+ }, $(r = i("common.notification.markDelete")) ? r : { default: () => [r] })]) : void 0]);
1073
+ }
1074
+ })] }), T = () => {
1075
+ let e;
1076
+ return p("div", null, [p("div", { style: "padding: 12px 20px; position: sticky; z-index: 1; top: 0; backdrop-filter: blur(6px)" }, [p(F, {
1077
+ size: "small",
1078
+ clearable: !0,
1079
+ value: u.value,
1080
+ onUpdateValue: v
1081
+ }, { suffix: () => p(P, { style: "margin-left: 4px" }, { default: () => [p("svg", {
1082
+ xmlns: "http://www.w3.org/2000/svg",
1083
+ width: "1em",
1084
+ height: "1em",
1085
+ viewBox: "0 0 24 24"
1086
+ }, [p("path", {
1087
+ fill: "currentColor",
1088
+ d: "m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"
1089
+ }, null)])] }) })]), O(l.records.length > 0 ? p(I, {
1090
+ clickable: !0,
1091
+ hoverable: !0,
1092
+ style: "min-height: 50vh"
1093
+ }, $(e = l.records.map((e) => w(e))) ? e : { default: () => [e] }) : p(le, { style: "margin-top: 30vh" }, null), [[c, l.loading]])]);
1094
+ }, E = () => p("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [o.value === "unread" ? p(M, {
1095
+ text: !0,
1096
+ type: "primary",
1097
+ disabled: l.records.length === 0,
1098
+ onClick: () => {
1099
+ let e = l.records.filter((e) => e.status === "unread").map((e) => e.key);
1100
+ t.markRead(e).then(() => {
1101
+ for (; l.unread - e.length <= l.size * (l.page - 1);) l.page--;
1102
+ m();
1103
+ });
1104
+ }
1105
+ }, {
1106
+ icon: () => p(P, { size: "20" }, { default: () => [p("svg", {
1107
+ xmlns: "http://www.w3.org/2000/svg",
1108
+ width: "1em",
1109
+ height: "1em",
1110
+ viewBox: "0 0 24 24"
1111
+ }, [p("path", {
1112
+ fill: "currentColor",
1113
+ d: "M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"
1114
+ }, null)])] }),
1115
+ default: () => i("common.notification.markPageRead")
1116
+ }) : p("span", null, null), p(z, {
1117
+ simple: !0,
1118
+ pageSize: l.size,
1119
+ page: l.page,
1120
+ itemCount: l.filteredTotal,
1121
+ onUpdatePage: (e) => {
1122
+ l.page = e, f();
1123
+ }
1124
+ }, null)]);
1125
+ return () => p(d, null, [S(), p(se, {
1126
+ show: a.value,
1127
+ "onUpdate:show": (e) => a.value = e,
1128
+ showMask: !1,
1129
+ resizable: !0,
1130
+ defaultWidth: 420,
1131
+ minWidth: 400,
1132
+ to: t.drawerTo
1133
+ }, { default: () => [p(ce, {
1134
+ title: i("common.notification.title"),
1135
+ closable: !0,
1136
+ nativeScrollbar: !1,
1137
+ bodyContentStyle: { padding: "0" }
1138
+ }, {
1139
+ header: C,
1140
+ default: T,
1141
+ footer: E
1142
+ })] })]);
1143
+ }
1144
+ }), ze = (e) => p("svg", _({
1145
+ xmlns: "http://www.w3.org/2000/svg",
1146
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1147
+ role: "img",
1148
+ width: "1em",
1149
+ height: "1em",
1150
+ viewBox: "0 0 24 24"
1151
+ }, e), [p("path", {
1152
+ fill: "currentColor",
1153
+ d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
1154
+ }, null)]), Be = /* @__PURE__ */ m({
1155
+ name: "AppTenant",
1156
+ props: {
1157
+ options: Array,
1158
+ current: String
1159
+ },
1160
+ emit: ["update:current"],
1161
+ setup(t, { emit: n }) {
1162
+ let { t: r } = e(), i = (e) => e.disabled ? p("div", null, [e.name]) : p("div", { style: "display: flex; align-items: center; justify-content: space-between; gap: 20px" }, [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(j, {
1163
+ round: !0,
1164
+ size: 22,
1165
+ color: "var(--color-primary-hover)"
1166
+ }, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(ze, { style: "color: var(--color-primary); font-size: 20px" }, null) : p("div", null, null)]), a = f(() => [{
1167
+ id: "___",
1168
+ name: r("common.account.changeTenant"),
1169
+ disabled: !0
1170
+ }, ...t.options ?? []]);
1171
+ return () => {
1172
+ if (!t.options?.length) return;
1173
+ let e = t.options.find((e) => e.id === t.current);
1174
+ return p(N, {
1175
+ options: a.value,
1176
+ placement: "bottom-end",
1177
+ keyField: "id",
1178
+ labelField: "name",
1179
+ showArrow: !0,
1180
+ renderLabel: i,
1181
+ onSelect: (e) => e !== t.current && n("update:current", e)
1182
+ }, { default: () => [p(M, {
1183
+ quaternary: !0,
1184
+ style: "--n-padding: 0 6px"
1185
+ }, {
1186
+ icon: () => p(P, { size: "18" }, { default: () => [p("svg", {
1187
+ xmlns: "http://www.w3.org/2000/svg",
1188
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1189
+ viewBox: "0 0 1024 1024",
1190
+ width: "1em",
1191
+ height: "1em",
1192
+ role: "img"
1193
+ }, [p("path", {
1194
+ d: "M728 600.2c8.1-13.2 4-30.4-9.1-38.5-30.7-19-63.6-33.8-97.8-44.4 69.4-43 115.6-119.8 115.6-207.4C736.7 175.2 627.5 66 492.8 66S249 175.2 249 309.9c0 88.2 46.8 165.5 117 208.3-12.9 4.1-25.6 8.8-38.1 14.1-51.1 21.8-97 53-136.4 92.7-39.4 39.7-70.3 85.9-91.9 137.4-22.4 53.3-33.7 109.9-33.7 168.2 0 15.5 12.5 28 28 28s28-12.5 28-28c0-207.5 167.4-376.3 373.2-376.3 68.8 0 136.1 19 194.4 55 13.1 8.2 30.4 4.1 38.5-9.1zM305 309.9c0-50.2 19.5-97.4 55-132.8 35.5-35.5 82.7-55 132.8-55 50.2 0 97.4 19.5 132.8 55 35.5 35.5 55 82.7 55 132.8s-19.5 97.4-55 132.8c-35.5 35.5-82.7 55-132.8 55-50.2 0-97.4-19.5-132.8-55-35.5-35.5-55-82.6-55-132.8zM606.2 746.4h325.1c11.3 0 21.5-6.8 25.9-17.3s1.9-22.5-6.1-30.5L844.5 592.1c-10.9-10.9-28.7-10.9-39.6 0-10.9 10.9-10.9 28.7 0 39.6l58.7 58.6H606.2c-15.5 0-28 12.5-28 28s12.6 28.1 28 28.1zM931.4 794.6H606.3c-11.3 0-21.5 6.8-25.9 17.3s-1.9 22.5 6.1 30.5l106.6 106.4c5.5 5.5 12.6 8.2 19.8 8.2 7.2 0 14.4-2.7 19.8-8.2 10.9-10.9 10.9-28.7 0-39.6L674 850.6h257.4c15.5 0 28-12.5 28-28s-12.5-28-28-28z",
1195
+ fill: "currentColor"
1196
+ }, null)])] }),
1197
+ default: () => e?.shotName || e?.name
1198
+ })] });
1199
+ };
1200
+ }
1201
+ }), Ve = /* @__PURE__ */ m({
1202
+ name: "UIProvider",
1203
+ props: { i18n: Function },
1204
+ setup(e, { slots: n }) {
1205
+ return v(t, C(e, "i18n")), () => x(n, "default");
1206
+ }
1207
+ });
1208
+ //#endregion
1209
+ export { _e as AppAccount, ve as AppAppearance, be as AppBreadcrumb, Oe as AppContent, ke as AppFooter, Ee as AppHeader, xe as AppLanguage, Te as AppLayout, je as AppLogo, Me as AppMenu, Le as AppMultiTabs, Re as AppNotification, De as AppSidebar, Be as AppTenant, u as SpinDirectiveProvider, l as TooltipDirectiveProvider, Ve as UIProvider, c as vSpin, s as vTooltip };