@huyooo/ui 0.5.34 → 0.5.37
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/dist/WidthContainer-CGy4PLm9.js +516 -0
- package/dist/common.js +1 -1
- package/dist/composables.js +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/{useSEO-CFQMgnVq.js → useSEO-CDBhukDZ.js} +212 -210
- package/package.json +1 -1
- package/dist/WidthContainer-DrExTm1Z.js +0 -525
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as I, computed as d, watch as C, toValue as G, isRef as W, hasInjectionContext as B, inject as F, watchEffect as J, getCurrentInstance as Q, onBeforeUnmount as Z, onDeactivated as X, onActivated as Y } from "vue";
|
|
2
2
|
import { useRouter as _, useRoute as x } from "vue-router";
|
|
3
3
|
import { u as R } from "./useAuthkitAppsAuthPageInfo-Ct-ElH04.js";
|
|
4
4
|
import { a as U } from "./useAuthkitUsersProfile-B1y2nleU.js";
|
|
5
|
-
const
|
|
5
|
+
const v = I({
|
|
6
6
|
key: "",
|
|
7
7
|
name: ""
|
|
8
8
|
});
|
|
9
|
-
function
|
|
9
|
+
function we() {
|
|
10
10
|
function e(t, n) {
|
|
11
|
-
|
|
11
|
+
v.value.key = t, v.value.name = n;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
activeDoc:
|
|
14
|
+
activeDoc: v,
|
|
15
15
|
setActiveDoc: e
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Se(e, t = "default") {
|
|
19
19
|
const n = document;
|
|
20
20
|
if (n && typeof n.startViewTransition == "function") {
|
|
21
21
|
const r = document.body;
|
|
@@ -30,81 +30,83 @@ function we(e, t = "default") {
|
|
|
30
30
|
} else
|
|
31
31
|
e();
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
function K(e, t) {
|
|
34
|
+
return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(t) : !1;
|
|
35
|
+
}
|
|
36
|
+
function Ae(e, t, n) {
|
|
37
|
+
for (let r = e.length - 1; r >= 0; r--) {
|
|
38
|
+
const o = e[r];
|
|
39
|
+
if (K(o.meta, t))
|
|
40
|
+
return o.path;
|
|
39
41
|
}
|
|
40
42
|
return n;
|
|
41
43
|
}
|
|
42
|
-
function
|
|
44
|
+
function $e(e) {
|
|
43
45
|
const t = _(), {
|
|
44
46
|
appsData: n
|
|
45
47
|
} = R(), {
|
|
46
48
|
isLoggedIn: r,
|
|
47
49
|
userProfile: o
|
|
48
|
-
} = U(), s =
|
|
49
|
-
var
|
|
50
|
-
return !r.value || !o.value ? [] : ((
|
|
50
|
+
} = U(), s = d(() => {
|
|
51
|
+
var p;
|
|
52
|
+
return !r.value || !o.value ? [] : ((p = o.value.permissions) == null ? void 0 : p.map((a) => a.permissionKey)) || [];
|
|
51
53
|
});
|
|
52
|
-
function i(
|
|
53
|
-
return (n.value.publicRoutes || []).some((
|
|
54
|
+
function i(p) {
|
|
55
|
+
return (n.value.publicRoutes || []).some((h) => h.permissionKey === p);
|
|
54
56
|
}
|
|
55
|
-
function c(
|
|
56
|
-
return r.value ? s.value.includes(
|
|
57
|
+
function c(p) {
|
|
58
|
+
return r.value ? s.value.includes(p) : !1;
|
|
57
59
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
60
|
+
function l(p) {
|
|
61
|
+
var a;
|
|
60
62
|
return {
|
|
61
|
-
path:
|
|
62
|
-
name:
|
|
63
|
-
meta:
|
|
64
|
-
children: (
|
|
63
|
+
path: p.path,
|
|
64
|
+
name: p.name,
|
|
65
|
+
meta: p.meta,
|
|
66
|
+
children: (a = p.children) == null ? void 0 : a.map((h) => l(h))
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
function p
|
|
68
|
-
const
|
|
69
|
-
for (const
|
|
70
|
-
if (
|
|
69
|
+
function u(p, a) {
|
|
70
|
+
const h = [];
|
|
71
|
+
for (const f of p) {
|
|
72
|
+
if (f.path === "/" || f.path === "/:catchAll(.*)")
|
|
71
73
|
continue;
|
|
72
|
-
const
|
|
73
|
-
if ((
|
|
74
|
-
const w =
|
|
74
|
+
const m = f.meta;
|
|
75
|
+
if (K(m, a)) {
|
|
76
|
+
const w = f.path;
|
|
75
77
|
if (i(w) || c(w)) {
|
|
76
|
-
const
|
|
77
|
-
name: (
|
|
78
|
-
path:
|
|
79
|
-
icon: (
|
|
80
|
-
hidden:
|
|
78
|
+
const g = {
|
|
79
|
+
name: (m == null ? void 0 : m.menuName) || (m == null ? void 0 : m.title) || (typeof f.name == "string" ? f.name : f.path),
|
|
80
|
+
path: f.path,
|
|
81
|
+
icon: (m == null ? void 0 : m.menuIcon) || (m == null ? void 0 : m.icon),
|
|
82
|
+
hidden: m == null ? void 0 : m.hidden
|
|
81
83
|
};
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
|
|
84
|
+
if (f.children && f.children.length > 0) {
|
|
85
|
+
const P = u(f.children, a);
|
|
86
|
+
P.length > 0 && (g.children = P);
|
|
85
87
|
}
|
|
86
|
-
|
|
88
|
+
h.push(g);
|
|
87
89
|
}
|
|
88
|
-
} else if (
|
|
89
|
-
const w =
|
|
90
|
-
|
|
90
|
+
} else if (f.children && f.children.length > 0) {
|
|
91
|
+
const w = u(f.children, a);
|
|
92
|
+
h.push(...w);
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
|
-
return
|
|
95
|
+
return h;
|
|
94
96
|
}
|
|
95
97
|
return {
|
|
96
|
-
menus:
|
|
98
|
+
menus: d(() => {
|
|
97
99
|
if (!e)
|
|
98
100
|
return [];
|
|
99
|
-
const
|
|
100
|
-
return console.log(
|
|
101
|
+
const p = t.getRoutes(), a = p.find((g) => g.path === "/"), h = a != null && a.children ? a.children.map((g) => l(g)) : [], f = new Set(h.map((g) => g.path)), w = p.filter((g) => g.path === "/" || g.path === "/:catchAll(.*)" || f.has(g.path) ? !1 : g.path.split("/").filter((N) => N).length === 1).map(l), T = [...h, ...w];
|
|
102
|
+
return console.log(u(T, e), "过滤菜单"), u(T, e);
|
|
101
103
|
}),
|
|
102
104
|
isRoutePublic: i,
|
|
103
|
-
hasPermission: (
|
|
105
|
+
hasPermission: (p) => i(p) ? !0 : c(p),
|
|
104
106
|
isLoggedIn: r
|
|
105
107
|
};
|
|
106
108
|
}
|
|
107
|
-
function
|
|
109
|
+
function Te() {
|
|
108
110
|
const e = _(), t = x(), {
|
|
109
111
|
appsAuthPageInfoApi: n,
|
|
110
112
|
appsData: r,
|
|
@@ -113,54 +115,54 @@ function $e() {
|
|
|
113
115
|
userProfile: s,
|
|
114
116
|
isLoggedIn: i,
|
|
115
117
|
usersProfileSuccess: c
|
|
116
|
-
} = U(),
|
|
117
|
-
function
|
|
118
|
-
return (r.value.publicRoutes || []).some((
|
|
118
|
+
} = U(), l = I(!1);
|
|
119
|
+
function u(a) {
|
|
120
|
+
return (r.value.publicRoutes || []).some((f) => f.permissionKey === a);
|
|
119
121
|
}
|
|
120
|
-
function
|
|
121
|
-
var
|
|
122
|
-
return !i.value || !s.value ? !1 : (((
|
|
122
|
+
function b(a) {
|
|
123
|
+
var f;
|
|
124
|
+
return !i.value || !s.value ? !1 : (((f = s.value.permissions) == null ? void 0 : f.map((m) => m.permissionKey)) || []).includes(a);
|
|
123
125
|
}
|
|
124
|
-
function
|
|
125
|
-
var
|
|
126
|
+
function p(a) {
|
|
127
|
+
var h, f;
|
|
126
128
|
if (!o.value) {
|
|
127
|
-
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成",
|
|
129
|
+
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成", a);
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
130
|
-
if (
|
|
131
|
-
console.log("权限检查通过:公开路由",
|
|
132
|
+
if (l.value = !0, u(a)) {
|
|
133
|
+
console.log("权限检查通过:公开路由", a), l.value = !1;
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
136
|
if (!c.value) {
|
|
135
|
-
console.log("权限检查跳过:usersProfileSuccess 未加载完成,等待...",
|
|
137
|
+
console.log("权限检查跳过:usersProfileSuccess 未加载完成,等待...", a), l.value = !1;
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
138
140
|
if (!i.value) {
|
|
139
|
-
console.log("权限检查失败:未登录,重定向到首页",
|
|
141
|
+
console.log("权限检查失败:未登录,重定向到首页", a), e.replace("/"), l.value = !1;
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
|
-
|
|
143
|
-
permissions: (
|
|
144
|
-
}), e.replace("/")),
|
|
144
|
+
b(a) ? console.log("权限检查通过:有权限", a) : (console.log("权限检查失败:无权限,重定向到首页", a, {
|
|
145
|
+
permissions: (f = (h = s.value) == null ? void 0 : h.permissions) == null ? void 0 : f.map((m) => m.permissionKey)
|
|
146
|
+
}), e.replace("/")), l.value = !1;
|
|
145
147
|
}
|
|
146
|
-
return n(),
|
|
147
|
-
|
|
148
|
-
}),
|
|
149
|
-
|
|
148
|
+
return n(), C(() => t.path, (a) => {
|
|
149
|
+
p(a);
|
|
150
|
+
}), C([o, c], ([a]) => {
|
|
151
|
+
a && p(t.path);
|
|
150
152
|
}), {
|
|
151
|
-
isChecking:
|
|
152
|
-
isRoutePublic:
|
|
153
|
-
hasPermission:
|
|
153
|
+
isChecking: l,
|
|
154
|
+
isRoutePublic: u,
|
|
155
|
+
hasPermission: b
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
const
|
|
158
|
+
const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]), Pe = /* @__PURE__ */ new Set([
|
|
157
159
|
"base",
|
|
158
160
|
"meta",
|
|
159
161
|
"link",
|
|
160
162
|
"style",
|
|
161
163
|
"script",
|
|
162
164
|
"noscript"
|
|
163
|
-
]),
|
|
165
|
+
]), ve = /* @__PURE__ */ new Set([
|
|
164
166
|
"title",
|
|
165
167
|
"base",
|
|
166
168
|
"htmlAttrs",
|
|
@@ -170,7 +172,7 @@ const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y =
|
|
|
170
172
|
"style",
|
|
171
173
|
"script",
|
|
172
174
|
"noscript"
|
|
173
|
-
]),
|
|
175
|
+
]), ne = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]), re = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]), je = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]), E = /* @__PURE__ */ new Set([
|
|
174
176
|
"theme-color",
|
|
175
177
|
"google-site-verification",
|
|
176
178
|
"og",
|
|
@@ -179,12 +181,12 @@ const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y =
|
|
|
179
181
|
"profile",
|
|
180
182
|
"twitter",
|
|
181
183
|
"author"
|
|
182
|
-
]),
|
|
184
|
+
]), S = {
|
|
183
185
|
META: /* @__PURE__ */ new Set(["twitter"]),
|
|
184
186
|
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
|
185
187
|
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
|
186
188
|
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
|
187
|
-
},
|
|
189
|
+
}, oe = {
|
|
188
190
|
articleExpirationTime: "article:expiration_time",
|
|
189
191
|
articleModifiedTime: "article:modified_time",
|
|
190
192
|
articlePublishedTime: "article:published_time",
|
|
@@ -203,12 +205,12 @@ const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y =
|
|
|
203
205
|
msapplicationConfig: "msapplication-Config",
|
|
204
206
|
msapplicationTileColor: "msapplication-TileColor",
|
|
205
207
|
msapplicationTileImage: "msapplication-TileImage"
|
|
206
|
-
},
|
|
208
|
+
}, L = {
|
|
207
209
|
appleItunesApp: {
|
|
208
210
|
unpack: {
|
|
209
211
|
entrySeparator: ", ",
|
|
210
212
|
// @ts-expect-error untyped
|
|
211
|
-
resolve: ({ key: e, value: t }) => `${
|
|
213
|
+
resolve: ({ key: e, value: t }) => `${y(e)}=${t}`
|
|
212
214
|
}
|
|
213
215
|
},
|
|
214
216
|
refresh: {
|
|
@@ -223,7 +225,7 @@ const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y =
|
|
|
223
225
|
unpack: {
|
|
224
226
|
entrySeparator: ", ",
|
|
225
227
|
// @ts-expect-error untyped
|
|
226
|
-
resolve: ({ key: e, value: t }) => typeof t == "boolean" ?
|
|
228
|
+
resolve: ({ key: e, value: t }) => typeof t == "boolean" ? y(e) : `${y(e)}:${t}`
|
|
227
229
|
}
|
|
228
230
|
},
|
|
229
231
|
contentSecurityPolicy: {
|
|
@@ -231,66 +233,66 @@ const X = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), Y =
|
|
|
231
233
|
unpack: {
|
|
232
234
|
entrySeparator: "; ",
|
|
233
235
|
// @ts-expect-error untyped
|
|
234
|
-
resolve: ({ key: e, value: t }) => `${
|
|
236
|
+
resolve: ({ key: e, value: t }) => `${y(e)} ${t}`
|
|
235
237
|
}
|
|
236
238
|
},
|
|
237
239
|
charset: {}
|
|
238
240
|
};
|
|
239
|
-
function
|
|
241
|
+
function y(e) {
|
|
240
242
|
const t = e.replace(/([A-Z])/g, "-$1").toLowerCase(), n = t.indexOf("-");
|
|
241
|
-
return n === -1 ? t :
|
|
243
|
+
return n === -1 ? t : S.META.has(t.slice(0, n)) || S.OG.has(t.slice(0, n)) ? e.replace(/([A-Z])/g, ":$1").toLowerCase() : t;
|
|
242
244
|
}
|
|
243
245
|
function D(e) {
|
|
244
246
|
return Object.fromEntries(Object.entries(e).filter(([t, n]) => String(n) !== "false" && t));
|
|
245
247
|
}
|
|
246
|
-
function
|
|
247
|
-
return Array.isArray(e) ? e.map(
|
|
248
|
+
function j(e) {
|
|
249
|
+
return Array.isArray(e) ? e.map(j) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [y(t), j(n)]));
|
|
248
250
|
}
|
|
249
|
-
function
|
|
251
|
+
function H(e, t = {}) {
|
|
250
252
|
const { entrySeparator: n = "", keyValueSeparator: r = "", wrapValue: o, resolve: s } = t;
|
|
251
253
|
return Object.entries(e).map(([i, c]) => {
|
|
252
254
|
if (s) {
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
return
|
|
255
|
+
const u = s({ key: i, value: c });
|
|
256
|
+
if (u !== void 0)
|
|
257
|
+
return u;
|
|
256
258
|
}
|
|
257
|
-
const
|
|
258
|
-
return `${i}${r}${
|
|
259
|
+
const l = typeof c == "object" ? H(c, t) : typeof c == "number" ? c.toString() : typeof c == "string" && o ? `${o}${c.replace(new RegExp(o, "g"), `\\${o}`)}${o}` : c;
|
|
260
|
+
return `${i}${r}${l}`;
|
|
259
261
|
}).join(n);
|
|
260
262
|
}
|
|
261
|
-
function
|
|
262
|
-
const n = D(t), r =
|
|
263
|
-
if (!
|
|
263
|
+
function V(e, t) {
|
|
264
|
+
const n = D(t), r = y(e), o = k(r);
|
|
265
|
+
if (!E.has(r))
|
|
264
266
|
return [{ [o]: r, ...n }];
|
|
265
267
|
const s = Object.fromEntries(
|
|
266
268
|
Object.entries(n).map(([i, c]) => [`${e}${i === "url" ? "" : `${i[0].toUpperCase()}${i.slice(1)}`}`, c])
|
|
267
269
|
);
|
|
268
|
-
return
|
|
269
|
-
var
|
|
270
|
-
return (((
|
|
270
|
+
return A(s || {}).sort((i, c) => {
|
|
271
|
+
var l, u;
|
|
272
|
+
return (((l = i[o]) == null ? void 0 : l.length) || 0) - (((u = c[o]) == null ? void 0 : u.length) || 0);
|
|
271
273
|
});
|
|
272
274
|
}
|
|
273
|
-
function
|
|
275
|
+
function k(e) {
|
|
274
276
|
var r;
|
|
275
|
-
if (((r =
|
|
277
|
+
if (((r = L[e]) == null ? void 0 : r.metaKey) === "http-equiv" || S.HTTP_EQUIV.has(e))
|
|
276
278
|
return "http-equiv";
|
|
277
|
-
const t =
|
|
278
|
-
return n === -1 ? "name" :
|
|
279
|
+
const t = y(e), n = t.indexOf(":");
|
|
280
|
+
return n === -1 ? "name" : S.OG.has(t.slice(0, n)) ? "property" : "name";
|
|
279
281
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
282
|
+
function se(e) {
|
|
283
|
+
return oe[e] || y(e);
|
|
282
284
|
}
|
|
283
|
-
function
|
|
285
|
+
function ie(e, t) {
|
|
284
286
|
var n;
|
|
285
|
-
return t === "refresh" ? `${e.seconds};url=${e.url}` :
|
|
287
|
+
return t === "refresh" ? `${e.seconds};url=${e.url}` : H(j(e), {
|
|
286
288
|
keyValueSeparator: "=",
|
|
287
289
|
entrySeparator: ", ",
|
|
288
290
|
resolve: ({ value: r, key: o }) => r === null ? "" : typeof r == "boolean" ? o : void 0,
|
|
289
291
|
// @ts-expect-error untyped
|
|
290
|
-
...(n =
|
|
292
|
+
...(n = L[t]) == null ? void 0 : n.unpack
|
|
291
293
|
});
|
|
292
294
|
}
|
|
293
|
-
function
|
|
295
|
+
function A(e) {
|
|
294
296
|
const t = [], n = {};
|
|
295
297
|
for (const [o, s] of Object.entries(e)) {
|
|
296
298
|
if (Array.isArray(s)) {
|
|
@@ -302,120 +304,120 @@ function S(e) {
|
|
|
302
304
|
}
|
|
303
305
|
for (const i of s)
|
|
304
306
|
if (typeof i == "object" && i !== null) {
|
|
305
|
-
const c = [],
|
|
306
|
-
for (const [
|
|
307
|
-
const
|
|
308
|
-
(
|
|
307
|
+
const c = [], l = [];
|
|
308
|
+
for (const [u, b] of Object.entries(i)) {
|
|
309
|
+
const p = `${o}${u === "url" ? "" : `:${u}`}`, a = A({ [p]: b });
|
|
310
|
+
(u === "url" ? c : l).push(...a);
|
|
309
311
|
}
|
|
310
|
-
t.push(...c, ...
|
|
312
|
+
t.push(...c, ...l);
|
|
311
313
|
} else
|
|
312
|
-
t.push(...typeof i == "string" ?
|
|
314
|
+
t.push(...typeof i == "string" ? A({ [o]: i }) : V(o, i));
|
|
313
315
|
continue;
|
|
314
316
|
}
|
|
315
317
|
if (typeof s == "object" && s)
|
|
316
|
-
if (
|
|
317
|
-
const i = o.startsWith("twitter") ? "twitter" : "og", c = o.replace(/^(og|twitter)/, "").toLowerCase(),
|
|
318
|
+
if (S.MEDIA.has(o)) {
|
|
319
|
+
const i = o.startsWith("twitter") ? "twitter" : "og", c = o.replace(/^(og|twitter)/, "").toLowerCase(), l = i === "twitter" ? "name" : "property";
|
|
318
320
|
s.url && t.push({
|
|
319
|
-
[
|
|
321
|
+
[l]: `${i}:${c}`,
|
|
320
322
|
content: s.url
|
|
321
323
|
}), s.secureUrl && t.push({
|
|
322
|
-
[
|
|
324
|
+
[l]: `${i}:${c}:secure_url`,
|
|
323
325
|
content: s.secureUrl
|
|
324
326
|
});
|
|
325
|
-
for (const [
|
|
326
|
-
|
|
327
|
-
[
|
|
327
|
+
for (const [u, b] of Object.entries(s))
|
|
328
|
+
u !== "url" && u !== "secureUrl" && t.push({
|
|
329
|
+
[l]: `${i}:${c}:${u}`,
|
|
328
330
|
// @ts-expect-error untyped
|
|
329
|
-
content:
|
|
331
|
+
content: b
|
|
330
332
|
});
|
|
331
|
-
} else
|
|
333
|
+
} else E.has(y(o)) ? t.push(...V(o, s)) : n[o] = D(s);
|
|
332
334
|
else
|
|
333
335
|
n[o] = s;
|
|
334
336
|
}
|
|
335
337
|
const r = Object.entries(n).map(([o, s]) => {
|
|
336
338
|
if (o === "charset")
|
|
337
339
|
return { charset: s === null ? "_null" : s };
|
|
338
|
-
const i =
|
|
339
|
-
return i === "http-equiv" ? { "http-equiv": c, content:
|
|
340
|
+
const i = k(o), c = se(o), l = s === null ? "_null" : typeof s == "object" ? ie(s, o) : typeof s == "number" ? s.toString() : s;
|
|
341
|
+
return i === "http-equiv" ? { "http-equiv": c, content: l } : { [i]: c, content: l };
|
|
340
342
|
});
|
|
341
343
|
return [...t, ...r].map(
|
|
342
344
|
(o) => "content" in o && o.content === "_null" ? { ...o, content: null } : o
|
|
343
345
|
);
|
|
344
346
|
}
|
|
345
|
-
const
|
|
347
|
+
const ce = {
|
|
346
348
|
key: "flatMeta",
|
|
347
349
|
hooks: {
|
|
348
350
|
"entries:normalize": (e) => {
|
|
349
351
|
const t = [];
|
|
350
|
-
e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(
|
|
352
|
+
e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(A(n.props).map((r) => ({
|
|
351
353
|
...n,
|
|
352
354
|
tag: "meta",
|
|
353
355
|
props: r
|
|
354
356
|
}))), !1)).filter(Boolean).concat(...t);
|
|
355
357
|
}
|
|
356
358
|
}
|
|
357
|
-
},
|
|
359
|
+
}, ae = ["name", "property", "http-equiv"], le = /* @__PURE__ */ new Set([
|
|
358
360
|
"viewport",
|
|
359
361
|
"description",
|
|
360
362
|
"keywords",
|
|
361
363
|
"robots"
|
|
362
364
|
]);
|
|
363
|
-
function
|
|
365
|
+
function Me(e) {
|
|
364
366
|
const t = e.split(":");
|
|
365
|
-
return t.length ?
|
|
367
|
+
return t.length ? E.has(t[1]) : !1;
|
|
366
368
|
}
|
|
367
|
-
function
|
|
369
|
+
function Ie(e) {
|
|
368
370
|
const { props: t, tag: n } = e;
|
|
369
|
-
if (
|
|
371
|
+
if (ne.has(n))
|
|
370
372
|
return n;
|
|
371
373
|
if (n === "link" && t.rel === "canonical")
|
|
372
374
|
return "canonical";
|
|
373
375
|
if (t.charset)
|
|
374
376
|
return "charset";
|
|
375
377
|
if (e.tag === "meta") {
|
|
376
|
-
for (const r of
|
|
378
|
+
for (const r of ae)
|
|
377
379
|
if (t[r] !== void 0) {
|
|
378
|
-
const o = t[r], s = o.includes(":"), i =
|
|
379
|
-
return `${n}:${o}${
|
|
380
|
+
const o = t[r], s = o.includes(":"), i = le.has(o), l = !(s || i) && e.key ? `:key:${e.key}` : "";
|
|
381
|
+
return `${n}:${o}${l}`;
|
|
380
382
|
}
|
|
381
383
|
}
|
|
382
384
|
if (e.key)
|
|
383
385
|
return `${n}:key:${e.key}`;
|
|
384
386
|
if (t.id)
|
|
385
387
|
return `${n}:id:${t.id}`;
|
|
386
|
-
if (
|
|
388
|
+
if (te.has(n)) {
|
|
387
389
|
const r = e.textContent || e.innerHTML;
|
|
388
390
|
if (r)
|
|
389
391
|
return `${n}:content:${r}`;
|
|
390
392
|
}
|
|
391
393
|
}
|
|
392
|
-
function
|
|
394
|
+
function Ee(e) {
|
|
393
395
|
const t = e._h || e._d;
|
|
394
396
|
if (t)
|
|
395
397
|
return t;
|
|
396
398
|
const n = e.textContent || e.innerHTML;
|
|
397
399
|
return n || `${e.tag}:${Object.entries(e.props).map(([r, o]) => `${r}:${String(o)}`).join(",")}`;
|
|
398
400
|
}
|
|
399
|
-
function
|
|
401
|
+
function $(e, t, n) {
|
|
400
402
|
typeof e === "function" && (!n || n !== "titleTemplate" && !(n[0] === "o" && n[1] === "n")) && (e = e());
|
|
401
403
|
let o;
|
|
402
404
|
if (t && (o = t(n, e)), Array.isArray(o))
|
|
403
|
-
return o.map((s) =>
|
|
405
|
+
return o.map((s) => $(s, t));
|
|
404
406
|
if ((o == null ? void 0 : o.constructor) === Object) {
|
|
405
407
|
const s = {};
|
|
406
408
|
for (const i of Object.keys(o))
|
|
407
|
-
s[i] =
|
|
409
|
+
s[i] = $(o[i], t, i);
|
|
408
410
|
return s;
|
|
409
411
|
}
|
|
410
412
|
return o;
|
|
411
413
|
}
|
|
412
|
-
function
|
|
414
|
+
function ue(e, t) {
|
|
413
415
|
const n = e === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
|
|
414
416
|
function r(o) {
|
|
415
417
|
const s = o.trim();
|
|
416
418
|
if (s)
|
|
417
419
|
if (e === "style") {
|
|
418
|
-
const [i, ...c] = s.split(":").map((
|
|
420
|
+
const [i, ...c] = s.split(":").map((l) => l.trim());
|
|
419
421
|
i && c.length && n.set(i, c.join(":"));
|
|
420
422
|
} else
|
|
421
423
|
s.split(" ").filter(Boolean).forEach((i) => n.add(i));
|
|
@@ -424,17 +426,17 @@ function ae(e, t) {
|
|
|
424
426
|
s && s !== "false" && (e === "style" ? n.set(o.trim(), s) : r(o));
|
|
425
427
|
}), n;
|
|
426
428
|
}
|
|
427
|
-
function
|
|
429
|
+
function pe(e, t) {
|
|
428
430
|
return e.props = e.props || {}, t ? e.tag === "templateParams" ? (e.props = t, e) : (Object.entries(t).forEach(([n, r]) => {
|
|
429
431
|
if (r === null) {
|
|
430
432
|
e.props[n] = null;
|
|
431
433
|
return;
|
|
432
434
|
}
|
|
433
435
|
if (n === "class" || n === "style") {
|
|
434
|
-
e.props[n] =
|
|
436
|
+
e.props[n] = ue(n, r);
|
|
435
437
|
return;
|
|
436
438
|
}
|
|
437
|
-
if (
|
|
439
|
+
if (re.has(n)) {
|
|
438
440
|
if (["textContent", "innerHTML"].includes(n) && typeof r == "object") {
|
|
439
441
|
let i = t.type;
|
|
440
442
|
if (t.type || (i = "application/json"), !(i != null && i.endsWith("json")) && i !== "speculationrules")
|
|
@@ -448,11 +450,11 @@ function le(e, t) {
|
|
|
448
450
|
o === "true" || o === "" ? e.props[n] = s ? o : !0 : !r && s && o === "false" ? e.props[n] = "false" : r !== void 0 && (e.props[n] = r);
|
|
449
451
|
}), e) : e;
|
|
450
452
|
}
|
|
451
|
-
function
|
|
452
|
-
const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r =
|
|
453
|
-
return r.key &&
|
|
453
|
+
function fe(e, t) {
|
|
454
|
+
const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r = pe({ tag: e, props: {} }, n);
|
|
455
|
+
return r.key && ee.has(r.tag) && (r.props["data-hid"] = r._h = r.key), r.tag === "script" && typeof r.innerHTML == "object" && (r.innerHTML = JSON.stringify(r.innerHTML), r.props.type = r.props.type || "application/json"), Array.isArray(r.props.content) ? r.props.content.map((o) => ({ ...r, props: { ...r.props, content: o } })) : r;
|
|
454
456
|
}
|
|
455
|
-
function
|
|
457
|
+
function Oe(e, t) {
|
|
456
458
|
if (!e)
|
|
457
459
|
return [];
|
|
458
460
|
typeof e == "function" && (e = e());
|
|
@@ -463,53 +465,53 @@ function Ee(e, t) {
|
|
|
463
465
|
};
|
|
464
466
|
e = n(void 0, e);
|
|
465
467
|
const r = [];
|
|
466
|
-
return e =
|
|
468
|
+
return e = $(e, n), Object.entries(e || {}).forEach(([o, s]) => {
|
|
467
469
|
if (s !== void 0)
|
|
468
470
|
for (const i of Array.isArray(s) ? s : [s])
|
|
469
|
-
r.push(
|
|
471
|
+
r.push(fe(o, i));
|
|
470
472
|
}), r.flat();
|
|
471
473
|
}
|
|
472
|
-
const
|
|
474
|
+
const me = (e, t) => W(t) ? G(t) : t, q = "usehead";
|
|
473
475
|
// @__NO_SIDE_EFFECTS__
|
|
474
|
-
function
|
|
476
|
+
function Ce(e) {
|
|
475
477
|
return {
|
|
476
478
|
install(n) {
|
|
477
|
-
n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(
|
|
479
|
+
n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(q, e);
|
|
478
480
|
}
|
|
479
481
|
}.install;
|
|
480
482
|
}
|
|
481
483
|
// @__NO_SIDE_EFFECTS__
|
|
482
|
-
function
|
|
483
|
-
if (
|
|
484
|
-
const e =
|
|
484
|
+
function z() {
|
|
485
|
+
if (B()) {
|
|
486
|
+
const e = F(q);
|
|
485
487
|
if (!e)
|
|
486
488
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
487
489
|
return e;
|
|
488
490
|
}
|
|
489
491
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
490
492
|
}
|
|
491
|
-
function
|
|
492
|
-
const n = t.head || /* @__PURE__ */
|
|
493
|
-
return n.ssr ? n.push(e || {}, t) :
|
|
493
|
+
function O(e, t = {}) {
|
|
494
|
+
const n = t.head || /* @__PURE__ */ z();
|
|
495
|
+
return n.ssr ? n.push(e || {}, t) : he(n, e, t);
|
|
494
496
|
}
|
|
495
|
-
function
|
|
496
|
-
const r =
|
|
497
|
+
function he(e, t, n = {}) {
|
|
498
|
+
const r = I(!1);
|
|
497
499
|
let o;
|
|
498
|
-
return
|
|
499
|
-
const i = r.value ? {} :
|
|
500
|
+
return J(() => {
|
|
501
|
+
const i = r.value ? {} : $(t, me);
|
|
500
502
|
o ? o.patch(i) : o = e.push(i, n);
|
|
501
|
-
}),
|
|
503
|
+
}), Q() && (Z(() => {
|
|
502
504
|
o.dispose();
|
|
503
|
-
}),
|
|
505
|
+
}), X(() => {
|
|
504
506
|
r.value = !0;
|
|
505
|
-
}),
|
|
507
|
+
}), Y(() => {
|
|
506
508
|
r.value = !1;
|
|
507
509
|
})), o;
|
|
508
510
|
}
|
|
509
|
-
function
|
|
510
|
-
(t.head || /* @__PURE__ */
|
|
511
|
+
function M(e = {}, t = {}) {
|
|
512
|
+
(t.head || /* @__PURE__ */ z()).use(ce);
|
|
511
513
|
const { title: r, titleTemplate: o, ...s } = e;
|
|
512
|
-
return
|
|
514
|
+
return O({
|
|
513
515
|
title: r,
|
|
514
516
|
titleTemplate: o,
|
|
515
517
|
_flatMeta: s
|
|
@@ -517,7 +519,7 @@ function P(e = {}, t = {}) {
|
|
|
517
519
|
}
|
|
518
520
|
function Ve() {
|
|
519
521
|
function e(n) {
|
|
520
|
-
|
|
522
|
+
M({
|
|
521
523
|
ogSiteName: n.siteName,
|
|
522
524
|
ogLocale: n.locale
|
|
523
525
|
});
|
|
@@ -529,26 +531,26 @@ function Ve() {
|
|
|
529
531
|
keywords: s,
|
|
530
532
|
image: i,
|
|
531
533
|
url: c,
|
|
532
|
-
type:
|
|
533
|
-
} = n,
|
|
534
|
-
|
|
534
|
+
type: l = "website"
|
|
535
|
+
} = n, u = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
|
|
536
|
+
O({
|
|
535
537
|
title: r,
|
|
536
538
|
link: c ? [{
|
|
537
539
|
rel: "canonical",
|
|
538
540
|
href: c
|
|
539
541
|
}] : []
|
|
540
|
-
}),
|
|
541
|
-
description:
|
|
542
|
+
}), M({
|
|
543
|
+
description: u || o,
|
|
542
544
|
keywords: s,
|
|
543
545
|
ogTitle: r,
|
|
544
|
-
ogDescription:
|
|
545
|
-
ogType:
|
|
546
|
+
ogDescription: u || o,
|
|
547
|
+
ogType: l === "product" ? void 0 : l,
|
|
546
548
|
// product 类型不被支持,跳过
|
|
547
549
|
ogUrl: c,
|
|
548
550
|
ogImage: i,
|
|
549
551
|
twitterCard: "summary_large_image",
|
|
550
552
|
twitterTitle: r,
|
|
551
|
-
twitterDescription:
|
|
553
|
+
twitterDescription: u || o,
|
|
552
554
|
twitterImage: i
|
|
553
555
|
});
|
|
554
556
|
}
|
|
@@ -557,61 +559,61 @@ function Ve() {
|
|
|
557
559
|
setPageSEO: t
|
|
558
560
|
};
|
|
559
561
|
}
|
|
560
|
-
function
|
|
562
|
+
function _e() {
|
|
561
563
|
const e = x(), t = () => e.meta;
|
|
562
|
-
|
|
563
|
-
title:
|
|
564
|
-
link:
|
|
564
|
+
O({
|
|
565
|
+
title: d(() => t().title || ""),
|
|
566
|
+
link: d(() => {
|
|
565
567
|
const n = t();
|
|
566
568
|
return n.url ? [{
|
|
567
569
|
rel: "canonical",
|
|
568
570
|
href: n.url
|
|
569
571
|
}] : [];
|
|
570
572
|
})
|
|
571
|
-
}),
|
|
572
|
-
description:
|
|
573
|
+
}), M({
|
|
574
|
+
description: d(() => {
|
|
573
575
|
const r = t().description;
|
|
574
576
|
if (r)
|
|
575
577
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
576
578
|
}),
|
|
577
|
-
keywords:
|
|
578
|
-
ogTitle:
|
|
579
|
-
ogDescription:
|
|
579
|
+
keywords: d(() => t().keywords),
|
|
580
|
+
ogTitle: d(() => t().title),
|
|
581
|
+
ogDescription: d(() => {
|
|
580
582
|
const r = t().description;
|
|
581
583
|
if (r)
|
|
582
584
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
583
585
|
}),
|
|
584
|
-
ogType:
|
|
586
|
+
ogType: d(() => {
|
|
585
587
|
const r = t().type || "website";
|
|
586
588
|
return r === "product" ? void 0 : r;
|
|
587
589
|
}),
|
|
588
|
-
ogUrl:
|
|
589
|
-
ogImage:
|
|
590
|
+
ogUrl: d(() => t().url),
|
|
591
|
+
ogImage: d(() => t().image),
|
|
590
592
|
twitterCard: "summary_large_image",
|
|
591
|
-
twitterTitle:
|
|
592
|
-
twitterDescription:
|
|
593
|
+
twitterTitle: d(() => t().title),
|
|
594
|
+
twitterDescription: d(() => {
|
|
593
595
|
const r = t().description;
|
|
594
596
|
if (r)
|
|
595
597
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
596
598
|
}),
|
|
597
|
-
twitterImage:
|
|
599
|
+
twitterImage: d(() => t().image)
|
|
598
600
|
});
|
|
599
601
|
}
|
|
600
602
|
export {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
603
|
+
Pe as H,
|
|
604
|
+
je as U,
|
|
605
|
+
ve as V,
|
|
606
|
+
$e as a,
|
|
607
|
+
Te as b,
|
|
606
608
|
Ve as c,
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
609
|
+
_e as d,
|
|
610
|
+
Ie as e,
|
|
611
|
+
Ae as f,
|
|
612
|
+
pe as g,
|
|
613
|
+
Ee as h,
|
|
614
|
+
Me as i,
|
|
615
|
+
Oe as n,
|
|
616
|
+
we as u,
|
|
617
|
+
Ce as v,
|
|
618
|
+
Se as w
|
|
617
619
|
};
|