@blocklet/pages-kit-inner-components 0.6.96 → 0.6.98
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/lib/cjs/chunks/site-state-5h791IH4.js +1 -0
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/chunks/{site-state-zENZxyOj.js → site-state-DGHmLp10.js} +294 -292
- package/lib/es/resources.js +1 -1
- package/lib/es/site-state.js +1 -1
- package/package.json +17 -17
- package/lib/cjs/chunks/site-state-D2b0QUgx.js +0 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { getYjsValue as V, syncedStore as
|
|
3
|
-
import * as
|
|
4
|
-
import { setPageDataSource as
|
|
5
|
-
import { getRouteMetaDataByOptionIds as
|
|
1
|
+
import { d as Fe, l as f, I as tt, c as st, m as ot, b as at } from "./components-DLwSTd_N.js";
|
|
2
|
+
import { getYjsValue as V, syncedStore as nt } from "@syncedstore/core";
|
|
3
|
+
import * as N from "yjs";
|
|
4
|
+
import { setPageDataSource as rt } from "@blocklet/pages-kit/utils/data-source";
|
|
5
|
+
import { getRouteMetaDataByOptionIds as it, generateParamCombinations as Ie } from "@blocklet/pages-kit/utils/route";
|
|
6
6
|
import Ee from "lodash/cloneDeep";
|
|
7
7
|
import E from "@blocklet/sdk/lib/config";
|
|
8
|
-
import { mkdtempSync as
|
|
8
|
+
import { mkdtempSync as ct, existsSync as $, readFileSync as J, renameSync as je, mkdirSync as _, rmSync as Ge, writeFileSync as te, copyFileSync as lt, lstatSync as x, readdirSync as pt, createWriteStream as ut } from "fs";
|
|
9
9
|
import { join as b, basename as k, dirname as L } from "path";
|
|
10
|
-
import { nextId as
|
|
11
|
-
import { unzipSection as
|
|
12
|
-
import { getComponentDependencies as
|
|
13
|
-
import { getComponentWebEndpoint as
|
|
14
|
-
import { reactive as
|
|
10
|
+
import { nextId as De } from "@blocklet/pages-kit/utils/common";
|
|
11
|
+
import { unzipSection as dt } from "@blocklet/pages-kit/utils/page-model";
|
|
12
|
+
import { getComponentDependencies as ft } from "@blocklet/pages-kit/utils/property";
|
|
13
|
+
import { getComponentWebEndpoint as mt, getResources as gt, call as ht } from "@blocklet/sdk/lib/component";
|
|
14
|
+
import { reactive as yt } from "@reactivedata/reactive";
|
|
15
15
|
import { globSync as se } from "glob";
|
|
16
16
|
import * as de from "lib0/decoding";
|
|
17
17
|
import * as D from "lib0/encoding";
|
|
18
|
-
import
|
|
18
|
+
import xe from "lodash/debounce";
|
|
19
19
|
import be from "lodash/get";
|
|
20
20
|
import Ae from "lodash/isEmpty";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
21
|
+
import Te from "lodash/set";
|
|
22
|
+
import St from "lodash/union";
|
|
23
23
|
import { LRUCache as we } from "lru-cache";
|
|
24
|
-
import
|
|
25
|
-
import { DataTypes as R, Sequelize as
|
|
26
|
-
import { pipeline as
|
|
27
|
-
import { x as
|
|
28
|
-
import { withoutTrailingSlash as
|
|
24
|
+
import It from "p-limit";
|
|
25
|
+
import { DataTypes as R, Sequelize as Et, Model as Be, Op as Pe } from "sequelize";
|
|
26
|
+
import { pipeline as bt } from "stream/promises";
|
|
27
|
+
import { x as At } from "tar";
|
|
28
|
+
import { withoutTrailingSlash as Oe, withLeadingSlash as Ve, joinURL as Y } from "ufo";
|
|
29
29
|
import wt from "wait-on";
|
|
30
|
-
import { Awareness as Pt, encodeAwarenessUpdate as
|
|
30
|
+
import { Awareness as Pt, encodeAwarenessUpdate as ke, removeAwarenessStates as Ot, applyAwarenessUpdate as Ct } from "y-protocols/awareness";
|
|
31
31
|
import { writeUpdate as vt, writeSyncStep1 as Rt, readSyncMessage as jt } from "y-protocols/sync";
|
|
32
32
|
import * as B from "yaml";
|
|
33
|
-
import { m as
|
|
33
|
+
import { m as Le } from "./html-DOgzvdOd.js";
|
|
34
34
|
import "sqlite3";
|
|
35
35
|
import "@blocklet/pages-kit/types/state";
|
|
36
36
|
const Dt = R.sqlite.DATE.parse;
|
|
37
37
|
R.sqlite.DATE.parse = (t, e) => typeof t == "number" ? new Date(t) : Dt(t, e);
|
|
38
|
-
const F = new
|
|
38
|
+
const F = new Et({
|
|
39
39
|
dialect: "sqlite",
|
|
40
|
-
storage:
|
|
40
|
+
storage: Fe,
|
|
41
41
|
benchmark: process.env.ENABLE_SEQUELIZE_BENCHMARK === "true",
|
|
42
42
|
retry: {
|
|
43
43
|
match: [/SQLITE_BUSY/],
|
|
@@ -76,16 +76,16 @@ let ge = null;
|
|
|
76
76
|
ge && clearInterval(ge);
|
|
77
77
|
ge = setInterval(
|
|
78
78
|
async () => {
|
|
79
|
-
f.info("Start cleanupSqliteMemory"), await Tt(F,
|
|
79
|
+
f.info("Start cleanupSqliteMemory"), await Tt(F, Fe), f.info("End cleanupSqliteMemory");
|
|
80
80
|
},
|
|
81
81
|
60 * 1e3 * 10
|
|
82
82
|
// 10 minutes
|
|
83
83
|
);
|
|
84
|
-
const kt = "z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o",
|
|
85
|
-
class
|
|
84
|
+
const kt = "z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o", Ue = "page", he = "trigger-reload-project-resource", ze = kt, Lt = "z2qa7BQdkEb3TwYyEYC1psK6uvmGnHSUHt5RM", Ut = "z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o";
|
|
85
|
+
class Ce extends Be {
|
|
86
86
|
// Foreign key to Component
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
Ce.init(
|
|
89
89
|
{
|
|
90
90
|
id: {
|
|
91
91
|
type: R.UUID,
|
|
@@ -104,22 +104,22 @@ Oe.init(
|
|
|
104
104
|
},
|
|
105
105
|
{ sequelize: F, tableName: "ProjectComponents", timestamps: !1 }
|
|
106
106
|
);
|
|
107
|
-
const
|
|
107
|
+
const Mt = "SLUG_INVALID", K = (t) => ({
|
|
108
108
|
error: "slugInvalid",
|
|
109
|
-
code:
|
|
109
|
+
code: Mt,
|
|
110
110
|
field: "slug",
|
|
111
111
|
message: t
|
|
112
|
-
}),
|
|
112
|
+
}), $t = {
|
|
113
113
|
error: "slugRequired",
|
|
114
114
|
code: "SLUG_REQUIRED",
|
|
115
115
|
field: "slug",
|
|
116
116
|
message: () => "Project slug is required"
|
|
117
|
-
},
|
|
117
|
+
}, Nt = {
|
|
118
118
|
error: "slugAlreadyExists",
|
|
119
119
|
code: "SLUG_EXISTS",
|
|
120
120
|
field: "slug",
|
|
121
121
|
message: (t) => `Project slug "${t}" already exists`
|
|
122
|
-
},
|
|
122
|
+
}, _t = [
|
|
123
123
|
/\.\./,
|
|
124
124
|
// Directory traversal
|
|
125
125
|
/<[^>]*>/,
|
|
@@ -135,13 +135,13 @@ const $t = "SLUG_INVALID", K = (t) => ({
|
|
|
135
135
|
// Control characters
|
|
136
136
|
/[^a-zA-Z0-9-_@/\\:]/
|
|
137
137
|
// Only allow specific characters
|
|
138
|
-
],
|
|
138
|
+
], Me = (t) => {
|
|
139
139
|
if (!t) return "";
|
|
140
140
|
if (t === "/") return "/";
|
|
141
|
-
const e =
|
|
142
|
-
return
|
|
141
|
+
const e = Oe(t);
|
|
142
|
+
return Ve(e) || "/";
|
|
143
143
|
}, Ft = (t) => t.did === Ut;
|
|
144
|
-
class U extends
|
|
144
|
+
class U extends Be {
|
|
145
145
|
static async getProjectByIdOrSlug(e, s) {
|
|
146
146
|
return e ? U.findOne({
|
|
147
147
|
where: {
|
|
@@ -159,20 +159,22 @@ class U extends xe {
|
|
|
159
159
|
if (e == null)
|
|
160
160
|
return null;
|
|
161
161
|
if (e === "")
|
|
162
|
-
return
|
|
163
|
-
const o =
|
|
164
|
-
if (
|
|
162
|
+
return $t;
|
|
163
|
+
const o = e === "/" ? "/" : Oe(Ve(e)), a = Me(o);
|
|
164
|
+
if (o !== "/" && o.endsWith("/"))
|
|
165
165
|
return K((r) => `Project slug "${r}" cannot end with /`);
|
|
166
|
-
if (/\/{2,}/.test(
|
|
166
|
+
if (/\/{2,}/.test(o))
|
|
167
167
|
return K((r) => `Project slug "${r}" cannot contain consecutive /`);
|
|
168
|
-
if (/\s/.test(
|
|
168
|
+
if (/\s/.test(o))
|
|
169
169
|
return K((r) => `Project slug "${r}" cannot contain whitespace`);
|
|
170
|
-
if (
|
|
170
|
+
if (_t.some((r) => r.test(o)))
|
|
171
171
|
return K((r) => `Project slug "${r}" contains invalid characters`);
|
|
172
|
-
if (E.components?.filter((r) => r.mountPoint && !Ft(r)).some((r) =>
|
|
172
|
+
if (E.components?.filter((r) => r.mountPoint && !Ft(r)).some((r) => Me(r.mountPoint) === a))
|
|
173
173
|
return K((r) => `Project slug "${r}" conflicts with existing blocklet`);
|
|
174
|
-
const
|
|
175
|
-
|
|
174
|
+
const c = await U.findOne({
|
|
175
|
+
where: { slug: o }
|
|
176
|
+
});
|
|
177
|
+
return c && c?.id !== s ? Nt : null;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
U.init(
|
|
@@ -279,7 +281,7 @@ U.init(
|
|
|
279
281
|
]
|
|
280
282
|
}
|
|
281
283
|
);
|
|
282
|
-
U.hasMany(
|
|
284
|
+
U.hasMany(Ce, {
|
|
283
285
|
foreignKey: "projectId",
|
|
284
286
|
as: "components"
|
|
285
287
|
});
|
|
@@ -288,8 +290,8 @@ function oe(t) {
|
|
|
288
290
|
e.some((s) => s.changes.keys.has("updatedAt") || s.changes.keys.has("publishedAt")) || t.set("updatedAt", (/* @__PURE__ */ new Date()).toISOString());
|
|
289
291
|
});
|
|
290
292
|
}
|
|
291
|
-
function
|
|
292
|
-
return
|
|
293
|
+
function qe() {
|
|
294
|
+
return ct(b(E.env.dataDir, "tmp-"));
|
|
293
295
|
}
|
|
294
296
|
function ae(t, e, s = []) {
|
|
295
297
|
return Array.isArray(t) ? t.flatMap((o, a) => ae(o, e, [...s, a])) : typeof t == "object" ? t === null ? [] : Object.entries(t).flatMap(([o, a]) => ae(a, e, [...s, o])) : e(t) ? [s] : [];
|
|
@@ -300,14 +302,14 @@ function T(t) {
|
|
|
300
302
|
function Gt(t) {
|
|
301
303
|
t.pages && Object.keys(t.pages).forEach((s) => {
|
|
302
304
|
const o = V(t.pages[s]);
|
|
303
|
-
o && o instanceof
|
|
305
|
+
o && o instanceof N.Map && oe(o);
|
|
304
306
|
});
|
|
305
307
|
const e = V(t.pages);
|
|
306
|
-
e && e instanceof
|
|
308
|
+
e && e instanceof N.Map && e.observe((s) => {
|
|
307
309
|
s.changes.keys.forEach((o, a) => {
|
|
308
310
|
if (o.action === "add") {
|
|
309
311
|
const n = V(t.pages[a]);
|
|
310
|
-
n && n instanceof
|
|
312
|
+
n && n instanceof N.Map && oe(n);
|
|
311
313
|
}
|
|
312
314
|
});
|
|
313
315
|
});
|
|
@@ -315,14 +317,14 @@ function Gt(t) {
|
|
|
315
317
|
function xt(t) {
|
|
316
318
|
t.routes && Object.keys(t.routes).forEach((s) => {
|
|
317
319
|
const o = V(t.routes?.[s]);
|
|
318
|
-
o && o instanceof
|
|
320
|
+
o && o instanceof N.Map && oe(o);
|
|
319
321
|
});
|
|
320
322
|
const e = V(t.routes);
|
|
321
|
-
e && e instanceof
|
|
323
|
+
e && e instanceof N.Map && e.observe((s) => {
|
|
322
324
|
s.changes.keys.forEach((o, a) => {
|
|
323
325
|
if (o.action === "add") {
|
|
324
326
|
const n = V(t.routes?.[a]);
|
|
325
|
-
n && n instanceof
|
|
327
|
+
n && n instanceof N.Map && oe(n);
|
|
326
328
|
}
|
|
327
329
|
});
|
|
328
330
|
});
|
|
@@ -331,8 +333,8 @@ function Bt(t, e) {
|
|
|
331
333
|
for (const s of e || Object.keys(t.routes || {})) {
|
|
332
334
|
let o = s, a = [];
|
|
333
335
|
if (s.includes("-")) {
|
|
334
|
-
const [n, ...
|
|
335
|
-
o = n, a =
|
|
336
|
+
const [n, ...c] = s.split("-");
|
|
337
|
+
o = n, a = c || [];
|
|
336
338
|
}
|
|
337
339
|
if (t.routes?.[o] !== void 0) {
|
|
338
340
|
t.routes[o].publishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -340,11 +342,11 @@ function Bt(t, e) {
|
|
|
340
342
|
if (!n || !n.params || n.params.length === 0)
|
|
341
343
|
continue;
|
|
342
344
|
if (s.includes("-") && a.length > 0) {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
+
const c = it(a, n);
|
|
346
|
+
c && (c.publishedAt = (/* @__PURE__ */ new Date()).toISOString());
|
|
345
347
|
}
|
|
346
348
|
if (!e) {
|
|
347
|
-
const
|
|
349
|
+
const c = Ie({
|
|
348
350
|
basePath: n.path,
|
|
349
351
|
params: n.params,
|
|
350
352
|
routeId: n.id,
|
|
@@ -354,8 +356,8 @@ function Bt(t, e) {
|
|
|
354
356
|
currentOptionIds: [],
|
|
355
357
|
result: []
|
|
356
358
|
});
|
|
357
|
-
for (const
|
|
358
|
-
|
|
359
|
+
for (const r of c)
|
|
360
|
+
r.routeMetaData ??= {}, r.routeMetaData.publishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
359
361
|
}
|
|
360
362
|
}
|
|
361
363
|
}
|
|
@@ -379,14 +381,14 @@ function fe({
|
|
|
379
381
|
publishedAt: a?.routeMetaData?.publishedAt ?? e.publishedAt,
|
|
380
382
|
isPublic: (a?.routeMetaData?.isPublic ?? e.isPublic) && e.isPublic
|
|
381
383
|
};
|
|
382
|
-
for (const
|
|
384
|
+
for (const c of s.supportedLocales) {
|
|
383
385
|
if (e.dataSource) {
|
|
384
|
-
let
|
|
385
|
-
a && (
|
|
386
|
-
const p = e.dataSource.pathDataMappings?.[
|
|
386
|
+
let r = e.id;
|
|
387
|
+
a && (r = a.paramOptionIds.join("-"));
|
|
388
|
+
const p = e.dataSource.pathDataMappings?.[r]?.dataCache?.[c.locale] ?? e.dataSource.pathDataMappings?.[r]?.dataCache?.[s.config.defaultLocale || "en"];
|
|
387
389
|
if (!p)
|
|
388
390
|
continue;
|
|
389
|
-
|
|
391
|
+
rt(n, s, c.locale, p);
|
|
390
392
|
}
|
|
391
393
|
a && a.routeMetaData && (a.routeMetaData.publishedAt = (/* @__PURE__ */ new Date()).toISOString());
|
|
392
394
|
}
|
|
@@ -402,15 +404,15 @@ const Vt = 60 * 60 * 1e3, W = new we({
|
|
|
402
404
|
});
|
|
403
405
|
function zt(t, e = []) {
|
|
404
406
|
let s = 0;
|
|
405
|
-
const o = Array.from(W.keys()), a = t.map((n) =>
|
|
407
|
+
const o = Array.from(W.keys()), a = t.map((n) => Oe(n));
|
|
406
408
|
for (const n of o)
|
|
407
|
-
for (const
|
|
408
|
-
if (
|
|
409
|
+
for (const c of a) {
|
|
410
|
+
if (Le(n, { currentPath: c })) {
|
|
409
411
|
W.delete(n), s++, f.info(`[Cache CLEAR] key: ${n}`);
|
|
410
412
|
break;
|
|
411
413
|
}
|
|
412
|
-
for (const
|
|
413
|
-
if (
|
|
414
|
+
for (const r of e)
|
|
415
|
+
if (Le(n, { currentPath: `/${r}${c}` })) {
|
|
414
416
|
W.delete(n), s++, f.info(`[Cache CLEAR] key: ${n}`);
|
|
415
417
|
break;
|
|
416
418
|
}
|
|
@@ -422,7 +424,7 @@ function qt() {
|
|
|
422
424
|
return W.clear(), f.info(`[Cache CLEAR ALL] cleared ${t} entries`), t;
|
|
423
425
|
}
|
|
424
426
|
E.events.on(E.Events.envUpdate, qt);
|
|
425
|
-
const { uploadToMediaKit: Kt } = require("@blocklet/uploader-server"),
|
|
427
|
+
const { uploadToMediaKit: Kt } = require("@blocklet/uploader-server"), ve = /^\w+(\w|-|\.)+\w+\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm)$/, X = /mediakit:\/\/([a-f0-9]{32}\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm))/i, $e = /mediakit:\/\/([a-f0-9]{32}\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm))/gi, Ht = 1e4, Jt = 3e4, Z = 0, me = 1, Yt = 0, Wt = 1, ye = E, H = b(process.env.BLOCKLET_DATA_DIR, "site-state"), $s = ["production", "draft"], Ns = ["production"];
|
|
426
428
|
function ne(t) {
|
|
427
429
|
return t?.replace(/\//g, "|") || "";
|
|
428
430
|
}
|
|
@@ -441,10 +443,10 @@ function Xt() {
|
|
|
441
443
|
resources: {}
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
|
-
class O extends
|
|
446
|
+
class O extends N.Doc {
|
|
445
447
|
constructor(e) {
|
|
446
|
-
super(), this.options = e,
|
|
447
|
-
|
|
448
|
+
super(), this.options = e, $(this.draftYjsFilePath) && N.applyUpdate(this, J(this.draftYjsFilePath)), this.syncedStore = yt(
|
|
449
|
+
nt(
|
|
448
450
|
{
|
|
449
451
|
pages: {},
|
|
450
452
|
pageIds: [],
|
|
@@ -480,7 +482,7 @@ class O extends _.Doc {
|
|
|
480
482
|
throw new Error("Should provide project context");
|
|
481
483
|
try {
|
|
482
484
|
const s = b(H, e), o = b(H, `@del-${e}`);
|
|
483
|
-
|
|
485
|
+
je(s, o);
|
|
484
486
|
} catch (s) {
|
|
485
487
|
f.error("Failed to safe delete project state dir:", s);
|
|
486
488
|
}
|
|
@@ -514,10 +516,10 @@ class O extends _.Doc {
|
|
|
514
516
|
attributes: ["productionState"]
|
|
515
517
|
});
|
|
516
518
|
if (Ae(s?.productionState)) {
|
|
517
|
-
const o = b(H, e, "production"), a = await
|
|
519
|
+
const o = b(H, e, "production"), a = await He(o, { includeResources: !0 }) ?? Xt();
|
|
518
520
|
if (!a?.config?.defaultLocale) {
|
|
519
521
|
a.config ??= {};
|
|
520
|
-
const n = ye.env.languages?.map((
|
|
522
|
+
const n = ye.env.languages?.map((c) => ({ locale: c.code, name: c.name })) || [];
|
|
521
523
|
a.config.defaultLocale = n[0]?.locale;
|
|
522
524
|
}
|
|
523
525
|
return a;
|
|
@@ -550,11 +552,11 @@ class O extends _.Doc {
|
|
|
550
552
|
}
|
|
551
553
|
async setState(e, s) {
|
|
552
554
|
const o = await ts(s, { exportAssets: !1, includeResources: !0 }), a = this.getPublishDir(e);
|
|
553
|
-
if (
|
|
555
|
+
if (_(L(a), { recursive: !0 }), Ge(a, { force: !0, recursive: !0 }), je(o, a), e === "production") {
|
|
554
556
|
const n = k(this.options.path);
|
|
555
557
|
O.pageUrlMapCache.delete(n);
|
|
556
|
-
const
|
|
557
|
-
await U.update({ productionState:
|
|
558
|
+
const c = Ee(s);
|
|
559
|
+
await U.update({ productionState: c }, { where: { id: n } });
|
|
558
560
|
}
|
|
559
561
|
}
|
|
560
562
|
getPublishDir(e) {
|
|
@@ -575,10 +577,10 @@ class O extends _.Doc {
|
|
|
575
577
|
p.delete(y);
|
|
576
578
|
}));
|
|
577
579
|
}
|
|
578
|
-
const
|
|
579
|
-
D.writeVarUint(
|
|
580
|
-
const
|
|
581
|
-
this.conns.forEach((p, y) => this.send(y,
|
|
580
|
+
const c = D.createEncoder();
|
|
581
|
+
D.writeVarUint(c, me), D.writeVarUint8Array(c, ke(this.awareness, n));
|
|
582
|
+
const r = D.toUint8Array(c);
|
|
583
|
+
this.conns.forEach((p, y) => this.send(y, r));
|
|
582
584
|
};
|
|
583
585
|
updateHandler = (e) => {
|
|
584
586
|
const s = D.createEncoder();
|
|
@@ -587,30 +589,30 @@ class O extends _.Doc {
|
|
|
587
589
|
this.conns.forEach((a, n) => this.send(n, o));
|
|
588
590
|
};
|
|
589
591
|
ensureDataStructure = () => {
|
|
590
|
-
const { supportedLocales: e, pages: s, pageIds: o, config: a, routes: n, routeIds:
|
|
592
|
+
const { supportedLocales: e, pages: s, pageIds: o, config: a, routes: n, routeIds: c } = this.syncedStore;
|
|
591
593
|
{
|
|
592
|
-
const
|
|
594
|
+
const r = new Set(Object.keys(s));
|
|
593
595
|
let p = 0;
|
|
594
596
|
for (; p < o.length; ) {
|
|
595
597
|
const y = o[p];
|
|
596
|
-
|
|
598
|
+
r.has(y) ? (r.delete(y), p++) : o.splice(p, 1);
|
|
597
599
|
}
|
|
598
600
|
}
|
|
599
601
|
{
|
|
600
|
-
const
|
|
602
|
+
const r = new Set(Object.keys(n));
|
|
601
603
|
let p = 0;
|
|
602
|
-
for (; p <
|
|
603
|
-
const y =
|
|
604
|
-
|
|
604
|
+
for (; p < c.length; ) {
|
|
605
|
+
const y = c[p];
|
|
606
|
+
r.has(y) ? (r.delete(y), p++) : c.splice(p, 1);
|
|
605
607
|
}
|
|
606
608
|
}
|
|
607
|
-
e.splice(0, e.length), e.push(...ye.env.languages.map((
|
|
609
|
+
e.splice(0, e.length), e.push(...ye.env.languages.map((r) => ({ locale: r.code, name: r.name }))), a.defaultLocale = e[0]?.locale;
|
|
608
610
|
{
|
|
609
|
-
let
|
|
611
|
+
let r = 0;
|
|
610
612
|
const p = /* @__PURE__ */ new Set();
|
|
611
|
-
for (;
|
|
612
|
-
const { locale: y } = e[
|
|
613
|
-
p.has(y) ? e.splice(
|
|
613
|
+
for (; r < e.length; ) {
|
|
614
|
+
const { locale: y } = e[r];
|
|
615
|
+
p.has(y) ? e.splice(r, 1) : (r++, p.add(y));
|
|
614
616
|
}
|
|
615
617
|
}
|
|
616
618
|
};
|
|
@@ -651,8 +653,8 @@ class O extends _.Doc {
|
|
|
651
653
|
f.info(`[SiteState] cancelled scheduled release for project ${e}`);
|
|
652
654
|
}
|
|
653
655
|
}
|
|
654
|
-
autoSave =
|
|
655
|
-
|
|
656
|
+
autoSave = xe(() => {
|
|
657
|
+
_(L(this.draftYjsFilePath), { recursive: !0 }), te(this.draftYjsFilePath, N.encodeStateAsUpdate(this));
|
|
656
658
|
}, Ht);
|
|
657
659
|
save = ({ flush: e = !1 } = {}) => {
|
|
658
660
|
this.autoSave(), e && this.autoSave.flush();
|
|
@@ -667,30 +669,30 @@ class O extends _.Doc {
|
|
|
667
669
|
const o = JSON.parse(JSON.stringify(s));
|
|
668
670
|
e.config.fontFamily ??= {};
|
|
669
671
|
const a = o.config?.fontFamily, n = e.config?.fontFamily;
|
|
670
|
-
e.config.fontFamily.title = a?.title || n?.title, e.config.fontFamily.description = a?.description || n?.description, await new Promise((
|
|
672
|
+
e.config.fontFamily.title = a?.title || n?.title, e.config.fontFamily.description = a?.description || n?.description, await new Promise((c, r) => {
|
|
671
673
|
this.transact(async () => {
|
|
672
674
|
try {
|
|
673
675
|
const p = await _e(e, s);
|
|
674
|
-
|
|
676
|
+
c(p);
|
|
675
677
|
} catch (p) {
|
|
676
|
-
|
|
678
|
+
r(p);
|
|
677
679
|
}
|
|
678
680
|
});
|
|
679
681
|
});
|
|
680
682
|
};
|
|
681
683
|
clearPageCacheForRoutes = async (e, s) => {
|
|
682
684
|
const o = k(this.options.path), n = (await U.findByPk(o))?.slug || o;
|
|
683
|
-
let
|
|
684
|
-
(!
|
|
685
|
-
const
|
|
685
|
+
let c = e;
|
|
686
|
+
(!c || c.length === 0) && (c = s.pageIds ?? []), f.info(`[SiteState] clearing page cache for project ${o}, routes:`, c || []);
|
|
687
|
+
const r = s.supportedLocales.map((A) => A.locale), p = [], y = c.filter((A) => s.pageIds?.includes(A));
|
|
686
688
|
for (const A of y) {
|
|
687
689
|
const I = s.pages[A].slug;
|
|
688
690
|
n && n !== o && (n === "/" ? p.push(I) : p.push(`/${n}${I}`)), p.push(`/${o}${I}`);
|
|
689
691
|
}
|
|
690
692
|
if (p.length > 0)
|
|
691
693
|
try {
|
|
692
|
-
const A = zt(p,
|
|
693
|
-
f.info(`[SiteState] cleared ${A} page cache entries for project ${o}, routes:`,
|
|
694
|
+
const A = zt(p, r);
|
|
695
|
+
f.info(`[SiteState] cleared ${A} page cache entries for project ${o}, routes:`, c);
|
|
694
696
|
} catch {
|
|
695
697
|
}
|
|
696
698
|
O.pageUrlMapCache.delete(o);
|
|
@@ -722,8 +724,8 @@ class O extends _.Doc {
|
|
|
722
724
|
D.writeVarUint(a, Z), Rt(a, this), this.send(e, D.toUint8Array(a));
|
|
723
725
|
const n = this.awareness.getStates();
|
|
724
726
|
if (n.size > 0) {
|
|
725
|
-
const
|
|
726
|
-
D.writeVarUint(
|
|
727
|
+
const c = D.createEncoder();
|
|
728
|
+
D.writeVarUint(c, me), D.writeVarUint8Array(c, ke(this.awareness, Array.from(n.keys()))), this.send(e, D.toUint8Array(c));
|
|
727
729
|
}
|
|
728
730
|
}
|
|
729
731
|
};
|
|
@@ -752,10 +754,10 @@ class O extends _.Doc {
|
|
|
752
754
|
s ? o = [s] : o = await this.getProjectIds();
|
|
753
755
|
let a = {};
|
|
754
756
|
if (e === "production" && o?.length) {
|
|
755
|
-
const n = new Map(o?.map((
|
|
756
|
-
for (const
|
|
757
|
-
const
|
|
758
|
-
|
|
757
|
+
const n = new Map(o?.map((c) => [c, !0]) || []);
|
|
758
|
+
for (const c of o) {
|
|
759
|
+
const r = O.pageUrlMapCache.get(c);
|
|
760
|
+
r && (a = { ...a, ...r }, n.delete(c));
|
|
759
761
|
}
|
|
760
762
|
o = Array.from(n.keys());
|
|
761
763
|
}
|
|
@@ -768,35 +770,35 @@ class O extends _.Doc {
|
|
|
768
770
|
}
|
|
769
771
|
});
|
|
770
772
|
await Promise.all(
|
|
771
|
-
n?.map(async (
|
|
772
|
-
const
|
|
773
|
+
n?.map(async (c) => {
|
|
774
|
+
const r = c.id, p = c.slug || r, y = {}, A = e === "production" && c?.productionState ? c.productionState : await O.getStateByProjectId(c.id, e), j = St(
|
|
773
775
|
E.env.languages?.map((u) => u.code) || [],
|
|
774
776
|
A.supportedLocales?.map((u) => u.locale) || []
|
|
775
|
-
), I = (u,
|
|
777
|
+
), I = (u, l) => {
|
|
776
778
|
p && (y[Y("/", p, u)] = {
|
|
777
|
-
...
|
|
779
|
+
...l,
|
|
778
780
|
shouldRedirect: !0,
|
|
779
781
|
mainPage: !0
|
|
780
|
-
}), y[Y("/",
|
|
781
|
-
...
|
|
782
|
+
}), y[Y("/", r, u)] = {
|
|
783
|
+
...l,
|
|
782
784
|
shouldRedirect: !0,
|
|
783
785
|
mainPage: !0
|
|
784
786
|
};
|
|
785
787
|
for (const g of j) {
|
|
786
|
-
const C = { ...
|
|
787
|
-
y[Y("/", g,
|
|
788
|
+
const C = { ...l, locale: g };
|
|
789
|
+
y[Y("/", g, r, u)] = C, p && (y[Y("/", g, p, u)] = C);
|
|
788
790
|
}
|
|
789
791
|
};
|
|
790
792
|
if (e === "draft")
|
|
791
793
|
for (const u of A.routeIds || []) {
|
|
792
|
-
const
|
|
793
|
-
if (!
|
|
794
|
-
if (
|
|
794
|
+
const l = A?.routes?.[u];
|
|
795
|
+
if (!l) continue;
|
|
796
|
+
if (l.params && l.params.length > 0) {
|
|
795
797
|
const m = Ie({
|
|
796
|
-
basePath:
|
|
797
|
-
params:
|
|
798
|
-
routeId:
|
|
799
|
-
paramsOptions:
|
|
798
|
+
basePath: l.path,
|
|
799
|
+
params: l.params,
|
|
800
|
+
routeId: l.id,
|
|
801
|
+
paramsOptions: l.paramsOptions,
|
|
800
802
|
currentIndex: 0,
|
|
801
803
|
currentParams: [],
|
|
802
804
|
currentOptionIds: [],
|
|
@@ -804,40 +806,40 @@ class O extends _.Doc {
|
|
|
804
806
|
});
|
|
805
807
|
for (const d of m) {
|
|
806
808
|
const h = d.path, w = {
|
|
807
|
-
projectId:
|
|
809
|
+
projectId: r,
|
|
808
810
|
projectSlug: p,
|
|
809
811
|
pageSlug: h,
|
|
810
|
-
pageId:
|
|
812
|
+
pageId: l.displayTemplateId || "",
|
|
811
813
|
routeId: u,
|
|
812
814
|
// default locale
|
|
813
815
|
defaultLocale: j?.[0],
|
|
814
816
|
locales: j,
|
|
815
817
|
publishedAt: A.config.publishedAt,
|
|
816
|
-
isPublic:
|
|
818
|
+
isPublic: l.isPublic && d?.routeMetaData?.isPublic
|
|
817
819
|
};
|
|
818
820
|
I(h, w);
|
|
819
821
|
}
|
|
820
822
|
}
|
|
821
|
-
const g =
|
|
822
|
-
projectId:
|
|
823
|
+
const g = l.path, C = {
|
|
824
|
+
projectId: r,
|
|
823
825
|
projectSlug: p,
|
|
824
826
|
pageSlug: g,
|
|
825
|
-
pageId:
|
|
827
|
+
pageId: l.displayTemplateId || "",
|
|
826
828
|
routeId: u,
|
|
827
829
|
// default locale
|
|
828
830
|
defaultLocale: j?.[0],
|
|
829
831
|
locales: j,
|
|
830
832
|
publishedAt: A.config.publishedAt,
|
|
831
|
-
isPublic:
|
|
833
|
+
isPublic: l.isPublic
|
|
832
834
|
};
|
|
833
835
|
I(g, C);
|
|
834
836
|
}
|
|
835
837
|
for (const u of A.pageIds || []) {
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
838
|
+
const l = A.pages[u];
|
|
839
|
+
if (!l || e === "production" && !l.isPublic)
|
|
838
840
|
continue;
|
|
839
|
-
const g =
|
|
840
|
-
projectId:
|
|
841
|
+
const g = l.slug, C = c.slug || r, m = {
|
|
842
|
+
projectId: r,
|
|
841
843
|
projectSlug: C,
|
|
842
844
|
pageSlug: g,
|
|
843
845
|
pageId: u,
|
|
@@ -845,19 +847,19 @@ class O extends _.Doc {
|
|
|
845
847
|
defaultLocale: j?.[0],
|
|
846
848
|
locales: j,
|
|
847
849
|
publishedAt: A.config.publishedAt,
|
|
848
|
-
isPublic:
|
|
849
|
-
templateConfig:
|
|
850
|
+
isPublic: l.isPublic,
|
|
851
|
+
templateConfig: l.templateConfig
|
|
850
852
|
};
|
|
851
853
|
I(g, m);
|
|
852
854
|
}
|
|
853
|
-
e === "production" && O.pageUrlMapCache.set(
|
|
855
|
+
e === "production" && O.pageUrlMapCache.set(r, y), a = { ...a, ...y };
|
|
854
856
|
})
|
|
855
857
|
);
|
|
856
858
|
}
|
|
857
859
|
return a;
|
|
858
860
|
}
|
|
859
861
|
getDocumentSize() {
|
|
860
|
-
return
|
|
862
|
+
return N.encodeStateAsUpdate(this).byteLength;
|
|
861
863
|
}
|
|
862
864
|
static getInstancesSizeInfo() {
|
|
863
865
|
const e = [];
|
|
@@ -897,11 +899,11 @@ class O extends _.Doc {
|
|
|
897
899
|
s.map((n) => n.projectId)
|
|
898
900
|
);
|
|
899
901
|
let a = 0;
|
|
900
|
-
for (const { projectId: n, instance:
|
|
902
|
+
for (const { projectId: n, instance: c } of s)
|
|
901
903
|
try {
|
|
902
|
-
f.info(`[SiteState] releasing instance due to periodic check: ${n}`),
|
|
903
|
-
} catch (
|
|
904
|
-
f.error(`[SiteState] failed to release instance ${n} during periodic check:`,
|
|
904
|
+
f.info(`[SiteState] releasing instance due to periodic check: ${n}`), c.destroy(), a++;
|
|
905
|
+
} catch (r) {
|
|
906
|
+
f.error(`[SiteState] failed to release instance ${n} during periodic check:`, r);
|
|
905
907
|
}
|
|
906
908
|
f.info(
|
|
907
909
|
`[SiteState] periodic check completed: ${a}/${s.length} instances released successfully`
|
|
@@ -910,7 +912,7 @@ class O extends _.Doc {
|
|
|
910
912
|
}
|
|
911
913
|
}
|
|
912
914
|
async function Qt(t, e, s) {
|
|
913
|
-
if (!t ||
|
|
915
|
+
if (!t || !$(t) || !x(t).isFile())
|
|
914
916
|
return null;
|
|
915
917
|
let o = s[t];
|
|
916
918
|
return o || (o = (async () => {
|
|
@@ -925,15 +927,15 @@ async function Qt(t, e, s) {
|
|
|
925
927
|
})(), s[t] = o), o;
|
|
926
928
|
}
|
|
927
929
|
const Zt = async (t, e) => {
|
|
928
|
-
const s = k(t), o = await
|
|
929
|
-
name:
|
|
930
|
+
const s = k(t), o = await ht({
|
|
931
|
+
name: ze,
|
|
930
932
|
path: Y("/uploads", s),
|
|
931
933
|
responseType: "stream",
|
|
932
934
|
method: "GET"
|
|
933
935
|
});
|
|
934
936
|
if (o.status >= 200 && o.status < 400) {
|
|
935
|
-
const a =
|
|
936
|
-
await
|
|
937
|
+
const a = ut(e);
|
|
938
|
+
await bt(o.data, a);
|
|
937
939
|
} else
|
|
938
940
|
throw new Error(`download asset failed ${o.status}`);
|
|
939
941
|
}, es = async (t, e) => {
|
|
@@ -947,20 +949,20 @@ const Zt = async (t, e) => {
|
|
|
947
949
|
})
|
|
948
950
|
);
|
|
949
951
|
};
|
|
950
|
-
function
|
|
951
|
-
return
|
|
952
|
+
function Ke(t) {
|
|
953
|
+
return ve.test(t) ? [t] : X.test(t) ? ($e.lastIndex = 0, Array.from(t.matchAll($e)).map((s) => s[1]).filter((s) => !!s)) : [];
|
|
952
954
|
}
|
|
953
955
|
async function ee(t, e, s) {
|
|
954
956
|
const { getFilename: o, exportAssets: a } = s, n = b(e, o(t));
|
|
955
|
-
if (
|
|
956
|
-
const
|
|
957
|
+
if (_(L(n), { recursive: !0 }), te(n, B.stringify(t)), a) {
|
|
958
|
+
const r = ae(
|
|
957
959
|
t,
|
|
958
|
-
(p) => typeof p == "string" && (
|
|
960
|
+
(p) => typeof p == "string" && (ve.test(p) || X.test(p))
|
|
959
961
|
).map((p) => {
|
|
960
962
|
const y = be(t, p);
|
|
961
|
-
return
|
|
963
|
+
return Ke(y);
|
|
962
964
|
}).flat().filter(Boolean);
|
|
963
|
-
await es(
|
|
965
|
+
await es(r, L(n));
|
|
964
966
|
}
|
|
965
967
|
}
|
|
966
968
|
const Se = new we({
|
|
@@ -968,29 +970,29 @@ const Se = new we({
|
|
|
968
970
|
ttl: 1 * 60 * 1e3
|
|
969
971
|
// 1 minute
|
|
970
972
|
});
|
|
971
|
-
async function
|
|
973
|
+
async function Ne(t, e, s) {
|
|
972
974
|
const o = ae(
|
|
973
975
|
t,
|
|
974
|
-
(
|
|
975
|
-
), a =
|
|
976
|
-
(
|
|
976
|
+
(r) => typeof r == "string" && (ve.test(r) || X.test(r))
|
|
977
|
+
), a = It(2), n = o.map(
|
|
978
|
+
(r) => a(async () => {
|
|
977
979
|
try {
|
|
978
|
-
const p = be(t,
|
|
980
|
+
const p = be(t, r), y = Ke(p);
|
|
979
981
|
for (const A of y) {
|
|
980
|
-
const j = k(A), I = s.getFilePath(A,
|
|
981
|
-
if (
|
|
982
|
-
X.test(p) ||
|
|
982
|
+
const j = k(A), I = s.getFilePath(A, r), u = I ? `${I}:${j}` : j, l = Se.get(u);
|
|
983
|
+
if (l) {
|
|
984
|
+
X.test(p) || Te(t, r, l);
|
|
983
985
|
return;
|
|
984
986
|
}
|
|
985
987
|
const g = await Qt(I, j, e);
|
|
986
|
-
g && (X.test(p) ||
|
|
988
|
+
g && (X.test(p) || Te(t, r, g), Se.set(u, g));
|
|
987
989
|
}
|
|
988
990
|
} catch (p) {
|
|
989
|
-
f.error(`Failed to process upload for path ${
|
|
991
|
+
f.error(`Failed to process upload for path ${r.join(".")}:`, p.message || p.reason);
|
|
990
992
|
}
|
|
991
993
|
})
|
|
992
|
-
),
|
|
993
|
-
s.onFinish?.(
|
|
994
|
+
), c = await Promise.allSettled(n);
|
|
995
|
+
s.onFinish?.(c);
|
|
994
996
|
}
|
|
995
997
|
async function ts(t, {
|
|
996
998
|
exportAssets: e,
|
|
@@ -998,17 +1000,17 @@ async function ts(t, {
|
|
|
998
1000
|
componentIds: o = "all",
|
|
999
1001
|
rawConfig: a,
|
|
1000
1002
|
includeResources: n = !1,
|
|
1001
|
-
routeIds:
|
|
1003
|
+
routeIds: c = "all"
|
|
1002
1004
|
} = {}) {
|
|
1003
|
-
const
|
|
1005
|
+
const r = s === "all" ? t.pageIds : s, p = ft({
|
|
1004
1006
|
state: t,
|
|
1005
|
-
pageIds:
|
|
1007
|
+
pageIds: r,
|
|
1006
1008
|
componentIds: o === "all" ? Object.keys(t.components) : o
|
|
1007
1009
|
});
|
|
1008
1010
|
Object.entries(t.components).forEach(([i, S]) => {
|
|
1009
1011
|
S.data?.renderer?.type === "component-template" && p.push(i);
|
|
1010
1012
|
});
|
|
1011
|
-
const y =
|
|
1013
|
+
const y = c === "all" ? t.routeIds : c, A = (i) => ({
|
|
1012
1014
|
id: i.id,
|
|
1013
1015
|
name: i.name,
|
|
1014
1016
|
isTemplateSection: i.isTemplateSection ?? !1,
|
|
@@ -1061,9 +1063,9 @@ async function ts(t, {
|
|
|
1061
1063
|
const S = t.routes[i];
|
|
1062
1064
|
return S && I(S);
|
|
1063
1065
|
})
|
|
1064
|
-
),
|
|
1066
|
+
), l = T(
|
|
1065
1067
|
t.supportedLocales.map((i) => i.locale).flatMap(
|
|
1066
|
-
(i) =>
|
|
1068
|
+
(i) => r.map((S) => {
|
|
1067
1069
|
const v = t.pages[S];
|
|
1068
1070
|
return v && {
|
|
1069
1071
|
locale: i,
|
|
@@ -1072,13 +1074,13 @@ async function ts(t, {
|
|
|
1072
1074
|
};
|
|
1073
1075
|
})
|
|
1074
1076
|
)
|
|
1075
|
-
), g =
|
|
1076
|
-
|
|
1077
|
+
), g = qe(), C = b(g, "pages");
|
|
1078
|
+
_(C, { recursive: !0 });
|
|
1077
1079
|
const m = b(g, "components");
|
|
1078
|
-
|
|
1080
|
+
_(m, { recursive: !0 });
|
|
1079
1081
|
const d = b(g, "routes");
|
|
1080
|
-
|
|
1081
|
-
for (const { locale: i, slug: S, page: v } of
|
|
1082
|
+
_(d, { recursive: !0 });
|
|
1083
|
+
for (const { locale: i, slug: S, page: v } of l)
|
|
1082
1084
|
await ee(v, C, {
|
|
1083
1085
|
getFilename: () => `${ne(S) || "index"}.${i}.yml`,
|
|
1084
1086
|
exportAssets: e
|
|
@@ -1097,10 +1099,10 @@ async function ts(t, {
|
|
|
1097
1099
|
});
|
|
1098
1100
|
}
|
|
1099
1101
|
const h = b(g, ".blocklet/pages/pages.config.yml");
|
|
1100
|
-
|
|
1102
|
+
_(L(h), { recursive: !0 });
|
|
1101
1103
|
const w = {
|
|
1102
1104
|
pages: T(
|
|
1103
|
-
|
|
1105
|
+
r.map((i) => {
|
|
1104
1106
|
const S = t.pages[i];
|
|
1105
1107
|
return S && { id: i, slug: S.slug };
|
|
1106
1108
|
})
|
|
@@ -1137,32 +1139,32 @@ async function ts(t, {
|
|
|
1137
1139
|
const P = b(g, "config.source.json");
|
|
1138
1140
|
if (a && te(P, JSON.stringify(a)), n) {
|
|
1139
1141
|
const i = b(g, "resources"), S = b(i, "components");
|
|
1140
|
-
|
|
1142
|
+
_(S, { recursive: !0 });
|
|
1141
1143
|
for (const z of Object.keys(t?.resources?.components ?? {}).filter(
|
|
1142
|
-
(
|
|
1144
|
+
(M) => p.includes(M)
|
|
1143
1145
|
)) {
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1146
|
+
const M = t.resources?.components?.[z]?.component;
|
|
1147
|
+
M && await ee(M, S, {
|
|
1146
1148
|
getFilename: (q) => `${q.name || "unnamed"}.${q.id}.yml`,
|
|
1147
1149
|
exportAssets: e
|
|
1148
1150
|
});
|
|
1149
1151
|
}
|
|
1150
1152
|
const v = b(g, "chunks");
|
|
1151
|
-
|
|
1153
|
+
_(v, { recursive: !0 });
|
|
1152
1154
|
const G = ss();
|
|
1153
1155
|
for (const z of Object.keys(t?.resources?.components ?? {}).filter(
|
|
1154
|
-
(
|
|
1156
|
+
(M) => p.includes(M)
|
|
1155
1157
|
)) {
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
const q =
|
|
1158
|
+
const M = t.resources?.components?.[z]?.component;
|
|
1159
|
+
if (M && M.renderer?.type === "react-component") {
|
|
1160
|
+
const q = M.renderer?.chunks ?? [];
|
|
1159
1161
|
if (q?.length > 0)
|
|
1160
1162
|
for (const pe of q) {
|
|
1161
|
-
const
|
|
1163
|
+
const Re = b(v, pe), ue = G?.[pe];
|
|
1162
1164
|
try {
|
|
1163
|
-
ue &&
|
|
1164
|
-
} catch (
|
|
1165
|
-
f.error(`copy chunk ${pe} error`,
|
|
1165
|
+
ue && $(ue) && !$(Re) && lt(ue, Re);
|
|
1166
|
+
} catch (et) {
|
|
1167
|
+
f.error(`copy chunk ${pe} error`, et.message);
|
|
1166
1168
|
}
|
|
1167
1169
|
}
|
|
1168
1170
|
}
|
|
@@ -1170,18 +1172,18 @@ async function ts(t, {
|
|
|
1170
1172
|
}
|
|
1171
1173
|
return g;
|
|
1172
1174
|
}
|
|
1173
|
-
async function
|
|
1174
|
-
if (
|
|
1175
|
+
async function He(t, { importAssets: e, includeResources: s } = {}) {
|
|
1176
|
+
if (!$(t))
|
|
1175
1177
|
return null;
|
|
1176
1178
|
let o, a = !1;
|
|
1177
1179
|
try {
|
|
1178
|
-
x(t).isDirectory() ? o = t : /\.(tgz|gz|tar)$/.test(t) && (a = !0, o =
|
|
1179
|
-
const n = se("**/.blocklet/pages/pages.config.yml", { cwd: o, absolute: !0 }).at(0),
|
|
1180
|
+
x(t).isDirectory() ? o = t : /\.(tgz|gz|tar)$/.test(t) && (a = !0, o = qe(), await At({ file: t, C: o }));
|
|
1181
|
+
const n = se("**/.blocklet/pages/pages.config.yml", { cwd: o, absolute: !0 }).at(0), c = n && b(L(n), "../../pages"), r = n && b(L(n), "../../components"), p = n && b(L(n), "../../routes");
|
|
1180
1182
|
if (!n)
|
|
1181
1183
|
return null;
|
|
1182
1184
|
const y = B.parse(J(n).toString()), A = (m, d, h) => {
|
|
1183
1185
|
let w = b(m, `${d}${h ? `.${h}` : ""}.yml`);
|
|
1184
|
-
return (
|
|
1186
|
+
return (!$(w) || !x(w).isFile()) && (w = b(m, d, `index${h ? `.${h}` : ""}.yml`), !$(w) || !x(w)) ? null : B.parse(J(w).toString());
|
|
1185
1187
|
}, j = (m, d) => {
|
|
1186
1188
|
try {
|
|
1187
1189
|
const h = se(`*.${d}.yml`, { cwd: m, absolute: !0 })[0];
|
|
@@ -1192,23 +1194,23 @@ async function Ke(t, { importAssets: e, includeResources: s } = {}) {
|
|
|
1192
1194
|
return null;
|
|
1193
1195
|
}, I = (m, d) => {
|
|
1194
1196
|
let h = b(m, `${d}.yml`);
|
|
1195
|
-
return (
|
|
1197
|
+
return (!$(h) || !x(h).isFile()) && (h = b(m, d, "index.yml"), !$(h) || !x(h)) ? null : B.parse(J(h).toString());
|
|
1196
1198
|
}, u = T(
|
|
1197
1199
|
y.pages.map(({ slug: m }) => {
|
|
1198
1200
|
const d = T(
|
|
1199
1201
|
y.supportedLocales.map(({ locale: P }) => {
|
|
1200
|
-
const i =
|
|
1202
|
+
const i = c ? A(c, ne(m), P) : void 0;
|
|
1201
1203
|
if (i)
|
|
1202
1204
|
return { locale: P, page: i };
|
|
1203
|
-
const S =
|
|
1205
|
+
const S = c ? A(c, m, P) : void 0;
|
|
1204
1206
|
return S && { locale: P, page: S };
|
|
1205
1207
|
})
|
|
1206
1208
|
), h = d[0]?.page;
|
|
1207
1209
|
if (!h)
|
|
1208
1210
|
return null;
|
|
1209
|
-
const w = h.sections.map(
|
|
1211
|
+
const w = h.sections.map(dt);
|
|
1210
1212
|
return {
|
|
1211
|
-
id: h.id ||
|
|
1213
|
+
id: h.id || De(),
|
|
1212
1214
|
createdAt: h.createdAt,
|
|
1213
1215
|
updatedAt: h.updatedAt,
|
|
1214
1216
|
publishedAt: h.publishedAt,
|
|
@@ -1246,12 +1248,12 @@ async function Ke(t, { importAssets: e, includeResources: s } = {}) {
|
|
|
1246
1248
|
)
|
|
1247
1249
|
};
|
|
1248
1250
|
})
|
|
1249
|
-
),
|
|
1251
|
+
), l = T(
|
|
1250
1252
|
y?.routes?.map(({ path: m }) => {
|
|
1251
1253
|
const d = p ? I(p, ne(m)) : void 0;
|
|
1252
1254
|
return {
|
|
1253
1255
|
...d,
|
|
1254
|
-
id: d?.id ||
|
|
1256
|
+
id: d?.id || De(),
|
|
1255
1257
|
createdAt: d?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1256
1258
|
updatedAt: d?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1257
1259
|
publishedAt: (/* @__PURE__ */ new Date(0)).toISOString(),
|
|
@@ -1264,28 +1266,28 @@ async function Ke(t, { importAssets: e, includeResources: s } = {}) {
|
|
|
1264
1266
|
dataSource: d?.dataSource ?? {}
|
|
1265
1267
|
};
|
|
1266
1268
|
}) ?? []
|
|
1267
|
-
), g =
|
|
1269
|
+
), g = r ? T(y.components?.map(({ id: m }) => j(r, m)) ?? []) : [];
|
|
1268
1270
|
if (e) {
|
|
1269
1271
|
const m = (...d) => {
|
|
1270
1272
|
f.info(`[${a ? k(t) : k(b(t, "../../../../"))}] importAssets:`, ...d);
|
|
1271
1273
|
};
|
|
1272
1274
|
try {
|
|
1273
1275
|
m("wait image-bin api ready"), await wt({
|
|
1274
|
-
resources: [`${
|
|
1276
|
+
resources: [`${mt(tt)}/api/sdk/uploads`],
|
|
1275
1277
|
validateStatus: (w) => w >= 200 && w <= 500
|
|
1276
1278
|
}), m("image-bin api is ready");
|
|
1277
1279
|
const d = {}, h = {};
|
|
1278
1280
|
m("start to upload assets"), await Promise.allSettled([
|
|
1279
|
-
|
|
1280
|
-
getFilePath: (w) =>
|
|
1281
|
+
Ne(g, d, {
|
|
1282
|
+
getFilePath: (w) => r && b(r, w),
|
|
1281
1283
|
onFinish: (w) => {
|
|
1282
1284
|
m(`upload ${w.length} component assets`);
|
|
1283
1285
|
}
|
|
1284
1286
|
}),
|
|
1285
|
-
|
|
1287
|
+
Ne(u, h, {
|
|
1286
1288
|
getFilePath: (w, P) => {
|
|
1287
1289
|
const i = be(u, P.slice(0, 1));
|
|
1288
|
-
return
|
|
1290
|
+
return c && b(c, L(i.slug), w);
|
|
1289
1291
|
},
|
|
1290
1292
|
onFinish: (w) => {
|
|
1291
1293
|
m(`upload ${w.length} page assets`);
|
|
@@ -1312,13 +1314,13 @@ async function Ke(t, { importAssets: e, includeResources: s } = {}) {
|
|
|
1312
1314
|
pages: Object.fromEntries(u.map((m) => [m.id, m])),
|
|
1313
1315
|
config: y.config || {},
|
|
1314
1316
|
resources: C,
|
|
1315
|
-
routeIds:
|
|
1316
|
-
routes: Object.fromEntries(
|
|
1317
|
+
routeIds: l.map((m) => m.id),
|
|
1318
|
+
routes: Object.fromEntries(l.map((m) => [m.id, m])),
|
|
1317
1319
|
dataSourceIds: [],
|
|
1318
1320
|
dataSources: {}
|
|
1319
1321
|
};
|
|
1320
1322
|
} finally {
|
|
1321
|
-
a && o &&
|
|
1323
|
+
a && o && Ge(o, { force: !0, recursive: !0 });
|
|
1322
1324
|
}
|
|
1323
1325
|
}
|
|
1324
1326
|
async function _e(t, e, {
|
|
@@ -1328,15 +1330,15 @@ async function _e(t, e, {
|
|
|
1328
1330
|
publishMode: n = void 0
|
|
1329
1331
|
} = {}) {
|
|
1330
1332
|
try {
|
|
1331
|
-
n &&
|
|
1333
|
+
n && st(n);
|
|
1332
1334
|
} catch (I) {
|
|
1333
1335
|
f.error("clear preload page cache error", { error: I });
|
|
1334
1336
|
}
|
|
1335
|
-
const { pages:
|
|
1337
|
+
const { pages: c, pageIds: r, routeIds: p, routes: y, supportedLocales: A } = t;
|
|
1336
1338
|
if (n === "production") {
|
|
1337
1339
|
let I = s ?? [], u = null;
|
|
1338
|
-
for (const
|
|
1339
|
-
const g = y?.[
|
|
1340
|
+
for (const l of p ?? []) {
|
|
1341
|
+
const g = y?.[l];
|
|
1340
1342
|
if (g?.params && g?.params.length > 0 && g?.paramsOptions && g?.paramsOptions.length > 0) {
|
|
1341
1343
|
const C = Ie({
|
|
1342
1344
|
basePath: g.path,
|
|
@@ -1347,13 +1349,13 @@ async function _e(t, e, {
|
|
|
1347
1349
|
currentParams: [],
|
|
1348
1350
|
currentOptionIds: [],
|
|
1349
1351
|
result: []
|
|
1350
|
-
}), m = Object.fromEntries(C.map((d) => [`${
|
|
1351
|
-
u = { ...u || {}, ...m }, s || (I = [...I, ...C.map((d) => `${
|
|
1352
|
-
} else s || I.push(
|
|
1352
|
+
}), m = Object.fromEntries(C.map((d) => [`${l}-${d.paramOptionIds.join("-")}`, d]));
|
|
1353
|
+
u = { ...u || {}, ...m }, s || (I = [...I, ...C.map((d) => `${l}-${d.paramOptionIds.join("-")}`)]);
|
|
1354
|
+
} else s || I.push(l);
|
|
1353
1355
|
}
|
|
1354
1356
|
f.info("routeIds to be published: ", I);
|
|
1355
|
-
for (const
|
|
1356
|
-
let g =
|
|
1357
|
+
for (const l of I) {
|
|
1358
|
+
let g = l;
|
|
1357
1359
|
if (g.includes("-")) {
|
|
1358
1360
|
const [d] = g.split("-");
|
|
1359
1361
|
g = d;
|
|
@@ -1367,61 +1369,61 @@ async function _e(t, e, {
|
|
|
1367
1369
|
f.info("delete main route page", g);
|
|
1368
1370
|
continue;
|
|
1369
1371
|
}
|
|
1370
|
-
if (
|
|
1371
|
-
const d = e.pageIds.indexOf(
|
|
1372
|
-
d !== -1 && a && (e.pageIds.splice(d, 1), delete e.pages[
|
|
1372
|
+
if (l.includes("-") && !u?.[l]) {
|
|
1373
|
+
const d = e.pageIds.indexOf(l);
|
|
1374
|
+
d !== -1 && a && (e.pageIds.splice(d, 1), delete e.pages[l]), f.info("delete page", l);
|
|
1373
1375
|
continue;
|
|
1374
1376
|
}
|
|
1375
1377
|
if (!C.displayTemplateId) {
|
|
1376
|
-
f.info("no display template",
|
|
1378
|
+
f.info("no display template", l);
|
|
1377
1379
|
continue;
|
|
1378
1380
|
}
|
|
1379
|
-
const m =
|
|
1381
|
+
const m = c[C.displayTemplateId];
|
|
1380
1382
|
if (!m) {
|
|
1381
|
-
f.info("no template page",
|
|
1383
|
+
f.info("no template page", l);
|
|
1382
1384
|
continue;
|
|
1383
1385
|
}
|
|
1384
|
-
if (e.pageIds.includes(
|
|
1385
|
-
if (f.info("has need update page",
|
|
1386
|
-
e.pages[
|
|
1386
|
+
if (e.pageIds.includes(l)) {
|
|
1387
|
+
if (f.info("has need update page", l), o === "replace")
|
|
1388
|
+
e.pages[l] = fe({
|
|
1387
1389
|
page: m,
|
|
1388
1390
|
route: C,
|
|
1389
1391
|
state: t,
|
|
1390
|
-
routeId:
|
|
1391
|
-
routePathInfo: u?.[
|
|
1392
|
-
}), f.info("replace page",
|
|
1392
|
+
routeId: l,
|
|
1393
|
+
routePathInfo: u?.[l]
|
|
1394
|
+
}), f.info("replace page", l);
|
|
1393
1395
|
else if (o === "byUpdateTime") {
|
|
1394
1396
|
const d = e.pages[C.id];
|
|
1395
|
-
(!d || C.updatedAt && C.updatedAt > d.updatedAt) && (e.pages[
|
|
1397
|
+
(!d || C.updatedAt && C.updatedAt > d.updatedAt) && (e.pages[l] = fe({
|
|
1396
1398
|
page: m,
|
|
1397
1399
|
route: C,
|
|
1398
1400
|
state: t,
|
|
1399
|
-
routeId:
|
|
1400
|
-
routePathInfo: u?.[
|
|
1401
|
-
}), f.info("replace page by update time",
|
|
1401
|
+
routeId: l,
|
|
1402
|
+
routePathInfo: u?.[l]
|
|
1403
|
+
}), f.info("replace page by update time", l));
|
|
1402
1404
|
}
|
|
1403
1405
|
} else
|
|
1404
|
-
e.pageIds.push(
|
|
1406
|
+
e.pageIds.push(l), e.pages[l] = fe({
|
|
1405
1407
|
page: m,
|
|
1406
1408
|
route: C,
|
|
1407
1409
|
state: t,
|
|
1408
|
-
routeId:
|
|
1409
|
-
routePathInfo: u?.[
|
|
1410
|
-
}), f.info("add page",
|
|
1410
|
+
routeId: l,
|
|
1411
|
+
routePathInfo: u?.[l]
|
|
1412
|
+
}), f.info("add page", l);
|
|
1411
1413
|
}
|
|
1412
1414
|
if (a && !s)
|
|
1413
|
-
for (const
|
|
1414
|
-
I?.includes(
|
|
1415
|
+
for (const l of e.pageIds)
|
|
1416
|
+
I?.includes(l) || (delete e.pages[l], f.info("delete page", l)), e.pageIds = [...e.pageIds].filter((g) => I?.includes(g));
|
|
1415
1417
|
} else {
|
|
1416
|
-
for (const I of
|
|
1417
|
-
const u =
|
|
1418
|
+
for (const I of r) {
|
|
1419
|
+
const u = c[I];
|
|
1418
1420
|
if (u)
|
|
1419
1421
|
if (e.pageIds.includes(u.id)) {
|
|
1420
1422
|
if (o === "replace")
|
|
1421
1423
|
e.pages[u.id] = u;
|
|
1422
1424
|
else if (o === "byUpdateTime") {
|
|
1423
|
-
const
|
|
1424
|
-
(!
|
|
1425
|
+
const l = e.pages[u.id];
|
|
1426
|
+
(!l || u.updatedAt && u.updatedAt > l.updatedAt) && (e.pages[u.id] = u);
|
|
1425
1427
|
}
|
|
1426
1428
|
} else
|
|
1427
1429
|
e.pageIds.push(u.id), e.pages[u.id] = u;
|
|
@@ -1433,8 +1435,8 @@ async function _e(t, e, {
|
|
|
1433
1435
|
if (o === "replace")
|
|
1434
1436
|
e.routes[u.id] = u;
|
|
1435
1437
|
else if (o === "byUpdateTime") {
|
|
1436
|
-
const
|
|
1437
|
-
(!
|
|
1438
|
+
const l = e.routes[u.id];
|
|
1439
|
+
(!l || u.updatedAt && u.updatedAt > l.updatedAt) && (e.routes[u.id] = u);
|
|
1438
1440
|
}
|
|
1439
1441
|
} else
|
|
1440
1442
|
e.routeIds.push(u.id), e.routes[u.id] = u;
|
|
@@ -1447,19 +1449,19 @@ async function _e(t, e, {
|
|
|
1447
1449
|
j = Object.fromEntries(
|
|
1448
1450
|
await Promise.all(
|
|
1449
1451
|
Object.entries(j).map(async ([I, u]) => {
|
|
1450
|
-
const
|
|
1452
|
+
const l = await Je(u?.data);
|
|
1451
1453
|
return [
|
|
1452
1454
|
I,
|
|
1453
1455
|
{
|
|
1454
1456
|
...u,
|
|
1455
|
-
data:
|
|
1457
|
+
data: l
|
|
1456
1458
|
}
|
|
1457
1459
|
];
|
|
1458
1460
|
})
|
|
1459
1461
|
)
|
|
1460
1462
|
), Object.assign(e.components, j), Object.assign(e.config, JSON.parse(JSON.stringify(t.config))), Ae(t.resources.components) || (e.resources.components = JSON.parse(JSON.stringify(t.resources.components || {})));
|
|
1461
1463
|
}
|
|
1462
|
-
const
|
|
1464
|
+
const Je = ot(
|
|
1463
1465
|
async (t) => {
|
|
1464
1466
|
if (!Ae(t?.properties))
|
|
1465
1467
|
return t;
|
|
@@ -1467,7 +1469,7 @@ const He = st(
|
|
|
1467
1469
|
const { script: e, PROPERTIES_SCHEMA: s } = t?.renderer || {};
|
|
1468
1470
|
if (s || e && e.includes("PROPERTIES_SCHEMA"))
|
|
1469
1471
|
try {
|
|
1470
|
-
const o = await
|
|
1472
|
+
const o = await at(
|
|
1471
1473
|
e ?? "",
|
|
1472
1474
|
"PROPERTIES_SCHEMA",
|
|
1473
1475
|
t.id,
|
|
@@ -1490,28 +1492,28 @@ const He = st(
|
|
|
1490
1492
|
}
|
|
1491
1493
|
);
|
|
1492
1494
|
let re, Q, ie, ce;
|
|
1493
|
-
const
|
|
1495
|
+
const Ye = () => gt({
|
|
1494
1496
|
types: [
|
|
1495
|
-
{ did:
|
|
1496
|
-
{ did: Lt, type:
|
|
1497
|
+
{ did: ze, type: Ue },
|
|
1498
|
+
{ did: Lt, type: Ue }
|
|
1497
1499
|
]
|
|
1498
1500
|
}), ss = () => {
|
|
1499
|
-
const t =
|
|
1501
|
+
const t = Ye(), e = {};
|
|
1500
1502
|
return t.forEach((s) => {
|
|
1501
1503
|
const o = se("**/.blocklet/pages/pages.config.yml", { cwd: s.path, absolute: !0 }).at(0), a = o && b(L(o), "../../chunks");
|
|
1502
|
-
if (a &&
|
|
1503
|
-
const n =
|
|
1504
|
-
for (const
|
|
1505
|
-
e[
|
|
1504
|
+
if (a && $(a)) {
|
|
1505
|
+
const n = pt(a);
|
|
1506
|
+
for (const c of n)
|
|
1507
|
+
e[c] = b(a, c);
|
|
1506
1508
|
}
|
|
1507
1509
|
}), e;
|
|
1508
1510
|
};
|
|
1509
|
-
function
|
|
1511
|
+
function We() {
|
|
1510
1512
|
return re = (async () => {
|
|
1511
|
-
const t =
|
|
1513
|
+
const t = Ye();
|
|
1512
1514
|
Q = (await Promise.all(
|
|
1513
1515
|
t.map(async (s) => {
|
|
1514
|
-
const o = s.path ? await
|
|
1516
|
+
const o = s.path ? await He(s.path, { importAssets: !1 }) : void 0;
|
|
1515
1517
|
return o ? { blockletId: s.did, state: o, blockletTitle: s.title } : void 0;
|
|
1516
1518
|
})
|
|
1517
1519
|
)).filter((s) => !!s), ie = Q.reduce(
|
|
@@ -1535,7 +1537,7 @@ function Ye() {
|
|
|
1535
1537
|
ce = Object.fromEntries(
|
|
1536
1538
|
await Promise.all(
|
|
1537
1539
|
Object.entries(e).map(async ([s, o]) => {
|
|
1538
|
-
const a = await
|
|
1540
|
+
const a = await Je(o.component);
|
|
1539
1541
|
return [
|
|
1540
1542
|
s,
|
|
1541
1543
|
{
|
|
@@ -1549,9 +1551,9 @@ function Ye() {
|
|
|
1549
1551
|
})(), re;
|
|
1550
1552
|
}
|
|
1551
1553
|
function os(t) {
|
|
1552
|
-
const e =
|
|
1554
|
+
const e = xe(
|
|
1553
1555
|
async () => {
|
|
1554
|
-
await
|
|
1556
|
+
await We().catch((s) => {
|
|
1555
1557
|
f.error("load resource states error", { error: s });
|
|
1556
1558
|
}), await t?.({
|
|
1557
1559
|
states: Q,
|
|
@@ -1567,9 +1569,9 @@ function os(t) {
|
|
|
1567
1569
|
E.events.off(E.Events.componentAdded, e), E.events.off(E.Events.componentRemoved, e), E.events.off(E.Events.componentStarted, e), E.events.off(E.Events.componentStopped, e), E.events.off(E.Events.componentUpdated, e), E.events.off(he, e);
|
|
1568
1570
|
};
|
|
1569
1571
|
}
|
|
1570
|
-
const
|
|
1571
|
-
le[
|
|
1572
|
-
le[
|
|
1572
|
+
const Xe = Symbol.for("GLOBAL_RESOURCE_STATES_LISTENER_KEY"), Qe = Symbol.for("GLOBAL_ENV_UPDATE_LISTENER_KEY"), le = globalThis;
|
|
1573
|
+
le[Xe]?.();
|
|
1574
|
+
le[Xe] = os(async ({ pages: t, components: e }) => {
|
|
1573
1575
|
const s = await O.getProjectIds();
|
|
1574
1576
|
f.info(`start update resource states projects(${s.length})`, s), await Promise.race([
|
|
1575
1577
|
new Promise((o) => {
|
|
@@ -1579,7 +1581,7 @@ le[We] = os(async ({ pages: t, components: e }) => {
|
|
|
1579
1581
|
}),
|
|
1580
1582
|
Promise.all(
|
|
1581
1583
|
s.map(async (o) => {
|
|
1582
|
-
|
|
1584
|
+
Ze({
|
|
1583
1585
|
projectId: o,
|
|
1584
1586
|
pages: t,
|
|
1585
1587
|
components: e
|
|
@@ -1590,8 +1592,8 @@ le[We] = os(async ({ pages: t, components: e }) => {
|
|
|
1590
1592
|
f.error("update resource states failed:", o);
|
|
1591
1593
|
});
|
|
1592
1594
|
});
|
|
1593
|
-
le[
|
|
1594
|
-
le[
|
|
1595
|
+
le[Qe]?.();
|
|
1596
|
+
le[Qe] = () => {
|
|
1595
1597
|
const t = () => {
|
|
1596
1598
|
O.pageUrlMapCache.clear(), f.info("[Cache CLEAR ALL] clear all page url map cache by env update");
|
|
1597
1599
|
};
|
|
@@ -1609,7 +1611,7 @@ process.on("SIGINT", () => {
|
|
|
1609
1611
|
process.on("SIGTERM", () => {
|
|
1610
1612
|
O.stopPeriodicCheck(), process.exit(0);
|
|
1611
1613
|
});
|
|
1612
|
-
async function
|
|
1614
|
+
async function Ze({
|
|
1613
1615
|
projectId: t,
|
|
1614
1616
|
pages: e,
|
|
1615
1617
|
components: s
|
|
@@ -1622,10 +1624,10 @@ async function Qe({
|
|
|
1622
1624
|
if (o.syncedStore.resources.pages = e, (await U.findByPk(t))?.useAllResources)
|
|
1623
1625
|
o.syncedStore.resources.components = s;
|
|
1624
1626
|
else {
|
|
1625
|
-
const
|
|
1626
|
-
Object.entries(s || {}).filter(([p]) =>
|
|
1627
|
+
const c = (await Ce.findAll({ where: { projectId: t } })).map((p) => p.componentId), r = Object.fromEntries(
|
|
1628
|
+
Object.entries(s || {}).filter(([p]) => c.includes(p))
|
|
1627
1629
|
);
|
|
1628
|
-
o.syncedStore.resources.components =
|
|
1630
|
+
o.syncedStore.resources.components = r;
|
|
1629
1631
|
}
|
|
1630
1632
|
f.info(`update [${t}] resource states:`, {
|
|
1631
1633
|
pages: Object.keys(o.syncedStore.resources.pages || {}).length,
|
|
@@ -1633,35 +1635,35 @@ async function Qe({
|
|
|
1633
1635
|
});
|
|
1634
1636
|
}
|
|
1635
1637
|
async function as(t) {
|
|
1636
|
-
return
|
|
1638
|
+
return Ze({
|
|
1637
1639
|
projectId: t,
|
|
1638
1640
|
pages: ie,
|
|
1639
1641
|
components: ce
|
|
1640
1642
|
});
|
|
1641
1643
|
}
|
|
1642
|
-
async function
|
|
1644
|
+
async function _s() {
|
|
1643
1645
|
f.info("trigger reload all project resource"), E.events.emit(he);
|
|
1644
1646
|
}
|
|
1645
1647
|
async function Fs({
|
|
1646
1648
|
ensureLoaded: t = !0
|
|
1647
1649
|
} = {}) {
|
|
1648
|
-
return t && (re ??=
|
|
1650
|
+
return t && (re ??= We(), await re), { states: Q, pages: ie, components: ce };
|
|
1649
1651
|
}
|
|
1650
1652
|
export {
|
|
1651
|
-
|
|
1653
|
+
ze as C,
|
|
1652
1654
|
U as P,
|
|
1653
|
-
|
|
1655
|
+
Ue as R,
|
|
1654
1656
|
O as S,
|
|
1655
1657
|
H as a,
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
+
$s as b,
|
|
1659
|
+
Ns as c,
|
|
1658
1660
|
Xt as d,
|
|
1659
1661
|
Zt as e,
|
|
1660
1662
|
es as f,
|
|
1661
1663
|
Fs as g,
|
|
1662
|
-
|
|
1664
|
+
He as h,
|
|
1663
1665
|
os as i,
|
|
1664
|
-
|
|
1666
|
+
_s as j,
|
|
1665
1667
|
_e as m,
|
|
1666
1668
|
ts as t,
|
|
1667
1669
|
as as u
|