zudoku 0.33.1 → 0.33.2-local.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/validators/common.d.ts +226 -8
- package/dist/config/validators/common.js +26 -8
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +89 -2
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +11 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +6 -6
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +2 -1
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +3 -1
- package/dist/lib/plugins/api-catalog/Catalog.js +7 -4
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.js +1 -1
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
- package/dist/lib/plugins/openapi/ParameterList.js +3 -2
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +10 -7
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +66 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +31 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +3 -0
- package/dist/lib/plugins/search-pagefind/get-results.js +37 -0
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/index.d.ts +8 -0
- package/dist/lib/plugins/search-pagefind/index.js +9 -0
- package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
- package/dist/lib/plugins/search-pagefind/types.js +2 -0
- package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +7 -1
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +6 -8
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +4 -0
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +7 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +8 -0
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/pagefind.d.ts +4 -0
- package/dist/vite/pagefind.js +15 -0
- package/dist/vite/pagefind.js.map +1 -0
- package/dist/vite/plugin-component.js +4 -0
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-search.js +4 -0
- package/dist/vite/plugin-search.js.map +1 -1
- package/dist/vite/prerender/prerender.js +1 -1
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/sitemap.js +2 -1
- package/dist/vite/sitemap.js.map +1 -1
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-BCYuduZ9.js} +3 -3
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js.map → AuthenticationPlugin-BCYuduZ9.js.map} +1 -1
- package/lib/Command-CrTA1FX0.js +140 -0
- package/lib/Command-CrTA1FX0.js.map +1 -0
- package/lib/{Dialog-DIKGQxQc.js → Dialog-mi6BrnrM.js} +3 -3
- package/lib/{Dialog-DIKGQxQc.js.map → Dialog-mi6BrnrM.js.map} +1 -1
- package/lib/{Markdown-DePfm7oQ.js → Markdown-DofXBcqg.js} +2 -2
- package/lib/{Markdown-DePfm7oQ.js.map → Markdown-DofXBcqg.js.map} +1 -1
- package/lib/MdxPage-KJcNWIgt.js +200 -0
- package/lib/MdxPage-KJcNWIgt.js.map +1 -0
- package/lib/{OasProvider-SzD9mHJc.js → OasProvider-HcqBeC4H.js} +4 -4
- package/lib/{OasProvider-SzD9mHJc.js.map → OasProvider-HcqBeC4H.js.map} +1 -1
- package/lib/{OperationList-DDs9NblY.js → OperationList-C3wnbFxp.js} +1857 -1816
- package/lib/OperationList-C3wnbFxp.js.map +1 -0
- package/lib/{Select-Dqtcn53H.js → Select-Co6MuS4j.js} +36 -36
- package/lib/{Select-Dqtcn53H.js.map → Select-Co6MuS4j.js.map} +1 -1
- package/lib/{SlotletProvider-DdtIOUi6.js → SlotletProvider-CYFNHuok.js} +4 -4
- package/lib/{SlotletProvider-DdtIOUi6.js.map → SlotletProvider-CYFNHuok.js.map} +1 -1
- package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js → chunk-IR6S3I6Y-CRDBmIgK.js} +3 -3
- package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js.map → chunk-IR6S3I6Y-CRDBmIgK.js.map} +1 -1
- package/lib/hook-LTe5qHSc.js +347 -0
- package/lib/hook-LTe5qHSc.js.map +1 -0
- package/lib/{index-CibzSNks.js → index-CtkRMvMw.js} +698 -746
- package/lib/index-CtkRMvMw.js.map +1 -0
- package/lib/index-vn5bsvmU.js +1399 -0
- package/lib/index-vn5bsvmU.js.map +1 -0
- package/lib/{mutation-EclmI0is.js → mutation-B81DztCT.js} +2 -2
- package/lib/{mutation-EclmI0is.js.map → mutation-B81DztCT.js.map} +1 -1
- package/lib/ui/Command.js +96 -70
- package/lib/ui/Command.js.map +1 -1
- package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-D76yras4.js} +2 -2
- package/lib/{useExposedProps-RIvey2Oy.js.map → useExposedProps-D76yras4.js.map} +1 -1
- package/lib/useQuery-CQUwWR9i.js +1137 -0
- package/lib/useQuery-CQUwWR9i.js.map +1 -0
- package/lib/useScrollToAnchor-DKyrbZoy.js +977 -0
- package/lib/useScrollToAnchor-DKyrbZoy.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +29 -29
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.components.js +32 -1393
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +87 -71
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +16 -15
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +274 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/package.json +8 -3
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/clerk.tsx +10 -6
- package/src/lib/components/Banner.tsx +1 -0
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/Layout.tsx +1 -0
- package/src/lib/core/RouteGuard.tsx +2 -1
- package/src/lib/plugins/api-catalog/Catalog.tsx +23 -7
- package/src/lib/plugins/api-catalog/index.tsx +1 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +5 -1
- package/src/lib/plugins/openapi/OperationList.tsx +15 -3
- package/src/lib/plugins/openapi/OperationListItem.tsx +8 -0
- package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +8 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +61 -5
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +135 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +104 -0
- package/src/lib/plugins/search-pagefind/get-results.tsx +54 -0
- package/src/lib/plugins/search-pagefind/index.tsx +21 -0
- package/src/lib/plugins/search-pagefind/types.ts +118 -0
- package/src/lib/ui/Command.tsx +25 -3
- package/src/lib/util/useScrollToAnchor.ts +8 -8
- package/README.md +0 -121
- package/lib/MdxPage-DZTt9ld7.js +0 -193
- package/lib/MdxPage-DZTt9ld7.js.map +0 -1
- package/lib/OperationList-DDs9NblY.js.map +0 -1
- package/lib/hook-CN__aZIt.js +0 -1464
- package/lib/hook-CN__aZIt.js.map +0 -1
- package/lib/index-CibzSNks.js.map +0 -1
- package/lib/index.esm-CQHE3GEU.js +0 -691
- package/lib/index.esm-CQHE3GEU.js.map +0 -1
- package/lib/objectEntries-yMIkr2mI.js +0 -5
- package/lib/objectEntries-yMIkr2mI.js.map +0 -1
- package/lib/useScrollToAnchor-C7ilRSts.js +0 -290
- package/lib/useScrollToAnchor-C7ilRSts.js.map +0 -1
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var xe = (e, t, r) => t in e ? Te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var T = (e, t, r) => xe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import y, { Component as Y, useState as J, useEffect as ie, useCallback as Ce } from "react";
|
|
5
|
+
import { g as X } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
6
|
+
import { u as le, L as Ae, d as we, g as U, b as Ee } from "./chunk-IR6S3I6Y-CRDBmIgK.js";
|
|
7
|
+
import { u as Z } from "./Markdown-DofXBcqg.js";
|
|
8
|
+
import { j as u } from "./jsx-runtime-CYK1ROHF.js";
|
|
9
|
+
import { c as Oe } from "./index-CPNSgwSb.js";
|
|
10
|
+
import { ChevronRightIcon as ke, ExternalLinkIcon as Se } from "lucide-react";
|
|
11
|
+
import { f as je, j as ce } from "./hook-LTe5qHSc.js";
|
|
12
|
+
import { c as S } from "./cn-qaFjX9_3.js";
|
|
13
|
+
import * as M from "@radix-ui/react-collapsible";
|
|
14
|
+
const z = {}, ue = y.createContext(z);
|
|
15
|
+
function Ie(e) {
|
|
16
|
+
const t = y.useContext(ue);
|
|
17
|
+
return y.useMemo(
|
|
18
|
+
function() {
|
|
19
|
+
return typeof e == "function" ? e(t) : { ...t, ...e };
|
|
20
|
+
},
|
|
21
|
+
[t, e]
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function Tt(e) {
|
|
25
|
+
let t;
|
|
26
|
+
return e.disableParentContext ? t = typeof e.components == "function" ? e.components(z) : e.components || z : t = Ie(e.components), y.createElement(
|
|
27
|
+
ue.Provider,
|
|
28
|
+
{ value: t },
|
|
29
|
+
e.children
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
var $, Q;
|
|
33
|
+
function He() {
|
|
34
|
+
if (Q) return $;
|
|
35
|
+
Q = 1;
|
|
36
|
+
var e = typeof Element < "u", t = typeof Map == "function", r = typeof Set == "function", n = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
37
|
+
function a(s, o) {
|
|
38
|
+
if (s === o) return !0;
|
|
39
|
+
if (s && o && typeof s == "object" && typeof o == "object") {
|
|
40
|
+
if (s.constructor !== o.constructor) return !1;
|
|
41
|
+
var c, i, l;
|
|
42
|
+
if (Array.isArray(s)) {
|
|
43
|
+
if (c = s.length, c != o.length) return !1;
|
|
44
|
+
for (i = c; i-- !== 0; )
|
|
45
|
+
if (!a(s[i], o[i])) return !1;
|
|
46
|
+
return !0;
|
|
47
|
+
}
|
|
48
|
+
var f;
|
|
49
|
+
if (t && s instanceof Map && o instanceof Map) {
|
|
50
|
+
if (s.size !== o.size) return !1;
|
|
51
|
+
for (f = s.entries(); !(i = f.next()).done; )
|
|
52
|
+
if (!o.has(i.value[0])) return !1;
|
|
53
|
+
for (f = s.entries(); !(i = f.next()).done; )
|
|
54
|
+
if (!a(i.value[1], o.get(i.value[0]))) return !1;
|
|
55
|
+
return !0;
|
|
56
|
+
}
|
|
57
|
+
if (r && s instanceof Set && o instanceof Set) {
|
|
58
|
+
if (s.size !== o.size) return !1;
|
|
59
|
+
for (f = s.entries(); !(i = f.next()).done; )
|
|
60
|
+
if (!o.has(i.value[0])) return !1;
|
|
61
|
+
return !0;
|
|
62
|
+
}
|
|
63
|
+
if (n && ArrayBuffer.isView(s) && ArrayBuffer.isView(o)) {
|
|
64
|
+
if (c = s.length, c != o.length) return !1;
|
|
65
|
+
for (i = c; i-- !== 0; )
|
|
66
|
+
if (s[i] !== o[i]) return !1;
|
|
67
|
+
return !0;
|
|
68
|
+
}
|
|
69
|
+
if (s.constructor === RegExp) return s.source === o.source && s.flags === o.flags;
|
|
70
|
+
if (s.valueOf !== Object.prototype.valueOf && typeof s.valueOf == "function" && typeof o.valueOf == "function") return s.valueOf() === o.valueOf();
|
|
71
|
+
if (s.toString !== Object.prototype.toString && typeof s.toString == "function" && typeof o.toString == "function") return s.toString() === o.toString();
|
|
72
|
+
if (l = Object.keys(s), c = l.length, c !== Object.keys(o).length) return !1;
|
|
73
|
+
for (i = c; i-- !== 0; )
|
|
74
|
+
if (!Object.prototype.hasOwnProperty.call(o, l[i])) return !1;
|
|
75
|
+
if (e && s instanceof Element) return !1;
|
|
76
|
+
for (i = c; i-- !== 0; )
|
|
77
|
+
if (!((l[i] === "_owner" || l[i] === "__v" || l[i] === "__o") && s.$$typeof) && !a(s[l[i]], o[l[i]]))
|
|
78
|
+
return !1;
|
|
79
|
+
return !0;
|
|
80
|
+
}
|
|
81
|
+
return s !== s && o !== o;
|
|
82
|
+
}
|
|
83
|
+
return $ = function(o, c) {
|
|
84
|
+
try {
|
|
85
|
+
return a(o, c);
|
|
86
|
+
} catch (i) {
|
|
87
|
+
if ((i.message || "").match(/stack|recursion/i))
|
|
88
|
+
return console.warn("react-fast-compare cannot handle circular refs"), !1;
|
|
89
|
+
throw i;
|
|
90
|
+
}
|
|
91
|
+
}, $;
|
|
92
|
+
}
|
|
93
|
+
var Pe = He();
|
|
94
|
+
const Me = /* @__PURE__ */ X(Pe);
|
|
95
|
+
var D, ee;
|
|
96
|
+
function $e() {
|
|
97
|
+
if (ee) return D;
|
|
98
|
+
ee = 1;
|
|
99
|
+
var e = function(t, r, n, a, s, o, c, i) {
|
|
100
|
+
if (process.env.NODE_ENV !== "production" && r === void 0)
|
|
101
|
+
throw new Error("invariant requires an error message argument");
|
|
102
|
+
if (!t) {
|
|
103
|
+
var l;
|
|
104
|
+
if (r === void 0)
|
|
105
|
+
l = new Error(
|
|
106
|
+
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
107
|
+
);
|
|
108
|
+
else {
|
|
109
|
+
var f = [n, a, s, o, c, i], d = 0;
|
|
110
|
+
l = new Error(
|
|
111
|
+
r.replace(/%s/g, function() {
|
|
112
|
+
return f[d++];
|
|
113
|
+
})
|
|
114
|
+
), l.name = "Invariant Violation";
|
|
115
|
+
}
|
|
116
|
+
throw l.framesToPop = 1, l;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return D = e, D;
|
|
120
|
+
}
|
|
121
|
+
var De = $e();
|
|
122
|
+
const te = /* @__PURE__ */ X(De);
|
|
123
|
+
var N, re;
|
|
124
|
+
function Ne() {
|
|
125
|
+
return re || (re = 1, N = function(t, r, n, a) {
|
|
126
|
+
var s = n ? n.call(a, t, r) : void 0;
|
|
127
|
+
if (s !== void 0)
|
|
128
|
+
return !!s;
|
|
129
|
+
if (t === r)
|
|
130
|
+
return !0;
|
|
131
|
+
if (typeof t != "object" || !t || typeof r != "object" || !r)
|
|
132
|
+
return !1;
|
|
133
|
+
var o = Object.keys(t), c = Object.keys(r);
|
|
134
|
+
if (o.length !== c.length)
|
|
135
|
+
return !1;
|
|
136
|
+
for (var i = Object.prototype.hasOwnProperty.bind(r), l = 0; l < o.length; l++) {
|
|
137
|
+
var f = o[l];
|
|
138
|
+
if (!i(f))
|
|
139
|
+
return !1;
|
|
140
|
+
var d = t[f], h = r[f];
|
|
141
|
+
if (s = n ? n.call(a, d, h, f) : void 0, s === !1 || s === void 0 && d !== h)
|
|
142
|
+
return !1;
|
|
143
|
+
}
|
|
144
|
+
return !0;
|
|
145
|
+
}), N;
|
|
146
|
+
}
|
|
147
|
+
var _e = Ne();
|
|
148
|
+
const Re = /* @__PURE__ */ X(_e);
|
|
149
|
+
var fe = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(fe || {}), _ = {
|
|
150
|
+
link: { rel: ["amphtml", "canonical", "alternate"] },
|
|
151
|
+
script: { type: ["application/ld+json"] },
|
|
152
|
+
meta: {
|
|
153
|
+
charset: "",
|
|
154
|
+
name: ["generator", "robots", "description"],
|
|
155
|
+
property: [
|
|
156
|
+
"og:type",
|
|
157
|
+
"og:title",
|
|
158
|
+
"og:url",
|
|
159
|
+
"og:image",
|
|
160
|
+
"og:image:alt",
|
|
161
|
+
"og:description",
|
|
162
|
+
"twitter:url",
|
|
163
|
+
"twitter:title",
|
|
164
|
+
"twitter:description",
|
|
165
|
+
"twitter:image",
|
|
166
|
+
"twitter:image:alt",
|
|
167
|
+
"twitter:card",
|
|
168
|
+
"twitter:site"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}, ne = Object.values(fe), G = {
|
|
172
|
+
accesskey: "accessKey",
|
|
173
|
+
charset: "charSet",
|
|
174
|
+
class: "className",
|
|
175
|
+
contenteditable: "contentEditable",
|
|
176
|
+
contextmenu: "contextMenu",
|
|
177
|
+
"http-equiv": "httpEquiv",
|
|
178
|
+
itemprop: "itemProp",
|
|
179
|
+
tabindex: "tabIndex"
|
|
180
|
+
}, Le = Object.entries(G).reduce(
|
|
181
|
+
(e, [t, r]) => (e[r] = t, e),
|
|
182
|
+
{}
|
|
183
|
+
), v = "data-rh", A = {
|
|
184
|
+
DEFAULT_TITLE: "defaultTitle",
|
|
185
|
+
DEFER: "defer",
|
|
186
|
+
ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
|
|
187
|
+
ON_CHANGE_CLIENT_STATE: "onChangeClientState",
|
|
188
|
+
TITLE_TEMPLATE: "titleTemplate",
|
|
189
|
+
PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
|
|
190
|
+
}, w = (e, t) => {
|
|
191
|
+
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
192
|
+
const n = e[r];
|
|
193
|
+
if (Object.prototype.hasOwnProperty.call(n, t))
|
|
194
|
+
return n[t];
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
}, Fe = (e) => {
|
|
198
|
+
let t = w(
|
|
199
|
+
e,
|
|
200
|
+
"title"
|
|
201
|
+
/* TITLE */
|
|
202
|
+
);
|
|
203
|
+
const r = w(e, A.TITLE_TEMPLATE);
|
|
204
|
+
if (Array.isArray(t) && (t = t.join("")), r && t)
|
|
205
|
+
return r.replace(/%s/g, () => t);
|
|
206
|
+
const n = w(e, A.DEFAULT_TITLE);
|
|
207
|
+
return t || n || void 0;
|
|
208
|
+
}, qe = (e) => w(e, A.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
209
|
+
}), R = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), Ue = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
|
|
210
|
+
if (!r.length) {
|
|
211
|
+
const a = Object.keys(n);
|
|
212
|
+
for (let s = 0; s < a.length; s += 1) {
|
|
213
|
+
const c = a[s].toLowerCase();
|
|
214
|
+
if (e.indexOf(c) !== -1 && n[c])
|
|
215
|
+
return r.concat(n);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return r;
|
|
219
|
+
}, []), ze = (e) => console && typeof console.warn == "function" && console.warn(e), O = (e, t, r) => {
|
|
220
|
+
const n = {};
|
|
221
|
+
return r.filter((a) => Array.isArray(a[e]) ? !0 : (typeof a[e] < "u" && ze(
|
|
222
|
+
`Helmet: ${e} should be of type "Array". Instead found type "${typeof a[e]}"`
|
|
223
|
+
), !1)).map((a) => a[e]).reverse().reduce((a, s) => {
|
|
224
|
+
const o = {};
|
|
225
|
+
s.filter((i) => {
|
|
226
|
+
let l;
|
|
227
|
+
const f = Object.keys(i);
|
|
228
|
+
for (let h = 0; h < f.length; h += 1) {
|
|
229
|
+
const p = f[h], b = p.toLowerCase();
|
|
230
|
+
t.indexOf(b) !== -1 && !(l === "rel" && i[l].toLowerCase() === "canonical") && !(b === "rel" && i[b].toLowerCase() === "stylesheet") && (l = b), t.indexOf(p) !== -1 && (p === "innerHTML" || p === "cssText" || p === "itemprop") && (l = p);
|
|
231
|
+
}
|
|
232
|
+
if (!l || !i[l])
|
|
233
|
+
return !1;
|
|
234
|
+
const d = i[l].toLowerCase();
|
|
235
|
+
return n[l] || (n[l] = {}), o[l] || (o[l] = {}), n[l][d] ? !1 : (o[l][d] = !0, !0);
|
|
236
|
+
}).reverse().forEach((i) => a.push(i));
|
|
237
|
+
const c = Object.keys(o);
|
|
238
|
+
for (let i = 0; i < c.length; i += 1) {
|
|
239
|
+
const l = c[i], f = {
|
|
240
|
+
...n[l],
|
|
241
|
+
...o[l]
|
|
242
|
+
};
|
|
243
|
+
n[l] = f;
|
|
244
|
+
}
|
|
245
|
+
return a;
|
|
246
|
+
}, []).reverse();
|
|
247
|
+
}, Ve = (e, t) => {
|
|
248
|
+
if (Array.isArray(e) && e.length) {
|
|
249
|
+
for (let r = 0; r < e.length; r += 1)
|
|
250
|
+
if (e[r][t])
|
|
251
|
+
return !0;
|
|
252
|
+
}
|
|
253
|
+
return !1;
|
|
254
|
+
}, Ke = (e) => ({
|
|
255
|
+
baseTag: Ue([
|
|
256
|
+
"href"
|
|
257
|
+
/* HREF */
|
|
258
|
+
], e),
|
|
259
|
+
bodyAttributes: R("bodyAttributes", e),
|
|
260
|
+
defer: w(e, A.DEFER),
|
|
261
|
+
encode: w(e, A.ENCODE_SPECIAL_CHARACTERS),
|
|
262
|
+
htmlAttributes: R("htmlAttributes", e),
|
|
263
|
+
linkTags: O(
|
|
264
|
+
"link",
|
|
265
|
+
[
|
|
266
|
+
"rel",
|
|
267
|
+
"href"
|
|
268
|
+
/* HREF */
|
|
269
|
+
],
|
|
270
|
+
e
|
|
271
|
+
),
|
|
272
|
+
metaTags: O(
|
|
273
|
+
"meta",
|
|
274
|
+
[
|
|
275
|
+
"name",
|
|
276
|
+
"charset",
|
|
277
|
+
"http-equiv",
|
|
278
|
+
"property",
|
|
279
|
+
"itemprop"
|
|
280
|
+
/* ITEM_PROP */
|
|
281
|
+
],
|
|
282
|
+
e
|
|
283
|
+
),
|
|
284
|
+
noscriptTags: O("noscript", [
|
|
285
|
+
"innerHTML"
|
|
286
|
+
/* INNER_HTML */
|
|
287
|
+
], e),
|
|
288
|
+
onChangeClientState: qe(e),
|
|
289
|
+
scriptTags: O(
|
|
290
|
+
"script",
|
|
291
|
+
[
|
|
292
|
+
"src",
|
|
293
|
+
"innerHTML"
|
|
294
|
+
/* INNER_HTML */
|
|
295
|
+
],
|
|
296
|
+
e
|
|
297
|
+
),
|
|
298
|
+
styleTags: O("style", [
|
|
299
|
+
"cssText"
|
|
300
|
+
/* CSS_TEXT */
|
|
301
|
+
], e),
|
|
302
|
+
title: Fe(e),
|
|
303
|
+
titleAttributes: R("titleAttributes", e),
|
|
304
|
+
prioritizeSeoTags: Ve(e, A.PRIORITIZE_SEO_TAGS)
|
|
305
|
+
}), de = (e) => Array.isArray(e) ? e.join("") : e, Be = (e, t) => {
|
|
306
|
+
const r = Object.keys(e);
|
|
307
|
+
for (let n = 0; n < r.length; n += 1)
|
|
308
|
+
if (t[r[n]] && t[r[n]].includes(e[r[n]]))
|
|
309
|
+
return !0;
|
|
310
|
+
return !1;
|
|
311
|
+
}, L = (e, t) => Array.isArray(e) ? e.reduce(
|
|
312
|
+
(r, n) => (Be(n, t) ? r.priority.push(n) : r.default.push(n), r),
|
|
313
|
+
{ priority: [], default: [] }
|
|
314
|
+
) : { default: e, priority: [] }, se = (e, t) => ({
|
|
315
|
+
...e,
|
|
316
|
+
[t]: void 0
|
|
317
|
+
}), We = [
|
|
318
|
+
"noscript",
|
|
319
|
+
"script",
|
|
320
|
+
"style"
|
|
321
|
+
/* STYLE */
|
|
322
|
+
], V = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), pe = (e) => Object.keys(e).reduce((t, r) => {
|
|
323
|
+
const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
|
|
324
|
+
return t ? `${t} ${n}` : n;
|
|
325
|
+
}, ""), Ye = (e, t, r, n) => {
|
|
326
|
+
const a = pe(r), s = de(t);
|
|
327
|
+
return a ? `<${e} ${v}="true" ${a}>${V(
|
|
328
|
+
s,
|
|
329
|
+
n
|
|
330
|
+
)}</${e}>` : `<${e} ${v}="true">${V(
|
|
331
|
+
s,
|
|
332
|
+
n
|
|
333
|
+
)}</${e}>`;
|
|
334
|
+
}, Xe = (e, t, r = !0) => t.reduce((n, a) => {
|
|
335
|
+
const s = a, o = Object.keys(s).filter(
|
|
336
|
+
(l) => !(l === "innerHTML" || l === "cssText")
|
|
337
|
+
).reduce((l, f) => {
|
|
338
|
+
const d = typeof s[f] > "u" ? f : `${f}="${V(s[f], r)}"`;
|
|
339
|
+
return l ? `${l} ${d}` : d;
|
|
340
|
+
}, ""), c = s.innerHTML || s.cssText || "", i = We.indexOf(e) === -1;
|
|
341
|
+
return `${n}<${e} ${v}="true" ${o}${i ? "/>" : `>${c}</${e}>`}`;
|
|
342
|
+
}, ""), he = (e, t = {}) => Object.keys(e).reduce((r, n) => {
|
|
343
|
+
const a = G[n];
|
|
344
|
+
return r[a || n] = e[n], r;
|
|
345
|
+
}, t), Ze = (e, t, r) => {
|
|
346
|
+
const n = {
|
|
347
|
+
key: t,
|
|
348
|
+
[v]: !0
|
|
349
|
+
}, a = he(r, n);
|
|
350
|
+
return [y.createElement("title", a, t)];
|
|
351
|
+
}, P = (e, t) => t.map((r, n) => {
|
|
352
|
+
const a = {
|
|
353
|
+
key: n,
|
|
354
|
+
[v]: !0
|
|
355
|
+
};
|
|
356
|
+
return Object.keys(r).forEach((s) => {
|
|
357
|
+
const c = G[s] || s;
|
|
358
|
+
if (c === "innerHTML" || c === "cssText") {
|
|
359
|
+
const i = r.innerHTML || r.cssText;
|
|
360
|
+
a.dangerouslySetInnerHTML = { __html: i };
|
|
361
|
+
} else
|
|
362
|
+
a[c] = r[s];
|
|
363
|
+
}), y.createElement(e, a);
|
|
364
|
+
}), g = (e, t, r = !0) => {
|
|
365
|
+
switch (e) {
|
|
366
|
+
case "title":
|
|
367
|
+
return {
|
|
368
|
+
toComponent: () => Ze(e, t.title, t.titleAttributes),
|
|
369
|
+
toString: () => Ye(e, t.title, t.titleAttributes, r)
|
|
370
|
+
};
|
|
371
|
+
case "bodyAttributes":
|
|
372
|
+
case "htmlAttributes":
|
|
373
|
+
return {
|
|
374
|
+
toComponent: () => he(t),
|
|
375
|
+
toString: () => pe(t)
|
|
376
|
+
};
|
|
377
|
+
default:
|
|
378
|
+
return {
|
|
379
|
+
toComponent: () => P(e, t),
|
|
380
|
+
toString: () => Xe(e, t, r)
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}, Ge = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
|
|
384
|
+
const a = L(e, _.meta), s = L(t, _.link), o = L(r, _.script);
|
|
385
|
+
return {
|
|
386
|
+
priorityMethods: {
|
|
387
|
+
toComponent: () => [
|
|
388
|
+
...P("meta", a.priority),
|
|
389
|
+
...P("link", s.priority),
|
|
390
|
+
...P("script", o.priority)
|
|
391
|
+
],
|
|
392
|
+
toString: () => (
|
|
393
|
+
// generate all the tags as strings and concatenate them
|
|
394
|
+
`${g("meta", a.priority, n)} ${g(
|
|
395
|
+
"link",
|
|
396
|
+
s.priority,
|
|
397
|
+
n
|
|
398
|
+
)} ${g("script", o.priority, n)}`
|
|
399
|
+
)
|
|
400
|
+
},
|
|
401
|
+
metaTags: a.default,
|
|
402
|
+
linkTags: s.default,
|
|
403
|
+
scriptTags: o.default
|
|
404
|
+
};
|
|
405
|
+
}, Je = (e) => {
|
|
406
|
+
const {
|
|
407
|
+
baseTag: t,
|
|
408
|
+
bodyAttributes: r,
|
|
409
|
+
encode: n = !0,
|
|
410
|
+
htmlAttributes: a,
|
|
411
|
+
noscriptTags: s,
|
|
412
|
+
styleTags: o,
|
|
413
|
+
title: c = "",
|
|
414
|
+
titleAttributes: i,
|
|
415
|
+
prioritizeSeoTags: l
|
|
416
|
+
} = e;
|
|
417
|
+
let { linkTags: f, metaTags: d, scriptTags: h } = e, p = {
|
|
418
|
+
toComponent: () => {
|
|
419
|
+
},
|
|
420
|
+
toString: () => ""
|
|
421
|
+
};
|
|
422
|
+
return l && ({ priorityMethods: p, linkTags: f, metaTags: d, scriptTags: h } = Ge(e)), {
|
|
423
|
+
priority: p,
|
|
424
|
+
base: g("base", t, n),
|
|
425
|
+
bodyAttributes: g("bodyAttributes", r, n),
|
|
426
|
+
htmlAttributes: g("htmlAttributes", a, n),
|
|
427
|
+
link: g("link", f, n),
|
|
428
|
+
meta: g("meta", d, n),
|
|
429
|
+
noscript: g("noscript", s, n),
|
|
430
|
+
script: g("script", h, n),
|
|
431
|
+
style: g("style", o, n),
|
|
432
|
+
title: g("title", { title: c, titleAttributes: i }, n)
|
|
433
|
+
};
|
|
434
|
+
}, K = Je, H = [], me = !!(typeof window < "u" && window.document && window.document.createElement), B = class {
|
|
435
|
+
constructor(e, t) {
|
|
436
|
+
T(this, "instances", []);
|
|
437
|
+
T(this, "canUseDOM", me);
|
|
438
|
+
T(this, "context");
|
|
439
|
+
T(this, "value", {
|
|
440
|
+
setHelmet: (e) => {
|
|
441
|
+
this.context.helmet = e;
|
|
442
|
+
},
|
|
443
|
+
helmetInstances: {
|
|
444
|
+
get: () => this.canUseDOM ? H : this.instances,
|
|
445
|
+
add: (e) => {
|
|
446
|
+
(this.canUseDOM ? H : this.instances).push(e);
|
|
447
|
+
},
|
|
448
|
+
remove: (e) => {
|
|
449
|
+
const t = (this.canUseDOM ? H : this.instances).indexOf(e);
|
|
450
|
+
(this.canUseDOM ? H : this.instances).splice(t, 1);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
this.context = e, this.canUseDOM = t || !1, t || (e.helmet = K({
|
|
455
|
+
baseTag: [],
|
|
456
|
+
bodyAttributes: {},
|
|
457
|
+
htmlAttributes: {},
|
|
458
|
+
linkTags: [],
|
|
459
|
+
metaTags: [],
|
|
460
|
+
noscriptTags: [],
|
|
461
|
+
scriptTags: [],
|
|
462
|
+
styleTags: [],
|
|
463
|
+
title: "",
|
|
464
|
+
titleAttributes: {}
|
|
465
|
+
}));
|
|
466
|
+
}
|
|
467
|
+
}, Qe = {}, ge = y.createContext(Qe), x, et = (x = class extends Y {
|
|
468
|
+
constructor(r) {
|
|
469
|
+
super(r);
|
|
470
|
+
T(this, "helmetData");
|
|
471
|
+
this.helmetData = new B(this.props.context || {}, x.canUseDOM);
|
|
472
|
+
}
|
|
473
|
+
render() {
|
|
474
|
+
return /* @__PURE__ */ y.createElement(ge.Provider, { value: this.helmetData.value }, this.props.children);
|
|
475
|
+
}
|
|
476
|
+
}, T(x, "canUseDOM", me), x), C = (e, t) => {
|
|
477
|
+
const r = document.head || document.querySelector(
|
|
478
|
+
"head"
|
|
479
|
+
/* HEAD */
|
|
480
|
+
), n = r.querySelectorAll(`${e}[${v}]`), a = [].slice.call(n), s = [];
|
|
481
|
+
let o;
|
|
482
|
+
return t && t.length && t.forEach((c) => {
|
|
483
|
+
const i = document.createElement(e);
|
|
484
|
+
for (const l in c)
|
|
485
|
+
if (Object.prototype.hasOwnProperty.call(c, l))
|
|
486
|
+
if (l === "innerHTML")
|
|
487
|
+
i.innerHTML = c.innerHTML;
|
|
488
|
+
else if (l === "cssText")
|
|
489
|
+
i.styleSheet ? i.styleSheet.cssText = c.cssText : i.appendChild(document.createTextNode(c.cssText));
|
|
490
|
+
else {
|
|
491
|
+
const f = l, d = typeof c[f] > "u" ? "" : c[f];
|
|
492
|
+
i.setAttribute(l, d);
|
|
493
|
+
}
|
|
494
|
+
i.setAttribute(v, "true"), a.some((l, f) => (o = f, i.isEqualNode(l))) ? a.splice(o, 1) : s.push(i);
|
|
495
|
+
}), a.forEach((c) => {
|
|
496
|
+
var i;
|
|
497
|
+
return (i = c.parentNode) == null ? void 0 : i.removeChild(c);
|
|
498
|
+
}), s.forEach((c) => r.appendChild(c)), {
|
|
499
|
+
oldTags: a,
|
|
500
|
+
newTags: s
|
|
501
|
+
};
|
|
502
|
+
}, W = (e, t) => {
|
|
503
|
+
const r = document.getElementsByTagName(e)[0];
|
|
504
|
+
if (!r)
|
|
505
|
+
return;
|
|
506
|
+
const n = r.getAttribute(v), a = n ? n.split(",") : [], s = [...a], o = Object.keys(t);
|
|
507
|
+
for (const c of o) {
|
|
508
|
+
const i = t[c] || "";
|
|
509
|
+
r.getAttribute(c) !== i && r.setAttribute(c, i), a.indexOf(c) === -1 && a.push(c);
|
|
510
|
+
const l = s.indexOf(c);
|
|
511
|
+
l !== -1 && s.splice(l, 1);
|
|
512
|
+
}
|
|
513
|
+
for (let c = s.length - 1; c >= 0; c -= 1)
|
|
514
|
+
r.removeAttribute(s[c]);
|
|
515
|
+
a.length === s.length ? r.removeAttribute(v) : r.getAttribute(v) !== o.join(",") && r.setAttribute(v, o.join(","));
|
|
516
|
+
}, tt = (e, t) => {
|
|
517
|
+
typeof e < "u" && document.title !== e && (document.title = de(e)), W("title", t);
|
|
518
|
+
}, ae = (e, t) => {
|
|
519
|
+
const {
|
|
520
|
+
baseTag: r,
|
|
521
|
+
bodyAttributes: n,
|
|
522
|
+
htmlAttributes: a,
|
|
523
|
+
linkTags: s,
|
|
524
|
+
metaTags: o,
|
|
525
|
+
noscriptTags: c,
|
|
526
|
+
onChangeClientState: i,
|
|
527
|
+
scriptTags: l,
|
|
528
|
+
styleTags: f,
|
|
529
|
+
title: d,
|
|
530
|
+
titleAttributes: h
|
|
531
|
+
} = e;
|
|
532
|
+
W("body", n), W("html", a), tt(d, h);
|
|
533
|
+
const p = {
|
|
534
|
+
baseTag: C("base", r),
|
|
535
|
+
linkTags: C("link", s),
|
|
536
|
+
metaTags: C("meta", o),
|
|
537
|
+
noscriptTags: C("noscript", c),
|
|
538
|
+
scriptTags: C("script", l),
|
|
539
|
+
styleTags: C("style", f)
|
|
540
|
+
}, b = {}, E = {};
|
|
541
|
+
Object.keys(p).forEach((m) => {
|
|
542
|
+
const { newTags: I, oldTags: be } = p[m];
|
|
543
|
+
I.length && (b[m] = I), be.length && (E[m] = p[m].oldTags);
|
|
544
|
+
}), t && t(), i(e, b, E);
|
|
545
|
+
}, k = null, rt = (e) => {
|
|
546
|
+
k && cancelAnimationFrame(k), e.defer ? k = requestAnimationFrame(() => {
|
|
547
|
+
ae(e, () => {
|
|
548
|
+
k = null;
|
|
549
|
+
});
|
|
550
|
+
}) : (ae(e), k = null);
|
|
551
|
+
}, nt = rt, oe = class extends Y {
|
|
552
|
+
constructor() {
|
|
553
|
+
super(...arguments);
|
|
554
|
+
T(this, "rendered", !1);
|
|
555
|
+
}
|
|
556
|
+
shouldComponentUpdate(t) {
|
|
557
|
+
return !Re(t, this.props);
|
|
558
|
+
}
|
|
559
|
+
componentDidUpdate() {
|
|
560
|
+
this.emitChange();
|
|
561
|
+
}
|
|
562
|
+
componentWillUnmount() {
|
|
563
|
+
const { helmetInstances: t } = this.props.context;
|
|
564
|
+
t.remove(this), this.emitChange();
|
|
565
|
+
}
|
|
566
|
+
emitChange() {
|
|
567
|
+
const { helmetInstances: t, setHelmet: r } = this.props.context;
|
|
568
|
+
let n = null;
|
|
569
|
+
const a = Ke(
|
|
570
|
+
t.get().map((s) => {
|
|
571
|
+
const o = { ...s.props };
|
|
572
|
+
return delete o.context, o;
|
|
573
|
+
})
|
|
574
|
+
);
|
|
575
|
+
et.canUseDOM ? nt(a) : K && (n = K(a)), r(n);
|
|
576
|
+
}
|
|
577
|
+
// componentWillMount will be deprecated
|
|
578
|
+
// for SSR, initialize on first render
|
|
579
|
+
// constructor is also unsafe in StrictMode
|
|
580
|
+
init() {
|
|
581
|
+
if (this.rendered)
|
|
582
|
+
return;
|
|
583
|
+
this.rendered = !0;
|
|
584
|
+
const { helmetInstances: t } = this.props.context;
|
|
585
|
+
t.add(this), this.emitChange();
|
|
586
|
+
}
|
|
587
|
+
render() {
|
|
588
|
+
return this.init(), null;
|
|
589
|
+
}
|
|
590
|
+
}, q, xt = (q = class extends Y {
|
|
591
|
+
shouldComponentUpdate(e) {
|
|
592
|
+
return !Me(se(this.props, "helmetData"), se(e, "helmetData"));
|
|
593
|
+
}
|
|
594
|
+
mapNestedChildrenToProps(e, t) {
|
|
595
|
+
if (!t)
|
|
596
|
+
return null;
|
|
597
|
+
switch (e.type) {
|
|
598
|
+
case "script":
|
|
599
|
+
case "noscript":
|
|
600
|
+
return {
|
|
601
|
+
innerHTML: t
|
|
602
|
+
};
|
|
603
|
+
case "style":
|
|
604
|
+
return {
|
|
605
|
+
cssText: t
|
|
606
|
+
};
|
|
607
|
+
default:
|
|
608
|
+
throw new Error(
|
|
609
|
+
`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
flattenArrayTypeChildren(e, t, r, n) {
|
|
614
|
+
return {
|
|
615
|
+
...t,
|
|
616
|
+
[e.type]: [
|
|
617
|
+
...t[e.type] || [],
|
|
618
|
+
{
|
|
619
|
+
...r,
|
|
620
|
+
...this.mapNestedChildrenToProps(e, n)
|
|
621
|
+
}
|
|
622
|
+
]
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
mapObjectTypeChildren(e, t, r, n) {
|
|
626
|
+
switch (e.type) {
|
|
627
|
+
case "title":
|
|
628
|
+
return {
|
|
629
|
+
...t,
|
|
630
|
+
[e.type]: n,
|
|
631
|
+
titleAttributes: { ...r }
|
|
632
|
+
};
|
|
633
|
+
case "body":
|
|
634
|
+
return {
|
|
635
|
+
...t,
|
|
636
|
+
bodyAttributes: { ...r }
|
|
637
|
+
};
|
|
638
|
+
case "html":
|
|
639
|
+
return {
|
|
640
|
+
...t,
|
|
641
|
+
htmlAttributes: { ...r }
|
|
642
|
+
};
|
|
643
|
+
default:
|
|
644
|
+
return {
|
|
645
|
+
...t,
|
|
646
|
+
[e.type]: { ...r }
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
mapArrayTypeChildrenToProps(e, t) {
|
|
651
|
+
let r = { ...t };
|
|
652
|
+
return Object.keys(e).forEach((n) => {
|
|
653
|
+
r = {
|
|
654
|
+
...r,
|
|
655
|
+
[n]: e[n]
|
|
656
|
+
};
|
|
657
|
+
}), r;
|
|
658
|
+
}
|
|
659
|
+
warnOnInvalidChildren(e, t) {
|
|
660
|
+
return te(
|
|
661
|
+
ne.some((r) => e.type === r),
|
|
662
|
+
typeof e.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : `Only elements types ${ne.join(
|
|
663
|
+
", "
|
|
664
|
+
)} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`
|
|
665
|
+
), te(
|
|
666
|
+
!t || typeof t == "string" || Array.isArray(t) && !t.some((r) => typeof r != "string"),
|
|
667
|
+
`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`
|
|
668
|
+
), !0;
|
|
669
|
+
}
|
|
670
|
+
mapChildrenToProps(e, t) {
|
|
671
|
+
let r = {};
|
|
672
|
+
return y.Children.forEach(e, (n) => {
|
|
673
|
+
if (!n || !n.props)
|
|
674
|
+
return;
|
|
675
|
+
const { children: a, ...s } = n.props, o = Object.keys(s).reduce((i, l) => (i[Le[l] || l] = s[l], i), {});
|
|
676
|
+
let { type: c } = n;
|
|
677
|
+
switch (typeof c == "symbol" ? c = c.toString() : this.warnOnInvalidChildren(n, a), c) {
|
|
678
|
+
case "Symbol(react.fragment)":
|
|
679
|
+
t = this.mapChildrenToProps(a, t);
|
|
680
|
+
break;
|
|
681
|
+
case "link":
|
|
682
|
+
case "meta":
|
|
683
|
+
case "noscript":
|
|
684
|
+
case "script":
|
|
685
|
+
case "style":
|
|
686
|
+
r = this.flattenArrayTypeChildren(
|
|
687
|
+
n,
|
|
688
|
+
r,
|
|
689
|
+
o,
|
|
690
|
+
a
|
|
691
|
+
);
|
|
692
|
+
break;
|
|
693
|
+
default:
|
|
694
|
+
t = this.mapObjectTypeChildren(n, t, o, a);
|
|
695
|
+
break;
|
|
696
|
+
}
|
|
697
|
+
}), this.mapArrayTypeChildrenToProps(r, t);
|
|
698
|
+
}
|
|
699
|
+
render() {
|
|
700
|
+
const { children: e, ...t } = this.props;
|
|
701
|
+
let r = { ...t }, { helmetData: n } = t;
|
|
702
|
+
if (e && (r = this.mapChildrenToProps(e, r)), n && !(n instanceof B)) {
|
|
703
|
+
const a = n;
|
|
704
|
+
n = new B(a.context, !0), delete r.helmetData;
|
|
705
|
+
}
|
|
706
|
+
return n ? /* @__PURE__ */ y.createElement(oe, { ...r, context: n.value }) : /* @__PURE__ */ y.createElement(ge.Consumer, null, (a) => /* @__PURE__ */ y.createElement(oe, { ...r, context: a }));
|
|
707
|
+
}
|
|
708
|
+
}, T(q, "defaultProps", {
|
|
709
|
+
defer: !0,
|
|
710
|
+
encodeSpecialCharacters: !0,
|
|
711
|
+
prioritizeSeoTags: !1
|
|
712
|
+
}), q);
|
|
713
|
+
const st = (e) => {
|
|
714
|
+
const t = le(), r = ve(), n = typeof e.to == "string" ? e.to : e.to.hash, a = (s) => {
|
|
715
|
+
var o;
|
|
716
|
+
(o = e.onClick) == null || o.call(e, s), !(!(n != null && n.startsWith("#")) || n !== t.hash) && (s.preventDefault(), r(n));
|
|
717
|
+
};
|
|
718
|
+
return /* @__PURE__ */ u.jsx(Ae, { ...e, onClick: a });
|
|
719
|
+
}, at = {
|
|
720
|
+
green: "bg-green-400 dark:bg-green-800",
|
|
721
|
+
blue: "bg-sky-400 dark:bg-sky-800",
|
|
722
|
+
yellow: "bg-yellow-400 dark:bg-yellow-800",
|
|
723
|
+
red: "bg-red-400 dark:bg-red-800",
|
|
724
|
+
purple: "bg-purple-400 dark:bg-purple-600",
|
|
725
|
+
indigo: "bg-indigo-400 dark:bg-indigo-600",
|
|
726
|
+
gray: "bg-gray-400 dark:bg-gray-600",
|
|
727
|
+
outline: "border border-border rounded-md text-foreground"
|
|
728
|
+
}, ot = {
|
|
729
|
+
green: "text-green-500 dark:text-green-600",
|
|
730
|
+
blue: "text-sky-400 dark:text-sky-600",
|
|
731
|
+
yellow: "text-yellow-400 dark:text-yellow-600",
|
|
732
|
+
red: "text-red-400 dark:text-red-600",
|
|
733
|
+
purple: "text-purple-400 dark:text-purple-600",
|
|
734
|
+
indigo: "text-indigo-400 dark:text-indigo-600",
|
|
735
|
+
gray: "text-gray-400 dark:text-gray-600",
|
|
736
|
+
outline: ""
|
|
737
|
+
}, F = ({
|
|
738
|
+
color: e,
|
|
739
|
+
label: t,
|
|
740
|
+
className: r,
|
|
741
|
+
invert: n
|
|
742
|
+
}) => /* @__PURE__ */ u.jsx(
|
|
743
|
+
"span",
|
|
744
|
+
{
|
|
745
|
+
className: S(
|
|
746
|
+
"flex items-center duration-200 transition-opacity text-center uppercase text-[0.65rem] font-bold rounded text-background dark:text-zinc-50 h-full",
|
|
747
|
+
e === "outline" ? "px-3" : "mt-0.5 px-1",
|
|
748
|
+
n ? ot[e] : at[e],
|
|
749
|
+
r
|
|
750
|
+
),
|
|
751
|
+
children: t
|
|
752
|
+
}
|
|
753
|
+
), it = ({
|
|
754
|
+
category: e,
|
|
755
|
+
onRequestClose: t
|
|
756
|
+
}) => {
|
|
757
|
+
var b, E;
|
|
758
|
+
const r = je(e), [n, a] = J(!1), s = e.collapsible ?? !0, o = e.collapsed ?? !0, c = !!(!s || !o || r), [i, l] = J(c), f = we(((b = e.link) == null ? void 0 : b.id) ?? "");
|
|
759
|
+
ie(() => {
|
|
760
|
+
r && l(!0);
|
|
761
|
+
}, [r]);
|
|
762
|
+
const d = s && /* @__PURE__ */ u.jsx(
|
|
763
|
+
"button",
|
|
764
|
+
{
|
|
765
|
+
type: "button",
|
|
766
|
+
onClick: (m) => {
|
|
767
|
+
m.preventDefault(), l((I) => !I), a(!0);
|
|
768
|
+
},
|
|
769
|
+
children: /* @__PURE__ */ u.jsx(
|
|
770
|
+
ke,
|
|
771
|
+
{
|
|
772
|
+
size: 16,
|
|
773
|
+
className: S(
|
|
774
|
+
n && "transition",
|
|
775
|
+
"shrink-0 group-data-[state=open]:rotate-90"
|
|
776
|
+
)
|
|
777
|
+
}
|
|
778
|
+
)
|
|
779
|
+
}
|
|
780
|
+
), h = e.icon && /* @__PURE__ */ u.jsx(
|
|
781
|
+
e.icon,
|
|
782
|
+
{
|
|
783
|
+
size: 16,
|
|
784
|
+
className: S("align-[-0.125em] ", f && "text-primary")
|
|
785
|
+
}
|
|
786
|
+
), p = j({
|
|
787
|
+
className: [
|
|
788
|
+
"text-start font-medium",
|
|
789
|
+
s || typeof e.link < "u" ? "cursor-pointer" : "cursor-default hover:bg-transparent"
|
|
790
|
+
]
|
|
791
|
+
});
|
|
792
|
+
return /* @__PURE__ */ u.jsxs(
|
|
793
|
+
M.Root,
|
|
794
|
+
{
|
|
795
|
+
className: "flex flex-col",
|
|
796
|
+
defaultOpen: c,
|
|
797
|
+
open: i,
|
|
798
|
+
onOpenChange: () => l(!0),
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ u.jsx(M.Trigger, { className: "group", asChild: !0, disabled: !s, children: ((E = e.link) == null ? void 0 : E.type) === "doc" ? /* @__PURE__ */ u.jsxs(
|
|
801
|
+
U,
|
|
802
|
+
{
|
|
803
|
+
to: ce(e.link.id),
|
|
804
|
+
className: p,
|
|
805
|
+
onClick: () => {
|
|
806
|
+
a(!0), f && !i && l(!0);
|
|
807
|
+
},
|
|
808
|
+
children: [
|
|
809
|
+
h,
|
|
810
|
+
/* @__PURE__ */ u.jsxs(
|
|
811
|
+
"div",
|
|
812
|
+
{
|
|
813
|
+
className: S(
|
|
814
|
+
"flex items-center gap-2 justify-between w-full",
|
|
815
|
+
f ? "text-primary" : "text-foreground/80"
|
|
816
|
+
),
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ u.jsx("div", { className: "truncate", children: e.label }),
|
|
819
|
+
d
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
)
|
|
823
|
+
]
|
|
824
|
+
}
|
|
825
|
+
) : /* @__PURE__ */ u.jsxs("div", { onClick: () => a(!0), className: p, children: [
|
|
826
|
+
h,
|
|
827
|
+
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
828
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex gap-2 truncate w-full", children: e.label }),
|
|
829
|
+
d
|
|
830
|
+
] })
|
|
831
|
+
] }) }),
|
|
832
|
+
/* @__PURE__ */ u.jsx(
|
|
833
|
+
M.Content,
|
|
834
|
+
{
|
|
835
|
+
className: S(
|
|
836
|
+
// CollapsibleContent class is used to animate and it should only be applied when the user has triggered the toggle
|
|
837
|
+
n && "CollapsibleContent",
|
|
838
|
+
e.items.length === 0 && "hidden",
|
|
839
|
+
"ms-6 my-1"
|
|
840
|
+
),
|
|
841
|
+
children: /* @__PURE__ */ u.jsx("ul", { className: "relative after:absolute after:-left-[--padding-nav-item] after:translate-x-[1.5px] after:top-0 after:bottom-0 after:w-px after:bg-border", children: e.items.map((m) => /* @__PURE__ */ u.jsx(
|
|
842
|
+
lt,
|
|
843
|
+
{
|
|
844
|
+
onRequestClose: t,
|
|
845
|
+
item: m
|
|
846
|
+
},
|
|
847
|
+
("id" in m ? m.id : "") + ("href" in m ? m.href : "") + m.label
|
|
848
|
+
)) })
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
]
|
|
852
|
+
}
|
|
853
|
+
);
|
|
854
|
+
}, j = Oe(
|
|
855
|
+
"flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent",
|
|
856
|
+
{
|
|
857
|
+
variants: {
|
|
858
|
+
isActive: {
|
|
859
|
+
true: "text-primary font-medium",
|
|
860
|
+
false: "text-foreground/80"
|
|
861
|
+
},
|
|
862
|
+
isMuted: {
|
|
863
|
+
true: "text-foreground/30",
|
|
864
|
+
false: ""
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
defaultVariants: {
|
|
868
|
+
isActive: !1
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
), ye = "data-anchor", lt = ({
|
|
872
|
+
item: e,
|
|
873
|
+
onRequestClose: t
|
|
874
|
+
}) => {
|
|
875
|
+
var a, s;
|
|
876
|
+
const { activeAnchor: r } = Z(), [n] = Ee();
|
|
877
|
+
switch (e.type) {
|
|
878
|
+
case "category":
|
|
879
|
+
return /* @__PURE__ */ u.jsx(it, { category: e, onRequestClose: t });
|
|
880
|
+
case "doc":
|
|
881
|
+
return /* @__PURE__ */ u.jsxs(
|
|
882
|
+
U,
|
|
883
|
+
{
|
|
884
|
+
className: ({ isActive: o }) => j({ isActive: o }),
|
|
885
|
+
to: ce(e.id),
|
|
886
|
+
onClick: t,
|
|
887
|
+
end: !0,
|
|
888
|
+
children: [
|
|
889
|
+
e.icon && /* @__PURE__ */ u.jsx(e.icon, { size: 16, className: "align-[-0.125em]" }),
|
|
890
|
+
e.badge ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
891
|
+
/* @__PURE__ */ u.jsx("span", { className: "truncate flex-1", title: e.label, children: e.label }),
|
|
892
|
+
/* @__PURE__ */ u.jsx(F, { ...e.badge })
|
|
893
|
+
] }) : e.label
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
);
|
|
897
|
+
case "link":
|
|
898
|
+
return e.href.startsWith("#") ? /* @__PURE__ */ u.jsx(
|
|
899
|
+
st,
|
|
900
|
+
{
|
|
901
|
+
to: { hash: e.href, search: n.toString() },
|
|
902
|
+
[ye]: e.href.slice(1),
|
|
903
|
+
className: j({
|
|
904
|
+
isActive: e.href.slice(1) === r,
|
|
905
|
+
className: ((a = e.badge) == null ? void 0 : a.placement) !== "start" && "justify-between"
|
|
906
|
+
}),
|
|
907
|
+
onClick: t,
|
|
908
|
+
children: e.badge ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
909
|
+
/* @__PURE__ */ u.jsx("span", { className: "truncate", title: e.label, children: e.label }),
|
|
910
|
+
/* @__PURE__ */ u.jsx(F, { ...e.badge })
|
|
911
|
+
] }) : /* @__PURE__ */ u.jsx("span", { className: "break-all", children: e.label })
|
|
912
|
+
}
|
|
913
|
+
) : e.href.startsWith("http") ? /* @__PURE__ */ u.jsxs(
|
|
914
|
+
"a",
|
|
915
|
+
{
|
|
916
|
+
className: j(),
|
|
917
|
+
href: e.href,
|
|
918
|
+
target: "_blank",
|
|
919
|
+
rel: "noopener noreferrer",
|
|
920
|
+
onClick: t,
|
|
921
|
+
children: [
|
|
922
|
+
/* @__PURE__ */ u.jsx("span", { className: "whitespace-normal", children: e.label }),
|
|
923
|
+
/* @__PURE__ */ u.jsx("span", { className: "whitespace-nowrap", children: /* @__PURE__ */ u.jsx(Se, { className: "inline -translate-y-0.5", size: 12 }) })
|
|
924
|
+
]
|
|
925
|
+
}
|
|
926
|
+
) : /* @__PURE__ */ u.jsx(
|
|
927
|
+
U,
|
|
928
|
+
{
|
|
929
|
+
className: j({
|
|
930
|
+
isActive: e.href.split("#")[1] === r,
|
|
931
|
+
className: ((s = e.badge) == null ? void 0 : s.placement) !== "start" && "justify-between"
|
|
932
|
+
}),
|
|
933
|
+
to: e.href,
|
|
934
|
+
children: e.badge ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
935
|
+
/* @__PURE__ */ u.jsx("span", { className: "truncate", title: e.label, children: e.label }),
|
|
936
|
+
/* @__PURE__ */ u.jsx(F, { ...e.badge })
|
|
937
|
+
] }) : /* @__PURE__ */ u.jsx("span", { className: "break-all", children: e.label })
|
|
938
|
+
}
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
}, ct = (e, t = { block: "center" }) => {
|
|
942
|
+
if (!e) return;
|
|
943
|
+
const r = e.getBoundingClientRect();
|
|
944
|
+
r.top >= 0 && r.left >= 0 && r.bottom <= (window.innerHeight || document.documentElement.clientHeight) && r.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView(t);
|
|
945
|
+
}, ve = () => {
|
|
946
|
+
const { setActiveAnchor: e } = Z();
|
|
947
|
+
return Ce(
|
|
948
|
+
(r) => {
|
|
949
|
+
const n = r.replace(/^#/, ""), a = n.split("/").at(0), s = document.getElementById(decodeURIComponent(n)), o = document.querySelector(
|
|
950
|
+
`[${ye}="${a}"]`
|
|
951
|
+
);
|
|
952
|
+
return s ? (s.scrollIntoView(), ct(o), requestIdleCallback(() => e(a)), !0) : !1;
|
|
953
|
+
},
|
|
954
|
+
[e]
|
|
955
|
+
);
|
|
956
|
+
}, Ct = () => {
|
|
957
|
+
const e = le(), { setActiveAnchor: t } = Z(), r = ve();
|
|
958
|
+
ie(() => {
|
|
959
|
+
if (e.hash && !r(e.hash)) {
|
|
960
|
+
const n = new MutationObserver((a, s) => {
|
|
961
|
+
r(e.hash) && s.disconnect();
|
|
962
|
+
});
|
|
963
|
+
return n.observe(document.body, { childList: !0, subtree: !0 }), () => n.disconnect();
|
|
964
|
+
}
|
|
965
|
+
}, [e.hash, r, t]);
|
|
966
|
+
};
|
|
967
|
+
export {
|
|
968
|
+
st as A,
|
|
969
|
+
xt as H,
|
|
970
|
+
Tt as M,
|
|
971
|
+
lt as S,
|
|
972
|
+
et as a,
|
|
973
|
+
Ct as b,
|
|
974
|
+
ct as s,
|
|
975
|
+
Ie as u
|
|
976
|
+
};
|
|
977
|
+
//# sourceMappingURL=useScrollToAnchor-DKyrbZoy.js.map
|