@templatical/editor 0.54.2 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/{AiAltTextPopover-BBKVJ6HA.js → AiAltTextPopover-DdsvhE78.js} +4 -4
  2. package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-P6to1_0t.js} +3 -3
  3. package/dist/{AiChatPanel-C8SeEJRP.js → AiChatPanel-BSlmzMRC.js} +10 -10
  4. package/dist/{AiPanels-CR6zphjP.js → AiPanels-DAsnX-a3.js} +1 -1
  5. package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-DIISOR6U.js} +11 -11
  6. package/dist/{BlockIssueBadge-DaPTq1RE.js → BlockIssueBadge-Bmtc50BQ.js} +4 -4
  7. package/dist/BlockPreviewCanvas-BYIzNn-9.js +154 -0
  8. package/dist/{CloudHeaderExtras-XpjJjn3o.js → CloudHeaderExtras-Cqhw-jMz.js} +1 -1
  9. package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-w34W8_BP.js} +4 -4
  10. package/dist/{CollaborationNotices-Cnx0XHzZ.js → CollaborationNotices-HTbCebjV.js} +2 -2
  11. package/dist/{CollaboratorBar-BaBoNhwB.js → CollaboratorBar-CLQjksX-.js} +2 -2
  12. package/dist/{CommentsPanel-Ck3QmqiC.js → CommentsPanel-C5qG17Ki.js} +1 -1
  13. package/dist/{CommentsSidebar-CHknhOar.js → CommentsSidebar-C7CWcUYZ.js} +12 -12
  14. package/dist/{CountdownBlock-BMezkFbJ.js → CountdownBlock-BTXcCvjZ.js} +2 -2
  15. package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CP-pkntQ.js} +5 -5
  16. package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-CiiNBzH0.js} +12 -12
  17. package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-B981Av-6.js} +15 -15
  18. package/dist/{LocaleNotices-WzsYtBRs.js → LocaleNotices-CTCZ7BYv.js} +4 -4
  19. package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-DEOPc4RC.js} +284 -279
  20. package/dist/{MediaEditModal-C3U9Mi31.js → MediaEditModal-DJsPLTwP.js} +1 -1
  21. package/dist/{MediaPanels-CGmk9ufe.js → MediaPanels-D2WD2aE2.js} +1 -1
  22. package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-C9icdxw7.js} +1 -1
  23. package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DXvb80OE.js} +6 -6
  24. package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-CrAcmT3A.js} +5 -5
  25. package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-BWBQ3jKz.js} +55 -55
  26. package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-CqAp16yQ.js} +4 -4
  27. package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-xbBjVPVQ.js} +8 -8
  28. package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-pebNJBTc.js} +9 -9
  29. package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-CvagMcv7.js} +11 -11
  30. package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-B9AAVBDm.js} +1 -1
  31. package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BIANWe3i.js} +3 -3
  32. package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-ORq4PbCN.js} +12 -12
  33. package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-DRjCpcPl.js} +11 -11
  34. package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-H0v8El__.js} +1 -1
  35. package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-CEGbJXeU.js} +11 -11
  36. package/dist/{Toolbar-BppchV2k.js → Toolbar-XT-uGA9J.js} +1134 -852
  37. package/dist/{TplModal-BFWOoK8l.js → TplModal-7NQq5-VW.js} +4 -4
  38. package/dist/{VersionHistoryMenu-BnP0EyLl.js → VersionHistoryMenu-C8BE3Pr-.js} +7 -7
  39. package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-CuKuOSJG.js} +1 -1
  40. package/dist/{VersionPreviewBanner-BPP939cD.js → VersionPreviewBanner-BVFBkveR.js} +2 -2
  41. package/dist/WrapperBlock-Bdw-072t.js +56 -0
  42. package/dist/{blockTypeIcons-D91v9k0x.js → blockTypeIcons-CGplGmmr.js} +3 -3
  43. package/dist/bundle-stats.json +6 -6
  44. package/dist/{ca-DOuIxWRv.js → ca-BJn8lcJx.js} +18 -1
  45. package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js → AiAltTextPopover-x999Gimz.js} +5 -5
  46. package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-x999Gimz.js.map} +1 -1
  47. package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-DjnFz1wO.js} +4 -4
  48. package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-DjnFz1wO.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js → AiChatPanel-DKDu9cs7.js} +4 -4
  50. package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js.map → AiChatPanel-DKDu9cs7.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiPanels-BblCSkQy.js → AiPanels-jMLVaiKx.js} +2 -2
  52. package/dist/cdn/chunks/{AiPanels-BblCSkQy.js.map → AiPanels-jMLVaiKx.js.map} +1 -1
  53. package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-s79rmHFy.js} +10 -10
  54. package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-s79rmHFy.js.map} +1 -1
  55. package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js → BlockIssueBadge-Bnmq_M4G.js} +4 -4
  56. package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js.map → BlockIssueBadge-Bnmq_M4G.js.map} +1 -1
  57. package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-B3HkuENF.js} +46 -32
  58. package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js.map +1 -0
  59. package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js → CloudHeaderExtras-uUJYJFJ6.js} +2 -2
  60. package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js.map → CloudHeaderExtras-uUJYJFJ6.js.map} +1 -1
  61. package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-DQnlH_YJ.js} +4 -4
  62. package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-DQnlH_YJ.js.map} +1 -1
  63. package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js → CollaborationNotices-CHqUGhOZ.js} +3 -3
  64. package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js.map → CollaborationNotices-CHqUGhOZ.js.map} +1 -1
  65. package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js → CollaboratorBar-C1ZI2xwa.js} +3 -3
  66. package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js.map → CollaboratorBar-C1ZI2xwa.js.map} +1 -1
  67. package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js → CommentsPanel-EtdTzTmq.js} +2 -2
  68. package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js.map → CommentsPanel-EtdTzTmq.js.map} +1 -1
  69. package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js → CommentsSidebar-Qmj049QX.js} +4 -4
  70. package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js.map → CommentsSidebar-Qmj049QX.js.map} +1 -1
  71. package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js → CountdownBlock-DyGsh92b.js} +3 -3
  72. package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js.map → CountdownBlock-DyGsh92b.js.map} +1 -1
  73. package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-Ddj2erNm.js} +6 -6
  74. package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-Ddj2erNm.js.map} +1 -1
  75. package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-DnSnEh1X.js} +8 -8
  76. package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-DnSnEh1X.js.map} +1 -1
  77. package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-C2I_yTL5.js} +110 -110
  78. package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-C2I_yTL5.js.map} +1 -1
  79. package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js → LocaleNotices-Dr9LRCAg.js} +4 -4
  80. package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js.map → LocaleNotices-Dr9LRCAg.js.map} +1 -1
  81. package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-BdzE9-l7.js} +260 -255
  82. package/dist/cdn/chunks/LogicTagInsertButton-BdzE9-l7.js.map +1 -0
  83. package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js → MediaEditModal-CMJFXu_o.js} +2 -2
  84. package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js.map → MediaEditModal-CMJFXu_o.js.map} +1 -1
  85. package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js → MediaPanels-C790ZXuY.js} +2 -2
  86. package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js.map → MediaPanels-C790ZXuY.js.map} +1 -1
  87. package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-CmrX8Md6.js} +2 -2
  88. package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-CmrX8Md6.js.map} +1 -1
  89. package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-D7maMGIM.js} +5 -5
  90. package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-D7maMGIM.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-KOnd2teB.js} +8 -8
  92. package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-KOnd2teB.js.map} +1 -1
  93. package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-I9lbKaPk.js} +19 -19
  94. package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-I9lbKaPk.js.map} +1 -1
  95. package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-DqbULAbc.js} +4 -4
  96. package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-DqbULAbc.js.map} +1 -1
  97. package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-_O22z0pn.js} +8 -8
  98. package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-_O22z0pn.js.map} +1 -1
  99. package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-CClRLXgF.js} +8 -8
  100. package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-CClRLXgF.js.map} +1 -1
  101. package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-BIaxaxw9.js} +8 -8
  102. package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-BIaxaxw9.js.map} +1 -1
  103. package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-Dfu9N6YW.js} +2 -2
  104. package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-Dfu9N6YW.js.map} +1 -1
  105. package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DiMW_dbJ.js} +4 -4
  106. package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DiMW_dbJ.js.map} +1 -1
  107. package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-JMUo0LIV.js} +10 -10
  108. package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-JMUo0LIV.js.map} +1 -1
  109. package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-D52VtwBZ.js} +12 -12
  110. package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-D52VtwBZ.js.map} +1 -1
  111. package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-D9ezVDHd.js} +2 -2
  112. package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-D9ezVDHd.js.map} +1 -1
  113. package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-D04vvbUc.js} +9 -9
  114. package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-D04vvbUc.js.map} +1 -1
  115. package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-C_Hfsher.js} +1196 -914
  116. package/dist/cdn/chunks/Toolbar-C_Hfsher.js.map +1 -0
  117. package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-d6fEZGJ5.js} +5 -5
  118. package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-d6fEZGJ5.js.map} +1 -1
  119. package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js → VersionHistoryMenu-C8ucm43v.js} +7 -7
  120. package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js.map → VersionHistoryMenu-C8ucm43v.js.map} +1 -1
  121. package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-BAdzmhvH.js} +2 -2
  122. package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-BAdzmhvH.js.map} +1 -1
  123. package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js → VersionPreviewBanner-BWuovbFc.js} +3 -3
  124. package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js.map → VersionPreviewBanner-BWuovbFc.js.map} +1 -1
  125. package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js +58 -0
  126. package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js.map +1 -0
  127. package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js → blockTypeIcons-CzYA5DF9.js} +2 -2
  128. package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js.map → blockTypeIcons-CzYA5DF9.js.map} +1 -1
  129. package/dist/cdn/chunks/{ca-DOuIxWRv.js → ca-BJn8lcJx.js} +19 -2
  130. package/dist/cdn/chunks/ca-BJn8lcJx.js.map +1 -0
  131. package/dist/cdn/chunks/{composables-BxikPuC1.js → composables-CsfQlmcf.js} +676 -620
  132. package/dist/cdn/chunks/composables-CsfQlmcf.js.map +1 -0
  133. package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-PpIFCDfj.js} +4 -4
  134. package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js.map → createCloudRuntime-PpIFCDfj.js.map} +1 -1
  135. package/dist/{de-DaOUfYBX.js → cdn/chunks/de-BLFp3nWx.js} +20 -1
  136. package/dist/cdn/chunks/de-BLFp3nWx.js.map +1 -0
  137. package/dist/cdn/chunks/{editor-modal-erQEOHZN.js → editor-modal-B8UE9V8B.js} +90 -90
  138. package/dist/cdn/chunks/{editor-modal-erQEOHZN.js.map → editor-modal-B8UE9V8B.js.map} +1 -1
  139. package/dist/cdn/chunks/en-CVxNoHww.js +1 -0
  140. package/dist/cdn/chunks/{en-C0pHHMiR.js → en-DGGQJGbm.js} +19 -2
  141. package/dist/cdn/chunks/en-DGGQJGbm.js.map +1 -0
  142. package/dist/{es-CxyEKr6n.js → cdn/chunks/es-DTY9qgLv.js} +20 -1
  143. package/dist/cdn/chunks/es-DTY9qgLv.js.map +1 -0
  144. package/dist/cdn/chunks/{extensions-DuDWpKo7.js → extensions-BM6ZSnsQ.js} +82 -76
  145. package/dist/cdn/chunks/extensions-BM6ZSnsQ.js.map +1 -0
  146. package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-L4FqO9Gp.js} +20 -1
  147. package/dist/cdn/chunks/fr-L4FqO9Gp.js.map +1 -0
  148. package/dist/cdn/chunks/{icons-Da9GKjPx.js → icons-DHExFLlT.js} +43 -43
  149. package/dist/cdn/chunks/{icons-Da9GKjPx.js.map → icons-DHExFLlT.js.map} +1 -1
  150. package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-6uOXkh4v.js} +19 -2
  151. package/dist/cdn/chunks/ja-6uOXkh4v.js.map +1 -0
  152. package/dist/cdn/chunks/{keys-CoQtCqNv.js → keys-BUmIvYy3.js} +4 -4
  153. package/dist/cdn/chunks/keys-BUmIvYy3.js.map +1 -0
  154. package/dist/cdn/chunks/{nl-DkrB-VKZ.js → nl-DCxuxwNq.js} +19 -2
  155. package/dist/cdn/chunks/nl-DCxuxwNq.js.map +1 -0
  156. package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js +300 -0
  157. package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js.map +1 -0
  158. package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Dn6dFUwx.js} +2 -2
  159. package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js.map → preRenderCustomBlocks-Dn6dFUwx.js.map} +1 -1
  160. package/dist/cdn/chunks/{pt-BR-CY5Ye7eP.js → pt-BR-CBkcrebr.js} +19 -2
  161. package/dist/cdn/chunks/pt-BR-CBkcrebr.js.map +1 -0
  162. package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js → sanitizeHtml-DJI7vvET.js} +3 -3
  163. package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-DJI7vvET.js.map} +1 -1
  164. package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-Qw9rHc8C.js} +420 -406
  165. package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-Qw9rHc8C.js.map} +1 -1
  166. package/dist/cdn/chunks/src-Bfj1jHnn.js +710 -0
  167. package/dist/cdn/chunks/src-Bfj1jHnn.js.map +1 -0
  168. package/dist/cdn/chunks/{src-712f3ofG.js → src-C9JWWxAk.js} +683 -568
  169. package/dist/cdn/chunks/src-C9JWWxAk.js.map +1 -0
  170. package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-mXG-Of9A.js} +892 -735
  171. package/dist/cdn/chunks/src-mXG-Of9A.js.map +1 -0
  172. package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js → useCloudI18n-Xsih9yRH.js} +2 -2
  173. package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js.map → useCloudI18n-Xsih9yRH.js.map} +1 -1
  174. package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js → useEditorRoot-Beau2Z_T.js} +2 -2
  175. package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js.map → useEditorRoot-Beau2Z_T.js.map} +1 -1
  176. package/dist/cdn/chunks/{useI18n-BnJYydPv.js → useI18n-D8s7HtTn.js} +2 -2
  177. package/dist/cdn/chunks/{useI18n-BnJYydPv.js.map → useI18n-D8s7HtTn.js.map} +1 -1
  178. package/dist/cdn/chunks/useLocalizedDisplay-Bgg4qpev.js +33 -0
  179. package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-Bgg4qpev.js.map} +1 -1
  180. package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-DLvWzWsp.js} +4 -4
  181. package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-DLvWzWsp.js.map} +1 -1
  182. package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-B4FHCGGm.js} +6 -6
  183. package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-B4FHCGGm.js.map} +1 -1
  184. package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js → usePopoverPosition-esO6wjvU.js} +5 -5
  185. package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js.map → usePopoverPosition-esO6wjvU.js.map} +1 -1
  186. package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js → useScrollToBlock-CJuUu7Xj.js} +2 -2
  187. package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js.map → useScrollToBlock-CJuUu7Xj.js.map} +1 -1
  188. package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-QqBilClC.js} +2 -2
  189. package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-QqBilClC.js.map} +1 -1
  190. package/dist/cdn/editor.css +1 -1
  191. package/dist/cdn/editor.js +761 -764
  192. package/dist/cdn/editor.js.map +1 -1
  193. package/dist/{check-XMnOOIEC.js → check-CcuCoJDh.js} +1 -1
  194. package/dist/{chevron-down-DmamTEWQ.js → chevron-down-BfYIbFbC.js} +1 -1
  195. package/dist/{chevron-right-BEFXOH27.js → chevron-right-DyjFqY35.js} +1 -1
  196. package/dist/{chevron-up-Dw7woXj8.js → chevron-up-BHEIxuS-.js} +1 -1
  197. package/dist/{circle-alert-BTKC9vkq.js → circle-alert-Tq7kAh9S.js} +1 -1
  198. package/dist/{clock-BVT5u2uG.js → clock-Df0ZiXwQ.js} +1 -1
  199. package/dist/{composables-BbPFRlBf.js → composables-CRX6rncm.js} +1044 -988
  200. package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-DplyIlsy.js} +3 -3
  201. package/dist/{createLucideIcon-CgDE3xAR.js → createLucideIcon-CfBdtoUw.js} +5 -5
  202. package/dist/{cdn/chunks/de-DaOUfYBX.js → de-BLFp3nWx.js} +18 -3
  203. package/dist/{dist-C34cYI5S.js → dist-BMUUt3zJ.js} +964 -807
  204. package/dist/{editor-modal-BeX6otLk.js → editor-modal-D9HT9bD6.js} +15 -15
  205. package/dist/{en-C0pHHMiR.js → en-DGGQJGbm.js} +18 -1
  206. package/dist/en-De3uAutQ.js +1 -0
  207. package/dist/{cdn/chunks/es-CxyEKr6n.js → es-DTY9qgLv.js} +18 -3
  208. package/dist/{extensions-xCiyqSg7.js → extensions-Cm6K4SRX.js} +344 -338
  209. package/dist/{eye-ByMgHeA_.js → eye-B3psrAqd.js} +1 -1
  210. package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-L4FqO9Gp.js} +18 -3
  211. package/dist/{image-Ch8tR35K.js → image-C3yuPDxx.js} +1 -1
  212. package/dist/index.d.ts +74 -13
  213. package/dist/{info-DzSD-Wpk.js → info-DKja7A68.js} +1 -1
  214. package/dist/{ja-DfaIAoGI.js → ja-6uOXkh4v.js} +18 -1
  215. package/dist/{keys-BCqskl51.js → keys-w_VRjoMu.js} +3 -3
  216. package/dist/{link-oDn9AR2w.js → link-DhzPI4Hn.js} +1 -1
  217. package/dist/{list-C5t07dp8.js → list-DVGn7Ik2.js} +1 -1
  218. package/dist/{loader-circle-k6xvKgUB.js → loader-circle-DqKWsMHO.js} +1 -1
  219. package/dist/{message-circle-C23R6OJR.js → message-circle-C4TonoBs.js} +1 -1
  220. package/dist/{nl-DkrB-VKZ.js → nl-DCxuxwNq.js} +18 -1
  221. package/dist/normalizeMergeTagMarkup-Da9JAgx7.js +298 -0
  222. package/dist/{package-C90eQ7NU.js → package-9OkiEO4S.js} +1 -1
  223. package/dist/{pencil-BK7GrQuA.js → pencil-M9vkOB7C.js} +1 -1
  224. package/dist/{plus-Cr0Mis63.js → plus-DxZiv9YC.js} +1 -1
  225. package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CdqSp2P7.js} +4 -4
  226. package/dist/{pt-BR-CY5Ye7eP.js → pt-BR-CBkcrebr.js} +18 -1
  227. package/dist/{refresh-cw-_ZLOIEvA.js → refresh-cw-UY8_sdFG.js} +1 -1
  228. package/dist/{rotate-ccw-CB5wsHwv.js → rotate-ccw-BFTGCpHn.js} +1 -1
  229. package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-wBibnBF4.js} +6 -6
  230. package/dist/{search-BmrQNox8.js → search-RuGJnMEn.js} +1 -1
  231. package/dist/{send-blAsIBBg.js → send-DGB1ar02.js} +1 -1
  232. package/dist/{smartphone-BPpWYrwV.js → smartphone-CVA29CU_.js} +1 -1
  233. package/dist/{socialIcons-DhAolBjt.js → socialIcons-CJD6OsI7.js} +283 -269
  234. package/dist/{sparkles-OqIxrNp-.js → sparkles-IHfEwEcd.js} +1 -1
  235. package/dist/{square-BP-V7iT-.js → square-_Cl44UU6.js} +1 -1
  236. package/dist/style.css +1 -1
  237. package/dist/templatical-editor.js +851 -854
  238. package/dist/{text-align-start-4mwX2o-F.js → text-align-start-Dqk2Xt_Q.js} +13 -13
  239. package/dist/{trash-B99WixTA.js → trash-Cr7rD5Hh.js} +1 -1
  240. package/dist/{triangle-alert-CHMiDkHa.js → triangle-alert-CKcpwtUj.js} +1 -1
  241. package/dist/{upload-Cp8o-hrN.js → upload-DR9pqVON.js} +1 -1
  242. package/dist/{useCloudI18n-Dh2iydo1.js → useCloudI18n-BczJoFf4.js} +1 -1
  243. package/dist/{useEditorRoot-DY3mgcHm.js → useEditorRoot-BcXKhM_8.js} +1 -1
  244. package/dist/{useI18n-CgtvtF4C.js → useI18n-zeWYtWSv.js} +1 -1
  245. package/dist/useLocalizedDisplay-Cbhx208c.js +31 -0
  246. package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-DLkYos2Q.js} +3 -3
  247. package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-IoWOO679.js} +5 -5
  248. package/dist/{usePopoverPosition-VDQjyX_A.js → usePopoverPosition-Br3zt_MQ.js} +4 -4
  249. package/dist/{useScrollToBlock-B35ObCGK.js → useScrollToBlock-BfOzc1Z6.js} +2 -2
  250. package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-m_PHcOD0.js} +1 -1
  251. package/dist/{x-BIBStNMS.js → x-DZSFHafL.js} +1 -1
  252. package/package.json +10 -10
  253. package/dist/BlockPreviewCanvas-DtOo5y3U.js +0 -140
  254. package/dist/WrapperBlock-BUzQTZuu.js +0 -44
  255. package/dist/cdn/chunks/BlockPreviewCanvas-B6ndvof2.js.map +0 -1
  256. package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
  257. package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
  258. package/dist/cdn/chunks/WrapperBlock-C_uE5rPJ.js +0 -46
  259. package/dist/cdn/chunks/WrapperBlock-C_uE5rPJ.js.map +0 -1
  260. package/dist/cdn/chunks/ca-DOuIxWRv.js.map +0 -1
  261. package/dist/cdn/chunks/composables-BxikPuC1.js.map +0 -1
  262. package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
  263. package/dist/cdn/chunks/en-B6tLGRHq.js +0 -1
  264. package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
  265. package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
  266. package/dist/cdn/chunks/extensions-DuDWpKo7.js.map +0 -1
  267. package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
  268. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
  269. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +0 -1
  270. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
  271. package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js +0 -290
  272. package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js.map +0 -1
  273. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
  274. package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
  275. package/dist/cdn/chunks/src-B2tQbzf6.js +0 -677
  276. package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
  277. package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
  278. package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
  279. package/dist/en-Do0SU6tR.js +0 -1
  280. package/dist/normalizeMergeTagMarkup-C7FGNURu.js +0 -288
  281. package/dist/useLocalizedDisplay-C9MBFUr4.js +0 -31
@@ -1,12 +1,12 @@
1
1
  import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-DepKdldn.js";
2
- import { $t as T, A as E, At as D, Bt as O, Ft as k, Gt as A, Ht as j, It as M, Jt as N, Kt as ee, Mt as P, N as F, Nt as te, O as ne, Ot as re, P as I, Pt as L, Qt as R, Rt as z, Vt as ie, Xt as B, Yt as ae, Z as oe, Zt as V, en as H, jt as U, k as W, lt as se, n as ce, qt as le, r as ue, sn as de, tn as fe, vn as pe, xt as me, zt as he } from "./src-ZFw5fg_z.js";
3
- import { at as ge, s as _e } from "./icons-Da9GKjPx.js";
4
- import { B as ve, C as ye, U as be, u as xe } from "./keys-CoQtCqNv.js";
5
- import { t as Se } from "./useI18n-BnJYydPv.js";
6
- import { r as Ce } from "./dist-DqGgijFI.js";
7
- import { i as we, r as Te } from "./usePopoverPosition-BWAXWeBv.js";
2
+ import { $t as T, Ft as E, Gt as D, H as O, Ht as ee, I as k, It as te, Jt as A, Lt as j, Nt as ne, Pt as M, Qt as re, Rt as N, Ut as ie, Vt as P, W as F, Wt as I, Xt as ae, Yt as L, Zt as R, en as z, ft as oe, h as B, in as se, jt as V, m as ce, nn as H, p as le, rn as U, tn as W, un as ue, v as de, wt as G, xn as fe, y as pe, zt as me } from "./src-mXG-Of9A.js";
3
+ import { at as he, s as K } from "./icons-DHExFLlT.js";
4
+ import { B as ge, C as _e, W as ve, u as ye } from "./keys-BUmIvYy3.js";
5
+ import { t as be } from "./useI18n-D8s7HtTn.js";
6
+ import { r as xe } from "./dist-DqGgijFI.js";
7
+ import { i as Se, r as q } from "./usePopoverPosition-esO6wjvU.js";
8
8
  // ../core/src/localized-edit.ts
9
- var G = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ee = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => G(e) && typeof e.id == "string"), De = /* @__PURE__ */ new Set([
9
+ var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
10
10
  "id",
11
11
  "type",
12
12
  "children",
@@ -14,51 +14,51 @@ var G = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ee = (e) => Arr
14
14
  "l10n",
15
15
  "renderedHtml"
16
16
  ]);
17
- function Oe(e, t, n) {
17
+ function Te(e, t, n) {
18
18
  let r = /* @__PURE__ */ new Set();
19
19
  for (let i of n) {
20
- if (!O(i)) continue;
21
- let n = i.split("."), a = n.pop(), o = n.join("."), s = N(e, i), c = t;
20
+ if (!ie(i)) continue;
21
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = R(e, i), c = t;
22
22
  for (let [t, i] of n.entries()) {
23
23
  let a = n.slice(0, t + 1).join(".");
24
- s !== void 0 && G(c) && N(c, i) === void 0 && G(N(e, a)) && (c[i] = {}, r.add(a)), c = N(c, i);
24
+ s !== void 0 && J(c) && R(c, i) === void 0 && J(R(e, a)) && (c[i] = {}, r.add(a)), c = R(c, i);
25
25
  }
26
26
  if (Array.isArray(c)) {
27
- let e = c.findIndex((e) => G(e) && e.id === a);
27
+ let e = c.findIndex((e) => J(e) && e.id === a);
28
28
  if (e < 0) continue;
29
- s === void 0 ? c.splice(e, 1) : c[e] = H(s);
30
- } else G(c) && (s === void 0 ? delete c[a] : c[a] = H(s), o && Object.keys(c).length === 0 && N(e, o) === void 0 && Oe(e, t, [o]));
29
+ s === void 0 ? c.splice(e, 1) : c[e] = U(s);
30
+ } else J(c) && (s === void 0 ? delete c[a] : c[a] = U(s), o && Object.keys(c).length === 0 && R(e, o) === void 0 && Te(e, t, [o]));
31
31
  }
32
32
  return r;
33
33
  }
34
- function K(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
- if (G(e) && G(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !De.has(o)) && K(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
36
- else if (i && Ee(e) && Ee(t)) for (let o of t) {
34
+ function Y(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
+ 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)) && Y(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
36
+ else if (i && Ce(e) && Ce(t)) for (let o of t) {
37
37
  if (o.id.includes(".")) continue;
38
38
  let t = e.find((e) => e.id === o.id);
39
- t && K(t, o, `${n}.${o.id}`, r, i, a);
39
+ t && Y(t, o, `${n}.${o.id}`, r, i, a);
40
40
  }
41
- else T(e, t) || r.set(n, t);
41
+ else H(e, t) || r.set(n, t);
42
42
  }
43
- function q(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
43
+ function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
44
44
  let a = /* @__PURE__ */ new Map();
45
- K(e, t, "", a, e.type !== "custom", i);
46
- let o = new Set(e.type === "custom" ? V(e, r) : []), s = {}, c = {};
47
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : j(e.type, t)) && typeof r == "string" && N(e, t) !== void 0) {
45
+ Y(e, t, "", a, e.type !== "custom", i);
46
+ let o = new Set(e.type === "custom" ? z(e, r) : []), s = {}, c = {};
47
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : D(e.type, t)) && typeof r == "string" && R(e, t) !== void 0) {
48
48
  let i = n?.text?.[t];
49
49
  s[t] = i && i.value === r ? i : {
50
50
  value: r,
51
- sourceHash: B(String(N(e, t) ?? ""))
51
+ sourceHash: T(String(R(e, t) ?? ""))
52
52
  };
53
53
  } else c[t] = r === void 0 ? null : r;
54
54
  let l = {};
55
55
  return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
56
56
  }
57
- function ke(e, t, n) {
57
+ function De(e, t, n) {
58
58
  let r = !1;
59
59
  function i(e, t, n, a) {
60
- let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => G(e) && typeof e.id == "string");
61
- 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) => H(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
60
+ let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
61
+ 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) => U(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
62
  let r = e[n].find((e) => e.id === t.id);
63
63
  r && i(r, t, a);
64
64
  }
@@ -66,48 +66,48 @@ function ke(e, t, n) {
66
66
  let a = e, o = t;
67
67
  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") {
68
68
  let i = (e) => e.map((e) => e.map((e) => e.id));
69
- (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) => H(n(e.id) ?? e))));
69
+ (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) => U(n(e.id) ?? e))));
70
70
  }
71
71
  return r;
72
72
  }
73
- function J(e, t, n) {
73
+ function Oe(e, t, n) {
74
74
  let r = (e) => {
75
75
  let { locale: t, locales: n, l10n: r, ...i } = e;
76
76
  return i;
77
77
  }, i = /* @__PURE__ */ new Map();
78
- K(r(e), r(t), "", i);
78
+ Y(r(e), r(t), "", i);
79
79
  let a = {};
80
- for (let [t, r] of i) if (M.includes(t) && typeof r == "string" && N(e, t) !== void 0) {
80
+ for (let [t, r] of i) if (me.includes(t) && typeof r == "string" && R(e, t) !== void 0) {
81
81
  let i = n?.text?.[t];
82
82
  (a.text ??= {})[t] = i?.value === r ? i : {
83
83
  value: r,
84
- sourceHash: B(String(N(e, t) ?? ""))
84
+ sourceHash: T(String(R(e, t) ?? ""))
85
85
  };
86
86
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
87
87
  return a;
88
88
  }
89
- function Y(e, t, n, r, i, a = []) {
90
- let o = H(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
89
+ function ke(e, t, n, r, i, a = []) {
90
+ let o = U(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
91
91
  ...Object.keys(t.text ?? {}),
92
92
  ...Object.keys(t.set ?? {}),
93
93
  ...Object.keys(n.text ?? {}),
94
94
  ...Object.keys(n.set ?? {})
95
- ])].filter((e) => !T(t.text?.[e], n.text?.[e]) || !T(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
95
+ ])].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}.`)));
96
96
  for (let e of c) {
97
- let t = N(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && T(N(r, t), N(i, t)));
98
- if (T(t, N(r, e))) delete o.set[e];
99
- else if (n.length && G(N(r, e)) && G(t)) {
97
+ let t = R(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && H(R(r, t), R(i, t)));
98
+ if (H(t, R(r, e))) delete o.set[e];
99
+ else if (n.length && J(R(r, e)) && J(t)) {
100
100
  delete o.set[e];
101
101
  let i = (e, t, a) => {
102
102
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
103
- if (G(t) && G(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
104
- else if (G(r) && r.type !== "custom" && Ee(t) && Ee(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
105
- else G(r) && typeof r.type == "string" && ie(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : H(a));
103
+ 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]);
104
+ else if (J(r) && r.type !== "custom" && Ce(t) && Ce(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
105
+ else J(r) && typeof r.type == "string" && I(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : U(a));
106
106
  }
107
107
  };
108
- i(e, N(r, e), t);
109
- } else o.set[e] = t === void 0 ? null : H(t);
110
- for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (T(t === "text" ? o.text[n].value : o.set[n] ?? void 0, N(i, n)) || delete o[t][n]);
108
+ i(e, R(r, e), t);
109
+ } else o.set[e] = t === void 0 ? null : U(t);
110
+ for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (H(t === "text" ? o.text[n].value : o.set[n] ?? void 0, R(i, n)) || delete o[t][n]);
111
111
  }
112
112
  for (let e of s) if (!c.includes(e)) {
113
113
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
@@ -135,7 +135,7 @@ function je(e, t, n) {
135
135
  ...e.content(),
136
136
  blocks: [o]
137
137
  };
138
- W(t), E(t);
138
+ ce(t), B(t);
139
139
  }
140
140
  if (t === "removeBlock") return !0;
141
141
  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;
@@ -143,7 +143,7 @@ function je(e, t, n) {
143
143
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
144
144
  if (e.findBlock) {
145
145
  let t = e.findBlock(l);
146
- if (t?.type !== "section" || u < 0 || u >= k(t.columns)) return !1;
146
+ if (t?.type !== "section" || u < 0 || u >= N(t.columns)) return !1;
147
147
  }
148
148
  }
149
149
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
@@ -188,8 +188,8 @@ function Q(e, t) {
188
188
  }
189
189
  // ../core/src/editor.ts
190
190
  function Fe(t) {
191
- let n = t.content ?? se(t.defaultFontFamily, t.templateDefaults);
192
- W(n), E(n);
191
+ let n = t.content ?? oe(t.defaultFontFamily, t.templateDefaults);
192
+ ce(n), B(n);
193
193
  let r = e({
194
194
  template: null,
195
195
  content: n,
@@ -204,11 +204,11 @@ function Fe(t) {
204
204
  uiTheme: "auto"
205
205
  }), i = u(r, "activeLocale"), a = [];
206
206
  function o(e) {
207
- let t = z(r.content);
208
- if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new R(`This template has no "${e}" version.`, void 0, "unknown_locale");
207
+ let t = P(r.content);
208
+ if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new W(`This template has no "${e}" version.`, void 0, "unknown_locale");
209
209
  i.value = e;
210
210
  }
211
- h(() => i.value ?? z(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
211
+ h(() => i.value ?? P(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
212
212
  i.value && !r.content.settings.locales?.includes(i.value) && o(null);
213
213
  });
214
214
  function s() {
@@ -218,20 +218,20 @@ function Fe(t) {
218
218
  a = e;
219
219
  }
220
220
  function l(e) {
221
- return L(r.content, e, a);
221
+ return j(r.content, e, a);
222
222
  }
223
223
  function d(e, n) {
224
224
  if (!s()) return null;
225
- if (e === "addLocale" && (!he(n) || t.localization && !t.localization.locales.includes(n))) throw new R(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
- let i = H(r.content);
225
+ if (e === "addLocale" && (!ee(n) || t.localization && !t.localization.locales.includes(n))) throw new W(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
+ let i = U(r.content);
227
227
  return te(i, [{
228
228
  op: e,
229
229
  locale: n
230
- }]), T(i, r.content) ? null : i;
230
+ }]), H(i, r.content) ? null : i;
231
231
  }
232
232
  function f(e, t) {
233
233
  let n = d(e, t);
234
- n && (r.content = n, j());
234
+ n && (r.content = n, k());
235
235
  }
236
236
  function p(e) {
237
237
  f("addLocale", e);
@@ -249,23 +249,23 @@ function Fe(t) {
249
249
  function v(e, t) {
250
250
  let [n, o] = t;
251
251
  if (!i.value || !s() || I(n)) return null;
252
- let c = F(r.content.blocks, n);
252
+ let c = N(r.content.blocks, n);
253
253
  if (!c) return null;
254
- let l = c.l10n?.[i.value], u = A(c, i.value, z(r.content)), d = q(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Oe(c, u, o) : void 0, p = e === "resetLocaleFields" ? Y(l, d, q(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : H(l ?? {});
254
+ let l = c.l10n?.[i.value], u = A(c, i.value, P(r.content)), d = Ee(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? ke(l, d, Ee(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : U(l ?? {});
255
255
  if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
256
256
  else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
257
257
  else for (let e of o) {
258
258
  let t = p.text?.[e];
259
- t && (t.sourceHash = B(String(N(c, e) ?? "")));
259
+ t && (t.sourceHash = T(String(R(c, e) ?? "")));
260
260
  }
261
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, T(l ?? {}, p) ? null : {
261
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, H(l ?? {}, p) ? null : {
262
262
  block: c,
263
263
  layer: p
264
264
  };
265
265
  }
266
266
  function y(e, t) {
267
267
  let n = v(e, t);
268
- n && (_(n.block, n.layer), j());
268
+ n && (_(n.block, n.layer), k());
269
269
  }
270
270
  function x(e, t) {
271
271
  y("setBlockHidden", [e, t]);
@@ -276,35 +276,35 @@ function Fe(t) {
276
276
  function w(e, t) {
277
277
  y("keepTranslations", [e, t]);
278
278
  }
279
- let D = S(0), O = 0, k = 0;
280
- function j() {
281
- r.isDirty = !0, k++;
279
+ let E = S(0), D = 0, O = 0;
280
+ function k() {
281
+ r.isDirty = !0, O++;
282
282
  }
283
- let M = b({
283
+ let ne = b({
284
284
  get: () => r.content,
285
285
  set: (e) => {
286
- r.content = e, j();
286
+ r.content = e, k();
287
287
  }
288
- }), P = b(() => r.selectedBlockId ? F(r.content.blocks, r.selectedBlockId) : null);
289
- function F(e, t) {
288
+ }), M = b(() => r.selectedBlockId ? N(r.content.blocks, r.selectedBlockId) : null);
289
+ function N(e, t) {
290
290
  for (let n of e) {
291
291
  if (n.id === t) return n;
292
292
  if (n.type === "section") for (let e of n.children) {
293
- let n = F(e, t);
293
+ let n = N(e, t);
294
294
  if (n) return n;
295
295
  }
296
296
  }
297
297
  return null;
298
298
  }
299
- function ne(e, t) {
300
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ne(e, t);
299
+ function ie(e, t) {
300
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ie(e, t);
301
301
  }
302
- function re(e, t, n = { blocks: e }) {
302
+ function F(e, t, n = { blocks: e }) {
303
303
  for (let r = 0; r < e.length; r++) {
304
304
  let i = e[r];
305
305
  if (i.id === t) return n;
306
306
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
307
- let n = re(i.children[e], t, {
307
+ let n = F(i.children[e], t, {
308
308
  blocks: i.children[e],
309
309
  sectionId: i.id,
310
310
  columnIndex: e
@@ -324,8 +324,8 @@ function Fe(t) {
324
324
  }
325
325
  return !1;
326
326
  }
327
- function ie(e) {
328
- let t = re(r.content.blocks, e);
327
+ function z(e) {
328
+ let t = F(r.content.blocks, e);
329
329
  if (!t) return null;
330
330
  let n = t.blocks.findIndex((t) => t.id === e);
331
331
  return n === -1 ? null : {
@@ -334,202 +334,202 @@ function Fe(t) {
334
334
  index: n
335
335
  };
336
336
  }
337
- function oe(e, t = !0) {
338
- W(e), E(e), r.content = e, t && j();
337
+ function se(e, t = !0) {
338
+ ce(e), B(e), r.content = e, t && k();
339
339
  }
340
340
  function V(e) {
341
341
  e && I(e) || (r.selectedBlockId = e);
342
342
  }
343
- function U(e) {
343
+ function le(e) {
344
344
  r.viewport = e;
345
345
  }
346
- function ce(e) {
346
+ function ue(e) {
347
347
  r.darkMode = e;
348
348
  }
349
- function ue(e) {
349
+ function de(e) {
350
350
  r.uiTheme = e;
351
351
  }
352
- function de(e) {
352
+ function G(e) {
353
353
  r.previewMode = e, e && (r.selectedBlockId = null);
354
354
  }
355
355
  function fe(e, t) {
356
356
  if (!s()) return !1;
357
- let n = F(r.content.blocks, e);
357
+ let n = N(r.content.blocks, e);
358
358
  if (!n) return !1;
359
- if ("l10n" in t) throw new R("l10n is immutable in updateBlock.", void 0, "invalid_operation");
359
+ if ("l10n" in t) throw new W("l10n is immutable in updateBlock.", void 0, "invalid_operation");
360
360
  let i = {
361
361
  ...n,
362
362
  ...t
363
363
  };
364
- return !I(e, ke(H(n), i, (e) => F(r.content.blocks, e)));
364
+ return !I(e, De(U(n), i, (e) => N(r.content.blocks, e)));
365
365
  }
366
366
  function pe(e, n) {
367
367
  if (!fe(e, n)) return;
368
- let o = F(r.content.blocks, e);
368
+ let o = N(r.content.blocks, e);
369
369
  if (!o) return;
370
370
  let s = i.value;
371
371
  if (s) {
372
- let i = A(o, s, z(r.content)), c = {
372
+ let i = A(o, s, P(r.content)), c = {
373
373
  ...i,
374
374
  ...n
375
- }, l = H(o), u = ke(l, c, (e) => F(r.content.blocks, e));
375
+ }, l = U(o), u = De(l, c, (e) => N(r.content.blocks, e));
376
376
  if (I(e, u)) return;
377
377
  u && t.onStructureChange?.();
378
- let d = ee(l);
379
- delete o.l10n, Object.assign(o, d), _(o, Y(o.l10n?.[s], q(o, i, o.l10n?.[s], a), q(o, c, o.l10n?.[s], a), o, c));
378
+ let d = L(l);
379
+ delete o.l10n, Object.assign(o, d), _(o, ke(o.l10n?.[s], Ee(o, i, o.l10n?.[s], a), Ee(o, c, o.l10n?.[s], a), o, c));
380
380
  } else {
381
381
  if (I(e, "children" in n || "columns" in n)) return;
382
- let t = ee({
382
+ let t = L({
383
383
  ...o,
384
384
  ...n
385
385
  });
386
386
  delete o.l10n, Object.assign(o, t);
387
387
  }
388
- j();
388
+ k();
389
389
  }
390
390
  function me(e) {
391
- if ("locales" in e || "l10n" in e) throw new R("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
392
- if ("locale" in e && e.locale !== z(r.content) && r.content.settings.locales?.length) throw new R("The default locale can't change while language versions exist.", void 0, "invalid_operation");
391
+ if ("locales" in e || "l10n" in e) throw new W("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
392
+ if ("locale" in e && e.locale !== P(r.content) && r.content.settings.locales?.length) throw new W("The default locale can't change while language versions exist.", void 0, "invalid_operation");
393
393
  }
394
- function ge(e) {
394
+ function he(e) {
395
395
  if (!s()) return;
396
396
  me(e);
397
397
  let t = i.value;
398
- if (!t) r.content.settings = le({
398
+ if (!t) r.content.settings = ae({
399
399
  ...r.content.settings,
400
400
  ...e
401
401
  });
402
402
  else {
403
- let n = r.content.settings, i = ae(r.content, t).settings, a = {
403
+ let n = r.content.settings, i = re(r.content, t).settings, a = {
404
404
  ...i,
405
405
  locale: n.locale,
406
406
  ...e
407
- }, o = n.l10n?.[t], s = Y(o, J(n, i, o), J(n, a, o), n, a);
407
+ }, o = n.l10n?.[t], s = ke(o, Oe(n, i, o), Oe(n, a, o), n, a);
408
408
  Object.keys(s).length ? n.l10n = {
409
409
  ...n.l10n,
410
410
  [t]: s
411
411
  } : n.l10n && (delete n.l10n[t], Object.keys(n.l10n).length || delete n.l10n);
412
412
  }
413
- j();
413
+ k();
414
414
  }
415
- let _e = {
415
+ let K = {
416
416
  canEdit: s,
417
417
  content: () => r.content,
418
- findBlock: (e) => F(r.content.blocks, e),
419
- findBlockLocation: ie,
418
+ findBlock: (e) => N(r.content.blocks, e),
419
+ findBlockLocation: z,
420
420
  isBlockLocked: I
421
421
  };
422
- function ve(e, n, a = 0, o) {
423
- if (je(_e, "addBlock", [
422
+ function ge(e, n, a = 0, o) {
423
+ if (je(K, "addBlock", [
424
424
  e,
425
425
  n,
426
426
  a,
427
427
  o
428
428
  ])) {
429
429
  if (n) {
430
- let t = F(r.content.blocks, n);
430
+ let t = N(r.content.blocks, n);
431
431
  if (t && t.type === "section") {
432
432
  t.children[a] = t.children[a] || [];
433
433
  let n = t.children[a];
434
434
  o !== void 0 && o < n.length ? n.splice(o, 0, e) : n.push(e);
435
435
  }
436
436
  } else o !== void 0 && o < r.content.blocks.length ? r.content.blocks.splice(o, 0, e) : r.content.blocks.push(e);
437
- i.value && t.onStructureChange?.(), j();
437
+ i.value && t.onStructureChange?.(), k();
438
438
  }
439
439
  }
440
- function ye(e) {
441
- if (!je(_e, "removeBlock", [e])) return;
442
- let n = re(r.content.blocks, e);
440
+ function _e(e) {
441
+ if (!je(K, "removeBlock", [e])) return;
442
+ let n = F(r.content.blocks, e);
443
443
  if (n) {
444
444
  let a = n.blocks.findIndex((t) => t.id === e);
445
445
  if (a !== -1) {
446
446
  let [e] = n.blocks.splice(a, 1);
447
447
  if (r.selectedBlockId) {
448
448
  let t = /* @__PURE__ */ new Set();
449
- ne(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
449
+ ie(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
450
450
  }
451
- i.value && t.onStructureChange?.(), j();
451
+ i.value && t.onStructureChange?.(), k();
452
452
  }
453
453
  }
454
454
  }
455
- function be(e, n, a, o = 0) {
456
- if (!je(_e, "moveBlock", [
455
+ function ve(e, n, a, o = 0) {
456
+ if (!je(K, "moveBlock", [
457
457
  e,
458
458
  n,
459
459
  a,
460
460
  o
461
461
  ])) return;
462
- let s = re(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
462
+ let s = F(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
463
463
  if (a) {
464
- let e = F(r.content.blocks, a);
464
+ let e = N(r.content.blocks, a);
465
465
  e.children[o] = e.children[o] || [], l = e.children[o];
466
466
  } else l = r.content.blocks;
467
467
  let [u] = s.blocks.splice(c, 1);
468
- l.splice(n, 0, u), i.value && t.onStructureChange?.(), j();
468
+ l.splice(n, 0, u), i.value && t.onStructureChange?.(), k();
469
469
  }
470
- function xe() {
471
- j();
470
+ function ye() {
471
+ k();
472
472
  }
473
- function Se(e, t) {
474
- throw new R(`[Templatical] Templates: ${e} ${t}`);
473
+ function be(e, t) {
474
+ throw new W(`[Templatical] Templates: ${e} ${t}`);
475
475
  }
476
- function Ce(e) {
476
+ function xe(e) {
477
477
  Q(t.onError, e);
478
478
  }
479
- function we(e) {
479
+ function Se(e) {
480
480
  let { templates: n } = t;
481
- return n || Se(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
481
+ return n || be(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
482
482
  }
483
- function Te(e) {
483
+ function q(e) {
484
484
  r.template && (r.template = {
485
485
  ...r.template,
486
486
  name: e
487
- }, j());
487
+ }, k());
488
488
  }
489
- async function G(e) {
490
- let n = we("create()"), { create: i } = n;
491
- typeof i != "function" && Se("create()", "is disabled by the provider — its `create` is `false`.");
492
- let a, o = ++O;
489
+ async function J(e) {
490
+ let n = Se("create()"), { create: i } = n;
491
+ typeof i != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
492
+ let a, o = ++D;
493
493
  r.isLoading = !0;
494
494
  try {
495
495
  e?.content && (r.content = e.content);
496
- let t = k;
496
+ let t = O;
497
497
  a = await i(e?.name === void 0 ? { content: r.content } : {
498
498
  name: e.name,
499
499
  content: r.content
500
- }), r.template = a, k === t && (r.isDirty = !1), D.value++;
500
+ }), r.template = a, O === t && (r.isDirty = !1), E.value++;
501
501
  } catch (e) {
502
502
  throw t.onError?.(e), e;
503
503
  } finally {
504
- O === o && (r.isLoading = !1);
504
+ D === o && (r.isLoading = !1);
505
505
  }
506
- return Ce(() => n.onCreated?.(a)), a;
506
+ return xe(() => n.onCreated?.(a)), a;
507
507
  }
508
- async function Ee(e, n) {
509
- let i = we("load()"), a, o = ++O;
508
+ async function Ce(e, n) {
509
+ let i = Se("load()"), a, o = ++D;
510
510
  r.isLoading = !0;
511
511
  try {
512
- if (a = await i.load(e), W(a.content), E(a.content), n && !n()) return a;
513
- r.template = a, r.content = a.content, r.isDirty = !1, D.value++;
512
+ if (a = await i.load(e), ce(a.content), B(a.content), n && !n()) return a;
513
+ r.template = a, r.content = a.content, r.isDirty = !1, E.value++;
514
514
  } catch (e) {
515
515
  throw t.onError?.(e), e;
516
516
  } finally {
517
- O === o && (r.isLoading = !1);
517
+ D === o && (r.isLoading = !1);
518
518
  }
519
- return Ce(() => i.onLoaded?.(a)), a;
519
+ return xe(() => i.onLoaded?.(a)), a;
520
520
  }
521
- async function De(e = "api") {
522
- let n = we("save()"), { save: i } = n;
523
- typeof i != "function" && Se("save()", "is disabled by the provider — its `save` is `false`.");
521
+ async function we(e = "api") {
522
+ let n = Se("save()"), { save: i } = n;
523
+ typeof i != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
524
524
  let a = r.template;
525
- a || Se("save()", "has no template loaded. Call create() or load() first.");
525
+ a || be("save()", "has no template loaded. Call create() or load() first.");
526
526
  let o = a.name === void 0 ? { content: r.content } : {
527
527
  name: a.name,
528
528
  content: r.content
529
529
  }, s;
530
530
  r.isSaving = !0;
531
531
  try {
532
- let e = k;
532
+ let e = O;
533
533
  if (s = await i(a.id, o), r.template?.id === a.id) {
534
534
  let e = r.template.name;
535
535
  r.template = e === a.name ? s : {
@@ -537,22 +537,22 @@ function Fe(t) {
537
537
  name: e
538
538
  };
539
539
  }
540
- k === e && (r.isDirty = !1);
540
+ O === e && (r.isDirty = !1);
541
541
  } catch (e) {
542
542
  throw t.onError?.(e), e;
543
543
  } finally {
544
544
  r.isSaving = !1;
545
545
  }
546
- return Ce(() => n.onSaved?.(s, { trigger: e })), s;
546
+ return xe(() => n.onSaved?.(s, { trigger: e })), s;
547
547
  }
548
- function K() {
548
+ function Y() {
549
549
  return r.template?.id !== void 0;
550
550
  }
551
551
  let X = {
552
552
  state: m(r),
553
- loadVersion: m(D),
554
- content: M,
555
- selectedBlock: P,
553
+ loadVersion: m(E),
554
+ content: ne,
555
+ selectedBlock: M,
556
556
  activeLocale: i,
557
557
  setActiveLocale: o,
558
558
  addLocale: p,
@@ -563,33 +563,33 @@ function Fe(t) {
563
563
  setCustomBlockDefinitions: c,
564
564
  createSetDefaultLocaleOperation: l,
565
565
  isBlockLocked: I,
566
- setContent: oe,
566
+ setContent: se,
567
567
  selectBlock: V,
568
- setViewport: U,
569
- setDarkMode: ce,
570
- setUiTheme: ue,
571
- setPreviewMode: de,
568
+ setViewport: le,
569
+ setDarkMode: ue,
570
+ setUiTheme: de,
571
+ setPreviewMode: G,
572
572
  updateBlock: pe,
573
- updateSettings: ge,
574
- addBlock: ve,
575
- removeBlock: ye,
576
- moveBlock: be,
577
- markDirty: xe,
578
- findBlockLocation: ie,
579
- setName: Te,
580
- create: G,
581
- load: Ee,
582
- save: De,
583
- hasTemplate: K
573
+ updateSettings: he,
574
+ addBlock: ge,
575
+ removeBlock: _e,
576
+ moveBlock: ve,
577
+ markDirty: ye,
578
+ findBlockLocation: z,
579
+ setName: q,
580
+ create: J,
581
+ load: Ce,
582
+ save: we,
583
+ hasTemplate: Y
584
584
  };
585
- return Me(X, (e, t) => Ae(e) ? je(_e, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
585
+ return Me(X, (e, t) => Ae(e) ? je(K, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
586
586
  }
587
587
  // ../core/src/history.ts
588
588
  var Ie = 50, Le = 300, Re = 1500;
589
589
  function ze(e) {
590
590
  let { content: t, setContent: n, maxSize: r = Ie } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
591
591
  function d() {
592
- return H(t.value);
592
+ return U(t.value);
593
593
  }
594
594
  function f(e) {
595
595
  i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
@@ -650,11 +650,11 @@ function ze(e) {
650
650
  function Be(e) {
651
651
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
652
652
  function o(n, r, a) {
653
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = I(n, o);
653
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = pe(n, o);
654
654
  return t(s, r, a), i(s.id), s;
655
655
  }
656
656
  function s(e, n, r) {
657
- let o = F(e);
657
+ let o = de(e);
658
658
  if (!Z(t, "duplicateBlock", [
659
659
  e,
660
660
  n,
@@ -859,7 +859,7 @@ function et(e) {
859
859
  }
860
860
  function tt(e, t, n) {
861
861
  let r = {}, i = [];
862
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || T(e[i], t[i]) || (r[i] = H(t[i]));
862
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || H(e[i], t[i]) || (r[i] = U(t[i]));
863
863
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
864
864
  return {
865
865
  set: r,
@@ -878,7 +878,7 @@ function nt(e = {}, t = {}) {
878
878
  function rt(e, t) {
879
879
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
880
880
  op: "setContent",
881
- content: H(t)
881
+ content: U(t)
882
882
  }];
883
883
  let n = $e(e.blocks), r = $e(t.blocks), i = [], a = (e) => {
884
884
  let t = r.get(e), i = n.get(e);
@@ -896,8 +896,8 @@ function rt(e, t) {
896
896
  };
897
897
  for (let t of e.blocks) u(t, "kept");
898
898
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
899
- let t = H(e);
900
- return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => H(e)) : e)), t;
899
+ let t = U(e);
900
+ return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => U(e)) : e)), t;
901
901
  }, p = (e, t, r) => {
902
902
  let a = Ze(e), o = [], s = [];
903
903
  t.forEach((e, t) => {
@@ -1037,41 +1037,41 @@ function st(e, t, n) {
1037
1037
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1038
1038
  }
1039
1039
  function ct(e) {
1040
- let t = H(e);
1040
+ let t = U(e);
1041
1041
  return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(ct))), t;
1042
1042
  }
1043
1043
  function lt(e, t, n, r) {
1044
- let i = ae(e, t), a = H(e), o = H(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1044
+ let i = re(e, t), a = U(e), o = U(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1045
1045
  for (let [i, a] of $(n)) c.set(i, {
1046
- initial: A(a, t, z(e)),
1046
+ initial: A(a, t, P(e)),
1047
1047
  added: r,
1048
1048
  changed: !1
1049
1049
  });
1050
1050
  };
1051
1051
  l(i.blocks, !1);
1052
1052
  let u = [], d = (e, t, n) => {
1053
- if (t.some((e) => e?.op === "setDefaultLocale")) throw new U("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1054
- if (t.some((e) => e?.op === "setContent")) throw new U("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1053
+ if (t.some((e) => e?.op === "setDefaultLocale")) throw new M("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1054
+ if (t.some((e) => e?.op === "setContent")) throw new M("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1055
1055
  try {
1056
- return P(e, t);
1056
+ return E(e, t);
1057
1057
  } catch (e) {
1058
- throw e instanceof U ? new U(e.code, n, e.message, e.blockId) : e;
1058
+ throw e instanceof M ? new M(e.code, n, e.message, e.blockId) : e;
1059
1059
  }
1060
1060
  }, f = (e, t) => {
1061
1061
  a = d(a, e, t), u.push(...e);
1062
1062
  }, p = (e, n) => {
1063
1063
  let o = c.get(e);
1064
1064
  if (!o?.changed) return;
1065
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = H(a), d = it(u, at(u, e).parent), p = H(s);
1065
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = U(a), d = it(u, at(u, e).parent), p = U(s);
1066
1066
  if (o.added) p = ct(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
1067
1067
  else {
1068
- ke(p, p.type === "section" ? {
1068
+ De(p, p.type === "section" ? {
1069
1069
  ...l,
1070
1070
  children: p.children,
1071
1071
  columns: p.columns
1072
- } : l, (e) => $(a.blocks).get(e) ?? null), p = ee(p);
1072
+ } : l, (e) => $(a.blocks).get(e) ?? null), p = L(p);
1073
1073
  let e = p.l10n?.[t];
1074
- st(p, t, Y(e, q(p, o.initial, e, r), q(p, l, e, r), p, l));
1074
+ st(p, t, ke(e, Ee(p, o.initial, e, r), Ee(p, l, e, r), p, l));
1075
1075
  }
1076
1076
  d[d.findIndex((t) => t.id === e)] = p, f(rt(a, u), n), o.changed = !1;
1077
1077
  }, m = (e, t, n) => {
@@ -1092,7 +1092,7 @@ function lt(e, t, n, r) {
1092
1092
  op: "updateBlock",
1093
1093
  blockId: e.blockId,
1094
1094
  set: { columns: i.columns },
1095
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, N(u, e) ?? null])) } : {}
1095
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, R(u, e) ?? null])) } : {}
1096
1096
  }], n);
1097
1097
  };
1098
1098
  n.forEach((e, t) => {
@@ -1137,8 +1137,8 @@ function lt(e, t, n, r) {
1137
1137
  });
1138
1138
  for (let e of c.keys()) p(e, n.length - 1);
1139
1139
  if (s) {
1140
- let e = H(a), r = e.settings.l10n?.[t];
1141
- st(e.settings, t, Y(r, J(e.settings, o, r), J(e.settings, i.settings, r), e.settings, i.settings)), f(rt(a, e), n.length - 1);
1140
+ let e = U(a), r = e.settings.l10n?.[t];
1141
+ st(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(rt(a, e), n.length - 1);
1142
1142
  }
1143
1143
  return u;
1144
1144
  }
@@ -1194,14 +1194,14 @@ function St(e) {
1194
1194
  });
1195
1195
  }
1196
1196
  function Ct(e) {
1197
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, E = !1, O = null, k = 0, A = !1, j = [], M = null, N = null, ee = Promise.resolve(), F = null, ne = b(() => (v?.undo.length ?? 0) > 0), re = b(() => (v?.redo.length ?? 0) > 0);
1198
- function I(t) {
1197
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, D = null, O = 0, ee = !1, k = [], A = null, j = null, re = Promise.resolve(), N = null, ie = b(() => (v?.undo.length ?? 0) > 0), P = b(() => (v?.redo.length ?? 0) > 0);
1198
+ function F(t) {
1199
1199
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1200
1200
  }
1201
- function L(t, n = v) {
1202
- n !== v || A || e.onNotice?.(t);
1201
+ function I(t, n = v) {
1202
+ n !== v || ee || e.onNotice?.(t);
1203
1203
  }
1204
- function R() {
1204
+ function ae() {
1205
1205
  return {
1206
1206
  locks: [...s.value.values()].map((e) => ({
1207
1207
  blockId: e.blockId,
@@ -1211,13 +1211,13 @@ function Ct(e) {
1211
1211
  session: n
1212
1212
  };
1213
1213
  }
1214
- function z() {
1214
+ function L() {
1215
1215
  g.value++;
1216
1216
  }
1217
- function ie(e, t) {
1217
+ function R(e, t) {
1218
1218
  e.push(t), e.length > r && e.splice(0, e.length - r);
1219
1219
  }
1220
- function B(e) {
1220
+ function z(e) {
1221
1221
  if (!_ || y) return;
1222
1222
  C = !0;
1223
1223
  try {
@@ -1225,85 +1225,85 @@ function Ct(e) {
1225
1225
  if (n.length > 0) try {
1226
1226
  te(t, n);
1227
1227
  } catch {
1228
- _.setContent(H(e), !1);
1228
+ _.setContent(U(e), !1);
1229
1229
  }
1230
- T(_.content.value, e) || _.setContent(H(e), !1);
1230
+ H(_.content.value, e) || _.setContent(U(e), !1);
1231
1231
  } finally {
1232
1232
  C = !1;
1233
1233
  }
1234
1234
  let t = _.state.selectedBlockId;
1235
1235
  t && !bt(e.blocks, t) && _.selectBlock(null);
1236
1236
  }
1237
- function ae() {
1238
- C || E || (E = !0, queueMicrotask(() => {
1239
- E = !1, V(!1);
1237
+ function oe() {
1238
+ C || T || (T = !0, queueMicrotask(() => {
1239
+ T = !1, se(!1);
1240
1240
  }));
1241
1241
  }
1242
- function oe() {
1243
- O &&= (clearTimeout(O), null);
1242
+ function B() {
1243
+ D &&= (clearTimeout(D), null);
1244
1244
  }
1245
- function V(e, t = !1) {
1245
+ function se(e, t = !1) {
1246
1246
  let n = v;
1247
1247
  if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1248
1248
  let r = rt(n.view, _.content.value);
1249
- if (r.length === 0) oe();
1249
+ if (r.length === 0) B();
1250
1250
  else {
1251
1251
  if (!e && xt(r)) {
1252
1252
  let e = Date.now();
1253
- if (O === null && (k = e), e - k < 1e3) {
1254
- O && clearTimeout(O), O = setTimeout(() => {
1255
- O = null, V(!0);
1253
+ if (D === null && (O = e), e - O < 1e3) {
1254
+ D && clearTimeout(D), D = setTimeout(() => {
1255
+ D = null, se(!0);
1256
1256
  }, 300);
1257
1257
  return;
1258
1258
  }
1259
1259
  }
1260
- oe(), se(n, r);
1260
+ B(), ce(n, r);
1261
1261
  }
1262
1262
  }
1263
- function W() {
1264
- V(!0);
1263
+ function V() {
1264
+ se(!0);
1265
1265
  }
1266
- function se(e, t) {
1266
+ function ce(e, t) {
1267
1267
  let n = t, r;
1268
1268
  try {
1269
- r = P(e.view, n, R());
1269
+ r = E(e.view, n, ae());
1270
1270
  } catch (n) {
1271
- if (!(n instanceof U)) throw n;
1272
- B(e.view);
1271
+ if (!(n instanceof M)) throw n;
1272
+ z(e.view);
1273
1273
  let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
1274
1274
  let r = t[n.opIndex];
1275
1275
  return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
1276
1276
  })?.holder;
1277
- L({
1277
+ I({
1278
1278
  type: "editRefused",
1279
1279
  code: n.code,
1280
1280
  ...r ? { holder: r } : {}
1281
- }), n.code === "invalid_operation" && I(n);
1281
+ }), n.code === "invalid_operation" && F(n);
1282
1282
  return;
1283
1283
  }
1284
1284
  let i = _.content.value;
1285
- if (!T(r, i)) {
1286
- I(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1285
+ if (!H(r, i)) {
1286
+ F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1287
1287
  op: "setContent",
1288
- content: H(i)
1288
+ content: U(i)
1289
1289
  }];
1290
1290
  try {
1291
- r = P(e.view, n, R());
1291
+ r = E(e.view, n, ae());
1292
1292
  } catch (t) {
1293
- if (!(t instanceof U)) throw t;
1294
- B(e.view), L({
1293
+ if (!(t instanceof M)) throw t;
1294
+ z(e.view), I({
1295
1295
  type: "editRefused",
1296
1296
  code: t.code
1297
1297
  });
1298
1298
  return;
1299
1299
  }
1300
1300
  }
1301
- let a = gt({ ops: D(e.view, n) }, r);
1302
- ie(e.undo, a), e.redo = [], z();
1301
+ let a = gt({ ops: ne(e.view, n) }, r);
1302
+ R(e.undo, a), e.redo = [], L();
1303
1303
  let o = e.view;
1304
- e.view = r, ce(e, n, "edit", a, o);
1304
+ e.view = r, le(e, n, "edit", a, o);
1305
1305
  }
1306
- function ce(e, t, n, r, i) {
1306
+ function le(e, t, n, r, i) {
1307
1307
  let a = { dropped: !1 }, o = 0, s = i;
1308
1308
  do {
1309
1309
  let i = t.slice(o, o + mt);
@@ -1317,17 +1317,17 @@ function Ct(e) {
1317
1317
  revision: null,
1318
1318
  ...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
1319
1319
  }), o += mt, s && t.slice(o).some((e) => e.op === "setContent")) try {
1320
- s = P(s, i);
1320
+ s = E(s, i);
1321
1321
  } catch {
1322
1322
  s = null;
1323
1323
  }
1324
1324
  } while (o < t.length);
1325
- le(e);
1325
+ W(e);
1326
1326
  }
1327
- function le(e) {
1327
+ function W(e) {
1328
1328
  if (e.inFlight || w) return;
1329
1329
  let t = e.pending.find((e) => !e.sent);
1330
- t ? (t.sent = !0, e.inFlight = t, ue(e, t, 0)) : ge(e);
1330
+ t ? (t.sent = !0, e.inFlight = t, ue(e, t, 0)) : he(e);
1331
1331
  }
1332
1332
  function ue(e, n, r) {
1333
1333
  t.submit(e.templateId, {
@@ -1336,125 +1336,125 @@ function Ct(e) {
1336
1336
  ops: n.ops,
1337
1337
  ...n.origin === "ai" ? { origin: "ai" } : {}
1338
1338
  }).then(({ revision: t }) => {
1339
- e.inFlight = null, de(e, n, t), le(e);
1339
+ e.inFlight = null, de(e, n, t), W(e);
1340
1340
  }, (t) => {
1341
- if (_t(t) !== null) e.inFlight = null, he(e, n, t), le(e);
1341
+ if (_t(t) !== null) e.inFlight = null, me(e, n, t), W(e);
1342
1342
  else if (yt(t)) {
1343
- _e(e, t);
1343
+ K(e, t);
1344
1344
  let i = ft[Math.min(r, ft.length - 1)];
1345
1345
  setTimeout(() => {
1346
- A || ue(e, n, r + 1);
1346
+ ee || ue(e, n, r + 1);
1347
1347
  }, i);
1348
- } else e.inFlight = null, I(t), he(e, n, t), le(e);
1348
+ } else e.inFlight = null, F(t), me(e, n, t), W(e);
1349
1349
  });
1350
1350
  }
1351
1351
  function de(e, t, n) {
1352
- t.revision === null && (t.revision = n, n <= e.revision ? (fe(e, t), xe(e)) : (e.own.set(n, t), be(e)));
1352
+ t.revision === null && (t.revision = n, n <= e.revision ? (G(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
1353
1353
  }
1354
- function fe(e, t) {
1355
- e.pending = e.pending.filter((e) => e !== t), ge(e);
1354
+ function G(e, t) {
1355
+ e.pending = e.pending.filter((e) => e !== t), he(e);
1356
1356
  }
1357
- function pe(e, t) {
1357
+ function fe(e, t) {
1358
1358
  if (t.entry) {
1359
1359
  for (let n of [e.undo, e.redo]) {
1360
1360
  let e = n.indexOf(t.entry);
1361
1361
  e !== -1 && n.splice(e, 1);
1362
1362
  }
1363
- z();
1363
+ L();
1364
1364
  }
1365
1365
  }
1366
- function me(e, t) {
1366
+ function pe(e, t) {
1367
1367
  let n = !t.group.dropped;
1368
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && pe(e, t), ge(e), n;
1368
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && fe(e, t), he(e), n;
1369
1369
  }
1370
- function he(e, t, n) {
1371
- if (fe(e, t), me(e, t)) {
1370
+ function me(e, t, n) {
1371
+ if (G(e, t), pe(e, t)) {
1372
1372
  let r = _t(n) ?? "invalid_operation";
1373
1373
  if (t.origin === "edit" || t.origin === "ai") {
1374
1374
  let t = vt(n);
1375
- L({
1375
+ I({
1376
1376
  type: "editRefused",
1377
1377
  code: r,
1378
1378
  ...t ? { holder: t } : {}
1379
1379
  }, e);
1380
- } else L({
1380
+ } else I({
1381
1381
  type: "undoSkipped",
1382
1382
  code: r
1383
1383
  }, e);
1384
1384
  }
1385
- xe(e), e === v && Te();
1385
+ ye(e), e === v && q();
1386
1386
  }
1387
- function ge(e) {
1387
+ function he(e) {
1388
1388
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
1389
1389
  }
1390
- function _e(e, t) {
1390
+ function K(e, t) {
1391
1391
  let n = t instanceof Error ? t : Error(String(t));
1392
1392
  for (let t of e.waiters.splice(0)) t.reject(n);
1393
1393
  }
1394
- function ve(e, t) {
1394
+ function ge(e, t) {
1395
1395
  if (t.revision <= e.revision) return;
1396
1396
  let n = e.pending.find((e) => e.batchId === t.batchId);
1397
- n ? de(e, n, t.revision) : (e.remote.set(t.revision, t), be(e));
1397
+ n ? de(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
1398
1398
  }
1399
- function ye(t, n) {
1399
+ function _e(t, n) {
1400
1400
  let r = n.ops;
1401
1401
  if (e.normalizeRemoteOperations) try {
1402
1402
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
1403
1403
  } catch (e) {
1404
- I(e);
1404
+ F(e);
1405
1405
  }
1406
1406
  return St(r);
1407
1407
  }
1408
- function be(t) {
1408
+ function ve(t) {
1409
1409
  let n = [], r = !1;
1410
1410
  for (;;) {
1411
1411
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1412
1412
  if (!i && !a) break;
1413
1413
  try {
1414
- t.confirmed = P(t.confirmed, i ? ye(t, i) : a.ops);
1414
+ t.confirmed = E(t.confirmed, i ? _e(t, i) : a.ops);
1415
1415
  } catch {
1416
1416
  if (t.recovering) {
1417
- t.remote.clear(), t.own.clear(), I(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1417
+ t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1418
1418
  return;
1419
1419
  }
1420
- G(t);
1420
+ J(t);
1421
1421
  return;
1422
1422
  }
1423
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), fe(t, a));
1423
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), G(t, a));
1424
1424
  }
1425
- if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? Ce(t) : we(t), (n.length !== 0 || r) && (xe(t), t === v)) for (let t of n) try {
1425
+ if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === v)) for (let t of n) try {
1426
1426
  e.onRemoteChange?.({
1427
1427
  actor: t.actor,
1428
1428
  ops: t.ops,
1429
1429
  locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
1430
1430
  });
1431
1431
  } catch (e) {
1432
- I(e);
1432
+ F(e);
1433
1433
  }
1434
1434
  }
1435
- function xe(e) {
1435
+ function ye(e) {
1436
1436
  let t = !w;
1437
1437
  w = !0;
1438
1438
  try {
1439
- Se(e);
1439
+ be(e);
1440
1440
  } finally {
1441
1441
  t && (w = !1);
1442
1442
  }
1443
- t && le(e);
1443
+ t && W(e);
1444
1444
  }
1445
- function Se(e) {
1446
- e === v && W();
1445
+ function be(e) {
1446
+ e === v && V();
1447
1447
  let t = e.confirmed;
1448
1448
  for (let n = 0; n < e.pending.length; n++) {
1449
1449
  let r = e.pending[n], i;
1450
- if (r.base && !T(r.base, t)) i = "precondition_failed";
1450
+ if (r.base && !H(r.base, t)) i = "precondition_failed";
1451
1451
  else try {
1452
- t = P(t, r.ops);
1452
+ t = E(t, r.ops);
1453
1453
  continue;
1454
1454
  } catch (e) {
1455
- i = e instanceof U ? e.code : "invalid_operation";
1455
+ i = e instanceof M ? e.code : "invalid_operation";
1456
1456
  }
1457
- r.sent || (me(e, r) && L(r.origin === "edit" || r.origin === "ai" ? {
1457
+ r.sent || (pe(e, r) && I(r.origin === "edit" || r.origin === "ai" ? {
1458
1458
  type: "editRefused",
1459
1459
  code: i
1460
1460
  } : {
@@ -1462,54 +1462,54 @@ function Ct(e) {
1462
1462
  code: i
1463
1463
  }, e), t = e.confirmed, n = -1);
1464
1464
  }
1465
- e.view = t, ge(e), e === v && B(t);
1465
+ e.view = t, he(e), e === v && z(t);
1466
1466
  }
1467
- function Ce(e) {
1467
+ function xe(e) {
1468
1468
  e.gapTimer ||= setTimeout(() => {
1469
- e.gapTimer = null, e === v && Te();
1469
+ e.gapTimer = null, e === v && q();
1470
1470
  }, ut);
1471
1471
  }
1472
- function we(e) {
1472
+ function Se(e) {
1473
1473
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1474
1474
  }
1475
- function Te() {
1475
+ function q() {
1476
1476
  let e = v;
1477
1477
  return e ? (e.catchingUp ||= (async () => {
1478
1478
  try {
1479
1479
  let n = await t.operationsAfter(e.templateId, e.revision);
1480
1480
  if (e.retired) return;
1481
1481
  if ("resync" in n) {
1482
- await G(e);
1482
+ await J(e);
1483
1483
  return;
1484
1484
  }
1485
- for (let t of n.batches) ve(e, t);
1485
+ for (let t of n.batches) ge(e, t);
1486
1486
  } catch (e) {
1487
- I(e);
1487
+ F(e);
1488
1488
  } finally {
1489
1489
  e.catchingUp = null;
1490
1490
  }
1491
1491
  })(), e.catchingUp) : Promise.resolve();
1492
1492
  }
1493
- async function G(t) {
1493
+ async function J(t) {
1494
1494
  t.recovering = !0;
1495
1495
  try {
1496
1496
  let n = await e.loadTemplate(t.templateId);
1497
1497
  if (t.retired) return;
1498
1498
  let r = n.revision ?? t.revision;
1499
- t.confirmed = H(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1500
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), fe(t, n));
1501
- t === v && (m.value = r), xe(t), be(t);
1499
+ t.confirmed = U(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1500
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), G(t, n));
1501
+ t === v && (m.value = r), ye(t), ve(t);
1502
1502
  } catch (e) {
1503
- I(e);
1503
+ F(e);
1504
1504
  } finally {
1505
1505
  t.recovering = !1;
1506
1506
  }
1507
1507
  }
1508
- function Ee(t) {
1508
+ function Ce(t) {
1509
1509
  let n = () => t === v && !t.retired;
1510
1510
  return {
1511
1511
  onBatch: (e) => {
1512
- n() && ve(t, e);
1512
+ n() && ge(t, e);
1513
1513
  },
1514
1514
  onResync: (r, i) => {
1515
1515
  if (!(!n() || r <= t.revision)) {
@@ -1519,9 +1519,9 @@ function Ct(e) {
1519
1519
  actor: i
1520
1520
  });
1521
1521
  } catch (e) {
1522
- I(e);
1522
+ F(e);
1523
1523
  }
1524
- Te();
1524
+ q();
1525
1525
  }
1526
1526
  },
1527
1527
  onLock: (e) => {
@@ -1534,23 +1534,23 @@ function Ct(e) {
1534
1534
  n() && Z(e);
1535
1535
  },
1536
1536
  onConnectionChange: (e) => {
1537
- n() && q(t, e);
1537
+ n() && Ee(t, e);
1538
1538
  }
1539
1539
  };
1540
1540
  }
1541
- function De(e, r) {
1541
+ function we(e, r) {
1542
1542
  let i = d;
1543
- t.join(e.templateId, { sessionId: n }, Ee(e)).then((t) => {
1544
- e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && Te(), r && Q());
1545
- }, (e) => I(e));
1543
+ t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
1544
+ e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && q(), r && Q());
1545
+ }, (e) => F(e));
1546
1546
  }
1547
- function Oe(e) {
1548
- let t = H(e.content), n = {
1547
+ function Te(e) {
1548
+ let t = U(e.content), n = {
1549
1549
  templateId: e.id,
1550
1550
  confirmed: t,
1551
1551
  revision: e.revision ?? 0,
1552
1552
  pending: [],
1553
- view: H(t),
1553
+ view: U(t),
1554
1554
  remote: /* @__PURE__ */ new Map(),
1555
1555
  own: /* @__PURE__ */ new Map(),
1556
1556
  inFlight: null,
@@ -1563,49 +1563,49 @@ function Ct(e) {
1563
1563
  redo: [],
1564
1564
  waiters: []
1565
1565
  };
1566
- v = n, m.value = n.revision, z(), De(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), ae();
1566
+ v = n, m.value = n.revision, L(), we(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), oe();
1567
1567
  }
1568
- function K(e) {
1569
- e.retired = !0, we(e), e.leave?.(), e.leave = null, _e(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1568
+ function Y(e) {
1569
+ e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1570
1570
  }
1571
- function q(e, t) {
1571
+ function Ee(e, t) {
1572
1572
  let n = p.value;
1573
- p.value = t, t === "connected" && n !== null && n !== "connected" && De(e, !0);
1573
+ p.value = t, t === "connected" && n !== null && n !== "connected" && we(e, !0);
1574
1574
  }
1575
- function ke(e) {
1576
- v && v.templateId === e?.id || (v &&= (oe(), K(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, M = null, Q(), z(), e && Oe(e));
1575
+ function De(e) {
1576
+ v && v.templateId === e?.id || (v &&= (B(), Y(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, A = null, Q(), L(), e && Te(e));
1577
1577
  }
1578
- function J(e, t) {
1578
+ function Oe(e, t) {
1579
1579
  return `${e}\u0000${t ?? ""}`;
1580
1580
  }
1581
- function Y(e, t, n) {
1581
+ function ke(e, t, n) {
1582
1582
  return e.blockId === t && (n == null || e.locale == null || e.locale === n);
1583
1583
  }
1584
1584
  function Ae(e) {
1585
1585
  return [...s.value.values()].filter((t) => t.blockId === e);
1586
1586
  }
1587
1587
  function je(e) {
1588
- e !== f.value && (W(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1588
+ e !== f.value && (V(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1589
1589
  }
1590
1590
  function X(e, t = !1) {
1591
1591
  if (e.holder.sessionId === n) return;
1592
1592
  t ? l.add(e) : u.set(e, ++d);
1593
1593
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1594
- r.set(J(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), L({
1594
+ r.set(Oe(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), I({
1595
1595
  type: "selectionRefused",
1596
1596
  blockId: e.blockId,
1597
1597
  holder: e.holder
1598
1598
  }));
1599
1599
  }
1600
1600
  function Me(e, t, n) {
1601
- let r = J(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1601
+ let r = Oe(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1602
1602
  i.size !== s.value.size && (s.value = i);
1603
1603
  }
1604
1604
  function Ne(e, t, r) {
1605
1605
  let i = new Map([...s.value].filter(([, e]) => !l.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
1606
- for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Y(e, t.blockId, t.locale))) {
1606
+ for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || ke(e, t.blockId, t.locale))) {
1607
1607
  for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
1608
- i.set(J(t.blockId, t.locale), t);
1608
+ i.set(Oe(t.blockId, t.locale), t);
1609
1609
  }
1610
1610
  s.value = i;
1611
1611
  }
@@ -1616,83 +1616,83 @@ function Ct(e) {
1616
1616
  r.size !== s.value.size && (s.value = r);
1617
1617
  }
1618
1618
  function Pe(e) {
1619
- ee = ee.then(e).catch(I);
1619
+ re = re.then(e).catch(F);
1620
1620
  }
1621
1621
  function Q() {
1622
1622
  i && Pe(async () => {
1623
- if (N && (M === null || N.templateId !== M.templateId || N.locale !== M.locale)) {
1624
- let e = N;
1625
- N = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1623
+ if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
1624
+ let e = j;
1625
+ j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1626
1626
  }
1627
- let e = M;
1628
- if (!(!e || N?.templateId === e.templateId && N.blockId === e.blockId && N.locale === e.locale)) try {
1627
+ let e = A;
1628
+ if (!(!e || j?.templateId === e.templateId && j.blockId === e.blockId && j.locale === e.locale)) try {
1629
1629
  let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
1630
- N = e, Le(), Fe(n.blockId, n.locale ?? null);
1630
+ j = e, Le(), Fe(n.blockId, n.locale ?? null);
1631
1631
  } catch (n) {
1632
- if (N?.templateId === e.templateId) {
1633
- let e = N;
1634
- N = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1632
+ if (j?.templateId === e.templateId) {
1633
+ let e = j;
1634
+ j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1635
1635
  }
1636
- if (M !== e) return;
1636
+ if (A !== e) return;
1637
1637
  Ie(e.blockId, n);
1638
1638
  }
1639
1639
  });
1640
1640
  }
1641
1641
  function Fe(e, t) {
1642
- let n = new Map([...s.value].filter(([, n]) => !Y(n, e, t)));
1642
+ let n = new Map([...s.value].filter(([, n]) => !ke(n, e, t)));
1643
1643
  n.size !== s.value.size && (s.value = n);
1644
1644
  }
1645
1645
  function Ie(e, t) {
1646
1646
  let n = _t(t);
1647
1647
  if (n === "lock_held" || n === "block_missing") {
1648
- M = null;
1648
+ A = null;
1649
1649
  let n = vt(t);
1650
1650
  n ? X({
1651
1651
  blockId: e,
1652
1652
  holder: n,
1653
1653
  expiresAt: ""
1654
1654
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1655
- } else I(t), setTimeout(() => {
1656
- M?.blockId === e && Q();
1655
+ } else F(t), setTimeout(() => {
1656
+ A?.blockId === e && Q();
1657
1657
  }, ft[0]);
1658
1658
  }
1659
1659
  function Le() {
1660
- F ||= setInterval(() => {
1660
+ N ||= setInterval(() => {
1661
1661
  Pe(async () => {
1662
- let e = N;
1662
+ let e = j;
1663
1663
  if (e) try {
1664
1664
  await t.renewLock(e.templateId, e.blockId, e.locale);
1665
1665
  } catch (e) {
1666
1666
  if (_t(e) === "lock_lost") {
1667
- N = null, Re(), Q();
1667
+ j = null, Re(), Q();
1668
1668
  return;
1669
1669
  }
1670
- I(e);
1670
+ F(e);
1671
1671
  }
1672
1672
  });
1673
1673
  }, dt);
1674
1674
  }
1675
1675
  function Re() {
1676
- F &&= (clearInterval(F), null);
1676
+ N &&= (clearInterval(N), null);
1677
1677
  }
1678
1678
  function ze(e) {
1679
- W(), v && (M = e ? {
1679
+ V(), v && (A = e ? {
1680
1680
  templateId: v.templateId,
1681
1681
  blockId: e,
1682
1682
  locale: f.value
1683
1683
  } : null, Q());
1684
1684
  }
1685
1685
  function Be() {
1686
- W(), N && i && (t.releaseLock(N.templateId, N.blockId, N.locale).catch(() => {}), N = null, Re()), v?.leave?.(), v && (v.leave = null);
1686
+ V(), j && i && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, Re()), v?.leave?.(), v && (v.leave = null);
1687
1687
  }
1688
1688
  function Ve(e) {
1689
1689
  let t = v;
1690
1690
  if (!t || y) return;
1691
- W();
1691
+ V();
1692
1692
  let n = (e === "undo" ? t.undo : t.redo).pop();
1693
1693
  if (!n) return;
1694
- if (z(), n.view && !T(n.view, t.view)) {
1695
- L({
1694
+ if (L(), n.view && !H(n.view, t.view)) {
1695
+ I({
1696
1696
  type: "undoSkipped",
1697
1697
  code: "precondition_failed"
1698
1698
  });
@@ -1700,41 +1700,41 @@ function Ct(e) {
1700
1700
  }
1701
1701
  let r;
1702
1702
  try {
1703
- r = P(t.view, n.ops, R());
1703
+ r = E(t.view, n.ops, ae());
1704
1704
  } catch (e) {
1705
- if (!(e instanceof U)) throw e;
1706
- L({
1705
+ if (!(e instanceof M)) throw e;
1706
+ I({
1707
1707
  type: "undoSkipped",
1708
1708
  code: e.code
1709
1709
  });
1710
1710
  return;
1711
1711
  }
1712
- let i = gt({ ops: D(t.view, n.ops) }, r);
1713
- ie(e === "undo" ? t.redo : t.undo, i);
1712
+ let i = gt({ ops: ne(t.view, n.ops) }, r);
1713
+ R(e === "undo" ? t.redo : t.undo, i);
1714
1714
  let a = t.view;
1715
- t.view = r, B(r), _?.markDirty(), ce(t, n.ops, e, i, a);
1715
+ t.view = r, z(r), _?.markDirty(), le(t, n.ops, e, i, a);
1716
1716
  }
1717
1717
  function He(e, t) {
1718
1718
  let n = v;
1719
1719
  if (!_ || !n || y) return {
1720
1720
  applied: !1,
1721
- error: new U("invalid_operation", 0, "No template is open for editing.")
1721
+ error: new M("invalid_operation", 0, "No template is open for editing.")
1722
1722
  };
1723
1723
  if (t.origin === void 0) try {
1724
- P(_.content.value, e, R());
1724
+ E(_.content.value, e, ae());
1725
1725
  } catch (e) {
1726
- if (e instanceof U) return {
1726
+ if (e instanceof M) return {
1727
1727
  applied: !1,
1728
1728
  error: e
1729
1729
  };
1730
1730
  throw e;
1731
1731
  }
1732
- W();
1732
+ V();
1733
1733
  let r, i;
1734
1734
  try {
1735
- r = P(n.view, e, R()), i = D(n.view, e);
1735
+ r = E(n.view, e, ae()), i = ne(n.view, e);
1736
1736
  } catch (e) {
1737
- if (e instanceof U) return {
1737
+ if (e instanceof M) return {
1738
1738
  applied: !1,
1739
1739
  error: e
1740
1740
  };
@@ -1742,15 +1742,15 @@ function Ct(e) {
1742
1742
  }
1743
1743
  let a = n.undo.at(-1), o;
1744
1744
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1745
- let e = a.view !== void 0 && !T(a.view, n.view);
1745
+ let e = a.view !== void 0 && !H(a.view, n.view);
1746
1746
  a.ops = [...i, ...a.ops], o = e ? a : gt(a, r);
1747
1747
  } else o = gt({
1748
1748
  ops: i,
1749
1749
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1750
- }, r), ie(n.undo, o);
1751
- n.redo = [], z();
1750
+ }, r), R(n.undo, o);
1751
+ n.redo = [], L();
1752
1752
  let s = n.view;
1753
- return n.view = r, B(r), _.markDirty(), ce(n, e, t.origin ?? "edit", o, s), {
1753
+ return n.view = r, z(r), _.markDirty(), le(n, e, t.origin ?? "edit", o, s), {
1754
1754
  applied: !0,
1755
1755
  inverse: i
1756
1756
  };
@@ -1761,28 +1761,28 @@ function Ct(e) {
1761
1761
  if (t.moveBlock && t.findBlockLocation) {
1762
1762
  let n = t.moveBlock, r = (...r) => {
1763
1763
  let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1764
- if (a && V(!0), n(...r), !a || T(i.view, e.content.value)) return;
1764
+ if (a && se(!0), n(...r), !a || H(i.view, e.content.value)) return;
1765
1765
  let o = t.findBlockLocation(r[0]);
1766
1766
  if (!o) return;
1767
1767
  let s = o.targetSectionId ? {
1768
1768
  sectionId: o.targetSectionId,
1769
1769
  column: o.columnIndex ?? 0
1770
1770
  } : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0;
1771
- se(i, [{
1771
+ ce(i, [{
1772
1772
  op: "moveBlock",
1773
1773
  blockId: r[0],
1774
1774
  parent: s,
1775
1775
  after: (s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks)[o.index - 1]?.id ?? null
1776
1776
  }]);
1777
1777
  };
1778
- t.moveBlock = r, j.push(() => {
1778
+ t.moveBlock = r, k.push(() => {
1779
1779
  t.moveBlock === r && (t.moveBlock = n);
1780
1780
  });
1781
1781
  }
1782
- j.push(h(() => e.state.template, (e) => ke(e), { immediate: !0 }), h(() => e.content.value, ae, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? V(!0, !0) : ae())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", W)), c() && o(qe);
1782
+ k.push(h(() => e.state.template, (e) => De(e), { immediate: !0 }), h(() => e.content.value, oe, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? se(!0, !0) : oe())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", V)), c() && o(qe);
1783
1783
  }
1784
1784
  function We() {
1785
- W();
1785
+ V();
1786
1786
  let e = v;
1787
1787
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1788
1788
  resolve: t,
@@ -1790,16 +1790,16 @@ function Ct(e) {
1790
1790
  }));
1791
1791
  }
1792
1792
  function Ge() {
1793
- W(), y = !0;
1793
+ V(), y = !0;
1794
1794
  }
1795
1795
  function Ke() {
1796
- y = !1, v && B(v.view);
1796
+ y = !1, v && z(v.view);
1797
1797
  }
1798
1798
  function qe() {
1799
- if (!A) {
1800
- W();
1801
- for (let e of j.splice(0)) e();
1802
- oe(), Be(), A = !0, v && K(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", W));
1799
+ if (!ee) {
1800
+ V();
1801
+ for (let e of k.splice(0)) e();
1802
+ B(), Be(), ee = !0, v && Y(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", V));
1803
1803
  }
1804
1804
  }
1805
1805
  return {
@@ -1811,19 +1811,19 @@ function Ct(e) {
1811
1811
  setLockLocale: je,
1812
1812
  connection: p,
1813
1813
  revision: m,
1814
- canUndo: ne,
1815
- canRedo: re,
1814
+ canUndo: ie,
1815
+ canRedo: P,
1816
1816
  attach: Ue,
1817
1817
  undo: () => Ve("undo"),
1818
1818
  redo: () => Ve("redo"),
1819
1819
  clearHistory: () => {
1820
- v && (v.undo = [], v.redo = [], z());
1820
+ v && (v.undo = [], v.redo = [], L());
1821
1821
  },
1822
- flush: W,
1822
+ flush: V,
1823
1823
  settle: We,
1824
1824
  suspend: Ge,
1825
1825
  resume: Ke,
1826
- catchUp: Te,
1826
+ catchUp: q,
1827
1827
  hasConfirmedBlock: (e) => v ? bt(v.confirmed.blocks, e) : !1,
1828
1828
  applyOperations: He,
1829
1829
  destroy: qe
@@ -1846,7 +1846,7 @@ function wt(e) {
1846
1846
  return s.value && e.canDelete !== !1;
1847
1847
  }
1848
1848
  function u(e, t) {
1849
- throw new R(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1849
+ throw new W(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1850
1850
  }
1851
1851
  function d(t) {
1852
1852
  Q(e.onError, t);
@@ -1944,7 +1944,7 @@ function Et(e = {}) {
1944
1944
  },
1945
1945
  async create(e) {
1946
1946
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1947
- id: oe(),
1947
+ id: k(),
1948
1948
  name: e.name,
1949
1949
  content: e.content,
1950
1950
  ...e.category ? { category: e.category } : {},
@@ -2011,7 +2011,7 @@ function kt(e = {}) {
2011
2011
  },
2012
2012
  async create(e) {
2013
2013
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2014
- id: oe(),
2014
+ id: k(),
2015
2015
  url: t,
2016
2016
  filename: e.filename || e.file.name,
2017
2017
  createdAt: n,
@@ -2051,11 +2051,11 @@ function At(e) {
2051
2051
  let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
2052
2052
  function u(e) {
2053
2053
  let t = n();
2054
- if (!t) throw new R(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2054
+ if (!t) throw new W(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2055
2055
  return t;
2056
2056
  }
2057
2057
  function d(e) {
2058
- throw new R(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2058
+ throw new W(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2059
2059
  }
2060
2060
  function f(t) {
2061
2061
  Q(e.onError, t);
@@ -2134,16 +2134,16 @@ function jt(e) {
2134
2134
  });
2135
2135
  function m(e) {
2136
2136
  let t = n();
2137
- if (!t) throw new R(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2137
+ if (!t) throw new W(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2138
2138
  return t;
2139
2139
  }
2140
2140
  function h(e) {
2141
2141
  let t = r();
2142
- if (!t) throw new R(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2142
+ if (!t) throw new W(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2143
2143
  return t;
2144
2144
  }
2145
2145
  function g(e) {
2146
- throw new R(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2146
+ throw new W(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2147
2147
  }
2148
2148
  function _(e) {
2149
2149
  for (let t of i.value) {
@@ -2225,7 +2225,7 @@ function jt(e) {
2225
2225
  o.value = !1;
2226
2226
  }
2227
2227
  }
2228
- async function k(e, n) {
2228
+ async function ee(e, n) {
2229
2229
  let { update: r } = t;
2230
2230
  typeof r != "function" && g("update");
2231
2231
  let i = m("update");
@@ -2239,7 +2239,7 @@ function jt(e) {
2239
2239
  o.value = !1;
2240
2240
  }
2241
2241
  }
2242
- async function A(e) {
2242
+ async function k(e) {
2243
2243
  let { delete: n } = t;
2244
2244
  typeof n != "function" && g("delete");
2245
2245
  let r = m("delete");
@@ -2254,7 +2254,7 @@ function jt(e) {
2254
2254
  o.value = !1;
2255
2255
  }
2256
2256
  }
2257
- async function j(e, n) {
2257
+ async function te(e, n) {
2258
2258
  let { setResolved: r } = t;
2259
2259
  typeof r != "function" && g("setResolved");
2260
2260
  let i = m("setResolved");
@@ -2268,13 +2268,13 @@ function jt(e) {
2268
2268
  o.value = !1;
2269
2269
  }
2270
2270
  }
2271
- function M(e) {
2271
+ function A(e) {
2272
2272
  T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
2273
2273
  }
2274
- function N(e) {
2274
+ function j(e) {
2275
2275
  T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2276
2276
  }
2277
- function ee(e, n) {
2277
+ function ne(e, n) {
2278
2278
  let r = E(e, n);
2279
2279
  r && x(() => t.onDeleted?.(r, { origin: "remote" }));
2280
2280
  }
@@ -2291,14 +2291,14 @@ function jt(e) {
2291
2291
  commentCountByBlock: p,
2292
2292
  load: D,
2293
2293
  create: O,
2294
- update: k,
2295
- remove: A,
2296
- setResolved: j,
2294
+ update: ee,
2295
+ remove: k,
2296
+ setResolved: te,
2297
2297
  find: _,
2298
2298
  isOwn: y,
2299
- applyRemoteCreate: M,
2300
- applyRemoteUpdate: N,
2301
- applyRemoteDelete: ee
2299
+ applyRemoteCreate: A,
2300
+ applyRemoteUpdate: j,
2301
+ applyRemoteDelete: ne
2302
2302
  };
2303
2303
  }
2304
2304
  function Mt(e) {
@@ -2355,7 +2355,7 @@ function Pt(t) {
2355
2355
  };
2356
2356
  }
2357
2357
  function Ft(e) {
2358
- let t = a(ye, null), n = v(e);
2358
+ let t = a(_e, null), n = v(e);
2359
2359
  if (!t) return n;
2360
2360
  let i;
2361
2361
  function s() {
@@ -2382,14 +2382,14 @@ function It(e, t) {
2382
2382
  return typeof n == "string" && n.length > 0 ? n : t;
2383
2383
  }
2384
2384
  function Lt(e, t) {
2385
- return typeof e?.url == "string" && ue(e.url, t);
2385
+ return typeof e?.url == "string" && F(e.url, t);
2386
2386
  }
2387
2387
  function Rt(e, t) {
2388
2388
  let n = e?.url;
2389
- if (typeof n == "string" && n.trim() !== "") return ue(n, t) ? void 0 : n;
2389
+ if (typeof n == "string" && n.trim() !== "") return F(n, t) ? void 0 : n;
2390
2390
  }
2391
2391
  function zt(e) {
2392
- let t = a(ve, ce.liquid), n = Ft(() => Rt(e(), t));
2392
+ let t = a(ge, O.liquid), n = Ft(() => Rt(e(), t));
2393
2393
  return v(() => Lt(e(), t) ? null : n.value);
2394
2394
  }
2395
2395
  function Bt(e, t, n) {
@@ -2406,7 +2406,7 @@ function Ht(e, t, n = []) {
2406
2406
  }
2407
2407
  // src/utils/resolveFieldColors.ts
2408
2408
  function Ut(e, t) {
2409
- let n = we({ presets: e.presets }, Te), r = n.presets.length === 0;
2409
+ let n = Se({ presets: e.presets }, q), r = n.presets.length === 0;
2410
2410
  return {
2411
2411
  presets: r ? t.presets : n.presets,
2412
2412
  allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
@@ -2466,7 +2466,7 @@ var Xt = /* @__PURE__ */ t({
2466
2466
  size: { default: "field" }
2467
2467
  },
2468
2468
  setup(e) {
2469
- let t = e, { t: r } = Se(), i = {
2469
+ let t = e, { t: r } = be(), i = {
2470
2470
  field: {
2471
2471
  gap: "tpl:gap-1.5",
2472
2472
  icon: 18,
@@ -2481,11 +2481,11 @@ var Xt = /* @__PURE__ */ t({
2481
2481
  return (t, i) => (n(), l("div", {
2482
2482
  class: p(["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)]", a.value.gap]),
2483
2483
  style: y({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
2484
- }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(ge), {
2484
+ }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(he), {
2485
2485
  class: "tpl-spinner",
2486
2486
  size: a.value.icon,
2487
2487
  "stroke-width": 2
2488
- }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(_e), {
2488
+ }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(K), {
2489
2489
  size: a.value.icon,
2490
2490
  "stroke-width": 1.5
2491
2491
  }, null, 8, ["size"]), d(" " + g(f(r).image.dropToUpload), 1)], 64))], 6));
@@ -2501,7 +2501,7 @@ function Zt() {
2501
2501
  // src/composables/useImageDrop.ts
2502
2502
  var Qt = "image/";
2503
2503
  function $t(e) {
2504
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = Ce(t, {
2504
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = xe(t, {
2505
2505
  preventDefaultForUnhandled: !0,
2506
2506
  onDrop: (e) => {
2507
2507
  if (!i()) return;
@@ -2513,7 +2513,7 @@ function $t(e) {
2513
2513
  }
2514
2514
  // src/composables/useMediaDropField.ts
2515
2515
  function en(e) {
2516
- let { target: t, blocked: n, apply: r } = e, i = a(be, null), o = a(xe, null), s = Zt();
2516
+ let { target: t, blocked: n, apply: r } = e, i = a(ve, null), o = a(ye, null), s = Zt();
2517
2517
  async function c() {
2518
2518
  let e = await i?.({ accept: ["images"] });
2519
2519
  s.alive && e && r(e);
@@ -2558,11 +2558,24 @@ var nn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", rn = {
2558
2558
  33.33,
2559
2559
  33.34
2560
2560
  ],
2561
+ 4: [
2562
+ 25,
2563
+ 25,
2564
+ 25,
2565
+ 25
2566
+ ],
2561
2567
  "1-2": [33.33, 66.67],
2562
- "2-1": [66.67, 33.33]
2568
+ "2-1": [66.67, 33.33],
2569
+ "1-3": [25, 75],
2570
+ "3-1": [75, 25],
2571
+ "1-2-1": [
2572
+ 25,
2573
+ 50,
2574
+ 25
2575
+ ]
2563
2576
  };
2564
2577
  function an(e, t) {
2565
- let n = (e) => Math.trunc(e ?? 0), r = (e) => pe(e) === null ? 0 : Math.trunc(e.width);
2578
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => fe(e) === null ? 0 : Math.trunc(e.width);
2566
2579
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2567
2580
  }
2568
2581
  function on(e, t) {
@@ -2573,23 +2586,23 @@ function sn(e, t) {
2573
2586
  return Math.floor(t) - an(e.styles.padding, n);
2574
2587
  }
2575
2588
  function* cn(e, t) {
2576
- for (let n of e) re(n) ? yield* cn(n.children, on(t, n.styles.padding)) : yield {
2589
+ for (let n of e) V(n) ? yield* cn(n.children, on(t, n.styles.padding)) : yield {
2577
2590
  block: n,
2578
- bandWidth: me(n) && n.wrapper ? on(t, n.wrapper.padding) : t
2591
+ bandWidth: G(n) && n.wrapper ? on(t, n.wrapper.padding) : t
2579
2592
  };
2580
2593
  }
2581
- function ln(e, t, n = z(e)) {
2594
+ function ln(e, t, n = P(e)) {
2582
2595
  if (!t) return e;
2583
2596
  try {
2584
- return ne(ae(t, n, { missing: "default" }), e);
2597
+ return le(re(t, n, { missing: "default" }), e);
2585
2598
  } catch {
2586
2599
  return e;
2587
2600
  }
2588
2601
  }
2589
2602
  function un(e, t, n, r) {
2590
2603
  let i = ln(e, n, r);
2591
- for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (me(e)) {
2592
- let r = de(e)?.applied ? void 0 : e.border, i = Math.floor(n) - an(e.styles.padding, r), a = rn[e.columns] ?? [100];
2604
+ for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (G(e)) {
2605
+ let r = ue(e)?.applied ? void 0 : e.border, i = Math.floor(n) - an(e.styles.padding, r), a = rn[e.columns] ?? [100];
2593
2606
  for (let n = 0; n < e.children.length; n++) {
2594
2607
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2595
2608
  if (o) return sn(o, r);
@@ -2603,14 +2616,14 @@ function dn(e, t, n, r) {
2603
2616
  return null;
2604
2617
  }
2605
2618
  function fn(e) {
2606
- let t = me(e) ? de(e) : null;
2619
+ let t = G(e) ? ue(e) : null;
2607
2620
  return !!t?.applied && t.height === "image";
2608
2621
  }
2609
2622
  function pn(e, t, n, r) {
2610
2623
  if (fn(e)) return (t ? dn(t, e.id, n, r) : null) ?? tn(t?.settings);
2611
2624
  }
2612
2625
  // src/constants/socialIcons.ts
2613
- var mn = fe, hn = {
2626
+ var mn = se, hn = {
2614
2627
  small: 24,
2615
2628
  medium: 32,
2616
2629
  large: 48
@@ -2619,6 +2632,7 @@ var mn = fe, hn = {
2619
2632
  "twitter",
2620
2633
  "instagram",
2621
2634
  "linkedin",
2635
+ "xing",
2622
2636
  "youtube",
2623
2637
  "tiktok",
2624
2638
  "pinterest",
@@ -2635,4 +2649,4 @@ var mn = fe, hn = {
2635
2649
  ];
2636
2650
  export { Et as A, ze as B, Bt as C, jt as D, Mt as E, We as F, Ue as I, Ve as L, Ct as M, lt as N, At as O, Ge as P, He as R, Rt as S, Ft as T, Fe as V, Gt as _, fn as a, Vt as b, nn as c, Zt as d, Xt as f, Kt as g, qt as h, un as i, wt as j, kt as k, tn as l, Yt as m, mn as n, pn as o, Jt as p, gn as r, dn as s, hn as t, en as u, Ut as v, zt as w, Pt as x, Ht as y, Be as z };
2637
2651
 
2638
- //# sourceMappingURL=socialIcons-DPwkrn5v.js.map
2652
+ //# sourceMappingURL=socialIcons-Qw9rHc8C.js.map