Remove deprecated scripts for adding head-matter to wt_config.xml, including Python and Bash implementations, to streamline configuration management.
This commit is contained in:
13
client/node_modules/unhead/dist/client.d.mts
generated
vendored
Normal file
13
client/node_modules/unhead/dist/client.d.mts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { R as ResolvableHead, r as CreateClientHeadOptions, U as Unhead, I as RenderDomHeadOptions } from './shared/unhead.Prz0gZXE.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
|
||||
|
||||
/**
|
||||
* Render the head tags to the DOM.
|
||||
*/
|
||||
declare function renderDOMHead<T extends Unhead<any>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
|
||||
|
||||
declare function createDebouncedFn(callee: () => void, delayer: (fn: () => void) => void): () => void;
|
||||
|
||||
export { CreateClientHeadOptions, Unhead, createDebouncedFn, createHead, renderDOMHead };
|
||||
13
client/node_modules/unhead/dist/client.d.ts
generated
vendored
Normal file
13
client/node_modules/unhead/dist/client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { R as ResolvableHead, r as CreateClientHeadOptions, U as Unhead, I as RenderDomHeadOptions } from './shared/unhead.Prz0gZXE.js';
|
||||
import 'hookable';
|
||||
|
||||
declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
|
||||
|
||||
/**
|
||||
* Render the head tags to the DOM.
|
||||
*/
|
||||
declare function renderDOMHead<T extends Unhead<any>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
|
||||
|
||||
declare function createDebouncedFn(callee: () => void, delayer: (fn: () => void) => void): () => void;
|
||||
|
||||
export { CreateClientHeadOptions, Unhead, createDebouncedFn, createHead, renderDOMHead };
|
||||
222
client/node_modules/unhead/dist/client.mjs
generated
vendored
Normal file
222
client/node_modules/unhead/dist/client.mjs
generated
vendored
Normal file
@@ -0,0 +1,222 @@
|
||||
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
||||
import { H as HasElementTags } from './shared/unhead.yem5I2v_.mjs';
|
||||
import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.BpRRHAhY.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
|
||||
async function renderDOMHead(head, options = {}) {
|
||||
const dom = options.document || head.resolvedOptions.document;
|
||||
if (!dom || !head.dirty)
|
||||
return;
|
||||
const beforeRenderCtx = { shouldRender: true, tags: [] };
|
||||
await head.hooks.callHook("dom:beforeRender", beforeRenderCtx);
|
||||
if (!beforeRenderCtx.shouldRender)
|
||||
return;
|
||||
if (head._domUpdatePromise) {
|
||||
return head._domUpdatePromise;
|
||||
}
|
||||
head._domUpdatePromise = new Promise(async (resolve) => {
|
||||
const dupeKeyCounter = /* @__PURE__ */ new Map();
|
||||
const resolveTagPromise = new Promise((resolve2) => {
|
||||
head.resolveTags().then((tags2) => {
|
||||
resolve2(
|
||||
tags2.map((tag) => {
|
||||
const count = dupeKeyCounter.get(tag._d) || 0;
|
||||
const res = {
|
||||
tag,
|
||||
id: (count ? `${tag._d}:${count}` : tag._d) || hashTag(tag),
|
||||
shouldRender: true
|
||||
};
|
||||
if (tag._d && isMetaArrayDupeKey(tag._d)) {
|
||||
dupeKeyCounter.set(tag._d, count + 1);
|
||||
}
|
||||
return res;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
let state = head._dom;
|
||||
if (!state) {
|
||||
state = {
|
||||
title: dom.title,
|
||||
elMap: (/* @__PURE__ */ new Map()).set("htmlAttrs", dom.documentElement).set("bodyAttrs", dom.body)
|
||||
};
|
||||
for (const key of ["body", "head"]) {
|
||||
const children = dom[key]?.children;
|
||||
for (const c of children) {
|
||||
const tag = c.tagName.toLowerCase();
|
||||
if (!HasElementTags.has(tag)) {
|
||||
continue;
|
||||
}
|
||||
const next = normalizeProps({ tag, props: {} }, {
|
||||
innerHTML: c.innerHTML,
|
||||
...c.getAttributeNames().reduce((props, name) => {
|
||||
props[name] = c.getAttribute(name);
|
||||
return props;
|
||||
}, {}) || {}
|
||||
});
|
||||
next.key = c.getAttribute("data-hid") || void 0;
|
||||
next._d = dedupeKey(next) || hashTag(next);
|
||||
if (state.elMap.has(next._d)) {
|
||||
let count = 1;
|
||||
let k = next._d;
|
||||
while (state.elMap.has(k)) {
|
||||
k = `${next._d}:${count++}`;
|
||||
}
|
||||
state.elMap.set(k, c);
|
||||
} else {
|
||||
state.elMap.set(next._d, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
state.pendingSideEffects = { ...state.sideEffects };
|
||||
state.sideEffects = {};
|
||||
function track(id, scope, fn) {
|
||||
const k = `${id}:${scope}`;
|
||||
state.sideEffects[k] = fn;
|
||||
delete state.pendingSideEffects[k];
|
||||
}
|
||||
function trackCtx({ id, $el, tag }) {
|
||||
const isAttrTag = tag.tag.endsWith("Attrs");
|
||||
state.elMap.set(id, $el);
|
||||
if (!isAttrTag) {
|
||||
if (tag.textContent && tag.textContent !== $el.textContent) {
|
||||
$el.textContent = tag.textContent;
|
||||
}
|
||||
if (tag.innerHTML && tag.innerHTML !== $el.innerHTML) {
|
||||
$el.innerHTML = tag.innerHTML;
|
||||
}
|
||||
track(id, "el", () => {
|
||||
$el?.remove();
|
||||
state.elMap.delete(id);
|
||||
});
|
||||
}
|
||||
for (const k in tag.props) {
|
||||
if (!Object.prototype.hasOwnProperty.call(tag.props, k))
|
||||
continue;
|
||||
const value = tag.props[k];
|
||||
if (k.startsWith("on") && typeof value === "function") {
|
||||
const dataset = $el?.dataset;
|
||||
if (dataset && dataset[`${k}fired`]) {
|
||||
const ek = k.slice(0, -5);
|
||||
value.call($el, new Event(ek.substring(2)));
|
||||
}
|
||||
if ($el.getAttribute(`data-${k}`) !== "") {
|
||||
(tag.tag === "bodyAttrs" ? dom.defaultView : $el).addEventListener(
|
||||
// onload -> load
|
||||
k.substring(2),
|
||||
value.bind($el)
|
||||
);
|
||||
$el.setAttribute(`data-${k}`, "");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const ck = `attr:${k}`;
|
||||
if (k === "class") {
|
||||
if (!value) {
|
||||
continue;
|
||||
}
|
||||
for (const c of value) {
|
||||
isAttrTag && track(id, `${ck}:${c}`, () => $el.classList.remove(c));
|
||||
!$el.classList.contains(c) && $el.classList.add(c);
|
||||
}
|
||||
} else if (k === "style") {
|
||||
if (!value) {
|
||||
continue;
|
||||
}
|
||||
for (const [k2, v] of value) {
|
||||
track(id, `${ck}:${k2}`, () => {
|
||||
$el.style.removeProperty(k2);
|
||||
});
|
||||
$el.style.setProperty(k2, v);
|
||||
}
|
||||
} else if (value !== false && value !== null) {
|
||||
$el.getAttribute(k) !== value && $el.setAttribute(k, value === true ? "" : String(value));
|
||||
isAttrTag && track(id, ck, () => $el.removeAttribute(k));
|
||||
}
|
||||
}
|
||||
}
|
||||
const pending = [];
|
||||
const frag = {
|
||||
bodyClose: void 0,
|
||||
bodyOpen: void 0,
|
||||
head: void 0
|
||||
};
|
||||
const tags = await resolveTagPromise;
|
||||
for (const ctx of tags) {
|
||||
const { tag, shouldRender, id } = ctx;
|
||||
if (!shouldRender)
|
||||
continue;
|
||||
if (tag.tag === "title") {
|
||||
dom.title = tag.textContent;
|
||||
track("title", "", () => dom.title = state.title);
|
||||
continue;
|
||||
}
|
||||
ctx.$el = ctx.$el || state.elMap.get(id);
|
||||
if (ctx.$el) {
|
||||
trackCtx(ctx);
|
||||
} else if (HasElementTags.has(tag.tag)) {
|
||||
pending.push(ctx);
|
||||
}
|
||||
}
|
||||
for (const ctx of pending) {
|
||||
const pos = ctx.tag.tagPosition || "head";
|
||||
ctx.$el = dom.createElement(ctx.tag.tag);
|
||||
trackCtx(ctx);
|
||||
frag[pos] = frag[pos] || dom.createDocumentFragment();
|
||||
frag[pos].appendChild(ctx.$el);
|
||||
}
|
||||
for (const ctx of tags)
|
||||
await head.hooks.callHook("dom:renderTag", ctx, dom, track);
|
||||
frag.head && dom.head.appendChild(frag.head);
|
||||
frag.bodyOpen && dom.body.insertBefore(frag.bodyOpen, dom.body.firstChild);
|
||||
frag.bodyClose && dom.body.appendChild(frag.bodyClose);
|
||||
for (const k in state.pendingSideEffects) {
|
||||
state.pendingSideEffects[k]();
|
||||
}
|
||||
head._dom = state;
|
||||
await head.hooks.callHook("dom:rendered", { renders: tags });
|
||||
resolve();
|
||||
}).finally(() => {
|
||||
head._domUpdatePromise = void 0;
|
||||
head.dirty = false;
|
||||
});
|
||||
return head._domUpdatePromise;
|
||||
}
|
||||
|
||||
function createHead(options = {}) {
|
||||
const render = options.domOptions?.render || renderDOMHead;
|
||||
options.document = options.document || (typeof window !== "undefined" ? document : void 0);
|
||||
const initialPayload = options.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML || false;
|
||||
return createUnhead({
|
||||
...options,
|
||||
plugins: [
|
||||
...options.plugins || [],
|
||||
{
|
||||
key: "client",
|
||||
hooks: {
|
||||
"entries:updated": render
|
||||
}
|
||||
}
|
||||
],
|
||||
init: [
|
||||
initialPayload ? JSON.parse(initialPayload) : false,
|
||||
...options.init || []
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function createDebouncedFn(callee, delayer) {
|
||||
let ctxId = 0;
|
||||
return () => {
|
||||
const delayFnCtxId = ++ctxId;
|
||||
delayer(() => {
|
||||
if (ctxId === delayFnCtxId) {
|
||||
callee();
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export { createDebouncedFn, createHead, renderDOMHead };
|
||||
32
client/node_modules/unhead/dist/index.d.mts
generated
vendored
Normal file
32
client/node_modules/unhead/dist/index.d.mts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { H as HeadSafe } from './shared/unhead.Ctcwz9O1.mjs';
|
||||
import { U as Unhead, R as ResolvableHead, s as HeadEntryOptions, p as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { u as useScript } from './shared/unhead.CnYfgE7E.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
||||
declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
||||
declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
||||
/**
|
||||
* @deprecated use `useHead` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerHead<T extends Unhead<any>>(unhead: T, input?: Parameters<T['push']>[0], options?: Omit<HeadEntryOptions, 'mode'>): ReturnType<T['push']>;
|
||||
/**
|
||||
* @deprecated use `useHeadSafe` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<HeadSafe>;
|
||||
/**
|
||||
* @deprecated use `useSeoMeta` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<UseSeoMetaInput>;
|
||||
|
||||
/**
|
||||
* @deprecated use `createUnhead` instead
|
||||
*/
|
||||
declare function createHeadCore<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
||||
/**
|
||||
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
||||
* and does not register DOM plugins.
|
||||
*/
|
||||
declare function createUnhead<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
||||
|
||||
export { createHeadCore, createUnhead, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
||||
32
client/node_modules/unhead/dist/index.d.ts
generated
vendored
Normal file
32
client/node_modules/unhead/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { H as HeadSafe } from './shared/unhead.DQUgqVjB.js';
|
||||
import { U as Unhead, R as ResolvableHead, s as HeadEntryOptions, p as ActiveHeadEntry, a8 as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.Prz0gZXE.js';
|
||||
export { u as useScript } from './shared/unhead.kTflSlNr.js';
|
||||
import 'hookable';
|
||||
|
||||
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: ResolvableHead, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
||||
declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
||||
declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
||||
/**
|
||||
* @deprecated use `useHead` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerHead<T extends Unhead<any>>(unhead: T, input?: Parameters<T['push']>[0], options?: Omit<HeadEntryOptions, 'mode'>): ReturnType<T['push']>;
|
||||
/**
|
||||
* @deprecated use `useHeadSafe` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<HeadSafe>;
|
||||
/**
|
||||
* @deprecated use `useSeoMeta` instead. Advanced use cases should tree shake using import.meta.* if statements.
|
||||
*/
|
||||
declare function useServerSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<UseSeoMetaInput>;
|
||||
|
||||
/**
|
||||
* @deprecated use `createUnhead` instead
|
||||
*/
|
||||
declare function createHeadCore<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
||||
/**
|
||||
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
||||
* and does not register DOM plugins.
|
||||
*/
|
||||
declare function createUnhead<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
||||
|
||||
export { createHeadCore, createUnhead, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
||||
9
client/node_modules/unhead/dist/index.mjs
generated
vendored
Normal file
9
client/node_modules/unhead/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
|
||||
export { c as createHeadCore, a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
||||
export { u as useScript } from './shared/unhead.B578PsDV.mjs';
|
||||
import './shared/unhead.CApf5sj3.mjs';
|
||||
import './shared/unhead.DQc16pHI.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.BpRRHAhY.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
16
client/node_modules/unhead/dist/legacy.d.mts
generated
vendored
Normal file
16
client/node_modules/unhead/dist/legacy.d.mts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createUnhead } from './index.mjs';
|
||||
export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.mjs';
|
||||
import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { u as useScript } from './shared/unhead.CnYfgE7E.mjs';
|
||||
import './shared/unhead.Ctcwz9O1.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare const activeHead: {
|
||||
value: Unhead<any> | null;
|
||||
};
|
||||
declare function getActiveHead(): Unhead<any> | null;
|
||||
declare function createServerHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
||||
declare function createHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
||||
declare const createHeadCore: typeof createUnhead;
|
||||
|
||||
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
||||
16
client/node_modules/unhead/dist/legacy.d.ts
generated
vendored
Normal file
16
client/node_modules/unhead/dist/legacy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createUnhead } from './index.js';
|
||||
export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.js';
|
||||
import { U as Unhead, R as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.Prz0gZXE.js';
|
||||
export { u as useScript } from './shared/unhead.kTflSlNr.js';
|
||||
import './shared/unhead.DQUgqVjB.js';
|
||||
import 'hookable';
|
||||
|
||||
declare const activeHead: {
|
||||
value: Unhead<any> | null;
|
||||
};
|
||||
declare function getActiveHead(): Unhead<any> | null;
|
||||
declare function createServerHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
||||
declare function createHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
||||
declare const createHeadCore: typeof createUnhead;
|
||||
|
||||
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
||||
47
client/node_modules/unhead/dist/legacy.mjs
generated
vendored
Normal file
47
client/node_modules/unhead/dist/legacy.mjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
||||
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.Djo8ep_Y.mjs';
|
||||
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
|
||||
export { u as useScript } from './shared/unhead.B578PsDV.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.BpRRHAhY.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
import './shared/unhead.CApf5sj3.mjs';
|
||||
import './shared/unhead.DQc16pHI.mjs';
|
||||
import './shared/unhead.BYvz9V1x.mjs';
|
||||
|
||||
const activeHead = { value: null };
|
||||
function getActiveHead() {
|
||||
return activeHead?.value;
|
||||
}
|
||||
function createServerHead(options = {}) {
|
||||
return activeHead.value = createUnhead({
|
||||
disableCapoSorting: true,
|
||||
...options,
|
||||
// @ts-expect-error untyped
|
||||
document: false,
|
||||
plugins: [
|
||||
...options.plugins || [],
|
||||
DeprecationsPlugin,
|
||||
PromisesPlugin,
|
||||
TemplateParamsPlugin,
|
||||
AliasSortingPlugin
|
||||
]
|
||||
});
|
||||
}
|
||||
function createHead(options = {}) {
|
||||
return activeHead.value = createUnhead({
|
||||
disableCapoSorting: true,
|
||||
...options,
|
||||
plugins: [
|
||||
...options.plugins || [],
|
||||
DeprecationsPlugin,
|
||||
PromisesPlugin,
|
||||
TemplateParamsPlugin,
|
||||
AliasSortingPlugin
|
||||
]
|
||||
});
|
||||
}
|
||||
const createHeadCore = createUnhead;
|
||||
|
||||
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
||||
54
client/node_modules/unhead/dist/parser.d.mts
generated
vendored
Normal file
54
client/node_modules/unhead/dist/parser.d.mts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { S as SerializableHead } from './shared/unhead.Prz0gZXE.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare const TagIdMap: {
|
||||
readonly html: 0;
|
||||
readonly head: 1;
|
||||
readonly title: 4;
|
||||
readonly meta: 5;
|
||||
readonly body: 44;
|
||||
readonly script: 52;
|
||||
readonly style: 53;
|
||||
readonly link: 54;
|
||||
readonly base: 56;
|
||||
};
|
||||
interface PreparedHtmlTemplate {
|
||||
html: string;
|
||||
input: SerializableHead;
|
||||
}
|
||||
interface PreparedHtmlTemplateWithIndexes {
|
||||
html: string;
|
||||
input: SerializableHead;
|
||||
indexes: {
|
||||
htmlTagStart: number;
|
||||
htmlTagEnd: number;
|
||||
headTagEnd: number;
|
||||
bodyTagStart: number;
|
||||
bodyTagEnd: number;
|
||||
bodyCloseTagStart: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Parse HTML attributes string into key-value object
|
||||
*/
|
||||
declare function parseAttributes(attrStr: string): Record<string, string>;
|
||||
/**
|
||||
* Parse HTML to find tag indexes without extracting head elements
|
||||
* Used for transformHtmlTemplateRaw where we don't want to extract existing head content
|
||||
*/
|
||||
declare function parseHtmlForIndexes(html: string): PreparedHtmlTemplateWithIndexes;
|
||||
declare function parseHtmlForUnheadExtraction(html: string): PreparedHtmlTemplateWithIndexes;
|
||||
/**
|
||||
* Optimized HTML construction function that uses indexes instead of string.replace()
|
||||
* This avoids searching through the entire HTML
|
||||
*/
|
||||
declare function applyHeadToHtml(template: PreparedHtmlTemplateWithIndexes, headHtml: {
|
||||
htmlAttrs: string;
|
||||
headTags: string;
|
||||
bodyAttrs: string;
|
||||
bodyTagsOpen?: string;
|
||||
bodyTags: string;
|
||||
}): string;
|
||||
|
||||
export { TagIdMap, applyHeadToHtml, parseAttributes, parseHtmlForIndexes, parseHtmlForUnheadExtraction };
|
||||
export type { PreparedHtmlTemplate, PreparedHtmlTemplateWithIndexes };
|
||||
54
client/node_modules/unhead/dist/parser.d.ts
generated
vendored
Normal file
54
client/node_modules/unhead/dist/parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { S as SerializableHead } from './shared/unhead.Prz0gZXE.js';
|
||||
import 'hookable';
|
||||
|
||||
declare const TagIdMap: {
|
||||
readonly html: 0;
|
||||
readonly head: 1;
|
||||
readonly title: 4;
|
||||
readonly meta: 5;
|
||||
readonly body: 44;
|
||||
readonly script: 52;
|
||||
readonly style: 53;
|
||||
readonly link: 54;
|
||||
readonly base: 56;
|
||||
};
|
||||
interface PreparedHtmlTemplate {
|
||||
html: string;
|
||||
input: SerializableHead;
|
||||
}
|
||||
interface PreparedHtmlTemplateWithIndexes {
|
||||
html: string;
|
||||
input: SerializableHead;
|
||||
indexes: {
|
||||
htmlTagStart: number;
|
||||
htmlTagEnd: number;
|
||||
headTagEnd: number;
|
||||
bodyTagStart: number;
|
||||
bodyTagEnd: number;
|
||||
bodyCloseTagStart: number;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Parse HTML attributes string into key-value object
|
||||
*/
|
||||
declare function parseAttributes(attrStr: string): Record<string, string>;
|
||||
/**
|
||||
* Parse HTML to find tag indexes without extracting head elements
|
||||
* Used for transformHtmlTemplateRaw where we don't want to extract existing head content
|
||||
*/
|
||||
declare function parseHtmlForIndexes(html: string): PreparedHtmlTemplateWithIndexes;
|
||||
declare function parseHtmlForUnheadExtraction(html: string): PreparedHtmlTemplateWithIndexes;
|
||||
/**
|
||||
* Optimized HTML construction function that uses indexes instead of string.replace()
|
||||
* This avoids searching through the entire HTML
|
||||
*/
|
||||
declare function applyHeadToHtml(template: PreparedHtmlTemplateWithIndexes, headHtml: {
|
||||
htmlAttrs: string;
|
||||
headTags: string;
|
||||
bodyAttrs: string;
|
||||
bodyTagsOpen?: string;
|
||||
bodyTags: string;
|
||||
}): string;
|
||||
|
||||
export { TagIdMap, applyHeadToHtml, parseAttributes, parseHtmlForIndexes, parseHtmlForUnheadExtraction };
|
||||
export type { PreparedHtmlTemplate, PreparedHtmlTemplateWithIndexes };
|
||||
508
client/node_modules/unhead/dist/parser.mjs
generated
vendored
Normal file
508
client/node_modules/unhead/dist/parser.mjs
generated
vendored
Normal file
@@ -0,0 +1,508 @@
|
||||
const TAG_HTML = 0;
|
||||
const TAG_HEAD = 1;
|
||||
const TAG_TITLE = 4;
|
||||
const TAG_META = 5;
|
||||
const TAG_BODY = 44;
|
||||
const TAG_SCRIPT = 52;
|
||||
const TAG_STYLE = 53;
|
||||
const TAG_LINK = 54;
|
||||
const TAG_BASE = 56;
|
||||
const LT_CHAR = 60;
|
||||
const GT_CHAR = 62;
|
||||
const SLASH_CHAR = 47;
|
||||
const EQUALS_CHAR = 61;
|
||||
const QUOTE_CHAR = 34;
|
||||
const APOS_CHAR = 39;
|
||||
const EXCLAMATION_CHAR = 33;
|
||||
const BACKSLASH_CHAR = 92;
|
||||
const DASH_CHAR = 45;
|
||||
const TagIdMap = {
|
||||
html: TAG_HTML,
|
||||
head: TAG_HEAD,
|
||||
title: TAG_TITLE,
|
||||
meta: TAG_META,
|
||||
body: TAG_BODY,
|
||||
script: TAG_SCRIPT,
|
||||
style: TAG_STYLE,
|
||||
link: TAG_LINK,
|
||||
base: TAG_BASE
|
||||
};
|
||||
function isWhitespace(charCode) {
|
||||
return charCode === 32 || charCode === 9 || charCode === 10 || charCode === 13;
|
||||
}
|
||||
function processCommentOrDoctype(htmlChunk, position) {
|
||||
let i = position;
|
||||
const chunkLength = htmlChunk.length;
|
||||
if (i + 3 < chunkLength && htmlChunk.charCodeAt(i + 2) === DASH_CHAR && htmlChunk.charCodeAt(i + 3) === DASH_CHAR) {
|
||||
i += 4;
|
||||
while (i < chunkLength - 2) {
|
||||
if (htmlChunk.charCodeAt(i) === DASH_CHAR && htmlChunk.charCodeAt(i + 1) === DASH_CHAR && htmlChunk.charCodeAt(i + 2) === GT_CHAR) {
|
||||
i += 3;
|
||||
return {
|
||||
complete: true,
|
||||
newPosition: i,
|
||||
remainingText: ""
|
||||
};
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return {
|
||||
complete: false,
|
||||
newPosition: position,
|
||||
remainingText: htmlChunk.substring(position)
|
||||
};
|
||||
} else {
|
||||
i += 2;
|
||||
while (i < chunkLength) {
|
||||
if (htmlChunk.charCodeAt(i) === GT_CHAR) {
|
||||
i++;
|
||||
return {
|
||||
complete: true,
|
||||
newPosition: i,
|
||||
remainingText: ""
|
||||
};
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return {
|
||||
complete: false,
|
||||
newPosition: i,
|
||||
remainingText: htmlChunk.substring(position, i)
|
||||
};
|
||||
}
|
||||
}
|
||||
function parseAttributes(attrStr) {
|
||||
if (!attrStr)
|
||||
return {};
|
||||
const result = {};
|
||||
const len = attrStr.length;
|
||||
let i = 0;
|
||||
const WHITESPACE = 0;
|
||||
const NAME = 1;
|
||||
const AFTER_NAME = 2;
|
||||
const BEFORE_VALUE = 3;
|
||||
const QUOTED_VALUE = 4;
|
||||
const UNQUOTED_VALUE = 5;
|
||||
let state = WHITESPACE;
|
||||
let nameStart = 0;
|
||||
let nameEnd = 0;
|
||||
let valueStart = 0;
|
||||
let quoteChar = 0;
|
||||
let name = "";
|
||||
while (i < len) {
|
||||
const charCode = attrStr.charCodeAt(i);
|
||||
const isSpace = isWhitespace(charCode);
|
||||
switch (state) {
|
||||
case WHITESPACE:
|
||||
if (!isSpace) {
|
||||
state = NAME;
|
||||
nameStart = i;
|
||||
nameEnd = 0;
|
||||
}
|
||||
break;
|
||||
case NAME:
|
||||
if (charCode === EQUALS_CHAR || isSpace) {
|
||||
nameEnd = i;
|
||||
name = attrStr.substring(nameStart, nameEnd).toLowerCase();
|
||||
state = charCode === EQUALS_CHAR ? BEFORE_VALUE : AFTER_NAME;
|
||||
}
|
||||
break;
|
||||
case AFTER_NAME:
|
||||
if (charCode === EQUALS_CHAR) {
|
||||
state = BEFORE_VALUE;
|
||||
} else if (!isSpace) {
|
||||
result[name] = "";
|
||||
state = NAME;
|
||||
nameStart = i;
|
||||
nameEnd = 0;
|
||||
}
|
||||
break;
|
||||
case BEFORE_VALUE:
|
||||
if (charCode === QUOTE_CHAR || charCode === APOS_CHAR) {
|
||||
quoteChar = charCode;
|
||||
state = QUOTED_VALUE;
|
||||
valueStart = i + 1;
|
||||
} else if (!isSpace) {
|
||||
state = UNQUOTED_VALUE;
|
||||
valueStart = i;
|
||||
}
|
||||
break;
|
||||
case QUOTED_VALUE:
|
||||
if (charCode === BACKSLASH_CHAR && i + 1 < len) {
|
||||
i++;
|
||||
} else if (charCode === quoteChar) {
|
||||
result[name] = attrStr.substring(valueStart, i);
|
||||
state = WHITESPACE;
|
||||
}
|
||||
break;
|
||||
case UNQUOTED_VALUE:
|
||||
if (isSpace || charCode === GT_CHAR) {
|
||||
result[name] = attrStr.substring(valueStart, i);
|
||||
state = WHITESPACE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (state === QUOTED_VALUE || state === UNQUOTED_VALUE) {
|
||||
if (name) {
|
||||
result[name] = attrStr.substring(valueStart, i);
|
||||
}
|
||||
} else if (state === NAME || state === AFTER_NAME || state === BEFORE_VALUE) {
|
||||
nameEnd = nameEnd || i;
|
||||
const currentName = attrStr.substring(nameStart, nameEnd).toLowerCase();
|
||||
if (currentName) {
|
||||
result[currentName] = "";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function parseHtmlForIndexes(html) {
|
||||
const indexes = {
|
||||
htmlTagStart: html.indexOf("<html"),
|
||||
htmlTagEnd: -1,
|
||||
headTagEnd: html.indexOf("</head>"),
|
||||
bodyTagStart: html.indexOf("<body"),
|
||||
bodyTagEnd: -1,
|
||||
bodyCloseTagStart: html.indexOf("</body>")
|
||||
};
|
||||
if (indexes.htmlTagStart >= 0) {
|
||||
const htmlTagEndPos = html.indexOf(">", indexes.htmlTagStart);
|
||||
if (htmlTagEndPos >= 0) {
|
||||
indexes.htmlTagEnd = htmlTagEndPos + 1;
|
||||
}
|
||||
}
|
||||
if (indexes.bodyTagStart >= 0) {
|
||||
const bodyTagEndPos = html.indexOf(">", indexes.bodyTagStart);
|
||||
if (bodyTagEndPos >= 0) {
|
||||
indexes.bodyTagEnd = bodyTagEndPos + 1;
|
||||
}
|
||||
}
|
||||
return { html, input: {}, indexes };
|
||||
}
|
||||
function parseHtmlForUnheadExtraction(html) {
|
||||
const input = {};
|
||||
const htmlParts = [];
|
||||
let position = 0;
|
||||
let inHead = false;
|
||||
let foundBodyStart = false;
|
||||
let lastCopyPosition = 0;
|
||||
let currentOutputLength = 0;
|
||||
const indexes = {
|
||||
htmlTagStart: -1,
|
||||
htmlTagEnd: -1,
|
||||
headTagEnd: -1,
|
||||
bodyTagStart: -1,
|
||||
bodyTagEnd: -1,
|
||||
bodyCloseTagStart: -1
|
||||
};
|
||||
const headElementsToExtract = /* @__PURE__ */ new Set([TAG_TITLE, TAG_META, TAG_LINK, TAG_SCRIPT, TAG_STYLE, TAG_BASE]);
|
||||
function copyAccumulatedText() {
|
||||
if (lastCopyPosition < position) {
|
||||
const textToAdd = html.substring(lastCopyPosition, position);
|
||||
htmlParts.push(textToAdd);
|
||||
currentOutputLength += textToAdd.length;
|
||||
lastCopyPosition = position;
|
||||
}
|
||||
}
|
||||
function addText(text) {
|
||||
htmlParts.push(text);
|
||||
currentOutputLength += text.length;
|
||||
}
|
||||
while (position < html.length && !foundBodyStart) {
|
||||
const currentCharCode = html.charCodeAt(position);
|
||||
if (currentCharCode !== LT_CHAR) {
|
||||
position++;
|
||||
continue;
|
||||
}
|
||||
if (position + 1 >= html.length) {
|
||||
copyAccumulatedText();
|
||||
addText(html[position]);
|
||||
break;
|
||||
}
|
||||
const nextCharCode = html.charCodeAt(position + 1);
|
||||
if (nextCharCode === EXCLAMATION_CHAR) {
|
||||
const result = processCommentOrDoctype(html, position);
|
||||
if (result.complete) {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position, result.newPosition));
|
||||
position = result.newPosition;
|
||||
lastCopyPosition = position;
|
||||
} else {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position));
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (nextCharCode === SLASH_CHAR) {
|
||||
let tagEnd2 = position + 2;
|
||||
while (tagEnd2 < html.length && html.charCodeAt(tagEnd2) !== GT_CHAR) {
|
||||
tagEnd2++;
|
||||
}
|
||||
if (tagEnd2 >= html.length) {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position));
|
||||
break;
|
||||
}
|
||||
const tagName2 = html.substring(position + 2, tagEnd2).toLowerCase().trim();
|
||||
const tagId2 = TagIdMap[tagName2] ?? -1;
|
||||
if (tagId2 === TAG_HEAD) {
|
||||
inHead = false;
|
||||
copyAccumulatedText();
|
||||
const headCloseStart = currentOutputLength;
|
||||
addText(html.substring(position, tagEnd2 + 1));
|
||||
indexes.headTagEnd = headCloseStart;
|
||||
} else {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position, tagEnd2 + 1));
|
||||
}
|
||||
position = tagEnd2 + 1;
|
||||
lastCopyPosition = position;
|
||||
continue;
|
||||
}
|
||||
const tagStart = position + 1;
|
||||
let tagNameEnd = tagStart;
|
||||
while (tagNameEnd < html.length) {
|
||||
const c = html.charCodeAt(tagNameEnd);
|
||||
if (isWhitespace(c) || c === SLASH_CHAR || c === GT_CHAR) {
|
||||
break;
|
||||
}
|
||||
tagNameEnd++;
|
||||
}
|
||||
if (tagNameEnd >= html.length) {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position));
|
||||
break;
|
||||
}
|
||||
const tagName = html.substring(tagStart, tagNameEnd).toLowerCase();
|
||||
const tagId = TagIdMap[tagName] ?? -1;
|
||||
let tagEnd = tagNameEnd;
|
||||
let inQuote = false;
|
||||
let quoteChar = 0;
|
||||
let foundEnd = false;
|
||||
let isSelfClosing = false;
|
||||
while (tagEnd < html.length && !foundEnd) {
|
||||
const c = html.charCodeAt(tagEnd);
|
||||
if (inQuote) {
|
||||
if (c === quoteChar) {
|
||||
inQuote = false;
|
||||
}
|
||||
} else if (c === QUOTE_CHAR || c === APOS_CHAR) {
|
||||
inQuote = true;
|
||||
quoteChar = c;
|
||||
} else if (c === SLASH_CHAR && tagEnd + 1 < html.length && html.charCodeAt(tagEnd + 1) === GT_CHAR) {
|
||||
isSelfClosing = true;
|
||||
tagEnd += 2;
|
||||
foundEnd = true;
|
||||
continue;
|
||||
} else if (c === GT_CHAR) {
|
||||
tagEnd++;
|
||||
foundEnd = true;
|
||||
continue;
|
||||
}
|
||||
tagEnd++;
|
||||
}
|
||||
if (!foundEnd) {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position));
|
||||
break;
|
||||
}
|
||||
const attributesStr = html.substring(tagNameEnd, tagEnd - (isSelfClosing ? 2 : 1)).trim();
|
||||
const attributes = parseAttributes(attributesStr);
|
||||
if (tagId === TAG_HTML) {
|
||||
copyAccumulatedText();
|
||||
indexes.htmlTagStart = currentOutputLength;
|
||||
if (Object.keys(attributes).length > 0) {
|
||||
input.htmlAttrs = attributes;
|
||||
addText(`<${tagName}>`);
|
||||
} else {
|
||||
addText(html.substring(position, tagEnd));
|
||||
}
|
||||
indexes.htmlTagEnd = currentOutputLength;
|
||||
} else if (tagId === TAG_BODY) {
|
||||
copyAccumulatedText();
|
||||
indexes.bodyTagStart = currentOutputLength;
|
||||
if (Object.keys(attributes).length > 0) {
|
||||
input.bodyAttrs = attributes;
|
||||
addText(`<${tagName}>`);
|
||||
} else {
|
||||
addText(html.substring(position, tagEnd));
|
||||
}
|
||||
indexes.bodyTagEnd = currentOutputLength;
|
||||
foundBodyStart = true;
|
||||
position = tagEnd;
|
||||
lastCopyPosition = position;
|
||||
break;
|
||||
} else if (tagId === TAG_HEAD) {
|
||||
inHead = true;
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position, tagEnd));
|
||||
} else if (inHead && headElementsToExtract.has(tagId)) {
|
||||
if (tagId === TAG_TITLE) {
|
||||
if (!isSelfClosing) {
|
||||
const titleEnd = findClosingTag(html, tagEnd, tagName);
|
||||
if (titleEnd !== -1) {
|
||||
const titleContent = html.substring(tagEnd, titleEnd).trim();
|
||||
if (titleContent && !input.title) {
|
||||
input.title = titleContent;
|
||||
}
|
||||
position = findTagEnd(html, titleEnd, tagName);
|
||||
lastCopyPosition = position;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else if (tagId === TAG_SCRIPT) {
|
||||
const scriptAttrs = { ...attributes };
|
||||
if (!isSelfClosing) {
|
||||
const scriptEnd = findClosingTag(html, tagEnd, tagName);
|
||||
if (scriptEnd !== -1) {
|
||||
const scriptContent = html.substring(tagEnd, scriptEnd);
|
||||
scriptAttrs.innerHTML = scriptContent || "";
|
||||
position = findTagEnd(html, scriptEnd, tagName);
|
||||
} else {
|
||||
scriptAttrs.innerHTML = "";
|
||||
position = tagEnd;
|
||||
}
|
||||
} else {
|
||||
scriptAttrs.innerHTML = "";
|
||||
position = tagEnd;
|
||||
}
|
||||
lastCopyPosition = position;
|
||||
(input.script ||= []).push(scriptAttrs);
|
||||
continue;
|
||||
} else if (tagId === TAG_STYLE) {
|
||||
const styleAttrs = { ...attributes };
|
||||
if (!isSelfClosing) {
|
||||
const styleEnd = findClosingTag(html, tagEnd, tagName);
|
||||
if (styleEnd !== -1) {
|
||||
const styleContent = html.substring(tagEnd, styleEnd);
|
||||
styleAttrs.textContent = styleContent || "";
|
||||
position = findTagEnd(html, styleEnd, tagName);
|
||||
} else {
|
||||
styleAttrs.textContent = "";
|
||||
position = tagEnd;
|
||||
}
|
||||
} else {
|
||||
styleAttrs.textContent = "";
|
||||
position = tagEnd;
|
||||
}
|
||||
lastCopyPosition = position;
|
||||
(input.style ||= []).push(styleAttrs);
|
||||
continue;
|
||||
} else if (tagId === TAG_META) {
|
||||
(input.meta ||= []).push(attributes);
|
||||
position = tagEnd;
|
||||
lastCopyPosition = position;
|
||||
continue;
|
||||
} else if (tagId === TAG_LINK) {
|
||||
(input.link ||= []).push(attributes);
|
||||
position = tagEnd;
|
||||
lastCopyPosition = position;
|
||||
continue;
|
||||
} else if (tagId === TAG_BASE && !input.base) {
|
||||
input.base = attributes;
|
||||
position = tagEnd;
|
||||
lastCopyPosition = position;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
copyAccumulatedText();
|
||||
addText(html.substring(position, tagEnd));
|
||||
}
|
||||
position = tagEnd;
|
||||
lastCopyPosition = position;
|
||||
}
|
||||
const remainingHtml = html.substring(position);
|
||||
const bodyCloseIndex = remainingHtml.indexOf("</body>");
|
||||
if (bodyCloseIndex !== -1) {
|
||||
indexes.bodyCloseTagStart = currentOutputLength + bodyCloseIndex;
|
||||
}
|
||||
copyAccumulatedText();
|
||||
addText(remainingHtml);
|
||||
return { html: htmlParts.join(""), input, indexes };
|
||||
}
|
||||
function findClosingTag(html, startPos, tagName) {
|
||||
const tagId = TagIdMap[tagName];
|
||||
const isScriptOrStyle = tagId === TAG_SCRIPT || tagId === TAG_STYLE;
|
||||
if (!isScriptOrStyle) {
|
||||
const closingTag2 = `</${tagName}`;
|
||||
const index = html.indexOf(closingTag2, startPos);
|
||||
return index === -1 ? -1 : index;
|
||||
}
|
||||
const closingTag = `</${tagName}`;
|
||||
let pos = startPos;
|
||||
let inSingleQuote = false;
|
||||
let inDoubleQuote = false;
|
||||
let inBacktick = false;
|
||||
let lastCharWasBackslash = false;
|
||||
while (pos < html.length) {
|
||||
const currentCharCode = html.charCodeAt(pos);
|
||||
if (!lastCharWasBackslash) {
|
||||
if (currentCharCode === APOS_CHAR && !inDoubleQuote && !inBacktick) {
|
||||
inSingleQuote = !inSingleQuote;
|
||||
} else if (currentCharCode === QUOTE_CHAR && !inSingleQuote && !inBacktick) {
|
||||
inDoubleQuote = !inDoubleQuote;
|
||||
} else if (currentCharCode === 96 && !inSingleQuote && !inDoubleQuote) {
|
||||
inBacktick = !inBacktick;
|
||||
}
|
||||
}
|
||||
lastCharWasBackslash = currentCharCode === BACKSLASH_CHAR && !lastCharWasBackslash;
|
||||
const inQuotes = inSingleQuote || inDoubleQuote || inBacktick;
|
||||
if (!inQuotes && html.startsWith(closingTag, pos)) {
|
||||
const afterTagPos = pos + closingTag.length;
|
||||
if (afterTagPos >= html.length) {
|
||||
return pos;
|
||||
}
|
||||
const nextChar = html.charCodeAt(afterTagPos);
|
||||
if (nextChar === GT_CHAR || isWhitespace(nextChar)) {
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
function findTagEnd(html, closingTagStart, tagName) {
|
||||
let pos = closingTagStart + tagName.length + 2;
|
||||
while (pos < html.length && html.charCodeAt(pos) !== GT_CHAR) {
|
||||
pos++;
|
||||
}
|
||||
return pos < html.length ? pos + 1 : pos;
|
||||
}
|
||||
function applyHeadToHtml(template, headHtml) {
|
||||
const { html, indexes } = template;
|
||||
const parts = [];
|
||||
let lastIndex = 0;
|
||||
if (indexes.htmlTagStart >= 0) {
|
||||
parts.push(html.substring(lastIndex, indexes.htmlTagStart));
|
||||
parts.push(`<html${headHtml.htmlAttrs}>`);
|
||||
lastIndex = indexes.htmlTagEnd;
|
||||
}
|
||||
if (indexes.headTagEnd >= 0) {
|
||||
parts.push(html.substring(lastIndex, indexes.headTagEnd));
|
||||
parts.push(headHtml.headTags);
|
||||
parts.push("</head>");
|
||||
lastIndex = indexes.headTagEnd + 7;
|
||||
}
|
||||
if (indexes.bodyTagStart >= 0) {
|
||||
parts.push(html.substring(lastIndex, indexes.bodyTagStart));
|
||||
if (headHtml.bodyTagsOpen) {
|
||||
parts.push(`<body${headHtml.bodyAttrs}>
|
||||
${headHtml.bodyTagsOpen}`);
|
||||
} else {
|
||||
parts.push(`<body${headHtml.bodyAttrs}>`);
|
||||
}
|
||||
lastIndex = indexes.bodyTagEnd;
|
||||
}
|
||||
if (indexes.bodyCloseTagStart >= 0) {
|
||||
parts.push(html.substring(lastIndex, indexes.bodyCloseTagStart));
|
||||
parts.push(headHtml.bodyTags);
|
||||
parts.push(html.substring(indexes.bodyCloseTagStart));
|
||||
} else {
|
||||
parts.push(html.substring(lastIndex));
|
||||
}
|
||||
return parts.join("");
|
||||
}
|
||||
|
||||
export { TagIdMap, applyHeadToHtml, parseAttributes, parseHtmlForIndexes, parseHtmlForUnheadExtraction };
|
||||
65
client/node_modules/unhead/dist/plugins.d.mts
generated
vendored
Normal file
65
client/node_modules/unhead/dist/plugins.d.mts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import { n as HeadPluginInput, U as Unhead, m as HeadPluginOptions } from './shared/unhead.Prz0gZXE.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare const AliasSortingPlugin: HeadPluginInput;
|
||||
|
||||
interface CanonicalPluginOptions {
|
||||
canonicalHost?: string;
|
||||
customResolver?: (url: string) => string;
|
||||
}
|
||||
/**
|
||||
* CanonicalPlugin resolves paths in tags that require a canonical host to be set.
|
||||
*
|
||||
* - Resolves paths in meta tags like `og:image` and `twitter:image`.
|
||||
* - Resolves paths in the `og:url` meta tag.
|
||||
* - Resolves paths in the `link` tag with the `rel="canonical"` attribute.
|
||||
* @example
|
||||
* const plugin = CanonicalPlugin({
|
||||
* canonicalHost: 'https://example.com',
|
||||
* customResolver: (path) => `/custom${path}`,
|
||||
* });
|
||||
*
|
||||
* // This plugin will resolve URLs in meta tags like:
|
||||
* // <meta property="og:image" content="/image.jpg">
|
||||
* // to:
|
||||
* // <meta property="og:image" content="https://example.com/image.jpg">
|
||||
*/
|
||||
declare function CanonicalPlugin(options: CanonicalPluginOptions): ((head: Unhead) => HeadPluginOptions & {
|
||||
key: string;
|
||||
});
|
||||
|
||||
declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
||||
|
||||
declare const DeprecationsPlugin: HeadPluginInput;
|
||||
|
||||
declare const FlatMetaPlugin: HeadPluginInput;
|
||||
|
||||
interface InferSeoMetaPluginOptions {
|
||||
/**
|
||||
* Transform the og title.
|
||||
*
|
||||
* @param title
|
||||
*/
|
||||
ogTitle?: ((title?: string) => string);
|
||||
/**
|
||||
* Transform the og description.
|
||||
*
|
||||
* @param title
|
||||
*/
|
||||
ogDescription?: ((description?: string) => string);
|
||||
/**
|
||||
* The twitter card to use.
|
||||
*
|
||||
* @default 'summary_large_image'
|
||||
*/
|
||||
twitterCard?: false | 'summary' | 'summary_large_image' | 'app' | 'player';
|
||||
}
|
||||
declare function InferSeoMetaPlugin(options?: InferSeoMetaPluginOptions): HeadPluginInput;
|
||||
|
||||
declare const PromisesPlugin: HeadPluginInput;
|
||||
|
||||
declare const SafeInputPlugin: HeadPluginInput;
|
||||
|
||||
declare const TemplateParamsPlugin: HeadPluginInput;
|
||||
|
||||
export { AliasSortingPlugin, CanonicalPlugin, DeprecationsPlugin, FlatMetaPlugin, InferSeoMetaPlugin, PromisesPlugin, SafeInputPlugin, TemplateParamsPlugin, defineHeadPlugin };
|
||||
65
client/node_modules/unhead/dist/plugins.d.ts
generated
vendored
Normal file
65
client/node_modules/unhead/dist/plugins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import { n as HeadPluginInput, U as Unhead, m as HeadPluginOptions } from './shared/unhead.Prz0gZXE.js';
|
||||
import 'hookable';
|
||||
|
||||
declare const AliasSortingPlugin: HeadPluginInput;
|
||||
|
||||
interface CanonicalPluginOptions {
|
||||
canonicalHost?: string;
|
||||
customResolver?: (url: string) => string;
|
||||
}
|
||||
/**
|
||||
* CanonicalPlugin resolves paths in tags that require a canonical host to be set.
|
||||
*
|
||||
* - Resolves paths in meta tags like `og:image` and `twitter:image`.
|
||||
* - Resolves paths in the `og:url` meta tag.
|
||||
* - Resolves paths in the `link` tag with the `rel="canonical"` attribute.
|
||||
* @example
|
||||
* const plugin = CanonicalPlugin({
|
||||
* canonicalHost: 'https://example.com',
|
||||
* customResolver: (path) => `/custom${path}`,
|
||||
* });
|
||||
*
|
||||
* // This plugin will resolve URLs in meta tags like:
|
||||
* // <meta property="og:image" content="/image.jpg">
|
||||
* // to:
|
||||
* // <meta property="og:image" content="https://example.com/image.jpg">
|
||||
*/
|
||||
declare function CanonicalPlugin(options: CanonicalPluginOptions): ((head: Unhead) => HeadPluginOptions & {
|
||||
key: string;
|
||||
});
|
||||
|
||||
declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
||||
|
||||
declare const DeprecationsPlugin: HeadPluginInput;
|
||||
|
||||
declare const FlatMetaPlugin: HeadPluginInput;
|
||||
|
||||
interface InferSeoMetaPluginOptions {
|
||||
/**
|
||||
* Transform the og title.
|
||||
*
|
||||
* @param title
|
||||
*/
|
||||
ogTitle?: ((title?: string) => string);
|
||||
/**
|
||||
* Transform the og description.
|
||||
*
|
||||
* @param title
|
||||
*/
|
||||
ogDescription?: ((description?: string) => string);
|
||||
/**
|
||||
* The twitter card to use.
|
||||
*
|
||||
* @default 'summary_large_image'
|
||||
*/
|
||||
twitterCard?: false | 'summary' | 'summary_large_image' | 'app' | 'player';
|
||||
}
|
||||
declare function InferSeoMetaPlugin(options?: InferSeoMetaPluginOptions): HeadPluginInput;
|
||||
|
||||
declare const PromisesPlugin: HeadPluginInput;
|
||||
|
||||
declare const SafeInputPlugin: HeadPluginInput;
|
||||
|
||||
declare const TemplateParamsPlugin: HeadPluginInput;
|
||||
|
||||
export { AliasSortingPlugin, CanonicalPlugin, DeprecationsPlugin, FlatMetaPlugin, InferSeoMetaPlugin, PromisesPlugin, SafeInputPlugin, TemplateParamsPlugin, defineHeadPlugin };
|
||||
101
client/node_modules/unhead/dist/plugins.mjs
generated
vendored
Normal file
101
client/node_modules/unhead/dist/plugins.mjs
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.Djo8ep_Y.mjs';
|
||||
import { d as defineHeadPlugin } from './shared/unhead.CApf5sj3.mjs';
|
||||
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.CApf5sj3.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
import './shared/unhead.BYvz9V1x.mjs';
|
||||
import './shared/unhead.DQc16pHI.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
|
||||
const META_TRANSFORMABLE_URL = [
|
||||
"og:url",
|
||||
"og:image",
|
||||
"og:image:secure_url",
|
||||
"twitter:image",
|
||||
"twitter:image:src",
|
||||
"og:video",
|
||||
"og:video:secure_url",
|
||||
"og:see_also"
|
||||
];
|
||||
function CanonicalPlugin(options) {
|
||||
return (head) => {
|
||||
let host = options.canonicalHost || (!head.ssr ? window.location.origin : "");
|
||||
if (!host.startsWith("http") && !host.startsWith("//")) {
|
||||
host = `https://${host}`;
|
||||
}
|
||||
host = new URL(host).origin;
|
||||
function resolvePath(path) {
|
||||
if (options?.customResolver) {
|
||||
return options.customResolver(path);
|
||||
}
|
||||
if (path.startsWith("http") || path.startsWith("//"))
|
||||
return path;
|
||||
try {
|
||||
return new URL(path, host).toString();
|
||||
} catch {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
return {
|
||||
key: "canonical",
|
||||
hooks: {
|
||||
"tags:resolve": (ctx) => {
|
||||
for (const tag of ctx.tags) {
|
||||
if (tag.tag === "meta" && (META_TRANSFORMABLE_URL.includes(tag.props?.property) || META_TRANSFORMABLE_URL.includes(tag.props?.name))) {
|
||||
tag.props.content = resolvePath(tag.props.content);
|
||||
} else if (tag.tag === "link" && tag.props.rel === "canonical") {
|
||||
tag.props.href = resolvePath(tag.props.href);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function InferSeoMetaPlugin(options = {}) {
|
||||
return defineHeadPlugin((head) => {
|
||||
head.push({
|
||||
meta: [
|
||||
{
|
||||
name: "twitter:card",
|
||||
content: options.twitterCard || "summary_large_image",
|
||||
tagPriority: "low"
|
||||
},
|
||||
{
|
||||
"property": "og:title",
|
||||
"tagPriority": "low",
|
||||
"data-infer": ""
|
||||
},
|
||||
{
|
||||
"property": "og:description",
|
||||
"tagPriority": "low",
|
||||
"data-infer": ""
|
||||
}
|
||||
]
|
||||
});
|
||||
return {
|
||||
key: "infer-seo-meta",
|
||||
hooks: {
|
||||
"tags:beforeResolve": ({ tagMap }) => {
|
||||
let title = head._titleTemplate || head._title;
|
||||
const ogTitle = tagMap.get("meta:og:title");
|
||||
if (typeof ogTitle?.props["data-infer"] !== "undefined") {
|
||||
if (typeof title === "function") {
|
||||
title = title(head._title);
|
||||
}
|
||||
ogTitle.props.content = options.ogTitle ? options.ogTitle(title) : title || "";
|
||||
ogTitle.processTemplateParams = true;
|
||||
}
|
||||
const description = tagMap.get("meta:description")?.props?.content;
|
||||
const ogDescription = tagMap.get("meta:og:description");
|
||||
if (typeof ogDescription?.props["data-infer"] !== "undefined") {
|
||||
ogDescription.props.content = options.ogDescription ? options.ogDescription(description) : description || "";
|
||||
ogDescription.processTemplateParams = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export { CanonicalPlugin, InferSeoMetaPlugin, defineHeadPlugin };
|
||||
8
client/node_modules/unhead/dist/scripts.d.mts
generated
vendored
Normal file
8
client/node_modules/unhead/dist/scripts.d.mts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { j as RecordingEntry } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { A as AsVoidFunctions, E as EventHandlerOptions, i as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { r as resolveScriptKey, u as useScript } from './shared/unhead.CnYfgE7E.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
|
||||
|
||||
export { RecordingEntry, createSpyProxy };
|
||||
8
client/node_modules/unhead/dist/scripts.d.ts
generated
vendored
Normal file
8
client/node_modules/unhead/dist/scripts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { j as RecordingEntry } from './shared/unhead.Prz0gZXE.js';
|
||||
export { A as AsVoidFunctions, E as EventHandlerOptions, i as ScriptInstance, h as UseFunctionType, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.Prz0gZXE.js';
|
||||
export { r as resolveScriptKey, u as useScript } from './shared/unhead.kTflSlNr.js';
|
||||
import 'hookable';
|
||||
|
||||
declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
|
||||
|
||||
export { RecordingEntry, createSpyProxy };
|
||||
30
client/node_modules/unhead/dist/scripts.mjs
generated
vendored
Normal file
30
client/node_modules/unhead/dist/scripts.mjs
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
export { r as resolveScriptKey, u as useScript } from './shared/unhead.B578PsDV.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
|
||||
function createSpyProxy(target, onApply) {
|
||||
const stack = [];
|
||||
let stackIdx = -1;
|
||||
const handler = (reuseStack = false) => ({
|
||||
get(_, prop, receiver) {
|
||||
if (!reuseStack) {
|
||||
stackIdx++;
|
||||
stack[stackIdx] = [];
|
||||
}
|
||||
const v = Reflect.get(_, prop, receiver);
|
||||
if (typeof v === "object" || typeof v === "function") {
|
||||
stack[stackIdx].push({ type: "get", key: prop });
|
||||
return new Proxy(v, handler(true));
|
||||
}
|
||||
stack[stackIdx].push({ type: "get", key: prop, value: v });
|
||||
return v;
|
||||
},
|
||||
apply(_, __, args) {
|
||||
stack[stackIdx].push({ type: "apply", key: "", args });
|
||||
onApply(stack);
|
||||
return Reflect.apply(_, __, args);
|
||||
}
|
||||
});
|
||||
return new Proxy(target, handler());
|
||||
}
|
||||
|
||||
export { createSpyProxy };
|
||||
52
client/node_modules/unhead/dist/server.d.mts
generated
vendored
Normal file
52
client/node_modules/unhead/dist/server.d.mts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { R as ResolvableHead, q as CreateServerHeadOptions, U as Unhead, v as RenderSSRHeadOptions, au as HeadTag } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { u as SSRHeadPayload } from './shared/unhead.Prz0gZXE.mjs';
|
||||
import { PreparedHtmlTemplate } from './parser.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
|
||||
|
||||
declare function renderSSRHead(head: Unhead<any>, options?: RenderSSRHeadOptions): Promise<{
|
||||
headTags: string;
|
||||
bodyTags: string;
|
||||
bodyTagsOpen: string;
|
||||
htmlAttrs: string;
|
||||
bodyAttrs: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Transform an HTML template string by extracting any head tags and attributes from it, pushing them to Unhead,
|
||||
* and injecting the resulting head tags back into the HTML.
|
||||
* Uses optimized parsing and index-based HTML construction for best performance.
|
||||
*/
|
||||
declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
||||
/**
|
||||
* Transform an HTML template string by injecting head tags managed by Unhead.
|
||||
*
|
||||
* The differs to `transformHtmlTemplate` in that it does not extract and push any head input from the HTML, resulting
|
||||
* in much more performant execution if you don't need that feature.
|
||||
*
|
||||
* However, this also means that any head tags or attributes already present in the HTML may be duplicated or
|
||||
* ordered incorrectly, so use with caution.
|
||||
*/
|
||||
declare function transformHtmlTemplateRaw(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* @deprecated use `parseHtmlForUnheadExtraction` from `unhead/parser` instead
|
||||
* @param html
|
||||
*/
|
||||
declare function extractUnheadInputFromHtml(html: string): PreparedHtmlTemplate;
|
||||
|
||||
declare function propsToString(props: Record<string, any>): string;
|
||||
|
||||
declare function ssrRenderTags<T extends HeadTag>(tags: T[], options?: RenderSSRHeadOptions): {
|
||||
headTags: string;
|
||||
bodyTags: string;
|
||||
bodyTagsOpen: string;
|
||||
htmlAttrs: string;
|
||||
bodyAttrs: string;
|
||||
};
|
||||
|
||||
declare function escapeHtml(str: string): string;
|
||||
declare function tagToString<T extends HeadTag>(tag: T): string;
|
||||
|
||||
export { CreateServerHeadOptions, Unhead, createHead, escapeHtml, extractUnheadInputFromHtml, propsToString, renderSSRHead, ssrRenderTags, tagToString, transformHtmlTemplate, transformHtmlTemplateRaw };
|
||||
52
client/node_modules/unhead/dist/server.d.ts
generated
vendored
Normal file
52
client/node_modules/unhead/dist/server.d.ts
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { R as ResolvableHead, q as CreateServerHeadOptions, U as Unhead, v as RenderSSRHeadOptions, au as HeadTag } from './shared/unhead.Prz0gZXE.js';
|
||||
export { u as SSRHeadPayload } from './shared/unhead.Prz0gZXE.js';
|
||||
import { PreparedHtmlTemplate } from './parser.js';
|
||||
import 'hookable';
|
||||
|
||||
declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
|
||||
|
||||
declare function renderSSRHead(head: Unhead<any>, options?: RenderSSRHeadOptions): Promise<{
|
||||
headTags: string;
|
||||
bodyTags: string;
|
||||
bodyTagsOpen: string;
|
||||
htmlAttrs: string;
|
||||
bodyAttrs: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Transform an HTML template string by extracting any head tags and attributes from it, pushing them to Unhead,
|
||||
* and injecting the resulting head tags back into the HTML.
|
||||
* Uses optimized parsing and index-based HTML construction for best performance.
|
||||
*/
|
||||
declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
||||
/**
|
||||
* Transform an HTML template string by injecting head tags managed by Unhead.
|
||||
*
|
||||
* The differs to `transformHtmlTemplate` in that it does not extract and push any head input from the HTML, resulting
|
||||
* in much more performant execution if you don't need that feature.
|
||||
*
|
||||
* However, this also means that any head tags or attributes already present in the HTML may be duplicated or
|
||||
* ordered incorrectly, so use with caution.
|
||||
*/
|
||||
declare function transformHtmlTemplateRaw(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
||||
|
||||
/**
|
||||
* @deprecated use `parseHtmlForUnheadExtraction` from `unhead/parser` instead
|
||||
* @param html
|
||||
*/
|
||||
declare function extractUnheadInputFromHtml(html: string): PreparedHtmlTemplate;
|
||||
|
||||
declare function propsToString(props: Record<string, any>): string;
|
||||
|
||||
declare function ssrRenderTags<T extends HeadTag>(tags: T[], options?: RenderSSRHeadOptions): {
|
||||
headTags: string;
|
||||
bodyTags: string;
|
||||
bodyTagsOpen: string;
|
||||
htmlAttrs: string;
|
||||
bodyAttrs: string;
|
||||
};
|
||||
|
||||
declare function escapeHtml(str: string): string;
|
||||
declare function tagToString<T extends HeadTag>(tag: T): string;
|
||||
|
||||
export { CreateServerHeadOptions, Unhead, createHead, escapeHtml, extractUnheadInputFromHtml, propsToString, renderSSRHead, ssrRenderTags, tagToString, transformHtmlTemplate, transformHtmlTemplateRaw };
|
||||
182
client/node_modules/unhead/dist/server.mjs
generated
vendored
Normal file
182
client/node_modules/unhead/dist/server.mjs
generated
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
||||
import { T as TagsWithInnerContent, S as SelfClosingTags } from './shared/unhead.yem5I2v_.mjs';
|
||||
import { parseHtmlForUnheadExtraction } from './parser.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.BpRRHAhY.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
const unhead = createUnhead({
|
||||
...options,
|
||||
// @ts-expect-error untyped
|
||||
document: false,
|
||||
propResolvers: [
|
||||
...options.propResolvers || [],
|
||||
(k, v) => {
|
||||
if (k && k.startsWith("on") && typeof v === "function") {
|
||||
return `this.dataset.${k}fired = true`;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
],
|
||||
init: [
|
||||
options.disableDefaults ? void 0 : {
|
||||
htmlAttrs: {
|
||||
lang: "en"
|
||||
},
|
||||
meta: [
|
||||
{
|
||||
charset: "utf-8"
|
||||
},
|
||||
{
|
||||
name: "viewport",
|
||||
content: "width=device-width, initial-scale=1"
|
||||
}
|
||||
]
|
||||
},
|
||||
...options.init || []
|
||||
]
|
||||
});
|
||||
unhead._ssrPayload = {};
|
||||
unhead.use({
|
||||
key: "server",
|
||||
hooks: {
|
||||
"tags:resolve": function(ctx) {
|
||||
const title = ctx.tagMap.get("title");
|
||||
const titleTemplate = ctx.tagMap.get("titleTemplate");
|
||||
let payload = {
|
||||
title: title?.mode === "server" ? unhead._title : void 0,
|
||||
titleTemplate: titleTemplate?.mode === "server" ? unhead._titleTemplate : void 0
|
||||
};
|
||||
if (Object.keys(unhead._ssrPayload || {}).length > 0) {
|
||||
payload = {
|
||||
...unhead._ssrPayload,
|
||||
...payload
|
||||
};
|
||||
}
|
||||
if (Object.values(payload).some(Boolean)) {
|
||||
ctx.tags.push({
|
||||
tag: "script",
|
||||
innerHTML: JSON.stringify(payload),
|
||||
props: { id: "unhead:payload", type: "application/json" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return unhead;
|
||||
}
|
||||
|
||||
function extractUnheadInputFromHtml(html) {
|
||||
return parseHtmlForUnheadExtraction(html);
|
||||
}
|
||||
|
||||
function encodeAttribute(value) {
|
||||
return String(value).replace(/"/g, """);
|
||||
}
|
||||
function propsToString(props) {
|
||||
let attrs = "";
|
||||
for (const key in props) {
|
||||
if (!Object.hasOwn(props, key))
|
||||
continue;
|
||||
let value = props[key];
|
||||
if ((key === "class" || key === "style") && typeof value !== "string") {
|
||||
value = key === "class" ? Array.from(value).join(" ") : Array.from(value).map(([k, v]) => `${k}:${v}`).join(";");
|
||||
}
|
||||
if (value !== false && value !== null) {
|
||||
attrs += value === true ? ` ${key}` : ` ${key}="${encodeAttribute(value)}"`;
|
||||
}
|
||||
}
|
||||
return attrs;
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
return str.replace(/[&<>"'/]/g, (char) => {
|
||||
switch (char) {
|
||||
case "&":
|
||||
return "&";
|
||||
case "<":
|
||||
return "<";
|
||||
case ">":
|
||||
return ">";
|
||||
case '"':
|
||||
return """;
|
||||
case "'":
|
||||
return "'";
|
||||
case "/":
|
||||
return "/";
|
||||
default:
|
||||
return char;
|
||||
}
|
||||
});
|
||||
}
|
||||
function tagToString(tag) {
|
||||
const attrs = propsToString(tag.props);
|
||||
const openTag = `<${tag.tag}${attrs}>`;
|
||||
if (!TagsWithInnerContent.has(tag.tag))
|
||||
return SelfClosingTags.has(tag.tag) ? openTag : `${openTag}</${tag.tag}>`;
|
||||
let content = String(tag.textContent || tag.innerHTML || "");
|
||||
content = tag.tag === "title" ? escapeHtml(content) : content.replace(new RegExp(`</${tag.tag}`, "gi"), `<\\/${tag.tag}`);
|
||||
return SelfClosingTags.has(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
|
||||
}
|
||||
|
||||
function ssrRenderTags(tags, options) {
|
||||
const schema = { htmlAttrs: {}, bodyAttrs: {}, tags: { head: "", bodyClose: "", bodyOpen: "" } };
|
||||
const lineBreaks = !options?.omitLineBreaks ? "\n" : "";
|
||||
for (const tag of tags) {
|
||||
if (tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs") {
|
||||
Object.assign(schema[tag.tag], tag.props);
|
||||
continue;
|
||||
}
|
||||
const s = tagToString(tag);
|
||||
const tagPosition = tag.tagPosition || "head";
|
||||
schema.tags[tagPosition] += schema.tags[tagPosition] ? `${lineBreaks}${s}` : s;
|
||||
}
|
||||
return {
|
||||
headTags: schema.tags.head,
|
||||
bodyTags: schema.tags.bodyClose,
|
||||
bodyTagsOpen: schema.tags.bodyOpen,
|
||||
htmlAttrs: propsToString(schema.htmlAttrs),
|
||||
bodyAttrs: propsToString(schema.bodyAttrs)
|
||||
};
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
async function renderSSRHead(head, options) {
|
||||
const beforeRenderCtx = { shouldRender: true };
|
||||
await head.hooks.callHook("ssr:beforeRender", beforeRenderCtx);
|
||||
if (!beforeRenderCtx.shouldRender) {
|
||||
return {
|
||||
headTags: "",
|
||||
bodyTags: "",
|
||||
bodyTagsOpen: "",
|
||||
htmlAttrs: "",
|
||||
bodyAttrs: ""
|
||||
};
|
||||
}
|
||||
const ctx = { tags: options?.resolvedTags || await head.resolveTags() };
|
||||
await head.hooks.callHook("ssr:render", ctx);
|
||||
const html = ssrRenderTags(ctx.tags, options);
|
||||
const renderCtx = { tags: ctx.tags, html };
|
||||
await head.hooks.callHook("ssr:rendered", renderCtx);
|
||||
return renderCtx.html;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
async function transformHtmlTemplate(head, html, options) {
|
||||
const { parseHtmlForUnheadExtraction, applyHeadToHtml } = await import('./parser.mjs');
|
||||
const template = parseHtmlForUnheadExtraction(html);
|
||||
head.push(template.input, { _index: 0 });
|
||||
const headHtml = await renderSSRHead(head, options);
|
||||
return applyHeadToHtml(template, headHtml);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
async function transformHtmlTemplateRaw(head, html, options) {
|
||||
const { parseHtmlForIndexes, applyHeadToHtml } = await import('./parser.mjs');
|
||||
const headHtml = await renderSSRHead(head, options);
|
||||
const template = parseHtmlForIndexes(html);
|
||||
return applyHeadToHtml(template, headHtml);
|
||||
}
|
||||
|
||||
export { createHead, escapeHtml, extractUnheadInputFromHtml, propsToString, renderSSRHead, ssrRenderTags, tagToString, transformHtmlTemplate, transformHtmlTemplateRaw };
|
||||
266
client/node_modules/unhead/dist/shared/unhead.B578PsDV.mjs
generated
vendored
Normal file
266
client/node_modules/unhead/dist/shared/unhead.B578PsDV.mjs
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
import { b as ScriptNetworkEvents } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
function createNoopedRecordingProxy(instance = {}) {
|
||||
const stack = [];
|
||||
let stackIdx = -1;
|
||||
const handler = (reuseStack = false) => ({
|
||||
get(_, prop, receiver) {
|
||||
if (!reuseStack) {
|
||||
const v = Reflect.get(_, prop, receiver);
|
||||
if (typeof v !== "undefined") {
|
||||
return v;
|
||||
}
|
||||
stackIdx++;
|
||||
stack[stackIdx] = [];
|
||||
}
|
||||
stack[stackIdx].push({ type: "get", key: prop });
|
||||
return new Proxy(() => {
|
||||
}, handler(true));
|
||||
},
|
||||
apply(_, __, args) {
|
||||
stack[stackIdx].push({ type: "apply", key: "", args });
|
||||
return void 0;
|
||||
}
|
||||
});
|
||||
return {
|
||||
proxy: new Proxy(instance || {}, handler()),
|
||||
stack
|
||||
};
|
||||
}
|
||||
function createForwardingProxy(target) {
|
||||
const handler = {
|
||||
get(_, prop, receiver) {
|
||||
const v = Reflect.get(_, prop, receiver);
|
||||
if (typeof v === "object") {
|
||||
return new Proxy(v, handler);
|
||||
}
|
||||
return v;
|
||||
},
|
||||
apply(_, __, args) {
|
||||
Reflect.apply(_, __, args);
|
||||
return void 0;
|
||||
}
|
||||
};
|
||||
return new Proxy(target, handler);
|
||||
}
|
||||
function replayProxyRecordings(target, stack) {
|
||||
stack.forEach((recordings) => {
|
||||
let context = target;
|
||||
let prevContext = target;
|
||||
recordings.forEach(({ type, key, args }) => {
|
||||
if (type === "get") {
|
||||
prevContext = context;
|
||||
context = context[key];
|
||||
} else if (type === "apply") {
|
||||
context = context.call(prevContext, ...args);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function resolveScriptKey(input) {
|
||||
return input.key || input.src || (typeof input.innerHTML === "string" ? input.innerHTML : "");
|
||||
}
|
||||
const PreconnectServerModes = ["preconnect", "dns-prefetch"];
|
||||
function useScript(head, _input, _options) {
|
||||
const input = typeof _input === "string" ? { src: _input } : _input;
|
||||
const options = _options || {};
|
||||
const id = resolveScriptKey(input);
|
||||
const prevScript = head._scripts?.[id];
|
||||
if (prevScript) {
|
||||
prevScript.setupTriggerHandler(options.trigger);
|
||||
return prevScript;
|
||||
}
|
||||
options.beforeInit?.();
|
||||
const syncStatus = (s) => {
|
||||
script.status = s;
|
||||
head.hooks.callHook(`script:updated`, hookCtx);
|
||||
};
|
||||
ScriptNetworkEvents.forEach((fn) => {
|
||||
const k = fn;
|
||||
const _fn = typeof input[k] === "function" ? input[k].bind(options.eventContext) : null;
|
||||
input[k] = (e) => {
|
||||
syncStatus(fn === "onload" ? "loaded" : fn === "onerror" ? "error" : "loading");
|
||||
_fn?.(e);
|
||||
};
|
||||
});
|
||||
const _cbs = { loaded: [], error: [] };
|
||||
const _uniqueCbs = /* @__PURE__ */ new Set();
|
||||
const _registerCb = (key, cb, options2) => {
|
||||
if (head.ssr) {
|
||||
return;
|
||||
}
|
||||
if (options2?.key) {
|
||||
const key2 = `${options2?.key}:${options2.key}`;
|
||||
if (_uniqueCbs.has(key2)) {
|
||||
return;
|
||||
}
|
||||
_uniqueCbs.add(key2);
|
||||
}
|
||||
if (_cbs[key]) {
|
||||
const i = _cbs[key].push(cb);
|
||||
return () => _cbs[key]?.splice(i - 1, 1);
|
||||
}
|
||||
cb(script.instance);
|
||||
return () => {
|
||||
};
|
||||
};
|
||||
const loadPromise = new Promise((resolve) => {
|
||||
if (head.ssr)
|
||||
return;
|
||||
const emit = (api) => requestAnimationFrame(() => resolve(api));
|
||||
const _ = head.hooks.hook("script:updated", ({ script: script2 }) => {
|
||||
const status = script2.status;
|
||||
if (script2.id === id && (status === "loaded" || status === "error")) {
|
||||
if (status === "loaded") {
|
||||
if (typeof options.use === "function") {
|
||||
const api = options.use();
|
||||
if (api) {
|
||||
emit(api);
|
||||
}
|
||||
} else {
|
||||
emit({});
|
||||
}
|
||||
} else if (status === "error") {
|
||||
resolve(false);
|
||||
}
|
||||
_();
|
||||
}
|
||||
});
|
||||
});
|
||||
const script = {
|
||||
_loadPromise: loadPromise,
|
||||
instance: !head.ssr && options?.use?.() || null,
|
||||
proxy: null,
|
||||
id,
|
||||
status: "awaitingLoad",
|
||||
remove() {
|
||||
script._triggerAbortController?.abort();
|
||||
script._triggerPromises = [];
|
||||
script._warmupEl?.dispose();
|
||||
if (script.entry) {
|
||||
script.entry.dispose();
|
||||
script.entry = void 0;
|
||||
syncStatus("removed");
|
||||
delete head._scripts?.[id];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
warmup(rel) {
|
||||
const { src } = input;
|
||||
const isCrossOrigin = !src.startsWith("/") || src.startsWith("//");
|
||||
const isPreconnect = rel && PreconnectServerModes.includes(rel);
|
||||
let href = src;
|
||||
if (!rel || isPreconnect && !isCrossOrigin) {
|
||||
return;
|
||||
}
|
||||
if (isPreconnect) {
|
||||
const $url = new URL(src);
|
||||
href = `${$url.protocol}//${$url.host}`;
|
||||
}
|
||||
const link = {
|
||||
href,
|
||||
rel,
|
||||
crossorigin: typeof input.crossorigin !== "undefined" ? input.crossorigin : isCrossOrigin ? "anonymous" : void 0,
|
||||
referrerpolicy: typeof input.referrerpolicy !== "undefined" ? input.referrerpolicy : isCrossOrigin ? "no-referrer" : void 0,
|
||||
fetchpriority: typeof input.fetchpriority !== "undefined" ? input.fetchpriority : "low",
|
||||
integrity: input.integrity,
|
||||
as: rel === "preload" ? "script" : void 0
|
||||
};
|
||||
script._warmupEl = head.push({ link: [link] }, { head, tagPriority: "high" });
|
||||
return script._warmupEl;
|
||||
},
|
||||
load(cb) {
|
||||
script._triggerAbortController?.abort();
|
||||
script._triggerPromises = [];
|
||||
if (!script.entry) {
|
||||
syncStatus("loading");
|
||||
const defaults = {
|
||||
defer: true,
|
||||
fetchpriority: "low"
|
||||
};
|
||||
if (input.src && (input.src.startsWith("http") || input.src.startsWith("//"))) {
|
||||
defaults.crossorigin = "anonymous";
|
||||
defaults.referrerpolicy = "no-referrer";
|
||||
}
|
||||
script.entry = head.push({
|
||||
script: [{ ...defaults, ...input }]
|
||||
}, options);
|
||||
}
|
||||
if (cb)
|
||||
_registerCb("loaded", cb);
|
||||
return loadPromise;
|
||||
},
|
||||
onLoaded(cb, options2) {
|
||||
return _registerCb("loaded", cb, options2);
|
||||
},
|
||||
onError(cb, options2) {
|
||||
return _registerCb("error", cb, options2);
|
||||
},
|
||||
setupTriggerHandler(trigger) {
|
||||
if (script.status !== "awaitingLoad") {
|
||||
return;
|
||||
}
|
||||
if ((typeof trigger === "undefined" || trigger === "client") && !head.ssr || trigger === "server") {
|
||||
script.load();
|
||||
} else if (trigger instanceof Promise) {
|
||||
if (head.ssr) {
|
||||
return;
|
||||
}
|
||||
if (!script._triggerAbortController) {
|
||||
script._triggerAbortController = new AbortController();
|
||||
script._triggerAbortPromise = new Promise((resolve) => {
|
||||
script._triggerAbortController.signal.addEventListener("abort", () => {
|
||||
script._triggerAbortController = null;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
script._triggerPromises = script._triggerPromises || [];
|
||||
const idx = script._triggerPromises.push(Promise.race([
|
||||
trigger.then((v) => typeof v === "undefined" || v ? script.load : void 0),
|
||||
script._triggerAbortPromise
|
||||
]).catch(() => {
|
||||
}).then((res) => {
|
||||
res?.();
|
||||
}).finally(() => {
|
||||
script._triggerPromises?.splice(idx, 1);
|
||||
}));
|
||||
} else if (typeof trigger === "function") {
|
||||
trigger(script.load);
|
||||
}
|
||||
},
|
||||
_cbs
|
||||
};
|
||||
loadPromise.then((api) => {
|
||||
if (api !== false) {
|
||||
script.instance = api;
|
||||
_cbs.loaded?.forEach((cb) => cb(api));
|
||||
_cbs.loaded = null;
|
||||
} else {
|
||||
_cbs.error?.forEach((cb) => cb());
|
||||
_cbs.error = null;
|
||||
}
|
||||
});
|
||||
const hookCtx = { script };
|
||||
script.setupTriggerHandler(options.trigger);
|
||||
if (options.use) {
|
||||
const { proxy, stack } = createNoopedRecordingProxy(head.ssr ? {} : options.use() || {});
|
||||
script.proxy = proxy;
|
||||
script.onLoaded((instance) => {
|
||||
replayProxyRecordings(instance, stack);
|
||||
script.proxy = createForwardingProxy(instance);
|
||||
});
|
||||
}
|
||||
if (!options.warmupStrategy && (typeof options.trigger === "undefined" || options.trigger === "client")) {
|
||||
options.warmupStrategy = "preload";
|
||||
}
|
||||
if (options.warmupStrategy) {
|
||||
script.warmup(options.warmupStrategy);
|
||||
}
|
||||
head._scripts = Object.assign(head._scripts || {}, { [id]: script });
|
||||
return script;
|
||||
}
|
||||
|
||||
export { resolveScriptKey as r, useScript as u };
|
||||
44
client/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs
generated
vendored
Normal file
44
client/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { S as SafeInputPlugin, F as FlatMetaPlugin } from './unhead.CApf5sj3.mjs';
|
||||
|
||||
function useHead(unhead, input, options = {}) {
|
||||
return unhead.push(input || {}, options);
|
||||
}
|
||||
function useHeadSafe(unhead, input = {}, options = {}) {
|
||||
unhead.use(SafeInputPlugin);
|
||||
return useHead(unhead, input, Object.assign(options, { _safe: true }));
|
||||
}
|
||||
function useSeoMeta(unhead, input = {}, options) {
|
||||
unhead.use(FlatMetaPlugin);
|
||||
function normalize(input2) {
|
||||
if (input2._flatMeta) {
|
||||
return input2;
|
||||
}
|
||||
const { title, titleTemplate, ...meta } = input2 || {};
|
||||
return {
|
||||
title,
|
||||
titleTemplate,
|
||||
_flatMeta: meta
|
||||
};
|
||||
}
|
||||
const entry = unhead.push(normalize(input), options);
|
||||
const corePatch = entry.patch;
|
||||
if (!entry.__patched) {
|
||||
entry.patch = (input2) => corePatch(normalize(input2));
|
||||
entry.__patched = true;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
function useServerHead(unhead, input = {}, options = {}) {
|
||||
options.mode = "server";
|
||||
return unhead.push(input, options);
|
||||
}
|
||||
function useServerHeadSafe(unhead, input = {}, options = {}) {
|
||||
options.mode = "server";
|
||||
return useHeadSafe(unhead, input, { ...options, mode: "server" });
|
||||
}
|
||||
function useServerSeoMeta(unhead, input = {}, options) {
|
||||
options.mode = "server";
|
||||
return useSeoMeta(unhead, input, { ...options, mode: "server" });
|
||||
}
|
||||
|
||||
export { useHeadSafe as a, useSeoMeta as b, useServerHead as c, useServerHeadSafe as d, useServerSeoMeta as e, useHead as u };
|
||||
43
client/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs
generated
vendored
Normal file
43
client/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
const SepSub = "%separator";
|
||||
function sub(p, token, isJson = false) {
|
||||
let val;
|
||||
if (token === "s" || token === "pageTitle") {
|
||||
val = p.pageTitle;
|
||||
} else if (token.includes(".")) {
|
||||
const dotIndex = token.indexOf(".");
|
||||
val = p[token.substring(0, dotIndex)]?.[token.substring(dotIndex + 1)];
|
||||
} else {
|
||||
val = p[token];
|
||||
}
|
||||
if (val !== void 0) {
|
||||
return isJson ? (val || "").replace(/\\/g, "\\\\").replace(/</g, "\\u003C").replace(/"/g, '\\"') : val || "";
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function processTemplateParams(s, p, sep, isJson = false) {
|
||||
if (typeof s !== "string" || !s.includes("%"))
|
||||
return s;
|
||||
let decoded = s;
|
||||
try {
|
||||
decoded = decodeURI(s);
|
||||
} catch {
|
||||
}
|
||||
const tokens = decoded.match(/%\w+(?:\.\w+)?/g);
|
||||
if (!tokens) {
|
||||
return s;
|
||||
}
|
||||
const hasSepSub = s.includes(SepSub);
|
||||
s = s.replace(/%\w+(?:\.\w+)?/g, (token) => {
|
||||
if (token === SepSub || !tokens.includes(token)) {
|
||||
return token;
|
||||
}
|
||||
const re = sub(p, token.slice(1), isJson);
|
||||
return re !== void 0 ? re : token;
|
||||
}).trim();
|
||||
if (hasSepSub) {
|
||||
s = s.split(SepSub).map((part) => part.trim()).filter((part) => part !== "").join(sep ? ` ${sep} ` : " ");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
export { processTemplateParams as p };
|
||||
194
client/node_modules/unhead/dist/shared/unhead.BpRRHAhY.mjs
generated
vendored
Normal file
194
client/node_modules/unhead/dist/shared/unhead.BpRRHAhY.mjs
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
import { U as UniqueTags, T as TagsWithInnerContent, M as MetaTagsArrayable, a as TagConfigKeys, D as DupeableTags } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
const allowedMetaProperties = ["name", "property", "http-equiv"];
|
||||
const StandardSingleMetaTags = /* @__PURE__ */ new Set([
|
||||
"viewport",
|
||||
"description",
|
||||
"keywords",
|
||||
"robots"
|
||||
]);
|
||||
function isMetaArrayDupeKey(v) {
|
||||
const parts = v.split(":");
|
||||
if (!parts.length)
|
||||
return false;
|
||||
return MetaTagsArrayable.has(parts[1]);
|
||||
}
|
||||
function dedupeKey(tag) {
|
||||
const { props, tag: name } = tag;
|
||||
if (UniqueTags.has(name))
|
||||
return name;
|
||||
if (name === "link" && props.rel === "canonical")
|
||||
return "canonical";
|
||||
if (props.charset)
|
||||
return "charset";
|
||||
if (tag.tag === "meta") {
|
||||
for (const n of allowedMetaProperties) {
|
||||
if (props[n] !== void 0) {
|
||||
const propValue = props[n];
|
||||
const isStructured = propValue.includes(":");
|
||||
const isStandardSingle = StandardSingleMetaTags.has(propValue);
|
||||
const shouldAlwaysDedupe = isStructured || isStandardSingle;
|
||||
const keyPart = !shouldAlwaysDedupe && tag.key ? `:key:${tag.key}` : "";
|
||||
return `${name}:${propValue}${keyPart}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tag.key) {
|
||||
return `${name}:key:${tag.key}`;
|
||||
}
|
||||
if (props.id) {
|
||||
return `${name}:id:${props.id}`;
|
||||
}
|
||||
if (TagsWithInnerContent.has(name)) {
|
||||
const v = tag.textContent || tag.innerHTML;
|
||||
if (v) {
|
||||
return `${name}:content:${v}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
function hashTag(tag) {
|
||||
const dedupe = tag._h || tag._d;
|
||||
if (dedupe)
|
||||
return dedupe;
|
||||
const inner = tag.textContent || tag.innerHTML;
|
||||
if (inner)
|
||||
return inner;
|
||||
return `${tag.tag}:${Object.entries(tag.props).map(([k, v]) => `${k}:${String(v)}`).join(",")}`;
|
||||
}
|
||||
|
||||
function walkResolver(val, resolve, key) {
|
||||
const type = typeof val;
|
||||
if (type === "function") {
|
||||
if (!key || key !== "titleTemplate" && !(key[0] === "o" && key[1] === "n")) {
|
||||
val = val();
|
||||
}
|
||||
}
|
||||
let v;
|
||||
if (resolve) {
|
||||
v = resolve(key, val);
|
||||
}
|
||||
if (Array.isArray(v)) {
|
||||
return v.map((r) => walkResolver(r, resolve));
|
||||
}
|
||||
if (v?.constructor === Object) {
|
||||
const next = {};
|
||||
for (const key2 of Object.keys(v)) {
|
||||
next[key2] = walkResolver(v[key2], resolve, key2);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
function normalizeStyleClassProps(key, value) {
|
||||
const store = key === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
|
||||
function processValue(rawValue) {
|
||||
const value2 = rawValue.trim();
|
||||
if (!value2)
|
||||
return;
|
||||
if (key === "style") {
|
||||
const [k, ...v] = value2.split(":").map((s) => s.trim());
|
||||
if (k && v.length)
|
||||
store.set(k, v.join(":"));
|
||||
} else {
|
||||
value2.split(" ").filter(Boolean).forEach((c) => store.add(c));
|
||||
}
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
key === "style" ? value.split(";").forEach(processValue) : processValue(value);
|
||||
} else if (Array.isArray(value)) {
|
||||
value.forEach((item) => processValue(item));
|
||||
} else if (value && typeof value === "object") {
|
||||
Object.entries(value).forEach(([k, v]) => {
|
||||
if (v && v !== "false") {
|
||||
key === "style" ? store.set(k.trim(), v) : processValue(k);
|
||||
}
|
||||
});
|
||||
}
|
||||
return store;
|
||||
}
|
||||
function normalizeProps(tag, input) {
|
||||
tag.props = tag.props || {};
|
||||
if (!input) {
|
||||
return tag;
|
||||
}
|
||||
if (tag.tag === "templateParams") {
|
||||
tag.props = input;
|
||||
return tag;
|
||||
}
|
||||
Object.entries(input).forEach(([key, value]) => {
|
||||
if (value === null) {
|
||||
tag.props[key] = null;
|
||||
return;
|
||||
}
|
||||
if (key === "class" || key === "style") {
|
||||
tag.props[key] = normalizeStyleClassProps(key, value);
|
||||
return;
|
||||
}
|
||||
if (TagConfigKeys.has(key)) {
|
||||
if (["textContent", "innerHTML"].includes(key) && typeof value === "object") {
|
||||
let type = input.type;
|
||||
if (!input.type) {
|
||||
type = "application/json";
|
||||
}
|
||||
if (!type?.endsWith("json") && type !== "speculationrules") {
|
||||
return;
|
||||
}
|
||||
input.type = type;
|
||||
tag.props.type = type;
|
||||
tag[key] = JSON.stringify(value);
|
||||
} else {
|
||||
tag[key] = value;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const strValue = String(value);
|
||||
const isDataKey = key.startsWith("data-");
|
||||
if (strValue === "true" || strValue === "") {
|
||||
tag.props[key] = isDataKey ? strValue : true;
|
||||
} else if (!value && isDataKey && strValue === "false") {
|
||||
tag.props[key] = "false";
|
||||
} else if (value !== void 0) {
|
||||
tag.props[key] = value;
|
||||
}
|
||||
});
|
||||
return tag;
|
||||
}
|
||||
function normalizeTag(tagName, _input) {
|
||||
const input = typeof _input === "object" && typeof _input !== "function" ? _input : { [tagName === "script" || tagName === "noscript" || tagName === "style" ? "innerHTML" : "textContent"]: _input };
|
||||
const tag = normalizeProps({ tag: tagName, props: {} }, input);
|
||||
if (tag.key && DupeableTags.has(tag.tag)) {
|
||||
tag.props["data-hid"] = tag._h = tag.key;
|
||||
}
|
||||
if (tag.tag === "script" && typeof tag.innerHTML === "object") {
|
||||
tag.innerHTML = JSON.stringify(tag.innerHTML);
|
||||
tag.props.type = tag.props.type || "application/json";
|
||||
}
|
||||
return Array.isArray(tag.props.content) ? tag.props.content.map((v) => ({ ...tag, props: { ...tag.props, content: v } })) : tag;
|
||||
}
|
||||
function normalizeEntryToTags(input, propResolvers) {
|
||||
if (!input) {
|
||||
return [];
|
||||
}
|
||||
if (typeof input === "function") {
|
||||
input = input();
|
||||
}
|
||||
const resolvers = (key, val) => {
|
||||
for (let i = 0; i < propResolvers.length; i++) {
|
||||
val = propResolvers[i](key, val);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
input = resolvers(void 0, input);
|
||||
const tags = [];
|
||||
input = walkResolver(input, resolvers);
|
||||
Object.entries(input || {}).forEach(([key, value]) => {
|
||||
if (value === void 0)
|
||||
return;
|
||||
for (const v of Array.isArray(value) ? value : [value])
|
||||
tags.push(normalizeTag(key, v));
|
||||
});
|
||||
return tags.flat();
|
||||
}
|
||||
|
||||
export { normalizeProps as a, dedupeKey as d, hashTag as h, isMetaArrayDupeKey as i, normalizeEntryToTags as n, walkResolver as w };
|
||||
148
client/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs
generated
vendored
Normal file
148
client/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
import { u as unpackMeta } from './unhead.DQc16pHI.mjs';
|
||||
|
||||
function defineHeadPlugin(plugin) {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
const FlatMetaPlugin = /* @__PURE__ */ defineHeadPlugin({
|
||||
key: "flatMeta",
|
||||
hooks: {
|
||||
"entries:normalize": (ctx) => {
|
||||
const tagsToAdd = [];
|
||||
ctx.tags = ctx.tags.map((t) => {
|
||||
if (t.tag !== "_flatMeta") {
|
||||
return t;
|
||||
}
|
||||
tagsToAdd.push(unpackMeta(t.props).map((p) => ({
|
||||
...t,
|
||||
tag: "meta",
|
||||
props: p
|
||||
})));
|
||||
return false;
|
||||
}).filter(Boolean).concat(...tagsToAdd);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const WhitelistAttributes = {
|
||||
htmlAttrs: /* @__PURE__ */ new Set(["class", "style", "lang", "dir"]),
|
||||
bodyAttrs: /* @__PURE__ */ new Set(["class", "style"]),
|
||||
meta: /* @__PURE__ */ new Set(["name", "property", "charset", "content", "media"]),
|
||||
noscript: /* @__PURE__ */ new Set(["textContent"]),
|
||||
style: /* @__PURE__ */ new Set(["media", "textContent", "nonce", "title", "blocking"]),
|
||||
script: /* @__PURE__ */ new Set(["type", "textContent", "nonce", "blocking"]),
|
||||
link: /* @__PURE__ */ new Set(["color", "crossorigin", "fetchpriority", "href", "hreflang", "imagesrcset", "imagesizes", "integrity", "media", "referrerpolicy", "rel", "sizes", "type"])
|
||||
};
|
||||
function acceptDataAttrs(value) {
|
||||
return Object.fromEntries(
|
||||
Object.entries(value || {}).filter(([key]) => key === "id" || key.startsWith("data-"))
|
||||
);
|
||||
}
|
||||
function makeTagSafe(tag) {
|
||||
let next = {};
|
||||
const { tag: type, props: prev } = tag;
|
||||
switch (type) {
|
||||
// always safe
|
||||
case "title":
|
||||
case "titleTemplate":
|
||||
case "templateParams":
|
||||
next = prev;
|
||||
break;
|
||||
case "htmlAttrs":
|
||||
case "bodyAttrs":
|
||||
WhitelistAttributes[type].forEach((attr) => {
|
||||
if (prev[attr]) {
|
||||
next[attr] = prev[attr];
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "style":
|
||||
next = acceptDataAttrs(prev);
|
||||
WhitelistAttributes.style.forEach((key) => {
|
||||
if (prev[key]) {
|
||||
next[key] = prev[key];
|
||||
}
|
||||
});
|
||||
break;
|
||||
// meta is safe, except for http-equiv
|
||||
case "meta":
|
||||
WhitelistAttributes.meta.forEach((key) => {
|
||||
if (prev[key]) {
|
||||
next[key] = prev[key];
|
||||
}
|
||||
});
|
||||
break;
|
||||
// link tags we don't allow stylesheets, scripts, preloading, prerendering, prefetching, etc
|
||||
case "link":
|
||||
WhitelistAttributes.link.forEach((key) => {
|
||||
const val = prev[key];
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
if (key === "rel" && (val === "canonical" || val === "modulepreload" || val === "prerender" || val === "preload" || val === "prefetch")) {
|
||||
return;
|
||||
}
|
||||
if (key === "href") {
|
||||
if (val.includes("javascript:") || val.includes("data:")) {
|
||||
return;
|
||||
}
|
||||
next[key] = val;
|
||||
} else if (val) {
|
||||
next[key] = val;
|
||||
}
|
||||
});
|
||||
if (!next.href && !next.imagesrcset || !next.rel) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case "noscript":
|
||||
WhitelistAttributes.noscript.forEach((key) => {
|
||||
if (prev[key]) {
|
||||
next[key] = prev[key];
|
||||
}
|
||||
});
|
||||
break;
|
||||
// we only allow JSON in scripts
|
||||
case "script":
|
||||
if (!tag.textContent || !prev.type?.endsWith("json")) {
|
||||
return false;
|
||||
}
|
||||
WhitelistAttributes.script.forEach((s) => {
|
||||
if (prev[s] === "textContent") {
|
||||
try {
|
||||
const jsonVal = typeof prev[s] === "string" ? JSON.parse(prev[s]) : prev[s];
|
||||
next[s] = JSON.stringify(jsonVal, null, 0);
|
||||
} catch {
|
||||
}
|
||||
} else if (prev[s]) {
|
||||
next[s] = prev[s];
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
if (!Object.keys(next).length && !tag.tag.endsWith("Attrs")) {
|
||||
return false;
|
||||
}
|
||||
tag.props = { ...acceptDataAttrs(prev), ...next };
|
||||
return tag;
|
||||
}
|
||||
const SafeInputPlugin = (
|
||||
/* @PURE */
|
||||
defineHeadPlugin({
|
||||
key: "safe",
|
||||
hooks: {
|
||||
"entries:normalize": (ctx) => {
|
||||
if (ctx.entry.options?._safe) {
|
||||
ctx.tags = ctx.tags.reduce((acc, tag) => {
|
||||
const safeTag = makeTagSafe(tag);
|
||||
if (safeTag)
|
||||
acc.push(safeTag);
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
export { FlatMetaPlugin as F, SafeInputPlugin as S, defineHeadPlugin as d };
|
||||
14
client/node_modules/unhead/dist/shared/unhead.CnYfgE7E.d.mts
generated
vendored
Normal file
14
client/node_modules/unhead/dist/shared/unhead.CnYfgE7E.d.mts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.Prz0gZXE.mjs';
|
||||
|
||||
/**
|
||||
* @deprecated compute key manually
|
||||
*/
|
||||
declare function resolveScriptKey(input: UseScriptResolvedInput): string;
|
||||
/**
|
||||
* Load third-party scripts with SSR support and a proxied API.
|
||||
*
|
||||
* @see https://unhead.unjs.io/usage/composables/use-script
|
||||
*/
|
||||
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(head: Unhead<any>, _input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
||||
|
||||
export { resolveScriptKey as r, useScript as u };
|
||||
68
client/node_modules/unhead/dist/shared/unhead.Ctcwz9O1.d.mts
generated
vendored
Normal file
68
client/node_modules/unhead/dist/shared/unhead.Ctcwz9O1.d.mts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, K as SchemaAugmentations, Q as UnheadMeta, ai as ScriptWithoutEvents, O as UnheadHtmlAttributes, N as UnheadBodyAttributesWithoutEvents } from './unhead.Prz0gZXE.mjs';
|
||||
|
||||
type Base = RawInput<'base'>;
|
||||
type HtmlAttributes = RawInput<'htmlAttrs'>;
|
||||
type Noscript = RawInput<'noscript'>;
|
||||
type Style = RawInput<'style'>;
|
||||
type Meta = RawInput<'meta'>;
|
||||
type Script = RawInput<'script'>;
|
||||
type Link = RawInput<'link'>;
|
||||
type BodyAttributes = RawInput<'bodyAttrs'>;
|
||||
|
||||
type SafeBodyAttr = ResolvableProperties<Pick<UnheadBodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
||||
type SafeHtmlAttr = ResolvableProperties<Pick<UnheadHtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
||||
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
||||
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
||||
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & SchemaAugmentations['script']>;
|
||||
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
||||
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
|
||||
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
|
||||
/**
|
||||
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
||||
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
||||
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
||||
*/
|
||||
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
||||
/**
|
||||
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
||||
*/
|
||||
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
||||
/**
|
||||
* The `<style>` HTML element contains style information for a document, or part of a document.
|
||||
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
||||
*/
|
||||
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
||||
/**
|
||||
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
||||
*/
|
||||
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
||||
/**
|
||||
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
||||
* or if scripting is currently turned off in the browser.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
||||
*/
|
||||
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
||||
/**
|
||||
* Attributes for the `<html>` HTML element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
||||
*/
|
||||
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
||||
/**
|
||||
* Attributes for the `<body>` HTML element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
||||
*/
|
||||
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
||||
}
|
||||
|
||||
export type { Base as B, HeadSafe as H, Link as L, Meta as M, Noscript as N, SafeBodyAttr as S, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f, HtmlAttributes as g, Style as h, Script as i, BodyAttributes as j };
|
||||
180
client/node_modules/unhead/dist/shared/unhead.DH45uomy.mjs
generated
vendored
Normal file
180
client/node_modules/unhead/dist/shared/unhead.DH45uomy.mjs
generated
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
import { createHooks } from 'hookable';
|
||||
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.BpRRHAhY.mjs';
|
||||
import { t as tagWeight, s as sortTags } from './unhead.DZbvapt-.mjs';
|
||||
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
function registerPlugin(head, p) {
|
||||
const plugin = typeof p === "function" ? p(head) : p;
|
||||
const key = plugin.key || String(head.plugins.size + 1);
|
||||
const exists = head.plugins.get(key);
|
||||
if (!exists) {
|
||||
head.plugins.set(key, plugin);
|
||||
head.hooks.addHooks(plugin.hooks || {});
|
||||
}
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHeadCore(resolvedOptions = {}) {
|
||||
return /* @__PURE__ */ createUnhead(resolvedOptions);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createUnhead(resolvedOptions = {}) {
|
||||
const hooks = createHooks();
|
||||
hooks.addHooks(resolvedOptions.hooks || {});
|
||||
const ssr = !resolvedOptions.document;
|
||||
const entries = /* @__PURE__ */ new Map();
|
||||
const plugins = /* @__PURE__ */ new Map();
|
||||
const normalizeQueue = /* @__PURE__ */ new Set();
|
||||
const head = {
|
||||
_entryCount: 1,
|
||||
// 0 is reserved for internal use
|
||||
plugins,
|
||||
dirty: false,
|
||||
resolvedOptions,
|
||||
hooks,
|
||||
ssr,
|
||||
entries,
|
||||
headEntries() {
|
||||
return [...entries.values()];
|
||||
},
|
||||
use: (p) => registerPlugin(head, p),
|
||||
push(input, _options) {
|
||||
const options = { ..._options || {} };
|
||||
delete options.head;
|
||||
const _i = options._index ?? head._entryCount++;
|
||||
const inst = { _i, input, options };
|
||||
const _ = {
|
||||
_poll(rm = false) {
|
||||
head.dirty = true;
|
||||
!rm && normalizeQueue.add(_i);
|
||||
hooks.callHook("entries:updated", head);
|
||||
},
|
||||
dispose() {
|
||||
if (entries.delete(_i)) {
|
||||
head.invalidate();
|
||||
}
|
||||
},
|
||||
// a patch is the same as creating a new entry, just a nice DX
|
||||
patch(input2) {
|
||||
if (!options.mode || options.mode === "server" && ssr || options.mode === "client" && !ssr) {
|
||||
inst.input = input2;
|
||||
entries.set(_i, inst);
|
||||
_._poll();
|
||||
}
|
||||
}
|
||||
};
|
||||
_.patch(input);
|
||||
return _;
|
||||
},
|
||||
async resolveTags() {
|
||||
const ctx = {
|
||||
tagMap: /* @__PURE__ */ new Map(),
|
||||
tags: [],
|
||||
entries: [...head.entries.values()]
|
||||
};
|
||||
await hooks.callHook("entries:resolve", ctx);
|
||||
while (normalizeQueue.size) {
|
||||
const i = normalizeQueue.values().next().value;
|
||||
normalizeQueue.delete(i);
|
||||
const e = entries.get(i);
|
||||
if (e) {
|
||||
const normalizeCtx = {
|
||||
tags: normalizeEntryToTags(e.input, resolvedOptions.propResolvers || []).map((t) => Object.assign(t, e.options)),
|
||||
entry: e
|
||||
};
|
||||
await hooks.callHook("entries:normalize", normalizeCtx);
|
||||
e._tags = normalizeCtx.tags.map((t, i2) => {
|
||||
t._w = tagWeight(head, t);
|
||||
t._p = (e._i << 10) + i2;
|
||||
t._d = dedupeKey(t);
|
||||
return t;
|
||||
});
|
||||
}
|
||||
}
|
||||
let hasFlatMeta = false;
|
||||
ctx.entries.flatMap((e) => (e._tags || []).map((t) => ({ ...t, props: { ...t.props } }))).sort(sortTags).reduce((acc, next) => {
|
||||
const k = String(next._d || next._p);
|
||||
if (!acc.has(k))
|
||||
return acc.set(k, next);
|
||||
const prev = acc.get(k);
|
||||
const strategy = next?.tagDuplicateStrategy || (UsesMergeStrategy.has(next.tag) ? "merge" : null) || (next.key && next.key === prev.key ? "merge" : null);
|
||||
if (strategy === "merge") {
|
||||
const newProps = { ...prev.props };
|
||||
Object.entries(next.props).forEach(([p, v]) => (
|
||||
// @ts-expect-error untyped
|
||||
newProps[p] = p === "style" ? new Map([...prev.props.style || /* @__PURE__ */ new Map(), ...v]) : p === "class" ? /* @__PURE__ */ new Set([...prev.props.class || /* @__PURE__ */ new Set(), ...v]) : v
|
||||
));
|
||||
acc.set(k, { ...next, props: newProps });
|
||||
} else if (next._p >> 10 === prev._p >> 10 && next.tag === "meta" && isMetaArrayDupeKey(k)) {
|
||||
acc.set(k, Object.assign([...Array.isArray(prev) ? prev : [prev], next], next));
|
||||
hasFlatMeta = true;
|
||||
} else if (next._w === prev._w ? next._p > prev._p : next?._w < prev?._w) {
|
||||
acc.set(k, next);
|
||||
}
|
||||
return acc;
|
||||
}, ctx.tagMap);
|
||||
const title = ctx.tagMap.get("title");
|
||||
const titleTemplate = ctx.tagMap.get("titleTemplate");
|
||||
head._title = title?.textContent;
|
||||
if (titleTemplate) {
|
||||
const titleTemplateFn = titleTemplate?.textContent;
|
||||
head._titleTemplate = titleTemplateFn;
|
||||
if (titleTemplateFn) {
|
||||
let newTitle = typeof titleTemplateFn === "function" ? titleTemplateFn(title?.textContent) : titleTemplateFn;
|
||||
if (typeof newTitle === "string" && !head.plugins.has("template-params")) {
|
||||
newTitle = newTitle.replace("%s", title?.textContent || "");
|
||||
}
|
||||
if (title) {
|
||||
newTitle === null ? ctx.tagMap.delete("title") : ctx.tagMap.set("title", { ...title, textContent: newTitle });
|
||||
} else {
|
||||
titleTemplate.tag = "title";
|
||||
titleTemplate.textContent = newTitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.tags = Array.from(ctx.tagMap.values());
|
||||
if (hasFlatMeta) {
|
||||
ctx.tags = ctx.tags.flat().sort(sortTags);
|
||||
}
|
||||
await hooks.callHook("tags:beforeResolve", ctx);
|
||||
await hooks.callHook("tags:resolve", ctx);
|
||||
await hooks.callHook("tags:afterResolve", ctx);
|
||||
const finalTags = [];
|
||||
for (const t of ctx.tags) {
|
||||
const { innerHTML, tag, props } = t;
|
||||
if (!ValidHeadTags.has(tag)) {
|
||||
continue;
|
||||
}
|
||||
if (Object.keys(props).length === 0 && !t.innerHTML && !t.textContent) {
|
||||
continue;
|
||||
}
|
||||
if (tag === "meta" && !props.content && !props["http-equiv"] && !props.charset) {
|
||||
continue;
|
||||
}
|
||||
if (tag === "script" && innerHTML) {
|
||||
if (props.type?.endsWith("json")) {
|
||||
const v = typeof innerHTML === "string" ? innerHTML : JSON.stringify(innerHTML);
|
||||
t.innerHTML = v.replace(/</g, "\\u003C");
|
||||
} else if (typeof innerHTML === "string") {
|
||||
t.innerHTML = innerHTML.replace(new RegExp(`</${tag}`, "g"), `<\\/${tag}`);
|
||||
}
|
||||
t._d = dedupeKey(t);
|
||||
}
|
||||
finalTags.push(t);
|
||||
}
|
||||
return finalTags;
|
||||
},
|
||||
invalidate() {
|
||||
for (const entry of entries.values()) {
|
||||
normalizeQueue.add(entry._i);
|
||||
}
|
||||
head.dirty = true;
|
||||
hooks.callHook("entries:updated", head);
|
||||
}
|
||||
};
|
||||
(resolvedOptions?.plugins || []).forEach((p) => registerPlugin(head, p));
|
||||
head.hooks.callHook("init", head);
|
||||
resolvedOptions.init?.forEach((e) => e && head.push(e));
|
||||
return head;
|
||||
}
|
||||
|
||||
export { createUnhead as a, createHeadCore as c };
|
||||
68
client/node_modules/unhead/dist/shared/unhead.DQUgqVjB.d.ts
generated
vendored
Normal file
68
client/node_modules/unhead/dist/shared/unhead.DQUgqVjB.d.ts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { a5 as RawInput, R as ResolvableHead, az as ResolvableValue, aA as ResolvableProperties, ag as LinkWithoutEvents, ab as DataKeys, K as SchemaAugmentations, Q as UnheadMeta, ai as ScriptWithoutEvents, O as UnheadHtmlAttributes, N as UnheadBodyAttributesWithoutEvents } from './unhead.Prz0gZXE.js';
|
||||
|
||||
type Base = RawInput<'base'>;
|
||||
type HtmlAttributes = RawInput<'htmlAttrs'>;
|
||||
type Noscript = RawInput<'noscript'>;
|
||||
type Style = RawInput<'style'>;
|
||||
type Meta = RawInput<'meta'>;
|
||||
type Script = RawInput<'script'>;
|
||||
type Link = RawInput<'link'>;
|
||||
type BodyAttributes = RawInput<'bodyAttrs'>;
|
||||
|
||||
type SafeBodyAttr = ResolvableProperties<Pick<UnheadBodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
||||
type SafeHtmlAttr = ResolvableProperties<Pick<UnheadHtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
||||
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
||||
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
||||
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & SchemaAugmentations['script']>;
|
||||
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
||||
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
|
||||
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
|
||||
/**
|
||||
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
||||
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
||||
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
||||
*/
|
||||
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
||||
/**
|
||||
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
||||
*/
|
||||
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
||||
/**
|
||||
* The `<style>` HTML element contains style information for a document, or part of a document.
|
||||
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
||||
*/
|
||||
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
||||
/**
|
||||
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
||||
*/
|
||||
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
||||
/**
|
||||
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
||||
* or if scripting is currently turned off in the browser.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
||||
*/
|
||||
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
||||
/**
|
||||
* Attributes for the `<html>` HTML element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
||||
*/
|
||||
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
||||
/**
|
||||
* Attributes for the `<body>` HTML element.
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
||||
*/
|
||||
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
||||
}
|
||||
|
||||
export type { Base as B, HeadSafe as H, Link as L, Meta as M, Noscript as N, SafeBodyAttr as S, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f, HtmlAttributes as g, Style as h, Script as i, BodyAttributes as j };
|
||||
196
client/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs
generated
vendored
Normal file
196
client/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs
generated
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
import { M as MetaTagsArrayable } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
const NAMESPACES = {
|
||||
META: /* @__PURE__ */ new Set(["twitter"]),
|
||||
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
||||
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
||||
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
||||
};
|
||||
const META_ALIASES = {
|
||||
articleExpirationTime: "article:expiration_time",
|
||||
articleModifiedTime: "article:modified_time",
|
||||
articlePublishedTime: "article:published_time",
|
||||
bookReleaseDate: "book:release_date",
|
||||
fbAppId: "fb:app_id",
|
||||
ogAudioSecureUrl: "og:audio:secure_url",
|
||||
ogAudioUrl: "og:audio",
|
||||
ogImageSecureUrl: "og:image:secure_url",
|
||||
ogImageUrl: "og:image",
|
||||
ogSiteName: "og:site_name",
|
||||
ogVideoSecureUrl: "og:video:secure_url",
|
||||
ogVideoUrl: "og:video",
|
||||
profileFirstName: "profile:first_name",
|
||||
profileLastName: "profile:last_name",
|
||||
profileUsername: "profile:username",
|
||||
msapplicationConfig: "msapplication-Config",
|
||||
msapplicationTileColor: "msapplication-TileColor",
|
||||
msapplicationTileImage: "msapplication-TileImage"
|
||||
};
|
||||
const MetaPackingSchema = {
|
||||
appleItunesApp: {
|
||||
unpack: {
|
||||
entrySeparator: ", ",
|
||||
// @ts-expect-error untyped
|
||||
resolve: ({ key, value }) => `${fixKeyCase(key)}=${value}`
|
||||
}
|
||||
},
|
||||
refresh: {
|
||||
metaKey: "http-equiv",
|
||||
unpack: {
|
||||
entrySeparator: ";",
|
||||
// @ts-expect-error untyped
|
||||
resolve: ({ key, value }) => key === "seconds" ? `${value}` : void 0
|
||||
}
|
||||
},
|
||||
robots: {
|
||||
unpack: {
|
||||
entrySeparator: ", ",
|
||||
// @ts-expect-error untyped
|
||||
resolve: ({ key, value }) => typeof value === "boolean" ? fixKeyCase(key) : `${fixKeyCase(key)}:${value}`
|
||||
}
|
||||
},
|
||||
contentSecurityPolicy: {
|
||||
metaKey: "http-equiv",
|
||||
unpack: {
|
||||
entrySeparator: "; ",
|
||||
// @ts-expect-error untyped
|
||||
resolve: ({ key, value }) => `${fixKeyCase(key)} ${value}`
|
||||
}
|
||||
},
|
||||
charset: {}
|
||||
};
|
||||
function fixKeyCase(key) {
|
||||
const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
||||
const prefixIndex = updated.indexOf("-");
|
||||
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;
|
||||
}
|
||||
function sanitizeObject(input) {
|
||||
return Object.fromEntries(Object.entries(input).filter(([k, v]) => String(v) !== "false" && k));
|
||||
}
|
||||
function transformObject(obj) {
|
||||
return Array.isArray(obj) ? obj.map(transformObject) : !obj || typeof obj !== "object" ? obj : Object.fromEntries(Object.entries(obj).map(([k, v]) => [fixKeyCase(k), transformObject(v)]));
|
||||
}
|
||||
function unpackToString(value, options = {}) {
|
||||
const { entrySeparator = "", keyValueSeparator = "", wrapValue, resolve } = options;
|
||||
return Object.entries(value).map(([key, val]) => {
|
||||
if (resolve) {
|
||||
const resolved = resolve({ key, value: val });
|
||||
if (resolved !== void 0)
|
||||
return resolved;
|
||||
}
|
||||
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;
|
||||
return `${key}${keyValueSeparator}${processedVal}`;
|
||||
}).join(entrySeparator);
|
||||
}
|
||||
function handleObjectEntry(key, value) {
|
||||
const sanitizedValue = sanitizeObject(value);
|
||||
const fixedKey = fixKeyCase(key);
|
||||
const attr = resolveMetaKeyType(fixedKey);
|
||||
if (!MetaTagsArrayable.has(fixedKey)) {
|
||||
return [{ [attr]: fixedKey, ...sanitizedValue }];
|
||||
}
|
||||
const input = Object.fromEntries(
|
||||
Object.entries(sanitizedValue).map(([k, v]) => [`${key}${k === "url" ? "" : `${k[0].toUpperCase()}${k.slice(1)}`}`, v])
|
||||
);
|
||||
return unpackMeta(input || {}).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
|
||||
}
|
||||
function resolveMetaKeyType(key) {
|
||||
if (MetaPackingSchema[key]?.metaKey === "http-equiv" || NAMESPACES.HTTP_EQUIV.has(key)) {
|
||||
return "http-equiv";
|
||||
}
|
||||
const fixed = fixKeyCase(key);
|
||||
const colonIndex = fixed.indexOf(":");
|
||||
return colonIndex === -1 ? "name" : NAMESPACES.OG.has(fixed.slice(0, colonIndex)) ? "property" : "name";
|
||||
}
|
||||
function resolveMetaKeyValue(key) {
|
||||
return META_ALIASES[key] || fixKeyCase(key);
|
||||
}
|
||||
function resolvePackedMetaObjectValue(value, key) {
|
||||
if (key === "refresh")
|
||||
return `${value.seconds};url=${value.url}`;
|
||||
return unpackToString(transformObject(value), {
|
||||
keyValueSeparator: "=",
|
||||
entrySeparator: ", ",
|
||||
resolve: ({ value: value2, key: key2 }) => value2 === null ? "" : typeof value2 === "boolean" ? key2 : void 0,
|
||||
// @ts-expect-error untyped
|
||||
...MetaPackingSchema[key]?.unpack
|
||||
});
|
||||
}
|
||||
function unpackMeta(input) {
|
||||
const extras = [];
|
||||
const primitives = {};
|
||||
for (const [key, value] of Object.entries(input)) {
|
||||
if (Array.isArray(value)) {
|
||||
if (key === "themeColor") {
|
||||
value.forEach((v) => {
|
||||
if (typeof v === "object" && v !== null) {
|
||||
extras.push({ name: "theme-color", ...v });
|
||||
}
|
||||
});
|
||||
continue;
|
||||
}
|
||||
for (const v of value) {
|
||||
if (typeof v === "object" && v !== null) {
|
||||
const urlProps = [];
|
||||
const otherProps = [];
|
||||
for (const [propKey, propValue] of Object.entries(v)) {
|
||||
const metaKey = `${key}${propKey === "url" ? "" : `:${propKey}`}`;
|
||||
const meta2 = unpackMeta({ [metaKey]: propValue });
|
||||
(propKey === "url" ? urlProps : otherProps).push(...meta2);
|
||||
}
|
||||
extras.push(...urlProps, ...otherProps);
|
||||
} else {
|
||||
extras.push(...typeof v === "string" ? unpackMeta({ [key]: v }) : handleObjectEntry(key, v));
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (typeof value === "object" && value) {
|
||||
if (NAMESPACES.MEDIA.has(key)) {
|
||||
const prefix = key.startsWith("twitter") ? "twitter" : "og";
|
||||
const type = key.replace(/^(og|twitter)/, "").toLowerCase();
|
||||
const metaKey = prefix === "twitter" ? "name" : "property";
|
||||
if (value.url) {
|
||||
extras.push({
|
||||
[metaKey]: `${prefix}:${type}`,
|
||||
content: value.url
|
||||
});
|
||||
}
|
||||
if (value.secureUrl) {
|
||||
extras.push({
|
||||
[metaKey]: `${prefix}:${type}:secure_url`,
|
||||
content: value.secureUrl
|
||||
});
|
||||
}
|
||||
for (const [propKey, propValue] of Object.entries(value)) {
|
||||
if (propKey !== "url" && propKey !== "secureUrl") {
|
||||
extras.push({
|
||||
[metaKey]: `${prefix}:${type}:${propKey}`,
|
||||
// @ts-expect-error untyped
|
||||
content: propValue
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (MetaTagsArrayable.has(fixKeyCase(key))) {
|
||||
extras.push(...handleObjectEntry(key, value));
|
||||
} else {
|
||||
primitives[key] = sanitizeObject(value);
|
||||
}
|
||||
} else {
|
||||
primitives[key] = value;
|
||||
}
|
||||
}
|
||||
const meta = Object.entries(primitives).map(([key, value]) => {
|
||||
if (key === "charset")
|
||||
return { charset: value === null ? "_null" : value };
|
||||
const metaKey = resolveMetaKeyType(key);
|
||||
const keyValue = resolveMetaKeyValue(key);
|
||||
const processedValue = value === null ? "_null" : typeof value === "object" ? resolvePackedMetaObjectValue(value, key) : typeof value === "number" ? value.toString() : value;
|
||||
return metaKey === "http-equiv" ? { "http-equiv": keyValue, "content": processedValue } : { [metaKey]: keyValue, content: processedValue };
|
||||
});
|
||||
return [...extras, ...meta].map(
|
||||
(m) => !("content" in m) ? m : m.content === "_null" ? { ...m, content: null } : m
|
||||
);
|
||||
}
|
||||
|
||||
export { resolveMetaKeyValue as a, resolvePackedMetaObjectValue as b, resolveMetaKeyType as r, unpackMeta as u };
|
||||
70
client/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs
generated
vendored
Normal file
70
client/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
const sortTags = (a, b) => a._w === b._w ? a._p - b._p : a._w - b._w;
|
||||
const TAG_WEIGHTS = {
|
||||
base: -10,
|
||||
title: 10
|
||||
};
|
||||
const TAG_ALIASES = {
|
||||
critical: -8,
|
||||
high: -1,
|
||||
low: 2
|
||||
};
|
||||
const WEIGHT_MAP = {
|
||||
meta: {
|
||||
"content-security-policy": -30,
|
||||
"charset": -20,
|
||||
"viewport": -15
|
||||
},
|
||||
link: {
|
||||
"preconnect": 20,
|
||||
"stylesheet": 60,
|
||||
"preload": 70,
|
||||
"modulepreload": 70,
|
||||
"prefetch": 90,
|
||||
"dns-prefetch": 90,
|
||||
"prerender": 90
|
||||
},
|
||||
script: {
|
||||
async: 30,
|
||||
defer: 80,
|
||||
sync: 50
|
||||
},
|
||||
style: {
|
||||
imported: 40,
|
||||
sync: 60
|
||||
}
|
||||
};
|
||||
const ImportStyleRe = /@import/;
|
||||
const isTruthy = (val) => val === "" || val === true;
|
||||
function tagWeight(head, tag) {
|
||||
if (typeof tag.tagPriority === "number")
|
||||
return tag.tagPriority;
|
||||
let weight = 100;
|
||||
const offset = TAG_ALIASES[tag.tagPriority] || 0;
|
||||
const weightMap = head.resolvedOptions.disableCapoSorting ? {
|
||||
link: {},
|
||||
script: {},
|
||||
style: {}
|
||||
} : WEIGHT_MAP;
|
||||
if (tag.tag in TAG_WEIGHTS) {
|
||||
weight = TAG_WEIGHTS[tag.tag];
|
||||
} else if (tag.tag === "meta") {
|
||||
const metaType = tag.props["http-equiv"] === "content-security-policy" ? "content-security-policy" : tag.props.charset ? "charset" : tag.props.name === "viewport" ? "viewport" : null;
|
||||
if (metaType)
|
||||
weight = WEIGHT_MAP.meta[metaType];
|
||||
} else if (tag.tag === "link" && tag.props.rel) {
|
||||
weight = weightMap.link[tag.props.rel];
|
||||
} else if (tag.tag === "script") {
|
||||
if (isTruthy(tag.props.async)) {
|
||||
weight = weightMap.script.async;
|
||||
} else if (tag.props.src && !isTruthy(tag.props.defer) && !isTruthy(tag.props.async) && tag.props.type !== "module" && !tag.props.type?.endsWith("json")) {
|
||||
weight = weightMap.script.sync;
|
||||
} else if (isTruthy(tag.props.defer) && tag.props.src && !isTruthy(tag.props.async)) {
|
||||
weight = weightMap.script.defer;
|
||||
}
|
||||
} else if (tag.tag === "style") {
|
||||
weight = tag.innerHTML && ImportStyleRe.test(tag.innerHTML) ? weightMap.style.imported : weightMap.style.sync;
|
||||
}
|
||||
return (weight || 100) + offset;
|
||||
}
|
||||
|
||||
export { sortTags as s, tagWeight as t };
|
||||
166
client/node_modules/unhead/dist/shared/unhead.Djo8ep_Y.mjs
generated
vendored
Normal file
166
client/node_modules/unhead/dist/shared/unhead.Djo8ep_Y.mjs
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
import { d as defineHeadPlugin } from './unhead.CApf5sj3.mjs';
|
||||
import { s as sortTags } from './unhead.DZbvapt-.mjs';
|
||||
import { p as processTemplateParams } from './unhead.BYvz9V1x.mjs';
|
||||
|
||||
const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
|
||||
const AliasSortingPlugin = defineHeadPlugin({
|
||||
key: "aliasSorting",
|
||||
hooks: {
|
||||
"tags:resolve": (ctx) => {
|
||||
let m = false;
|
||||
for (const t of ctx.tags) {
|
||||
const p = t.tagPriority;
|
||||
if (!p)
|
||||
continue;
|
||||
const s = String(p);
|
||||
if (s.startsWith("before:")) {
|
||||
const k = formatKey(s.slice(7));
|
||||
const l = ctx.tagMap.get(k);
|
||||
if (l) {
|
||||
if (typeof l.tagPriority === "number")
|
||||
t.tagPriority = l.tagPriority;
|
||||
t._p = l._p - 1;
|
||||
m = true;
|
||||
}
|
||||
} else if (s.startsWith("after:")) {
|
||||
const k = formatKey(s.slice(6));
|
||||
const l = ctx.tagMap.get(k);
|
||||
if (l) {
|
||||
if (typeof l.tagPriority === "number")
|
||||
t.tagPriority = l.tagPriority;
|
||||
t._p = l._p + 1;
|
||||
m = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m)
|
||||
ctx.tags = ctx.tags.sort(sortTags);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const DeprecationsPlugin = /* @__PURE__ */ defineHeadPlugin({
|
||||
key: "deprecations",
|
||||
hooks: {
|
||||
"entries:normalize": ({ tags }) => {
|
||||
for (const tag of tags) {
|
||||
if (tag.props.children) {
|
||||
tag.innerHTML = tag.props.children;
|
||||
delete tag.props.children;
|
||||
}
|
||||
if (tag.props.hid) {
|
||||
tag.key = tag.props.hid;
|
||||
delete tag.props.hid;
|
||||
}
|
||||
if (tag.props.vmid) {
|
||||
tag.key = tag.props.vmid;
|
||||
delete tag.props.vmid;
|
||||
}
|
||||
if (tag.props.body) {
|
||||
tag.tagPosition = "bodyClose";
|
||||
delete tag.props.body;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
async function walkPromises(v) {
|
||||
const type = typeof v;
|
||||
if (type === "function") {
|
||||
return v;
|
||||
}
|
||||
if (v instanceof Promise) {
|
||||
return await v;
|
||||
}
|
||||
if (Array.isArray(v)) {
|
||||
return await Promise.all(v.map((r) => walkPromises(r)));
|
||||
}
|
||||
if (v?.constructor === Object) {
|
||||
const next = {};
|
||||
for (const key of Object.keys(v)) {
|
||||
next[key] = await walkPromises(v[key]);
|
||||
}
|
||||
return next;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
const PromisesPlugin = /* @__PURE__ */ defineHeadPlugin({
|
||||
key: "promises",
|
||||
hooks: {
|
||||
"entries:resolve": async (ctx) => {
|
||||
const promises = [];
|
||||
for (const k in ctx.entries) {
|
||||
if (!ctx.entries[k]._promisesProcessed) {
|
||||
promises.push(
|
||||
walkPromises(ctx.entries[k].input).then((val) => {
|
||||
ctx.entries[k].input = val;
|
||||
ctx.entries[k]._promisesProcessed = true;
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const SupportedAttrs = {
|
||||
meta: "content",
|
||||
link: "href",
|
||||
htmlAttrs: "lang"
|
||||
};
|
||||
const contentAttrs = ["innerHTML", "textContent"];
|
||||
const TemplateParamsPlugin = /* @__PURE__ */ defineHeadPlugin((head) => {
|
||||
return {
|
||||
key: "template-params",
|
||||
hooks: {
|
||||
"entries:normalize": (ctx) => {
|
||||
const params = ctx.tags.filter((t) => t.tag === "templateParams" && t.mode === "server")?.[0]?.props || {};
|
||||
if (Object.keys(params).length) {
|
||||
head._ssrPayload = {
|
||||
templateParams: {
|
||||
...head._ssrPayload?.templateParams || {},
|
||||
...params
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
"tags:resolve": ({ tagMap, tags }) => {
|
||||
const params = tagMap.get("templateParams")?.props || {};
|
||||
const sep = params.separator || "|";
|
||||
delete params.separator;
|
||||
params.pageTitle = processTemplateParams(
|
||||
// find templateParams
|
||||
params.pageTitle || head._title || "",
|
||||
params,
|
||||
sep
|
||||
);
|
||||
for (const tag of tags) {
|
||||
if (tag.processTemplateParams === false) {
|
||||
continue;
|
||||
}
|
||||
const v = SupportedAttrs[tag.tag];
|
||||
if (v && typeof tag.props[v] === "string") {
|
||||
tag.props[v] = processTemplateParams(tag.props[v], params, sep);
|
||||
} else if (tag.processTemplateParams || tag.tag === "titleTemplate" || tag.tag === "title") {
|
||||
for (const p of contentAttrs) {
|
||||
if (typeof tag[p] === "string")
|
||||
tag[p] = processTemplateParams(tag[p], params, sep, tag.tag === "script" && tag.props.type.endsWith("json"));
|
||||
}
|
||||
}
|
||||
}
|
||||
head._templateParams = params;
|
||||
head._separator = sep;
|
||||
},
|
||||
"tags:afterResolve": ({ tagMap }) => {
|
||||
const title = tagMap.get("title");
|
||||
if (title?.textContent && title.processTemplateParams !== false) {
|
||||
title.textContent = processTemplateParams(title.textContent, head._templateParams, head._separator);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export { AliasSortingPlugin as A, DeprecationsPlugin as D, PromisesPlugin as P, TemplateParamsPlugin as T };
|
||||
2325
client/node_modules/unhead/dist/shared/unhead.Prz0gZXE.d.mts
generated
vendored
Normal file
2325
client/node_modules/unhead/dist/shared/unhead.Prz0gZXE.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2325
client/node_modules/unhead/dist/shared/unhead.Prz0gZXE.d.ts
generated
vendored
Normal file
2325
client/node_modules/unhead/dist/shared/unhead.Prz0gZXE.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
14
client/node_modules/unhead/dist/shared/unhead.kTflSlNr.d.ts
generated
vendored
Normal file
14
client/node_modules/unhead/dist/shared/unhead.kTflSlNr.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { U as Unhead, a as UseScriptInput, b as UseScriptOptions, c as UseScriptReturn, d as UseScriptResolvedInput } from './unhead.Prz0gZXE.js';
|
||||
|
||||
/**
|
||||
* @deprecated compute key manually
|
||||
*/
|
||||
declare function resolveScriptKey(input: UseScriptResolvedInput): string;
|
||||
/**
|
||||
* Load third-party scripts with SSR support and a proxied API.
|
||||
*
|
||||
* @see https://unhead.unjs.io/usage/composables/use-script
|
||||
*/
|
||||
declare function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(head: Unhead<any>, _input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T>;
|
||||
|
||||
export { resolveScriptKey as r, useScript as u };
|
||||
38
client/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs
generated
vendored
Normal file
38
client/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
const SelfClosingTags = /* @__PURE__ */ new Set(["meta", "link", "base"]);
|
||||
const DupeableTags = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]);
|
||||
const TagsWithInnerContent = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]);
|
||||
const HasElementTags = /* @__PURE__ */ new Set([
|
||||
"base",
|
||||
"meta",
|
||||
"link",
|
||||
"style",
|
||||
"script",
|
||||
"noscript"
|
||||
]);
|
||||
const ValidHeadTags = /* @__PURE__ */ new Set([
|
||||
"title",
|
||||
"base",
|
||||
"htmlAttrs",
|
||||
"bodyAttrs",
|
||||
"meta",
|
||||
"link",
|
||||
"style",
|
||||
"script",
|
||||
"noscript"
|
||||
]);
|
||||
const UniqueTags = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]);
|
||||
const TagConfigKeys = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]);
|
||||
const ScriptNetworkEvents = /* @__PURE__ */ new Set(["onload", "onerror"]);
|
||||
const UsesMergeStrategy = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]);
|
||||
const MetaTagsArrayable = /* @__PURE__ */ new Set([
|
||||
"theme-color",
|
||||
"google-site-verification",
|
||||
"og",
|
||||
"article",
|
||||
"book",
|
||||
"profile",
|
||||
"twitter",
|
||||
"author"
|
||||
]);
|
||||
|
||||
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 };
|
||||
266
client/node_modules/unhead/dist/types.d.mts
generated
vendored
Normal file
266
client/node_modules/unhead/dist/types.d.mts
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { p as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, r as CreateClientHeadOptions, C as CreateHeadOptions, q as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, y as DomBeforeRenderCtx, J as DomPluginOptions, x as DomRenderTagContext, D as DomState, w as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, s as HeadEntryOptions, G as HeadHooks, o as HeadPlugin, n as HeadPluginInput, m as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, t as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, L as MaybeArray, T as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, j as RecordingEntry, I as RenderDomHeadOptions, v as RenderSSRHeadOptions, Y as ResolvableBase, a3 as ResolvableBodyAttributes, R as ResolvableHead, a2 as ResolvableHtmlAttributes, Z as ResolvableLink, _ as ResolvableMeta, a1 as ResolvableNoscript, aA as ResolvableProperties, a0 as ResolvableScript, $ as ResolvableStyle, a4 as ResolvableTemplateParams, V as ResolvableTitle, X as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, l as RuntimeMode, u as SSRHeadPayload, F as SSRRenderContext, K as SchemaAugmentations, i as ScriptInstance, ai as ScriptWithoutEvents, S as SerializableHead, z as ShouldRenderContext, k as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, N as UnheadBodyAttributesWithoutEvents, O as UnheadHtmlAttributes, Q as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.Prz0gZXE.mjs';
|
||||
export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.Ctcwz9O1.mjs';
|
||||
export { r as resolveScriptKey, u as useScript } from './shared/unhead.CnYfgE7E.mjs';
|
||||
export { createSpyProxy } from './scripts.mjs';
|
||||
import 'hookable';
|
||||
|
||||
interface AriaAttributes {
|
||||
/**
|
||||
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
|
||||
* notifications defined by the aria-relevant attribute.
|
||||
*/
|
||||
'role'?: 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
||||
/**
|
||||
* Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
|
||||
*/
|
||||
'aria-activedescendant'?: string;
|
||||
/**
|
||||
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
|
||||
* notifications defined by the aria-relevant attribute.
|
||||
*/
|
||||
'aria-atomic'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for
|
||||
* an input and specifies how predictions would be presented if they are made.
|
||||
*/
|
||||
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
|
||||
/**
|
||||
* Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are
|
||||
* complete before exposing them to the user.
|
||||
*/
|
||||
'aria-busy'?: Booleanable;
|
||||
/**
|
||||
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
|
||||
*/
|
||||
'aria-checked'?: Booleanable | 'mixed';
|
||||
/**
|
||||
* Defines the total number of columns in a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-colcount'?: number;
|
||||
/**
|
||||
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or
|
||||
* treegrid.
|
||||
*/
|
||||
'aria-colindex'?: number;
|
||||
/**
|
||||
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-colspan'?: number;
|
||||
/**
|
||||
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
||||
*/
|
||||
'aria-controls'?: string;
|
||||
/**
|
||||
* Indicates the element that represents the current item within a container or set of related elements.
|
||||
*/
|
||||
'aria-current'?: Booleanable | 'page' | 'step' | 'location' | 'date' | 'time';
|
||||
/**
|
||||
* Identifies the element (or elements) that describes the object.
|
||||
*/
|
||||
'aria-describedby'?: string;
|
||||
/**
|
||||
* Identifies the element that provides a detailed, extended description for the object.
|
||||
*/
|
||||
'aria-details'?: string;
|
||||
/**
|
||||
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
|
||||
*/
|
||||
'aria-disabled'?: Booleanable;
|
||||
/**
|
||||
* Indicates what functions can be performed when a dragged object is released on the drop target.
|
||||
*/
|
||||
'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
|
||||
/**
|
||||
* Identifies the element that provides an error message for the object.
|
||||
*/
|
||||
'aria-errormessage'?: string;
|
||||
/**
|
||||
* Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
|
||||
*/
|
||||
'aria-expanded'?: Booleanable;
|
||||
/**
|
||||
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
|
||||
* allows assistive technology to override the general default of reading in document source order.
|
||||
*/
|
||||
'aria-flowto'?: string;
|
||||
/**
|
||||
* Indicates an element's "grabbed" state in a drag-and-drop operation.
|
||||
*/
|
||||
'aria-grabbed'?: Booleanable;
|
||||
/**
|
||||
* Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by
|
||||
* an element.
|
||||
*/
|
||||
'aria-haspopup'?: Booleanable | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
||||
/**
|
||||
* Indicates whether the element is exposed to an accessibility API.
|
||||
*/
|
||||
'aria-hidden'?: Booleanable;
|
||||
/**
|
||||
* Indicates the entered value does not conform to the format expected by the application.
|
||||
*/
|
||||
'aria-invalid'?: Booleanable | 'grammar' | 'spelling';
|
||||
/**
|
||||
* Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
|
||||
*/
|
||||
'aria-keyshortcuts'?: string;
|
||||
/**
|
||||
* Defines a string value that labels the current element.
|
||||
*/
|
||||
'aria-label'?: string;
|
||||
/**
|
||||
* Identifies the element (or elements) that labels the current element.
|
||||
*/
|
||||
'aria-labelledby'?: string;
|
||||
/**
|
||||
* Defines the hierarchical level of an element within a structure.
|
||||
*/
|
||||
'aria-level'?: number;
|
||||
/**
|
||||
* Indicates that an element will be updated, and describes the types of updates the user agents, assistive
|
||||
* technologies, and user can expect from the live region.
|
||||
*/
|
||||
'aria-live'?: 'off' | 'assertive' | 'polite';
|
||||
/**
|
||||
* Indicates whether an element is modal when displayed.
|
||||
*/
|
||||
'aria-modal'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether a text box accepts multiple lines of input or only a single line.
|
||||
*/
|
||||
'aria-multiline'?: Booleanable;
|
||||
/**
|
||||
* Indicates that the user may select more than one item from the current selectable descendants.
|
||||
*/
|
||||
'aria-multiselectable'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
|
||||
*/
|
||||
'aria-orientation'?: 'horizontal' | 'vertical';
|
||||
/**
|
||||
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
|
||||
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
|
||||
*/
|
||||
'aria-owns'?: string;
|
||||
/**
|
||||
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no
|
||||
* value. A hint could be a sample value or a brief description of the expected format.
|
||||
*/
|
||||
'aria-placeholder'?: string;
|
||||
/**
|
||||
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements
|
||||
* in the set are present in the DOM.
|
||||
*/
|
||||
'aria-posinset'?: number;
|
||||
/**
|
||||
* Indicates the current "pressed" state of toggle buttons.
|
||||
*/
|
||||
'aria-pressed'?: Booleanable | 'mixed';
|
||||
/**
|
||||
* Indicates that the element is not editable, but is otherwise operable.
|
||||
*/
|
||||
'aria-readonly'?: Booleanable;
|
||||
/**
|
||||
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
|
||||
*/
|
||||
'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
|
||||
/**
|
||||
* Indicates that user input is required on the element before a form may be submitted.
|
||||
*/
|
||||
'aria-required'?: Booleanable;
|
||||
/**
|
||||
* Defines a human-readable, author-localized description for the role of an element.
|
||||
*/
|
||||
'aria-roledescription'?: string;
|
||||
/**
|
||||
* Defines the total number of rows in a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowcount'?: number;
|
||||
/**
|
||||
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowindex'?: number;
|
||||
/**
|
||||
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowspan'?: number;
|
||||
/**
|
||||
* Indicates the current "selected" state of various widgets.
|
||||
*/
|
||||
'aria-selected'?: Booleanable;
|
||||
/**
|
||||
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
|
||||
*/
|
||||
'aria-setsize'?: number;
|
||||
/**
|
||||
* Indicates if items in a table or grid are sorted in ascending or descending order.
|
||||
*/
|
||||
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
|
||||
/**
|
||||
* Defines the maximum allowed value for a range widget.
|
||||
*/
|
||||
'aria-valuemax'?: number;
|
||||
/**
|
||||
* Defines the minimum allowed value for a range widget.
|
||||
*/
|
||||
'aria-valuemin'?: number;
|
||||
/**
|
||||
* Defines the current value for a range widget.
|
||||
*/
|
||||
'aria-valuenow'?: number;
|
||||
/**
|
||||
* Defines the human readable text alternative of aria-valuenow for a range widget.
|
||||
*/
|
||||
'aria-valuetext'?: string;
|
||||
}
|
||||
|
||||
interface SpeculationRules {
|
||||
prefetch?: (SpeculationRuleList | SpeculationRuleDocument)[];
|
||||
prerender?: (SpeculationRuleList | SpeculationRuleDocument)[];
|
||||
}
|
||||
interface SpeculationRuleBase {
|
||||
/**
|
||||
* A hint about how likely the user is to navigate to the URL
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#scores
|
||||
*/
|
||||
score?: number;
|
||||
/**
|
||||
* Parse urls/patterns relative to the document's base url.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#using-the-documents-base-url-for-external-speculation-rule-sets
|
||||
*/
|
||||
relative_to?: 'document';
|
||||
/**
|
||||
* Assertions in the rule about the capabilities of the user agent while executing them.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#requirements
|
||||
*/
|
||||
requires?: 'anonymous-client-ip-when-cross-origin'[];
|
||||
/**
|
||||
* Indicating where the page expects the prerendered content to be activated.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints
|
||||
*/
|
||||
target_hint?: '_blank' | '_self' | '_parent' | '_top';
|
||||
/**
|
||||
* The policy to use for the speculative request.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#explicit-referrer-policy
|
||||
*/
|
||||
referrer_policy?: ReferrerPolicy;
|
||||
}
|
||||
interface SpeculationRuleList extends SpeculationRuleBase {
|
||||
source: 'list';
|
||||
urls: string[];
|
||||
}
|
||||
type SpeculationRuleFn = 'and' | 'or' | 'href_matches' | 'selector_matches' | 'not';
|
||||
type SpeculationRuleWhere = Partial<Record<SpeculationRuleFn, Partial<(Record<SpeculationRuleFn, (Partial<Record<SpeculationRuleFn, string>>) | string>)>[]>>;
|
||||
interface SpeculationRuleDocument extends SpeculationRuleBase {
|
||||
source: 'document';
|
||||
where: SpeculationRuleWhere;
|
||||
}
|
||||
|
||||
export { Booleanable };
|
||||
export type { AriaAttributes, SpeculationRules };
|
||||
266
client/node_modules/unhead/dist/types.d.ts
generated
vendored
Normal file
266
client/node_modules/unhead/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
import { B as Booleanable, e as ReferrerPolicy } from './shared/unhead.Prz0gZXE.js';
|
||||
export { p as ActiveHeadEntry, ax as Arrayable, A as AsVoidFunctions, ae as BodyAttributesWithoutEvents, af as BodyEvents, r as CreateClientHeadOptions, C as CreateHeadOptions, q as CreateServerHeadOptions, ab as DataKeys, aC as DeepResolvableProperties, y as DomBeforeRenderCtx, J as DomPluginOptions, x as DomRenderTagContext, D as DomState, w as EntryResolveCtx, E as EventHandlerOptions, ad as GlobalAttributes, at as HasTemplateParams, a6 as Head, H as HeadEntry, s as HeadEntryOptions, G as HeadHooks, o as HeadPlugin, n as HeadPluginInput, m as HeadPluginOptions, au as HeadTag, av as HeadTagKeys, t as HookResult, ac as HttpEventAttributes, an as InnerContent, am as InnerContentVal, ag as LinkWithoutEvents, L as MaybeArray, T as MaybeEventFnHandlers, aa as MergeHead, ah as MetaFlat, M as MetaFlatInput, ay as Never, as as ProcessesTemplateParams, P as PropResolver, a5 as RawInput, j as RecordingEntry, I as RenderDomHeadOptions, v as RenderSSRHeadOptions, Y as ResolvableBase, a3 as ResolvableBodyAttributes, R as ResolvableHead, a2 as ResolvableHtmlAttributes, Z as ResolvableLink, _ as ResolvableMeta, a1 as ResolvableNoscript, aA as ResolvableProperties, a0 as ResolvableScript, $ as ResolvableStyle, a4 as ResolvableTemplateParams, V as ResolvableTitle, X as ResolvableTitleTemplate, aB as ResolvableUnion, az as ResolvableValue, a7 as ResolvedHead, aj as ResolvesDuplicates, l as RuntimeMode, u as SSRHeadPayload, F as SSRRenderContext, K as SchemaAugmentations, i as ScriptInstance, ai as ScriptWithoutEvents, S as SerializableHead, z as ShouldRenderContext, k as SideEffectsRecord, aw as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, ar as TemplateParams, U as Unhead, N as UnheadBodyAttributesWithoutEvents, O as UnheadHtmlAttributes, Q as UnheadMeta, h as UseFunctionType, a9 as UseHeadInput, g as UseScriptContext, a as UseScriptInput, b as UseScriptOptions, d as UseScriptResolvedInput, c as UseScriptReturn, f as UseScriptStatus, a8 as UseSeoMetaInput, ak as ValidTagPositions, W as WarmupStrategy } from './shared/unhead.Prz0gZXE.js';
|
||||
export { B as Base, j as BodyAttributes, H as HeadSafe, g as HtmlAttributes, L as Link, M as Meta, N as Noscript, S as SafeBodyAttr, a as SafeHtmlAttr, c as SafeLink, b as SafeMeta, e as SafeNoscript, d as SafeScript, f as SafeStyle, i as Script, h as Style } from './shared/unhead.DQUgqVjB.js';
|
||||
export { r as resolveScriptKey, u as useScript } from './shared/unhead.kTflSlNr.js';
|
||||
export { createSpyProxy } from './scripts.js';
|
||||
import 'hookable';
|
||||
|
||||
interface AriaAttributes {
|
||||
/**
|
||||
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
|
||||
* notifications defined by the aria-relevant attribute.
|
||||
*/
|
||||
'role'?: 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
||||
/**
|
||||
* Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
|
||||
*/
|
||||
'aria-activedescendant'?: string;
|
||||
/**
|
||||
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
|
||||
* notifications defined by the aria-relevant attribute.
|
||||
*/
|
||||
'aria-atomic'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for
|
||||
* an input and specifies how predictions would be presented if they are made.
|
||||
*/
|
||||
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
|
||||
/**
|
||||
* Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are
|
||||
* complete before exposing them to the user.
|
||||
*/
|
||||
'aria-busy'?: Booleanable;
|
||||
/**
|
||||
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
|
||||
*/
|
||||
'aria-checked'?: Booleanable | 'mixed';
|
||||
/**
|
||||
* Defines the total number of columns in a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-colcount'?: number;
|
||||
/**
|
||||
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or
|
||||
* treegrid.
|
||||
*/
|
||||
'aria-colindex'?: number;
|
||||
/**
|
||||
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-colspan'?: number;
|
||||
/**
|
||||
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
||||
*/
|
||||
'aria-controls'?: string;
|
||||
/**
|
||||
* Indicates the element that represents the current item within a container or set of related elements.
|
||||
*/
|
||||
'aria-current'?: Booleanable | 'page' | 'step' | 'location' | 'date' | 'time';
|
||||
/**
|
||||
* Identifies the element (or elements) that describes the object.
|
||||
*/
|
||||
'aria-describedby'?: string;
|
||||
/**
|
||||
* Identifies the element that provides a detailed, extended description for the object.
|
||||
*/
|
||||
'aria-details'?: string;
|
||||
/**
|
||||
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
|
||||
*/
|
||||
'aria-disabled'?: Booleanable;
|
||||
/**
|
||||
* Indicates what functions can be performed when a dragged object is released on the drop target.
|
||||
*/
|
||||
'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
|
||||
/**
|
||||
* Identifies the element that provides an error message for the object.
|
||||
*/
|
||||
'aria-errormessage'?: string;
|
||||
/**
|
||||
* Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
|
||||
*/
|
||||
'aria-expanded'?: Booleanable;
|
||||
/**
|
||||
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
|
||||
* allows assistive technology to override the general default of reading in document source order.
|
||||
*/
|
||||
'aria-flowto'?: string;
|
||||
/**
|
||||
* Indicates an element's "grabbed" state in a drag-and-drop operation.
|
||||
*/
|
||||
'aria-grabbed'?: Booleanable;
|
||||
/**
|
||||
* Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by
|
||||
* an element.
|
||||
*/
|
||||
'aria-haspopup'?: Booleanable | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
||||
/**
|
||||
* Indicates whether the element is exposed to an accessibility API.
|
||||
*/
|
||||
'aria-hidden'?: Booleanable;
|
||||
/**
|
||||
* Indicates the entered value does not conform to the format expected by the application.
|
||||
*/
|
||||
'aria-invalid'?: Booleanable | 'grammar' | 'spelling';
|
||||
/**
|
||||
* Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
|
||||
*/
|
||||
'aria-keyshortcuts'?: string;
|
||||
/**
|
||||
* Defines a string value that labels the current element.
|
||||
*/
|
||||
'aria-label'?: string;
|
||||
/**
|
||||
* Identifies the element (or elements) that labels the current element.
|
||||
*/
|
||||
'aria-labelledby'?: string;
|
||||
/**
|
||||
* Defines the hierarchical level of an element within a structure.
|
||||
*/
|
||||
'aria-level'?: number;
|
||||
/**
|
||||
* Indicates that an element will be updated, and describes the types of updates the user agents, assistive
|
||||
* technologies, and user can expect from the live region.
|
||||
*/
|
||||
'aria-live'?: 'off' | 'assertive' | 'polite';
|
||||
/**
|
||||
* Indicates whether an element is modal when displayed.
|
||||
*/
|
||||
'aria-modal'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether a text box accepts multiple lines of input or only a single line.
|
||||
*/
|
||||
'aria-multiline'?: Booleanable;
|
||||
/**
|
||||
* Indicates that the user may select more than one item from the current selectable descendants.
|
||||
*/
|
||||
'aria-multiselectable'?: Booleanable;
|
||||
/**
|
||||
* Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
|
||||
*/
|
||||
'aria-orientation'?: 'horizontal' | 'vertical';
|
||||
/**
|
||||
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
|
||||
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
|
||||
*/
|
||||
'aria-owns'?: string;
|
||||
/**
|
||||
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no
|
||||
* value. A hint could be a sample value or a brief description of the expected format.
|
||||
*/
|
||||
'aria-placeholder'?: string;
|
||||
/**
|
||||
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements
|
||||
* in the set are present in the DOM.
|
||||
*/
|
||||
'aria-posinset'?: number;
|
||||
/**
|
||||
* Indicates the current "pressed" state of toggle buttons.
|
||||
*/
|
||||
'aria-pressed'?: Booleanable | 'mixed';
|
||||
/**
|
||||
* Indicates that the element is not editable, but is otherwise operable.
|
||||
*/
|
||||
'aria-readonly'?: Booleanable;
|
||||
/**
|
||||
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
|
||||
*/
|
||||
'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
|
||||
/**
|
||||
* Indicates that user input is required on the element before a form may be submitted.
|
||||
*/
|
||||
'aria-required'?: Booleanable;
|
||||
/**
|
||||
* Defines a human-readable, author-localized description for the role of an element.
|
||||
*/
|
||||
'aria-roledescription'?: string;
|
||||
/**
|
||||
* Defines the total number of rows in a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowcount'?: number;
|
||||
/**
|
||||
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowindex'?: number;
|
||||
/**
|
||||
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
|
||||
*/
|
||||
'aria-rowspan'?: number;
|
||||
/**
|
||||
* Indicates the current "selected" state of various widgets.
|
||||
*/
|
||||
'aria-selected'?: Booleanable;
|
||||
/**
|
||||
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
|
||||
*/
|
||||
'aria-setsize'?: number;
|
||||
/**
|
||||
* Indicates if items in a table or grid are sorted in ascending or descending order.
|
||||
*/
|
||||
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
|
||||
/**
|
||||
* Defines the maximum allowed value for a range widget.
|
||||
*/
|
||||
'aria-valuemax'?: number;
|
||||
/**
|
||||
* Defines the minimum allowed value for a range widget.
|
||||
*/
|
||||
'aria-valuemin'?: number;
|
||||
/**
|
||||
* Defines the current value for a range widget.
|
||||
*/
|
||||
'aria-valuenow'?: number;
|
||||
/**
|
||||
* Defines the human readable text alternative of aria-valuenow for a range widget.
|
||||
*/
|
||||
'aria-valuetext'?: string;
|
||||
}
|
||||
|
||||
interface SpeculationRules {
|
||||
prefetch?: (SpeculationRuleList | SpeculationRuleDocument)[];
|
||||
prerender?: (SpeculationRuleList | SpeculationRuleDocument)[];
|
||||
}
|
||||
interface SpeculationRuleBase {
|
||||
/**
|
||||
* A hint about how likely the user is to navigate to the URL
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#scores
|
||||
*/
|
||||
score?: number;
|
||||
/**
|
||||
* Parse urls/patterns relative to the document's base url.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#using-the-documents-base-url-for-external-speculation-rule-sets
|
||||
*/
|
||||
relative_to?: 'document';
|
||||
/**
|
||||
* Assertions in the rule about the capabilities of the user agent while executing them.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#requirements
|
||||
*/
|
||||
requires?: 'anonymous-client-ip-when-cross-origin'[];
|
||||
/**
|
||||
* Indicating where the page expects the prerendered content to be activated.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints
|
||||
*/
|
||||
target_hint?: '_blank' | '_self' | '_parent' | '_top';
|
||||
/**
|
||||
* The policy to use for the speculative request.
|
||||
*
|
||||
* @see https://github.com/WICG/nav-speculation/blob/main/triggers.md#explicit-referrer-policy
|
||||
*/
|
||||
referrer_policy?: ReferrerPolicy;
|
||||
}
|
||||
interface SpeculationRuleList extends SpeculationRuleBase {
|
||||
source: 'list';
|
||||
urls: string[];
|
||||
}
|
||||
type SpeculationRuleFn = 'and' | 'or' | 'href_matches' | 'selector_matches' | 'not';
|
||||
type SpeculationRuleWhere = Partial<Record<SpeculationRuleFn, Partial<(Record<SpeculationRuleFn, (Partial<Record<SpeculationRuleFn, string>>) | string>)>[]>>;
|
||||
interface SpeculationRuleDocument extends SpeculationRuleBase {
|
||||
source: 'document';
|
||||
where: SpeculationRuleWhere;
|
||||
}
|
||||
|
||||
export { Booleanable };
|
||||
export type { AriaAttributes, SpeculationRules };
|
||||
1
client/node_modules/unhead/dist/types.mjs
generated
vendored
Normal file
1
client/node_modules/unhead/dist/types.mjs
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
34
client/node_modules/unhead/dist/utils.d.mts
generated
vendored
Normal file
34
client/node_modules/unhead/dist/utils.d.mts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { au as HeadTag, Q as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.Prz0gZXE.mjs';
|
||||
import 'hookable';
|
||||
|
||||
declare const SelfClosingTags: Set<string>;
|
||||
declare const DupeableTags: Set<string>;
|
||||
declare const TagsWithInnerContent: Set<string>;
|
||||
declare const HasElementTags: Set<string>;
|
||||
declare const ValidHeadTags: Set<string>;
|
||||
declare const UniqueTags: Set<string>;
|
||||
declare const TagConfigKeys: Set<string>;
|
||||
declare const ScriptNetworkEvents: Set<string>;
|
||||
declare const UsesMergeStrategy: Set<string>;
|
||||
declare const MetaTagsArrayable: Set<string>;
|
||||
|
||||
declare function isMetaArrayDupeKey(v: string): boolean;
|
||||
declare function dedupeKey<T extends HeadTag>(tag: T): string | undefined;
|
||||
declare function hashTag(tag: HeadTag): string;
|
||||
|
||||
declare function resolveMetaKeyType(key: string): keyof UnheadMeta;
|
||||
declare function resolveMetaKeyValue(key: string): string;
|
||||
declare function resolvePackedMetaObjectValue(value: string, key: string): string;
|
||||
declare function unpackMeta<T extends MetaFlat>(input: T): Required<ResolvableHead>['meta'];
|
||||
|
||||
declare function normalizeProps(tag: HeadTag, input: Record<string, any>): HeadTag;
|
||||
declare function normalizeEntryToTags(input: any, propResolvers: PropResolver[]): HeadTag[];
|
||||
|
||||
declare const sortTags: (a: HeadTag, b: HeadTag) => number;
|
||||
declare function tagWeight<T extends HeadTag>(head: Unhead<any>, tag: T): number;
|
||||
|
||||
declare function processTemplateParams(s: string, p: TemplateParams, sep?: string, isJson?: boolean): string;
|
||||
|
||||
declare function walkResolver(val: any, resolve?: PropResolver, key?: string): any;
|
||||
|
||||
export { DupeableTags, HasElementTags, MetaTagsArrayable, ScriptNetworkEvents, SelfClosingTags, TagConfigKeys, TagsWithInnerContent, UniqueTags, UsesMergeStrategy, ValidHeadTags, dedupeKey, hashTag, isMetaArrayDupeKey, normalizeEntryToTags, normalizeProps, processTemplateParams, resolveMetaKeyType, resolveMetaKeyValue, resolvePackedMetaObjectValue, sortTags, tagWeight, unpackMeta, walkResolver };
|
||||
34
client/node_modules/unhead/dist/utils.d.ts
generated
vendored
Normal file
34
client/node_modules/unhead/dist/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { au as HeadTag, Q as UnheadMeta, ah as MetaFlat, R as ResolvableHead, P as PropResolver, U as Unhead, ar as TemplateParams } from './shared/unhead.Prz0gZXE.js';
|
||||
import 'hookable';
|
||||
|
||||
declare const SelfClosingTags: Set<string>;
|
||||
declare const DupeableTags: Set<string>;
|
||||
declare const TagsWithInnerContent: Set<string>;
|
||||
declare const HasElementTags: Set<string>;
|
||||
declare const ValidHeadTags: Set<string>;
|
||||
declare const UniqueTags: Set<string>;
|
||||
declare const TagConfigKeys: Set<string>;
|
||||
declare const ScriptNetworkEvents: Set<string>;
|
||||
declare const UsesMergeStrategy: Set<string>;
|
||||
declare const MetaTagsArrayable: Set<string>;
|
||||
|
||||
declare function isMetaArrayDupeKey(v: string): boolean;
|
||||
declare function dedupeKey<T extends HeadTag>(tag: T): string | undefined;
|
||||
declare function hashTag(tag: HeadTag): string;
|
||||
|
||||
declare function resolveMetaKeyType(key: string): keyof UnheadMeta;
|
||||
declare function resolveMetaKeyValue(key: string): string;
|
||||
declare function resolvePackedMetaObjectValue(value: string, key: string): string;
|
||||
declare function unpackMeta<T extends MetaFlat>(input: T): Required<ResolvableHead>['meta'];
|
||||
|
||||
declare function normalizeProps(tag: HeadTag, input: Record<string, any>): HeadTag;
|
||||
declare function normalizeEntryToTags(input: any, propResolvers: PropResolver[]): HeadTag[];
|
||||
|
||||
declare const sortTags: (a: HeadTag, b: HeadTag) => number;
|
||||
declare function tagWeight<T extends HeadTag>(head: Unhead<any>, tag: T): number;
|
||||
|
||||
declare function processTemplateParams(s: string, p: TemplateParams, sep?: string, isJson?: boolean): string;
|
||||
|
||||
declare function walkResolver(val: any, resolve?: PropResolver, key?: string): any;
|
||||
|
||||
export { DupeableTags, HasElementTags, MetaTagsArrayable, ScriptNetworkEvents, SelfClosingTags, TagConfigKeys, TagsWithInnerContent, UniqueTags, UsesMergeStrategy, ValidHeadTags, dedupeKey, hashTag, isMetaArrayDupeKey, normalizeEntryToTags, normalizeProps, processTemplateParams, resolveMetaKeyType, resolveMetaKeyValue, resolvePackedMetaObjectValue, sortTags, tagWeight, unpackMeta, walkResolver };
|
||||
5
client/node_modules/unhead/dist/utils.mjs
generated
vendored
Normal file
5
client/node_modules/unhead/dist/utils.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
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';
|
||||
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.BpRRHAhY.mjs';
|
||||
export { r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.DQc16pHI.mjs';
|
||||
export { s as sortTags, t as tagWeight } from './shared/unhead.DZbvapt-.mjs';
|
||||
export { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
|
||||
Reference in New Issue
Block a user