usage-board 3.1.0 → 3.1.1
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/index.mjs +1 -1
- package/dist/public/_nuxt/{BuL2_OVR.js → B6C9KBQ4.js} +1 -1
- package/dist/public/_nuxt/{CbwePq4F.js → Bv6agYS5.js} +1 -1
- package/dist/public/_nuxt/{LYzk-FvL.js → BvRyOET7.js} +1 -1
- package/dist/public/_nuxt/{CF27djws.js → CMWftE4h.js} +1 -1
- package/dist/public/_nuxt/{CoVMsEv_.js → COIbUy5w.js} +1 -1
- package/dist/public/_nuxt/{DS17D0R7.js → CXLmM1yO.js} +1 -1
- package/dist/public/_nuxt/{Bz0aA7IQ.js → DFqWEFN4.js} +1 -1
- package/dist/public/_nuxt/{WjVGlVHF.js → DUoLvn3A.js} +1 -1
- package/dist/public/_nuxt/{Dzuxw4nD.js → D_W11Quh.js} +1 -1
- package/dist/public/_nuxt/{D7Qebc1i.js → DgKrPjze.js} +2 -2
- package/dist/public/_nuxt/{CEZpUSPI.js → DkxY2YMp.js} +1 -1
- package/dist/public/_nuxt/{Dr4nyTE3.js → DtbPvE6R.js} +1 -1
- package/dist/public/_nuxt/{BJUAqwzD.js → HiqUua3-.js} +1 -1
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/6f98f1cb-266c-475e-a249-dad346a55f24.json +1 -0
- package/dist/public/_nuxt/error-404.CFBEg71j.css +1 -0
- package/dist/public/_nuxt/error-500.BqCnH31G.css +1 -0
- package/dist/public/_nuxt/{Cd5S9Sm2.js → uHQwCIHg.js} +1 -1
- package/dist/server/chunks/_/error-500.mjs +2 -20
- package/dist/server/chunks/build/client.precomputed.mjs +1 -1
- package/dist/server/chunks/nitro/nitro.mjs +1885 -3648
- package/dist/server/chunks/routes/api/analysis/agent/session.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/agent/token.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/cache.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/hot-project.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/model.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/overview-cards.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/session.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/token/daily.json.mjs +8 -9
- package/dist/server/chunks/routes/api/analysis/token.json.mjs +8 -9
- package/dist/server/chunks/routes/api/payload.json.mjs +8 -9
- package/dist/server/chunks/routes/api/projects/_project/modules.get.mjs +8 -9
- package/dist/server/chunks/routes/api/projects/catalog.get.mjs +8 -9
- package/dist/server/chunks/routes/renderer.mjs +17 -39183
- package/dist/server/chunks/routes/ws.mjs +8 -9
- package/dist/server/index.mjs +9 -10
- package/dist/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/dist/server/node_modules/@babel/parser/package.json +50 -0
- package/dist/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/dist/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/dist/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/dist/server/node_modules/@iconify/utils/package.json +118 -0
- package/dist/server/node_modules/@lonewolfyx/utils/dist/index.mjs +63 -0
- package/dist/server/node_modules/@lonewolfyx/utils/package.json +64 -0
- package/dist/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/dist/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/dist/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/dist/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/dist/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/dist/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/dist/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1877 -0
- package/dist/server/node_modules/@vue/reactivity/package.json +55 -0
- package/dist/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6856 -0
- package/dist/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/dist/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1796 -0
- package/dist/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/dist/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/dist/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/dist/server/{chunks/_/shared.cjs.prod.mjs → node_modules/@vue/shared/dist/shared.cjs.prod.js} +76 -81
- package/dist/server/node_modules/@vue/shared/package.json +47 -0
- package/dist/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/dist/server/node_modules/better-sqlite3/lib/database.js +90 -0
- package/dist/server/node_modules/better-sqlite3/lib/index.js +3 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/dist/server/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/dist/server/node_modules/better-sqlite3/lib/util.js +12 -0
- package/dist/server/node_modules/better-sqlite3/package.json +59 -0
- package/dist/server/node_modules/bindings/bindings.js +221 -0
- package/dist/server/node_modules/bindings/package.json +28 -0
- package/dist/server/node_modules/chokidar/handler.js +632 -0
- package/dist/server/node_modules/chokidar/index.js +822 -0
- package/dist/server/node_modules/chokidar/package.json +63 -0
- package/dist/server/{chunks/_ → node_modules/consola/dist/chunks}/prompt.mjs +2 -1
- package/dist/server/node_modules/consola/dist/core.mjs +512 -0
- package/dist/server/node_modules/consola/dist/index.mjs +651 -0
- package/dist/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/dist/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/dist/server/node_modules/consola/package.json +136 -0
- package/dist/server/node_modules/devalue/index.js +4 -0
- package/dist/server/node_modules/devalue/package.json +40 -0
- package/dist/server/node_modules/devalue/src/base64.js +60 -0
- package/dist/server/node_modules/devalue/src/constants.js +7 -0
- package/dist/server/node_modules/devalue/src/parse.js +268 -0
- package/dist/server/node_modules/devalue/src/stringify.js +335 -0
- package/dist/server/node_modules/devalue/src/uneval.js +552 -0
- package/dist/server/node_modules/devalue/src/utils.js +144 -0
- package/dist/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/dist/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/dist/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/dist/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/dist/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/dist/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/dist/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/dist/server/node_modules/entities/package.json +120 -0
- package/dist/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/dist/server/node_modules/estree-walker/package.json +37 -0
- package/dist/server/node_modules/file-uri-to-path/index.js +66 -0
- package/dist/server/node_modules/file-uri-to-path/package.json +32 -0
- package/dist/server/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/server/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/server/node_modules/glob/package.json +98 -0
- package/dist/server/node_modules/hookable/dist/index.mjs +257 -0
- package/dist/server/node_modules/hookable/package.json +53 -0
- package/dist/server/node_modules/md5-typescript/dist/bundles/bundle.umd.js +208 -0
- package/dist/server/node_modules/md5-typescript/package.json +31 -0
- package/dist/server/node_modules/path-type/index.js +42 -0
- package/dist/server/node_modules/path-type/package.json +51 -0
- package/dist/server/node_modules/readdirp/index.js +272 -0
- package/dist/server/node_modules/readdirp/package.json +66 -0
- package/dist/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/dist/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/dist/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/dist/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/dist/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/dist/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/dist/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/dist/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/dist/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/dist/server/node_modules/source-map-js/lib/util.js +594 -0
- package/dist/server/node_modules/source-map-js/package.json +71 -0
- package/dist/server/node_modules/source-map-js/source-map.js +8 -0
- package/dist/server/node_modules/ufo/dist/index.mjs +645 -0
- package/dist/server/node_modules/ufo/package.json +48 -0
- package/dist/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/dist/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/dist/server/node_modules/unhead/dist/server.mjs +180 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.B5FWS6X0.mjs +207 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.Ct24BOby.mjs +182 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.TxTMM7cM.mjs +166 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/dist/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/dist/server/node_modules/unhead/package.json +105 -0
- package/dist/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/dist/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/dist/server/node_modules/vue/index.js +7 -0
- package/dist/server/node_modules/vue/index.mjs +1 -0
- package/dist/server/node_modules/vue/package.json +112 -0
- package/dist/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/dist/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/dist/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/dist/server/package.json +37 -0
- package/package.json +3 -1
- package/dist/public/_nuxt/builds/meta/5b933d30-47b4-45ca-8d5a-cba3255174fa.json +0 -1
- package/dist/public/_nuxt/error-404.B0EXnOcv.css +0 -1
- package/dist/public/_nuxt/error-500.CnSNZoEG.css +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { u as unpackMeta } from './unhead.DQc16pHI.mjs';
|
|
2
|
+
|
|
3
|
+
function defineHeadPlugin(plugin) {
|
|
4
|
+
return plugin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const FlatMetaPlugin = /* @__PURE__ */ defineHeadPlugin({
|
|
8
|
+
key: "flatMeta",
|
|
9
|
+
hooks: {
|
|
10
|
+
"entries:normalize": (ctx) => {
|
|
11
|
+
const tagsToAdd = [];
|
|
12
|
+
ctx.tags = ctx.tags.map((t) => {
|
|
13
|
+
if (t.tag !== "_flatMeta") {
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
tagsToAdd.push(unpackMeta(t.props).map((p) => ({
|
|
17
|
+
...t,
|
|
18
|
+
tag: "meta",
|
|
19
|
+
props: p
|
|
20
|
+
})));
|
|
21
|
+
return false;
|
|
22
|
+
}).filter(Boolean).concat(...tagsToAdd);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const WhitelistAttributes = {
|
|
28
|
+
htmlAttrs: /* @__PURE__ */ new Set(["class", "style", "lang", "dir"]),
|
|
29
|
+
bodyAttrs: /* @__PURE__ */ new Set(["class", "style"]),
|
|
30
|
+
meta: /* @__PURE__ */ new Set(["name", "property", "charset", "content", "media"]),
|
|
31
|
+
noscript: /* @__PURE__ */ new Set([]),
|
|
32
|
+
style: /* @__PURE__ */ new Set(["media", "nonce", "title", "blocking"]),
|
|
33
|
+
script: /* @__PURE__ */ new Set(["type", "textContent", "nonce", "blocking"]),
|
|
34
|
+
link: /* @__PURE__ */ new Set(["color", "crossorigin", "fetchpriority", "href", "hreflang", "imagesrcset", "imagesizes", "integrity", "media", "referrerpolicy", "rel", "sizes", "type"])
|
|
35
|
+
};
|
|
36
|
+
const BlockedLinkRels = /* @__PURE__ */ new Set(["canonical", "modulepreload", "prerender", "preload", "prefetch", "dns-prefetch", "preconnect", "manifest", "pingback"]);
|
|
37
|
+
const SafeAttrName = /^[a-z][a-z0-9\-]*[a-z0-9]$/i;
|
|
38
|
+
const HtmlEntityHex = /&#x([0-9a-f]+);?/gi;
|
|
39
|
+
const HtmlEntityDec = /&#(\d+);?/g;
|
|
40
|
+
const HtmlEntityNamed = /&(tab|newline|colon|semi|lpar|rpar|sol|bsol|comma|period|excl|num|dollar|percnt|amp|apos|ast|plus|lt|gt|equals|quest|at|lsqb|rsqb|lcub|rcub|vert|hat|grave|tilde|nbsp);?/gi;
|
|
41
|
+
const ControlChars = /[\x00-\x20]+/g;
|
|
42
|
+
const NamedEntityMap = {
|
|
43
|
+
tab: " ",
|
|
44
|
+
newline: "\n",
|
|
45
|
+
colon: ":",
|
|
46
|
+
semi: ";",
|
|
47
|
+
lpar: "(",
|
|
48
|
+
rpar: ")",
|
|
49
|
+
sol: "/",
|
|
50
|
+
bsol: "\\",
|
|
51
|
+
comma: ",",
|
|
52
|
+
period: ".",
|
|
53
|
+
excl: "!",
|
|
54
|
+
num: "#",
|
|
55
|
+
dollar: "$",
|
|
56
|
+
percnt: "%",
|
|
57
|
+
amp: "&",
|
|
58
|
+
apos: "'",
|
|
59
|
+
ast: "*",
|
|
60
|
+
plus: "+",
|
|
61
|
+
lt: "<",
|
|
62
|
+
gt: ">",
|
|
63
|
+
equals: "=",
|
|
64
|
+
quest: "?",
|
|
65
|
+
at: "@",
|
|
66
|
+
lsqb: "[",
|
|
67
|
+
rsqb: "]",
|
|
68
|
+
lcub: "{",
|
|
69
|
+
rcub: "}",
|
|
70
|
+
vert: "|",
|
|
71
|
+
hat: "^",
|
|
72
|
+
grave: "`",
|
|
73
|
+
tilde: "~",
|
|
74
|
+
nbsp: "\xA0"
|
|
75
|
+
};
|
|
76
|
+
function safeFromCodePoint(codePoint) {
|
|
77
|
+
if (codePoint > 1114111 || codePoint < 0 || Number.isNaN(codePoint))
|
|
78
|
+
return "";
|
|
79
|
+
return String.fromCodePoint(codePoint);
|
|
80
|
+
}
|
|
81
|
+
function decodeHtmlEntities(str) {
|
|
82
|
+
return str.replace(HtmlEntityHex, (_, hex) => safeFromCodePoint(Number.parseInt(hex, 16))).replace(HtmlEntityDec, (_, dec) => safeFromCodePoint(Number(dec))).replace(HtmlEntityNamed, (_, name) => NamedEntityMap[name.toLowerCase()] || "");
|
|
83
|
+
}
|
|
84
|
+
function hasDangerousProtocol(url) {
|
|
85
|
+
const entityDecoded = decodeHtmlEntities(url);
|
|
86
|
+
const cleaned = entityDecoded.replace(ControlChars, "");
|
|
87
|
+
let decoded;
|
|
88
|
+
try {
|
|
89
|
+
decoded = decodeURIComponent(cleaned);
|
|
90
|
+
} catch {
|
|
91
|
+
decoded = cleaned;
|
|
92
|
+
}
|
|
93
|
+
const sanitized = decoded.replace(ControlChars, "");
|
|
94
|
+
const lower = sanitized.toLowerCase();
|
|
95
|
+
return lower.startsWith("javascript:") || lower.startsWith("data:") || lower.startsWith("vbscript:");
|
|
96
|
+
}
|
|
97
|
+
function stripProtoKeys(obj) {
|
|
98
|
+
if (Array.isArray(obj))
|
|
99
|
+
return obj.map(stripProtoKeys);
|
|
100
|
+
if (obj && typeof obj === "object") {
|
|
101
|
+
const clean = {};
|
|
102
|
+
for (const key of Object.keys(obj)) {
|
|
103
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
|
104
|
+
continue;
|
|
105
|
+
clean[key] = stripProtoKeys(obj[key]);
|
|
106
|
+
}
|
|
107
|
+
return clean;
|
|
108
|
+
}
|
|
109
|
+
return obj;
|
|
110
|
+
}
|
|
111
|
+
function acceptDataAttrs(value, allowId = true) {
|
|
112
|
+
return Object.fromEntries(
|
|
113
|
+
Object.entries(value || {}).filter(([key]) => (allowId && key === "id" || key.startsWith("data-")) && SafeAttrName.test(key))
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function makeTagSafe(tag) {
|
|
117
|
+
let next = {};
|
|
118
|
+
const { tag: type, props: prev } = tag;
|
|
119
|
+
switch (type) {
|
|
120
|
+
// title: textContent is escaped in rendering (tagToString), no props needed
|
|
121
|
+
case "title":
|
|
122
|
+
break;
|
|
123
|
+
// virtual tags, not rendered to HTML — but sanitize to prevent injection if rendered
|
|
124
|
+
case "titleTemplate":
|
|
125
|
+
case "templateParams":
|
|
126
|
+
next = prev;
|
|
127
|
+
break;
|
|
128
|
+
case "htmlAttrs":
|
|
129
|
+
case "bodyAttrs":
|
|
130
|
+
WhitelistAttributes[type].forEach((attr) => {
|
|
131
|
+
if (prev[attr]) {
|
|
132
|
+
next[attr] = prev[attr];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
delete tag.innerHTML;
|
|
136
|
+
delete tag.textContent;
|
|
137
|
+
tag.props = { ...acceptDataAttrs(prev, false), ...next };
|
|
138
|
+
return !Object.keys(tag.props).length ? false : tag;
|
|
139
|
+
case "style":
|
|
140
|
+
next = acceptDataAttrs(prev);
|
|
141
|
+
WhitelistAttributes.style.forEach((key) => {
|
|
142
|
+
if (prev[key]) {
|
|
143
|
+
next[key] = prev[key];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
break;
|
|
147
|
+
// meta is safe, except for http-equiv
|
|
148
|
+
case "meta":
|
|
149
|
+
WhitelistAttributes.meta.forEach((key) => {
|
|
150
|
+
if (prev[key]) {
|
|
151
|
+
next[key] = prev[key];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
break;
|
|
155
|
+
// link tags we block preloading, prerendering, prefetching, dns-prefetch, preconnect, manifest, etc
|
|
156
|
+
case "link":
|
|
157
|
+
WhitelistAttributes.link.forEach((key) => {
|
|
158
|
+
const val = prev[key];
|
|
159
|
+
if (!val) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (key === "rel" && (typeof val !== "string" || BlockedLinkRels.has(val.toLowerCase()))) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (key === "href" || key === "imagesrcset") {
|
|
166
|
+
if (typeof val !== "string") {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const urls = key === "imagesrcset" ? val.split(",").map((s) => s.trim()) : [val];
|
|
170
|
+
if (urls.some((u) => hasDangerousProtocol(u))) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
next[key] = val;
|
|
174
|
+
} else if (val) {
|
|
175
|
+
next[key] = val;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
if (!next.href && !next.imagesrcset || !next.rel) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "noscript":
|
|
183
|
+
WhitelistAttributes.noscript.forEach((key) => {
|
|
184
|
+
if (prev[key]) {
|
|
185
|
+
next[key] = prev[key];
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
break;
|
|
189
|
+
// we only allow JSON in scripts
|
|
190
|
+
case "script":
|
|
191
|
+
if (!tag.textContent || typeof prev.type !== "string" || !prev.type.endsWith("json")) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const jsonVal = typeof tag.textContent === "string" ? JSON.parse(tag.textContent) : tag.textContent;
|
|
196
|
+
tag.textContent = JSON.stringify(stripProtoKeys(jsonVal), null, 0);
|
|
197
|
+
} catch {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
WhitelistAttributes.script.forEach((s) => {
|
|
201
|
+
if (s !== "textContent" && prev[s]) {
|
|
202
|
+
next[s] = prev[s];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
delete tag.innerHTML;
|
|
208
|
+
if (type !== "title" && type !== "script") {
|
|
209
|
+
delete tag.textContent;
|
|
210
|
+
}
|
|
211
|
+
tag.props = { ...acceptDataAttrs(prev), ...next };
|
|
212
|
+
if (!Object.keys(tag.props).length && !tag.tag.endsWith("Attrs") && !tag.textContent) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return tag;
|
|
216
|
+
}
|
|
217
|
+
const SafeInputPlugin = (
|
|
218
|
+
/* @PURE */
|
|
219
|
+
defineHeadPlugin({
|
|
220
|
+
key: "safe",
|
|
221
|
+
hooks: {
|
|
222
|
+
"entries:normalize": (ctx) => {
|
|
223
|
+
if (ctx.entry.options?._safe) {
|
|
224
|
+
ctx.tags = ctx.tags.reduce((acc, tag) => {
|
|
225
|
+
const safeTag = makeTagSafe(tag);
|
|
226
|
+
if (safeTag)
|
|
227
|
+
acc.push(safeTag);
|
|
228
|
+
return acc;
|
|
229
|
+
}, []);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
export { FlatMetaPlugin as F, SafeInputPlugin as S, defineHeadPlugin as d };
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { M as MetaTagsArrayable } from './unhead.yem5I2v_.mjs';
|
|
2
|
+
|
|
3
|
+
const NAMESPACES = {
|
|
4
|
+
META: /* @__PURE__ */ new Set(["twitter"]),
|
|
5
|
+
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
|
6
|
+
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
|
7
|
+
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
|
8
|
+
};
|
|
9
|
+
const META_ALIASES = {
|
|
10
|
+
articleExpirationTime: "article:expiration_time",
|
|
11
|
+
articleModifiedTime: "article:modified_time",
|
|
12
|
+
articlePublishedTime: "article:published_time",
|
|
13
|
+
bookReleaseDate: "book:release_date",
|
|
14
|
+
fbAppId: "fb:app_id",
|
|
15
|
+
ogAudioSecureUrl: "og:audio:secure_url",
|
|
16
|
+
ogAudioUrl: "og:audio",
|
|
17
|
+
ogImageSecureUrl: "og:image:secure_url",
|
|
18
|
+
ogImageUrl: "og:image",
|
|
19
|
+
ogSiteName: "og:site_name",
|
|
20
|
+
ogVideoSecureUrl: "og:video:secure_url",
|
|
21
|
+
ogVideoUrl: "og:video",
|
|
22
|
+
profileFirstName: "profile:first_name",
|
|
23
|
+
profileLastName: "profile:last_name",
|
|
24
|
+
profileUsername: "profile:username",
|
|
25
|
+
msapplicationConfig: "msapplication-Config",
|
|
26
|
+
msapplicationTileColor: "msapplication-TileColor",
|
|
27
|
+
msapplicationTileImage: "msapplication-TileImage"
|
|
28
|
+
};
|
|
29
|
+
const MetaPackingSchema = {
|
|
30
|
+
appleItunesApp: {
|
|
31
|
+
unpack: {
|
|
32
|
+
entrySeparator: ", ",
|
|
33
|
+
// @ts-expect-error untyped
|
|
34
|
+
resolve: ({ key, value }) => `${fixKeyCase(key)}=${value}`
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
refresh: {
|
|
38
|
+
metaKey: "http-equiv",
|
|
39
|
+
unpack: {
|
|
40
|
+
entrySeparator: ";",
|
|
41
|
+
// @ts-expect-error untyped
|
|
42
|
+
resolve: ({ key, value }) => key === "seconds" ? `${value}` : void 0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
robots: {
|
|
46
|
+
unpack: {
|
|
47
|
+
entrySeparator: ", ",
|
|
48
|
+
// @ts-expect-error untyped
|
|
49
|
+
resolve: ({ key, value }) => typeof value === "boolean" ? fixKeyCase(key) : `${fixKeyCase(key)}:${value}`
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
contentSecurityPolicy: {
|
|
53
|
+
metaKey: "http-equiv",
|
|
54
|
+
unpack: {
|
|
55
|
+
entrySeparator: "; ",
|
|
56
|
+
// @ts-expect-error untyped
|
|
57
|
+
resolve: ({ key, value }) => `${fixKeyCase(key)} ${value}`
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
charset: {}
|
|
61
|
+
};
|
|
62
|
+
function fixKeyCase(key) {
|
|
63
|
+
const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
64
|
+
const prefixIndex = updated.indexOf("-");
|
|
65
|
+
return prefixIndex === -1 ? updated : NAMESPACES.META.has(updated.slice(0, prefixIndex)) || NAMESPACES.OG.has(updated.slice(0, prefixIndex)) ? key.replace(/([A-Z])/g, ":$1").toLowerCase() : updated;
|
|
66
|
+
}
|
|
67
|
+
function sanitizeObject(input) {
|
|
68
|
+
return Object.fromEntries(Object.entries(input).filter(([k, v]) => String(v) !== "false" && k));
|
|
69
|
+
}
|
|
70
|
+
function transformObject(obj) {
|
|
71
|
+
return Array.isArray(obj) ? obj.map(transformObject) : !obj || typeof obj !== "object" ? obj : Object.fromEntries(Object.entries(obj).map(([k, v]) => [fixKeyCase(k), transformObject(v)]));
|
|
72
|
+
}
|
|
73
|
+
function unpackToString(value, options = {}) {
|
|
74
|
+
const { entrySeparator = "", keyValueSeparator = "", wrapValue, resolve } = options;
|
|
75
|
+
return Object.entries(value).map(([key, val]) => {
|
|
76
|
+
if (resolve) {
|
|
77
|
+
const resolved = resolve({ key, value: val });
|
|
78
|
+
if (resolved !== void 0)
|
|
79
|
+
return resolved;
|
|
80
|
+
}
|
|
81
|
+
const processedVal = typeof val === "object" ? unpackToString(val, options) : typeof val === "number" ? val.toString() : typeof val === "string" && wrapValue ? `${wrapValue}${val.replace(new RegExp(wrapValue, "g"), `\\${wrapValue}`)}${wrapValue}` : val;
|
|
82
|
+
return `${key}${keyValueSeparator}${processedVal}`;
|
|
83
|
+
}).join(entrySeparator);
|
|
84
|
+
}
|
|
85
|
+
function handleObjectEntry(key, value) {
|
|
86
|
+
const sanitizedValue = sanitizeObject(value);
|
|
87
|
+
const fixedKey = fixKeyCase(key);
|
|
88
|
+
const attr = resolveMetaKeyType(fixedKey);
|
|
89
|
+
if (!MetaTagsArrayable.has(fixedKey)) {
|
|
90
|
+
return [{ [attr]: fixedKey, ...sanitizedValue }];
|
|
91
|
+
}
|
|
92
|
+
const input = Object.fromEntries(
|
|
93
|
+
Object.entries(sanitizedValue).map(([k, v]) => [`${key}${k === "url" ? "" : `${k[0].toUpperCase()}${k.slice(1)}`}`, v])
|
|
94
|
+
);
|
|
95
|
+
return unpackMeta(input || {}).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
|
|
96
|
+
}
|
|
97
|
+
function resolveMetaKeyType(key) {
|
|
98
|
+
if (MetaPackingSchema[key]?.metaKey === "http-equiv" || NAMESPACES.HTTP_EQUIV.has(key)) {
|
|
99
|
+
return "http-equiv";
|
|
100
|
+
}
|
|
101
|
+
const fixed = fixKeyCase(key);
|
|
102
|
+
const colonIndex = fixed.indexOf(":");
|
|
103
|
+
return colonIndex === -1 ? "name" : NAMESPACES.OG.has(fixed.slice(0, colonIndex)) ? "property" : "name";
|
|
104
|
+
}
|
|
105
|
+
function resolveMetaKeyValue(key) {
|
|
106
|
+
return META_ALIASES[key] || fixKeyCase(key);
|
|
107
|
+
}
|
|
108
|
+
function resolvePackedMetaObjectValue(value, key) {
|
|
109
|
+
if (key === "refresh")
|
|
110
|
+
return `${value.seconds};url=${value.url}`;
|
|
111
|
+
return unpackToString(transformObject(value), {
|
|
112
|
+
keyValueSeparator: "=",
|
|
113
|
+
entrySeparator: ", ",
|
|
114
|
+
resolve: ({ value: value2, key: key2 }) => value2 === null ? "" : typeof value2 === "boolean" ? key2 : void 0,
|
|
115
|
+
// @ts-expect-error untyped
|
|
116
|
+
...MetaPackingSchema[key]?.unpack
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function unpackMeta(input) {
|
|
120
|
+
const extras = [];
|
|
121
|
+
const primitives = {};
|
|
122
|
+
for (const [key, value] of Object.entries(input)) {
|
|
123
|
+
if (Array.isArray(value)) {
|
|
124
|
+
if (key === "themeColor") {
|
|
125
|
+
value.forEach((v) => {
|
|
126
|
+
if (typeof v === "object" && v !== null) {
|
|
127
|
+
extras.push({ name: "theme-color", ...v });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
for (const v of value) {
|
|
133
|
+
if (typeof v === "object" && v !== null) {
|
|
134
|
+
const urlProps = [];
|
|
135
|
+
const otherProps = [];
|
|
136
|
+
for (const [propKey, propValue] of Object.entries(v)) {
|
|
137
|
+
const metaKey = `${key}${propKey === "url" ? "" : `:${propKey}`}`;
|
|
138
|
+
const meta2 = unpackMeta({ [metaKey]: propValue });
|
|
139
|
+
(propKey === "url" ? urlProps : otherProps).push(...meta2);
|
|
140
|
+
}
|
|
141
|
+
extras.push(...urlProps, ...otherProps);
|
|
142
|
+
} else {
|
|
143
|
+
extras.push(...typeof v === "string" ? unpackMeta({ [key]: v }) : handleObjectEntry(key, v));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (typeof value === "object" && value) {
|
|
149
|
+
if (NAMESPACES.MEDIA.has(key)) {
|
|
150
|
+
const prefix = key.startsWith("twitter") ? "twitter" : "og";
|
|
151
|
+
const type = key.replace(/^(og|twitter)/, "").toLowerCase();
|
|
152
|
+
const metaKey = prefix === "twitter" ? "name" : "property";
|
|
153
|
+
if (value.url) {
|
|
154
|
+
extras.push({
|
|
155
|
+
[metaKey]: `${prefix}:${type}`,
|
|
156
|
+
content: value.url
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (value.secureUrl) {
|
|
160
|
+
extras.push({
|
|
161
|
+
[metaKey]: `${prefix}:${type}:secure_url`,
|
|
162
|
+
content: value.secureUrl
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
for (const [propKey, propValue] of Object.entries(value)) {
|
|
166
|
+
if (propKey !== "url" && propKey !== "secureUrl") {
|
|
167
|
+
extras.push({
|
|
168
|
+
[metaKey]: `${prefix}:${type}:${propKey}`,
|
|
169
|
+
// @ts-expect-error untyped
|
|
170
|
+
content: propValue
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} else if (MetaTagsArrayable.has(fixKeyCase(key))) {
|
|
175
|
+
extras.push(...handleObjectEntry(key, value));
|
|
176
|
+
} else {
|
|
177
|
+
primitives[key] = sanitizeObject(value);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
primitives[key] = value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const meta = Object.entries(primitives).map(([key, value]) => {
|
|
184
|
+
if (key === "charset")
|
|
185
|
+
return { charset: value === null ? "_null" : value };
|
|
186
|
+
const metaKey = resolveMetaKeyType(key);
|
|
187
|
+
const keyValue = resolveMetaKeyValue(key);
|
|
188
|
+
const processedValue = value === null ? "_null" : typeof value === "object" ? resolvePackedMetaObjectValue(value, key) : typeof value === "number" ? value.toString() : value;
|
|
189
|
+
return metaKey === "http-equiv" ? { "http-equiv": keyValue, "content": processedValue } : { [metaKey]: keyValue, content: processedValue };
|
|
190
|
+
});
|
|
191
|
+
return [...extras, ...meta].map(
|
|
192
|
+
(m) => !("content" in m) ? m : m.content === "_null" ? { ...m, content: null } : m
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { resolveMetaKeyValue as a, resolvePackedMetaObjectValue as b, resolveMetaKeyType as r, unpackMeta as u };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { d as defineHeadPlugin } from './unhead.D4vSFytZ.mjs';
|
|
2
|
+
import { s as sortTags } from './unhead.CbpEuj3y.mjs';
|
|
3
|
+
import { p as processTemplateParams } from './unhead.BYvz9V1x.mjs';
|
|
4
|
+
|
|
5
|
+
const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
|
|
6
|
+
const AliasSortingPlugin = defineHeadPlugin({
|
|
7
|
+
key: "aliasSorting",
|
|
8
|
+
hooks: {
|
|
9
|
+
"tags:resolve": (ctx) => {
|
|
10
|
+
let m = false;
|
|
11
|
+
for (const t of ctx.tags) {
|
|
12
|
+
const p = t.tagPriority;
|
|
13
|
+
if (!p)
|
|
14
|
+
continue;
|
|
15
|
+
const s = String(p);
|
|
16
|
+
if (s.startsWith("before:")) {
|
|
17
|
+
const k = formatKey(s.slice(7));
|
|
18
|
+
const l = ctx.tagMap.get(k);
|
|
19
|
+
if (l) {
|
|
20
|
+
if (typeof l.tagPriority === "number")
|
|
21
|
+
t.tagPriority = l.tagPriority;
|
|
22
|
+
t._p = l._p - 1;
|
|
23
|
+
m = true;
|
|
24
|
+
}
|
|
25
|
+
} else if (s.startsWith("after:")) {
|
|
26
|
+
const k = formatKey(s.slice(6));
|
|
27
|
+
const l = ctx.tagMap.get(k);
|
|
28
|
+
if (l) {
|
|
29
|
+
if (typeof l.tagPriority === "number")
|
|
30
|
+
t.tagPriority = l.tagPriority;
|
|
31
|
+
t._p = l._p + 1;
|
|
32
|
+
m = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (m)
|
|
37
|
+
ctx.tags = ctx.tags.sort(sortTags);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const DeprecationsPlugin = /* @__PURE__ */ defineHeadPlugin({
|
|
43
|
+
key: "deprecations",
|
|
44
|
+
hooks: {
|
|
45
|
+
"entries:normalize": ({ tags }) => {
|
|
46
|
+
for (const tag of tags) {
|
|
47
|
+
if (tag.props.children) {
|
|
48
|
+
tag.innerHTML = tag.props.children;
|
|
49
|
+
delete tag.props.children;
|
|
50
|
+
}
|
|
51
|
+
if (tag.props.hid) {
|
|
52
|
+
tag.key = tag.props.hid;
|
|
53
|
+
delete tag.props.hid;
|
|
54
|
+
}
|
|
55
|
+
if (tag.props.vmid) {
|
|
56
|
+
tag.key = tag.props.vmid;
|
|
57
|
+
delete tag.props.vmid;
|
|
58
|
+
}
|
|
59
|
+
if (tag.props.body) {
|
|
60
|
+
tag.tagPosition = "bodyClose";
|
|
61
|
+
delete tag.props.body;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
async function walkPromises(v) {
|
|
69
|
+
const type = typeof v;
|
|
70
|
+
if (type === "function") {
|
|
71
|
+
return v;
|
|
72
|
+
}
|
|
73
|
+
if (v instanceof Promise) {
|
|
74
|
+
return await v;
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(v)) {
|
|
77
|
+
return await Promise.all(v.map((r) => walkPromises(r)));
|
|
78
|
+
}
|
|
79
|
+
if (v?.constructor === Object) {
|
|
80
|
+
const next = {};
|
|
81
|
+
for (const key of Object.keys(v)) {
|
|
82
|
+
next[key] = await walkPromises(v[key]);
|
|
83
|
+
}
|
|
84
|
+
return next;
|
|
85
|
+
}
|
|
86
|
+
return v;
|
|
87
|
+
}
|
|
88
|
+
const PromisesPlugin = /* @__PURE__ */ defineHeadPlugin({
|
|
89
|
+
key: "promises",
|
|
90
|
+
hooks: {
|
|
91
|
+
"entries:resolve": async (ctx) => {
|
|
92
|
+
const promises = [];
|
|
93
|
+
for (const k in ctx.entries) {
|
|
94
|
+
if (!ctx.entries[k]._promisesProcessed) {
|
|
95
|
+
promises.push(
|
|
96
|
+
walkPromises(ctx.entries[k].input).then((val) => {
|
|
97
|
+
ctx.entries[k].input = val;
|
|
98
|
+
ctx.entries[k]._promisesProcessed = true;
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
await Promise.all(promises);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const SupportedAttrs = {
|
|
109
|
+
meta: "content",
|
|
110
|
+
link: "href",
|
|
111
|
+
htmlAttrs: "lang"
|
|
112
|
+
};
|
|
113
|
+
const contentAttrs = ["innerHTML", "textContent"];
|
|
114
|
+
const TemplateParamsPlugin = /* @__PURE__ */ defineHeadPlugin((head) => {
|
|
115
|
+
return {
|
|
116
|
+
key: "template-params",
|
|
117
|
+
hooks: {
|
|
118
|
+
"entries:normalize": (ctx) => {
|
|
119
|
+
const params = ctx.tags.filter((t) => t.tag === "templateParams" && t.mode === "server")?.[0]?.props || {};
|
|
120
|
+
if (Object.keys(params).length) {
|
|
121
|
+
head._ssrPayload = {
|
|
122
|
+
templateParams: {
|
|
123
|
+
...head._ssrPayload?.templateParams || {},
|
|
124
|
+
...params
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"tags:resolve": ({ tagMap, tags }) => {
|
|
130
|
+
const params = tagMap.get("templateParams")?.props || {};
|
|
131
|
+
const sep = params.separator || "|";
|
|
132
|
+
delete params.separator;
|
|
133
|
+
params.pageTitle = processTemplateParams(
|
|
134
|
+
// find templateParams
|
|
135
|
+
params.pageTitle || head._title || "",
|
|
136
|
+
params,
|
|
137
|
+
sep
|
|
138
|
+
);
|
|
139
|
+
for (const tag of tags) {
|
|
140
|
+
if (tag.processTemplateParams === false) {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const v = SupportedAttrs[tag.tag];
|
|
144
|
+
if (v && typeof tag.props[v] === "string") {
|
|
145
|
+
tag.props[v] = processTemplateParams(tag.props[v], params, sep);
|
|
146
|
+
} else if (tag.processTemplateParams || tag.tag === "titleTemplate" || tag.tag === "title") {
|
|
147
|
+
for (const p of contentAttrs) {
|
|
148
|
+
if (typeof tag[p] === "string")
|
|
149
|
+
tag[p] = processTemplateParams(tag[p], params, sep, tag.tag === "script" && tag.props.type.endsWith("json"));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
head._templateParams = params;
|
|
154
|
+
head._separator = sep;
|
|
155
|
+
},
|
|
156
|
+
"tags:afterResolve": ({ tagMap }) => {
|
|
157
|
+
const title = tagMap.get("title");
|
|
158
|
+
if (title?.textContent && title.processTemplateParams !== false) {
|
|
159
|
+
title.textContent = processTemplateParams(title.textContent, head._templateParams, head._separator);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
export { AliasSortingPlugin as A, DeprecationsPlugin as D, PromisesPlugin as P, TemplateParamsPlugin as T };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const SelfClosingTags = /* @__PURE__ */ new Set(["meta", "link", "base"]);
|
|
2
|
+
const DupeableTags = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]);
|
|
3
|
+
const TagsWithInnerContent = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
|
|
4
|
+
const HasElementTags = /* @__PURE__ */ new Set([
|
|
5
|
+
"base",
|
|
6
|
+
"meta",
|
|
7
|
+
"link",
|
|
8
|
+
"style",
|
|
9
|
+
"script",
|
|
10
|
+
"noscript"
|
|
11
|
+
]);
|
|
12
|
+
const ValidHeadTags = /* @__PURE__ */ new Set([
|
|
13
|
+
"title",
|
|
14
|
+
"base",
|
|
15
|
+
"htmlAttrs",
|
|
16
|
+
"bodyAttrs",
|
|
17
|
+
"meta",
|
|
18
|
+
"link",
|
|
19
|
+
"style",
|
|
20
|
+
"script",
|
|
21
|
+
"noscript"
|
|
22
|
+
]);
|
|
23
|
+
const UniqueTags = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]);
|
|
24
|
+
const TagConfigKeys = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]);
|
|
25
|
+
const ScriptNetworkEvents = /* @__PURE__ */ new Set(["onload", "onerror"]);
|
|
26
|
+
const UsesMergeStrategy = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]);
|
|
27
|
+
const MetaTagsArrayable = /* @__PURE__ */ new Set([
|
|
28
|
+
"theme-color",
|
|
29
|
+
"google-site-verification",
|
|
30
|
+
"og",
|
|
31
|
+
"article",
|
|
32
|
+
"book",
|
|
33
|
+
"profile",
|
|
34
|
+
"twitter",
|
|
35
|
+
"author"
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
export { DupeableTags as D, HasElementTags as H, MetaTagsArrayable as M, SelfClosingTags as S, TagsWithInnerContent as T, UniqueTags as U, ValidHeadTags as V, TagConfigKeys as a, ScriptNetworkEvents as b, UsesMergeStrategy as c };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { D as DupeableTags, H as HasElementTags, M as MetaTagsArrayable, b as ScriptNetworkEvents, S as SelfClosingTags, a as TagConfigKeys, T as TagsWithInnerContent, U as UniqueTags, c as UsesMergeStrategy, V as ValidHeadTags } from './shared/unhead.yem5I2v_.mjs';
|
|
2
|
+
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.B5FWS6X0.mjs';
|
|
3
|
+
export { r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.DQc16pHI.mjs';
|
|
4
|
+
export { s as sortTags, t as tagWeight } from './shared/unhead.CbpEuj3y.mjs';
|
|
5
|
+
export { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
|