@webx-ui/module-blocks 0.10.3 → 0.10.4

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/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { WxCodeEditor as Qe, WxText as J, WxIcon as ye, WxSkeleton as He, WxBadge as ke, WxButton as ce, confirm as vt, toast as X, useElementWidth as bt, WxSegmented as sl, WxCard as De, WxPopover as Wl, WxAlert as al, WxTabs as Ml, WxTab as Re, WxFormItem as re, WxSelect as $t, WxInput as nt, WxTextarea as il, WxIconPicker as Nl, WxInputNumber as jt, WxTagsInput as Ft, WxSwitch as zl, WxActionBar as Dl, useModal as At, WxDialog as Bt, WxEmpty as Lt, WxAction as et, WxSortableList as Ol, createModal as St, WxDrawer as Il, WxRadioGroup as Ul, WxRadio as Ht, WxSpace as Pl, WxSkeletonItem as pt } from "@webx-ui/core";
2
- import { defineComponent as oe, ref as U, watch as ue, openBlock as c, createElementBlock as w, createVNode as v, unref as n, createBlock as W, withCtx as g, createTextVNode as B, toDisplayString as k, createCommentVNode as L, computed as S, createElementVNode as E, Fragment as F, renderList as Z, onMounted as ot, onBeforeUnmount as st, normalizeStyle as Ie, provide as Wt, inject as Fe, reactive as gt, resolveComponent as Mt, normalizeClass as Me, withDirectives as Rl, vShow as jl, isRef as Nt, watchEffect as Fl, nextTick as Hl, withKeys as Kt, withModifiers as qt, useModel as Kl, getCurrentInstance as ql, resolveDynamicComponent as Jl, mergeProps as Yl, mergeModels as Gl } from "vue";
3
- import { useAdmin as at, useTranslate as de, useErrorText as it, WxDate as Zl, WxScreenHead as Xl, WxRenameButton as Ql, WxHelpButton as en, adminKey as rl, WxRowMenu as tn, WxListScreen as ln } from "@webx-ui/module-admin";
4
- import { useRoute as nn, useRouter as ul } from "vue-router";
5
- import { WxScreenRenderer as cl, coreTypes as ft } from "@webx-ui/schema";
6
- import { autocompletion as on, pickedCompletion as Je, snippetCompletion as _e, startCompletion as sn } from "@codemirror/autocomplete";
7
- import { EditorState as an } from "@codemirror/state";
8
- import { VueDraggable as rn } from "vue-draggable-plus";
9
- const un = {
1
+ import { WxCodeEditor as Qe, WxText as Y, WxIcon as we, WxSkeleton as He, WxBadge as ye, WxButton as ce, confirm as vt, toast as X, useElementWidth as gt, WxSegmented as al, WxCard as De, WxPopover as Ml, WxAlert as il, WxTabs as zl, WxTab as Re, WxFormItem as re, WxSelect as St, WxInput as nt, WxTextarea as rl, WxIconPicker as Dl, WxInputNumber as Ft, WxTagsInput as Ht, WxSwitch as Ol, WxActionBar as Il, useModal as Lt, WxDialog as Bt, WxEmpty as Wt, WxAction as et, WxSortableList as Pl, createModal as Et, WxDrawer as Ul, WxRadioGroup as Rl, WxRadio as Kt, WxSpace as jl, WxSkeletonItem as pt } from "@webx-ui/core";
2
+ import { defineComponent as oe, ref as P, watch as ue, openBlock as d, createElementBlock as w, createVNode as v, unref as n, createBlock as W, withCtx as g, createTextVNode as L, toDisplayString as k, createCommentVNode as B, computed as S, createElementVNode as C, Fragment as F, renderList as Z, onMounted as ot, onBeforeUnmount as st, normalizeStyle as Ie, provide as Nt, inject as Fe, reactive as kt, resolveComponent as Mt, normalizeClass as Ne, withDirectives as Fl, vShow as Hl, isRef as zt, watchEffect as Kl, nextTick as ql, withKeys as qt, withModifiers as Yt, useModel as Yl, getCurrentInstance as Jl, resolveDynamicComponent as Gl, mergeProps as Zl, mergeModels as Xl } from "vue";
3
+ import { useAdmin as at, useTranslate as de, useErrorText as it, WxDate as Ql, WxScreenHead as en, WxRenameButton as tn, WxHelpButton as ln, adminKey as ul, WxRowMenu as nn, WxListScreen as on } from "@webx-ui/module-admin";
4
+ import { useRoute as sn, useRouter as cl } from "vue-router";
5
+ import { WxScreenRenderer as dl, coreTypes as ft } from "@webx-ui/schema";
6
+ import { autocompletion as an, pickedCompletion as Ye, snippetCompletion as ke, startCompletion as rn } from "@codemirror/autocomplete";
7
+ import { EditorState as un } from "@codemirror/state";
8
+ import { VueDraggable as cn } from "vue-draggable-plus";
9
+ const dn = {
10
10
  module: {
11
11
  title: "Blocks"
12
12
  },
@@ -207,14 +207,14 @@ const un = {
207
207
  "ok-variables": "Every variable of the template is a field of the schema."
208
208
  }
209
209
  }, Jt = /* @__PURE__ */ new WeakSet();
210
- function Ne() {
210
+ function Me() {
211
211
  try {
212
212
  const { i18n: e } = at();
213
- Jt.has(e) || (e.defaults("webx-blocks", un), Jt.add(e));
213
+ Jt.has(e) || (e.defaults("webx-blocks", dn), Jt.add(e));
214
214
  } catch {
215
215
  }
216
216
  }
217
- const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
217
+ const pn = { class: "wx-block-data" }, fn = /* @__PURE__ */ oe({
218
218
  __name: "BlockDataField",
219
219
  props: {
220
220
  modelValue: { default: void 0 },
@@ -224,36 +224,36 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
224
224
  emits: ["update:modelValue"],
225
225
  setup(e, { emit: l }) {
226
226
  const t = e, o = l;
227
- Ne();
228
- const a = de("webx-blocks"), i = U(r(t.modelValue)), s = U(null);
227
+ Me();
228
+ const a = de("webx-blocks"), i = P(r(t.modelValue)), s = P(null);
229
229
  function r(m) {
230
230
  return m == null ? "" : JSON.stringify(m, null, 2);
231
231
  }
232
- function p(m) {
232
+ function c(m) {
233
233
  return m.trim() === "" ? null : JSON.parse(m);
234
234
  }
235
235
  function u(m) {
236
236
  i.value = m;
237
237
  try {
238
- const d = p(m);
239
- s.value = null, o("update:modelValue", d);
240
- } catch (d) {
241
- s.value = a("components.data-invalid", { error: d.message });
238
+ const p = c(m);
239
+ s.value = null, o("update:modelValue", p);
240
+ } catch (p) {
241
+ s.value = a("components.data-invalid", { error: p.message });
242
242
  }
243
243
  }
244
244
  return ue(
245
245
  () => t.modelValue,
246
246
  (m) => {
247
- let d = !1;
247
+ let p = !1;
248
248
  try {
249
- d = JSON.stringify(p(i.value)) === JSON.stringify(m ?? null);
249
+ p = JSON.stringify(c(i.value)) === JSON.stringify(m ?? null);
250
250
  } catch {
251
- d = !1;
251
+ p = !1;
252
252
  }
253
- d || (i.value = r(m), s.value = null);
253
+ p || (i.value = r(m), s.value = null);
254
254
  },
255
255
  { deep: !0 }
256
- ), (m, d) => (c(), w("div", cn, [
256
+ ), (m, p) => (d(), w("div", pn, [
257
257
  v(n(Qe), {
258
258
  "model-value": i.value,
259
259
  language: "json",
@@ -263,16 +263,16 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
263
263
  "max-height": "320px",
264
264
  "onUpdate:modelValue": u
265
265
  }, null, 8, ["model-value", "lint", "readonly"]),
266
- s.value ? (c(), W(n(J), {
266
+ s.value ? (d(), W(n(Y), {
267
267
  key: 0,
268
268
  size: "sm",
269
269
  tone: "danger"
270
270
  }, {
271
271
  default: g(() => [
272
- B(k(s.value), 1)
272
+ L(k(s.value), 1)
273
273
  ]),
274
274
  _: 1
275
- })) : L("", !0)
275
+ })) : B("", !0)
276
276
  ]));
277
277
  }
278
278
  }), se = (e, l) => {
@@ -280,7 +280,7 @@ const cn = { class: "wx-block-data" }, dn = /* @__PURE__ */ oe({
280
280
  for (const [o, a] of l)
281
281
  t[o] = a;
282
282
  return t;
283
- }, pn = /* @__PURE__ */ se(dn, [["__scopeId", "data-v-b994c835"]]);
283
+ }, mn = /* @__PURE__ */ se(fn, [["__scopeId", "data-v-b994c835"]]);
284
284
  function Ke(e) {
285
285
  const l = `${e.apiPath}/blocks`, t = (o) => o.data;
286
286
  return {
@@ -304,10 +304,10 @@ function Ke(e) {
304
304
  })
305
305
  };
306
306
  }
307
- const fn = { class: "wx-block-checks" }, mn = {
307
+ const hn = { class: "wx-block-checks" }, vn = {
308
308
  key: 0,
309
309
  class: "wx-block-checks__line is-error"
310
- }, hn = /* @__PURE__ */ oe({
310
+ }, bn = /* @__PURE__ */ oe({
311
311
  __name: "BlockChecks",
312
312
  props: {
313
313
  file: {},
@@ -320,41 +320,41 @@ const fn = { class: "wx-block-checks" }, mn = {
320
320
  const i = new Set(o.value.map((r) => r.code)), s = [];
321
321
  return l.file === "template" && (i.has("no-marker") || s.push(t("checks.ok-marker")), i.has("variables-missing") || s.push(t("checks.ok-variables"))), l.file === "styles" && (i.has("stray-selectors") || s.push(t("checks.ok-prefix", { slug: l.slug })), i.has("bare-selectors") || s.push(t("checks.ok-bare")), i.has("media-query") || s.push(t("checks.ok-container"))), s;
322
322
  });
323
- return (i, s) => (c(), w("div", fn, [
324
- e.error ? (c(), w("div", mn, [
325
- v(n(ye), { name: "close-circle" }),
326
- E("span", null, [
327
- B(k(e.error.message) + " ", 1),
328
- e.error.line !== null ? (c(), w(F, { key: 0 }, [
329
- B(" · " + k(n(t)("page.line", { line: e.error.line })), 1)
330
- ], 64)) : L("", !0),
331
- e.error.where ? (c(), w(F, { key: 1 }, [
332
- B(" · " + k(e.error.where), 1)
333
- ], 64)) : L("", !0)
323
+ return (i, s) => (d(), w("div", hn, [
324
+ e.error ? (d(), w("div", vn, [
325
+ v(n(we), { name: "close-circle" }),
326
+ C("span", null, [
327
+ L(k(e.error.message) + " ", 1),
328
+ e.error.line !== null ? (d(), w(F, { key: 0 }, [
329
+ L(" · " + k(n(t)("page.line", { line: e.error.line })), 1)
330
+ ], 64)) : B("", !0),
331
+ e.error.where ? (d(), w(F, { key: 1 }, [
332
+ L(" · " + k(e.error.where), 1)
333
+ ], 64)) : B("", !0)
334
334
  ])
335
- ])) : L("", !0),
336
- (c(!0), w(F, null, Z(o.value, (r) => (c(), w("div", {
335
+ ])) : B("", !0),
336
+ (d(!0), w(F, null, Z(o.value, (r) => (d(), w("div", {
337
337
  key: r.code,
338
338
  class: "wx-block-checks__line is-warning"
339
339
  }, [
340
- v(n(ye), { name: "warning" }),
341
- E("span", null, [
342
- B(k(r.message) + " ", 1),
343
- r.line !== null ? (c(), w(F, { key: 0 }, [
344
- B(" · " + k(n(t)("page.line", { line: r.line })), 1)
345
- ], 64)) : L("", !0)
340
+ v(n(we), { name: "warning" }),
341
+ C("span", null, [
342
+ L(k(r.message) + " ", 1),
343
+ r.line !== null ? (d(), w(F, { key: 0 }, [
344
+ L(" · " + k(n(t)("page.line", { line: r.line })), 1)
345
+ ], 64)) : B("", !0)
346
346
  ])
347
347
  ]))), 128)),
348
- (c(!0), w(F, null, Z(a.value, (r) => (c(), w("div", {
348
+ (d(!0), w(F, null, Z(a.value, (r) => (d(), w("div", {
349
349
  key: r,
350
350
  class: "wx-block-checks__line is-ok"
351
351
  }, [
352
- v(n(ye), { name: "check" }),
353
- E("span", null, k(r), 1)
352
+ v(n(we), { name: "check" }),
353
+ C("span", null, k(r), 1)
354
354
  ]))), 128))
355
355
  ]));
356
356
  }
357
- }), Yt = /* @__PURE__ */ se(hn, [["__scopeId", "data-v-e56947a8"]]), vn = { class: "wx-block-history" }, bn = { class: "wx-block-history__number" }, gn = { class: "wx-block-history__who" }, kn = /* @__PURE__ */ oe({
357
+ }), Gt = /* @__PURE__ */ se(bn, [["__scopeId", "data-v-e56947a8"]]), gn = { class: "wx-block-history" }, kn = { class: "wx-block-history__number" }, yn = { class: "wx-block-history__who" }, wn = /* @__PURE__ */ oe({
358
358
  __name: "BlockHistory",
359
359
  props: {
360
360
  block: {},
@@ -362,14 +362,14 @@ const fn = { class: "wx-block-checks" }, mn = {
362
362
  },
363
363
  emits: ["restored"],
364
364
  setup(e, { emit: l }) {
365
- const t = e, o = l, a = at(), i = Ke(a), s = de("webx-blocks"), r = it(), p = U(null);
365
+ const t = e, o = l, a = at(), i = Ke(a), s = de("webx-blocks"), r = it(), c = P(null);
366
366
  async function u() {
367
- p.value = await i.versions(t.block.id);
367
+ c.value = await i.versions(t.block.id);
368
368
  }
369
369
  function m(f) {
370
370
  return t.block.draft?.number === f.number ? "draft" : t.block.published?.number === f.number ? "live" : "replaced";
371
371
  }
372
- async function d(f) {
372
+ async function p(f) {
373
373
  if (await vt({
374
374
  title: s("page.restore-title", { number: f.number }),
375
375
  message: s("page.restore-text"),
@@ -388,75 +388,75 @@ const fn = { class: "wx-block-checks" }, mn = {
388
388
  () => {
389
389
  u();
390
390
  }
391
- ), (f, h) => (c(), w("div", vn, [
392
- p.value === null ? (c(), W(n(He), {
391
+ ), (f, h) => (d(), w("div", gn, [
392
+ c.value === null ? (d(), W(n(He), {
393
393
  key: 0,
394
394
  class: "wx-block-history__ghost",
395
395
  rows: 3
396
- })) : (c(!0), w(F, { key: 1 }, Z(p.value, (x) => (c(), w("div", {
396
+ })) : (d(!0), w(F, { key: 1 }, Z(c.value, (x) => (d(), w("div", {
397
397
  key: x.number,
398
398
  class: "wx-block-history__row"
399
399
  }, [
400
- E("code", bn, k(n(s)("page.version", { number: x.number })), 1),
401
- E("div", gn, [
402
- v(n(J), null, {
400
+ C("code", kn, k(n(s)("page.version", { number: x.number })), 1),
401
+ C("div", yn, [
402
+ v(n(Y), null, {
403
403
  default: g(() => [
404
- B(k(n(s)(`page.version-${m(x)}`)), 1)
404
+ L(k(n(s)(`page.version-${m(x)}`)), 1)
405
405
  ]),
406
406
  _: 2
407
407
  }, 1024),
408
- v(n(J), {
408
+ v(n(Y), {
409
409
  size: "sm",
410
410
  tone: "muted"
411
411
  }, {
412
412
  default: g(() => [
413
- x.created_at ? (c(), W(n(Zl), {
413
+ x.created_at ? (d(), W(n(Ql), {
414
414
  key: 0,
415
415
  value: x.created_at
416
- }, null, 8, ["value"])) : L("", !0),
417
- B(" · " + k(x.author ?? n(s)(`page.source-${x.source}`)) + " ", 1),
418
- x.comment ? (c(), w(F, { key: 1 }, [
419
- B(" · " + k(x.comment), 1)
420
- ], 64)) : L("", !0)
416
+ }, null, 8, ["value"])) : B("", !0),
417
+ L(" · " + k(x.author ?? n(s)(`page.source-${x.source}`)) + " ", 1),
418
+ x.comment ? (d(), w(F, { key: 1 }, [
419
+ L(" · " + k(x.comment), 1)
420
+ ], 64)) : B("", !0)
421
421
  ]),
422
422
  _: 2
423
423
  }, 1024)
424
424
  ]),
425
- m(x) === "draft" ? (c(), W(n(ke), {
425
+ m(x) === "draft" ? (d(), W(n(ye), {
426
426
  key: 0,
427
427
  type: "warning",
428
428
  dot: ""
429
429
  }, {
430
430
  default: g(() => [
431
- B(k(n(s)("page.version-draft")), 1)
431
+ L(k(n(s)("page.version-draft")), 1)
432
432
  ]),
433
433
  _: 1
434
- })) : m(x) === "live" ? (c(), W(n(ke), {
434
+ })) : m(x) === "live" ? (d(), W(n(ye), {
435
435
  key: 1,
436
436
  type: "success",
437
437
  dot: ""
438
438
  }, {
439
439
  default: g(() => [
440
- B(k(n(s)("page.version-live")), 1)
440
+ L(k(n(s)("page.version-live")), 1)
441
441
  ]),
442
442
  _: 1
443
- })) : L("", !0),
444
- e.canManage && m(x) === "replaced" ? (c(), W(n(ce), {
443
+ })) : B("", !0),
444
+ e.canManage && m(x) === "replaced" ? (d(), W(n(ce), {
445
445
  key: 2,
446
446
  size: "sm",
447
447
  variant: "outline",
448
- onClick: (T) => d(x)
448
+ onClick: (T) => p(x)
449
449
  }, {
450
450
  default: g(() => [
451
- B(k(n(s)("page.restore")), 1)
451
+ L(k(n(s)("page.restore")), 1)
452
452
  ]),
453
453
  _: 1
454
- }, 8, ["onClick"])) : L("", !0)
454
+ }, 8, ["onClick"])) : B("", !0)
455
455
  ]))), 128))
456
456
  ]));
457
457
  }
458
- }), yn = /* @__PURE__ */ se(kn, [["__scopeId", "data-v-42c6b7ad"]]), tt = "wx-preview-selected", mt = "wx-preview-hover", Gt = "wx-preview-style";
459
- function dl(e, l) {
458
+ }), xn = /* @__PURE__ */ se(wn, [["__scopeId", "data-v-42c6b7ad"]]), tt = "wx-preview-selected", mt = "wx-preview-hover", Zt = "wx-preview-style";
459
+ function pl(e, l) {
460
460
  const o = (e.ownerDocument ?? e).createTreeWalker(
461
461
  e,
462
462
  128
@@ -472,8 +472,8 @@ function dl(e, l) {
472
472
  }
473
473
  return null;
474
474
  }
475
- function pl(e, l, t) {
476
- const o = dl(e, l);
475
+ function fl(e, l, t) {
476
+ const o = pl(e, l);
477
477
  if (!o) return !1;
478
478
  const a = o.start.parentNode;
479
479
  if (!a) return !1;
@@ -482,40 +482,40 @@ function pl(e, l, t) {
482
482
  const s = o.end.nextSibling;
483
483
  let r = o.start;
484
484
  for (; r; ) {
485
- const d = r.nextSibling, f = r === o.end;
485
+ const p = r.nextSibling, f = r === o.end;
486
486
  if (a.removeChild(r), f) break;
487
- r = d;
487
+ r = p;
488
488
  }
489
- const p = i.content, u = Array.from(p.childNodes);
490
- a.insertBefore(p, s);
489
+ const c = i.content, u = Array.from(c.childNodes);
490
+ a.insertBefore(c, s);
491
491
  const m = e.defaultView?.webx;
492
492
  if (m?.mount)
493
- for (const d of u)
494
- d.nodeType === 1 && m.mount(d);
493
+ for (const p of u)
494
+ p.nodeType === 1 && m.mount(p);
495
495
  return !0;
496
496
  }
497
- function zt(e, l) {
498
- const t = dl(e, l);
497
+ function Dt(e, l) {
498
+ const t = pl(e, l);
499
499
  if (!t) return null;
500
500
  for (let o = t.start.nextSibling; o && o !== t.end; o = o.nextSibling)
501
501
  if (o.nodeType === 1) return o;
502
502
  return null;
503
503
  }
504
- function kt(e, l) {
505
- Dt(e);
504
+ function yt(e, l) {
505
+ Ot(e);
506
506
  for (const o of Array.from(e.querySelectorAll(`.${tt}`)))
507
507
  o.classList.remove(tt);
508
508
  if (l === null) return null;
509
- const t = zt(e, l);
509
+ const t = Dt(e, l);
510
510
  return t?.classList.add(tt), t;
511
511
  }
512
- function Zt(e, l) {
513
- Dt(e);
512
+ function Xt(e, l) {
513
+ Ot(e);
514
514
  for (const t of Array.from(e.querySelectorAll(`.${mt}`)))
515
515
  t.classList.remove(mt);
516
- l !== null && zt(e, l)?.classList.add(mt);
516
+ l !== null && Dt(e, l)?.classList.add(mt);
517
517
  }
518
- function Xt(e) {
518
+ function Qt(e) {
519
519
  let l = e?.nodeType === 1 ? e : e?.parentElement ?? null;
520
520
  for (; l; ) {
521
521
  let t = 0;
@@ -533,19 +533,19 @@ function Xt(e) {
533
533
  }
534
534
  return null;
535
535
  }
536
- function wn(e, l) {
537
- Dt(e);
536
+ function _n(e, l) {
537
+ Ot(e);
538
538
  let t = null;
539
539
  function o(s) {
540
- const r = Xt(s.target);
540
+ const r = Qt(s.target);
541
541
  r === null ? lt(s) : Oe(s), l.select(r);
542
542
  }
543
543
  function a(s) {
544
- const r = Xt(s.target);
545
- r !== t && (t = r, Zt(e, r));
544
+ const r = Qt(s.target);
545
+ r !== t && (t = r, Xt(e, r));
546
546
  }
547
547
  function i() {
548
- t = null, Zt(e, null);
548
+ t = null, Xt(e, null);
549
549
  }
550
550
  return e.addEventListener("click", o, !0), e.addEventListener("auxclick", lt, !0), e.addEventListener("submit", Oe, !0), e.addEventListener("dragstart", Oe, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
551
551
  release() {
@@ -560,7 +560,7 @@ function lt(e) {
560
560
  const l = e.target;
561
561
  (l?.nodeType === Node.ELEMENT_NODE ? l : l?.parentElement ?? null)?.closest("a[href], area[href]") && e.preventDefault();
562
562
  }
563
- function xn(e) {
563
+ function $n(e) {
564
564
  const l = [
565
565
  ["click", lt],
566
566
  ["auxclick", lt],
@@ -574,61 +574,61 @@ function xn(e) {
574
574
  }
575
575
  };
576
576
  }
577
- const ht = "sample", Ct = "wx-stage-styles";
578
- function _n(e, l) {
579
- let t = e.getElementById(Ct);
580
- t === null && (t = e.createElement("style"), t.id = Ct, (e.head ?? e.documentElement).appendChild(t)), t.textContent = l.styles;
577
+ const ht = "sample", Tt = "wx-stage-styles";
578
+ function Sn(e, l) {
579
+ let t = e.getElementById(Tt);
580
+ t === null && (t = e.createElement("style"), t.id = Tt, (e.head ?? e.documentElement).appendChild(t)), t.textContent = l.styles;
581
581
  const o = `<!--wx:${ht}-->`, a = l.html.trimStart().startsWith(o) ? l.html : `${o}${l.html}<!--/wx:${ht}-->`;
582
- return pl(e, ht, a);
582
+ return fl(e, ht, a);
583
583
  }
584
- function $n(e, l) {
584
+ function En(e, l) {
585
585
  const t = e.createElement("script");
586
586
  t.textContent = l, e.body.appendChild(t);
587
587
  }
588
- function Dt(e) {
589
- if (e.getElementById(Gt)) return;
588
+ function Ot(e) {
589
+ if (e.getElementById(Zt)) return;
590
590
  const l = e.createElement("style");
591
- l.id = Gt, l.textContent = `.${tt}{outline:2px solid #427edd;outline-offset:-2px;}.${mt}:not(.${tt}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(l);
591
+ l.id = Zt, l.textContent = `.${tt}{outline:2px solid #427edd;outline-offset:-2px;}.${mt}:not(.${tt}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(l);
592
592
  }
593
- function fl(e) {
594
- const l = e.base ? `<base href="${Tt(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", o = e.script && e.runtime ? `<script src="${Tt(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
593
+ function ml(e) {
594
+ const l = e.base ? `<base href="${Ct(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", o = e.script && e.runtime ? `<script src="${Ct(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
595
595
  return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${l}<style>html,body{margin:0}body{container-type:inline-size}</style>${t}<style>${e.styles}</style></head><body>${e.html}${o}</body></html>`;
596
596
  }
597
- const ml = "<!--wx-thumb-->";
598
- function Sn(e, l) {
599
- const t = new DOMParser().parseFromString(e, "text/html"), o = Tn(t, `wx:${ht}`);
597
+ const hl = "<!--wx-thumb-->";
598
+ function Tn(e, l) {
599
+ const t = new DOMParser().parseFromString(e, "text/html"), o = An(t, `wx:${ht}`);
600
600
  if (o === null) return null;
601
601
  const a = (u) => u === null ? null : new URL(u, new URL(l, location.href)).href, i = [];
602
602
  for (const u of Array.from(t.head.children)) {
603
- const m = u.tagName.toLowerCase(), d = (u.getAttribute("rel") ?? "").toLowerCase().split(/\s+/);
604
- if (m === "style" && u.id !== Ct)
603
+ const m = u.tagName.toLowerCase(), p = (u.getAttribute("rel") ?? "").toLowerCase().split(/\s+/);
604
+ if (m === "style" && u.id !== Tt)
605
605
  i.push(u.outerHTML);
606
- else if (m === "link" && (d.includes("stylesheet") || d.includes("preload") && u.getAttribute("as") === "font")) {
606
+ else if (m === "link" && (p.includes("stylesheet") || p.includes("preload") && u.getAttribute("as") === "font")) {
607
607
  const f = u.cloneNode(!1);
608
608
  f.setAttribute("href", a(u.getAttribute("href")) ?? ""), i.push(f.outerHTML);
609
609
  }
610
610
  }
611
- let s = ml, r = o.parentElement;
611
+ let s = hl, r = o.parentElement;
612
612
  for (; r !== null && r !== t.body && r !== t.documentElement; ) {
613
613
  const u = r.cloneNode(!1);
614
614
  u.innerHTML = s, s = u.outerHTML, r = r.parentElement;
615
615
  }
616
- const p = (u) => Array.from(u.attributes).map((m) => ` ${m.name}="${Tt(m.value)}"`).join("");
617
- return `<!doctype html><html${p(t.documentElement)}><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${i.join("")}</head><body${p(t.body)}>${s}</body></html>`;
616
+ const c = (u) => Array.from(u.attributes).map((m) => ` ${m.name}="${Ct(m.value)}"`).join("");
617
+ return `<!doctype html><html${c(t.documentElement)}><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${i.join("")}</head><body${c(t.body)}>${s}</body></html>`;
618
618
  }
619
619
  function Cn(e, l) {
620
- return e.replace("</head>", () => `<style>${l.styles}</style></head>`).replace(ml, () => l.html);
620
+ return e.replace("</head>", () => `<style>${l.styles}</style></head>`).replace(hl, () => l.html);
621
621
  }
622
- function Tn(e, l) {
622
+ function An(e, l) {
623
623
  const t = e.createTreeWalker(e.body ?? e.documentElement, NodeFilter.SHOW_COMMENT);
624
624
  for (let o = t.nextNode(); o !== null; o = t.nextNode())
625
625
  if (o.data.trim() === l) return o;
626
626
  return null;
627
627
  }
628
- function Tt(e) {
628
+ function Ct(e) {
629
629
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
630
630
  }
631
- const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, An = ["src", "srcdoc", "title"], Bn = /* @__PURE__ */ oe({
631
+ const Vn = { class: "wx-block-stage" }, Ln = { class: "wx-block-stage__bar" }, Bn = ["src", "srcdoc", "title"], Wn = /* @__PURE__ */ oe({
632
632
  __name: "BlockStage",
633
633
  props: {
634
634
  html: {},
@@ -643,24 +643,24 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
643
643
  { value: 1280, icon: "monitor", ariaLabel: t("page.width-desktop") },
644
644
  { value: 834, icon: "tablet", ariaLabel: t("page.width-tablet") },
645
645
  { value: 390, icon: "smartphone", ariaLabel: t("page.width-phone") }
646
- ]), a = U(1280), i = U(null), s = U(null), r = bt(i), p = U(360), u = U(!1);
646
+ ]), a = P(1280), i = P(null), s = P(null), r = gt(i), c = P(360), u = P(!1);
647
647
  ue([r, o], () => {
648
648
  if (u.value || r.value === 0) return;
649
- const D = o.value.find((P) => r.value / P.value >= 0.45);
649
+ const D = o.value.find((U) => r.value / U.value >= 0.45);
650
650
  a.value = (D ?? o.value[o.value.length - 1]).value;
651
651
  });
652
652
  function m(D) {
653
653
  u.value = !0, a.value = D;
654
654
  }
655
- const d = S(() => r.value === 0 ? 1 : Math.min(1, r.value / a.value)), f = S(
656
- () => l.stage ? void 0 : fl({
655
+ const p = S(() => r.value === 0 ? 1 : Math.min(1, r.value / a.value)), f = S(
656
+ () => l.stage ? void 0 : ml({
657
657
  html: l.html,
658
658
  styles: l.styles,
659
659
  script: l.script,
660
660
  runtime: l.runtime,
661
661
  base: typeof location > "u" ? null : location.origin + "/"
662
662
  })
663
- ), h = U(0);
663
+ ), h = P(0);
664
664
  let x = null;
665
665
  ue(
666
666
  () => l.script,
@@ -671,23 +671,23 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
671
671
  function T() {
672
672
  const D = s.value?.contentDocument?.body;
673
673
  if (!D) return;
674
- const P = D.ownerDocument.defaultView, Q = P && parseFloat(P.getComputedStyle(D).marginBottom) || 0, le = D.getBoundingClientRect().bottom + Q + (P?.scrollY ?? 0);
675
- p.value = Math.max(120, Math.ceil(Math.max(D.scrollHeight, le)));
674
+ const U = D.ownerDocument.defaultView, Q = U && parseFloat(U.getComputedStyle(D).marginBottom) || 0, le = D.getBoundingClientRect().bottom + Q + (U?.scrollY ?? 0);
675
+ c.value = Math.max(120, Math.ceil(Math.max(D.scrollHeight, le)));
676
676
  }
677
677
  let _ = null, b = null;
678
678
  function $() {
679
679
  _?.release(), _ = null, b?.disconnect(), b = null;
680
680
  }
681
681
  function R(D) {
682
- l.stage && (l.script && x !== l.script && (x = l.script, $n(D, l.script)), _n(D, { html: l.html, styles: l.styles }));
682
+ l.stage && (l.script && x !== l.script && (x = l.script, En(D, l.script)), Sn(D, { html: l.html, styles: l.styles }));
683
683
  }
684
684
  function G() {
685
685
  $();
686
686
  const D = s.value?.contentDocument;
687
687
  if (!D?.body) return;
688
- l.stage && (x = null, _ = xn(D), R(D)), T();
689
- const P = D.defaultView?.ResizeObserver;
690
- P && (b = new P(() => T()), b.observe(D.body));
688
+ l.stage && (x = null, _ = $n(D), R(D)), T();
689
+ const U = D.defaultView?.ResizeObserver;
690
+ U && (b = new U(() => T()), b.observe(D.body));
691
691
  }
692
692
  ue(
693
693
  () => [l.html, l.styles],
@@ -695,41 +695,41 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
695
695
  const D = s.value?.contentDocument;
696
696
  l.stage && D?.body && _ !== null && R(D);
697
697
  }
698
- ), ue(r, (D, P) => {
699
- D > 0 && P === 0 && setTimeout(T, 50);
698
+ ), ue(r, (D, U) => {
699
+ D > 0 && U === 0 && setTimeout(T, 50);
700
700
  }), ue(a, () => setTimeout(T, 50)), st($);
701
701
  const ee = S(() => ({
702
702
  width: `${a.value}px`,
703
- height: `${p.value}px`,
704
- transform: `scale(${d.value})`
703
+ height: `${c.value}px`,
704
+ transform: `scale(${p.value})`
705
705
  })), ae = S(() => ({
706
- width: `${Math.round(a.value * d.value)}px`,
707
- height: `${Math.round(p.value * d.value)}px`
706
+ width: `${Math.round(a.value * p.value)}px`,
707
+ height: `${Math.round(c.value * p.value)}px`
708
708
  }));
709
- return (D, P) => (c(), w("div", En, [
710
- E("div", Vn, [
711
- v(n(sl), {
709
+ return (D, U) => (d(), w("div", Vn, [
710
+ C("div", Ln, [
711
+ v(n(al), {
712
712
  "model-value": a.value,
713
713
  options: o.value,
714
714
  size: "sm",
715
715
  "aria-label": n(t)("page.width"),
716
- "onUpdate:modelValue": P[0] || (P[0] = (Q) => m(Number(Q)))
716
+ "onUpdate:modelValue": U[0] || (U[0] = (Q) => m(Number(Q)))
717
717
  }, null, 8, ["model-value", "options", "aria-label"])
718
718
  ]),
719
- E("div", {
719
+ C("div", {
720
720
  ref_key: "box",
721
721
  ref: i,
722
722
  class: "wx-block-stage__ground"
723
723
  }, [
724
- e.loading && !e.html ? (c(), W(n(He), {
724
+ e.loading && !e.html ? (d(), W(n(He), {
725
725
  key: 0,
726
726
  rows: 3
727
- })) : (c(), w("div", {
727
+ })) : (d(), w("div", {
728
728
  key: 1,
729
729
  class: "wx-block-stage__clip",
730
730
  style: Ie(ae.value)
731
731
  }, [
732
- (c(), w("iframe", {
732
+ (d(), w("iframe", {
733
733
  ref_key: "frame",
734
734
  ref: s,
735
735
  key: h.value,
@@ -740,121 +740,121 @@ const En = { class: "wx-block-stage" }, Vn = { class: "wx-block-stage__bar" }, A
740
740
  sandbox: "allow-same-origin allow-scripts",
741
741
  title: n(t)("page.preview"),
742
742
  onLoad: G
743
- }, null, 44, An))
743
+ }, null, 44, Bn))
744
744
  ], 4))
745
745
  ], 512)
746
746
  ]));
747
747
  }
748
- }), Ln = /* @__PURE__ */ se(Bn, [["__scopeId", "data-v-3185ee45"]]);
749
- function hl(e) {
748
+ }), Nn = /* @__PURE__ */ se(Wn, [["__scopeId", "data-v-3185ee45"]]);
749
+ function vl(e) {
750
750
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type !== "";
751
751
  }
752
752
  function rt(e) {
753
- return Array.isArray(e) && e.length > 0 && e.every(hl);
753
+ return Array.isArray(e) && e.length > 0 && e.every(vl);
754
754
  }
755
- function Et() {
755
+ function At() {
756
756
  return (typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2)).slice(0, 12);
757
757
  }
758
- function Wn(e, l = {}) {
759
- return { key: Et(), type: e, values: l };
758
+ function Mn(e, l = {}) {
759
+ return { key: At(), type: e, values: l };
760
760
  }
761
761
  function me(e, l) {
762
- return vl(e, l, null, null);
762
+ return bl(e, l, null, null);
763
763
  }
764
- function vl(e, l, t, o) {
764
+ function bl(e, l, t, o) {
765
765
  for (let a = 0; a < e.length; a++) {
766
766
  const i = e[a];
767
767
  if (i.key === l) return { node: i, parent: t, field: o, list: e, index: a };
768
768
  for (const [s, r] of Object.entries(i.values ?? {}))
769
769
  if (rt(r)) {
770
- const p = vl(r, l, i, s);
771
- if (p) return p;
770
+ const c = bl(r, l, i, s);
771
+ if (c) return c;
772
772
  }
773
773
  }
774
774
  return null;
775
775
  }
776
776
  function ut(e, l, t = 0, o = null) {
777
777
  for (const a of e)
778
- if (hl(a)) {
778
+ if (vl(a)) {
779
779
  l(a, t, o);
780
780
  for (const i of Object.values(a.values ?? {}))
781
781
  rt(i) && ut(i, l, t + 1, a);
782
782
  }
783
783
  }
784
- function Mn(e, l) {
784
+ function zn(e, l) {
785
785
  let t = 0;
786
786
  return ut(e, (o) => {
787
787
  o.type === l && t++;
788
788
  }), t;
789
789
  }
790
- function Nn(e) {
790
+ function Dn(e) {
791
791
  let l = 0;
792
792
  for (const t of Object.values(e.values ?? {}))
793
793
  rt(t) && ut(t, () => l++);
794
794
  return l;
795
795
  }
796
- function $a(e) {
796
+ function Ca(e) {
797
797
  const l = [];
798
798
  return ut(e, (t) => {
799
799
  l.includes(t.type) || l.push(t.type);
800
800
  }), l;
801
801
  }
802
- function Ot(e) {
802
+ function It(e) {
803
803
  const l = [];
804
804
  for (const t of e)
805
- t.type === "wx-blocks" && l.push(t), t.children && l.push(...Ot(t.children));
805
+ t.type === "wx-blocks" && l.push(t), t.children && l.push(...It(t.children));
806
806
  return l;
807
807
  }
808
- function bl(e) {
808
+ function gl(e) {
809
809
  const l = {};
810
810
  for (const [t, o] of Object.entries(e.values ?? {}))
811
- l[t] = rt(o) ? o.map(bl) : Ae(o);
812
- return e.hidden === !0 ? { key: Et(), type: e.type, hidden: !0, values: l } : { key: Et(), type: e.type, values: l };
811
+ l[t] = rt(o) ? o.map(gl) : Ve(o);
812
+ return e.hidden === !0 ? { key: At(), type: e.type, hidden: !0, values: l } : { key: At(), type: e.type, values: l };
813
813
  }
814
- function zn(e, l, t) {
815
- const o = Ae(e), a = me(o, l);
814
+ function On(e, l, t) {
815
+ const o = Ve(e), a = me(o, l);
816
816
  return a ? (t ? a.node.hidden = !0 : delete a.node.hidden, o) : e;
817
817
  }
818
- function Dn(e, l, t) {
818
+ function In(e, l, t) {
819
819
  if (l === null) return e;
820
820
  const o = me(e, l);
821
821
  if (!o || t === null) return null;
822
822
  const a = o.node.values[t];
823
823
  return Array.isArray(a) || (o.node.values[t] = []), o.node.values[t];
824
824
  }
825
- function yt(e, l, t, o, a) {
826
- const i = Ae(e), s = Dn(i, l, t);
825
+ function wt(e, l, t, o, a) {
826
+ const i = Ve(e), s = In(i, l, t);
827
827
  return s ? (s.splice(Math.max(0, Math.min(o, s.length)), 0, a), i) : e;
828
828
  }
829
- function Qt(e, l) {
830
- const t = Ae(e), o = me(t, l);
829
+ function el(e, l) {
830
+ const t = Ve(e), o = me(t, l);
831
831
  return o ? (o.list.splice(o.index, 1), t) : e;
832
832
  }
833
- function On(e, l, t) {
834
- const o = Ae(e), a = me(o, l);
833
+ function Pn(e, l, t) {
834
+ const o = Ve(e), a = me(o, l);
835
835
  return a ? (a.node.values = t, o) : e;
836
836
  }
837
- function In(e, l, t, o) {
838
- if (l === null) return Ae(o);
839
- const a = Ae(e), i = me(a, l);
840
- return !i || t === null ? e : (i.node.values[t] = Ae(o), a);
837
+ function Un(e, l, t, o) {
838
+ if (l === null) return Ve(o);
839
+ const a = Ve(e), i = me(a, l);
840
+ return !i || t === null ? e : (i.node.values[t] = Ve(o), a);
841
841
  }
842
- function Ae(e) {
842
+ function Ve(e) {
843
843
  return e === void 0 ? e : JSON.parse(JSON.stringify(e));
844
844
  }
845
- function wt(e) {
845
+ function xt(e) {
846
846
  return [
847
- on({ icons: !1 }),
848
- an.languageData.of(() => [{ autocomplete: e }])
847
+ an({ icons: !1 }),
848
+ un.languageData.of(() => [{ autocomplete: e }])
849
849
  ];
850
850
  }
851
- const Un = [
851
+ const Rn = [
852
852
  ["block", "key, type, version, depth, value()"],
853
853
  ["entity", "the page or article the block stands on"]
854
- ], Pn = ["key", "type", "version", "depth"], gl = ["url", "alt", "title", "path"], Rn = [...gl, "thumb", "name", "extension", "mime", "size", "width", "height"], jn = ["wx-media"], Fn = ["wx-gallery", "wx-files"], Hn = ["items", "groups", "filter"], Kn = {
854
+ ], jn = ["key", "type", "version", "depth"], kl = ["url", "alt", "title", "path"], Fn = [...kl, "thumb", "name", "extension", "mime", "size", "width", "height"], Hn = ["wx-media"], Kn = ["wx-gallery", "wx-files"], qn = ["items", "groups", "filter"], Yn = {
855
855
  items: ["id", "anchor", "categories"],
856
856
  groups: ["id", "title", "items"]
857
- }, qn = {
857
+ }, Jn = {
858
858
  faq: ["question", "answer"],
859
859
  services: ["title", "url", "lead", "cover", "fields"],
860
860
  reviews: [
@@ -882,8 +882,43 @@ const Un = [
882
882
  "fields"
883
883
  ],
884
884
  team: ["name", "initials", "job_title", "text", "photo", "socials", "service_links", "fields"]
885
- };
886
- function Jn({
885
+ }, yl = {
886
+ banners: [
887
+ "id",
888
+ "anchor",
889
+ "place",
890
+ "title",
891
+ "text",
892
+ "image",
893
+ "image_mobile",
894
+ "video",
895
+ "buttons",
896
+ "fields"
897
+ ],
898
+ banners_layout: [
899
+ "layout",
900
+ "interval",
901
+ "autoplay",
902
+ "loop",
903
+ "arrows",
904
+ "dots",
905
+ "pause_on_hover",
906
+ "ratio",
907
+ "ratio_mobile",
908
+ "breakpoint",
909
+ "video_on_mobile"
910
+ ]
911
+ }, bt = "helper:", Gn = {
912
+ banners: { buttons: ["label", "url", "new_tab", "rel", "variant"] }
913
+ }, Zn = [
914
+ [
915
+ "@foreach banners",
916
+ "@foreach (banners('${place}')->get() as $banner)\n ${}\n@endforeach",
917
+ "the banners of a place"
918
+ ],
919
+ ["@php banners_layout", "@php($layout = banners_layout('${place}'))", "its layout and options"]
920
+ ];
921
+ function Xn({
887
922
  schema: e,
888
923
  styles: l,
889
924
  types: t = () => [],
@@ -891,38 +926,38 @@ function Jn({
891
926
  }) {
892
927
  return (a) => {
893
928
  const i = a.state.sliceDoc(Math.max(0, a.pos - 200), a.pos), s = /<x-webx-block\b[^<>]*?\btype\s*=\s*(["'])([\w-]*)$/.exec(i);
894
- if (s) return Yn(a, s[1], s[2], t());
929
+ if (s) return Qn(a, s[1], s[2], t());
895
930
  const r = /\$block->(\w*)$/.exec(i);
896
- if (r) return lo(a, r[1]);
897
- const p = /\$(\w+)\[\s*(['"]?)(\w*)$/.exec(i);
898
- if (p) return no(a, p[1], p[2], p[3], e());
931
+ if (r) return ao(a, r[1]);
932
+ const c = /\$(\w+)\[\s*(['"]?)(\w*)$/.exec(i);
933
+ if (c) return io(a, c[1], c[2], c[3], e());
899
934
  const u = /\$(\w*)$/.exec(i);
900
935
  if (u)
901
936
  return {
902
937
  from: a.pos - u[0].length,
903
- options: eo(e(), a.state.doc.toString()),
938
+ options: oo(e(), a.state.doc.toString()),
904
939
  validFor: /^\$\w*$/
905
940
  };
906
941
  const m = /(\{\{|\{!!)(\s*)(\w*)$/.exec(i);
907
- if (m) return to(a, m[1], m[2], m[3], e());
908
- const d = Gn(i);
909
- if (d !== null) return Zn(a, d, t(), o);
942
+ if (m) return so(a, m[1], m[2], m[3], e());
943
+ const p = eo(i);
944
+ if (p !== null) return to(a, p, t(), o);
910
945
  const f = /<(x-[\w:-]*)$/.exec(i);
911
946
  if (f) {
912
947
  const T = a.state.sliceDoc(0, a.pos - f[0].length);
913
- return Xn(a, f[1], Qn(T), o);
948
+ return lo(a, f[1], no(T), o);
914
949
  }
915
950
  const h = /\bclass\s*=\s*"([^"]*)$/.exec(i);
916
- if (h) return so(a, h[1], l());
951
+ if (h) return uo(a, h[1], l());
917
952
  const x = /(?:^|[\s>(])@(\w*)$/.exec(i);
918
953
  return x ? {
919
954
  from: a.pos - x[1].length - 1,
920
- options: ao(e()),
955
+ options: co(e()),
921
956
  validFor: /^@\w*$/
922
957
  } : null;
923
958
  };
924
959
  }
925
- function Yn(e, l, t, o) {
960
+ function Qn(e, l, t, o) {
926
961
  return o.length === 0 ? null : {
927
962
  from: e.pos - t.length,
928
963
  options: o.map((a, i) => ({
@@ -931,13 +966,13 @@ function Yn(e, l, t, o) {
931
966
  info: a.title,
932
967
  type: "type",
933
968
  boost: (a.kind === "component" ? 50 : 0) - i / 100,
934
- apply: (s, r, p, u) => {
935
- const m = /^[\w-]*/.exec(s.state.sliceDoc(u, u + 64))[0], d = u + m.length, f = s.state.sliceDoc(d, d + 1) === l, h = `${a.slug}${f ? "" : l}`;
969
+ apply: (s, r, c, u) => {
970
+ const m = /^[\w-]*/.exec(s.state.sliceDoc(u, u + 64))[0], p = u + m.length, f = s.state.sliceDoc(p, p + 1) === l, h = `${a.slug}${f ? "" : l}`;
936
971
  s.dispatch({
937
- changes: { from: p, to: d, insert: h },
972
+ changes: { from: c, to: p, insert: h },
938
973
  // Past the closing quote: the attributes come next.
939
- selection: { anchor: p + h.length + (f ? 1 : 0) },
940
- annotations: Je.of(r),
974
+ selection: { anchor: c + h.length + (f ? 1 : 0) },
975
+ annotations: Ye.of(r),
941
976
  userEvent: "input.complete"
942
977
  });
943
978
  }
@@ -945,7 +980,7 @@ function Yn(e, l, t, o) {
945
980
  validFor: /^[\w-]*$/
946
981
  };
947
982
  }
948
- function Gn(e) {
983
+ function eo(e) {
949
984
  const l = e.lastIndexOf("<x-webx-block");
950
985
  if (l === -1) return null;
951
986
  const t = e.slice(l + 13);
@@ -957,25 +992,25 @@ function Gn(e) {
957
992
  const i = /\btype\s*=\s*["']([\w-]+)["']/.exec(t);
958
993
  return { attributes: t, type: i?.[1] ?? null, bound: a[1] === ":", word: a[2] };
959
994
  }
960
- function Zn(e, l, t, o) {
995
+ function to(e, l, t, o) {
961
996
  const a = new Set([...l.attributes.matchAll(/:?([\w-]+)\s*=/g)].map((u) => u[1])), i = e.pos - l.word.length - (l.bound ? 1 : 0), s = () => {
962
997
  const u = [];
963
- if (a.has("type") || u.push(xt("type", !1, "reserved", null, 60)), !a.has("fallback") && l.type !== null) {
964
- const m = t.find((d) => d.slug === l.type)?.fallback ?? null;
965
- u.push(xt("fallback", !1, "reserved", m, -10, m));
998
+ if (a.has("type") || u.push(_t("type", !1, "reserved", null, 60)), !a.has("fallback") && l.type !== null) {
999
+ const m = t.find((p) => p.slug === l.type)?.fallback ?? null;
1000
+ u.push(_t("fallback", !1, "reserved", m, -10, m));
966
1001
  }
967
1002
  return u;
968
1003
  }, r = (u) => {
969
- const d = [...We(u ?? []).filter((f) => f.type !== "wx-slot" && f.type !== "wx-blocks").filter((f) => !a.has(f.id)).map(
970
- (f, h) => xt(f.id, f.type === "wx-data" || l.bound, f.type, f.label, 40 - h)
1004
+ const p = [...We(u ?? []).filter((f) => f.type !== "wx-slot" && f.type !== "wx-blocks").filter((f) => !a.has(f.id)).map(
1005
+ (f, h) => _t(f.id, f.type === "wx-data" || l.bound, f.type, f.label, 40 - h)
971
1006
  ), ...s()];
972
- return d.length === 0 || !e.explicit && l.word === "" && !l.bound ? null : { from: i, options: d, validFor: /^:?[\w-]*$/ };
1007
+ return p.length === 0 || !e.explicit && l.word === "" && !l.bound ? null : { from: i, options: p, validFor: /^:?[\w-]*$/ };
973
1008
  };
974
1009
  if (l.type === null) return r(null);
975
- const p = o(l.type);
976
- return p instanceof Promise ? p.then(r, () => r(null)) : r(p);
1010
+ const c = o(l.type);
1011
+ return c instanceof Promise ? c.then(r, () => r(null)) : r(c);
977
1012
  }
978
- function xt(e, l, t, o, a, i = null) {
1013
+ function _t(e, l, t, o, a, i = null) {
979
1014
  const s = `${l ? ":" : ""}${e}`;
980
1015
  return {
981
1016
  label: s,
@@ -983,50 +1018,50 @@ function xt(e, l, t, o, a, i = null) {
983
1018
  info: o ?? void 0,
984
1019
  type: "property",
985
1020
  boost: a,
986
- apply: (r, p, u, m) => {
987
- const d = `${s}="${i ?? (l ? "$" : "")}"`;
1021
+ apply: (r, c, u, m) => {
1022
+ const p = `${s}="${i ?? (l ? "$" : "")}"`;
988
1023
  r.dispatch({
989
- changes: { from: u, to: m, insert: d },
990
- selection: { anchor: u + d.length - 1 },
991
- annotations: Je.of(p),
1024
+ changes: { from: u, to: m, insert: p },
1025
+ selection: { anchor: u + p.length - 1 },
1026
+ annotations: Ye.of(c),
992
1027
  userEvent: "input.complete"
993
1028
  });
994
1029
  }
995
1030
  };
996
1031
  }
997
- function Xn(e, l, t, o) {
1032
+ function lo(e, l, t, o) {
998
1033
  const a = e.pos - l.length, i = (r) => {
999
- const p = [
1000
- _e('x-webx-block type="${type}" />', {
1034
+ const c = [
1035
+ ke('x-webx-block type="${type}" />', {
1001
1036
  label: "x-webx-block",
1002
1037
  detail: "call a block",
1003
1038
  type: "keyword"
1004
1039
  })
1005
1040
  ];
1006
1041
  for (const u of We(r ?? []).filter((m) => m.type === "wx-slot"))
1007
- p.push({
1042
+ c.push({
1008
1043
  label: `x-slot:${u.id}`,
1009
1044
  detail: "slot",
1010
1045
  info: u.label,
1011
1046
  type: "keyword",
1012
1047
  boost: 20,
1013
- apply: (m, d, f, h) => {
1048
+ apply: (m, p, f, h) => {
1014
1049
  const x = `x-slot:${u.id}>`;
1015
1050
  m.dispatch({
1016
1051
  changes: { from: f, to: h, insert: `${x}</x-slot:${u.id}>` },
1017
1052
  selection: { anchor: f + x.length },
1018
- annotations: Je.of(d),
1053
+ annotations: Ye.of(p),
1019
1054
  userEvent: "input.complete"
1020
1055
  });
1021
1056
  }
1022
1057
  });
1023
- return { from: a, options: p, validFor: /^x-[\w:-]*$/ };
1058
+ return { from: a, options: c, validFor: /^x-[\w:-]*$/ };
1024
1059
  };
1025
1060
  if (t === null) return i(null);
1026
1061
  const s = o(t);
1027
1062
  return s instanceof Promise ? s.then(i, () => i(null)) : i(s);
1028
1063
  }
1029
- function Qn(e) {
1064
+ function no(e) {
1030
1065
  const l = [];
1031
1066
  for (const t of e.matchAll(
1032
1067
  /<x-webx-block\b((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>|<\/x-webx-block\s*>/g
@@ -1034,40 +1069,40 @@ function Qn(e) {
1034
1069
  t[0].startsWith("</") ? l.pop() : t[2] !== "/" && l.push(/\btype\s*=\s*["']([\w-]+)["']/.exec(t[1] ?? "")?.[1] ?? null);
1035
1070
  return l.at(-1) ?? null;
1036
1071
  }
1037
- function eo(e, l) {
1038
- const t = wl(e).map((o, a) => ({
1072
+ function oo(e, l) {
1073
+ const t = _l(e).map((o, a) => ({
1039
1074
  label: `$${o.id}`,
1040
1075
  detail: o.type,
1041
1076
  info: o.label,
1042
1077
  type: "variable",
1043
1078
  boost: 50 - a
1044
1079
  }));
1045
- for (const o of kl(l).keys())
1080
+ for (const o of wl(l).keys())
1046
1081
  t.push({ label: `$${o}`, detail: "loop", type: "variable" });
1047
- for (const [o, a] of Un)
1082
+ for (const [o, a] of Rn)
1048
1083
  t.push({ label: `$${o}`, detail: "given", info: a, type: "variable", boost: -10 });
1049
1084
  return t.push({ label: "$slot", detail: "given", info: "what the calling tag held", boost: -15 }), t.push({ label: "$loop", detail: "given", info: "inside @foreach", boost: -20 }), t;
1050
1085
  }
1051
- function to(e, l, t, o, a) {
1052
- const i = wl(a);
1086
+ function so(e, l, t, o, a) {
1087
+ const i = _l(a);
1053
1088
  if (i.length === 0) return null;
1054
1089
  const s = l === "{{" ? "}}" : "!!}";
1055
1090
  return {
1056
1091
  from: e.pos - o.length,
1057
- options: i.map((r, p) => ({
1092
+ options: i.map((r, c) => ({
1058
1093
  label: r.id,
1059
1094
  displayLabel: `$${r.id}`,
1060
1095
  detail: r.type,
1061
1096
  info: r.label,
1062
1097
  type: "variable",
1063
- boost: 50 - p,
1064
- apply: (u, m, d, f) => {
1065
- const h = u.state.sliceDoc(f, f + 8), x = new RegExp(`^\\s*${mo(s)}`).exec(h), T = x ? /^\s/.test(h) ? "" : " " : ` ${s}`, _ = `${t === "" ? " " : ""}$${r.id}${T}`;
1098
+ boost: 50 - c,
1099
+ apply: (u, m, p, f) => {
1100
+ const h = u.state.sliceDoc(f, f + 8), x = new RegExp(`^\\s*${go(s)}`).exec(h), T = x ? /^\s/.test(h) ? "" : " " : ` ${s}`, _ = `${t === "" ? " " : ""}$${r.id}${T}`;
1066
1101
  u.dispatch({
1067
- changes: { from: d, to: f, insert: _ },
1102
+ changes: { from: p, to: f, insert: _ },
1068
1103
  // Past the closing braces: the echo is finished, the next thing is the markup.
1069
- selection: { anchor: d + _.length + (x ? x[0].length : 0) },
1070
- annotations: Je.of(m),
1104
+ selection: { anchor: p + _.length + (x ? x[0].length : 0) },
1105
+ annotations: Ye.of(m),
1071
1106
  userEvent: "input.complete"
1072
1107
  });
1073
1108
  }
@@ -1075,12 +1110,12 @@ function to(e, l, t, o, a) {
1075
1110
  validFor: /^\w*$/
1076
1111
  };
1077
1112
  }
1078
- function lo(e, l) {
1113
+ function ao(e, l) {
1079
1114
  return {
1080
1115
  from: e.pos - l.length,
1081
1116
  options: [
1082
- ...Pn.map((t) => ({ label: t, type: "property" })),
1083
- _e("value('${name}', ${default})", {
1117
+ ...jn.map((t) => ({ label: t, type: "property" })),
1118
+ ke("value('${name}', ${default})", {
1084
1119
  label: "value",
1085
1120
  detail: "('name', default)",
1086
1121
  type: "method"
@@ -1089,20 +1124,20 @@ function lo(e, l) {
1089
1124
  validFor: /^\w*$/
1090
1125
  };
1091
1126
  }
1092
- function no(e, l, t, o, a) {
1093
- const i = oo(l, a, e.state.doc.toString());
1127
+ function io(e, l, t, o, a) {
1128
+ const i = ro(l, a, e.state.doc.toString());
1094
1129
  return i.length === 0 ? null : {
1095
1130
  from: e.pos - o.length,
1096
1131
  options: i.map(([s, r]) => ({
1097
1132
  label: s,
1098
1133
  detail: r,
1099
1134
  type: "property",
1100
- apply: (p, u, m, d) => {
1101
- const f = t ? m - 1 : m, h = p.state.sliceDoc(d, d + 2), x = t || "'", T = d + (h.startsWith(x) ? 1 : 0), _ = p.state.sliceDoc(T, T + 1) === "]", b = `${x}${s}${x}${_ ? "" : "]"}`;
1102
- p.dispatch({
1135
+ apply: (c, u, m, p) => {
1136
+ const f = t ? m - 1 : m, h = c.state.sliceDoc(p, p + 2), x = t || "'", T = p + (h.startsWith(x) ? 1 : 0), _ = c.state.sliceDoc(T, T + 1) === "]", b = `${x}${s}${x}${_ ? "" : "]"}`;
1137
+ c.dispatch({
1103
1138
  changes: { from: f, to: T, insert: b },
1104
1139
  selection: { anchor: f + b.length + (_ ? 1 : 0) },
1105
- annotations: Je.of(u),
1140
+ annotations: Ye.of(u),
1106
1141
  userEvent: "input.complete"
1107
1142
  });
1108
1143
  }
@@ -1110,99 +1145,115 @@ function no(e, l, t, o, a) {
1110
1145
  validFor: /^\w*$/
1111
1146
  };
1112
1147
  }
1113
- function oo(e, l, t) {
1114
- const o = We(l).find((p) => p.id === e);
1115
- if (o && jn.includes(o.type)) return gl.map((p) => [p, o.type]);
1116
- if (o?.type === "wx-collection") return Hn.map((p) => [p, o.type]);
1117
- const a = kl(t).get(e), [i, s] = a?.split(".") ?? [], r = i ? We(l).find((p) => p.id === i) : void 0;
1148
+ function ro(e, l, t) {
1149
+ const o = We(l).find((c) => c.id === e);
1150
+ if (o && Hn.includes(o.type)) return kl.map((c) => [c, o.type]);
1151
+ if (o?.type === "wx-collection") return qn.map((c) => [c, o.type]);
1152
+ const a = wl(t).get(e), [i, s] = a?.split(".") ?? [];
1153
+ if (i?.startsWith(bt)) {
1154
+ const c = i.slice(bt.length);
1155
+ return ((s ? Gn[c]?.[s] : yl[c]) ?? []).map((m) => [m, `${c}()`]);
1156
+ }
1157
+ const r = i ? We(l).find((c) => c.id === i) : void 0;
1118
1158
  if (!r) return [];
1119
1159
  if (r.type === "wx-collection") {
1120
- const p = typeof r.props?.source == "string" ? r.props.source : r.type, u = s === "items" ? qn[p] ?? [] : [];
1121
- return [...Kn[s ?? ""] ?? [], ...u].map((m) => [m, p]);
1160
+ const c = typeof r.props?.source == "string" ? r.props.source : r.type, u = s === "items" ? Jn[c] ?? [] : [];
1161
+ return [...Yn[s ?? ""] ?? [], ...u].map((m) => [m, c]);
1122
1162
  }
1123
- return Fn.includes(r.type) ? Rn.map((p) => [p, r.type]) : r.type === "wx-repeater" ? We(r.children ?? []).map((p) => [p.id, p.type]) : [];
1163
+ return Kn.includes(r.type) ? Fn.map((c) => [c, r.type]) : r.type === "wx-repeater" ? We(r.children ?? []).map((c) => [c.id, c.type]) : [];
1124
1164
  }
1125
- function kl(e) {
1165
+ function wl(e) {
1126
1166
  const l = /* @__PURE__ */ new Map();
1167
+ for (const t of e.matchAll(
1168
+ /\b(\w+)\([^()]*\)(?:->\w+\([^()]*\))*\s+as\s+\$(\w+)|\$(\w+)\s*=\s*(\w+)\(/g
1169
+ )) {
1170
+ const o = t[1] ?? t[4];
1171
+ o in yl && l.set(t[2] ?? t[3], `${bt}${o}`);
1172
+ }
1127
1173
  for (const t of e.matchAll(
1128
1174
  /\$(\w+)(?:\[\s*['"](\w+)['"]\s*\])?\s+as\s+\$(\w+)(?:\s*=>\s*\$(\w+))?/g
1129
- ))
1130
- l.set(t[4] ?? t[3], t[2] ? `${t[1]}.${t[2]}` : t[1]);
1175
+ )) {
1176
+ const o = t[1], a = l.get(o), i = a?.startsWith(bt) ? a : o;
1177
+ l.set(t[4] ?? t[3], t[2] ? `${i}.${t[2]}` : i);
1178
+ }
1131
1179
  return l;
1132
1180
  }
1133
- function so(e, l, t) {
1181
+ function uo(e, l, t) {
1134
1182
  const o = /[\w-]*$/.exec(l)[0], a = new Set(l.split(/\s+/));
1135
1183
  return {
1136
1184
  from: e.pos - o.length,
1137
- options: yl(t).filter((i) => !a.has(i) || i === o).map((i) => ({ label: i, detail: "styles", type: "class" })),
1185
+ options: xl(t).filter((i) => !a.has(i) || i === o).map((i) => ({ label: i, detail: "styles", type: "class" })),
1138
1186
  validFor: /^[\w-]*$/
1139
1187
  };
1140
1188
  }
1141
- function ao(e) {
1189
+ function co(e) {
1142
1190
  const l = We(e).filter((t) => t.type === "wx-blocks");
1143
1191
  return [
1144
- _e("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
1145
- _e("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
1146
- _e("@foreach (${items} as ${item})\n ${}\n@endforeach", {
1192
+ ke("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
1193
+ ke("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
1194
+ ke("@foreach (${items} as ${item})\n ${}\n@endforeach", {
1147
1195
  label: "@foreach",
1148
1196
  type: "keyword"
1149
1197
  }),
1150
- _e("@forelse (${items} as ${item})\n ${}\n@empty\n ${}\n@endforelse", {
1198
+ ke("@forelse (${items} as ${item})\n ${}\n@empty\n ${}\n@endforelse", {
1151
1199
  label: "@forelse",
1152
1200
  type: "keyword"
1153
1201
  }),
1154
- _e("@unless (${condition})\n ${}\n@endunless", {
1202
+ ke("@unless (${condition})\n ${}\n@endunless", {
1155
1203
  label: "@unless",
1156
1204
  type: "keyword"
1157
1205
  }),
1158
- _e("@class([${}])", { label: "@class", type: "keyword" }),
1159
- _e("@style([${}])", { label: "@style", type: "keyword" }),
1206
+ ke("@class([${}])", { label: "@class", type: "keyword" }),
1207
+ ke("@style([${}])", { label: "@style", type: "keyword" }),
1160
1208
  ...l.map(
1161
- (t) => _e(`@blocks('${t.id}')`, {
1209
+ (t) => ke(`@blocks('${t.id}')`, {
1162
1210
  label: "@blocks",
1163
1211
  detail: `('${t.id}')`,
1164
1212
  type: "keyword",
1165
1213
  boost: 10
1166
1214
  })
1167
1215
  ),
1216
+ ...Zn.map(
1217
+ ([t, o, a]) => ke(o, { label: t, info: a, type: "function", boost: -5 })
1218
+ ),
1168
1219
  ...["@elseif", "@else", "@endif", "@endforeach", "@endisset", "@empty", "@endforelse"].map(
1169
1220
  (t) => ({ label: t, type: "keyword", boost: -10 })
1170
1221
  )
1171
1222
  ];
1172
1223
  }
1173
- function io({ slug: e, template: l }) {
1224
+ function po({ slug: e, template: l }) {
1174
1225
  return (t) => {
1175
1226
  const o = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /(?:^|[\s,>+~(}{])\.([\w-]*)$/.exec(o);
1176
1227
  if (!a) return null;
1177
1228
  const i = /[^{};]*$/.exec(o)[0];
1178
1229
  if (/^\s*[\w-]+\s*:\s/.test(i)) return null;
1179
- const s = `b-${e()}`, r = new Set(yl(t.state.doc.toString())), p = ro(l()), u = [s, ...p.filter((d) => d !== s)], m = u.map((d, f) => ({
1180
- label: `.${d}`,
1230
+ const s = `b-${e()}`, r = new Set(xl(t.state.doc.toString())), c = fo(l()), u = [s, ...c.filter((p) => p !== s)], m = u.map((p, f) => ({
1231
+ label: `.${p}`,
1181
1232
  // A class the template uses and nothing styles yet is the likeliest thing to write.
1182
- detail: r.has(d) ? "template" : "template · no rule yet",
1233
+ detail: r.has(p) ? "template" : "template · no rule yet",
1183
1234
  type: "class",
1184
- boost: (r.has(d) ? 0 : 20) + (d === s ? 30 : 0) - f / 100
1235
+ boost: (r.has(p) ? 0 : 20) + (p === s ? 30 : 0) - f / 100
1185
1236
  }));
1186
- for (const d of r)
1187
- u.includes(d) || m.push({ label: `.${d}`, detail: "styles", type: "class" });
1237
+ for (const p of r)
1238
+ u.includes(p) || m.push({ label: `.${p}`, detail: "styles", type: "class" });
1188
1239
  return { from: t.pos - a[1].length - 1, options: m, validFor: /^\.[\w-]*$/ };
1189
1240
  };
1190
1241
  }
1191
- function yl(e) {
1242
+ function xl(e) {
1192
1243
  const l = e.replace(/\/\*[\s\S]*?\*\//g, ""), t = /* @__PURE__ */ new Set(), o = [];
1193
1244
  let a = "";
1194
1245
  for (const i of l)
1195
1246
  if (i === "{") {
1196
- const s = o.at(-1) ?? [""], r = a.split(",").map((p) => p.trim()).filter((p) => p !== "" && !p.startsWith("@")).flatMap(
1197
- (p) => p.includes("&") ? s.map((u) => p.replaceAll("&", u)) : s.map((u) => u ? `${u} ${p}` : p)
1247
+ const s = o.at(-1) ?? [""], r = a.split(",").map((c) => c.trim()).filter((c) => c !== "" && !c.startsWith("@")).flatMap(
1248
+ (c) => c.includes("&") ? s.map((u) => c.replaceAll("&", u)) : s.map((u) => u ? `${u} ${c}` : c)
1198
1249
  );
1199
- for (const p of r)
1200
- for (const u of p.matchAll(/\.(-?[a-zA-Z_][\w-]*)/g)) t.add(u[1]);
1250
+ for (const c of r)
1251
+ for (const u of c.matchAll(/\.(-?[a-zA-Z_][\w-]*)/g)) t.add(u[1]);
1201
1252
  o.push(a.trim().startsWith("@") ? s : r.length ? r : s), a = "";
1202
1253
  } else i === "}" ? (o.pop(), a = "") : i === ";" ? a = "" : a += i;
1203
1254
  return [...t];
1204
1255
  }
1205
- function ro(e) {
1256
+ function fo(e) {
1206
1257
  const l = /* @__PURE__ */ new Set();
1207
1258
  for (const t of e.matchAll(/\bclass\s*=\s*"([^"]*)"/g)) {
1208
1259
  const o = t[1].replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}|@\w+(\([^)]*\))?/g, " ");
@@ -1211,7 +1262,7 @@ function ro(e) {
1211
1262
  }
1212
1263
  return [...l];
1213
1264
  }
1214
- const uo = [
1265
+ const mo = [
1215
1266
  { key: "id", value: '""', info: "The variable the template gets, in snake_case." },
1216
1267
  { key: "type", value: '""', info: "A type from the registry." },
1217
1268
  { key: "label", value: '""', info: "What the editor sees above the field." },
@@ -1223,49 +1274,49 @@ const uo = [
1223
1274
  { key: "slot", value: '""', info: "The parent's named slot to land in." },
1224
1275
  { key: "can", value: '""', info: "The permission the node needs." }
1225
1276
  ];
1226
- function co({ types: e }) {
1277
+ function ho({ types: e }) {
1227
1278
  return (l) => {
1228
- const t = po(l.state.doc.toString(), l.pos);
1279
+ const t = vo(l.state.doc.toString(), l.pos);
1229
1280
  if (!t || !t.node) return null;
1230
1281
  const o = t.string ? l.state.sliceDoc(t.string, l.pos) : /[\w-]*$/.exec(l.state.sliceDoc(Math.max(0, l.pos - 60), l.pos))[0];
1231
1282
  if (!t.string && o === "" && !l.explicit) return null;
1232
1283
  const a = l.pos - o.length, i = t.string !== null;
1233
1284
  if (t.phase === "key") {
1234
- const s = uo.filter(({ key: r }) => !t.keys.has(r) || r === o).map(
1235
- ({ key: r, value: p, info: u }, m) => ({
1285
+ const s = mo.filter(({ key: r }) => !t.keys.has(r) || r === o).map(
1286
+ ({ key: r, value: c, info: u }, m) => ({
1236
1287
  label: r,
1237
1288
  info: u,
1238
1289
  type: "property",
1239
1290
  boost: -m,
1240
- apply: (d, f, h, x) => el(d, f, h, x, i, `"${r}": ${p}`, p)
1291
+ apply: (p, f, h, x) => tl(p, f, h, x, i, `"${r}": ${c}`, c)
1241
1292
  })
1242
1293
  );
1243
1294
  return { from: a, options: s, validFor: /^[\w-]*$/ };
1244
1295
  }
1245
1296
  if (t.phase === "value" && t.key === "type") {
1246
- const s = Object.entries(e()).map(([r, p]) => ({
1297
+ const s = Object.entries(e()).map(([r, c]) => ({
1247
1298
  label: r,
1248
- detail: p.kind,
1299
+ detail: c.kind,
1249
1300
  type: "type",
1250
1301
  // Fields first: a block's schema is mostly fields, the layout only groups them.
1251
- boost: p.kind === "field" ? 1 : 0,
1252
- apply: (u, m, d, f) => el(u, m, d, f, i, `"${r}"`, "")
1302
+ boost: c.kind === "field" ? 1 : 0,
1303
+ apply: (u, m, p, f) => tl(u, m, p, f, i, `"${r}"`, "")
1253
1304
  }));
1254
1305
  return { from: a, options: s, validFor: /^[\w-]*$/ };
1255
1306
  }
1256
1307
  return null;
1257
1308
  };
1258
1309
  }
1259
- function el(e, l, t, o, a, i, s) {
1260
- const r = a ? t - 1 : t, p = /^[\w-]*"?/.exec(e.state.sliceDoc(o, o + 60))[0], u = o + (a ? p.length : /^[\w-]*/.exec(p)[0].length), m = s === '""' || s === "{}" || s === "[]" ? 1 : 0;
1310
+ function tl(e, l, t, o, a, i, s) {
1311
+ const r = a ? t - 1 : t, c = /^[\w-]*"?/.exec(e.state.sliceDoc(o, o + 60))[0], u = o + (a ? c.length : /^[\w-]*/.exec(c)[0].length), m = s === '""' || s === "{}" || s === "[]" ? 1 : 0;
1261
1312
  e.dispatch({
1262
1313
  changes: { from: r, to: u, insert: i },
1263
1314
  selection: { anchor: r + i.length - m },
1264
- annotations: Je.of(l),
1315
+ annotations: Ye.of(l),
1265
1316
  userEvent: "input.complete"
1266
- }), i.startsWith('"type"') && sn(e);
1317
+ }), i.startsWith('"type"') && rn(e);
1267
1318
  }
1268
- function po(e, l) {
1319
+ function vo(e, l) {
1269
1320
  let t = null, o = null, a = null, i = !1;
1270
1321
  const s = (r) => r?.kind === "object" && r.parent?.kind === "array" && (r.parent.parent === null || r.parent.under === "children");
1271
1322
  for (let r = 0; r <= e.length && (r === l && (o = t?.kind === "object" ? {
@@ -1275,23 +1326,23 @@ function po(e, l) {
1275
1326
  keys: t.keys,
1276
1327
  string: a ? a.start + 1 : null
1277
1328
  } : null), r !== e.length); r++) {
1278
- const p = e[r];
1329
+ const c = e[r];
1279
1330
  if (a) {
1280
1331
  if (i) i = !1;
1281
- else if (p === "\\") i = !0;
1282
- else if (p === '"' || p === `
1332
+ else if (c === "\\") i = !0;
1333
+ else if (c === '"' || c === `
1283
1334
  `) {
1284
1335
  const u = e.slice(a.start + 1, r);
1285
1336
  t?.kind === "object" && (a.key ? (t.keys.add(u), t.key = u, t.phase = "colon") : t.phase === "value" && (t.phase = "after")), a = null;
1286
1337
  }
1287
1338
  continue;
1288
1339
  }
1289
- if (!/\s/.test(p))
1290
- if (p === '"')
1340
+ if (!/\s/.test(c))
1341
+ if (c === '"')
1291
1342
  a = { start: r, key: t?.kind === "object" && t.phase === "key" };
1292
- else if (p === "{" || p === "[") {
1343
+ else if (c === "{" || c === "[") {
1293
1344
  const u = {
1294
- kind: p === "{" ? "object" : "array",
1345
+ kind: c === "{" ? "object" : "array",
1295
1346
  parent: t,
1296
1347
  under: t?.kind === "object" ? t.key : null,
1297
1348
  keys: /* @__PURE__ */ new Set(),
@@ -1299,28 +1350,28 @@ function po(e, l) {
1299
1350
  key: null
1300
1351
  };
1301
1352
  t?.kind === "object" && (t.phase = "after"), t = u;
1302
- } else p === "}" || p === "]" ? t = t?.parent ?? null : p === ":" ? t?.kind === "object" && (t.phase = "value") : p === "," && t?.kind === "object" && (t.phase = "key", t.key = null);
1353
+ } else c === "}" || c === "]" ? t = t?.parent ?? null : c === ":" ? t?.kind === "object" && (t.phase = "value") : c === "," && t?.kind === "object" && (t.phase = "key", t.key = null);
1303
1354
  }
1304
1355
  return o;
1305
1356
  }
1306
1357
  function We(e) {
1307
1358
  const l = [];
1308
1359
  for (const t of e)
1309
- !t || typeof t != "object" || (fo.has(t.type) ? l.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
1360
+ !t || typeof t != "object" || (bo.has(t.type) ? l.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
1310
1361
  return l;
1311
1362
  }
1312
- function wl(e) {
1363
+ function _l(e) {
1313
1364
  return We(e).filter((l) => l.type !== "wx-blocks");
1314
1365
  }
1315
- const fo = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1316
- function mo(e) {
1366
+ const bo = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1367
+ function go(e) {
1317
1368
  return e.replace(/[.*+?^${}()|[\]\\!]/g, "\\$&");
1318
1369
  }
1319
- const ho = ["block", "entity", "loop", "slot", "__env", "errors", "app"];
1320
- function vo(e, l, t) {
1370
+ const ko = ["block", "entity", "loop", "slot", "__env", "errors", "app"];
1371
+ function yo(e, l, t) {
1321
1372
  const o = [];
1322
1373
  /data-wx-block\s*=/.test(l.template) || o.push({ file: "template", code: "no-marker", line: null, message: t("checks.no-marker") });
1323
- const a = bo(l.template, l.schema);
1374
+ const a = wo(l.template, l.schema);
1324
1375
  a.length > 0 && o.push({
1325
1376
  file: "template",
1326
1377
  code: "variables-missing",
@@ -1330,35 +1381,35 @@ function vo(e, l, t) {
1330
1381
  })
1331
1382
  });
1332
1383
  const i = [], s = [], r = `.b-${e}`;
1333
- for (const [m, d] of go(l.styles))
1334
- m.startsWith(r) || m.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(m) ? s.push([m, d]) : i.push([m, d]));
1384
+ for (const [m, p] of xo(l.styles))
1385
+ m.startsWith(r) || m.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(m) ? s.push([m, p]) : i.push([m, p]));
1335
1386
  i.length > 0 && o.push({
1336
1387
  file: "styles",
1337
1388
  code: "stray-selectors",
1338
1389
  line: i[0][1],
1339
- message: t("checks.stray-selectors", { slug: e, selectors: tl(i) })
1390
+ message: t("checks.stray-selectors", { slug: e, selectors: ll(i) })
1340
1391
  }), s.length > 0 && o.push({
1341
1392
  file: "styles",
1342
1393
  code: "bare-selectors",
1343
1394
  line: s[0][1],
1344
- message: t("checks.bare-selectors", { selectors: tl(s) })
1395
+ message: t("checks.bare-selectors", { selectors: ll(s) })
1345
1396
  });
1346
- const p = _l(l.styles), u = /@media\b/.exec(p);
1397
+ const c = Sl(l.styles), u = /@media\b/.exec(c);
1347
1398
  return u && o.push({
1348
1399
  file: "styles",
1349
1400
  code: "media-query",
1350
- line: $l(p, u.index),
1401
+ line: El(c, u.index),
1351
1402
  message: t("checks.media-query")
1352
1403
  }), o;
1353
1404
  }
1354
- function xl(e) {
1405
+ function $l(e) {
1355
1406
  const l = [];
1356
1407
  for (const t of e)
1357
- t.id && l.push(t.id), t.children && l.push(...xl(t.children));
1408
+ t.id && l.push(t.id), t.children && l.push(...$l(t.children));
1358
1409
  return l;
1359
1410
  }
1360
- function bo(e, l) {
1361
- const t = /* @__PURE__ */ new Set([...xl(l), ...ho]);
1411
+ function wo(e, l) {
1412
+ const t = /* @__PURE__ */ new Set([...$l(l), ...ko]);
1362
1413
  for (const a of e.matchAll(/\bas\s+\$([a-zA-Z_]\w*)(?:\s*=>\s*\$([a-zA-Z_]\w*))?/g))
1363
1414
  t.add(a[1]), a[2] && t.add(a[2]);
1364
1415
  for (const a of e.matchAll(/\$([a-zA-Z_]\w*)\s*(?:=[^=]|\+\+|--|\.=|\+=|-=)/g))
@@ -1370,37 +1421,37 @@ function bo(e, l) {
1370
1421
  }
1371
1422
  return o;
1372
1423
  }
1373
- function go(e) {
1374
- const l = _l(e), t = [];
1424
+ function xo(e) {
1425
+ const l = Sl(e), t = [];
1375
1426
  for (const o of l.matchAll(/([^{};]+)\{/g)) {
1376
1427
  const a = o[1], i = a.trim();
1377
1428
  if (!(i === "" || i.startsWith("@")))
1378
1429
  for (const s of a.split(",")) {
1379
1430
  const r = s.trim();
1380
- r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, $l(l, o.index + a.indexOf(r))]);
1431
+ r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, El(l, o.index + a.indexOf(r))]);
1381
1432
  }
1382
1433
  }
1383
1434
  return t;
1384
1435
  }
1385
- function _l(e) {
1436
+ function Sl(e) {
1386
1437
  return e.replace(/\/\*[\s\S]*?\*\//g, (l) => l.replace(/[^\n]/g, " "));
1387
1438
  }
1388
- function $l(e, l) {
1439
+ function El(e, l) {
1389
1440
  return e.slice(0, Math.max(0, l)).split(`
1390
1441
  `).length;
1391
1442
  }
1392
- function tl(e) {
1443
+ function ll(e) {
1393
1444
  const l = [...new Set(e.map(([t]) => t))];
1394
1445
  return l.slice(0, 3).join(", ") + (l.length > 3 ? ", …" : "");
1395
1446
  }
1396
- const It = /* @__PURE__ */ Symbol("wx-blocks-preview");
1397
- function Sa(e) {
1398
- Wt(It, e);
1447
+ const Pt = /* @__PURE__ */ Symbol("wx-blocks-preview");
1448
+ function Aa(e) {
1449
+ Nt(Pt, e);
1399
1450
  }
1400
- function Ca() {
1401
- return Fe(It, null);
1451
+ function Va() {
1452
+ return Fe(Pt, null);
1402
1453
  }
1403
- const ll = /* @__PURE__ */ Symbol("wx-blocks-root"), Sl = /* @__PURE__ */ Symbol("wx-blocks-owner");
1454
+ const nl = /* @__PURE__ */ Symbol("wx-blocks-root"), Tl = /* @__PURE__ */ Symbol("wx-blocks-owner");
1404
1455
  function Ut(e) {
1405
1456
  return e.map((l) => ({
1406
1457
  ...l,
@@ -1418,68 +1469,68 @@ function qe(e, l) {
1418
1469
  function $e(e) {
1419
1470
  return e.kind ?? "block";
1420
1471
  }
1421
- function Tl(e, l) {
1472
+ function Al(e, l) {
1422
1473
  return e === 0 ? l("components.not-called") : e === 1 ? l("components.in-block") : l("components.in-blocks", { count: e });
1423
1474
  }
1424
- const ko = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1425
- function Pt(e) {
1475
+ const _o = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1476
+ function Rt(e) {
1426
1477
  const l = [];
1427
1478
  for (const t of e)
1428
- !t || typeof t != "object" || (ko.has(t.type) ? l.push(...Pt(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
1479
+ !t || typeof t != "object" || (_o.has(t.type) ? l.push(...Rt(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
1429
1480
  return l;
1430
1481
  }
1431
- function yo(e, l, t = {}, o = null) {
1432
- const a = Pt(l), i = [`type="${e}"`];
1433
- for (const p of a) {
1434
- if (p.type === "wx-slot" || p.type === "wx-blocks") continue;
1435
- const u = t[p.id];
1482
+ function $o(e, l, t = {}, o = null) {
1483
+ const a = Rt(l), i = [`type="${e}"`];
1484
+ for (const c of a) {
1485
+ if (c.type === "wx-slot" || c.type === "wx-blocks") continue;
1486
+ const u = t[c.id];
1436
1487
  i.push(
1437
- p.type !== "wx-data" && (typeof u == "string" || typeof u == "number") ? `${p.id}="${String(u).replace(/"/g, "&quot;")}"` : `:${p.id}="$${wo(p.id)}"`
1488
+ c.type !== "wx-data" && (typeof u == "string" || typeof u == "number") ? `${c.id}="${String(u).replace(/"/g, "&quot;")}"` : `:${c.id}="$${So(c.id)}"`
1438
1489
  );
1439
1490
  }
1440
1491
  o && i.push(`fallback="${o}"`);
1441
- const s = a.filter((p) => p.type === "wx-slot"), r = `<x-webx-block ${i.join(" ")}`;
1492
+ const s = a.filter((c) => c.type === "wx-slot"), r = `<x-webx-block ${i.join(" ")}`;
1442
1493
  return s.length === 0 ? `${r} />` : [
1443
1494
  `${r}>`,
1444
- ...s.map((p) => ` <x-slot:${p.id}>…</x-slot:${p.id}>`),
1495
+ ...s.map((c) => ` <x-slot:${c.id}>…</x-slot:${c.id}>`),
1445
1496
  "</x-webx-block>"
1446
1497
  ].join(`
1447
1498
  `);
1448
1499
  }
1449
- function wo(e) {
1500
+ function So(e) {
1450
1501
  return e.replace(/-(\w)/g, (l, t) => t.toUpperCase());
1451
1502
  }
1452
- const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split" }, $o = {
1503
+ const Eo = { class: "wx-block-editor" }, To = { class: "wx-block-editor__split" }, Co = {
1453
1504
  type: "button",
1454
1505
  class: "wx-block-editor__uses"
1455
- }, So = { class: "wx-block-editor__usage" }, Co = {
1506
+ }, Ao = { class: "wx-block-editor__usage" }, Vo = {
1456
1507
  key: 0,
1457
1508
  class: "wx-block-editor__use"
1458
- }, To = { class: "wx-block-editor__pane" }, Eo = {
1509
+ }, Lo = { class: "wx-block-editor__pane" }, Bo = {
1459
1510
  key: 0,
1460
1511
  class: "wx-block-editor__pills"
1461
- }, Vo = ["disabled", "onClick", "textContent"], Ao = { class: "wx-block-editor__call-tag" }, Bo = { key: 0 }, Lo = {
1512
+ }, Wo = ["disabled", "onClick", "textContent"], No = { class: "wx-block-editor__call-tag" }, Mo = { key: 0 }, zo = {
1462
1513
  key: 0,
1463
1514
  class: "wx-block-editor__shape-fields"
1464
- }, Wo = { class: "wx-block-editor__shape-type" }, Mo = { class: "wx-block-editor__pane" }, No = { class: "wx-block-editor__pane" }, zo = { class: "wx-block-editor__note" }, Do = { class: "wx-block-editor__split" }, Oo = { class: "wx-block-editor__pane" }, Io = { class: "wx-block-editor__note" }, Uo = { class: "wx-block-editor__settings" }, Po = {
1515
+ }, Do = { class: "wx-block-editor__shape-type" }, Oo = { class: "wx-block-editor__pane" }, Io = { class: "wx-block-editor__pane" }, Po = { class: "wx-block-editor__note" }, Uo = { class: "wx-block-editor__split" }, Ro = { class: "wx-block-editor__pane" }, jo = { class: "wx-block-editor__note" }, Fo = { class: "wx-block-editor__settings" }, Ho = {
1465
1516
  key: 5,
1466
1517
  class: "is-wide wx-block-editor__danger"
1467
- }, Ro = /* @__PURE__ */ oe({
1518
+ }, Ko = /* @__PURE__ */ oe({
1468
1519
  __name: "BlockEditorPage",
1469
1520
  props: {
1470
1521
  base: { default: "/blocks" }
1471
1522
  },
1472
1523
  setup(e) {
1473
- const l = e, t = at(), o = Ke(t), a = nn(), i = ul();
1474
- Ne();
1475
- const s = de("webx-blocks"), r = it(), p = S(() => Number(a.params.id)), u = U(null), m = U([]), d = U(!0), f = U(!1), h = U(!1), x = U("template"), T = S(() => {
1476
- const C = t.state.manifest?.modules.find((y) => y.id === "blocks")?.meta;
1524
+ const l = e, t = at(), o = Ke(t), a = sn(), i = cl();
1525
+ Me();
1526
+ const s = de("webx-blocks"), r = it(), c = S(() => Number(a.params.id)), u = P(null), m = P([]), p = P(!0), f = P(!1), h = P(!1), x = P("template"), T = S(() => {
1527
+ const E = t.state.manifest?.modules.find((y) => y.id === "blocks")?.meta;
1477
1528
  return {
1478
- groups: C?.groups ?? [],
1479
- editing: C?.editing ?? !0,
1480
- provides: C?.provides ?? []
1529
+ groups: E?.groups ?? [],
1530
+ editing: E?.editing ?? !0,
1531
+ provides: E?.provides ?? []
1481
1532
  };
1482
- }), _ = S(() => t.can("blocks.manage") && T.value.editing), b = gt({
1533
+ }), _ = S(() => t.can("blocks.manage") && T.value.editing), b = kt({
1483
1534
  kind: "block",
1484
1535
  slug: "",
1485
1536
  title: "",
@@ -1492,8 +1543,8 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1492
1543
  max_per_entity: null,
1493
1544
  is_enabled: !0
1494
1545
  });
1495
- Wt(
1496
- Sl,
1546
+ Nt(
1547
+ Tl,
1497
1548
  S(
1498
1549
  () => u.value ? {
1499
1550
  ...u.value,
@@ -1503,33 +1554,33 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1503
1554
  } : null
1504
1555
  )
1505
1556
  );
1506
- const $ = gt({
1557
+ const $ = kt({
1507
1558
  schema: [],
1508
1559
  template: "",
1509
1560
  styles: "",
1510
1561
  script: null,
1511
1562
  sample: {}
1512
- }), R = U("[]"), G = U(null), ee = U(""), ae = U({}), D = U(null), P = gt({
1563
+ }), R = P("[]"), G = P(null), ee = P(""), ae = P({}), D = P(null), U = kt({
1513
1564
  html: "",
1514
1565
  styles: "",
1515
1566
  script: null,
1516
1567
  runtime: null,
1517
1568
  stage: null,
1518
1569
  loading: !1
1519
- }), Q = S(() => JSON.stringify({ settings: b, content: $ })), le = S(() => ee.value !== "" && Q.value !== ee.value), Se = S(() => vo(b.slug, $, s)), he = U([]), ne = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map();
1520
- async function Be() {
1570
+ }), Q = S(() => JSON.stringify({ settings: b, content: $ })), le = S(() => ee.value !== "" && Q.value !== ee.value), Se = S(() => yo(b.slug, $, s)), he = P([]), ne = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map();
1571
+ async function Le() {
1521
1572
  try {
1522
- const C = await o.index();
1573
+ const E = await o.index();
1523
1574
  ne.clear();
1524
- for (const y of C.blocks) ne.set(y.slug, y.id);
1575
+ for (const y of E.blocks) ne.set(y.slug, y.id);
1525
1576
  he.value = [
1526
- ...C.blocks.map((y) => ({
1577
+ ...E.blocks.map((y) => ({
1527
1578
  slug: y.slug,
1528
1579
  title: y.title,
1529
1580
  kind: $e(y),
1530
- fallback: C.declared.find((K) => K.slug === y.slug)?.fallback ?? null
1581
+ fallback: E.declared.find((K) => K.slug === y.slug)?.fallback ?? null
1531
1582
  })),
1532
- ...C.declared.filter((y) => !y.customised).map((y) => ({
1583
+ ...E.declared.filter((y) => !y.customised).map((y) => ({
1533
1584
  slug: y.slug,
1534
1585
  title: y.title,
1535
1586
  kind: "component",
@@ -1539,20 +1590,20 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1539
1590
  } catch {
1540
1591
  }
1541
1592
  }
1542
- function ze(C) {
1543
- if (C === b.slug) return $.schema;
1544
- const y = ne.get(C);
1593
+ function ze(E) {
1594
+ if (E === b.slug) return $.schema;
1595
+ const y = ne.get(E);
1545
1596
  if (y === void 0) return null;
1546
- let K = we.get(C);
1597
+ let K = xe.get(E);
1547
1598
  return K === void 0 && (K = o.get(y).then(
1548
- (M) => M.content?.schema ?? null,
1599
+ (N) => N.content?.schema ?? null,
1549
1600
  () => null
1550
- ), we.set(C, K)), K;
1601
+ ), xe.set(E, K)), K;
1551
1602
  }
1552
- const xe = {
1603
+ const _e = {
1553
1604
  template: [
1554
- wt(
1555
- Jn({
1605
+ xt(
1606
+ Xn({
1556
1607
  schema: () => $.schema,
1557
1608
  styles: () => $.styles,
1558
1609
  types: () => he.value,
@@ -1561,78 +1612,78 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1561
1612
  )
1562
1613
  ],
1563
1614
  styles: [
1564
- wt(io({ slug: () => b.slug, template: () => $.template }))
1615
+ xt(po({ slug: () => b.slug, template: () => $.template }))
1565
1616
  ],
1566
1617
  // The renderer's own types under the panel's, the same merge the sample form is drawn with.
1567
- schema: [wt(co({ types: () => ({ ...ft, ...t.types }) }))]
1618
+ schema: [xt(ho({ types: () => ({ ...ft, ...t.types }) }))]
1568
1619
  }, ie = S(() => {
1569
- const C = [...T.value.groups];
1570
- return C.includes(b.group) || C.push(b.group), C.map((y) => ({ value: y, label: qe(y, s) }));
1620
+ const E = [...T.value.groups];
1621
+ return E.includes(b.group) || E.push(b.group), E.map((y) => ({ value: y, label: qe(y, s) }));
1571
1622
  }), ve = S({
1572
1623
  get: () => $.sample,
1573
- set: (C) => {
1574
- $.sample = C;
1624
+ set: (E) => {
1625
+ $.sample = E;
1575
1626
  }
1576
- }), Ce = S(() => N($.schema));
1577
- function N(C) {
1627
+ }), Ee = S(() => M($.schema));
1628
+ function M(E) {
1578
1629
  const y = [];
1579
- for (const K of C)
1580
- K.type !== "wx-blocks" && !(K.children?.length && !K.name) && y.push(K.id), K.children && y.push(...N(K.children));
1630
+ for (const K of E)
1631
+ K.type !== "wx-blocks" && !(K.children?.length && !K.name) && y.push(K.id), K.children && y.push(...M(K.children));
1581
1632
  return y;
1582
1633
  }
1583
- function j(C) {
1584
- u.value = C, Object.assign(b, {
1585
- kind: $e(C),
1586
- slug: C.slug,
1587
- title: C.title,
1588
- description: C.description,
1589
- icon: C.icon,
1590
- group: C.group,
1591
- sort: C.sort,
1592
- allow: C.allow ?? [],
1593
- allowed_in: C.allowed_in ?? [],
1594
- max_per_entity: C.max_per_entity,
1595
- is_enabled: C.is_enabled
1634
+ function j(E) {
1635
+ u.value = E, Object.assign(b, {
1636
+ kind: $e(E),
1637
+ slug: E.slug,
1638
+ title: E.title,
1639
+ description: E.description,
1640
+ icon: E.icon,
1641
+ group: E.group,
1642
+ sort: E.sort,
1643
+ allow: E.allow ?? [],
1644
+ allowed_in: E.allowed_in ?? [],
1645
+ max_per_entity: E.max_per_entity,
1646
+ is_enabled: E.is_enabled
1596
1647
  });
1597
- const y = C.content ?? {
1648
+ const y = E.content ?? {
1598
1649
  schema: [],
1599
1650
  template: "",
1600
1651
  styles: "",
1601
1652
  script: null,
1602
1653
  sample: {}
1603
1654
  };
1604
- Object.assign($, Ae(y)), R.value = JSON.stringify(y.schema, null, 2), G.value = null, ee.value = Q.value;
1655
+ Object.assign($, Ve(y)), R.value = JSON.stringify(y.schema, null, 2), G.value = null, ee.value = Q.value;
1605
1656
  }
1606
1657
  async function q() {
1607
- d.value = !0;
1658
+ p.value = !0;
1608
1659
  try {
1609
- j(await o.get(p.value)), m.value = await o.usage(p.value), Be();
1610
- } catch (C) {
1611
- X.danger(r(C));
1660
+ j(await o.get(c.value)), m.value = await o.usage(c.value), Le();
1661
+ } catch (E) {
1662
+ X.danger(r(E));
1612
1663
  } finally {
1613
- d.value = !1;
1664
+ p.value = !1;
1614
1665
  }
1615
1666
  }
1616
- function pe(C) {
1617
- R.value = C;
1667
+ function pe(E) {
1668
+ R.value = E;
1618
1669
  try {
1619
- const y = JSON.parse(C);
1670
+ const y = JSON.parse(E);
1620
1671
  if (!Array.isArray(y)) throw new Error("not a list");
1621
1672
  $.schema = y, G.value = null;
1622
1673
  } catch (y) {
1623
1674
  G.value = s("page.schema-invalid", { error: y.message });
1624
1675
  }
1625
1676
  }
1626
- let V, O = 0;
1677
+ let A, O = 0;
1627
1678
  function I() {
1628
- clearTimeout(V), V = setTimeout(() => {
1629
- Y();
1679
+ clearTimeout(A), A = setTimeout(() => {
1680
+ J();
1630
1681
  }, 250);
1631
1682
  }
1632
- async function Y() {
1683
+ async function J() {
1633
1684
  if (!u.value) return;
1634
- const C = ++O;
1635
- P.loading = !0;
1685
+ const E = ++O;
1686
+ U.loading = !0;
1636
1687
  try {
1637
1688
  const y = await o.render(u.value.id, {
1638
1689
  values: $.sample,
@@ -1643,12 +1694,12 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1643
1694
  schema: $.schema
1644
1695
  } : void 0
1645
1696
  });
1646
- if (C !== O) return;
1647
- P.html = y.html, P.styles = y.styles, P.script = y.script, P.runtime = y.runtime, P.stage = y.stage ?? null;
1697
+ if (E !== O) return;
1698
+ U.html = y.html, U.styles = y.styles, U.script = y.script, U.runtime = y.runtime, U.stage = y.stage ?? null;
1648
1699
  } catch (y) {
1649
- C === O && X.danger(r(y));
1700
+ E === O && X.danger(r(y));
1650
1701
  } finally {
1651
- C === O && (P.loading = !1);
1702
+ E === O && (U.loading = !1);
1652
1703
  }
1653
1704
  }
1654
1705
  ue(
@@ -1656,22 +1707,22 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1656
1707
  I,
1657
1708
  { deep: !0 }
1658
1709
  );
1659
- const Te = U(null);
1660
- function Ye(C) {
1661
- return `{{ $${C} }}`;
1710
+ const Te = P(null);
1711
+ function Je(E) {
1712
+ return `{{ $${E} }}`;
1662
1713
  }
1663
- function Le(C) {
1714
+ function Be(E) {
1664
1715
  const K = Te.value?.view?.value;
1665
1716
  if (!K) {
1666
- $.template += `{{ $${C} }}`;
1717
+ $.template += `{{ $${E} }}`;
1667
1718
  return;
1668
1719
  }
1669
- K.dispatch(K.state.replaceSelection(`{{ $${C} }}`)), K.focus();
1720
+ K.dispatch(K.state.replaceSelection(`{{ $${E} }}`)), K.focus();
1670
1721
  }
1671
- async function Ue() {
1722
+ async function Pe() {
1672
1723
  if (!u.value) return;
1673
1724
  f.value = !0, ae.value = {}, D.value = null;
1674
- const C = u.value.draft?.number ?? null;
1725
+ const E = u.value.draft?.number ?? null;
1675
1726
  try {
1676
1727
  const y = await o.update(u.value.id, {
1677
1728
  ...b,
@@ -1682,7 +1733,7 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1682
1733
  content: G.value ? { ...$, schema: void 0 } : $
1683
1734
  });
1684
1735
  j(y), X.success(
1685
- y.draft && y.draft.number !== C ? s("page.saved", { number: y.draft.number }) : s("page.unchanged")
1736
+ y.draft && y.draft.number !== E ? s("page.saved", { number: y.draft.number }) : s("page.unchanged")
1686
1737
  );
1687
1738
  } catch (y) {
1688
1739
  const K = y.body;
@@ -1692,14 +1743,14 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1692
1743
  }
1693
1744
  }
1694
1745
  async function ct() {
1695
- if (!(!u.value?.draft || (le.value && await Ue(), !u.value.draft) || !await vt({
1746
+ if (!(!u.value?.draft || (le.value && await Pe(), !u.value.draft) || !await vt({
1696
1747
  title: s("page.publish-title", { number: u.value.draft.number }),
1697
1748
  // A component stands on no page itself; what a new version reaches is the blocks calling it.
1698
1749
  // A declared place is also printed by the module's views, which the count does not see.
1699
- message: Ve.value ? s("components.publish-declared", {
1700
- module: Ve.value,
1701
- count: Ee.value.length
1702
- }) : fe.value ? s("components.publish-text", { count: Ee.value.length }) : s("page.publish-text", { count: u.value.usage_count }),
1750
+ message: Ae.value ? s("components.publish-declared", {
1751
+ module: Ae.value,
1752
+ count: Ce.value.length
1753
+ }) : fe.value ? s("components.publish-text", { count: Ce.value.length }) : s("page.publish-text", { count: u.value.usage_count }),
1703
1754
  confirmText: s("page.publish"),
1704
1755
  cancelText: s("page.cancel")
1705
1756
  }))) {
@@ -1714,13 +1765,13 @@ const xo = { class: "wx-block-editor" }, _o = { class: "wx-block-editor__split"
1714
1765
  }
1715
1766
  }
1716
1767
  }
1717
- async function A() {
1768
+ async function V() {
1718
1769
  if (!u.value) return;
1719
- const C = u.value.declared != null;
1770
+ const E = u.value.declared != null;
1720
1771
  if (await vt({
1721
- title: C ? s("components.delete-declared-title", { title: u.value.title }) : s("page.delete-title", { title: u.value.title }),
1722
- message: s(C ? "components.delete-declared-text" : "page.delete-text"),
1723
- confirmText: s(C ? "components.delete-declared" : "page.delete"),
1772
+ title: E ? s("components.delete-declared-title", { title: u.value.title }) : s("page.delete-title", { title: u.value.title }),
1773
+ message: s(E ? "components.delete-declared-text" : "page.delete-text"),
1774
+ confirmText: s(E ? "components.delete-declared" : "page.delete"),
1724
1775
  cancelText: s("page.cancel"),
1725
1776
  tone: "danger"
1726
1777
  }))
@@ -1761,56 +1812,56 @@ setInterval(() => el.classList.toggle('is-second'), seconds * 1000)`
1761
1812
 
1762
1813
  new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1763
1814
  }
1764
- ]), te = S(() => m.value.slice(0, 5)), fe = S(() => b.kind === "component"), Ee = S(() => u.value?.used_by ?? []), Ve = S(() => {
1765
- const C = u.value?.declared?.module;
1766
- return C ? t.state.manifest?.modules.find((y) => y.id === C)?.title ?? C.charAt(0).toUpperCase() + C.slice(1) : null;
1815
+ ]), te = S(() => m.value.slice(0, 5)), fe = S(() => b.kind === "component"), Ce = S(() => u.value?.used_by ?? []), Ae = S(() => {
1816
+ const E = u.value?.declared?.module;
1817
+ return E ? t.state.manifest?.modules.find((y) => y.id === E)?.title ?? E.charAt(0).toUpperCase() + E.slice(1) : null;
1767
1818
  }), Ge = S(
1768
- () => fe.value ? Tl(Ee.value.length, s) : Cl(u.value?.usage_count ?? 0, s)
1819
+ () => fe.value ? Al(Ce.value.length, s) : Cl(u.value?.usage_count ?? 0, s)
1769
1820
  ), Ze = S(
1770
- () => (u.value?.usage_count ?? 0) > 0 || Ee.value.length > 0 || Ve.value !== null
1771
- ), Pe = S(() => {
1772
- const C = u.value?.usage_count ?? 0;
1773
- return C > 0 ? C === 1 ? s("page.delete-used-one") : s("page.delete-used", { count: C }) : Ee.value.length > 0 ? s("components.delete-called", {
1774
- titles: Ee.value.map((y) => `"${y.title}"`).join(", ")
1821
+ () => (u.value?.usage_count ?? 0) > 0 || Ce.value.length > 0 || Ae.value !== null
1822
+ ), Ue = S(() => {
1823
+ const E = u.value?.usage_count ?? 0;
1824
+ return E > 0 ? E === 1 ? s("page.delete-used-one") : s("page.delete-used", { count: E }) : Ce.value.length > 0 ? s("components.delete-called", {
1825
+ titles: Ce.value.map((y) => `"${y.title}"`).join(", ")
1775
1826
  }) : null;
1776
1827
  }), dt = S(
1777
- () => yo(b.slug, $.schema, $.sample, u.value?.declared?.fallback ?? null)
1778
- ), Vl = S(
1779
- () => Pt($.schema).filter((C) => C.type === "wx-data").map((C) => {
1780
- const y = typeof C.props?.shape == "string" ? C.props.shape : null;
1828
+ () => $o(b.slug, $.schema, $.sample, u.value?.declared?.fallback ?? null)
1829
+ ), Ll = S(
1830
+ () => Rt($.schema).filter((E) => E.type === "wx-data").map((E) => {
1831
+ const y = typeof E.props?.shape == "string" ? E.props.shape : null;
1781
1832
  return {
1782
- id: C.id,
1833
+ id: E.id,
1783
1834
  shape: y,
1784
1835
  fields: y ? u.value?.shape?.[y]?.fields ?? [] : []
1785
1836
  };
1786
1837
  })
1787
1838
  );
1788
- async function Al() {
1839
+ async function Bl() {
1789
1840
  try {
1790
1841
  await navigator.clipboard.writeText(dt.value), X.success(s("components.copied"));
1791
1842
  } catch {
1792
1843
  }
1793
1844
  }
1794
- function ge(C) {
1795
- return ae.value[C]?.[0];
1845
+ function ge(E) {
1846
+ return ae.value[E]?.[0];
1796
1847
  }
1797
- function Rt(C) {
1798
- le.value && C.preventDefault();
1848
+ function jt(E) {
1849
+ le.value && E.preventDefault();
1799
1850
  }
1800
1851
  ot(() => {
1801
- q(), window.addEventListener("beforeunload", Rt);
1852
+ q(), window.addEventListener("beforeunload", jt);
1802
1853
  }), st(() => {
1803
- clearTimeout(V), window.removeEventListener("beforeunload", Rt);
1804
- }), ue(p, () => {
1854
+ clearTimeout(A), window.removeEventListener("beforeunload", jt);
1855
+ }), ue(c, () => {
1805
1856
  q();
1806
1857
  });
1807
- const Bl = S(() => [
1858
+ const Wl = S(() => [
1808
1859
  { value: "block", label: s("components.kind-block") },
1809
1860
  { value: "component", label: s("components.kind-component") }
1810
- ]), Ll = S(
1861
+ ]), Nl = S(
1811
1862
  () => _.value ? [
1812
1863
  { key: "save", label: s("page.save"), loading: f.value, run: () => {
1813
- Ue();
1864
+ Pe();
1814
1865
  } },
1815
1866
  {
1816
1867
  key: "publish",
@@ -1824,16 +1875,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1824
1875
  }
1825
1876
  ] : []
1826
1877
  );
1827
- return (C, y) => {
1878
+ return (E, y) => {
1828
1879
  const K = Mt("router-link");
1829
- return c(), w("div", xo, [
1830
- d.value || !u.value ? (c(), w(F, { key: 0 }, [
1880
+ return d(), w("div", Eo, [
1881
+ p.value || !u.value ? (d(), w(F, { key: 0 }, [
1831
1882
  v(n(He), {
1832
1883
  class: "wx-block-editor__ghost-head",
1833
1884
  title: "",
1834
1885
  rows: 1
1835
1886
  }),
1836
- E("div", _o, [
1887
+ C("div", To, [
1837
1888
  v(n(De), null, {
1838
1889
  default: g(() => [
1839
1890
  v(n(He), { rows: 8 })
@@ -1847,131 +1898,131 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1847
1898
  _: 1
1848
1899
  })
1849
1900
  ])
1850
- ], 64)) : (c(), w(F, { key: 1 }, [
1851
- v(n(Xl), {
1901
+ ], 64)) : (d(), w(F, { key: 1 }, [
1902
+ v(n(en), {
1852
1903
  title: b.title,
1853
1904
  back: e.base,
1854
1905
  "back-label": n(s)("page.back"),
1855
- actions: Ll.value
1906
+ actions: Nl.value
1856
1907
  }, {
1857
1908
  "title-after": g(() => [
1858
- _.value ? (c(), W(n(Ql), {
1909
+ _.value ? (d(), W(n(tn), {
1859
1910
  key: 0,
1860
1911
  name: b.title,
1861
1912
  placeholder: n(s)("page.title"),
1862
- onRename: y[0] || (y[0] = (M) => b.title = M)
1863
- }, null, 8, ["name", "placeholder"])) : L("", !0),
1864
- le.value ? (c(), W(n(ke), {
1913
+ onRename: y[0] || (y[0] = (N) => b.title = N)
1914
+ }, null, 8, ["name", "placeholder"])) : B("", !0),
1915
+ le.value ? (d(), W(n(ye), {
1865
1916
  key: 1,
1866
1917
  type: "primary",
1867
1918
  dot: ""
1868
1919
  }, {
1869
1920
  default: g(() => [
1870
- B(k(n(s)("page.unsaved")), 1)
1921
+ L(k(n(s)("page.unsaved")), 1)
1871
1922
  ]),
1872
1923
  _: 1
1873
- })) : L("", !0),
1874
- u.value.draft ? (c(), W(n(ke), {
1924
+ })) : B("", !0),
1925
+ u.value.draft ? (d(), W(n(ye), {
1875
1926
  key: 2,
1876
1927
  type: "warning",
1877
1928
  dot: ""
1878
1929
  }, {
1879
1930
  default: g(() => [
1880
- B(k(n(s)("page.draft", { number: u.value.draft.number })), 1)
1931
+ L(k(n(s)("page.draft", { number: u.value.draft.number })), 1)
1881
1932
  ]),
1882
1933
  _: 1
1883
- })) : L("", !0),
1884
- u.value.published ? (c(), W(n(ke), {
1934
+ })) : B("", !0),
1935
+ u.value.published ? (d(), W(n(ye), {
1885
1936
  key: 3,
1886
1937
  type: "success",
1887
1938
  dot: ""
1888
1939
  }, {
1889
1940
  default: g(() => [
1890
- B(k(n(s)("page.live", { number: u.value.published.number })), 1)
1941
+ L(k(n(s)("page.live", { number: u.value.published.number })), 1)
1891
1942
  ]),
1892
1943
  _: 1
1893
- })) : (c(), W(n(ke), {
1944
+ })) : (d(), W(n(ye), {
1894
1945
  key: 4,
1895
1946
  type: "default"
1896
1947
  }, {
1897
1948
  default: g(() => [
1898
- B(k(n(s)("page.never-published")), 1)
1949
+ L(k(n(s)("page.never-published")), 1)
1899
1950
  ]),
1900
1951
  _: 1
1901
1952
  }))
1902
1953
  ]),
1903
1954
  subtitle: g(() => [
1904
- E("code", null, k(b.slug), 1),
1905
- B(" · " + k(fe.value ? n(s)("components.kind-component") : n(qe)(b.group, n(s))) + " · ", 1),
1906
- Ze.value ? (c(), W(n(Wl), {
1955
+ C("code", null, k(b.slug), 1),
1956
+ L(" · " + k(fe.value ? n(s)("components.kind-component") : n(qe)(b.group, n(s))) + " · ", 1),
1957
+ Ze.value ? (d(), W(n(Ml), {
1907
1958
  key: 0,
1908
1959
  title: n(s)("page.usage"),
1909
1960
  width: 260,
1910
1961
  align: "start"
1911
1962
  }, {
1912
1963
  trigger: g(() => [
1913
- E("button", $o, k(Ge.value), 1)
1964
+ C("button", Co, k(Ge.value), 1)
1914
1965
  ]),
1915
1966
  default: g(() => [
1916
- E("div", So, [
1917
- (c(!0), w(F, null, Z(Ee.value, (M) => (c(), W(K, {
1918
- key: `type:${M.id}`,
1919
- to: `${e.base}/${M.id}`,
1967
+ C("div", Ao, [
1968
+ (d(!0), w(F, null, Z(Ce.value, (N) => (d(), W(K, {
1969
+ key: `type:${N.id}`,
1970
+ to: `${e.base}/${N.id}`,
1920
1971
  class: "wx-block-editor__use"
1921
1972
  }, {
1922
1973
  default: g(() => [
1923
- B(k(n(s)("components.called-by", { title: M.title })), 1)
1974
+ L(k(n(s)("components.called-by", { title: N.title })), 1)
1924
1975
  ]),
1925
1976
  _: 2
1926
1977
  }, 1032, ["to"]))), 128)),
1927
- Ve.value ? (c(), w("div", Co, k(n(s)("components.module-views", { module: Ve.value })), 1)) : L("", !0),
1928
- (c(!0), w(F, null, Z(te.value, (M) => (c(), w("div", {
1929
- key: `${M.model}:${M.id}`,
1978
+ Ae.value ? (d(), w("div", Vo, k(n(s)("components.module-views", { module: Ae.value })), 1)) : B("", !0),
1979
+ (d(!0), w(F, null, Z(te.value, (N) => (d(), w("div", {
1980
+ key: `${N.model}:${N.id}`,
1930
1981
  class: "wx-block-editor__use"
1931
1982
  }, [
1932
- E("span", null, k(M.title ?? `#${M.id}`), 1),
1933
- M.published ? L("", !0) : (c(), W(n(ke), {
1983
+ C("span", null, k(N.title ?? `#${N.id}`), 1),
1984
+ N.published ? B("", !0) : (d(), W(n(ye), {
1934
1985
  key: 0,
1935
1986
  type: "warning",
1936
1987
  size: "sm"
1937
1988
  }, {
1938
1989
  default: g(() => [
1939
- B(k(n(s)("page.unpublished-page")), 1)
1990
+ L(k(n(s)("page.unpublished-page")), 1)
1940
1991
  ]),
1941
1992
  _: 1
1942
1993
  }))
1943
1994
  ]))), 128)),
1944
- m.value.length > te.value.length ? (c(), W(n(J), {
1995
+ m.value.length > te.value.length ? (d(), W(n(Y), {
1945
1996
  key: 1,
1946
1997
  size: "sm",
1947
1998
  tone: "muted"
1948
1999
  }, {
1949
2000
  default: g(() => [
1950
- B(k(n(s)("page.usage-more", { count: m.value.length - te.value.length })), 1)
2001
+ L(k(n(s)("page.usage-more", { count: m.value.length - te.value.length })), 1)
1951
2002
  ]),
1952
2003
  _: 1
1953
- })) : L("", !0)
2004
+ })) : B("", !0)
1954
2005
  ])
1955
2006
  ]),
1956
2007
  _: 1
1957
- }, 8, ["title"])) : (c(), w(F, { key: 1 }, [
1958
- B(k(Ge.value), 1)
2008
+ }, 8, ["title"])) : (d(), w(F, { key: 1 }, [
2009
+ L(k(Ge.value), 1)
1959
2010
  ], 64))
1960
2011
  ]),
1961
2012
  _: 1
1962
2013
  }, 8, ["title", "back", "back-label", "actions"]),
1963
- T.value.editing ? L("", !0) : (c(), W(n(al), {
2014
+ T.value.editing ? B("", !0) : (d(), W(n(il), {
1964
2015
  key: 0,
1965
2016
  type: "info",
1966
2017
  variant: "soft",
1967
2018
  description: n(s)("page.editing-off")
1968
2019
  }, null, 8, ["description"])),
1969
- E("div", {
1970
- class: Me(["wx-block-editor__columns", { "is-alone": !H.value }])
2020
+ C("div", {
2021
+ class: Ne(["wx-block-editor__columns", { "is-alone": !H.value }])
1971
2022
  }, [
1972
- v(n(Ml), {
2023
+ v(n(zl), {
1973
2024
  modelValue: x.value,
1974
- "onUpdate:modelValue": y[15] || (y[15] = (M) => x.value = M),
2025
+ "onUpdate:modelValue": y[15] || (y[15] = (N) => x.value = N),
1975
2026
  "keep-alive": ""
1976
2027
  }, {
1977
2028
  default: g(() => [
@@ -1980,113 +2031,113 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1980
2031
  label: n(s)("page.tab-template")
1981
2032
  }, {
1982
2033
  default: g(() => [
1983
- E("div", To, [
2034
+ C("div", Lo, [
1984
2035
  v(n(Qe), {
1985
2036
  ref_key: "templateEditor",
1986
2037
  ref: Te,
1987
2038
  modelValue: $.template,
1988
- "onUpdate:modelValue": y[1] || (y[1] = (M) => $.template = M),
2039
+ "onUpdate:modelValue": y[1] || (y[1] = (N) => $.template = N),
1989
2040
  language: "php",
1990
- extensions: xe.template,
2041
+ extensions: _e.template,
1991
2042
  readonly: !_.value,
1992
2043
  "min-height": "340px",
1993
2044
  "max-height": "70vh",
1994
2045
  "line-wrapping": ""
1995
2046
  }, null, 8, ["modelValue", "extensions", "readonly"]),
1996
- Ce.value.length ? (c(), w("div", Eo, [
1997
- v(n(J), {
2047
+ Ee.value.length ? (d(), w("div", Bo, [
2048
+ v(n(Y), {
1998
2049
  size: "sm",
1999
2050
  tone: "muted"
2000
2051
  }, {
2001
2052
  default: g(() => [
2002
- B(k(n(s)("page.insert-field")), 1)
2053
+ L(k(n(s)("page.insert-field")), 1)
2003
2054
  ]),
2004
2055
  _: 1
2005
2056
  }),
2006
- (c(!0), w(F, null, Z(Ce.value, (M) => (c(), w("button", {
2007
- key: M,
2057
+ (d(!0), w(F, null, Z(Ee.value, (N) => (d(), w("button", {
2058
+ key: N,
2008
2059
  type: "button",
2009
2060
  class: "wx-block-editor__pill",
2010
2061
  disabled: !_.value,
2011
- onClick: (Xe) => Le(M),
2012
- textContent: k(Ye(M))
2013
- }, null, 8, Vo))), 128))
2014
- ])) : L("", !0),
2015
- v(Yt, {
2062
+ onClick: (Xe) => Be(N),
2063
+ textContent: k(Je(N))
2064
+ }, null, 8, Wo))), 128))
2065
+ ])) : B("", !0),
2066
+ v(Gt, {
2016
2067
  file: "template",
2017
2068
  lints: Se.value,
2018
2069
  slug: b.slug,
2019
2070
  error: z.value
2020
2071
  }, null, 8, ["lints", "slug", "error"])
2021
2072
  ]),
2022
- fe.value ? (c(), W(n(De), {
2073
+ fe.value ? (d(), W(n(De), {
2023
2074
  key: 0,
2024
2075
  class: "wx-block-editor__call",
2025
2076
  title: n(s)("components.call")
2026
2077
  }, {
2027
2078
  default: g(() => [
2028
- v(n(J), {
2079
+ v(n(Y), {
2029
2080
  size: "sm",
2030
2081
  tone: "muted"
2031
2082
  }, {
2032
2083
  default: g(() => [
2033
- B(k(n(s)("components.call-help")), 1)
2084
+ L(k(n(s)("components.call-help")), 1)
2034
2085
  ]),
2035
2086
  _: 1
2036
2087
  }),
2037
- E("div", Ao, [
2038
- E("pre", null, [
2039
- E("code", null, k(dt.value), 1)
2088
+ C("div", No, [
2089
+ C("pre", null, [
2090
+ C("code", null, k(dt.value), 1)
2040
2091
  ]),
2041
2092
  v(n(ce), {
2042
2093
  size: "sm",
2043
2094
  variant: "outline",
2044
- onClick: Al
2095
+ onClick: Bl
2045
2096
  }, {
2046
2097
  default: g(() => [
2047
- B(k(n(s)("components.copy")), 1)
2098
+ L(k(n(s)("components.copy")), 1)
2048
2099
  ]),
2049
2100
  _: 1
2050
2101
  })
2051
2102
  ]),
2052
- (c(!0), w(F, null, Z(Vl.value, (M) => (c(), w("div", {
2053
- key: M.id,
2103
+ (d(!0), w(F, null, Z(Ll.value, (N) => (d(), w("div", {
2104
+ key: N.id,
2054
2105
  class: "wx-block-editor__shape"
2055
2106
  }, [
2056
- v(n(J), {
2107
+ v(n(Y), {
2057
2108
  size: "sm",
2058
2109
  tone: "muted"
2059
2110
  }, {
2060
2111
  default: g(() => [
2061
- B(k(M.fields.length ? n(s)("components.shape", { name: M.id }) : n(s)("components.shape-free", { name: M.id })) + " ", 1),
2062
- M.shape ? (c(), w("code", Bo, k(M.shape), 1)) : L("", !0)
2112
+ L(k(N.fields.length ? n(s)("components.shape", { name: N.id }) : n(s)("components.shape-free", { name: N.id })) + " ", 1),
2113
+ N.shape ? (d(), w("code", Mo, k(N.shape), 1)) : B("", !0)
2063
2114
  ]),
2064
2115
  _: 2
2065
2116
  }, 1024),
2066
- M.fields.length ? (c(), w("dl", Lo, [
2067
- (c(!0), w(F, null, Z(M.fields, (Xe) => (c(), w(F, {
2117
+ N.fields.length ? (d(), w("dl", zo, [
2118
+ (d(!0), w(F, null, Z(N.fields, (Xe) => (d(), w(F, {
2068
2119
  key: Xe.name
2069
2120
  }, [
2070
- E("dt", null, [
2071
- E("code", null, k(Xe.name), 1),
2072
- E("span", Wo, k(Xe.type), 1)
2121
+ C("dt", null, [
2122
+ C("code", null, k(Xe.name), 1),
2123
+ C("span", Do, k(Xe.type), 1)
2073
2124
  ]),
2074
- E("dd", null, k(Xe.description), 1)
2125
+ C("dd", null, k(Xe.description), 1)
2075
2126
  ], 64))), 128))
2076
- ])) : L("", !0)
2127
+ ])) : B("", !0)
2077
2128
  ]))), 128)),
2078
- v(n(J), {
2129
+ v(n(Y), {
2079
2130
  size: "sm",
2080
2131
  tone: "muted"
2081
2132
  }, {
2082
2133
  default: g(() => [
2083
- B(k(n(s)("components.site-views")), 1)
2134
+ L(k(n(s)("components.site-views")), 1)
2084
2135
  ]),
2085
2136
  _: 1
2086
2137
  })
2087
2138
  ]),
2088
2139
  _: 1
2089
- }, 8, ["title"])) : L("", !0)
2140
+ }, 8, ["title"])) : B("", !0)
2090
2141
  ]),
2091
2142
  _: 1
2092
2143
  }, 8, ["label"]),
@@ -2095,17 +2146,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2095
2146
  label: n(s)("page.tab-styles")
2096
2147
  }, {
2097
2148
  default: g(() => [
2098
- E("div", Mo, [
2149
+ C("div", Oo, [
2099
2150
  v(n(Qe), {
2100
2151
  modelValue: $.styles,
2101
- "onUpdate:modelValue": y[2] || (y[2] = (M) => $.styles = M),
2152
+ "onUpdate:modelValue": y[2] || (y[2] = (N) => $.styles = N),
2102
2153
  language: "css",
2103
- extensions: xe.styles,
2154
+ extensions: _e.styles,
2104
2155
  readonly: !_.value,
2105
2156
  "min-height": "340px",
2106
2157
  "max-height": "70vh"
2107
2158
  }, null, 8, ["modelValue", "extensions", "readonly"]),
2108
- v(Yt, {
2159
+ v(Gt, {
2109
2160
  file: "styles",
2110
2161
  lints: Se.value,
2111
2162
  slug: b.slug
@@ -2119,31 +2170,31 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2119
2170
  label: n(s)("page.tab-script")
2120
2171
  }, {
2121
2172
  default: g(() => [
2122
- E("div", No, [
2173
+ C("div", Io, [
2123
2174
  v(n(Qe), {
2124
2175
  "model-value": $.script ?? "",
2125
2176
  language: "javascript",
2126
2177
  readonly: !_.value,
2127
2178
  "min-height": "340px",
2128
2179
  "max-height": "70vh",
2129
- "onUpdate:modelValue": y[3] || (y[3] = (M) => $.script = M || null)
2180
+ "onUpdate:modelValue": y[3] || (y[3] = (N) => $.script = N || null)
2130
2181
  }, null, 8, ["model-value", "readonly"]),
2131
- E("div", zo, [
2132
- v(n(J), {
2182
+ C("div", Po, [
2183
+ v(n(Y), {
2133
2184
  size: "sm",
2134
2185
  tone: "muted"
2135
2186
  }, {
2136
2187
  default: g(() => [
2137
- B(k(n(s)("page.script-help")), 1)
2188
+ L(k(n(s)("page.script-help")), 1)
2138
2189
  ]),
2139
2190
  _: 1
2140
2191
  }),
2141
- v(n(J), {
2192
+ v(n(Y), {
2142
2193
  size: "sm",
2143
2194
  tone: "muted"
2144
2195
  }, {
2145
2196
  default: g(() => [
2146
- B(k(T.value.provides.length ? n(s)("page.provides", { names: T.value.provides.join(", ") }) : n(s)("page.provides-none")), 1)
2197
+ L(k(T.value.provides.length ? n(s)("page.provides", { names: T.value.provides.join(", ") }) : n(s)("page.provides-none")), 1)
2147
2198
  ]),
2148
2199
  _: 1
2149
2200
  })
@@ -2154,21 +2205,21 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2154
2205
  title: n(s)("page.examples")
2155
2206
  }, {
2156
2207
  default: g(() => [
2157
- (c(!0), w(F, null, Z(be.value, (M) => (c(), w("div", {
2158
- key: M.title,
2208
+ (d(!0), w(F, null, Z(be.value, (N) => (d(), w("div", {
2209
+ key: N.title,
2159
2210
  class: "wx-block-editor__example"
2160
2211
  }, [
2161
- v(n(J), {
2212
+ v(n(Y), {
2162
2213
  size: "sm",
2163
2214
  tone: "muted"
2164
2215
  }, {
2165
2216
  default: g(() => [
2166
- B(k(M.title), 1)
2217
+ L(k(N.title), 1)
2167
2218
  ]),
2168
2219
  _: 2
2169
2220
  }, 1024),
2170
- E("pre", null, [
2171
- E("code", null, k(M.code), 1)
2221
+ C("pre", null, [
2222
+ C("code", null, k(N.code), 1)
2172
2223
  ])
2173
2224
  ]))), 128))
2174
2225
  ]),
@@ -2182,48 +2233,48 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2182
2233
  label: fe.value ? n(s)("components.tab-inputs") : n(s)("page.tab-fields")
2183
2234
  }, {
2184
2235
  default: g(() => [
2185
- E("div", Do, [
2186
- E("div", Oo, [
2236
+ C("div", Uo, [
2237
+ C("div", Ro, [
2187
2238
  v(n(Qe), {
2188
2239
  "model-value": R.value,
2189
2240
  language: "json",
2190
- extensions: xe.schema,
2241
+ extensions: _e.schema,
2191
2242
  lint: "",
2192
2243
  readonly: !_.value,
2193
2244
  "min-height": "340px",
2194
2245
  "max-height": "70vh",
2195
2246
  "onUpdate:modelValue": pe
2196
2247
  }, null, 8, ["model-value", "extensions", "readonly"]),
2197
- E("div", Io, [
2198
- G.value ? (c(), W(n(J), {
2248
+ C("div", jo, [
2249
+ G.value ? (d(), W(n(Y), {
2199
2250
  key: 0,
2200
2251
  size: "sm",
2201
2252
  tone: "danger"
2202
2253
  }, {
2203
2254
  default: g(() => [
2204
- B(k(G.value), 1)
2255
+ L(k(G.value), 1)
2205
2256
  ]),
2206
2257
  _: 1
2207
- })) : ge("content.schema") ? (c(), W(n(J), {
2258
+ })) : ge("content.schema") ? (d(), W(n(Y), {
2208
2259
  key: 1,
2209
2260
  size: "sm",
2210
2261
  tone: "danger"
2211
2262
  }, {
2212
2263
  default: g(() => [
2213
- B(k(ge("content.schema")), 1)
2264
+ L(k(ge("content.schema")), 1)
2214
2265
  ]),
2215
2266
  _: 1
2216
- })) : (c(), W(n(J), {
2267
+ })) : (d(), W(n(Y), {
2217
2268
  key: 2,
2218
2269
  size: "sm",
2219
2270
  tone: "muted"
2220
2271
  }, {
2221
2272
  default: g(() => [
2222
- B(k(fe.value ? n(s)("components.inputs-help") : n(s)("page.fields-help")), 1)
2273
+ L(k(fe.value ? n(s)("components.inputs-help") : n(s)("page.fields-help")), 1)
2223
2274
  ]),
2224
2275
  _: 1
2225
2276
  })),
2226
- v(n(en), {
2277
+ v(n(ln), {
2227
2278
  title: n(s)("help.schema-title"),
2228
2279
  body: n(s)("help.schema")
2229
2280
  }, null, 8, ["title", "body"])
@@ -2234,17 +2285,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2234
2285
  title: n(s)("page.sample")
2235
2286
  }, {
2236
2287
  default: g(() => [
2237
- $.schema.length ? (c(), W(n(cl), {
2288
+ $.schema.length ? (d(), W(n(dl), {
2238
2289
  key: 0,
2239
2290
  modelValue: ve.value,
2240
- "onUpdate:modelValue": y[4] || (y[4] = (M) => ve.value = M),
2291
+ "onUpdate:modelValue": y[4] || (y[4] = (N) => ve.value = N),
2241
2292
  root: n(Ut)($.schema),
2242
2293
  types: n(t).types,
2243
2294
  translate: n(t).i18n.t,
2244
2295
  can: n(t).can,
2245
2296
  disabled: !_.value,
2246
2297
  size: "sm"
2247
- }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : L("", !0)
2298
+ }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : B("", !0)
2248
2299
  ]),
2249
2300
  _: 1
2250
2301
  }, 8, ["title"])
@@ -2259,7 +2310,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2259
2310
  default: g(() => [
2260
2311
  v(n(De), { class: "wx-block-editor__sheet" }, {
2261
2312
  default: g(() => [
2262
- E("div", Uo, [
2313
+ C("div", Fo, [
2263
2314
  v(n(re), {
2264
2315
  label: n(s)("components.kind"),
2265
2316
  help: n(s)("components.kind-help"),
@@ -2267,10 +2318,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2267
2318
  disabled: !_.value
2268
2319
  }, {
2269
2320
  default: g(() => [
2270
- v(n($t), {
2321
+ v(n(St), {
2271
2322
  modelValue: b.kind,
2272
- "onUpdate:modelValue": y[5] || (y[5] = (M) => b.kind = M),
2273
- options: Bl.value
2323
+ "onUpdate:modelValue": y[5] || (y[5] = (N) => b.kind = N),
2324
+ options: Wl.value
2274
2325
  }, null, 8, ["modelValue", "options"])
2275
2326
  ]),
2276
2327
  _: 1
@@ -2284,12 +2335,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2284
2335
  default: g(() => [
2285
2336
  v(n(nt), {
2286
2337
  modelValue: b.slug,
2287
- "onUpdate:modelValue": y[6] || (y[6] = (M) => b.slug = M)
2338
+ "onUpdate:modelValue": y[6] || (y[6] = (N) => b.slug = N)
2288
2339
  }, null, 8, ["modelValue"])
2289
2340
  ]),
2290
2341
  _: 1
2291
2342
  }, 8, ["label", "help", "error", "disabled"]),
2292
- fe.value ? L("", !0) : (c(), W(n(re), {
2343
+ fe.value ? B("", !0) : (d(), W(n(re), {
2293
2344
  key: 0,
2294
2345
  label: n(s)("page.group"),
2295
2346
  help: n(s)("page.group-help"),
@@ -2297,9 +2348,9 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2297
2348
  disabled: !_.value
2298
2349
  }, {
2299
2350
  default: g(() => [
2300
- v(n($t), {
2351
+ v(n(St), {
2301
2352
  modelValue: b.group,
2302
- "onUpdate:modelValue": y[7] || (y[7] = (M) => b.group = M),
2353
+ "onUpdate:modelValue": y[7] || (y[7] = (N) => b.group = N),
2303
2354
  options: ie.value
2304
2355
  }, null, 8, ["modelValue", "options"])
2305
2356
  ]),
@@ -2313,10 +2364,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2313
2364
  disabled: !_.value
2314
2365
  }, {
2315
2366
  default: g(() => [
2316
- v(n(il), {
2367
+ v(n(rl), {
2317
2368
  "model-value": b.description ?? "",
2318
2369
  rows: 2,
2319
- "onUpdate:modelValue": y[8] || (y[8] = (M) => b.description = String(M ?? ""))
2370
+ "onUpdate:modelValue": y[8] || (y[8] = (N) => b.description = String(N ?? ""))
2320
2371
  }, null, 8, ["model-value"])
2321
2372
  ]),
2322
2373
  _: 1
@@ -2327,14 +2378,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2327
2378
  disabled: !_.value
2328
2379
  }, {
2329
2380
  default: g(() => [
2330
- v(n(Nl), {
2381
+ v(n(Dl), {
2331
2382
  "model-value": b.icon,
2332
2383
  clearable: "",
2333
2384
  placeholder: n(s)("page.icon-search"),
2334
2385
  "empty-text": n(s)("page.icon-none"),
2335
2386
  "unknown-text": n(s)("page.icon-unknown"),
2336
2387
  "clear-label": n(s)("page.icon-clear"),
2337
- "onUpdate:modelValue": y[9] || (y[9] = (M) => b.icon = M)
2388
+ "onUpdate:modelValue": y[9] || (y[9] = (N) => b.icon = N)
2338
2389
  }, null, 8, ["model-value", "placeholder", "empty-text", "unknown-text", "clear-label"])
2339
2390
  ]),
2340
2391
  _: 1
@@ -2346,14 +2397,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2346
2397
  disabled: !_.value
2347
2398
  }, {
2348
2399
  default: g(() => [
2349
- v(n(jt), {
2400
+ v(n(Ft), {
2350
2401
  modelValue: b.sort,
2351
- "onUpdate:modelValue": y[10] || (y[10] = (M) => b.sort = M)
2402
+ "onUpdate:modelValue": y[10] || (y[10] = (N) => b.sort = N)
2352
2403
  }, null, 8, ["modelValue"])
2353
2404
  ]),
2354
2405
  _: 1
2355
2406
  }, 8, ["label", "help", "error", "disabled"]),
2356
- fe.value ? L("", !0) : (c(), W(n(re), {
2407
+ fe.value ? B("", !0) : (d(), W(n(re), {
2357
2408
  key: 1,
2358
2409
  label: n(s)("page.allow"),
2359
2410
  help: n(s)("page.allow-help"),
@@ -2361,15 +2412,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2361
2412
  disabled: !_.value
2362
2413
  }, {
2363
2414
  default: g(() => [
2364
- v(n(Ft), {
2415
+ v(n(Ht), {
2365
2416
  modelValue: b.allow,
2366
- "onUpdate:modelValue": y[11] || (y[11] = (M) => b.allow = M),
2417
+ "onUpdate:modelValue": y[11] || (y[11] = (N) => b.allow = N),
2367
2418
  "allow-create": ""
2368
2419
  }, null, 8, ["modelValue"])
2369
2420
  ]),
2370
2421
  _: 1
2371
2422
  }, 8, ["label", "help", "error", "disabled"])),
2372
- fe.value ? L("", !0) : (c(), W(n(re), {
2423
+ fe.value ? B("", !0) : (d(), W(n(re), {
2373
2424
  key: 2,
2374
2425
  label: n(s)("page.allowed-in"),
2375
2426
  help: n(s)("page.allowed-in-help"),
@@ -2377,16 +2428,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2377
2428
  disabled: !_.value
2378
2429
  }, {
2379
2430
  default: g(() => [
2380
- v(n(Ft), {
2431
+ v(n(Ht), {
2381
2432
  modelValue: b.allowed_in,
2382
- "onUpdate:modelValue": y[12] || (y[12] = (M) => b.allowed_in = M),
2433
+ "onUpdate:modelValue": y[12] || (y[12] = (N) => b.allowed_in = N),
2383
2434
  "allow-create": "",
2384
2435
  suggestions: ["root"]
2385
2436
  }, null, 8, ["modelValue"])
2386
2437
  ]),
2387
2438
  _: 1
2388
2439
  }, 8, ["label", "help", "error", "disabled"])),
2389
- fe.value ? L("", !0) : (c(), W(n(re), {
2440
+ fe.value ? B("", !0) : (d(), W(n(re), {
2390
2441
  key: 3,
2391
2442
  label: n(s)("page.max-per-entity"),
2392
2443
  help: n(s)("page.max-per-entity-help"),
@@ -2394,51 +2445,51 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2394
2445
  disabled: !_.value
2395
2446
  }, {
2396
2447
  default: g(() => [
2397
- v(n(jt), {
2448
+ v(n(Ft), {
2398
2449
  "model-value": b.max_per_entity ?? void 0,
2399
2450
  min: 1,
2400
- "onUpdate:modelValue": y[13] || (y[13] = (M) => b.max_per_entity = M ?? null)
2451
+ "onUpdate:modelValue": y[13] || (y[13] = (N) => b.max_per_entity = N ?? null)
2401
2452
  }, null, 8, ["model-value"])
2402
2453
  ]),
2403
2454
  _: 1
2404
2455
  }, 8, ["label", "help", "error", "disabled"])),
2405
- fe.value ? L("", !0) : (c(), W(n(re), {
2456
+ fe.value ? B("", !0) : (d(), W(n(re), {
2406
2457
  key: 4,
2407
2458
  label: n(s)("page.enabled"),
2408
2459
  help: n(s)("page.enabled-help"),
2409
2460
  disabled: !_.value
2410
2461
  }, {
2411
2462
  default: g(() => [
2412
- v(n(zl), {
2463
+ v(n(Ol), {
2413
2464
  modelValue: b.is_enabled,
2414
- "onUpdate:modelValue": y[14] || (y[14] = (M) => b.is_enabled = M)
2465
+ "onUpdate:modelValue": y[14] || (y[14] = (N) => b.is_enabled = N)
2415
2466
  }, null, 8, ["modelValue"])
2416
2467
  ]),
2417
2468
  _: 1
2418
2469
  }, 8, ["label", "help", "disabled"])),
2419
- _.value ? (c(), w("div", Po, [
2470
+ _.value ? (d(), w("div", Ho, [
2420
2471
  v(n(ce), {
2421
2472
  type: "danger",
2422
2473
  variant: "outline",
2423
- disabled: Pe.value !== null,
2424
- onClick: A
2474
+ disabled: Ue.value !== null,
2475
+ onClick: V
2425
2476
  }, {
2426
2477
  default: g(() => [
2427
- B(k(u.value.declared ? n(s)("components.delete-declared") : n(s)("page.delete")), 1)
2478
+ L(k(u.value.declared ? n(s)("components.delete-declared") : n(s)("page.delete")), 1)
2428
2479
  ]),
2429
2480
  _: 1
2430
2481
  }, 8, ["disabled"]),
2431
- Pe.value ? (c(), W(n(J), {
2482
+ Ue.value ? (d(), W(n(Y), {
2432
2483
  key: 0,
2433
2484
  size: "sm",
2434
2485
  tone: "muted"
2435
2486
  }, {
2436
2487
  default: g(() => [
2437
- B(k(Pe.value), 1)
2488
+ L(k(Ue.value), 1)
2438
2489
  ]),
2439
2490
  _: 1
2440
- })) : L("", !0)
2441
- ])) : L("", !0)
2491
+ })) : B("", !0)
2492
+ ])) : B("", !0)
2442
2493
  ])
2443
2494
  ]),
2444
2495
  _: 1
@@ -2456,7 +2507,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2456
2507
  padding: "none"
2457
2508
  }, {
2458
2509
  default: g(() => [
2459
- v(yn, {
2510
+ v(xn, {
2460
2511
  block: u.value,
2461
2512
  "can-manage": _.value,
2462
2513
  onRestored: j
@@ -2470,27 +2521,27 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2470
2521
  ]),
2471
2522
  _: 1
2472
2523
  }, 8, ["modelValue"]),
2473
- Rl(v(Ln, {
2524
+ Fl(v(Nn, {
2474
2525
  class: "wx-block-editor__stage",
2475
- html: P.html,
2476
- styles: P.styles,
2477
- script: P.script,
2478
- runtime: P.runtime,
2479
- stage: P.stage,
2480
- loading: P.loading
2526
+ html: U.html,
2527
+ styles: U.styles,
2528
+ script: U.script,
2529
+ runtime: U.runtime,
2530
+ stage: U.stage,
2531
+ loading: U.loading
2481
2532
  }, null, 8, ["html", "styles", "script", "runtime", "stage", "loading"]), [
2482
- [jl, H.value]
2533
+ [Hl, H.value]
2483
2534
  ])
2484
2535
  ], 2),
2485
- _.value ? (c(), W(n(Dl), { key: 1 }, {
2536
+ _.value ? (d(), W(n(Il), { key: 1 }, {
2486
2537
  default: g(() => [
2487
2538
  v(n(ce), {
2488
2539
  variant: "outline",
2489
2540
  loading: f.value,
2490
- onClick: Ue
2541
+ onClick: Pe
2491
2542
  }, {
2492
2543
  default: g(() => [
2493
- B(k(n(s)("page.save")), 1)
2544
+ L(k(n(s)("page.save")), 1)
2494
2545
  ]),
2495
2546
  _: 1
2496
2547
  }, 8, ["loading"]),
@@ -2501,24 +2552,24 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2501
2552
  onClick: ct
2502
2553
  }, {
2503
2554
  default: g(() => [
2504
- B(k(n(s)("page.publish")), 1)
2555
+ L(k(n(s)("page.publish")), 1)
2505
2556
  ]),
2506
2557
  _: 1
2507
2558
  }, 8, ["loading", "disabled"])
2508
2559
  ]),
2509
2560
  _: 1
2510
- })) : L("", !0)
2561
+ })) : B("", !0)
2511
2562
  ], 64))
2512
2563
  ]);
2513
2564
  };
2514
2565
  }
2515
- }), jo = /* @__PURE__ */ se(Ro, [["__scopeId", "data-v-8201065d"]]), Fo = {
2566
+ }), qo = /* @__PURE__ */ se(Ko, [["__scopeId", "data-v-8201065d"]]), Yo = {
2516
2567
  key: 1,
2517
2568
  class: "wx-block-move"
2518
- }, Ho = ["disabled", "onClick"], Ko = { class: "wx-block-move__trail" }, qo = {
2569
+ }, Jo = ["disabled", "onClick"], Go = { class: "wx-block-move__trail" }, Zo = {
2519
2570
  key: 0,
2520
2571
  class: "wx-block-move__sep"
2521
- }, Jo = /* @__PURE__ */ oe({
2572
+ }, Xo = /* @__PURE__ */ oe({
2522
2573
  __name: "BlockMoveDialog",
2523
2574
  props: {
2524
2575
  title: {},
@@ -2526,12 +2577,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2526
2577
  topLabel: {}
2527
2578
  },
2528
2579
  setup(e) {
2529
- const { resolve: l, dismiss: t, open: o } = At();
2530
- Ne();
2580
+ const { resolve: l, dismiss: t, open: o } = Lt();
2581
+ Me();
2531
2582
  const a = de("webx-blocks");
2532
- return (i, s) => (c(), W(n(Bt), {
2583
+ return (i, s) => (d(), W(n(Bt), {
2533
2584
  open: n(o),
2534
- "onUpdate:open": s[1] || (s[1] = (r) => Nt(o) ? o.value = r : null),
2585
+ "onUpdate:open": s[1] || (s[1] = (r) => zt(o) ? o.value = r : null),
2535
2586
  title: n(a)("field.move-title", { title: e.title }),
2536
2587
  width: 520
2537
2588
  }, {
@@ -2541,75 +2592,75 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2541
2592
  onClick: s[0] || (s[0] = (r) => n(t)())
2542
2593
  }, {
2543
2594
  default: g(() => [
2544
- B(k(n(a)("page.cancel")), 1)
2595
+ L(k(n(a)("page.cancel")), 1)
2545
2596
  ]),
2546
2597
  _: 1
2547
2598
  })
2548
2599
  ]),
2549
2600
  default: g(() => [
2550
- e.destinations.length === 0 ? (c(), W(n(Lt), {
2601
+ e.destinations.length === 0 ? (d(), W(n(Wt), {
2551
2602
  key: 0,
2552
2603
  icon: "grid",
2553
2604
  title: n(a)("field.move-none"),
2554
2605
  size: "sm"
2555
- }, null, 8, ["title"])) : (c(), w("div", Fo, [
2556
- (c(!0), w(F, null, Z(e.destinations, (r) => (c(), w("button", {
2606
+ }, null, 8, ["title"])) : (d(), w("div", Yo, [
2607
+ (d(!0), w(F, null, Z(e.destinations, (r) => (d(), w("button", {
2557
2608
  key: `${r.parentKey}:${r.field}`,
2558
2609
  type: "button",
2559
2610
  class: "wx-block-move__place",
2560
2611
  disabled: r.full,
2561
- onClick: (p) => n(l)(r)
2612
+ onClick: (c) => n(l)(r)
2562
2613
  }, [
2563
- v(n(ye), {
2614
+ v(n(we), {
2564
2615
  name: r.parentKey === null ? "file" : "folder"
2565
2616
  }, null, 8, ["name"]),
2566
- E("span", Ko, [
2567
- r.trail.length === 0 ? (c(), w(F, { key: 0 }, [
2568
- B(k(e.topLabel), 1)
2569
- ], 64)) : (c(!0), w(F, { key: 1 }, Z(r.trail, (p, u) => (c(), w(F, { key: u }, [
2570
- u > 0 ? (c(), w("span", qo, "/")) : L("", !0),
2571
- E("span", {
2572
- class: Me({ "is-last": u === r.trail.length - 1 })
2573
- }, k(p), 3)
2617
+ C("span", Go, [
2618
+ r.trail.length === 0 ? (d(), w(F, { key: 0 }, [
2619
+ L(k(e.topLabel), 1)
2620
+ ], 64)) : (d(!0), w(F, { key: 1 }, Z(r.trail, (c, u) => (d(), w(F, { key: u }, [
2621
+ u > 0 ? (d(), w("span", Zo, "/")) : B("", !0),
2622
+ C("span", {
2623
+ class: Ne({ "is-last": u === r.trail.length - 1 })
2624
+ }, k(c), 3)
2574
2625
  ], 64))), 128))
2575
2626
  ]),
2576
- r.full ? (c(), W(n(J), {
2627
+ r.full ? (d(), W(n(Y), {
2577
2628
  key: 0,
2578
2629
  size: "sm",
2579
2630
  tone: "muted"
2580
2631
  }, {
2581
2632
  default: g(() => [
2582
- B(k(n(a)("field.move-full")), 1)
2633
+ L(k(n(a)("field.move-full")), 1)
2583
2634
  ]),
2584
2635
  _: 1
2585
- })) : L("", !0)
2586
- ], 8, Ho))), 128))
2636
+ })) : B("", !0)
2637
+ ], 8, Jo))), 128))
2587
2638
  ]))
2588
2639
  ]),
2589
2640
  _: 1
2590
2641
  }, 8, ["open", "title"]));
2591
2642
  }
2592
- }), Yo = /* @__PURE__ */ se(Jo, [["__scopeId", "data-v-41c2ff3e"]]), nl = /* @__PURE__ */ new Map();
2593
- function Go(e) {
2594
- let l = nl.get(e);
2595
- return l === void 0 && (l = fetch(e, { credentials: "same-origin", headers: { Accept: "text/html" } }).then((t) => t.ok ? t.text() : null).then((t) => t === null ? null : Sn(t, e)).catch(() => null), nl.set(e, l)), l;
2643
+ }), Qo = /* @__PURE__ */ se(Xo, [["__scopeId", "data-v-41c2ff3e"]]), ol = /* @__PURE__ */ new Map();
2644
+ function es(e) {
2645
+ let l = ol.get(e);
2646
+ return l === void 0 && (l = fetch(e, { credentials: "same-origin", headers: { Accept: "text/html" } }).then((t) => t.ok ? t.text() : null).then((t) => t === null ? null : Tn(t, e)).catch(() => null), ol.set(e, l)), l;
2596
2647
  }
2597
- function Zo() {
2598
- const e = Fe(rl, null), l = U(null), t = S(() => {
2648
+ function ts() {
2649
+ const e = Fe(ul, null), l = P(null), t = S(() => {
2599
2650
  const a = e?.state.manifest?.modules.find((i) => i.id === "blocks")?.meta?.stage;
2600
2651
  return typeof a == "string" && a !== "" ? a : null;
2601
2652
  });
2602
- return Fl(() => {
2653
+ return Kl(() => {
2603
2654
  const o = t.value;
2604
- o !== null && Go(o).then((a) => {
2655
+ o !== null && es(o).then((a) => {
2605
2656
  t.value === o && (l.value = a);
2606
2657
  });
2607
2658
  }), l;
2608
2659
  }
2609
- const Xo = ["srcdoc"], Qo = {
2660
+ const ls = ["srcdoc"], ns = {
2610
2661
  key: 1,
2611
2662
  class: "wx-block-thumb__empty"
2612
- }, _t = 1600, es = /* @__PURE__ */ oe({
2663
+ }, $t = 1600, os = /* @__PURE__ */ oe({
2613
2664
  __name: "BlockThumb",
2614
2665
  props: {
2615
2666
  thumbnail: {},
@@ -2618,7 +2669,7 @@ const Xo = ["srcdoc"], Qo = {
2618
2669
  fit: { type: Boolean, default: !1 }
2619
2670
  },
2620
2671
  setup(e) {
2621
- const l = e, t = U(null), o = bt(t), a = U(null), i = S(() => o.value > 0 ? o.value / l.width : 0.2), s = S(() => {
2672
+ const l = e, t = P(null), o = gt(t), a = P(null), i = S(() => o.value > 0 ? o.value / l.width : 0.2), s = S(() => {
2622
2673
  const f = a.value;
2623
2674
  if (!l.fit || !f || f.width <= 0 || f.height <= 0 || o.value <= 0)
2624
2675
  return null;
@@ -2628,22 +2679,22 @@ const Xo = ["srcdoc"], Qo = {
2628
2679
  x: (o.value - f.width * h) / 2 - f.left * h,
2629
2680
  y: (l.height - f.height * h) / 2 - f.top * h
2630
2681
  };
2631
- }), r = Zo(), p = S(() => {
2682
+ }), r = ts(), c = S(() => {
2632
2683
  if (!l.thumbnail) return "";
2633
2684
  const f = { html: l.thumbnail.html, styles: l.thumbnail.styles };
2634
- return r.value ? Cn(r.value, f) : fl(f);
2685
+ return r.value ? Cn(r.value, f) : ml(f);
2635
2686
  }), u = S(() => {
2636
2687
  const f = s.value, h = a.value;
2637
2688
  return f && h ? {
2638
2689
  width: `${l.width}px`,
2639
- height: `${_t}px`,
2690
+ height: `${$t}px`,
2640
2691
  transform: `translate(${f.x}px, ${f.y}px) scale(${f.scale})`,
2641
2692
  // The component alone: the rest of the frame is a white page around it, and moved off
2642
2693
  // the corner it shows as a white slab beside a small badge.
2643
- clipPath: `inset(${h.top}px ${l.width - h.left - h.width}px ${_t - h.top - h.height}px ${h.left}px)`
2694
+ clipPath: `inset(${h.top}px ${l.width - h.left - h.width}px ${$t - h.top - h.height}px ${h.left}px)`
2644
2695
  } : {
2645
2696
  width: `${l.width}px`,
2646
- height: l.fit ? `${_t}px` : `${Math.round(l.height / i.value)}px`,
2697
+ height: l.fit ? `${$t}px` : `${Math.round(l.height / i.value)}px`,
2647
2698
  transform: `scale(${i.value})`,
2648
2699
  // Until it is measured, a fitted frame would flash its top at the wrong scale; measured and
2649
2700
  // found to have no size (a root with `display: contents`), it is drawn the ordinary way.
@@ -2651,7 +2702,7 @@ const Xo = ["srcdoc"], Qo = {
2651
2702
  };
2652
2703
  });
2653
2704
  let m = null;
2654
- function d(f) {
2705
+ function p(f) {
2655
2706
  if (!l.fit) return;
2656
2707
  m?.disconnect();
2657
2708
  const h = f.target, x = h.contentWindow, T = h.contentDocument;
@@ -2662,34 +2713,34 @@ const Xo = ["srcdoc"], Qo = {
2662
2713
  };
2663
2714
  b(), m = new x.ResizeObserver(b), m.observe(_);
2664
2715
  }
2665
- return st(() => m?.disconnect()), (f, h) => (c(), w("div", {
2716
+ return st(() => m?.disconnect()), (f, h) => (d(), w("div", {
2666
2717
  ref_key: "box",
2667
2718
  ref: t,
2668
2719
  class: "wx-block-thumb",
2669
2720
  style: Ie({ height: `${e.height}px` })
2670
2721
  }, [
2671
- e.thumbnail ? (c(), w("iframe", {
2722
+ e.thumbnail ? (d(), w("iframe", {
2672
2723
  key: 0,
2673
2724
  class: "wx-block-thumb__frame",
2674
- srcdoc: p.value,
2725
+ srcdoc: c.value,
2675
2726
  style: Ie(u.value),
2676
2727
  sandbox: "allow-same-origin",
2677
2728
  tabindex: "-1",
2678
2729
  "aria-hidden": "true",
2679
- onLoad: d
2680
- }, null, 44, Xo)) : (c(), w("div", Qo, [
2681
- v(n(ye), { name: "grid" })
2730
+ onLoad: p
2731
+ }, null, 44, ls)) : (d(), w("div", ns, [
2732
+ v(n(we), { name: "grid" })
2682
2733
  ]))
2683
2734
  ], 4));
2684
2735
  }
2685
- }), El = /* @__PURE__ */ se(es, [["__scopeId", "data-v-7421ce33"]]);
2736
+ }), Vl = /* @__PURE__ */ se(os, [["__scopeId", "data-v-7421ce33"]]);
2686
2737
  function Vt(e, l, t) {
2687
2738
  if (l === null)
2688
2739
  return (t === null || t.includes(e.slug)) && (e.allowed_in === null || e.allowed_in.includes("root"));
2689
2740
  const o = t ? t.includes(e.slug) : l.allow?.includes(e.slug) === !0, a = e.allowed_in === null || e.allowed_in.includes(l.slug);
2690
2741
  return o && a;
2691
2742
  }
2692
- function ts(e, l, t, o) {
2743
+ function ss(e, l, t, o) {
2693
2744
  const a = me(e, l), i = a ? t.find((u) => u.slug === a.node.type) : void 0;
2694
2745
  if (!a || !i) return [];
2695
2746
  const s = [], r = (u, m) => (a.parent?.key ?? null) === u && a.field === m;
@@ -2699,27 +2750,27 @@ function ts(e, l, t, o) {
2699
2750
  trail: [],
2700
2751
  full: o.max !== null && e.length >= o.max
2701
2752
  });
2702
- const p = (u, m) => {
2703
- for (const d of u) {
2704
- if (d.key === l) continue;
2705
- const f = t.find((x) => x.slug === d.type), h = f?.content ? Ot(f.content.schema) : [];
2753
+ const c = (u, m) => {
2754
+ for (const p of u) {
2755
+ if (p.key === l) continue;
2756
+ const f = t.find((x) => x.slug === p.type), h = f?.content ? It(f.content.schema) : [];
2706
2757
  for (const x of h) {
2707
- const T = f.title, _ = h.length > 1 ? `${T} · ${x.label ?? x.id}` : T, b = d.values[x.id], $ = rt(b) ? b : [], R = x.props?.max ?? null, G = x.props?.allow ?? null;
2708
- !r(d.key, x.id) && Vt(i, f, G) && s.push({
2709
- parentKey: d.key,
2758
+ const T = f.title, _ = h.length > 1 ? `${T} · ${x.label ?? x.id}` : T, b = p.values[x.id], $ = rt(b) ? b : [], R = x.props?.max ?? null, G = x.props?.allow ?? null;
2759
+ !r(p.key, x.id) && Vt(i, f, G) && s.push({
2760
+ parentKey: p.key,
2710
2761
  field: x.id,
2711
2762
  trail: [...m, _],
2712
2763
  full: R !== null && $.length >= R
2713
- }), p($, [...m, _]);
2764
+ }), c($, [...m, _]);
2714
2765
  }
2715
2766
  }
2716
2767
  };
2717
- return p(e, []), s;
2768
+ return c(e, []), s;
2718
2769
  }
2719
- const ls = { class: "wx-block-picker" }, ns = {
2770
+ const as = { class: "wx-block-picker" }, is = {
2720
2771
  key: 0,
2721
2772
  class: "wx-block-picker__group-title"
2722
- }, os = { class: "wx-block-picker__cards" }, ss = ["disabled", "title", "onClick"], as = { class: "wx-block-picker__body" }, is = { class: "wx-block-picker__title" }, rs = /* @__PURE__ */ oe({
2773
+ }, rs = { class: "wx-block-picker__cards" }, us = ["disabled", "title", "onClick"], cs = { class: "wx-block-picker__body" }, ds = { class: "wx-block-picker__title" }, ps = /* @__PURE__ */ oe({
2723
2774
  __name: "BlockPicker",
2724
2775
  props: {
2725
2776
  catalog: {},
@@ -2730,22 +2781,22 @@ const ls = { class: "wx-block-picker" }, ns = {
2730
2781
  blocksPath: { default: null }
2731
2782
  },
2732
2783
  setup(e) {
2733
- const l = e, { resolve: t, dismiss: o, open: a } = At();
2734
- Ne();
2735
- const i = de("webx-blocks"), s = U("");
2784
+ const l = e, { resolve: t, dismiss: o, open: a } = Lt();
2785
+ Me();
2786
+ const i = de("webx-blocks"), s = P("");
2736
2787
  function r(f) {
2737
2788
  return Vt(f, l.parent, l.allow);
2738
2789
  }
2739
- const p = S(
2790
+ const c = S(
2740
2791
  () => l.catalog.filter(
2741
2792
  (f) => $e(f) !== "component" && f.is_enabled && f.published !== null && r(f)
2742
2793
  ).map((f) => {
2743
- const h = Mn(l.tree, f.slug), x = f.max_per_entity !== null && h >= f.max_per_entity;
2794
+ const h = zn(l.tree, f.slug), x = f.max_per_entity !== null && h >= f.max_per_entity;
2744
2795
  return { type: f, reason: x ? i("field.limit-reached", { count: h }) : null };
2745
2796
  })
2746
2797
  ), u = S(() => {
2747
2798
  const f = s.value.trim().toLowerCase();
2748
- return f === "" ? p.value : p.value.filter(
2799
+ return f === "" ? c.value : c.value.filter(
2749
2800
  ({ type: h }) => h.title.toLowerCase().includes(f) || h.slug.includes(f) || (h.description ?? "").toLowerCase().includes(f)
2750
2801
  );
2751
2802
  }), m = S(() => {
@@ -2758,9 +2809,9 @@ const ls = { class: "wx-block-picker" }, ns = {
2758
2809
  options: u.value.filter((_) => _.type.group === T)
2759
2810
  })).filter((T) => T.options.length > 0);
2760
2811
  return u.value.length <= 5 || s.value.trim() !== "" || h.length < 2 ? [{ id: "", label: "", options: u.value }] : h;
2761
- }), d = S(() => {
2812
+ }), p = S(() => {
2762
2813
  if (l.catalog.length === 0) return i("field.pick-none");
2763
- if (p.value.length === 0 && l.parent) {
2814
+ if (c.value.length === 0 && l.parent) {
2764
2815
  const f = (l.allow ?? l.parent.allow ?? []).filter(
2765
2816
  (h) => l.catalog.some((x) => x.slug === h)
2766
2817
  );
@@ -2770,9 +2821,9 @@ const ls = { class: "wx-block-picker" }, ns = {
2770
2821
  });
2771
2822
  return (f, h) => {
2772
2823
  const x = Mt("router-link");
2773
- return c(), W(n(Bt), {
2824
+ return d(), W(n(Bt), {
2774
2825
  open: n(a),
2775
- "onUpdate:open": h[2] || (h[2] = (T) => Nt(a) ? a.value = T : null),
2826
+ "onUpdate:open": h[2] || (h[2] = (T) => zt(a) ? a.value = T : null),
2776
2827
  title: n(i)("field.pick"),
2777
2828
  width: 860
2778
2829
  }, {
@@ -2782,81 +2833,81 @@ const ls = { class: "wx-block-picker" }, ns = {
2782
2833
  onClick: h[1] || (h[1] = (T) => n(o)())
2783
2834
  }, {
2784
2835
  default: g(() => [
2785
- B(k(n(i)("field.close")), 1)
2836
+ L(k(n(i)("field.close")), 1)
2786
2837
  ]),
2787
2838
  _: 1
2788
2839
  })
2789
2840
  ]),
2790
2841
  default: g(() => [
2791
- E("div", ls, [
2792
- p.value.length > 0 ? (c(), W(n(nt), {
2842
+ C("div", as, [
2843
+ c.value.length > 0 ? (d(), W(n(nt), {
2793
2844
  key: 0,
2794
2845
  modelValue: s.value,
2795
2846
  "onUpdate:modelValue": h[0] || (h[0] = (T) => s.value = T),
2796
2847
  placeholder: n(i)("field.search"),
2797
2848
  clearable: "",
2798
2849
  autofocus: ""
2799
- }, null, 8, ["modelValue", "placeholder"])) : L("", !0),
2800
- u.value.length === 0 ? (c(), W(n(Lt), {
2850
+ }, null, 8, ["modelValue", "placeholder"])) : B("", !0),
2851
+ u.value.length === 0 ? (d(), W(n(Wt), {
2801
2852
  key: 1,
2802
2853
  icon: "grid",
2803
- title: d.value,
2854
+ title: p.value,
2804
2855
  size: "sm"
2805
2856
  }, {
2806
2857
  default: g(() => [
2807
- e.catalog.length === 0 && e.blocksPath ? (c(), W(x, {
2858
+ e.catalog.length === 0 && e.blocksPath ? (d(), W(x, {
2808
2859
  key: 0,
2809
2860
  to: e.blocksPath
2810
2861
  }, {
2811
2862
  default: g(() => [
2812
- B(k(n(i)("field.pick-none-link")), 1)
2863
+ L(k(n(i)("field.pick-none-link")), 1)
2813
2864
  ]),
2814
2865
  _: 1
2815
- }, 8, ["to"])) : L("", !0)
2866
+ }, 8, ["to"])) : B("", !0)
2816
2867
  ]),
2817
2868
  _: 1
2818
- }, 8, ["title"])) : L("", !0),
2819
- (c(!0), w(F, null, Z(m.value, (T) => (c(), w("section", {
2869
+ }, 8, ["title"])) : B("", !0),
2870
+ (d(!0), w(F, null, Z(m.value, (T) => (d(), w("section", {
2820
2871
  key: T.id,
2821
2872
  class: "wx-block-picker__group"
2822
2873
  }, [
2823
- T.label ? (c(), w("div", ns, k(T.label), 1)) : L("", !0),
2824
- E("div", os, [
2825
- (c(!0), w(F, null, Z(T.options, (_) => (c(), w("button", {
2874
+ T.label ? (d(), w("div", is, k(T.label), 1)) : B("", !0),
2875
+ C("div", rs, [
2876
+ (d(!0), w(F, null, Z(T.options, (_) => (d(), w("button", {
2826
2877
  key: _.type.id,
2827
2878
  type: "button",
2828
- class: Me(["wx-block-picker__card", { "is-disabled": _.reason !== null }]),
2879
+ class: Ne(["wx-block-picker__card", { "is-disabled": _.reason !== null }]),
2829
2880
  disabled: _.reason !== null,
2830
2881
  title: _.reason ?? void 0,
2831
2882
  onClick: (b) => n(t)(_.type)
2832
2883
  }, [
2833
- v(El, {
2884
+ v(Vl, {
2834
2885
  thumbnail: _.type.thumbnail,
2835
2886
  height: 96
2836
2887
  }, null, 8, ["thumbnail"]),
2837
- E("div", as, [
2838
- E("div", is, k(_.type.title), 1),
2839
- _.reason ? (c(), W(n(J), {
2888
+ C("div", cs, [
2889
+ C("div", ds, k(_.type.title), 1),
2890
+ _.reason ? (d(), W(n(Y), {
2840
2891
  key: 0,
2841
2892
  size: "sm",
2842
2893
  tone: "warning"
2843
2894
  }, {
2844
2895
  default: g(() => [
2845
- B(k(_.reason), 1)
2896
+ L(k(_.reason), 1)
2846
2897
  ]),
2847
2898
  _: 2
2848
- }, 1024)) : _.type.description ? (c(), W(n(J), {
2899
+ }, 1024)) : _.type.description ? (d(), W(n(Y), {
2849
2900
  key: 1,
2850
2901
  size: "sm",
2851
2902
  tone: "muted"
2852
2903
  }, {
2853
2904
  default: g(() => [
2854
- B(k(_.type.description), 1)
2905
+ L(k(_.type.description), 1)
2855
2906
  ]),
2856
2907
  _: 2
2857
- }, 1024)) : L("", !0)
2908
+ }, 1024)) : B("", !0)
2858
2909
  ])
2859
- ], 10, ss))), 128))
2910
+ ], 10, us))), 128))
2860
2911
  ])
2861
2912
  ]))), 128))
2862
2913
  ])
@@ -2865,7 +2916,7 @@ const ls = { class: "wx-block-picker" }, ns = {
2865
2916
  }, 8, ["open", "title"]);
2866
2917
  };
2867
2918
  }
2868
- }), us = /* @__PURE__ */ se(rs, [["__scopeId", "data-v-d04662fd"]]), cs = { class: "wx-blocks-preview__tools" }, ds = ["src", "title"], ps = /* @__PURE__ */ oe({
2919
+ }), fs = /* @__PURE__ */ se(ps, [["__scopeId", "data-v-d04662fd"]]), ms = { class: "wx-blocks-preview__tools" }, hs = ["src", "title"], vs = /* @__PURE__ */ oe({
2869
2920
  __name: "BlocksPreview",
2870
2921
  props: {
2871
2922
  url: {},
@@ -2875,7 +2926,7 @@ const ls = { class: "wx-block-picker" }, ns = {
2875
2926
  },
2876
2927
  emits: ["select", "edit"],
2877
2928
  setup(e, { expose: l, emit: t }) {
2878
- const o = e, a = t, i = de("webx-blocks"), s = U(null), r = U(null), p = U(null), u = bt(p), m = U(!1), d = U(!1), f = U(null), h = U(0), x = S(() => h.value > 0), T = S(() => [
2929
+ const o = e, a = t, i = de("webx-blocks"), s = P(null), r = P(null), c = P(null), u = gt(c), m = P(!1), p = P(!1), f = P(null), h = P(0), x = S(() => h.value > 0), T = S(() => [
2879
2930
  { value: 1280, icon: "monitor", ariaLabel: i("field.width-desktop") },
2880
2931
  { value: 834, icon: "tablet", ariaLabel: i("field.width-tablet") },
2881
2932
  { value: 390, icon: "smartphone", ariaLabel: i("field.width-phone") }
@@ -2902,109 +2953,109 @@ const ls = { class: "wx-block-picker" }, ns = {
2902
2953
  }
2903
2954
  }
2904
2955
  let ae = null, D = null;
2905
- function P(N) {
2906
- N.documentElement.scrollTop !== 0 && (N.documentElement.scrollTop = 0);
2956
+ function U(M) {
2957
+ M.documentElement.scrollTop !== 0 && (M.documentElement.scrollTop = 0);
2907
2958
  }
2908
2959
  function Q() {
2909
- const N = ee(), j = N?.body;
2910
- if (!j || !N?.defaultView) return;
2911
- P(N);
2912
- const q = N.defaultView.getComputedStyle(j), pe = (parseFloat(q.marginTop) || 0) + (parseFloat(q.marginBottom) || 0), V = Math.ceil(j.scrollHeight + pe);
2913
- V !== h.value && (h.value = V, he !== null && Hl(() => requestAnimationFrame(xe)));
2960
+ const M = ee(), j = M?.body;
2961
+ if (!j || !M?.defaultView) return;
2962
+ U(M);
2963
+ const q = M.defaultView.getComputedStyle(j), pe = (parseFloat(q.marginTop) || 0) + (parseFloat(q.marginBottom) || 0), A = Math.ceil(j.scrollHeight + pe);
2964
+ A !== h.value && (h.value = A, he !== null && ql(() => requestAnimationFrame(_e)));
2914
2965
  }
2915
- function le(N) {
2966
+ function le(M) {
2916
2967
  D?.disconnect();
2917
- const j = N.defaultView;
2918
- !j || !N.body || (D = new j.ResizeObserver(Q), D.observe(N.body), Q());
2968
+ const j = M.defaultView;
2969
+ !j || !M.body || (D = new j.ResizeObserver(Q), D.observe(M.body), Q());
2919
2970
  }
2920
2971
  function Se() {
2921
- d.value = !0;
2922
- const N = ee();
2923
- N && (le(N), ae?.release(), ae = wn(N, {
2972
+ p.value = !0;
2973
+ const M = ee();
2974
+ M && (le(M), ae?.release(), ae = _n(M, {
2924
2975
  /* No guard against answering a click with a scroll: `bring` moves nothing that is already
2925
2976
  readable, and a block clicked at the very bottom of the window, half under the action
2926
2977
  bar, is exactly the one worth moving. */
2927
2978
  select: (j) => a("select", j)
2928
- }), kt(N, o.selected ?? null), we(o.selected ?? null));
2979
+ }), yt(M, o.selected ?? null), xe(o.selected ?? null));
2929
2980
  }
2930
2981
  let he = null, ne = null;
2931
- function we(N) {
2932
- N !== null && (he = N, ne !== null && clearTimeout(ne), ne = window.setTimeout(() => {
2982
+ function xe(M) {
2983
+ M !== null && (he = M, ne !== null && clearTimeout(ne), ne = window.setTimeout(() => {
2933
2984
  he = null, ne = null;
2934
- }, 400), xe());
2985
+ }, 400), _e());
2935
2986
  }
2936
- function Be(N) {
2987
+ function Le(M) {
2937
2988
  const j = s.value?.getBoundingClientRect();
2938
2989
  if (!j) return null;
2939
- const q = N.getBoundingClientRect();
2990
+ const q = M.getBoundingClientRect();
2940
2991
  return { top: j.top + q.top * b.value, height: q.height * b.value };
2941
2992
  }
2942
2993
  function ze() {
2943
- let N = s.value?.parentElement ?? null;
2944
- for (; N; ) {
2945
- const j = getComputedStyle(N).overflowY;
2946
- if ((j === "auto" || j === "scroll") && N.scrollHeight > N.clientHeight)
2947
- return N;
2948
- N = N.parentElement;
2994
+ let M = s.value?.parentElement ?? null;
2995
+ for (; M; ) {
2996
+ const j = getComputedStyle(M).overflowY;
2997
+ if ((j === "auto" || j === "scroll") && M.scrollHeight > M.clientHeight)
2998
+ return M;
2999
+ M = M.parentElement;
2949
3000
  }
2950
3001
  return null;
2951
3002
  }
2952
- function xe() {
2953
- const N = ee();
2954
- if (he === null || !N) return;
2955
- P(N);
2956
- const j = zt(N, he), q = j ? Be(j) : null;
3003
+ function _e() {
3004
+ const M = ee();
3005
+ if (he === null || !M) return;
3006
+ U(M);
3007
+ const j = Dt(M, he), q = j ? Le(j) : null;
2957
3008
  if (!q) return;
2958
- const pe = ze(), V = pe?.getBoundingClientRect(), O = r.value?.getBoundingClientRect().height ?? 0, I = {
2959
- top: (V?.top ?? 0) + O,
2960
- bottom: (V ? V.bottom : window.innerHeight) - O
2961
- }, Y = q.top + q.height, Te = q.top < I.top, Ye = q.height > I.bottom - I.top, Le = Te || Ye ? q.top - I.top : Y > I.bottom ? Y - I.bottom : 0;
2962
- Le !== 0 && (pe ?? window).scrollBy({ top: Le, behavior: "smooth" });
3009
+ const pe = ze(), A = pe?.getBoundingClientRect(), O = r.value?.getBoundingClientRect().height ?? 0, I = {
3010
+ top: (A?.top ?? 0) + O,
3011
+ bottom: (A ? A.bottom : window.innerHeight) - O
3012
+ }, J = q.top + q.height, Te = q.top < I.top, Je = q.height > I.bottom - I.top, Be = Te || Je ? q.top - I.top : J > I.bottom ? J - I.bottom : 0;
3013
+ Be !== 0 && (pe ?? window).scrollBy({ top: Be, behavior: "smooth" });
2963
3014
  }
2964
- function ie(N, j) {
3015
+ function ie(M, j) {
2965
3016
  const q = ee();
2966
- if (!q || !d.value) return !1;
2967
- const pe = pl(q, N, j);
2968
- return pe && kt(q, o.selected ?? null), pe;
3017
+ if (!q || !p.value) return !1;
3018
+ const pe = fl(q, M, j);
3019
+ return pe && yt(q, o.selected ?? null), pe;
2969
3020
  }
2970
3021
  function ve() {
2971
- d.value = !1, D?.disconnect(), D = null, s.value && o.url && (s.value.src = o.url);
3022
+ p.value = !1, D?.disconnect(), D = null, s.value && o.url && (s.value.src = o.url);
2972
3023
  }
2973
- function Ce(N) {
2974
- N.key === "Escape" && m.value && (m.value = !1, N.stopPropagation());
3024
+ function Ee(M) {
3025
+ M.key === "Escape" && m.value && (m.value = !1, M.stopPropagation());
2975
3026
  }
2976
3027
  return ue(
2977
3028
  () => o.selected,
2978
- (N) => {
3029
+ (M) => {
2979
3030
  const j = ee();
2980
- !j || !d.value || (kt(j, N ?? null), we(N ?? null));
3031
+ !j || !p.value || (yt(j, M ?? null), xe(M ?? null));
2981
3032
  }
2982
3033
  ), ue(() => o.reload, ve), ue(
2983
3034
  () => o.url,
2984
- () => d.value = !1
2985
- ), ot(() => window.addEventListener("keydown", Ce)), st(() => {
2986
- window.removeEventListener("keydown", Ce), ne !== null && clearTimeout(ne), D?.disconnect(), ae?.release();
2987
- }), l({ replace: ie, refresh: ve, open: () => m.value = !0 }), (N, j) => (c(), w("div", {
2988
- class: Me(["wx-blocks-preview", { "is-fullscreen": m.value, "is-grown": x.value, "is-compact": e.compact }]),
3035
+ () => p.value = !1
3036
+ ), ot(() => window.addEventListener("keydown", Ee)), st(() => {
3037
+ window.removeEventListener("keydown", Ee), ne !== null && clearTimeout(ne), D?.disconnect(), ae?.release();
3038
+ }), l({ replace: ie, refresh: ve, open: () => m.value = !0 }), (M, j) => (d(), w("div", {
3039
+ class: Ne(["wx-blocks-preview", { "is-fullscreen": m.value, "is-grown": x.value, "is-compact": e.compact }]),
2989
3040
  style: Ie({ "--wx-preview-scale": b.value })
2990
3041
  }, [
2991
- E("div", {
3042
+ C("div", {
2992
3043
  ref_key: "bar",
2993
3044
  ref: r,
2994
3045
  class: "wx-blocks-preview__bar"
2995
3046
  }, [
2996
- v(n(J), {
3047
+ v(n(Y), {
2997
3048
  size: "xs",
2998
3049
  tone: "muted",
2999
3050
  class: "wx-blocks-preview__label",
3000
3051
  truncate: ""
3001
3052
  }, {
3002
3053
  default: g(() => [
3003
- B(k(G.value), 1)
3054
+ L(k(G.value), 1)
3004
3055
  ]),
3005
3056
  _: 1
3006
3057
  }),
3007
- v(n(sl), {
3058
+ v(n(al), {
3008
3059
  class: "wx-blocks-preview__widths",
3009
3060
  "model-value": _.value,
3010
3061
  options: T.value,
@@ -3012,16 +3063,16 @@ const ls = { class: "wx-block-picker" }, ns = {
3012
3063
  "aria-label": n(i)("field.width"),
3013
3064
  "onUpdate:modelValue": j[0] || (j[0] = (q) => f.value = Number(q))
3014
3065
  }, null, 8, ["model-value", "options", "aria-label"]),
3015
- E("div", cs, [
3016
- e.compact ? (c(), W(n(et), {
3066
+ C("div", ms, [
3067
+ e.compact ? (d(), W(n(et), {
3017
3068
  key: 0,
3018
3069
  size: "sm",
3019
3070
  tone: "primary",
3020
3071
  icon: "edit",
3021
3072
  title: n(i)("field.blocks"),
3022
3073
  onClick: j[1] || (j[1] = (q) => a("edit"))
3023
- }, null, 8, ["title"])) : L("", !0),
3024
- e.url ? (c(), W(n(et), {
3074
+ }, null, 8, ["title"])) : B("", !0),
3075
+ e.url ? (d(), W(n(et), {
3025
3076
  key: 1,
3026
3077
  size: "sm",
3027
3078
  icon: "external-link",
@@ -3030,7 +3081,7 @@ const ls = { class: "wx-block-picker" }, ns = {
3030
3081
  href: e.url,
3031
3082
  target: "_blank",
3032
3083
  rel: "noopener"
3033
- }, null, 8, ["title", "href"])) : L("", !0),
3084
+ }, null, 8, ["title", "href"])) : B("", !0),
3034
3085
  v(n(et), {
3035
3086
  size: "sm",
3036
3087
  icon: m.value ? "minimize" : "maximize",
@@ -3040,16 +3091,16 @@ const ls = { class: "wx-block-picker" }, ns = {
3040
3091
  }, null, 8, ["icon", "title"])
3041
3092
  ])
3042
3093
  ], 512),
3043
- E("div", {
3094
+ C("div", {
3044
3095
  ref_key: "box",
3045
- ref: p,
3096
+ ref: c,
3046
3097
  class: "wx-blocks-preview__ground"
3047
3098
  }, [
3048
- E("div", {
3099
+ C("div", {
3049
3100
  class: "wx-blocks-preview__clip",
3050
3101
  style: Ie(R.value)
3051
3102
  }, [
3052
- e.url ? (c(), w("iframe", {
3103
+ e.url ? (d(), w("iframe", {
3053
3104
  key: 0,
3054
3105
  ref_key: "frame",
3055
3106
  ref: s,
@@ -3058,15 +3109,15 @@ const ls = { class: "wx-block-picker" }, ns = {
3058
3109
  style: Ie($.value),
3059
3110
  title: n(i)("field.preview"),
3060
3111
  onLoad: Se
3061
- }, null, 44, ds)) : L("", !0)
3112
+ }, null, 44, hs)) : B("", !0)
3062
3113
  ], 4)
3063
3114
  ], 512)
3064
3115
  ], 6));
3065
3116
  }
3066
- }), fs = /* @__PURE__ */ se(ps, [["__scopeId", "data-v-398e4cef"]]), ms = { class: "wx-blocks-tree__node" }, hs = ["onClick", "onKeydown"], vs = { class: "wx-blocks-tree__name" }, bs = ["title"], gs = ["title"], ks = ["title"], ys = ["title"], ws = {
3117
+ }), bs = /* @__PURE__ */ se(vs, [["__scopeId", "data-v-398e4cef"]]), gs = { class: "wx-blocks-tree__node" }, ks = ["onClick", "onKeydown"], ys = { class: "wx-blocks-tree__name" }, ws = ["title"], xs = ["title"], _s = ["title"], $s = ["title"], Ss = {
3067
3118
  key: 4,
3068
3119
  class: "wx-blocks-tree__actions"
3069
- }, xs = ["onClick"], _s = /* @__PURE__ */ oe({
3120
+ }, Es = ["onClick"], Ts = /* @__PURE__ */ oe({
3070
3121
  __name: "BlocksTree",
3071
3122
  props: {
3072
3123
  nodes: {},
@@ -3083,20 +3134,20 @@ const ls = { class: "wx-block-picker" }, ns = {
3083
3134
  setup(e, { emit: l }) {
3084
3135
  const t = e, o = l, a = de("webx-blocks");
3085
3136
  function i(m) {
3086
- return t.catalog.find((d) => d.slug === m.type) ?? null;
3137
+ return t.catalog.find((p) => p.slug === m.type) ?? null;
3087
3138
  }
3088
3139
  function s(m) {
3089
3140
  return i(m)?.title ?? m.type;
3090
3141
  }
3091
3142
  function r(m) {
3092
- const d = i(m);
3093
- return d?.content ? Ot(d.content.schema) : [];
3143
+ const p = i(m);
3144
+ return p?.content ? It(p.content.schema) : [];
3094
3145
  }
3095
- function p(m, d) {
3096
- const f = m.values[d.id];
3146
+ function c(m, p) {
3147
+ const f = m.values[p.id];
3097
3148
  return Array.isArray(f) ? f : [];
3098
3149
  }
3099
- function u(m, d) {
3150
+ function u(m, p) {
3100
3151
  const f = t.fieldNode ? t.fieldNode.props?.max ?? null : t.max;
3101
3152
  return [
3102
3153
  /*
@@ -3109,7 +3160,7 @@ const ls = { class: "wx-block-picker" }, ns = {
3109
3160
  icon: "plus",
3110
3161
  label: a("field.add-after"),
3111
3162
  disabled: f !== null && t.nodes.length >= f,
3112
- run: () => o("add", t.parentKey, t.field, t.fieldNode, d + 1)
3163
+ run: () => o("add", t.parentKey, t.field, t.fieldNode, p + 1)
3113
3164
  },
3114
3165
  {
3115
3166
  key: "visibility",
@@ -3138,9 +3189,9 @@ const ls = { class: "wx-block-picker" }, ns = {
3138
3189
  }
3139
3190
  ];
3140
3191
  }
3141
- return (m, d) => {
3192
+ return (m, p) => {
3142
3193
  const f = Mt("blocks-tree", !0);
3143
- return c(), W(n(Ol), {
3194
+ return d(), W(n(Pl), {
3144
3195
  "model-value": e.nodes,
3145
3196
  "item-key": "key",
3146
3197
  "item-label": (h) => s(h),
@@ -3148,61 +3199,61 @@ const ls = { class: "wx-block-picker" }, ns = {
3148
3199
  plain: "",
3149
3200
  size: "sm",
3150
3201
  "empty-text": e.depth === 0 ? n(a)("field.empty") : "",
3151
- class: Me(["wx-blocks-tree", { "is-nested": e.depth > 0 }]),
3152
- "onUpdate:modelValue": d[7] || (d[7] = (h) => o("reorder", e.parentKey, e.field, h))
3202
+ class: Ne(["wx-blocks-tree", { "is-nested": e.depth > 0 }]),
3203
+ "onUpdate:modelValue": p[7] || (p[7] = (h) => o("reorder", e.parentKey, e.field, h))
3153
3204
  }, {
3154
3205
  default: g(({ item: h, index: x }) => [
3155
- E("div", ms, [
3156
- E("div", {
3157
- class: Me(["wx-blocks-tree__row", { "is-selected": e.selected === h.key, "is-hidden": h.hidden === !0 }]),
3206
+ C("div", gs, [
3207
+ C("div", {
3208
+ class: Ne(["wx-blocks-tree__row", { "is-selected": e.selected === h.key, "is-hidden": h.hidden === !0 }]),
3158
3209
  role: "button",
3159
3210
  tabindex: "0",
3160
3211
  onClick: (T) => o("select", h.key),
3161
3212
  onKeydown: [
3162
- Kt(qt((T) => o("select", h.key), ["prevent"]), ["enter"]),
3163
- Kt(qt((T) => o("select", h.key), ["prevent"]), ["space"])
3213
+ qt(Yt((T) => o("select", h.key), ["prevent"]), ["enter"]),
3214
+ qt(Yt((T) => o("select", h.key), ["prevent"]), ["space"])
3164
3215
  ]
3165
3216
  }, [
3166
- E("span", vs, k(s(h)), 1),
3167
- i(h) ? i(h)?.draft ? (c(), w("span", {
3217
+ C("span", ys, k(s(h)), 1),
3218
+ i(h) ? i(h)?.draft ? (d(), w("span", {
3168
3219
  key: 1,
3169
3220
  class: "wx-blocks-tree__flag is-warning",
3170
3221
  title: n(a)("field.draft-type")
3171
3222
  }, [
3172
- v(n(ye), { name: "warning" })
3173
- ], 8, gs)) : i(h)?.is_enabled === !1 ? (c(), w("span", {
3223
+ v(n(we), { name: "warning" })
3224
+ ], 8, xs)) : i(h)?.is_enabled === !1 ? (d(), w("span", {
3174
3225
  key: 2,
3175
3226
  class: "wx-blocks-tree__flag",
3176
3227
  title: n(a)("field.disabled-type")
3177
3228
  }, [
3178
- v(n(ye), { name: "lock" })
3179
- ], 8, ks)) : L("", !0) : (c(), w("span", {
3229
+ v(n(we), { name: "lock" })
3230
+ ], 8, _s)) : B("", !0) : (d(), w("span", {
3180
3231
  key: 0,
3181
3232
  class: "wx-blocks-tree__flag is-danger",
3182
3233
  title: n(a)("field.unknown-type", { type: h.type })
3183
3234
  }, [
3184
- v(n(ye), { name: "close-circle" })
3185
- ], 8, bs)),
3186
- h.hidden === !0 ? (c(), w("span", {
3235
+ v(n(we), { name: "close-circle" })
3236
+ ], 8, ws)),
3237
+ h.hidden === !0 ? (d(), w("span", {
3187
3238
  key: 3,
3188
3239
  class: "wx-blocks-tree__flag",
3189
3240
  title: n(a)("field.hidden-note")
3190
3241
  }, [
3191
- v(n(ye), { name: "eye-off" })
3192
- ], 8, ys)) : L("", !0),
3193
- e.disabled ? L("", !0) : (c(), w("span", ws, [
3194
- v(n(tn), {
3242
+ v(n(we), { name: "eye-off" })
3243
+ ], 8, $s)) : B("", !0),
3244
+ e.disabled ? B("", !0) : (d(), w("span", Ss, [
3245
+ v(n(nn), {
3195
3246
  actions: u(h, x),
3196
3247
  label: s(h)
3197
3248
  }, null, 8, ["actions", "label"])
3198
3249
  ]))
3199
- ], 42, hs),
3200
- (c(!0), w(F, null, Z(r(h), (T) => (c(), w("div", {
3250
+ ], 42, ks),
3251
+ (d(!0), w(F, null, Z(r(h), (T) => (d(), w("div", {
3201
3252
  key: T.id,
3202
3253
  class: "wx-blocks-tree__kids"
3203
3254
  }, [
3204
3255
  v(f, {
3205
- nodes: p(h, T),
3256
+ nodes: c(h, T),
3206
3257
  catalog: e.catalog,
3207
3258
  "parent-key": h.key,
3208
3259
  field: T.id,
@@ -3210,25 +3261,25 @@ const ls = { class: "wx-block-picker" }, ns = {
3210
3261
  selected: e.selected,
3211
3262
  disabled: e.disabled,
3212
3263
  depth: e.depth + 1,
3213
- onSelect: d[0] || (d[0] = (_) => o("select", _)),
3214
- onAdd: d[1] || (d[1] = (_, b, $, R) => o("add", _, b, $, R)),
3215
- onRemove: d[2] || (d[2] = (_) => o("remove", _)),
3216
- onDuplicate: d[3] || (d[3] = (_) => o("duplicate", _)),
3217
- onMove: d[4] || (d[4] = (_) => o("move", _)),
3218
- onVisibility: d[5] || (d[5] = (_, b) => o("visibility", _, b)),
3219
- onReorder: d[6] || (d[6] = (_, b, $) => o("reorder", _, b, $))
3264
+ onSelect: p[0] || (p[0] = (_) => o("select", _)),
3265
+ onAdd: p[1] || (p[1] = (_, b, $, R) => o("add", _, b, $, R)),
3266
+ onRemove: p[2] || (p[2] = (_) => o("remove", _)),
3267
+ onDuplicate: p[3] || (p[3] = (_) => o("duplicate", _)),
3268
+ onMove: p[4] || (p[4] = (_) => o("move", _)),
3269
+ onVisibility: p[5] || (p[5] = (_, b) => o("visibility", _, b)),
3270
+ onReorder: p[6] || (p[6] = (_, b, $) => o("reorder", _, b, $))
3220
3271
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "field-node", "selected", "disabled", "depth"]),
3221
- e.disabled ? L("", !0) : (c(), w("button", {
3272
+ e.disabled ? B("", !0) : (d(), w("button", {
3222
3273
  key: 0,
3223
3274
  type: "button",
3224
3275
  class: "wx-blocks-tree__add is-inner",
3225
3276
  onClick: (_) => o("add", h.key, T.id, T)
3226
3277
  }, [
3227
- B(" + " + k(n(a)("field.add-inside")), 1),
3228
- r(h).length > 1 ? (c(), w(F, { key: 0 }, [
3229
- B(" · " + k(T.label ?? T.id), 1)
3230
- ], 64)) : L("", !0)
3231
- ], 8, xs))
3278
+ L(" + " + k(n(a)("field.add-inside")), 1),
3279
+ r(h).length > 1 ? (d(), w(F, { key: 0 }, [
3280
+ L(" · " + k(T.label ?? T.id), 1)
3281
+ ], 64)) : B("", !0)
3282
+ ], 8, Es))
3232
3283
  ]))), 128))
3233
3284
  ])
3234
3285
  ]),
@@ -3236,26 +3287,26 @@ const ls = { class: "wx-block-picker" }, ns = {
3236
3287
  }, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
3237
3288
  };
3238
3289
  }
3239
- }), $s = /* @__PURE__ */ se(_s, [["__scopeId", "data-v-3cef28cd"]]), Ss = {
3290
+ }), Cs = /* @__PURE__ */ se(Ts, [["__scopeId", "data-v-3cef28cd"]]), As = {
3240
3291
  key: 0,
3241
3292
  class: "wx-blocks-nested"
3242
- }, Cs = {
3293
+ }, Vs = {
3243
3294
  key: 0,
3244
3295
  class: "wx-blocks__tree"
3245
- }, Ts = { class: "wx-blocks__panel-head" }, Es = { class: "wx-blocks__panel-title" }, Vs = { class: "wx-blocks__list" }, As = { class: "wx-blocks__tools" }, Bs = {
3296
+ }, Ls = { class: "wx-blocks__panel-head" }, Bs = { class: "wx-blocks__panel-title" }, Ws = { class: "wx-blocks__list" }, Ns = { class: "wx-blocks__tools" }, Ms = {
3246
3297
  key: 1,
3247
3298
  class: "wx-blocks__fields"
3248
- }, Ls = { class: "wx-blocks__panel-head" }, Ws = { class: "wx-blocks__panel-title" }, Ms = {
3299
+ }, zs = { class: "wx-blocks__panel-head" }, Ds = { class: "wx-blocks__panel-title" }, Os = {
3249
3300
  key: 0,
3250
3301
  class: "wx-blocks__trail"
3251
- }, Ns = ["onClick"], zs = { class: "wx-blocks__panel-name" }, Ds = { class: "wx-blocks__panel-extra" }, Os = { key: 0 }, Is = { class: "wx-blocks__form" }, Us = {
3302
+ }, Is = ["onClick"], Ps = { class: "wx-blocks__panel-name" }, Us = { class: "wx-blocks__panel-extra" }, Rs = { key: 0 }, js = { class: "wx-blocks__form" }, Fs = {
3252
3303
  key: 0,
3253
3304
  class: "wx-blocks__preview"
3254
- }, Ps = /* @__PURE__ */ oe({
3305
+ }, Hs = /* @__PURE__ */ oe({
3255
3306
  name: "WxBlocks",
3256
3307
  inheritAttrs: !1,
3257
3308
  __name: "BlocksField",
3258
- props: /* @__PURE__ */ Gl({
3309
+ props: /* @__PURE__ */ Xl({
3259
3310
  node: { default: void 0 },
3260
3311
  context: { default: void 0 },
3261
3312
  name: { default: void 0 },
@@ -3271,37 +3322,37 @@ const ls = { class: "wx-block-picker" }, ns = {
3271
3322
  }),
3272
3323
  emits: ["update:modelValue"],
3273
3324
  setup(e) {
3274
- const l = e, t = Kl(e, "modelValue"), o = Fe(ll, !1), a = Fe(Sl, null);
3275
- Wt(ll, !0), Ne();
3276
- const i = de("webx-blocks"), s = it(), r = Fe(rl, null);
3277
- let p = null;
3278
- const u = U([]), m = S(() => l.catalog ?? u.value), d = S(() => Array.isArray(t.value) ? t.value : []), f = U(null), h = S(() => f.value ? me(d.value, f.value) : null), x = S(
3279
- () => h.value ? m.value.find((A) => A.slug === h.value?.node.type) ?? null : null
3325
+ const l = e, t = Yl(e, "modelValue"), o = Fe(nl, !1), a = Fe(Tl, null);
3326
+ Nt(nl, !0), Me();
3327
+ const i = de("webx-blocks"), s = it(), r = Fe(ul, null);
3328
+ let c = null;
3329
+ const u = P([]), m = S(() => l.catalog ?? u.value), p = S(() => Array.isArray(t.value) ? t.value : []), f = P(null), h = S(() => f.value ? me(p.value, f.value) : null), x = S(
3330
+ () => h.value ? m.value.find((V) => V.slug === h.value?.node.type) ?? null : null
3280
3331
  );
3281
- function T(A) {
3282
- return m.value.find((z) => z.slug === A.type)?.title ?? A.type;
3332
+ function T(V) {
3333
+ return m.value.find((z) => z.slug === V.type)?.title ?? V.type;
3283
3334
  }
3284
3335
  const _ = S(() => {
3285
- const A = [];
3286
- return ut(d.value, (z) => A.push(z.key)), A;
3336
+ const V = [];
3337
+ return ut(p.value, (z) => V.push(z.key)), V;
3287
3338
  }), b = S(() => {
3288
- const A = f.value ? _.value.indexOf(f.value) : -1;
3339
+ const V = f.value ? _.value.indexOf(f.value) : -1;
3289
3340
  return {
3290
- previous: A > 0 ? _.value[A - 1] : null,
3291
- next: A >= 0 && A < _.value.length - 1 ? _.value[A + 1] : null
3341
+ previous: V > 0 ? _.value[V - 1] : null,
3342
+ next: V >= 0 && V < _.value.length - 1 ? _.value[V + 1] : null
3292
3343
  };
3293
3344
  }), $ = S(() => {
3294
- const A = [];
3345
+ const V = [];
3295
3346
  let z = h.value?.parent ?? null;
3296
3347
  for (; z; )
3297
- A.unshift({ key: z.key, title: T(z) }), z = me(d.value, z.key)?.parent ?? null;
3298
- return A;
3299
- }), R = Fe(It, null), G = U(null), ee = U(null), ae = bt(ee), D = S(() => R !== null && R.url.value !== null), P = S(() => D.value && ae.value > 0 && ae.value <= 900), Q = U(!1), le = S(() => {
3348
+ V.unshift({ key: z.key, title: T(z) }), z = me(p.value, z.key)?.parent ?? null;
3349
+ return V;
3350
+ }), R = Fe(Pt, null), G = P(null), ee = P(null), ae = gt(ee), D = S(() => R !== null && R.url.value !== null), U = S(() => D.value && ae.value > 0 && ae.value <= 900), Q = P(!1), le = S(() => {
3300
3351
  if (!h.value) return;
3301
- const A = x.value?.title ?? h.value.node.type;
3302
- return [...$.value.map((z) => z.title), A].join(" / ");
3352
+ const V = x.value?.title ?? h.value.node.type;
3353
+ return [...$.value.map((z) => z.title), V].join(" / ");
3303
3354
  }), Se = S(
3304
- () => P.value ? {
3355
+ () => U.value ? {
3305
3356
  /* Up from the bottom, and not all the way: the strip of page left above it is what
3306
3357
  says the sheet is over the page rather than instead of it. No heading of its own —
3307
3358
  the panels inside carry theirs, and the × is the one thing the sheet has to add. */
@@ -3320,41 +3371,41 @@ const ls = { class: "wx-block-picker" }, ns = {
3320
3371
  which already says what it is and how many. */
3321
3372
  title: le.value,
3322
3373
  open: Q.value,
3323
- "onUpdate:open": (A) => Q.value = A
3374
+ "onUpdate:open": (V) => Q.value = V
3324
3375
  } : {}
3325
3376
  ), he = S(
3326
- () => r?.state.manifest?.modules.find((A) => A.id === "blocks")?.meta?.groups ?? []
3327
- ), ne = ql()?.type, we = S(() => l.context?.types ? l.context.types : r?.types ? { ...ft, ...r.types } : ne ? { ...ft, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : ft), Be = S(
3328
- () => l.context?.translate ?? r?.i18n.t ?? ((A) => A)
3329
- ), ze = S(() => l.context?.can ?? r?.can ?? (() => !0)), xe = St(us);
3330
- function ie(A) {
3331
- t.value = A;
3377
+ () => r?.state.manifest?.modules.find((V) => V.id === "blocks")?.meta?.groups ?? []
3378
+ ), ne = Jl()?.type, xe = S(() => l.context?.types ? l.context.types : r?.types ? { ...ft, ...r.types } : ne ? { ...ft, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : ft), Le = S(
3379
+ () => l.context?.translate ?? r?.i18n.t ?? ((V) => V)
3380
+ ), ze = S(() => l.context?.can ?? r?.can ?? (() => !0)), _e = Et(fs);
3381
+ function ie(V) {
3382
+ t.value = V;
3332
3383
  }
3333
- async function ve(A, z, H, be) {
3334
- const te = A ? me(d.value, A) : null, fe = te ? m.value.find((dt) => dt.slug === te.node.type) ?? null : a?.value ?? null, Ee = A === null ? l.allow : H?.props?.allow ?? null, Ve = A === null ? l.max : H?.props?.max ?? null, Ge = A === null ? d.value : te && z ? te.node.values[z] ?? [] : [];
3335
- if (Ve != null && Ge.length >= Ve) return;
3336
- const Ze = await xe({
3384
+ async function ve(V, z, H, be) {
3385
+ const te = V ? me(p.value, V) : null, fe = te ? m.value.find((dt) => dt.slug === te.node.type) ?? null : a?.value ?? null, Ce = V === null ? l.allow : H?.props?.allow ?? null, Ae = V === null ? l.max : H?.props?.max ?? null, Ge = V === null ? p.value : te && z ? te.node.values[z] ?? [] : [];
3386
+ if (Ae != null && Ge.length >= Ae) return;
3387
+ const Ze = await _e({
3337
3388
  catalog: m.value,
3338
3389
  parent: fe,
3339
- allow: Ee,
3340
- tree: d.value,
3390
+ allow: Ce,
3391
+ tree: p.value,
3341
3392
  groups: he.value,
3342
3393
  blocksPath: l.blocksPath
3343
3394
  });
3344
3395
  if (!Ze) return;
3345
- const Pe = Wn(Ze.slug, Ce(Ze));
3346
- ie(yt(d.value, A, z, be ?? Ge.length, Pe)), f.value = Pe.key;
3396
+ const Ue = Mn(Ze.slug, Ee(Ze));
3397
+ ie(wt(p.value, V, z, be ?? Ge.length, Ue)), f.value = Ue.key;
3347
3398
  }
3348
- function Ce(A) {
3349
- const z = A.content?.sample ?? {}, H = {};
3399
+ function Ee(V) {
3400
+ const z = V.content?.sample ?? {}, H = {};
3350
3401
  for (const [be, te] of Object.entries(z))
3351
3402
  (!Array.isArray(te) || te.length === 0 || typeof te[0] != "object") && (H[be] = te);
3352
3403
  return H;
3353
3404
  }
3354
- async function N(A) {
3355
- const z = me(d.value, A);
3405
+ async function M(V) {
3406
+ const z = me(p.value, V);
3356
3407
  if (!z) return;
3357
- const H = Nn(z.node);
3408
+ const H = Dn(z.node);
3358
3409
  await vt({
3359
3410
  title: i("field.remove-title", {
3360
3411
  title: m.value.find((te) => te.slug === z.node.type)?.title ?? z.node.type
@@ -3363,21 +3414,21 @@ const ls = { class: "wx-block-picker" }, ns = {
3363
3414
  confirmText: i("field.remove"),
3364
3415
  cancelText: i("page.cancel"),
3365
3416
  tone: "danger"
3366
- }) && (f.value === A && (f.value = null), ie(Qt(d.value, A)));
3417
+ }) && (f.value === V && (f.value = null), ie(el(p.value, V)));
3367
3418
  }
3368
- function j(A) {
3369
- const z = me(d.value, A);
3419
+ function j(V) {
3420
+ const z = me(p.value, V);
3370
3421
  if (!z) return;
3371
- const H = bl(z.node);
3372
- ie(yt(d.value, z.parent?.key ?? null, z.field, z.index + 1, H)), f.value = H.key;
3422
+ const H = gl(z.node);
3423
+ ie(wt(p.value, z.parent?.key ?? null, z.field, z.index + 1, H)), f.value = H.key;
3373
3424
  }
3374
- const q = St(Yo);
3375
- async function pe(A) {
3376
- const z = me(d.value, A);
3425
+ const q = Et(Qo);
3426
+ async function pe(V) {
3427
+ const z = me(p.value, V);
3377
3428
  if (!z) return;
3378
3429
  const H = await q({
3379
3430
  title: T(z.node),
3380
- destinations: ts(d.value, A, m.value, {
3431
+ destinations: ss(p.value, V, m.value, {
3381
3432
  owner: a?.value ?? null,
3382
3433
  allow: l.allow,
3383
3434
  max: l.max
@@ -3385,35 +3436,35 @@ const ls = { class: "wx-block-picker" }, ns = {
3385
3436
  topLabel: a?.value?.title ?? i("field.move-page")
3386
3437
  });
3387
3438
  if (!H) return;
3388
- const be = Qt(d.value, A);
3389
- ie(yt(be, H.parentKey, H.field, Number.MAX_SAFE_INTEGER, z.node));
3439
+ const be = el(p.value, V);
3440
+ ie(wt(be, H.parentKey, H.field, Number.MAX_SAFE_INTEGER, z.node));
3390
3441
  }
3391
- function V(A, z) {
3392
- ie(zn(d.value, A, z));
3442
+ function A(V, z) {
3443
+ ie(On(p.value, V, z));
3393
3444
  }
3394
- function O(A, z, H) {
3395
- ie(In(d.value, A, z, H));
3445
+ function O(V, z, H) {
3446
+ ie(Un(p.value, V, z, H));
3396
3447
  }
3397
- function I(A) {
3398
- f.value = f.value === A ? null : A;
3448
+ function I(V) {
3449
+ f.value = f.value === V ? null : V;
3399
3450
  }
3400
- function Y(A) {
3401
- A === null || !me(d.value, A) || (f.value = A, P.value && (Q.value = !0));
3451
+ function J(V) {
3452
+ V === null || !me(p.value, V) || (f.value = V, U.value && (Q.value = !0));
3402
3453
  }
3403
3454
  function Te() {
3404
3455
  f.value = null;
3405
3456
  }
3406
- function Ye(A) {
3407
- f.value && ie(On(d.value, f.value, A));
3457
+ function Je(V) {
3458
+ f.value && ie(Pn(p.value, f.value, V));
3408
3459
  }
3409
- let Le;
3460
+ let Be;
3410
3461
  ue(
3411
3462
  () => h.value?.node.values,
3412
- (A, z) => {
3413
- if (!A || !z || !x.value || !p || !R) return;
3463
+ (V, z) => {
3464
+ if (!V || !z || !x.value || !c || !R) return;
3414
3465
  const H = f.value, be = x.value.id;
3415
- clearTimeout(Le), Le = setTimeout(() => {
3416
- !H || !p || p.render(be, { values: A, key: H }).then((te) => {
3466
+ clearTimeout(Be), Be = setTimeout(() => {
3467
+ !H || !c || c.render(be, { values: V, key: H }).then((te) => {
3417
3468
  G.value?.replace(H, te.html) || G.value?.refresh();
3418
3469
  }).catch(() => {
3419
3470
  });
@@ -3421,79 +3472,79 @@ const ls = { class: "wx-block-picker" }, ns = {
3421
3472
  },
3422
3473
  { deep: !0 }
3423
3474
  );
3424
- function Ue(A) {
3425
- A.key === "Escape" && f.value && Te();
3475
+ function Pe(V) {
3476
+ V.key === "Escape" && f.value && Te();
3426
3477
  }
3427
3478
  ot(async () => {
3428
- if (window.addEventListener("keydown", Ue), l.catalog === null && r) {
3429
- p = Ke(r);
3479
+ if (window.addEventListener("keydown", Pe), l.catalog === null && r) {
3480
+ c = Ke(r);
3430
3481
  try {
3431
- u.value = await p.catalog();
3432
- } catch (A) {
3433
- X.danger(s(A));
3482
+ u.value = await c.catalog();
3483
+ } catch (V) {
3484
+ X.danger(s(V));
3434
3485
  }
3435
- } else r && (p = Ke(r));
3486
+ } else r && (c = Ke(r));
3436
3487
  }), st(() => {
3437
- clearTimeout(Le), window.removeEventListener("keydown", Ue);
3488
+ clearTimeout(Be), window.removeEventListener("keydown", Pe);
3438
3489
  });
3439
3490
  const ct = S(
3440
3491
  () => x.value?.content ? Ut(x.value.content.schema) : []
3441
3492
  );
3442
- return (A, z) => n(o) ? (c(), w("div", Ss, [
3443
- v(n(J), {
3493
+ return (V, z) => n(o) ? (d(), w("div", As, [
3494
+ v(n(Y), {
3444
3495
  size: "sm",
3445
3496
  tone: "muted"
3446
3497
  }, {
3447
3498
  default: g(() => [
3448
- B(k(n(i)("field.nested-note")), 1)
3499
+ L(k(n(i)("field.nested-note")), 1)
3449
3500
  ]),
3450
3501
  _: 1
3451
3502
  })
3452
- ])) : (c(), w("div", {
3503
+ ])) : (d(), w("div", {
3453
3504
  key: 1,
3454
3505
  ref_key: "host",
3455
3506
  ref: ee,
3456
- class: Me(["wx-blocks-host", { "is-compact": P.value }])
3507
+ class: Ne(["wx-blocks-host", { "is-compact": U.value }])
3457
3508
  }, [
3458
- E("div", {
3459
- class: Me(["wx-blocks", {
3509
+ C("div", {
3510
+ class: Ne(["wx-blocks", {
3460
3511
  "is-editing": h.value !== null,
3461
3512
  "has-preview": n(R) !== null && n(R).url.value !== null
3462
3513
  }])
3463
3514
  }, [
3464
- (c(), W(Jl(P.value ? n(Il) : "div"), Yl(Se.value, { class: "wx-blocks__side" }), {
3515
+ (d(), W(Gl(U.value ? n(Ul) : "div"), Zl(Se.value, { class: "wx-blocks__side" }), {
3465
3516
  default: g(() => [
3466
- h.value ? L("", !0) : (c(), w("div", Cs, [
3467
- E("div", Ts, [
3468
- E("span", Es, k(n(i)("field.blocks")), 1),
3469
- v(n(J), {
3517
+ h.value ? B("", !0) : (d(), w("div", Vs, [
3518
+ C("div", Ls, [
3519
+ C("span", Bs, k(n(i)("field.blocks")), 1),
3520
+ v(n(Y), {
3470
3521
  size: "sm",
3471
3522
  tone: "muted"
3472
3523
  }, {
3473
3524
  default: g(() => [
3474
- B(k(d.value.length), 1)
3525
+ L(k(p.value.length), 1)
3475
3526
  ]),
3476
3527
  _: 1
3477
3528
  })
3478
3529
  ]),
3479
- E("div", Vs, [
3480
- v($s, {
3481
- nodes: d.value,
3530
+ C("div", Ws, [
3531
+ v(Cs, {
3532
+ nodes: p.value,
3482
3533
  catalog: m.value,
3483
3534
  max: e.max,
3484
3535
  selected: f.value,
3485
3536
  disabled: e.disabled,
3486
3537
  onSelect: I,
3487
3538
  onAdd: ve,
3488
- onRemove: N,
3539
+ onRemove: M,
3489
3540
  onDuplicate: j,
3490
3541
  onMove: pe,
3491
- onVisibility: V,
3542
+ onVisibility: A,
3492
3543
  onReorder: O
3493
3544
  }, null, 8, ["nodes", "catalog", "max", "selected", "disabled"])
3494
3545
  ]),
3495
- E("div", As, [
3496
- !e.disabled && (e.max === null || d.value.length < e.max) ? (c(), W(n(ce), {
3546
+ C("div", Ns, [
3547
+ !e.disabled && (e.max === null || p.value.length < e.max) ? (d(), W(n(ce), {
3497
3548
  key: 0,
3498
3549
  variant: "outline",
3499
3550
  icon: "plus",
@@ -3501,11 +3552,11 @@ const ls = { class: "wx-block-picker" }, ns = {
3501
3552
  onClick: z[0] || (z[0] = (H) => ve(null, null, null))
3502
3553
  }, {
3503
3554
  default: g(() => [
3504
- B(k(n(i)("field.add")), 1)
3555
+ L(k(n(i)("field.add")), 1)
3505
3556
  ]),
3506
3557
  _: 1
3507
- })) : L("", !0),
3508
- !P.value && n(R) && n(R).url.value ? (c(), W(n(ce), {
3558
+ })) : B("", !0),
3559
+ !U.value && n(R) && n(R).url.value ? (d(), W(n(ce), {
3509
3560
  key: 1,
3510
3561
  variant: "outline",
3511
3562
  icon: "eye",
@@ -3513,31 +3564,31 @@ const ls = { class: "wx-block-picker" }, ns = {
3513
3564
  onClick: z[1] || (z[1] = (H) => G.value?.open())
3514
3565
  }, {
3515
3566
  default: g(() => [
3516
- B(k(n(i)("field.preview")), 1)
3567
+ L(k(n(i)("field.preview")), 1)
3517
3568
  ]),
3518
3569
  _: 1
3519
- })) : L("", !0)
3570
+ })) : B("", !0)
3520
3571
  ])
3521
3572
  ])),
3522
- h.value ? (c(), w("div", Bs, [
3523
- E("div", Ls, [
3524
- E("span", Ws, [
3525
- $.value.length ? (c(), w("span", Ms, [
3526
- (c(!0), w(F, null, Z($.value, (H) => (c(), w(F, {
3573
+ h.value ? (d(), w("div", Ms, [
3574
+ C("div", zs, [
3575
+ C("span", Ds, [
3576
+ $.value.length ? (d(), w("span", Os, [
3577
+ (d(!0), w(F, null, Z($.value, (H) => (d(), w(F, {
3527
3578
  key: H.key
3528
3579
  }, [
3529
- E("button", {
3580
+ C("button", {
3530
3581
  type: "button",
3531
3582
  class: "wx-blocks__trail-step",
3532
3583
  onClick: (be) => I(H.key)
3533
- }, k(H.title), 9, Ns),
3534
- v(n(ye), { name: "chevron-right" })
3584
+ }, k(H.title), 9, Is),
3585
+ v(n(we), { name: "chevron-right" })
3535
3586
  ], 64))), 128))
3536
- ])) : L("", !0),
3537
- E("span", zs, k(x.value?.title ?? h.value.node.type), 1)
3587
+ ])) : B("", !0),
3588
+ C("span", Ps, k(x.value?.title ?? h.value.node.type), 1)
3538
3589
  ]),
3539
- E("span", Ds, [
3540
- P.value ? L("", !0) : (c(), w("code", Os, k(h.value.node.type), 1)),
3590
+ C("span", Us, [
3591
+ U.value ? B("", !0) : (d(), w("code", Rs, k(h.value.node.type), 1)),
3541
3592
  v(n(et), {
3542
3593
  size: "sm",
3543
3594
  tone: "neutral",
@@ -3554,7 +3605,7 @@ const ls = { class: "wx-block-picker" }, ns = {
3554
3605
  disabled: b.value.next === null,
3555
3606
  onClick: z[3] || (z[3] = (H) => b.value.next && I(b.value.next))
3556
3607
  }, null, 8, ["title", "disabled"]),
3557
- !P.value && n(R) && n(R).url.value ? (c(), W(n(ce), {
3608
+ !U.value && n(R) && n(R).url.value ? (d(), W(n(ce), {
3558
3609
  key: 1,
3559
3610
  size: "sm",
3560
3611
  variant: "outline",
@@ -3562,60 +3613,60 @@ const ls = { class: "wx-block-picker" }, ns = {
3562
3613
  class: "wx-blocks__preview-button",
3563
3614
  "aria-label": n(i)("field.preview"),
3564
3615
  onClick: z[4] || (z[4] = (H) => G.value?.open())
3565
- }, null, 8, ["aria-label"])) : L("", !0),
3616
+ }, null, 8, ["aria-label"])) : B("", !0),
3566
3617
  v(n(ce), {
3567
3618
  size: "sm",
3568
3619
  variant: "outline",
3569
3620
  onClick: Te
3570
3621
  }, {
3571
3622
  default: g(() => [
3572
- B(k(P.value ? n(i)("field.done") : `${n(i)("field.done")} · Esc`), 1)
3623
+ L(k(U.value ? n(i)("field.done") : `${n(i)("field.done")} · Esc`), 1)
3573
3624
  ]),
3574
3625
  _: 1
3575
3626
  })
3576
3627
  ])
3577
3628
  ]),
3578
- E("div", Is, [
3579
- x.value?.content ? (c(), W(n(cl), {
3629
+ C("div", js, [
3630
+ x.value?.content ? (d(), W(n(dl), {
3580
3631
  key: h.value.node.key,
3581
3632
  "model-value": h.value.node.values,
3582
3633
  root: ct.value,
3583
- types: we.value,
3584
- translate: Be.value,
3634
+ types: xe.value,
3635
+ translate: Le.value,
3585
3636
  can: ze.value,
3586
3637
  disabled: e.disabled,
3587
- "onUpdate:modelValue": Ye
3588
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (c(), W(n(J), {
3638
+ "onUpdate:modelValue": Je
3639
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (d(), W(n(Y), {
3589
3640
  key: 1,
3590
3641
  size: "sm",
3591
3642
  tone: "danger"
3592
3643
  }, {
3593
3644
  default: g(() => [
3594
- B(k(n(i)("field.unknown-type", { type: h.value.node.type })), 1)
3645
+ L(k(n(i)("field.unknown-type", { type: h.value.node.type })), 1)
3595
3646
  ]),
3596
3647
  _: 1
3597
3648
  }))
3598
3649
  ])
3599
- ])) : L("", !0)
3650
+ ])) : B("", !0)
3600
3651
  ]),
3601
3652
  _: 1
3602
3653
  }, 16)),
3603
- n(R) && n(R).url.value ? (c(), w("div", Us, [
3604
- v(fs, {
3654
+ n(R) && n(R).url.value ? (d(), w("div", Fs, [
3655
+ v(bs, {
3605
3656
  ref_key: "previewEl",
3606
3657
  ref: G,
3607
3658
  url: n(R).url.value,
3608
3659
  selected: f.value,
3609
3660
  reload: n(R).reload?.value ?? 0,
3610
- compact: P.value,
3611
- onSelect: Y,
3661
+ compact: U.value,
3662
+ onSelect: J,
3612
3663
  onEdit: z[5] || (z[5] = (H) => Q.value = !0)
3613
3664
  }, null, 8, ["url", "selected", "reload", "compact"])
3614
- ])) : L("", !0)
3665
+ ])) : B("", !0)
3615
3666
  ], 2)
3616
3667
  ], 2));
3617
3668
  }
3618
- }), Rs = /* @__PURE__ */ se(Ps, [["__scopeId", "data-v-9de2f53a"]]), js = { class: "wx-block-card__body" }, Fs = { class: "wx-block-card__title" }, Hs = { class: "wx-block-card__chips" }, Ks = /* @__PURE__ */ oe({
3669
+ }), Ks = /* @__PURE__ */ se(Hs, [["__scopeId", "data-v-9de2f53a"]]), qs = { class: "wx-block-card__body" }, Ys = { class: "wx-block-card__title" }, Js = { class: "wx-block-card__chips" }, Gs = /* @__PURE__ */ oe({
3619
3670
  __name: "BlockCard",
3620
3671
  props: {
3621
3672
  block: {},
@@ -3624,92 +3675,92 @@ const ls = { class: "wx-block-picker" }, ns = {
3624
3675
  emits: ["open"],
3625
3676
  setup(e, { emit: l }) {
3626
3677
  const t = l, o = de("webx-blocks");
3627
- return (a, i) => (c(), w("button", {
3678
+ return (a, i) => (d(), w("button", {
3628
3679
  type: "button",
3629
3680
  class: "wx-block-card",
3630
3681
  onClick: i[0] || (i[0] = (s) => t("open", e.block))
3631
3682
  }, [
3632
- v(El, {
3683
+ v(Vl, {
3633
3684
  thumbnail: e.block.thumbnail,
3634
3685
  height: n($e)(e.block) === "component" ? 180 : 120,
3635
3686
  width: n($e)(e.block) === "component" ? 360 : void 0,
3636
3687
  fit: n($e)(e.block) === "component"
3637
3688
  }, null, 8, ["thumbnail", "height", "width", "fit"]),
3638
- E("div", js, [
3639
- E("div", Fs, k(e.block.title), 1),
3640
- v(n(J), {
3689
+ C("div", qs, [
3690
+ C("div", Ys, k(e.block.title), 1),
3691
+ v(n(Y), {
3641
3692
  size: "sm",
3642
3693
  tone: "muted"
3643
3694
  }, {
3644
3695
  default: g(() => [
3645
- E("code", null, k(e.block.slug), 1),
3646
- i[1] || (i[1] = B(" · ", -1)),
3647
- n($e)(e.block) === "component" ? (c(), w(F, { key: 0 }, [
3648
- B(k(n(Tl)(e.block.used_by?.length ?? 0, n(o))) + " ", 1),
3649
- e.module ? (c(), w(F, { key: 0 }, [
3650
- B("· " + k(n(o)("components.module", { module: e.module })), 1)
3651
- ], 64)) : L("", !0)
3652
- ], 64)) : (c(), w(F, { key: 1 }, [
3653
- B(k(n(Cl)(e.block.usage_count, n(o))), 1)
3696
+ C("code", null, k(e.block.slug), 1),
3697
+ i[1] || (i[1] = L(" · ", -1)),
3698
+ n($e)(e.block) === "component" ? (d(), w(F, { key: 0 }, [
3699
+ L(k(n(Al)(e.block.used_by?.length ?? 0, n(o))) + " ", 1),
3700
+ e.module ? (d(), w(F, { key: 0 }, [
3701
+ L("· " + k(n(o)("components.module", { module: e.module })), 1)
3702
+ ], 64)) : B("", !0)
3703
+ ], 64)) : (d(), w(F, { key: 1 }, [
3704
+ L(k(n(Cl)(e.block.usage_count, n(o))), 1)
3654
3705
  ], 64))
3655
3706
  ]),
3656
3707
  _: 1
3657
3708
  }),
3658
- E("div", Hs, [
3659
- e.block.draft ? (c(), W(n(ke), {
3709
+ C("div", Js, [
3710
+ e.block.draft ? (d(), W(n(ye), {
3660
3711
  key: 0,
3661
3712
  type: "warning",
3662
3713
  dot: ""
3663
3714
  }, {
3664
3715
  default: g(() => [
3665
- B(k(n(o)("page.draft", { number: e.block.draft.number })), 1)
3716
+ L(k(n(o)("page.draft", { number: e.block.draft.number })), 1)
3666
3717
  ]),
3667
3718
  _: 1
3668
- })) : L("", !0),
3669
- e.block.published ? (c(), W(n(ke), {
3719
+ })) : B("", !0),
3720
+ e.block.published ? (d(), W(n(ye), {
3670
3721
  key: 1,
3671
3722
  type: "success",
3672
3723
  dot: ""
3673
3724
  }, {
3674
3725
  default: g(() => [
3675
- B(k(n(o)("page.live", { number: e.block.published.number })), 1)
3726
+ L(k(n(o)("page.live", { number: e.block.published.number })), 1)
3676
3727
  ]),
3677
3728
  _: 1
3678
- })) : (c(), W(n(ke), {
3729
+ })) : (d(), W(n(ye), {
3679
3730
  key: 2,
3680
3731
  type: "default"
3681
3732
  }, {
3682
3733
  default: g(() => [
3683
- B(k(n(o)("page.never-published")), 1)
3734
+ L(k(n(o)("page.never-published")), 1)
3684
3735
  ]),
3685
3736
  _: 1
3686
3737
  })),
3687
- !e.block.is_enabled && n($e)(e.block) !== "component" ? (c(), W(n(ke), {
3738
+ !e.block.is_enabled && n($e)(e.block) !== "component" ? (d(), W(n(ye), {
3688
3739
  key: 3,
3689
3740
  type: "default",
3690
3741
  variant: "outline"
3691
3742
  }, {
3692
3743
  default: g(() => [
3693
- B(k(n(o)("page.hidden")), 1)
3744
+ L(k(n(o)("page.hidden")), 1)
3694
3745
  ]),
3695
3746
  _: 1
3696
- })) : L("", !0)
3747
+ })) : B("", !0)
3697
3748
  ])
3698
3749
  ])
3699
3750
  ]));
3700
3751
  }
3701
- }), ol = /* @__PURE__ */ se(Ks, [["__scopeId", "data-v-1d29dfee"]]), qs = { class: "wx-block-create" }, Js = { class: "wx-block-create__kind" }, Ys = { class: "wx-block-create__kind-help" }, Gs = { class: "wx-block-create__kind" }, Zs = { class: "wx-block-create__kind-help" }, Xs = /* @__PURE__ */ oe({
3752
+ }), sl = /* @__PURE__ */ se(Gs, [["__scopeId", "data-v-1d29dfee"]]), Zs = { class: "wx-block-create" }, Xs = { class: "wx-block-create__kind" }, Qs = { class: "wx-block-create__kind-help" }, ea = { class: "wx-block-create__kind" }, ta = { class: "wx-block-create__kind-help" }, la = /* @__PURE__ */ oe({
3702
3753
  __name: "BlockCreateDialog",
3703
3754
  setup(e) {
3704
- const { resolve: l, dismiss: t, open: o } = At(), a = at(), i = Ke(a);
3705
- Ne();
3706
- const s = de("webx-blocks"), r = it(), p = S(() => a.state.manifest?.modules.find(($) => $.id === "blocks")?.meta?.groups ?? ["content"]), u = U({
3755
+ const { resolve: l, dismiss: t, open: o } = Lt(), a = at(), i = Ke(a);
3756
+ Me();
3757
+ const s = de("webx-blocks"), r = it(), c = S(() => a.state.manifest?.modules.find(($) => $.id === "blocks")?.meta?.groups ?? ["content"]), u = P({
3707
3758
  kind: "block",
3708
3759
  title: "",
3709
3760
  slug: "",
3710
- group: p.value[0] ?? "content"
3711
- }), m = U({}), d = U(!1), f = U(!1), h = S(
3712
- () => p.value.map((b) => ({ value: b, label: qe(b, s) }))
3761
+ group: c.value[0] ?? "content"
3762
+ }), m = P({}), p = P(!1), f = P(!1), h = S(
3763
+ () => c.value.map((b) => ({ value: b, label: qe(b, s) }))
3713
3764
  );
3714
3765
  function x(b) {
3715
3766
  return b.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
@@ -3724,7 +3775,7 @@ const ls = { class: "wx-block-picker" }, ns = {
3724
3775
  return m.value[b]?.[0];
3725
3776
  }
3726
3777
  async function _() {
3727
- d.value = !0, m.value = {};
3778
+ p.value = !0, m.value = {};
3728
3779
  try {
3729
3780
  const { group: b, ...$ } = u.value;
3730
3781
  l(await i.create(u.value.kind === "component" ? $ : { ...$, group: b }));
@@ -3732,34 +3783,34 @@ const ls = { class: "wx-block-picker" }, ns = {
3732
3783
  const $ = b.body;
3733
3784
  $?.errors ? m.value = $.errors : X.danger(r(b, s("page.failed")));
3734
3785
  } finally {
3735
- d.value = !1;
3786
+ p.value = !1;
3736
3787
  }
3737
3788
  }
3738
- return (b, $) => (c(), W(n(Bt), {
3789
+ return (b, $) => (d(), W(n(Bt), {
3739
3790
  open: n(o),
3740
- "onUpdate:open": $[6] || ($[6] = (R) => Nt(o) ? o.value = R : null),
3791
+ "onUpdate:open": $[6] || ($[6] = (R) => zt(o) ? o.value = R : null),
3741
3792
  title: n(s)("page.new"),
3742
3793
  width: 520
3743
3794
  }, {
3744
3795
  footer: g(() => [
3745
- v(n(Pl), { size: "sm" }, {
3796
+ v(n(jl), { size: "sm" }, {
3746
3797
  default: g(() => [
3747
3798
  v(n(ce), {
3748
3799
  variant: "outline",
3749
3800
  onClick: $[5] || ($[5] = (R) => n(t)())
3750
3801
  }, {
3751
3802
  default: g(() => [
3752
- B(k(n(s)("page.cancel")), 1)
3803
+ L(k(n(s)("page.cancel")), 1)
3753
3804
  ]),
3754
3805
  _: 1
3755
3806
  }),
3756
3807
  v(n(ce), {
3757
3808
  type: "primary",
3758
- loading: d.value,
3809
+ loading: p.value,
3759
3810
  onClick: _
3760
3811
  }, {
3761
3812
  default: g(() => [
3762
- B(k(n(s)("page.create")), 1)
3813
+ L(k(n(s)("page.create")), 1)
3763
3814
  ]),
3764
3815
  _: 1
3765
3816
  }, 8, ["loading"])
@@ -3768,29 +3819,29 @@ const ls = { class: "wx-block-picker" }, ns = {
3768
3819
  })
3769
3820
  ]),
3770
3821
  default: g(() => [
3771
- E("div", qs, [
3822
+ C("div", Zs, [
3772
3823
  v(n(re), {
3773
3824
  label: n(s)("components.kind"),
3774
3825
  error: T("kind")
3775
3826
  }, {
3776
3827
  default: g(() => [
3777
- v(n(Ul), {
3828
+ v(n(Rl), {
3778
3829
  modelValue: u.value.kind,
3779
3830
  "onUpdate:modelValue": $[0] || ($[0] = (R) => u.value.kind = R),
3780
3831
  class: "wx-block-create__kinds"
3781
3832
  }, {
3782
3833
  default: g(() => [
3783
- v(n(Ht), { value: "block" }, {
3834
+ v(n(Kt), { value: "block" }, {
3784
3835
  default: g(() => [
3785
- E("span", Js, k(n(s)("components.kind-block")), 1),
3786
- E("span", Ys, k(n(s)("components.kind-block-help")), 1)
3836
+ C("span", Xs, k(n(s)("components.kind-block")), 1),
3837
+ C("span", Qs, k(n(s)("components.kind-block-help")), 1)
3787
3838
  ]),
3788
3839
  _: 1
3789
3840
  }),
3790
- v(n(Ht), { value: "component" }, {
3841
+ v(n(Kt), { value: "component" }, {
3791
3842
  default: g(() => [
3792
- E("span", Gs, k(n(s)("components.kind-component")), 1),
3793
- E("span", Zs, k(n(s)("components.kind-component-help")), 1)
3843
+ C("span", ea, k(n(s)("components.kind-component")), 1),
3844
+ C("span", ta, k(n(s)("components.kind-component-help")), 1)
3794
3845
  ]),
3795
3846
  _: 1
3796
3847
  })
@@ -3828,33 +3879,33 @@ const ls = { class: "wx-block-picker" }, ns = {
3828
3879
  ]),
3829
3880
  _: 1
3830
3881
  }, 8, ["label", "help", "error"]),
3831
- u.value.kind === "block" ? (c(), W(n(re), {
3882
+ u.value.kind === "block" ? (d(), W(n(re), {
3832
3883
  key: 0,
3833
3884
  label: n(s)("page.group"),
3834
3885
  help: n(s)("page.group-help"),
3835
3886
  error: T("group")
3836
3887
  }, {
3837
3888
  default: g(() => [
3838
- v(n($t), {
3889
+ v(n(St), {
3839
3890
  modelValue: u.value.group,
3840
3891
  "onUpdate:modelValue": $[4] || ($[4] = (R) => u.value.group = R),
3841
3892
  options: h.value
3842
3893
  }, null, 8, ["modelValue", "options"])
3843
3894
  ]),
3844
3895
  _: 1
3845
- }, 8, ["label", "help", "error"])) : L("", !0)
3896
+ }, 8, ["label", "help", "error"])) : B("", !0)
3846
3897
  ])
3847
3898
  ]),
3848
3899
  _: 1
3849
3900
  }, 8, ["open", "title"]));
3850
3901
  }
3851
- }), Qs = /* @__PURE__ */ se(Xs, [["__scopeId", "data-v-585106f0"]]), ea = { class: "wx-block-declared" }, ta = {
3902
+ }), na = /* @__PURE__ */ se(la, [["__scopeId", "data-v-585106f0"]]), oa = { class: "wx-block-declared" }, sa = {
3852
3903
  class: "wx-block-declared__mark",
3853
3904
  "aria-hidden": "true"
3854
- }, la = { class: "wx-block-declared__body" }, na = { class: "wx-block-declared__title" }, oa = {
3905
+ }, aa = { class: "wx-block-declared__body" }, ia = { class: "wx-block-declared__title" }, ra = {
3855
3906
  key: 1,
3856
3907
  class: "wx-block-declared__actions"
3857
- }, sa = /* @__PURE__ */ oe({
3908
+ }, ua = /* @__PURE__ */ oe({
3858
3909
  __name: "BlockDeclaredCard",
3859
3910
  props: {
3860
3911
  declared: {},
@@ -3865,164 +3916,164 @@ const ls = { class: "wx-block-picker" }, ns = {
3865
3916
  emits: ["customise"],
3866
3917
  setup(e, { emit: l }) {
3867
3918
  const t = l;
3868
- Ne();
3919
+ Me();
3869
3920
  const o = de("webx-blocks");
3870
- return (a, i) => (c(), w("div", ea, [
3871
- E("div", ta, [
3872
- v(n(ye), { name: "sliders" })
3921
+ return (a, i) => (d(), w("div", oa, [
3922
+ C("div", sa, [
3923
+ v(n(we), { name: "sliders" })
3873
3924
  ]),
3874
- E("div", la, [
3875
- E("div", na, k(e.declared.title), 1),
3876
- v(n(J), {
3925
+ C("div", aa, [
3926
+ C("div", ia, k(e.declared.title), 1),
3927
+ v(n(Y), {
3877
3928
  size: "sm",
3878
3929
  tone: "muted"
3879
3930
  }, {
3880
3931
  default: g(() => [
3881
- E("code", null, k(e.declared.slug), 1),
3882
- B(" · " + k(n(o)("components.standard", { module: e.module })), 1)
3932
+ C("code", null, k(e.declared.slug), 1),
3933
+ L(" · " + k(n(o)("components.standard", { module: e.module })), 1)
3883
3934
  ]),
3884
3935
  _: 1
3885
3936
  }),
3886
- e.declared.description ? (c(), W(n(J), {
3937
+ e.declared.description ? (d(), W(n(Y), {
3887
3938
  key: 0,
3888
3939
  size: "sm",
3889
3940
  tone: "muted"
3890
3941
  }, {
3891
3942
  default: g(() => [
3892
- B(k(e.declared.description), 1)
3943
+ L(k(e.declared.description), 1)
3893
3944
  ]),
3894
3945
  _: 1
3895
- })) : L("", !0),
3896
- v(n(J), {
3946
+ })) : B("", !0),
3947
+ v(n(Y), {
3897
3948
  size: "sm",
3898
3949
  tone: "muted",
3899
3950
  class: "wx-block-declared__help"
3900
3951
  }, {
3901
3952
  default: g(() => [
3902
- B(k(n(o)("components.standard-help")), 1)
3953
+ L(k(n(o)("components.standard-help")), 1)
3903
3954
  ]),
3904
3955
  _: 1
3905
3956
  }),
3906
- e.canManage ? (c(), w("div", oa, [
3957
+ e.canManage ? (d(), w("div", ra, [
3907
3958
  v(n(ce), {
3908
3959
  size: "sm",
3909
3960
  loading: e.busy,
3910
3961
  onClick: i[0] || (i[0] = (s) => t("customise", e.declared))
3911
3962
  }, {
3912
3963
  default: g(() => [
3913
- B(k(n(o)("components.customise")), 1)
3964
+ L(k(n(o)("components.customise")), 1)
3914
3965
  ]),
3915
3966
  _: 1
3916
3967
  }, 8, ["loading"])
3917
- ])) : L("", !0)
3968
+ ])) : B("", !0)
3918
3969
  ])
3919
3970
  ]));
3920
3971
  }
3921
- }), aa = /* @__PURE__ */ se(sa, [["__scopeId", "data-v-3c4079a4"]]), ia = {
3972
+ }), ca = /* @__PURE__ */ se(ua, [["__scopeId", "data-v-3c4079a4"]]), da = {
3922
3973
  key: 1,
3923
3974
  class: "wx-blocks-page__toolbar"
3924
- }, ra = { class: "wx-blocks-page__cards" }, ua = { class: "wx-blocks-page__ghost-body" }, ca = {
3975
+ }, pa = { class: "wx-blocks-page__cards" }, fa = { class: "wx-blocks-page__ghost-body" }, ma = {
3925
3976
  key: 0,
3926
3977
  class: "wx-blocks-page__group-title"
3927
- }, da = {
3978
+ }, ha = {
3928
3979
  key: 0,
3929
3980
  class: "wx-blocks-page__group"
3930
- }, pa = {
3981
+ }, va = {
3931
3982
  key: 0,
3932
3983
  class: "wx-blocks-page__group-title"
3933
- }, fa = { class: "wx-blocks-page__cards" }, je = "@components", ma = /* @__PURE__ */ oe({
3984
+ }, ba = { class: "wx-blocks-page__cards" }, je = "@components", ga = /* @__PURE__ */ oe({
3934
3985
  __name: "BlocksPage",
3935
3986
  props: {
3936
3987
  base: { default: "/blocks" }
3937
3988
  },
3938
3989
  setup(e) {
3939
- const l = e, t = at(), o = Ke(t), a = ul();
3940
- Ne();
3941
- const i = de("webx-blocks"), s = it(), r = U([]), p = U([]), u = U(!0), m = U(""), d = U(""), f = U(null), h = St(Qs), x = S(() => {
3942
- const V = t.state.manifest?.modules.find((O) => O.id === "blocks")?.meta;
3990
+ const l = e, t = at(), o = Ke(t), a = cl();
3991
+ Me();
3992
+ const i = de("webx-blocks"), s = it(), r = P([]), c = P([]), u = P(!0), m = P(""), p = P(""), f = P(null), h = Et(na), x = S(() => {
3993
+ const A = t.state.manifest?.modules.find((O) => O.id === "blocks")?.meta;
3943
3994
  return {
3944
- groups: V?.groups ?? [],
3945
- editing: V?.editing ?? !0,
3946
- provides: V?.provides ?? []
3995
+ groups: A?.groups ?? [],
3996
+ editing: A?.editing ?? !0,
3997
+ provides: A?.provides ?? []
3947
3998
  };
3948
3999
  }), T = S(() => t.can("blocks.manage") && x.value.editing), _ = S(
3949
- () => t.state.manifest?.modules.find((V) => V.id === "blocks")?.title ?? i("module.title")
3950
- ), b = S(() => r.value.filter((V) => $e(V) === "block")), $ = S(() => r.value.filter((V) => $e(V) === "component")), R = S(() => p.value.filter((V) => !V.customised)), G = S(() => $.value.length > 0 || R.value.length > 0);
3951
- function ee(V) {
3952
- return t.state.manifest?.modules.find((O) => O.id === V)?.title ?? V.charAt(0).toUpperCase() + V.slice(1);
4000
+ () => t.state.manifest?.modules.find((A) => A.id === "blocks")?.title ?? i("module.title")
4001
+ ), b = S(() => r.value.filter((A) => $e(A) === "block")), $ = S(() => r.value.filter((A) => $e(A) === "component")), R = S(() => c.value.filter((A) => !A.customised)), G = S(() => $.value.length > 0 || R.value.length > 0);
4002
+ function ee(A) {
4003
+ return t.state.manifest?.modules.find((O) => O.id === A)?.title ?? A.charAt(0).toUpperCase() + A.slice(1);
3953
4004
  }
3954
- function ae(V) {
3955
- const O = p.value.find((I) => I.slug === V);
4005
+ function ae(A) {
4006
+ const O = c.value.find((I) => I.slug === A);
3956
4007
  return O ? ee(O.module) : null;
3957
4008
  }
3958
- function D(V) {
4009
+ function D(A) {
3959
4010
  const O = m.value.trim().toLowerCase();
3960
- return O === "" || V.some((I) => (I ?? "").toLowerCase().includes(O));
4011
+ return O === "" || A.some((I) => (I ?? "").toLowerCase().includes(O));
3961
4012
  }
3962
- const P = S(() => d.value === je ? [] : (d.value === "" ? b.value : b.value.filter((O) => O.group === d.value)).filter((O) => D([O.title, O.slug, O.description]))), Q = S(
3963
- () => d.value === "" || d.value === je ? $.value.filter((V) => D([V.title, V.slug, V.description])) : []
4013
+ const U = S(() => p.value === je ? [] : (p.value === "" ? b.value : b.value.filter((O) => O.group === p.value)).filter((O) => D([O.title, O.slug, O.description]))), Q = S(
4014
+ () => p.value === "" || p.value === je ? $.value.filter((A) => D([A.title, A.slug, A.description])) : []
3964
4015
  ), le = S(
3965
- () => d.value === "" || d.value === je ? R.value.filter((V) => D([V.title, V.slug, V.description])) : []
4016
+ () => p.value === "" || p.value === je ? R.value.filter((A) => D([A.title, A.slug, A.description])) : []
3966
4017
  ), Se = S(() => {
3967
- const V = [...x.value.groups];
4018
+ const A = [...x.value.groups];
3968
4019
  for (const O of b.value)
3969
- V.includes(O.group) || V.push(O.group);
3970
- return V.filter((O) => b.value.some((I) => I.group === O));
4020
+ A.includes(O.group) || A.push(O.group);
4021
+ return A.filter((O) => b.value.some((I) => I.group === O));
3971
4022
  }), he = S(() => {
3972
- const V = Se.value.map((I) => ({ value: I, label: qe(I, i) })), O = G.value ? [{ value: je, label: i("components.components") }] : [];
3973
- return V.length + O.length < 2 ? [] : [{ value: "", label: i("page.all-groups") }, ...V, ...O];
4023
+ const A = Se.value.map((I) => ({ value: I, label: qe(I, i) })), O = G.value ? [{ value: je, label: i("components.components") }] : [];
4024
+ return A.length + O.length < 2 ? [] : [{ value: "", label: i("page.all-groups") }, ...A, ...O];
3974
4025
  }), ne = S(() => {
3975
- const V = Se.value.map((Y) => ({
3976
- id: Y,
3977
- label: qe(Y, i),
3978
- blocks: P.value.filter((Te) => Te.group === Y)
3979
- })).filter((Y) => Y.blocks.length > 0);
3980
- return d.value !== "" || P.value.length <= 5 || m.value.trim() !== "" || V.length < 2 ? P.value.length === 0 ? [] : [{ id: "", label: d.value === "" && Q.value.length + le.value.length > 0 ? i("components.blocks") : "", blocks: P.value }] : V;
3981
- }), we = S(
3982
- () => d.value === je || P.value.length === 0 ? "" : i("components.components")
3983
- ), Be = S(() => r.value.length === 0 && R.value.length === 0), ze = S(
3984
- () => T.value && d.value !== je && m.value.trim() === ""
4026
+ const A = Se.value.map((J) => ({
4027
+ id: J,
4028
+ label: qe(J, i),
4029
+ blocks: U.value.filter((Te) => Te.group === J)
4030
+ })).filter((J) => J.blocks.length > 0);
4031
+ return p.value !== "" || U.value.length <= 5 || m.value.trim() !== "" || A.length < 2 ? U.value.length === 0 ? [] : [{ id: "", label: p.value === "" && Q.value.length + le.value.length > 0 ? i("components.blocks") : "", blocks: U.value }] : A;
4032
+ }), xe = S(
4033
+ () => p.value === je || U.value.length === 0 ? "" : i("components.components")
4034
+ ), Le = S(() => r.value.length === 0 && R.value.length === 0), ze = S(
4035
+ () => T.value && p.value !== je && m.value.trim() === ""
3985
4036
  );
3986
- async function xe(V) {
3987
- const O = V.map((Y) => Y.id), I = [...V];
3988
- r.value = r.value.map((Y) => O.includes(Y.id) ? I.shift() : Y);
4037
+ async function _e(A) {
4038
+ const O = A.map((J) => J.id), I = [...A];
4039
+ r.value = r.value.map((J) => O.includes(J.id) ? I.shift() : J);
3989
4040
  try {
3990
4041
  await o.reorder(O);
3991
- } catch (Y) {
3992
- X.danger(s(Y)), await ie();
4042
+ } catch (J) {
4043
+ X.danger(s(J)), await ie();
3993
4044
  }
3994
4045
  }
3995
4046
  async function ie() {
3996
4047
  u.value = !0;
3997
4048
  try {
3998
- const V = await o.index();
3999
- r.value = V.blocks, p.value = V.declared;
4000
- } catch (V) {
4001
- X.danger(s(V));
4049
+ const A = await o.index();
4050
+ r.value = A.blocks, c.value = A.declared;
4051
+ } catch (A) {
4052
+ X.danger(s(A));
4002
4053
  } finally {
4003
4054
  u.value = !1;
4004
4055
  }
4005
4056
  }
4006
4057
  let ve = 0;
4007
- function Ce() {
4058
+ function Ee() {
4008
4059
  ve = Date.now();
4009
4060
  }
4010
- function N(V) {
4011
- Date.now() - ve < 400 || a.push(`${l.base}/${V.id}`);
4061
+ function M(A) {
4062
+ Date.now() - ve < 400 || a.push(`${l.base}/${A.id}`);
4012
4063
  }
4013
4064
  async function j() {
4014
- const V = await h({});
4015
- V && N(V);
4065
+ const A = await h({});
4066
+ A && M(A);
4016
4067
  }
4017
- async function q(V) {
4018
- f.value = V.slug;
4068
+ async function q(A) {
4069
+ f.value = A.slug;
4019
4070
  try {
4020
- const O = await o.customise(V.slug);
4021
- X.success(i("components.customised")), N(O);
4071
+ const O = await o.customise(A.slug);
4072
+ X.success(i("components.customised")), M(O);
4022
4073
  } catch (O) {
4023
4074
  const I = O.body;
4024
4075
  if (O.status === 409 && typeof I?.id == "number") {
4025
- N({ id: I.id });
4076
+ M({ id: I.id });
4026
4077
  return;
4027
4078
  }
4028
4079
  X.danger(s(O, i("components.customise-failed")));
@@ -4036,22 +4087,22 @@ const ls = { class: "wx-block-picker" }, ns = {
4036
4087
  j();
4037
4088
  } }] : []
4038
4089
  );
4039
- return (V, O) => (c(), W(n(ln), {
4040
- view: d.value,
4041
- "onUpdate:view": O[2] || (O[2] = (I) => d.value = I),
4090
+ return (A, O) => (d(), W(n(on), {
4091
+ view: p.value,
4092
+ "onUpdate:view": O[2] || (O[2] = (I) => p.value = I),
4042
4093
  class: "wx-blocks-page",
4043
4094
  title: _.value,
4044
4095
  views: he.value,
4045
4096
  actions: pe.value
4046
4097
  }, {
4047
4098
  default: g(() => [
4048
- x.value.editing ? L("", !0) : (c(), W(n(al), {
4099
+ x.value.editing ? B("", !0) : (d(), W(n(il), {
4049
4100
  key: 0,
4050
4101
  type: "info",
4051
4102
  variant: "soft",
4052
4103
  description: n(i)("page.editing-off")
4053
4104
  }, null, 8, ["description"])),
4054
- u.value || !Be.value ? (c(), w("div", ia, [
4105
+ u.value || !Le.value ? (d(), w("div", da, [
4055
4106
  v(n(nt), {
4056
4107
  modelValue: m.value,
4057
4108
  "onUpdate:modelValue": O[0] || (O[0] = (I) => m.value = I),
@@ -4059,11 +4110,11 @@ const ls = { class: "wx-block-picker" }, ns = {
4059
4110
  placeholder: n(i)("page.search"),
4060
4111
  clearable: ""
4061
4112
  }, null, 8, ["modelValue", "placeholder"])
4062
- ])) : L("", !0),
4063
- u.value ? (c(), W(n(He), { key: 2 }, {
4113
+ ])) : B("", !0),
4114
+ u.value ? (d(), W(n(He), { key: 2 }, {
4064
4115
  template: g(() => [
4065
- E("div", ra, [
4066
- (c(), w(F, null, Z(4, (I) => E("div", {
4116
+ C("div", pa, [
4117
+ (d(), w(F, null, Z(4, (I) => C("div", {
4067
4118
  key: I,
4068
4119
  class: "wx-blocks-page__ghost"
4069
4120
  }, [
@@ -4072,7 +4123,7 @@ const ls = { class: "wx-block-picker" }, ns = {
4072
4123
  height: 120,
4073
4124
  class: "wx-blocks-page__ghost-thumb"
4074
4125
  }),
4075
- E("div", ua, [
4126
+ C("div", fa, [
4076
4127
  v(n(pt), {
4077
4128
  variant: "title",
4078
4129
  width: "45%"
@@ -4091,18 +4142,18 @@ const ls = { class: "wx-block-picker" }, ns = {
4091
4142
  ])
4092
4143
  ]),
4093
4144
  _: 1
4094
- })) : Be.value ? (c(), W(n(Lt), {
4145
+ })) : Le.value ? (d(), W(n(Wt), {
4095
4146
  key: 3,
4096
4147
  icon: "grid",
4097
4148
  title: n(i)("page.empty"),
4098
4149
  description: n(i)("page.empty-help")
4099
- }, null, 8, ["title", "description"])) : (c(), w(F, { key: 4 }, [
4100
- (c(!0), w(F, null, Z(ne.value, (I) => (c(), w("section", {
4150
+ }, null, 8, ["title", "description"])) : (d(), w(F, { key: 4 }, [
4151
+ (d(!0), w(F, null, Z(ne.value, (I) => (d(), w("section", {
4101
4152
  key: I.id,
4102
4153
  class: "wx-blocks-page__group"
4103
4154
  }, [
4104
- I.label ? (c(), w("div", ca, k(I.label), 1)) : L("", !0),
4105
- v(n(rn), {
4155
+ I.label ? (d(), w("div", ma, k(I.label), 1)) : B("", !0),
4156
+ v(n(cn), {
4106
4157
  "model-value": I.blocks,
4107
4158
  class: "wx-blocks-page__cards",
4108
4159
  disabled: !ze.value,
@@ -4111,29 +4162,29 @@ const ls = { class: "wx-block-picker" }, ns = {
4111
4162
  "delay-on-touch-only": !0,
4112
4163
  "force-fallback": !0,
4113
4164
  "ghost-class": "is-ghost",
4114
- onEnd: Ce,
4115
- "onUpdate:modelValue": O[1] || (O[1] = (Y) => xe(Y))
4165
+ onEnd: Ee,
4166
+ "onUpdate:modelValue": O[1] || (O[1] = (J) => _e(J))
4116
4167
  }, {
4117
4168
  default: g(() => [
4118
- (c(!0), w(F, null, Z(I.blocks, (Y) => (c(), W(ol, {
4119
- key: Y.id,
4120
- block: Y,
4121
- onOpen: N
4169
+ (d(!0), w(F, null, Z(I.blocks, (J) => (d(), W(sl, {
4170
+ key: J.id,
4171
+ block: J,
4172
+ onOpen: M
4122
4173
  }, null, 8, ["block"]))), 128))
4123
4174
  ]),
4124
4175
  _: 2
4125
4176
  }, 1032, ["model-value", "disabled"])
4126
4177
  ]))), 128)),
4127
- Q.value.length > 0 || le.value.length > 0 ? (c(), w("section", da, [
4128
- we.value ? (c(), w("div", pa, k(we.value), 1)) : L("", !0),
4129
- E("div", fa, [
4130
- (c(!0), w(F, null, Z(Q.value, (I) => (c(), W(ol, {
4178
+ Q.value.length > 0 || le.value.length > 0 ? (d(), w("section", ha, [
4179
+ xe.value ? (d(), w("div", va, k(xe.value), 1)) : B("", !0),
4180
+ C("div", ba, [
4181
+ (d(!0), w(F, null, Z(Q.value, (I) => (d(), W(sl, {
4131
4182
  key: I.id,
4132
4183
  block: I,
4133
4184
  module: ae(I.slug),
4134
- onOpen: N
4185
+ onOpen: M
4135
4186
  }, null, 8, ["block", "module"]))), 128)),
4136
- (c(!0), w(F, null, Z(le.value, (I) => (c(), W(aa, {
4187
+ (d(!0), w(F, null, Z(le.value, (I) => (d(), W(ca, {
4137
4188
  key: I.slug,
4138
4189
  declared: I,
4139
4190
  module: ee(I.module),
@@ -4142,24 +4193,24 @@ const ls = { class: "wx-block-picker" }, ns = {
4142
4193
  onCustomise: q
4143
4194
  }, null, 8, ["declared", "module", "can-manage", "busy"]))), 128))
4144
4195
  ])
4145
- ])) : L("", !0)
4196
+ ])) : B("", !0)
4146
4197
  ], 64))
4147
4198
  ]),
4148
4199
  _: 1
4149
4200
  }, 8, ["view", "title", "views", "actions"]));
4150
4201
  }
4151
- }), ha = /* @__PURE__ */ se(ma, [["__scopeId", "data-v-14d130be"]]);
4152
- function Ta(e = {}) {
4202
+ }), ka = /* @__PURE__ */ se(ga, [["__scopeId", "data-v-14d130be"]]);
4203
+ function La(e = {}) {
4153
4204
  const l = e.path ?? "/blocks";
4154
4205
  return {
4155
4206
  id: "blocks",
4156
4207
  path: l,
4157
4208
  routes: [
4158
- { path: l, name: "webx.blocks", component: ha, props: { base: l } },
4209
+ { path: l, name: "webx.blocks", component: ka, props: { base: l } },
4159
4210
  {
4160
4211
  path: `${l}/:id(\\d+)`,
4161
4212
  name: "webx.blocks.edit",
4162
- component: jo,
4213
+ component: qo,
4163
4214
  props: { base: l }
4164
4215
  }
4165
4216
  ],
@@ -4168,7 +4219,7 @@ function Ta(e = {}) {
4168
4219
  // draws its children through the renderer; it needs the node for `props.allow` alone.
4169
4220
  types: {
4170
4221
  "wx-blocks": {
4171
- component: Rs,
4222
+ component: Ks,
4172
4223
  kind: "field",
4173
4224
  nested: !0,
4174
4225
  wide: !0,
@@ -4177,9 +4228,9 @@ function Ta(e = {}) {
4177
4228
  // The two inputs only a component's schema has (§3.3): a structure passed from code,
4178
4229
  // edited in the sample form as the JSON it is, and a piece of markup the caller puts
4179
4230
  // between the tags, as HTML. Neither is a field an editor fills on a page.
4180
- "wx-data": { component: pn, kind: "field", wide: !0 },
4231
+ "wx-data": { component: mn, kind: "field", wide: !0 },
4181
4232
  "wx-slot": {
4182
- component: il,
4233
+ component: rl,
4183
4234
  kind: "field",
4184
4235
  bind: () => ({ rows: 3, placeholder: "<p>…</p>" })
4185
4236
  }
@@ -4187,39 +4238,39 @@ function Ta(e = {}) {
4187
4238
  };
4188
4239
  }
4189
4240
  export {
4190
- jo as WxBlockEditorPage,
4191
- us as WxBlockPicker,
4192
- Ln as WxBlockStage,
4193
- El as WxBlockThumb,
4194
- Rs as WxBlocks,
4195
- ha as WxBlocksPage,
4196
- Ta as blocks,
4197
- un as blocksMessages,
4198
- It as blocksPreviewKey,
4199
- yo as callTag,
4200
- bl as cloneNode,
4201
- Mn as countType,
4241
+ qo as WxBlockEditorPage,
4242
+ fs as WxBlockPicker,
4243
+ Nn as WxBlockStage,
4244
+ Vl as WxBlockThumb,
4245
+ Ks as WxBlocks,
4246
+ ka as WxBlocksPage,
4247
+ La as blocks,
4248
+ dn as blocksMessages,
4249
+ Pt as blocksPreviewKey,
4250
+ $o as callTag,
4251
+ gl as cloneNode,
4252
+ zn as countType,
4202
4253
  Ke as createBlocksApi,
4203
- dl as findRange,
4254
+ pl as findRange,
4204
4255
  Ut as formSchema,
4205
- kt as highlightBlock,
4206
- yt as insertNode,
4207
- hl as isNode,
4256
+ yt as highlightBlock,
4257
+ wt as insertNode,
4258
+ vl as isNode,
4208
4259
  rt as isNodeList,
4209
4260
  $e as kindOf,
4210
- vo as lintBlock,
4261
+ yo as lintBlock,
4211
4262
  me as locate,
4212
- Wn as makeNode,
4213
- Et as newKey,
4214
- Sa as provideBlocksPreview,
4215
- Qt as removeNode,
4216
- pl as replaceBlock,
4217
- In as replaceList,
4218
- fl as stageDocument,
4219
- $a as typesIn,
4220
- bo as undeclared,
4221
- On as updateValues,
4222
- Ca as useBlocksPreview,
4263
+ Mn as makeNode,
4264
+ At as newKey,
4265
+ Aa as provideBlocksPreview,
4266
+ el as removeNode,
4267
+ fl as replaceBlock,
4268
+ Un as replaceList,
4269
+ ml as stageDocument,
4270
+ Ca as typesIn,
4271
+ wo as undeclared,
4272
+ Pn as updateValues,
4273
+ Va as useBlocksPreview,
4223
4274
  ut as walk
4224
4275
  };
4225
4276
  //# sourceMappingURL=index.js.map