zudoku 0.3.0-dev.16 → 0.3.0-dev.17

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.
Files changed (51) hide show
  1. package/dist/config/config.d.ts +1 -1
  2. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  3. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  4. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  5. package/dist/vite/plugin-api-keys.js +2 -2
  6. package/dist/vite/plugin-api-keys.js.map +1 -1
  7. package/dist/vite/plugin-api.js +2 -2
  8. package/dist/vite/plugin-api.js.map +1 -1
  9. package/dist/vite/plugin-docs.js +1 -1
  10. package/dist/vite/plugin-docs.js.map +1 -1
  11. package/dist/vite/plugin-redirect.js +2 -2
  12. package/dist/vite/plugin-redirect.js.map +1 -1
  13. package/lib/DevPortalProvider-CRKuwoXc.js +4123 -0
  14. package/lib/Markdown-5LmPZyLV.js +8620 -0
  15. package/lib/MdxComponents-DYD_QPVF.js +3017 -0
  16. package/lib/Select-DR3PiqjV.js +4569 -0
  17. package/lib/Spinner-DjQ2eBxC.js +181 -0
  18. package/lib/_commonjsHelpers-BkfeUUK-.js +28 -0
  19. package/lib/hook-FCY9-FHO.js +24 -0
  20. package/lib/index-By9bEW57.js +411 -0
  21. package/lib/{loglevel-CoH7VSwE.js → loglevel-CA34MiFn.js} +10 -10
  22. package/lib/state-Ds_OxRHP.js +288 -0
  23. package/lib/util-voKLTRDG.js +740 -0
  24. package/lib/zudoku.auth-auth0.js +1 -1
  25. package/lib/zudoku.auth-clerk.js +1 -1
  26. package/lib/zudoku.auth-openid.js +2 -2
  27. package/lib/zudoku.components.js +111 -104
  28. package/lib/zudoku.plugin-api-keys.js +292 -0
  29. package/lib/zudoku.plugin-markdown.js +255 -0
  30. package/lib/zudoku.plugin-openapi.js +6240 -0
  31. package/lib/zudoku.plugin-redirect.js +10 -0
  32. package/package.json +12 -3
  33. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  34. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  35. package/dist/lib/plugins/api-key/index.js.map +0 -1
  36. package/dist/lib/plugins/index.d.ts +0 -4
  37. package/dist/lib/plugins/index.js +0 -5
  38. package/dist/lib/plugins/index.js.map +0 -1
  39. package/lib/Spinner-Cf0Eb7YI.js +0 -8460
  40. package/lib/state-2Hu1renZ.js +0 -313
  41. package/lib/zudoku.plugins.js +0 -19918
  42. package/src/lib/plugins/index.ts +0 -4
  43. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  44. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +0 -0
  45. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  46. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.js +0 -0
  47. /package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +0 -0
  48. /package/dist/lib/plugins/{api-key → api-keys}/index.js +0 -0
  49. /package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +0 -0
  50. /package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +0 -0
  51. /package/src/lib/plugins/{api-key → api-keys}/index.tsx +0 -0
@@ -0,0 +1,740 @@
1
+ var oe = Object.defineProperty;
2
+ var ie = (e, t, r) => t in e ? oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var T = (e, t, r) => ie(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import d, { Component as L } from "react";
5
+ import { g as F } from "./_commonjsHelpers-BkfeUUK-.js";
6
+ import { u as ae, j as le, m as ce } from "./index-PyGcnQFX.js";
7
+ import { L as ue } from "./DevPortalProvider-CRKuwoXc.js";
8
+ const M = {}, W = d.createContext(M);
9
+ function fe(e) {
10
+ const t = d.useContext(W);
11
+ return d.useMemo(
12
+ function() {
13
+ return typeof e == "function" ? e(t) : { ...t, ...e };
14
+ },
15
+ [t, e]
16
+ );
17
+ }
18
+ function Ye(e) {
19
+ let t;
20
+ return e.disableParentContext ? t = typeof e.components == "function" ? e.components(M) : e.components || M : t = fe(e.components), d.createElement(
21
+ W.Provider,
22
+ { value: t },
23
+ e.children
24
+ );
25
+ }
26
+ var pe = typeof Element < "u", me = typeof Map == "function", de = typeof Set == "function", he = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
27
+ function x(e, t) {
28
+ if (e === t) return !0;
29
+ if (e && t && typeof e == "object" && typeof t == "object") {
30
+ if (e.constructor !== t.constructor) return !1;
31
+ var r, n, s;
32
+ if (Array.isArray(e)) {
33
+ if (r = e.length, r != t.length) return !1;
34
+ for (n = r; n-- !== 0; )
35
+ if (!x(e[n], t[n])) return !1;
36
+ return !0;
37
+ }
38
+ var o;
39
+ if (me && e instanceof Map && t instanceof Map) {
40
+ if (e.size !== t.size) return !1;
41
+ for (o = e.entries(); !(n = o.next()).done; )
42
+ if (!t.has(n.value[0])) return !1;
43
+ for (o = e.entries(); !(n = o.next()).done; )
44
+ if (!x(n.value[1], t.get(n.value[0]))) return !1;
45
+ return !0;
46
+ }
47
+ if (de && e instanceof Set && t instanceof Set) {
48
+ if (e.size !== t.size) return !1;
49
+ for (o = e.entries(); !(n = o.next()).done; )
50
+ if (!t.has(n.value[0])) return !1;
51
+ return !0;
52
+ }
53
+ if (he && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
54
+ if (r = e.length, r != t.length) return !1;
55
+ for (n = r; n-- !== 0; )
56
+ if (e[n] !== t[n]) return !1;
57
+ return !0;
58
+ }
59
+ if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
60
+ if (e.valueOf !== Object.prototype.valueOf && typeof e.valueOf == "function" && typeof t.valueOf == "function") return e.valueOf() === t.valueOf();
61
+ if (e.toString !== Object.prototype.toString && typeof e.toString == "function" && typeof t.toString == "function") return e.toString() === t.toString();
62
+ if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
63
+ for (n = r; n-- !== 0; )
64
+ if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
65
+ if (pe && e instanceof Element) return !1;
66
+ for (n = r; n-- !== 0; )
67
+ if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !x(e[s[n]], t[s[n]]))
68
+ return !1;
69
+ return !0;
70
+ }
71
+ return e !== e && t !== t;
72
+ }
73
+ var ye = function(t, r) {
74
+ try {
75
+ return x(t, r);
76
+ } catch (n) {
77
+ if ((n.message || "").match(/stack|recursion/i))
78
+ return console.warn("react-fast-compare cannot handle circular refs"), !1;
79
+ throw n;
80
+ }
81
+ };
82
+ const Te = /* @__PURE__ */ F(ye);
83
+ var ge = function(e, t, r, n, s, o, c, a) {
84
+ if (process.env.NODE_ENV !== "production" && t === void 0)
85
+ throw new Error("invariant requires an error message argument");
86
+ if (!e) {
87
+ var i;
88
+ if (t === void 0)
89
+ i = new Error(
90
+ "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
91
+ );
92
+ else {
93
+ var l = [r, n, s, o, c, a], u = 0;
94
+ i = new Error(
95
+ t.replace(/%s/g, function() {
96
+ return l[u++];
97
+ })
98
+ ), i.name = "Invariant Violation";
99
+ }
100
+ throw i.framesToPop = 1, i;
101
+ }
102
+ }, ve = ge;
103
+ const z = /* @__PURE__ */ F(ve);
104
+ var Ae = function(t, r, n, s) {
105
+ var o = n ? n.call(s, t, r) : void 0;
106
+ if (o !== void 0)
107
+ return !!o;
108
+ if (t === r)
109
+ return !0;
110
+ if (typeof t != "object" || !t || typeof r != "object" || !r)
111
+ return !1;
112
+ var c = Object.keys(t), a = Object.keys(r);
113
+ if (c.length !== a.length)
114
+ return !1;
115
+ for (var i = Object.prototype.hasOwnProperty.bind(r), l = 0; l < c.length; l++) {
116
+ var u = c[l];
117
+ if (!i(u))
118
+ return !1;
119
+ var f = t[u], h = r[u];
120
+ if (o = n ? n.call(s, f, h, u) : void 0, o === !1 || o === void 0 && f !== h)
121
+ return !1;
122
+ }
123
+ return !0;
124
+ };
125
+ const Ce = /* @__PURE__ */ F(Ae);
126
+ var Z = /* @__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))(Z || {}), $ = {
127
+ link: { rel: ["amphtml", "canonical", "alternate"] },
128
+ script: { type: ["application/ld+json"] },
129
+ meta: {
130
+ charset: "",
131
+ name: ["generator", "robots", "description"],
132
+ property: [
133
+ "og:type",
134
+ "og:title",
135
+ "og:url",
136
+ "og:image",
137
+ "og:image:alt",
138
+ "og:description",
139
+ "twitter:url",
140
+ "twitter:title",
141
+ "twitter:description",
142
+ "twitter:image",
143
+ "twitter:image:alt",
144
+ "twitter:card",
145
+ "twitter:site"
146
+ ]
147
+ }
148
+ }, V = Object.values(Z), U = {
149
+ accesskey: "accessKey",
150
+ charset: "charSet",
151
+ class: "className",
152
+ contenteditable: "contentEditable",
153
+ contextmenu: "contextMenu",
154
+ "http-equiv": "httpEquiv",
155
+ itemprop: "itemProp",
156
+ tabindex: "tabIndex"
157
+ }, Ee = Object.entries(U).reduce(
158
+ (e, [t, r]) => (e[r] = t, e),
159
+ {}
160
+ ), y = "data-rh", C = {
161
+ DEFAULT_TITLE: "defaultTitle",
162
+ DEFER: "defer",
163
+ ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
164
+ ON_CHANGE_CLIENT_STATE: "onChangeClientState",
165
+ TITLE_TEMPLATE: "titleTemplate",
166
+ PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
167
+ }, E = (e, t) => {
168
+ for (let r = e.length - 1; r >= 0; r -= 1) {
169
+ const n = e[r];
170
+ if (Object.prototype.hasOwnProperty.call(n, t))
171
+ return n[t];
172
+ }
173
+ return null;
174
+ }, be = (e) => {
175
+ let t = E(
176
+ e,
177
+ "title"
178
+ /* TITLE */
179
+ );
180
+ const r = E(e, C.TITLE_TEMPLATE);
181
+ if (Array.isArray(t) && (t = t.join("")), r && t)
182
+ return r.replace(/%s/g, () => t);
183
+ const n = E(e, C.DEFAULT_TITLE);
184
+ return t || n || void 0;
185
+ }, Oe = (e) => E(e, C.ON_CHANGE_CLIENT_STATE) || (() => {
186
+ }), I = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), Se = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
187
+ if (!r.length) {
188
+ const s = Object.keys(n);
189
+ for (let o = 0; o < s.length; o += 1) {
190
+ const a = s[o].toLowerCase();
191
+ if (e.indexOf(a) !== -1 && n[a])
192
+ return r.concat(n);
193
+ }
194
+ }
195
+ return r;
196
+ }, []), we = (e) => console && typeof console.warn == "function" && console.warn(e), b = (e, t, r) => {
197
+ const n = {};
198
+ return r.filter((s) => Array.isArray(s[e]) ? !0 : (typeof s[e] < "u" && we(
199
+ `Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`
200
+ ), !1)).map((s) => s[e]).reverse().reduce((s, o) => {
201
+ const c = {};
202
+ o.filter((i) => {
203
+ let l;
204
+ const u = Object.keys(i);
205
+ for (let h = 0; h < u.length; h += 1) {
206
+ const p = u[h], g = p.toLowerCase();
207
+ t.indexOf(g) !== -1 && !(l === "rel" && i[l].toLowerCase() === "canonical") && !(g === "rel" && i[g].toLowerCase() === "stylesheet") && (l = g), t.indexOf(p) !== -1 && (p === "innerHTML" || p === "cssText" || p === "itemprop") && (l = p);
208
+ }
209
+ if (!l || !i[l])
210
+ return !1;
211
+ const f = i[l].toLowerCase();
212
+ return n[l] || (n[l] = {}), c[l] || (c[l] = {}), n[l][f] ? !1 : (c[l][f] = !0, !0);
213
+ }).reverse().forEach((i) => s.push(i));
214
+ const a = Object.keys(c);
215
+ for (let i = 0; i < a.length; i += 1) {
216
+ const l = a[i], u = {
217
+ ...n[l],
218
+ ...c[l]
219
+ };
220
+ n[l] = u;
221
+ }
222
+ return s;
223
+ }, []).reverse();
224
+ }, xe = (e, t) => {
225
+ if (Array.isArray(e) && e.length) {
226
+ for (let r = 0; r < e.length; r += 1)
227
+ if (e[r][t])
228
+ return !0;
229
+ }
230
+ return !1;
231
+ }, Pe = (e) => ({
232
+ baseTag: Se([
233
+ "href"
234
+ /* HREF */
235
+ ], e),
236
+ bodyAttributes: I("bodyAttributes", e),
237
+ defer: E(e, C.DEFER),
238
+ encode: E(e, C.ENCODE_SPECIAL_CHARACTERS),
239
+ htmlAttributes: I("htmlAttributes", e),
240
+ linkTags: b(
241
+ "link",
242
+ [
243
+ "rel",
244
+ "href"
245
+ /* HREF */
246
+ ],
247
+ e
248
+ ),
249
+ metaTags: b(
250
+ "meta",
251
+ [
252
+ "name",
253
+ "charset",
254
+ "http-equiv",
255
+ "property",
256
+ "itemprop"
257
+ /* ITEM_PROP */
258
+ ],
259
+ e
260
+ ),
261
+ noscriptTags: b("noscript", [
262
+ "innerHTML"
263
+ /* INNER_HTML */
264
+ ], e),
265
+ onChangeClientState: Oe(e),
266
+ scriptTags: b(
267
+ "script",
268
+ [
269
+ "src",
270
+ "innerHTML"
271
+ /* INNER_HTML */
272
+ ],
273
+ e
274
+ ),
275
+ styleTags: b("style", [
276
+ "cssText"
277
+ /* CSS_TEXT */
278
+ ], e),
279
+ title: be(e),
280
+ titleAttributes: I("titleAttributes", e),
281
+ prioritizeSeoTags: xe(e, C.PRIORITIZE_SEO_TAGS)
282
+ }), G = (e) => Array.isArray(e) ? e.join("") : e, $e = (e, t) => {
283
+ const r = Object.keys(e);
284
+ for (let n = 0; n < r.length; n += 1)
285
+ if (t[r[n]] && t[r[n]].includes(e[r[n]]))
286
+ return !0;
287
+ return !1;
288
+ }, H = (e, t) => Array.isArray(e) ? e.reduce(
289
+ (r, n) => ($e(n, t) ? r.priority.push(n) : r.default.push(n), r),
290
+ { priority: [], default: [] }
291
+ ) : { default: e, priority: [] }, B = (e, t) => ({
292
+ ...e,
293
+ [t]: void 0
294
+ }), Ie = [
295
+ "noscript",
296
+ "script",
297
+ "style"
298
+ /* STYLE */
299
+ ], k = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), J = (e) => Object.keys(e).reduce((t, r) => {
300
+ const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
301
+ return t ? `${t} ${n}` : n;
302
+ }, ""), He = (e, t, r, n) => {
303
+ const s = J(r), o = G(t);
304
+ return s ? `<${e} ${y}="true" ${s}>${k(
305
+ o,
306
+ n
307
+ )}</${e}>` : `<${e} ${y}="true">${k(
308
+ o,
309
+ n
310
+ )}</${e}>`;
311
+ }, De = (e, t, r = !0) => t.reduce((n, s) => {
312
+ const o = s, c = Object.keys(o).filter(
313
+ (l) => !(l === "innerHTML" || l === "cssText")
314
+ ).reduce((l, u) => {
315
+ const f = typeof o[u] > "u" ? u : `${u}="${k(o[u], r)}"`;
316
+ return l ? `${l} ${f}` : f;
317
+ }, ""), a = o.innerHTML || o.cssText || "", i = Ie.indexOf(e) === -1;
318
+ return `${n}<${e} ${y}="true" ${c}${i ? "/>" : `>${a}</${e}>`}`;
319
+ }, ""), Q = (e, t = {}) => Object.keys(e).reduce((r, n) => {
320
+ const s = U[n];
321
+ return r[s || n] = e[n], r;
322
+ }, t), Me = (e, t, r) => {
323
+ const n = {
324
+ key: t,
325
+ [y]: !0
326
+ }, s = Q(r, n);
327
+ return [d.createElement("title", s, t)];
328
+ }, P = (e, t) => t.map((r, n) => {
329
+ const s = {
330
+ key: n,
331
+ [y]: !0
332
+ };
333
+ return Object.keys(r).forEach((o) => {
334
+ const a = U[o] || o;
335
+ if (a === "innerHTML" || a === "cssText") {
336
+ const i = r.innerHTML || r.cssText;
337
+ s.dangerouslySetInnerHTML = { __html: i };
338
+ } else
339
+ s[a] = r[o];
340
+ }), d.createElement(e, s);
341
+ }), m = (e, t, r = !0) => {
342
+ switch (e) {
343
+ case "title":
344
+ return {
345
+ toComponent: () => Me(e, t.title, t.titleAttributes),
346
+ toString: () => He(e, t.title, t.titleAttributes, r)
347
+ };
348
+ case "bodyAttributes":
349
+ case "htmlAttributes":
350
+ return {
351
+ toComponent: () => Q(t),
352
+ toString: () => J(t)
353
+ };
354
+ default:
355
+ return {
356
+ toComponent: () => P(e, t),
357
+ toString: () => De(e, t, r)
358
+ };
359
+ }
360
+ }, ke = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
361
+ const s = H(e, $.meta), o = H(t, $.link), c = H(r, $.script);
362
+ return {
363
+ priorityMethods: {
364
+ toComponent: () => [
365
+ ...P("meta", s.priority),
366
+ ...P("link", o.priority),
367
+ ...P("script", c.priority)
368
+ ],
369
+ toString: () => (
370
+ // generate all the tags as strings and concatenate them
371
+ `${m("meta", s.priority, n)} ${m(
372
+ "link",
373
+ o.priority,
374
+ n
375
+ )} ${m("script", c.priority, n)}`
376
+ )
377
+ },
378
+ metaTags: s.default,
379
+ linkTags: o.default,
380
+ scriptTags: c.default
381
+ };
382
+ }, _e = (e) => {
383
+ const {
384
+ baseTag: t,
385
+ bodyAttributes: r,
386
+ encode: n = !0,
387
+ htmlAttributes: s,
388
+ noscriptTags: o,
389
+ styleTags: c,
390
+ title: a = "",
391
+ titleAttributes: i,
392
+ prioritizeSeoTags: l
393
+ } = e;
394
+ let { linkTags: u, metaTags: f, scriptTags: h } = e, p = {
395
+ toComponent: () => {
396
+ },
397
+ toString: () => ""
398
+ };
399
+ return l && ({ priorityMethods: p, linkTags: u, metaTags: f, scriptTags: h } = ke(e)), {
400
+ priority: p,
401
+ base: m("base", t, n),
402
+ bodyAttributes: m("bodyAttributes", r, n),
403
+ htmlAttributes: m("htmlAttributes", s, n),
404
+ link: m("link", u, n),
405
+ meta: m("meta", f, n),
406
+ noscript: m("noscript", o, n),
407
+ script: m("script", h, n),
408
+ style: m("style", c, n),
409
+ title: m("title", { title: a, titleAttributes: i }, n)
410
+ };
411
+ }, _ = _e, w = [], ee = !!(typeof window < "u" && window.document && window.document.createElement), j = class {
412
+ constructor(e, t) {
413
+ T(this, "instances", []);
414
+ T(this, "canUseDOM", ee);
415
+ T(this, "context");
416
+ T(this, "value", {
417
+ setHelmet: (e) => {
418
+ this.context.helmet = e;
419
+ },
420
+ helmetInstances: {
421
+ get: () => this.canUseDOM ? w : this.instances,
422
+ add: (e) => {
423
+ (this.canUseDOM ? w : this.instances).push(e);
424
+ },
425
+ remove: (e) => {
426
+ const t = (this.canUseDOM ? w : this.instances).indexOf(e);
427
+ (this.canUseDOM ? w : this.instances).splice(t, 1);
428
+ }
429
+ }
430
+ });
431
+ this.context = e, this.canUseDOM = t || !1, t || (e.helmet = _({
432
+ baseTag: [],
433
+ bodyAttributes: {},
434
+ encodeSpecialCharacters: !0,
435
+ htmlAttributes: {},
436
+ linkTags: [],
437
+ metaTags: [],
438
+ noscriptTags: [],
439
+ scriptTags: [],
440
+ styleTags: [],
441
+ title: "",
442
+ titleAttributes: {}
443
+ }));
444
+ }
445
+ }, je = {}, te = d.createContext(je), v, re = (v = class extends L {
446
+ constructor(r) {
447
+ super(r);
448
+ T(this, "helmetData");
449
+ this.helmetData = new j(this.props.context || {}, v.canUseDOM);
450
+ }
451
+ render() {
452
+ return /* @__PURE__ */ d.createElement(te.Provider, { value: this.helmetData.value }, this.props.children);
453
+ }
454
+ }, T(v, "canUseDOM", ee), v), A = (e, t) => {
455
+ const r = document.head || document.querySelector(
456
+ "head"
457
+ /* HEAD */
458
+ ), n = r.querySelectorAll(`${e}[${y}]`), s = [].slice.call(n), o = [];
459
+ let c;
460
+ return t && t.length && t.forEach((a) => {
461
+ const i = document.createElement(e);
462
+ for (const l in a)
463
+ if (Object.prototype.hasOwnProperty.call(a, l))
464
+ if (l === "innerHTML")
465
+ i.innerHTML = a.innerHTML;
466
+ else if (l === "cssText")
467
+ i.styleSheet ? i.styleSheet.cssText = a.cssText : i.appendChild(document.createTextNode(a.cssText));
468
+ else {
469
+ const u = l, f = typeof a[u] > "u" ? "" : a[u];
470
+ i.setAttribute(l, f);
471
+ }
472
+ i.setAttribute(y, "true"), s.some((l, u) => (c = u, i.isEqualNode(l))) ? s.splice(c, 1) : o.push(i);
473
+ }), s.forEach((a) => {
474
+ var i;
475
+ return (i = a.parentNode) == null ? void 0 : i.removeChild(a);
476
+ }), o.forEach((a) => r.appendChild(a)), {
477
+ oldTags: s,
478
+ newTags: o
479
+ };
480
+ }, R = (e, t) => {
481
+ const r = document.getElementsByTagName(e)[0];
482
+ if (!r)
483
+ return;
484
+ const n = r.getAttribute(y), s = n ? n.split(",") : [], o = [...s], c = Object.keys(t);
485
+ for (const a of c) {
486
+ const i = t[a] || "";
487
+ r.getAttribute(a) !== i && r.setAttribute(a, i), s.indexOf(a) === -1 && s.push(a);
488
+ const l = o.indexOf(a);
489
+ l !== -1 && o.splice(l, 1);
490
+ }
491
+ for (let a = o.length - 1; a >= 0; a -= 1)
492
+ r.removeAttribute(o[a]);
493
+ s.length === o.length ? r.removeAttribute(y) : r.getAttribute(y) !== c.join(",") && r.setAttribute(y, c.join(","));
494
+ }, Re = (e, t) => {
495
+ typeof e < "u" && document.title !== e && (document.title = G(e)), R("title", t);
496
+ }, Y = (e, t) => {
497
+ const {
498
+ baseTag: r,
499
+ bodyAttributes: n,
500
+ htmlAttributes: s,
501
+ linkTags: o,
502
+ metaTags: c,
503
+ noscriptTags: a,
504
+ onChangeClientState: i,
505
+ scriptTags: l,
506
+ styleTags: u,
507
+ title: f,
508
+ titleAttributes: h
509
+ } = e;
510
+ R("body", n), R("html", s), Re(f, h);
511
+ const p = {
512
+ baseTag: A("base", r),
513
+ linkTags: A("link", o),
514
+ metaTags: A("meta", c),
515
+ noscriptTags: A("noscript", a),
516
+ scriptTags: A("script", l),
517
+ styleTags: A("style", u)
518
+ }, g = {}, N = {};
519
+ Object.keys(p).forEach((S) => {
520
+ const { newTags: K, oldTags: se } = p[S];
521
+ K.length && (g[S] = K), se.length && (N[S] = p[S].oldTags);
522
+ }), t && t(), i(e, g, N);
523
+ }, O = null, Le = (e) => {
524
+ O && cancelAnimationFrame(O), e.defer ? O = requestAnimationFrame(() => {
525
+ Y(e, () => {
526
+ O = null;
527
+ });
528
+ }) : (Y(e), O = null);
529
+ }, Fe = Le, X = class extends L {
530
+ constructor() {
531
+ super(...arguments);
532
+ T(this, "rendered", !1);
533
+ }
534
+ shouldComponentUpdate(t) {
535
+ return !Ce(t, this.props);
536
+ }
537
+ componentDidUpdate() {
538
+ this.emitChange();
539
+ }
540
+ componentWillUnmount() {
541
+ const { helmetInstances: t } = this.props.context;
542
+ t.remove(this), this.emitChange();
543
+ }
544
+ emitChange() {
545
+ const { helmetInstances: t, setHelmet: r } = this.props.context;
546
+ let n = null;
547
+ const s = Pe(
548
+ t.get().map((o) => {
549
+ const c = { ...o.props };
550
+ return delete c.context, c;
551
+ })
552
+ );
553
+ re.canUseDOM ? Fe(s) : _ && (n = _(s)), r(n);
554
+ }
555
+ // componentWillMount will be deprecated
556
+ // for SSR, initialize on first render
557
+ // constructor is also unsafe in StrictMode
558
+ init() {
559
+ if (this.rendered)
560
+ return;
561
+ this.rendered = !0;
562
+ const { helmetInstances: t } = this.props.context;
563
+ t.add(this), this.emitChange();
564
+ }
565
+ render() {
566
+ return this.init(), null;
567
+ }
568
+ }, D, Ue = (D = class extends L {
569
+ shouldComponentUpdate(t) {
570
+ return !Te(B(this.props, "helmetData"), B(t, "helmetData"));
571
+ }
572
+ mapNestedChildrenToProps(t, r) {
573
+ if (!r)
574
+ return null;
575
+ switch (t.type) {
576
+ case "script":
577
+ case "noscript":
578
+ return {
579
+ innerHTML: r
580
+ };
581
+ case "style":
582
+ return {
583
+ cssText: r
584
+ };
585
+ default:
586
+ throw new Error(
587
+ `<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`
588
+ );
589
+ }
590
+ }
591
+ flattenArrayTypeChildren(t, r, n, s) {
592
+ return {
593
+ ...r,
594
+ [t.type]: [
595
+ ...r[t.type] || [],
596
+ {
597
+ ...n,
598
+ ...this.mapNestedChildrenToProps(t, s)
599
+ }
600
+ ]
601
+ };
602
+ }
603
+ mapObjectTypeChildren(t, r, n, s) {
604
+ switch (t.type) {
605
+ case "title":
606
+ return {
607
+ ...r,
608
+ [t.type]: s,
609
+ titleAttributes: { ...n }
610
+ };
611
+ case "body":
612
+ return {
613
+ ...r,
614
+ bodyAttributes: { ...n }
615
+ };
616
+ case "html":
617
+ return {
618
+ ...r,
619
+ htmlAttributes: { ...n }
620
+ };
621
+ default:
622
+ return {
623
+ ...r,
624
+ [t.type]: { ...n }
625
+ };
626
+ }
627
+ }
628
+ mapArrayTypeChildrenToProps(t, r) {
629
+ let n = { ...r };
630
+ return Object.keys(t).forEach((s) => {
631
+ n = {
632
+ ...n,
633
+ [s]: t[s]
634
+ };
635
+ }), n;
636
+ }
637
+ warnOnInvalidChildren(t, r) {
638
+ return z(
639
+ V.some((n) => t.type === n),
640
+ typeof t.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 ${V.join(
641
+ ", "
642
+ )} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`
643
+ ), z(
644
+ !r || typeof r == "string" || Array.isArray(r) && !r.some((n) => typeof n != "string"),
645
+ `Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`
646
+ ), !0;
647
+ }
648
+ mapChildrenToProps(t, r) {
649
+ let n = {};
650
+ return d.Children.forEach(t, (s) => {
651
+ if (!s || !s.props)
652
+ return;
653
+ const { children: o, ...c } = s.props, a = Object.keys(c).reduce((l, u) => (l[Ee[u] || u] = c[u], l), {});
654
+ let { type: i } = s;
655
+ switch (typeof i == "symbol" ? i = i.toString() : this.warnOnInvalidChildren(s, o), i) {
656
+ case "Symbol(react.fragment)":
657
+ r = this.mapChildrenToProps(o, r);
658
+ break;
659
+ case "link":
660
+ case "meta":
661
+ case "noscript":
662
+ case "script":
663
+ case "style":
664
+ n = this.flattenArrayTypeChildren(
665
+ s,
666
+ n,
667
+ a,
668
+ o
669
+ );
670
+ break;
671
+ default:
672
+ r = this.mapObjectTypeChildren(s, r, a, o);
673
+ break;
674
+ }
675
+ }), this.mapArrayTypeChildrenToProps(n, r);
676
+ }
677
+ render() {
678
+ const { children: t, ...r } = this.props;
679
+ let n = { ...r }, { helmetData: s } = r;
680
+ if (t && (n = this.mapChildrenToProps(t, n)), s && !(s instanceof j)) {
681
+ const o = s;
682
+ s = new j(o.context, !0), delete n.helmetData;
683
+ }
684
+ return s ? /* @__PURE__ */ d.createElement(X, { ...n, context: s.value }) : /* @__PURE__ */ d.createElement(te.Consumer, null, (o) => /* @__PURE__ */ d.createElement(X, { ...n, context: o }));
685
+ }
686
+ }, T(D, "defaultProps", {
687
+ defer: !0,
688
+ encodeSpecialCharacters: !0,
689
+ prioritizeSeoTags: !1
690
+ }), D);
691
+ const We = Ue, Ze = re, qe = (...e) => {
692
+ const t = e.filter((r) => !!r).map((r) => r.replace(/(^\/+|\/+$)/g, "")).join("/");
693
+ return t ? `/${t}` : "";
694
+ }, Ge = (e) => {
695
+ const t = ae(), r = typeof e.to == "string" ? e.to : e.to.hash, n = (s) => {
696
+ var o;
697
+ !(r != null && r.startsWith("#")) || r !== t.hash || (s.preventDefault(), (o = document.getElementById(r.slice(1))) == null || o.scrollIntoView());
698
+ };
699
+ return /* @__PURE__ */ le.jsx(ue, { onClick: n, ...e });
700
+ }, q = (e, t, r, n = []) => {
701
+ const s = ne(e) ? qe(r, e.path) : r, o = t(e, s, n);
702
+ if (o !== void 0) return o;
703
+ if ("children" in e && e.children) {
704
+ const c = [...n, e];
705
+ for (const a of e.children) {
706
+ const i = q(
707
+ a,
708
+ t,
709
+ s,
710
+ c
711
+ );
712
+ if (i !== void 0) return i;
713
+ }
714
+ }
715
+ }, Je = (e, t) => {
716
+ if (e.categories)
717
+ for (const r of e.categories) {
718
+ const n = q(r, t, e.path);
719
+ if (n !== void 0) return n;
720
+ }
721
+ }, ne = (e) => "path" in e, Qe = (e) => "href" in e, et = (e, t, r) => !!q(
722
+ e,
723
+ (n, s) => {
724
+ if (ne(n) && ce(s, t))
725
+ return !0;
726
+ },
727
+ r
728
+ );
729
+ export {
730
+ Ge as A,
731
+ We as H,
732
+ Ye as M,
733
+ Qe as a,
734
+ Ze as b,
735
+ et as c,
736
+ ne as i,
737
+ qe as j,
738
+ Je as t,
739
+ fe as u
740
+ };