@blocklet/pages-kit-inner-components 0.4.132 → 0.4.133

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,47 +1,47 @@
1
1
  import { jsx as e, jsxs as A } from "react/jsx-runtime";
2
- import { d as G, e as le, g as ce, u as ue, c as me } from "./state-DGyH1TW3.js";
3
- import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
4
- import q from "@arcblock/ux/lib/Result";
5
- import { useHeaderState as pe } from "@blocklet/pages-kit/builtin/page/header";
6
- import { useColorConvert as de } from "@blocklet/pages-kit/contexts/color";
7
- import { setPageDataSource as K } from "@blocklet/pages-kit/utils/data-source";
8
- import { generateParamCombinations as ge } from "@blocklet/pages-kit/utils/route";
9
- import fe from "@blocklet/ui-react/lib/Header";
10
- import { cx as Q } from "@emotion/css";
11
- import { Global as X, css as Y } from "@emotion/react";
12
- import J from "@emotion/styled";
13
- import { Box as O, CircularProgress as he, useTheme as be, Button as ye, Stack as ve, useMediaQuery as we } from "@mui/material";
14
- import { useReactive as Z, useScroll as Se } from "ahooks";
15
- import xe from "isomorphic-dompurify";
2
+ import { d as W, e as ce, g as ue, u as pe, c as me } from "./state-DGyH1TW3.js";
3
+ import { useLocaleContext as q } from "@arcblock/ux/lib/Locale/context";
4
+ import K from "@arcblock/ux/lib/Result";
5
+ import { useHeaderState as de } from "@blocklet/pages-kit/builtin/page/header";
6
+ import { useColorConvert as ge } from "@blocklet/pages-kit/contexts/color";
7
+ import { setPageDataSource as Q } from "@blocklet/pages-kit/utils/data-source";
8
+ import { generateParamCombinations as fe } from "@blocklet/pages-kit/utils/route";
9
+ import he from "@blocklet/ui-react/lib/Header";
10
+ import { cx as X } from "@emotion/css";
11
+ import { Global as Y, css as J } from "@emotion/react";
12
+ import Z from "@emotion/styled";
13
+ import { Box as O, CircularProgress as be, useTheme as ye, Button as ve, Stack as we, useMediaQuery as Se } from "@mui/material";
14
+ import { useReactive as ee, useScroll as xe } from "ahooks";
15
+ import Pe from "isomorphic-dompurify";
16
16
  import D from "lodash/cloneDeep";
17
- import Pe from "lodash/isEmpty";
18
- import ee from "lodash/isEqual";
19
- import { useEffect as F, useContext as ke, lazy as te, useMemo as M, useRef as oe, Suspense as Ce, useState as Ie } from "react";
17
+ import ke from "lodash/isEmpty";
18
+ import te from "lodash/isEqual";
19
+ import { useEffect as F, useContext as Ce, lazy as oe, useMemo as M, useRef as ne, Suspense as Ie, useState as Re } from "react";
20
20
  import { Helmet as Me } from "react-helmet";
21
- import { useSearchParams as ne, Routes as Re, Route as C, Navigate as je, ScrollRestoration as Ee } from "react-router-dom";
22
- import { useAsync as re } from "react-use";
23
- import { joinURL as I } from "ufo";
24
- import { S as Te, n as Be, P as $e, a as Fe, B as Oe, g as Le } from "./array-BfSgATE1.js";
25
- import { styled as se, useTheme as _e } from "@arcblock/ux/lib/Theme";
26
- import Ae from "@blocklet/ui-react/lib/Footer";
21
+ import { useSearchParams as re, Routes as je, Route as I, Navigate as Ee, ScrollRestoration as Te } from "react-router-dom";
22
+ import { useAsync as se } from "react-use";
23
+ import { joinURL as R } from "ufo";
24
+ import { S as Be, n as $e, P as Fe, a as Oe, B as Le, g as _e } from "./array-BfSgATE1.js";
25
+ import { styled as ae, useTheme as Ae } from "@arcblock/ux/lib/Theme";
26
+ import De from "@blocklet/ui-react/lib/Footer";
27
27
  import "webfontloader";
28
- import { createAuthServiceSessionContext as De } from "@arcblock/did-connect/lib/Session";
29
- const Ne = se(Ae, { shouldForwardProp: (t) => !!t })`
28
+ import { createAuthServiceSessionContext as Ne } from "@arcblock/did-connect/lib/Session";
29
+ const He = ae(De, { shouldForwardProp: (t) => !!t })`
30
30
  & > div > .MuiContainer-root {
31
31
  max-width: unset;
32
32
  }
33
33
  `;
34
- function He({ meta: t, ...o }) {
35
- const s = _e();
36
- return /* @__PURE__ */ e(Ne, { ...o, meta: t, theme: s || {} });
37
- }
38
- function Ue(t) {
39
- return /* @__PURE__ */ e(O, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(he, { size: 30 }) });
34
+ function Ue({ meta: t, ...o }) {
35
+ const s = Ae();
36
+ return /* @__PURE__ */ e(He, { ...o, meta: t, theme: s || {} });
40
37
  }
41
38
  function Ve(t) {
42
- return /* @__PURE__ */ e(ze, { ...t });
39
+ return /* @__PURE__ */ e(O, { display: "flex", flex: 1, height: "100%", alignItems: "center", justifyContent: "center", ...t, children: /* @__PURE__ */ e(be, { size: 30 }) });
40
+ }
41
+ function ze(t) {
42
+ return /* @__PURE__ */ e(Ge, { ...t });
43
43
  }
44
- const ze = se(O)`
44
+ const Ge = ae(O)`
45
45
  position: fixed;
46
46
  left: 0;
47
47
  top: 0;
@@ -52,21 +52,21 @@ const ze = se(O)`
52
52
  opacity: 0.7;
53
53
  transform: translateX(-23%) translateY(70%) rotate(-45deg);
54
54
  pointer-events: none;
55
- `, Ge = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
55
+ `, We = `Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
56
56
  sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;
57
- function We({
57
+ function qe({
58
58
  titleFontFamily: t,
59
59
  descriptionFontFamily: o
60
60
  }) {
61
61
  var n;
62
- const s = be(), a = (n = s == null ? void 0 : s.typography) == null ? void 0 : n.fontFamily;
62
+ const s = ye(), a = (n = s == null ? void 0 : s.typography) == null ? void 0 : n.fontFamily;
63
63
  F(() => {
64
64
  }, [t, o]);
65
- const r = `${a}, ${Ge}`;
65
+ const r = `${a}, ${We}`;
66
66
  return /* @__PURE__ */ e(
67
- X,
67
+ Y,
68
68
  {
69
- styles: Y`
69
+ styles: J`
70
70
  #app {
71
71
  font-family: ${r};
72
72
 
@@ -82,83 +82,84 @@ function We({
82
82
  }
83
83
  );
84
84
  }
85
- const { SessionProvider: Et, SessionContext: qe, SessionConsumer: Tt, withSession: Bt } = De();
85
+ const { SessionProvider: Tt, SessionContext: Ke, SessionConsumer: Bt, withSession: $t } = Ne();
86
86
  function U() {
87
- return ke(qe);
87
+ return Ce(Ke);
88
88
  }
89
- function Ke(...t) {
89
+ function Qe(...t) {
90
90
  var s;
91
91
  const { session: o } = U();
92
92
  return t.includes((s = o.user) == null ? void 0 : s.role);
93
93
  }
94
- function Qe(...t) {
94
+ function Xe(...t) {
95
95
  var a;
96
- const { session: o } = U(), s = Ke(...t);
96
+ const { session: o } = U(), s = Qe(...t);
97
97
  return ((a = window.blocklet) == null ? void 0 : a.tenantMode) === "multiple" ? !!o.user : s;
98
98
  }
99
- function $t() {
100
- const [t] = ne(), { session: o } = U(), s = Qe("owner", "admin", "pagesEditor", "member"), a = M(() => {
99
+ function Ft() {
100
+ const [t] = re(), { session: o } = U(), s = Xe("owner", "admin", "pagesEditor", "member"), a = M(() => {
101
101
  const n = t.get("mode");
102
- return Te.includes(n) ? n : "production";
102
+ return Be.includes(n) ? n : "production";
103
103
  }, [t]), r = a === "production" ? a : o.user ? s ? a : "production" : null;
104
- return r ? /* @__PURE__ */ e(Xe, { mode: r }) : null;
104
+ return r ? /* @__PURE__ */ e(Ye, { mode: r }) : null;
105
105
  }
106
- function Xe({ mode: t }) {
106
+ function Ye({ mode: t }) {
107
107
  if (t !== "draft") {
108
108
  const o = window.__PAGE_STATE__;
109
- return o ? /* @__PURE__ */ e(H, { mode: t, state: o }) : /* @__PURE__ */ e(Je, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(H, { mode: t, state: s }) });
109
+ return o ? /* @__PURE__ */ e(H, { mode: t, state: o }) : /* @__PURE__ */ e(Ze, { mode: t, children: ({ state: s }) => /* @__PURE__ */ e(H, { mode: t, state: s }) });
110
110
  }
111
- return /* @__PURE__ */ e(Ye, { children: ({ state: o }) => /* @__PURE__ */ e(H, { mode: t, state: o }) });
111
+ return /* @__PURE__ */ e(Je, { children: ({ state: o }) => /* @__PURE__ */ e(H, { mode: t, state: o }) });
112
112
  }
113
- const Ye = te(() => import("./draft-data-PScFOAJJ.js"));
114
- function Je({
113
+ const Je = oe(() => import("./draft-data-PScFOAJJ.js"));
114
+ function Ze({
115
115
  mode: t,
116
116
  children: o
117
117
  }) {
118
- const s = document.querySelector('meta[property="pages:version"]'), a = s == null ? void 0 : s.content, r = ue(), n = M(() => {
118
+ const s = document.querySelector('meta[property="pages:version"]'), a = s == null ? void 0 : s.content, r = pe(), n = M(() => {
119
119
  if (a === "{{pagesPublishedAt}}") {
120
120
  const c = localStorage.getItem(me(r ?? ""));
121
121
  return Number(c) ? Number(c) : (/* @__PURE__ */ new Date()).getTime();
122
122
  }
123
123
  return Number(a);
124
- }, [a]), { loading: d, value: l } = re(() => Le({ mode: t, version: n }), [t, n]);
125
- return d ? /* @__PURE__ */ e(Ue, {}) : l ? o({ state: l }) : null;
124
+ }, [a]), { loading: d, value: l } = se(() => _e({ mode: t, version: n }), [t, n]);
125
+ return d ? /* @__PURE__ */ e(Ve, {}) : l ? o({ state: l }) : null;
126
126
  }
127
127
  function H({ mode: t, state: o }) {
128
- const { t: s, locale: a } = W(), [r] = ne(), n = r.get("hiddenBadge") === "true", d = r.get("showPublish") === "true", {
128
+ const { t: s, locale: a } = q(), [r] = re(), n = r.get("hiddenBadge") === "true", d = r.get("showPublish") === "true", {
129
129
  pageIds: l,
130
130
  pages: c,
131
131
  routeIds: g,
132
- routes: p,
132
+ routes: m,
133
133
  supportedLocales: u,
134
- config: { defaultLocale: h },
134
+ config: { defaultLocale: b },
135
135
  resources: v
136
- } = o, w = G(o), y = M(
137
- () => u != null && u.some((m) => m.locale === a) ? a : void 0,
136
+ } = o, w = W(o), y = M(
137
+ () => u != null && u.some((p) => p.locale === a) ? a : void 0,
138
138
  [a, u]
139
- ), f = Object.values(c).find((m) => (m == null ? void 0 : m.slug) === "/") ? void 0 : Object.values(c)[0], L = M(
140
- () => l.map((m) => {
141
- const i = c[m];
139
+ ), f = Object.values(c).find((p) => (p == null ? void 0 : p.slug) === "/") ? void 0 : Object.values(c)[0], L = M(
140
+ () => l.map((p) => {
141
+ const i = c[p];
142
142
  return i && {
143
143
  id: i.id,
144
- path: I("/", y || "", i.slug, t !== "production" ? `?mode=${t}` : "")
144
+ path: R("/", y || "", i.slug, t !== "production" ? `?mode=${t}` : "")
145
145
  };
146
- }).filter(Be),
146
+ }).filter($e),
147
147
  [l, c, y, t]
148
- ), P = ([...m]) => (t !== "production" && d && m.unshift(
149
- /* @__PURE__ */ e(Ce, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(Ze, { mode: "production", state: o }) })
150
- ), m);
151
- return /* @__PURE__ */ A($e, { value: { pages: L }, children: [
152
- /* @__PURE__ */ A(Re, { children: [
153
- f && /* @__PURE__ */ e(C, { index: !0, element: /* @__PURE__ */ e(je, { to: I("/", y || "", f.slug) }) }),
154
- g == null ? void 0 : g.map((m) => {
155
- var R, j, E, T;
156
- const i = p == null ? void 0 : p[m];
148
+ ), P = ([...p]) => (t !== "production" && d && p.unshift(
149
+ /* @__PURE__ */ e(Ie, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(et, { mode: "production", state: o }) })
150
+ ), p);
151
+ return /* @__PURE__ */ A(Fe, { value: { pages: L }, children: [
152
+ /* @__PURE__ */ A(je, { children: [
153
+ f && /* @__PURE__ */ e(I, { index: !0, element: /* @__PURE__ */ e(Ee, { to: R("/", y || "", f.slug) }) }),
154
+ g == null ? void 0 : g.map((p) => {
155
+ var j, E, T, S;
156
+ const i = m == null ? void 0 : m[p];
157
157
  if (!i || !i.displayTemplateId) return null;
158
158
  const k = c[i.displayTemplateId];
159
159
  if (!k) return null;
160
+ let C = [];
160
161
  if (i.params && i.params.length > 0) {
161
- const S = ge({
162
+ const h = fe({
162
163
  basePath: i.path,
163
164
  params: i.params,
164
165
  routeId: i.id,
@@ -168,58 +169,60 @@ function H({ mode: t, state: o }) {
168
169
  currentOptionIds: [],
169
170
  result: []
170
171
  });
171
- return S == null ? void 0 : S.map((b) => {
172
- var _, B, $, V;
173
- const x = b.paramOptionIds.join("-");
172
+ C = h == null ? void 0 : h.map((x) => {
173
+ var B, $, V, z;
174
+ const _ = x.paramOptionIds.join("-");
174
175
  return /* @__PURE__ */ e(
175
- C,
176
+ I,
176
177
  {
177
- path: I(":projectIdOrSlug?", b.path),
178
+ path: R(":projectIdOrSlug?", x.path),
178
179
  element: /* @__PURE__ */ e(
179
- z,
180
+ G,
180
181
  {
181
182
  mode: t,
182
183
  components: w,
183
184
  page: k,
184
185
  locale: y,
185
- defaultLocale: h,
186
+ defaultLocale: b,
186
187
  headerAddons: P,
187
188
  state: o,
188
- pageData: (V = ($ = (B = (_ = i.dataSource) == null ? void 0 : _.pathDataMappings) == null ? void 0 : B[x]) == null ? void 0 : $.dataCache) == null ? void 0 : V[y || h || "en"]
189
+ pageData: (z = (V = ($ = (B = i.dataSource) == null ? void 0 : B.pathDataMappings) == null ? void 0 : $[_]) == null ? void 0 : V.dataCache) == null ? void 0 : z[y || b || "en"]
189
190
  }
190
191
  )
191
192
  },
192
- x
193
+ _
193
194
  );
194
195
  });
195
196
  }
196
- return /* @__PURE__ */ e(
197
- C,
198
- {
199
- path: I(":projectIdOrSlug?", i.path),
200
- element: /* @__PURE__ */ e(
201
- z,
202
- {
203
- mode: t,
204
- components: w,
205
- page: k,
206
- locale: y,
207
- defaultLocale: h,
208
- headerAddons: P,
209
- state: o,
210
- pageData: (T = (E = (j = (R = i.dataSource) == null ? void 0 : R.pathDataMappings) == null ? void 0 : j[i.id]) == null ? void 0 : E.dataCache) == null ? void 0 : T[y || h || "en"]
211
- }
212
- )
213
- },
214
- i.id
215
- );
197
+ return C.push(
198
+ /* @__PURE__ */ e(
199
+ I,
200
+ {
201
+ path: R(":projectIdOrSlug?", i.path),
202
+ element: /* @__PURE__ */ e(
203
+ G,
204
+ {
205
+ mode: t,
206
+ components: w,
207
+ page: k,
208
+ locale: y,
209
+ defaultLocale: b,
210
+ headerAddons: P,
211
+ state: o,
212
+ pageData: (S = (T = (E = (j = i.dataSource) == null ? void 0 : j.pathDataMappings) == null ? void 0 : E[i.id]) == null ? void 0 : T.dataCache) == null ? void 0 : S[y || b || "en"]
213
+ }
214
+ )
215
+ },
216
+ i.id
217
+ )
218
+ ), C;
216
219
  }),
217
- l.map((m) => {
218
- const i = c[m];
220
+ l.map((p) => {
221
+ const i = c[p];
219
222
  return i ? /* @__PURE__ */ e(
220
- C,
223
+ I,
221
224
  {
222
- path: I(":projectIdOrSlug?", i.slug),
225
+ path: R(":projectIdOrSlug?", i.slug),
223
226
  element: /* @__PURE__ */ e(
224
227
  N,
225
228
  {
@@ -227,7 +230,7 @@ function H({ mode: t, state: o }) {
227
230
  components: w,
228
231
  page: i,
229
232
  locale: y,
230
- defaultLocale: h,
233
+ defaultLocale: b,
231
234
  headerAddons: P
232
235
  }
233
236
  )
@@ -235,10 +238,10 @@ function H({ mode: t, state: o }) {
235
238
  i.id
236
239
  ) : null;
237
240
  }),
238
- v.pages && Object.values(v.pages).map(({ blockletId: m, page: i }) => /* @__PURE__ */ e(
239
- C,
241
+ v.pages && Object.values(v.pages).map(({ blockletId: p, page: i }) => /* @__PURE__ */ e(
242
+ I,
240
243
  {
241
- path: I("/", `@${m}`, i.slug),
244
+ path: R("/", `@${p}`, i.slug),
242
245
  element: /* @__PURE__ */ e(
243
246
  N,
244
247
  {
@@ -246,7 +249,7 @@ function H({ mode: t, state: o }) {
246
249
  components: w,
247
250
  page: i,
248
251
  locale: y,
249
- defaultLocale: h,
252
+ defaultLocale: b,
250
253
  headerAddons: P
251
254
  }
252
255
  )
@@ -254,18 +257,18 @@ function H({ mode: t, state: o }) {
254
257
  i.id
255
258
  )),
256
259
  /* @__PURE__ */ e(
257
- C,
260
+ I,
258
261
  {
259
262
  path: "*",
260
- element: /* @__PURE__ */ e(O, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(q, { status: 404, extra: /* @__PURE__ */ e(ie, { href: "/", children: s("common.back") }) }) })
263
+ element: /* @__PURE__ */ e(O, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(K, { status: 404, extra: /* @__PURE__ */ e(le, { href: "/", children: s("common.back") }) }) })
261
264
  }
262
265
  )
263
266
  ] }),
264
- t !== "production" && !n && /* @__PURE__ */ e(Ve, { sx: { bgcolor: "info.light" }, children: t }),
265
- /* @__PURE__ */ e(We, {})
267
+ t !== "production" && !n && /* @__PURE__ */ e(ze, { sx: { bgcolor: "info.light" }, children: t }),
268
+ /* @__PURE__ */ e(qe, {})
266
269
  ] });
267
270
  }
268
- function z({
271
+ function G({
269
272
  mode: t,
270
273
  pageData: o,
271
274
  components: s,
@@ -275,16 +278,16 @@ function z({
275
278
  headerAddons: d,
276
279
  state: l
277
280
  }) {
278
- const c = Z({
281
+ const c = ee({
279
282
  page: null
280
283
  });
281
284
  F(() => {
282
- const p = a || null;
283
- p ? c.page = D(p) : c.page = null;
285
+ const m = a || null;
286
+ m ? c.page = D(m) : c.page = null;
284
287
  }, [a, c]);
285
- const g = oe();
288
+ const g = ne();
286
289
  return F(() => {
287
- ee(o, g.current) || o && c.page && (K(c.page, l, r, o), g.current = D(o));
290
+ te(o, g.current) || o && c.page && (Q(c.page, l, r, o), g.current = D(o));
288
291
  }, [c.page, o, r, l]), c.page ? /* @__PURE__ */ e(
289
292
  N,
290
293
  {
@@ -297,40 +300,40 @@ function z({
297
300
  }
298
301
  ) : null;
299
302
  }
300
- function Ft({
303
+ function Ot({
301
304
  mode: t,
302
305
  state: o,
303
306
  path: s,
304
307
  pageData: a
305
308
  }) {
306
- const { t: r, locale: n } = W(), {
309
+ const { t: r, locale: n } = q(), {
307
310
  pages: d,
308
311
  supportedLocales: l,
309
312
  config: { defaultLocale: c },
310
313
  resources: g
311
- } = o, p = Object.values(d).find((f) => (f == null ? void 0 : f.slug) === s), u = Object.values(g.pages || {}).find((f) => f.page.slug === s), h = M(
314
+ } = o, m = Object.values(d).find((f) => (f == null ? void 0 : f.slug) === s), u = Object.values(g.pages || {}).find((f) => f.page.slug === s), b = M(
312
315
  () => l != null && l.some((f) => f.locale === n) ? n : void 0,
313
316
  [n, l]
314
- ), v = Z({
317
+ ), v = ee({
315
318
  page: null
316
319
  });
317
320
  F(() => {
318
- const f = p || (u == null ? void 0 : u.page) || null;
321
+ const f = m || (u == null ? void 0 : u.page) || null;
319
322
  f ? v.page = D(f) : v.page = null;
320
- }, [p, u]);
321
- const w = oe();
323
+ }, [m, u]);
324
+ const w = ne();
322
325
  if (F(() => {
323
- ee(a, w.current) || a && v.page && (K(v.page, o, h, a), w.current = D(a));
324
- }, [{}]), !p && !(u != null && u.page))
325
- return /* @__PURE__ */ e(O, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(q, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(ie, { href: "/", children: r("common.back") }) }) });
326
- const y = G(o);
326
+ te(a, w.current) || a && v.page && (Q(v.page, o, b, a), w.current = D(a));
327
+ }, [{}]), !m && !(u != null && u.page))
328
+ return /* @__PURE__ */ e(O, { width: "100vw", height: "100vh", display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(K, { style: { background: "inherit" }, status: 404, extra: /* @__PURE__ */ e(le, { href: "/", children: r("common.back") }) }) });
329
+ const y = W(o);
327
330
  return v.page ? /* @__PURE__ */ e(
328
331
  N,
329
332
  {
330
333
  mode: t,
331
334
  components: y,
332
335
  page: v.page,
333
- locale: h,
336
+ locale: b,
334
337
  defaultLocale: c
335
338
  }
336
339
  ) : null;
@@ -343,20 +346,20 @@ function N({
343
346
  defaultLocale: r,
344
347
  headerAddons: n
345
348
  }) {
346
- var L, P, m, i, k, R, j, E, T;
347
- const d = de(), l = ((L = s.locales) == null ? void 0 : L[a]) ?? ((P = s.locales) == null ? void 0 : P[r]) ?? {}, c = l.title || ((m = window.blocklet) == null ? void 0 : m.appName), g = l.description || ((i = window.blocklet) == null ? void 0 : i.appDescription), p = le(ce(l.image), 540), { logo: u, brand: h, description: v, ...w } = pe(), y = M(
349
+ var L, P, p, i, k, C, j, E, T;
350
+ const d = ge(), l = ((L = s.locales) == null ? void 0 : L[a]) ?? ((P = s.locales) == null ? void 0 : P[r]) ?? {}, c = l.title || ((p = window.blocklet) == null ? void 0 : p.appName), g = l.description || ((i = window.blocklet) == null ? void 0 : i.appDescription), m = ce(ue(l.image), 540), { logo: u, brand: b, description: v, ...w } = de(), y = M(
348
351
  () => (S) => {
349
352
  var x;
350
- let b = (n == null ? void 0 : n(S)) ?? S;
351
- return b = ((x = w.addons) == null ? void 0 : x.call(w, b)) ?? b, b;
353
+ let h = (n == null ? void 0 : n(S)) ?? S;
354
+ return h = ((x = w.addons) == null ? void 0 : x.call(w, h)) ?? h, h;
352
355
  },
353
356
  [w.addons, n]
354
- ), f = (k = l.header) != null && k.translucent ? tt : ae;
355
- return /* @__PURE__ */ A(Fe, { page: s, defaultLocale: r, currentLocale: a, children: [
357
+ ), f = (k = l.header) != null && k.translucent ? ot : ie;
358
+ return /* @__PURE__ */ A(Oe, { page: s, defaultLocale: r, currentLocale: a, children: [
356
359
  /* @__PURE__ */ e(
357
- X,
360
+ Y,
358
361
  {
359
- styles: Y`
362
+ styles: J`
360
363
  body {
361
364
  background-color: ${d(
362
365
  !l.backgroundColor || l.backgroundColor === "transparent" ? "background.default" : l.backgroundColor
@@ -368,30 +371,30 @@ function N({
368
371
  /* @__PURE__ */ e(
369
372
  f,
370
373
  {
371
- hideNavMenu: !!((R = l.header) != null && R.hideNavMenus),
374
+ hideNavMenu: !!((C = l.header) != null && C.hideNavMenus),
372
375
  translucentTextColor: (j = l.header) == null ? void 0 : j.translucentTextColor,
373
376
  ...u ? { logo: u } : {},
374
- ...h ? { brand: h } : {},
377
+ ...b ? { brand: b } : {},
375
378
  ...v ? { description: v } : {},
376
- className: Q(((E = l.header) == null ? void 0 : E.sticky) && "sticky", "page-header"),
379
+ className: X(((E = l.header) == null ? void 0 : E.sticky) && "sticky", "page-header"),
377
380
  maxWidth: !1,
378
381
  addons: y
379
382
  }
380
383
  ),
381
- /* @__PURE__ */ e(Ee, {}),
384
+ /* @__PURE__ */ e(Te, {}),
382
385
  /* @__PURE__ */ A(Me, { children: [
383
386
  /* @__PURE__ */ e("title", { children: c }),
384
387
  /* @__PURE__ */ e("meta", { name: "og:title", content: c }),
385
388
  /* @__PURE__ */ e("meta", { name: "og:description", content: g }),
386
- /* @__PURE__ */ e("meta", { name: "og:image", content: p }),
387
- /* @__PURE__ */ e("meta", { name: "twitter:image:src", content: p }),
388
- /* @__PURE__ */ e("meta", { name: "twitter:image", content: p }),
389
+ /* @__PURE__ */ e("meta", { name: "og:image", content: m }),
390
+ /* @__PURE__ */ e("meta", { name: "twitter:image:src", content: m }),
391
+ /* @__PURE__ */ e("meta", { name: "twitter:image", content: m }),
389
392
  /* @__PURE__ */ e("meta", { property: "twitter:description", content: g }),
390
393
  /* @__PURE__ */ e("meta", { property: "twitter:title", content: c }),
391
394
  /* @__PURE__ */ e("meta", { name: "description", content: g })
392
395
  ] }),
393
396
  /* @__PURE__ */ e(
394
- ve,
397
+ we,
395
398
  {
396
399
  flexGrow: 1,
397
400
  className: "PageView-root",
@@ -403,18 +406,18 @@ function N({
403
406
  },
404
407
  children: s.sectionIds.map((S) => {
405
408
  var B, $;
406
- const b = s.sections[S];
407
- if (!b || b.visibility === "hidden") return null;
408
- const x = (B = b.locales) == null ? void 0 : B[a], _ = (($ = b.locales) == null ? void 0 : $[r]) ?? {};
409
+ const h = s.sections[S];
410
+ if (!h || h.visibility === "hidden") return null;
411
+ const x = (B = h.locales) == null ? void 0 : B[a], _ = (($ = h.locales) == null ? void 0 : $[r]) ?? {};
409
412
  return /* @__PURE__ */ e(
410
- Oe,
413
+ Le,
411
414
  {
412
415
  id: S,
413
- type: b.component,
416
+ type: h.component,
414
417
  mode: t,
415
- section: b,
418
+ section: h,
416
419
  config: {
417
- ...Pe(x) ? _ : x,
420
+ ...ke(x) ? _ : x,
418
421
  locale: a,
419
422
  dev: t === "draft" ? {
420
423
  mode: t,
@@ -428,17 +431,17 @@ function N({
428
431
  })
429
432
  }
430
433
  ),
431
- !((T = l.footer) != null && T.hidden) && /* @__PURE__ */ e(He, {})
434
+ !((T = l.footer) != null && T.hidden) && /* @__PURE__ */ e(Ue, {})
432
435
  ] });
433
436
  }
434
- const Ze = te(() => import("./publish-button-DMQRXAVS.js")), ae = J(fe)`
437
+ const et = oe(() => import("./publish-button-BPU8djxy.js")), ie = Z(he)`
435
438
  &.sticky {
436
439
  position: sticky;
437
440
  top: 0;
438
441
  }
439
442
  `;
440
- function et({ logo: t }) {
441
- const [o, s] = Ie(), a = we((n) => n.breakpoints.down("sm")), { value: r } = re(() => {
443
+ function tt({ logo: t }) {
444
+ const [o, s] = Re(), a = Se((n) => n.breakpoints.down("sm")), { value: r } = se(() => {
442
445
  var l, c;
443
446
  const n = new URL(
444
447
  a ? ((l = window == null ? void 0 : window.blocklet) == null ? void 0 : l.appLogo) || "/.well-known/service/blocklet/logo" : ((c = window == null ? void 0 : window.blocklet) == null ? void 0 : c.appLogoRect) || "/.well-known/service/blocklet/logo-rect",
@@ -447,18 +450,18 @@ function et({ logo: t }) {
447
450
  n.searchParams.delete("imageFilter"), n.searchParams.delete("f");
448
451
  const d = n.toString();
449
452
  return new Promise((g) => {
450
- fetch(d).then((p) => {
451
- const u = p.headers.get("content-type");
452
- u != null && u.includes("svg") && p.text().then((h) => {
453
- s(h), g(null);
454
- }), g(p.url);
453
+ fetch(d).then((m) => {
454
+ const u = m.headers.get("content-type");
455
+ u != null && u.includes("svg") && m.text().then((b) => {
456
+ s(b), g(null);
457
+ }), g(m.url);
455
458
  });
456
459
  });
457
460
  }, [a]);
458
461
  if (t)
459
462
  return t;
460
463
  if (o)
461
- return /* @__PURE__ */ e(O, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: xe.sanitize(o) } });
464
+ return /* @__PURE__ */ e(O, { sx: { filter: "initial !important" }, dangerouslySetInnerHTML: { __html: Pe.sanitize(o) } });
462
465
  if (r) {
463
466
  const n = new URL(r);
464
467
  n.searchParams.set("imageFilter", "convert"), n.searchParams.set("f", "png"), n.searchParams.set("h", "80");
@@ -467,12 +470,12 @@ function et({ logo: t }) {
467
470
  }
468
471
  return null;
469
472
  }
470
- function tt({
473
+ function ot({
471
474
  logo: t,
472
475
  translucentTextColor: o,
473
476
  ...s
474
477
  }) {
475
- const { top: a = 0 } = Se(() => document.getElementById("app")) || {};
478
+ const { top: a = 0 } = xe(() => document.getElementById("app")) || {};
476
479
  let r = Math.min(a / 800, 1), n = "";
477
480
  if (r > 0.1) {
478
481
  r = Math.max(r, 0.6);
@@ -481,11 +484,11 @@ function tt({
481
484
  } else
482
485
  n = o || "#EEEEEE";
483
486
  return /* @__PURE__ */ e(
484
- ae,
487
+ ie,
485
488
  {
486
- logo: /* @__PURE__ */ e(et, { logo: t }),
489
+ logo: /* @__PURE__ */ e(tt, { logo: t }),
487
490
  ...s,
488
- className: Q(r <= 0.7 && "reverse-color"),
491
+ className: X(r <= 0.7 && "reverse-color"),
489
492
  style: {
490
493
  backgroundColor: `rgba(255,255,255,${r})`,
491
494
  // @ts-ignore
@@ -514,14 +517,14 @@ function tt({
514
517
  }
515
518
  );
516
519
  }
517
- const ie = J(ye)``;
520
+ const le = Z(ve)``;
518
521
  export {
519
- $t as H,
520
- Ue as L,
522
+ Ft as H,
523
+ Ve as L,
521
524
  H as P,
522
- tt as T,
523
- Xe as a,
524
- z as b,
525
- Ft as c,
525
+ ot as T,
526
+ Ye as a,
527
+ G as b,
528
+ Ot as c,
526
529
  N as d
527
530
  };
@@ -10,7 +10,7 @@ import { produce as Oe } from "immer";
10
10
  import ee from "lodash/difference";
11
11
  import { useState as T, useMemo as R, useCallback as j, forwardRef as Te, useImperativeHandle as je, useEffect as W, useRef as ve } from "react";
12
12
  import { useAsync as Re } from "react-use";
13
- import { L as Ee } from "./home-qQe9H8C9.js";
13
+ import { L as Ee } from "./home-Bnr_eVpB.js";
14
14
  import { p as ze, g as Be } from "./array-BfSgATE1.js";
15
15
  function Le(s) {
16
16
  const [y, w] = T(!1);