@storyblok/astro 4.1.0-alpha.2 → 4.1.0-alpha.3

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.
@@ -1,9 +1,9 @@
1
- function Or(o, e, r) {
2
- const a = "virtual:storyblok-init", s = "\0" + a;
1
+ function Or(o, r, e) {
2
+ const i = "virtual:storyblok-init", s = "\0" + i;
3
3
  return {
4
4
  name: "vite-plugin-storyblok-init",
5
5
  async resolveId(l) {
6
- if (l === a)
6
+ if (l === i)
7
7
  return s;
8
8
  },
9
9
  async load(l) {
@@ -12,35 +12,35 @@ function Or(o, e, r) {
12
12
  import { storyblokInit, apiPlugin } from "@storyblok/js";
13
13
  const { storyblokApi } = storyblokInit({
14
14
  accessToken: "${o}",
15
- use: ${e ? "[]" : "[apiPlugin]"},
16
- apiOptions: ${JSON.stringify(r)},
15
+ use: ${r ? "[]" : "[apiPlugin]"},
16
+ apiOptions: ${JSON.stringify(e)},
17
17
  });
18
18
  export const storyblokApiInstance = storyblokApi;
19
19
  `;
20
20
  }
21
21
  };
22
22
  }
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) => {
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"), Dt = new RegExp("\\d+" + Gt.source, "gu"), xr = (o, r, e, i) => {
24
24
  let s = !1, l = !1, u = !1, f = !1;
25
25
  for (let g = 0; g < o.length; g++) {
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);
26
+ const b = o[g];
27
+ f = g > 2 ? o[g - 3] === "-" : !0, s && Cr.test(b) ? (o = o.slice(0, g) + "-" + o.slice(g), s = !1, u = l, l = !0, g++) : l && u && jr.test(b) && (!f || i) ? (o = o.slice(0, g - 1) + "-" + o.slice(g - 1), u = l, l = !1, s = !0) : (s = r(b) === b && e(b) !== b, u = l, l = e(b) === b && r(b) !== b);
28
28
  }
29
29
  return o;
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
- function Dt(o, e) {
30
+ }, Er = (o, r) => (zt.lastIndex = 0, o.replaceAll(zt, (e) => r(e))), Rr = (o, r) => (Lt.lastIndex = 0, Dt.lastIndex = 0, o.replaceAll(Dt, (e, i, s) => ["_", "-"].includes(o.charAt(s + e.length)) ? e : r(e)).replaceAll(Lt, (e, i) => r(i)));
31
+ function Ut(o, r) {
32
32
  if (!(typeof o == "string" || Array.isArray(o)))
33
33
  throw new TypeError("Expected the input to be `string | string[]`");
34
- if (e = {
34
+ if (r = {
35
35
  pascalCase: !1,
36
36
  preserveConsecutiveUppercase: !1,
37
- ...e
37
+ ...r
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
- 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 = 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));
40
+ const e = r.locale === !1 ? (l) => l.toLowerCase() : (l) => l.toLocaleLowerCase(r.locale), i = r.locale === !1 ? (l) => l.toUpperCase() : (l) => l.toLocaleUpperCase(r.locale);
41
+ return o.length === 1 ? ft.test(o) ? "" : r.pascalCase ? i(o) : e(o) : (o !== e(o) && (o = xr(o, e, i, r.preserveConsecutiveUppercase)), o = o.replace($r, ""), o = r.preserveConsecutiveUppercase ? Er(o, e) : e(o), r.pascalCase && (o = i(o.charAt(0)) + o.slice(1)), Rr(o, i));
42
42
  }
43
- function Pr(o, e, r, a) {
43
+ function Pr(o, r, e, i) {
44
44
  const s = "virtual:storyblok-components", l = "\0" + s;
45
45
  return {
46
46
  name: "vite-plugin-storyblok-components",
@@ -51,28 +51,28 @@ function Pr(o, e, r, a) {
51
51
  async load(u) {
52
52
  if (u === l) {
53
53
  const f = [], g = [];
54
- for await (const [_, T] of Object.entries(e)) {
55
- const w = await this.resolve(
56
- "/" + o + "/" + T + ".astro"
54
+ for await (const [_, k] of Object.entries(r)) {
55
+ const I = await this.resolve(
56
+ "/" + o + "/" + k + ".astro"
57
57
  );
58
- if (w)
59
- f.push(`import ${Dt(_)} from "${w.id}"`);
60
- else if (r)
58
+ if (I)
59
+ f.push(`import ${Ut(_)} from "${I.id}"`);
60
+ else if (e)
61
61
  g.push(_);
62
62
  else
63
63
  throw new Error(
64
- `Component could not be found for blok "${_}"! Does "${"/" + o + "/" + T}.astro" exist?`
64
+ `Component could not be found for blok "${_}"! Does "${"/" + o + "/" + k}.astro" exist?`
65
65
  );
66
66
  }
67
- let v = "";
68
- if (r)
69
- if (v = ",FallbackComponent", a) {
67
+ let b = "";
68
+ if (e)
69
+ if (b = ",FallbackComponent", i) {
70
70
  const _ = await this.resolve(
71
- "/" + o + "/" + a + ".astro"
71
+ "/" + o + "/" + i + ".astro"
72
72
  );
73
73
  if (!_)
74
74
  throw new Error(
75
- `Custom fallback component could not be found. Does "${"/" + o + "/" + a}.astro" exist?`
75
+ `Custom fallback component could not be found. Does "${"/" + o + "/" + i}.astro" exist?`
76
76
  );
77
77
  f.push(
78
78
  `import FallbackComponent from "${_.id}"`
@@ -81,10 +81,10 @@ function Pr(o, e, r, a) {
81
81
  f.push(
82
82
  "import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
83
83
  );
84
- if (Object.values(e).length)
85
- return `${f.join(";")};export default {${Object.keys(e).filter((_) => !g.includes(_)).map((_) => Dt(_)).join(",")}${v}}`;
86
- if (r)
87
- return `${f[0]}; export default {${v.replace(",", "")}}`;
84
+ if (Object.values(r).length)
85
+ return `${f.join(";")};export default {${Object.keys(r).filter((_) => !g.includes(_)).map((_) => Ut(_)).join(",")}${b}}`;
86
+ if (e)
87
+ return `${f[0]}; export default {${b.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.
@@ -95,21 +95,21 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
95
95
  };
96
96
  }
97
97
  function Mr(o) {
98
- const e = "virtual:storyblok-options", r = "\0" + e;
98
+ const r = "virtual:storyblok-options", e = "\0" + r;
99
99
  return {
100
100
  name: "vite-plugin-storyblok-options",
101
- async resolveId(a) {
102
- if (a === e)
103
- return r;
101
+ async resolveId(i) {
102
+ if (i === r)
103
+ return e;
104
104
  },
105
- async load(a) {
106
- if (a === r)
105
+ async load(i) {
106
+ if (i === e)
107
107
  return `export default ${JSON.stringify(o)}`;
108
108
  }
109
109
  };
110
110
  }
111
111
  let Bt = !1;
112
- const Ft = [], Nr = (o) => new Promise((e, r) => {
112
+ const Ft = [], Nr = (o) => new Promise((r, e) => {
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.");
@@ -118,30 +118,30 @@ const Ft = [], Nr = (o) => new Promise((e, r) => {
118
118
  Bt ? s() : Ft.push(s);
119
119
  }, document.getElementById("storyblok-javascript-bridge")))
120
120
  return;
121
- const a = document.createElement("script");
122
- a.async = !0, a.src = o, a.id = "storyblok-javascript-bridge", a.onerror = (s) => r(s), a.onload = (s) => {
123
- Ft.forEach((l) => l()), Bt = !0, e(s);
124
- }, document.getElementsByTagName("head")[0].appendChild(a);
121
+ const i = document.createElement("script");
122
+ i.async = !0, i.src = o, i.id = "storyblok-javascript-bridge", i.onerror = (s) => e(s), i.onload = (s) => {
123
+ Ft.forEach((l) => l()), Bt = !0, r(s);
124
+ }, document.getElementsByTagName("head")[0].appendChild(i);
125
125
  });
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 {
126
+ var zr = Object.defineProperty, Lr = (o, r, e) => r in o ? zr(o, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[r] = e, S = (o, r, e) => (Lr(o, typeof r != "symbol" ? r + "" : r, e), e);
127
+ class Dr {
128
128
  constructor() {
129
- O(this, "isCDNUrl", (e = "") => e.indexOf("/cdn/") > -1), O(this, "getOptionsPage", (e, r = 25, a = 1) => ({
130
- ...e,
131
- per_page: r,
132
- page: a
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
- const a = Math.abs(r - e) || 0, s = e < r ? 1 : -1;
135
- return this.arrayFrom(a, (l, u) => u * s + e);
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
- const r = {
129
+ S(this, "isCDNUrl", (r = "") => r.indexOf("/cdn/") > -1), S(this, "getOptionsPage", (r, e = 25, i = 1) => ({
130
+ ...r,
131
+ per_page: e,
132
+ page: i
133
+ })), S(this, "delay", (r) => new Promise((e) => setTimeout(e, r))), S(this, "arrayFrom", (r = 0, e) => [...Array(r)].map(e)), S(this, "range", (r = 0, e = r) => {
134
+ const i = Math.abs(e - r) || 0, s = r < e ? 1 : -1;
135
+ return this.arrayFrom(i, (l, u) => u * s + r);
136
+ }), S(this, "asyncMap", async (r, e) => Promise.all(r.map(e))), S(this, "flatMap", (r = [], e) => r.map(e).reduce((i, s) => [...i, ...s], [])), S(this, "escapeHTML", function(r) {
137
+ const e = {
138
138
  "&": "&amp;",
139
139
  "<": "&lt;",
140
140
  ">": "&gt;",
141
141
  '"': "&quot;",
142
142
  "'": "&#39;"
143
- }, a = /[&<>"']/g, s = RegExp(a.source);
144
- return e && s.test(e) ? e.replace(a, (l) => r[l]) : e;
143
+ }, i = /[&<>"']/g, s = RegExp(i.source);
144
+ return r && s.test(r) ? r.replace(i, (l) => e[l]) : r;
145
145
  });
146
146
  }
147
147
  /**
@@ -151,18 +151,18 @@ class Ur {
151
151
  * @param {Boolean} isArray
152
152
  * @return {String} Stringified object
153
153
  */
154
- stringify(e, r, a) {
154
+ stringify(r, e, i) {
155
155
  const s = [];
156
- for (const l in e) {
157
- if (!Object.prototype.hasOwnProperty.call(e, l))
156
+ for (const l in r) {
157
+ if (!Object.prototype.hasOwnProperty.call(r, l))
158
158
  continue;
159
- const u = e[l], f = a ? "" : encodeURIComponent(l);
159
+ const u = r[l], f = i ? "" : encodeURIComponent(l);
160
160
  let g;
161
161
  typeof u == "object" ? g = this.stringify(
162
162
  u,
163
- r ? r + encodeURIComponent("[" + f + "]") : f,
163
+ e ? e + encodeURIComponent("[" + f + "]") : f,
164
164
  Array.isArray(u)
165
- ) : g = (r ? r + encodeURIComponent("[" + f + "]") : f) + "=" + encodeURIComponent(u), s.push(g);
165
+ ) : g = (e ? e + encodeURIComponent("[" + f + "]") : f) + "=" + encodeURIComponent(u), s.push(g);
166
166
  }
167
167
  return s.join("&");
168
168
  }
@@ -171,11 +171,11 @@ class Ur {
171
171
  * @param {String} regionCode region code, could be eu, us, cn, ap or ca
172
172
  * @return {String} The base URL of the region
173
173
  */
174
- getRegionURL(e) {
175
- const r = "api.storyblok.com", a = "api-us.storyblok.com", s = "app.storyblokchina.cn", l = "api-ap.storyblok.com", u = "api-ca.storyblok.com";
176
- switch (e) {
174
+ getRegionURL(r) {
175
+ const e = "api.storyblok.com", i = "api-us.storyblok.com", s = "app.storyblokchina.cn", l = "api-ap.storyblok.com", u = "api-ca.storyblok.com";
176
+ switch (r) {
177
177
  case "us":
178
- return a;
178
+ return i;
179
179
  case "cn":
180
180
  return s;
181
181
  case "ap":
@@ -183,17 +183,17 @@ class Ur {
183
183
  case "ca":
184
184
  return u;
185
185
  default:
186
- return r;
186
+ return e;
187
187
  }
188
188
  }
189
189
  }
190
- const Dr = function(o, e) {
191
- const r = {};
192
- for (const a in o) {
193
- const s = o[a];
194
- e.indexOf(a) > -1 && s !== null && (r[a] = s);
190
+ const Ur = function(o, r) {
191
+ const e = {};
192
+ for (const i in o) {
193
+ const s = o[i];
194
+ r.indexOf(i) > -1 && s !== null && (e[i] = s);
195
195
  }
196
- return r;
196
+ return e;
197
197
  }, Br = (o) => o === "email", Fr = () => ({
198
198
  singleTag: "hr"
199
199
  }), Hr = () => ({
@@ -216,16 +216,16 @@ const Dr = function(o, e) {
216
216
  singleTag: [
217
217
  {
218
218
  tag: "img",
219
- attrs: Dr(o.attrs, ["src", "alt", "title"])
219
+ attrs: Ur(o.attrs, ["src", "alt", "title"])
220
220
  }
221
221
  ]
222
222
  }), Yr = () => ({
223
223
  tag: "li"
224
- }), Xr = () => ({
224
+ }), Vr = () => ({
225
225
  tag: "ol"
226
- }), Zr = () => ({
226
+ }), Xr = () => ({
227
227
  tag: "p"
228
- }), Qr = (o) => ({
228
+ }), Zr = (o) => ({
229
229
  tag: [
230
230
  {
231
231
  tag: "span",
@@ -236,7 +236,7 @@ const Dr = function(o, e) {
236
236
  }
237
237
  }
238
238
  ]
239
- }), Vr = () => ({
239
+ }), Qr = () => ({
240
240
  tag: "b"
241
241
  }), tn = () => ({
242
242
  tag: "s"
@@ -253,17 +253,17 @@ const Dr = function(o, e) {
253
253
  return {
254
254
  tag: ""
255
255
  };
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
- for (const s in r.custom)
259
- r[s] = r.custom[s];
260
- delete r.custom;
256
+ const r = new Dr().escapeHTML, e = { ...o.attrs }, { linktype: i = "url" } = o.attrs;
257
+ if (delete e.linktype, e.href && (e.href = r(o.attrs.href || "")), Br(i) && (e.href = `mailto:${e.href}`), e.anchor && (e.href = `${e.href}#${e.anchor}`, delete e.anchor), e.custom) {
258
+ for (const s in e.custom)
259
+ e[s] = e.custom[s];
260
+ delete e.custom;
261
261
  }
262
262
  return {
263
263
  tag: [
264
264
  {
265
265
  tag: "a",
266
- attrs: r
266
+ attrs: e
267
267
  }
268
268
  ]
269
269
  };
@@ -286,8 +286,8 @@ const Dr = function(o, e) {
286
286
  }
287
287
  ]
288
288
  }), fn = (o) => {
289
- var e;
290
- return (e = o.attrs) != null && e.color ? {
289
+ var r;
290
+ return (r = o.attrs) != null && r.color ? {
291
291
  tag: [
292
292
  {
293
293
  tag: "span",
@@ -300,8 +300,8 @@ const Dr = function(o, e) {
300
300
  tag: ""
301
301
  };
302
302
  }, pn = (o) => {
303
- var e;
304
- return (e = o.attrs) != null && e.color ? {
303
+ var r;
304
+ return (r = o.attrs) != null && r.color ? {
305
305
  tag: [
306
306
  {
307
307
  tag: "span",
@@ -323,12 +323,12 @@ const Dr = function(o, e) {
323
323
  heading: Kr,
324
324
  image: Wr,
325
325
  list_item: Yr,
326
- ordered_list: Xr,
327
- paragraph: Zr,
328
- emoji: Qr
326
+ ordered_list: Vr,
327
+ paragraph: Xr,
328
+ emoji: Zr
329
329
  },
330
330
  marks: {
331
- bold: Vr,
331
+ bold: Qr,
332
332
  strike: tn,
333
333
  underline: en,
334
334
  strong: rn,
@@ -343,31 +343,31 @@ const Dr = function(o, e) {
343
343
  textStyle: pn
344
344
  }
345
345
  }, gn = function(o) {
346
- const e = {
346
+ const r = {
347
347
  "&": "&amp;",
348
348
  "<": "&lt;",
349
349
  ">": "&gt;",
350
350
  '"': "&quot;",
351
351
  "'": "&#39;"
352
- }, r = /[&<>"']/g, a = RegExp(r.source);
353
- return o && a.test(o) ? o.replace(r, (s) => e[s]) : o;
352
+ }, e = /[&<>"']/g, i = RegExp(e.source);
353
+ return o && i.test(o) ? o.replace(e, (s) => r[s]) : o;
354
354
  };
355
355
  class hn {
356
- constructor(e) {
357
- O(this, "marks"), O(this, "nodes"), e || (e = dn), this.marks = e.marks || [], this.nodes = e.nodes || [];
356
+ constructor(r) {
357
+ S(this, "marks"), S(this, "nodes"), r || (r = dn), this.marks = r.marks || [], this.nodes = r.nodes || [];
358
358
  }
359
- addNode(e, r) {
360
- this.nodes[e] = r;
359
+ addNode(r, e) {
360
+ this.nodes[r] = e;
361
361
  }
362
- addMark(e, r) {
363
- this.marks[e] = r;
362
+ addMark(r, e) {
363
+ this.marks[r] = e;
364
364
  }
365
- render(e, r = { optimizeImages: !1 }) {
366
- if (e && e.content && Array.isArray(e.content)) {
367
- let a = "";
368
- return e.content.forEach((s) => {
369
- a += this.renderNode(s);
370
- }), r.optimizeImages ? this.optimizeImages(a, r.optimizeImages) : a;
365
+ render(r, e = { optimizeImages: !1 }) {
366
+ if (r && r.content && Array.isArray(r.content)) {
367
+ let i = "";
368
+ return r.content.forEach((s) => {
369
+ i += this.renderNode(s);
370
+ }), e.optimizeImages ? this.optimizeImages(i, e.optimizeImages) : i;
371
371
  }
372
372
  return console.warn(
373
373
  `The render method must receive an Object with a "content" field.
@@ -396,195 +396,197 @@ class hn {
396
396
  }`
397
397
  ), "";
398
398
  }
399
- optimizeImages(e, r) {
400
- let a = 0, s = 0, l = "", u = "";
401
- typeof r != "boolean" && (typeof r.width == "number" && r.width > 0 && (l += `width="${r.width}" `, a = r.width), typeof r.height == "number" && r.height > 0 && (l += `height="${r.height}" `, s = r.height), (r.loading === "lazy" || r.loading === "eager") && (l += `loading="${r.loading}" `), typeof r.class == "string" && r.class.length > 0 && (l += `class="${r.class}" `), r.filters && (typeof r.filters.blur == "number" && r.filters.blur >= 0 && r.filters.blur <= 100 && (u += `:blur(${r.filters.blur})`), typeof r.filters.brightness == "number" && r.filters.brightness >= -100 && r.filters.brightness <= 100 && (u += `:brightness(${r.filters.brightness})`), r.filters.fill && (r.filters.fill.match(/[0-9A-Fa-f]{6}/g) || r.filters.fill === "transparent") && (u += `:fill(${r.filters.fill})`), r.filters.format && ["webp", "png", "jpeg"].includes(r.filters.format) && (u += `:format(${r.filters.format})`), typeof r.filters.grayscale == "boolean" && r.filters.grayscale && (u += ":grayscale()"), typeof r.filters.quality == "number" && r.filters.quality >= 0 && r.filters.quality <= 100 && (u += `:quality(${r.filters.quality})`), r.filters.rotate && [90, 180, 270].includes(r.filters.rotate) && (u += `:rotate(${r.filters.rotate})`), u.length > 0 && (u = "/filters" + u))), l.length > 0 && (e = e.replace(/<img/g, `<img ${l.trim()}`));
402
- const f = a > 0 || s > 0 || u.length > 0 ? `${a}x${s}${u}` : "";
403
- return e = e.replace(
399
+ optimizeImages(r, e) {
400
+ let i = 0, s = 0, l = "", u = "";
401
+ typeof e != "boolean" && (typeof e.width == "number" && e.width > 0 && (l += `width="${e.width}" `, i = e.width), typeof e.height == "number" && e.height > 0 && (l += `height="${e.height}" `, s = e.height), (e.loading === "lazy" || e.loading === "eager") && (l += `loading="${e.loading}" `), typeof e.class == "string" && e.class.length > 0 && (l += `class="${e.class}" `), e.filters && (typeof e.filters.blur == "number" && e.filters.blur >= 0 && e.filters.blur <= 100 && (u += `:blur(${e.filters.blur})`), typeof e.filters.brightness == "number" && e.filters.brightness >= -100 && e.filters.brightness <= 100 && (u += `:brightness(${e.filters.brightness})`), e.filters.fill && (e.filters.fill.match(/[0-9A-Fa-f]{6}/g) || e.filters.fill === "transparent") && (u += `:fill(${e.filters.fill})`), e.filters.format && ["webp", "png", "jpeg"].includes(e.filters.format) && (u += `:format(${e.filters.format})`), typeof e.filters.grayscale == "boolean" && e.filters.grayscale && (u += ":grayscale()"), typeof e.filters.quality == "number" && e.filters.quality >= 0 && e.filters.quality <= 100 && (u += `:quality(${e.filters.quality})`), e.filters.rotate && [90, 180, 270].includes(e.filters.rotate) && (u += `:rotate(${e.filters.rotate})`), u.length > 0 && (u = "/filters" + u))), l.length > 0 && (r = r.replace(/<img/g, `<img ${l.trim()}`));
402
+ const f = i > 0 || s > 0 || u.length > 0 ? `${i}x${s}${u}` : "";
403
+ return r = r.replace(
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
- ), typeof r != "boolean" && (r.sizes || r.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (g) => {
407
- var v, _;
408
- const T = g.match(
406
+ ), typeof e != "boolean" && (e.sizes || e.srcset) && (r = r.replace(/<img.*?src=["|'](.*?)["|']/g, (g) => {
407
+ var b, _;
408
+ const k = g.match(
409
409
  /a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
410
410
  );
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) {
411
+ if (k && k.length > 0) {
412
+ const I = {
413
+ srcset: (b = e.srcset) == null ? void 0 : b.map((w) => {
414
+ if (typeof w == "number")
415
+ return `//${k}/m/${w}x0${u} ${w}w`;
416
+ if (typeof w == "object" && w.length === 2) {
417
417
  let M = 0, F = 0;
418
- return typeof k[0] == "number" && (M = k[0]), typeof k[1] == "number" && (F = k[1]), `//${T}/m/${M}x${F}${u} ${M}w`;
418
+ return typeof w[0] == "number" && (M = w[0]), typeof w[1] == "number" && (F = w[1]), `//${k}/m/${M}x${F}${u} ${M}w`;
419
419
  }
420
420
  }).join(", "),
421
- sizes: (_ = r.sizes) == null ? void 0 : _.map((k) => k).join(", ")
421
+ sizes: (_ = e.sizes) == null ? void 0 : _.map((w) => w).join(", ")
422
422
  };
423
- let A = "";
424
- return w.srcset && (A += `srcset="${w.srcset}" `), w.sizes && (A += `sizes="${w.sizes}" `), g.replace(/<img/g, `<img ${A.trim()}`);
423
+ let O = "";
424
+ return I.srcset && (O += `srcset="${I.srcset}" `), I.sizes && (O += `sizes="${I.sizes}" `), g.replace(/<img/g, `<img ${O.trim()}`);
425
425
  }
426
426
  return g;
427
- })), e;
427
+ })), r;
428
428
  }
429
- renderNode(e) {
430
- const r = [];
431
- e.marks && e.marks.forEach((s) => {
429
+ renderNode(r) {
430
+ const e = [];
431
+ r.marks && r.marks.forEach((s) => {
432
432
  const l = this.getMatchingMark(s);
433
- l && l.tag !== "" && r.push(this.renderOpeningTag(l.tag));
433
+ l && l.tag !== "" && e.push(this.renderOpeningTag(l.tag));
434
434
  });
435
- const a = this.getMatchingNode(e);
436
- return a && a.tag && r.push(this.renderOpeningTag(a.tag)), e.content ? e.content.forEach((s) => {
437
- r.push(this.renderNode(s));
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) => {
435
+ const i = this.getMatchingNode(r);
436
+ return i && i.tag && e.push(this.renderOpeningTag(i.tag)), r.content ? r.content.forEach((s) => {
437
+ e.push(this.renderNode(s));
438
+ }) : r.text ? e.push(gn(r.text)) : i && i.singleTag ? e.push(this.renderTag(i.singleTag, " /")) : i && i.html ? e.push(i.html) : r.type === "emoji" && e.push(this.renderEmoji(r)), i && i.tag && e.push(this.renderClosingTag(i.tag)), r.marks && r.marks.slice(0).reverse().forEach((s) => {
439
439
  const l = this.getMatchingMark(s);
440
- l && l.tag !== "" && r.push(this.renderClosingTag(l.tag));
441
- }), r.join("");
440
+ l && l.tag !== "" && e.push(this.renderClosingTag(l.tag));
441
+ }), e.join("");
442
442
  }
443
- renderTag(e, r) {
444
- return e.constructor === String ? `<${e}${r}>` : e.map((a) => {
445
- if (a.constructor === String)
446
- return `<${a}${r}>`;
443
+ renderTag(r, e) {
444
+ return r.constructor === String ? `<${r}${e}>` : r.map((i) => {
445
+ if (i.constructor === String)
446
+ return `<${i}${e}>`;
447
447
  {
448
- let s = `<${a.tag}`;
449
- if (a.attrs)
450
- for (const l in a.attrs) {
451
- const u = a.attrs[l];
448
+ let s = `<${i.tag}`;
449
+ if (i.attrs)
450
+ for (const l in i.attrs) {
451
+ const u = i.attrs[l];
452
452
  u !== null && (s += ` ${l}="${u}"`);
453
453
  }
454
- return `${s}${r}>`;
454
+ return `${s}${e}>`;
455
455
  }
456
456
  }).join("");
457
457
  }
458
- renderOpeningTag(e) {
459
- return this.renderTag(e, "");
458
+ renderOpeningTag(r) {
459
+ return this.renderTag(r, "");
460
460
  }
461
- renderClosingTag(e) {
462
- return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((r) => r.constructor === String ? `</${r}>` : `</${r.tag}>`).join("");
461
+ renderClosingTag(r) {
462
+ return r.constructor === String ? `</${r}>` : r.slice(0).reverse().map((e) => e.constructor === String ? `</${e}>` : `</${e.tag}>`).join("");
463
463
  }
464
- getMatchingNode(e) {
465
- const r = this.nodes[e.type];
466
- if (typeof r == "function")
467
- return r(e);
464
+ getMatchingNode(r) {
465
+ const e = this.nodes[r.type];
466
+ if (typeof e == "function")
467
+ return e(r);
468
468
  }
469
- getMatchingMark(e) {
470
- const r = this.marks[e.type];
471
- if (typeof r == "function")
472
- return r(e);
469
+ getMatchingMark(r) {
470
+ const e = this.marks[r.type];
471
+ if (typeof e == "function")
472
+ return e(r);
473
473
  }
474
- renderEmoji(e) {
475
- if (e.attrs.emoji)
476
- return e.attrs.emoji;
477
- const r = [
474
+ renderEmoji(r) {
475
+ if (r.attrs.emoji)
476
+ return r.attrs.emoji;
477
+ const e = [
478
478
  {
479
479
  tag: "img",
480
480
  attrs: {
481
- src: e.attrs.fallbackImage,
481
+ src: r.attrs.fallbackImage,
482
482
  draggable: "false",
483
483
  loading: "lazy",
484
484
  align: "absmiddle"
485
485
  }
486
486
  }
487
487
  ];
488
- return this.renderTag(r, " /");
488
+ return this.renderTag(e, " /");
489
489
  }
490
490
  }
491
491
  const $n = (o) => {
492
492
  if (typeof o != "object" || typeof o._editable > "u")
493
493
  return {};
494
494
  try {
495
- const e = JSON.parse(
495
+ const r = JSON.parse(
496
496
  o._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
497
497
  );
498
- return e ? {
499
- "data-blok-c": JSON.stringify(e),
500
- "data-blok-uid": e.id + "-" + e.uid
498
+ return r ? {
499
+ "data-blok-c": JSON.stringify(r),
500
+ "data-blok-uid": r.id + "-" + r.uid
501
501
  } : {};
502
502
  } catch {
503
503
  return {};
504
504
  }
505
505
  };
506
- let bn, yn = "https://app.storyblok.com/f/storyblok-v2-latest.js";
507
- const mn = (o, e) => {
508
- o.addNode("blok", (r) => {
509
- let a = "";
510
- return r.attrs.body.forEach((s) => {
511
- a += e(s.component, s);
506
+ let yn, bn = "https://app.storyblok.com/f/storyblok-v2-latest.js";
507
+ const mn = (o, r) => {
508
+ o.addNode("blok", (e) => {
509
+ let i = "";
510
+ return e.attrs.body.forEach((s) => {
511
+ i += r(s.component, s);
512
512
  }), {
513
- html: a
513
+ html: i
514
514
  };
515
515
  });
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
- if (!a) {
516
+ }, vn = (o) => !o || !(o != null && o.content.some((r) => r.content || r.type === "blok" || r.type === "horizontal_rule")), _n = (o, r, e) => {
517
+ let i = e || yn;
518
+ if (!i) {
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 vn(o) ? "" : (e && (a = new hn(e.schema), e.resolver && mn(a, e.resolver)), a.render(o));
525
- }, xn = () => Nr(yn);
524
+ return vn(o) ? "" : (r && (i = new hn(r.schema), r.resolver && mn(i, r.resolver)), i.render(o));
525
+ }, xn = () => Nr(bn);
526
526
  function wn(o) {
527
- let e = {
527
+ let r = {
528
528
  resolveRelations: []
529
529
  };
530
- function r(a) {
531
- a && (Array.isArray(a) ? e.resolveRelations.push(...a) : e.resolveRelations.push(a));
530
+ function e(i) {
531
+ i && Array.isArray(r.resolveRelations) && r.resolveRelations.push(
532
+ ...Array.isArray(i) ? i : [i]
533
+ );
532
534
  }
533
- for (const a of o)
534
- if (a.options) {
535
- const { apiOptions: s, bridgeOptions: l } = a.options;
536
- if (r(s == null ? void 0 : s.resolve_relations), l) {
535
+ for (const i of o)
536
+ if (i.options) {
537
+ const { apiOptions: s, bridgeOptions: l } = i.options;
538
+ if (e(s == null ? void 0 : s.resolve_relations), l) {
537
539
  const { resolveRelations: u, ...f } = l;
538
- r(u), Object.assign(e, f);
540
+ e(u), Object.assign(r, f);
539
541
  }
540
542
  }
541
- return e.resolveRelations = [...new Set(e.resolveRelations)], e;
543
+ return r.resolveRelations = [...new Set(r.resolveRelations)], r;
542
544
  }
543
- var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
545
+ var X = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
544
546
  function Tn(o) {
545
547
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
546
548
  }
547
- var Q = { exports: {} };
548
- Q.exports;
549
- (function(o, e) {
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() {
549
+ var Z = { exports: {} };
550
+ Z.exports;
551
+ (function(o, r) {
552
+ var e = 200, i = "__lodash_hash_undefined__", s = 800, l = 16, u = 9007199254740991, f = "[object Arguments]", g = "[object Array]", b = "[object AsyncFunction]", _ = "[object Boolean]", k = "[object Date]", I = "[object Error]", O = "[object Function]", w = "[object GeneratorFunction]", M = "[object Map]", F = "[object Number]", Jt = "[object Null]", pt = "[object Object]", Kt = "[object Proxy]", Wt = "[object RegExp]", Yt = "[object Set]", Vt = "[object String]", Xt = "[object Undefined]", Zt = "[object WeakMap]", Qt = "[object ArrayBuffer]", te = "[object DataView]", ee = "[object Float32Array]", re = "[object Float64Array]", ne = "[object Int8Array]", oe = "[object Int16Array]", ae = "[object Int32Array]", ie = "[object Uint8Array]", se = "[object Uint8ClampedArray]", le = "[object Uint16Array]", ce = "[object Uint32Array]", ue = /[\\^$.*+?()[\]{}|]/g, fe = /^\[object .+?Constructor\]$/, pe = /^(?:0|[1-9]\d*)$/, y = {};
553
+ y[ee] = y[re] = y[ne] = y[oe] = y[ae] = y[ie] = y[se] = y[le] = y[ce] = !0, y[f] = y[g] = y[Qt] = y[_] = y[te] = y[k] = y[I] = y[O] = y[M] = y[F] = y[pt] = y[Wt] = y[Yt] = y[Vt] = y[Zt] = !1;
554
+ var dt = typeof X == "object" && X && X.Object === Object && X, de = typeof self == "object" && self && self.Object === Object && self, N = dt || de || Function("return this")(), gt = r && !r.nodeType && r, z = gt && !0 && o && !o.nodeType && o, ht = z && z.exports === gt, Q = ht && dt.process, yt = function() {
553
555
  try {
554
556
  var t = z && z.require && z.require("util").types;
555
- return t || V && V.binding && V.binding("util");
557
+ return t || Q && Q.binding && Q.binding("util");
556
558
  } catch {
557
559
  }
558
- }(), yt = bt && bt.isTypedArray;
559
- function ge(t, n, i) {
560
- switch (i.length) {
560
+ }(), bt = yt && yt.isTypedArray;
561
+ function ge(t, n, a) {
562
+ switch (a.length) {
561
563
  case 0:
562
564
  return t.call(n);
563
565
  case 1:
564
- return t.call(n, i[0]);
566
+ return t.call(n, a[0]);
565
567
  case 2:
566
- return t.call(n, i[0], i[1]);
568
+ return t.call(n, a[0], a[1]);
567
569
  case 3:
568
- return t.call(n, i[0], i[1], i[2]);
570
+ return t.call(n, a[0], a[1], a[2]);
569
571
  }
570
- return t.apply(n, i);
572
+ return t.apply(n, a);
571
573
  }
572
574
  function he(t, n) {
573
- for (var i = -1, c = Array(t); ++i < t; )
574
- c[i] = n(i);
575
+ for (var a = -1, c = Array(t); ++a < t; )
576
+ c[a] = n(a);
575
577
  return c;
576
578
  }
577
- function be(t) {
579
+ function ye(t) {
578
580
  return function(n) {
579
581
  return t(n);
580
582
  };
581
583
  }
582
- function ye(t, n) {
584
+ function be(t, n) {
583
585
  return t == null ? void 0 : t[n];
584
586
  }
585
587
  function me(t, n) {
586
- return function(i) {
587
- return t(n(i));
588
+ return function(a) {
589
+ return t(n(a));
588
590
  };
589
591
  }
590
592
  var ve = Array.prototype, _e = Function.prototype, H = Object.prototype, tt = N["__core-js_shared__"], q = _e.toString, C = H.hasOwnProperty, mt = function() {
@@ -607,13 +609,13 @@ Q.exports;
607
609
  if (At)
608
610
  return At(n);
609
611
  t.prototype = n;
610
- var i = new t();
611
- return t.prototype = void 0, i;
612
+ var a = new t();
613
+ return t.prototype = void 0, a;
612
614
  };
613
615
  }();
614
616
  function x(t) {
615
- var n = -1, i = t == null ? 0 : t.length;
616
- for (this.clear(); ++n < i; ) {
617
+ var n = -1, a = t == null ? 0 : t.length;
618
+ for (this.clear(); ++n < a; ) {
617
619
  var c = t[n];
618
620
  this.set(c[0], c[1]);
619
621
  }
@@ -628,8 +630,8 @@ Q.exports;
628
630
  function $e(t) {
629
631
  var n = this.__data__;
630
632
  if (L) {
631
- var i = n[t];
632
- return i === a ? void 0 : i;
633
+ var a = n[t];
634
+ return a === i ? void 0 : a;
633
635
  }
634
636
  return C.call(n, t) ? n[t] : void 0;
635
637
  }
@@ -638,13 +640,13 @@ Q.exports;
638
640
  return L ? n[t] !== void 0 : C.call(n, t);
639
641
  }
640
642
  function Ee(t, n) {
641
- var i = this.__data__;
642
- return this.size += this.has(t) ? 0 : 1, i[t] = L && n === void 0 ? a : n, this;
643
+ var a = this.__data__;
644
+ return this.size += this.has(t) ? 0 : 1, a[t] = L && n === void 0 ? i : n, this;
643
645
  }
644
646
  x.prototype.clear = Ce, x.prototype.delete = je, x.prototype.get = $e, x.prototype.has = xe, x.prototype.set = Ee;
645
647
  function j(t) {
646
- var n = -1, i = t == null ? 0 : t.length;
647
- for (this.clear(); ++n < i; ) {
648
+ var n = -1, a = t == null ? 0 : t.length;
649
+ for (this.clear(); ++n < a; ) {
648
650
  var c = t[n];
649
651
  this.set(c[0], c[1]);
650
652
  }
@@ -653,27 +655,27 @@ Q.exports;
653
655
  this.__data__ = [], this.size = 0;
654
656
  }
655
657
  function Pe(t) {
656
- var n = this.__data__, i = K(n, t);
657
- if (i < 0)
658
+ var n = this.__data__, a = K(n, t);
659
+ if (a < 0)
658
660
  return !1;
659
661
  var c = n.length - 1;
660
- return i == c ? n.pop() : Ae.call(n, i, 1), --this.size, !0;
662
+ return a == c ? n.pop() : Ae.call(n, a, 1), --this.size, !0;
661
663
  }
662
664
  function Me(t) {
663
- var n = this.__data__, i = K(n, t);
664
- return i < 0 ? void 0 : n[i][1];
665
+ var n = this.__data__, a = K(n, t);
666
+ return a < 0 ? void 0 : n[a][1];
665
667
  }
666
668
  function Ne(t) {
667
669
  return K(this.__data__, t) > -1;
668
670
  }
669
671
  function ze(t, n) {
670
- var i = this.__data__, c = K(i, t);
671
- return c < 0 ? (++this.size, i.push([t, n])) : i[c][1] = n, this;
672
+ var a = this.__data__, c = K(a, t);
673
+ return c < 0 ? (++this.size, a.push([t, n])) : a[c][1] = n, this;
672
674
  }
673
675
  j.prototype.clear = Re, j.prototype.delete = Pe, j.prototype.get = Me, j.prototype.has = Ne, j.prototype.set = ze;
674
676
  function R(t) {
675
- var n = -1, i = t == null ? 0 : t.length;
676
- for (this.clear(); ++n < i; ) {
677
+ var n = -1, a = t == null ? 0 : t.length;
678
+ for (this.clear(); ++n < a; ) {
677
679
  var c = t[n];
678
680
  this.set(c[0], c[1]);
679
681
  }
@@ -685,21 +687,21 @@ Q.exports;
685
687
  string: new x()
686
688
  };
687
689
  }
688
- function Ue(t) {
690
+ function De(t) {
689
691
  var n = Y(this, t).delete(t);
690
692
  return this.size -= n ? 1 : 0, n;
691
693
  }
692
- function De(t) {
694
+ function Ue(t) {
693
695
  return Y(this, t).get(t);
694
696
  }
695
697
  function Be(t) {
696
698
  return Y(this, t).has(t);
697
699
  }
698
700
  function Fe(t, n) {
699
- var i = Y(this, t), c = i.size;
700
- return i.set(t, n), this.size += i.size == c ? 0 : 1, this;
701
+ var a = Y(this, t), c = a.size;
702
+ return a.set(t, n), this.size += a.size == c ? 0 : 1, this;
701
703
  }
702
- R.prototype.clear = Le, R.prototype.delete = Ue, R.prototype.get = De, R.prototype.has = Be, R.prototype.set = Fe;
704
+ R.prototype.clear = Le, R.prototype.delete = De, R.prototype.get = Ue, R.prototype.has = Be, R.prototype.set = Fe;
703
705
  function P(t) {
704
706
  var n = this.__data__ = new j(t);
705
707
  this.size = n.size;
@@ -708,8 +710,8 @@ Q.exports;
708
710
  this.__data__ = new j(), this.size = 0;
709
711
  }
710
712
  function qe(t) {
711
- var n = this.__data__, i = n.delete(t);
712
- return this.size = n.size, i;
713
+ var n = this.__data__, a = n.delete(t);
714
+ return this.size = n.size, a;
713
715
  }
714
716
  function Ge(t) {
715
717
  return this.__data__.get(t);
@@ -718,96 +720,96 @@ Q.exports;
718
720
  return this.__data__.has(t);
719
721
  }
720
722
  function Ke(t, n) {
721
- var i = this.__data__;
722
- if (i instanceof j) {
723
- var c = i.__data__;
724
- if (!St || c.length < r - 1)
725
- return c.push([t, n]), this.size = ++i.size, this;
726
- i = this.__data__ = new R(c);
723
+ var a = this.__data__;
724
+ if (a instanceof j) {
725
+ var c = a.__data__;
726
+ if (!St || c.length < e - 1)
727
+ return c.push([t, n]), this.size = ++a.size, this;
728
+ a = this.__data__ = new R(c);
727
729
  }
728
- return i.set(t, n), this.size = i.size, this;
730
+ return a.set(t, n), this.size = a.size, this;
729
731
  }
730
732
  P.prototype.clear = He, P.prototype.delete = qe, P.prototype.get = Ge, P.prototype.has = Je, P.prototype.set = Ke;
731
733
  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);
734
+ var a = it(t), c = !a && at(t), d = !a && !c && xt(t), h = !a && !c && !d && Rt(t), m = a || c || d || h, p = m ? he(t.length, String) : [], v = p.length;
735
+ for (var A in t)
736
+ (n || C.call(t, A)) && !(m && // Safari 9 has enumerable `arguments.length` in strict mode.
737
+ (A == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
738
+ d && (A == "offset" || A == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
739
+ h && (A == "buffer" || A == "byteLength" || A == "byteOffset") || // Skip index properties.
740
+ jt(A, v))) && p.push(A);
739
741
  return p;
740
742
  }
741
- function et(t, n, i) {
742
- (i !== void 0 && !X(t[n], i) || i === void 0 && !(n in t)) && rt(t, n, i);
743
+ function et(t, n, a) {
744
+ (a !== void 0 && !V(t[n], a) || a === void 0 && !(n in t)) && rt(t, n, a);
743
745
  }
744
- function Ye(t, n, i) {
746
+ function Ye(t, n, a) {
745
747
  var c = t[n];
746
- (!(C.call(t, n) && X(c, i)) || i === void 0 && !(n in t)) && rt(t, n, i);
748
+ (!(C.call(t, n) && V(c, a)) || a === void 0 && !(n in t)) && rt(t, n, a);
747
749
  }
748
750
  function K(t, n) {
749
- for (var i = t.length; i--; )
750
- if (X(t[i][0], n))
751
- return i;
751
+ for (var a = t.length; a--; )
752
+ if (V(t[a][0], n))
753
+ return a;
752
754
  return -1;
753
755
  }
754
- function rt(t, n, i) {
756
+ function rt(t, n, a) {
755
757
  n == "__proto__" && J ? J(t, n, {
756
758
  configurable: !0,
757
759
  enumerable: !0,
758
- value: i,
760
+ value: a,
759
761
  writable: !0
760
- }) : t[n] = i;
762
+ }) : t[n] = a;
761
763
  }
762
- var Xe = cr();
764
+ var Ve = cr();
763
765
  function W(t) {
764
- return t == null ? t === void 0 ? Zt : Jt : $ && $ in Object(t) ? ur(t) : br(t);
766
+ return t == null ? t === void 0 ? Xt : Jt : $ && $ in Object(t) ? ur(t) : yr(t);
765
767
  }
766
768
  function Ot(t) {
767
- return U(t) && W(t) == f;
769
+ return D(t) && W(t) == f;
768
770
  }
769
- function Ze(t) {
771
+ function Xe(t) {
770
772
  if (!E(t) || gr(t))
771
773
  return !1;
772
774
  var n = lt(t) ? Te : fe;
773
775
  return n.test(_r(t));
774
776
  }
775
- function Qe(t) {
776
- return U(t) && Et(t.length) && !!b[W(t)];
777
+ function Ze(t) {
778
+ return D(t) && Et(t.length) && !!y[W(t)];
777
779
  }
778
- function Ve(t) {
780
+ function Qe(t) {
779
781
  if (!E(t))
780
782
  return hr(t);
781
- var n = $t(t), i = [];
783
+ var n = $t(t), a = [];
782
784
  for (var c in t)
783
- c == "constructor" && (n || !C.call(t, c)) || i.push(c);
784
- return i;
785
+ c == "constructor" && (n || !C.call(t, c)) || a.push(c);
786
+ return a;
785
787
  }
786
- function Ct(t, n, i, c, d) {
787
- t !== n && Xe(n, function(h, y) {
788
+ function Ct(t, n, a, c, d) {
789
+ t !== n && Ve(n, function(h, m) {
788
790
  if (d || (d = new P()), E(h))
789
- tr(t, n, y, i, Ct, c, d);
791
+ tr(t, n, m, a, Ct, c, d);
790
792
  else {
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
+ var p = c ? c(ot(t, m), h, m + "", t, n, d) : void 0;
794
+ p === void 0 && (p = h), et(t, m, p);
793
795
  }
794
796
  }, Pt);
795
797
  }
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);
798
+ function tr(t, n, a, c, d, h, m) {
799
+ var p = ot(t, a), v = ot(n, a), A = m.get(v);
800
+ if (A) {
801
+ et(t, a, A);
800
802
  return;
801
803
  }
802
- var I = h ? h(p, m, i + "", t, n, y) : void 0, D = I === void 0;
803
- if (D) {
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;
804
+ var T = h ? h(p, v, a + "", t, n, m) : void 0, U = T === void 0;
805
+ if (U) {
806
+ var ct = it(v), ut = !ct && xt(v), Nt = !ct && !ut && Rt(v);
807
+ T = v, ct || ut || Nt ? it(p) ? T = p : wr(p) ? T = ir(p) : ut ? (U = !1, T = nr(v, !0)) : Nt ? (U = !1, T = ar(v, !0)) : T = [] : Tr(v) || at(v) ? (T = p, at(p) ? T = kr(p) : (!E(p) || lt(p)) && (T = fr(v))) : U = !1;
806
808
  }
807
- D && (y.set(m, I), d(I, m, c, h, y), y.delete(m)), et(t, i, I);
809
+ U && (m.set(v, T), d(T, v, c, h, m), m.delete(v)), et(t, a, T);
808
810
  }
809
811
  function er(t, n) {
810
- return mr(yr(t, n, Mt), t + "");
812
+ return mr(br(t, n, Mt), t + "");
811
813
  }
812
814
  var rr = J ? function(t, n) {
813
815
  return J(t, "toString", {
@@ -820,82 +822,82 @@ Q.exports;
820
822
  function nr(t, n) {
821
823
  if (n)
822
824
  return t.slice();
823
- var i = t.length, c = Tt ? Tt(i) : new t.constructor(i);
825
+ var a = t.length, c = Tt ? Tt(a) : new t.constructor(a);
824
826
  return t.copy(c), c;
825
827
  }
826
828
  function or(t) {
827
829
  var n = new t.constructor(t.byteLength);
828
830
  return new wt(n).set(new wt(t)), n;
829
831
  }
830
- function ir(t, n) {
831
- var i = n ? or(t.buffer) : t.buffer;
832
- return new t.constructor(i, t.byteOffset, t.length);
833
- }
834
832
  function ar(t, n) {
835
- var i = -1, c = t.length;
836
- for (n || (n = Array(c)); ++i < c; )
837
- n[i] = t[i];
833
+ var a = n ? or(t.buffer) : t.buffer;
834
+ return new t.constructor(a, t.byteOffset, t.length);
835
+ }
836
+ function ir(t, n) {
837
+ var a = -1, c = t.length;
838
+ for (n || (n = Array(c)); ++a < c; )
839
+ n[a] = t[a];
838
840
  return n;
839
841
  }
840
- function sr(t, n, i, c) {
841
- var d = !i;
842
- i || (i = {});
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);
842
+ function sr(t, n, a, c) {
843
+ var d = !a;
844
+ a || (a = {});
845
+ for (var h = -1, m = n.length; ++h < m; ) {
846
+ var p = n[h], v = c ? c(a[p], t[p], p, a, t) : void 0;
847
+ v === void 0 && (v = t[p]), d ? rt(a, p, v) : Ye(a, p, v);
846
848
  }
847
- return i;
849
+ return a;
848
850
  }
849
851
  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];
852
+ return er(function(n, a) {
853
+ var c = -1, d = a.length, h = d > 1 ? a[d - 1] : void 0, m = d > 2 ? a[2] : void 0;
854
+ for (h = t.length > 3 && typeof h == "function" ? (d--, h) : void 0, m && pr(a[0], a[1], m) && (h = d < 3 ? void 0 : h, d = 1), n = Object(n); ++c < d; ) {
855
+ var p = a[c];
854
856
  p && t(n, p, c, h);
855
857
  }
856
858
  return n;
857
859
  });
858
860
  }
859
861
  function cr(t) {
860
- return function(n, i, c) {
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)
862
+ return function(n, a, c) {
863
+ for (var d = -1, h = Object(n), m = c(n), p = m.length; p--; ) {
864
+ var v = m[t ? p : ++d];
865
+ if (a(h[v], v, h) === !1)
864
866
  break;
865
867
  }
866
868
  return n;
867
869
  };
868
870
  }
869
871
  function Y(t, n) {
870
- var i = t.__data__;
871
- return dr(n) ? i[typeof n == "string" ? "string" : "hash"] : i.map;
872
+ var a = t.__data__;
873
+ return dr(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map;
872
874
  }
873
875
  function nt(t, n) {
874
- var i = ye(t, n);
875
- return Ze(i) ? i : void 0;
876
+ var a = be(t, n);
877
+ return Xe(a) ? a : void 0;
876
878
  }
877
879
  function ur(t) {
878
- var n = C.call(t, $), i = t[$];
880
+ var n = C.call(t, $), a = t[$];
879
881
  try {
880
882
  t[$] = void 0;
881
883
  var c = !0;
882
884
  } catch {
883
885
  }
884
886
  var d = vt.call(t);
885
- return c && (n ? t[$] = i : delete t[$]), d;
887
+ return c && (n ? t[$] = a : delete t[$]), d;
886
888
  }
887
889
  function fr(t) {
888
890
  return typeof t.constructor == "function" && !$t(t) ? Oe(kt(t)) : {};
889
891
  }
890
892
  function jt(t, n) {
891
- var i = typeof t;
892
- return n = n ?? u, !!n && (i == "number" || i != "symbol" && pe.test(t)) && t > -1 && t % 1 == 0 && t < n;
893
+ var a = typeof t;
894
+ return n = n ?? u, !!n && (a == "number" || a != "symbol" && pe.test(t)) && t > -1 && t % 1 == 0 && t < n;
893
895
  }
894
- function pr(t, n, i) {
895
- if (!E(i))
896
+ function pr(t, n, a) {
897
+ if (!E(a))
896
898
  return !1;
897
899
  var c = typeof n;
898
- return (c == "number" ? st(i) && jt(n, i.length) : c == "string" && n in i) ? X(i[n], t) : !1;
900
+ return (c == "number" ? st(a) && jt(n, a.length) : c == "string" && n in a) ? V(a[n], t) : !1;
899
901
  }
900
902
  function dr(t) {
901
903
  var n = typeof t;
@@ -905,27 +907,27 @@ Q.exports;
905
907
  return !!mt && mt in t;
906
908
  }
907
909
  function $t(t) {
908
- var n = t && t.constructor, i = typeof n == "function" && n.prototype || H;
909
- return t === i;
910
+ var n = t && t.constructor, a = typeof n == "function" && n.prototype || H;
911
+ return t === a;
910
912
  }
911
913
  function hr(t) {
912
914
  var n = [];
913
915
  if (t != null)
914
- for (var i in Object(t))
915
- n.push(i);
916
+ for (var a in Object(t))
917
+ n.push(a);
916
918
  return n;
917
919
  }
918
- function br(t) {
920
+ function yr(t) {
919
921
  return vt.call(t);
920
922
  }
921
- function yr(t, n, i) {
923
+ function br(t, n, a) {
922
924
  return n = It(n === void 0 ? t.length - 1 : n, 0), function() {
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
+ for (var c = arguments, d = -1, h = It(c.length - n, 0), m = Array(h); ++d < h; )
926
+ m[d] = c[n + d];
925
927
  d = -1;
926
928
  for (var p = Array(n + 1); ++d < n; )
927
929
  p[d] = c[d];
928
- return p[n] = i(y), ge(t, this, p);
930
+ return p[n] = a(m), ge(t, this, p);
929
931
  };
930
932
  }
931
933
  function ot(t, n) {
@@ -934,10 +936,10 @@ Q.exports;
934
936
  }
935
937
  var mr = vr(rr);
936
938
  function vr(t) {
937
- var n = 0, i = 0;
939
+ var n = 0, a = 0;
938
940
  return function() {
939
- var c = Se(), d = l - (c - i);
940
- if (i = c, d > 0) {
941
+ var c = Se(), d = l - (c - a);
942
+ if (a = c, d > 0) {
941
943
  if (++n >= s)
942
944
  return arguments[0];
943
945
  } else
@@ -958,26 +960,26 @@ Q.exports;
958
960
  }
959
961
  return "";
960
962
  }
961
- function X(t, n) {
963
+ function V(t, n) {
962
964
  return t === n || t !== t && n !== n;
963
965
  }
964
- var it = Ot(/* @__PURE__ */ function() {
966
+ var at = Ot(/* @__PURE__ */ function() {
965
967
  return arguments;
966
968
  }()) ? Ot : function(t) {
967
- return U(t) && C.call(t, "callee") && !ke.call(t, "callee");
968
- }, at = Array.isArray;
969
+ return D(t) && C.call(t, "callee") && !ke.call(t, "callee");
970
+ }, it = Array.isArray;
969
971
  function st(t) {
970
972
  return t != null && Et(t.length) && !lt(t);
971
973
  }
972
974
  function wr(t) {
973
- return U(t) && st(t);
975
+ return D(t) && st(t);
974
976
  }
975
977
  var xt = Ie || Sr;
976
978
  function lt(t) {
977
979
  if (!E(t))
978
980
  return !1;
979
981
  var n = W(t);
980
- return n == A || n == k || n == v || n == Kt;
982
+ return n == O || n == w || n == b || n == Kt;
981
983
  }
982
984
  function Et(t) {
983
985
  return typeof t == "number" && t > -1 && t % 1 == 0 && t <= u;
@@ -986,27 +988,27 @@ Q.exports;
986
988
  var n = typeof t;
987
989
  return t != null && (n == "object" || n == "function");
988
990
  }
989
- function U(t) {
991
+ function D(t) {
990
992
  return t != null && typeof t == "object";
991
993
  }
992
994
  function Tr(t) {
993
- if (!U(t) || W(t) != pt)
995
+ if (!D(t) || W(t) != pt)
994
996
  return !1;
995
997
  var n = kt(t);
996
998
  if (n === null)
997
999
  return !0;
998
- var i = C.call(n, "constructor") && n.constructor;
999
- return typeof i == "function" && i instanceof i && q.call(i) == we;
1000
+ var a = C.call(n, "constructor") && n.constructor;
1001
+ return typeof a == "function" && a instanceof a && q.call(a) == we;
1000
1002
  }
1001
- var Rt = yt ? be(yt) : Qe;
1003
+ var Rt = bt ? ye(bt) : Ze;
1002
1004
  function kr(t) {
1003
1005
  return sr(t, Pt(t));
1004
1006
  }
1005
1007
  function Pt(t) {
1006
- return st(t) ? We(t, !0) : Ve(t);
1008
+ return st(t) ? We(t, !0) : Qe(t);
1007
1009
  }
1008
- var Ar = lr(function(t, n, i, c) {
1009
- Ct(t, n, i, c);
1010
+ var Ar = lr(function(t, n, a, c) {
1011
+ Ct(t, n, a, c);
1010
1012
  });
1011
1013
  function Ir(t) {
1012
1014
  return function() {
@@ -1020,75 +1022,85 @@ Q.exports;
1020
1022
  return !1;
1021
1023
  }
1022
1024
  o.exports = Ar;
1023
- })(Q, Q.exports);
1024
- var kn = Q.exports;
1025
+ })(Z, Z.exports);
1026
+ var kn = Z.exports;
1025
1027
  const An = /* @__PURE__ */ Tn(kn);
1026
1028
  function In(o) {
1027
- let e;
1028
- function r(a, s) {
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
- ...e,
1036
- apiOptions: A
1029
+ let r = {};
1030
+ function e(i, s) {
1031
+ if ((s == null ? void 0 : s.type) === "AwaitExpression" && s.argument.type === "CallExpression" && s.argument.callee.type === "Identifier" && s.argument.callee.name === "useStoryblok") {
1032
+ const l = s.argument.arguments;
1033
+ if (l && l[1].type === "ObjectExpression") {
1034
+ const u = Ht(l[1].properties);
1035
+ r = {
1036
+ ...r,
1037
+ apiOptions: u
1037
1038
  };
1038
1039
  }
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
1040
+ if (l && l[2].type === "ObjectExpression") {
1041
+ const u = Ht(l[2].properties);
1042
+ r = {
1043
+ ...r,
1044
+ bridgeOptions: u
1044
1045
  };
1045
1046
  }
1046
1047
  }
1047
1048
  }
1048
- return An({}, o, r), e;
1049
+ return An({}, o, e), r;
1049
1050
  }
1050
1051
  function Ht(o) {
1051
- return o.reduce((e, { key: r, value: a }) => {
1052
- const { type: s } = a;
1053
- return e[r.name] = s === "Literal" ? a.value : s === "ArrayExpression" ? a.elements.map((l) => l.value) : a.value, e;
1054
- }, {});
1052
+ const r = {};
1053
+ return o.reduce((e, i) => {
1054
+ if (i.type !== "Property")
1055
+ return e;
1056
+ const { key: s, value: l } = i, { type: u } = l;
1057
+ if (s.type !== "Identifier")
1058
+ return e;
1059
+ if (u === "Literal")
1060
+ e[s.name] = l.value;
1061
+ else if (u === "ArrayExpression") {
1062
+ const f = l.elements.reduce((g, b) => b.type === "Literal" && b.value ? [...g, b.value] : g, []);
1063
+ e[s.name] = f;
1064
+ }
1065
+ return e;
1066
+ }, r);
1055
1067
  }
1056
1068
  let B = [];
1057
- function Sn(o, e) {
1058
- const r = "virtual:storyblok-bridge", a = "\0" + r;
1059
- if (!o || e !== "server")
1069
+ function Sn(o, r) {
1070
+ const e = "virtual:storyblok-bridge", i = "\0" + e;
1071
+ if (!o || r !== "server")
1060
1072
  return {
1061
1073
  name: "vite-plugin-storyblok-bridge",
1062
1074
  resolveId(f) {
1063
- if (f === r)
1064
- return a;
1075
+ if (f === e)
1076
+ return i;
1065
1077
  },
1066
1078
  load(f) {
1067
- if (f === a)
1079
+ if (f === i)
1068
1080
  return "export const bridgeOptions = null";
1069
1081
  }
1070
1082
  };
1071
- let s = [], l = null, u = null;
1083
+ let s = [], l = null, u;
1072
1084
  return {
1073
1085
  name: "vite-plugin-storyblok-bridge",
1074
1086
  async resolveId(f) {
1075
- if (f === r)
1076
- return a;
1087
+ if (f === e)
1088
+ return i;
1077
1089
  },
1078
1090
  async transform(f, g) {
1079
- var A;
1080
- if (g.includes("node_modules") && !g.includes("/pages/") || !f.includes("useStoryblok") || !((A = this.getModuleInfo(g).meta) != null && A.astro))
1091
+ var O;
1092
+ if (g.includes("node_modules") && !g.includes("/pages/") || !f.includes("useStoryblok") || !((O = this.getModuleInfo(g).meta) != null && O.astro))
1081
1093
  return;
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
1094
+ const [, ..._] = g.split("src/pages/"), k = _.join("/").replace(".astro", ""), I = In(this.parse(f));
1095
+ B.length && (s = B.filter((w) => w.url !== k)), s.push({
1096
+ url: k,
1097
+ options: I
1086
1098
  }), l && (u && clearTimeout(u), u = setTimeout(() => {
1087
- On(B, s) || (B.length !== 0 && (l.restart(), console.info("Updating bridge options...")), B = [...s]);
1099
+ On(B, s) || (B.length !== 0 && (l.restart(), console.info("Bridge options updated. Restarting...")), B = [...s]);
1088
1100
  }, 1e3));
1089
1101
  },
1090
1102
  async load(f) {
1091
- if (f === a)
1103
+ if (f === i)
1092
1104
  return `export const bridgeOptions = ${JSON.stringify(wn(s))}`;
1093
1105
  },
1094
1106
  configureServer(f) {
@@ -1096,38 +1108,38 @@ function Sn(o, e) {
1096
1108
  }
1097
1109
  };
1098
1110
  }
1099
- function On(o = [], e = []) {
1100
- return e.every(({ url: r, options: a }) => {
1101
- const s = o.find((l) => (l == null ? void 0 : l.url) === r);
1102
- return s && JSON.stringify(a) === JSON.stringify(s.options);
1111
+ function On(o = [], r = []) {
1112
+ return r.every(({ url: e, options: i }) => {
1113
+ const s = o.find((l) => (l == null ? void 0 : l.url) === e);
1114
+ return s && JSON.stringify(i) === JSON.stringify(s.options);
1103
1115
  });
1104
1116
  }
1105
1117
  let qt;
1106
1118
  async function En(o) {
1107
- const { action: e, story: r } = o || {};
1108
- if (e === "input" && r) {
1109
- const a = async () => {
1110
- const l = await jn(r), u = document.body;
1119
+ const { action: r, story: e } = o || {};
1120
+ if (r === "input" && e) {
1121
+ const i = async () => {
1122
+ const l = await jn(e), u = document.body;
1111
1123
  if (l.outerHTML === u.outerHTML)
1112
1124
  return;
1113
1125
  const f = document.querySelector('[data-blok-focused="true"]');
1114
1126
  Cn(u, l, f);
1115
1127
  };
1116
- clearTimeout(qt), qt = setTimeout(a, 500);
1128
+ clearTimeout(qt), qt = setTimeout(i, 500);
1117
1129
  }
1118
1130
  ["published", "change"].includes(o == null ? void 0 : o.action) && location.reload();
1119
1131
  }
1120
- function Cn(o, e, r) {
1121
- if (r) {
1122
- const a = r.getAttribute("data-blok-uid"), s = e.querySelector(
1123
- `[data-blok-uid="${a}"]`
1132
+ function Cn(o, r, e) {
1133
+ if (e) {
1134
+ const i = e.getAttribute("data-blok-uid"), s = r.querySelector(
1135
+ `[data-blok-uid="${i}"]`
1124
1136
  );
1125
- s && (s.setAttribute("data-blok-focused", "true"), r.replaceWith(s));
1137
+ s && (s.setAttribute("data-blok-focused", "true"), e.replaceWith(s));
1126
1138
  } else
1127
- o.replaceWith(e);
1139
+ o.replaceWith(r);
1128
1140
  }
1129
1141
  async function jn(o) {
1130
- const r = await (await fetch(location.href, {
1142
+ const e = await (await fetch(location.href, {
1131
1143
  method: "POST",
1132
1144
  body: JSON.stringify({
1133
1145
  ...o,
@@ -1137,38 +1149,38 @@ async function jn(o) {
1137
1149
  "Content-Type": "application/json"
1138
1150
  }
1139
1151
  })).text();
1140
- return new DOMParser().parseFromString(r, "text/html").body;
1152
+ return new DOMParser().parseFromString(e, "text/html").body;
1141
1153
  }
1142
1154
  function Rn() {
1143
1155
  return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
1144
1156
  }
1145
- async function Pn(o, e = {}, r = {}, a) {
1157
+ async function Pn(o, r = {}, e = {}, i) {
1146
1158
  globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly");
1147
1159
  let s = null;
1148
- if (a && a.locals._storyblok_preview_data)
1149
- s = a.locals._storyblok_preview_data;
1160
+ if (i && i.locals._storyblok_preview_data)
1161
+ s = i.locals._storyblok_preview_data;
1150
1162
  else {
1151
1163
  const { data: l } = await globalThis.storyblokApiInstance.get(
1152
1164
  o,
1153
- e,
1154
- r
1165
+ r,
1166
+ e
1155
1167
  );
1156
1168
  s = l.story;
1157
1169
  }
1158
1170
  return s;
1159
1171
  }
1160
- function Mn(o, e) {
1161
- const r = globalThis.storyblokApiInstance.richTextResolver;
1162
- if (!r) {
1172
+ function Mn(o, r) {
1173
+ const e = globalThis.storyblokApiInstance.richTextResolver;
1174
+ if (!e) {
1163
1175
  console.error(
1164
1176
  "Please initialize the Storyblok SDK before calling the renderRichText function"
1165
1177
  );
1166
1178
  return;
1167
1179
  }
1168
- return _n(o, e, r);
1180
+ return _n(o, r, e);
1169
1181
  }
1170
1182
  function Nn(o) {
1171
- const e = {
1183
+ const r = {
1172
1184
  useCustomApi: !1,
1173
1185
  bridge: !0,
1174
1186
  componentsDir: "src",
@@ -1180,53 +1192,53 @@ function Nn(o) {
1180
1192
  name: "@storyblok/astro",
1181
1193
  hooks: {
1182
1194
  "astro:config:setup": ({
1183
- injectScript: r,
1184
- updateConfig: a,
1195
+ injectScript: e,
1196
+ updateConfig: i,
1185
1197
  addDevToolbarApp: s,
1186
1198
  addMiddleware: l,
1187
1199
  config: u
1188
1200
  }) => {
1189
- if (a({
1201
+ if (i({
1190
1202
  vite: {
1191
1203
  plugins: [
1192
1204
  Or(
1193
- e.accessToken,
1194
- e.useCustomApi,
1195
- e.apiOptions
1205
+ r.accessToken,
1206
+ r.useCustomApi,
1207
+ r.apiOptions
1196
1208
  ),
1197
1209
  Pr(
1198
- e.componentsDir,
1199
- e.components,
1200
- e.enableFallbackComponent,
1201
- e.customFallbackComponent
1210
+ r.componentsDir,
1211
+ r.components,
1212
+ r.enableFallbackComponent,
1213
+ r.customFallbackComponent
1202
1214
  ),
1203
- Mr(e),
1215
+ Mr(r),
1204
1216
  Sn(
1205
- e.livePreview,
1217
+ r.livePreview,
1206
1218
  u.output
1207
1219
  )
1208
1220
  ]
1209
1221
  }
1210
- }), e.livePreview && (u == null ? void 0 : u.output) !== "server")
1222
+ }), r.livePreview && (u == null ? void 0 : u.output) !== "server")
1211
1223
  throw new Error(
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."
1224
+ "To utilize the Astro Storyblok Live feature, Astro must be configured to run in SSR mode. Please disable this feature or switch Astro to SSR mode."
1213
1225
  );
1214
- if (r(
1226
+ if (e(
1215
1227
  "page-ssr",
1216
1228
  `
1217
1229
  import { storyblokApiInstance } from "virtual:storyblok-init";
1218
1230
  globalThis.storyblokApiInstance = storyblokApiInstance;
1219
1231
  `
1220
- ), e.bridge && !e.livePreview) {
1232
+ ), r.bridge && !r.livePreview) {
1221
1233
  let f = "";
1222
- if (typeof e.bridge == "object") {
1223
- const g = { ...e.bridge };
1234
+ if (typeof r.bridge == "object") {
1235
+ const g = { ...r.bridge };
1224
1236
  f = `const storyblokInstance = new StoryblokBridge(${JSON.stringify(
1225
1237
  g
1226
1238
  )});`;
1227
1239
  } else
1228
1240
  f = "const storyblokInstance = new StoryblokBridge()";
1229
- r(
1241
+ e(
1230
1242
  "page",
1231
1243
  `
1232
1244
  import { loadStoryblokBridge } from "@storyblok/astro";
@@ -1243,7 +1255,7 @@ function Nn(o) {
1243
1255
  `
1244
1256
  );
1245
1257
  }
1246
- e.livePreview && (r(
1258
+ r.livePreview && (e(
1247
1259
  "page",
1248
1260
  `
1249
1261
  import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";