@templatical/editor 0.52.0 → 0.52.1

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 (261) hide show
  1. package/dist/{AiAltTextPopover-Cm11CsKH.js → AiAltTextPopover-DawbUywc.js} +13 -13
  2. package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-9ySsXOTU.js} +22 -22
  3. package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-CupPhmsN.js} +137 -137
  4. package/dist/{AiPanels-CxGp6klr.js → AiPanels-DqT4PgQ0.js} +4 -4
  5. package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-28agTycW.js} +62 -62
  6. package/dist/BlockIssueBadge-BxpDy3u-.js +33 -0
  7. package/dist/{BlockPreviewCanvas-Df9iz7sK.js → BlockPreviewCanvas-B-4bmJ3t.js} +23 -23
  8. package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-QI82yF54.js} +3 -3
  9. package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-BKJaLkUN.js} +50 -50
  10. package/dist/{CollaborationNotices-JQ3vQoqO.js → CollaborationNotices-CTw4JThq.js} +11 -11
  11. package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CXQqN3VP.js} +15 -15
  12. package/dist/{CommentsPanel-BuftXc0U.js → CommentsPanel-DwwFuh1h.js} +2 -2
  13. package/dist/CommentsSidebar-9ZfiC2DO.js +500 -0
  14. package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-CU2yTWtF.js} +20 -20
  15. package/dist/{CountdownToolbar-CrL4WKy9.js → CountdownToolbar-BqoYzf_6.js} +53 -53
  16. package/dist/IssuesPanel-4ykrf1ax.js +359 -0
  17. package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-DM4g6j7b.js} +1 -1
  18. package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-CfscnwCn.js} +234 -234
  19. package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-Dy08GEwE.js} +446 -446
  20. package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-BgEp7iCp.js} +2 -2
  21. package/dist/{MergeTagInput-DE7kWwXx.js → MergeTagInput-B9dtUthD.js} +11 -11
  22. package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DxujhYJ4.js} +30 -30
  23. package/dist/{MergeTagTextarea-DVPQkiYY.js → MergeTagTextarea-CPFEjJZd.js} +11 -11
  24. package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-CWXfurGh.js} +201 -201
  25. package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-C4s_JYCx.js} +14 -14
  26. package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-o6HmE8GR.js} +40 -39
  27. package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-CWLrly6l.js} +56 -56
  28. package/dist/SavedBlocksBrowserModal-CE8n4EBS.js +359 -0
  29. package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-BE1N9rNZ.js} +6 -6
  30. package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-Dwl94xhP.js} +12 -12
  31. package/dist/{TemplateSettings-D0XcH32O.js → TemplateSettings-CS0f1Ues.js} +74 -74
  32. package/dist/{TestEmailModal-Cb5t0yB2.js → TestEmailModal-DBD0X5nV.js} +52 -52
  33. package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-DaFjP9QK.js} +2 -2
  34. package/dist/{TitleEditor-BYk_9SpQ.js → TitleEditor-DSqtle77.js} +75 -75
  35. package/dist/{ToggleSwitch-poGWbduy.js → ToggleSwitch-JykPyD_8.js} +4 -4
  36. package/dist/{Toolbar-Dku_pZni.js → Toolbar-BZPFfKrf.js} +913 -913
  37. package/dist/{TplModal-9IndEYk5.js → TplModal-DLMssVlt.js} +15 -15
  38. package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BkbYUs0Q.js} +35 -35
  39. package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DP7HaYWv.js} +4 -4
  40. package/dist/{VersionPreviewBanner-CSs7zum_.js → VersionPreviewBanner-DECaBwLq.js} +9 -9
  41. package/dist/{WrapperBlock-DwjK_IdJ.js → WrapperBlock-BsJv_Fiw.js} +16 -16
  42. package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BHjlPnPf.js} +23 -22
  43. package/dist/bundle-stats.json +6 -6
  44. package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js → AiAltTextPopover-SEEjkd-I.js} +21 -21
  45. package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js.map → AiAltTextPopover-SEEjkd-I.js.map} +1 -1
  46. package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-BGLLSKLm.js} +41 -41
  47. package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js.map → AiAltTextReview-BGLLSKLm.js.map} +1 -1
  48. package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js → AiChatPanel-DKDAaBNi.js} +127 -127
  49. package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js.map → AiChatPanel-DKDAaBNi.js.map} +1 -1
  50. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-0wBarZSH.js} +3 -3
  51. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-0wBarZSH.js.map} +1 -1
  52. package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-qf-cfEpy.js} +43 -43
  53. package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js.map → AiRewriteMenu-qf-cfEpy.js.map} +1 -1
  54. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +34 -0
  55. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +1 -0
  56. package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js → BlockPreviewCanvas-DGBh6mqe.js} +20 -20
  57. package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-DGBh6mqe.js.map} +1 -1
  58. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BMNK_F9p.js} +3 -3
  59. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BMNK_F9p.js.map} +1 -1
  60. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-JMWIoVWh.js} +32 -32
  61. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-JMWIoVWh.js.map} +1 -1
  62. package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js → CollaborationNotices-Bsf1rGW9.js} +12 -12
  63. package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js.map → CollaborationNotices-Bsf1rGW9.js.map} +1 -1
  64. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-CXByAoUz.js} +14 -14
  65. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-CXByAoUz.js.map} +1 -1
  66. package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js → CommentsPanel-DoJnKLXI.js} +3 -3
  67. package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DoJnKLXI.js.map} +1 -1
  68. package/dist/cdn/chunks/{CommentsSidebar-Dj8sDiLN.js → CommentsSidebar-CUtgvdBC.js} +100 -99
  69. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +1 -0
  70. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-BqRw147R.js} +18 -18
  71. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-BqRw147R.js.map} +1 -1
  72. package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js → CountdownToolbar-xobieKoU.js} +26 -26
  73. package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js.map → CountdownToolbar-xobieKoU.js.map} +1 -1
  74. package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-C7LfxaAY.js} +75 -75
  75. package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js.map → IssuesPanel-C7LfxaAY.js.map} +1 -1
  76. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-CZuLTazv.js} +2 -2
  77. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-CZuLTazv.js.map} +1 -1
  78. package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-BIi05UQu.js} +250 -250
  79. package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js.map → LogicTagInsertButton-BIi05UQu.js.map} +1 -1
  80. package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-Cpcod6_U.js} +148 -148
  81. package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js.map → MediaEditModal-Cpcod6_U.js.map} +1 -1
  82. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-BIdcW_1f.js} +3 -3
  83. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-BIdcW_1f.js.map} +1 -1
  84. package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js → MergeTagInput-BvWg8o5E.js} +32 -32
  85. package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-BvWg8o5E.js.map} +1 -1
  86. package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BgKEVUtV.js} +27 -27
  87. package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js.map → MergeTagModeToggle-BgKEVUtV.js.map} +1 -1
  88. package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js → MergeTagTextarea-tBz8McZf.js} +32 -32
  89. package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js.map → MergeTagTextarea-tBz8McZf.js.map} +1 -1
  90. package/dist/cdn/chunks/{ParagraphEditor-DsPLVAgm.js → ParagraphEditor-B3Rj_cWF.js} +191 -191
  91. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +1 -0
  92. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-CjOdD2xj.js} +19 -19
  93. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-CjOdD2xj.js.map} +1 -1
  94. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-DNjR_sNN.js} +29 -29
  95. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-DNjR_sNN.js.map} +1 -1
  96. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-CUhpawq0.js} +75 -75
  97. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-CUhpawq0.js.map} +1 -1
  98. package/dist/cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js +356 -0
  99. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-BPYcRoGa.js.map} +1 -1
  100. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-C6--Bc81.js} +3 -3
  101. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-C6--Bc81.js.map} +1 -1
  102. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-DUavxpbU.js} +14 -14
  103. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-DUavxpbU.js.map} +1 -1
  104. package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js → TemplateSettings-CKtI-dof.js} +69 -69
  105. package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js.map → TemplateSettings-CKtI-dof.js.map} +1 -1
  106. package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-CDQTgESD.js} +65 -65
  107. package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js.map → TestEmailModal-CDQTgESD.js.map} +1 -1
  108. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CcUpEpAn.js} +3 -3
  109. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CcUpEpAn.js.map} +1 -1
  110. package/dist/cdn/chunks/{TitleEditor-R2lQw6WA.js → TitleEditor-Cob7RLyK.js} +70 -70
  111. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +1 -0
  112. package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js → ToggleSwitch-J7Vwhvha.js} +5 -5
  113. package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js.map → ToggleSwitch-J7Vwhvha.js.map} +1 -1
  114. package/dist/cdn/chunks/{Toolbar-CnvfW72e.js → Toolbar-CdpsvNOR.js} +893 -893
  115. package/dist/cdn/chunks/{Toolbar-CnvfW72e.js.map → Toolbar-CdpsvNOR.js.map} +1 -1
  116. package/dist/cdn/chunks/TplModal-CFPDgbwQ.js +51 -0
  117. package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-CFPDgbwQ.js.map} +1 -1
  118. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-BYlLRvRJ.js} +32 -32
  119. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-BYlLRvRJ.js.map} +1 -1
  120. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-C6SOVoiT.js} +3 -3
  121. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-C6SOVoiT.js.map} +1 -1
  122. package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js → VersionPreviewBanner-Dvg0ZfAW.js} +10 -10
  123. package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js.map → VersionPreviewBanner-Dvg0ZfAW.js.map} +1 -1
  124. package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js → WrapperBlock-C7Md56IT.js} +13 -13
  125. package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js.map → WrapperBlock-C7Md56IT.js.map} +1 -1
  126. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js +21 -0
  127. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js.map +1 -0
  128. package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-Cth2JCEh.js} +36 -36
  129. package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js.map → createCloudRuntime-Cth2JCEh.js.map} +1 -1
  130. package/dist/cdn/chunks/{dist-C2epoAwW.js → dist-8ym3y-pH.js} +43 -43
  131. package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-8ym3y-pH.js.map} +1 -1
  132. package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-BMzNabtD.js} +106 -107
  133. package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-BMzNabtD.js.map} +1 -1
  134. package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-Du8AUMFT.js} +639 -636
  135. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +1 -0
  136. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CyCe560f.js} +891 -891
  137. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CyCe560f.js.map} +1 -1
  138. package/dist/cdn/chunks/en-TIqv4ag3.js +1 -0
  139. package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-CFF2KWy-.js} +55 -55
  140. package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-CFF2KWy-.js.map} +1 -1
  141. package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-okSPsLOa.js} +99 -97
  142. package/dist/cdn/chunks/icons-okSPsLOa.js.map +1 -0
  143. package/dist/cdn/chunks/{keys-BF9gazbd.js → keys-CUj6UA38.js} +2 -2
  144. package/dist/cdn/chunks/{keys-BF9gazbd.js.map → keys-CUj6UA38.js.map} +1 -1
  145. package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
  146. package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
  147. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js → normalizeMergeTagMarkup-C_KlfSW4.js} +2 -2
  148. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js.map → normalizeMergeTagMarkup-C_KlfSW4.js.map} +1 -1
  149. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-BcXIz7oJ.js} +2 -2
  150. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-BcXIz7oJ.js.map} +1 -1
  151. package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js → sanitizeHtml-CN85EDrO.js} +2 -2
  152. package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js.map → sanitizeHtml-CN85EDrO.js.map} +1 -1
  153. package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js → socialIcons-jsTDmkbb.js} +480 -480
  154. package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js.map → socialIcons-jsTDmkbb.js.map} +1 -1
  155. package/dist/cdn/chunks/{src-CUH_EI7k.js → src-C7bkofBL.js} +6 -6
  156. package/dist/cdn/chunks/{src-CUH_EI7k.js.map → src-C7bkofBL.js.map} +1 -1
  157. package/dist/cdn/chunks/{src-BKpAis_q.js → src-DEd87i_U.js} +2 -2
  158. package/dist/cdn/chunks/{src-BKpAis_q.js.map → src-DEd87i_U.js.map} +1 -1
  159. package/dist/cdn/chunks/{src-C9DTvn1H.js → src-DwWrYnUj.js} +3 -22
  160. package/dist/cdn/chunks/src-DwWrYnUj.js.map +1 -0
  161. package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-CbiTlECY.js} +45 -45
  162. package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-CbiTlECY.js.map} +1 -1
  163. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-DY8_-ETE.js} +3 -3
  164. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-DY8_-ETE.js.map} +1 -1
  165. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +2582 -0
  166. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +1 -0
  167. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +9 -0
  168. package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-vjZJwKrV.js.map} +1 -1
  169. package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-D8pY4LTq.js} +3 -3
  170. package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-D8pY4LTq.js.map} +1 -1
  171. package/dist/{useLogicTag-DFDYJeMN.js → cdn/chunks/useLogicTag-DBJDtpKA.js} +5 -3
  172. package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-DBJDtpKA.js.map} +1 -1
  173. package/dist/{useMergeTag-B46vACAG.js → cdn/chunks/useMergeTag-B-aG--s1.js} +7 -5
  174. package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-B-aG--s1.js.map} +1 -1
  175. package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js → usePopoverPosition-DSMtmu2W.js} +4 -4
  176. package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js.map → usePopoverPosition-DSMtmu2W.js.map} +1 -1
  177. package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-vjQ0fe-L.js} +3 -3
  178. package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js.map → useScrollToBlock-vjQ0fe-L.js.map} +1 -1
  179. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-hZTvYBHO.js} +2 -2
  180. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-hZTvYBHO.js.map} +1 -1
  181. package/dist/cdn/editor.css +1 -1
  182. package/dist/cdn/editor.js +1422 -1422
  183. package/dist/cdn/editor.js.map +1 -1
  184. package/dist/{check-N3x4z_rH.js → check-BZ8o0eet.js} +1 -1
  185. package/dist/{chevron-down-gXu9qNwO.js → chevron-down-DfAAfILv.js} +1 -1
  186. package/dist/{chevron-right-rL0ayGk5.js → chevron-right-Bk4mGdr7.js} +1 -1
  187. package/dist/{chevron-up-0ugh8HnW.js → chevron-up-MhUf_azW.js} +1 -1
  188. package/dist/{circle-alert-B9Ls75B5.js → circle-alert-CShJwVFv.js} +1 -1
  189. package/dist/{clock-BqHBaCLm.js → clock-CTfD6OCt.js} +1 -1
  190. package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DCgO4A1r.js} +24 -24
  191. package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-CvhTA2KG.js} +6 -6
  192. package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-ByCWA2Tv.js} +100 -99
  193. package/dist/{dist-CzrLYq2s.js → dist-CKi_npZM.js} +2 -21
  194. package/dist/{dist-CEdyyDn7.js → dist-CVy-7PHQ.js} +54 -54
  195. package/dist/{dist-DDN7yR-w.js → dist-D6cMdrfG.js} +129 -129
  196. package/dist/{editor-modal-Du9VI9q4.js → editor-modal-zaZHcmlO.js} +812 -812
  197. package/dist/en-Db76vJbY.js +1 -0
  198. package/dist/{extensions-FRYhx7qa.js → extensions-fo_c-vqf.js} +32 -32
  199. package/dist/{eye-BKj9Tfnc.js → eye-7W4t5e0Q.js} +1 -1
  200. package/dist/{image-DNdvdTla.js → image-BDiRFzSd.js} +1 -1
  201. package/dist/{info-Bx-kBkbH.js → info-Cxi3-Kh9.js} +1 -1
  202. package/dist/{keys-DBjrQkYH.js → keys-BgRERHzu.js} +1 -1
  203. package/dist/{link-D8-rYdIQ.js → link-ju_2Cmir.js} +1 -1
  204. package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
  205. package/dist/{list-BneisA27.js → list-DYZJf0aZ.js} +1 -1
  206. package/dist/{loader-circle-DBEXphyx.js → loader-circle-BZRD0a4I.js} +1 -1
  207. package/dist/{message-circle-Bg4xInCM.js → message-circle-DuEw4Zfx.js} +1 -1
  208. package/dist/{normalizeMergeTagMarkup-IH8COHzd.js → normalizeMergeTagMarkup-CELnOlgK.js} +1 -1
  209. package/dist/{package-B40Vkfsp.js → package-CePMr2kK.js} +1 -1
  210. package/dist/{pencil-CYdAHTds.js → pencil-D3aFCL7c.js} +1 -1
  211. package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks--_xc0XK3.js} +1 -1
  212. package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xnro7_Sk.js} +1 -1
  213. package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-BURR-bj5.js} +118 -118
  214. package/dist/{sanitizeHtml-CnOA1efV.js → sanitizeHtml-BzfzpYJY.js} +1 -1
  215. package/dist/{search-BZEo08gi.js → search-CDrstRBv.js} +1 -1
  216. package/dist/{send-DHtrnXQs.js → send-DROkPOaX.js} +1 -1
  217. package/dist/{smartphone-dlN3vpA3.js → smartphone-Bx6u_tjn.js} +1 -1
  218. package/dist/{socialIcons-B_d52_eS.js → socialIcons-D7MGsg0d.js} +366 -366
  219. package/dist/{sparkles-NOttoDnJ.js → sparkles-CdaTtvoz.js} +1 -1
  220. package/dist/{square-B1CJgdt2.js → square-BbCROH_f.js} +1 -1
  221. package/dist/style.css +1 -1
  222. package/dist/templatical-editor.js +1096 -1096
  223. package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-CGacJ9Vw.js} +1 -1
  224. package/dist/{trash-CGbk4Sgt.js → trash-DxCd7zIy.js} +1 -1
  225. package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-7_oaitpf.js} +1 -1
  226. package/dist/{upload-DQoackAn.js → upload-DuFEOi_0.js} +1 -1
  227. package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-DEMmUKuO.js} +2 -2
  228. package/dist/{useEditorCore-DG9UvWUm.js → useEditorCore-BSo2sSID.js} +1518 -1470
  229. package/dist/useEditorRoot-BMcoCLBx.js +7 -0
  230. package/dist/{useI18n-CeTm777E.js → useI18n-BBrHTdu8.js} +2 -2
  231. package/dist/{cdn/chunks/useLogicTag-vy5KGg5D.js → useLogicTag-ZPC39rfH.js} +3 -5
  232. package/dist/{cdn/chunks/useMergeTag-BFBBjnwh.js → useMergeTag-BQ4qqWpQ.js} +5 -7
  233. package/dist/{usePopoverPosition-C42kD7zt.js → usePopoverPosition-DV1PxL66.js} +3 -3
  234. package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-BSyAV4pk.js} +3 -3
  235. package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-CnEeTfhs.js} +993 -990
  236. package/dist/{withCurrentFont-v_a4Oso8.js → withCurrentFont-B22FXAF5.js} +1 -1
  237. package/dist/{x-zcrnmcmU.js → x-BpfG7v9g.js} +1 -1
  238. package/package.json +10 -10
  239. package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
  240. package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
  241. package/dist/IssuesPanel-BHFQ3wrP.js +0 -359
  242. package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
  243. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
  244. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
  245. package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
  246. package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
  247. package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
  248. package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
  249. package/dist/cdn/chunks/TplModal-BDyeS69p.js +0 -51
  250. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
  251. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
  252. package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
  253. package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
  254. package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
  255. package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
  256. package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
  257. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
  258. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
  259. package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
  260. package/dist/en-CyEE7FPY.js +0 -1
  261. package/dist/useEditorRoot-BKr6nNkC.js +0 -7
@@ -1,10 +1,10 @@
1
- import { $ as e, C as t, D as n, G as r, P as i, Q as a, V as o, X as s, Z as c, _ as l, b as u, dt as d, it as f, j as p, lt as m, ot as h, p as g, q as _, st as v, tt as y, u as b, ut as x, x as S } from "./draggable-B8hTTYFO.js";
2
- import { A as C, Ct as w, Dt as T, Et as E, Ft as D, Kt as O, N as k, O as A, Ot as j, P as M, St as N, Tt as P, Z as ee, et as F, ft as I, k as L, kt as R, n as z, r as B, wt as V, xt as H, yt as U } from "./src-C9DTvn1H.js";
3
- import { r as W } from "./dist-CONcGNwy.js";
4
- import { L as G, P as te, c as ne, x as K } from "./keys-BF9gazbd.js";
5
- import { t as re } from "./useI18n-11iqzC6m.js";
6
- import { o as ie, s as q } from "./usePopoverPosition-AnVIwiVv.js";
7
- import { at as ae, s as oe } from "./icons-HCBP93Ch.js";
1
+ import { $ as e, C as t, D as n, J as r, K as i, P as a, Q as o, V as s, Z as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, ft as h, j as g, nt as _, p as v, st as y, u as b, ut as x, x as S } from "./draggable-Du8AUMFT.js";
2
+ import { A as C, Ct as w, Dt as T, Et as E, Ft as D, Kt as O, N as k, O as A, Ot as j, P as M, St as N, Tt as P, Z as ee, et as F, ft as I, k as L, kt as R, n as z, r as B, wt as V, xt as H, yt as U } from "./src-DwWrYnUj.js";
3
+ import { r as W } from "./dist-BMzNabtD.js";
4
+ import { L as G, P as te, c as ne, x as K } from "./keys-CUj6UA38.js";
5
+ import { t as re } from "./useI18n-D8pY4LTq.js";
6
+ import { o as ie, s as q } from "./usePopoverPosition-DSMtmu2W.js";
7
+ import { at as ae, s as oe } from "./icons-okSPsLOa.js";
8
8
  // ../core/src/error-reporting.ts
9
9
  function se(e) {
10
10
  return e instanceof Error ? e : Error(String(e), { cause: e });
@@ -20,7 +20,7 @@ function J(e, t) {
20
20
  function ce(t) {
21
21
  let n = t.content ?? F(t.defaultFontFamily, t.templateDefaults);
22
22
  L(n), C(n);
23
- let i = c({
23
+ let r = o({
24
24
  template: null,
25
25
  content: n,
26
26
  selectedBlockId: null,
@@ -31,28 +31,28 @@ function ce(t) {
31
31
  isSaving: !1,
32
32
  isLoading: !1,
33
33
  uiTheme: "auto"
34
- }), o = e(0), s = 0, l = 0;
35
- function u() {
36
- i.isDirty = !0, l++;
34
+ }), a = m(0), s = 0, c = 0;
35
+ function l() {
36
+ r.isDirty = !0, c++;
37
37
  }
38
- let d = r({
39
- get: () => i.content,
38
+ let u = i({
39
+ get: () => r.content,
40
40
  set: (e) => {
41
- i.content = e, u();
41
+ r.content = e, l();
42
42
  }
43
- }), f = r(() => i.selectedBlockId ? p(i.content.blocks, i.selectedBlockId) : null);
44
- function p(e, t) {
43
+ }), d = i(() => r.selectedBlockId ? f(r.content.blocks, r.selectedBlockId) : null);
44
+ function f(e, t) {
45
45
  for (let n of e) {
46
46
  if (n.id === t) return n;
47
47
  if (n.type === "section") for (let e of n.children) {
48
- let n = p(e, t);
48
+ let n = f(e, t);
49
49
  if (n) return n;
50
50
  }
51
51
  }
52
52
  return null;
53
53
  }
54
- function m(e, t) {
55
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) m(e, t);
54
+ function p(e, t) {
55
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) p(e, t);
56
56
  }
57
57
  function h(e, t, n = { blocks: e }) {
58
58
  for (let r = 0; r < e.length; r++) {
@@ -73,7 +73,7 @@ function ce(t) {
73
73
  return t.lockedBlocks?.value.has(e) ?? !1;
74
74
  }
75
75
  function _(e) {
76
- let t = h(i.content.blocks, e);
76
+ let t = h(r.content.blocks, e);
77
77
  if (!t) return null;
78
78
  let n = t.blocks.findIndex((t) => t.id === e);
79
79
  return n === -1 ? null : {
@@ -83,85 +83,85 @@ function ce(t) {
83
83
  };
84
84
  }
85
85
  function v(e, t = !0) {
86
- L(e), C(e), i.content = e, t && u();
86
+ L(e), C(e), r.content = e, t && l();
87
87
  }
88
88
  function y(e) {
89
- e && g(e) || (i.selectedBlockId = e);
89
+ e && g(e) || (r.selectedBlockId = e);
90
90
  }
91
91
  function b(e) {
92
- i.viewport = e;
92
+ r.viewport = e;
93
93
  }
94
94
  function x(e) {
95
- i.darkMode = e;
95
+ r.darkMode = e;
96
96
  }
97
97
  function S(e) {
98
- i.uiTheme = e;
98
+ r.uiTheme = e;
99
99
  }
100
100
  function w(e) {
101
- i.previewMode = e, e && (i.selectedBlockId = null);
101
+ r.previewMode = e, e && (r.selectedBlockId = null);
102
102
  }
103
103
  function T(e, t) {
104
104
  if (g(e)) return;
105
- let n = p(i.content.blocks, e);
106
- n && (Object.assign(n, t), u());
105
+ let n = f(r.content.blocks, e);
106
+ n && (Object.assign(n, t), l());
107
107
  }
108
108
  function D(e) {
109
- i.content.settings = {
110
- ...i.content.settings,
109
+ r.content.settings = {
110
+ ...r.content.settings,
111
111
  ...e
112
- }, u();
112
+ }, l();
113
113
  }
114
- function O(e, t, n = 0, r) {
114
+ function O(e, t, n = 0, i) {
115
115
  let a = {
116
- settings: i.content.settings,
116
+ settings: r.content.settings,
117
117
  blocks: [e]
118
118
  };
119
119
  if (L(a), C(a), !(t && e.type === "section")) {
120
120
  if (t) {
121
121
  if (g(t)) return;
122
- let a = p(i.content.blocks, t);
122
+ let a = f(r.content.blocks, t);
123
123
  if (a && a.type === "section") {
124
124
  if (n < 0 || n >= E(a.columns)) return;
125
125
  a.children[n] = a.children[n] || [];
126
126
  let t = a.children[n];
127
- r !== void 0 && r < t.length ? t.splice(r, 0, e) : t.push(e);
127
+ i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
128
128
  }
129
- } else r !== void 0 && r < i.content.blocks.length ? i.content.blocks.splice(r, 0, e) : i.content.blocks.push(e);
130
- u();
129
+ } else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
130
+ l();
131
131
  }
132
132
  }
133
133
  function k(e) {
134
134
  if (g(e)) return;
135
- let t = h(i.content.blocks, e);
135
+ let t = h(r.content.blocks, e);
136
136
  if (t) {
137
137
  let n = t.blocks.findIndex((t) => t.id === e);
138
138
  if (n !== -1) {
139
139
  let [e] = t.blocks.splice(n, 1);
140
- if (i.selectedBlockId) {
140
+ if (r.selectedBlockId) {
141
141
  let t = /* @__PURE__ */ new Set();
142
- m(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
142
+ p(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
143
143
  }
144
- u();
144
+ l();
145
145
  }
146
146
  }
147
147
  }
148
- function A(e, t, n, r = 0) {
148
+ function A(e, t, n, i = 0) {
149
149
  if (g(e) || n && g(n)) return;
150
- let a = h(i.content.blocks, e);
150
+ let a = h(r.content.blocks, e);
151
151
  if (!a) return;
152
152
  let o = a.blocks.findIndex((t) => t.id === e);
153
153
  if (o === -1 || n && a.blocks[o].type === "section") return;
154
154
  let s;
155
155
  if (n) {
156
- let e = p(i.content.blocks, n);
157
- if (!e || e.type !== "section" || r < 0 || r >= E(e.columns)) return;
158
- e.children[r] = e.children[r] || [], s = e.children[r];
159
- } else s = i.content.blocks;
156
+ let e = f(r.content.blocks, n);
157
+ if (!e || e.type !== "section" || i < 0 || i >= E(e.columns)) return;
158
+ e.children[i] = e.children[i] || [], s = e.children[i];
159
+ } else s = r.content.blocks;
160
160
  let [c] = a.blocks.splice(o, 1);
161
- s.splice(t, 0, c), u();
161
+ s.splice(t, 0, c), l();
162
162
  }
163
163
  function j() {
164
- u();
164
+ l();
165
165
  }
166
166
  function M(e, t) {
167
167
  throw new H(`[Templatical] Templates: ${e} ${t}`);
@@ -174,78 +174,78 @@ function ce(t) {
174
174
  return n || M(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
175
175
  }
176
176
  function ee(e) {
177
- i.template && (i.template = {
178
- ...i.template,
177
+ r.template && (r.template = {
178
+ ...r.template,
179
179
  name: e
180
- }, u());
180
+ }, l());
181
181
  }
182
182
  async function I(e) {
183
- let n = P("create()"), { create: r } = n;
184
- typeof r != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
185
- let a, c = ++s;
186
- i.isLoading = !0;
183
+ let n = P("create()"), { create: i } = n;
184
+ typeof i != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
185
+ let o, l = ++s;
186
+ r.isLoading = !0;
187
187
  try {
188
- e?.content && (i.content = e.content);
189
- let t = l;
190
- a = await r(e?.name === void 0 ? { content: i.content } : {
188
+ e?.content && (r.content = e.content);
189
+ let t = c;
190
+ o = await i(e?.name === void 0 ? { content: r.content } : {
191
191
  name: e.name,
192
- content: i.content
193
- }), i.template = a, l === t && (i.isDirty = !1), o.value++;
192
+ content: r.content
193
+ }), r.template = o, c === t && (r.isDirty = !1), a.value++;
194
194
  } catch (e) {
195
195
  throw t.onError?.(e), e;
196
196
  } finally {
197
- s === c && (i.isLoading = !1);
197
+ s === l && (r.isLoading = !1);
198
198
  }
199
- return N(() => n.onCreated?.(a)), a;
199
+ return N(() => n.onCreated?.(o)), o;
200
200
  }
201
201
  async function R(e, n) {
202
- let r = P("load()"), a, c = ++s;
203
- i.isLoading = !0;
202
+ let i = P("load()"), o, c = ++s;
203
+ r.isLoading = !0;
204
204
  try {
205
- if (a = await r.load(e), L(a.content), C(a.content), n && !n()) return a;
206
- i.template = a, i.content = a.content, i.isDirty = !1, o.value++;
205
+ if (o = await i.load(e), L(o.content), C(o.content), n && !n()) return o;
206
+ r.template = o, r.content = o.content, r.isDirty = !1, a.value++;
207
207
  } catch (e) {
208
208
  throw t.onError?.(e), e;
209
209
  } finally {
210
- s === c && (i.isLoading = !1);
210
+ s === c && (r.isLoading = !1);
211
211
  }
212
- return N(() => r.onLoaded?.(a)), a;
212
+ return N(() => i.onLoaded?.(o)), o;
213
213
  }
214
214
  async function z(e = "api") {
215
- let n = P("save()"), { save: r } = n;
216
- typeof r != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
217
- let a = i.template;
215
+ let n = P("save()"), { save: i } = n;
216
+ typeof i != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
217
+ let a = r.template;
218
218
  a || M("save()", "has no template loaded. Call create() or load() first.");
219
- let o = a.name === void 0 ? { content: i.content } : {
219
+ let o = a.name === void 0 ? { content: r.content } : {
220
220
  name: a.name,
221
- content: i.content
221
+ content: r.content
222
222
  }, s;
223
- i.isSaving = !0;
223
+ r.isSaving = !0;
224
224
  try {
225
- let e = l;
226
- if (s = await r(a.id, o), i.template?.id === a.id) {
227
- let e = i.template.name;
228
- i.template = e === a.name ? s : {
225
+ let e = c;
226
+ if (s = await i(a.id, o), r.template?.id === a.id) {
227
+ let e = r.template.name;
228
+ r.template = e === a.name ? s : {
229
229
  ...s,
230
230
  name: e
231
231
  };
232
232
  }
233
- l === e && (i.isDirty = !1);
233
+ c === e && (r.isDirty = !1);
234
234
  } catch (e) {
235
235
  throw t.onError?.(e), e;
236
236
  } finally {
237
- i.isSaving = !1;
237
+ r.isSaving = !1;
238
238
  }
239
239
  return N(() => n.onSaved?.(s, { trigger: e })), s;
240
240
  }
241
241
  function B() {
242
- return i.template?.id !== void 0;
242
+ return r.template?.id !== void 0;
243
243
  }
244
244
  return {
245
- state: a(i),
246
- loadVersion: a(o),
247
- content: d,
248
- selectedBlock: f,
245
+ state: e(r),
246
+ loadVersion: e(a),
247
+ content: u,
248
+ selectedBlock: d,
249
249
  isBlockLocked: g,
250
250
  setContent: v,
251
251
  selectBlock: y,
@@ -269,57 +269,57 @@ function ce(t) {
269
269
  }
270
270
  // ../core/src/history.ts
271
271
  var le = 50, ue = 300, de = 1500;
272
- function Y(t) {
273
- let { content: n, setContent: i, maxSize: a = le } = t, o = e([]), s = e([]), c = e(!1), l = null, u = null, d = r(() => o.value.length > 0), f = r(() => s.value.length > 0);
274
- function p() {
275
- return j(n.value);
272
+ function Y(e) {
273
+ let { content: t, setContent: n, maxSize: r = le } = e, a = m([]), o = m([]), s = m(!1), c = null, l = null, u = i(() => a.value.length > 0), d = i(() => o.value.length > 0);
274
+ function f() {
275
+ return j(t.value);
276
276
  }
277
- function m(e) {
278
- o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
277
+ function p(e) {
278
+ a.value.push(e), a.value.length > r && a.value.splice(0, a.value.length - r);
279
279
  }
280
280
  function h() {
281
- u &&= (clearTimeout(u.timeoutId), null);
281
+ l &&= (clearTimeout(l.timeoutId), null);
282
282
  }
283
283
  function g() {
284
- h(), m(p()), s.value = [];
284
+ h(), p(f()), o.value = [];
285
285
  }
286
286
  function _(e) {
287
- u && u.blockId === e ? (clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
288
- u = null;
289
- }, ue)) : (h(), m(p()), s.value = [], u = {
287
+ l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
288
+ l = null;
289
+ }, ue)) : (h(), p(f()), o.value = [], l = {
290
290
  blockId: e,
291
291
  timeoutId: setTimeout(() => {
292
- u = null;
292
+ l = null;
293
293
  }, ue)
294
294
  });
295
295
  }
296
296
  function v() {
297
- c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
298
- c.value = !1, l = null;
297
+ s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
298
+ s.value = !1, c = null;
299
299
  }, de);
300
300
  }
301
301
  function y() {
302
- if (o.value.length === 0) return;
302
+ if (a.value.length === 0) return;
303
303
  h();
304
- let e = o.value.pop();
305
- s.value.push(p()), i(e, !0), v();
304
+ let e = a.value.pop();
305
+ o.value.push(f()), n(e, !0), v();
306
306
  }
307
307
  function b() {
308
- if (s.value.length === 0) return;
308
+ if (o.value.length === 0) return;
309
309
  h();
310
- let e = s.value.pop();
311
- o.value.push(p()), i(e, !0), v();
310
+ let e = o.value.pop();
311
+ a.value.push(f()), n(e, !0), v();
312
312
  }
313
313
  function x() {
314
- o.value = [], s.value = [], h();
314
+ a.value = [], o.value = [], h();
315
315
  }
316
316
  function S() {
317
- x(), l &&= (clearTimeout(l), null);
317
+ x(), c &&= (clearTimeout(c), null);
318
318
  }
319
319
  return {
320
- canUndo: d,
321
- canRedo: f,
322
- isNavigating: c,
320
+ canUndo: u,
321
+ canRedo: d,
322
+ isNavigating: s,
323
323
  undo: y,
324
324
  redo: b,
325
325
  record: g,
@@ -373,76 +373,76 @@ function X(e) {
373
373
  function d() {
374
374
  o &&= (clearTimeout(o), null);
375
375
  }
376
- function f() {
376
+ function p() {
377
377
  d(), n() && r(JSON.parse(JSON.stringify(t.value)));
378
378
  }
379
- function p() {
379
+ function m() {
380
380
  c() && !s && (d(), o = setTimeout(() => {
381
381
  o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
382
382
  }, i));
383
383
  }
384
- let m = v(t, () => {
385
- p();
384
+ let h = f(t, () => {
385
+ m();
386
386
  }, { deep: !0 });
387
- function h() {
388
- m(), d();
387
+ function g() {
388
+ h(), d();
389
389
  }
390
390
  return {
391
- flush: f,
391
+ flush: p,
392
392
  cancel: d,
393
393
  pause: l,
394
394
  resume: u,
395
- destroy: h
395
+ destroy: g
396
396
  };
397
397
  }
398
398
  // ../core/src/condition-preview.ts
399
399
  function me(e) {
400
- let t = c(/* @__PURE__ */ new Set()), n = r(() => t.size > 0);
401
- function i(e) {
400
+ let t = o(/* @__PURE__ */ new Set()), n = i(() => t.size > 0);
401
+ function r(e) {
402
402
  return t.has(e);
403
403
  }
404
404
  function a(n) {
405
405
  t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
406
406
  }
407
- function o() {
407
+ function s() {
408
408
  t.clear();
409
409
  }
410
410
  return {
411
- isHidden: i,
411
+ isHidden: r,
412
412
  toggleBlock: a,
413
- reset: o,
413
+ reset: s,
414
414
  hasHiddenBlocks: n
415
415
  };
416
416
  }
417
417
  // ../core/src/data-source-fetch.ts
418
- function he(t) {
419
- let n = e(!1), i = e(!1), a = r(() => !!t.definition.value?.dataSource), o = r(() => a.value && !t.block.value.dataSourceFetched);
420
- async function s() {
421
- let e = t.definition.value;
422
- if (e?.dataSource) {
423
- n.value = !0, i.value = !1;
418
+ function he(e) {
419
+ let t = m(!1), n = m(!1), r = i(() => !!e.definition.value?.dataSource), a = i(() => r.value && !e.block.value.dataSourceFetched);
420
+ async function o() {
421
+ let r = e.definition.value;
422
+ if (r?.dataSource) {
423
+ t.value = !0, n.value = !1;
424
424
  try {
425
- let n = await e.dataSource.onFetch({
426
- fieldValues: { ...t.block.value.fieldValues },
427
- blockId: t.block.value.id
425
+ let t = await r.dataSource.onFetch({
426
+ fieldValues: { ...e.block.value.fieldValues },
427
+ blockId: e.block.value.id
428
428
  });
429
- if (n == null) return;
430
- let r = { ...t.block.value.fieldValues };
431
- for (let e of Object.keys(r)) e in n && (r[e] = n[e]);
432
- t.onUpdate(r, !0);
429
+ if (t == null) return;
430
+ let n = { ...e.block.value.fieldValues };
431
+ for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
432
+ e.onUpdate(n, !0);
433
433
  } catch (e) {
434
- console.warn("[Templatical] Data source fetch error:", e), i.value = !0;
434
+ console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
435
435
  } finally {
436
- n.value = !1;
436
+ t.value = !1;
437
437
  }
438
438
  }
439
439
  }
440
440
  return {
441
- isFetching: n,
442
- fetchError: i,
443
- fetch: s,
444
- hasDataSource: a,
445
- needsFetch: o
441
+ isFetching: t,
442
+ fetchError: n,
443
+ fetch: o,
444
+ hasDataSource: r,
445
+ needsFetch: a
446
446
  };
447
447
  }
448
448
  // ../core/src/history-interceptor.ts
@@ -652,13 +652,13 @@ function Ie(e) {
652
652
  return n;
653
653
  });
654
654
  }
655
- function Le(t) {
656
- let { provider: n } = t, i = t.sessionId ?? crypto.randomUUID(), a = t.maxUndo ?? ke, o = typeof n.acquireLock == "function" && typeof n.renewLock == "function" && typeof n.releaseLock == "function", c = y([]), l = y(/* @__PURE__ */ new Map()), u = e(null), d = e(0), f = e(0), p = null, m = null, h = !1, g = !1, b = !1, x = null, S = 0, C = !1, E = [], D = null, O = null, k = Promise.resolve(), A = null, M = r(() => (m?.undo.length ?? 0) > 0), ee = r(() => (m?.redo.length ?? 0) > 0);
657
- function F(e) {
658
- t.onError?.(e instanceof Error ? e : Error(String(e)));
655
+ function Le(e) {
656
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), a = e.maxUndo ?? ke, o = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", s = _([]), l = _(/* @__PURE__ */ new Map()), u = m(null), d = m(0), p = m(0), h = null, g = null, v = !1, y = !1, b = !1, x = null, S = 0, C = !1, E = [], D = null, O = null, k = Promise.resolve(), A = null, M = i(() => (g?.undo.length ?? 0) > 0), ee = i(() => (g?.redo.length ?? 0) > 0);
657
+ function F(t) {
658
+ e.onError?.(t instanceof Error ? t : Error(String(t)));
659
659
  }
660
- function I(e, n = m) {
661
- n !== m || C || t.onNotice?.(e);
660
+ function I(t, n = g) {
661
+ n !== g || C || e.onNotice?.(t);
662
662
  }
663
663
  function L() {
664
664
  return {
@@ -666,34 +666,34 @@ function Le(t) {
666
666
  blockId: e.blockId,
667
667
  sessionId: e.holder.sessionId
668
668
  })),
669
- session: i
669
+ session: n
670
670
  };
671
671
  }
672
672
  function R() {
673
- f.value++;
673
+ p.value++;
674
674
  }
675
675
  function z(e, t) {
676
676
  e.push(t), e.length > a && e.splice(0, e.length - a);
677
677
  }
678
678
  function B(e) {
679
- if (!p || h) return;
680
- g = !0;
679
+ if (!h || v) return;
680
+ y = !0;
681
681
  try {
682
- let t = p.content.value, n = Te(t, e);
682
+ let t = h.content.value, n = Te(t, e);
683
683
  if (n.length > 0) try {
684
684
  P(t, n);
685
685
  } catch {
686
- p.setContent(j(e), !1);
686
+ h.setContent(j(e), !1);
687
687
  }
688
- T(p.content.value, e) || p.setContent(j(e), !1);
688
+ T(h.content.value, e) || h.setContent(j(e), !1);
689
689
  } finally {
690
- g = !1;
690
+ y = !1;
691
691
  }
692
- let t = p.state.selectedBlockId;
693
- t && !Pe(e.blocks, t) && p.selectBlock(null);
692
+ let t = h.state.selectedBlockId;
693
+ t && !Pe(e.blocks, t) && h.selectBlock(null);
694
694
  }
695
695
  function H() {
696
- g || b || (b = !0, queueMicrotask(() => {
696
+ y || b || (b = !0, queueMicrotask(() => {
697
697
  b = !1, W(!1);
698
698
  }));
699
699
  }
@@ -701,9 +701,9 @@ function Le(t) {
701
701
  x &&= (clearTimeout(x), null);
702
702
  }
703
703
  function W(e, t = !1) {
704
- let n = m;
705
- if (!p || !n || h || g || p.state.isLoading && !t || p.state.template?.id !== n.templateId) return;
706
- let r = Te(n.view, p.content.value);
704
+ let n = g;
705
+ if (!h || !n || v || y || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
706
+ let r = Te(n.view, h.content.value);
707
707
  if (r.length === 0) U();
708
708
  else {
709
709
  if (!e && Fe(r)) {
@@ -736,7 +736,7 @@ function Le(t) {
736
736
  }), t.code === "invalid_operation" && F(t);
737
737
  return;
738
738
  }
739
- let i = p.content.value;
739
+ let i = h.content.value;
740
740
  if (!T(r, i)) {
741
741
  F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
742
742
  op: "setContent",
@@ -776,23 +776,23 @@ function Le(t) {
776
776
  let t = e.pending.find((e) => !e.sent);
777
777
  t ? (t.sent = !0, e.inFlight = t, re(e, t, 0)) : J(e);
778
778
  }
779
- function re(e, t, r) {
780
- n.submit(e.templateId, {
781
- batchId: t.batchId,
779
+ function re(e, n, r) {
780
+ t.submit(e.templateId, {
781
+ batchId: n.batchId,
782
782
  baseRevision: e.revision,
783
- ops: t.ops,
784
- ...t.origin === "ai" ? { origin: "ai" } : {}
785
- }).then(({ revision: n }) => {
786
- e.inFlight = null, ie(e, t, n), K(e);
787
- }, (n) => {
788
- if (je(n) !== null) e.inFlight = null, se(e, t, n), K(e);
789
- else if (Ne(n)) {
790
- ce(e, n);
783
+ ops: n.ops,
784
+ ...n.origin === "ai" ? { origin: "ai" } : {}
785
+ }).then(({ revision: t }) => {
786
+ e.inFlight = null, ie(e, n, t), K(e);
787
+ }, (t) => {
788
+ if (je(t) !== null) e.inFlight = null, se(e, n, t), K(e);
789
+ else if (Ne(t)) {
790
+ ce(e, t);
791
791
  let i = Oe[Math.min(r, Oe.length - 1)];
792
792
  setTimeout(() => {
793
- C || re(e, t, r + 1);
793
+ C || re(e, n, r + 1);
794
794
  }, i);
795
- } else e.inFlight = null, F(n), se(e, t, n), K(e);
795
+ } else e.inFlight = null, F(t), se(e, n, t), K(e);
796
796
  });
797
797
  }
798
798
  function ie(e, t, n) {
@@ -829,7 +829,7 @@ function Le(t) {
829
829
  code: r
830
830
  }, e);
831
831
  }
832
- Y(e), e === m && X();
832
+ Y(e), e === g && X();
833
833
  }
834
834
  function J(e) {
835
835
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
@@ -843,43 +843,43 @@ function Le(t) {
843
843
  let n = e.pending.find((e) => e.batchId === t.batchId);
844
844
  n ? ie(e, n, t.revision) : (e.remote.set(t.revision, t), de(e));
845
845
  }
846
- function ue(e, n) {
846
+ function ue(t, n) {
847
847
  let r = n.ops;
848
- if (t.normalizeRemoteOperations) try {
849
- r = t.normalizeRemoteOperations(n.ops, e.confirmed);
848
+ if (e.normalizeRemoteOperations) try {
849
+ r = e.normalizeRemoteOperations(n.ops, t.confirmed);
850
850
  } catch (e) {
851
851
  F(e);
852
852
  }
853
853
  return Ie(r);
854
854
  }
855
- function de(e) {
855
+ function de(t) {
856
856
  let n = [], r = !1;
857
857
  for (;;) {
858
- let t = e.revision + 1, i = e.remote.get(t), a = e.own.get(t);
858
+ let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
859
859
  if (!i && !a) break;
860
860
  try {
861
- e.confirmed = V(e.confirmed, i ? ue(e, i) : a.ops);
861
+ t.confirmed = V(t.confirmed, i ? ue(t, i) : a.ops);
862
862
  } catch {
863
- if (e.recovering) {
864
- e.remote.clear(), e.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
863
+ if (t.recovering) {
864
+ t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
865
865
  return;
866
866
  }
867
- me(e);
867
+ me(t);
868
868
  return;
869
869
  }
870
- e.revision = t, i ? (e.remote.delete(t), n.push(i)) : (e.own.delete(t), a.group.dropped && (r = !0), q(e, a));
870
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), q(t, a));
871
871
  }
872
- if (e === m && (d.value = e.revision), e.remote.size > 0 || e.own.size > 0 ? fe(e) : pe(e), (n.length !== 0 || r) && (Y(e), e === m)) for (let e of n) try {
873
- t.onRemoteChange?.({
874
- actor: e.actor,
875
- ops: e.ops
872
+ if (t === g && (d.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? fe(t) : pe(t), (n.length !== 0 || r) && (Y(t), t === g)) for (let t of n) try {
873
+ e.onRemoteChange?.({
874
+ actor: t.actor,
875
+ ops: t.ops
876
876
  });
877
877
  } catch (e) {
878
878
  F(e);
879
879
  }
880
880
  }
881
881
  function Y(e) {
882
- e === m && G();
882
+ e === g && G();
883
883
  let t = e.confirmed;
884
884
  for (let n = 0; n < e.pending.length; n++) {
885
885
  let r = e.pending[n];
@@ -900,27 +900,27 @@ function Le(t) {
900
900
  t = e.confirmed, n = -1;
901
901
  }
902
902
  }
903
- e.view = t, J(e), e === m && B(t);
903
+ e.view = t, J(e), e === g && B(t);
904
904
  }
905
905
  function fe(e) {
906
906
  e.gapTimer ||= setTimeout(() => {
907
- e.gapTimer = null, e === m && X();
907
+ e.gapTimer = null, e === g && X();
908
908
  }, Ee);
909
909
  }
910
910
  function pe(e) {
911
911
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
912
912
  }
913
913
  function X() {
914
- let e = m;
914
+ let e = g;
915
915
  return e ? (e.catchingUp ||= (async () => {
916
916
  try {
917
- let t = await n.operationsAfter(e.templateId, e.revision);
917
+ let n = await t.operationsAfter(e.templateId, e.revision);
918
918
  if (e.retired) return;
919
- if ("resync" in t) {
919
+ if ("resync" in n) {
920
920
  await me(e);
921
921
  return;
922
922
  }
923
- for (let n of t.batches) le(e, n);
923
+ for (let t of n.batches) le(e, t);
924
924
  } catch (e) {
925
925
  F(e);
926
926
  } finally {
@@ -928,31 +928,31 @@ function Le(t) {
928
928
  }
929
929
  })(), e.catchingUp) : Promise.resolve();
930
930
  }
931
- async function me(e) {
932
- e.recovering = !0;
931
+ async function me(t) {
932
+ t.recovering = !0;
933
933
  try {
934
- let n = await t.loadTemplate(e.templateId);
935
- if (e.retired) return;
936
- let r = n.revision ?? e.revision;
937
- e.confirmed = j(n.content), e.revision = r, e.remote = new Map([...e.remote].filter(([e]) => e > r));
938
- for (let [t, n] of [...e.own]) t <= r && (e.own.delete(t), q(e, n));
939
- e === m && (d.value = r), Y(e), de(e);
934
+ let n = await e.loadTemplate(t.templateId);
935
+ if (t.retired) return;
936
+ let r = n.revision ?? t.revision;
937
+ t.confirmed = j(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
938
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), q(t, n));
939
+ t === g && (d.value = r), Y(t), de(t);
940
940
  } catch (e) {
941
941
  F(e);
942
942
  } finally {
943
- e.recovering = !1;
943
+ t.recovering = !1;
944
944
  }
945
945
  }
946
- function he(e) {
947
- let n = () => e === m && !e.retired;
946
+ function he(t) {
947
+ let n = () => t === g && !t.retired;
948
948
  return {
949
- onBatch: (t) => {
950
- n() && le(e, t);
949
+ onBatch: (e) => {
950
+ n() && le(t, e);
951
951
  },
952
952
  onResync: (r, i) => {
953
- if (!(!n() || r <= e.revision)) {
953
+ if (!(!n() || r <= t.revision)) {
954
954
  if (i) try {
955
- t.onRemoteResync?.({
955
+ e.onRemoteResync?.({
956
956
  revision: r,
957
957
  actor: i
958
958
  });
@@ -971,14 +971,14 @@ function Le(t) {
971
971
  onMembers: (e) => {
972
972
  n() && Ce(e);
973
973
  },
974
- onConnectionChange: (t) => {
975
- n() && ye(e, t);
974
+ onConnectionChange: (e) => {
975
+ n() && ye(t, e);
976
976
  }
977
977
  };
978
978
  }
979
- function ge(e, t) {
980
- n.join(e.templateId, { sessionId: i }, he(e)).then((n) => {
981
- e.retired || e !== m ? t || n.leave() : (e.leave = n.leave, Se(n.locks, !t), Ce(n.members), n.members.length > 0 && (u.value = "connected"), n.revision > e.revision && X(), t && Q());
979
+ function ge(e, r) {
980
+ t.join(e.templateId, { sessionId: n }, he(e)).then((t) => {
981
+ e.retired || e !== g ? r || t.leave() : (e.leave = t.leave, Se(t.locks, !r), Ce(t.members), t.members.length > 0 && (u.value = "connected"), t.revision > e.revision && X(), r && Q());
982
982
  }, (e) => F(e));
983
983
  }
984
984
  function _e(e) {
@@ -1000,7 +1000,7 @@ function Le(t) {
1000
1000
  redo: [],
1001
1001
  waiters: []
1002
1002
  };
1003
- m = n, d.value = n.revision, R(), ge(n, !1), p?.state.selectedBlockId && Be(p.state.selectedBlockId), H();
1003
+ g = n, d.value = n.revision, R(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), H();
1004
1004
  }
1005
1005
  function ve(e) {
1006
1006
  e.retired = !0, pe(e), e.leave?.(), e.leave = null, ce(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
@@ -1010,12 +1010,12 @@ function Le(t) {
1010
1010
  u.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
1011
1011
  }
1012
1012
  function be(e) {
1013
- m && m.templateId === e?.id || (m &&= (U(), ve(m), null), c.value = [], l.value = /* @__PURE__ */ new Map(), u.value = null, D = null, Q(), R(), e && _e(e));
1013
+ g && g.templateId === e?.id || (g &&= (U(), ve(g), null), s.value = [], l.value = /* @__PURE__ */ new Map(), u.value = null, D = null, Q(), R(), e && _e(e));
1014
1014
  }
1015
1015
  function xe(e) {
1016
- if (e.holder.sessionId === i) return;
1016
+ if (e.holder.sessionId === n) return;
1017
1017
  let t = new Map([...l.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1018
- t.set(e.blockId, e), l.value = t, p?.state.selectedBlockId === e.blockId && (p.selectBlock(null), I({
1018
+ t.set(e.blockId, e), l.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), I({
1019
1019
  type: "selectionRefused",
1020
1020
  blockId: e.blockId,
1021
1021
  holder: e.holder
@@ -1027,13 +1027,13 @@ function Le(t) {
1027
1027
  n.delete(e), l.value = n;
1028
1028
  }
1029
1029
  function Se(e, t) {
1030
- let n = t ? new Map(l.value) : /* @__PURE__ */ new Map();
1031
- for (let r of e) r.holder.sessionId !== i && (t && n.has(r.blockId) || n.set(r.blockId, r));
1032
- l.value = n;
1030
+ let r = t ? new Map(l.value) : /* @__PURE__ */ new Map();
1031
+ for (let i of e) i.holder.sessionId !== n && (t && r.has(i.blockId) || r.set(i.blockId, i));
1032
+ l.value = r;
1033
1033
  }
1034
1034
  function Ce(e) {
1035
- let t = new Set(e.map((e) => e.sessionId)), n = new Set(c.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1036
- if (c.value = e, n.size === 0) return;
1035
+ let t = new Set(e.map((e) => e.sessionId)), n = new Set(s.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1036
+ if (s.value = e, n.size === 0) return;
1037
1037
  let r = new Map([...l.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1038
1038
  r.size !== l.value.size && (l.value = r);
1039
1039
  }
@@ -1044,18 +1044,18 @@ function Le(t) {
1044
1044
  o && we(async () => {
1045
1045
  if (O && (D === null || O.templateId !== D.templateId)) {
1046
1046
  let e = O;
1047
- O = null, $(), await n.releaseLock(e.templateId, e.blockId);
1047
+ O = null, $(), await t.releaseLock(e.templateId, e.blockId);
1048
1048
  }
1049
1049
  let e = D;
1050
1050
  if (!(!e || O?.templateId === e.templateId && O.blockId === e.blockId)) try {
1051
- await n.acquireLock(e.templateId, e.blockId), O = e, ze(), Le(e.blockId);
1052
- } catch (t) {
1051
+ await t.acquireLock(e.templateId, e.blockId), O = e, ze(), Le(e.blockId);
1052
+ } catch (n) {
1053
1053
  if (O?.templateId === e.templateId) {
1054
1054
  let e = O;
1055
- O = null, $(), await n.releaseLock(e.templateId, e.blockId).catch(() => {});
1055
+ O = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
1056
1056
  }
1057
1057
  if (D !== e) return;
1058
- Re(e.blockId, t);
1058
+ Re(e.blockId, n);
1059
1059
  }
1060
1060
  });
1061
1061
  }
@@ -1073,7 +1073,7 @@ function Le(t) {
1073
1073
  blockId: e,
1074
1074
  holder: n,
1075
1075
  expiresAt: ""
1076
- }) : p?.state.selectedBlockId === e && p.selectBlock(null);
1076
+ }) : h?.state.selectedBlockId === e && h.selectBlock(null);
1077
1077
  } else F(t), setTimeout(() => {
1078
1078
  D?.blockId === e && Q();
1079
1079
  }, Oe[0]);
@@ -1083,7 +1083,7 @@ function Le(t) {
1083
1083
  we(async () => {
1084
1084
  let e = O;
1085
1085
  if (e) try {
1086
- await n.renewLock(e.templateId, e.blockId);
1086
+ await t.renewLock(e.templateId, e.blockId);
1087
1087
  } catch (e) {
1088
1088
  if (je(e) === "lock_lost") {
1089
1089
  O = null, $(), Q();
@@ -1098,17 +1098,17 @@ function Le(t) {
1098
1098
  A &&= (clearInterval(A), null);
1099
1099
  }
1100
1100
  function Be(e) {
1101
- G(), m && (D = e ? {
1102
- templateId: m.templateId,
1101
+ G(), g && (D = e ? {
1102
+ templateId: g.templateId,
1103
1103
  blockId: e
1104
1104
  } : null, Q());
1105
1105
  }
1106
1106
  function Ve() {
1107
- G(), O && o && (n.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), m?.leave?.(), m && (m.leave = null);
1107
+ G(), O && o && (t.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), g?.leave?.(), g && (g.leave = null);
1108
1108
  }
1109
1109
  function He(e) {
1110
- let t = m;
1111
- if (!t || h) return;
1110
+ let t = g;
1111
+ if (!t || v) return;
1112
1112
  G();
1113
1113
  let n = (e === "undo" ? t.undo : t.redo).pop();
1114
1114
  if (!n) return;
@@ -1125,11 +1125,11 @@ function Le(t) {
1125
1125
  return;
1126
1126
  }
1127
1127
  let i = { ops: N(t.view, n.ops) };
1128
- z(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), p?.markDirty(), ne(t, n.ops, e, i);
1128
+ z(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), h?.markDirty(), ne(t, n.ops, e, i);
1129
1129
  }
1130
1130
  function Ue(e, t) {
1131
- let n = m;
1132
- if (!p || !n || h) return {
1131
+ let n = g;
1132
+ if (!h || !n || v) return {
1133
1133
  applied: !1,
1134
1134
  error: new w("invalid_operation", 0, "No template is open for editing.")
1135
1135
  };
@@ -1148,38 +1148,38 @@ function Le(t) {
1148
1148
  return a && a.turn === t.turn ? (a.ops = [...i, ...a.ops], o = a) : (o = {
1149
1149
  ops: i,
1150
1150
  turn: t.turn
1151
- }, z(n.undo, o)), n.redo = [], R(), n.view = r, B(r), p.markDirty(), ne(n, e, t.origin, o), {
1151
+ }, z(n.undo, o)), n.redo = [], R(), n.view = r, B(r), h.markDirty(), ne(n, e, t.origin, o), {
1152
1152
  applied: !0,
1153
1153
  inverse: i
1154
1154
  };
1155
1155
  }
1156
1156
  function We(e) {
1157
- p = e, E.push(v(() => e.state.template, (e) => be(e), { immediate: !0 }), v(() => e.content.value, H, { deep: !0 }), v(() => e.state.selectedBlockId, Be), v(() => e.state.isLoading, (e) => e ? W(!0, !0) : H())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", G)), _() && s(Je);
1157
+ h = e, E.push(f(() => e.state.template, (e) => be(e), { immediate: !0 }), f(() => e.content.value, H, { deep: !0 }), f(() => e.state.selectedBlockId, Be), f(() => e.state.isLoading, (e) => e ? W(!0, !0) : H())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", G)), r() && c(Je);
1158
1158
  }
1159
1159
  function Ge() {
1160
1160
  G();
1161
- let e = m;
1161
+ let e = g;
1162
1162
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1163
1163
  resolve: t,
1164
1164
  reject: n
1165
1165
  }));
1166
1166
  }
1167
1167
  function Ke() {
1168
- G(), h = !0;
1168
+ G(), v = !0;
1169
1169
  }
1170
1170
  function qe() {
1171
- h = !1, m && B(m.view);
1171
+ v = !1, g && B(g.view);
1172
1172
  }
1173
1173
  function Je() {
1174
1174
  if (!C) {
1175
1175
  G();
1176
1176
  for (let e of E.splice(0)) e();
1177
- U(), Ve(), C = !0, m && ve(m), m = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", G));
1177
+ U(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", G));
1178
1178
  }
1179
1179
  }
1180
1180
  return {
1181
- sessionId: i,
1182
- members: c,
1181
+ sessionId: n,
1182
+ members: s,
1183
1183
  locks: l,
1184
1184
  connection: u,
1185
1185
  revision: d,
@@ -1189,103 +1189,103 @@ function Le(t) {
1189
1189
  undo: () => He("undo"),
1190
1190
  redo: () => He("redo"),
1191
1191
  clearHistory: () => {
1192
- m && (m.undo = [], m.redo = [], R());
1192
+ g && (g.undo = [], g.redo = [], R());
1193
1193
  },
1194
1194
  flush: G,
1195
1195
  settle: Ge,
1196
1196
  suspend: Ke,
1197
1197
  resume: qe,
1198
1198
  catchUp: X,
1199
- hasConfirmedBlock: (e) => m ? Pe(m.confirmed.blocks, e) : !1,
1199
+ hasConfirmedBlock: (e) => g ? Pe(g.confirmed.blocks, e) : !1,
1200
1200
  applyOperations: Ue,
1201
1201
  destroy: Je
1202
1202
  };
1203
1203
  }
1204
1204
  // ../core/src/saved-blocks.ts
1205
- function Re(t) {
1206
- let { provider: n } = t, r = e([]), i = e(!1), a = g(() => {
1205
+ function Re(e) {
1206
+ let { provider: t } = e, n = m([]), r = m(!1), i = v(() => {
1207
1207
  let e = /* @__PURE__ */ new Set();
1208
- for (let t of r.value) {
1208
+ for (let t of n.value) {
1209
1209
  let n = t.category?.trim();
1210
1210
  n && e.add(n);
1211
1211
  }
1212
1212
  return [...e].sort((e, t) => e.localeCompare(t));
1213
- }), o = g(() => typeof n.create == "function"), s = g(() => typeof n.update == "function"), c = g(() => typeof n.delete == "function");
1214
- function l(e) {
1215
- return s.value && e.canUpdate !== !1;
1213
+ }), a = v(() => typeof t.create == "function"), o = v(() => typeof t.update == "function"), s = v(() => typeof t.delete == "function");
1214
+ function c(e) {
1215
+ return o.value && e.canUpdate !== !1;
1216
1216
  }
1217
- function u(e) {
1218
- return c.value && e.canDelete !== !1;
1217
+ function l(e) {
1218
+ return s.value && e.canDelete !== !1;
1219
1219
  }
1220
- function d(e, t) {
1220
+ function u(e, t) {
1221
1221
  throw new H(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1222
1222
  }
1223
- function f(e) {
1224
- J(t.onError, e);
1223
+ function d(t) {
1224
+ J(e.onError, t);
1225
1225
  }
1226
- async function p(e) {
1227
- i.value = !0;
1226
+ async function f(i) {
1227
+ r.value = !0;
1228
1228
  try {
1229
- r.value = await n.list(e);
1230
- } catch (e) {
1231
- throw t.onError?.(e), e;
1229
+ n.value = await t.list(i);
1230
+ } catch (t) {
1231
+ throw e.onError?.(t), t;
1232
1232
  } finally {
1233
- i.value = !1;
1233
+ r.value = !1;
1234
1234
  }
1235
1235
  }
1236
- async function m(e, i, a) {
1237
- let { create: o } = n;
1238
- typeof o != "function" && d("create", "disabled by the provider");
1236
+ async function p(r, i, a) {
1237
+ let { create: o } = t;
1238
+ typeof o != "function" && u("create", "disabled by the provider");
1239
1239
  try {
1240
- let t = await o(a ? {
1241
- name: e,
1240
+ let e = await o(a ? {
1241
+ name: r,
1242
1242
  content: i,
1243
1243
  category: a
1244
1244
  } : {
1245
- name: e,
1245
+ name: r,
1246
1246
  content: i
1247
1247
  });
1248
- return r.value = [t, ...r.value], f(() => n.onCreated?.(t)), t;
1249
- } catch (e) {
1250
- throw t.onError?.(e), e;
1248
+ return n.value = [e, ...n.value], d(() => t.onCreated?.(e)), e;
1249
+ } catch (t) {
1250
+ throw e.onError?.(t), t;
1251
1251
  }
1252
1252
  }
1253
- async function h(e, i) {
1254
- let { update: a } = n;
1255
- typeof a != "function" && d("update", "disabled by the provider");
1256
- let o = r.value.find((t) => t.id === e);
1257
- o && o.canUpdate === !1 && d("update", `not permitted for entry "${e}"`);
1253
+ async function h(r, i) {
1254
+ let { update: a } = t;
1255
+ typeof a != "function" && u("update", "disabled by the provider");
1256
+ let o = n.value.find((e) => e.id === r);
1257
+ o && o.canUpdate === !1 && u("update", `not permitted for entry "${r}"`);
1258
1258
  try {
1259
- let t = await a(e, i);
1260
- return r.value = r.value.map((n) => n.id === e ? t : n), f(() => n.onUpdated?.(t)), t;
1261
- } catch (e) {
1262
- throw t.onError?.(e), e;
1259
+ let e = await a(r, i);
1260
+ return n.value = n.value.map((t) => t.id === r ? e : t), d(() => t.onUpdated?.(e)), e;
1261
+ } catch (t) {
1262
+ throw e.onError?.(t), t;
1263
1263
  }
1264
1264
  }
1265
- async function _(e) {
1266
- let { delete: i } = n;
1267
- typeof i != "function" && d("delete", "disabled by the provider");
1268
- let a = r.value.find((t) => t.id === e) ?? null;
1269
- a && a.canDelete === !1 && d("delete", `not permitted for entry "${e}"`);
1265
+ async function g(r) {
1266
+ let { delete: i } = t;
1267
+ typeof i != "function" && u("delete", "disabled by the provider");
1268
+ let a = n.value.find((e) => e.id === r) ?? null;
1269
+ a && a.canDelete === !1 && u("delete", `not permitted for entry "${r}"`);
1270
1270
  try {
1271
- await i(e), r.value = r.value.filter((t) => t.id !== e), a && f(() => n.onDeleted?.(a));
1272
- } catch (e) {
1273
- throw t.onError?.(e), e;
1271
+ await i(r), n.value = n.value.filter((e) => e.id !== r), a && d(() => t.onDeleted?.(a));
1272
+ } catch (t) {
1273
+ throw e.onError?.(t), t;
1274
1274
  }
1275
1275
  }
1276
1276
  return {
1277
- savedBlocks: r,
1278
- isLoading: i,
1279
- categories: a,
1280
- canCreate: o,
1281
- canUpdate: s,
1282
- canDelete: c,
1283
- canUpdateBlock: l,
1284
- canDeleteBlock: u,
1285
- load: p,
1286
- create: m,
1277
+ savedBlocks: n,
1278
+ isLoading: r,
1279
+ categories: i,
1280
+ canCreate: a,
1281
+ canUpdate: o,
1282
+ canDelete: s,
1283
+ canUpdateBlock: c,
1284
+ canDeleteBlock: l,
1285
+ load: f,
1286
+ create: p,
1287
1287
  update: h,
1288
- remove: _
1288
+ remove: g
1289
1289
  };
1290
1290
  }
1291
1291
  // ../core/src/saved-blocks-local.ts
@@ -1419,121 +1419,121 @@ function He(e = {}) {
1419
1419
  };
1420
1420
  }
1421
1421
  // ../core/src/version-history.ts
1422
- function Ue(t) {
1423
- let { provider: n, getTemplateId: r } = t, i = e([]), a = e(!1), o = e(void 0), s = e(!1), c = /* @__PURE__ */ new Map(), l = g(() => typeof n.create == "function"), u = g(() => typeof n.restore == "function");
1424
- function d(e) {
1425
- let t = r();
1422
+ function Ue(e) {
1423
+ let { provider: t, getTemplateId: n } = e, r = m([]), i = m(!1), a = m(void 0), o = m(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
1424
+ function u(e) {
1425
+ let t = n();
1426
1426
  if (!t) throw new H(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1427
1427
  return t;
1428
1428
  }
1429
- function f(e) {
1429
+ function d(e) {
1430
1430
  throw new H(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1431
1431
  }
1432
- function p(e) {
1433
- J(t.onError, e);
1432
+ function f(t) {
1433
+ J(e.onError, t);
1434
1434
  }
1435
- async function m(e) {
1436
- let r = d("list");
1437
- a.value = !0;
1435
+ async function p(n) {
1436
+ let o = u("list");
1437
+ i.value = !0;
1438
1438
  try {
1439
- let t = await n.list(r, e);
1440
- i.value = t.versions, o.value = t.nextCursor;
1441
- } catch (e) {
1442
- throw t.onError?.(e), e;
1439
+ let e = await t.list(o, n);
1440
+ r.value = e.versions, a.value = e.nextCursor;
1441
+ } catch (t) {
1442
+ throw e.onError?.(t), t;
1443
1443
  } finally {
1444
- a.value = !1;
1444
+ i.value = !1;
1445
1445
  }
1446
1446
  }
1447
1447
  function h(e) {
1448
- return e.content ?? c.get(e.id) ?? null;
1448
+ return e.content ?? s.get(e.id) ?? null;
1449
1449
  }
1450
- async function _(e) {
1451
- let r = h(e);
1450
+ async function g(n) {
1451
+ let r = h(n);
1452
1452
  if (r) return r;
1453
- let i = d("get");
1453
+ let i = u("get");
1454
1454
  try {
1455
- let t = await n.get(i, e.id);
1456
- return c.set(e.id, t), t;
1457
- } catch (e) {
1458
- throw t.onError?.(e), e;
1455
+ let e = await t.get(i, n.id);
1456
+ return s.set(n.id, e), e;
1457
+ } catch (t) {
1458
+ throw e.onError?.(t), t;
1459
1459
  }
1460
1460
  }
1461
- async function v(e, r) {
1462
- let { create: a } = n;
1463
- typeof a != "function" && f("create");
1464
- let o = d("create");
1461
+ async function _(n, i) {
1462
+ let { create: a } = t;
1463
+ typeof a != "function" && d("create");
1464
+ let o = u("create");
1465
1465
  try {
1466
- let t = await a(o, e, r);
1467
- return i.value = [t, ...i.value], p(() => n.onCreated?.(t)), t;
1468
- } catch (e) {
1469
- throw t.onError?.(e), e;
1466
+ let e = await a(o, n, i);
1467
+ return r.value = [e, ...r.value], f(() => t.onCreated?.(e)), e;
1468
+ } catch (t) {
1469
+ throw e.onError?.(t), t;
1470
1470
  }
1471
1471
  }
1472
- async function y(e) {
1473
- let { restore: r } = n;
1474
- typeof r != "function" && f("restore");
1475
- let i = d("restore"), a;
1476
- s.value = !0;
1472
+ async function y(n) {
1473
+ let { restore: r } = t;
1474
+ typeof r != "function" && d("restore");
1475
+ let i = u("restore"), a;
1476
+ o.value = !0;
1477
1477
  try {
1478
- a = await r(i, e);
1479
- } catch (e) {
1480
- throw t.onError?.(e), e;
1478
+ a = await r(i, n);
1479
+ } catch (t) {
1480
+ throw e.onError?.(t), t;
1481
1481
  } finally {
1482
- s.value = !1;
1482
+ o.value = !1;
1483
1483
  }
1484
- return p(() => n.onRestored?.(a)), a;
1484
+ return f(() => t.onRestored?.(a)), a;
1485
1485
  }
1486
1486
  return {
1487
- nextCursor: o,
1488
- versions: i,
1489
- isLoading: a,
1490
- isRestoring: s,
1491
- canCreate: l,
1492
- canRestore: u,
1493
- load: m,
1487
+ nextCursor: a,
1488
+ versions: r,
1489
+ isLoading: i,
1490
+ isRestoring: o,
1491
+ canCreate: c,
1492
+ canRestore: l,
1493
+ load: p,
1494
1494
  peekContent: h,
1495
- resolveContent: _,
1496
- create: v,
1495
+ resolveContent: g,
1496
+ create: _,
1497
1497
  restore: y
1498
1498
  };
1499
1499
  }
1500
1500
  // ../core/src/comments.ts
1501
- function We(t) {
1502
- let { provider: n, getTemplateId: r, getUser: i } = t, a = e([]), o = e(!1), s = e(!1), c = g(() => typeof n.create == "function"), l = g(() => typeof n.update == "function"), u = g(() => typeof n.delete == "function"), d = g(() => typeof n.setResolved == "function"), f = g(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = g(() => a.value.filter((e) => !e.resolvedAt).length), m = g(() => {
1501
+ function We(e) {
1502
+ let { provider: t, getTemplateId: n, getUser: r } = e, i = m([]), a = m(!1), o = m(!1), s = v(() => typeof t.create == "function"), c = v(() => typeof t.update == "function"), l = v(() => typeof t.delete == "function"), u = v(() => typeof t.setResolved == "function"), d = v(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), f = v(() => i.value.filter((e) => !e.resolvedAt).length), p = v(() => {
1503
1503
  let e = /* @__PURE__ */ new Map();
1504
- for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1504
+ for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1505
1505
  return e;
1506
1506
  });
1507
1507
  function h(e) {
1508
- let t = r();
1508
+ let t = n();
1509
1509
  if (!t) throw new H(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1510
1510
  return t;
1511
1511
  }
1512
- function _(e) {
1513
- let t = i();
1512
+ function g(e) {
1513
+ let t = r();
1514
1514
  if (!t) throw new H(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1515
1515
  return t;
1516
1516
  }
1517
- function v(e) {
1517
+ function _(e) {
1518
1518
  throw new H(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1519
1519
  }
1520
1520
  function y(e) {
1521
- for (let t of a.value) {
1521
+ for (let t of i.value) {
1522
1522
  if (t.id === e) return t;
1523
1523
  for (let n of t.replies ?? []) if (n.id === e) return n;
1524
1524
  }
1525
1525
  return null;
1526
1526
  }
1527
1527
  function b(e) {
1528
- let t = i();
1528
+ let t = r();
1529
1529
  return t !== null && e.author.id === t.id;
1530
1530
  }
1531
- function x(e) {
1532
- let n = se(e);
1533
- throw t.onError?.(n), n;
1531
+ function x(t) {
1532
+ let n = se(t);
1533
+ throw e.onError?.(n), n;
1534
1534
  }
1535
- function S(e) {
1536
- J(t.onError, e);
1535
+ function S(t) {
1536
+ J(e.onError, t);
1537
1537
  }
1538
1538
  function C(e, t, n) {
1539
1539
  return [
@@ -1547,7 +1547,7 @@ function We(t) {
1547
1547
  }
1548
1548
  function T(e) {
1549
1549
  if (e.parentId) {
1550
- let t = !1, n = a.value.map((n) => {
1550
+ let t = !1, n = i.value.map((n) => {
1551
1551
  if (n.id !== e.parentId) return n;
1552
1552
  let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
1553
1553
  return i !== -1 && w(r[i], e) ? n : (t = !0, {
@@ -1555,112 +1555,112 @@ function We(t) {
1555
1555
  replies: i === -1 ? [...r, e] : C(r, i, e)
1556
1556
  });
1557
1557
  });
1558
- return t && (a.value = n), t;
1558
+ return t && (i.value = n), t;
1559
1559
  }
1560
- let t = a.value.findIndex((t) => t.id === e.id);
1561
- if (t === -1) return a.value = [...a.value, e], !0;
1560
+ let t = i.value.findIndex((t) => t.id === e.id);
1561
+ if (t === -1) return i.value = [...i.value, e], !0;
1562
1562
  let n = {
1563
1563
  ...e,
1564
- replies: e.replies ?? a.value[t].replies
1564
+ replies: e.replies ?? i.value[t].replies
1565
1565
  };
1566
- return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
1566
+ return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
1567
1567
  }
1568
1568
  function E(e, t) {
1569
1569
  let n = y(e), r = t ?? n?.parentId ?? null;
1570
- return r ? a.value = a.value.map((t) => t.id === r ? {
1570
+ return r ? i.value = i.value.map((t) => t.id === r ? {
1571
1571
  ...t,
1572
1572
  replies: (t.replies ?? []).filter((t) => t.id !== e)
1573
- } : t) : a.value = a.value.filter((t) => t.id !== e), n;
1573
+ } : t) : i.value = i.value.filter((t) => t.id !== e), n;
1574
1574
  }
1575
1575
  async function D(e) {
1576
- let t = h("list");
1577
- o.value = !0;
1576
+ let n = h("list");
1577
+ a.value = !0;
1578
1578
  try {
1579
- a.value = await n.list(t, e);
1579
+ i.value = await t.list(n, e);
1580
1580
  } catch (e) {
1581
1581
  x(e);
1582
1582
  } finally {
1583
- o.value = !1;
1583
+ a.value = !1;
1584
1584
  }
1585
1585
  }
1586
1586
  async function O(e) {
1587
- let { create: t } = n;
1588
- typeof t != "function" && v("create");
1587
+ let { create: n } = t;
1588
+ typeof n != "function" && _("create");
1589
1589
  let r = h("create");
1590
- _("create"), s.value = !0;
1590
+ g("create"), o.value = !0;
1591
1591
  try {
1592
- let i = await t(r, e);
1593
- return T(i), S(() => n.onCreated?.(i, { origin: "local" })), i;
1592
+ let i = await n(r, e);
1593
+ return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
1594
1594
  } catch (e) {
1595
1595
  x(e);
1596
1596
  } finally {
1597
- s.value = !1;
1597
+ o.value = !1;
1598
1598
  }
1599
1599
  }
1600
- async function k(e, t) {
1601
- let { update: r } = n;
1602
- typeof r != "function" && v("update");
1600
+ async function k(e, n) {
1601
+ let { update: r } = t;
1602
+ typeof r != "function" && _("update");
1603
1603
  let i = h("update");
1604
- _("update"), s.value = !0;
1604
+ g("update"), o.value = !0;
1605
1605
  try {
1606
- let a = await r(i, e, t);
1607
- return T(a), S(() => n.onUpdated?.(a, { origin: "local" })), a;
1606
+ let a = await r(i, e, n);
1607
+ return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
1608
1608
  } catch (e) {
1609
1609
  x(e);
1610
1610
  } finally {
1611
- s.value = !1;
1611
+ o.value = !1;
1612
1612
  }
1613
1613
  }
1614
1614
  async function A(e) {
1615
- let { delete: t } = n;
1616
- typeof t != "function" && v("delete");
1615
+ let { delete: n } = t;
1616
+ typeof n != "function" && _("delete");
1617
1617
  let r = h("delete");
1618
- _("delete");
1618
+ g("delete");
1619
1619
  let i = y(e);
1620
- s.value = !0;
1620
+ o.value = !0;
1621
1621
  try {
1622
- await t(r, e), E(e), i && S(() => n.onDeleted?.(i, { origin: "local" }));
1622
+ await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
1623
1623
  } catch (e) {
1624
1624
  x(e);
1625
1625
  } finally {
1626
- s.value = !1;
1626
+ o.value = !1;
1627
1627
  }
1628
1628
  }
1629
- async function j(e, t) {
1630
- let { setResolved: r } = n;
1631
- typeof r != "function" && v("setResolved");
1629
+ async function j(e, n) {
1630
+ let { setResolved: r } = t;
1631
+ typeof r != "function" && _("setResolved");
1632
1632
  let i = h("setResolved");
1633
- _("setResolved"), s.value = !0;
1633
+ g("setResolved"), o.value = !0;
1634
1634
  try {
1635
- let a = await r(i, e, t);
1636
- return T(a), S(() => (a.resolvedAt ? n.onResolved : n.onUnresolved)?.(a, { origin: "local" })), a;
1635
+ let a = await r(i, e, n);
1636
+ return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
1637
1637
  } catch (e) {
1638
1638
  x(e);
1639
1639
  } finally {
1640
- s.value = !1;
1640
+ o.value = !1;
1641
1641
  }
1642
1642
  }
1643
1643
  function M(e) {
1644
- T(e) && S(() => n.onCreated?.(e, { origin: "remote" }));
1644
+ T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
1645
1645
  }
1646
1646
  function N(e) {
1647
- T(e) && S(() => (e.resolvedAt ? n.onResolved : n.onUpdated)?.(e, { origin: "remote" }));
1647
+ T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
1648
1648
  }
1649
- function P(e, t) {
1650
- let r = E(e, t);
1651
- r && S(() => n.onDeleted?.(r, { origin: "remote" }));
1649
+ function P(e, n) {
1650
+ let r = E(e, n);
1651
+ r && S(() => t.onDeleted?.(r, { origin: "remote" }));
1652
1652
  }
1653
1653
  return {
1654
- comments: a,
1655
- isLoading: o,
1656
- isSubmitting: s,
1657
- canCreate: c,
1658
- canUpdate: l,
1659
- canDelete: u,
1660
- canResolve: d,
1661
- totalCount: f,
1662
- unresolvedCount: p,
1663
- commentCountByBlock: m,
1654
+ comments: i,
1655
+ isLoading: a,
1656
+ isSubmitting: o,
1657
+ canCreate: s,
1658
+ canUpdate: c,
1659
+ canDelete: l,
1660
+ canResolve: u,
1661
+ totalCount: d,
1662
+ unresolvedCount: f,
1663
+ commentCountByBlock: p,
1664
1664
  load: D,
1665
1665
  create: O,
1666
1666
  update: k,
@@ -1677,11 +1677,11 @@ function Ge(e) {
1677
1677
  let { comments: t, provider: n, getTemplateId: r } = e, { subscribe: i } = n;
1678
1678
  if (typeof i != "function") return;
1679
1679
  let a = null;
1680
- function c() {
1680
+ function o() {
1681
1681
  a?.(), a = null;
1682
1682
  }
1683
- o(() => r(), (e) => {
1684
- c(), e && (a = i(e, (e) => {
1683
+ s(() => r(), (e) => {
1684
+ o(), e && (a = i(e, (e) => {
1685
1685
  switch (e.type) {
1686
1686
  case "created":
1687
1687
  t.applyRemoteCreate(e.comment);
@@ -1692,13 +1692,13 @@ function Ge(e) {
1692
1692
  case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
1693
1693
  }
1694
1694
  }));
1695
- }, { immediate: !0 }), s(c);
1695
+ }, { immediate: !0 }), c(o);
1696
1696
  }
1697
1697
  // src/constants/timeouts.ts
1698
1698
  var Ke = 1e4;
1699
1699
  // src/composables/useImageUrlResolver.ts
1700
1700
  function qe(e) {
1701
- let t = c(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1701
+ let t = o(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1702
1702
  function r(e) {
1703
1703
  return t.get(e);
1704
1704
  }
@@ -1727,22 +1727,22 @@ function qe(e) {
1727
1727
  };
1728
1728
  }
1729
1729
  function Je(e) {
1730
- let t = n(K, null), r = g(e);
1731
- if (!t) return r;
1732
- let i;
1733
- function a() {
1734
- i !== void 0 && (clearTimeout(i), i = void 0);
1735
- }
1736
- _() && s(a);
1737
- let c = !0;
1738
- return o(r, (e) => {
1739
- a();
1740
- let n = c;
1741
- c = !1, e && !t.has(e) && (n ? t.lookup(e) : i = setTimeout(() => {
1742
- i = void 0, t.lookup(e);
1730
+ let t = n(K, null), i = v(e);
1731
+ if (!t) return i;
1732
+ let a;
1733
+ function o() {
1734
+ a !== void 0 && (clearTimeout(a), a = void 0);
1735
+ }
1736
+ r() && c(o);
1737
+ let l = !0;
1738
+ return s(i, (e) => {
1739
+ o();
1740
+ let n = l;
1741
+ l = !1, e && !t.has(e) && (n ? t.lookup(e) : a = setTimeout(() => {
1742
+ a = void 0, t.lookup(e);
1743
1743
  }, 300));
1744
- }, { immediate: !0 }), g(() => {
1745
- let e = r.value;
1744
+ }, { immediate: !0 }), v(() => {
1745
+ let e = i.value;
1746
1746
  if (!e) return e;
1747
1747
  let n = t.get(e);
1748
1748
  return typeof n == "string" && n.length > 0 ? n : e;
@@ -1762,7 +1762,7 @@ function Ze(e, t) {
1762
1762
  }
1763
1763
  function Qe(e) {
1764
1764
  let t = n(te, z.liquid), r = Je(() => Ze(e(), t));
1765
- return g(() => Xe(e(), t) ? null : r.value);
1765
+ return v(() => Xe(e(), t) ? null : r.value);
1766
1766
  }
1767
1767
  function $e(e, t, n) {
1768
1768
  return Xe(t, n) ? null : Ye(e, Ze(t, n));
@@ -1849,31 +1849,31 @@ var lt = /* @__PURE__ */ t({
1849
1849
  icon: 20,
1850
1850
  veil: "85%"
1851
1851
  }
1852
- }, a = g(() => r[t.size]);
1853
- return (t, r) => (i(), l("div", {
1854
- class: m(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", a.value.gap]),
1855
- style: x({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
1856
- }, [e.uploading ? (i(), l(b, { key: 0 }, [S(h(ae), {
1852
+ }, i = v(() => r[t.size]);
1853
+ return (t, r) => (a(), l("div", {
1854
+ class: x(["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)]", i.value.gap]),
1855
+ style: p({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${i.value.veil}, transparent)` })
1856
+ }, [e.uploading ? (a(), l(b, { key: 0 }, [S(y(ae), {
1857
1857
  class: "tpl-spinner",
1858
- size: a.value.icon,
1858
+ size: i.value.icon,
1859
1859
  "stroke-width": 2
1860
- }, null, 8, ["size"]), u(" " + d(h(n).image.uploading), 1)], 64)) : (i(), l(b, { key: 1 }, [S(h(oe), {
1861
- size: a.value.icon,
1860
+ }, null, 8, ["size"]), d(" " + h(y(n).image.uploading), 1)], 64)) : (a(), l(b, { key: 1 }, [S(y(oe), {
1861
+ size: i.value.icon,
1862
1862
  "stroke-width": 1.5
1863
- }, null, 8, ["size"]), u(" " + d(h(n).image.dropToUpload), 1)], 64))], 6));
1863
+ }, null, 8, ["size"]), d(" " + h(y(n).image.dropToUpload), 1)], 64))], 6));
1864
1864
  }
1865
1865
  });
1866
1866
  // src/composables/useAliveFlag.ts
1867
1867
  function ut() {
1868
1868
  let e = { alive: !0 };
1869
- return p(() => {
1869
+ return g(() => {
1870
1870
  e.alive = !1;
1871
1871
  }), e;
1872
1872
  }
1873
1873
  // src/composables/useImageDrop.ts
1874
1874
  var dt = "image/";
1875
1875
  function ft(e) {
1876
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || f(r), { isOverDropZone: a } = W(t, {
1876
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || u(r), { isOverDropZone: a } = W(t, {
1877
1877
  preventDefaultForUnhandled: !0,
1878
1878
  onDrop: (e) => {
1879
1879
  if (!i()) return;
@@ -1881,42 +1881,42 @@ function ft(e) {
1881
1881
  t.length > 0 && n([t[0]]);
1882
1882
  }
1883
1883
  });
1884
- return { isOver: g(() => i() && a.value) };
1884
+ return { isOver: v(() => i() && a.value) };
1885
1885
  }
1886
1886
  // src/composables/useMediaDropField.ts
1887
- function pt(t) {
1888
- let { target: r, blocked: i, apply: a } = t, o = n(G, null), s = n(ne, null), c = ut();
1889
- async function l() {
1890
- let e = await o?.({ accept: ["images"] });
1891
- c.alive && e && a(e);
1892
- }
1893
- let u = e(!1), d = g(() => (s?.value ?? !!o) && !u.value && !f(i));
1894
- async function p(e) {
1895
- if (o) {
1896
- u.value = !0;
1887
+ function pt(e) {
1888
+ let { target: t, blocked: r, apply: i } = e, a = n(G, null), o = n(ne, null), s = ut();
1889
+ async function c() {
1890
+ let e = await a?.({ accept: ["images"] });
1891
+ s.alive && e && i(e);
1892
+ }
1893
+ let l = m(!1), d = v(() => (o?.value ?? !!a) && !l.value && !u(r));
1894
+ async function f(e) {
1895
+ if (a) {
1896
+ l.value = !0;
1897
1897
  try {
1898
- let t = await o({
1898
+ let t = await a({
1899
1899
  accept: ["images"],
1900
1900
  files: e
1901
1901
  });
1902
- if (!c.alive) return;
1903
- t && a(t);
1902
+ if (!s.alive) return;
1903
+ t && i(t);
1904
1904
  } finally {
1905
- c.alive && (u.value = !1);
1905
+ s.alive && (l.value = !1);
1906
1906
  }
1907
1907
  }
1908
1908
  }
1909
- let { isOver: m } = ft({
1910
- target: r,
1909
+ let { isOver: p } = ft({
1910
+ target: t,
1911
1911
  enabled: d,
1912
- onFiles: p
1913
- }), h = g(() => d.value && m.value || u.value);
1912
+ onFiles: f
1913
+ }), h = v(() => d.value && p.value || l.value);
1914
1914
  return {
1915
- canBrowse: !!o,
1915
+ canBrowse: !!a,
1916
1916
  dropEnabled: d,
1917
- isUploading: u,
1917
+ isUploading: l,
1918
1918
  showOverlay: h,
1919
- openMediaBrowser: l
1919
+ openMediaBrowser: c
1920
1920
  };
1921
1921
  }
1922
1922
  function mt(e, t = "desktop") {
@@ -2005,4 +2005,4 @@ var Tt = R, Et = {
2005
2005
  ];
2006
2006
  export { Re as A, Qe as C, Ue as D, We as E, pe as F, X as I, fe as L, ge as M, he as N, He as O, me as P, Y as R, $e as S, Ge as T, nt as _, wt as a, qe as b, mt as c, lt as d, st as f, it as g, at as h, St as i, Le as j, $ as k, pt as l, ot as m, Tt as n, Ct as o, ct as p, Dt as r, ht as s, Et as t, ut as u, tt as v, Je as w, Ze as x, et as y, ce as z };
2007
2007
 
2008
- //# sourceMappingURL=socialIcons-rJoqO1TJ.js.map
2008
+ //# sourceMappingURL=socialIcons-jsTDmkbb.js.map