@ithinkdt/ui 4.0.0-10 → 4.0.0-101

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.
@@ -1,216 +1,170 @@
1
- import { Fragment, computed, createVNode, defineComponent, h, inject as inject$1, isVNode, mergeProps, nextTick, provide, reactive, ref as ref$1, renderSlot, shallowRef, toRef as toRef$1, toValue, useTemplateRef, watch, withDirectives } from "vue";
2
- import { promiseTimeout, useElementHover, useElementSize, useEventListener, useFullscreen, watchDebounced } from "@vueuse/core";
3
- import { NAvatar, NBadge, NBreadcrumb, NBreadcrumbItem, NButton, NDrawer, NDrawerContent, NDropdown, NEmpty, NIcon, NList, NListItem, NMenu, NPagination, NPopover, NScrollbar, NText, NThing, NTooltip, useThemeVars } from "ithinkdt-ui";
4
- import { useAtomicBroadcast, useElementIntersectionRect } from "@ithinkdt/common/composables";
5
- import { string2dom } from "@ithinkdt/common/dom";
6
- import { debounce } from "@ithinkdt/common/fn";
7
- import { useMergedClsPrefix } from "ithinkdt-ui/es/_mixins/use-config";
8
- import _useStyle from "ithinkdt-ui/es/_mixins/use-style";
9
- import { c, cB, cE, cM } from "ithinkdt-ui/es/_utils/cssr/index";
1
+ import { n as useI18n, t as UI_I18N_INJECTION } from "./use-i18n-Dx7V4KrY.js";
2
+ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-DUuJW647.js";
3
+ import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
4
+ import { Fragment, computed, createVNode, defineComponent, inject, isVNode, mergeProps, provide, reactive, ref, renderSlot, shallowRef, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
5
+ import { computedAsync, promiseTimeout, useElementHover, useElementSize, useEventListener, useFullscreen, watchDebounced } from "@vueuse/core";
6
+ import { NAvatar, NBadge, NBreadcrumb, NBreadcrumbItem, NButton, NDrawer, NDrawerContent, NDropdown, NEmpty, NIcon, NList, NListItem, NMenu, NPagination, NPopover, NScrollbar, NText, NThing, useThemeVars } from "ithinkdt-ui";
7
+ import { useAtomicBroadcast } from "@ithinkdt/common/composables";
10
8
  import { RouterLink, useRouter } from "vue-router";
11
9
  import { walkTree } from "@ithinkdt/common/tree";
12
- import { format } from "date-fns";
13
10
  import { getOpaqueColor } from "@ithinkdt/common/color";
14
- const UI_I18N_INJECTION = "__UI_I18N__";
15
- function useI18n() {
16
- return inject$1(UI_I18N_INJECTION).value();
11
+ import { format } from "date-fns";
12
+ function _isSlot$4(d) {
13
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
17
14
  }
18
- var Tooltip = /* @__PURE__ */ Symbol("tooltip-dir"), current = /* @__PURE__ */ shallowRef(), _update;
19
- const TooltipDirectiveProvider = /* @__PURE__ */ defineComponent({
20
- name: "TooltipDirectiveProvider",
21
- props: { delay: {
22
- type: Number,
23
- default: 180
24
- } },
25
- setup(u) {
26
- let R = shallowRef(), B = reactive({
27
- show: !1,
28
- tip: void 0,
29
- placement: "top",
30
- x: 0,
31
- y: 0
32
- });
33
- return _update = async () => {
34
- if (!current.value) return;
35
- u.delay > 0 && await promiseTimeout(u.delay);
36
- let z = current.value, V = z?.[Tooltip];
37
- if (!V) return;
38
- let H = V.tip;
39
- R.value = typeof H == "function" ? H : () => H || z.attributes.getNamedItem("title") || z.textContent;
40
- let { auto: U } = V.binding.modifiers;
41
- if (!U || z.firstChild.offsetWidth > z.clientWidth || z.firstChild.offsetHeight > z.clientHeight) {
42
- B.show = !0;
43
- let u = z.getBoundingClientRect();
44
- switch (B.placement = Object.keys(V.binding.modifiers).find((u) => [
45
- "top",
46
- "right",
47
- "left",
48
- "bottom"
49
- ].find((R) => u.startsWith(R))) ?? "top", B.placement.split("-")[0]) {
50
- case "top":
51
- B.x = u.left + u.width / 2, B.y = u.top;
52
- break;
53
- case "right":
54
- B.x = u.left + u.width, B.y = u.top + u.height / 2;
55
- break;
56
- case "left":
57
- B.x = u.left, B.y = u.top + u.height / 2;
58
- break;
59
- case "bottom":
60
- B.x = u.left + u.width / 2, B.y = u.bottom;
61
- break;
62
- }
63
- } else B.show &&= !1;
64
- }, useEventListener("mouseover", (u) => {
65
- let R = u.target;
66
- !current.value || current.value?.contains(R) || (B.show = !1, current.value = void 0);
67
- }, { capture: !0 }), () => createVNode(NTooltip, {
68
- trigger: "manual",
69
- show: !!current.value && B.show,
70
- x: B.x,
71
- y: B.y,
72
- placement: B.placement,
73
- keepAliveOnHover: !0
74
- }, { default: () => [R.value?.()] });
75
- }
76
- });
77
- var _listener = (u) => {
78
- current.value = u.target, _update?.();
79
- };
80
- const vTooltip = {
81
- mounted(u, R) {
82
- u[Tooltip] = {
83
- binding: R,
84
- tip: R.value
85
- }, u.addEventListener("mouseenter", _listener);
86
- },
87
- updated(u, R) {
88
- u[Tooltip].binding = R, u[Tooltip].tip = R.value, _update();
15
+ const AppAccount = /* @__PURE__ */ defineComponent({
16
+ name: "AppAccount",
17
+ props: {
18
+ username: String,
19
+ nickname: String,
20
+ head: String,
21
+ showLogoutButton: {
22
+ type: Boolean,
23
+ default: !0
24
+ },
25
+ showChangePwd: {
26
+ type: Boolean,
27
+ default: !0
28
+ }
89
29
  },
90
- beforeUnmount(u) {
91
- u[Tooltip] && u.removeEventListener("mouseenter", _listener), current.value === u && (current.value = void 0), delete u[Tooltip];
92
- }
93
- };
94
- function useStyle(u, R, z, B) {
95
- return z ??= useMergedClsPrefix(), _useStyle(u, R, z, B), z;
96
- }
97
- const fullWidth = { width: "100%" }, fullHeight = { height: "100%" };
98
- ({
99
- ...fullWidth,
100
- ...fullHeight
101
- });
102
- const flex = { display: "flex" };
103
- ({ ...flex });
104
- const flexAlignCenter = {
105
- ...flex,
106
- alignItems: "center"
107
- }, flexJustifyCenter = {
108
- ...flex,
109
- justifyContent: "center"
110
- };
111
- ({ ...flex }), {
112
- ...flexAlignCenter,
113
- ...flexJustifyCenter
114
- };
115
- var clsPrefix$1, isDark, style$1 = /* @__PURE__ */ c([c(({ props: u }) => `:where(${u.bPrefix}spin-host)`, { position: "relative" }), cB("spin-directive", {
116
- zIndex: "999999",
117
- position: "absolute",
118
- color: "var(--color-primary)",
119
- display: "flex",
120
- flexDirection: "column",
121
- justifyContent: "center",
122
- alignItems: "center",
123
- gap: "4px",
124
- willChange: "background-color",
125
- backgroundColor: "rgb(var(--host-bg, 255 255 255) / 0)",
126
- transition: "background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
127
- }, [
128
- cE("tip, icon", {
129
- willChange: "opacity",
130
- opacity: "0",
131
- transition: "opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
132
- }),
133
- cE("tip:empty", { display: "none" }),
134
- cM("spining", { backgroundColor: "rgb(var(--host-bg, 255 255 255) / 0.5)" }, [cE("tip, icon", { opacity: "1" })])
135
- ])]);
136
- const SpinDirectiveProvider = /* @__PURE__ */ defineComponent({
137
- name: "SpinDirectiveProvider",
138
- props: { dark: Boolean },
139
- setup(R) {
140
- return clsPrefix$1 = useStyle("-spin-directive", style$1), isDark = toRef$1(R, "dark"), () => h(Fragment);
30
+ emit: ["logout", "change-pwd"],
31
+ setup(z, { emit: V, slots: H }) {
32
+ let U = computed(() => /^[\u4E00-\u9FA5]+$/.test(z.nickname) ? z.nickname?.slice(z.nickname?.length > 3 ? 2 : 1) : z.nickname?.split(" ")[0]), { t: W } = useI18n(), G = createVNode(NIcon, { size: "28" }, { default: () => [createVNode("svg", {
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ width: "1em",
35
+ height: "1em",
36
+ viewBox: "-4 -4 32 32"
37
+ }, [createVNode("path", {
38
+ fill: "currentColor",
39
+ 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"
40
+ }, null)])] }), K = createVNode("svg", {
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ width: "1em",
43
+ height: "1em",
44
+ viewBox: "0 0 24 24"
45
+ }, [createVNode("path", {
46
+ fill: "currentColor",
47
+ 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"
48
+ }, null)]);
49
+ return () => createVNode("div", { style: "display: flex; align-items: center" }, [
50
+ createVNode(NPopover, { style: "padding: 4px" }, {
51
+ trigger: () => createVNode(NButton, {
52
+ quaternary: !0,
53
+ style: "--n-padding: 0 12px"
54
+ }, { default: () => [createVNode("div", { style: "display: flex; align-items: center; gap: 8px" }, [createVNode(NAvatar, {
55
+ key: z.head ? "head" : "no-head",
56
+ src: z.head,
57
+ round: !0,
58
+ size: "small",
59
+ radix: .78,
60
+ color: "var(--color-primary-hover)"
61
+ }, {
62
+ fallback: () => G,
63
+ placeholder: () => G,
64
+ default: z.head ? void 0 : () => U.value
65
+ }), createVNode("span", { style: "font-size: 14px" }, [z.username ?? ""])])] }),
66
+ default: () => {
67
+ let d = () => z.showChangePwd ? createVNode(NButton, {
68
+ quaternary: !0,
69
+ style: "justify-content: left",
70
+ onClick: () => V("change-pwd")
71
+ }, {
72
+ icon: () => createVNode(NIcon, null, { default: () => [createVNode("svg", {
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ width: "1em",
75
+ height: "1em",
76
+ viewBox: "0 0 32 32"
77
+ }, [createVNode("path", {
78
+ fill: "currentColor",
79
+ 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"
80
+ }, null), createVNode("circle", {
81
+ cx: "22",
82
+ cy: "10",
83
+ r: "2",
84
+ fill: "currentColor"
85
+ }, null)])] }),
86
+ default: () => W("common.account.changePwd")
87
+ }) : void 0, B = () => z.showLogoutButton ? void 0 : createVNode(NButton, {
88
+ quaternary: !0,
89
+ style: "justify-content: left",
90
+ onClick: () => V("logout")
91
+ }, {
92
+ icon: () => createVNode(NIcon, null, _isSlot$4(K) ? K : { default: () => [K] }),
93
+ default: () => W("common.account.logout")
94
+ });
95
+ return H.dropdown ? H.dropdown({
96
+ pwd: d,
97
+ logout: B
98
+ }) : createVNode("div", { style: "display: flex; flex-direction: column" }, [
99
+ d(),
100
+ H.dropdownExtra?.(),
101
+ B()
102
+ ]);
103
+ }
104
+ }),
105
+ H.extra?.(),
106
+ z.showLogoutButton ? withDirectives(createVNode(NButton, {
107
+ quaternary: !0,
108
+ style: "--n-padding: 0 12px",
109
+ onClick: () => z.username && V("logout")
110
+ }, { default: () => [H.logoutButton?.() ?? createVNode(NIcon, { size: "16" }, _isSlot$4(K) ? K : { default: () => [K] })] }), [[
111
+ vTooltip,
112
+ W("common.account.logout"),
113
+ void 0,
114
+ { "bottom-end": !0 }
115
+ ]]) : void 0
116
+ ]);
141
117
  }
142
- });
143
- var Spin = /* @__PURE__ */ Symbol("spin-dir"), updateLoading = (u, { value: R, modifiers: z }) => {
144
- if (u[Spin].loading.value = !!R, !u[Spin].loading.value) return;
145
- let B = z.dark || !z.light && isDark.value;
146
- u[Spin].spinEl.style.setProperty("--host-bg", B ? "0 0 0" : "255 255 255");
147
- };
148
- const vSpin = {
149
- beforeMount(u) {
150
- if (u.classList.add(`${clsPrefix$1.value}-spin-host`), u[Spin]) return;
151
- let R = ref$1(!1), z = string2dom(`
152
- <div class="${clsPrefix$1.value}-spin-directive">
153
- <svg class="${clsPrefix$1.value}-spin-directive__icon" width="32" height="32" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
154
- <g>
155
- <animateTransform attributeName="transform" type="rotate" values="0 100 100;270 100 100" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animateTransform>
156
- <circle fill="none" stroke="currentColor" stroke-width="18" stroke-linecap="round" cx="100" cy="100" r="92" stroke-dasharray="567" stroke-dashoffset="1848">
157
- <animateTransform attributeName="transform" type="rotate" values="0 100 100;135 100 100;450 100 100" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animateTransform>
158
- <animate attributeName="stroke-dashoffset" values="567;142;567" begin="0s" dur="1.6s" fill="freeze" repeatCount="indefinite"></animate>
159
- </circle>
160
- </g>
161
- </svg>
162
- <div class="${clsPrefix$1.value}-spin-directive__tip"></div>
163
- </div>
164
- `.trim()), B, { stop: V, update: H } = useElementIntersectionRect(u, (u) => {
165
- B = u, Object.assign(z.style, {
166
- left: 0,
167
- top: 0,
168
- width: B.width + "px",
169
- height: B.height + "px"
170
- });
171
- }, { interval: 1e3 / 30 }), U, W = watch(R, debounce(() => {
172
- if (R.value) U === void 0 && (clearTimeout(U), U = void 0), H(), u.append(z), requestAnimationFrame(() => {
173
- R.value && z.classList.add(`${clsPrefix$1.value}-spin-directive--spining`);
174
- });
175
- else {
176
- z.classList.remove(`${clsPrefix$1.value}-spin-directive--spining`);
177
- let u = () => {
178
- z.remove(), R && clearTimeout(R), R = null, z.removeEventListener("transitioncancel", u), z.removeEventListener("transitionend", u);
179
- };
180
- z.addEventListener("transitioncancel", u), z.addEventListener("transitionend", u);
181
- let R = setTimeout(u, 300);
182
- }
183
- }, 30));
184
- u[Spin] = {
185
- loading: R,
186
- spinEl: z,
187
- updateTip: () => {
188
- let R = z.querySelector(`.${clsPrefix$1.value}-spin-directive__tip`);
189
- R.textContent = u.dataset.spinTip;
190
- },
191
- stop: () => {
192
- V(), W();
118
+ }), AppAppearance = /* @__PURE__ */ defineComponent({
119
+ name: "AppAppearance",
120
+ props: { mode: String },
121
+ emit: ["update:mode"],
122
+ setup(z, { emit: V }) {
123
+ let { t: H } = useI18n();
124
+ return () => withDirectives(createVNode(NButton, {
125
+ quaternary: !0,
126
+ style: "--n-padding: 0 12px",
127
+ onClick: () => {
128
+ V("update:mode", z.mode === "light" ? "dark" : z.mode === "dark" ? "auto" : "light");
193
129
  }
194
- };
195
- },
196
- mounted(u, R) {
197
- updateLoading(u, R), u[Spin].updateTip(), !u[Spin].observer && nextTick().then(() => {
198
- (u[Spin].observer = new MutationObserver((R) => {
199
- for (let z of R) if (z.type === "attributes" && z.attributeName === "data-spin-tip") {
200
- u[Spin].updateTip();
201
- return;
202
- }
203
- })).observe(u, {
204
- attributes: !0,
205
- attributeFilter: ["data-spin-tip"]
206
- });
207
- });
208
- },
209
- updated: updateLoading,
210
- beforeUnmount(u) {
211
- u[Spin].loading.value = !1, u[Spin].stop(), u[Spin].observer?.disconnect(), delete u[Spin];
130
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [z.mode === "light" ? createVNode("svg", {
131
+ xmlns: "http://www.w3.org/2000/svg",
132
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
133
+ role: "img",
134
+ width: "1em",
135
+ height: "1em",
136
+ viewBox: "0 0 24 24"
137
+ }, [createVNode("path", {
138
+ fill: "currentColor",
139
+ 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"
140
+ }, null)]) : z.mode === "dark" ? createVNode("svg", {
141
+ xmlns: "http://www.w3.org/2000/svg",
142
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
143
+ role: "img",
144
+ width: "1em",
145
+ height: "1em",
146
+ viewBox: "0 0 24 24"
147
+ }, [createVNode("path", {
148
+ fill: "currentColor",
149
+ 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"
150
+ }, null)]) : createVNode("svg", {
151
+ xmlns: "http://www.w3.org/2000/svg",
152
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
153
+ role: "img",
154
+ width: "1em",
155
+ height: "1em",
156
+ viewBox: "0 0 24 24"
157
+ }, [createVNode("path", {
158
+ fill: "currentColor",
159
+ 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"
160
+ }, null)])] })] }), [[
161
+ vTooltip,
162
+ z.mode === "light" ? H("common.layout.mode.light") : z.mode === "dark" ? H("common.layout.mode.dark") : H("common.layout.mode.auto"),
163
+ void 0,
164
+ { bottom: !0 }
165
+ ]]);
212
166
  }
213
- }, COLLAPSED_INJECTION_KEY = "APP_SIDER_COLLAPSED", IBookmark = () => createVNode("svg", {
167
+ }), COLLAPSED_INJECTION_KEY = "APP_SIDER_COLLAPSED", IBookmark = () => createVNode("svg", {
214
168
  xmlns: "http://www.w3.org/2000/svg",
215
169
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
216
170
  role: "img",
@@ -221,6 +175,113 @@ const vSpin = {
221
175
  fill: "currentColor",
222
176
  d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
223
177
  }, null)]), CTX_INJECTION_KEY = "__APP_CTX__", getCtx = () => inject(CTX_INJECTION_KEY);
178
+ function _isSlot$3(d) {
179
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
180
+ }
181
+ const AppBreadcrumb = /* @__PURE__ */ defineComponent({
182
+ name: "AppBreadcrumb",
183
+ props: {
184
+ items: {
185
+ type: Array,
186
+ default: () => []
187
+ },
188
+ getIcon: {
189
+ type: Function,
190
+ default: void 0
191
+ }
192
+ },
193
+ setup(d) {
194
+ let z = useRouter(), B = Symbol(), V = Symbol();
195
+ return watch(() => d.items, (z) => {
196
+ walkTree(z, (z) => {
197
+ z.icon && (typeof z.icon == "string" ? (z[B] = d.getIcon?.(z.icon), z[V] = () => z[B]?.() || IBookmark()) : z[V] = z.icon);
198
+ });
199
+ }, { immediate: !0 }), () => {
200
+ let B;
201
+ return createVNode(NBreadcrumb, null, _isSlot$3(B = d.items.map((d) => createVNode(NBreadcrumbItem, {
202
+ clickable: d.href?.length > 0,
203
+ separator: d.separator,
204
+ onClick: d.href && ((B) => {
205
+ B.stopPropagation(), z.push(d.href);
206
+ })
207
+ }, { default: () => [d.icon ? createVNode(Fragment, null, [createVNode(NIcon, { component: d[V] }, null), " "]) : void 0, toValue(d.title)] }))) ? B : { default: () => [B] });
208
+ };
209
+ }
210
+ }), AppFullscreen = /* @__PURE__ */ defineComponent({
211
+ name: "AppFullscreen",
212
+ props: {},
213
+ emit: ["change"],
214
+ setup(z, { emit: V }) {
215
+ let { t: H } = useI18n(), { isFullscreen: U, toggle: W } = useFullscreen();
216
+ return () => withDirectives(createVNode(NButton, {
217
+ quaternary: !0,
218
+ style: "--n-padding: 0 12px",
219
+ onClick: () => {
220
+ W(), V("change", U.value);
221
+ }
222
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [U.value ? createVNode("svg", {
223
+ xmlns: "http://www.w3.org/2000/svg",
224
+ width: "1em",
225
+ height: "1em",
226
+ viewBox: "0 0 24 24"
227
+ }, [createVNode("path", {
228
+ fill: "none",
229
+ stroke: "currentColor",
230
+ "stroke-linecap": "round",
231
+ "stroke-linejoin": "round",
232
+ "stroke-width": "1.5",
233
+ d: "M8.345 3.75v2.095a2.5 2.5 0 0 1-2.5 2.5H3.75M8.345 20.25v-2.095a2.5 2.5 0 0 0-2.5-2.5H3.75M15.655 3.75v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M15.655 20.25v-2.095a2.5 2.5 0 0 1 2.5-2.5h2.095"
234
+ }, null)]) : createVNode("svg", {
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ width: "1em",
237
+ height: "1em",
238
+ viewBox: "0 0 24 24"
239
+ }, [createVNode("path", {
240
+ fill: "none",
241
+ stroke: "currentColor",
242
+ "stroke-linecap": "round",
243
+ "stroke-linejoin": "round",
244
+ "stroke-width": "1.5",
245
+ d: "M3.75 8.345V6.25a2.5 2.5 0 0 1 2.5-2.5h2.095M3.75 15.655v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M20.25 8.345V6.25a2.5 2.5 0 0 0-2.5-2.5h-2.095m4.595 11.905v2.095a2.5 2.5 0 0 1-2.5 2.5h-2.095"
246
+ }, null)])] })] }), [[
247
+ vTooltip,
248
+ U.value ? H("common.layout.screen.exitfull") : H("common.layout.screen.full"),
249
+ void 0,
250
+ { bottom: !0 }
251
+ ]]);
252
+ }
253
+ }), AppLanguage = /* @__PURE__ */ defineComponent({
254
+ name: "AppLanguage",
255
+ props: {
256
+ lang: String,
257
+ supports: Array
258
+ },
259
+ emit: ["update:lang"],
260
+ setup(d, { emit: z }) {
261
+ return () => createVNode(NDropdown, {
262
+ options: d.supports,
263
+ keyField: "value",
264
+ showArrow: !0,
265
+ onSelect: (d) => z("update:lang", d)
266
+ }, { default: () => [createVNode(NButton, {
267
+ quaternary: !0,
268
+ style: "--n-padding: 0 12px"
269
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
270
+ xmlns: "http://www.w3.org/2000/svg",
271
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
272
+ role: "img",
273
+ width: "1em",
274
+ height: "1em",
275
+ viewBox: "0 0 24 24"
276
+ }, [createVNode("g", {
277
+ fill: "none",
278
+ stroke: "currentColor",
279
+ "stroke-linecap": "round",
280
+ "stroke-linejoin": "round",
281
+ "stroke-width": "1.5"
282
+ }, [createVNode("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), createVNode("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)])])] })] })] });
283
+ }
284
+ });
224
285
  var style = /* @__PURE__ */ c([
225
286
  cB("layout", {
226
287
  display: "grid",
@@ -269,7 +330,9 @@ var style = /* @__PURE__ */ c([
269
330
  }),
270
331
  cB("footer", {
271
332
  gridArea: "footer",
272
- lineHeight: "24px"
333
+ lineHeight: "32px",
334
+ textAlign: "center",
335
+ color: "gray"
273
336
  })
274
337
  ]), IFold = () => createVNode("svg", {
275
338
  xmlns: "http://www.w3.org/2000/svg",
@@ -307,7 +370,7 @@ const AppLayout = /* @__PURE__ */ defineComponent({
307
370
  },
308
371
  fullContent: Boolean
309
372
  },
310
- setup(u, { slots: R }) {
373
+ setup(d, { slots: z }) {
311
374
  useStyle("-layout", style, ref("app"), !1);
312
375
  let B = reactive({
313
376
  siderWidth: "0px",
@@ -316,19 +379,19 @@ const AppLayout = /* @__PURE__ */ defineComponent({
316
379
  hasMultiTab: !1
317
380
  });
318
381
  return provide(CTX_INJECTION_KEY, B), () => {
319
- let { layout: V } = u;
382
+ let { layout: V } = d;
320
383
  return createVNode("div", {
321
384
  class: {
322
385
  "app-layout": !0,
323
386
  "app-layout--full-header": V === "top2bottom",
324
- "app-layout--full-content": u.fullContent
387
+ "app-layout--full-content": d.fullContent
325
388
  },
326
389
  style: {
327
390
  "--app-sider-width": B.siderWidth,
328
391
  "--app-header-height": B.headerHeight,
329
392
  "--app-footer-height": B.footerHeight
330
393
  }
331
- }, [renderSlot(R, "default")]);
394
+ }, [renderSlot(z, "default")]);
332
395
  };
333
396
  }
334
397
  }), AppHeader = /* @__PURE__ */ defineComponent({
@@ -337,9 +400,9 @@ const AppLayout = /* @__PURE__ */ defineComponent({
337
400
  type: Number,
338
401
  default: 44
339
402
  } },
340
- setup(u, { slots: R }) {
403
+ setup(d, { slots: z }) {
341
404
  let B = getCtx();
342
- return () => (B.headerHeight = u.height + "px", createVNode("div", { class: "app-header" }, [renderSlot(R, "default")]));
405
+ return () => (B.headerHeight = d.height + "px", createVNode("div", { class: "app-header" }, [renderSlot(z, "default")]));
343
406
  }
344
407
  }), AppSider = /* @__PURE__ */ defineComponent({
345
408
  name: "AppSider",
@@ -359,21 +422,21 @@ const AppLayout = /* @__PURE__ */ defineComponent({
359
422
  }
360
423
  },
361
424
  emits: { "update:collapsed": () => !0 },
362
- setup(u, { emit: R, slots: B }) {
363
- provide(COLLAPSED_INJECTION_KEY, toRef$1(u, "collapsed"));
364
- let { t: V } = useI18n(), H = getCtx();
365
- return () => (H.siderWidth = (u.collapsed ? u.collapsedWidth : u.width) + "px", createVNode("div", { class: "app-sider" }, [renderSlot(B, "default"), u.showCollapseBtn ? withDirectives(createVNode(NButton, {
425
+ setup(z, { emit: V, slots: H }) {
426
+ provide(COLLAPSED_INJECTION_KEY, toRef(z, "collapsed"));
427
+ let { t: U } = useI18n(), W = getCtx();
428
+ return () => (W.siderWidth = (z.collapsed ? z.collapsedWidth : z.width) + "px", createVNode("div", { class: "app-sider" }, [renderSlot(H, "default"), z.showCollapseBtn ? withDirectives(createVNode(NButton, {
366
429
  class: "app-sider__collapse-btn",
367
430
  quaternary: !0,
368
431
  onClick: () => {
369
- R("update:collapsed", !u.collapsed);
432
+ V("update:collapsed", !z.collapsed);
370
433
  }
371
- }, { default: () => [createVNode(NIcon, { size: "20" }, { default: () => [u.collapsed ? createVNode(IUnfold, null, null) : createVNode(IFold, null, null)] })] }), [[vTooltip, u.collapsed ? V("common.layout.sider.expand") : V("common.layout.sider.collapse")]]) : void 0]));
434
+ }, { default: () => [createVNode(NIcon, { size: "20" }, { default: () => [z.collapsed ? createVNode(IUnfold, null, null) : createVNode(IFold, null, null)] })] }), [[vTooltip, z.collapsed ? U("common.layout.sider.expand") : U("common.layout.sider.collapse")]]) : void 0]));
372
435
  }
373
436
  }), AppContent = /* @__PURE__ */ defineComponent({
374
437
  name: "AppContent",
375
- setup(u, { slots: R }) {
376
- return () => createVNode("div", { class: "app-content" }, [renderSlot(R, "default")]);
438
+ setup(d, { slots: z }) {
439
+ return () => createVNode("div", { class: "app-content" }, [renderSlot(z, "default")]);
377
440
  }
378
441
  }), AppFooter = /* @__PURE__ */ defineComponent({
379
442
  name: "AppFooter",
@@ -381,13 +444,13 @@ const AppLayout = /* @__PURE__ */ defineComponent({
381
444
  type: Number,
382
445
  default: 30
383
446
  } },
384
- setup(u, { slots: R }) {
447
+ setup(d, { slots: z }) {
385
448
  let B = getCtx();
386
- return () => (B.footerHeight = u.height + "px", createVNode("div", { class: "app-footer" }, [renderSlot(R, "default")]));
449
+ return () => (B.footerHeight = d.height + "px", createVNode("div", { class: "app-footer" }, [renderSlot(z, "default")]));
387
450
  }
388
451
  });
389
- function _isSlot$4(u) {
390
- return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !isVNode(u);
452
+ function _isSlot$2(d) {
453
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
391
454
  }
392
455
  const AppLogo = /* @__PURE__ */ defineComponent({
393
456
  name: "AppLogo",
@@ -407,10 +470,10 @@ const AppLogo = /* @__PURE__ */ defineComponent({
407
470
  default: !0
408
471
  }
409
472
  },
410
- setup(u, { slots: R }) {
411
- let B = asyncComputed(() => typeof u.src == "function" ? u.src() : u.src), V = inject$1(COLLAPSED_INJECTION_KEY, !1);
473
+ setup(d, { slots: z }) {
474
+ let B = computedAsync(() => typeof d.src == "function" ? d.src() : d.src), V = inject(COLLAPSED_INJECTION_KEY, !1);
412
475
  return () => {
413
- let { name: H, collapsed: U, center: W, link: G } = u;
476
+ let { name: H, collapsed: U, center: W, link: G } = d;
414
477
  U ??= unref(V);
415
478
  let K = U ? 1 : 1 / 1.1;
416
479
  return createVNode("div", {
@@ -425,7 +488,7 @@ const AppLogo = /* @__PURE__ */ defineComponent({
425
488
  justifyContent: W ? "center" : "flex-start",
426
489
  cursor: G ? "pointer" : void 0
427
490
  }
428
- }, [R.default ? R.default() : createVNode("div", {
491
+ }, [z.default ? z.default() : createVNode("div", {
429
492
  class: "app-logo__img",
430
493
  style: `
431
494
  width: ${U ? "var(--app-sider-width, 60px)" : "56px"};
@@ -435,19 +498,19 @@ const AppLogo = /* @__PURE__ */ defineComponent({
435
498
  display: flex;
436
499
  justify-content: center
437
500
  `
438
- }, [R.icon ? R.icon() : createVNode("img", {
501
+ }, [z.icon ? z.icon() : createVNode("img", {
439
502
  src: B.value,
440
503
  alt: "App Logo",
441
504
  style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${K})`
442
505
  }, null)]), H ? createVNode(NText, {
443
506
  class: "app-logo__name",
444
507
  style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
445
- }, _isSlot$4(H) ? H : { default: () => [H] }) : ""]);
508
+ }, _isSlot$2(H) ? H : { default: () => [H] }) : ""]);
446
509
  };
447
510
  }
448
511
  });
449
- function _isSlot$3(u) {
450
- return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !isVNode(u);
512
+ function _isSlot$1(d) {
513
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
451
514
  }
452
515
  const AppMenu = /* @__PURE__ */ defineComponent({
453
516
  name: "AppMenu",
@@ -467,547 +530,93 @@ const AppMenu = /* @__PURE__ */ defineComponent({
467
530
  type: Number,
468
531
  default: 220
469
532
  },
470
- collapsedWidth: {
471
- type: Number,
472
- default: 60
473
- }
474
- },
475
- setup(u) {
476
- let R = shallowRef([]);
477
- watch([() => u.menus, () => u.single], ([z, B]) => {
478
- if (R.value = [], !z?.length) return;
479
- let V = (R, z = 0) => {
480
- let H = [];
481
- for (let U of R) {
482
- if (U.type === "action") continue;
483
- let R = U.type === "view" ? void 0 : V(U.children ?? [], z + 1), W = {
484
- _: U,
485
- key: U.key,
486
- label: () => u.renderLabel?.(U) ?? U.name,
487
- icon: z === 0 || U.icon ? u.getIcon?.(U.icon) ?? IBookmark : void 0,
488
- children: B ? void 0 : R,
489
- path: U.path || (B ? R?.[0]?.path : void 0),
490
- depth: z
491
- };
492
- delete W.type, H.push(W);
493
- }
494
- return H;
495
- };
496
- R.value = V(z);
497
- }, { immediate: !0 }), watch([useTemplateRef("menu"), () => u.current], ([u, R]) => {
498
- u?.showOption(R);
499
- }, { immediate: !0 });
500
- let B = inject$1(COLLAPSED_INJECTION_KEY, !1), V = (R) => {
501
- let V = u.collapsed ?? unref(B), H;
502
- if (R._.type === "view") if (R.isExternal && R.externalEmbed) H = createVNode("a", {
503
- href: R.externalLink,
504
- target: "_blank",
505
- onClick: (u) => u.stopPropagation()
506
- }, [R.label()]);
507
- else {
508
- let u;
509
- H = createVNode(RouterLink, { to: R.path }, _isSlot$3(u = R.label()) ? u : { default: () => [u] });
510
- }
511
- else H = createVNode("span", null, [R.label()]);
512
- return H.key = `${R.key}:${V ? 1 : 0}`, R.depth === 0 && !V && (H = withDirectives(H, [[
513
- vTooltip,
514
- R.label(),
515
- void 0,
516
- {
517
- auto: !0,
518
- right: !0
519
- }
520
- ]])), R.isNew && (H = createVNode("div", { style: "display: flex; width: 100%" }, [createVNode("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [H]), createVNode("svg", {
521
- xmlns: "http://www.w3.org/2000/svg",
522
- width: "24",
523
- height: "24",
524
- viewBox: "0 0 1024 1024",
525
- style: "margin-left: 8px; flex: 0 0 auto;"
526
- }, [createVNode("path", {
527
- 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",
528
- fill: "var(--color-danger)"
529
- }, null)])])), H;
530
- };
531
- return () => {
532
- let H = createVNode(NMenu, {
533
- ref: "menu",
534
- options: R.value,
535
- rootIndent: 16,
536
- accordion: u.accordion,
537
- collapsed: u.collapsed ?? unref(B),
538
- dropdownProps: { showArrow: !0 },
539
- mode: u.horizontal ? "horizontal" : "vertical",
540
- value: u.current ?? null,
541
- renderLabel: V,
542
- responsive: !0,
543
- collapsedWidth: u.collapsedWidth,
544
- width: u.width
545
- }, null);
546
- return u.horizontal ? H : createVNode(NScrollbar, null, _isSlot$3(H) ? H : { default: () => [H] });
547
- };
548
- }
549
- });
550
- function _isSlot$2(u) {
551
- return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !isVNode(u);
552
- }
553
- const AppBreadcrumb = /* @__PURE__ */ defineComponent({
554
- name: "AppBreadcrumb",
555
- props: {
556
- items: {
557
- type: Array,
558
- default: () => []
559
- },
560
- getIcon: {
561
- type: Function,
562
- default: void 0
563
- }
564
- },
565
- setup(R) {
566
- let B = useRouter(), V = Symbol(), H = Symbol();
567
- return watch(() => R.items, (u) => {
568
- walkTree(u, (u) => {
569
- u.icon && (typeof u.icon == "string" ? (u[V] = R.getIcon?.(u.icon), u[H] = () => u[V]?.() || IBookmark()) : u[H] = u.icon);
570
- });
571
- }, { immediate: !0 }), () => {
572
- let V;
573
- return createVNode(NBreadcrumb, null, _isSlot$2(V = R.items.map((R) => createVNode(NBreadcrumbItem, {
574
- clickable: R.href?.length > 0,
575
- separator: R.separator,
576
- onClick: R.href && ((u) => {
577
- u.stopPropagation(), B.push(R.href);
578
- })
579
- }, { default: () => [R.icon ? createVNode(Fragment, null, [createVNode(NIcon, { component: R[H] }, null), " "]) : void 0, toValue(R.title)] }))) ? V : { default: () => [V] });
580
- };
581
- }
582
- });
583
- function _isSlot$1(u) {
584
- return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !isVNode(u);
585
- }
586
- const AppAccount = /* @__PURE__ */ defineComponent({
587
- name: "AppAccount",
588
- props: {
589
- username: String,
590
- nickname: String,
591
- head: String,
592
- showLogoutButton: {
593
- type: Boolean,
594
- default: !0
595
- },
596
- showChangePwd: {
597
- type: Boolean,
598
- default: !0
599
- }
600
- },
601
- emit: ["logout", "change-pwd"],
602
- setup(u, { emit: B, slots: V }) {
603
- let H = computed(() => /^[\u4E00-\u9FA5]+$/.test(u.nickname) ? u.nickname?.slice(u.nickname?.length > 3 ? 2 : 1) : u.nickname?.split(" ")[0]), { t: U } = useI18n(), W = createVNode(NIcon, { size: "28" }, { default: () => [createVNode("svg", {
604
- xmlns: "http://www.w3.org/2000/svg",
605
- width: "1em",
606
- height: "1em",
607
- viewBox: "-4 -4 32 32"
608
- }, [createVNode("path", {
609
- fill: "currentColor",
610
- 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"
611
- }, null)])] }), G = createVNode("svg", {
612
- xmlns: "http://www.w3.org/2000/svg",
613
- width: "1em",
614
- height: "1em",
615
- viewBox: "0 0 24 24"
616
- }, [createVNode("path", {
617
- fill: "currentColor",
618
- 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"
619
- }, null)]);
620
- return () => createVNode("div", { style: "display: flex; align-items: center" }, [createVNode(NPopover, { style: "padding: 4px" }, {
621
- trigger: () => createVNode(NButton, {
622
- quaternary: !0,
623
- style: "--n-padding: 0 12px"
624
- }, { default: () => [createVNode("div", { style: "display: flex; align-items: center; gap: 8px" }, [createVNode(NAvatar, {
625
- key: u.head ? "head" : "no-head",
626
- src: u.head,
627
- round: !0,
628
- size: "small",
629
- radix: .78,
630
- color: "var(--color-primary-hover)"
631
- }, {
632
- fallback: () => W,
633
- placeholder: () => W,
634
- default: u.head ? void 0 : () => H.value
635
- }), createVNode("span", { style: "font-size: 14px" }, [u.username ?? ""])])] }),
636
- default: () => {
637
- let R = () => u.showChangePwd ? createVNode(NButton, {
638
- quaternary: !0,
639
- style: "justify-content: left",
640
- onClick: () => B("change-pwd")
641
- }, {
642
- icon: () => createVNode(NIcon, null, { default: () => [createVNode("svg", {
643
- xmlns: "http://www.w3.org/2000/svg",
644
- width: "1em",
645
- height: "1em",
646
- viewBox: "0 0 32 32"
647
- }, [createVNode("path", {
648
- fill: "currentColor",
649
- 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"
650
- }, null), createVNode("circle", {
651
- cx: "22",
652
- cy: "10",
653
- r: "2",
654
- fill: "currentColor"
655
- }, null)])] }),
656
- default: () => U("common.account.changePwd")
657
- }) : void 0, H = () => u.showLogoutButton ? void 0 : createVNode(NButton, {
658
- quaternary: !0,
659
- style: "justify-content: left",
660
- onClick: () => B("logout")
661
- }, {
662
- icon: () => createVNode(NIcon, null, _isSlot$1(G) ? G : { default: () => [G] }),
663
- default: () => U("common.account.logout")
664
- });
665
- return V.dropdown ? V.dropdown({
666
- pwd: R,
667
- logout: H
668
- }) : createVNode("div", { style: "display: flex; flex-direction: column" }, [
669
- R(),
670
- V.dropdownExtra?.(),
671
- H()
672
- ]);
673
- }
674
- }), u.showLogoutButton ? withDirectives(createVNode(NButton, {
675
- quaternary: !0,
676
- style: "--n-padding: 0 12px",
677
- onClick: () => u.username && B("logout")
678
- }, { default: () => [V.logoutButton?.() ?? createVNode(NIcon, { size: "16" }, _isSlot$1(G) ? G : { default: () => [G] })] }), [[
679
- vTooltip,
680
- U("common.account.logout"),
681
- void 0,
682
- { "bottom-end": !0 }
683
- ]]) : void 0]);
684
- }
685
- }), AppFullscreen = /* @__PURE__ */ defineComponent({
686
- name: "AppFullscreen",
687
- props: {},
688
- emit: ["change"],
689
- setup(u, { emit: R }) {
690
- let { t: B } = useI18n(), { isFullscreen: V, toggle: H } = useFullscreen();
691
- return () => withDirectives(createVNode(NButton, {
692
- quaternary: !0,
693
- style: "--n-padding: 0 12px",
694
- onClick: () => {
695
- H(), R("change", V.value);
696
- }
697
- }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [V.value ? createVNode("svg", {
698
- xmlns: "http://www.w3.org/2000/svg",
699
- width: "1em",
700
- height: "1em",
701
- viewBox: "0 0 24 24"
702
- }, [createVNode("path", {
703
- fill: "none",
704
- stroke: "currentColor",
705
- "stroke-linecap": "round",
706
- "stroke-linejoin": "round",
707
- "stroke-width": "1.5",
708
- d: "M8.345 3.75v2.095a2.5 2.5 0 0 1-2.5 2.5H3.75M8.345 20.25v-2.095a2.5 2.5 0 0 0-2.5-2.5H3.75M15.655 3.75v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M15.655 20.25v-2.095a2.5 2.5 0 0 1 2.5-2.5h2.095"
709
- }, null)]) : createVNode("svg", {
710
- xmlns: "http://www.w3.org/2000/svg",
711
- width: "1em",
712
- height: "1em",
713
- viewBox: "0 0 24 24"
714
- }, [createVNode("path", {
715
- fill: "none",
716
- stroke: "currentColor",
717
- "stroke-linecap": "round",
718
- "stroke-linejoin": "round",
719
- "stroke-width": "1.5",
720
- d: "M3.75 8.345V6.25a2.5 2.5 0 0 1 2.5-2.5h2.095M3.75 15.655v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M20.25 8.345V6.25a2.5 2.5 0 0 0-2.5-2.5h-2.095m4.595 11.905v2.095a2.5 2.5 0 0 1-2.5 2.5h-2.095"
721
- }, null)])] })] }), [[
722
- vTooltip,
723
- V.value ? B("common.layout.screen.exitfull") : B("common.layout.screen.full"),
724
- void 0,
725
- { bottom: !0 }
726
- ]]);
727
- }
728
- }), AppAppearance = /* @__PURE__ */ defineComponent({
729
- name: "AppAppearance",
730
- props: { mode: String },
731
- emit: ["update:mode"],
732
- setup(u, { emit: R }) {
733
- let { t: B } = useI18n();
734
- return () => withDirectives(createVNode(NButton, {
735
- quaternary: !0,
736
- style: "--n-padding: 0 12px",
737
- onClick: () => {
738
- R("update:mode", u.mode === "light" ? "dark" : u.mode === "dark" ? "auto" : "light");
739
- }
740
- }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [u.mode === "light" ? createVNode("svg", {
741
- xmlns: "http://www.w3.org/2000/svg",
742
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
743
- role: "img",
744
- width: "1em",
745
- height: "1em",
746
- viewBox: "0 0 24 24"
747
- }, [createVNode("path", {
748
- fill: "currentColor",
749
- 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"
750
- }, null)]) : u.mode === "dark" ? createVNode("svg", {
751
- xmlns: "http://www.w3.org/2000/svg",
752
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
753
- role: "img",
754
- width: "1em",
755
- height: "1em",
756
- viewBox: "0 0 24 24"
757
- }, [createVNode("path", {
758
- fill: "currentColor",
759
- 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"
760
- }, null)]) : createVNode("svg", {
761
- xmlns: "http://www.w3.org/2000/svg",
762
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
763
- role: "img",
764
- width: "1em",
765
- height: "1em",
766
- viewBox: "0 0 24 24"
767
- }, [createVNode("path", {
768
- fill: "currentColor",
769
- 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"
770
- }, null)])] })] }), [[
771
- vTooltip,
772
- u.mode === "light" ? B("common.layout.mode.light") : u.mode === "dark" ? B("common.layout.mode.dark") : B("common.layout.mode.auto"),
773
- void 0,
774
- { bottom: !0 }
775
- ]]);
776
- }
777
- }), AppLanguage = /* @__PURE__ */ defineComponent({
778
- name: "AppLanguage",
779
- props: {
780
- lang: String,
781
- supports: Array
782
- },
783
- emit: ["update:lang"],
784
- setup(u, { emit: R }) {
785
- return () => createVNode(NDropdown, {
786
- options: u.supports,
787
- keyField: "value",
788
- showArrow: !0,
789
- onSelect: (u) => R("update:lang", u)
790
- }, { default: () => [createVNode(NButton, {
791
- quaternary: !0,
792
- style: "--n-padding: 0 12px"
793
- }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
794
- xmlns: "http://www.w3.org/2000/svg",
795
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
796
- role: "img",
797
- width: "1em",
798
- height: "1em",
799
- viewBox: "0 0 24 24"
800
- }, [createVNode("g", {
801
- fill: "none",
802
- stroke: "currentColor",
803
- "stroke-linecap": "round",
804
- "stroke-linejoin": "round",
805
- "stroke-width": "1.5"
806
- }, [createVNode("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), createVNode("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)])])] })] })] });
807
- }
808
- });
809
- function _isSlot(u) {
810
- return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !isVNode(u);
811
- }
812
- const AppNotification = /* @__PURE__ */ defineComponent({
813
- name: "AppNotification",
814
- inheritAttrs: !1,
815
- props: {
816
- getUnreadCount: Function,
817
- getPage: Function,
818
- markRead: Function,
819
- markDelete: Function,
820
- interval: {
821
- type: Number,
822
- default: 3e4
823
- }
824
- },
825
- setup(R, { slots: B, attrs: V }) {
826
- let { t: H } = useI18n(), U = ref(!1), G = ref("unread"), K = reactive({
827
- page: 1,
828
- size: 10,
829
- loading: !1,
830
- records: [],
831
- total: 0,
832
- unread: 0
833
- }), { sync: J, post: Y } = useAtomicBroadcast({
834
- channel: "__ithinkdt_mc_shared_channel",
835
- onMsg: (u) => {
836
- K.unread = u;
837
- },
838
- getMsg: () => (U.value && (K.loading = !0, Promise.resolve(R.getPage?.(G.value, K.page, K.size) ?? []).then(({ records: u, total: R }) => {
839
- K.records = u, G.value === "unread" ? (K.unread = R, Y(R)) : K.total = R;
840
- }).finally(() => {
841
- K.loading = !1;
842
- })), R.getUnreadCount?.() ?? 0),
843
- timeout: () => R.interval,
844
- immediate: !0
845
- });
846
- return () => {
847
- let q = withDirectives(createVNode(NButton, mergeProps(V, {
848
- quaternary: !0,
849
- style: "--n-padding: 0 12px",
850
- onClick: () => {
851
- U.value = !0, G.value = K.unread > 0 ? "unread" : "all", setTimeout(J, 300);
852
- }
853
- }), { default: () => [B.icon ? B.icon() : createVNode(NBadge, {
854
- show: K.unread > 0,
855
- dot: !0,
856
- offset: [-2, 5],
857
- processing: !0
858
- }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
859
- xmlns: "http://www.w3.org/2000/svg",
860
- width: "1em",
861
- height: "1em",
862
- viewBox: "0 0 24 24"
863
- }, [createVNode("g", {
864
- fill: "none",
865
- stroke: "currentColor",
866
- "stroke-linecap": "round",
867
- "stroke-linejoin": "round",
868
- "stroke-width": "1.5",
869
- color: "currentColor"
870
- }, [createVNode("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), createVNode("path", { d: "M8 19c.458 1.725 2.076 3 4 3c1.925 0 3.541-1.275 4-3" }, null)])])] })] })] }), [[
533
+ collapsedWidth: {
534
+ type: Number,
535
+ default: 60
536
+ }
537
+ },
538
+ setup(d) {
539
+ let z = shallowRef([]);
540
+ watch([() => d.menus, () => d.single], ([B, V]) => {
541
+ if (z.value = [], !B?.length) return;
542
+ let H = (z, B = 0) => {
543
+ let U = [];
544
+ for (let W of z) {
545
+ if (W.type === "action") continue;
546
+ let z = W.type === "view" ? void 0 : H(W.children ?? [], B + 1), G = {
547
+ _: W,
548
+ key: W.key,
549
+ label: () => d.renderLabel?.(W) ?? W.name,
550
+ icon: B === 0 || W.icon ? d.getIcon?.(W.icon) ?? IBookmark : void 0,
551
+ children: V ? void 0 : z,
552
+ path: W.path || (V ? z?.[0]?.path : void 0),
553
+ depth: B
554
+ };
555
+ delete G.type, U.push(G);
556
+ }
557
+ return U;
558
+ };
559
+ z.value = H(B);
560
+ }, { immediate: !0 }), watch([useTemplateRef("menu"), () => d.current], ([d, z]) => {
561
+ d?.showOption(z);
562
+ }, { immediate: !0 });
563
+ let V = inject(COLLAPSED_INJECTION_KEY, !1), H = (z) => {
564
+ let H = d.collapsed ?? unref(V), U;
565
+ if (z._.type === "view") if (z.isExternal && z.externalEmbed) U = createVNode("a", {
566
+ href: z.externalLink,
567
+ target: "_blank",
568
+ onClick: (d) => d.stopPropagation()
569
+ }, [z.label()]);
570
+ else {
571
+ let d;
572
+ U = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
573
+ }
574
+ else U = createVNode("span", null, [z.label()]);
575
+ return U.key = `${z.key}:${H ? 1 : 0}`, z.depth === 0 && !H && (U = withDirectives(U, [[
871
576
  vTooltip,
872
- H("common.notification.tip", { count: K.unread }),
577
+ z.label(),
873
578
  void 0,
874
- { bottom: !0 }
875
- ]]), Y = () => {
876
- let u, R;
877
- return createVNode("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
878
- createVNode("div", { style: "padding-right: 12px" }, [H("common.notification.title")]),
879
- createVNode(NButton, {
880
- text: !0,
881
- type: G.value === "all" ? "primary" : "default",
882
- onClick: () => {
883
- G.value = "all", J();
884
- }
885
- }, _isSlot(u = H("common.notification.all")) ? u : { default: () => [u] }),
886
- createVNode(NButton, {
887
- text: !0,
888
- type: G.value === "unread" ? "primary" : "default",
889
- onClick: () => {
890
- G.value = "unread", J();
891
- }
892
- }, _isSlot(R = H("common.notification.unread", { count: K.unread > 99 ? "99+" : K.unread.toString() })) ? R : { default: () => [R] })
893
- ]);
894
- }, X = (u) => createVNode(NListItem, {
895
- key: u.key,
896
- onClick: () => {
897
- u.status === "unread" && (R.markRead?.([u.key]).then(() => {
898
- u.status = "read";
899
- }), K.unread--), u.link && window.open(u.link, "_target");
900
- }
901
- }, { default: () => [createVNode(NThing, {
902
- bordered: !1,
903
- closable: !0,
904
- contentIndented: !0,
905
- size: "small",
906
- onMouseenter: () => u.hover = !0,
907
- onMouseleave: () => u.hover = !1,
908
- style: "padding: 0 4px"
909
- }, {
910
- avatar: () => createVNode(NIcon, {
911
- size: 22,
912
- color: u.status === "unread" ? "var(--color-primary)" : void 0
913
- }, { default: () => [createVNode("svg", {
914
- xmlns: "http://www.w3.org/2000/svg",
915
- width: "1em",
916
- height: "1em",
917
- viewBox: "0 0 24 24"
918
- }, [createVNode("path", {
919
- fill: "currentColor",
920
- 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"
921
- }, null)])] }),
922
- header: () => u.title,
923
- "header-extra": () => {
924
- let B, V;
925
- return u.hover ? createVNode("div", {
926
- style: "display: flex; justify-content: end; gap: 12px",
927
- onClick: (u) => {
928
- u.preventDefault(), u.stopPropagation();
929
- }
930
- }, [u.status === "unread" ? createVNode(NButton, {
931
- text: !0,
932
- type: "primary",
933
- onClick: () => {
934
- R.markRead?.([u.key]).then(() => {
935
- u.status = "read", K.unread--;
936
- });
937
- }
938
- }, _isSlot(B = H("common.notification.markRead")) ? B : { default: () => [B] }) : void 0, createVNode(NButton, {
939
- text: !0,
940
- type: "error",
941
- onClick: () => {
942
- K.records === 1 ? (K.records = [], J()) : K.records.splice(K.records.findIndex((R) => R.key == u.key), 1), R.markDelete?.([u.key]);
943
- }
944
- }, _isSlot(V = H("common.notification.markDelete")) ? V : { default: () => [V] })]) : void 0;
945
- },
946
- default: u.content,
947
- footer: () => createVNode("span", { style: "color: gray" }, [u.hover ? format(u.date, H("common.notification.time")) : H("common.timeago", { time: u.date })])
948
- })] }), Z = () => {
949
- let u;
950
- return withDirectives(K.records.length > 0 ? createVNode(NList, {
951
- clickable: !0,
952
- hoverable: !0,
953
- style: "min-height: 50vh"
954
- }, _isSlot(u = K.records.map((u) => X(u))) ? u : { default: () => [u] }) : createVNode(NEmpty, { style: "margin-top: 30vh" }, null), [[vSpin, K.loading]]);
955
- }, Q = () => createVNode("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [G.value === "unread" ? createVNode(NButton, {
956
- text: !0,
957
- type: "primary",
958
- disabled: K.records.length === 0,
959
- onClick: () => {
960
- let u = K.records.filter((u) => u.status === "unread").map((u) => u.key);
961
- R.markRead(u).then(() => {
962
- for (; K.unread - u.length <= K.size * (K.page - 1);) K.page--;
963
- J();
964
- });
965
- }
966
- }, {
967
- icon: () => createVNode(NIcon, { size: "20" }, { default: () => [createVNode("svg", {
968
- xmlns: "http://www.w3.org/2000/svg",
969
- width: "1em",
970
- height: "1em",
971
- viewBox: "0 0 24 24"
972
- }, [createVNode("path", {
973
- fill: "currentColor",
974
- 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"
975
- }, null)])] }),
976
- default: () => H("common.notification.markPageRead")
977
- }) : createVNode("span", null, null), createVNode(NPagination, {
978
- simple: !0,
979
- pageSize: K.size,
980
- page: K.page,
981
- itemCount: G.value === "unread" ? K.unread : K.total,
982
- onUpdatePage: (u) => {
983
- K.page = u, J();
579
+ {
580
+ auto: !0,
581
+ right: !0
984
582
  }
985
- }, null)]);
986
- return createVNode(Fragment, null, [q, createVNode(NDrawer, {
987
- show: U.value,
988
- "onUpdate:show": (u) => U.value = u,
989
- showMask: !1,
990
- width: 400
991
- }, { default: () => [createVNode(NDrawerContent, {
992
- title: H("common.notification.title"),
993
- closable: !0,
994
- nativeScrollbar: !1,
995
- bodyContentStyle: { padding: "0" }
996
- }, {
997
- header: Y,
998
- default: Z,
999
- footer: Q
1000
- })] })]);
583
+ ]])), z.isNew && (U = createVNode("div", { style: "display: flex; width: 100%" }, [createVNode("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [U]), createVNode("svg", {
584
+ xmlns: "http://www.w3.org/2000/svg",
585
+ width: "24",
586
+ height: "24",
587
+ viewBox: "0 0 1024 1024",
588
+ style: "margin-left: 8px; flex: 0 0 auto;"
589
+ }, [createVNode("path", {
590
+ 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",
591
+ fill: "var(--color-danger)"
592
+ }, null)])])), U;
593
+ };
594
+ return () => {
595
+ let B = createVNode(NMenu, {
596
+ ref: "menu",
597
+ options: z.value,
598
+ rootIndent: 16,
599
+ accordion: d.accordion,
600
+ collapsed: d.collapsed ?? unref(V),
601
+ dropdownProps: { showArrow: !0 },
602
+ mode: d.horizontal ? "horizontal" : "vertical",
603
+ value: d.current ?? null,
604
+ renderLabel: H,
605
+ responsive: !0,
606
+ collapsedWidth: d.collapsedWidth,
607
+ width: d.width
608
+ }, null);
609
+ return d.horizontal ? B : createVNode(NScrollbar, null, _isSlot$1(B) ? B : { default: () => [B] });
1001
610
  };
1002
611
  }
1003
612
  });
1004
- function useCtxMenu(u, B, V) {
613
+ function useCtxMenu(z, B, V) {
1005
614
  let { t: H } = useI18n(), U = reactive({
1006
615
  visible: !1,
1007
616
  x: 0,
1008
617
  y: 0
1009
- }), W = async (u, R) => {
1010
- u.preventDefault(), u.stopPropagation(), !(U.visible && U.tab === R) && (U.tab = R, U.visible && (U.visible = !1, await promiseTimeout(130)), U.visible = !0, U.x = u.clientX, U.y = u.clientY);
618
+ }), W = async (d, z) => {
619
+ d.preventDefault(), d.stopPropagation(), !(U.visible && U.tab === z) && (U.tab = z, U.visible && (U.visible = !1, await promiseTimeout(130)), U.visible = !0, U.x = d.clientX, U.y = d.clientY);
1011
620
  }, G = async () => {
1012
621
  requestIdleCallback(() => {
1013
622
  U.visible = !1;
@@ -1135,31 +744,31 @@ function useCtxMenu(u, B, V) {
1135
744
  }, null)])] })
1136
745
  }
1137
746
  ]),
1138
- onSelect: async (R) => {
747
+ onSelect: async (d) => {
1139
748
  U.visible = !1;
1140
- let z = [...u.value];
1141
- if (R === "closeAll") {
749
+ let H = [...z.value];
750
+ if (d === "closeAll") {
1142
751
  await K.push("/");
1143
- for (let u of z) u.key !== B.value && u.close(!1);
752
+ for (let d of H) d.key !== B.value && d.close(!1);
1144
753
  return;
1145
754
  }
1146
- if (R === "fullTab") {
755
+ if (d === "fullTab") {
1147
756
  V();
1148
757
  return;
1149
758
  }
1150
759
  if (!U.tab) {
1151
- let u = z.find((u) => u.key === B.value);
1152
- switch (R) {
760
+ let z = H.find((d) => d.key === B.value);
761
+ switch (d) {
1153
762
  case "open":
1154
- window.open(u.href, "_blank");
763
+ window.open(z.href, "_blank");
1155
764
  break;
1156
765
  case "reload":
1157
- u.reloading ||= (u.reloading = !0, await promiseTimeout(220), !1);
766
+ z.reloading ||= (z.reloading = !0, await promiseTimeout(220), !1);
1158
767
  break;
1159
768
  }
1160
769
  return;
1161
770
  }
1162
- switch (R) {
771
+ switch (d) {
1163
772
  case "open":
1164
773
  window.open(U.tab.href, "_blank");
1165
774
  break;
@@ -1171,39 +780,39 @@ function useCtxMenu(u, B, V) {
1171
780
  break;
1172
781
  case "closeOther":
1173
782
  B.value !== U.tab.key && await K.push(U.tab.fullPath);
1174
- for (let u of z) u.key !== U.tab.key && u.close(!1);
783
+ for (let d of H) d.key !== U.tab.key && d.close(!1);
1175
784
  break;
1176
785
  case "closeLeft":
1177
786
  B.value !== U.tab.key && await K.push(U.tab.fullPath);
1178
- for (let R of u.value.slice(0, z.indexOf(U.tab))) R.close(!1);
787
+ for (let d of z.value.slice(0, H.indexOf(U.tab))) d.close(!1);
1179
788
  break;
1180
789
  case "closeRight":
1181
790
  B.value !== U.tab.key && await K.push(U.tab.fullPath);
1182
- for (let R of u.value.slice(z.indexOf(U.tab) + 1)) R.close(!1);
791
+ for (let d of z.value.slice(H.indexOf(U.tab) + 1)) d.close(!1);
1183
792
  break;
1184
793
  }
1185
794
  }
1186
795
  };
1187
796
  }
1188
- function useContentScroll(u, R, z) {
1189
- function B(z) {
1190
- if (z === -1 || !R.value?.children.length) return;
1191
- let B = R.value.children[z];
1192
- u.value.scrollTo({
797
+ function useContentScroll(d, z, B) {
798
+ function V(B) {
799
+ if (B === -1 || !z.value?.children.length) return;
800
+ let V = z.value.children[B];
801
+ d.value.scrollTo({
1193
802
  behavior: "smooth",
1194
- left: Math.max(0, R.value.offsetLeft + B.offsetLeft - u.value.clientWidth / 2 + B.clientWidth / 2 + 10)
803
+ left: Math.max(0, z.value.offsetLeft + V.offsetLeft - d.value.clientWidth / 2 + V.clientWidth / 2 + 10)
1195
804
  });
1196
805
  }
1197
- return watchDebounced(useElementHover(u), (u) => {
1198
- u || B(z.value);
1199
- }, { debounce: 333 }), watch(z, B, { flush: "post" }), useEventListener(u, "wheel", (R) => {
1200
- R.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (R.preventDefault(), u.value.scrollBy({ left: R.deltaY }));
806
+ return watchDebounced(useElementHover(d), (d) => {
807
+ d || V(B.value);
808
+ }, { debounce: 333 }), watch(B, V, { flush: "post" }), useEventListener(d, "wheel", (z) => {
809
+ z.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (z.preventDefault(), d.value.scrollBy({ left: z.deltaY }));
1201
810
  }, { passive: !1 }), {
1202
- el: u,
1203
- content: R
811
+ el: d,
812
+ content: z
1204
813
  };
1205
814
  }
1206
- var IBg = (u) => createVNode("svg", u, [
815
+ var IBg = (d) => createVNode("svg", d, [
1207
816
  createVNode("defs", null, [
1208
817
  createVNode("symbol", {
1209
818
  id: "geometry-left",
@@ -1249,39 +858,39 @@ var IBg = (u) => createVNode("svg", u, [
1249
858
  dark: Boolean
1250
859
  },
1251
860
  emits: ["close"],
1252
- setup(u, { emit: B, slots: V }) {
1253
- let H = ref$1(), U = useElementHover(H), W = ref$1(), G = ref$1(), { width: K } = useElementSize(G);
1254
- watch(K, async () => {
1255
- await promiseTimeout(1), W.value.style.width = G.value.scrollWidth + "px";
861
+ setup(d, { emit: z, slots: B }) {
862
+ let V = ref(), H = useElementHover(V), U = ref(), W = ref(), { width: G } = useElementSize(W);
863
+ watch(G, async () => {
864
+ await promiseTimeout(1), U.value.style.width = W.value.scrollWidth + "px";
1256
865
  });
1257
- let q = useThemeVars(), Y = computed(() => ({
866
+ let K = useThemeVars(), q = computed(() => ({
1258
867
  fontSize: "14px",
1259
- color: u.isCurrent ? q.value.primaryColor : q.value.textColor3,
868
+ color: d.isCurrent ? K.value.primaryColor : K.value.textColor3,
1260
869
  maxWidth: "355px",
1261
870
  overflow: "hidden"
1262
- })), X = computed(() => ({
871
+ })), J = computed(() => ({
1263
872
  width: "calc(100% + 27px)",
1264
873
  height: "100%",
1265
874
  position: "absolute",
1266
875
  top: "0",
1267
876
  left: "-14px",
1268
- zIndex: u.isCurrent ? -1 : -2,
1269
- color: u.isCurrent ? getOpaqueColor(q.value.primaryColor, u.dark ? .3 : .12, u.dark ? "#000" : "#fff") : U.value ? q.value.borderColor : "transparent"
877
+ zIndex: d.isCurrent ? -1 : -2,
878
+ color: d.isCurrent ? getOpaqueColor(K.value.primaryColor, d.dark ? .3 : .12, d.dark ? "#000" : "#fff") : H.value ? K.value.borderColor : "transparent"
1270
879
  }));
1271
880
  return () => createVNode("div", {
1272
- ref: H,
881
+ ref: V,
1273
882
  style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
1274
883
  }, [
1275
884
  createVNode("div", {
1276
- ref: W,
885
+ ref: U,
1277
886
  style: "transition: width 300ms; overflow: hidden"
1278
887
  }, [createVNode("div", {
1279
- ref: G,
888
+ ref: W,
1280
889
  style: "display: flex; align-items: center; gap: 4px; width: fit-content"
1281
- }, [createVNode("span", { style: Y.value }, [V.default?.()]), u.closable !== !1 && (u.isCurrent || U.value) ? createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
890
+ }, [createVNode("span", { style: q.value }, [B.default?.()]), d.closable !== !1 && (d.isCurrent || H.value) ? createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
1282
891
  text: !0,
1283
- onClick: (u) => {
1284
- u.stopPropagation(), B("close");
892
+ onClick: (d) => {
893
+ d.stopPropagation(), z("close");
1285
894
  }
1286
895
  }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
1287
896
  xmlns: "http://www.w3.org/2000/svg",
@@ -1293,7 +902,7 @@ var IBg = (u) => createVNode("svg", u, [
1293
902
  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"
1294
903
  }, null)])] })] })]) : void 0])]),
1295
904
  createVNode("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
1296
- createVNode(IBg, { style: X.value }, null)
905
+ createVNode(IBg, { style: J.value }, null)
1297
906
  ]);
1298
907
  }
1299
908
  });
@@ -1307,55 +916,309 @@ const AppMultiTabs = /* @__PURE__ */ defineComponent({
1307
916
  dark: Boolean
1308
917
  },
1309
918
  emits: ["update:fullTab"],
1310
- setup(u, { emit: B, slots: V }) {
1311
- let H = getCtx();
1312
- H.hasMultiTab = !0;
1313
- let U = useRouter(), { ctx: W, onCtx: G, onClickoutside: K, options: q, onSelect: Y } = useCtxMenu(toRef$1(u, "tabs"), computed(() => u.current?.key), () => B("update:fullTab", !u.fullTab)), X = computed(() => u.current ? u.tabs.findIndex((R) => R.key === u.current?.key) : -1), Q = ref$1(), $ = ref$1();
1314
- return useContentScroll(Q, $, X), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
1315
- ref: Q,
919
+ setup(d, { emit: z, slots: B }) {
920
+ let V = getCtx();
921
+ V.hasMultiTab = !0;
922
+ let H = useRouter(), { ctx: U, onCtx: W, onClickoutside: G, options: K, onSelect: q } = useCtxMenu(toRef(d, "tabs"), computed(() => d.current?.key), () => z("update:fullTab", !d.fullTab)), J = computed(() => d.current ? d.tabs.findIndex((z) => z.key === d.current?.key) : -1), Y = ref(), Z = ref();
923
+ return useContentScroll(Y, Z, J), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
924
+ ref: Y,
1316
925
  style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
1317
926
  }, [
1318
927
  createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
1319
928
  createVNode("div", {
1320
- ref: $,
929
+ ref: Z,
1321
930
  style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
1322
- onContextmenu: (u) => G(u)
1323
- }, [u.tabs.map((R, B, H) => {
1324
- let W = u.current?.key === R.key, K = R.title ?? R.path;
931
+ onContextmenu: (d) => W(d)
932
+ }, [d.tabs.map((z, V, U) => {
933
+ let G = d.current?.key === z.key, K = z.title ?? z.path;
1325
934
  return createVNode(AppTab, {
1326
- key: R.key,
1327
- isCurrent: W,
1328
- isLast: B === H.length - 1,
1329
- onClose: R.close,
1330
- closable: R.closable,
1331
- dark: u.dark,
935
+ key: z.key,
936
+ isCurrent: G,
937
+ isLast: V === U.length - 1,
938
+ onClose: z.close,
939
+ closable: z.closable,
940
+ dark: d.dark,
1332
941
  onClick: () => {
1333
- W || U.push(R.fullPath);
942
+ G || H.push(z.fullPath);
1334
943
  },
1335
- onContextmenu: (u) => G(u, R)
1336
- }, { default: () => [V.name ? V.name({
1337
- isCurrent: W,
944
+ onContextmenu: (d) => W(d, z)
945
+ }, { default: () => [B.name ? B.name({
946
+ isCurrent: G,
1338
947
  name: K,
1339
- tab: R
948
+ tab: z
1340
949
  }) : K] });
1341
950
  })]),
1342
951
  createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
1343
952
  ]), createVNode(NDropdown, {
1344
953
  placement: "bottom-start",
1345
954
  trigger: "manual",
1346
- show: W.visible,
1347
- x: W.x,
1348
- y: W.y,
1349
- options: q.value,
1350
- onClickoutside: K,
1351
- onSelect: Y
955
+ show: U.visible,
956
+ x: U.x,
957
+ y: U.y,
958
+ options: K.value,
959
+ onClickoutside: G,
960
+ onSelect: q
1352
961
  }, null)]);
1353
962
  }
963
+ });
964
+ function _isSlot(d) {
965
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
966
+ }
967
+ const AppNotification = /* @__PURE__ */ defineComponent({
968
+ name: "AppNotification",
969
+ inheritAttrs: !1,
970
+ props: {
971
+ getUnreadCount: Function,
972
+ getPage: Function,
973
+ markRead: Function,
974
+ markDelete: Function,
975
+ interval: {
976
+ type: Number,
977
+ default: 3e4
978
+ }
979
+ },
980
+ setup(z, { slots: H, attrs: U }) {
981
+ let { t: W } = useI18n(), G = ref(!1), K = ref("unread"), q = reactive({
982
+ page: 1,
983
+ size: 10,
984
+ loading: !1,
985
+ records: [],
986
+ total: 0,
987
+ unread: 0
988
+ }), { sync: J, post: X } = useAtomicBroadcast({
989
+ channel: "__ithinkdt_mc_shared_channel",
990
+ onMsg: (d) => {
991
+ q.unread = d;
992
+ },
993
+ getMsg: () => (G.value && (q.loading = !0, Promise.resolve(z.getPage?.(K.value, q.page, q.size) ?? []).then(({ records: d, total: z }) => {
994
+ q.records = d, K.value === "unread" ? (q.unread = z, X(z)) : q.total = z;
995
+ }).finally(() => {
996
+ q.loading = !1;
997
+ })), z.getUnreadCount?.() ?? 0),
998
+ timeout: () => z.interval,
999
+ immediate: !0
1000
+ });
1001
+ return () => {
1002
+ let d = withDirectives(createVNode(NButton, mergeProps(U, {
1003
+ quaternary: !0,
1004
+ style: "--n-padding: 0 12px",
1005
+ onClick: () => {
1006
+ G.value = !0, K.value = q.unread > 0 ? "unread" : "all", setTimeout(J, 300);
1007
+ }
1008
+ }), { default: () => [H.icon ? H.icon() : createVNode(NBadge, {
1009
+ show: q.unread > 0,
1010
+ dot: !0,
1011
+ offset: [-2, 5],
1012
+ processing: !0
1013
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1014
+ xmlns: "http://www.w3.org/2000/svg",
1015
+ width: "1em",
1016
+ height: "1em",
1017
+ viewBox: "0 0 24 24"
1018
+ }, [createVNode("g", {
1019
+ fill: "none",
1020
+ stroke: "currentColor",
1021
+ "stroke-linecap": "round",
1022
+ "stroke-linejoin": "round",
1023
+ "stroke-width": "1.5",
1024
+ color: "currentColor"
1025
+ }, [createVNode("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), createVNode("path", { d: "M8 19c.458 1.725 2.076 3 4 3c1.925 0 3.541-1.275 4-3" }, null)])])] })] })] }), [[
1026
+ vTooltip,
1027
+ W("common.notification.tip", { count: q.unread }),
1028
+ void 0,
1029
+ { bottom: !0 }
1030
+ ]]), X = () => {
1031
+ let d, z;
1032
+ return createVNode("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
1033
+ createVNode("div", { style: "padding-right: 12px" }, [W("common.notification.title")]),
1034
+ createVNode(NButton, {
1035
+ text: !0,
1036
+ type: K.value === "all" ? "primary" : "default",
1037
+ onClick: () => {
1038
+ K.value = "all", J();
1039
+ }
1040
+ }, _isSlot(d = W("common.notification.all")) ? d : { default: () => [d] }),
1041
+ createVNode(NButton, {
1042
+ text: !0,
1043
+ type: K.value === "unread" ? "primary" : "default",
1044
+ onClick: () => {
1045
+ K.value = "unread", J();
1046
+ }
1047
+ }, _isSlot(z = W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })) ? z : { default: () => [z] })
1048
+ ]);
1049
+ }, Z = (d) => createVNode(NListItem, {
1050
+ key: d.key,
1051
+ onClick: () => {
1052
+ d.status === "unread" && (z.markRead?.([d.key]).then(() => {
1053
+ d.status = "read";
1054
+ }), q.unread--), d.link && window.open(d.link, "_target");
1055
+ }
1056
+ }, { default: () => [createVNode(NThing, {
1057
+ bordered: !1,
1058
+ closable: !0,
1059
+ contentIndented: !0,
1060
+ size: "small",
1061
+ onMouseenter: () => d.hover = !0,
1062
+ onMouseleave: () => d.hover = !1,
1063
+ style: "padding: 0 4px"
1064
+ }, {
1065
+ avatar: () => createVNode(NIcon, {
1066
+ size: 22,
1067
+ color: d.status === "unread" ? "var(--color-primary)" : void 0
1068
+ }, { default: () => [createVNode("svg", {
1069
+ xmlns: "http://www.w3.org/2000/svg",
1070
+ width: "1em",
1071
+ height: "1em",
1072
+ viewBox: "0 0 24 24"
1073
+ }, [createVNode("path", {
1074
+ fill: "currentColor",
1075
+ 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"
1076
+ }, null)])] }),
1077
+ header: () => d.title,
1078
+ "header-extra": () => {
1079
+ let B, V;
1080
+ return d.hover ? createVNode("div", {
1081
+ style: "display: flex; justify-content: end; gap: 12px",
1082
+ onClick: (d) => {
1083
+ d.preventDefault(), d.stopPropagation();
1084
+ }
1085
+ }, [d.status === "unread" ? createVNode(NButton, {
1086
+ text: !0,
1087
+ type: "primary",
1088
+ onClick: () => {
1089
+ z.markRead?.([d.key]).then(() => {
1090
+ d.status = "read", q.unread--;
1091
+ });
1092
+ }
1093
+ }, _isSlot(B = W("common.notification.markRead")) ? B : { default: () => [B] }) : void 0, createVNode(NButton, {
1094
+ text: !0,
1095
+ type: "error",
1096
+ onClick: () => {
1097
+ q.records === 1 ? (q.records = [], J()) : q.records.splice(q.records.findIndex((z) => z.key == d.key), 1), z.markDelete?.([d.key]);
1098
+ }
1099
+ }, _isSlot(V = W("common.notification.markDelete")) ? V : { default: () => [V] })]) : void 0;
1100
+ },
1101
+ default: d.content,
1102
+ footer: () => createVNode("span", { style: "color: gray" }, [d.hover ? format(d.date, W("common.notification.time")) : W("common.timeago", { time: d.date })])
1103
+ })] }), Q = () => {
1104
+ let d;
1105
+ return withDirectives(q.records.length > 0 ? createVNode(NList, {
1106
+ clickable: !0,
1107
+ hoverable: !0,
1108
+ style: "min-height: 50vh"
1109
+ }, _isSlot(d = q.records.map((d) => Z(d))) ? d : { default: () => [d] }) : createVNode(NEmpty, { style: "margin-top: 30vh" }, null), [[vSpin, q.loading]]);
1110
+ }, $ = () => createVNode("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [K.value === "unread" ? createVNode(NButton, {
1111
+ text: !0,
1112
+ type: "primary",
1113
+ disabled: q.records.length === 0,
1114
+ onClick: () => {
1115
+ let d = q.records.filter((d) => d.status === "unread").map((d) => d.key);
1116
+ z.markRead(d).then(() => {
1117
+ for (; q.unread - d.length <= q.size * (q.page - 1);) q.page--;
1118
+ J();
1119
+ });
1120
+ }
1121
+ }, {
1122
+ icon: () => createVNode(NIcon, { size: "20" }, { default: () => [createVNode("svg", {
1123
+ xmlns: "http://www.w3.org/2000/svg",
1124
+ width: "1em",
1125
+ height: "1em",
1126
+ viewBox: "0 0 24 24"
1127
+ }, [createVNode("path", {
1128
+ fill: "currentColor",
1129
+ 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"
1130
+ }, null)])] }),
1131
+ default: () => W("common.notification.markPageRead")
1132
+ }) : createVNode("span", null, null), createVNode(NPagination, {
1133
+ simple: !0,
1134
+ pageSize: q.size,
1135
+ page: q.page,
1136
+ itemCount: K.value === "unread" ? q.unread : q.total,
1137
+ onUpdatePage: (d) => {
1138
+ q.page = d, J();
1139
+ }
1140
+ }, null)]);
1141
+ return createVNode(Fragment, null, [d, createVNode(NDrawer, {
1142
+ show: G.value,
1143
+ "onUpdate:show": (d) => G.value = d,
1144
+ showMask: !1,
1145
+ width: 400
1146
+ }, { default: () => [createVNode(NDrawerContent, {
1147
+ title: W("common.notification.title"),
1148
+ closable: !0,
1149
+ nativeScrollbar: !1,
1150
+ bodyContentStyle: { padding: "0" }
1151
+ }, {
1152
+ header: X,
1153
+ default: Q,
1154
+ footer: $
1155
+ })] })]);
1156
+ };
1157
+ }
1158
+ });
1159
+ var ICheck = (d) => createVNode("svg", mergeProps({
1160
+ xmlns: "http://www.w3.org/2000/svg",
1161
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1162
+ role: "img",
1163
+ width: "1em",
1164
+ height: "1em",
1165
+ viewBox: "0 0 24 24"
1166
+ }, d), [createVNode("path", {
1167
+ fill: "currentColor",
1168
+ d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
1169
+ }, null)]);
1170
+ const AppTenant = /* @__PURE__ */ defineComponent({
1171
+ name: "AppTenant",
1172
+ props: {
1173
+ options: Array,
1174
+ current: String
1175
+ },
1176
+ emit: ["update:current"],
1177
+ setup(z, { emit: B }) {
1178
+ let { t: V } = useI18n(), H = (d) => d.disabled ? createVNode("div", null, [d.name]) : createVNode("div", { style: "display: flex; align-items: center; justify-content: space-between; gap: 20px" }, [createVNode("div", { style: "display: flex; align-items: center; gap: 8px" }, [createVNode(NAvatar, {
1179
+ round: !0,
1180
+ size: 22,
1181
+ color: "var(--color-primary-hover)"
1182
+ }, { default: () => [d.icon?.() || d.name[0]] }), createVNode("span", { style: d.id === z.current ? "color: var(--color-primary)" : "" }, [d.name])]), d.id === z.current ? createVNode(ICheck, { style: "color: var(--color-primary); font-size: 20px" }, null) : createVNode("div", null, null)]), U = computed(() => [{
1183
+ id: "___",
1184
+ name: V("common.account.changeTenant"),
1185
+ disabled: !0
1186
+ }, ...z.options ?? []]);
1187
+ return () => {
1188
+ if (!z.options?.length) return;
1189
+ let d = z.options.find((d) => d.id === z.current);
1190
+ return createVNode(NDropdown, {
1191
+ options: U.value,
1192
+ placement: "bottom-end",
1193
+ keyField: "id",
1194
+ labelField: "name",
1195
+ showArrow: !0,
1196
+ renderLabel: H,
1197
+ onSelect: (d) => d !== z.current && B("update:current", d)
1198
+ }, { default: () => [createVNode(NButton, {
1199
+ quaternary: !0,
1200
+ style: "--n-padding: 0 6px"
1201
+ }, {
1202
+ icon: () => createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1203
+ xmlns: "http://www.w3.org/2000/svg",
1204
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1205
+ viewBox: "0 0 1024 1024",
1206
+ width: "1em",
1207
+ height: "1em",
1208
+ role: "img"
1209
+ }, [createVNode("path", {
1210
+ 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",
1211
+ fill: "currentColor"
1212
+ }, null)])] }),
1213
+ default: () => d?.shotName || d?.name
1214
+ })] });
1215
+ };
1216
+ }
1354
1217
  }), UIProvider = /* @__PURE__ */ defineComponent({
1355
1218
  name: "UIProvider",
1356
1219
  props: { i18n: Function },
1357
- setup(u, { slots: R }) {
1358
- return provide(UI_I18N_INJECTION, toRef(u, "i18n")), () => R.default();
1220
+ setup(d, { slots: B }) {
1221
+ return provide(UI_I18N_INJECTION, toRef(d, "i18n")), () => B.default();
1359
1222
  }
1360
1223
  });
1361
- export { AppAccount, AppAppearance, AppBreadcrumb, AppContent, AppFooter, AppFullscreen, AppHeader, AppLanguage, AppLayout, AppLogo, AppMenu, AppMultiTabs, AppNotification, AppSider, SpinDirectiveProvider, TooltipDirectiveProvider, UIProvider, vSpin, vTooltip };
1224
+ export { AppAccount, AppAppearance, AppBreadcrumb, AppContent, AppFooter, AppFullscreen, AppHeader, AppLanguage, AppLayout, AppLogo, AppMenu, AppMultiTabs, AppNotification, AppSider, AppTenant, SpinDirectiveProvider, TooltipDirectiveProvider, UIProvider, vSpin, vTooltip };