@flyo/nitro-astro 1.4.4 → 2.0.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.
@@ -1,13 +1,13 @@
1
- const j = "https://api.flyo.cloud/nitro/v1".replace(/\/+$/, "");
2
- class P {
3
- constructor(t = {}) {
4
- this.configuration = t;
1
+ const x = "https://api.flyo.cloud/nitro/v1".replace(/\/+$/, "");
2
+ class S {
3
+ constructor(n = {}) {
4
+ this.configuration = n;
5
5
  }
6
- set config(t) {
7
- this.configuration = t;
6
+ set config(n) {
7
+ this.configuration = n;
8
8
  }
9
9
  get basePath() {
10
- return this.configuration.basePath != null ? this.configuration.basePath : j;
10
+ return this.configuration.basePath != null ? this.configuration.basePath : x;
11
11
  }
12
12
  get fetchApi() {
13
13
  return this.configuration.fetchApi;
@@ -16,7 +16,7 @@ class P {
16
16
  return this.configuration.middleware || [];
17
17
  }
18
18
  get queryParamsStringify() {
19
- return this.configuration.queryParamsStringify || A;
19
+ return this.configuration.queryParamsStringify || q;
20
20
  }
21
21
  get username() {
22
22
  return this.configuration.username;
@@ -25,14 +25,14 @@ class P {
25
25
  return this.configuration.password;
26
26
  }
27
27
  get apiKey() {
28
- const t = this.configuration.apiKey;
29
- if (t)
30
- return typeof t == "function" ? t : () => t;
28
+ const n = this.configuration.apiKey;
29
+ if (n)
30
+ return typeof n == "function" ? n : () => n;
31
31
  }
32
32
  get accessToken() {
33
- const t = this.configuration.accessToken;
34
- if (t)
35
- return typeof t == "function" ? t : async () => t;
33
+ const n = this.configuration.accessToken;
34
+ if (n)
35
+ return typeof n == "function" ? n : async () => n;
36
36
  }
37
37
  get headers() {
38
38
  return this.configuration.headers;
@@ -41,51 +41,51 @@ class P {
41
41
  return this.configuration.credentials;
42
42
  }
43
43
  }
44
- const L = new P(), C = class k {
45
- constructor(t = L) {
46
- this.configuration = t, this.fetchApi = async (i, o) => {
47
- let a = { url: i, init: o };
48
- for (const s of this.middleware)
49
- s.pre && (a = await s.pre({
44
+ const U = new S(), C = class E {
45
+ constructor(n = U) {
46
+ this.configuration = n, this.fetchApi = async (t, i) => {
47
+ let r = { url: t, init: i };
48
+ for (const a of this.middleware)
49
+ a.pre && (r = await a.pre({
50
50
  fetch: this.fetchApi,
51
- ...a
52
- }) || a);
53
- let r;
51
+ ...r
52
+ }) || r);
53
+ let o;
54
54
  try {
55
- r = await (this.configuration.fetchApi || fetch)(a.url, a.init);
56
- } catch (s) {
57
- for (const u of this.middleware)
58
- u.onError && (r = await u.onError({
55
+ o = await (this.configuration.fetchApi || fetch)(r.url, r.init);
56
+ } catch (a) {
57
+ for (const l of this.middleware)
58
+ l.onError && (o = await l.onError({
59
59
  fetch: this.fetchApi,
60
- url: a.url,
61
- init: a.init,
62
- error: s,
63
- response: r ? r.clone() : void 0
64
- }) || r);
65
- if (r === void 0)
66
- throw s instanceof Error ? new $(s, "The request failed and the interceptors did not return an alternative response") : s;
60
+ url: r.url,
61
+ init: r.init,
62
+ error: a,
63
+ response: o ? o.clone() : void 0
64
+ }) || o);
65
+ if (o === void 0)
66
+ throw a instanceof Error ? new P(a, "The request failed and the interceptors did not return an alternative response") : a;
67
67
  }
68
- for (const s of this.middleware)
69
- s.post && (r = await s.post({
68
+ for (const a of this.middleware)
69
+ a.post && (o = await a.post({
70
70
  fetch: this.fetchApi,
71
- url: a.url,
72
- init: a.init,
73
- response: r.clone()
74
- }) || r);
75
- return r;
76
- }, this.middleware = t.middleware;
71
+ url: r.url,
72
+ init: r.init,
73
+ response: o.clone()
74
+ }) || o);
75
+ return o;
76
+ }, this.middleware = n.middleware;
77
77
  }
78
- withMiddleware(...t) {
79
- const i = this.clone();
80
- return i.middleware = i.middleware.concat(...t), i;
78
+ withMiddleware(...n) {
79
+ const t = this.clone();
80
+ return t.middleware = t.middleware.concat(...n), t;
81
81
  }
82
- withPreMiddleware(...t) {
83
- const i = t.map((o) => ({ pre: o }));
84
- return this.withMiddleware(...i);
82
+ withPreMiddleware(...n) {
83
+ const t = n.map((i) => ({ pre: i }));
84
+ return this.withMiddleware(...t);
85
85
  }
86
- withPostMiddleware(...t) {
87
- const i = t.map((o) => ({ post: o }));
88
- return this.withMiddleware(...i);
86
+ withPostMiddleware(...n) {
87
+ const t = n.map((i) => ({ post: i }));
88
+ return this.withMiddleware(...t);
89
89
  }
90
90
  /**
91
91
  * Check if the given MIME is a JSON MIME.
@@ -97,647 +97,666 @@ const L = new P(), C = class k {
97
97
  * @param mime - MIME (Multipurpose Internet Mail Extensions)
98
98
  * @return True if the given MIME is JSON, false otherwise.
99
99
  */
100
- isJsonMime(t) {
101
- return t ? k.jsonRegex.test(t) : !1;
102
- }
103
- async request(t, i) {
104
- const { url: o, init: a } = await this.createFetchParams(t, i), r = await this.fetchApi(o, a);
105
- if (r && r.status >= 200 && r.status < 300)
106
- return r;
107
- throw new O(r, "Response returned an error code");
108
- }
109
- async createFetchParams(t, i) {
110
- let o = this.configuration.basePath + t.path;
111
- t.query !== void 0 && Object.keys(t.query).length !== 0 && (o += "?" + this.configuration.queryParamsStringify(t.query));
112
- const a = Object.assign({}, this.configuration.headers, t.headers);
113
- Object.keys(a).forEach((h) => a[h] === void 0 ? delete a[h] : {});
114
- const r = typeof i == "function" ? i : async () => i, s = {
115
- method: t.method,
116
- headers: a,
117
- body: t.body,
100
+ isJsonMime(n) {
101
+ return n ? E.jsonRegex.test(n) : !1;
102
+ }
103
+ async request(n, t) {
104
+ const { url: i, init: r } = await this.createFetchParams(n, t), o = await this.fetchApi(i, r);
105
+ if (o && o.status >= 200 && o.status < 300)
106
+ return o;
107
+ throw new F(o, "Response returned an error code");
108
+ }
109
+ async createFetchParams(n, t) {
110
+ let i = this.configuration.basePath + n.path;
111
+ n.query !== void 0 && Object.keys(n.query).length !== 0 && (i += "?" + this.configuration.queryParamsStringify(n.query));
112
+ const r = Object.assign({}, this.configuration.headers, n.headers);
113
+ Object.keys(r).forEach((p) => r[p] === void 0 ? delete r[p] : {});
114
+ const o = typeof t == "function" ? t : async () => t, a = {
115
+ method: n.method,
116
+ headers: r,
117
+ body: n.body,
118
118
  credentials: this.configuration.credentials
119
- }, u = {
120
- ...s,
121
- ...await r({
122
- init: s,
123
- context: t
119
+ }, l = {
120
+ ...a,
121
+ ...await o({
122
+ init: a,
123
+ context: n
124
124
  })
125
125
  };
126
- let c;
127
- N(u.body) || u.body instanceof URLSearchParams || K(u.body) ? c = u.body : this.isJsonMime(a["Content-Type"]) ? c = JSON.stringify(u.body) : c = u.body;
128
- const l = {
129
- ...u,
130
- body: c
126
+ let s;
127
+ L(l.body) || l.body instanceof URLSearchParams || j(l.body) ? s = l.body : this.isJsonMime(r["Content-Type"]) ? s = JSON.stringify(l.body) : s = l.body;
128
+ const u = {
129
+ ...l,
130
+ body: s
131
131
  };
132
- return { url: o, init: l };
132
+ return { url: i, init: u };
133
133
  }
134
134
  /**
135
135
  * Create a shallow clone of `this` by constructing a new instance
136
136
  * and then shallow cloning data members.
137
137
  */
138
138
  clone() {
139
- const t = this.constructor, i = new t(this.configuration);
140
- return i.middleware = this.middleware.slice(), i;
139
+ const n = this.constructor, t = new n(this.configuration);
140
+ return t.middleware = this.middleware.slice(), t;
141
141
  }
142
142
  };
143
143
  C.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
144
- let p = C;
145
- function K(e) {
144
+ let d = C;
145
+ function j(e) {
146
146
  return typeof Blob < "u" && e instanceof Blob;
147
147
  }
148
- function N(e) {
148
+ function L(e) {
149
149
  return typeof FormData < "u" && e instanceof FormData;
150
150
  }
151
- class O extends Error {
152
- constructor(t, i) {
153
- super(i), this.response = t, this.name = "ResponseError";
151
+ class F extends Error {
152
+ constructor(n, t) {
153
+ super(t), this.response = n, this.name = "ResponseError";
154
154
  }
155
155
  }
156
- class $ extends Error {
157
- constructor(t, i) {
158
- super(i), this.cause = t, this.name = "FetchError";
156
+ class P extends Error {
157
+ constructor(n, t) {
158
+ super(t), this.cause = n, this.name = "FetchError";
159
159
  }
160
160
  }
161
- class v extends Error {
162
- constructor(t, i) {
163
- super(i), this.field = t, this.name = "RequiredError";
161
+ class g extends Error {
162
+ constructor(n, t) {
163
+ super(t), this.field = n, this.name = "RequiredError";
164
164
  }
165
165
  }
166
- function n(e, t) {
167
- return e[t] != null;
168
- }
169
- function A(e, t = "") {
170
- return Object.keys(e).map((i) => I(i, e[i], t)).filter((i) => i.length > 0).join("&");
166
+ function q(e, n = "") {
167
+ return Object.keys(e).map((t) => R(t, e[t], n)).filter((t) => t.length > 0).join("&");
171
168
  }
172
- function I(e, t, i = "") {
173
- const o = i + (i.length ? `[${e}]` : e);
174
- if (t instanceof Array) {
175
- const a = t.map((r) => encodeURIComponent(String(r))).join(`&${encodeURIComponent(o)}=`);
176
- return `${encodeURIComponent(o)}=${a}`;
169
+ function R(e, n, t = "") {
170
+ const i = t + (t.length ? `[${e}]` : e);
171
+ if (n instanceof Array) {
172
+ const r = n.map((o) => encodeURIComponent(String(o))).join(`&${encodeURIComponent(i)}=`);
173
+ return `${encodeURIComponent(i)}=${r}`;
177
174
  }
178
- if (t instanceof Set) {
179
- const a = Array.from(t);
180
- return I(e, a, i);
175
+ if (n instanceof Set) {
176
+ const r = Array.from(n);
177
+ return R(e, r, t);
181
178
  }
182
- return t instanceof Date ? `${encodeURIComponent(o)}=${encodeURIComponent(t.toISOString())}` : t instanceof Object ? A(t, o) : `${encodeURIComponent(o)}=${encodeURIComponent(String(t))}`;
179
+ return n instanceof Date ? `${encodeURIComponent(i)}=${encodeURIComponent(n.toISOString())}` : n instanceof Object ? q(n, i) : `${encodeURIComponent(i)}=${encodeURIComponent(String(n))}`;
183
180
  }
184
- function m(e, t) {
181
+ function y(e, n) {
185
182
  return Object.keys(e).reduce(
186
- (i, o) => ({ ...i, [o]: t(e[o]) }),
183
+ (t, i) => ({ ...t, [i]: n(e[i]) }),
187
184
  {}
188
185
  );
189
186
  }
190
- class f {
191
- constructor(t, i = (o) => o) {
192
- this.raw = t, this.transformer = i;
187
+ class c {
188
+ constructor(n, t = (i) => i) {
189
+ this.raw = n, this.transformer = t;
193
190
  }
194
191
  async value() {
195
192
  return this.transformer(await this.raw.json());
196
193
  }
197
194
  }
198
- function F(e) {
199
- return B(e);
195
+ function K(e) {
196
+ return N(e);
200
197
  }
201
- function B(e, t) {
198
+ function N(e, n) {
202
199
  return e == null ? e : {
203
- identifier: n(e, "identifier") ? e.identifier : void 0,
204
- content: n(e, "content") ? e.content.map(S) : void 0
200
+ identifier: e.identifier == null ? void 0 : e.identifier,
201
+ content: e.content == null ? void 0 : e.content.map(A)
205
202
  };
206
203
  }
207
- function S(e) {
208
- return D(e);
204
+ function A(e) {
205
+ return $(e);
209
206
  }
210
- function D(e, t) {
207
+ function $(e, n) {
211
208
  return e == null ? e : {
212
- items: n(e, "items") ? e.items : void 0,
213
- content: n(e, "content") ? e.content : void 0,
214
- config: n(e, "config") ? e.config : void 0,
215
- identifier: n(e, "identifier") ? e.identifier : void 0,
216
- uid: n(e, "uid") ? e.uid : void 0,
217
- component: n(e, "component") ? e.component : void 0,
218
- slots: n(e, "slots") ? m(e.slots, F) : void 0
209
+ items: e.items == null ? void 0 : e.items,
210
+ content: e.content == null ? void 0 : e.content,
211
+ config: e.config == null ? void 0 : e.config,
212
+ identifier: e.identifier == null ? void 0 : e.identifier,
213
+ uid: e.uid == null ? void 0 : e.uid,
214
+ component: e.component == null ? void 0 : e.component,
215
+ slots: e.slots == null ? void 0 : y(e.slots, K)
219
216
  };
220
217
  }
221
- function x(e) {
222
- return M(e);
218
+ function I(e) {
219
+ return B(e);
223
220
  }
224
- function M(e, t) {
221
+ function B(e, n) {
225
222
  return e == null ? e : {
226
- type: n(e, "type") ? e.type : void 0,
227
- target: n(e, "target") ? e.target : void 0,
228
- label: n(e, "label") ? e.label : void 0,
229
- href: n(e, "href") ? e.href : void 0,
230
- slug: n(e, "slug") ? e.slug : void 0,
231
- properties: n(e, "properties") ? e.properties : void 0,
232
- children: n(e, "children") ? e.children.map(x) : void 0
223
+ type: e.type == null ? void 0 : e.type,
224
+ target: e.target == null ? void 0 : e.target,
225
+ label: e.label == null ? void 0 : e.label,
226
+ href: e.href == null ? void 0 : e.href,
227
+ slug: e.slug == null ? void 0 : e.slug,
228
+ properties: e.properties == null ? void 0 : e.properties,
229
+ children: e.children == null ? void 0 : e.children.map(I)
233
230
  };
234
231
  }
235
- function G(e) {
236
- return J(e);
232
+ function M(e) {
233
+ return O(e);
237
234
  }
238
- function J(e, t) {
235
+ function O(e, n) {
239
236
  return e == null ? e : {
240
- items: n(e, "items") ? e.items.map(x) : void 0,
241
- uid: n(e, "uid") ? e.uid : void 0,
242
- identifier: n(e, "identifier") ? e.identifier : void 0,
243
- label: n(e, "label") ? e.label : void 0
237
+ items: e.items == null ? void 0 : e.items.map(I),
238
+ uid: e.uid == null ? void 0 : e.uid,
239
+ identifier: e.identifier == null ? void 0 : e.identifier,
240
+ label: e.label == null ? void 0 : e.label
244
241
  };
245
242
  }
246
- function V(e) {
247
- return W(e);
243
+ function D(e) {
244
+ return G(e);
248
245
  }
249
- function W(e, t) {
246
+ function G(e, n) {
250
247
  return e == null ? e : {
251
- domain: n(e, "domain") ? e.domain : void 0,
252
- slug: n(e, "slug") ? e.slug : void 0,
253
- version: n(e, "version") ? e.version : void 0,
254
- updated_at: n(e, "updated_at") ? e.updated_at : void 0,
255
- language: n(e, "language") ? e.language : void 0
248
+ domain: e.domain == null ? void 0 : e.domain,
249
+ slug: e.slug == null ? void 0 : e.slug,
250
+ version: e.version == null ? void 0 : e.version,
251
+ updated_at: e.updated_at == null ? void 0 : e.updated_at,
252
+ language: e.language == null ? void 0 : e.language,
253
+ primary_language: e.primary_language == null ? void 0 : e.primary_language
256
254
  };
257
255
  }
258
- function z(e) {
259
- return Q(e);
256
+ function H(e) {
257
+ return V(e);
260
258
  }
261
- function Q(e, t) {
259
+ function V(e, n) {
262
260
  return e == null ? e : {
263
- nitro: n(e, "nitro") ? V(e.nitro) : void 0,
264
- pages: n(e, "pages") ? e.pages : void 0,
265
- containers: n(e, "containers") ? m(e.containers, G) : void 0,
266
- globals: n(e, "globals") ? e.globals : void 0
261
+ nitro: e.nitro == null ? void 0 : D(e.nitro),
262
+ pages: e.pages == null ? void 0 : e.pages,
263
+ containers: e.containers == null ? void 0 : y(e.containers, M),
264
+ globals: e.globals == null ? void 0 : e.globals
267
265
  };
268
266
  }
269
- function H(e) {
270
- return X(e);
267
+ function z(e) {
268
+ return J(e);
271
269
  }
272
- function X(e, t) {
270
+ function J(e, n) {
273
271
  return e == null ? e : {
274
- api: n(e, "api") ? e.api : void 0,
275
- image: n(e, "image") ? e.image : void 0
272
+ api: e.api == null ? void 0 : e.api,
273
+ image: e.image == null ? void 0 : e.image
276
274
  };
277
275
  }
278
- function Z(e) {
279
- return Y(e);
276
+ function W(e) {
277
+ return Q(e);
280
278
  }
281
- function Y(e, t) {
279
+ function Q(e, n) {
282
280
  return e == null ? e : {
283
- _version: n(e, "_version") ? e._version : void 0,
284
- entity_metric: n(e, "entity_metric") ? H(e.entity_metric) : void 0,
285
- entity_unique_id: n(e, "entity_unique_id") ? e.entity_unique_id : void 0,
286
- entity_id: n(e, "entity_id") ? e.entity_id : void 0,
287
- entity_image: n(e, "entity_image") ? e.entity_image : void 0,
288
- entity_slug: n(e, "entity_slug") ? e.entity_slug : void 0,
289
- entity_teaser: n(e, "entity_teaser") ? e.entity_teaser : void 0,
290
- entity_time_end: n(e, "entity_time_end") ? e.entity_time_end : void 0,
291
- entity_time_start: n(e, "entity_time_start") ? e.entity_time_start : void 0,
292
- entity_title: n(e, "entity_title") ? e.entity_title : void 0,
293
- entity_type: n(e, "entity_type") ? e.entity_type : void 0,
294
- entity_type_id: n(e, "entity_type_id") ? e.entity_type_id : void 0,
295
- updated_at: n(e, "updated_at") ? e.updated_at : void 0,
296
- routes: n(e, "routes") ? e.routes : void 0
281
+ _version: e._version == null ? void 0 : e._version,
282
+ entity_metric: e.entity_metric == null ? void 0 : z(e.entity_metric),
283
+ entity_unique_id: e.entity_unique_id == null ? void 0 : e.entity_unique_id,
284
+ entity_id: e.entity_id == null ? void 0 : e.entity_id,
285
+ entity_image: e.entity_image == null ? void 0 : e.entity_image,
286
+ entity_slug: e.entity_slug == null ? void 0 : e.entity_slug,
287
+ entity_teaser: e.entity_teaser == null ? void 0 : e.entity_teaser,
288
+ entity_time_end: e.entity_time_end == null ? void 0 : e.entity_time_end,
289
+ entity_time_start: e.entity_time_start == null ? void 0 : e.entity_time_start,
290
+ entity_title: e.entity_title == null ? void 0 : e.entity_title,
291
+ entity_type: e.entity_type == null ? void 0 : e.entity_type,
292
+ entity_type_id: e.entity_type_id == null ? void 0 : e.entity_type_id,
293
+ updated_at: e.updated_at == null ? void 0 : e.updated_at,
294
+ routes: e.routes == null ? void 0 : e.routes
297
295
  };
298
296
  }
299
- function _(e) {
300
- return ee(e);
297
+ function v(e) {
298
+ return Y(e);
301
299
  }
302
- function ee(e, t) {
300
+ function Y(e, n) {
303
301
  return e == null ? e : {
304
- entity: n(e, "entity") ? Z(e.entity) : void 0,
305
- model: n(e, "model") ? e.model : void 0,
306
- language: n(e, "language") ? e.language : void 0,
307
- jsonld: n(e, "jsonld") ? e.jsonld : void 0
302
+ entity: e.entity == null ? void 0 : W(e.entity),
303
+ model: e.model == null ? void 0 : e.model,
304
+ language: e.language == null ? void 0 : e.language,
305
+ jsonld: e.jsonld == null ? void 0 : e.jsonld
308
306
  };
309
307
  }
310
- function T(e) {
311
- return te(e);
308
+ function k(e) {
309
+ return Z(e);
312
310
  }
313
- function te(e, t) {
311
+ function Z(e, n) {
314
312
  return e == null ? e : {
315
- entity_unique_id: n(e, "entity_unique_id") ? e.entity_unique_id : void 0,
316
- entity_title: n(e, "entity_title") ? e.entity_title : void 0,
317
- entity_teaser: n(e, "entity_teaser") ? e.entity_teaser : void 0,
318
- entity_slug: n(e, "entity_slug") ? e.entity_slug : void 0,
319
- entity_time_start: n(e, "entity_time_start") ? e.entity_time_start : void 0,
320
- entity_type: n(e, "entity_type") ? e.entity_type : void 0,
321
- entity_type_id: n(e, "entity_type_id") ? e.entity_type_id : void 0,
322
- entity_image: n(e, "entity_image") ? e.entity_image : void 0,
323
- routes: n(e, "routes") ? e.routes : void 0
313
+ entity_unique_id: e.entity_unique_id == null ? void 0 : e.entity_unique_id,
314
+ entity_title: e.entity_title == null ? void 0 : e.entity_title,
315
+ entity_teaser: e.entity_teaser == null ? void 0 : e.entity_teaser,
316
+ entity_slug: e.entity_slug == null ? void 0 : e.entity_slug,
317
+ entity_time_start: e.entity_time_start == null ? void 0 : e.entity_time_start,
318
+ entity_type: e.entity_type == null ? void 0 : e.entity_type,
319
+ entity_type_id: e.entity_type_id == null ? void 0 : e.entity_type_id,
320
+ entity_image: e.entity_image == null ? void 0 : e.entity_image,
321
+ routes: e.routes == null ? void 0 : e.routes
324
322
  };
325
323
  }
326
- function ie(e) {
327
- return ne(e);
324
+ function X(e) {
325
+ return ee(e);
328
326
  }
329
- function ne(e, t) {
327
+ function ee(e, n) {
330
328
  return e == null ? e : {
331
- description: n(e, "description") ? e.description : void 0,
332
- image: n(e, "image") ? e.image : void 0,
333
- title: n(e, "title") ? e.title : void 0
329
+ description: e.description == null ? void 0 : e.description,
330
+ image: e.image == null ? void 0 : e.image,
331
+ title: e.title == null ? void 0 : e.title
334
332
  };
335
333
  }
336
- function oe(e) {
337
- return re(e);
334
+ function ne(e) {
335
+ return te(e);
338
336
  }
339
- function re(e, t) {
337
+ function te(e, n) {
340
338
  return e == null ? e : {
341
- slug: n(e, "slug") ? e.slug : void 0,
342
- title: n(e, "title") ? e.title : void 0
339
+ slug: e.slug == null ? void 0 : e.slug,
340
+ title: e.title == null ? void 0 : e.title
343
341
  };
344
342
  }
345
- function ae(e) {
346
- return se(e);
343
+ function ie(e) {
344
+ return oe(e);
347
345
  }
348
- function se(e, t) {
346
+ function oe(e, n) {
349
347
  return e == null ? e : {
350
- value: n(e, "value") ? e.value : void 0,
351
- navigation: n(e, "navigation") ? e.navigation : void 0,
352
- propagate: n(e, "propagate") ? e.propagate : void 0
348
+ value: e.value == null ? void 0 : e.value,
349
+ navigation: e.navigation == null ? void 0 : e.navigation,
350
+ propagate: e.propagate == null ? void 0 : e.propagate
353
351
  };
354
352
  }
355
- function b(e) {
356
- return ue(e);
353
+ function m(e) {
354
+ return re(e);
357
355
  }
358
- function ue(e, t) {
356
+ function re(e, n) {
359
357
  return e == null ? e : {
360
- id: n(e, "id") ? e.id : void 0,
361
- title: n(e, "title") ? e.title : void 0,
362
- href: n(e, "href") ? e.href : void 0,
363
- slug: n(e, "slug") ? e.slug : void 0,
364
- json: n(e, "json") ? e.json.map(S) : void 0,
365
- depth: n(e, "depth") ? e.depth : void 0,
366
- is_home: n(e, "is_home") ? e.is_home : void 0,
367
- created_at: n(e, "created_at") ? e.created_at : void 0,
368
- updated_at: n(e, "updated_at") ? e.updated_at : void 0,
369
- is_visible: n(e, "is_visible") ? e.is_visible : void 0,
370
- meta_json: n(e, "meta_json") ? ie(e.meta_json) : void 0,
371
- properties: n(e, "properties") ? m(e.properties, ae) : void 0,
372
- uid: n(e, "uid") ? e.uid : void 0,
373
- type: n(e, "type") ? e.type : void 0,
374
- target: n(e, "target") ? e.target : void 0,
375
- container: n(e, "container") ? e.container : void 0,
376
- breadcrumb: n(e, "breadcrumb") ? e.breadcrumb.map(oe) : void 0
358
+ id: e.id == null ? void 0 : e.id,
359
+ title: e.title == null ? void 0 : e.title,
360
+ href: e.href == null ? void 0 : e.href,
361
+ slug: e.slug == null ? void 0 : e.slug,
362
+ json: e.json == null ? void 0 : e.json.map(A),
363
+ depth: e.depth == null ? void 0 : e.depth,
364
+ is_home: e.is_home == null ? void 0 : e.is_home,
365
+ created_at: e.created_at == null ? void 0 : e.created_at,
366
+ updated_at: e.updated_at == null ? void 0 : e.updated_at,
367
+ is_visible: e.is_visible == null ? void 0 : e.is_visible,
368
+ meta_json: e.meta_json == null ? void 0 : X(e.meta_json),
369
+ properties: e.properties == null ? void 0 : y(e.properties, ie),
370
+ uid: e.uid == null ? void 0 : e.uid,
371
+ type: e.type == null ? void 0 : e.type,
372
+ target: e.target == null ? void 0 : e.target,
373
+ container: e.container == null ? void 0 : e.container,
374
+ breadcrumb: e.breadcrumb == null ? void 0 : e.breadcrumb.map(ne)
377
375
  };
378
376
  }
379
- function ce(e) {
377
+ function ae(e) {
380
378
  return le(e);
381
379
  }
382
- function le(e, t) {
380
+ function le(e, n) {
383
381
  return e == null ? e : {
384
- version: n(e, "version") ? e.version : void 0,
385
- updated_at: n(e, "updated_at") ? e.updated_at : void 0
382
+ version: e.version == null ? void 0 : e.version,
383
+ updated_at: e.updated_at == null ? void 0 : e.updated_at
386
384
  };
387
385
  }
388
- class de extends p {
386
+ class se extends d {
389
387
  /**
390
388
  * The config API endpoint provides comprehensive information required for configuring the layout of websites. It encompasses various essential elements, including containers with pages, an extensive list of available slugs, globals containing content pool data, and crucial details about the Nitro configuration itself. By accessing this endpoint, developers can gather all the necessary data to effectively design and structure their websites. The endpoint offers a holistic view of the website\'s layout, empowering developers to tailor the user experience and optimize the overall design.
391
389
  * Get Config
392
390
  */
393
- async configRaw(t) {
394
- const i = {}, o = {};
395
- this.configuration && this.configuration.apiKey && (i.token = this.configuration.apiKey("token"));
396
- const a = await this.request({
391
+ async configRaw(n, t) {
392
+ const i = {};
393
+ n.lang != null && (i.lang = n.lang);
394
+ const r = {};
395
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
396
+ const o = await this.request({
397
397
  path: "/config",
398
398
  method: "GET",
399
- headers: o,
399
+ headers: r,
400
400
  query: i
401
401
  }, t);
402
- return new f(a, (r) => z(r));
402
+ return new c(o, (a) => H(a));
403
403
  }
404
404
  /**
405
405
  * The config API endpoint provides comprehensive information required for configuring the layout of websites. It encompasses various essential elements, including containers with pages, an extensive list of available slugs, globals containing content pool data, and crucial details about the Nitro configuration itself. By accessing this endpoint, developers can gather all the necessary data to effectively design and structure their websites. The endpoint offers a holistic view of the website\'s layout, empowering developers to tailor the user experience and optimize the overall design.
406
406
  * Get Config
407
407
  */
408
- async config(t) {
409
- return await (await this.configRaw(t)).value();
408
+ async config(n = {}, t) {
409
+ return await (await this.configRaw(n, t)).value();
410
410
  }
411
411
  }
412
- class fe extends p {
412
+ class ue extends d {
413
413
  /**
414
- *
415
- * Find entity by slug and optional Type-ID
414
+ * The endpoint allows for the retrieval of entities based on their slug, with an optional Entity-Type-ID for more accurate results. The endpoint requires a `slug` parameter to be passed in the path, which is necessary for identifying the entity. However, since slugs are not unique across different entities, it is highly recommended to also provide the `typeId` parameter through the query to avoid incorrect or unintended results. This `typeId` serves as an Entity-Definition-Schema ID, ensuring a more precise and targeted entity retrieval by distinguishing the entities more clearly. The `slug` parameter is mandatory and should be a string (e.g., \'hello-world\'), while the `typeId` parameter is optional and should be an integer (e.g., 123), representing the Entity-Definition-Schema ID.
415
+ * Find entity by slug and optional Entity-Type-ID
416
416
  */
417
- async entityBySlugRaw(t, i) {
418
- if (t.slug === null || t.slug === void 0)
419
- throw new v("slug", "Required parameter requestParameters.slug was null or undefined when calling entityBySlug.");
420
- const o = {};
421
- t.typeId !== void 0 && (o.typeId = t.typeId);
422
- const a = {};
423
- this.configuration && this.configuration.apiKey && (o.token = this.configuration.apiKey("token"));
424
- const r = await this.request({
425
- path: "/entities/slug/{slug}".replace("{slug}", encodeURIComponent(String(t.slug))),
417
+ async entityBySlugRaw(n, t) {
418
+ if (n.slug == null)
419
+ throw new g(
420
+ "slug",
421
+ 'Required parameter "slug" was null or undefined when calling entityBySlug().'
422
+ );
423
+ const i = {};
424
+ n.lang != null && (i.lang = n.lang), n.typeId != null && (i.typeId = n.typeId);
425
+ const r = {};
426
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
427
+ const o = await this.request({
428
+ path: "/entities/slug/{slug}".replace("{slug}", encodeURIComponent(String(n.slug))),
426
429
  method: "GET",
427
- headers: a,
428
- query: o
429
- }, i);
430
- return new f(r, (s) => _(s));
430
+ headers: r,
431
+ query: i
432
+ }, t);
433
+ return new c(o, (a) => v(a));
431
434
  }
432
435
  /**
433
- *
434
- * Find entity by slug and optional Type-ID
436
+ * The endpoint allows for the retrieval of entities based on their slug, with an optional Entity-Type-ID for more accurate results. The endpoint requires a `slug` parameter to be passed in the path, which is necessary for identifying the entity. However, since slugs are not unique across different entities, it is highly recommended to also provide the `typeId` parameter through the query to avoid incorrect or unintended results. This `typeId` serves as an Entity-Definition-Schema ID, ensuring a more precise and targeted entity retrieval by distinguishing the entities more clearly. The `slug` parameter is mandatory and should be a string (e.g., \'hello-world\'), while the `typeId` parameter is optional and should be an integer (e.g., 123), representing the Entity-Definition-Schema ID.
437
+ * Find entity by slug and optional Entity-Type-ID
435
438
  */
436
- async entityBySlug(t, i) {
437
- return await (await this.entityBySlugRaw(t, i)).value();
439
+ async entityBySlug(n, t) {
440
+ return await (await this.entityBySlugRaw(n, t)).value();
438
441
  }
439
442
  /**
440
443
  * The endpoint provides comprehensive information about a specified entity. An entity represents a collection of information pertaining to a specific data type and is defined by a key-value pair. You can use various data types such as blogs, events, or any other relevant data. However, in order to access an entity, it must be properly configured within the nitro config.
441
444
  * Find entity by uniqueid
442
445
  */
443
- async entityByUniqueidRaw(t, i) {
444
- if (t.uniqueid === null || t.uniqueid === void 0)
445
- throw new v("uniqueid", "Required parameter requestParameters.uniqueid was null or undefined when calling entityByUniqueid.");
446
- const o = {}, a = {};
447
- this.configuration && this.configuration.apiKey && (o.token = this.configuration.apiKey("token"));
448
- const r = await this.request({
449
- path: "/entities/uniqueid/{uniqueid}".replace("{uniqueid}", encodeURIComponent(String(t.uniqueid))),
446
+ async entityByUniqueidRaw(n, t) {
447
+ if (n.uniqueid == null)
448
+ throw new g(
449
+ "uniqueid",
450
+ 'Required parameter "uniqueid" was null or undefined when calling entityByUniqueid().'
451
+ );
452
+ const i = {};
453
+ n.lang != null && (i.lang = n.lang);
454
+ const r = {};
455
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
456
+ const o = await this.request({
457
+ path: "/entities/uniqueid/{uniqueid}".replace("{uniqueid}", encodeURIComponent(String(n.uniqueid))),
450
458
  method: "GET",
451
- headers: a,
452
- query: o
453
- }, i);
454
- return new f(r, (s) => _(s));
459
+ headers: r,
460
+ query: i
461
+ }, t);
462
+ return new c(o, (a) => v(a));
455
463
  }
456
464
  /**
457
465
  * The endpoint provides comprehensive information about a specified entity. An entity represents a collection of information pertaining to a specific data type and is defined by a key-value pair. You can use various data types such as blogs, events, or any other relevant data. However, in order to access an entity, it must be properly configured within the nitro config.
458
466
  * Find entity by uniqueid
459
467
  */
460
- async entityByUniqueid(t, i) {
461
- return await (await this.entityByUniqueidRaw(t, i)).value();
468
+ async entityByUniqueid(n, t) {
469
+ return await (await this.entityByUniqueidRaw(n, t)).value();
462
470
  }
463
471
  }
464
- class pe extends p {
472
+ class ce extends d {
465
473
  /**
466
474
  * This endpoint allows you to retrieve the designated homepage of a website. Alternatively, you can utilize the pages endpoint by specifying an empty slug parameter to achieve the same result. By using either of these methods, you can effectively access the desired homepage of the website.
467
475
  * Get Home
468
476
  */
469
- async homeRaw(t) {
470
- const i = {}, o = {};
471
- this.configuration && this.configuration.apiKey && (i.token = this.configuration.apiKey("token"));
472
- const a = await this.request({
477
+ async homeRaw(n, t) {
478
+ const i = {};
479
+ n.lang != null && (i.lang = n.lang);
480
+ const r = {};
481
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
482
+ const o = await this.request({
473
483
  path: "/pages/home",
474
484
  method: "GET",
475
- headers: o,
485
+ headers: r,
476
486
  query: i
477
487
  }, t);
478
- return new f(a, (r) => b(r));
488
+ return new c(o, (a) => m(a));
479
489
  }
480
490
  /**
481
491
  * This endpoint allows you to retrieve the designated homepage of a website. Alternatively, you can utilize the pages endpoint by specifying an empty slug parameter to achieve the same result. By using either of these methods, you can effectively access the desired homepage of the website.
482
492
  * Get Home
483
493
  */
484
- async home(t) {
485
- return await (await this.homeRaw(t)).value();
494
+ async home(n = {}, t) {
495
+ return await (await this.homeRaw(n, t)).value();
486
496
  }
487
497
  /**
488
498
  * This endpoint retrieves comprehensive information from a specified page using either a slug or a path. The slug refers to a unique identifier for the page, while the path is the slug with a leading slash. By providing either the slug or the path as input, the function will gather all the relevant details associated with the page.
489
499
  * Get Page by slug
490
500
  */
491
- async pageRaw(t, i) {
492
- const o = {};
493
- t.slug !== void 0 && (o.slug = t.slug);
494
- const a = {};
495
- this.configuration && this.configuration.apiKey && (o.token = this.configuration.apiKey("token"));
496
- const r = await this.request({
501
+ async pageRaw(n, t) {
502
+ const i = {};
503
+ n.lang != null && (i.lang = n.lang), n.slug != null && (i.slug = n.slug);
504
+ const r = {};
505
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
506
+ const o = await this.request({
497
507
  path: "/pages",
498
508
  method: "GET",
499
- headers: a,
500
- query: o
501
- }, i);
502
- return new f(r, (s) => b(s));
509
+ headers: r,
510
+ query: i
511
+ }, t);
512
+ return new c(o, (a) => m(a));
503
513
  }
504
514
  /**
505
515
  * This endpoint retrieves comprehensive information from a specified page using either a slug or a path. The slug refers to a unique identifier for the page, while the path is the slug with a leading slash. By providing either the slug or the path as input, the function will gather all the relevant details associated with the page.
506
516
  * Get Page by slug
507
517
  */
508
- async page(t = {}, i) {
509
- return await (await this.pageRaw(t, i)).value();
518
+ async page(n = {}, t) {
519
+ return await (await this.pageRaw(n, t)).value();
510
520
  }
511
521
  }
512
- class ye extends p {
522
+ class de extends d {
513
523
  /**
514
524
  * This endpoint offers a powerful capability to search through the websites sitemap, encompassing both pages and entities. With this endpoint, users can efficiently explore and retrieve information from your sitemap by creating a paginated search experience.
515
525
  * Get Search by query
516
526
  */
517
- async searchRaw(t, i) {
518
- if (t.query === null || t.query === void 0)
519
- throw new v("query", "Required parameter requestParameters.query was null or undefined when calling search.");
520
- const o = {};
521
- t.query !== void 0 && (o.query = t.query);
522
- const a = {};
523
- this.configuration && this.configuration.apiKey && (o.token = this.configuration.apiKey("token"));
524
- const r = await this.request({
527
+ async searchRaw(n, t) {
528
+ if (n.query == null)
529
+ throw new g(
530
+ "query",
531
+ 'Required parameter "query" was null or undefined when calling search().'
532
+ );
533
+ const i = {};
534
+ n.lang != null && (i.lang = n.lang), n.query != null && (i.query = n.query);
535
+ const r = {};
536
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
537
+ const o = await this.request({
525
538
  path: "/search",
526
539
  method: "GET",
527
- headers: a,
528
- query: o
529
- }, i);
530
- return new f(r, (s) => s.map(T));
540
+ headers: r,
541
+ query: i
542
+ }, t);
543
+ return new c(o, (a) => a.map(k));
531
544
  }
532
545
  /**
533
546
  * This endpoint offers a powerful capability to search through the websites sitemap, encompassing both pages and entities. With this endpoint, users can efficiently explore and retrieve information from your sitemap by creating a paginated search experience.
534
547
  * Get Search by query
535
548
  */
536
- async search(t, i) {
537
- return await (await this.searchRaw(t, i)).value();
549
+ async search(n, t) {
550
+ return await (await this.searchRaw(n, t)).value();
538
551
  }
539
552
  }
540
- class he extends p {
553
+ class fe extends d {
541
554
  /**
542
555
  * This endpoint provides comprehensive data for generating the sitemap. It encompasses all the necessary information, including pages from containers, as well as all entities that have been mapped.
543
556
  * Get Sitemap
544
557
  */
545
- async sitemapRaw(t) {
546
- const i = {}, o = {};
547
- this.configuration && this.configuration.apiKey && (i.token = this.configuration.apiKey("token"));
548
- const a = await this.request({
558
+ async sitemapRaw(n, t) {
559
+ const i = {};
560
+ n.lang != null && (i.lang = n.lang);
561
+ const r = {};
562
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
563
+ const o = await this.request({
549
564
  path: "/sitemap",
550
565
  method: "GET",
551
- headers: o,
566
+ headers: r,
552
567
  query: i
553
568
  }, t);
554
- return new f(a, (r) => r.map(T));
569
+ return new c(o, (a) => a.map(k));
555
570
  }
556
571
  /**
557
572
  * This endpoint provides comprehensive data for generating the sitemap. It encompasses all the necessary information, including pages from containers, as well as all entities that have been mapped.
558
573
  * Get Sitemap
559
574
  */
560
- async sitemap(t) {
561
- return await (await this.sitemapRaw(t)).value();
575
+ async sitemap(n = {}, t) {
576
+ return await (await this.sitemapRaw(n, t)).value();
562
577
  }
563
578
  }
564
- class ge extends p {
579
+ class pe extends d {
565
580
  /**
566
581
  * The Version API endpoint offers a highly efficient solution for evaluating the current caching status of your application\'s caching mechanism. This functionality allows you to cache the entire application configuration and page responses indefinitely. However, utilizing this endpoint enables you to assess the validity of the cache by sending a request to determine its current status. This caching endpoint is specifically designed for optimal performance when compared to the configuration endpoint, which requires more thorough evaluation and encompasses a substantial response body.
567
582
  * Get Version Information
568
583
  */
569
- async versionRaw(t) {
570
- const i = {}, o = {};
571
- this.configuration && this.configuration.apiKey && (i.token = this.configuration.apiKey("token"));
572
- const a = await this.request({
584
+ async versionRaw(n, t) {
585
+ const i = {};
586
+ n.lang != null && (i.lang = n.lang);
587
+ const r = {};
588
+ this.configuration && this.configuration.apiKey && (i.token = await this.configuration.apiKey("token"));
589
+ const o = await this.request({
573
590
  path: "/version",
574
591
  method: "GET",
575
- headers: o,
592
+ headers: r,
576
593
  query: i
577
594
  }, t);
578
- return new f(a, (r) => ce(r));
595
+ return new c(o, (a) => ae(a));
579
596
  }
580
597
  /**
581
598
  * The Version API endpoint offers a highly efficient solution for evaluating the current caching status of your application\'s caching mechanism. This functionality allows you to cache the entire application configuration and page responses indefinitely. However, utilizing this endpoint enables you to assess the validity of the cache by sending a request to determine its current status. This caching endpoint is specifically designed for optimal performance when compared to the configuration endpoint, which requires more thorough evaluation and encompasses a substantial response body.
582
599
  * Get Version Information
583
600
  */
584
- async version(t) {
585
- return await (await this.versionRaw(t)).value();
601
+ async version(n = {}, t) {
602
+ return await (await this.versionRaw(n, t)).value();
586
603
  }
587
604
  }
588
- const ve = /[\p{Lu}]/u, me = /[\p{Ll}]/u, q = /^[\p{Lu}](?![\p{Lu}])/gu, U = /([\p{Alpha}\p{N}_]|$)/u, w = /[_.\- ]+/, we = new RegExp("^" + w.source), E = new RegExp(w.source + U.source, "gu"), R = new RegExp("\\d+" + U.source, "gu"), _e = (e, t, i, o) => {
589
- let a = !1, r = !1, s = !1, u = !1;
590
- for (let c = 0; c < e.length; c++) {
591
- const l = e[c];
592
- u = c > 2 ? e[c - 3] === "-" : !0, a && ve.test(l) ? (e = e.slice(0, c) + "-" + e.slice(c), a = !1, s = r, r = !0, c++) : r && s && me.test(l) && (!u || o) ? (e = e.slice(0, c - 1) + "-" + e.slice(c - 1), s = r, r = !1, a = !0) : (a = t(l) === l && i(l) !== l, s = r, r = i(l) === l && t(l) !== l);
605
+ const ge = /[\p{Lu}]/u, ye = /[\p{Ll}]/u, w = /^[\p{Lu}](?![\p{Lu}])/gu, T = /([\p{Alpha}\p{N}_]|$)/u, h = /[_.\- ]+/, he = new RegExp("^" + h.source), _ = new RegExp(h.source + T.source, "gu"), b = new RegExp("\\d+" + T.source, "gu"), ve = (e, n, t, i) => {
606
+ let r = !1, o = !1, a = !1, l = !1;
607
+ for (let s = 0; s < e.length; s++) {
608
+ const u = e[s];
609
+ l = s > 2 ? e[s - 3] === "-" : !0, r && ge.test(u) ? (e = e.slice(0, s) + "-" + e.slice(s), r = !1, a = o, o = !0, s++) : o && a && ye.test(u) && (!l || i) ? (e = e.slice(0, s - 1) + "-" + e.slice(s - 1), a = o, o = !1, r = !0) : (r = n(u) === u && t(u) !== u, a = o, o = t(u) === u && n(u) !== u);
593
610
  }
594
611
  return e;
595
- }, be = (e, t) => (q.lastIndex = 0, e.replace(q, (i) => t(i))), qe = (e, t) => (E.lastIndex = 0, R.lastIndex = 0, e.replace(E, (i, o) => t(o)).replace(R, (i) => t(i)));
596
- function Ee(e, t) {
612
+ }, me = (e, n) => (w.lastIndex = 0, e.replace(w, (t) => n(t))), we = (e, n) => (_.lastIndex = 0, b.lastIndex = 0, e.replace(_, (t, i) => n(i)).replace(b, (t) => n(t)));
613
+ function _e(e, n) {
597
614
  if (!(typeof e == "string" || Array.isArray(e)))
598
615
  throw new TypeError("Expected the input to be `string | string[]`");
599
- if (t = {
616
+ if (n = {
600
617
  pascalCase: !1,
601
618
  preserveConsecutiveUppercase: !1,
602
- ...t
603
- }, Array.isArray(e) ? e = e.map((r) => r.trim()).filter((r) => r.length).join("-") : e = e.trim(), e.length === 0)
619
+ ...n
620
+ }, Array.isArray(e) ? e = e.map((o) => o.trim()).filter((o) => o.length).join("-") : e = e.trim(), e.length === 0)
604
621
  return "";
605
- const i = t.locale === !1 ? (r) => r.toLowerCase() : (r) => r.toLocaleLowerCase(t.locale), o = t.locale === !1 ? (r) => r.toUpperCase() : (r) => r.toLocaleUpperCase(t.locale);
606
- return e.length === 1 ? w.test(e) ? "" : t.pascalCase ? o(e) : i(e) : (e !== i(e) && (e = _e(e, i, o, t.preserveConsecutiveUppercase)), e = e.replace(we, ""), e = t.preserveConsecutiveUppercase ? be(e, i) : i(e), t.pascalCase && (e = o(e.charAt(0)) + e.slice(1)), qe(e, o));
622
+ const t = n.locale === !1 ? (o) => o.toLowerCase() : (o) => o.toLocaleLowerCase(n.locale), i = n.locale === !1 ? (o) => o.toUpperCase() : (o) => o.toLocaleUpperCase(n.locale);
623
+ return e.length === 1 ? h.test(e) ? "" : n.pascalCase ? i(e) : t(e) : (e !== t(e) && (e = ve(e, t, i, n.preserveConsecutiveUppercase)), e = e.replace(he, ""), e = n.preserveConsecutiveUppercase ? me(e, t) : t(e), n.pascalCase && (e = i(e.charAt(0)) + e.slice(1)), we(e, i));
607
624
  }
608
- function Re(e, t, i) {
609
- const o = "virtual:flyo-components", a = "\0" + o;
625
+ function be(e, n, t) {
626
+ const i = "virtual:flyo-components", r = "\0" + i;
610
627
  return {
611
628
  name: "vite-plugin-flyo-components",
612
- async resolveId(r) {
613
- if (r === o)
614
- return a;
629
+ async resolveId(o) {
630
+ if (o === i)
631
+ return r;
615
632
  },
616
- async load(r) {
617
- if (r === a) {
618
- const s = [];
619
- for (const [c, l] of Object.entries(t)) {
620
- const h = await this.resolve(
621
- "/" + e + "/" + l + ".astro"
633
+ async load(o) {
634
+ if (o === r) {
635
+ const a = [];
636
+ for (const [s, u] of Object.entries(
637
+ n
638
+ )) {
639
+ const p = await this.resolve(
640
+ "/" + e + "/" + u + ".astro"
641
+ );
642
+ p && a.push(
643
+ `export { default as ${_e(s)} } from "${p.id}"`
622
644
  );
623
- h && s.push(`export { default as ${Ee(c)} } from "${h.id}"`);
624
645
  }
625
- let u = null;
626
- return i && (u = await this.resolve(
627
- "/" + e + "/" + i + ".astro"
628
- )), u ? s.push(`export { default as fallback } from "${u.id}"`) : s.push('export { default as fallback } from "@flyo/nitro-astro/FallbackComponent.astro"'), s.join(";");
646
+ let l = null;
647
+ return t && (l = await this.resolve(
648
+ "/" + e + "/" + t + ".astro"
649
+ )), l ? a.push(
650
+ `export { default as fallback } from "${l.id}"`
651
+ ) : a.push(
652
+ 'export { default as fallback } from "@flyo/nitro-astro/FallbackComponent.astro"'
653
+ ), a.join(";");
629
654
  }
630
655
  }
631
656
  };
632
657
  }
633
- let Ce = Symbol("clean"), d = [], ke = (e, t) => {
634
- let i = [], o = {
635
- get() {
636
- return o.lc || o.listen(() => {
637
- })(), o.value;
638
- },
639
- l: t || 0,
640
- lc: 0,
641
- listen(a, r) {
642
- return o.lc = i.push(a, r || o.l) / 2, () => {
643
- let s = i.indexOf(a);
644
- ~s && (i.splice(s, 2), --o.lc || o.off());
645
- };
646
- },
647
- notify(a, r) {
648
- let s = !d.length;
649
- for (let u = 0; u < i.length; u += 2)
650
- d.push(
651
- i[u],
652
- i[u + 1],
653
- o.value,
654
- a,
655
- r
656
- );
657
- if (s) {
658
- for (let u = 0; u < d.length; u += 5) {
659
- let c;
660
- for (let l = u + 1; !c && (l += 5) < d.length; )
661
- d[l] < d[u + 1] && (c = d.push(
662
- d[u],
663
- d[u + 1],
664
- d[u + 2],
665
- d[u + 3],
666
- d[u + 4]
667
- ));
668
- c || d[u](
669
- d[u + 2],
670
- d[u + 3],
671
- d[u + 4]
672
- );
673
- }
674
- d.length = 0;
675
- }
676
- },
677
- /* It will be called on last listener unsubscribing.
678
- We will redefine it in onMount and onStop. */
679
- off() {
680
- },
681
- set(a) {
682
- let r = o.value;
683
- r !== a && (o.value = a, o.notify(r));
684
- },
685
- subscribe(a, r) {
686
- let s = o.listen(a, r);
687
- return a(o.value), s;
688
- },
689
- value: e
690
- };
691
- return process.env.NODE_ENV !== "production" && (o[Ce] = () => {
692
- i = [], o.lc = 0, o.off();
693
- }), o;
694
- };
695
- function y() {
696
- return globalThis.flyoNitroInstance || console.error("The Flyo Typescript Configuration has not been initialized correctly"), globalThis.flyoNitroInstance;
658
+ function Ce() {
659
+ return globalThis.flyoNitroInstance || console.error(
660
+ "The Flyo Typescript Configuration has not been initialized correctly"
661
+ ), globalThis.flyoNitroInstance;
697
662
  }
698
- function Ae() {
699
- return new de(y());
663
+ function f() {
664
+ return Ce().config;
700
665
  }
701
- const g = ke(!1);
702
- async function Ie() {
703
- return g.get() || g.set(await Ae().config()), g.get();
666
+ async function qe(e) {
667
+ return await e.locals.config;
704
668
  }
705
- function Se() {
706
- return new fe(y());
669
+ function Re() {
670
+ return new se(f());
707
671
  }
708
- function xe() {
709
- return new pe(y());
672
+ function Ae() {
673
+ return new ue(f());
710
674
  }
711
- function Te() {
712
- return new ye(y());
675
+ function Ie() {
676
+ return new ce(f());
713
677
  }
714
- function Ue() {
715
- return new he(y());
678
+ function ke() {
679
+ return new de(f());
716
680
  }
717
- function je() {
718
- return new ge(y());
681
+ function Te() {
682
+ return new fe(f());
719
683
  }
720
- function Pe(e) {
684
+ function xe() {
685
+ return new pe(f());
686
+ }
687
+ function Se(e) {
721
688
  return {
722
689
  "data-flyo-block-uid": e.uid
723
690
  };
724
691
  }
725
- function Le(e) {
726
- const t = {
692
+ const Ee = `
693
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 163.4 88.5">
694
+ <style type="text/css">
695
+ .st8{fill:#FFFFFF;}
696
+ </style>
697
+ <g id="Ebene_1">
698
+ <g>
699
+ <path class="st8" d="M49,56.7c-0.5-0.3-0.8-0.7-1.2-1.2c-0.4-0.5-0.6-1.2-0.7-1.8c-0.1-0.6-0.2-1.2-0.2-1.8V18.7
700
+ c0-5.2-1.6-9.4-4.8-12.6c-3.2-3.2-8.2-4.8-15-4.8c-6.1,0-10.9,1.5-14.3,4.6C9.4,8.9,7.7,13.3,7.7,19v6.4H1.5V35h6.1v32.1h11.9V35
701
+ h7.7v-9.6h-7.7c0-8.3,0.6-9.4,1.8-11.3c1.2-1.8,3.2-2.8,6.1-2.8c1.5,0,2.7,0.3,3.7,0.8c1,0.5,1.7,1.2,2.3,2.1
702
+ c0.6,0.9,0.9,1.9,1.2,3.1c0.2,1.2,0.3,2.4,0.3,3.7v36.8c0,1.4,0.3,2.6,0.8,3.8c0.5,1.2,1.3,2.2,2.3,3.2c1,0.9,2.1,1.6,3.5,2.1
703
+ c10.1,3,18.5-1.1,18.5-1.1l-4-10.1C52,58.4,49.6,57,49,56.7z"/>
704
+ <path class="st8" d="M146.3,34.6c-1.1-2.9-2.7-5.5-4.9-7.7c-2.1-2.2-4.7-4-7.7-5.3c-3-1.3-6.4-2-10.2-2c-3.8,0-7.2,0.7-10.2,2
705
+ c-3,1.3-5.6,3.1-7.7,5.3c-2.1,2.2-3.7,4.8-4.9,7.7c-1.1,2.9-1.7,6-1.7,9.3c0,3.2,0.6,6.3,1.7,9.2c1.1,2.9,2.7,5.5,4.9,7.7
706
+ c2.1,2.2,4.7,4,7.7,5.3c3,1.3,6.4,2,10.2,2c3.8,0,7.2-0.7,10.2-2c3-1.3,5.6-3.1,7.7-5.3c2.1-2.2,3.7-4.8,4.8-7.7
707
+ c1.1-2.9,1.7-6,1.7-9.2C148,40.6,147.4,37.5,146.3,34.6z M134.8,49.5c-0.6,1.7-1.5,3.2-2.6,4.5c-1.1,1.2-2.4,2.2-3.9,2.9
708
+ c-1.5,0.7-3.1,1-4.8,1c-1.7,0-3.3-0.3-4.8-1c-1.5-0.7-2.8-1.6-3.9-2.9c-1.1-1.2-2-2.7-2.6-4.4s-0.9-3.6-0.9-5.7
709
+ c0-2,0.3-3.9,0.9-5.6c0.6-1.7,1.5-3.2,2.6-4.5c1.1-1.2,2.4-2.2,3.9-2.9c1.5-0.7,3.1-1.1,4.8-1.1c1.7,0,3.3,0.3,4.8,1
710
+ c1.5,0.7,2.8,1.6,3.9,2.9c1.1,1.2,2,2.7,2.6,4.5c0.6,1.7,0.9,3.6,0.9,5.6C135.8,45.8,135.4,47.7,134.8,49.5z"/>
711
+ <path class="st8" d="M88.2,20.4L77,56.8L64.4,20.4H52.1l18.4,46.6c-0.1,0.9-0.2,1.7-0.4,2.6c-0.1,0.4-0.2,0.7-0.3,1.1c0,0,0,0,0,0
712
+ c-0.5,1.2-1,2.4-1.7,3.3c-0.1,0.1-0.1,0.2-0.2,0.3c0,0.1-0.1,0.1-0.2,0.2c-0.8,1-1.8,1.9-3,2.7c0.7,1.7,1.4,3.3,2.2,5.4l1.8,4.7
713
+ c0.3-0.1,0.6-0.3,0.9-0.4c0.3-0.2,0.6-0.3,0.9-0.4c0.2-0.1,0.4-0.2,0.5-0.3c1.3-0.7,2.3-1.4,3.4-2.3c0,0,0.1-0.1,0.1-0.1
714
+ c0.1-0.1,0.3-0.2,0.4-0.4c1.2-1.1,2.2-2.1,3-3.2c1.4-1.8,2.5-3.7,3.3-5.9c0.7-1.8,1.2-3.7,1.4-5.6c0-0.3,0.1-0.6,0.2-1l16.6-47.3
715
+ H88.2z"/>
716
+ <path class="st8" d="M161.3,62.6c-0.3-0.8-0.8-1.6-1.4-2.2c-0.6-0.6-1.3-1.1-2.2-1.5c-0.9-0.4-1.8-0.6-2.9-0.6
717
+ c-1.1,0-2.1,0.2-2.9,0.6c-0.9,0.4-1.6,0.9-2.2,1.5c-0.6,0.6-1.1,1.4-1.4,2.2c-0.3,0.8-0.5,1.7-0.5,2.6c0,0.9,0.2,1.8,0.5,2.6
718
+ c0.3,0.8,0.8,1.6,1.4,2.2c0.6,0.6,1.3,1.1,2.2,1.5c0.9,0.4,1.8,0.6,2.9,0.6c1.1,0,2.1-0.2,2.9-0.6c0.9-0.4,1.6-0.9,2.2-1.5
719
+ c0.6-0.6,1.1-1.4,1.4-2.2c0.3-0.8,0.5-1.7,0.5-2.6C161.7,64.3,161.6,63.4,161.3,62.6z"/>
720
+ </g>
721
+ </g>
722
+ </svg>
723
+ `;
724
+ function Ue(e) {
725
+ const n = {
727
726
  accessToken: !1,
728
727
  liveEdit: !1,
729
728
  fallbackComponent: null,
730
729
  componentsDir: "src/components/flyo",
730
+ serverCacheHeaderTtl: 1200,
731
+ // 20 minutes
732
+ clientCacheHeaderTtl: 900,
733
+ // 15 minutes
731
734
  ...e
732
735
  };
733
- return t.liveEdit === "true" ? t.liveEdit = !0 : t.liveEdit === "false" && (t.liveEdit = !1), {
736
+ return n.liveEdit === "true" ? n.liveEdit = !0 : n.liveEdit === "false" && (n.liveEdit = !1), {
734
737
  name: "@flyo/nitro-astro",
735
738
  hooks: {
736
- "astro:config:setup": ({ injectScript: i, updateConfig: o, injectRoute: a }) => {
739
+ "astro:config:setup": ({
740
+ injectScript: t,
741
+ updateConfig: i,
742
+ injectRoute: r,
743
+ addMiddleware: o,
744
+ addDevToolbarApp: a
745
+ }) => {
737
746
  a({
747
+ id: "flyo-nitro",
748
+ name: "Flyo Nitro",
749
+ //icon: 'lightbulb',
750
+ icon: Ee,
751
+ //icon: '<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><ellipse cx="100" cy="60" rx="90" ry="50" fill="#F4A460" /><circle cx="70" cy="45" r="5" fill="white" /><circle cx="90" cy="30" r="5" fill="white" /><circle cx="110" cy="45" r="5" fill="white" /><circle cx="130" cy="30" r="5" fill="white" /><circle cx="150" cy="45" r="5" fill="white" /><path d="M30 90 Q60 75, 90 90 T150 90 Q160 80, 180 90" fill="#228B22" /><rect x="30" y="90" width="140" height="15" fill="#FF6347" /><rect x="30" y="105" width="140" height="15" fill="#FFD700" /><rect x="30" y="120" width="140" height="25" fill="#8B4513" /><ellipse cx="100" cy="160" rx="90" ry="30" fill="#F4A460" /></svg>',
752
+ entrypoint: "@flyo/nitro-astro/toolbar.ts"
753
+ }), r({
738
754
  pattern: "sitemap.xml",
739
755
  entrypoint: "@flyo/nitro-astro/sitemap.ts"
740
756
  }), o({
757
+ entrypoint: "@flyo/nitro-astro/middleware.ts",
758
+ order: "post"
759
+ }), i({
741
760
  image: {
742
761
  service: {
743
762
  entrypoint: "@flyo/nitro-astro/cdn.ts"
@@ -745,25 +764,33 @@ function Le(e) {
745
764
  },
746
765
  vite: {
747
766
  plugins: [
748
- Re(
767
+ be(
749
768
  e.componentsDir,
750
- e.components,
769
+ e.components || {},
751
770
  e.fallbackComponent
752
771
  )
753
772
  ]
754
773
  }
755
- }), i(
774
+ }), t(
756
775
  "page-ssr",
757
776
  `
758
777
  import { Configuration } from '@flyo/nitro-typescript'
759
778
 
760
779
  var defaultConfig = new Configuration({
761
- apiKey: '${t.accessToken}'
780
+ apiKey: '${n.accessToken}'
762
781
  })
763
782
 
764
- globalThis.flyoNitroInstance = defaultConfig;
783
+ globalThis.flyoNitroInstance = {
784
+ config: defaultConfig,
785
+ options: {
786
+ liveEdit: ${n.liveEdit},
787
+ componentsDir: '${n.componentsDir}',
788
+ clientCacheHeaderTtl: ${n.clientCacheHeaderTtl},
789
+ serverCacheHeaderTtl: ${n.serverCacheHeaderTtl}
790
+ }
791
+ };
765
792
  `
766
- ), t.liveEdit && i(
793
+ ), n.liveEdit && t(
767
794
  "page",
768
795
  `
769
796
  window.addEventListener("message", (event) => {
@@ -803,14 +830,15 @@ function Le(e) {
803
830
  };
804
831
  }
805
832
  export {
806
- Le as default,
807
- Pe as editableBlock,
808
- Ie as useConfig,
809
- Ae as useConfigApi,
810
- y as useConfiguration,
811
- Se as useEntitiesApi,
812
- xe as usePagesApi,
813
- Te as useSearchApi,
814
- Ue as useSitemapApi,
815
- je as useVersionApi
833
+ Ue as default,
834
+ Se as editableBlock,
835
+ qe as useConfig,
836
+ Re as useConfigApi,
837
+ f as useConfiguration,
838
+ Ae as useEntitiesApi,
839
+ Ce as useFlyoIntegration,
840
+ Ie as usePagesApi,
841
+ ke as useSearchApi,
842
+ Te as useSitemapApi,
843
+ xe as useVersionApi
816
844
  };