@storyblok/astro 4.1.0-alpha.1 → 4.1.0-alpha.2
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/README.md +50 -0
- package/dist/storyblok-astro.js +18 -18
- package/dist/storyblok-astro.mjs +308 -306
- package/dist/types/index.d.ts +2 -7
- package/live-preview/handleStoryblokMessage.ts +1 -1
- package/package.json +2 -1
- package/utils/parseAstCode.ts +14 -10
package/dist/storyblok-astro.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Or(o, e, r) {
|
|
2
2
|
const a = "virtual:storyblok-init", s = "\0" + a;
|
|
3
3
|
return {
|
|
4
4
|
name: "vite-plugin-storyblok-init",
|
|
@@ -20,14 +20,14 @@ function Sr(o, e, r) {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Cr = /[\p{Lu}]/u, jr = /[\p{Ll}]/u, zt = /^[\p{Lu}](?![\p{Lu}])/gu, Gt = /([\p{Alpha}\p{N}_]|$)/u, ft = /[_.\- ]+/, $r = new RegExp("^" + ft.source), Lt = new RegExp(ft.source + Gt.source, "gu"), Ut = new RegExp("\\d+" + Gt.source, "gu"), xr = (o, e, r, a) => {
|
|
24
24
|
let s = !1, l = !1, u = !1, f = !1;
|
|
25
25
|
for (let g = 0; g < o.length; g++) {
|
|
26
|
-
const
|
|
27
|
-
f = g > 2 ? o[g - 3] === "-" : !0, s &&
|
|
26
|
+
const v = o[g];
|
|
27
|
+
f = g > 2 ? o[g - 3] === "-" : !0, s && Cr.test(v) ? (o = o.slice(0, g) + "-" + o.slice(g), s = !1, u = l, l = !0, g++) : l && u && jr.test(v) && (!f || a) ? (o = o.slice(0, g - 1) + "-" + o.slice(g - 1), u = l, l = !1, s = !0) : (s = e(v) === v && r(v) !== v, u = l, l = r(v) === v && e(v) !== v);
|
|
28
28
|
}
|
|
29
29
|
return o;
|
|
30
|
-
},
|
|
30
|
+
}, Er = (o, e) => (zt.lastIndex = 0, o.replaceAll(zt, (r) => e(r))), Rr = (o, e) => (Lt.lastIndex = 0, Ut.lastIndex = 0, o.replaceAll(Ut, (r, a, s) => ["_", "-"].includes(o.charAt(s + r.length)) ? r : e(r)).replaceAll(Lt, (r, a) => e(a)));
|
|
31
31
|
function Dt(o, e) {
|
|
32
32
|
if (!(typeof o == "string" || Array.isArray(o)))
|
|
33
33
|
throw new TypeError("Expected the input to be `string | string[]`");
|
|
@@ -38,9 +38,9 @@ function Dt(o, e) {
|
|
|
38
38
|
}, Array.isArray(o) ? o = o.map((l) => l.trim()).filter((l) => l.length).join("-") : o = o.trim(), o.length === 0)
|
|
39
39
|
return "";
|
|
40
40
|
const r = e.locale === !1 ? (l) => l.toLowerCase() : (l) => l.toLocaleLowerCase(e.locale), a = e.locale === !1 ? (l) => l.toUpperCase() : (l) => l.toLocaleUpperCase(e.locale);
|
|
41
|
-
return o.length === 1 ? ft.test(o) ? "" : e.pascalCase ? a(o) : r(o) : (o !== r(o) && (o =
|
|
41
|
+
return o.length === 1 ? ft.test(o) ? "" : e.pascalCase ? a(o) : r(o) : (o !== r(o) && (o = xr(o, r, a, e.preserveConsecutiveUppercase)), o = o.replace($r, ""), o = e.preserveConsecutiveUppercase ? Er(o, r) : r(o), e.pascalCase && (o = a(o.charAt(0)) + o.slice(1)), Rr(o, a));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Pr(o, e, r, a) {
|
|
44
44
|
const s = "virtual:storyblok-components", l = "\0" + s;
|
|
45
45
|
return {
|
|
46
46
|
name: "vite-plugin-storyblok-components",
|
|
@@ -51,22 +51,22 @@ function Rr(o, e, r, a) {
|
|
|
51
51
|
async load(u) {
|
|
52
52
|
if (u === l) {
|
|
53
53
|
const f = [], g = [];
|
|
54
|
-
for await (const [_,
|
|
55
|
-
const
|
|
56
|
-
"/" + o + "/" +
|
|
54
|
+
for await (const [_, T] of Object.entries(e)) {
|
|
55
|
+
const w = await this.resolve(
|
|
56
|
+
"/" + o + "/" + T + ".astro"
|
|
57
57
|
);
|
|
58
|
-
if (
|
|
59
|
-
f.push(`import ${Dt(_)} from "${
|
|
58
|
+
if (w)
|
|
59
|
+
f.push(`import ${Dt(_)} from "${w.id}"`);
|
|
60
60
|
else if (r)
|
|
61
61
|
g.push(_);
|
|
62
62
|
else
|
|
63
63
|
throw new Error(
|
|
64
|
-
`Component could not be found for blok "${_}"! Does "${"/" + o + "/" +
|
|
64
|
+
`Component could not be found for blok "${_}"! Does "${"/" + o + "/" + T}.astro" exist?`
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
-
let
|
|
67
|
+
let v = "";
|
|
68
68
|
if (r)
|
|
69
|
-
if (
|
|
69
|
+
if (v = ",FallbackComponent", a) {
|
|
70
70
|
const _ = await this.resolve(
|
|
71
71
|
"/" + o + "/" + a + ".astro"
|
|
72
72
|
);
|
|
@@ -82,9 +82,9 @@ function Rr(o, e, r, a) {
|
|
|
82
82
|
"import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
|
|
83
83
|
);
|
|
84
84
|
if (Object.values(e).length)
|
|
85
|
-
return `${f.join(";")};export default {${Object.keys(e).filter((_) => !g.includes(_)).map((_) => Dt(_)).join(",")}${
|
|
85
|
+
return `${f.join(";")};export default {${Object.keys(e).filter((_) => !g.includes(_)).map((_) => Dt(_)).join(",")}${v}}`;
|
|
86
86
|
if (r)
|
|
87
|
-
return `${f[0]}; export default {${
|
|
87
|
+
return `${f[0]}; export default {${v.replace(",", "")}}`;
|
|
88
88
|
throw new Error(
|
|
89
89
|
`Currently, no Storyblok components are registered in astro.config.mjs.
|
|
90
90
|
Please register your components or enable the fallback component.
|
|
@@ -94,7 +94,7 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Mr(o) {
|
|
98
98
|
const e = "virtual:storyblok-options", r = "\0" + e;
|
|
99
99
|
return {
|
|
100
100
|
name: "vite-plugin-storyblok-options",
|
|
@@ -109,7 +109,7 @@ function Pr(o) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
let Bt = !1;
|
|
112
|
-
const Ft = [],
|
|
112
|
+
const Ft = [], Nr = (o) => new Promise((e, r) => {
|
|
113
113
|
if (typeof window > "u" || (window.storyblokRegisterEvent = (s) => {
|
|
114
114
|
if (window.location === window.parent.location) {
|
|
115
115
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
@@ -123,17 +123,17 @@ const Ft = [], Mr = (o) => new Promise((e, r) => {
|
|
|
123
123
|
Ft.forEach((l) => l()), Bt = !0, e(s);
|
|
124
124
|
}, document.getElementsByTagName("head")[0].appendChild(a);
|
|
125
125
|
});
|
|
126
|
-
var
|
|
127
|
-
class
|
|
126
|
+
var zr = Object.defineProperty, Lr = (o, e, r) => e in o ? zr(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r, O = (o, e, r) => (Lr(o, typeof e != "symbol" ? e + "" : e, r), r);
|
|
127
|
+
class Ur {
|
|
128
128
|
constructor() {
|
|
129
|
-
|
|
129
|
+
O(this, "isCDNUrl", (e = "") => e.indexOf("/cdn/") > -1), O(this, "getOptionsPage", (e, r = 25, a = 1) => ({
|
|
130
130
|
...e,
|
|
131
131
|
per_page: r,
|
|
132
132
|
page: a
|
|
133
|
-
})),
|
|
133
|
+
})), O(this, "delay", (e) => new Promise((r) => setTimeout(r, e))), O(this, "arrayFrom", (e = 0, r) => [...Array(e)].map(r)), O(this, "range", (e = 0, r = e) => {
|
|
134
134
|
const a = Math.abs(r - e) || 0, s = e < r ? 1 : -1;
|
|
135
135
|
return this.arrayFrom(a, (l, u) => u * s + e);
|
|
136
|
-
}),
|
|
136
|
+
}), O(this, "asyncMap", async (e, r) => Promise.all(e.map(r))), O(this, "flatMap", (e = [], r) => e.map(r).reduce((a, s) => [...a, ...s], [])), O(this, "escapeHTML", function(e) {
|
|
137
137
|
const r = {
|
|
138
138
|
"&": "&",
|
|
139
139
|
"<": "<",
|
|
@@ -187,20 +187,20 @@ class zr {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
const
|
|
190
|
+
const Dr = function(o, e) {
|
|
191
191
|
const r = {};
|
|
192
192
|
for (const a in o) {
|
|
193
193
|
const s = o[a];
|
|
194
194
|
e.indexOf(a) > -1 && s !== null && (r[a] = s);
|
|
195
195
|
}
|
|
196
196
|
return r;
|
|
197
|
-
},
|
|
197
|
+
}, Br = (o) => o === "email", Fr = () => ({
|
|
198
198
|
singleTag: "hr"
|
|
199
|
-
}), Fr = () => ({
|
|
200
|
-
tag: "blockquote"
|
|
201
199
|
}), Hr = () => ({
|
|
200
|
+
tag: "blockquote"
|
|
201
|
+
}), qr = () => ({
|
|
202
202
|
tag: "ul"
|
|
203
|
-
}),
|
|
203
|
+
}), Gr = (o) => ({
|
|
204
204
|
tag: [
|
|
205
205
|
"pre",
|
|
206
206
|
{
|
|
@@ -208,24 +208,24 @@ const Ur = function(o, e) {
|
|
|
208
208
|
attrs: o.attrs
|
|
209
209
|
}
|
|
210
210
|
]
|
|
211
|
-
}),
|
|
211
|
+
}), Jr = () => ({
|
|
212
212
|
singleTag: "br"
|
|
213
|
-
}), Jr = (o) => ({
|
|
214
|
-
tag: `h${o.attrs.level}`
|
|
215
213
|
}), Kr = (o) => ({
|
|
214
|
+
tag: `h${o.attrs.level}`
|
|
215
|
+
}), Wr = (o) => ({
|
|
216
216
|
singleTag: [
|
|
217
217
|
{
|
|
218
218
|
tag: "img",
|
|
219
|
-
attrs:
|
|
219
|
+
attrs: Dr(o.attrs, ["src", "alt", "title"])
|
|
220
220
|
}
|
|
221
221
|
]
|
|
222
|
-
}), Wr = () => ({
|
|
223
|
-
tag: "li"
|
|
224
222
|
}), Yr = () => ({
|
|
225
|
-
tag: "
|
|
223
|
+
tag: "li"
|
|
226
224
|
}), Xr = () => ({
|
|
225
|
+
tag: "ol"
|
|
226
|
+
}), Zr = () => ({
|
|
227
227
|
tag: "p"
|
|
228
|
-
}),
|
|
228
|
+
}), Qr = (o) => ({
|
|
229
229
|
tag: [
|
|
230
230
|
{
|
|
231
231
|
tag: "span",
|
|
@@ -236,25 +236,25 @@ const Ur = function(o, e) {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
]
|
|
239
|
-
}), Qr = () => ({
|
|
240
|
-
tag: "b"
|
|
241
239
|
}), Vr = () => ({
|
|
242
|
-
tag: "
|
|
240
|
+
tag: "b"
|
|
243
241
|
}), tn = () => ({
|
|
244
|
-
tag: "
|
|
242
|
+
tag: "s"
|
|
245
243
|
}), en = () => ({
|
|
246
|
-
tag: "
|
|
244
|
+
tag: "u"
|
|
247
245
|
}), rn = () => ({
|
|
248
|
-
tag: "
|
|
246
|
+
tag: "strong"
|
|
249
247
|
}), nn = () => ({
|
|
248
|
+
tag: "code"
|
|
249
|
+
}), on = () => ({
|
|
250
250
|
tag: "i"
|
|
251
|
-
}),
|
|
251
|
+
}), an = (o) => {
|
|
252
252
|
if (!o.attrs)
|
|
253
253
|
return {
|
|
254
254
|
tag: ""
|
|
255
255
|
};
|
|
256
|
-
const e = new
|
|
257
|
-
if (delete r.linktype, r.href && (r.href = e(o.attrs.href || "")),
|
|
256
|
+
const e = new Ur().escapeHTML, r = { ...o.attrs }, { linktype: a = "url" } = o.attrs;
|
|
257
|
+
if (delete r.linktype, r.href && (r.href = e(o.attrs.href || "")), Br(a) && (r.href = `mailto:${r.href}`), r.anchor && (r.href = `${r.href}#${r.anchor}`, delete r.anchor), r.custom) {
|
|
258
258
|
for (const s in r.custom)
|
|
259
259
|
r[s] = r.custom[s];
|
|
260
260
|
delete r.custom;
|
|
@@ -267,25 +267,25 @@ const Ur = function(o, e) {
|
|
|
267
267
|
}
|
|
268
268
|
]
|
|
269
269
|
};
|
|
270
|
-
},
|
|
270
|
+
}, sn = (o) => ({
|
|
271
271
|
tag: [
|
|
272
272
|
{
|
|
273
273
|
tag: "span",
|
|
274
274
|
attrs: o.attrs
|
|
275
275
|
}
|
|
276
276
|
]
|
|
277
|
-
}), sn = () => ({
|
|
278
|
-
tag: "sub"
|
|
279
277
|
}), ln = () => ({
|
|
278
|
+
tag: "sub"
|
|
279
|
+
}), cn = () => ({
|
|
280
280
|
tag: "sup"
|
|
281
|
-
}),
|
|
281
|
+
}), un = (o) => ({
|
|
282
282
|
tag: [
|
|
283
283
|
{
|
|
284
284
|
tag: "span",
|
|
285
285
|
attrs: o.attrs
|
|
286
286
|
}
|
|
287
287
|
]
|
|
288
|
-
}),
|
|
288
|
+
}), fn = (o) => {
|
|
289
289
|
var e;
|
|
290
290
|
return (e = o.attrs) != null && e.color ? {
|
|
291
291
|
tag: [
|
|
@@ -299,7 +299,7 @@ const Ur = function(o, e) {
|
|
|
299
299
|
} : {
|
|
300
300
|
tag: ""
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, pn = (o) => {
|
|
303
303
|
var e;
|
|
304
304
|
return (e = o.attrs) != null && e.color ? {
|
|
305
305
|
tag: [
|
|
@@ -315,34 +315,34 @@ const Ur = function(o, e) {
|
|
|
315
315
|
};
|
|
316
316
|
}, dn = {
|
|
317
317
|
nodes: {
|
|
318
|
-
horizontal_rule:
|
|
319
|
-
blockquote:
|
|
320
|
-
bullet_list:
|
|
321
|
-
code_block:
|
|
322
|
-
hard_break:
|
|
323
|
-
heading:
|
|
324
|
-
image:
|
|
325
|
-
list_item:
|
|
326
|
-
ordered_list:
|
|
327
|
-
paragraph:
|
|
328
|
-
emoji:
|
|
318
|
+
horizontal_rule: Fr,
|
|
319
|
+
blockquote: Hr,
|
|
320
|
+
bullet_list: qr,
|
|
321
|
+
code_block: Gr,
|
|
322
|
+
hard_break: Jr,
|
|
323
|
+
heading: Kr,
|
|
324
|
+
image: Wr,
|
|
325
|
+
list_item: Yr,
|
|
326
|
+
ordered_list: Xr,
|
|
327
|
+
paragraph: Zr,
|
|
328
|
+
emoji: Qr
|
|
329
329
|
},
|
|
330
330
|
marks: {
|
|
331
|
-
bold:
|
|
332
|
-
strike:
|
|
333
|
-
underline:
|
|
334
|
-
strong:
|
|
335
|
-
code:
|
|
336
|
-
italic:
|
|
337
|
-
link:
|
|
338
|
-
styled:
|
|
339
|
-
subscript:
|
|
340
|
-
superscript:
|
|
341
|
-
anchor:
|
|
342
|
-
highlight:
|
|
343
|
-
textStyle:
|
|
344
|
-
}
|
|
345
|
-
},
|
|
331
|
+
bold: Vr,
|
|
332
|
+
strike: tn,
|
|
333
|
+
underline: en,
|
|
334
|
+
strong: rn,
|
|
335
|
+
code: nn,
|
|
336
|
+
italic: on,
|
|
337
|
+
link: an,
|
|
338
|
+
styled: sn,
|
|
339
|
+
subscript: ln,
|
|
340
|
+
superscript: cn,
|
|
341
|
+
anchor: un,
|
|
342
|
+
highlight: fn,
|
|
343
|
+
textStyle: pn
|
|
344
|
+
}
|
|
345
|
+
}, gn = function(o) {
|
|
346
346
|
const e = {
|
|
347
347
|
"&": "&",
|
|
348
348
|
"<": "<",
|
|
@@ -352,9 +352,9 @@ const Ur = function(o, e) {
|
|
|
352
352
|
}, r = /[&<>"']/g, a = RegExp(r.source);
|
|
353
353
|
return o && a.test(o) ? o.replace(r, (s) => e[s]) : o;
|
|
354
354
|
};
|
|
355
|
-
class
|
|
355
|
+
class hn {
|
|
356
356
|
constructor(e) {
|
|
357
|
-
|
|
357
|
+
O(this, "marks"), O(this, "nodes"), e || (e = dn), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
358
358
|
}
|
|
359
359
|
addNode(e, r) {
|
|
360
360
|
this.nodes[e] = r;
|
|
@@ -404,24 +404,24 @@ class gn {
|
|
|
404
404
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,
|
|
405
405
|
`a.storyblok.com/f/$1/$2.$3/m/${f}`
|
|
406
406
|
), typeof r != "boolean" && (r.sizes || r.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (g) => {
|
|
407
|
-
var
|
|
408
|
-
const
|
|
407
|
+
var v, _;
|
|
408
|
+
const T = g.match(
|
|
409
409
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
|
|
410
410
|
);
|
|
411
|
-
if (
|
|
412
|
-
const
|
|
413
|
-
srcset: (
|
|
414
|
-
if (typeof
|
|
415
|
-
return `//${
|
|
416
|
-
if (typeof
|
|
411
|
+
if (T && T.length > 0) {
|
|
412
|
+
const w = {
|
|
413
|
+
srcset: (v = r.srcset) == null ? void 0 : v.map((k) => {
|
|
414
|
+
if (typeof k == "number")
|
|
415
|
+
return `//${T}/m/${k}x0${u} ${k}w`;
|
|
416
|
+
if (typeof k == "object" && k.length === 2) {
|
|
417
417
|
let M = 0, F = 0;
|
|
418
|
-
return typeof
|
|
418
|
+
return typeof k[0] == "number" && (M = k[0]), typeof k[1] == "number" && (F = k[1]), `//${T}/m/${M}x${F}${u} ${M}w`;
|
|
419
419
|
}
|
|
420
420
|
}).join(", "),
|
|
421
|
-
sizes: (_ = r.sizes) == null ? void 0 : _.map((
|
|
421
|
+
sizes: (_ = r.sizes) == null ? void 0 : _.map((k) => k).join(", ")
|
|
422
422
|
};
|
|
423
|
-
let
|
|
424
|
-
return
|
|
423
|
+
let A = "";
|
|
424
|
+
return w.srcset && (A += `srcset="${w.srcset}" `), w.sizes && (A += `sizes="${w.sizes}" `), g.replace(/<img/g, `<img ${A.trim()}`);
|
|
425
425
|
}
|
|
426
426
|
return g;
|
|
427
427
|
})), e;
|
|
@@ -435,7 +435,7 @@ class gn {
|
|
|
435
435
|
const a = this.getMatchingNode(e);
|
|
436
436
|
return a && a.tag && r.push(this.renderOpeningTag(a.tag)), e.content ? e.content.forEach((s) => {
|
|
437
437
|
r.push(this.renderNode(s));
|
|
438
|
-
}) : e.text ? r.push(
|
|
438
|
+
}) : e.text ? r.push(gn(e.text)) : a && a.singleTag ? r.push(this.renderTag(a.singleTag, " /")) : a && a.html ? r.push(a.html) : e.type === "emoji" && r.push(this.renderEmoji(e)), a && a.tag && r.push(this.renderClosingTag(a.tag)), e.marks && e.marks.slice(0).reverse().forEach((s) => {
|
|
439
439
|
const l = this.getMatchingMark(s);
|
|
440
440
|
l && l.tag !== "" && r.push(this.renderClosingTag(l.tag));
|
|
441
441
|
}), r.join("");
|
|
@@ -503,8 +503,8 @@ const $n = (o) => {
|
|
|
503
503
|
return {};
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
let
|
|
507
|
-
const
|
|
506
|
+
let bn, yn = "https://app.storyblok.com/f/storyblok-v2-latest.js";
|
|
507
|
+
const mn = (o, e) => {
|
|
508
508
|
o.addNode("blok", (r) => {
|
|
509
509
|
let a = "";
|
|
510
510
|
return r.attrs.body.forEach((s) => {
|
|
@@ -513,17 +513,17 @@ const yn = (o, e) => {
|
|
|
513
513
|
html: a
|
|
514
514
|
};
|
|
515
515
|
});
|
|
516
|
-
},
|
|
517
|
-
let a = r ||
|
|
516
|
+
}, vn = (o) => !o || !(o != null && o.content.some((e) => e.content || e.type === "blok" || e.type === "horizontal_rule")), _n = (o, e, r) => {
|
|
517
|
+
let a = r || bn;
|
|
518
518
|
if (!a) {
|
|
519
519
|
console.error(
|
|
520
520
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
521
521
|
);
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
|
-
return
|
|
525
|
-
},
|
|
526
|
-
function
|
|
524
|
+
return vn(o) ? "" : (e && (a = new hn(e.schema), e.resolver && mn(a, e.resolver)), a.render(o));
|
|
525
|
+
}, xn = () => Nr(yn);
|
|
526
|
+
function wn(o) {
|
|
527
527
|
let e = {
|
|
528
528
|
resolveRelations: []
|
|
529
529
|
};
|
|
@@ -541,22 +541,22 @@ function _n(o) {
|
|
|
541
541
|
return e.resolveRelations = [...new Set(e.resolveRelations)], e;
|
|
542
542
|
}
|
|
543
543
|
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
544
|
-
function
|
|
544
|
+
function Tn(o) {
|
|
545
545
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
546
546
|
}
|
|
547
547
|
var Q = { exports: {} };
|
|
548
548
|
Q.exports;
|
|
549
549
|
(function(o, e) {
|
|
550
|
-
var r = 200, a = "__lodash_hash_undefined__", s = 800, l = 16, u = 9007199254740991, f = "[object Arguments]", g = "[object Array]",
|
|
551
|
-
b[
|
|
552
|
-
var
|
|
550
|
+
var r = 200, a = "__lodash_hash_undefined__", s = 800, l = 16, u = 9007199254740991, f = "[object Arguments]", g = "[object Array]", v = "[object AsyncFunction]", _ = "[object Boolean]", T = "[object Date]", w = "[object Error]", A = "[object Function]", k = "[object GeneratorFunction]", M = "[object Map]", F = "[object Number]", Jt = "[object Null]", pt = "[object Object]", Kt = "[object Proxy]", Wt = "[object RegExp]", Yt = "[object Set]", Xt = "[object String]", Zt = "[object Undefined]", Qt = "[object WeakMap]", Vt = "[object ArrayBuffer]", te = "[object DataView]", ee = "[object Float32Array]", re = "[object Float64Array]", ne = "[object Int8Array]", oe = "[object Int16Array]", ie = "[object Int32Array]", ae = "[object Uint8Array]", se = "[object Uint8ClampedArray]", le = "[object Uint16Array]", ce = "[object Uint32Array]", ue = /[\\^$.*+?()[\]{}|]/g, fe = /^\[object .+?Constructor\]$/, pe = /^(?:0|[1-9]\d*)$/, b = {};
|
|
551
|
+
b[ee] = b[re] = b[ne] = b[oe] = b[ie] = b[ae] = b[se] = b[le] = b[ce] = !0, b[f] = b[g] = b[Vt] = b[_] = b[te] = b[T] = b[w] = b[A] = b[M] = b[F] = b[pt] = b[Wt] = b[Yt] = b[Xt] = b[Qt] = !1;
|
|
552
|
+
var dt = typeof Z == "object" && Z && Z.Object === Object && Z, de = typeof self == "object" && self && self.Object === Object && self, N = dt || de || Function("return this")(), gt = e && !e.nodeType && e, z = gt && !0 && o && !o.nodeType && o, ht = z && z.exports === gt, V = ht && dt.process, bt = function() {
|
|
553
553
|
try {
|
|
554
|
-
var t =
|
|
554
|
+
var t = z && z.require && z.require("util").types;
|
|
555
555
|
return t || V && V.binding && V.binding("util");
|
|
556
556
|
} catch {
|
|
557
557
|
}
|
|
558
558
|
}(), yt = bt && bt.isTypedArray;
|
|
559
|
-
function
|
|
559
|
+
function ge(t, n, i) {
|
|
560
560
|
switch (i.length) {
|
|
561
561
|
case 0:
|
|
562
562
|
return t.call(n);
|
|
@@ -569,36 +569,36 @@ Q.exports;
|
|
|
569
569
|
}
|
|
570
570
|
return t.apply(n, i);
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function he(t, n) {
|
|
573
573
|
for (var i = -1, c = Array(t); ++i < t; )
|
|
574
574
|
c[i] = n(i);
|
|
575
575
|
return c;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function be(t) {
|
|
578
578
|
return function(n) {
|
|
579
579
|
return t(n);
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function ye(t, n) {
|
|
583
583
|
return t == null ? void 0 : t[n];
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function me(t, n) {
|
|
586
586
|
return function(i) {
|
|
587
587
|
return t(n(i));
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
var
|
|
590
|
+
var ve = Array.prototype, _e = Function.prototype, H = Object.prototype, tt = N["__core-js_shared__"], q = _e.toString, C = H.hasOwnProperty, mt = function() {
|
|
591
591
|
var t = /[^.]+$/.exec(tt && tt.keys && tt.keys.IE_PROTO || "");
|
|
592
592
|
return t ? "Symbol(src)_1." + t : "";
|
|
593
|
-
}(), vt = H.toString,
|
|
594
|
-
"^" + q.call(C).replace(
|
|
595
|
-
), G = ht ?
|
|
593
|
+
}(), vt = H.toString, we = q.call(Object), Te = RegExp(
|
|
594
|
+
"^" + q.call(C).replace(ue, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
595
|
+
), G = ht ? N.Buffer : void 0, _t = N.Symbol, wt = N.Uint8Array, Tt = G ? G.allocUnsafe : void 0, kt = me(Object.getPrototypeOf, Object), At = Object.create, ke = H.propertyIsEnumerable, Ae = ve.splice, $ = _t ? _t.toStringTag : void 0, J = function() {
|
|
596
596
|
try {
|
|
597
597
|
var t = nt(Object, "defineProperty");
|
|
598
598
|
return t({}, "", {}), t;
|
|
599
599
|
} catch {
|
|
600
600
|
}
|
|
601
|
-
}(),
|
|
601
|
+
}(), Ie = G ? G.isBuffer : void 0, It = Math.max, Se = Date.now, St = nt(N, "Map"), L = nt(Object, "create"), Oe = /* @__PURE__ */ function() {
|
|
602
602
|
function t() {
|
|
603
603
|
}
|
|
604
604
|
return function(n) {
|
|
@@ -611,66 +611,66 @@ Q.exports;
|
|
|
611
611
|
return t.prototype = void 0, i;
|
|
612
612
|
};
|
|
613
613
|
}();
|
|
614
|
-
function
|
|
614
|
+
function x(t) {
|
|
615
615
|
var n = -1, i = t == null ? 0 : t.length;
|
|
616
616
|
for (this.clear(); ++n < i; ) {
|
|
617
617
|
var c = t[n];
|
|
618
618
|
this.set(c[0], c[1]);
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
this.__data__ =
|
|
621
|
+
function Ce() {
|
|
622
|
+
this.__data__ = L ? L(null) : {}, this.size = 0;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function je(t) {
|
|
625
625
|
var n = this.has(t) && delete this.__data__[t];
|
|
626
626
|
return this.size -= n ? 1 : 0, n;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function $e(t) {
|
|
629
629
|
var n = this.__data__;
|
|
630
|
-
if (
|
|
630
|
+
if (L) {
|
|
631
631
|
var i = n[t];
|
|
632
632
|
return i === a ? void 0 : i;
|
|
633
633
|
}
|
|
634
634
|
return C.call(n, t) ? n[t] : void 0;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function xe(t) {
|
|
637
637
|
var n = this.__data__;
|
|
638
|
-
return
|
|
638
|
+
return L ? n[t] !== void 0 : C.call(n, t);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Ee(t, n) {
|
|
641
641
|
var i = this.__data__;
|
|
642
|
-
return this.size += this.has(t) ? 0 : 1, i[t] =
|
|
642
|
+
return this.size += this.has(t) ? 0 : 1, i[t] = L && n === void 0 ? a : n, this;
|
|
643
643
|
}
|
|
644
|
-
|
|
645
|
-
function
|
|
644
|
+
x.prototype.clear = Ce, x.prototype.delete = je, x.prototype.get = $e, x.prototype.has = xe, x.prototype.set = Ee;
|
|
645
|
+
function j(t) {
|
|
646
646
|
var n = -1, i = t == null ? 0 : t.length;
|
|
647
647
|
for (this.clear(); ++n < i; ) {
|
|
648
648
|
var c = t[n];
|
|
649
649
|
this.set(c[0], c[1]);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Re() {
|
|
653
653
|
this.__data__ = [], this.size = 0;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Pe(t) {
|
|
656
656
|
var n = this.__data__, i = K(n, t);
|
|
657
657
|
if (i < 0)
|
|
658
658
|
return !1;
|
|
659
659
|
var c = n.length - 1;
|
|
660
|
-
return i == c ? n.pop() :
|
|
660
|
+
return i == c ? n.pop() : Ae.call(n, i, 1), --this.size, !0;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Me(t) {
|
|
663
663
|
var n = this.__data__, i = K(n, t);
|
|
664
664
|
return i < 0 ? void 0 : n[i][1];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Ne(t) {
|
|
667
667
|
return K(this.__data__, t) > -1;
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function ze(t, n) {
|
|
670
670
|
var i = this.__data__, c = K(i, t);
|
|
671
671
|
return c < 0 ? (++this.size, i.push([t, n])) : i[c][1] = n, this;
|
|
672
672
|
}
|
|
673
|
-
|
|
673
|
+
j.prototype.clear = Re, j.prototype.delete = Pe, j.prototype.get = Me, j.prototype.has = Ne, j.prototype.set = ze;
|
|
674
674
|
function R(t) {
|
|
675
675
|
var n = -1, i = t == null ? 0 : t.length;
|
|
676
676
|
for (this.clear(); ++n < i; ) {
|
|
@@ -678,48 +678,48 @@ Q.exports;
|
|
|
678
678
|
this.set(c[0], c[1]);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Le() {
|
|
682
682
|
this.size = 0, this.__data__ = {
|
|
683
|
-
hash: new
|
|
684
|
-
map: new (St ||
|
|
685
|
-
string: new
|
|
683
|
+
hash: new x(),
|
|
684
|
+
map: new (St || j)(),
|
|
685
|
+
string: new x()
|
|
686
686
|
};
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function Ue(t) {
|
|
689
689
|
var n = Y(this, t).delete(t);
|
|
690
690
|
return this.size -= n ? 1 : 0, n;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function De(t) {
|
|
693
693
|
return Y(this, t).get(t);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Be(t) {
|
|
696
696
|
return Y(this, t).has(t);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Fe(t, n) {
|
|
699
699
|
var i = Y(this, t), c = i.size;
|
|
700
700
|
return i.set(t, n), this.size += i.size == c ? 0 : 1, this;
|
|
701
701
|
}
|
|
702
|
-
R.prototype.clear =
|
|
702
|
+
R.prototype.clear = Le, R.prototype.delete = Ue, R.prototype.get = De, R.prototype.has = Be, R.prototype.set = Fe;
|
|
703
703
|
function P(t) {
|
|
704
|
-
var n = this.__data__ = new
|
|
704
|
+
var n = this.__data__ = new j(t);
|
|
705
705
|
this.size = n.size;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
this.__data__ = new
|
|
707
|
+
function He() {
|
|
708
|
+
this.__data__ = new j(), this.size = 0;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function qe(t) {
|
|
711
711
|
var n = this.__data__, i = n.delete(t);
|
|
712
712
|
return this.size = n.size, i;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Ge(t) {
|
|
715
715
|
return this.__data__.get(t);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Je(t) {
|
|
718
718
|
return this.__data__.has(t);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Ke(t, n) {
|
|
721
721
|
var i = this.__data__;
|
|
722
|
-
if (i instanceof
|
|
722
|
+
if (i instanceof j) {
|
|
723
723
|
var c = i.__data__;
|
|
724
724
|
if (!St || c.length < r - 1)
|
|
725
725
|
return c.push([t, n]), this.size = ++i.size, this;
|
|
@@ -727,21 +727,21 @@ Q.exports;
|
|
|
727
727
|
}
|
|
728
728
|
return i.set(t, n), this.size = i.size, this;
|
|
729
729
|
}
|
|
730
|
-
P.prototype.clear =
|
|
731
|
-
function
|
|
732
|
-
var i = at(t), c = !i && it(t),
|
|
733
|
-
for (var
|
|
734
|
-
(n || C.call(t,
|
|
735
|
-
(
|
|
736
|
-
|
|
737
|
-
h && (
|
|
738
|
-
|
|
739
|
-
return
|
|
730
|
+
P.prototype.clear = He, P.prototype.delete = qe, P.prototype.get = Ge, P.prototype.has = Je, P.prototype.set = Ke;
|
|
731
|
+
function We(t, n) {
|
|
732
|
+
var i = at(t), c = !i && it(t), d = !i && !c && xt(t), h = !i && !c && !d && Rt(t), y = i || c || d || h, p = y ? he(t.length, String) : [], m = p.length;
|
|
733
|
+
for (var S in t)
|
|
734
|
+
(n || C.call(t, S)) && !(y && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
735
|
+
(S == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
736
|
+
d && (S == "offset" || S == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
737
|
+
h && (S == "buffer" || S == "byteLength" || S == "byteOffset") || // Skip index properties.
|
|
738
|
+
jt(S, m))) && p.push(S);
|
|
739
|
+
return p;
|
|
740
740
|
}
|
|
741
741
|
function et(t, n, i) {
|
|
742
742
|
(i !== void 0 && !X(t[n], i) || i === void 0 && !(n in t)) && rt(t, n, i);
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Ye(t, n, i) {
|
|
745
745
|
var c = t[n];
|
|
746
746
|
(!(C.call(t, n) && X(c, i)) || i === void 0 && !(n in t)) && rt(t, n, i);
|
|
747
747
|
}
|
|
@@ -759,108 +759,108 @@ Q.exports;
|
|
|
759
759
|
writable: !0
|
|
760
760
|
}) : t[n] = i;
|
|
761
761
|
}
|
|
762
|
-
var
|
|
762
|
+
var Xe = cr();
|
|
763
763
|
function W(t) {
|
|
764
|
-
return t == null ? t === void 0 ?
|
|
764
|
+
return t == null ? t === void 0 ? Zt : Jt : $ && $ in Object(t) ? ur(t) : br(t);
|
|
765
765
|
}
|
|
766
766
|
function Ot(t) {
|
|
767
767
|
return U(t) && W(t) == f;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
if (!E(t) ||
|
|
769
|
+
function Ze(t) {
|
|
770
|
+
if (!E(t) || gr(t))
|
|
771
771
|
return !1;
|
|
772
|
-
var n = lt(t) ?
|
|
773
|
-
return n.test(
|
|
772
|
+
var n = lt(t) ? Te : fe;
|
|
773
|
+
return n.test(_r(t));
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function Qe(t) {
|
|
776
776
|
return U(t) && Et(t.length) && !!b[W(t)];
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function Ve(t) {
|
|
779
779
|
if (!E(t))
|
|
780
|
-
return
|
|
780
|
+
return hr(t);
|
|
781
781
|
var n = $t(t), i = [];
|
|
782
782
|
for (var c in t)
|
|
783
783
|
c == "constructor" && (n || !C.call(t, c)) || i.push(c);
|
|
784
784
|
return i;
|
|
785
785
|
}
|
|
786
|
-
function Ct(t, n, i, c,
|
|
787
|
-
t !== n &&
|
|
788
|
-
if (
|
|
789
|
-
|
|
786
|
+
function Ct(t, n, i, c, d) {
|
|
787
|
+
t !== n && Xe(n, function(h, y) {
|
|
788
|
+
if (d || (d = new P()), E(h))
|
|
789
|
+
tr(t, n, y, i, Ct, c, d);
|
|
790
790
|
else {
|
|
791
|
-
var
|
|
792
|
-
|
|
791
|
+
var p = c ? c(ot(t, y), h, y + "", t, n, d) : void 0;
|
|
792
|
+
p === void 0 && (p = h), et(t, y, p);
|
|
793
793
|
}
|
|
794
794
|
}, Pt);
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
var
|
|
798
|
-
if (
|
|
799
|
-
et(t, i,
|
|
796
|
+
function tr(t, n, i, c, d, h, y) {
|
|
797
|
+
var p = ot(t, i), m = ot(n, i), S = y.get(m);
|
|
798
|
+
if (S) {
|
|
799
|
+
et(t, i, S);
|
|
800
800
|
return;
|
|
801
801
|
}
|
|
802
|
-
var
|
|
802
|
+
var I = h ? h(p, m, i + "", t, n, y) : void 0, D = I === void 0;
|
|
803
803
|
if (D) {
|
|
804
|
-
var ct = at(
|
|
805
|
-
|
|
804
|
+
var ct = at(m), ut = !ct && xt(m), Nt = !ct && !ut && Rt(m);
|
|
805
|
+
I = m, ct || ut || Nt ? at(p) ? I = p : wr(p) ? I = ar(p) : ut ? (D = !1, I = nr(m, !0)) : Nt ? (D = !1, I = ir(m, !0)) : I = [] : Tr(m) || it(m) ? (I = p, it(p) ? I = kr(p) : (!E(p) || lt(p)) && (I = fr(m))) : D = !1;
|
|
806
806
|
}
|
|
807
|
-
D && (
|
|
807
|
+
D && (y.set(m, I), d(I, m, c, h, y), y.delete(m)), et(t, i, I);
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
return yr(
|
|
809
|
+
function er(t, n) {
|
|
810
|
+
return mr(yr(t, n, Mt), t + "");
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var rr = J ? function(t, n) {
|
|
813
813
|
return J(t, "toString", {
|
|
814
814
|
configurable: !0,
|
|
815
815
|
enumerable: !1,
|
|
816
|
-
value:
|
|
816
|
+
value: Ir(n),
|
|
817
817
|
writable: !0
|
|
818
818
|
});
|
|
819
819
|
} : Mt;
|
|
820
|
-
function
|
|
820
|
+
function nr(t, n) {
|
|
821
821
|
if (n)
|
|
822
822
|
return t.slice();
|
|
823
823
|
var i = t.length, c = Tt ? Tt(i) : new t.constructor(i);
|
|
824
824
|
return t.copy(c), c;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function or(t) {
|
|
827
827
|
var n = new t.constructor(t.byteLength);
|
|
828
828
|
return new wt(n).set(new wt(t)), n;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
var i = n ?
|
|
830
|
+
function ir(t, n) {
|
|
831
|
+
var i = n ? or(t.buffer) : t.buffer;
|
|
832
832
|
return new t.constructor(i, t.byteOffset, t.length);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function ar(t, n) {
|
|
835
835
|
var i = -1, c = t.length;
|
|
836
836
|
for (n || (n = Array(c)); ++i < c; )
|
|
837
837
|
n[i] = t[i];
|
|
838
838
|
return n;
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
var
|
|
840
|
+
function sr(t, n, i, c) {
|
|
841
|
+
var d = !i;
|
|
842
842
|
i || (i = {});
|
|
843
|
-
for (var h = -1,
|
|
844
|
-
var
|
|
845
|
-
|
|
843
|
+
for (var h = -1, y = n.length; ++h < y; ) {
|
|
844
|
+
var p = n[h], m = c ? c(i[p], t[p], p, i, t) : void 0;
|
|
845
|
+
m === void 0 && (m = t[p]), d ? rt(i, p, m) : Ye(i, p, m);
|
|
846
846
|
}
|
|
847
847
|
return i;
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
return
|
|
851
|
-
var c = -1,
|
|
852
|
-
for (h = t.length > 3 && typeof h == "function" ? (
|
|
853
|
-
var
|
|
854
|
-
|
|
849
|
+
function lr(t) {
|
|
850
|
+
return er(function(n, i) {
|
|
851
|
+
var c = -1, d = i.length, h = d > 1 ? i[d - 1] : void 0, y = d > 2 ? i[2] : void 0;
|
|
852
|
+
for (h = t.length > 3 && typeof h == "function" ? (d--, h) : void 0, y && pr(i[0], i[1], y) && (h = d < 3 ? void 0 : h, d = 1), n = Object(n); ++c < d; ) {
|
|
853
|
+
var p = i[c];
|
|
854
|
+
p && t(n, p, c, h);
|
|
855
855
|
}
|
|
856
856
|
return n;
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function cr(t) {
|
|
860
860
|
return function(n, i, c) {
|
|
861
|
-
for (var
|
|
862
|
-
var
|
|
863
|
-
if (i(h[
|
|
861
|
+
for (var d = -1, h = Object(n), y = c(n), p = y.length; p--; ) {
|
|
862
|
+
var m = y[t ? p : ++d];
|
|
863
|
+
if (i(h[m], m, h) === !1)
|
|
864
864
|
break;
|
|
865
865
|
}
|
|
866
866
|
return n;
|
|
@@ -871,73 +871,73 @@ Q.exports;
|
|
|
871
871
|
return dr(n) ? i[typeof n == "string" ? "string" : "hash"] : i.map;
|
|
872
872
|
}
|
|
873
873
|
function nt(t, n) {
|
|
874
|
-
var i =
|
|
875
|
-
return
|
|
874
|
+
var i = ye(t, n);
|
|
875
|
+
return Ze(i) ? i : void 0;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function ur(t) {
|
|
878
878
|
var n = C.call(t, $), i = t[$];
|
|
879
879
|
try {
|
|
880
880
|
t[$] = void 0;
|
|
881
881
|
var c = !0;
|
|
882
882
|
} catch {
|
|
883
883
|
}
|
|
884
|
-
var
|
|
885
|
-
return c && (n ? t[$] = i : delete t[$]),
|
|
884
|
+
var d = vt.call(t);
|
|
885
|
+
return c && (n ? t[$] = i : delete t[$]), d;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
return typeof t.constructor == "function" && !$t(t) ?
|
|
887
|
+
function fr(t) {
|
|
888
|
+
return typeof t.constructor == "function" && !$t(t) ? Oe(kt(t)) : {};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function jt(t, n) {
|
|
891
891
|
var i = typeof t;
|
|
892
|
-
return n = n ?? u, !!n && (i == "number" || i != "symbol" &&
|
|
892
|
+
return n = n ?? u, !!n && (i == "number" || i != "symbol" && pe.test(t)) && t > -1 && t % 1 == 0 && t < n;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function pr(t, n, i) {
|
|
895
895
|
if (!E(i))
|
|
896
896
|
return !1;
|
|
897
897
|
var c = typeof n;
|
|
898
|
-
return (c == "number" ? st(i) &&
|
|
898
|
+
return (c == "number" ? st(i) && jt(n, i.length) : c == "string" && n in i) ? X(i[n], t) : !1;
|
|
899
899
|
}
|
|
900
900
|
function dr(t) {
|
|
901
901
|
var n = typeof t;
|
|
902
902
|
return n == "string" || n == "number" || n == "symbol" || n == "boolean" ? t !== "__proto__" : t === null;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function gr(t) {
|
|
905
905
|
return !!mt && mt in t;
|
|
906
906
|
}
|
|
907
907
|
function $t(t) {
|
|
908
908
|
var n = t && t.constructor, i = typeof n == "function" && n.prototype || H;
|
|
909
909
|
return t === i;
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function hr(t) {
|
|
912
912
|
var n = [];
|
|
913
913
|
if (t != null)
|
|
914
914
|
for (var i in Object(t))
|
|
915
915
|
n.push(i);
|
|
916
916
|
return n;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function br(t) {
|
|
919
919
|
return vt.call(t);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function yr(t, n, i) {
|
|
922
922
|
return n = It(n === void 0 ? t.length - 1 : n, 0), function() {
|
|
923
|
-
for (var c = arguments,
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
for (var
|
|
927
|
-
d
|
|
928
|
-
return
|
|
923
|
+
for (var c = arguments, d = -1, h = It(c.length - n, 0), y = Array(h); ++d < h; )
|
|
924
|
+
y[d] = c[n + d];
|
|
925
|
+
d = -1;
|
|
926
|
+
for (var p = Array(n + 1); ++d < n; )
|
|
927
|
+
p[d] = c[d];
|
|
928
|
+
return p[n] = i(y), ge(t, this, p);
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
931
|
function ot(t, n) {
|
|
932
932
|
if (!(n === "constructor" && typeof t[n] == "function") && n != "__proto__")
|
|
933
933
|
return t[n];
|
|
934
934
|
}
|
|
935
|
-
var
|
|
936
|
-
function
|
|
935
|
+
var mr = vr(rr);
|
|
936
|
+
function vr(t) {
|
|
937
937
|
var n = 0, i = 0;
|
|
938
938
|
return function() {
|
|
939
|
-
var c =
|
|
940
|
-
if (i = c,
|
|
939
|
+
var c = Se(), d = l - (c - i);
|
|
940
|
+
if (i = c, d > 0) {
|
|
941
941
|
if (++n >= s)
|
|
942
942
|
return arguments[0];
|
|
943
943
|
} else
|
|
@@ -945,7 +945,7 @@ Q.exports;
|
|
|
945
945
|
return t.apply(void 0, arguments);
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function _r(t) {
|
|
949
949
|
if (t != null) {
|
|
950
950
|
try {
|
|
951
951
|
return q.call(t);
|
|
@@ -964,20 +964,20 @@ Q.exports;
|
|
|
964
964
|
var it = Ot(/* @__PURE__ */ function() {
|
|
965
965
|
return arguments;
|
|
966
966
|
}()) ? Ot : function(t) {
|
|
967
|
-
return U(t) && C.call(t, "callee") && !
|
|
967
|
+
return U(t) && C.call(t, "callee") && !ke.call(t, "callee");
|
|
968
968
|
}, at = Array.isArray;
|
|
969
969
|
function st(t) {
|
|
970
970
|
return t != null && Et(t.length) && !lt(t);
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function wr(t) {
|
|
973
973
|
return U(t) && st(t);
|
|
974
974
|
}
|
|
975
|
-
var
|
|
975
|
+
var xt = Ie || Sr;
|
|
976
976
|
function lt(t) {
|
|
977
977
|
if (!E(t))
|
|
978
978
|
return !1;
|
|
979
979
|
var n = W(t);
|
|
980
|
-
return n ==
|
|
980
|
+
return n == A || n == k || n == v || n == Kt;
|
|
981
981
|
}
|
|
982
982
|
function Et(t) {
|
|
983
983
|
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= u;
|
|
@@ -989,26 +989,26 @@ Q.exports;
|
|
|
989
989
|
function U(t) {
|
|
990
990
|
return t != null && typeof t == "object";
|
|
991
991
|
}
|
|
992
|
-
function
|
|
993
|
-
if (!U(t) || W(t) !=
|
|
992
|
+
function Tr(t) {
|
|
993
|
+
if (!U(t) || W(t) != pt)
|
|
994
994
|
return !1;
|
|
995
995
|
var n = kt(t);
|
|
996
996
|
if (n === null)
|
|
997
997
|
return !0;
|
|
998
998
|
var i = C.call(n, "constructor") && n.constructor;
|
|
999
|
-
return typeof i == "function" && i instanceof i && q.call(i) ==
|
|
999
|
+
return typeof i == "function" && i instanceof i && q.call(i) == we;
|
|
1000
1000
|
}
|
|
1001
|
-
var Rt = yt ?
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1001
|
+
var Rt = yt ? be(yt) : Qe;
|
|
1002
|
+
function kr(t) {
|
|
1003
|
+
return sr(t, Pt(t));
|
|
1004
1004
|
}
|
|
1005
1005
|
function Pt(t) {
|
|
1006
|
-
return st(t) ?
|
|
1006
|
+
return st(t) ? We(t, !0) : Ve(t);
|
|
1007
1007
|
}
|
|
1008
|
-
var
|
|
1008
|
+
var Ar = lr(function(t, n, i, c) {
|
|
1009
1009
|
Ct(t, n, i, c);
|
|
1010
1010
|
});
|
|
1011
|
-
function
|
|
1011
|
+
function Ir(t) {
|
|
1012
1012
|
return function() {
|
|
1013
1013
|
return t;
|
|
1014
1014
|
};
|
|
@@ -1016,31 +1016,38 @@ Q.exports;
|
|
|
1016
1016
|
function Mt(t) {
|
|
1017
1017
|
return t;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function Sr() {
|
|
1020
1020
|
return !1;
|
|
1021
1021
|
}
|
|
1022
|
-
o.exports =
|
|
1022
|
+
o.exports = Ar;
|
|
1023
1023
|
})(Q, Q.exports);
|
|
1024
|
-
var
|
|
1025
|
-
const
|
|
1026
|
-
function
|
|
1024
|
+
var kn = Q.exports;
|
|
1025
|
+
const An = /* @__PURE__ */ Tn(kn);
|
|
1026
|
+
function In(o) {
|
|
1027
1027
|
let e;
|
|
1028
1028
|
function r(a, s) {
|
|
1029
|
-
var l, u, f;
|
|
1030
|
-
(s == null ? void 0 : s.type) === "AwaitExpression" && ((u = (l = s == null ? void 0 : s.argument) == null ? void 0 : l.callee) == null ? void 0 : u.name) === "useStoryblok"
|
|
1031
|
-
|
|
1032
|
-
(
|
|
1033
|
-
|
|
1034
|
-
|
|
1029
|
+
var l, u, f, g, v, _, T;
|
|
1030
|
+
if ((s == null ? void 0 : s.type) === "AwaitExpression" && ((u = (l = s == null ? void 0 : s.argument) == null ? void 0 : l.callee) == null ? void 0 : u.name) === "useStoryblok") {
|
|
1031
|
+
const w = (f = s == null ? void 0 : s.argument) == null ? void 0 : f.arguments;
|
|
1032
|
+
if (((g = w[1]) == null ? void 0 : g.type) === "ObjectExpression") {
|
|
1033
|
+
const A = Ht((v = w[1]) == null ? void 0 : v.properties);
|
|
1034
|
+
e = {
|
|
1035
1035
|
...e,
|
|
1036
|
-
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1036
|
+
apiOptions: A
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
if (((_ = w[2]) == null ? void 0 : _.type) === "ObjectExpression") {
|
|
1040
|
+
const A = Ht((T = w[2]) == null ? void 0 : T.properties);
|
|
1041
|
+
e = {
|
|
1042
|
+
...e,
|
|
1043
|
+
bridgeOptions: A
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1040
1047
|
}
|
|
1041
|
-
return
|
|
1048
|
+
return An({}, o, r), e;
|
|
1042
1049
|
}
|
|
1043
|
-
function
|
|
1050
|
+
function Ht(o) {
|
|
1044
1051
|
return o.reduce((e, { key: r, value: a }) => {
|
|
1045
1052
|
const { type: s } = a;
|
|
1046
1053
|
return e[r.name] = s === "Literal" ? a.value : s === "ArrayExpression" ? a.elements.map((l) => l.value) : a.value, e;
|
|
@@ -1069,20 +1076,20 @@ function Sn(o, e) {
|
|
|
1069
1076
|
return a;
|
|
1070
1077
|
},
|
|
1071
1078
|
async transform(f, g) {
|
|
1072
|
-
var
|
|
1073
|
-
if (g.includes("node_modules") && !g.includes("/pages/") || !f.includes("useStoryblok") || !((
|
|
1079
|
+
var A;
|
|
1080
|
+
if (g.includes("node_modules") && !g.includes("/pages/") || !f.includes("useStoryblok") || !((A = this.getModuleInfo(g).meta) != null && A.astro))
|
|
1074
1081
|
return;
|
|
1075
|
-
const [, ..._] = g.split("src/pages/"),
|
|
1076
|
-
B.length && (s = B.filter((
|
|
1077
|
-
url:
|
|
1078
|
-
options:
|
|
1082
|
+
const [, ..._] = g.split("src/pages/"), T = _.join("/").replace(".astro", ""), w = In(this.parse(f));
|
|
1083
|
+
B.length && (s = B.filter((k) => k.url !== T)), s.push({
|
|
1084
|
+
url: T,
|
|
1085
|
+
options: w
|
|
1079
1086
|
}), l && (u && clearTimeout(u), u = setTimeout(() => {
|
|
1080
1087
|
On(B, s) || (B.length !== 0 && (l.restart(), console.info("Updating bridge options...")), B = [...s]);
|
|
1081
1088
|
}, 1e3));
|
|
1082
1089
|
},
|
|
1083
1090
|
async load(f) {
|
|
1084
1091
|
if (f === a)
|
|
1085
|
-
return `export const bridgeOptions = ${JSON.stringify(
|
|
1092
|
+
return `export const bridgeOptions = ${JSON.stringify(wn(s))}`;
|
|
1086
1093
|
},
|
|
1087
1094
|
configureServer(f) {
|
|
1088
1095
|
l = f;
|
|
@@ -1095,18 +1102,18 @@ function On(o = [], e = []) {
|
|
|
1095
1102
|
return s && JSON.stringify(a) === JSON.stringify(s.options);
|
|
1096
1103
|
});
|
|
1097
1104
|
}
|
|
1098
|
-
let
|
|
1105
|
+
let qt;
|
|
1099
1106
|
async function En(o) {
|
|
1100
1107
|
const { action: e, story: r } = o || {};
|
|
1101
1108
|
if (e === "input" && r) {
|
|
1102
1109
|
const a = async () => {
|
|
1103
|
-
const l = await
|
|
1110
|
+
const l = await jn(r), u = document.body;
|
|
1104
1111
|
if (l.outerHTML === u.outerHTML)
|
|
1105
1112
|
return;
|
|
1106
1113
|
const f = document.querySelector('[data-blok-focused="true"]');
|
|
1107
1114
|
Cn(u, l, f);
|
|
1108
1115
|
};
|
|
1109
|
-
clearTimeout(
|
|
1116
|
+
clearTimeout(qt), qt = setTimeout(a, 500);
|
|
1110
1117
|
}
|
|
1111
1118
|
["published", "change"].includes(o == null ? void 0 : o.action) && location.reload();
|
|
1112
1119
|
}
|
|
@@ -1119,7 +1126,7 @@ function Cn(o, e, r) {
|
|
|
1119
1126
|
} else
|
|
1120
1127
|
o.replaceWith(e);
|
|
1121
1128
|
}
|
|
1122
|
-
async function
|
|
1129
|
+
async function jn(o) {
|
|
1123
1130
|
const r = await (await fetch(location.href, {
|
|
1124
1131
|
method: "POST",
|
|
1125
1132
|
body: JSON.stringify({
|
|
@@ -1135,12 +1142,7 @@ async function xn(o) {
|
|
|
1135
1142
|
function Rn() {
|
|
1136
1143
|
return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
|
|
1137
1144
|
}
|
|
1138
|
-
async function Pn({
|
|
1139
|
-
slug: o,
|
|
1140
|
-
apiOptions: e = {},
|
|
1141
|
-
bridgeOptions: r = {},
|
|
1142
|
-
Astro: a
|
|
1143
|
-
}) {
|
|
1145
|
+
async function Pn(o, e = {}, r = {}, a) {
|
|
1144
1146
|
globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly");
|
|
1145
1147
|
let s = null;
|
|
1146
1148
|
if (a && a.locals._storyblok_preview_data)
|
|
@@ -1163,15 +1165,15 @@ function Mn(o, e) {
|
|
|
1163
1165
|
);
|
|
1164
1166
|
return;
|
|
1165
1167
|
}
|
|
1166
|
-
return
|
|
1168
|
+
return _n(o, e, r);
|
|
1167
1169
|
}
|
|
1168
|
-
function
|
|
1170
|
+
function Nn(o) {
|
|
1169
1171
|
const e = {
|
|
1170
1172
|
useCustomApi: !1,
|
|
1171
1173
|
bridge: !0,
|
|
1172
1174
|
componentsDir: "src",
|
|
1173
1175
|
enableFallbackComponent: !1,
|
|
1174
|
-
|
|
1176
|
+
livePreview: !1,
|
|
1175
1177
|
...o
|
|
1176
1178
|
};
|
|
1177
1179
|
return {
|
|
@@ -1187,25 +1189,25 @@ function Ln(o) {
|
|
|
1187
1189
|
if (a({
|
|
1188
1190
|
vite: {
|
|
1189
1191
|
plugins: [
|
|
1190
|
-
|
|
1192
|
+
Or(
|
|
1191
1193
|
e.accessToken,
|
|
1192
1194
|
e.useCustomApi,
|
|
1193
1195
|
e.apiOptions
|
|
1194
1196
|
),
|
|
1195
|
-
|
|
1197
|
+
Pr(
|
|
1196
1198
|
e.componentsDir,
|
|
1197
1199
|
e.components,
|
|
1198
1200
|
e.enableFallbackComponent,
|
|
1199
1201
|
e.customFallbackComponent
|
|
1200
1202
|
),
|
|
1201
|
-
|
|
1203
|
+
Mr(e),
|
|
1202
1204
|
Sn(
|
|
1203
|
-
e.
|
|
1205
|
+
e.livePreview,
|
|
1204
1206
|
u.output
|
|
1205
1207
|
)
|
|
1206
1208
|
]
|
|
1207
1209
|
}
|
|
1208
|
-
}), e.
|
|
1210
|
+
}), e.livePreview && (u == null ? void 0 : u.output) !== "server")
|
|
1209
1211
|
throw new Error(
|
|
1210
1212
|
"To utilize the Astro Storyblok Live feature, Astro must be configured in SSR mode. Please disable this feature or switch Astro to SSR mode."
|
|
1211
1213
|
);
|
|
@@ -1215,7 +1217,7 @@ function Ln(o) {
|
|
|
1215
1217
|
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
1216
1218
|
globalThis.storyblokApiInstance = storyblokApiInstance;
|
|
1217
1219
|
`
|
|
1218
|
-
), e.bridge && !e.
|
|
1220
|
+
), e.bridge && !e.livePreview) {
|
|
1219
1221
|
let f = "";
|
|
1220
1222
|
if (typeof e.bridge == "object") {
|
|
1221
1223
|
const g = { ...e.bridge };
|
|
@@ -1241,20 +1243,20 @@ function Ln(o) {
|
|
|
1241
1243
|
`
|
|
1242
1244
|
);
|
|
1243
1245
|
}
|
|
1244
|
-
e.
|
|
1246
|
+
e.livePreview && (r(
|
|
1245
1247
|
"page",
|
|
1246
1248
|
`
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1249
|
+
import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
|
|
1250
|
+
import { bridgeOptions } from "virtual:storyblok-bridge";
|
|
1251
|
+
console.info("The Storyblok Astro live preview feature is currently in an experimental phase, and its API is subject to change in the future.")
|
|
1252
|
+
loadStoryblokBridge().then(() => {
|
|
1253
|
+
const { StoryblokBridge, location } = window;
|
|
1254
|
+
if(bridgeOptions){
|
|
1255
|
+
const storyblokInstance = new StoryblokBridge(bridgeOptions);
|
|
1256
|
+
storyblokInstance.on(["published", "change", "input"], handleStoryblokMessage);
|
|
1257
|
+
};
|
|
1258
|
+
});
|
|
1259
|
+
`
|
|
1258
1260
|
), l({
|
|
1259
1261
|
entrypoint: "@storyblok/astro/middleware.ts",
|
|
1260
1262
|
order: "pre"
|
|
@@ -1264,11 +1266,11 @@ function Ln(o) {
|
|
|
1264
1266
|
};
|
|
1265
1267
|
}
|
|
1266
1268
|
export {
|
|
1267
|
-
|
|
1269
|
+
hn as RichTextResolver,
|
|
1268
1270
|
dn as RichTextSchema,
|
|
1269
|
-
|
|
1271
|
+
Nn as default,
|
|
1270
1272
|
En as handleStoryblokMessage,
|
|
1271
|
-
|
|
1273
|
+
xn as loadStoryblokBridge,
|
|
1272
1274
|
Mn as renderRichText,
|
|
1273
1275
|
$n as storyblokEditable,
|
|
1274
1276
|
Pn as useStoryblok,
|