@templatical/editor 0.54.0 → 0.54.2

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.
Files changed (133) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-BBKVJ6HA.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-BuVbeQh-.js} +1 -1
  3. package/dist/{AiRewriteMenu-CIHUnPud.js → AiRewriteMenu-ZpYJfm-O.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-B70RSavL.js → BlockPreviewCanvas-DtOo5y3U.js} +6 -6
  5. package/dist/{CloudPanels-VpSQiLLL.js → CloudPanels-DQRWMc59.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-DTpMEDyh.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-BZn7-p9e.js} +1 -1
  8. package/dist/{LanguageMenu-d2GlX67r.js → LanguageMenu-OOmQWVzO.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-XESwnJia.js} +8 -8
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-CAsBRoSm.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-bOf27Hg1.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-DH_6JFui.js} +2 -2
  13. package/dist/{ParagraphEditor-CI68PYDL.js → ParagraphEditor-XGUkV5Uw.js} +12 -11
  14. package/dist/{RestoreVersionDialog-DcuhpOIz.js → RestoreVersionDialog-C72kWccI.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-BZN8KRvR.js} +2 -2
  16. package/dist/{SaveBlockDialog-vuwvoi-d.js → SaveBlockDialog-CKOnTMTU.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-DUJm0dOv.js → SavedBlocksBrowserModal-BrlNxqDH.js} +4 -4
  18. package/dist/{SavedBlocksPanels-BiMXQ5lY.js → SavedBlocksPanels--lPR6gdh.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-CAstZfG7.js → SavedBlocksPickBar-4ON4_KKl.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-BE0jZmRJ.js} +4 -4
  21. package/dist/{TestEmailModal-Bl_GHdrN.js → TestEmailModal-BKmNGrZN.js} +5 -5
  22. package/dist/{TestEmailPanel-CpTBF7B5.js → TestEmailPanel-DT1wllX3.js} +1 -1
  23. package/dist/{TitleEditor-DkbEDAZB.js → TitleEditor-HjVZuUTB.js} +8 -7
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-BppchV2k.js} +617 -617
  25. package/dist/{TplModal-wk2gLa7_.js → TplModal-BFWOoK8l.js} +1 -1
  26. package/dist/{VersionHistoryPanels-Cq2rFKIX.js → VersionHistoryPanels-D4yNVLvq.js} +1 -1
  27. package/dist/{WrapperBlock-cWT_nZgQ.js → WrapperBlock-BUzQTZuu.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-D91v9k0x.js} +1 -1
  29. package/dist/bundle-stats.json +6 -6
  30. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CAI18sdv.js} +2 -2
  31. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CAI18sdv.js.map} +1 -1
  32. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-CWEyMOF-.js} +2 -2
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-CWEyMOF-.js.map} +1 -1
  34. package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js → AiRewriteMenu-BEepu1vo.js} +5 -5
  35. package/dist/cdn/chunks/{AiRewriteMenu-C4btyN4W.js.map → AiRewriteMenu-BEepu1vo.js.map} +1 -1
  36. package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js → BlockPreviewCanvas-B6ndvof2.js} +5 -5
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-CTKmBPsq.js.map → BlockPreviewCanvas-B6ndvof2.js.map} +1 -1
  38. package/dist/cdn/chunks/{CloudPanels-COU26R83.js → CloudPanels-BGwDb0jB.js} +2 -2
  39. package/dist/cdn/chunks/{CloudPanels-COU26R83.js.map → CloudPanels-BGwDb0jB.js.map} +1 -1
  40. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-B-0FsTj-.js} +5 -5
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-B-0FsTj-.js.map} +1 -1
  42. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-LyjMBDok.js} +3 -3
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-LyjMBDok.js.map} +1 -1
  44. package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js → LanguageMenu-CGwMCOQ5.js} +4 -4
  45. package/dist/cdn/chunks/{LanguageMenu-B1Aue_lf.js.map → LanguageMenu-CGwMCOQ5.js.map} +1 -1
  46. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-PDKuo2J3.js} +4 -4
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js.map → LogicTagInsertButton-PDKuo2J3.js.map} +1 -1
  48. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-DoQHBJk2.js} +2 -2
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-DoQHBJk2.js.map} +1 -1
  50. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-Ct5IG4VW.js} +2 -2
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-Ct5IG4VW.js.map} +1 -1
  52. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-BMsnjphR.js} +3 -3
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-BMsnjphR.js.map} +1 -1
  54. package/dist/cdn/chunks/{ParagraphEditor-B2UU1Q5I.js → ParagraphEditor-CVW-kuHW.js} +114 -113
  55. package/dist/cdn/chunks/ParagraphEditor-CVW-kuHW.js.map +1 -0
  56. package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js → RestoreVersionDialog-7MFZz-Sb.js} +2 -2
  57. package/dist/cdn/chunks/{RestoreVersionDialog-C1Y5Ewo_.js.map → RestoreVersionDialog-7MFZz-Sb.js.map} +1 -1
  58. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-CiL-SkZg.js} +3 -3
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-CiL-SkZg.js.map} +1 -1
  60. package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js → SaveBlockDialog-CxdekCYy.js} +5 -5
  61. package/dist/cdn/chunks/{SaveBlockDialog-B9lwEP_T.js.map → SaveBlockDialog-CxdekCYy.js.map} +1 -1
  62. package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js → SavedBlocksBrowserModal-D9CAa2U3.js} +4 -4
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-fAeHUyxb.js.map → SavedBlocksBrowserModal-D9CAa2U3.js.map} +1 -1
  64. package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js → SavedBlocksPanels-jfkYWtss.js} +2 -2
  65. package/dist/cdn/chunks/{SavedBlocksPanels-DRDTLDyZ.js.map → SavedBlocksPanels-jfkYWtss.js.map} +1 -1
  66. package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js → SavedBlocksPickBar-yaCumC4j.js} +2 -2
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-B6b5z-o3.js.map → SavedBlocksPickBar-yaCumC4j.js.map} +1 -1
  68. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-SaV2UVh_.js} +5 -5
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-SaV2UVh_.js.map} +1 -1
  70. package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js → TestEmailModal-ByfhP_sm.js} +6 -6
  71. package/dist/cdn/chunks/{TestEmailModal-DQxnW5Q5.js.map → TestEmailModal-ByfhP_sm.js.map} +1 -1
  72. package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js → TestEmailPanel-CfzpqpDs.js} +2 -2
  73. package/dist/cdn/chunks/{TestEmailPanel-BcO_-16H.js.map → TestEmailPanel-CfzpqpDs.js.map} +1 -1
  74. package/dist/cdn/chunks/{TitleEditor-pmycpmTd.js → TitleEditor-Ceb0YfWv.js} +8 -7
  75. package/dist/cdn/chunks/TitleEditor-Ceb0YfWv.js.map +1 -0
  76. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-Cv6Rv1S-.js} +9 -9
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js.map → Toolbar-Cv6Rv1S-.js.map} +1 -1
  78. package/dist/cdn/chunks/{TplModal-ClSSGX7a.js → TplModal-DGpGdwgf.js} +2 -2
  79. package/dist/cdn/chunks/{TplModal-ClSSGX7a.js.map → TplModal-DGpGdwgf.js.map} +1 -1
  80. package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js → VersionHistoryPanels-BJnHCMAH.js} +2 -2
  81. package/dist/cdn/chunks/{VersionHistoryPanels-B8GPBKMq.js.map → VersionHistoryPanels-BJnHCMAH.js.map} +1 -1
  82. package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js → WrapperBlock-C_uE5rPJ.js} +4 -4
  83. package/dist/cdn/chunks/{WrapperBlock-BoUflYwY.js.map → WrapperBlock-C_uE5rPJ.js.map} +1 -1
  84. package/dist/cdn/chunks/{composables-C1KU4ZHw.js → composables-BxikPuC1.js} +449 -443
  85. package/dist/cdn/chunks/composables-BxikPuC1.js.map +1 -0
  86. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-D2DUaudp.js} +3 -3
  87. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-D2DUaudp.js.map} +1 -1
  88. package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-DuDWpKo7.js} +4 -4
  89. package/dist/cdn/chunks/{extensions-DcMKZpzh.js.map → extensions-DuDWpKo7.js.map} +1 -1
  90. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-Bn_hl4jd.js} +2 -2
  91. package/dist/cdn/chunks/{normalizeMergeTagMarkup-cC32Ox6A.js.map → normalizeMergeTagMarkup-Bn_hl4jd.js.map} +1 -1
  92. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-C9oavydG.js} +2 -2
  93. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-C9oavydG.js.map} +1 -1
  94. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-DfXoetOm.js} +2 -2
  95. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-DfXoetOm.js.map} +1 -1
  96. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-DPwkrn5v.js} +2 -2
  97. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-DPwkrn5v.js.map} +1 -1
  98. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-712f3ofG.js} +2 -2
  99. package/dist/cdn/chunks/{src-A_cKeTM_.js.map → src-712f3ofG.js.map} +1 -1
  100. package/dist/cdn/chunks/{src-BWX_xVxO.js → src-B2tQbzf6.js} +152 -146
  101. package/dist/cdn/chunks/src-B2tQbzf6.js.map +1 -0
  102. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-ZFw5fg_z.js} +40 -27
  103. package/dist/cdn/chunks/{src-BQUv2CYU.js.map → src-ZFw5fg_z.js.map} +1 -1
  104. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js → useLocalizedDisplay-DiNjT22M.js} +2 -2
  105. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DiNjT22M.js.map} +1 -1
  106. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-SvMW4g00.js} +2 -2
  107. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-SvMW4g00.js.map} +1 -1
  108. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-JLz3Pqcw.js} +2 -2
  109. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-JLz3Pqcw.js.map} +1 -1
  110. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-BcoPpkDS.js} +2 -2
  111. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-BcoPpkDS.js.map} +1 -1
  112. package/dist/cdn/editor.css +1 -1
  113. package/dist/cdn/editor.js +18 -18
  114. package/dist/{composables-CMIrGXJ1.js → composables-BbPFRlBf.js} +908 -902
  115. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Dlrg88gS.js} +2 -2
  116. package/dist/{dist-Cdkm20M6.js → dist-C34cYI5S.js} +126 -113
  117. package/dist/{extensions-BJ184osp.js → extensions-xCiyqSg7.js} +16 -16
  118. package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → normalizeMergeTagMarkup-C7FGNURu.js} +22 -22
  119. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → preRenderCustomBlocks-DvbRa3L3.js} +3 -3
  120. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-D_ab7dD6.js} +5 -5
  121. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-DhAolBjt.js} +342 -342
  122. package/dist/style.css +1 -1
  123. package/dist/templatical-editor.js +190 -190
  124. package/dist/useLocalizedDisplay-C9MBFUr4.js +31 -0
  125. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-BmuakZBd.js} +1 -1
  126. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-DC4a8b_v.js} +3 -3
  127. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-BSxJai99.js} +1 -1
  128. package/package.json +7 -7
  129. package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js.map +0 -1
  130. package/dist/cdn/chunks/TitleEditor-pmycpmTd.js.map +0 -1
  131. package/dist/cdn/chunks/composables-C1KU4ZHw.js.map +0 -1
  132. package/dist/cdn/chunks/src-BWX_xVxO.js.map +0 -1
  133. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -1,14 +1,14 @@
1
1
  import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
2
- import { A as T, Bt as E, C as D, D as O, E as k, Et as ee, F as A, Ft as j, Gt as M, H as te, Nt as ne, O as re, Pt as ie, Qt as N, St as P, T as F, Tt as I, Ut as ae, Yt as L, Z as R, _ as z, at as B, d as V, et as H, g as U, gt as oe, h as se, jt as W, m as ce, mt as le, ot as ue, tn as de, w as fe, wt as pe, x as me, xt as he } from "./dist-Cdkm20M6.js";
3
- import { t as G } from "./createLucideIcon-CgDE3xAR.js";
4
- import { t as K } from "./upload-Cp8o-hrN.js";
5
- import { t as ge } from "./loader-circle-k6xvKgUB.js";
6
- import { B as _e, C as ve, U as ye, u as be } from "./keys-BCqskl51.js";
7
- import { t as xe } from "./useI18n-CgtvtF4C.js";
8
- import { r as Se } from "./dist-0alKVRc_.js";
9
- import { i as q, r as Ce } from "./usePopoverPosition-VDQjyX_A.js";
2
+ import { $t as T, A as E, C as D, Ct as O, D as k, Dt as ee, E as A, Et as j, F as te, Ft as ne, H as re, It as M, Kt as N, Mt as P, O as F, Pt as I, St as L, T as R, Tt as z, Vt as B, Wt as ie, Xt as V, Z as H, _ as U, _t as ae, d as W, et as G, g as K, h as oe, ht as se, m as ce, nn as le, ot as ue, st as de, w as fe, x as pe } from "./dist-C34cYI5S.js";
3
+ import { t as q } from "./createLucideIcon-CgDE3xAR.js";
4
+ import { t as J } from "./upload-Cp8o-hrN.js";
5
+ import { t as me } from "./loader-circle-k6xvKgUB.js";
6
+ import { B as he, C as ge, U as _e, u as ve } from "./keys-BCqskl51.js";
7
+ import { t as ye } from "./useI18n-CgtvtF4C.js";
8
+ import { r as be } from "./dist-0alKVRc_.js";
9
+ import { i as Y, r as xe } from "./usePopoverPosition-VDQjyX_A.js";
10
10
  // ../core/dist/index.js
11
- var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
11
+ var X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => X(e) && typeof e.id == "string"), Ce = /* @__PURE__ */ new Set([
12
12
  "id",
13
13
  "type",
14
14
  "children",
@@ -16,41 +16,41 @@ var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Arra
16
16
  "l10n",
17
17
  "renderedHtml"
18
18
  ]);
19
- function Te(e, t, n) {
19
+ function we(e, t, n) {
20
20
  let r = /* @__PURE__ */ new Set();
21
21
  for (let i of n) {
22
- if (!he(i)) continue;
23
- let n = i.split("."), a = n.pop(), o = n.join("."), s = j(e, i), c = t;
22
+ if (!L(i)) continue;
23
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = M(e, i), c = t;
24
24
  for (let [t, i] of n.entries()) {
25
25
  let a = n.slice(0, t + 1).join(".");
26
- s !== void 0 && J(c) && j(c, i) === void 0 && J(j(e, a)) && (c[i] = {}, r.add(a)), c = j(c, i);
26
+ s !== void 0 && X(c) && M(c, i) === void 0 && X(M(e, a)) && (c[i] = {}, r.add(a)), c = M(c, i);
27
27
  }
28
28
  if (Array.isArray(c)) {
29
- let e = c.findIndex((e) => J(e) && e.id === a);
29
+ let e = c.findIndex((e) => X(e) && e.id === a);
30
30
  if (e < 0) continue;
31
- s === void 0 ? c.splice(e, 1) : c[e] = M(s);
32
- } else J(c) && (s === void 0 ? delete c[a] : c[a] = M(s), o && Object.keys(c).length === 0 && j(e, o) === void 0 && Te(e, t, [o]));
31
+ s === void 0 ? c.splice(e, 1) : c[e] = N(s);
32
+ } else X(c) && (s === void 0 ? delete c[a] : c[a] = N(s), o && Object.keys(c).length === 0 && M(e, o) === void 0 && we(e, t, [o]));
33
33
  }
34
34
  return r;
35
35
  }
36
- function X(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
- if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && X(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
- else if (i && Y(e) && Y(t)) for (let o of t) {
36
+ function Te(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
+ if (X(e) && X(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !Ce.has(o)) && Te(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
+ else if (i && Se(e) && Se(t)) for (let o of t) {
39
39
  if (o.id.includes(".")) continue;
40
40
  let t = e.find((e) => e.id === o.id);
41
- t && X(t, o, `${n}.${o.id}`, r, i, a);
41
+ t && Te(t, o, `${n}.${o.id}`, r, i, a);
42
42
  }
43
- else R(e, t) || r.set(n, t);
43
+ else H(e, t) || r.set(n, t);
44
44
  }
45
45
  function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
46
46
  let a = /* @__PURE__ */ new Map();
47
- X(e, t, "", a, e.type !== "custom", i);
48
- let o = new Set(e.type === "custom" ? de(e, r) : []), s = {}, c = {};
49
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : I(e.type, t)) && typeof r == "string" && j(e, t) !== void 0) {
47
+ Te(e, t, "", a, e.type !== "custom", i);
48
+ let o = new Set(e.type === "custom" ? le(e, r) : []), s = {}, c = {};
49
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : j(e.type, t)) && typeof r == "string" && M(e, t) !== void 0) {
50
50
  let i = n?.text?.[t];
51
51
  s[t] = i && i.value === r ? i : {
52
52
  value: r,
53
- sourceHash: L(String(j(e, t) ?? ""))
53
+ sourceHash: V(String(M(e, t) ?? ""))
54
54
  };
55
55
  } else c[t] = r === void 0 ? null : r;
56
56
  let l = {};
@@ -59,8 +59,8 @@ function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
59
59
  function De(e, t, n) {
60
60
  let r = !1;
61
61
  function i(e, t, n, a) {
62
- let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
63
- if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => M(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
+ let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => X(e) && typeof e.id == "string");
63
+ if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => N(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
64
64
  let r = e[n].find((e) => e.id === t.id);
65
65
  r && i(r, t, a);
66
66
  }
@@ -68,7 +68,7 @@ function De(e, t, n) {
68
68
  let a = e, o = t;
69
69
  if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
70
70
  let i = (e) => e.map((e) => e.map((e) => e.id));
71
- (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => M(n(e.id) ?? e))));
71
+ (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => N(n(e.id) ?? e))));
72
72
  }
73
73
  return r;
74
74
  }
@@ -77,42 +77,42 @@ function Oe(e, t, n) {
77
77
  let { locale: t, locales: n, l10n: r, ...i } = e;
78
78
  return i;
79
79
  }, i = /* @__PURE__ */ new Map();
80
- X(r(e), r(t), "", i);
80
+ Te(r(e), r(t), "", i);
81
81
  let a = {};
82
- for (let [t, r] of i) if (ce.includes(t) && typeof r == "string" && j(e, t) !== void 0) {
82
+ for (let [t, r] of i) if (ce.includes(t) && typeof r == "string" && M(e, t) !== void 0) {
83
83
  let i = n?.text?.[t];
84
84
  (a.text ??= {})[t] = i?.value === r ? i : {
85
85
  value: r,
86
- sourceHash: L(String(j(e, t) ?? ""))
86
+ sourceHash: V(String(M(e, t) ?? ""))
87
87
  };
88
88
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
89
89
  return a;
90
90
  }
91
91
  function ke(e, t, n, r, i, a = []) {
92
- let o = M(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
92
+ let o = N(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
93
93
  ...Object.keys(t.text ?? {}),
94
94
  ...Object.keys(t.set ?? {}),
95
95
  ...Object.keys(n.text ?? {}),
96
96
  ...Object.keys(n.set ?? {})
97
- ])].filter((e) => !R(t.text?.[e], n.text?.[e]) || !R(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
97
+ ])].filter((e) => !H(t.text?.[e], n.text?.[e]) || !H(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
98
98
  for (let e of c) {
99
- let t = j(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && R(j(r, t), j(i, t)));
100
- if (R(t, j(r, e))) delete o.set[e];
101
- else if (n.length && J(j(r, e)) && J(t)) {
99
+ let t = M(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && H(M(r, t), M(i, t)));
100
+ if (H(t, M(r, e))) delete o.set[e];
101
+ else if (n.length && X(M(r, e)) && X(t)) {
102
102
  delete o.set[e];
103
103
  let i = (e, t, a) => {
104
104
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
105
- if (J(t) && J(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
- else if (J(r) && r.type !== "custom" && Y(t) && Y(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
- else J(r) && typeof r.type == "string" && pe(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : M(a));
105
+ if (X(t) && X(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
+ else if (X(r) && r.type !== "custom" && Se(t) && Se(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
+ else X(r) && typeof r.type == "string" && z(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : N(a));
108
108
  }
109
109
  };
110
- i(e, j(r, e), t);
111
- } else o.set[e] = t === void 0 ? null : M(t);
110
+ i(e, M(r, e), t);
111
+ } else o.set[e] = t === void 0 ? null : N(t);
112
112
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) {
113
113
  if (!n.startsWith(`${e}.`)) continue;
114
114
  let r = t === "text" ? o.text[n].value : o.set[n] ?? void 0;
115
- R(r, j(i, n)) || delete o[t][n];
115
+ H(r, M(i, n)) || delete o[t][n];
116
116
  }
117
117
  }
118
118
  for (let e of s) if (!c.includes(e)) {
@@ -140,7 +140,7 @@ function je(e, t, n) {
140
140
  ...e.content(),
141
141
  blocks: [o]
142
142
  };
143
- F(t), k(t);
143
+ R(t), A(t);
144
144
  }
145
145
  if (t === "removeBlock") return !0;
146
146
  let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
@@ -148,7 +148,7 @@ function je(e, t, n) {
148
148
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
149
149
  if (e.findBlock) {
150
150
  let t = e.findBlock(l);
151
- if (t?.type !== "section" || u < 0 || u >= ue(t.columns)) return !1;
151
+ if (t?.type !== "section" || u < 0 || u >= de(t.columns)) return !1;
152
152
  }
153
153
  }
154
154
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
@@ -191,8 +191,8 @@ function Fe(e, t) {
191
191
  }
192
192
  }
193
193
  function Ie(t) {
194
- let n = t.content ?? A(t.defaultFontFamily, t.templateDefaults);
195
- F(n), k(n);
194
+ let n = t.content ?? te(t.defaultFontFamily, t.templateDefaults);
195
+ R(n), A(n);
196
196
  let i = s({
197
197
  template: null,
198
198
  content: n,
@@ -207,11 +207,11 @@ function Ie(t) {
207
207
  uiTheme: "auto"
208
208
  }), a = g(i, "activeLocale"), o = [];
209
209
  function c(e) {
210
- let t = H(i.content);
211
- if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new z(`This template has no "${e}" version.`, void 0, "unknown_locale");
210
+ let t = G(i.content);
211
+ if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new U(`This template has no "${e}" version.`, void 0, "unknown_locale");
212
212
  a.value = e;
213
213
  }
214
- v(() => a.value ?? H(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
214
+ v(() => a.value ?? G(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
215
215
  a.value && !i.content.settings.locales?.includes(a.value) && c(null);
216
216
  });
217
217
  function l() {
@@ -221,16 +221,16 @@ function Ie(t) {
221
221
  o = e;
222
222
  }
223
223
  function d(e) {
224
- return te(i.content, e, o);
224
+ return re(i.content, e, o);
225
225
  }
226
226
  function f(e, n) {
227
227
  if (!l()) return null;
228
- if (e === "addLocale" && (!oe(n) || t.localization && !t.localization.locales.includes(n))) throw new z(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
- let r = M(i.content);
228
+ if (e === "addLocale" && (!ae(n) || t.localization && !t.localization.locales.includes(n))) throw new U(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
+ let r = N(i.content);
230
230
  return fe(r, [{
231
231
  op: e,
232
232
  locale: n
233
- }]), R(r, i.content) ? null : r;
233
+ }]), H(r, i.content) ? null : r;
234
234
  }
235
235
  function m(e, t) {
236
236
  let n = f(e, t);
@@ -251,17 +251,17 @@ function Ie(t) {
251
251
  }
252
252
  function b(e, t) {
253
253
  let [n, r] = t;
254
- if (!a.value || !l() || B(n)) return null;
255
- let s = N(i.content.blocks, n);
254
+ if (!a.value || !l() || z(n)) return null;
255
+ let s = j(i.content.blocks, n);
256
256
  if (!s) return null;
257
- let c = s.l10n?.[a.value], u = W(s, a.value, H(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? Te(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : M(c ?? {});
257
+ let c = s.l10n?.[a.value], u = P(s, a.value, G(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? we(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : N(c ?? {});
258
258
  if (e === "setBlockHidden") r ? p.hidden = !0 : delete p.hidden;
259
259
  else if (e === "resetLocaleFields") r || (delete p.text, delete p.set, delete p.hidden);
260
260
  else for (let e of r) {
261
261
  let t = p.text?.[e];
262
- t && (t.sourceHash = L(String(j(s, e) ?? "")));
262
+ t && (t.sourceHash = V(String(M(s, e) ?? "")));
263
263
  }
264
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, R(c ?? {}, p) ? null : {
264
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, H(c ?? {}, p) ? null : {
265
265
  block: s,
266
266
  layer: p
267
267
  };
@@ -283,31 +283,31 @@ function Ie(t) {
283
283
  function O() {
284
284
  i.isDirty = !0, D++;
285
285
  }
286
- let ee = r({
286
+ let k = r({
287
287
  get: () => i.content,
288
288
  set: (e) => {
289
289
  i.content = e, O();
290
290
  }
291
- }), re = r(() => i.selectedBlockId ? N(i.content.blocks, i.selectedBlockId) : null);
292
- function N(e, t) {
291
+ }), ee = r(() => i.selectedBlockId ? j(i.content.blocks, i.selectedBlockId) : null);
292
+ function j(e, t) {
293
293
  for (let n of e) {
294
294
  if (n.id === t) return n;
295
295
  if (n.type === "section") for (let e of n.children) {
296
- let n = N(e, t);
296
+ let n = j(e, t);
297
297
  if (n) return n;
298
298
  }
299
299
  }
300
300
  return null;
301
301
  }
302
- function P(e, t) {
303
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) P(e, t);
302
+ function F(e, t) {
303
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) F(e, t);
304
304
  }
305
- function I(e, t, n = { blocks: e }) {
305
+ function L(e, t, n = { blocks: e }) {
306
306
  for (let r = 0; r < e.length; r++) {
307
307
  let i = e[r];
308
308
  if (i.id === t) return n;
309
309
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
310
- let n = I(i.children[e], t, {
310
+ let n = L(i.children[e], t, {
311
311
  blocks: i.children[e],
312
312
  sectionId: i.id,
313
313
  columnIndex: e
@@ -317,7 +317,7 @@ function Ie(t) {
317
317
  }
318
318
  return null;
319
319
  }
320
- function B(e, n = !1) {
320
+ function z(e, n = !1) {
321
321
  let r = a.value ?? t.lockLocale?.value ?? null;
322
322
  for (let [i, a] of t.lockedBlocks?.value ?? []) {
323
323
  let o = a;
@@ -327,8 +327,8 @@ function Ie(t) {
327
327
  }
328
328
  return !1;
329
329
  }
330
- function V(e) {
331
- let t = I(i.content.blocks, e);
330
+ function B(e) {
331
+ let t = L(i.content.blocks, e);
332
332
  if (!t) return null;
333
333
  let n = t.blocks.findIndex((t) => t.id === e);
334
334
  return n === -1 ? null : {
@@ -337,52 +337,52 @@ function Ie(t) {
337
337
  index: n
338
338
  };
339
339
  }
340
- function U(e, t = !0) {
341
- F(e), k(e), i.content = e, t && O();
340
+ function W(e, t = !0) {
341
+ R(e), A(e), i.content = e, t && O();
342
342
  }
343
- function se(e) {
344
- e && B(e) || (i.selectedBlockId = e);
343
+ function K(e) {
344
+ e && z(e) || (i.selectedBlockId = e);
345
345
  }
346
- function ce(e) {
346
+ function oe(e) {
347
347
  i.viewport = e;
348
348
  }
349
- function le(e) {
349
+ function se(e) {
350
350
  i.darkMode = e;
351
351
  }
352
- function ue(e) {
352
+ function ce(e) {
353
353
  i.uiTheme = e;
354
354
  }
355
- function de(e) {
355
+ function le(e) {
356
356
  i.previewMode = e, e && (i.selectedBlockId = null);
357
357
  }
358
- function pe(e, t) {
358
+ function ue(e, t) {
359
359
  if (!l()) return !1;
360
- let n = N(i.content.blocks, e);
360
+ let n = j(i.content.blocks, e);
361
361
  if (!n) return !1;
362
- if ("l10n" in t) throw new z("l10n is immutable in updateBlock.", void 0, "invalid_operation");
362
+ if ("l10n" in t) throw new U("l10n is immutable in updateBlock.", void 0, "invalid_operation");
363
363
  let r = {
364
364
  ...n,
365
365
  ...t
366
366
  };
367
- return !B(e, De(M(n), r, (e) => N(i.content.blocks, e)));
367
+ return !z(e, De(N(n), r, (e) => j(i.content.blocks, e)));
368
368
  }
369
- function me(e, n) {
370
- if (!pe(e, n)) return;
371
- let r = N(i.content.blocks, e);
369
+ function de(e, n) {
370
+ if (!ue(e, n)) return;
371
+ let r = j(i.content.blocks, e);
372
372
  if (!r) return;
373
373
  let s = a.value;
374
374
  if (s) {
375
- let a = W(r, s, H(i.content)), c = {
375
+ let a = P(r, s, G(i.content)), c = {
376
376
  ...a,
377
377
  ...n
378
- }, l = M(r), u = De(l, c, (e) => N(i.content.blocks, e));
379
- if (B(e, u)) return;
378
+ }, l = N(r), u = De(l, c, (e) => j(i.content.blocks, e));
379
+ if (z(e, u)) return;
380
380
  u && t.onStructureChange?.();
381
- let d = ne(l);
381
+ let d = I(l);
382
382
  delete r.l10n, Object.assign(r, d), y(r, ke(r.l10n?.[s], Ee(r, a, r.l10n?.[s], o), Ee(r, c, r.l10n?.[s], o), r, c));
383
383
  } else {
384
- if (B(e, "children" in n || "columns" in n)) return;
385
- let t = ne({
384
+ if (z(e, "children" in n || "columns" in n)) return;
385
+ let t = I({
386
386
  ...r,
387
387
  ...n
388
388
  });
@@ -390,20 +390,20 @@ function Ie(t) {
390
390
  }
391
391
  O();
392
392
  }
393
- function he(e) {
394
- if ("locales" in e || "l10n" in e) throw new z("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
395
- if ("locale" in e && e.locale !== H(i.content) && i.content.settings.locales?.length) throw new z("The default locale can't change while language versions exist.", void 0, "invalid_operation");
393
+ function pe(e) {
394
+ if ("locales" in e || "l10n" in e) throw new U("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
395
+ if ("locale" in e && e.locale !== G(i.content) && i.content.settings.locales?.length) throw new U("The default locale can't change while language versions exist.", void 0, "invalid_operation");
396
396
  }
397
- function G(e) {
397
+ function q(e) {
398
398
  if (!l()) return;
399
- he(e);
399
+ pe(e);
400
400
  let t = a.value;
401
- if (!t) i.content.settings = ie({
401
+ if (!t) i.content.settings = ne({
402
402
  ...i.content.settings,
403
403
  ...e
404
404
  });
405
405
  else {
406
- let n = i.content.settings, r = ae(i.content, t).settings, a = {
406
+ let n = i.content.settings, r = ie(i.content, t).settings, a = {
407
407
  ...r,
408
408
  locale: n.locale,
409
409
  ...e
@@ -415,22 +415,22 @@ function Ie(t) {
415
415
  }
416
416
  O();
417
417
  }
418
- let K = {
418
+ let J = {
419
419
  canEdit: l,
420
420
  content: () => i.content,
421
- findBlock: (e) => N(i.content.blocks, e),
422
- findBlockLocation: V,
423
- isBlockLocked: B
421
+ findBlock: (e) => j(i.content.blocks, e),
422
+ findBlockLocation: B,
423
+ isBlockLocked: z
424
424
  };
425
- function ge(e, n, r = 0, o) {
426
- if (je(K, "addBlock", [
425
+ function me(e, n, r = 0, o) {
426
+ if (je(J, "addBlock", [
427
427
  e,
428
428
  n,
429
429
  r,
430
430
  o
431
431
  ])) {
432
432
  if (n) {
433
- let t = N(i.content.blocks, n);
433
+ let t = j(i.content.blocks, n);
434
434
  if (t && t.type === "section") {
435
435
  t.children[r] = t.children[r] || [];
436
436
  let n = t.children[r];
@@ -440,58 +440,58 @@ function Ie(t) {
440
440
  a.value && t.onStructureChange?.(), O();
441
441
  }
442
442
  }
443
- function _e(e) {
444
- if (!je(K, "removeBlock", [e])) return;
445
- let n = I(i.content.blocks, e);
443
+ function he(e) {
444
+ if (!je(J, "removeBlock", [e])) return;
445
+ let n = L(i.content.blocks, e);
446
446
  if (n) {
447
447
  let r = n.blocks.findIndex((t) => t.id === e);
448
448
  if (r !== -1) {
449
449
  let [e] = n.blocks.splice(r, 1);
450
450
  if (i.selectedBlockId) {
451
451
  let t = /* @__PURE__ */ new Set();
452
- P(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
452
+ F(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
453
453
  }
454
454
  a.value && t.onStructureChange?.(), O();
455
455
  }
456
456
  }
457
457
  }
458
- function ve(e, n, r, o = 0) {
459
- if (!je(K, "moveBlock", [
458
+ function ge(e, n, r, o = 0) {
459
+ if (!je(J, "moveBlock", [
460
460
  e,
461
461
  n,
462
462
  r,
463
463
  o
464
464
  ])) return;
465
- let s = I(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
465
+ let s = L(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
466
466
  if (r) {
467
- let e = N(i.content.blocks, r);
467
+ let e = j(i.content.blocks, r);
468
468
  e.children[o] = e.children[o] || [], l = e.children[o];
469
469
  } else l = i.content.blocks;
470
470
  let [u] = s.blocks.splice(c, 1);
471
471
  l.splice(n, 0, u), a.value && t.onStructureChange?.(), O();
472
472
  }
473
- function ye() {
473
+ function _e() {
474
474
  O();
475
475
  }
476
- function be(e, t) {
477
- throw new z(`[Templatical] Templates: ${e} ${t}`);
476
+ function ve(e, t) {
477
+ throw new U(`[Templatical] Templates: ${e} ${t}`);
478
478
  }
479
- function xe(e) {
479
+ function ye(e) {
480
480
  Fe(t.onError, e);
481
481
  }
482
- function Se(e) {
482
+ function be(e) {
483
483
  let { templates: n } = t;
484
- return n || be(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
484
+ return n || ve(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
485
485
  }
486
- function q(e) {
486
+ function Y(e) {
487
487
  i.template && (i.template = {
488
488
  ...i.template,
489
489
  name: e
490
490
  }, O());
491
491
  }
492
- async function Ce(e) {
493
- let n = Se("create()"), { create: r } = n;
494
- typeof r != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
492
+ async function xe(e) {
493
+ let n = be("create()"), { create: r } = n;
494
+ typeof r != "function" && ve("create()", "is disabled by the provider — its `create` is `false`.");
495
495
  let a, o = ++E;
496
496
  i.isLoading = !0;
497
497
  try {
@@ -506,26 +506,26 @@ function Ie(t) {
506
506
  } finally {
507
507
  E === o && (i.isLoading = !1);
508
508
  }
509
- return xe(() => n.onCreated?.(a)), a;
509
+ return ye(() => n.onCreated?.(a)), a;
510
510
  }
511
- async function J(e, n) {
512
- let r = Se("load()"), a, o = ++E;
511
+ async function X(e, n) {
512
+ let r = be("load()"), a, o = ++E;
513
513
  i.isLoading = !0;
514
514
  try {
515
- if (a = await r.load(e), F(a.content), k(a.content), n && !n()) return a;
515
+ if (a = await r.load(e), R(a.content), A(a.content), n && !n()) return a;
516
516
  i.template = a, i.content = a.content, i.isDirty = !1, T.value++;
517
517
  } catch (e) {
518
518
  throw t.onError?.(e), e;
519
519
  } finally {
520
520
  E === o && (i.isLoading = !1);
521
521
  }
522
- return xe(() => r.onLoaded?.(a)), a;
522
+ return ye(() => r.onLoaded?.(a)), a;
523
523
  }
524
- async function Y(e = "api") {
525
- let n = Se("save()"), { save: r } = n;
526
- typeof r != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
524
+ async function Se(e = "api") {
525
+ let n = be("save()"), { save: r } = n;
526
+ typeof r != "function" && ve("save()", "is disabled by the provider — its `save` is `false`.");
527
527
  let a = i.template;
528
- a || be("save()", "has no template loaded. Call create() or load() first.");
528
+ a || ve("save()", "has no template loaded. Call create() or load() first.");
529
529
  let o = a.name === void 0 ? { content: i.content } : {
530
530
  name: a.name,
531
531
  content: i.content
@@ -546,16 +546,16 @@ function Ie(t) {
546
546
  } finally {
547
547
  i.isSaving = !1;
548
548
  }
549
- return xe(() => n.onSaved?.(s, { trigger: e })), s;
549
+ return ye(() => n.onSaved?.(s, { trigger: e })), s;
550
550
  }
551
- function we() {
551
+ function Ce() {
552
552
  return i.template?.id !== void 0;
553
553
  }
554
- let X = {
554
+ let Te = {
555
555
  state: e(i),
556
556
  loadVersion: e(T),
557
- content: ee,
558
- selectedBlock: re,
557
+ content: k,
558
+ selectedBlock: ee,
559
559
  activeLocale: a,
560
560
  setActiveLocale: c,
561
561
  addLocale: h,
@@ -565,33 +565,33 @@ function Ie(t) {
565
565
  keepTranslations: w,
566
566
  setCustomBlockDefinitions: u,
567
567
  createSetDefaultLocaleOperation: d,
568
- isBlockLocked: B,
569
- setContent: U,
570
- selectBlock: se,
571
- setViewport: ce,
572
- setDarkMode: le,
573
- setUiTheme: ue,
574
- setPreviewMode: de,
575
- updateBlock: me,
576
- updateSettings: G,
577
- addBlock: ge,
578
- removeBlock: _e,
579
- moveBlock: ve,
580
- markDirty: ye,
581
- findBlockLocation: V,
582
- setName: q,
583
- create: Ce,
584
- load: J,
585
- save: Y,
586
- hasTemplate: we
568
+ isBlockLocked: z,
569
+ setContent: W,
570
+ selectBlock: K,
571
+ setViewport: oe,
572
+ setDarkMode: se,
573
+ setUiTheme: ce,
574
+ setPreviewMode: le,
575
+ updateBlock: de,
576
+ updateSettings: q,
577
+ addBlock: me,
578
+ removeBlock: he,
579
+ moveBlock: ge,
580
+ markDirty: _e,
581
+ findBlockLocation: B,
582
+ setName: Y,
583
+ create: xe,
584
+ load: X,
585
+ save: Se,
586
+ hasTemplate: Ce
587
587
  };
588
- return Ne(X, (e, t) => Ae(e) ? je(K, e, t) : l() ? e === "updateBlock" ? pe(t[0], t[1]) : (e === "updateSettings" && he(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), X;
588
+ return Ne(Te, (e, t) => Ae(e) ? je(J, e, t) : l() ? e === "updateBlock" ? ue(t[0], t[1]) : (e === "updateSettings" && pe(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), Te;
589
589
  }
590
590
  var Le = 50, Re = 300, ze = 1500;
591
591
  function Be(e) {
592
592
  let { content: t, setContent: n, maxSize: i = Le } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
593
593
  function f() {
594
- return M(t.value);
594
+ return N(t.value);
595
595
  }
596
596
  function m(e) {
597
597
  a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
@@ -651,11 +651,11 @@ function Be(e) {
651
651
  function Ve(e) {
652
652
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
653
653
  function o(n, r, a) {
654
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = T(n, o);
654
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = E(n, o);
655
655
  return t(s, r, a), i(s.id), s;
656
656
  }
657
657
  function s(e, n, r) {
658
- let o = O(e);
658
+ let o = k(e);
659
659
  if (!Q(t, "duplicateBlock", [
660
660
  e,
661
661
  n,
@@ -855,7 +855,7 @@ function tt(e) {
855
855
  }
856
856
  function nt(e, t, n) {
857
857
  let r = {}, i = [];
858
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || R(e[i], t[i]) || (r[i] = M(t[i]));
858
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || H(e[i], t[i]) || (r[i] = N(t[i]));
859
859
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
860
860
  return {
861
861
  set: r,
@@ -874,7 +874,7 @@ function rt(e = {}, t = {}) {
874
874
  function it(e, t) {
875
875
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
876
876
  op: "setContent",
877
- content: M(t)
877
+ content: N(t)
878
878
  }];
879
879
  let n = et(e.blocks), r = et(t.blocks), i = [], a = (e) => {
880
880
  let t = r.get(e), i = n.get(e);
@@ -892,8 +892,8 @@ function it(e, t) {
892
892
  };
893
893
  for (let t of e.blocks) u(t, "kept");
894
894
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
895
- let t = M(e);
896
- return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => M(e)) : e)), t;
895
+ let t = N(e);
896
+ return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => N(e)) : e)), t;
897
897
  }, p = (e, t, r) => {
898
898
  let a = Qe(e), o = [], s = [];
899
899
  t.forEach((e, t) => {
@@ -1032,32 +1032,32 @@ function ct(e, t, n) {
1032
1032
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1033
1033
  }
1034
1034
  function lt(e) {
1035
- let t = M(e);
1035
+ let t = N(e);
1036
1036
  return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(lt))), t;
1037
1037
  }
1038
1038
  function ut(e, t, n, r) {
1039
- let i = ae(e, t), a = M(e), o = M(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1039
+ let i = ie(e, t), a = N(e), o = N(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1040
1040
  for (let [i, a] of $(n)) c.set(i, {
1041
- initial: W(a, t, H(e)),
1041
+ initial: P(a, t, G(e)),
1042
1042
  added: r,
1043
1043
  changed: !1
1044
1044
  });
1045
1045
  };
1046
1046
  l(i.blocks, !1);
1047
1047
  let u = [], d = (e, t, n) => {
1048
- if (t.some((e) => e?.op === "setDefaultLocale")) throw new V("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1049
- if (t.some((e) => e?.op === "setContent")) throw new V("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1048
+ if (t.some((e) => e?.op === "setDefaultLocale")) throw new W("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1049
+ if (t.some((e) => e?.op === "setContent")) throw new W("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1050
1050
  try {
1051
1051
  return D(e, t);
1052
1052
  } catch (e) {
1053
- throw e instanceof V ? new V(e.code, n, e.message, e.blockId) : e;
1053
+ throw e instanceof W ? new W(e.code, n, e.message, e.blockId) : e;
1054
1054
  }
1055
1055
  }, f = (e, t) => {
1056
1056
  a = d(a, e, t), u.push(...e);
1057
1057
  }, p = (e, n) => {
1058
1058
  let o = c.get(e);
1059
1059
  if (!o?.changed) return;
1060
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = M(a), d = at(u, ot(u, e).parent), p = M(s);
1060
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = N(a), d = at(u, ot(u, e).parent), p = N(s);
1061
1061
  if (o.added) p = lt(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
1062
1062
  else {
1063
1063
  let e = p.type === "section" ? {
@@ -1065,7 +1065,7 @@ function ut(e, t, n, r) {
1065
1065
  children: p.children,
1066
1066
  columns: p.columns
1067
1067
  } : l;
1068
- De(p, e, (e) => $(a.blocks).get(e) ?? null), p = ne(p);
1068
+ De(p, e, (e) => $(a.blocks).get(e) ?? null), p = I(p);
1069
1069
  let n = p.l10n?.[t];
1070
1070
  ct(p, t, ke(n, Ee(p, o.initial, n, r), Ee(p, l, n, r), p, l));
1071
1071
  }
@@ -1088,7 +1088,7 @@ function ut(e, t, n, r) {
1088
1088
  op: "updateBlock",
1089
1089
  blockId: e.blockId,
1090
1090
  set: { columns: i.columns },
1091
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, j(u, e) ?? null])) } : {}
1091
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, M(u, e) ?? null])) } : {}
1092
1092
  }], n);
1093
1093
  };
1094
1094
  n.forEach((e, t) => {
@@ -1133,7 +1133,7 @@ function ut(e, t, n, r) {
1133
1133
  });
1134
1134
  for (let e of c.keys()) p(e, n.length - 1);
1135
1135
  if (s) {
1136
- let e = M(a), r = e.settings.l10n?.[t];
1136
+ let e = N(a), r = e.settings.l10n?.[t];
1137
1137
  ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
1138
1138
  }
1139
1139
  return u;
@@ -1190,14 +1190,14 @@ function Ct(e) {
1190
1190
  });
1191
1191
  }
1192
1192
  function wt(e) {
1193
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, ee = [], A = null, j = null, te = Promise.resolve(), ne = null, re = r(() => (g.value, (b?.undo.length ?? 0) > 0)), ie = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1194
- function N(t) {
1193
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, ee = [], A = null, j = null, te = Promise.resolve(), ne = null, re = r(() => (g.value, (b?.undo.length ?? 0) > 0)), M = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1194
+ function P(t) {
1195
1195
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1196
1196
  }
1197
- function P(t, n = b) {
1197
+ function F(t, n = b) {
1198
1198
  n !== b || k || e.onNotice?.(t);
1199
1199
  }
1200
- function F() {
1200
+ function I() {
1201
1201
  return {
1202
1202
  locks: [...s.value.values()].map((e) => ({
1203
1203
  blockId: e.blockId,
@@ -1207,13 +1207,13 @@ function wt(e) {
1207
1207
  session: n
1208
1208
  };
1209
1209
  }
1210
- function I() {
1210
+ function L() {
1211
1211
  g.value++;
1212
1212
  }
1213
- function ae(e, t) {
1213
+ function R(e, t) {
1214
1214
  e.push(t), e.length > i && e.splice(0, e.length - i);
1215
1215
  }
1216
- function L(e) {
1216
+ function z(e) {
1217
1217
  if (!_ || S) return;
1218
1218
  C = !0;
1219
1219
  try {
@@ -1221,85 +1221,85 @@ function wt(e) {
1221
1221
  if (n.length > 0) try {
1222
1222
  fe(t, n);
1223
1223
  } catch {
1224
- _.setContent(M(e), !1);
1224
+ _.setContent(N(e), !1);
1225
1225
  }
1226
- R(_.content.value, e) || _.setContent(M(e), !1);
1226
+ H(_.content.value, e) || _.setContent(N(e), !1);
1227
1227
  } finally {
1228
1228
  C = !1;
1229
1229
  }
1230
1230
  let t = _.state.selectedBlockId;
1231
1231
  t && !xt(e.blocks, t) && _.selectBlock(null);
1232
1232
  }
1233
- function z() {
1233
+ function B() {
1234
1234
  C || T || (T = !0, queueMicrotask(() => {
1235
- T = !1, H(!1);
1235
+ T = !1, V(!1);
1236
1236
  }));
1237
1237
  }
1238
- function B() {
1238
+ function ie() {
1239
1239
  E &&= (clearTimeout(E), null);
1240
1240
  }
1241
- function H(e, t = !1) {
1241
+ function V(e, t = !1) {
1242
1242
  let n = b;
1243
1243
  if (!_ || !n || S || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1244
1244
  let r = it(n.view, _.content.value);
1245
- if (r.length === 0) B();
1245
+ if (r.length === 0) ie();
1246
1246
  else {
1247
1247
  if (!e && St(r)) {
1248
1248
  let e = Date.now();
1249
1249
  if (E === null && (O = e), e - O < 1e3) {
1250
1250
  E && clearTimeout(E), E = setTimeout(() => {
1251
- E = null, H(!0);
1251
+ E = null, V(!0);
1252
1252
  }, 300);
1253
1253
  return;
1254
1254
  }
1255
1255
  }
1256
- B(), oe(n, r);
1256
+ ie(), ae(n, r);
1257
1257
  }
1258
1258
  }
1259
1259
  function U() {
1260
- H(!0);
1260
+ V(!0);
1261
1261
  }
1262
- function oe(e, t) {
1262
+ function ae(e, t) {
1263
1263
  let n = t, r;
1264
1264
  try {
1265
- r = D(e.view, n, F());
1265
+ r = D(e.view, n, I());
1266
1266
  } catch (n) {
1267
- if (!(n instanceof V)) throw n;
1268
- L(e.view);
1267
+ if (!(n instanceof W)) throw n;
1268
+ z(e.view);
1269
1269
  let r = n.blockId === void 0 ? void 0 : ke(n.blockId).find((e) => {
1270
1270
  let r = t[n.opIndex];
1271
1271
  return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
1272
1272
  })?.holder;
1273
- P({
1273
+ F({
1274
1274
  type: "editRefused",
1275
1275
  code: n.code,
1276
1276
  ...r ? { holder: r } : {}
1277
- }), n.code === "invalid_operation" && N(n);
1277
+ }), n.code === "invalid_operation" && P(n);
1278
1278
  return;
1279
1279
  }
1280
1280
  let i = _.content.value;
1281
- if (!R(r, i)) {
1282
- N(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1281
+ if (!H(r, i)) {
1282
+ P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1283
1283
  op: "setContent",
1284
- content: M(i)
1284
+ content: N(i)
1285
1285
  }];
1286
1286
  try {
1287
- r = D(e.view, n, F());
1287
+ r = D(e.view, n, I());
1288
1288
  } catch (t) {
1289
- if (!(t instanceof V)) throw t;
1290
- L(e.view), P({
1289
+ if (!(t instanceof W)) throw t;
1290
+ z(e.view), F({
1291
1291
  type: "editRefused",
1292
1292
  code: t.code
1293
1293
  });
1294
1294
  return;
1295
1295
  }
1296
1296
  }
1297
- let a = _t({ ops: le(e.view, n) }, r);
1298
- ae(e.undo, a), e.redo = [], I();
1297
+ let a = _t({ ops: se(e.view, n) }, r);
1298
+ R(e.undo, a), e.redo = [], L();
1299
1299
  let o = e.view;
1300
- e.view = r, se(e, n, "edit", a, o);
1300
+ e.view = r, G(e, n, "edit", a, o);
1301
1301
  }
1302
- function se(e, t, n, r, i) {
1302
+ function G(e, t, n, r, i) {
1303
1303
  let a = { dropped: !1 }, o = 0, s = i;
1304
1304
  do {
1305
1305
  let i = t.slice(o, o + ht);
@@ -1318,139 +1318,139 @@ function wt(e) {
1318
1318
  s = null;
1319
1319
  }
1320
1320
  } while (o < t.length);
1321
- W(e);
1321
+ K(e);
1322
1322
  }
1323
- function W(e) {
1323
+ function K(e) {
1324
1324
  if (e.inFlight || w) return;
1325
1325
  let t = e.pending.find((e) => !e.sent);
1326
- t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : G(e);
1326
+ t ? (t.sent = !0, e.inFlight = t, oe(e, t, 0)) : q(e);
1327
1327
  }
1328
- function ce(e, n, r) {
1328
+ function oe(e, n, r) {
1329
1329
  t.submit(e.templateId, {
1330
1330
  batchId: n.batchId,
1331
1331
  baseRevision: n.baseRevision ??= e.revision,
1332
1332
  ops: n.ops,
1333
1333
  ...n.origin === "ai" ? { origin: "ai" } : {}
1334
1334
  }).then(({ revision: t }) => {
1335
- e.inFlight = null, ue(e, n, t), W(e);
1335
+ e.inFlight = null, ce(e, n, t), K(e);
1336
1336
  }, (t) => {
1337
- if (vt(t) !== null) e.inFlight = null, he(e, n, t), W(e);
1337
+ if (vt(t) !== null) e.inFlight = null, pe(e, n, t), K(e);
1338
1338
  else if (bt(t)) {
1339
- K(e, t);
1339
+ J(e, t);
1340
1340
  let i = pt[Math.min(r, pt.length - 1)];
1341
1341
  setTimeout(() => {
1342
- k || ce(e, n, r + 1);
1342
+ k || oe(e, n, r + 1);
1343
1343
  }, i);
1344
- } else e.inFlight = null, N(t), he(e, n, t), W(e);
1344
+ } else e.inFlight = null, P(t), pe(e, n, t), K(e);
1345
1345
  });
1346
1346
  }
1347
- function ue(e, t, n) {
1348
- t.revision === null && (t.revision = n, n <= e.revision ? (de(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
1347
+ function ce(e, t, n) {
1348
+ t.revision === null && (t.revision = n, n <= e.revision ? (le(e, t), _e(e)) : (e.own.set(n, t), ge(e)));
1349
1349
  }
1350
- function de(e, t) {
1351
- e.pending = e.pending.filter((e) => e !== t), G(e);
1350
+ function le(e, t) {
1351
+ e.pending = e.pending.filter((e) => e !== t), q(e);
1352
1352
  }
1353
- function pe(e, t) {
1353
+ function ue(e, t) {
1354
1354
  if (t.entry) {
1355
1355
  for (let n of [e.undo, e.redo]) {
1356
1356
  let e = n.indexOf(t.entry);
1357
1357
  e !== -1 && n.splice(e, 1);
1358
1358
  }
1359
- I();
1359
+ L();
1360
1360
  }
1361
1361
  }
1362
- function me(e, t) {
1362
+ function de(e, t) {
1363
1363
  let n = !t.group.dropped;
1364
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && pe(e, t), G(e), n;
1364
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && ue(e, t), q(e), n;
1365
1365
  }
1366
- function he(e, t, n) {
1367
- if (de(e, t), me(e, t)) {
1366
+ function pe(e, t, n) {
1367
+ if (le(e, t), de(e, t)) {
1368
1368
  let r = vt(n) ?? "invalid_operation";
1369
1369
  if (t.origin === "edit" || t.origin === "ai") {
1370
1370
  let t = yt(n);
1371
- P({
1371
+ F({
1372
1372
  type: "editRefused",
1373
1373
  code: r,
1374
1374
  ...t ? { holder: t } : {}
1375
1375
  }, e);
1376
- } else P({
1376
+ } else F({
1377
1377
  type: "undoSkipped",
1378
1378
  code: r
1379
1379
  }, e);
1380
1380
  }
1381
- ye(e), e === b && q();
1381
+ _e(e), e === b && Y();
1382
1382
  }
1383
- function G(e) {
1383
+ function q(e) {
1384
1384
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
1385
1385
  }
1386
- function K(e, t) {
1386
+ function J(e, t) {
1387
1387
  let n = t instanceof Error ? t : Error(String(t));
1388
1388
  for (let t of e.waiters.splice(0)) t.reject(n);
1389
1389
  }
1390
- function ge(e, t) {
1390
+ function me(e, t) {
1391
1391
  if (t.revision <= e.revision) return;
1392
1392
  let n = e.pending.find((e) => e.batchId === t.batchId);
1393
- n ? ue(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
1393
+ n ? ce(e, n, t.revision) : (e.remote.set(t.revision, t), ge(e));
1394
1394
  }
1395
- function _e(t, n) {
1395
+ function he(t, n) {
1396
1396
  let r = n.ops;
1397
1397
  if (e.normalizeRemoteOperations) try {
1398
1398
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
1399
1399
  } catch (e) {
1400
- N(e);
1400
+ P(e);
1401
1401
  }
1402
1402
  return Ct(r);
1403
1403
  }
1404
- function ve(t) {
1404
+ function ge(t) {
1405
1405
  let n = [], r = !1;
1406
1406
  for (;;) {
1407
1407
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1408
1408
  if (!i && !a) break;
1409
1409
  try {
1410
- t.confirmed = D(t.confirmed, i ? _e(t, i) : a.ops);
1410
+ t.confirmed = D(t.confirmed, i ? he(t, i) : a.ops);
1411
1411
  } catch {
1412
1412
  if (t.recovering) {
1413
- t.remote.clear(), t.own.clear(), N(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1413
+ t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1414
1414
  return;
1415
1415
  }
1416
- Ce(t);
1416
+ xe(t);
1417
1417
  return;
1418
1418
  }
1419
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), de(t, a));
1419
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), le(t, a));
1420
1420
  }
1421
- if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === b)) for (let t of n) try {
1421
+ if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? ye(t) : be(t), (n.length !== 0 || r) && (_e(t), t === b)) for (let t of n) try {
1422
1422
  e.onRemoteChange?.({
1423
1423
  actor: t.actor,
1424
1424
  ops: t.ops,
1425
1425
  locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
1426
1426
  });
1427
1427
  } catch (e) {
1428
- N(e);
1428
+ P(e);
1429
1429
  }
1430
1430
  }
1431
- function ye(e) {
1431
+ function _e(e) {
1432
1432
  let t = !w;
1433
1433
  w = !0;
1434
1434
  try {
1435
- be(e);
1435
+ ve(e);
1436
1436
  } finally {
1437
1437
  t && (w = !1);
1438
1438
  }
1439
- t && W(e);
1439
+ t && K(e);
1440
1440
  }
1441
- function be(e) {
1441
+ function ve(e) {
1442
1442
  e === b && U();
1443
1443
  let t = e.confirmed;
1444
1444
  for (let n = 0; n < e.pending.length; n++) {
1445
1445
  let r = e.pending[n], i;
1446
- if (r.base && !R(r.base, t)) i = "precondition_failed";
1446
+ if (r.base && !H(r.base, t)) i = "precondition_failed";
1447
1447
  else try {
1448
1448
  t = D(t, r.ops);
1449
1449
  continue;
1450
1450
  } catch (e) {
1451
- i = e instanceof V ? e.code : "invalid_operation";
1451
+ i = e instanceof W ? e.code : "invalid_operation";
1452
1452
  }
1453
- r.sent || (me(e, r) && P(r.origin === "edit" || r.origin === "ai" ? {
1453
+ r.sent || (de(e, r) && F(r.origin === "edit" || r.origin === "ai" ? {
1454
1454
  type: "editRefused",
1455
1455
  code: i
1456
1456
  } : {
@@ -1458,54 +1458,54 @@ function wt(e) {
1458
1458
  code: i
1459
1459
  }, e), t = e.confirmed, n = -1);
1460
1460
  }
1461
- e.view = t, G(e), e === b && L(t);
1461
+ e.view = t, q(e), e === b && z(t);
1462
1462
  }
1463
- function xe(e) {
1463
+ function ye(e) {
1464
1464
  e.gapTimer ||= setTimeout(() => {
1465
- e.gapTimer = null, e === b && q();
1465
+ e.gapTimer = null, e === b && Y();
1466
1466
  }, dt);
1467
1467
  }
1468
- function Se(e) {
1468
+ function be(e) {
1469
1469
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1470
1470
  }
1471
- function q() {
1471
+ function Y() {
1472
1472
  let e = b;
1473
1473
  return e ? (e.catchingUp ||= (async () => {
1474
1474
  try {
1475
1475
  let n = await t.operationsAfter(e.templateId, e.revision);
1476
1476
  if (e.retired) return;
1477
1477
  if ("resync" in n) {
1478
- await Ce(e);
1478
+ await xe(e);
1479
1479
  return;
1480
1480
  }
1481
- for (let t of n.batches) ge(e, t);
1481
+ for (let t of n.batches) me(e, t);
1482
1482
  } catch (e) {
1483
- N(e);
1483
+ P(e);
1484
1484
  } finally {
1485
1485
  e.catchingUp = null;
1486
1486
  }
1487
1487
  })(), e.catchingUp) : Promise.resolve();
1488
1488
  }
1489
- async function Ce(t) {
1489
+ async function xe(t) {
1490
1490
  t.recovering = !0;
1491
1491
  try {
1492
1492
  let n = await e.loadTemplate(t.templateId);
1493
1493
  if (t.retired) return;
1494
1494
  let r = n.revision ?? t.revision;
1495
- t.confirmed = M(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1496
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), de(t, n));
1497
- t === b && (h.value = r), ye(t), ve(t);
1495
+ t.confirmed = N(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1496
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), le(t, n));
1497
+ t === b && (h.value = r), _e(t), ge(t);
1498
1498
  } catch (e) {
1499
- N(e);
1499
+ P(e);
1500
1500
  } finally {
1501
1501
  t.recovering = !1;
1502
1502
  }
1503
1503
  }
1504
- function J(t) {
1504
+ function X(t) {
1505
1505
  let n = () => t === b && !t.retired;
1506
1506
  return {
1507
1507
  onBatch: (e) => {
1508
- n() && ge(t, e);
1508
+ n() && me(t, e);
1509
1509
  },
1510
1510
  onResync: (r, i) => {
1511
1511
  if (!(!n() || r <= t.revision)) {
@@ -1515,9 +1515,9 @@ function wt(e) {
1515
1515
  actor: i
1516
1516
  });
1517
1517
  } catch (e) {
1518
- N(e);
1518
+ P(e);
1519
1519
  }
1520
- q();
1520
+ Y();
1521
1521
  }
1522
1522
  },
1523
1523
  onLock: (e) => {
@@ -1530,23 +1530,23 @@ function wt(e) {
1530
1530
  n() && Z(e);
1531
1531
  },
1532
1532
  onConnectionChange: (e) => {
1533
- n() && X(t, e);
1533
+ n() && Te(t, e);
1534
1534
  }
1535
1535
  };
1536
1536
  }
1537
- function Y(e, r) {
1537
+ function Se(e, r) {
1538
1538
  let i = d;
1539
- t.join(e.templateId, { sessionId: n }, J(e)).then((t) => {
1540
- e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && q(), r && Pe());
1541
- }, (e) => N(e));
1539
+ t.join(e.templateId, { sessionId: n }, X(e)).then((t) => {
1540
+ e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && Y(), r && Pe());
1541
+ }, (e) => P(e));
1542
1542
  }
1543
- function we(e) {
1544
- let t = M(e.content), n = {
1543
+ function Ce(e) {
1544
+ let t = N(e.content), n = {
1545
1545
  templateId: e.id,
1546
1546
  confirmed: t,
1547
1547
  revision: e.revision ?? 0,
1548
1548
  pending: [],
1549
- view: M(t),
1549
+ view: N(t),
1550
1550
  remote: /* @__PURE__ */ new Map(),
1551
1551
  own: /* @__PURE__ */ new Map(),
1552
1552
  inFlight: null,
@@ -1559,17 +1559,17 @@ function wt(e) {
1559
1559
  redo: [],
1560
1560
  waiters: []
1561
1561
  };
1562
- b = n, h.value = n.revision, I(), Y(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), z();
1562
+ b = n, h.value = n.revision, L(), Se(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), B();
1563
1563
  }
1564
- function Te(e) {
1565
- e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1564
+ function we(e) {
1565
+ e.retired = !0, be(e), e.leave?.(), e.leave = null, J(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1566
1566
  }
1567
- function X(e, t) {
1567
+ function Te(e, t) {
1568
1568
  let n = m.value;
1569
- m.value = t, t === "connected" && n !== null && n !== "connected" && Y(e, !0);
1569
+ m.value = t, t === "connected" && n !== null && n !== "connected" && Se(e, !0);
1570
1570
  }
1571
1571
  function Ee(e) {
1572
- b && b.templateId === e?.id || (b &&= (B(), Te(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Pe(), I(), e && we(e));
1572
+ b && b.templateId === e?.id || (b &&= (ie(), we(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Pe(), L(), e && Ce(e));
1573
1573
  }
1574
1574
  function De(e, t) {
1575
1575
  return `${e}\u0000${t ?? ""}`;
@@ -1587,7 +1587,7 @@ function wt(e) {
1587
1587
  if (e.holder.sessionId === n) return;
1588
1588
  t ? c.add(e) : u.set(e, ++d);
1589
1589
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1590
- r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), P({
1590
+ r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), F({
1591
1591
  type: "selectionRefused",
1592
1592
  blockId: e.blockId,
1593
1593
  holder: e.holder
@@ -1612,7 +1612,7 @@ function wt(e) {
1612
1612
  r.size !== s.value.size && (s.value = r);
1613
1613
  }
1614
1614
  function Q(e) {
1615
- te = te.then(e).catch(N);
1615
+ te = te.then(e).catch(P);
1616
1616
  }
1617
1617
  function Pe() {
1618
1618
  a && Q(async () => {
@@ -1648,7 +1648,7 @@ function wt(e) {
1648
1648
  holder: n,
1649
1649
  expiresAt: ""
1650
1650
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1651
- } else N(t), setTimeout(() => {
1651
+ } else P(t), setTimeout(() => {
1652
1652
  A?.blockId === e && Pe();
1653
1653
  }, pt[0]);
1654
1654
  }
@@ -1663,7 +1663,7 @@ function wt(e) {
1663
1663
  j = null, Re(), Pe();
1664
1664
  return;
1665
1665
  }
1666
- N(e);
1666
+ P(e);
1667
1667
  }
1668
1668
  });
1669
1669
  }, ft);
@@ -1687,8 +1687,8 @@ function wt(e) {
1687
1687
  U();
1688
1688
  let n = (e === "undo" ? t.undo : t.redo).pop();
1689
1689
  if (!n) return;
1690
- if (I(), n.view && !R(n.view, t.view)) {
1691
- P({
1690
+ if (L(), n.view && !H(n.view, t.view)) {
1691
+ F({
1692
1692
  type: "undoSkipped",
1693
1693
  code: "precondition_failed"
1694
1694
  });
@@ -1696,30 +1696,30 @@ function wt(e) {
1696
1696
  }
1697
1697
  let r;
1698
1698
  try {
1699
- r = D(t.view, n.ops, F());
1699
+ r = D(t.view, n.ops, I());
1700
1700
  } catch (e) {
1701
- if (!(e instanceof V)) throw e;
1702
- P({
1701
+ if (!(e instanceof W)) throw e;
1702
+ F({
1703
1703
  type: "undoSkipped",
1704
1704
  code: e.code
1705
1705
  });
1706
1706
  return;
1707
1707
  }
1708
- let i = _t({ ops: le(t.view, n.ops) }, r);
1709
- ae(e === "undo" ? t.redo : t.undo, i);
1708
+ let i = _t({ ops: se(t.view, n.ops) }, r);
1709
+ R(e === "undo" ? t.redo : t.undo, i);
1710
1710
  let a = t.view;
1711
- t.view = r, L(r), _?.markDirty(), se(t, n.ops, e, i, a);
1711
+ t.view = r, z(r), _?.markDirty(), G(t, n.ops, e, i, a);
1712
1712
  }
1713
1713
  function He(e, t) {
1714
1714
  let n = b;
1715
1715
  if (!_ || !n || S) return {
1716
1716
  applied: !1,
1717
- error: new V("invalid_operation", 0, "No template is open for editing.")
1717
+ error: new W("invalid_operation", 0, "No template is open for editing.")
1718
1718
  };
1719
1719
  if (t.origin === void 0) try {
1720
- D(_.content.value, e, F());
1720
+ D(_.content.value, e, I());
1721
1721
  } catch (e) {
1722
- if (e instanceof V) return {
1722
+ if (e instanceof W) return {
1723
1723
  applied: !1,
1724
1724
  error: e
1725
1725
  };
@@ -1728,9 +1728,9 @@ function wt(e) {
1728
1728
  U();
1729
1729
  let r, i;
1730
1730
  try {
1731
- r = D(n.view, e, F()), i = le(n.view, e);
1731
+ r = D(n.view, e, I()), i = se(n.view, e);
1732
1732
  } catch (e) {
1733
- if (e instanceof V) return {
1733
+ if (e instanceof W) return {
1734
1734
  applied: !1,
1735
1735
  error: e
1736
1736
  };
@@ -1738,15 +1738,15 @@ function wt(e) {
1738
1738
  }
1739
1739
  let a = n.undo.at(-1), o;
1740
1740
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1741
- let e = a.view !== void 0 && !R(a.view, n.view);
1741
+ let e = a.view !== void 0 && !H(a.view, n.view);
1742
1742
  a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
1743
1743
  } else o = _t({
1744
1744
  ops: i,
1745
1745
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1746
- }, r), ae(n.undo, o);
1747
- n.redo = [], I();
1746
+ }, r), R(n.undo, o);
1747
+ n.redo = [], L();
1748
1748
  let s = n.view;
1749
- return n.view = r, L(r), _.markDirty(), se(n, e, t.origin ?? "edit", o, s), {
1749
+ return n.view = r, z(r), _.markDirty(), G(n, e, t.origin ?? "edit", o, s), {
1750
1750
  applied: !0,
1751
1751
  inverse: i
1752
1752
  };
@@ -1757,14 +1757,14 @@ function wt(e) {
1757
1757
  if (t.moveBlock && t.findBlockLocation) {
1758
1758
  let n = t.moveBlock, r = (...r) => {
1759
1759
  let i = b, a = i && !S && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1760
- if (a && H(!0), n(...r), !a || R(i.view, e.content.value)) return;
1760
+ if (a && V(!0), n(...r), !a || H(i.view, e.content.value)) return;
1761
1761
  let o = t.findBlockLocation(r[0]);
1762
1762
  if (!o) return;
1763
1763
  let s = o.targetSectionId ? {
1764
1764
  sectionId: o.targetSectionId,
1765
1765
  column: o.columnIndex ?? 0
1766
1766
  } : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0, l = s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks;
1767
- oe(i, [{
1767
+ ae(i, [{
1768
1768
  op: "moveBlock",
1769
1769
  blockId: r[0],
1770
1770
  parent: s,
@@ -1775,7 +1775,7 @@ function wt(e) {
1775
1775
  t.moveBlock === r && (t.moveBlock = n);
1776
1776
  });
1777
1777
  }
1778
- ee.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, z, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : z())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
1778
+ ee.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, B, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? V(!0, !0) : B())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
1779
1779
  }
1780
1780
  function We() {
1781
1781
  U();
@@ -1789,13 +1789,13 @@ function wt(e) {
1789
1789
  U(), S = !0;
1790
1790
  }
1791
1791
  function Ke() {
1792
- S = !1, b && L(b.view);
1792
+ S = !1, b && z(b.view);
1793
1793
  }
1794
1794
  function qe() {
1795
1795
  if (!k) {
1796
1796
  U();
1797
1797
  for (let e of ee.splice(0)) e();
1798
- B(), Be(), k = !0, b && Te(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
1798
+ ie(), Be(), k = !0, b && we(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
1799
1799
  }
1800
1800
  }
1801
1801
  return {
@@ -1808,18 +1808,18 @@ function wt(e) {
1808
1808
  connection: m,
1809
1809
  revision: h,
1810
1810
  canUndo: re,
1811
- canRedo: ie,
1811
+ canRedo: M,
1812
1812
  attach: Ue,
1813
1813
  undo: () => Ve("undo"),
1814
1814
  redo: () => Ve("redo"),
1815
1815
  clearHistory: () => {
1816
- b && (b.undo = [], b.redo = [], I());
1816
+ b && (b.undo = [], b.redo = [], L());
1817
1817
  },
1818
1818
  flush: U,
1819
1819
  settle: We,
1820
1820
  suspend: Ge,
1821
1821
  resume: Ke,
1822
- catchUp: q,
1822
+ catchUp: Y,
1823
1823
  hasConfirmedBlock: (e) => b ? xt(b.confirmed.blocks, e) : !1,
1824
1824
  applyOperations: He,
1825
1825
  destroy: qe
@@ -1841,7 +1841,7 @@ function Tt(e) {
1841
1841
  return s.value && e.canDelete !== !1;
1842
1842
  }
1843
1843
  function u(e, t) {
1844
- throw new z(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1844
+ throw new U(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1845
1845
  }
1846
1846
  function f(t) {
1847
1847
  Fe(e.onError, t);
@@ -1938,7 +1938,7 @@ function Dt(e = {}) {
1938
1938
  },
1939
1939
  async create(e) {
1940
1940
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1941
- id: B(),
1941
+ id: ue(),
1942
1942
  name: e.name,
1943
1943
  content: e.content,
1944
1944
  ...e.category ? { category: e.category } : {},
@@ -2004,7 +2004,7 @@ function At(e = {}) {
2004
2004
  },
2005
2005
  async create(e) {
2006
2006
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2007
- id: B(),
2007
+ id: ue(),
2008
2008
  url: t,
2009
2009
  filename: e.filename || e.file.name,
2010
2010
  createdAt: n,
@@ -2043,11 +2043,11 @@ function jt(e) {
2043
2043
  let { provider: t, getTemplateId: n } = e, r = p([]), i = p(!1), a = p(void 0), o = p(!1), s = /* @__PURE__ */ new Map(), c = d(() => typeof t.create == "function"), l = d(() => typeof t.restore == "function");
2044
2044
  function u(e) {
2045
2045
  let t = n();
2046
- if (!t) throw new z(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2046
+ if (!t) throw new U(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2047
2047
  return t;
2048
2048
  }
2049
2049
  function f(e) {
2050
- throw new z(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2050
+ throw new U(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2051
2051
  }
2052
2052
  function m(t) {
2053
2053
  Fe(e.onError, t);
@@ -2125,16 +2125,16 @@ function Mt(e) {
2125
2125
  });
2126
2126
  function g(e) {
2127
2127
  let t = n();
2128
- if (!t) throw new z(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2128
+ if (!t) throw new U(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2129
2129
  return t;
2130
2130
  }
2131
2131
  function _(e) {
2132
2132
  let t = r();
2133
- if (!t) throw new z(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2133
+ if (!t) throw new U(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2134
2134
  return t;
2135
2135
  }
2136
2136
  function v(e) {
2137
- throw new z(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2137
+ throw new U(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2138
2138
  }
2139
2139
  function y(e) {
2140
2140
  for (let t of i.value) {
@@ -2262,10 +2262,10 @@ function Mt(e) {
2262
2262
  function j(e) {
2263
2263
  T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
2264
2264
  }
2265
- function M(e) {
2265
+ function te(e) {
2266
2266
  T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2267
2267
  }
2268
- function te(e, n) {
2268
+ function ne(e, n) {
2269
2269
  let r = E(e, n);
2270
2270
  r && S(() => t.onDeleted?.(r, { origin: "remote" }));
2271
2271
  }
@@ -2288,8 +2288,8 @@ function Mt(e) {
2288
2288
  find: y,
2289
2289
  isOwn: b,
2290
2290
  applyRemoteCreate: j,
2291
- applyRemoteUpdate: M,
2292
- applyRemoteDelete: te
2291
+ applyRemoteUpdate: te,
2292
+ applyRemoteDelete: ne
2293
2293
  };
2294
2294
  }
2295
2295
  function Nt(e) {
@@ -2313,7 +2313,7 @@ function Nt(e) {
2313
2313
  }));
2314
2314
  }, { immediate: !0 }), l(s);
2315
2315
  }
2316
- var Pt = G({
2316
+ var Pt = q({
2317
2317
  name: "code",
2318
2318
  size: 24,
2319
2319
  node: [["path", {
@@ -2323,14 +2323,14 @@ var Pt = G({
2323
2323
  d: "m8 6-6 6 6 6",
2324
2324
  key: "ppft3o"
2325
2325
  }]]
2326
- }), Ft = G({
2326
+ }), Ft = q({
2327
2327
  name: "navigation",
2328
2328
  size: 24,
2329
2329
  node: [["polygon", {
2330
2330
  points: "3 11 22 2 13 21 11 13 3 11",
2331
2331
  key: "1ltx0t"
2332
2332
  }]]
2333
- }), It = G({
2333
+ }), It = q({
2334
2334
  name: "share-2",
2335
2335
  size: 24,
2336
2336
  node: [
@@ -2367,7 +2367,7 @@ var Pt = G({
2367
2367
  key: "1n3mei"
2368
2368
  }]
2369
2369
  ]
2370
- }), Lt = G({
2370
+ }), Lt = q({
2371
2371
  name: "table",
2372
2372
  size: 24,
2373
2373
  node: [
@@ -2424,7 +2424,7 @@ function zt(e) {
2424
2424
  };
2425
2425
  }
2426
2426
  function Bt(e) {
2427
- let n = C(ve, null), r = d(e);
2427
+ let n = C(ge, null), r = d(e);
2428
2428
  if (!n) return r;
2429
2429
  let i;
2430
2430
  function a() {
@@ -2451,14 +2451,14 @@ function Vt(e, t) {
2451
2451
  return typeof n == "string" && n.length > 0 ? n : t;
2452
2452
  }
2453
2453
  function Ht(e, t) {
2454
- return typeof e?.url == "string" && re(e.url, t);
2454
+ return typeof e?.url == "string" && F(e.url, t);
2455
2455
  }
2456
2456
  function Ut(e, t) {
2457
2457
  let n = e?.url;
2458
- if (typeof n == "string" && n.trim() !== "") return re(n, t) ? void 0 : n;
2458
+ if (typeof n == "string" && n.trim() !== "") return F(n, t) ? void 0 : n;
2459
2459
  }
2460
2460
  function Wt(e) {
2461
- let t = C(_e, U.liquid), n = Bt(() => Ut(e(), t));
2461
+ let t = C(he, K.liquid), n = Bt(() => Ut(e(), t));
2462
2462
  return d(() => Ht(e(), t) ? null : n.value);
2463
2463
  }
2464
2464
  function Gt(e, t, n) {
@@ -2475,7 +2475,7 @@ function qt(e, t, n = []) {
2475
2475
  }
2476
2476
  // src/utils/resolveFieldColors.ts
2477
2477
  function Jt(e, t) {
2478
- let n = q({ presets: e.presets }, Ce), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2478
+ let n = Y({ presets: e.presets }, xe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2479
2479
  return {
2480
2480
  presets: r ? t.presets : n.presets,
2481
2481
  allowCustom: t.allowCustom !== !1 && i,
@@ -2535,7 +2535,7 @@ var tn = /* @__PURE__ */ w({
2535
2535
  size: { default: "field" }
2536
2536
  },
2537
2537
  setup(e) {
2538
- let t = e, { t: r } = xe(), s = {
2538
+ let t = e, { t: r } = ye(), s = {
2539
2539
  field: {
2540
2540
  gap: "tpl:gap-1.5",
2541
2541
  icon: 18,
@@ -2550,11 +2550,11 @@ var tn = /* @__PURE__ */ w({
2550
2550
  return (t, s) => (i(), m("div", {
2551
2551
  class: a(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", c.value.gap]),
2552
2552
  style: o({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${c.value.veil}, transparent)` })
2553
- }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(ge), {
2553
+ }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(me), {
2554
2554
  class: "tpl-spinner",
2555
2555
  size: c.value.icon,
2556
2556
  "stroke-width": 2
2557
- }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(K), {
2557
+ }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(J), {
2558
2558
  size: c.value.icon,
2559
2559
  "stroke-width": 1.5
2560
2560
  }, null, 8, ["size"]), h(" " + n(f(r).image.dropToUpload), 1)], 64))], 6));
@@ -2570,7 +2570,7 @@ function nn() {
2570
2570
  // src/composables/useImageDrop.ts
2571
2571
  var rn = "image/";
2572
2572
  function an(e) {
2573
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = Se(t, {
2573
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = be(t, {
2574
2574
  preventDefaultForUnhandled: !0,
2575
2575
  onDrop: (e) => {
2576
2576
  if (!i()) return;
@@ -2582,7 +2582,7 @@ function an(e) {
2582
2582
  }
2583
2583
  // src/composables/useMediaDropField.ts
2584
2584
  function on(e) {
2585
- let { target: t, blocked: n, apply: r } = e, i = C(ye, null), a = C(be, null), o = nn();
2585
+ let { target: t, blocked: n, apply: r } = e, i = C(_e, null), a = C(ve, null), o = nn();
2586
2586
  async function s() {
2587
2587
  let e = await i?.({ accept: ["images"] });
2588
2588
  o.alive && e && r(e);
@@ -2631,7 +2631,7 @@ var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
2631
2631
  "2-1": [66.67, 33.33]
2632
2632
  };
2633
2633
  function un(e, t) {
2634
- let n = (e) => Math.trunc(e ?? 0), r = (e) => N(e) === null ? 0 : Math.trunc(e.width);
2634
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => T(e) === null ? 0 : Math.trunc(e.width);
2635
2635
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2636
2636
  }
2637
2637
  function dn(e, t) {
@@ -2644,21 +2644,21 @@ function fn(e, t) {
2644
2644
  function* pn(e, t) {
2645
2645
  for (let n of e) ee(n) ? yield* pn(n.children, dn(t, n.styles.padding)) : yield {
2646
2646
  block: n,
2647
- bandWidth: P(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
2647
+ bandWidth: O(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
2648
2648
  };
2649
2649
  }
2650
- function mn(e, t, n = H(e)) {
2650
+ function mn(e, t, n = G(e)) {
2651
2651
  if (!t) return e;
2652
2652
  try {
2653
- return me(ae(t, n, { missing: "default" }), e);
2653
+ return pe(ie(t, n, { missing: "default" }), e);
2654
2654
  } catch {
2655
2655
  return e;
2656
2656
  }
2657
2657
  }
2658
2658
  function hn(e, t, n, r) {
2659
2659
  let i = mn(e, n, r);
2660
- for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (P(e)) {
2661
- let r = E(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
2660
+ for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (O(e)) {
2661
+ let r = B(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
2662
2662
  for (let n = 0; n < e.children.length; n++) {
2663
2663
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2664
2664
  if (o) return fn(o, r);
@@ -2672,14 +2672,14 @@ function gn(e, t, n, r) {
2672
2672
  return null;
2673
2673
  }
2674
2674
  function _n(e) {
2675
- let t = P(e) ? E(e) : null;
2675
+ let t = O(e) ? B(e) : null;
2676
2676
  return !!t?.applied && t.height === "image";
2677
2677
  }
2678
2678
  function vn(e, t, n, r) {
2679
2679
  if (_n(e)) return (t ? gn(t, e.id, n, r) : null) ?? sn(t?.settings);
2680
2680
  }
2681
2681
  // src/constants/socialIcons.ts
2682
- var yn = se, bn = {
2682
+ var yn = oe, bn = {
2683
2683
  small: 24,
2684
2684
  medium: 32,
2685
2685
  large: 48