@storyblok/svelte 2.3.8 → 2.4.0
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 +7 -5
- package/dist/storyblok-svelte.js +3 -7
- package/dist/storyblok-svelte.mjs +702 -695
- package/dist/types.d.ts +2 -1
- package/package.json +6 -11
- package/types.ts +14 -14
|
@@ -1,589 +1,572 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ct.call(t, e) && z(r, e, t[e]);
|
|
1
|
+
var ne = Object.defineProperty, oe = Object.defineProperties, ie = Object.getOwnPropertyDescriptors, q = Object.getOwnPropertySymbols, ae = Object.prototype.hasOwnProperty, ce = Object.prototype.propertyIsEnumerable, B = (r, e, t) => e in r ? ne(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, p = (r, e) => {
|
|
2
|
+
for (var t in e || (e = {}))
|
|
3
|
+
ae.call(e, t) && B(r, t, e[t]);
|
|
4
|
+
if (q)
|
|
5
|
+
for (var t of q(e))
|
|
6
|
+
ce.call(e, t) && B(r, t, e[t]);
|
|
8
7
|
return r;
|
|
9
|
-
},
|
|
8
|
+
}, j = (r, e) => oe(r, ie(e));
|
|
10
9
|
let D = !1;
|
|
11
|
-
const
|
|
12
|
-
if (typeof window > "u" || (window.storyblokRegisterEvent = (
|
|
10
|
+
const F = [], le = (r) => new Promise((e, t) => {
|
|
11
|
+
if (typeof window > "u" || (window.storyblokRegisterEvent = (n) => {
|
|
13
12
|
if (window.location === window.parent.location) {
|
|
14
13
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
15
14
|
return;
|
|
16
15
|
}
|
|
17
|
-
D ?
|
|
16
|
+
D ? n() : F.push(n);
|
|
18
17
|
}, document.getElementById("storyblok-javascript-bridge")))
|
|
19
18
|
return;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, document.getElementsByTagName("head")[0].appendChild(
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
const s = document.createElement("script");
|
|
20
|
+
s.async = !0, s.src = r, s.id = "storyblok-javascript-bridge", s.onerror = (n) => t(n), s.onload = (n) => {
|
|
21
|
+
F.forEach((o) => o()), D = !0, e(n);
|
|
22
|
+
}, document.getElementsByTagName("head")[0].appendChild(s);
|
|
23
|
+
});
|
|
24
|
+
var he = Object.defineProperty, ue = (r, e, t) => e in r ? he(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, h = (r, e, t) => (ue(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
25
|
+
function J(r) {
|
|
26
|
+
return !(r !== r || r === 1 / 0 || r === -1 / 0);
|
|
27
|
+
}
|
|
28
|
+
function de(r, e, t) {
|
|
29
|
+
if (!J(e))
|
|
30
|
+
throw new TypeError("Expected `limit` to be a finite number");
|
|
31
|
+
if (!J(t))
|
|
32
|
+
throw new TypeError("Expected `interval` to be a finite number");
|
|
33
|
+
const s = [];
|
|
34
|
+
let n = [], o = 0;
|
|
35
|
+
const a = function() {
|
|
36
|
+
o++;
|
|
37
|
+
const c = setTimeout(function() {
|
|
38
|
+
o--, s.length > 0 && a(), n = n.filter(function(u) {
|
|
39
|
+
return u !== c;
|
|
40
|
+
});
|
|
41
|
+
}, t);
|
|
42
|
+
n.indexOf(c) < 0 && n.push(c);
|
|
43
|
+
const l = s.shift();
|
|
44
|
+
l.resolve(r.apply(l.self, l.args));
|
|
45
|
+
}, i = function(...c) {
|
|
46
|
+
const l = this;
|
|
47
|
+
return new Promise(function(u, d) {
|
|
48
|
+
s.push({
|
|
49
|
+
resolve: u,
|
|
50
|
+
reject: d,
|
|
51
|
+
args: c,
|
|
52
|
+
self: l
|
|
53
|
+
}), o < e && a();
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return i.abort = function() {
|
|
57
|
+
n.forEach(clearTimeout), n = [], s.forEach(function(c) {
|
|
58
|
+
c.reject(function() {
|
|
59
|
+
Error.call(this, "Throttled function aborted"), this.name = "AbortError";
|
|
60
|
+
});
|
|
61
|
+
}), s.length = 0;
|
|
62
|
+
}, i;
|
|
63
|
+
}
|
|
64
|
+
const fe = function(r, e) {
|
|
65
|
+
const t = {};
|
|
66
|
+
for (const s in r) {
|
|
67
|
+
const n = r[s];
|
|
68
|
+
e.indexOf(s) > -1 && n !== null && (t[s] = n);
|
|
31
69
|
}
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
bullet_list() {
|
|
47
|
-
return {
|
|
48
|
-
tag: "ul"
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
code_block(r) {
|
|
52
|
-
return {
|
|
53
|
-
tag: [
|
|
54
|
-
"pre",
|
|
55
|
-
{
|
|
56
|
-
tag: "code",
|
|
57
|
-
attrs: r.attrs
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
hard_break() {
|
|
63
|
-
return {
|
|
64
|
-
singleTag: "br"
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
heading(r) {
|
|
68
|
-
return {
|
|
69
|
-
tag: `h${r.attrs.level}`
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
image(r) {
|
|
73
|
-
return {
|
|
74
|
-
singleTag: [
|
|
75
|
-
{
|
|
76
|
-
tag: "img",
|
|
77
|
-
attrs: ht(r.attrs, ["src", "alt", "title"])
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
};
|
|
81
|
-
},
|
|
82
|
-
list_item() {
|
|
83
|
-
return {
|
|
84
|
-
tag: "li"
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
ordered_list() {
|
|
88
|
-
return {
|
|
89
|
-
tag: "ol"
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
paragraph() {
|
|
93
|
-
return {
|
|
94
|
-
tag: "p"
|
|
95
|
-
};
|
|
70
|
+
return t;
|
|
71
|
+
}, pe = (r) => r === "email", ge = () => ({
|
|
72
|
+
singleTag: "hr"
|
|
73
|
+
}), me = () => ({
|
|
74
|
+
tag: "blockquote"
|
|
75
|
+
}), ye = () => ({
|
|
76
|
+
tag: "ul"
|
|
77
|
+
}), _e = (r) => ({
|
|
78
|
+
tag: [
|
|
79
|
+
"pre",
|
|
80
|
+
{
|
|
81
|
+
tag: "code",
|
|
82
|
+
attrs: r.attrs
|
|
96
83
|
}
|
|
84
|
+
]
|
|
85
|
+
}), be = () => ({
|
|
86
|
+
singleTag: "br"
|
|
87
|
+
}), ke = (r) => ({
|
|
88
|
+
tag: `h${r.attrs.level}`
|
|
89
|
+
}), ve = (r) => ({
|
|
90
|
+
singleTag: [
|
|
91
|
+
{
|
|
92
|
+
tag: "img",
|
|
93
|
+
attrs: fe(r.attrs, ["src", "alt", "title"])
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}), we = () => ({
|
|
97
|
+
tag: "li"
|
|
98
|
+
}), $e = () => ({
|
|
99
|
+
tag: "ol"
|
|
100
|
+
}), Te = () => ({
|
|
101
|
+
tag: "p"
|
|
102
|
+
}), Re = () => ({
|
|
103
|
+
tag: "b"
|
|
104
|
+
}), xe = () => ({
|
|
105
|
+
tag: "strike"
|
|
106
|
+
}), je = () => ({
|
|
107
|
+
tag: "u"
|
|
108
|
+
}), Pe = () => ({
|
|
109
|
+
tag: "strong"
|
|
110
|
+
}), Oe = () => ({
|
|
111
|
+
tag: "code"
|
|
112
|
+
}), Ee = () => ({
|
|
113
|
+
tag: "i"
|
|
114
|
+
}), Se = (r) => {
|
|
115
|
+
const e = p({}, r.attrs), { linktype: t = "url" } = r.attrs;
|
|
116
|
+
return pe(t) && (e.href = `mailto:${e.href}`), e.anchor && (e.href = `${e.href}#${e.anchor}`, delete e.anchor), {
|
|
117
|
+
tag: [
|
|
118
|
+
{
|
|
119
|
+
tag: "a",
|
|
120
|
+
attrs: e
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
}, Ie = (r) => ({
|
|
125
|
+
tag: [
|
|
126
|
+
{
|
|
127
|
+
tag: "span",
|
|
128
|
+
attrs: r.attrs
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}), Ce = {
|
|
132
|
+
nodes: {
|
|
133
|
+
horizontal_rule: ge,
|
|
134
|
+
blockquote: me,
|
|
135
|
+
bullet_list: ye,
|
|
136
|
+
code_block: _e,
|
|
137
|
+
hard_break: be,
|
|
138
|
+
heading: ke,
|
|
139
|
+
image: ve,
|
|
140
|
+
list_item: we,
|
|
141
|
+
ordered_list: $e,
|
|
142
|
+
paragraph: Te
|
|
97
143
|
},
|
|
98
144
|
marks: {
|
|
99
|
-
bold
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
tag: "u"
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
strong() {
|
|
115
|
-
return {
|
|
116
|
-
tag: "strong"
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
code() {
|
|
120
|
-
return {
|
|
121
|
-
tag: "code"
|
|
122
|
-
};
|
|
123
|
-
},
|
|
124
|
-
italic() {
|
|
125
|
-
return {
|
|
126
|
-
tag: "i"
|
|
127
|
-
};
|
|
128
|
-
},
|
|
129
|
-
link(r) {
|
|
130
|
-
const t = d({}, r.attrs), { linktype: e = "url" } = r.attrs;
|
|
131
|
-
return ft(e) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), {
|
|
132
|
-
tag: [
|
|
133
|
-
{
|
|
134
|
-
tag: "a",
|
|
135
|
-
attrs: t
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
styled(r) {
|
|
141
|
-
return {
|
|
142
|
-
tag: [
|
|
143
|
-
{
|
|
144
|
-
tag: "span",
|
|
145
|
-
attrs: r.attrs
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const pt = function(r) {
|
|
153
|
-
const t = {
|
|
145
|
+
bold: Re,
|
|
146
|
+
strike: xe,
|
|
147
|
+
underline: je,
|
|
148
|
+
strong: Pe,
|
|
149
|
+
code: Oe,
|
|
150
|
+
italic: Ee,
|
|
151
|
+
link: Se,
|
|
152
|
+
styled: Ie
|
|
153
|
+
}
|
|
154
|
+
}, Ae = function(r) {
|
|
155
|
+
const e = {
|
|
154
156
|
"&": "&",
|
|
155
157
|
"<": "<",
|
|
156
158
|
">": ">",
|
|
157
159
|
'"': """,
|
|
158
160
|
"'": "'"
|
|
159
|
-
},
|
|
160
|
-
return r &&
|
|
161
|
+
}, t = /[&<>"']/g, s = RegExp(t.source);
|
|
162
|
+
return r && s.test(r) ? r.replace(t, (n) => e[n]) : r;
|
|
161
163
|
};
|
|
162
|
-
class
|
|
163
|
-
constructor(
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
addNode(
|
|
167
|
-
this.nodes[
|
|
168
|
-
}
|
|
169
|
-
addMark(
|
|
170
|
-
this.marks[
|
|
171
|
-
}
|
|
172
|
-
render(
|
|
173
|
-
if (
|
|
174
|
-
let
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
}),
|
|
164
|
+
class R {
|
|
165
|
+
constructor(e) {
|
|
166
|
+
h(this, "marks"), h(this, "nodes"), e || (e = Ce), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
167
|
+
}
|
|
168
|
+
addNode(e, t) {
|
|
169
|
+
this.nodes[e] = t;
|
|
170
|
+
}
|
|
171
|
+
addMark(e, t) {
|
|
172
|
+
this.marks[e] = t;
|
|
173
|
+
}
|
|
174
|
+
render(e) {
|
|
175
|
+
if (e && e.content && Array.isArray(e.content)) {
|
|
176
|
+
let t = "";
|
|
177
|
+
return e.content.forEach((s) => {
|
|
178
|
+
t += this.renderNode(s);
|
|
179
|
+
}), t;
|
|
178
180
|
}
|
|
179
181
|
return console.warn("The render method must receive an object with a content field, which is an array"), "";
|
|
180
182
|
}
|
|
181
|
-
renderNode(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const o = this.getMatchingMark(
|
|
185
|
-
o &&
|
|
183
|
+
renderNode(e) {
|
|
184
|
+
const t = [];
|
|
185
|
+
e.marks && e.marks.forEach((n) => {
|
|
186
|
+
const o = this.getMatchingMark(n);
|
|
187
|
+
o && t.push(this.renderOpeningTag(o.tag));
|
|
186
188
|
});
|
|
187
|
-
const
|
|
188
|
-
return
|
|
189
|
-
|
|
190
|
-
}) :
|
|
191
|
-
const o = this.getMatchingMark(
|
|
192
|
-
o &&
|
|
193
|
-
}),
|
|
194
|
-
}
|
|
195
|
-
renderTag(
|
|
196
|
-
return
|
|
189
|
+
const s = this.getMatchingNode(e);
|
|
190
|
+
return s && s.tag && t.push(this.renderOpeningTag(s.tag)), e.content ? e.content.forEach((n) => {
|
|
191
|
+
t.push(this.renderNode(n));
|
|
192
|
+
}) : e.text ? t.push(Ae(e.text)) : s && s.singleTag ? t.push(this.renderTag(s.singleTag, " /")) : s && s.html && t.push(s.html), s && s.tag && t.push(this.renderClosingTag(s.tag)), e.marks && e.marks.slice(0).reverse().forEach((n) => {
|
|
193
|
+
const o = this.getMatchingMark(n);
|
|
194
|
+
o && t.push(this.renderClosingTag(o.tag));
|
|
195
|
+
}), t.join("");
|
|
196
|
+
}
|
|
197
|
+
renderTag(e, t) {
|
|
198
|
+
return e.constructor === String ? `<${e}${t}>` : e.map((s) => {
|
|
197
199
|
if (s.constructor === String)
|
|
198
|
-
return `<${s}${
|
|
200
|
+
return `<${s}${t}>`;
|
|
199
201
|
{
|
|
200
|
-
let
|
|
202
|
+
let n = `<${s.tag}`;
|
|
201
203
|
if (s.attrs)
|
|
202
|
-
for (
|
|
203
|
-
|
|
204
|
-
|
|
204
|
+
for (const o in s.attrs) {
|
|
205
|
+
const a = s.attrs[o];
|
|
206
|
+
a !== null && (n += ` ${o}="${a}"`);
|
|
205
207
|
}
|
|
206
|
-
return `${
|
|
208
|
+
return `${n}${t}>`;
|
|
207
209
|
}
|
|
208
210
|
}).join("");
|
|
209
211
|
}
|
|
210
|
-
renderOpeningTag(
|
|
211
|
-
return this.renderTag(
|
|
212
|
+
renderOpeningTag(e) {
|
|
213
|
+
return this.renderTag(e, "");
|
|
214
|
+
}
|
|
215
|
+
renderClosingTag(e) {
|
|
216
|
+
return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((t) => t.constructor === String ? `</${t}>` : `</${t.tag}>`).join("");
|
|
217
|
+
}
|
|
218
|
+
getMatchingNode(e) {
|
|
219
|
+
const t = this.nodes[e.type];
|
|
220
|
+
if (typeof t == "function")
|
|
221
|
+
return t(e);
|
|
222
|
+
}
|
|
223
|
+
getMatchingMark(e) {
|
|
224
|
+
const t = this.marks[e.type];
|
|
225
|
+
if (typeof t == "function")
|
|
226
|
+
return t(e);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
class X {
|
|
230
|
+
constructor() {
|
|
231
|
+
h(this, "isCDNUrl", (e = "") => e.indexOf("/cdn/") > -1), h(this, "getOptionsPage", (e, t = 25, s = 1) => j(p({}, e), {
|
|
232
|
+
per_page: t,
|
|
233
|
+
page: s
|
|
234
|
+
})), h(this, "delay", (e) => new Promise((t) => setTimeout(t, e))), h(this, "arrayFrom", (e = 0, t) => [...Array(e)].map(t)), h(this, "range", (e = 0, t = e) => {
|
|
235
|
+
const s = Math.abs(t - e) || 0, n = e < t ? 1 : -1;
|
|
236
|
+
return this.arrayFrom(s, (o, a) => a * n + e);
|
|
237
|
+
}), h(this, "asyncMap", async (e, t) => Promise.all(e.map(t))), h(this, "flatMap", (e = [], t) => e.map(t).reduce((s, n) => [...s, ...n], []));
|
|
238
|
+
}
|
|
239
|
+
stringify(e, t, s) {
|
|
240
|
+
const n = [];
|
|
241
|
+
for (const o in e) {
|
|
242
|
+
if (!Object.prototype.hasOwnProperty.call(e, o))
|
|
243
|
+
continue;
|
|
244
|
+
const a = e[o], i = s ? "" : encodeURIComponent(o);
|
|
245
|
+
let c;
|
|
246
|
+
typeof a == "object" ? c = this.stringify(a, t ? t + encodeURIComponent("[" + i + "]") : i, Array.isArray(a)) : c = (t ? t + encodeURIComponent("[" + i + "]") : i) + "=" + encodeURIComponent(a), n.push(c);
|
|
247
|
+
}
|
|
248
|
+
return n.join("&");
|
|
212
249
|
}
|
|
213
|
-
|
|
214
|
-
|
|
250
|
+
}
|
|
251
|
+
class Ne {
|
|
252
|
+
constructor(e) {
|
|
253
|
+
h(this, "baseURL"), h(this, "timeout"), h(this, "headers"), h(this, "responseInterceptor"), h(this, "fetch"), h(this, "ejectInterceptor"), h(this, "url"), h(this, "parameters"), this.baseURL = e.baseURL, this.headers = e.headers || [], this.timeout = e.timeout ? e.timeout * 1e3 : 1e3, this.responseInterceptor = e.responseInterceptor, this.fetch = (...t) => e.fetch ? e.fetch(...t) : fetch(...t), this.ejectInterceptor = !1, this.url = "", this.parameters = {};
|
|
215
254
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return this.nodes[t.type](t);
|
|
255
|
+
get(e, t) {
|
|
256
|
+
return this.url = e, this.parameters = t, this._methodHandler("get");
|
|
219
257
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return this.marks[t.type](t);
|
|
258
|
+
post(e, t) {
|
|
259
|
+
return this.url = e, this.parameters = t, this._methodHandler("post");
|
|
223
260
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* storyblok-js-client v4.5.2
|
|
227
|
-
* Universal JavaScript SDK for Storyblok's API
|
|
228
|
-
* (c) 2020-2022 Stobylok Team
|
|
229
|
-
*/
|
|
230
|
-
function H(r) {
|
|
231
|
-
return typeof r == "number" && r == r && r !== 1 / 0 && r !== -1 / 0;
|
|
232
|
-
}
|
|
233
|
-
function X(r, t, e) {
|
|
234
|
-
if (!H(t))
|
|
235
|
-
throw new TypeError("Expected `limit` to be a finite number");
|
|
236
|
-
if (!H(e))
|
|
237
|
-
throw new TypeError("Expected `interval` to be a finite number");
|
|
238
|
-
var n = [], s = [], o = 0, a = function() {
|
|
239
|
-
o++;
|
|
240
|
-
var l = setTimeout(function() {
|
|
241
|
-
o--, n.length > 0 && a(), s = s.filter(function(u) {
|
|
242
|
-
return u !== l;
|
|
243
|
-
});
|
|
244
|
-
}, e);
|
|
245
|
-
s.indexOf(l) < 0 && s.push(l);
|
|
246
|
-
var c = n.shift();
|
|
247
|
-
c.resolve(r.apply(c.self, c.args));
|
|
248
|
-
}, i = function() {
|
|
249
|
-
var l = arguments, c = this;
|
|
250
|
-
return new Promise(function(u, h) {
|
|
251
|
-
n.push({ resolve: u, reject: h, args: l, self: c }), o < t && a();
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
return i.abort = function() {
|
|
255
|
-
s.forEach(clearTimeout), s = [], n.forEach(function(l) {
|
|
256
|
-
l.reject(new throttle.AbortError());
|
|
257
|
-
}), n.length = 0;
|
|
258
|
-
}, i;
|
|
259
|
-
}
|
|
260
|
-
X.AbortError = function() {
|
|
261
|
-
Error.call(this, "Throttled function aborted"), this.name = "AbortError";
|
|
262
|
-
};
|
|
263
|
-
const gt = function(r, t) {
|
|
264
|
-
if (!r)
|
|
265
|
-
return null;
|
|
266
|
-
let e = {};
|
|
267
|
-
for (let n in r) {
|
|
268
|
-
let s = r[n];
|
|
269
|
-
t.indexOf(n) > -1 && s !== null && (e[n] = s);
|
|
261
|
+
put(e, t) {
|
|
262
|
+
return this.url = e, this.parameters = t, this._methodHandler("put");
|
|
270
263
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
var mt = { nodes: { horizontal_rule: () => ({ singleTag: "hr" }), blockquote: () => ({ tag: "blockquote" }), bullet_list: () => ({ tag: "ul" }), code_block: (r) => ({ tag: ["pre", { tag: "code", attrs: r.attrs }] }), hard_break: () => ({ singleTag: "br" }), heading: (r) => ({ tag: `h${r.attrs.level}` }), image: (r) => ({ singleTag: [{ tag: "img", attrs: gt(r.attrs, ["src", "alt", "title"]) }] }), list_item: () => ({ tag: "li" }), ordered_list: () => ({ tag: "ol" }), paragraph: () => ({ tag: "p" }) }, marks: { bold: () => ({ tag: "b" }), strike: () => ({ tag: "strike" }), underline: () => ({ tag: "u" }), strong: () => ({ tag: "strong" }), code: () => ({ tag: "code" }), italic: () => ({ tag: "i" }), link(r) {
|
|
274
|
-
const t = d({}, r.attrs), { linktype: e = "url" } = r.attrs;
|
|
275
|
-
return e === "email" && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), { tag: [{ tag: "a", attrs: t }] };
|
|
276
|
-
}, styled: (r) => ({ tag: [{ tag: "span", attrs: r.attrs }] }) } };
|
|
277
|
-
class yt {
|
|
278
|
-
constructor(t) {
|
|
279
|
-
t || (t = mt), this.marks = t.marks || [], this.nodes = t.nodes || [];
|
|
280
|
-
}
|
|
281
|
-
addNode(t, e) {
|
|
282
|
-
this.nodes[t] = e;
|
|
283
|
-
}
|
|
284
|
-
addMark(t, e) {
|
|
285
|
-
this.marks[t] = e;
|
|
286
|
-
}
|
|
287
|
-
render(t = {}) {
|
|
288
|
-
if (t.content && Array.isArray(t.content)) {
|
|
289
|
-
let e = "";
|
|
290
|
-
return t.content.forEach((n) => {
|
|
291
|
-
e += this.renderNode(n);
|
|
292
|
-
}), e;
|
|
293
|
-
}
|
|
294
|
-
return console.warn("The render method must receive an object with a content field, which is an array"), "";
|
|
264
|
+
delete(e, t) {
|
|
265
|
+
return this.url = e, this.parameters = t, this._methodHandler("delete");
|
|
295
266
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
267
|
+
async _responseHandler(e) {
|
|
268
|
+
const t = [], s = {
|
|
269
|
+
data: {},
|
|
270
|
+
headers: {},
|
|
271
|
+
status: 0,
|
|
272
|
+
statusText: ""
|
|
273
|
+
};
|
|
274
|
+
await e.json().then((n) => {
|
|
275
|
+
s.data = n;
|
|
301
276
|
});
|
|
302
|
-
const n
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
renderOpeningTag(t) {
|
|
329
|
-
return this.renderTag(t, "");
|
|
330
|
-
}
|
|
331
|
-
renderClosingTag(t) {
|
|
332
|
-
return t.constructor === String ? `</${t}>` : t.slice(0).reverse().map((e) => e.constructor === String ? `</${e}>` : `</${e.tag}>`).join("");
|
|
277
|
+
for (const n of e.headers.entries())
|
|
278
|
+
t[n[0]] = n[1];
|
|
279
|
+
return s.headers = p({}, t), s.status = e.status, s.statusText = e.statusText, s;
|
|
280
|
+
}
|
|
281
|
+
async _methodHandler(e) {
|
|
282
|
+
const t = new URL(`${this.baseURL}${this.url}`);
|
|
283
|
+
let s = null;
|
|
284
|
+
if (e === "get") {
|
|
285
|
+
const i = new X();
|
|
286
|
+
t.search = i.stringify(this.parameters);
|
|
287
|
+
} else
|
|
288
|
+
s = JSON.stringify(this.parameters);
|
|
289
|
+
const n = new AbortController(), { signal: o } = n, a = setTimeout(() => n.abort(), this.timeout);
|
|
290
|
+
try {
|
|
291
|
+
const i = await this.fetch(`${t}`, {
|
|
292
|
+
method: e,
|
|
293
|
+
headers: this.headers,
|
|
294
|
+
body: s,
|
|
295
|
+
signal: o
|
|
296
|
+
});
|
|
297
|
+
clearTimeout(a);
|
|
298
|
+
const c = await this._responseHandler(i);
|
|
299
|
+
return this.responseInterceptor && !this.ejectInterceptor ? this._statusHandler(this.responseInterceptor(c)) : this._statusHandler(c);
|
|
300
|
+
} catch (i) {
|
|
301
|
+
return i;
|
|
302
|
+
}
|
|
333
303
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
return this.nodes[t.type](t);
|
|
304
|
+
eject() {
|
|
305
|
+
this.ejectInterceptor = !0;
|
|
337
306
|
}
|
|
338
|
-
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
307
|
+
_statusHandler(e) {
|
|
308
|
+
if (/20[01]/g.test(`${e.status}`))
|
|
309
|
+
return e;
|
|
310
|
+
throw {
|
|
311
|
+
message: new Error(e.statusText || `status: ${e.status}`),
|
|
312
|
+
response: e
|
|
313
|
+
};
|
|
341
314
|
}
|
|
342
315
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
continue;
|
|
351
|
-
const o = r[s], a = e ? "" : encodeURIComponent(s);
|
|
352
|
-
let i;
|
|
353
|
-
i = typeof o == "object" ? x(o, t ? t + encodeURIComponent("[" + a + "]") : a, Array.isArray(o)) : (t ? t + encodeURIComponent("[" + a + "]") : a) + "=" + encodeURIComponent(o), n.push(i);
|
|
354
|
-
}
|
|
355
|
-
return n.join("&");
|
|
356
|
-
};
|
|
357
|
-
let _ = {}, p = {};
|
|
358
|
-
class _t {
|
|
359
|
-
constructor(t, e) {
|
|
360
|
-
if (!e) {
|
|
361
|
-
let o = t.region ? `-${t.region}` : "", a = t.https === !1 ? "http" : "https";
|
|
362
|
-
e = t.oauthToken === void 0 ? `${a}://api${o}.storyblok.com/v2` : `${a}://api${o}.storyblok.com/v1`;
|
|
316
|
+
let k = {};
|
|
317
|
+
const m = {};
|
|
318
|
+
class Me {
|
|
319
|
+
constructor(e, t) {
|
|
320
|
+
if (h(this, "client"), h(this, "maxRetries"), h(this, "throttle"), h(this, "accessToken"), h(this, "cache"), h(this, "helpers"), h(this, "relations"), h(this, "links"), h(this, "richTextResolver"), h(this, "resolveNestedRelations"), !t) {
|
|
321
|
+
const o = e.region ? `-${e.region}` : "", a = e.https === !1 ? "http" : "https";
|
|
322
|
+
e.oauthToken ? t = `${a}://api${o}.storyblok.com/v1` : t = `${a}://api${o}.storyblok.com/v2`;
|
|
363
323
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
324
|
+
const s = new Headers();
|
|
325
|
+
s.set("Content-Type", "application/json"), s.set("Accept", "application/json"), s.forEach((o, a) => {
|
|
326
|
+
e.headers && e.headers[a] && s.set(a, e.headers[a]);
|
|
327
|
+
});
|
|
328
|
+
let n = 5;
|
|
329
|
+
e.oauthToken && (s.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new R(e.richTextSchema) : this.richTextResolver = new R(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries, this.throttle = de(this.throttledRequest, n, 1e3), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new X(), this.resolveNestedRelations = !1, this.client = new Ne({
|
|
330
|
+
baseURL: t,
|
|
331
|
+
timeout: e.timeout || 0,
|
|
332
|
+
headers: s,
|
|
333
|
+
responseInterceptor: e.responseInterceptor,
|
|
334
|
+
fetch: e.fetch
|
|
373
335
|
});
|
|
374
336
|
}
|
|
375
|
-
|
|
376
|
-
|
|
337
|
+
setComponentResolver(e) {
|
|
338
|
+
this.richTextResolver.addNode("blok", (t) => {
|
|
339
|
+
let s = "";
|
|
340
|
+
return t.attrs.body.forEach((n) => {
|
|
341
|
+
s += e(n.component, n);
|
|
342
|
+
}), {
|
|
343
|
+
html: s
|
|
344
|
+
};
|
|
345
|
+
});
|
|
377
346
|
}
|
|
378
|
-
|
|
379
|
-
return (
|
|
347
|
+
parseParams(e) {
|
|
348
|
+
return e.version || (e.version = "published"), e.token || (e.token = this.getToken()), e.cv || (e.cv = m[e.token]), Array.isArray(e.resolve_relations) && (e.resolve_relations = e.resolve_relations.join(",")), e;
|
|
380
349
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
return this.cacheResponse(t, o);
|
|
350
|
+
factoryParamOptions(e, t) {
|
|
351
|
+
return this.helpers.isCDNUrl(e) ? this.parseParams(t) : t;
|
|
384
352
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return this.cacheResponse(n, s);
|
|
353
|
+
makeRequest(e, t, s, n) {
|
|
354
|
+
const o = this.factoryParamOptions(e, this.helpers.getOptionsPage(t, s, n));
|
|
355
|
+
return this.cacheResponse(e, o);
|
|
389
356
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
return ((c = [], u) => c.map(u).reduce((h, k) => [...h, ...k], []))([i, ...await (async (c = [], u) => Promise.all(c.map(u)))(kt(1, l), async (c) => this.makeRequest(o, e, s, c + 1))], (c) => Object.values(c.data[n]));
|
|
357
|
+
get(e, t) {
|
|
358
|
+
t || (t = {});
|
|
359
|
+
const s = `/${e}`, n = this.factoryParamOptions(s, t);
|
|
360
|
+
return this.cacheResponse(s, n);
|
|
395
361
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
return this.
|
|
362
|
+
async getAll(e, t, s) {
|
|
363
|
+
const n = (t == null ? void 0 : t.per_page) || 25, o = `/${e}`, a = o.split("/"), i = s || a[a.length - 1], c = 1, l = await this.makeRequest(o, t, n, c), u = l.total ? Math.ceil(l.total / n) : 1, d = await this.helpers.asyncMap(this.helpers.range(c, u), (g) => this.makeRequest(o, t, n, g + 1));
|
|
364
|
+
return this.helpers.flatMap([l, ...d], (g) => Object.values(g.data[i]));
|
|
399
365
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
return this.throttle("
|
|
366
|
+
post(e, t) {
|
|
367
|
+
const s = `/${e}`;
|
|
368
|
+
return Promise.resolve(this.throttle("post", s, t));
|
|
403
369
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return this.throttle("
|
|
370
|
+
put(e, t) {
|
|
371
|
+
const s = `/${e}`;
|
|
372
|
+
return Promise.resolve(this.throttle("put", s, t));
|
|
407
373
|
}
|
|
408
|
-
|
|
409
|
-
|
|
374
|
+
delete(e, t) {
|
|
375
|
+
const s = `/${e}`;
|
|
376
|
+
return Promise.resolve(this.throttle("delete", s, t));
|
|
410
377
|
}
|
|
411
|
-
|
|
412
|
-
return this.get(
|
|
378
|
+
getStories(e) {
|
|
379
|
+
return this.get("cdn/stories", e);
|
|
413
380
|
}
|
|
414
|
-
|
|
415
|
-
this.
|
|
381
|
+
getStory(e, t) {
|
|
382
|
+
return this.get(`cdn/stories/${e}`, t);
|
|
416
383
|
}
|
|
417
384
|
getToken() {
|
|
418
385
|
return this.accessToken;
|
|
419
386
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
387
|
+
ejectInterceptor() {
|
|
388
|
+
this.client.eject();
|
|
389
|
+
}
|
|
390
|
+
_cleanCopy(e) {
|
|
391
|
+
return JSON.parse(JSON.stringify(e));
|
|
392
|
+
}
|
|
393
|
+
_insertLinks(e, t) {
|
|
394
|
+
const s = e[t];
|
|
395
|
+
s && s.fieldtype == "multilink" && s.linktype == "story" && typeof s.id == "string" && this.links[s.id] ? s.story = this._cleanCopy(this.links[s.id]) : s && s.linktype === "story" && typeof s.uuid == "string" && this.links[s.uuid] && (s.story = this._cleanCopy(this.links[s.uuid]));
|
|
396
|
+
}
|
|
397
|
+
_insertRelations(e, t, s) {
|
|
398
|
+
if (s.indexOf(`${e.component}.${t}`) > -1) {
|
|
399
|
+
if (typeof e[t] == "string")
|
|
400
|
+
this.relations[e[t]] && (e[t] = this._cleanCopy(this.relations[e[t]]));
|
|
401
|
+
else if (e[t] && e[t].constructor === Array) {
|
|
402
|
+
const n = [];
|
|
403
|
+
e[t].forEach((o) => {
|
|
404
|
+
this.relations[o] && n.push(this._cleanCopy(this.relations[o]));
|
|
405
|
+
}), e[t] = n;
|
|
436
406
|
}
|
|
437
407
|
}
|
|
438
408
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if (s.constructor === Array)
|
|
448
|
-
for (let o = 0; o < s.length; o++)
|
|
449
|
-
n(s[o]);
|
|
450
|
-
else if (s.constructor === Object) {
|
|
451
|
-
if (s._stopResolving)
|
|
409
|
+
iterateTree(e, t) {
|
|
410
|
+
const s = (n) => {
|
|
411
|
+
if (n != null) {
|
|
412
|
+
if (n.constructor === Array)
|
|
413
|
+
for (let o = 0; o < n.length; o++)
|
|
414
|
+
s(n[o]);
|
|
415
|
+
else if (n.constructor === Object) {
|
|
416
|
+
if (n._stopResolving)
|
|
452
417
|
return;
|
|
453
|
-
for (
|
|
454
|
-
|
|
418
|
+
for (const o in n)
|
|
419
|
+
(n.component && n._uid || n.type === "link") && (this._insertRelations(n, o, t), this._insertLinks(n, o)), s(n[o]);
|
|
455
420
|
}
|
|
456
421
|
}
|
|
457
422
|
};
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
async resolveLinks(
|
|
461
|
-
let
|
|
462
|
-
if (
|
|
463
|
-
const
|
|
464
|
-
let
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
const l = Math.min(s, i + a);
|
|
468
|
-
o.push(t.link_uuids.slice(i, l));
|
|
423
|
+
s(e.content);
|
|
424
|
+
}
|
|
425
|
+
async resolveLinks(e, t) {
|
|
426
|
+
let s = [];
|
|
427
|
+
if (e.link_uuids) {
|
|
428
|
+
const n = e.link_uuids.length, o = [], a = 50;
|
|
429
|
+
for (let i = 0; i < n; i += a) {
|
|
430
|
+
const c = Math.min(n, i + a);
|
|
431
|
+
o.push(e.link_uuids.slice(i, c));
|
|
469
432
|
}
|
|
470
433
|
for (let i = 0; i < o.length; i++)
|
|
471
|
-
(await this.getStories({
|
|
472
|
-
|
|
434
|
+
(await this.getStories({
|
|
435
|
+
per_page: a,
|
|
436
|
+
language: t.language,
|
|
437
|
+
version: t.version,
|
|
438
|
+
by_uuids: o[i].join(",")
|
|
439
|
+
})).data.stories.forEach((c) => {
|
|
440
|
+
s.push(c);
|
|
473
441
|
});
|
|
474
442
|
} else
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
this.links[
|
|
443
|
+
s = e.links;
|
|
444
|
+
s.forEach((n) => {
|
|
445
|
+
this.links[n.uuid] = j(p({}, n), { _stopResolving: !0 });
|
|
478
446
|
});
|
|
479
447
|
}
|
|
480
|
-
async resolveRelations(
|
|
481
|
-
let
|
|
482
|
-
if (
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const l = Math.min(s, i + a);
|
|
488
|
-
o.push(t.rel_uuids.slice(i, l));
|
|
448
|
+
async resolveRelations(e, t) {
|
|
449
|
+
let s = [];
|
|
450
|
+
if (e.rel_uuids) {
|
|
451
|
+
const n = e.rel_uuids.length, o = [], a = 50;
|
|
452
|
+
for (let i = 0; i < n; i += a) {
|
|
453
|
+
const c = Math.min(n, i + a);
|
|
454
|
+
o.push(e.rel_uuids.slice(i, c));
|
|
489
455
|
}
|
|
490
456
|
for (let i = 0; i < o.length; i++)
|
|
491
|
-
(await this.getStories({
|
|
492
|
-
|
|
457
|
+
(await this.getStories({
|
|
458
|
+
per_page: a,
|
|
459
|
+
language: t.language,
|
|
460
|
+
version: t.version,
|
|
461
|
+
by_uuids: o[i].join(",")
|
|
462
|
+
})).data.stories.forEach((c) => {
|
|
463
|
+
s.push(c);
|
|
493
464
|
});
|
|
494
465
|
} else
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
this.relations[
|
|
466
|
+
s = e.rels;
|
|
467
|
+
s && s.length > 0 && s.forEach((n) => {
|
|
468
|
+
this.relations[n.uuid] = j(p({}, n), { _stopResolving: !0 });
|
|
498
469
|
});
|
|
499
470
|
}
|
|
500
|
-
async resolveStories(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
471
|
+
async resolveStories(e, t) {
|
|
472
|
+
var s, n;
|
|
473
|
+
let o = [];
|
|
474
|
+
if (typeof t.resolve_relations < "u" && t.resolve_relations.length > 0 && (typeof t.resolve_relations == "string" && (o = t.resolve_relations.split(",")), await this.resolveRelations(e, t)), t.resolve_links && ["1", "story", "url"].indexOf(t.resolve_links) > -1 && ((s = e.links) != null && s.length || (n = e.link_uuids) != null && n.length) && await this.resolveLinks(e, t), this.resolveNestedRelations)
|
|
475
|
+
for (const a in this.relations)
|
|
476
|
+
this.iterateTree(this.relations[a], o);
|
|
477
|
+
e.story ? this.iterateTree(e.story, o) : e.stories.forEach((a) => {
|
|
478
|
+
this.iterateTree(a, o);
|
|
507
479
|
});
|
|
508
480
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
else {
|
|
515
|
-
if (!s)
|
|
516
|
-
return t;
|
|
517
|
-
this.iterateTree(s, e);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
cacheResponse(t, e, n) {
|
|
521
|
-
return n === void 0 && (n = 0), new Promise(async (s, o) => {
|
|
522
|
-
let a = x({ url: t, params: e }), i = this.cacheProvider();
|
|
523
|
-
if (this.cache.clear === "auto" && e.version === "draft" && await this.flushCache(), e.version === "published" && t != "/cdn/spaces/me") {
|
|
524
|
-
const c = await i.get(a);
|
|
481
|
+
cacheResponse(e, t, s) {
|
|
482
|
+
return new Promise((n, o) => {
|
|
483
|
+
const a = this.helpers.stringify({ url: e, params: t }), i = this.cacheProvider();
|
|
484
|
+
if (this.cache.clear === "auto" && t.version === "draft" && this.flushCache(), t.version === "published" && e != "/cdn/spaces/me") {
|
|
485
|
+
const c = i.get(a);
|
|
525
486
|
if (c)
|
|
526
|
-
return
|
|
487
|
+
return n(c);
|
|
527
488
|
}
|
|
528
489
|
try {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
490
|
+
(async () => {
|
|
491
|
+
var c;
|
|
492
|
+
const l = await this.throttle("get", e, t);
|
|
493
|
+
let u = { data: l.data, headers: l.headers };
|
|
494
|
+
if ((c = l.headers) != null && c["per-page"] && (u = Object.assign({}, u, {
|
|
495
|
+
perPage: l.headers["per-page"] ? parseInt(l.headers["per-page"]) : 0,
|
|
496
|
+
total: l.headers["per-page"] ? parseInt(l.headers.total) : 0
|
|
497
|
+
})), l.status != 200)
|
|
498
|
+
return o(l);
|
|
499
|
+
(u.data.story || u.data.stories) && await this.resolveStories(u.data, t), t.version === "published" && e != "/cdn/spaces/me" && i.set(a, u), u.data.cv && t.token && (t.version == "draft" && m[t.token] != u.data.cv && this.flushCache(), m[t.token] = u.data.cv), n(u);
|
|
500
|
+
})();
|
|
501
|
+
} catch {
|
|
537
502
|
}
|
|
538
|
-
var l;
|
|
539
503
|
});
|
|
540
504
|
}
|
|
541
|
-
throttledRequest(
|
|
542
|
-
return this.client[
|
|
505
|
+
throttledRequest(e, t, s) {
|
|
506
|
+
return this.client[e](t, s);
|
|
543
507
|
}
|
|
544
508
|
cacheVersions() {
|
|
545
|
-
return
|
|
509
|
+
return m;
|
|
546
510
|
}
|
|
547
511
|
cacheVersion() {
|
|
548
|
-
return
|
|
512
|
+
return m[this.accessToken];
|
|
549
513
|
}
|
|
550
|
-
setCacheVersion(
|
|
551
|
-
this.accessToken && (
|
|
514
|
+
setCacheVersion(e) {
|
|
515
|
+
this.accessToken && (m[this.accessToken] = e);
|
|
552
516
|
}
|
|
553
517
|
cacheProvider() {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
518
|
+
switch (this.cache.type) {
|
|
519
|
+
case "memory":
|
|
520
|
+
return {
|
|
521
|
+
get(e) {
|
|
522
|
+
return k[e];
|
|
523
|
+
},
|
|
524
|
+
getAll() {
|
|
525
|
+
return k;
|
|
526
|
+
},
|
|
527
|
+
set(e, t) {
|
|
528
|
+
k[e] = t;
|
|
529
|
+
},
|
|
530
|
+
flush() {
|
|
531
|
+
k = {};
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
default:
|
|
535
|
+
return {
|
|
536
|
+
get() {
|
|
537
|
+
},
|
|
538
|
+
getAll() {
|
|
539
|
+
},
|
|
540
|
+
set() {
|
|
541
|
+
},
|
|
542
|
+
flush() {
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
flushCache() {
|
|
548
|
+
return this.cacheProvider().flush(), this;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const it = (r = {}) => {
|
|
552
|
+
const { apiOptions: e } = r;
|
|
553
|
+
if (!e.accessToken) {
|
|
571
554
|
console.error("You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication");
|
|
572
555
|
return;
|
|
573
556
|
}
|
|
574
|
-
return { storyblokApi: new
|
|
557
|
+
return { storyblokApi: new Me(e) };
|
|
575
558
|
};
|
|
576
|
-
var
|
|
559
|
+
var Le = (r) => {
|
|
577
560
|
if (typeof r != "object" || typeof r._editable > "u")
|
|
578
561
|
return {};
|
|
579
|
-
const
|
|
562
|
+
const e = JSON.parse(r._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, ""));
|
|
580
563
|
return {
|
|
581
|
-
"data-blok-c": JSON.stringify(
|
|
582
|
-
"data-blok-uid":
|
|
564
|
+
"data-blok-c": JSON.stringify(e),
|
|
565
|
+
"data-blok-uid": e.id + "-" + e.uid
|
|
583
566
|
};
|
|
584
567
|
};
|
|
585
|
-
let
|
|
586
|
-
const
|
|
568
|
+
let P;
|
|
569
|
+
const Ue = "https://app.storyblok.com/f/storyblok-v2-latest.js", at = (r, e, t = {}) => {
|
|
587
570
|
if (!(typeof window > "u")) {
|
|
588
571
|
if (typeof window.storyblokRegisterEvent > "u") {
|
|
589
572
|
console.error("Storyblok Bridge is disabled. Please enable it to use it. Read https://github.com/storyblok/storyblok-js");
|
|
@@ -594,353 +577,377 @@ const vt = "https://app.storyblok.com/f/storyblok-v2-latest.js", Jt = (r, t, e =
|
|
|
594
577
|
return;
|
|
595
578
|
}
|
|
596
579
|
window.storyblokRegisterEvent(() => {
|
|
597
|
-
new window.StoryblokBridge(
|
|
598
|
-
|
|
580
|
+
new window.StoryblokBridge(t).on(["input", "published", "change"], (n) => {
|
|
581
|
+
n.action === "input" && n.story.id === r ? e(n.story) : (n.action === "change" || n.action === "published") && n.storyId === r && window.location.reload();
|
|
599
582
|
});
|
|
600
583
|
});
|
|
601
584
|
}
|
|
602
|
-
},
|
|
585
|
+
}, He = (r = {}) => {
|
|
603
586
|
const {
|
|
604
|
-
bridge:
|
|
605
|
-
accessToken:
|
|
606
|
-
use:
|
|
607
|
-
apiOptions:
|
|
587
|
+
bridge: e,
|
|
588
|
+
accessToken: t,
|
|
589
|
+
use: s = [],
|
|
590
|
+
apiOptions: n = {},
|
|
608
591
|
richText: o = {}
|
|
609
592
|
} = r;
|
|
610
|
-
|
|
611
|
-
const a = { bridge:
|
|
593
|
+
n.accessToken = n.accessToken || t;
|
|
594
|
+
const a = { bridge: e, apiOptions: n };
|
|
612
595
|
let i = {};
|
|
613
|
-
return
|
|
614
|
-
i =
|
|
615
|
-
}),
|
|
616
|
-
}, Z = (r,
|
|
617
|
-
r.addNode("blok", (
|
|
618
|
-
let
|
|
619
|
-
return
|
|
620
|
-
|
|
596
|
+
return s.forEach((c) => {
|
|
597
|
+
i = p(p({}, i), c(a));
|
|
598
|
+
}), e !== !1 && le(Ue), P = new R(o.schema), o.resolver && Z(P, o.resolver), i;
|
|
599
|
+
}, Z = (r, e) => {
|
|
600
|
+
r.addNode("blok", (t) => {
|
|
601
|
+
let s = "";
|
|
602
|
+
return t.attrs.body.forEach((n) => {
|
|
603
|
+
s += e(n.component, n);
|
|
621
604
|
}), {
|
|
622
|
-
html:
|
|
605
|
+
html: s
|
|
623
606
|
};
|
|
624
607
|
});
|
|
625
|
-
},
|
|
626
|
-
let
|
|
627
|
-
if (!
|
|
608
|
+
}, ct = (r, e, t) => {
|
|
609
|
+
let s = t || P;
|
|
610
|
+
if (!s) {
|
|
628
611
|
console.error("Please initialize the Storyblok SDK before calling the renderRichText function");
|
|
629
612
|
return;
|
|
630
613
|
}
|
|
631
|
-
return r === "" ? "" : r ? (
|
|
614
|
+
return r === "" ? "" : r ? (e && (s = new R(e.schema), e.resolver && Z(s, e.resolver)), s.render(r)) : (console.warn(`${r} is not a valid Richtext object. This might be because the value of the richtext field is empty.
|
|
632
615
|
|
|
633
616
|
For more info about the richtext object check https://github.com/storyblok/storyblok-js#rendering-rich-text`), "");
|
|
634
617
|
};
|
|
635
618
|
function O() {
|
|
636
619
|
}
|
|
637
|
-
function
|
|
638
|
-
for (const
|
|
639
|
-
r[
|
|
620
|
+
function E(r, e) {
|
|
621
|
+
for (const t in e)
|
|
622
|
+
r[t] = e[t];
|
|
640
623
|
return r;
|
|
641
624
|
}
|
|
642
|
-
function
|
|
625
|
+
function ee(r) {
|
|
643
626
|
return r();
|
|
644
627
|
}
|
|
645
628
|
function V() {
|
|
646
629
|
return /* @__PURE__ */ Object.create(null);
|
|
647
630
|
}
|
|
648
|
-
function
|
|
649
|
-
r.forEach(
|
|
631
|
+
function b(r) {
|
|
632
|
+
r.forEach(ee);
|
|
650
633
|
}
|
|
651
|
-
function
|
|
634
|
+
function te(r) {
|
|
652
635
|
return typeof r == "function";
|
|
653
636
|
}
|
|
654
|
-
function
|
|
655
|
-
return r != r ?
|
|
637
|
+
function qe(r, e) {
|
|
638
|
+
return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function";
|
|
656
639
|
}
|
|
657
|
-
function
|
|
640
|
+
function Be(r) {
|
|
658
641
|
return Object.keys(r).length === 0;
|
|
659
642
|
}
|
|
660
|
-
function
|
|
661
|
-
const t = {};
|
|
662
|
-
for (const e in r)
|
|
663
|
-
e[0] !== "$" && (t[e] = r[e]);
|
|
664
|
-
return t;
|
|
665
|
-
}
|
|
666
|
-
function J(r, t) {
|
|
643
|
+
function De(r) {
|
|
667
644
|
const e = {};
|
|
668
|
-
t
|
|
669
|
-
|
|
670
|
-
!t.has(n) && n[0] !== "$" && (e[n] = r[n]);
|
|
645
|
+
for (const t in r)
|
|
646
|
+
t[0] !== "$" && (e[t] = r[t]);
|
|
671
647
|
return e;
|
|
672
648
|
}
|
|
673
|
-
function
|
|
674
|
-
|
|
649
|
+
function z(r, e) {
|
|
650
|
+
const t = {};
|
|
651
|
+
e = new Set(e);
|
|
652
|
+
for (const s in r)
|
|
653
|
+
!e.has(s) && s[0] !== "$" && (t[s] = r[s]);
|
|
654
|
+
return t;
|
|
675
655
|
}
|
|
676
|
-
function
|
|
656
|
+
function Fe(r, e, t) {
|
|
657
|
+
r.insertBefore(e, t || null);
|
|
658
|
+
}
|
|
659
|
+
function re(r) {
|
|
677
660
|
r.parentNode && r.parentNode.removeChild(r);
|
|
678
661
|
}
|
|
679
|
-
function
|
|
662
|
+
function Je(r) {
|
|
680
663
|
return document.createTextNode(r);
|
|
681
664
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
665
|
+
function Ve() {
|
|
666
|
+
return Je("");
|
|
684
667
|
}
|
|
685
|
-
function
|
|
668
|
+
function ze(r) {
|
|
686
669
|
return Array.from(r.childNodes);
|
|
687
670
|
}
|
|
688
|
-
function Y(r,
|
|
689
|
-
return new r(
|
|
671
|
+
function Y(r, e) {
|
|
672
|
+
return new r(e);
|
|
690
673
|
}
|
|
691
|
-
let
|
|
692
|
-
function
|
|
693
|
-
|
|
674
|
+
let L;
|
|
675
|
+
function _(r) {
|
|
676
|
+
L = r;
|
|
694
677
|
}
|
|
695
|
-
const
|
|
696
|
-
let
|
|
697
|
-
function
|
|
698
|
-
|
|
678
|
+
const y = [], K = [], w = [], Q = [], Ye = Promise.resolve();
|
|
679
|
+
let S = !1;
|
|
680
|
+
function Ke() {
|
|
681
|
+
S || (S = !0, Ye.then(se));
|
|
699
682
|
}
|
|
700
|
-
function
|
|
701
|
-
|
|
683
|
+
function I(r) {
|
|
684
|
+
w.push(r);
|
|
702
685
|
}
|
|
703
|
-
const
|
|
704
|
-
let
|
|
705
|
-
function
|
|
706
|
-
const r =
|
|
686
|
+
const x = /* @__PURE__ */ new Set();
|
|
687
|
+
let v = 0;
|
|
688
|
+
function se() {
|
|
689
|
+
const r = L;
|
|
707
690
|
do {
|
|
708
|
-
for (;
|
|
709
|
-
const
|
|
710
|
-
|
|
691
|
+
for (; v < y.length; ) {
|
|
692
|
+
const e = y[v];
|
|
693
|
+
v++, _(e), Qe(e.$$);
|
|
711
694
|
}
|
|
712
|
-
for (
|
|
713
|
-
|
|
714
|
-
for (let
|
|
715
|
-
const
|
|
716
|
-
|
|
695
|
+
for (_(null), y.length = 0, v = 0; K.length; )
|
|
696
|
+
K.pop()();
|
|
697
|
+
for (let e = 0; e < w.length; e += 1) {
|
|
698
|
+
const t = w[e];
|
|
699
|
+
x.has(t) || (x.add(t), t());
|
|
717
700
|
}
|
|
718
|
-
|
|
719
|
-
} while (
|
|
720
|
-
for (;
|
|
721
|
-
|
|
722
|
-
|
|
701
|
+
w.length = 0;
|
|
702
|
+
} while (y.length);
|
|
703
|
+
for (; Q.length; )
|
|
704
|
+
Q.pop()();
|
|
705
|
+
S = !1, x.clear(), _(r);
|
|
723
706
|
}
|
|
724
|
-
function
|
|
707
|
+
function Qe(r) {
|
|
725
708
|
if (r.fragment !== null) {
|
|
726
|
-
r.update(),
|
|
727
|
-
const
|
|
728
|
-
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx,
|
|
709
|
+
r.update(), b(r.before_update);
|
|
710
|
+
const e = r.dirty;
|
|
711
|
+
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, e), r.after_update.forEach(I);
|
|
729
712
|
}
|
|
730
713
|
}
|
|
731
714
|
const $ = /* @__PURE__ */ new Set();
|
|
732
715
|
let f;
|
|
733
|
-
function
|
|
716
|
+
function Ge() {
|
|
734
717
|
f = {
|
|
735
718
|
r: 0,
|
|
736
719
|
c: [],
|
|
737
720
|
p: f
|
|
721
|
+
// parent group
|
|
738
722
|
};
|
|
739
723
|
}
|
|
740
|
-
function
|
|
741
|
-
f.r ||
|
|
724
|
+
function We() {
|
|
725
|
+
f.r || b(f.c), f = f.p;
|
|
742
726
|
}
|
|
743
|
-
function
|
|
744
|
-
r && r.i && ($.delete(r), r.i(
|
|
727
|
+
function C(r, e) {
|
|
728
|
+
r && r.i && ($.delete(r), r.i(e));
|
|
745
729
|
}
|
|
746
|
-
function G(r,
|
|
730
|
+
function G(r, e, t, s) {
|
|
747
731
|
if (r && r.o) {
|
|
748
732
|
if ($.has(r))
|
|
749
733
|
return;
|
|
750
734
|
$.add(r), f.c.push(() => {
|
|
751
|
-
$.delete(r),
|
|
752
|
-
}), r.o(
|
|
735
|
+
$.delete(r), s && (t && r.d(1), s());
|
|
736
|
+
}), r.o(e);
|
|
753
737
|
} else
|
|
754
|
-
|
|
738
|
+
s && s();
|
|
755
739
|
}
|
|
756
|
-
function
|
|
757
|
-
const
|
|
740
|
+
function Xe(r, e) {
|
|
741
|
+
const t = {}, s = {}, n = { $$scope: 1 };
|
|
758
742
|
let o = r.length;
|
|
759
743
|
for (; o--; ) {
|
|
760
|
-
const a = r[o], i =
|
|
744
|
+
const a = r[o], i = e[o];
|
|
761
745
|
if (i) {
|
|
762
|
-
for (const
|
|
763
|
-
|
|
764
|
-
for (const
|
|
765
|
-
|
|
746
|
+
for (const c in a)
|
|
747
|
+
c in i || (s[c] = 1);
|
|
748
|
+
for (const c in i)
|
|
749
|
+
n[c] || (t[c] = i[c], n[c] = 1);
|
|
766
750
|
r[o] = i;
|
|
767
751
|
} else
|
|
768
|
-
for (const
|
|
769
|
-
|
|
752
|
+
for (const c in a)
|
|
753
|
+
n[c] = 1;
|
|
770
754
|
}
|
|
771
|
-
for (const a in
|
|
772
|
-
a in
|
|
773
|
-
return
|
|
755
|
+
for (const a in s)
|
|
756
|
+
a in t || (t[a] = void 0);
|
|
757
|
+
return t;
|
|
774
758
|
}
|
|
775
|
-
function
|
|
759
|
+
function Ze(r) {
|
|
776
760
|
return typeof r == "object" && r !== null ? r : {};
|
|
777
761
|
}
|
|
778
|
-
function
|
|
762
|
+
function W(r) {
|
|
779
763
|
r && r.c();
|
|
780
764
|
}
|
|
781
|
-
function
|
|
782
|
-
const { fragment:
|
|
783
|
-
|
|
784
|
-
const a = r.$$.on_mount.map(
|
|
785
|
-
r.$$.on_destroy ? r.$$.on_destroy.push(...a) :
|
|
786
|
-
}), o.forEach(
|
|
765
|
+
function A(r, e, t, s) {
|
|
766
|
+
const { fragment: n, after_update: o } = r.$$;
|
|
767
|
+
n && n.m(e, t), s || I(() => {
|
|
768
|
+
const a = r.$$.on_mount.map(ee).filter(te);
|
|
769
|
+
r.$$.on_destroy ? r.$$.on_destroy.push(...a) : b(a), r.$$.on_mount = [];
|
|
770
|
+
}), o.forEach(I);
|
|
787
771
|
}
|
|
788
|
-
function
|
|
789
|
-
const
|
|
790
|
-
|
|
772
|
+
function N(r, e) {
|
|
773
|
+
const t = r.$$;
|
|
774
|
+
t.fragment !== null && (b(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
791
775
|
}
|
|
792
|
-
function
|
|
793
|
-
r.$$.dirty[0] === -1 && (
|
|
776
|
+
function et(r, e) {
|
|
777
|
+
r.$$.dirty[0] === -1 && (y.push(r), Ke(), r.$$.dirty.fill(0)), r.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
794
778
|
}
|
|
795
|
-
function
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
const
|
|
779
|
+
function tt(r, e, t, s, n, o, a, i = [-1]) {
|
|
780
|
+
const c = L;
|
|
781
|
+
_(r);
|
|
782
|
+
const l = r.$$ = {
|
|
799
783
|
fragment: null,
|
|
800
784
|
ctx: [],
|
|
785
|
+
// state
|
|
801
786
|
props: o,
|
|
802
787
|
update: O,
|
|
803
|
-
not_equal:
|
|
788
|
+
not_equal: n,
|
|
804
789
|
bound: V(),
|
|
790
|
+
// lifecycle
|
|
805
791
|
on_mount: [],
|
|
806
792
|
on_destroy: [],
|
|
807
793
|
on_disconnect: [],
|
|
808
794
|
before_update: [],
|
|
809
795
|
after_update: [],
|
|
810
|
-
context: new Map(
|
|
796
|
+
context: new Map(e.context || (c ? c.$$.context : [])),
|
|
797
|
+
// everything else
|
|
811
798
|
callbacks: V(),
|
|
812
799
|
dirty: i,
|
|
813
800
|
skip_bound: !1,
|
|
814
|
-
root:
|
|
801
|
+
root: e.target || c.$$.root
|
|
815
802
|
};
|
|
816
|
-
a && a(
|
|
803
|
+
a && a(l.root);
|
|
817
804
|
let u = !1;
|
|
818
|
-
if (
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
}) : [],
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
824
|
-
|
|
805
|
+
if (l.ctx = t ? t(r, e.props || {}, (d, g, ...U) => {
|
|
806
|
+
const H = U.length ? U[0] : g;
|
|
807
|
+
return l.ctx && n(l.ctx[d], l.ctx[d] = H) && (!l.skip_bound && l.bound[d] && l.bound[d](H), u && et(r, d)), g;
|
|
808
|
+
}) : [], l.update(), u = !0, b(l.before_update), l.fragment = s ? s(l.ctx) : !1, e.target) {
|
|
809
|
+
if (e.hydrate) {
|
|
810
|
+
const d = ze(e.target);
|
|
811
|
+
l.fragment && l.fragment.l(d), d.forEach(re);
|
|
825
812
|
} else
|
|
826
|
-
|
|
827
|
-
|
|
813
|
+
l.fragment && l.fragment.c();
|
|
814
|
+
e.intro && C(r.$$.fragment), A(r, e.target, e.anchor, e.customElement), se();
|
|
828
815
|
}
|
|
829
|
-
|
|
816
|
+
_(c);
|
|
830
817
|
}
|
|
831
|
-
class
|
|
818
|
+
class rt {
|
|
832
819
|
$destroy() {
|
|
833
|
-
|
|
820
|
+
N(this, 1), this.$destroy = O;
|
|
834
821
|
}
|
|
835
|
-
$on(
|
|
836
|
-
if (!
|
|
822
|
+
$on(e, t) {
|
|
823
|
+
if (!te(t))
|
|
837
824
|
return O;
|
|
838
|
-
const
|
|
839
|
-
return
|
|
840
|
-
const
|
|
841
|
-
|
|
825
|
+
const s = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
826
|
+
return s.push(t), () => {
|
|
827
|
+
const n = s.indexOf(t);
|
|
828
|
+
n !== -1 && s.splice(n, 1);
|
|
842
829
|
};
|
|
843
830
|
}
|
|
844
|
-
$set(
|
|
845
|
-
this.$$set && !
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
function
|
|
849
|
-
let
|
|
850
|
-
const
|
|
851
|
-
|
|
831
|
+
$set(e) {
|
|
832
|
+
this.$$set && !Be(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
function st(r) {
|
|
836
|
+
let e, t, s;
|
|
837
|
+
const n = [
|
|
838
|
+
{ blok: (
|
|
839
|
+
/*blok*/
|
|
840
|
+
r[0]
|
|
841
|
+
) },
|
|
842
|
+
/*$$restProps*/
|
|
843
|
+
r[2]
|
|
844
|
+
];
|
|
845
|
+
var o = (
|
|
846
|
+
/*component*/
|
|
847
|
+
r[1]
|
|
848
|
+
);
|
|
852
849
|
function a(i) {
|
|
853
|
-
let
|
|
854
|
-
for (let
|
|
855
|
-
|
|
856
|
-
return { props:
|
|
850
|
+
let c = {};
|
|
851
|
+
for (let l = 0; l < n.length; l += 1)
|
|
852
|
+
c = E(c, n[l]);
|
|
853
|
+
return { props: c };
|
|
857
854
|
}
|
|
858
|
-
return o && (
|
|
855
|
+
return o && (e = Y(o, a())), {
|
|
859
856
|
c() {
|
|
860
|
-
|
|
857
|
+
e && W(e.$$.fragment), t = Ve();
|
|
861
858
|
},
|
|
862
|
-
m(i,
|
|
863
|
-
|
|
859
|
+
m(i, c) {
|
|
860
|
+
e && A(e, i, c), Fe(i, t, c), s = !0;
|
|
864
861
|
},
|
|
865
|
-
p(i, [
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
|
|
862
|
+
p(i, [c]) {
|
|
863
|
+
const l = c & /*blok, $$restProps*/
|
|
864
|
+
5 ? Xe(n, [
|
|
865
|
+
c & /*blok*/
|
|
866
|
+
1 && { blok: (
|
|
867
|
+
/*blok*/
|
|
868
|
+
i[0]
|
|
869
|
+
) },
|
|
870
|
+
c & /*$$restProps*/
|
|
871
|
+
4 && Ze(
|
|
872
|
+
/*$$restProps*/
|
|
873
|
+
i[2]
|
|
874
|
+
)
|
|
869
875
|
]) : {};
|
|
870
|
-
if (o !== (o =
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
876
|
+
if (o !== (o = /*component*/
|
|
877
|
+
i[1])) {
|
|
878
|
+
if (e) {
|
|
879
|
+
Ge();
|
|
880
|
+
const u = e;
|
|
874
881
|
G(u.$$.fragment, 1, 0, () => {
|
|
875
|
-
|
|
876
|
-
}),
|
|
882
|
+
N(u, 1);
|
|
883
|
+
}), We();
|
|
877
884
|
}
|
|
878
|
-
o ? (
|
|
885
|
+
o ? (e = Y(o, a()), W(e.$$.fragment), C(e.$$.fragment, 1), A(e, t.parentNode, t)) : e = null;
|
|
879
886
|
} else
|
|
880
|
-
o &&
|
|
887
|
+
o && e.$set(l);
|
|
881
888
|
},
|
|
882
889
|
i(i) {
|
|
883
|
-
|
|
890
|
+
s || (e && C(e.$$.fragment, i), s = !0);
|
|
884
891
|
},
|
|
885
892
|
o(i) {
|
|
886
|
-
|
|
893
|
+
e && G(e.$$.fragment, i), s = !1;
|
|
887
894
|
},
|
|
888
895
|
d(i) {
|
|
889
|
-
i &&
|
|
896
|
+
i && re(t), e && N(e, i);
|
|
890
897
|
}
|
|
891
898
|
};
|
|
892
899
|
}
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
let
|
|
896
|
-
return a ? o =
|
|
897
|
-
|
|
898
|
-
}, [a, o,
|
|
900
|
+
function nt(r, e, t) {
|
|
901
|
+
const s = ["blok"];
|
|
902
|
+
let n = z(e, s), o, { blok: a } = e;
|
|
903
|
+
return a ? o = ot(a.component) : console.error("Please provide a 'blok' property to the StoryblokComponent"), r.$$set = (i) => {
|
|
904
|
+
e = E(E({}, e), De(i)), t(2, n = z(e, s)), "blok" in i && t(0, a = i.blok);
|
|
905
|
+
}, [a, o, n];
|
|
899
906
|
}
|
|
900
|
-
class
|
|
901
|
-
constructor(
|
|
902
|
-
super(),
|
|
907
|
+
class lt extends rt {
|
|
908
|
+
constructor(e) {
|
|
909
|
+
super(), tt(this, e, nt, st, qe, { blok: 0 });
|
|
903
910
|
}
|
|
904
911
|
}
|
|
905
|
-
const
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
|
|
912
|
+
const ht = (r, e) => {
|
|
913
|
+
const t = (s) => {
|
|
914
|
+
const n = Le(s);
|
|
915
|
+
n["data-blok-c"] && (r.setAttribute("data-blok-c", n["data-blok-c"]), r.setAttribute("data-blok-uid", n["data-blok-uid"]), r.classList.add("storyblok__outline"));
|
|
909
916
|
};
|
|
910
|
-
return e
|
|
911
|
-
update(
|
|
912
|
-
|
|
917
|
+
return t(e), {
|
|
918
|
+
update(s) {
|
|
919
|
+
t(s);
|
|
913
920
|
}
|
|
914
921
|
};
|
|
915
922
|
};
|
|
916
|
-
let
|
|
917
|
-
const
|
|
923
|
+
let M = null;
|
|
924
|
+
const ut = () => (M || console.log(
|
|
918
925
|
"You can't use getStoryblokApi if you're not loading apiPlugin."
|
|
919
|
-
),
|
|
920
|
-
let
|
|
921
|
-
const
|
|
922
|
-
const { storyblokApi:
|
|
923
|
-
|
|
924
|
-
},
|
|
925
|
-
let
|
|
926
|
-
return
|
|
926
|
+
), M);
|
|
927
|
+
let T = null;
|
|
928
|
+
const dt = (r) => {
|
|
929
|
+
const { storyblokApi: e } = He(r);
|
|
930
|
+
M = e, T = r.components || {};
|
|
931
|
+
}, ot = (r) => {
|
|
932
|
+
let e = null;
|
|
933
|
+
return e = typeof T == "function" ? T()[r] : T[r], e || console.error(`You didn't load the ${r} component. Please load it in storyblokInit. For example:
|
|
927
934
|
storyblokInit({
|
|
928
935
|
accessToken: "<your-token>",
|
|
929
936
|
components: {
|
|
930
937
|
"teaser": Teaser
|
|
931
938
|
}
|
|
932
939
|
})
|
|
933
|
-
`),
|
|
940
|
+
`), e;
|
|
934
941
|
};
|
|
935
942
|
export {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
943
|
+
Ce as RichTextSchema,
|
|
944
|
+
lt as StoryblokComponent,
|
|
945
|
+
it as apiPlugin,
|
|
946
|
+
ot as getComponent,
|
|
947
|
+
ut as getStoryblokApi,
|
|
948
|
+
ct as renderRichText,
|
|
949
|
+
ht as storyblokEditable,
|
|
950
|
+
dt as storyblokInit,
|
|
951
|
+
ut as useStoryblokApi,
|
|
952
|
+
at as useStoryblokBridge
|
|
946
953
|
};
|