@templatical/editor 0.56.1 → 0.57.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 (303) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiAltTextPopover-CpZ7UeAZ.js → AiAltTextPopover-BjClNscQ.js} +5 -5
  3. package/dist/{AiAltTextReview-LYxvn7Qe.js → AiAltTextReview-DeMdVbtT.js} +6 -6
  4. package/dist/{AiChatPanel-Cy05P-iO.js → AiChatPanel-Cros4ZCM.js} +22 -25
  5. package/dist/AiPanels-D_CdHqFZ.js +26 -0
  6. package/dist/{AiRewriteMenu-DgqJHnza.js → AiRewriteMenu-BSzj1dKC.js} +53 -53
  7. package/dist/{BlockIssueBadge-CxHJmuOh.js → BlockIssueBadge-i2cZy5PB.js} +5 -5
  8. package/dist/{BlockPreviewCanvas-DEmNZkEG.js → BlockPreviewCanvas-D-If_vd_.js} +27 -27
  9. package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
  10. package/dist/{CloudPanels-Bmlf05Il.js → CloudPanels-DPeK_siQ.js} +6 -6
  11. package/dist/{CollaborationNotices-C27GCMvK.js → CollaborationNotices-DkYX-ose.js} +3 -3
  12. package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
  13. package/dist/CommentsPanel-t3w16YUl.js +23 -0
  14. package/dist/CommentsSidebar-B3M90RY_.js +516 -0
  15. package/dist/{CountdownBlock-D8dqjm3F.js → CountdownBlock-BrR2uqM3.js} +4 -4
  16. package/dist/{CountdownToolbar-IjpCOjCd.js → CountdownToolbar-DBu2ZqC6.js} +7 -7
  17. package/dist/{IssuesPanel-uwuzeMSW.js → IssuesPanel-BnUut-p-.js} +13 -13
  18. package/dist/{LanguageMenu-C-eQ0lFy.js → LanguageMenu-DfTxrbvp.js} +16 -16
  19. package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
  20. package/dist/{LocaleNotices-CDK_9D7P.js → LocaleNotices-D6zk-QCL.js} +5 -5
  21. package/dist/{LogicTagInsertButton-BSolF7Fd.js → LogicTagInsertButton-CJ1Jk6jv.js} +65 -65
  22. package/dist/{MediaEditModal-C8yc9dxt.js → MediaEditModal-BxbwZxnf.js} +4 -4
  23. package/dist/{MediaPanels-FI4I8asn.js → MediaPanels-BiUxsTMM.js} +2 -2
  24. package/dist/{MergeTagInput-B1nl2ZMT.js → MergeTagInput-CV-z85s9.js} +2 -2
  25. package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-CixgX5C_.js} +7 -7
  26. package/dist/{MergeTagTextarea-DJlf3VbS.js → MergeTagTextarea-B1zOC_Nr.js} +9 -9
  27. package/dist/{ParagraphEditor-Dqco128s.js → ParagraphEditor-C9UhWvRB.js} +51 -51
  28. package/dist/{RestoreVersionDialog-hqLCuGV5.js → RestoreVersionDialog-Do7fZWpT.js} +5 -5
  29. package/dist/{RichTextEditorContent-xIEF0Y3Z.js → RichTextEditorContent-wW_SMun2.js} +10 -10
  30. package/dist/{SaveBlockDialog-CQlCP_XC.js → SaveBlockDialog-CCHIUfR-.js} +15 -15
  31. package/dist/{SavedBlocksBrowserModal-BXA32Fx6.js → SavedBlocksBrowserModal-DtPHhfw9.js} +13 -13
  32. package/dist/{SavedBlocksPanels-BKUzbamj.js → SavedBlocksPanels-CYIby5pR.js} +2 -2
  33. package/dist/{SavedBlocksPickBar-BlvF-4UF.js → SavedBlocksPickBar-CCwBugqN.js} +4 -4
  34. package/dist/{TemplateSettings-CYFtR8zv.js → TemplateSettings-B8IVy5q9.js} +14 -14
  35. package/dist/{TestEmailModal-BbaL17HO.js → TestEmailModal-CS5JoKRH.js} +13 -13
  36. package/dist/{TestEmailPanel-DhB1CSpg.js → TestEmailPanel-sOIZfKzc.js} +2 -2
  37. package/dist/{TitleEditor-3BRl8u5l.js → TitleEditor-ZlBcq9_P.js} +14 -14
  38. package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
  39. package/dist/{Toolbar-pzNIakGM.js → Toolbar-c4_rLLJT.js} +218 -218
  40. package/dist/{TplModal-WNuWhHZm.js → TplModal-DnFFEulp.js} +6 -6
  41. package/dist/{VersionHistoryMenu--T-Qp_mH.js → VersionHistoryMenu-Cd2IaHgT.js} +10 -10
  42. package/dist/{VersionHistoryPanels-BPubvYIE.js → VersionHistoryPanels-TdGaMaa_.js} +2 -2
  43. package/dist/{VersionPreviewBanner-ClL3Wkln.js → VersionPreviewBanner-lkAf7tc8.js} +3 -3
  44. package/dist/{WrapperBlock-CjfCPceb.js → WrapperBlock-BiW4ye3w.js} +5 -5
  45. package/dist/{blockTypeIcons-12OMwVyN.js → blockTypeIcons-D1aYMC1M.js} +3 -3
  46. package/dist/bundle-stats.json +7 -7
  47. package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js → AiAltTextPopover-CfGJNBOb.js} +5 -5
  48. package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js.map → AiAltTextPopover-CfGJNBOb.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js → AiAltTextReview-PKe31R_g.js} +6 -6
  50. package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js.map → AiAltTextReview-PKe31R_g.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiChatPanel-C2gpq4kP.js → AiChatPanel-DNCUpV8n.js} +15 -18
  52. package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
  53. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
  54. package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
  55. package/dist/cdn/chunks/{AiRewriteMenu-CnkyjPEu.js → AiRewriteMenu-ZDBwReuU.js} +58 -58
  56. package/dist/cdn/chunks/AiRewriteMenu-ZDBwReuU.js.map +1 -0
  57. package/dist/cdn/chunks/{BlockIssueBadge-DncZ-HDf.js → BlockIssueBadge-DIlFDDwh.js} +5 -5
  58. package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
  59. package/dist/cdn/chunks/{BlockPreviewCanvas-CCSEzL46.js → BlockPreviewCanvas-D7U6nQ7t.js} +28 -28
  60. package/dist/cdn/chunks/BlockPreviewCanvas-D7U6nQ7t.js.map +1 -0
  61. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
  62. package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
  63. package/dist/cdn/chunks/{CloudPanels-CRztnw4M.js → CloudPanels-EXXNMLbs.js} +5 -5
  64. package/dist/cdn/chunks/CloudPanels-EXXNMLbs.js.map +1 -0
  65. package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js → CollaborationNotices-DGA8XRZJ.js} +4 -4
  66. package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
  67. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
  68. package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
  69. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
  70. package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
  71. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
  72. package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
  73. package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js → CountdownBlock-Do6oItNW.js} +5 -5
  74. package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
  75. package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js → CountdownToolbar-BN2_zvRj.js} +8 -8
  76. package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js.map → CountdownToolbar-BN2_zvRj.js.map} +1 -1
  77. package/dist/cdn/chunks/{IssuesPanel-CrplCzo8.js → IssuesPanel-BDwegn0s.js} +9 -9
  78. package/dist/cdn/chunks/IssuesPanel-BDwegn0s.js.map +1 -0
  79. package/dist/cdn/chunks/{LanguageMenu-B6MNInCL.js → LanguageMenu-DXq9cXUd.js} +105 -105
  80. package/dist/cdn/chunks/LanguageMenu-DXq9cXUd.js.map +1 -0
  81. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
  82. package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
  83. package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js → LocaleNotices-CUN5K5QJ.js} +5 -5
  84. package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
  85. package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js → LogicTagInsertButton-BEArlbra.js} +12 -12
  86. package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js.map → LogicTagInsertButton-BEArlbra.js.map} +1 -1
  87. package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js → MediaEditModal-BHTMNHx0.js} +4 -4
  88. package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
  89. package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js → MediaPanels-BlianNRh.js} +3 -3
  90. package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js.map → MediaPanels-BlianNRh.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js → MergeTagInput-B3SLXXzL.js} +3 -3
  92. package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js.map → MergeTagInput-B3SLXXzL.js.map} +1 -1
  93. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-Dywp9ntA.js} +6 -6
  94. package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-Dywp9ntA.js.map} +1 -1
  95. package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js → MergeTagTextarea-B9TM7FgM.js} +7 -7
  96. package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js.map → MergeTagTextarea-B9TM7FgM.js.map} +1 -1
  97. package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js → ParagraphEditor-CVGtTYta.js} +30 -30
  98. package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js.map → ParagraphEditor-CVGtTYta.js.map} +1 -1
  99. package/dist/cdn/chunks/{RestoreVersionDialog-CPrrWTsT.js → RestoreVersionDialog-Dt_0qOOW.js} +5 -5
  100. package/dist/cdn/chunks/RestoreVersionDialog-Dt_0qOOW.js.map +1 -0
  101. package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js → RichTextEditorContent-BjN4mnzL.js} +9 -9
  102. package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js.map → RichTextEditorContent-BjN4mnzL.js.map} +1 -1
  103. package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js → SaveBlockDialog-D9eBjE99.js} +13 -13
  104. package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js.map → SaveBlockDialog-D9eBjE99.js.map} +1 -1
  105. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js → SavedBlocksBrowserModal-ClsTpkdk.js} +9 -9
  106. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js.map → SavedBlocksBrowserModal-ClsTpkdk.js.map} +1 -1
  107. package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js → SavedBlocksPanels-CxlNHhUs.js} +3 -3
  108. package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js.map → SavedBlocksPanels-CxlNHhUs.js.map} +1 -1
  109. package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js → SavedBlocksPickBar-C7_Z8phX.js} +5 -5
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js.map → SavedBlocksPickBar-C7_Z8phX.js.map} +1 -1
  111. package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js → TemplateSettings-B6zDtjSs.js} +12 -12
  112. package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js.map → TemplateSettings-B6zDtjSs.js.map} +1 -1
  113. package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js → TestEmailModal-CJ_QYFua.js} +10 -10
  114. package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js.map → TestEmailModal-CJ_QYFua.js.map} +1 -1
  115. package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js → TestEmailPanel-CsFrTq_a.js} +3 -3
  116. package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js.map → TestEmailPanel-CsFrTq_a.js.map} +1 -1
  117. package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js → TitleEditor-CuKJptyw.js} +13 -13
  118. package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js.map → TitleEditor-CuKJptyw.js.map} +1 -1
  119. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
  120. package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
  121. package/dist/cdn/chunks/{Toolbar-VH07SzX7.js → Toolbar-TS2WwlPW.js} +302 -302
  122. package/dist/cdn/chunks/Toolbar-TS2WwlPW.js.map +1 -0
  123. package/dist/cdn/chunks/{TplModal-DMe6J811.js → TplModal-CsadClrH.js} +6 -6
  124. package/dist/cdn/chunks/{TplModal-DMe6J811.js.map → TplModal-CsadClrH.js.map} +1 -1
  125. package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js → VersionHistoryMenu-BNPxnWiO.js} +9 -9
  126. package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
  127. package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js → VersionHistoryPanels-CieY91f0.js} +3 -3
  128. package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js.map → VersionHistoryPanels-CieY91f0.js.map} +1 -1
  129. package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js → VersionPreviewBanner-BldFvgxJ.js} +4 -4
  130. package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
  131. package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js → WrapperBlock-DtnRuKWE.js} +6 -6
  132. package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js.map → WrapperBlock-DtnRuKWE.js.map} +1 -1
  133. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
  134. package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
  135. package/dist/cdn/chunks/{composables-D3lsO7Io.js → composables-CUIiW9OD.js} +750 -730
  136. package/dist/cdn/chunks/composables-CUIiW9OD.js.map +1 -0
  137. package/dist/cdn/chunks/{createCloudRuntime-CE79GB1H.js → createCloudRuntime-B7D04wKf.js} +157 -143
  138. package/dist/cdn/chunks/createCloudRuntime-B7D04wKf.js.map +1 -0
  139. package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
  140. package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
  141. package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
  142. package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
  143. package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
  144. package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
  145. package/dist/cdn/chunks/{dist-Cf1pSluo.js → dist-zu1jwYIS.js} +4 -4
  146. package/dist/cdn/chunks/{dist-Cf1pSluo.js.map → dist-zu1jwYIS.js.map} +1 -1
  147. package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
  148. package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
  149. package/dist/cdn/chunks/{editor-modal-CN69NlOK.js → editor-modal-CarOiAYJ.js} +77 -76
  150. package/dist/cdn/chunks/{editor-modal-CN69NlOK.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
  151. package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
  152. package/dist/cdn/chunks/{extensions-8dlM-fU4.js → extensions-Cbvk9i08.js} +7 -7
  153. package/dist/cdn/chunks/{extensions-8dlM-fU4.js.map → extensions-Cbvk9i08.js.map} +1 -1
  154. package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
  155. package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
  156. package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
  157. package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
  158. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-BJ-MnCqF.js} +55 -55
  159. package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-BJ-MnCqF.js.map} +1 -1
  160. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-D2wISRHq.js} +2 -2
  161. package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-D2wISRHq.js.map} +1 -1
  162. package/dist/cdn/chunks/{sanitizeHtml-B3njfkSy.js → sanitizeHtml-CB7fjHFs.js} +22 -11
  163. package/dist/cdn/chunks/sanitizeHtml-CB7fjHFs.js.map +1 -0
  164. package/dist/cdn/chunks/{socialIcons-BFgc3qqJ.js → socialIcons-C_yggK1_.js} +575 -524
  165. package/dist/cdn/chunks/socialIcons-C_yggK1_.js.map +1 -0
  166. package/dist/cdn/chunks/{src-C9JWWxAk.js → src-Bp7bZcuD.js} +108 -95
  167. package/dist/cdn/chunks/src-Bp7bZcuD.js.map +1 -0
  168. package/dist/cdn/chunks/{src-mXG-Of9A.js → src-CdVAke9t.js} +721 -696
  169. package/dist/cdn/chunks/src-CdVAke9t.js.map +1 -0
  170. package/dist/cdn/chunks/{src-GgKlXNxy.js → src-D-URHI0Z.js} +232 -228
  171. package/dist/cdn/chunks/src-D-URHI0Z.js.map +1 -0
  172. package/dist/cdn/chunks/{tiptap-C940SvId.js → tiptap-BPiZqxCt.js} +40 -31
  173. package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
  174. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
  175. package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
  176. package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
  177. package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
  178. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
  179. package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
  180. package/dist/cdn/chunks/useLocalizedDisplay-slFOCPrh.js +33 -0
  181. package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-slFOCPrh.js.map} +1 -1
  182. package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js → useLogicTag-lPjCGeGC.js} +4 -4
  183. package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js.map → useLogicTag-lPjCGeGC.js.map} +1 -1
  184. package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js → useMergeTag-BKNBwIry.js} +4 -4
  185. package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js.map → useMergeTag-BKNBwIry.js.map} +1 -1
  186. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
  187. package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
  188. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
  189. package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
  190. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-CzTFFaJA.js} +2 -2
  191. package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-CzTFFaJA.js.map} +1 -1
  192. package/dist/cdn/editor.css +1 -1
  193. package/dist/cdn/editor.js +685 -663
  194. package/dist/cdn/editor.js.map +1 -1
  195. package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
  196. package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
  197. package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
  198. package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
  199. package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
  200. package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
  201. package/dist/{composables-DreAt_0A.js → composables-DbjgUQlV.js} +1123 -1103
  202. package/dist/{createCloudRuntime-CL4tUlDC.js → createCloudRuntime-Cnh2M6iT.js} +42 -28
  203. package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
  204. package/dist/da-CYWJkrTg.js +95 -0
  205. package/dist/da-qQzj0QGy.js +948 -0
  206. package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
  207. package/dist/{dist-BjzK1g4Z.js → dist-B15BvV94.js} +2 -2
  208. package/dist/{dist-DDytHU_6.js → dist-B3G4Yvpd.js} +3 -3
  209. package/dist/{dist-CiYotUR8.js → dist-B6ptxfPo.js} +3 -3
  210. package/dist/{dist-0GWMyHtM.js → dist-BmV-2uBJ.js} +2 -2
  211. package/dist/{dist-CCLRTtJP.js → dist-BxKFi2h_.js} +5 -5
  212. package/dist/{dist-BMUUt3zJ.js → dist-CAvsz9cW.js} +680 -655
  213. package/dist/{dist-CsknfjrZ.js → dist-CMBOqk9I.js} +7 -7
  214. package/dist/{dist-ZrT0vAB6.js → dist-CXTsTO5h.js} +2 -2
  215. package/dist/{dist-Dq9VnANT.js → dist-D5BUcCjv.js} +2 -2
  216. package/dist/dist-D9cbSSSx.js +4 -0
  217. package/dist/{dist-BsumKKh9.js → dist-DAdrn64r.js} +2 -2
  218. package/dist/{dist-C3avsUq9.js → dist-DENg3ORe.js} +31 -22
  219. package/dist/{dist-Cr1CLCmx.js → dist-DI_8rB1X.js} +2 -2
  220. package/dist/dist-ELLEk-lS.js +4 -0
  221. package/dist/{editor-modal-BD32TXws.js → editor-modal-CgsaLpwB.js} +20 -19
  222. package/dist/en-DBLcB-CW.js +1 -0
  223. package/dist/{extensions-DKxHlSd7.js → extensions-7fb-XtNJ.js} +21 -21
  224. package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
  225. package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
  226. package/dist/index.d.ts +6 -4
  227. package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
  228. package/dist/keys-D9oKZN1h.js +9 -0
  229. package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
  230. package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
  231. package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
  232. package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
  233. package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-GrXJfXsQ.js} +82 -82
  234. package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
  235. package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
  236. package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
  237. package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-DuXtzD-F.js} +3 -3
  238. package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
  239. package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
  240. package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
  241. package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-eV4_BpI6.js} +25 -14
  242. package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
  243. package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
  244. package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
  245. package/dist/{socialIcons-oo4uL16Y.js → socialIcons-brRkK9Om.js} +600 -549
  246. package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
  247. package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
  248. package/dist/style.css +1 -1
  249. package/dist/templatical-editor.js +748 -726
  250. package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
  251. package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
  252. package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
  253. package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
  254. package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
  255. package/dist/useEditorRoot-B0Njczhx.js +7 -0
  256. package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
  257. package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-DoaT7nWk.js} +2 -4
  258. package/dist/{useLogicTag-B4Zpk3eo.js → useLogicTag-cTC2KbWd.js} +3 -3
  259. package/dist/{useMergeTag-B5qlq8px.js → useMergeTag-D2YDZ8vR.js} +3 -3
  260. package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
  261. package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
  262. package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
  263. package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-DAmED4fN.js} +1 -1
  264. package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
  265. package/package.json +23 -23
  266. package/dist/AiPanels-CwKmXzyr.js +0 -31
  267. package/dist/CommentsPanel-B5NqPMmY.js +0 -16
  268. package/dist/CommentsSidebar-BDrcrDxS.js +0 -526
  269. package/dist/cdn/chunks/AiChatPanel-C2gpq4kP.js.map +0 -1
  270. package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js +0 -32
  271. package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js.map +0 -1
  272. package/dist/cdn/chunks/AiRewriteMenu-CnkyjPEu.js.map +0 -1
  273. package/dist/cdn/chunks/BlockIssueBadge-DncZ-HDf.js.map +0 -1
  274. package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +0 -1
  275. package/dist/cdn/chunks/CloudPanels-CRztnw4M.js.map +0 -1
  276. package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js +0 -18
  277. package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js.map +0 -1
  278. package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js +0 -496
  279. package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js.map +0 -1
  280. package/dist/cdn/chunks/IssuesPanel-CrplCzo8.js.map +0 -1
  281. package/dist/cdn/chunks/LanguageMenu-B6MNInCL.js.map +0 -1
  282. package/dist/cdn/chunks/RestoreVersionDialog-CPrrWTsT.js.map +0 -1
  283. package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +0 -1
  284. package/dist/cdn/chunks/composables-D3lsO7Io.js.map +0 -1
  285. package/dist/cdn/chunks/createCloudRuntime-CE79GB1H.js.map +0 -1
  286. package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
  287. package/dist/cdn/chunks/en-Bcz4gS9U.js +0 -1
  288. package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
  289. package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
  290. package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
  291. package/dist/cdn/chunks/sanitizeHtml-B3njfkSy.js.map +0 -1
  292. package/dist/cdn/chunks/socialIcons-BFgc3qqJ.js.map +0 -1
  293. package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
  294. package/dist/cdn/chunks/src-GgKlXNxy.js.map +0 -1
  295. package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
  296. package/dist/cdn/chunks/tiptap-C940SvId.js.map +0 -1
  297. package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
  298. package/dist/dist-B_0FPmoy.js +0 -4
  299. package/dist/dist-DKV9m4Uu.js +0 -4
  300. package/dist/en-Dgs_-NBw.js +0 -1
  301. package/dist/keys-w_VRjoMu.js +0 -9
  302. package/dist/useEditorRoot-BcXKhM_8.js +0 -7
  303. package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
@@ -1,14 +1,14 @@
1
- import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
2
- import { $t as T, C as E, Ct as D, Dt as O, E as k, Et as A, Ft as j, Gt as M, Ht as ee, I as te, It as ne, Lt as N, Nt as P, O as F, Ot as I, Q as L, T as R, U as re, _ as z, an as ie, ct as B, d as V, g as H, gt as ae, h as U, j as oe, k as se, m as W, nn as ce, qt as G, st as le, tt as K, vt as ue, w as de, wt as fe, x as pe } from "./dist-BMUUt3zJ.js";
3
- import { t as q } from "./createLucideIcon-CfBdtoUw.js";
4
- import { t as J } from "./upload-DR9pqVON.js";
5
- import { t as me } from "./loader-circle-DqKWsMHO.js";
6
- import { B as he, C as ge, W as _e, u as ve } from "./keys-w_VRjoMu.js";
7
- import { t as ye } from "./useI18n-zeWYtWSv.js";
8
- import { r as be } from "./dist-CiYotUR8.js";
9
- import { i as Y, r as xe } from "./usePopoverPosition-Br3zt_MQ.js";
1
+ import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BE5V8ADU.js";
2
+ import { A as T, At as E, D, E as O, Et as k, Ft as A, G as j, Lt as ee, N as M, O as N, Ot as te, R as P, Rt as F, S as ne, T as re, Tt as I, Wt as L, Yt as R, _ as z, bt as ie, et as B, f as V, g as ae, h as oe, in as H, j as se, kt as ce, lt as U, qt as le, rt as W, sn as ue, tn as de, ut as fe, v as G, vt as pe, w as K, zt as q } from "./dist-CAvsz9cW.js";
3
+ import { t as J } from "./createLucideIcon-D-mELTSY.js";
4
+ import { t as me } from "./upload-CNK8JX38.js";
5
+ import { t as he } from "./loader-circle-DmyagWpc.js";
6
+ import { B as ge, C as _e, W as ve, u as ye } from "./keys-D9oKZN1h.js";
7
+ import { t as be } from "./useI18n-CM9vKbYc.js";
8
+ import { r as xe } from "./dist-B6ptxfPo.js";
9
+ import { i as Se, r as Ce } from "./usePopoverPosition-CVRzzLkC.js";
10
10
  // ../core/dist/index.js
11
- var X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => X(e) && typeof e.id == "string"), Ce = /* @__PURE__ */ new Set([
11
+ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), we = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => Y(e) && typeof e.id == "string"), Te = /* @__PURE__ */ new Set([
12
12
  "id",
13
13
  "type",
14
14
  "children",
@@ -16,51 +16,51 @@ var X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = (e) => Arr
16
16
  "l10n",
17
17
  "renderedHtml"
18
18
  ]);
19
- function we(e, t, n) {
19
+ function Ee(e, t, n) {
20
20
  let r = /* @__PURE__ */ new Set();
21
21
  for (let i of n) {
22
- if (!D(i)) continue;
23
- let n = i.split("."), a = n.pop(), o = n.join("."), s = N(e, i), c = t;
22
+ if (!I(i)) continue;
23
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = q(e, i), c = t;
24
24
  for (let [t, i] of n.entries()) {
25
25
  let a = n.slice(0, t + 1).join(".");
26
- s !== void 0 && X(c) && N(c, i) === void 0 && X(N(e, a)) && (c[i] = {}, r.add(a)), c = N(c, i);
26
+ s !== void 0 && Y(c) && q(c, i) === void 0 && Y(q(e, a)) && (c[i] = {}, r.add(a)), c = q(c, i);
27
27
  }
28
28
  if (Array.isArray(c)) {
29
- let e = c.findIndex((e) => X(e) && e.id === a);
29
+ let e = c.findIndex((e) => Y(e) && e.id === a);
30
30
  if (e < 0) continue;
31
- s === void 0 ? c.splice(e, 1) : c[e] = G(s);
32
- } else X(c) && (s === void 0 ? delete c[a] : c[a] = G(s), o && Object.keys(c).length === 0 && N(e, o) === void 0 && we(e, t, [o]));
31
+ s === void 0 ? c.splice(e, 1) : c[e] = R(s);
32
+ } else Y(c) && (s === void 0 ? delete c[a] : c[a] = R(s), o && Object.keys(c).length === 0 && q(e, o) === void 0 && Ee(e, t, [o]));
33
33
  }
34
34
  return r;
35
35
  }
36
- function Te(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
- if (X(e) && X(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !Ce.has(o)) && Te(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
- else if (i && Se(e) && Se(t)) for (let o of t) {
36
+ function De(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
+ if (Y(e) && Y(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !Te.has(o)) && De(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
+ else if (i && we(e) && we(t)) for (let o of t) {
39
39
  if (o.id.includes(".")) continue;
40
40
  let t = e.find((e) => e.id === o.id);
41
- t && Te(t, o, `${n}.${o.id}`, r, i, a);
41
+ t && De(t, o, `${n}.${o.id}`, r, i, a);
42
42
  }
43
- else L(e, t) || r.set(n, t);
43
+ else B(e, t) || r.set(n, t);
44
44
  }
45
- function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
45
+ function X(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
46
46
  let a = /* @__PURE__ */ new Map();
47
- Te(e, t, "", a, e.type !== "custom", i);
48
- let o = new Set(e.type === "custom" ? ie(e, r) : []), s = {}, c = {};
49
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : O(e.type, t)) && typeof r == "string" && N(e, t) !== void 0) {
47
+ De(e, t, "", a, e.type !== "custom", i);
48
+ let o = new Set(e.type === "custom" ? ue(e, r) : []), s = {}, c = {};
49
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : ce(e.type, t)) && typeof r == "string" && q(e, t) !== void 0) {
50
50
  let i = n?.text?.[t];
51
51
  s[t] = i && i.value === r ? i : {
52
52
  value: r,
53
- sourceHash: T(String(N(e, t) ?? ""))
53
+ sourceHash: de(String(q(e, t) ?? ""))
54
54
  };
55
55
  } else c[t] = r === void 0 ? null : r;
56
56
  let l = {};
57
57
  return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
58
58
  }
59
- function De(e, t, n) {
59
+ function Oe(e, t, n) {
60
60
  let r = !1;
61
61
  function i(e, t, n, a) {
62
- let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => X(e) && typeof e.id == "string");
63
- if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => G(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
+ let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => Y(e) && typeof e.id == "string");
63
+ if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => R(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
64
64
  let r = e[n].find((e) => e.id === t.id);
65
65
  r && i(r, t, a);
66
66
  }
@@ -68,51 +68,51 @@ function De(e, t, n) {
68
68
  let a = e, o = t;
69
69
  if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
70
70
  let i = (e) => e.map((e) => e.map((e) => e.id));
71
- (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => G(n(e.id) ?? e))));
71
+ (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => R(n(e.id) ?? e))));
72
72
  }
73
73
  return r;
74
74
  }
75
- function Oe(e, t, n) {
75
+ function ke(e, t, n) {
76
76
  let r = (e) => {
77
77
  let { locale: t, locales: n, l10n: r, ...i } = e;
78
78
  return i;
79
79
  }, i = /* @__PURE__ */ new Map();
80
- Te(r(e), r(t), "", i);
80
+ De(r(e), r(t), "", i);
81
81
  let a = {};
82
- for (let [t, r] of i) if (W.includes(t) && typeof r == "string" && N(e, t) !== void 0) {
82
+ for (let [t, r] of i) if (oe.includes(t) && typeof r == "string" && q(e, t) !== void 0) {
83
83
  let i = n?.text?.[t];
84
84
  (a.text ??= {})[t] = i?.value === r ? i : {
85
85
  value: r,
86
- sourceHash: T(String(N(e, t) ?? ""))
86
+ sourceHash: de(String(q(e, t) ?? ""))
87
87
  };
88
88
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
89
89
  return a;
90
90
  }
91
- function ke(e, t, n, r, i, a = []) {
92
- let o = G(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
91
+ function Ae(e, t, n, r, i, a = []) {
92
+ let o = R(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
93
93
  ...Object.keys(t.text ?? {}),
94
94
  ...Object.keys(t.set ?? {}),
95
95
  ...Object.keys(n.text ?? {}),
96
96
  ...Object.keys(n.set ?? {})
97
- ])].filter((e) => !L(t.text?.[e], n.text?.[e]) || !L(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
97
+ ])].filter((e) => !B(t.text?.[e], n.text?.[e]) || !B(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
98
98
  for (let e of c) {
99
- let t = N(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && L(N(r, t), N(i, t)));
100
- if (L(t, N(r, e))) delete o.set[e];
101
- else if (n.length && X(N(r, e)) && X(t)) {
99
+ let t = q(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && B(q(r, t), q(i, t)));
100
+ if (B(t, q(r, e))) delete o.set[e];
101
+ else if (n.length && Y(q(r, e)) && Y(t)) {
102
102
  delete o.set[e];
103
103
  let i = (e, t, a) => {
104
104
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
105
- if (X(t) && X(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
- else if (X(r) && r.type !== "custom" && Se(t) && Se(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
- else X(r) && typeof r.type == "string" && A(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : G(a));
105
+ if (Y(t) && Y(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
+ else if (Y(r) && r.type !== "custom" && we(t) && we(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
+ else Y(r) && typeof r.type == "string" && te(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : R(a));
108
108
  }
109
109
  };
110
- i(e, N(r, e), t);
111
- } else o.set[e] = t === void 0 ? null : G(t);
110
+ i(e, q(r, e), t);
111
+ } else o.set[e] = t === void 0 ? null : R(t);
112
112
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) {
113
113
  if (!n.startsWith(`${e}.`)) continue;
114
114
  let r = t === "text" ? o.text[n].value : o.set[n] ?? void 0;
115
- L(r, N(i, n)) || delete o[t][n];
115
+ B(r, q(i, n)) || delete o[t][n];
116
116
  }
117
117
  }
118
118
  for (let e of s) if (!c.includes(e)) {
@@ -121,7 +121,7 @@ function ke(e, t, n, r, i, a = []) {
121
121
  }
122
122
  return o.text && !Object.keys(o.text).length && delete o.text, o.set && !Object.keys(o.set).length && delete o.set, o;
123
123
  }
124
- function Ae(e) {
124
+ function je(e) {
125
125
  return [
126
126
  "addBlock",
127
127
  "removeBlock",
@@ -129,18 +129,18 @@ function Ae(e) {
129
129
  "duplicateBlock"
130
130
  ].includes(e);
131
131
  }
132
- function je(e, t, n) {
132
+ function Me(e, t, n) {
133
133
  if (e.canEdit && !e.canEdit()) return !1;
134
134
  let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
135
135
  if (!r && e.findBlock && !o) return !1;
136
136
  let s = r ? null : e.findBlockLocation?.(a);
137
- if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
137
+ if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o && N(o).some((t) => t !== a && e.isBlockLocked(t, !0)) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
138
138
  if (r && e.content) {
139
139
  let t = {
140
140
  ...e.content(),
141
141
  blocks: [o]
142
142
  };
143
- R(t), k(t);
143
+ O(t), D(t);
144
144
  }
145
145
  if (t === "removeBlock") return !0;
146
146
  let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
@@ -148,24 +148,24 @@ function je(e, t, n) {
148
148
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
149
149
  if (e.findBlock) {
150
150
  let t = e.findBlock(l);
151
- if (t?.type !== "section" || u < 0 || u >= B(t.columns)) return !1;
151
+ if (t?.type !== "section" || u < 0 || u >= fe(t.columns)) return !1;
152
152
  }
153
153
  }
154
154
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
155
155
  }
156
- var Me = /* @__PURE__ */ new WeakMap();
157
- function Ne(e, t) {
158
- Me.set(e, t);
159
- for (let n of Object.values(e)) typeof n == "function" && Me.set(n, t);
156
+ var Ne = /* @__PURE__ */ new WeakMap();
157
+ function Pe(e, t) {
158
+ Ne.set(e, t);
159
+ for (let n of Object.values(e)) typeof n == "function" && Ne.set(n, t);
160
160
  }
161
161
  function Z(e, t) {
162
- let n = Me.get(e);
163
- n && Me.set(t, n);
162
+ let n = Ne.get(e);
163
+ n && Ne.set(t, n);
164
164
  }
165
165
  function Q(e, t, n) {
166
- let r = Reflect.get(e, t), i = Me.get(e) ?? (typeof r == "function" ? Me.get(r) : void 0);
166
+ let r = Reflect.get(e, t), i = Ne.get(e) ?? (typeof r == "function" ? Ne.get(r) : void 0);
167
167
  if (i) return i(t, n);
168
- if (!Ae(t)) return !0;
168
+ if (!je(t)) return !0;
169
169
  let a = Reflect.get(e, "isBlockLocked");
170
170
  if (typeof a != "function") return !0;
171
171
  let o = { isBlockLocked: (t, n) => a.call(e, t, n) }, s = Reflect.get(e, "content");
@@ -178,21 +178,21 @@ function Q(e, t, n) {
178
178
  let n = Reflect.get(e, t);
179
179
  typeof n == "function" && (o[t] = n.bind(e));
180
180
  }
181
- return je(o, t, n);
181
+ return Me(o, t, n);
182
182
  }
183
- function Pe(e) {
183
+ function Fe(e) {
184
184
  return e instanceof Error ? e : Error(String(e), { cause: e });
185
185
  }
186
- function Fe(e, t) {
186
+ function Ie(e, t) {
187
187
  try {
188
188
  t();
189
189
  } catch (t) {
190
- e?.(Pe(t));
190
+ e?.(Fe(t));
191
191
  }
192
192
  }
193
- function Ie(t) {
194
- let n = t.content ?? te(t.defaultFontFamily, t.templateDefaults);
195
- R(n), k(n);
193
+ function Le(t) {
194
+ let n = t.content ?? P(t.defaultFontFamily, t.templateDefaults);
195
+ O(n), D(n);
196
196
  let i = s({
197
197
  template: null,
198
198
  content: n,
@@ -207,11 +207,11 @@ function Ie(t) {
207
207
  uiTheme: "auto"
208
208
  }), a = g(i, "activeLocale"), o = [];
209
209
  function c(e) {
210
- let t = K(i.content);
211
- if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new z(`This template has no "${e}" version.`, void 0, "unknown_locale");
210
+ let t = W(i.content);
211
+ if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new G(`This template has no "${e}" version.`, void 0, "unknown_locale");
212
212
  a.value = e;
213
213
  }
214
- v(() => a.value ?? K(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
214
+ v(() => a.value ?? W(i.content), (e) => Ie(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
215
215
  a.value && !i.content.settings.locales?.includes(a.value) && c(null);
216
216
  });
217
217
  function l() {
@@ -221,20 +221,20 @@ function Ie(t) {
221
221
  o = e;
222
222
  }
223
223
  function d(e) {
224
- return re(i.content, e, o);
224
+ return j(i.content, e, o);
225
225
  }
226
226
  function f(e, n) {
227
227
  if (!l()) return null;
228
- if (e === "addLocale" && (!ue(n) || t.localization && !t.localization.locales.includes(n))) throw new z(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
- let r = G(i.content);
230
- return de(r, [{
228
+ if (e === "addLocale" && (!ie(n) || t.localization && !t.localization.locales.includes(n))) throw new G(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
+ let r = R(i.content);
230
+ return re(r, [{
231
231
  op: e,
232
232
  locale: n
233
- }]), L(r, i.content) ? null : r;
233
+ }]), B(r, i.content) ? null : r;
234
234
  }
235
235
  function m(e, t) {
236
236
  let n = f(e, t);
237
- n && (i.content = n, A());
237
+ n && (i.content = n, M());
238
238
  }
239
239
  function h(e) {
240
240
  m("addLocale", e);
@@ -251,24 +251,24 @@ function Ie(t) {
251
251
  }
252
252
  function b(e, t) {
253
253
  let [n, r] = t;
254
- if (!a.value || !l() || V(n)) return null;
254
+ if (!a.value || !l() || z(n)) return null;
255
255
  let s = I(i.content.blocks, n);
256
256
  if (!s) return null;
257
- let c = s.l10n?.[a.value], u = P(s, a.value, K(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? we(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : G(c ?? {});
257
+ let c = s.l10n?.[a.value], u = A(s, a.value, W(i.content)), d = X(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? Ee(s, u, r) : void 0, p = e === "resetLocaleFields" ? Ae(c, d, X(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : R(c ?? {});
258
258
  if (e === "setBlockHidden") r ? p.hidden = !0 : delete p.hidden;
259
259
  else if (e === "resetLocaleFields") r || (delete p.text, delete p.set, delete p.hidden);
260
260
  else for (let e of r) {
261
261
  let t = p.text?.[e];
262
- t && (t.sourceHash = T(String(N(s, e) ?? "")));
262
+ t && (t.sourceHash = de(String(q(s, e) ?? "")));
263
263
  }
264
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, L(c ?? {}, p) ? null : {
264
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, B(c ?? {}, p) ? null : {
265
265
  block: s,
266
266
  layer: p
267
267
  };
268
268
  }
269
269
  function x(e, t) {
270
270
  let n = b(e, t);
271
- n && (y(n.block, n.layer), A());
271
+ n && (y(n.block, n.layer), M());
272
272
  }
273
273
  function S(e, t) {
274
274
  x("setBlockHidden", [e, t]);
@@ -279,16 +279,16 @@ function Ie(t) {
279
279
  function w(e, t) {
280
280
  x("keepTranslations", [e, t]);
281
281
  }
282
- let E = p(0), D = 0, O = 0;
283
- function A() {
284
- i.isDirty = !0, O++;
282
+ let T = p(0), E = 0, k = 0;
283
+ function M() {
284
+ i.isDirty = !0, k++;
285
285
  }
286
- let ee = r({
286
+ let te = r({
287
287
  get: () => i.content,
288
288
  set: (e) => {
289
- i.content = e, A();
289
+ i.content = e, M();
290
290
  }
291
- }), F = r(() => i.selectedBlockId ? I(i.content.blocks, i.selectedBlockId) : null);
291
+ }), ne = r(() => i.selectedBlockId ? I(i.content.blocks, i.selectedBlockId) : null);
292
292
  function I(e, t) {
293
293
  for (let n of e) {
294
294
  if (n.id === t) return n;
@@ -299,15 +299,12 @@ function Ie(t) {
299
299
  }
300
300
  return null;
301
301
  }
302
- function ie(e, t) {
303
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ie(e, t);
304
- }
305
- function B(e, t, n = { blocks: e }) {
302
+ function L(e, t, n = { blocks: e }) {
306
303
  for (let r = 0; r < e.length; r++) {
307
304
  let i = e[r];
308
305
  if (i.id === t) return n;
309
306
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
310
- let n = B(i.children[e], t, {
307
+ let n = L(i.children[e], t, {
311
308
  blocks: i.children[e],
312
309
  sectionId: i.id,
313
310
  columnIndex: e
@@ -317,7 +314,7 @@ function Ie(t) {
317
314
  }
318
315
  return null;
319
316
  }
320
- function V(e, n = !1) {
317
+ function z(e, n = !1) {
321
318
  let r = a.value ?? t.lockLocale?.value ?? null;
322
319
  for (let [i, a] of t.lockedBlocks?.value ?? []) {
323
320
  let o = a;
@@ -327,8 +324,8 @@ function Ie(t) {
327
324
  }
328
325
  return !1;
329
326
  }
330
- function H(e) {
331
- let t = B(i.content.blocks, e);
327
+ function V(e) {
328
+ let t = L(i.content.blocks, e);
332
329
  if (!t) return null;
333
330
  let n = t.blocks.findIndex((t) => t.id === e);
334
331
  return n === -1 ? null : {
@@ -338,92 +335,103 @@ function Ie(t) {
338
335
  };
339
336
  }
340
337
  function ae(e, t = !0) {
341
- R(e), k(e), i.content = e, t && A();
342
- }
343
- function U(e) {
344
- e && V(e) || (i.selectedBlockId = e);
338
+ O(e), D(e), i.content = e, t && M();
345
339
  }
346
340
  function oe(e) {
341
+ e && z(e) || (i.selectedBlockId = e);
342
+ }
343
+ function H(e) {
347
344
  i.viewport = e;
348
345
  }
349
346
  function se(e) {
350
347
  i.darkMode = e;
351
348
  }
352
- function W(e) {
349
+ function ce(e) {
353
350
  i.uiTheme = e;
354
351
  }
355
- function ce(e) {
352
+ function U(e) {
356
353
  i.previewMode = e, e && (i.selectedBlockId = null);
357
354
  }
358
- function le(e, t) {
355
+ function ue(e, t) {
359
356
  if (!l()) return !1;
360
357
  let n = I(i.content.blocks, e);
361
358
  if (!n) return !1;
362
- if ("l10n" in t) throw new z("l10n is immutable in updateBlock.", void 0, "invalid_operation");
359
+ if ("l10n" in t) throw new G("l10n is immutable in updateBlock.", void 0, "invalid_operation");
363
360
  let r = {
364
361
  ...n,
365
362
  ...t
366
- };
367
- return !V(e, De(G(n), r, (e) => I(i.content.blocks, e)));
363
+ }, o = R(n), s = Oe(o, r, (e) => I(i.content.blocks, e)), c = "children" in t, u = s || c || r.type !== n.type;
364
+ if (c && r.type === "section" && Array.isArray(r.children)) {
365
+ let e = new Set(N(n).slice(1)), t = /* @__PURE__ */ new Set();
366
+ for (let n of r.children) for (let r of n) for (let n of N(r)) {
367
+ if (t.has(n) || z(n, !0) || I(i.content.blocks, n) !== null && !e.has(n)) return !1;
368
+ t.add(n);
369
+ }
370
+ if (a.value) {
371
+ let e = N(o);
372
+ if (new Set(e).size !== e.length) return !1;
373
+ }
374
+ }
375
+ return !z(e, u || "columns" in t) && (!u || !N(n).some((t) => t !== e && z(t, !0)));
368
376
  }
369
377
  function fe(e, n) {
370
- if (!le(e, n)) return;
378
+ if (!ue(e, n)) return;
371
379
  let r = I(i.content.blocks, e);
372
380
  if (!r) return;
373
381
  let s = a.value;
374
382
  if (s) {
375
- let a = P(r, s, K(i.content)), c = {
383
+ let a = A(r, s, W(i.content)), c = {
376
384
  ...a,
377
385
  ...n
378
- }, l = G(r), u = De(l, c, (e) => I(i.content.blocks, e));
379
- if (V(e, u)) return;
386
+ }, l = R(r), u = Oe(l, c, (e) => I(i.content.blocks, e));
387
+ if (z(e, u)) return;
380
388
  u && t.onStructureChange?.();
381
- let d = j(l);
382
- delete r.l10n, Object.assign(r, d), y(r, ke(r.l10n?.[s], Ee(r, a, r.l10n?.[s], o), Ee(r, c, r.l10n?.[s], o), r, c));
389
+ let d = ee(l);
390
+ delete r.l10n, Object.assign(r, d), y(r, Ae(r.l10n?.[s], X(r, a, r.l10n?.[s], o), X(r, c, r.l10n?.[s], o), r, c));
383
391
  } else {
384
- if (V(e, "children" in n || "columns" in n)) return;
385
- let t = j({
392
+ if (z(e, "children" in n || "columns" in n)) return;
393
+ let t = ee({
386
394
  ...r,
387
395
  ...n
388
396
  });
389
397
  delete r.l10n, Object.assign(r, t);
390
398
  }
391
- A();
399
+ M();
392
400
  }
393
401
  function pe(e) {
394
- if ("locales" in e || "l10n" in e) throw new z("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
395
- if ("locale" in e && e.locale !== K(i.content) && i.content.settings.locales?.length) throw new z("The default locale can't change while language versions exist.", void 0, "invalid_operation");
402
+ if ("locales" in e || "l10n" in e) throw new G("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
403
+ if ("locale" in e && e.locale !== W(i.content) && i.content.settings.locales?.length) throw new G("The default locale can't change while language versions exist.", void 0, "invalid_operation");
396
404
  }
397
- function q(e) {
405
+ function K(e) {
398
406
  if (!l()) return;
399
407
  pe(e);
400
408
  let t = a.value;
401
- if (!t) i.content.settings = ne({
409
+ if (!t) i.content.settings = F({
402
410
  ...i.content.settings,
403
411
  ...e
404
412
  });
405
413
  else {
406
- let n = i.content.settings, r = M(i.content, t).settings, a = {
414
+ let n = i.content.settings, r = le(i.content, t).settings, a = {
407
415
  ...r,
408
416
  locale: n.locale,
409
417
  ...e
410
- }, o = n.l10n?.[t], s = ke(o, Oe(n, r, o), Oe(n, a, o), n, a);
418
+ }, o = n.l10n?.[t], s = Ae(o, ke(n, r, o), ke(n, a, o), n, a);
411
419
  Object.keys(s).length ? n.l10n = {
412
420
  ...n.l10n,
413
421
  [t]: s
414
422
  } : n.l10n && (delete n.l10n[t], Object.keys(n.l10n).length || delete n.l10n);
415
423
  }
416
- A();
424
+ M();
417
425
  }
418
426
  let J = {
419
427
  canEdit: l,
420
428
  content: () => i.content,
421
429
  findBlock: (e) => I(i.content.blocks, e),
422
- findBlockLocation: H,
423
- isBlockLocked: V
430
+ findBlockLocation: V,
431
+ isBlockLocked: z
424
432
  };
425
433
  function me(e, n, r = 0, o) {
426
- if (je(J, "addBlock", [
434
+ if (Me(J, "addBlock", [
427
435
  e,
428
436
  n,
429
437
  r,
@@ -437,91 +445,87 @@ function Ie(t) {
437
445
  o !== void 0 && o < n.length ? n.splice(o, 0, e) : n.push(e);
438
446
  }
439
447
  } else o !== void 0 && o < i.content.blocks.length ? i.content.blocks.splice(o, 0, e) : i.content.blocks.push(e);
440
- a.value && t.onStructureChange?.(), A();
448
+ a.value && t.onStructureChange?.(), M();
441
449
  }
442
450
  }
443
451
  function he(e) {
444
- if (!je(J, "removeBlock", [e])) return;
445
- let n = B(i.content.blocks, e);
452
+ if (!Me(J, "removeBlock", [e])) return;
453
+ let n = L(i.content.blocks, e);
446
454
  if (n) {
447
455
  let r = n.blocks.findIndex((t) => t.id === e);
448
456
  if (r !== -1) {
449
457
  let [e] = n.blocks.splice(r, 1);
450
- if (i.selectedBlockId) {
451
- let t = /* @__PURE__ */ new Set();
452
- ie(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
453
- }
454
- a.value && t.onStructureChange?.(), A();
458
+ i.selectedBlockId && new Set(N(e)).has(i.selectedBlockId) && (i.selectedBlockId = null), a.value && t.onStructureChange?.(), M();
455
459
  }
456
460
  }
457
461
  }
458
462
  function ge(e, n, r, o = 0) {
459
- if (!je(J, "moveBlock", [
463
+ if (!Me(J, "moveBlock", [
460
464
  e,
461
465
  n,
462
466
  r,
463
467
  o
464
468
  ])) return;
465
- let s = B(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
469
+ let s = L(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
466
470
  if (r) {
467
471
  let e = I(i.content.blocks, r);
468
472
  e.children[o] = e.children[o] || [], l = e.children[o];
469
473
  } else l = i.content.blocks;
470
474
  let [u] = s.blocks.splice(c, 1);
471
- l.splice(n, 0, u), a.value && t.onStructureChange?.(), A();
475
+ l.splice(n, 0, u), a.value && t.onStructureChange?.(), M();
472
476
  }
473
477
  function _e() {
474
- A();
478
+ M();
475
479
  }
476
480
  function ve(e, t) {
477
- throw new z(`[Templatical] Templates: ${e} ${t}`);
481
+ throw new G(`[Templatical] Templates: ${e} ${t}`);
478
482
  }
479
483
  function ye(e) {
480
- Fe(t.onError, e);
484
+ Ie(t.onError, e);
481
485
  }
482
486
  function be(e) {
483
487
  let { templates: n } = t;
484
488
  return n || ve(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
485
489
  }
486
- function Y(e) {
490
+ function xe(e) {
487
491
  i.template && (i.template = {
488
492
  ...i.template,
489
493
  name: e
490
- }, A());
494
+ }, M());
491
495
  }
492
- async function xe(e) {
496
+ async function Se(e) {
493
497
  let n = be("create()"), { create: r } = n;
494
498
  typeof r != "function" && ve("create()", "is disabled by the provider — its `create` is `false`.");
495
- let a, o = ++D;
499
+ let a, o = ++E;
496
500
  i.isLoading = !0;
497
501
  try {
498
502
  e?.content && (i.content = e.content);
499
- let t = O;
503
+ let t = k;
500
504
  a = await r(e?.name === void 0 ? { content: i.content } : {
501
505
  name: e.name,
502
506
  content: i.content
503
- }), i.template = a, O === t && (i.isDirty = !1), E.value++;
507
+ }), i.template = a, k === t && (i.isDirty = !1), T.value++;
504
508
  } catch (e) {
505
509
  throw t.onError?.(e), e;
506
510
  } finally {
507
- D === o && (i.isLoading = !1);
511
+ E === o && (i.isLoading = !1);
508
512
  }
509
513
  return ye(() => n.onCreated?.(a)), a;
510
514
  }
511
- async function X(e, n) {
512
- let r = be("load()"), a, o = ++D;
515
+ async function Ce(e, n) {
516
+ let r = be("load()"), a, o = ++E;
513
517
  i.isLoading = !0;
514
518
  try {
515
- if (a = await r.load(e), R(a.content), k(a.content), n && !n()) return a;
516
- i.template = a, i.content = a.content, i.isDirty = !1, E.value++;
519
+ if (a = await r.load(e), O(a.content), D(a.content), n && !n()) return a;
520
+ i.template = a, i.content = a.content, i.isDirty = !1, T.value++;
517
521
  } catch (e) {
518
522
  throw t.onError?.(e), e;
519
523
  } finally {
520
- D === o && (i.isLoading = !1);
524
+ E === o && (i.isLoading = !1);
521
525
  }
522
526
  return ye(() => r.onLoaded?.(a)), a;
523
527
  }
524
- async function Se(e = "api") {
528
+ async function Y(e = "api") {
525
529
  let n = be("save()"), { save: r } = n;
526
530
  typeof r != "function" && ve("save()", "is disabled by the provider — its `save` is `false`.");
527
531
  let a = i.template;
@@ -532,7 +536,7 @@ function Ie(t) {
532
536
  }, s;
533
537
  i.isSaving = !0;
534
538
  try {
535
- let e = O;
539
+ let e = k;
536
540
  if (s = await r(a.id, o), i.template?.id === a.id) {
537
541
  let e = i.template.name;
538
542
  i.template = e === a.name ? s : {
@@ -540,7 +544,7 @@ function Ie(t) {
540
544
  name: e
541
545
  };
542
546
  }
543
- O === e && (i.isDirty = !1);
547
+ k === e && (i.isDirty = !1);
544
548
  } catch (e) {
545
549
  throw t.onError?.(e), e;
546
550
  } finally {
@@ -548,14 +552,14 @@ function Ie(t) {
548
552
  }
549
553
  return ye(() => n.onSaved?.(s, { trigger: e })), s;
550
554
  }
551
- function Ce() {
555
+ function we() {
552
556
  return i.template?.id !== void 0;
553
557
  }
554
558
  let Te = {
555
559
  state: e(i),
556
- loadVersion: e(E),
557
- content: ee,
558
- selectedBlock: F,
560
+ loadVersion: e(T),
561
+ content: te,
562
+ selectedBlock: ne,
559
563
  activeLocale: a,
560
564
  setActiveLocale: c,
561
565
  addLocale: h,
@@ -565,33 +569,33 @@ function Ie(t) {
565
569
  keepTranslations: w,
566
570
  setCustomBlockDefinitions: u,
567
571
  createSetDefaultLocaleOperation: d,
568
- isBlockLocked: V,
572
+ isBlockLocked: z,
569
573
  setContent: ae,
570
- selectBlock: U,
571
- setViewport: oe,
574
+ selectBlock: oe,
575
+ setViewport: H,
572
576
  setDarkMode: se,
573
- setUiTheme: W,
574
- setPreviewMode: ce,
577
+ setUiTheme: ce,
578
+ setPreviewMode: U,
575
579
  updateBlock: fe,
576
- updateSettings: q,
580
+ updateSettings: K,
577
581
  addBlock: me,
578
582
  removeBlock: he,
579
583
  moveBlock: ge,
580
584
  markDirty: _e,
581
- findBlockLocation: H,
582
- setName: Y,
583
- create: xe,
584
- load: X,
585
- save: Se,
586
- hasTemplate: Ce
585
+ findBlockLocation: V,
586
+ setName: xe,
587
+ create: Se,
588
+ load: Ce,
589
+ save: Y,
590
+ hasTemplate: we
587
591
  };
588
- return Ne(Te, (e, t) => Ae(e) ? je(J, e, t) : l() ? e === "updateBlock" ? le(t[0], t[1]) : (e === "updateSettings" && pe(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), Te;
592
+ return Pe(Te, (e, t) => je(e) ? Me(J, e, t) : l() ? e === "updateBlock" ? ue(t[0], t[1]) : (e === "updateSettings" && pe(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), Te;
589
593
  }
590
- var Le = 50, Re = 300, ze = 1500;
591
- function Be(e) {
592
- let { content: t, setContent: n, maxSize: i = Le } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
594
+ var Re = 50, ze = 300, Be = 1500;
595
+ function Ve(e) {
596
+ let { content: t, setContent: n, maxSize: i = Re } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
593
597
  function f() {
594
- return G(t.value);
598
+ return R(t.value);
595
599
  }
596
600
  function m(e) {
597
601
  a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
@@ -605,17 +609,17 @@ function Be(e) {
605
609
  function _(e) {
606
610
  l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
607
611
  l = null;
608
- }, Re)) : (h(), m(f()), o.value = [], l = {
612
+ }, ze)) : (h(), m(f()), o.value = [], l = {
609
613
  blockId: e,
610
614
  timeoutId: setTimeout(() => {
611
615
  l = null;
612
- }, Re)
616
+ }, ze)
613
617
  });
614
618
  }
615
619
  function v() {
616
620
  s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
617
621
  s.value = !1, c = null;
618
- }, ze);
622
+ }, Be);
619
623
  }
620
624
  function y() {
621
625
  if (a.value.length === 0) return;
@@ -648,14 +652,14 @@ function Be(e) {
648
652
  flushDebounce: h
649
653
  };
650
654
  }
651
- function Ve(e) {
655
+ function He(e) {
652
656
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
653
657
  function o(n, r, a) {
654
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = oe(n, o);
658
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = M(n, o);
655
659
  return t(s, r, a), i(s.id), s;
656
660
  }
657
661
  function s(e, n, r) {
658
- let o = F(e);
662
+ let o = T(e);
659
663
  if (!Q(t, "duplicateBlock", [
660
664
  e,
661
665
  n,
@@ -681,9 +685,9 @@ function Ve(e) {
681
685
  updateBlockProperty: l
682
686
  };
683
687
  }
684
- var He = 2e3;
685
- function Ue(e) {
686
- let { content: t, isDirty: n, onChange: r, debounce: i = He, enabled: a = !0 } = e, o = null, s = !1;
688
+ var Ue = 2e3;
689
+ function We(e) {
690
+ let { content: t, isDirty: n, onChange: r, debounce: i = Ue, enabled: a = !0 } = e, o = null, s = !1;
687
691
  function c() {
688
692
  return typeof a == "function" ? a() : a;
689
693
  }
@@ -718,7 +722,7 @@ function Ue(e) {
718
722
  destroy: h
719
723
  };
720
724
  }
721
- function We(e) {
725
+ function Ge(e) {
722
726
  let t = s(/* @__PURE__ */ new Set()), n = r(() => t.size > 0);
723
727
  function i(e) {
724
728
  return t.has(e);
@@ -736,7 +740,7 @@ function We(e) {
736
740
  hasHiddenBlocks: n
737
741
  };
738
742
  }
739
- function Ge(e) {
743
+ function Ke(e) {
740
744
  let t = p(!1), n = p(!1), i = r(() => !!e.definition.value?.dataSource), a = r(() => i.value && !e.block.value.dataSourceFetched);
741
745
  async function o() {
742
746
  let r = e.definition.value;
@@ -766,7 +770,7 @@ function Ge(e) {
766
770
  needsFetch: a
767
771
  };
768
772
  }
769
- function Ke(e, t) {
773
+ function qe(e, t) {
770
774
  e.activeLocale && v(e.activeLocale, () => t.flushDebounce?.());
771
775
  for (let n of [
772
776
  "addLocale",
@@ -803,43 +807,48 @@ function Ke(e, t) {
803
807
  Q(e, "updateSettings", [n]) && (t.record(), o(n));
804
808
  }, Z(a, e.updateBlock), Z(o, e.updateSettings);
805
809
  }
806
- var qe = "root", Je = /* @__PURE__ */ new Set([
810
+ var Je = "root", Ye = /* @__PURE__ */ new Set([
807
811
  "id",
808
812
  "type",
809
813
  "children",
810
814
  "l10n"
811
- ]), Ye = /* @__PURE__ */ new Set([
815
+ ]), Xe = /* @__PURE__ */ new Set([
812
816
  "id",
813
817
  "type",
814
818
  "children",
815
819
  "columns",
816
820
  "l10n"
817
- ]), Xe = /* @__PURE__ */ new Set(), Ze = /* @__PURE__ */ new Set(["locales", "l10n"]);
818
- function Qe(e) {
819
- return e === null ? qe : JSON.stringify([e.sectionId, e.column]);
820
- }
821
+ ]), Ze = /* @__PURE__ */ new Set(), Qe = /* @__PURE__ */ new Set(["locales", "l10n"]);
821
822
  function $e(e) {
823
+ return e === null ? Je : "wrapperId" in e ? JSON.stringify(["wrapper", e.wrapperId]) : JSON.stringify([
824
+ "section",
825
+ e.sectionId,
826
+ e.column
827
+ ]);
828
+ }
829
+ function et(e) {
822
830
  let t = e.children;
823
831
  return e.type === "section" && Array.isArray(t) ? t : [];
824
832
  }
825
- function et(e) {
833
+ function tt(e) {
826
834
  let t = /* @__PURE__ */ new Map(), n = (e, r) => {
827
835
  e.forEach((e, i) => {
828
836
  t.has(e.id) || t.set(e.id, {
829
837
  block: e,
830
- key: Qe(r),
838
+ parent: r,
839
+ key: $e(r),
831
840
  index: i
832
- }), $e(e).forEach((t, r) => {
841
+ }), et(e).forEach((t, r) => {
833
842
  Array.isArray(t) && n(t, {
834
843
  sectionId: e.id,
835
844
  column: r
836
845
  });
837
- });
846
+ }), e.type === "wrapper" && Array.isArray(e.children) && n(e.children, { wrapperId: e.id });
838
847
  });
839
848
  };
840
849
  return n(e, null), t;
841
850
  }
842
- function tt(e) {
851
+ function nt(e) {
843
852
  let t = [], n = Array(e.length).fill(-1);
844
853
  e.forEach((r, i) => {
845
854
  let a = 0, o = t.length;
@@ -853,17 +862,17 @@ function tt(e) {
853
862
  for (; i !== -1;) r.add(i), i = n[i];
854
863
  return r;
855
864
  }
856
- function nt(e, t, n) {
865
+ function rt(e, t, n) {
857
866
  let r = {}, i = [];
858
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || L(e[i], t[i]) || (r[i] = G(t[i]));
867
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || B(e[i], t[i]) || (r[i] = R(t[i]));
859
868
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
860
869
  return {
861
870
  set: r,
862
871
  unset: i
863
872
  };
864
873
  }
865
- function rt(e = {}, t = {}) {
866
- let n = nt(e.text ?? {}, t.text ?? {}, Xe), r = nt(e.set ?? {}, t.set ?? {}, Xe), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
874
+ function it(e = {}, t = {}) {
875
+ let n = rt(e.text ?? {}, t.text ?? {}, Ze), r = rt(e.set ?? {}, t.set ?? {}, Ze), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
867
876
  return {
868
877
  ...Object.keys(n.set).length > 0 ? { text: n.set } : {},
869
878
  ...Object.keys(r.set).length > 0 ? { set: r.set } : {},
@@ -871,107 +880,142 @@ function rt(e = {}, t = {}) {
871
880
  ...e.hidden === t.hidden ? {} : { hidden: t.hidden === !0 }
872
881
  };
873
882
  }
874
- function it(e, t) {
883
+ function at(e, t) {
875
884
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
876
885
  op: "setContent",
877
- content: G(t)
886
+ content: R(t)
878
887
  }];
879
- let n = et(e.blocks), r = et(t.blocks), i = [], a = (e) => {
888
+ let n = tt(e.blocks), r = tt(t.blocks), i = [], a = new Set(t.settings.locales ?? []), o = new Set(e.settings.locales ?? []), s = (e) => {
880
889
  let t = r.get(e), i = n.get(e);
881
890
  return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
882
- }, o = (e) => r.has(e.id) && !a(e.id), s = (e) => $e(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
891
+ }, c = (e) => r.has(e.id) && !s(e.id), l = (e) => e.type === "wrapper" && Array.isArray(e.children) ? [e.children] : et(e), u = (e) => l(e).some((e) => e.some((e) => c(e) || !s(e.id) && u(e))), d = /* @__PURE__ */ new Set(), f = [], p = (e, t) => {
883
892
  let n = "kept";
884
- t === "dropped" ? (c.add(e.id), n = "dropped") : a(e.id) ? (i.push({
893
+ t === "dropped" ? (d.add(e.id), n = "dropped") : s(e.id) ? (i.push({
885
894
  op: "deleteBlock",
886
895
  blockId: e.id
887
- }), c.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : s(e) ? (l.push(e.id), n = "deferred") : (i.push({
896
+ }), d.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : u(e) ? (f.push(e.id), n = "deferred") : (i.push({
888
897
  op: "deleteBlock",
889
898
  blockId: e.id
890
- }), c.add(e.id), n = "dropped"));
891
- for (let t of $e(e)) if (Array.isArray(t)) for (let e of t) u(e, n);
899
+ }), d.add(e.id), n = "dropped"));
900
+ for (let t of l(e)) if (Array.isArray(t)) for (let e of t) p(e, n);
892
901
  };
893
- for (let t of e.blocks) u(t, "kept");
894
- let d = (e) => n.has(e) && !c.has(e), f = (e) => {
895
- let t = G(e);
896
- return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => G(e)) : e)), t;
897
- }, p = (e, t, r) => {
898
- let a = Qe(e), o = [], s = [];
902
+ for (let t of e.blocks) p(t, "kept");
903
+ let m = (e) => n.has(e) && !d.has(e), h = (e) => {
904
+ let t = R(e);
905
+ return t.type === "section" ? t.children = et(e).map((e) => Array.isArray(e) ? e.filter((e) => !m(e.id)).map(h) : e) : t.type === "wrapper" && e.type === "wrapper" && (t.children = e.children.filter((e) => !m(e.id)).map(h)), t;
906
+ }, g = (e, t, r) => {
907
+ let a = $e(e), o = [], s = [];
899
908
  t.forEach((e, t) => {
900
909
  let r = n.get(e.id);
901
- d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
910
+ m(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
902
911
  });
903
- let c = new Set([...tt(o)].map((e) => s[e]));
912
+ let c = new Set([...nt(o)].map((e) => s[e]));
904
913
  t.forEach((n, a) => {
905
914
  if (c.has(a) || r(n)) return;
906
915
  let o = a > 0 ? t[a - 1].id : null;
907
- i.push(d(n.id) ? {
916
+ i.push(m(n.id) ? {
908
917
  op: "moveBlock",
909
918
  blockId: n.id,
910
919
  parent: e,
911
920
  after: o
912
921
  } : {
913
922
  op: "addBlock",
914
- block: f(n),
923
+ block: h(n),
915
924
  parent: e,
916
925
  after: o
917
926
  });
918
927
  });
919
928
  };
920
- p(null, t.blocks, () => !1);
921
- let m = t.blocks.filter((e) => e.type === "section"), h = /* @__PURE__ */ new Set(), g = (e) => {
922
- for (let t of m) {
923
- if (!d(t.id)) continue;
924
- let r = $e(n.get(t.id).block).length, a = $e(t).length;
929
+ g(null, t.blocks, () => !1);
930
+ let _ = [...r.values()].map(({ block: e }) => e).filter((e) => e.type === "section"), v = /* @__PURE__ */ new Set(), y = (e) => {
931
+ for (let t of _) {
932
+ if (!m(t.id)) continue;
933
+ let r = et(n.get(t.id).block).length, a = et(t).length;
925
934
  (e ? a > r : a < r) && (i.push({
926
935
  op: "updateBlock",
927
936
  blockId: t.id,
928
937
  set: { columns: t.columns }
929
- }), h.add(t.id));
938
+ }), v.add(t.id));
930
939
  }
931
940
  };
932
- g(!0);
933
- for (let e of m) {
934
- let t = !d(e.id);
935
- $e(e).forEach((n, r) => {
936
- Array.isArray(n) && p({
941
+ y(!0);
942
+ for (let { block: e } of r.values()) {
943
+ if (e.type !== "wrapper") continue;
944
+ let t = !m(e.id);
945
+ g({ wrapperId: e.id }, e.children, (e) => t && !m(e.id));
946
+ }
947
+ for (let e of _) {
948
+ let t = !m(e.id);
949
+ et(e).forEach((n, r) => {
950
+ Array.isArray(n) && g({
937
951
  sectionId: e.id,
938
952
  column: r
939
- }, n, (e) => t && !d(e.id));
953
+ }, n, (e) => t && !m(e.id));
940
954
  });
941
955
  }
942
- g(!1);
943
- for (let e of l) i.push({
956
+ y(!1);
957
+ for (let e of f) i.push({
944
958
  op: "deleteBlock",
945
959
  blockId: e
946
960
  });
961
+ let b = (e) => e.type === "slot" || l(e).some((e) => e.some(b)), x = (e) => {
962
+ let t = [], n = e;
963
+ for (; n !== null;) {
964
+ let e = "wrapperId" in n ? n.wrapperId : n.sectionId;
965
+ "wrapperId" in n && t.push(e), n = r.get(e)?.parent ?? null;
966
+ }
967
+ return t;
968
+ }, S = new Set(i.flatMap((e) => {
969
+ if (e.op !== "addBlock" && e.op !== "moveBlock" || e.parent === null) return [];
970
+ let t = e.op === "addBlock" ? e.block : n.get(e.blockId)?.block;
971
+ return t && b(t) ? x(e.parent) : [];
972
+ })), C = /* @__PURE__ */ new Set(), w = [];
973
+ for (let [e, t] of n) {
974
+ let n = r.get(e);
975
+ if (S.has(e) && n && c(t.block)) for (let [r, i] of Object.entries(t.block.l10n ?? {})) i.hidden === !0 && n.block.l10n?.[r]?.hidden !== !0 && o.has(r) && (w.push({
976
+ op: "updateBlockLocale",
977
+ blockId: e,
978
+ locale: r,
979
+ hidden: !1
980
+ }), C.add(JSON.stringify([e, r])));
981
+ }
982
+ let T = /* @__PURE__ */ new Set(), E = [];
983
+ for (let [e, t] of n) {
984
+ let n = r.get(e);
985
+ n && c(t.block) && t.block.type === "section" && t.block.wrapper !== void 0 && n.block.wrapper === void 0 && n.parent !== null && "wrapperId" in n.parent && (T.add(e), E.push({
986
+ op: "updateBlock",
987
+ blockId: e,
988
+ unset: ["wrapper"]
989
+ }));
990
+ }
991
+ i.unshift(...w, ...E);
947
992
  for (let [e, t] of r) {
948
- if (!d(e)) continue;
949
- let { set: r, unset: a } = nt(n.get(e).block, t.block, h.has(e) ? Ye : Je);
950
- (Object.keys(r).length !== 0 || a.length !== 0) && i.push({
993
+ if (!m(e)) continue;
994
+ let r = rt(n.get(e).block, t.block, v.has(e) ? Xe : Ye), { set: a } = r, o = T.has(e) ? r.unset.filter((e) => e !== "wrapper") : r.unset;
995
+ (Object.keys(a).length !== 0 || o.length !== 0) && i.push({
951
996
  op: "updateBlock",
952
997
  blockId: e,
953
- ...Object.keys(r).length > 0 ? { set: r } : {},
954
- ...a.length > 0 ? { unset: a } : {}
998
+ ...Object.keys(a).length > 0 ? { set: a } : {},
999
+ ...o.length > 0 ? { unset: o } : {}
955
1000
  });
956
1001
  }
957
- let _ = nt(e.settings, t.settings, Ze);
958
- (Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
1002
+ let D = rt(e.settings, t.settings, Qe);
1003
+ (Object.keys(D.set).length > 0 || D.unset.length > 0) && i.push({
959
1004
  op: "updateSettings",
960
- ...Object.keys(_.set).length > 0 ? { set: _.set } : {},
961
- ..._.unset.length > 0 ? { unset: _.unset } : {}
1005
+ ...Object.keys(D.set).length > 0 ? { set: D.set } : {},
1006
+ ...D.unset.length > 0 ? { unset: D.unset } : {}
962
1007
  });
963
- let v = new Set(e.settings.locales ?? []), y = new Set(t.settings.locales ?? []);
964
- for (let e of y) v.has(e) || i.push({
1008
+ for (let e of a) o.has(e) || i.push({
965
1009
  op: "addLocale",
966
1010
  locale: e
967
1011
  });
968
1012
  for (let [e, t] of r) {
969
- if (!d(e)) continue;
970
- let r = n.get(e).block.l10n ?? {}, a = t.block.l10n ?? {};
971
- for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(a)])) {
972
- if (!y.has(t)) continue;
973
- let n = rt(r[t], a[t]);
974
- Object.keys(n).length > 0 && i.push({
1013
+ if (!m(e)) continue;
1014
+ let r = n.get(e).block.l10n ?? {}, o = t.block.l10n ?? {};
1015
+ for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(o)])) {
1016
+ if (!a.has(t)) continue;
1017
+ let n = it(r[t], o[t]);
1018
+ C.has(JSON.stringify([e, t])) && delete n.hidden, Object.keys(n).length > 0 && i.push({
975
1019
  op: "updateBlockLocale",
976
1020
  blockId: e,
977
1021
  locale: t,
@@ -979,17 +1023,17 @@ function it(e, t) {
979
1023
  });
980
1024
  }
981
1025
  }
982
- let b = e.settings.l10n ?? {}, x = t.settings.l10n ?? {};
983
- for (let e of /* @__PURE__ */ new Set([...Object.keys(b), ...Object.keys(x)])) {
984
- if (!y.has(e)) continue;
985
- let t = rt(b[e], x[e]);
1026
+ let O = e.settings.l10n ?? {}, k = t.settings.l10n ?? {};
1027
+ for (let e of /* @__PURE__ */ new Set([...Object.keys(O), ...Object.keys(k)])) {
1028
+ if (!a.has(e)) continue;
1029
+ let t = it(O[e], k[e]);
986
1030
  Object.keys(t).length > 0 && i.push({
987
1031
  op: "updateSettingsLocale",
988
1032
  locale: e,
989
1033
  ...t
990
1034
  });
991
1035
  }
992
- for (let e of v) y.has(e) || i.push({
1036
+ for (let e of o) a.has(e) || i.push({
993
1037
  op: "removeLocale",
994
1038
  locale: e
995
1039
  });
@@ -997,23 +1041,30 @@ function it(e, t) {
997
1041
  }
998
1042
  function $(e) {
999
1043
  let t = /* @__PURE__ */ new Map(), n = (e) => {
1000
- t.set(e.id, e), e.type === "section" && e.children.flat().forEach(n);
1044
+ t.set(e.id, e), e.type === "section" ? e.children.flat().forEach(n) : e.type === "wrapper" && e.children.forEach(n);
1001
1045
  };
1002
1046
  return e.forEach(n), t;
1003
1047
  }
1004
- function at(e, t) {
1048
+ function ot(e, t) {
1005
1049
  if (t === null) return e.blocks;
1006
- let n = $(e.blocks).get(t.sectionId);
1007
- return n.type === "section" ? n.children[t.column] : [];
1050
+ if ("sectionId" in t) {
1051
+ let n = $(e.blocks).get(t.sectionId);
1052
+ return n?.type === "section" ? n.children[t.column] : [];
1053
+ }
1054
+ let n = $(e.blocks).get(t.wrapperId);
1055
+ return n?.type === "wrapper" ? n.children : [];
1008
1056
  }
1009
- function ot(e, t) {
1057
+ function st(e, t) {
1010
1058
  let n = (e, r) => {
1011
1059
  let i = e.findIndex((e) => e.id === t);
1012
1060
  if (i >= 0) return {
1013
1061
  parent: r,
1014
1062
  after: e[i - 1]?.id ?? null
1015
1063
  };
1016
- for (let t of e) if (t.type === "section") for (let [e, r] of t.children.entries()) {
1064
+ for (let t of e) if (t.type === "wrapper") {
1065
+ let e = n(t.children, { wrapperId: t.id });
1066
+ if (e) return e;
1067
+ } else if (t.type === "section") for (let [e, r] of t.children.entries()) {
1017
1068
  let i = n(r, {
1018
1069
  sectionId: t.id,
1019
1070
  column: e
@@ -1023,22 +1074,22 @@ function ot(e, t) {
1023
1074
  };
1024
1075
  return n(e.blocks, null);
1025
1076
  }
1026
- function st(e, t, n, r, i) {
1077
+ function ct(e, t, n, r, i) {
1027
1078
  if (r !== null) return r;
1028
- let a = at(t, n).find((e) => e.id !== i), o = at(e, n).filter((e) => e.id !== i);
1079
+ let a = ot(t, n).find((e) => e.id !== i), o = ot(e, n).filter((e) => e.id !== i);
1029
1080
  return o[(a ? o.findIndex((e) => e.id === a.id) : o.length) - 1]?.id ?? null;
1030
1081
  }
1031
- function ct(e, t, n) {
1082
+ function lt(e, t, n) {
1032
1083
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1033
1084
  }
1034
- function lt(e) {
1035
- let t = G(e);
1036
- return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(lt))), t;
1085
+ function ut(e) {
1086
+ let t = R(e);
1087
+ return delete t.l10n, t.type === "section" ? t.children = t.children.map((e) => e.map(ut)) : t.type === "wrapper" && (t.children = t.children.map(ut)), t;
1037
1088
  }
1038
- function ut(e, t, n, r) {
1039
- let i = M(e, t), a = G(e), o = G(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1089
+ function dt(e, t, n, r) {
1090
+ let i = le(e, t), a = R(e), o = R(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1040
1091
  for (let [i, a] of $(n)) c.set(i, {
1041
- initial: P(a, t, K(e)),
1092
+ initial: A(a, t, W(e)),
1042
1093
  added: r,
1043
1094
  changed: !1
1044
1095
  });
@@ -1048,7 +1099,7 @@ function ut(e, t, n, r) {
1048
1099
  if (t.some((e) => e?.op === "setDefaultLocale")) throw new V("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1049
1100
  if (t.some((e) => e?.op === "setContent")) throw new V("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1050
1101
  try {
1051
- return E(e, t);
1102
+ return K(e, t);
1052
1103
  } catch (e) {
1053
1104
  throw e instanceof V ? new V(e.code, n, e.message, e.blockId) : e;
1054
1105
  }
@@ -1057,19 +1108,19 @@ function ut(e, t, n, r) {
1057
1108
  }, p = (e, n) => {
1058
1109
  let o = c.get(e);
1059
1110
  if (!o?.changed) return;
1060
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = G(a), d = at(u, ot(u, e).parent), p = G(s);
1061
- if (o.added) p = lt(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
1111
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = R(a), d = ot(u, st(u, e).parent), p = R(s);
1112
+ if (o.added) p = ut(l), p.type === "section" && s.type === "section" ? (p.children = s.children, p.columns = s.columns) : p.type === "wrapper" && s.type === "wrapper" && (p.children = s.children);
1062
1113
  else {
1063
1114
  let e = p.type === "section" ? {
1064
1115
  ...l,
1065
1116
  children: p.children,
1066
1117
  columns: p.columns
1067
1118
  } : l;
1068
- De(p, e, (e) => $(a.blocks).get(e) ?? null), p = j(p);
1119
+ Oe(p, e, (e) => $(a.blocks).get(e) ?? null), p = ee(p);
1069
1120
  let n = p.l10n?.[t];
1070
- ct(p, t, ke(n, Ee(p, o.initial, n, r), Ee(p, l, n, r), p, l));
1121
+ lt(p, t, Ae(n, X(p, o.initial, n, r), X(p, l, n, r), p, l));
1071
1122
  }
1072
- d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
1123
+ d[d.findIndex((t) => t.id === e)] = p, f(at(a, u), n), o.changed = !1;
1073
1124
  }, m = (e, t, n) => {
1074
1125
  let r = $(a.blocks).get(e.blockId), i = $(t.blocks).get(e.blockId);
1075
1126
  if (r.type !== "section" || i.type !== "section" || r.columns === i.columns) return;
@@ -1088,7 +1139,7 @@ function ut(e, t, n, r) {
1088
1139
  op: "updateBlock",
1089
1140
  blockId: e.blockId,
1090
1141
  set: { columns: i.columns },
1091
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, N(u, e) ?? null])) } : {}
1142
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, q(u, e) ?? null])) } : {}
1092
1143
  }], n);
1093
1144
  };
1094
1145
  n.forEach((e, t) => {
@@ -1096,19 +1147,19 @@ function ut(e, t, n, r) {
1096
1147
  let n = d(i, [e], t);
1097
1148
  switch (e.op) {
1098
1149
  case "addBlock": {
1099
- let n = lt(e.block);
1150
+ let n = ut(e.block);
1100
1151
  f([{
1101
1152
  ...e,
1102
1153
  block: n,
1103
- after: st(a, i, e.parent, e.after)
1154
+ after: ct(a, i, e.parent, e.after)
1104
1155
  }], t), l([n], !0);
1105
1156
  break;
1106
1157
  }
1107
1158
  case "moveBlock":
1108
1159
  f([{
1109
1160
  ...e,
1110
- after: st(a, i, e.parent, e.after, e.blockId),
1111
- ...e.expect ? { expect: ot(a, e.blockId) } : {}
1161
+ after: ct(a, i, e.parent, e.after, e.blockId),
1162
+ ...e.expect ? { expect: st(a, e.blockId) } : {}
1112
1163
  }], t);
1113
1164
  break;
1114
1165
  case "deleteBlock": {
@@ -1133,18 +1184,18 @@ function ut(e, t, n, r) {
1133
1184
  });
1134
1185
  for (let e of c.keys()) p(e, n.length - 1);
1135
1186
  if (s) {
1136
- let e = G(a), r = e.settings.l10n?.[t];
1137
- ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
1187
+ let e = R(a), r = e.settings.l10n?.[t];
1188
+ lt(e.settings, t, Ae(r, ke(e.settings, o, r), ke(e.settings, i.settings, r), e.settings, i.settings)), f(at(a, e), n.length - 1);
1138
1189
  }
1139
1190
  return u;
1140
1191
  }
1141
- var dt = 1e3, ft = 1e4, pt = [
1192
+ var ft = 1e3, pt = 1e4, mt = [
1142
1193
  1e3,
1143
1194
  2e3,
1144
1195
  5e3,
1145
1196
  1e4,
1146
1197
  3e4
1147
- ], mt = 50, ht = 100, gt = /* @__PURE__ */ new Set([
1198
+ ], ht = 50, gt = 100, _t = /* @__PURE__ */ new Set([
1148
1199
  "block_exists",
1149
1200
  "block_missing",
1150
1201
  "anchor_missing",
@@ -1155,49 +1206,49 @@ var dt = 1e3, ft = 1e4, pt = [
1155
1206
  "lock_lost",
1156
1207
  "content_too_large"
1157
1208
  ]);
1158
- function _t(e, t) {
1209
+ function vt(e, t) {
1159
1210
  return e.ops.some((e) => e.op === "setContent") ? e.view = t : delete e.view, e;
1160
1211
  }
1161
- function vt(e) {
1212
+ function yt(e) {
1162
1213
  let t = e?.code;
1163
- return typeof t == "string" && gt.has(t) ? t : null;
1214
+ return typeof t == "string" && _t.has(t) ? t : null;
1164
1215
  }
1165
- function yt(e) {
1216
+ function bt(e) {
1166
1217
  let t = e?.holder;
1167
1218
  return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
1168
1219
  }
1169
- function bt(e) {
1220
+ function xt(e) {
1170
1221
  let t = e?.statusCode;
1171
1222
  return typeof t != "number" || t >= 500 || t === 408 || t === 429;
1172
1223
  }
1173
- function xt(e, t) {
1224
+ function St(e, t) {
1174
1225
  return e.some((e) => {
1175
1226
  if (e.id === t) return !0;
1176
1227
  let n = e.children;
1177
- return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && xt(e, t));
1228
+ return e.type === "wrapper" && Array.isArray(n) && St(n, t) || e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && St(e, t));
1178
1229
  });
1179
1230
  }
1180
- function St(e) {
1231
+ function Ct(e) {
1181
1232
  if (e.length === 1 && e[0].op === "updateSettings") return !0;
1182
1233
  let t = e[0];
1183
1234
  return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId) || t.op === "updateBlockLocale" && e.every((e) => e.op === "updateBlockLocale" && e.blockId === t.blockId && e.locale === t.locale);
1184
1235
  }
1185
- function Ct(e) {
1236
+ function wt(e) {
1186
1237
  return e.map((e) => {
1187
1238
  if (!("expect" in e)) return e;
1188
1239
  let { expect: t, ...n } = e;
1189
1240
  return n;
1190
1241
  });
1191
1242
  }
1192
- function wt(e) {
1193
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, D = null, O = 0, k = !1, A = [], j = null, M = null, ee = Promise.resolve(), te = null, ne = r(() => (g.value, (b?.undo.length ?? 0) > 0)), N = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1243
+ function Tt(e) {
1244
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? ht, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, E = null, D = 0, O = !1, k = [], A = null, j = null, ee = Promise.resolve(), M = null, N = r(() => (g.value, (b?.undo.length ?? 0) > 0)), te = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1194
1245
  function P(t) {
1195
1246
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1196
1247
  }
1197
1248
  function F(t, n = b) {
1198
- n !== b || k || e.onNotice?.(t);
1249
+ n !== b || O || e.onNotice?.(t);
1199
1250
  }
1200
- function I() {
1251
+ function ne() {
1201
1252
  return {
1202
1253
  locks: [...s.value.values()].map((e) => ({
1203
1254
  blockId: e.blockId,
@@ -1207,62 +1258,62 @@ function wt(e) {
1207
1258
  session: n
1208
1259
  };
1209
1260
  }
1210
- function R() {
1261
+ function I() {
1211
1262
  g.value++;
1212
1263
  }
1213
- function re(e, t) {
1264
+ function L(e, t) {
1214
1265
  e.push(t), e.length > i && e.splice(0, e.length - i);
1215
1266
  }
1216
1267
  function z(e) {
1217
1268
  if (!_ || S) return;
1218
1269
  C = !0;
1219
1270
  try {
1220
- let t = _.content.value, n = it(t, e);
1271
+ let t = _.content.value, n = at(t, e);
1221
1272
  if (n.length > 0) try {
1222
- de(t, n);
1273
+ re(t, n);
1223
1274
  } catch {
1224
- _.setContent(G(e), !1);
1275
+ _.setContent(R(e), !1);
1225
1276
  }
1226
- L(_.content.value, e) || _.setContent(G(e), !1);
1277
+ B(_.content.value, e) || _.setContent(R(e), !1);
1227
1278
  } finally {
1228
1279
  C = !1;
1229
1280
  }
1230
1281
  let t = _.state.selectedBlockId;
1231
- t && !xt(e.blocks, t) && _.selectBlock(null);
1282
+ t && !St(e.blocks, t) && _.selectBlock(null);
1232
1283
  }
1233
1284
  function ie() {
1234
1285
  C || T || (T = !0, queueMicrotask(() => {
1235
- T = !1, H(!1);
1286
+ T = !1, oe(!1);
1236
1287
  }));
1237
1288
  }
1238
- function B() {
1239
- D &&= (clearTimeout(D), null);
1289
+ function ae() {
1290
+ E &&= (clearTimeout(E), null);
1240
1291
  }
1241
- function H(e, t = !1) {
1292
+ function oe(e, t = !1) {
1242
1293
  let n = b;
1243
1294
  if (!_ || !n || S || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1244
- let r = it(n.view, _.content.value);
1245
- if (r.length === 0) B();
1295
+ let r = at(n.view, _.content.value);
1296
+ if (r.length === 0) ae();
1246
1297
  else {
1247
- if (!e && St(r)) {
1298
+ if (!e && Ct(r)) {
1248
1299
  let e = Date.now();
1249
- if (D === null && (O = e), e - O < 1e3) {
1250
- D && clearTimeout(D), D = setTimeout(() => {
1251
- D = null, H(!0);
1300
+ if (E === null && (D = e), e - D < 1e3) {
1301
+ E && clearTimeout(E), E = setTimeout(() => {
1302
+ E = null, oe(!0);
1252
1303
  }, 300);
1253
1304
  return;
1254
1305
  }
1255
1306
  }
1256
- B(), oe(n, r);
1307
+ ae(), se(n, r);
1257
1308
  }
1258
1309
  }
1259
- function U() {
1260
- H(!0);
1310
+ function H() {
1311
+ oe(!0);
1261
1312
  }
1262
- function oe(e, t) {
1313
+ function se(e, t) {
1263
1314
  let n = t, r;
1264
1315
  try {
1265
- r = E(e.view, n, I());
1316
+ r = K(e.view, n, ne());
1266
1317
  } catch (n) {
1267
1318
  if (!(n instanceof V)) throw n;
1268
1319
  z(e.view);
@@ -1278,13 +1329,13 @@ function wt(e) {
1278
1329
  return;
1279
1330
  }
1280
1331
  let i = _.content.value;
1281
- if (!L(r, i)) {
1332
+ if (!B(r, i)) {
1282
1333
  P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1283
1334
  op: "setContent",
1284
- content: G(i)
1335
+ content: R(i)
1285
1336
  }];
1286
1337
  try {
1287
- r = E(e.view, n, I());
1338
+ r = K(e.view, n, ne());
1288
1339
  } catch (t) {
1289
1340
  if (!(t instanceof V)) throw t;
1290
1341
  z(e.view), F({
@@ -1294,15 +1345,15 @@ function wt(e) {
1294
1345
  return;
1295
1346
  }
1296
1347
  }
1297
- let a = _t({ ops: ae(e.view, n) }, r);
1298
- re(e.undo, a), e.redo = [], R();
1348
+ let a = vt({ ops: pe(e.view, n) }, r);
1349
+ L(e.undo, a), e.redo = [], I();
1299
1350
  let o = e.view;
1300
- e.view = r, se(e, n, "edit", a, o);
1351
+ e.view = r, ce(e, n, "edit", a, o);
1301
1352
  }
1302
- function se(e, t, n, r, i) {
1353
+ function ce(e, t, n, r, i) {
1303
1354
  let a = { dropped: !1 }, o = 0, s = i;
1304
1355
  do {
1305
- let i = t.slice(o, o + ht);
1356
+ let i = t.slice(o, o + gt);
1306
1357
  if (e.pending.push({
1307
1358
  batchId: crypto.randomUUID(),
1308
1359
  ops: i,
@@ -1312,62 +1363,62 @@ function wt(e) {
1312
1363
  sent: !1,
1313
1364
  revision: null,
1314
1365
  ...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
1315
- }), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
1316
- s = E(s, i);
1366
+ }), o += gt, s && t.slice(o).some((e) => e.op === "setContent")) try {
1367
+ s = K(s, i);
1317
1368
  } catch {
1318
1369
  s = null;
1319
1370
  }
1320
1371
  } while (o < t.length);
1321
- W(e);
1372
+ U(e);
1322
1373
  }
1323
- function W(e) {
1374
+ function U(e) {
1324
1375
  if (e.inFlight || w) return;
1325
1376
  let t = e.pending.find((e) => !e.sent);
1326
- t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : q(e);
1377
+ t ? (t.sent = !0, e.inFlight = t, le(e, t, 0)) : q(e);
1327
1378
  }
1328
- function ce(e, n, r) {
1379
+ function le(e, n, r) {
1329
1380
  t.submit(e.templateId, {
1330
1381
  batchId: n.batchId,
1331
1382
  baseRevision: n.baseRevision ??= e.revision,
1332
1383
  ops: n.ops,
1333
1384
  ...n.origin === "ai" ? { origin: "ai" } : {}
1334
1385
  }).then(({ revision: t }) => {
1335
- e.inFlight = null, le(e, n, t), W(e);
1386
+ e.inFlight = null, W(e, n, t), U(e);
1336
1387
  }, (t) => {
1337
- if (vt(t) !== null) e.inFlight = null, pe(e, n, t), W(e);
1338
- else if (bt(t)) {
1388
+ if (yt(t) !== null) e.inFlight = null, G(e, n, t), U(e);
1389
+ else if (xt(t)) {
1339
1390
  J(e, t);
1340
- let i = pt[Math.min(r, pt.length - 1)];
1391
+ let i = mt[Math.min(r, mt.length - 1)];
1341
1392
  setTimeout(() => {
1342
- k || ce(e, n, r + 1);
1393
+ O || le(e, n, r + 1);
1343
1394
  }, i);
1344
- } else e.inFlight = null, P(t), pe(e, n, t), W(e);
1395
+ } else e.inFlight = null, P(t), G(e, n, t), U(e);
1345
1396
  });
1346
1397
  }
1347
- function le(e, t, n) {
1348
- t.revision === null && (t.revision = n, n <= e.revision ? (K(e, t), _e(e)) : (e.own.set(n, t), ge(e)));
1398
+ function W(e, t, n) {
1399
+ t.revision === null && (t.revision = n, n <= e.revision ? (ue(e, t), _e(e)) : (e.own.set(n, t), ge(e)));
1349
1400
  }
1350
- function K(e, t) {
1401
+ function ue(e, t) {
1351
1402
  e.pending = e.pending.filter((e) => e !== t), q(e);
1352
1403
  }
1353
- function ue(e, t) {
1404
+ function de(e, t) {
1354
1405
  if (t.entry) {
1355
1406
  for (let n of [e.undo, e.redo]) {
1356
1407
  let e = n.indexOf(t.entry);
1357
1408
  e !== -1 && n.splice(e, 1);
1358
1409
  }
1359
- R();
1410
+ I();
1360
1411
  }
1361
1412
  }
1362
1413
  function fe(e, t) {
1363
1414
  let n = !t.group.dropped;
1364
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && ue(e, t), q(e), n;
1415
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && de(e, t), q(e), n;
1365
1416
  }
1366
- function pe(e, t, n) {
1367
- if (K(e, t), fe(e, t)) {
1368
- let r = vt(n) ?? "invalid_operation";
1417
+ function G(e, t, n) {
1418
+ if (ue(e, t), fe(e, t)) {
1419
+ let r = yt(n) ?? "invalid_operation";
1369
1420
  if (t.origin === "edit" || t.origin === "ai") {
1370
- let t = yt(n);
1421
+ let t = bt(n);
1371
1422
  F({
1372
1423
  type: "editRefused",
1373
1424
  code: r,
@@ -1378,7 +1429,7 @@ function wt(e) {
1378
1429
  code: r
1379
1430
  }, e);
1380
1431
  }
1381
- _e(e), e === b && Y();
1432
+ _e(e), e === b && xe();
1382
1433
  }
1383
1434
  function q(e) {
1384
1435
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
@@ -1390,7 +1441,7 @@ function wt(e) {
1390
1441
  function me(e, t) {
1391
1442
  if (t.revision <= e.revision) return;
1392
1443
  let n = e.pending.find((e) => e.batchId === t.batchId);
1393
- n ? le(e, n, t.revision) : (e.remote.set(t.revision, t), ge(e));
1444
+ n ? W(e, n, t.revision) : (e.remote.set(t.revision, t), ge(e));
1394
1445
  }
1395
1446
  function he(t, n) {
1396
1447
  let r = n.ops;
@@ -1399,7 +1450,7 @@ function wt(e) {
1399
1450
  } catch (e) {
1400
1451
  P(e);
1401
1452
  }
1402
- return Ct(r);
1453
+ return wt(r);
1403
1454
  }
1404
1455
  function ge(t) {
1405
1456
  let n = [], r = !1;
@@ -1407,16 +1458,16 @@ function wt(e) {
1407
1458
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1408
1459
  if (!i && !a) break;
1409
1460
  try {
1410
- t.confirmed = E(t.confirmed, i ? he(t, i) : a.ops);
1461
+ t.confirmed = K(t.confirmed, i ? he(t, i) : a.ops);
1411
1462
  } catch {
1412
1463
  if (t.recovering) {
1413
1464
  t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1414
1465
  return;
1415
1466
  }
1416
- xe(t);
1467
+ Se(t);
1417
1468
  return;
1418
1469
  }
1419
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), K(t, a));
1470
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), ue(t, a));
1420
1471
  }
1421
1472
  if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? ye(t) : be(t), (n.length !== 0 || r) && (_e(t), t === b)) for (let t of n) try {
1422
1473
  e.onRemoteChange?.({
@@ -1436,16 +1487,16 @@ function wt(e) {
1436
1487
  } finally {
1437
1488
  t && (w = !1);
1438
1489
  }
1439
- t && W(e);
1490
+ t && U(e);
1440
1491
  }
1441
1492
  function ve(e) {
1442
- e === b && U();
1493
+ e === b && H();
1443
1494
  let t = e.confirmed;
1444
1495
  for (let n = 0; n < e.pending.length; n++) {
1445
1496
  let r = e.pending[n], i;
1446
- if (r.base && !L(r.base, t)) i = "precondition_failed";
1497
+ if (r.base && !B(r.base, t)) i = "precondition_failed";
1447
1498
  else try {
1448
- t = E(t, r.ops);
1499
+ t = K(t, r.ops);
1449
1500
  continue;
1450
1501
  } catch (e) {
1451
1502
  i = e instanceof V ? e.code : "invalid_operation";
@@ -1462,20 +1513,20 @@ function wt(e) {
1462
1513
  }
1463
1514
  function ye(e) {
1464
1515
  e.gapTimer ||= setTimeout(() => {
1465
- e.gapTimer = null, e === b && Y();
1466
- }, dt);
1516
+ e.gapTimer = null, e === b && xe();
1517
+ }, ft);
1467
1518
  }
1468
1519
  function be(e) {
1469
1520
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1470
1521
  }
1471
- function Y() {
1522
+ function xe() {
1472
1523
  let e = b;
1473
1524
  return e ? (e.catchingUp ||= (async () => {
1474
1525
  try {
1475
1526
  let n = await t.operationsAfter(e.templateId, e.revision);
1476
1527
  if (e.retired) return;
1477
1528
  if ("resync" in n) {
1478
- await xe(e);
1529
+ await Se(e);
1479
1530
  return;
1480
1531
  }
1481
1532
  for (let t of n.batches) me(e, t);
@@ -1486,14 +1537,14 @@ function wt(e) {
1486
1537
  }
1487
1538
  })(), e.catchingUp) : Promise.resolve();
1488
1539
  }
1489
- async function xe(t) {
1540
+ async function Se(t) {
1490
1541
  t.recovering = !0;
1491
1542
  try {
1492
1543
  let n = await e.loadTemplate(t.templateId);
1493
1544
  if (t.retired) return;
1494
1545
  let r = n.revision ?? t.revision;
1495
- t.confirmed = G(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1496
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), K(t, n));
1546
+ t.confirmed = R(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1547
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), ue(t, n));
1497
1548
  t === b && (h.value = r), _e(t), ge(t);
1498
1549
  } catch (e) {
1499
1550
  P(e);
@@ -1501,7 +1552,7 @@ function wt(e) {
1501
1552
  t.recovering = !1;
1502
1553
  }
1503
1554
  }
1504
- function X(t) {
1555
+ function Ce(t) {
1505
1556
  let n = () => t === b && !t.retired;
1506
1557
  return {
1507
1558
  onBatch: (e) => {
@@ -1517,7 +1568,7 @@ function wt(e) {
1517
1568
  } catch (e) {
1518
1569
  P(e);
1519
1570
  }
1520
- Y();
1571
+ xe();
1521
1572
  }
1522
1573
  },
1523
1574
  onLock: (e) => {
@@ -1527,26 +1578,26 @@ function wt(e) {
1527
1578
  n() && Me(e, t, r);
1528
1579
  },
1529
1580
  onMembers: (e) => {
1530
- n() && Z(e);
1581
+ n() && Pe(e);
1531
1582
  },
1532
1583
  onConnectionChange: (e) => {
1533
- n() && Te(t, e);
1584
+ n() && Ee(t, e);
1534
1585
  }
1535
1586
  };
1536
1587
  }
1537
- function Se(e, r) {
1588
+ function Y(e, r) {
1538
1589
  let i = d;
1539
- t.join(e.templateId, { sessionId: n }, X(e)).then((t) => {
1540
- e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && Y(), r && Pe());
1590
+ t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
1591
+ e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Pe(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && xe(), r && Q());
1541
1592
  }, (e) => P(e));
1542
1593
  }
1543
- function Ce(e) {
1544
- let t = G(e.content), n = {
1594
+ function we(e) {
1595
+ let t = R(e.content), n = {
1545
1596
  templateId: e.id,
1546
1597
  confirmed: t,
1547
1598
  revision: e.revision ?? 0,
1548
1599
  pending: [],
1549
- view: G(t),
1600
+ view: R(t),
1550
1601
  remote: /* @__PURE__ */ new Map(),
1551
1602
  own: /* @__PURE__ */ new Map(),
1552
1603
  inFlight: null,
@@ -1559,19 +1610,19 @@ function wt(e) {
1559
1610
  redo: [],
1560
1611
  waiters: []
1561
1612
  };
1562
- b = n, h.value = n.revision, R(), Se(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), ie();
1613
+ b = n, h.value = n.revision, I(), Y(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), ie();
1563
1614
  }
1564
- function we(e) {
1615
+ function Te(e) {
1565
1616
  e.retired = !0, be(e), e.leave?.(), e.leave = null, J(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1566
1617
  }
1567
- function Te(e, t) {
1618
+ function Ee(e, t) {
1568
1619
  let n = m.value;
1569
- m.value = t, t === "connected" && n !== null && n !== "connected" && Se(e, !0);
1620
+ m.value = t, t === "connected" && n !== null && n !== "connected" && Y(e, !0);
1570
1621
  }
1571
- function Ee(e) {
1572
- b && b.templateId === e?.id || (b &&= (B(), we(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, j = null, Pe(), R(), e && Ce(e));
1622
+ function De(e) {
1623
+ b && b.templateId === e?.id || (b &&= (ae(), Te(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Q(), I(), e && we(e));
1573
1624
  }
1574
- function De(e, t) {
1625
+ function X(e, t) {
1575
1626
  return `${e}\u0000${t ?? ""}`;
1576
1627
  }
1577
1628
  function Oe(e, t, n) {
@@ -1581,55 +1632,55 @@ function wt(e) {
1581
1632
  return [...s.value.values()].filter((t) => t.blockId === e);
1582
1633
  }
1583
1634
  function Ae(e) {
1584
- e !== f.value && (U(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1635
+ e !== f.value && (H(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1585
1636
  }
1586
1637
  function je(e, t = !1) {
1587
1638
  if (e.holder.sessionId === n) return;
1588
1639
  t ? c.add(e) : u.set(e, ++d);
1589
1640
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1590
- r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), F({
1641
+ r.set(X(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), F({
1591
1642
  type: "selectionRefused",
1592
1643
  blockId: e.blockId,
1593
1644
  holder: e.holder
1594
1645
  }));
1595
1646
  }
1596
1647
  function Me(e, t, n) {
1597
- let r = De(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
1648
+ let r = X(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
1598
1649
  i.size !== s.value.size && (s.value = i);
1599
1650
  }
1600
1651
  function Ne(e, t, r) {
1601
1652
  let i = new Map([...s.value].filter(([, e]) => !c.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
1602
1653
  for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Oe(e, t.blockId, t.locale))) {
1603
1654
  for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
1604
- i.set(De(t.blockId, t.locale), t);
1655
+ i.set(X(t.blockId, t.locale), t);
1605
1656
  }
1606
1657
  s.value = i;
1607
1658
  }
1608
- function Z(e) {
1659
+ function Pe(e) {
1609
1660
  let t = new Set(e.map((e) => e.sessionId)), n = new Set(o.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1610
1661
  if (o.value = e, n.size === 0) return;
1611
1662
  let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1612
1663
  r.size !== s.value.size && (s.value = r);
1613
1664
  }
1614
- function Q(e) {
1665
+ function Z(e) {
1615
1666
  ee = ee.then(e).catch(P);
1616
1667
  }
1617
- function Pe() {
1618
- a && Q(async () => {
1619
- if (M && (j === null || M.templateId !== j.templateId || M.locale !== j.locale)) {
1620
- let e = M;
1621
- M = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1668
+ function Q() {
1669
+ a && Z(async () => {
1670
+ if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
1671
+ let e = j;
1672
+ j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1622
1673
  }
1623
- let e = j;
1624
- if (!(!e || M?.templateId === e.templateId && M.blockId === e.blockId && M.locale === e.locale)) try {
1674
+ let e = A;
1675
+ if (!(!e || j?.templateId === e.templateId && j.blockId === e.blockId && j.locale === e.locale)) try {
1625
1676
  let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
1626
- M = e, Le(), Fe(n.blockId, n.locale ?? null);
1677
+ j = e, Le(), Fe(n.blockId, n.locale ?? null);
1627
1678
  } catch (n) {
1628
- if (M?.templateId === e.templateId) {
1629
- let e = M;
1630
- M = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1679
+ if (j?.templateId === e.templateId) {
1680
+ let e = j;
1681
+ j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1631
1682
  }
1632
- if (j !== e) return;
1683
+ if (A !== e) return;
1633
1684
  Ie(e.blockId, n);
1634
1685
  }
1635
1686
  });
@@ -1639,55 +1690,55 @@ function wt(e) {
1639
1690
  n.size !== s.value.size && (s.value = n);
1640
1691
  }
1641
1692
  function Ie(e, t) {
1642
- let n = vt(t);
1693
+ let n = yt(t);
1643
1694
  if (n === "lock_held" || n === "block_missing") {
1644
- j = null;
1645
- let n = yt(t);
1695
+ A = null;
1696
+ let n = bt(t);
1646
1697
  n ? je({
1647
1698
  blockId: e,
1648
1699
  holder: n,
1649
1700
  expiresAt: ""
1650
1701
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1651
1702
  } else P(t), setTimeout(() => {
1652
- j?.blockId === e && Pe();
1653
- }, pt[0]);
1703
+ A?.blockId === e && Q();
1704
+ }, mt[0]);
1654
1705
  }
1655
1706
  function Le() {
1656
- te ||= setInterval(() => {
1657
- Q(async () => {
1658
- let e = M;
1707
+ M ||= setInterval(() => {
1708
+ Z(async () => {
1709
+ let e = j;
1659
1710
  if (e) try {
1660
1711
  await t.renewLock(e.templateId, e.blockId, e.locale);
1661
1712
  } catch (e) {
1662
- if (vt(e) === "lock_lost") {
1663
- M = null, Re(), Pe();
1713
+ if (yt(e) === "lock_lost") {
1714
+ j = null, Re(), Q();
1664
1715
  return;
1665
1716
  }
1666
1717
  P(e);
1667
1718
  }
1668
1719
  });
1669
- }, ft);
1720
+ }, pt);
1670
1721
  }
1671
1722
  function Re() {
1672
- te &&= (clearInterval(te), null);
1723
+ M &&= (clearInterval(M), null);
1673
1724
  }
1674
1725
  function ze(e) {
1675
- U(), b && (j = e ? {
1726
+ H(), b && (A = e ? {
1676
1727
  templateId: b.templateId,
1677
1728
  blockId: e,
1678
1729
  locale: f.value
1679
- } : null, Pe());
1730
+ } : null, Q());
1680
1731
  }
1681
1732
  function Be() {
1682
- U(), M && a && (t.releaseLock(M.templateId, M.blockId, M.locale).catch(() => {}), M = null, Re()), b?.leave?.(), b && (b.leave = null);
1733
+ H(), j && a && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, Re()), b?.leave?.(), b && (b.leave = null);
1683
1734
  }
1684
1735
  function Ve(e) {
1685
1736
  let t = b;
1686
1737
  if (!t || S) return;
1687
- U();
1738
+ H();
1688
1739
  let n = (e === "undo" ? t.undo : t.redo).pop();
1689
1740
  if (!n) return;
1690
- if (R(), n.view && !L(n.view, t.view)) {
1741
+ if (I(), n.view && !B(n.view, t.view)) {
1691
1742
  F({
1692
1743
  type: "undoSkipped",
1693
1744
  code: "precondition_failed"
@@ -1696,7 +1747,7 @@ function wt(e) {
1696
1747
  }
1697
1748
  let r;
1698
1749
  try {
1699
- r = E(t.view, n.ops, I());
1750
+ r = K(t.view, n.ops, ne());
1700
1751
  } catch (e) {
1701
1752
  if (!(e instanceof V)) throw e;
1702
1753
  F({
@@ -1705,10 +1756,10 @@ function wt(e) {
1705
1756
  });
1706
1757
  return;
1707
1758
  }
1708
- let i = _t({ ops: ae(t.view, n.ops) }, r);
1709
- re(e === "undo" ? t.redo : t.undo, i);
1759
+ let i = vt({ ops: pe(t.view, n.ops) }, r);
1760
+ L(e === "undo" ? t.redo : t.undo, i);
1710
1761
  let a = t.view;
1711
- t.view = r, z(r), _?.markDirty(), se(t, n.ops, e, i, a);
1762
+ t.view = r, z(r), _?.markDirty(), ce(t, n.ops, e, i, a);
1712
1763
  }
1713
1764
  function He(e, t) {
1714
1765
  let n = b;
@@ -1717,7 +1768,7 @@ function wt(e) {
1717
1768
  error: new V("invalid_operation", 0, "No template is open for editing.")
1718
1769
  };
1719
1770
  if (t.origin === void 0) try {
1720
- E(_.content.value, e, I());
1771
+ K(_.content.value, e, ne());
1721
1772
  } catch (e) {
1722
1773
  if (e instanceof V) return {
1723
1774
  applied: !1,
@@ -1725,10 +1776,10 @@ function wt(e) {
1725
1776
  };
1726
1777
  throw e;
1727
1778
  }
1728
- U();
1779
+ H();
1729
1780
  let r, i;
1730
1781
  try {
1731
- r = E(n.view, e, I()), i = ae(n.view, e);
1782
+ r = K(n.view, e, ne()), i = pe(n.view, e);
1732
1783
  } catch (e) {
1733
1784
  if (e instanceof V) return {
1734
1785
  applied: !1,
@@ -1738,15 +1789,15 @@ function wt(e) {
1738
1789
  }
1739
1790
  let a = n.undo.at(-1), o;
1740
1791
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1741
- let e = a.view !== void 0 && !L(a.view, n.view);
1742
- a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
1743
- } else o = _t({
1792
+ let e = a.view !== void 0 && !B(a.view, n.view);
1793
+ a.ops = [...i, ...a.ops], o = e ? a : vt(a, r);
1794
+ } else o = vt({
1744
1795
  ops: i,
1745
1796
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1746
- }, r), re(n.undo, o);
1747
- n.redo = [], R();
1797
+ }, r), L(n.undo, o);
1798
+ n.redo = [], I();
1748
1799
  let s = n.view;
1749
- return n.view = r, z(r), _.markDirty(), se(n, e, t.origin ?? "edit", o, s), {
1800
+ return n.view = r, z(r), _.markDirty(), ce(n, e, t.origin ?? "edit", o, s), {
1750
1801
  applied: !0,
1751
1802
  inverse: i
1752
1803
  };
@@ -1757,28 +1808,28 @@ function wt(e) {
1757
1808
  if (t.moveBlock && t.findBlockLocation) {
1758
1809
  let n = t.moveBlock, r = (...r) => {
1759
1810
  let i = b, a = i && !S && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1760
- if (a && H(!0), n(...r), !a || L(i.view, e.content.value)) return;
1811
+ if (a && oe(!0), n(...r), !a || B(i.view, e.content.value)) return;
1761
1812
  let o = t.findBlockLocation(r[0]);
1762
1813
  if (!o) return;
1763
1814
  let s = o.targetSectionId ? {
1764
1815
  sectionId: o.targetSectionId,
1765
1816
  column: o.columnIndex ?? 0
1766
1817
  } : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0, l = s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks;
1767
- oe(i, [{
1818
+ se(i, [{
1768
1819
  op: "moveBlock",
1769
1820
  blockId: r[0],
1770
1821
  parent: s,
1771
1822
  after: l[o.index - 1]?.id ?? null
1772
1823
  }]);
1773
1824
  };
1774
- t.moveBlock = r, A.push(() => {
1825
+ t.moveBlock = r, k.push(() => {
1775
1826
  t.moveBlock === r && (t.moveBlock = n);
1776
1827
  });
1777
1828
  }
1778
- A.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, ie, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : ie())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
1829
+ k.push(v(() => e.state.template, (e) => De(e), { immediate: !0 }), v(() => e.content.value, ie, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? oe(!0, !0) : ie())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", H)), x() && l(qe);
1779
1830
  }
1780
1831
  function We() {
1781
- U();
1832
+ H();
1782
1833
  let e = b;
1783
1834
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1784
1835
  resolve: t,
@@ -1786,16 +1837,16 @@ function wt(e) {
1786
1837
  }));
1787
1838
  }
1788
1839
  function Ge() {
1789
- U(), S = !0;
1840
+ H(), S = !0;
1790
1841
  }
1791
1842
  function Ke() {
1792
1843
  S = !1, b && z(b.view);
1793
1844
  }
1794
1845
  function qe() {
1795
- if (!k) {
1796
- U();
1797
- for (let e of A.splice(0)) e();
1798
- B(), Be(), k = !0, b && we(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
1846
+ if (!O) {
1847
+ H();
1848
+ for (let e of k.splice(0)) e();
1849
+ ae(), Be(), O = !0, b && Te(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", H));
1799
1850
  }
1800
1851
  }
1801
1852
  return {
@@ -1807,25 +1858,25 @@ function wt(e) {
1807
1858
  setLockLocale: Ae,
1808
1859
  connection: m,
1809
1860
  revision: h,
1810
- canUndo: ne,
1811
- canRedo: N,
1861
+ canUndo: N,
1862
+ canRedo: te,
1812
1863
  attach: Ue,
1813
1864
  undo: () => Ve("undo"),
1814
1865
  redo: () => Ve("redo"),
1815
1866
  clearHistory: () => {
1816
- b && (b.undo = [], b.redo = [], R());
1867
+ b && (b.undo = [], b.redo = [], I());
1817
1868
  },
1818
- flush: U,
1869
+ flush: H,
1819
1870
  settle: We,
1820
1871
  suspend: Ge,
1821
1872
  resume: Ke,
1822
- catchUp: Y,
1823
- hasConfirmedBlock: (e) => b ? xt(b.confirmed.blocks, e) : !1,
1873
+ catchUp: xe,
1874
+ hasConfirmedBlock: (e) => b ? St(b.confirmed.blocks, e) : !1,
1824
1875
  applyOperations: He,
1825
1876
  destroy: qe
1826
1877
  };
1827
1878
  }
1828
- function Tt(e) {
1879
+ function Et(e) {
1829
1880
  let { provider: t } = e, n = p([]), r = p(!1), i = d(() => {
1830
1881
  let e = /* @__PURE__ */ new Set();
1831
1882
  for (let t of n.value) {
@@ -1841,10 +1892,10 @@ function Tt(e) {
1841
1892
  return s.value && e.canDelete !== !1;
1842
1893
  }
1843
1894
  function u(e, t) {
1844
- throw new z(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1895
+ throw new G(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1845
1896
  }
1846
1897
  function f(t) {
1847
- Fe(e.onError, t);
1898
+ Ie(e.onError, t);
1848
1899
  }
1849
1900
  async function m(i) {
1850
1901
  r.value = !0;
@@ -1911,9 +1962,9 @@ function Tt(e) {
1911
1962
  remove: _
1912
1963
  };
1913
1964
  }
1914
- var Et = "templatical:saved-blocks";
1915
- function Dt(e = {}) {
1916
- let t = e.key ?? Et;
1965
+ var Dt = "templatical:saved-blocks";
1966
+ function Ot(e = {}) {
1967
+ let t = e.key ?? Dt;
1917
1968
  function n() {
1918
1969
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
1919
1970
  return localStorage;
@@ -1938,7 +1989,7 @@ function Dt(e = {}) {
1938
1989
  },
1939
1990
  async create(e) {
1940
1991
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1941
- id: le(),
1992
+ id: U(),
1942
1993
  name: e.name,
1943
1994
  content: e.content,
1944
1995
  ...e.category ? { category: e.category } : {},
@@ -1964,9 +2015,9 @@ function Dt(e = {}) {
1964
2015
  }
1965
2016
  };
1966
2017
  }
1967
- var Ot = "templatical:media", kt = 50;
1968
- function At(e = {}) {
1969
- let t = e.key ?? Ot;
2018
+ var kt = "templatical:media", At = 50;
2019
+ function jt(e = {}) {
2020
+ let t = e.key ?? kt;
1970
2021
  function n() {
1971
2022
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
1972
2023
  return localStorage;
@@ -1999,12 +2050,12 @@ function At(e = {}) {
1999
2050
  let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
2000
2051
  let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
2001
2052
  return t.includes(n) || r.includes(n);
2002
- }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + kt), c = { items: s }, l = o + s.length;
2053
+ }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + At), c = { items: s }, l = o + s.length;
2003
2054
  return l < i.length && (c.nextCursor = String(l)), c;
2004
2055
  },
2005
2056
  async create(e) {
2006
2057
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2007
- id: le(),
2058
+ id: U(),
2008
2059
  url: t,
2009
2060
  filename: e.filename || e.file.name,
2010
2061
  createdAt: n,
@@ -2039,18 +2090,18 @@ function At(e = {}) {
2039
2090
  storage: !1
2040
2091
  };
2041
2092
  }
2042
- function jt(e) {
2093
+ function Mt(e) {
2043
2094
  let { provider: t, getTemplateId: n } = e, r = p([]), i = p(!1), a = p(void 0), o = p(!1), s = /* @__PURE__ */ new Map(), c = d(() => typeof t.create == "function"), l = d(() => typeof t.restore == "function");
2044
2095
  function u(e) {
2045
2096
  let t = n();
2046
- if (!t) throw new z(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2097
+ if (!t) throw new G(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2047
2098
  return t;
2048
2099
  }
2049
2100
  function f(e) {
2050
- throw new z(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2101
+ throw new G(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2051
2102
  }
2052
2103
  function m(t) {
2053
- Fe(e.onError, t);
2104
+ Ie(e.onError, t);
2054
2105
  }
2055
2106
  async function h(n) {
2056
2107
  let o = u("list");
@@ -2117,7 +2168,7 @@ function jt(e) {
2117
2168
  restore: y
2118
2169
  };
2119
2170
  }
2120
- function Mt(e) {
2171
+ function Nt(e) {
2121
2172
  let { provider: t, getTemplateId: n, getUser: r } = e, i = p([]), a = p(!1), o = p(!1), s = d(() => typeof t.create == "function"), c = d(() => typeof t.update == "function"), l = d(() => typeof t.delete == "function"), u = d(() => typeof t.setResolved == "function"), f = d(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = d(() => i.value.filter((e) => !e.resolvedAt).length), h = d(() => {
2122
2173
  let e = /* @__PURE__ */ new Map();
2123
2174
  for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
@@ -2125,16 +2176,16 @@ function Mt(e) {
2125
2176
  });
2126
2177
  function g(e) {
2127
2178
  let t = n();
2128
- if (!t) throw new z(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2179
+ if (!t) throw new G(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2129
2180
  return t;
2130
2181
  }
2131
2182
  function _(e) {
2132
2183
  let t = r();
2133
- if (!t) throw new z(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2184
+ if (!t) throw new G(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2134
2185
  return t;
2135
2186
  }
2136
2187
  function v(e) {
2137
- throw new z(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2188
+ throw new G(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2138
2189
  }
2139
2190
  function y(e) {
2140
2191
  for (let t of i.value) {
@@ -2148,11 +2199,11 @@ function Mt(e) {
2148
2199
  return t !== null && e.author.id === t.id;
2149
2200
  }
2150
2201
  function x(t) {
2151
- let n = Pe(t);
2202
+ let n = Fe(t);
2152
2203
  throw e.onError?.(n), n;
2153
2204
  }
2154
2205
  function S(t) {
2155
- Fe(e.onError, t);
2206
+ Ie(e.onError, t);
2156
2207
  }
2157
2208
  function C(e, t, n) {
2158
2209
  return [
@@ -2259,13 +2310,13 @@ function Mt(e) {
2259
2310
  o.value = !1;
2260
2311
  }
2261
2312
  }
2262
- function M(e) {
2313
+ function ee(e) {
2263
2314
  T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
2264
2315
  }
2265
- function ee(e) {
2316
+ function M(e) {
2266
2317
  T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2267
2318
  }
2268
- function te(e, n) {
2319
+ function N(e, n) {
2269
2320
  let r = E(e, n);
2270
2321
  r && S(() => t.onDeleted?.(r, { origin: "remote" }));
2271
2322
  }
@@ -2287,12 +2338,12 @@ function Mt(e) {
2287
2338
  setResolved: j,
2288
2339
  find: y,
2289
2340
  isOwn: b,
2290
- applyRemoteCreate: M,
2291
- applyRemoteUpdate: ee,
2292
- applyRemoteDelete: te
2341
+ applyRemoteCreate: ee,
2342
+ applyRemoteUpdate: M,
2343
+ applyRemoteDelete: N
2293
2344
  };
2294
2345
  }
2295
- function Nt(e) {
2346
+ function Pt(e) {
2296
2347
  let { comments: n, provider: r, getTemplateId: i } = e, { subscribe: a } = r;
2297
2348
  if (typeof a != "function") return;
2298
2349
  let o = null;
@@ -2313,7 +2364,7 @@ function Nt(e) {
2313
2364
  }));
2314
2365
  }, { immediate: !0 }), l(s);
2315
2366
  }
2316
- var Pt = q({
2367
+ var Ft = J({
2317
2368
  name: "code",
2318
2369
  size: 24,
2319
2370
  node: [["path", {
@@ -2323,14 +2374,14 @@ var Pt = q({
2323
2374
  d: "m8 6-6 6 6 6",
2324
2375
  key: "ppft3o"
2325
2376
  }]]
2326
- }), Ft = q({
2377
+ }), It = J({
2327
2378
  name: "navigation",
2328
2379
  size: 24,
2329
2380
  node: [["polygon", {
2330
2381
  points: "3 11 22 2 13 21 11 13 3 11",
2331
2382
  key: "1ltx0t"
2332
2383
  }]]
2333
- }), It = q({
2384
+ }), Lt = J({
2334
2385
  name: "share-2",
2335
2386
  size: 24,
2336
2387
  node: [
@@ -2367,7 +2418,7 @@ var Pt = q({
2367
2418
  key: "1n3mei"
2368
2419
  }]
2369
2420
  ]
2370
- }), Lt = q({
2421
+ }), Rt = J({
2371
2422
  name: "table",
2372
2423
  size: 24,
2373
2424
  node: [
@@ -2392,9 +2443,9 @@ var Pt = q({
2392
2443
  key: "5xshup"
2393
2444
  }]
2394
2445
  ]
2395
- }), Rt = 1e4;
2446
+ }), zt = 1e4;
2396
2447
  // src/composables/useImageUrlResolver.ts
2397
- function zt(e) {
2448
+ function Bt(e) {
2398
2449
  let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
2399
2450
  function r(e) {
2400
2451
  return t.get(e);
@@ -2423,8 +2474,8 @@ function zt(e) {
2423
2474
  lookup: a
2424
2475
  };
2425
2476
  }
2426
- function Bt(e) {
2427
- let n = C(ge, null), r = d(e);
2477
+ function Vt(e) {
2478
+ let n = C(_e, null), r = d(e);
2428
2479
  if (!n) return r;
2429
2480
  let i;
2430
2481
  function a() {
@@ -2445,37 +2496,37 @@ function Bt(e) {
2445
2496
  return typeof t == "string" && t.length > 0 ? t : e;
2446
2497
  });
2447
2498
  }
2448
- function Vt(e, t) {
2499
+ function Ht(e, t) {
2449
2500
  if (!e || !t) return t;
2450
2501
  let n = e.get(t);
2451
2502
  return typeof n == "string" && n.length > 0 ? n : t;
2452
2503
  }
2453
- function Ht(e, t) {
2504
+ function Ut(e, t) {
2454
2505
  return typeof e?.url == "string" && se(e.url, t);
2455
2506
  }
2456
- function Ut(e, t) {
2507
+ function Wt(e, t) {
2457
2508
  let n = e?.url;
2458
2509
  if (typeof n == "string" && n.trim() !== "") return se(n, t) ? void 0 : n;
2459
2510
  }
2460
- function Wt(e) {
2461
- let t = C(he, H.liquid), n = Bt(() => Ut(e(), t));
2462
- return d(() => Ht(e(), t) ? null : n.value);
2511
+ function Gt(e) {
2512
+ let t = C(ge, z.liquid), n = Vt(() => Wt(e(), t));
2513
+ return d(() => Ut(e(), t) ? null : n.value);
2463
2514
  }
2464
- function Gt(e, t, n) {
2465
- return Ht(t, n) ? null : Vt(e, Ut(t, n));
2515
+ function Kt(e, t, n) {
2516
+ return Ut(t, n) ? null : Ht(e, Wt(t, n));
2466
2517
  }
2467
2518
  // src/utils/blockTypeLabels.ts
2468
- function Kt(e, t) {
2519
+ function qt(e, t) {
2469
2520
  return t.blocks[e] ?? e;
2470
2521
  }
2471
- function qt(e, t, n = []) {
2472
- if (e.type !== "custom") return Kt(e.type, t);
2522
+ function Jt(e, t, n = []) {
2523
+ if (e.type !== "custom") return qt(e.type, t);
2473
2524
  let { customType: r } = e;
2474
2525
  return n.find((e) => e.type === r)?.name ?? r;
2475
2526
  }
2476
2527
  // src/utils/resolveFieldColors.ts
2477
- function Jt(e, t) {
2478
- let n = Y({ presets: e.presets }, xe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2528
+ function Yt(e, t) {
2529
+ let n = Se({ presets: e.presets }, Ce), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2479
2530
  return {
2480
2531
  presets: r ? t.presets : n.presets,
2481
2532
  allowCustom: t.allowCustom !== !1 && i,
@@ -2486,19 +2537,19 @@ function Jt(e, t) {
2486
2537
  };
2487
2538
  }
2488
2539
  // src/utils/imageNaturalSize.ts
2489
- function Yt(e) {
2540
+ function Xt(e) {
2490
2541
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2491
2542
  }
2492
- function Xt(e, t) {
2493
- return Yt(e) && Yt(t) ? {
2543
+ function Zt(e, t) {
2544
+ return Xt(e) && Xt(t) ? {
2494
2545
  width: e,
2495
2546
  height: t
2496
2547
  } : null;
2497
2548
  }
2498
- function Zt(e) {
2499
- return Xt(e.naturalWidth, e.naturalHeight);
2500
- }
2501
2549
  function Qt(e) {
2550
+ return Zt(e.naturalWidth, e.naturalHeight);
2551
+ }
2552
+ function $t(e) {
2502
2553
  return e ? {
2503
2554
  naturalWidth: e.width,
2504
2555
  naturalHeight: e.height
@@ -2507,35 +2558,35 @@ function Qt(e) {
2507
2558
  naturalHeight: void 0
2508
2559
  };
2509
2560
  }
2510
- function $t(e, t) {
2561
+ function en(e, t) {
2511
2562
  if (typeof Image > "u") return t(null), () => {};
2512
2563
  let n = new Image(), r = () => {
2513
2564
  n.onload = null, n.onerror = null;
2514
2565
  };
2515
2566
  return n.onload = () => {
2516
- r(), t(Xt(n.naturalWidth, n.naturalHeight));
2567
+ r(), t(Zt(n.naturalWidth, n.naturalHeight));
2517
2568
  }, n.onerror = () => {
2518
2569
  r(), t(null);
2519
2570
  }, n.src = e, r;
2520
2571
  }
2521
- function en(e) {
2572
+ function tn(e) {
2522
2573
  return new Promise((t) => {
2523
2574
  let n = setTimeout(() => {
2524
2575
  r(), t(null);
2525
- }, Rt), r = $t(e, (e) => {
2576
+ }, zt), r = en(e, (e) => {
2526
2577
  clearTimeout(n), t(e);
2527
2578
  });
2528
2579
  });
2529
2580
  }
2530
2581
  // src/components/MediaDropOverlay.vue
2531
- var tn = /* @__PURE__ */ w({
2582
+ var nn = /* @__PURE__ */ w({
2532
2583
  __name: "MediaDropOverlay",
2533
2584
  props: {
2534
2585
  uploading: { type: Boolean },
2535
2586
  size: { default: "field" }
2536
2587
  },
2537
2588
  setup(e) {
2538
- let t = e, { t: r } = ye(), s = {
2589
+ let t = e, { t: r } = be(), s = {
2539
2590
  field: {
2540
2591
  gap: "tpl:gap-1.5",
2541
2592
  icon: 18,
@@ -2550,39 +2601,39 @@ var tn = /* @__PURE__ */ w({
2550
2601
  return (t, s) => (i(), m("div", {
2551
2602
  class: a(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", c.value.gap]),
2552
2603
  style: o({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${c.value.veil}, transparent)` })
2553
- }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(me), {
2604
+ }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(he), {
2554
2605
  class: "tpl-spinner",
2555
2606
  size: c.value.icon,
2556
2607
  "stroke-width": 2
2557
- }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(J), {
2608
+ }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(me), {
2558
2609
  size: c.value.icon,
2559
2610
  "stroke-width": 1.5
2560
2611
  }, null, 8, ["size"]), h(" " + n(f(r).image.dropToUpload), 1)], 64))], 6));
2561
2612
  }
2562
2613
  });
2563
2614
  // src/composables/useAliveFlag.ts
2564
- function nn() {
2615
+ function rn() {
2565
2616
  let e = { alive: !0 };
2566
2617
  return _(() => {
2567
2618
  e.alive = !1;
2568
2619
  }), e;
2569
2620
  }
2570
2621
  // src/composables/useImageDrop.ts
2571
- var rn = "image/";
2572
- function an(e) {
2573
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = be(t, {
2622
+ var an = "image/";
2623
+ function on(e) {
2624
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = xe(t, {
2574
2625
  preventDefaultForUnhandled: !0,
2575
2626
  onDrop: (e) => {
2576
2627
  if (!i()) return;
2577
- let t = (e ?? []).filter((e) => e.type.startsWith(rn));
2628
+ let t = (e ?? []).filter((e) => e.type.startsWith(an));
2578
2629
  t.length > 0 && n([t[0]]);
2579
2630
  }
2580
2631
  });
2581
2632
  return { isOver: d(() => i() && a.value) };
2582
2633
  }
2583
2634
  // src/composables/useMediaDropField.ts
2584
- function on(e) {
2585
- let { target: t, blocked: n, apply: r } = e, i = C(_e, null), a = C(ve, null), o = nn();
2635
+ function sn(e) {
2636
+ let { target: t, blocked: n, apply: r } = e, i = C(ve, null), a = C(ye, null), o = rn();
2586
2637
  async function s() {
2587
2638
  let e = await i?.({ accept: ["images"] });
2588
2639
  o.alive && e && r(e);
@@ -2603,7 +2654,7 @@ function on(e) {
2603
2654
  }
2604
2655
  }
2605
2656
  }
2606
- let { isOver: f } = an({
2657
+ let { isOver: f } = on({
2607
2658
  target: t,
2608
2659
  enabled: l,
2609
2660
  onFiles: u
@@ -2616,10 +2667,10 @@ function on(e) {
2616
2667
  openMediaBrowser: s
2617
2668
  };
2618
2669
  }
2619
- function sn(e, t = "desktop") {
2670
+ function cn(e, t = "desktop") {
2620
2671
  return t === "mobile" ? 375 : e?.width ?? 600;
2621
2672
  }
2622
- var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
2673
+ var ln = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", un = {
2623
2674
  1: [100],
2624
2675
  2: [50, 50],
2625
2676
  3: [
@@ -2643,60 +2694,60 @@ var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
2643
2694
  25
2644
2695
  ]
2645
2696
  };
2646
- function un(e, t) {
2647
- let n = (e) => Math.trunc(e ?? 0), r = (e) => ce(e) === null ? 0 : Math.trunc(e.width);
2648
- return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2649
- }
2650
2697
  function dn(e, t) {
2651
- return Math.floor(e) - un(t);
2698
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => H(e) === null ? 0 : Math.trunc(e.width);
2699
+ return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2652
2700
  }
2653
2701
  function fn(e, t) {
2702
+ return Math.floor(e) - dn(t);
2703
+ }
2704
+ function pn(e, t) {
2654
2705
  let n = "border" in e ? e.border : void 0;
2655
- return Math.floor(t) - un(e.styles.padding, n);
2706
+ return Math.floor(t) - dn(e.styles.padding, n);
2656
2707
  }
2657
- function* pn(e, t) {
2658
- for (let n of e) I(n) ? yield* pn(n.children, dn(t, n.styles.padding)) : yield {
2708
+ function* mn(e, t) {
2709
+ for (let n of e) E(n) ? yield* mn(n.children, fn(t, n.styles.padding)) : yield {
2659
2710
  block: n,
2660
- bandWidth: fe(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
2711
+ bandWidth: k(n) && n.wrapper ? fn(t, n.wrapper.padding) : t
2661
2712
  };
2662
2713
  }
2663
- function mn(e, t, n = K(e)) {
2714
+ function hn(e, t, n = W(e)) {
2664
2715
  if (!t) return e;
2665
2716
  try {
2666
- return pe(M(t, n, { missing: "default" }), e);
2717
+ return ne(le(t, n, { missing: "default" }), e);
2667
2718
  } catch {
2668
2719
  return e;
2669
2720
  }
2670
2721
  }
2671
- function hn(e, t, n, r) {
2672
- let i = mn(e, n, r);
2673
- for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (fe(e)) {
2674
- let r = ee(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
2722
+ function gn(e, t, n, r) {
2723
+ let i = hn(e, n, r);
2724
+ for (let { block: e, bandWidth: n } of mn(i.blocks, i.settings.width)) if (k(e)) {
2725
+ let r = L(e)?.applied ? void 0 : e.border, i = Math.floor(n) - dn(e.styles.padding, r), a = un[e.columns] ?? [100];
2675
2726
  for (let n = 0; n < e.children.length; n++) {
2676
2727
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2677
- if (o) return fn(o, r);
2728
+ if (o) return pn(o, r);
2678
2729
  }
2679
- } else if (e.id === t) return fn(e, n);
2730
+ } else if (e.id === t) return pn(e, n);
2680
2731
  return null;
2681
2732
  }
2682
- function gn(e, t, n, r) {
2683
- let i = mn(e, n, r);
2684
- for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (e.id === t) return Math.floor(n);
2733
+ function _n(e, t, n, r) {
2734
+ let i = hn(e, n, r);
2735
+ for (let { block: e, bandWidth: n } of mn(i.blocks, i.settings.width)) if (e.id === t) return Math.floor(n);
2685
2736
  return null;
2686
2737
  }
2687
- function _n(e) {
2688
- let t = fe(e) ? ee(e) : null;
2738
+ function vn(e) {
2739
+ let t = k(e) ? L(e) : null;
2689
2740
  return !!t?.applied && t.height === "image";
2690
2741
  }
2691
- function vn(e, t, n, r) {
2692
- if (_n(e)) return (t ? gn(t, e.id, n, r) : null) ?? sn(t?.settings);
2742
+ function yn(e, t, n, r) {
2743
+ if (vn(e)) return (t ? _n(t, e.id, n, r) : null) ?? cn(t?.settings);
2693
2744
  }
2694
2745
  // src/constants/socialIcons.ts
2695
- var yn = U, bn = {
2746
+ var bn = ae, xn = {
2696
2747
  small: 24,
2697
2748
  medium: 32,
2698
2749
  large: 48
2699
- }, xn = [
2750
+ }, Sn = [
2700
2751
  "facebook",
2701
2752
  "twitter",
2702
2753
  "instagram",
@@ -2716,4 +2767,4 @@ var yn = U, bn = {
2716
2767
  "dribbble",
2717
2768
  "behance"
2718
2769
  ];
2719
- export { He as A, Ge as B, Gt as C, It as D, Lt as E, Ve as F, jt as G, Be as H, wt as I, Nt as L, Dt as M, ut as N, Ft as O, Ue as P, Mt as R, Ut as S, Bt as T, Ke as U, Ie as V, Tt as W, Xt as _, _n as a, Kt as b, cn as c, nn as d, tn as f, Zt as g, Qt as h, hn as i, At as j, Pt as k, sn as l, en as m, yn as n, vn as o, $t as p, xn as r, gn as s, bn as t, on as u, Jt as v, Wt as w, zt as x, qt as y, We as z };
2770
+ export { Ue as A, Ke as B, Kt as C, Lt as D, Rt as E, He as F, Mt as G, Ve as H, Tt as I, Pt as L, Ot as M, dt as N, It as O, We as P, Nt as R, Wt as S, Vt as T, qe as U, Le as V, Et as W, Zt as _, vn as a, qt as b, ln as c, rn as d, nn as f, Qt as g, $t as h, gn as i, jt as j, Ft as k, cn as l, tn as m, bn as n, yn as o, en as p, Sn as r, _n as s, xn as t, sn as u, Yt as v, Gt as w, Bt as x, Jt as y, Ge as z };