@templatical/editor 0.52.0 → 0.53.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 (400) hide show
  1. package/README.md +1 -1
  2. package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
  3. package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
  4. package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-DdhtfsmO.js} +223 -210
  5. package/dist/{AiPanels-CxGp6klr.js → AiPanels-HBx7xoJR.js} +6 -6
  6. package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-DPzSekZt.js} +78 -107
  7. package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
  8. package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
  9. package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
  10. package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-i2kZdrdP.js} +44 -44
  11. package/dist/CollaborationNotices-DANsjl7c.js +65 -0
  12. package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CbbAA0m1.js} +24 -24
  13. package/dist/CommentsPanel-CYW3LWis.js +16 -0
  14. package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
  15. package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-BMezkFbJ.js} +21 -21
  16. package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
  17. package/dist/{IssuesPanel-BHFQ3wrP.js → IssuesPanel-BMAG9042.js} +141 -129
  18. package/dist/LanguageMenu-FlP_Jbup.js +403 -0
  19. package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-BG8cg9xi.js} +2 -2
  20. package/dist/LocaleNotices-DAnVszWu.js +46 -0
  21. package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-BjYs-UQX.js} +439 -430
  22. package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-LnG-cF_S.js} +160 -160
  23. package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-C2r5fiFo.js} +4 -4
  24. package/dist/{cdn/chunks/MergeTagInput-CFu9VXPS.js → MergeTagInput-BsnogCeY.js} +32 -34
  25. package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
  26. package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
  27. package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-qgBp5yIB.js} +286 -257
  28. package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
  29. package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-C5MAzx3E.js} +54 -53
  30. package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
  31. package/dist/SavedBlocksBrowserModal-D2QHd2Yp.js +359 -0
  32. package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
  33. package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
  34. package/dist/TemplateSettings-BKJrdZcH.js +294 -0
  35. package/dist/TestEmailModal-DQotJg6g.js +212 -0
  36. package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-CwiTzJsh.js} +4 -4
  37. package/dist/TitleEditor-CzSvsPAn.js +202 -0
  38. package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
  39. package/dist/Toolbar-Cd75ci5W.js +3711 -0
  40. package/dist/{TplModal-9IndEYk5.js → TplModal-ZoXu40T9.js} +17 -17
  41. package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
  42. package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
  43. package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
  44. package/dist/WrapperBlock-D4fPwO0t.js +44 -0
  45. package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BXMxu86H.js} +27 -26
  46. package/dist/bundle-stats.json +8 -8
  47. package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
  48. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
  49. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
  50. package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-Dtm3A2cD.js} +71 -69
  51. package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
  52. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
  53. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
  54. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-BV5D1itk.js} +11 -11
  55. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-BV5D1itk.js.map} +1 -1
  56. package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-D3jkh6Xb.js} +80 -80
  57. package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
  58. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
  59. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
  61. package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
  62. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BtqdN777.js} +4 -4
  63. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
  64. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-BSJ-Z5Hw.js} +43 -43
  65. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
  66. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
  67. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
  68. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-Bc9914Az.js} +16 -16
  69. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
  70. package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
  71. package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
  72. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
  73. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
  74. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-CjMhMhnv.js} +26 -26
  75. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
  76. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
  77. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
  78. package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-CUmI4HMm.js} +132 -120
  79. package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
  80. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
  81. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
  82. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-DUYcDHOV.js} +2 -2
  83. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
  84. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
  85. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
  86. package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-5Z3fFzjc.js} +465 -456
  87. package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
  88. package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-DDCIwr9U.js} +439 -439
  89. package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
  90. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-Dz79oy8P.js} +5 -5
  91. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
  92. package/dist/cdn/chunks/MergeTagInput-CIWy-cXf.js +82 -0
  93. package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BrP5GR-x.js} +50 -50
  95. package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
  96. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
  99. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-Crj1DBqC.js} +18 -18
  101. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-rCCqFlwJ.js} +43 -43
  103. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-C34RW1aM.js} +71 -71
  105. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js +356 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
  108. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
  109. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
  113. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
  114. package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-BXeCtTjU.js} +81 -78
  115. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
  116. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CpZcpB9D.js} +5 -5
  117. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
  119. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
  120. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
  121. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
  122. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
  123. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-BDyeS69p.js → TplModal-DDDUDMYC.js} +19 -19
  125. package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-DDDUDMYC.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-DSElv3Sv.js} +36 -36
  127. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
  128. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
  130. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
  131. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
  132. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
  133. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
  134. package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js +21 -0
  135. package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js.map +1 -0
  136. package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
  137. package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
  138. package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
  139. package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
  140. package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-BdsclY8_.js} +85 -83
  141. package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
  142. package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
  143. package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
  144. package/dist/{dist-CEdyyDn7.js → cdn/chunks/dist-BzXULHvI.js} +63 -61
  145. package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-BzXULHvI.js.map} +1 -1
  146. package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-DqGgijFI.js} +108 -109
  147. package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-DqGgijFI.js.map} +1 -1
  148. package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-DepKdldn.js} +1384 -1376
  149. package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
  150. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CPbgthOv.js} +986 -986
  151. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CPbgthOv.js.map} +1 -1
  152. package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
  153. package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
  154. package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
  155. package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
  156. package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
  157. package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-Uh9vuFfK.js} +57 -57
  158. package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-Uh9vuFfK.js.map} +1 -1
  159. package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
  160. package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
  161. package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-CSSMtbGK.js} +187 -144
  162. package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
  163. package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
  164. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
  165. package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
  166. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
  167. package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
  168. package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
  169. package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
  170. package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
  171. package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
  172. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
  173. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
  174. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
  175. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
  176. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
  177. package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
  178. package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
  179. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
  180. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
  181. package/dist/cdn/chunks/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +115 -1
  182. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
  183. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
  184. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
  185. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
  186. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
  187. package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
  188. package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
  189. package/dist/cdn/chunks/{src-CUH_EI7k.js → src-Ddpm4HsS.js} +225 -259
  190. package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
  191. package/dist/cdn/chunks/{src-BKpAis_q.js → src-DheBmnvF.js} +635 -478
  192. package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
  193. package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
  194. package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
  195. package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
  196. package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-Dipw_zOQ.js} +48 -48
  197. package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
  198. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-Cc5NZqiI.js} +3 -3
  199. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
  200. package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
  201. package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
  202. package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-BnJYydPv.js} +3 -3
  203. package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-BnJYydPv.js.map} +1 -1
  204. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
  205. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
  206. package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js → useLogicTag-B7RpqVFQ.js} +5 -5
  207. package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
  208. package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js → useMergeTag-C-32ETjj.js} +6 -6
  209. package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
  210. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
  211. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
  212. package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
  213. package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
  214. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-D33ZXoWp.js} +2 -2
  215. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
  216. package/dist/cdn/editor.css +1 -1
  217. package/dist/cdn/editor.js +2503 -1809
  218. package/dist/cdn/editor.js.map +1 -1
  219. package/dist/{check-N3x4z_rH.js → check-ChQ0l8EQ.js} +1 -1
  220. package/dist/{chevron-down-gXu9qNwO.js → chevron-down-Bh6cp6PI.js} +1 -1
  221. package/dist/{chevron-right-rL0ayGk5.js → chevron-right-LUgdqdoW.js} +1 -1
  222. package/dist/{chevron-up-0ugh8HnW.js → chevron-up-XsDeJxQN.js} +1 -1
  223. package/dist/{circle-alert-B9Ls75B5.js → circle-alert-lODfDsrj.js} +1 -1
  224. package/dist/{clock-BqHBaCLm.js → clock-DrqFEZkT.js} +1 -1
  225. package/dist/composables-BOP3ERRP.js +4517 -0
  226. package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DGV5a5Af.js} +47 -45
  227. package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-Dw5e5gVE.js} +16 -16
  228. package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
  229. package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-0alKVRc_.js} +100 -99
  230. package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
  231. package/dist/dist-6DU0me3E.js +4 -0
  232. package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
  233. package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
  234. package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
  235. package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
  236. package/dist/{cdn/chunks/dist-C2epoAwW.js → dist-CX7skkvG.js} +29 -31
  237. package/dist/dist-CcOn7WCo.js +4 -0
  238. package/dist/dist-Cdkm20M6.js +2542 -0
  239. package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
  240. package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
  241. package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
  242. package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
  243. package/dist/{dist-DDN7yR-w.js → dist-fqSers8_.js} +131 -131
  244. package/dist/{editor-modal-Du9VI9q4.js → editor-modal-B_2EAOjN.js} +907 -906
  245. package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
  246. package/dist/en-DTtwco2Q.js +1 -0
  247. package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
  248. package/dist/{extensions-FRYhx7qa.js → extensions-DOLZkLzV.js} +173 -173
  249. package/dist/{eye-BKj9Tfnc.js → eye-DChfk0gi.js} +1 -1
  250. package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
  251. package/dist/{image-DNdvdTla.js → image--Hj2by1G.js} +1 -1
  252. package/dist/index.d.ts +182 -14
  253. package/dist/{info-Bx-kBkbH.js → info-BbXgy82f.js} +1 -1
  254. package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
  255. package/dist/keys-BCqskl51.js +9 -0
  256. package/dist/languageName-DEEOhDWI.js +10 -0
  257. package/dist/{link-D8-rYdIQ.js → link-C2_8yJno.js} +1 -1
  258. package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
  259. package/dist/{list-BneisA27.js → list-DLGs2n0V.js} +1 -1
  260. package/dist/{loader-circle-DBEXphyx.js → loader-circle-BbDItE_O.js} +1 -1
  261. package/dist/{message-circle-Bg4xInCM.js → message-circle-NAModq0p.js} +1 -1
  262. package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
  263. package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
  264. package/dist/noticeTones-D7BPu-Le.js +14 -0
  265. package/dist/{package-B40Vkfsp.js → package-BuzsfRyH.js} +1 -1
  266. package/dist/{pencil-CYdAHTds.js → pencil-BTUUECH4.js} +1 -1
  267. package/dist/plural-CyxrJXL1.js +15 -0
  268. package/dist/plus-Dm7DN65T.js +13 -0
  269. package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
  270. package/dist/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -0
  271. package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xMURqGWi.js} +2 -12
  272. package/dist/rotate-ccw-DqVcEIn5.js +13 -0
  273. package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-DlHp8xgy.js} +167 -167
  274. package/dist/sanitizeHtml-mKgNUdME.js +962 -0
  275. package/dist/{search-BZEo08gi.js → search-Cfr3W44N.js} +1 -1
  276. package/dist/{send-DHtrnXQs.js → send-CH1SrvyB.js} +1 -1
  277. package/dist/{smartphone-dlN3vpA3.js → smartphone-pAkvzjdI.js} +1 -1
  278. package/dist/socialIcons-Dqr4DJOz.js +2705 -0
  279. package/dist/{sparkles-NOttoDnJ.js → sparkles-CRO0cCnp.js} +1 -1
  280. package/dist/{square-B1CJgdt2.js → square-CaQWMntx.js} +1 -1
  281. package/dist/style.css +1 -1
  282. package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
  283. package/dist/templatical-editor.js +2294 -1608
  284. package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-BQ39AaRK.js} +1 -1
  285. package/dist/{trash-CGbk4Sgt.js → trash-BL5gEFHN.js} +1 -1
  286. package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-BYbKu7zZ.js} +1 -1
  287. package/dist/{upload-DQoackAn.js → upload-BhmL4Vqx.js} +1 -1
  288. package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-Dh2iydo1.js} +4 -4
  289. package/dist/useEditorRoot-DY3mgcHm.js +7 -0
  290. package/dist/{useI18n-CeTm777E.js → useI18n-CgtvtF4C.js} +4 -4
  291. package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
  292. package/dist/{useLogicTag-DFDYJeMN.js → useLogicTag-BXXXQQmi.js} +4 -4
  293. package/dist/{useMergeTag-B46vACAG.js → useMergeTag-C9Okr87y.js} +5 -5
  294. package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
  295. package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-C0Kapxdh.js} +5 -5
  296. package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1247 -1239
  297. package/dist/withCurrentFont-DJiQqZzL.js +18 -0
  298. package/dist/{x-zcrnmcmU.js → x-B7NZYzhx.js} +1 -1
  299. package/package.json +23 -23
  300. package/dist/AiAltTextPopover-Cm11CsKH.js +0 -105
  301. package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
  302. package/dist/BlockPreviewCanvas-Df9iz7sK.js +0 -140
  303. package/dist/CollaborationNotices-JQ3vQoqO.js +0 -75
  304. package/dist/CommentsPanel-BuftXc0U.js +0 -16
  305. package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
  306. package/dist/CountdownToolbar-CrL4WKy9.js +0 -197
  307. package/dist/MergeTagInput-DE7kWwXx.js +0 -80
  308. package/dist/MergeTagTextarea-DVPQkiYY.js +0 -69
  309. package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
  310. package/dist/TemplateSettings-D0XcH32O.js +0 -236
  311. package/dist/TestEmailModal-Cb5t0yB2.js +0 -209
  312. package/dist/TitleEditor-BYk_9SpQ.js +0 -198
  313. package/dist/ToggleSwitch-poGWbduy.js +0 -36
  314. package/dist/Toolbar-Dku_pZni.js +0 -3145
  315. package/dist/VersionPreviewBanner-CSs7zum_.js +0 -37
  316. package/dist/WrapperBlock-DwjK_IdJ.js +0 -44
  317. package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js +0 -106
  318. package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js.map +0 -1
  319. package/dist/cdn/chunks/AiAltTextReview-BafAtBoA.js.map +0 -1
  320. package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js +0 -474
  321. package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js.map +0 -1
  322. package/dist/cdn/chunks/AiRewriteMenu-4F6vwhJ5.js.map +0 -1
  323. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
  324. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
  325. package/dist/cdn/chunks/BlockPreviewCanvas-Ny1X_mee.js +0 -142
  326. package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js +0 -77
  327. package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js.map +0 -1
  328. package/dist/cdn/chunks/CommentsPanel-CAiwilM2.js +0 -18
  329. package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js +0 -469
  330. package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
  331. package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js +0 -199
  332. package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js.map +0 -1
  333. package/dist/cdn/chunks/IssuesPanel-pr7_nuLI.js.map +0 -1
  334. package/dist/cdn/chunks/LogicTagInsertButton-B_ldj3TO.js.map +0 -1
  335. package/dist/cdn/chunks/MediaEditModal-CGfzcHwP.js.map +0 -1
  336. package/dist/cdn/chunks/MergeTagModeToggle-BFpK5dxg.js.map +0 -1
  337. package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js +0 -71
  338. package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js.map +0 -1
  339. package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js +0 -631
  340. package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
  341. package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
  342. package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js +0 -208
  343. package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js.map +0 -1
  344. package/dist/cdn/chunks/TestEmailModal-DcwKhFnI.js.map +0 -1
  345. package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js +0 -198
  346. package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
  347. package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js +0 -38
  348. package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js.map +0 -1
  349. package/dist/cdn/chunks/Toolbar-CnvfW72e.js +0 -3061
  350. package/dist/cdn/chunks/Toolbar-CnvfW72e.js.map +0 -1
  351. package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js +0 -39
  352. package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js.map +0 -1
  353. package/dist/cdn/chunks/WrapperBlock-D3obNGab.js +0 -46
  354. package/dist/cdn/chunks/WrapperBlock-D3obNGab.js.map +0 -1
  355. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
  356. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
  357. package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
  358. package/dist/cdn/chunks/createCloudRuntime-D6niZ2Rc.js.map +0 -1
  359. package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
  360. package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
  361. package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
  362. package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
  363. package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
  364. package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
  365. package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
  366. package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
  367. package/dist/cdn/chunks/keys-BF9gazbd.js +0 -11
  368. package/dist/cdn/chunks/keys-BF9gazbd.js.map +0 -1
  369. package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
  370. package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
  371. package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js +0 -198
  372. package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js.map +0 -1
  373. package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
  374. package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js +0 -72
  375. package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js.map +0 -1
  376. package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js +0 -2008
  377. package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js.map +0 -1
  378. package/dist/cdn/chunks/src-BKpAis_q.js.map +0 -1
  379. package/dist/cdn/chunks/src-C9DTvn1H.js +0 -1423
  380. package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
  381. package/dist/cdn/chunks/src-CUH_EI7k.js.map +0 -1
  382. package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
  383. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
  384. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
  385. package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
  386. package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js +0 -70
  387. package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js.map +0 -1
  388. package/dist/cdn/chunks/useScrollToBlock-C0dawxGr.js.map +0 -1
  389. package/dist/dist-CzrLYq2s.js +0 -1363
  390. package/dist/dist-DyFArF_G.js +0 -4
  391. package/dist/dist-pA3ooG6N.js +0 -4
  392. package/dist/en-CyEE7FPY.js +0 -1
  393. package/dist/keys-DBjrQkYH.js +0 -9
  394. package/dist/normalizeMergeTagMarkup-IH8COHzd.js +0 -196
  395. package/dist/sanitizeHtml-CnOA1efV.js +0 -942
  396. package/dist/socialIcons-B_d52_eS.js +0 -2075
  397. package/dist/useEditorCore-DG9UvWUm.js +0 -4011
  398. package/dist/useEditorRoot-BKr6nNkC.js +0 -7
  399. package/dist/usePopoverPosition-C42kD7zt.js +0 -68
  400. package/dist/withCurrentFont-v_a4Oso8.js +0 -18
@@ -0,0 +1,3039 @@
1
+ import { A as e, B as t, C as n, E as r, F as i, G as a, H as o, I as s, K as c, L as l, M as u, N as d, O as f, P as p, Q as m, R as h, S as g, W as _, X as v, Y as y, _ as b, b as x, c as S, ct as C, dt as w, f as T, g as E, h as D, j as O, l as k, m as A, mt as j, ot as M, p as N, pt as P, rt as F, s as I, st as L, t as R, tt as z, u as B, x as V } from "./draggable-DepKdldn.js";
2
+ import { $ as H, $t as U, B as W, Dt as G, E as ee, F as K, G as q, H as te, Ht as ne, I as re, J as ie, Jt as J, K as Y, L as X, O as ae, P as oe, Q as se, R as ce, T as Z, U as le, V as ue, Y as de, Z as fe, _n as pe, a as me, at as he, b as ge, c as _e, d as ve, dn as ye, dt as be, f as xe, g as Se, gn as Ce, h as we, hn as Te, i as Ee, in as De, it as Oe, l as ke, lt as Ae, m as je, mn as Me, mt as Ne, n as Pe, nn as Fe, o as Ie, on as Le, p as Re, q as ze, qt as Be, r as Ve, rn as He, st as Ue, t as We, tt as Ge, u as Ke, un as qe, ut as Je, vn as Ye, y as Xe, yn as Ze, z as Qe } from "./src-CACM3o--.js";
3
+ import { B as $e, C as et, F as tt, I as nt, P as rt, R as it, T as at, _ as ot, a as st, f as ct, h as lt, n as ut, o as dt, t as ft, u as pt, v as mt, w as ht, x as gt, y as _t, z as vt } from "./socialIcons-BAiuHyJs.js";
4
+ import { t as yt } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
5
+ import { At as bt, G as xt, Mt as St, Nt as Ct, Ot as wt, St as Tt, Ut as Et, V as Dt, Wt as Ot, X as kt, _t as At, d as jt, f as Mt, k as Nt, mt as Pt, nt as Ft, o as It, y as Lt, yt as Rt } from "./icons-CSSMtbGK.js";
6
+ import { $ as zt, A as Bt, B as Vt, C as Ht, D as Ut, F as Wt, G as Gt, H as Kt, I as qt, J as Jt, K as Yt, L as Xt, M as Zt, N as Qt, O as $t, P as en, Q as tn, R as nn, S as rn, T as an, U as on, V as sn, W as cn, X as ln, _ as un, a as dn, at as fn, b as pn, c as mn, d as hn, et as gn, g as _n, h as vn, i as yn, it as bn, j as xn, k as Sn, l as Cn, m as wn, nt as Tn, ot as En, p as Dn, q as On, r as kn, rt as An, s as jn, tt as Mn, u as Nn, v as Pn, w as Fn, x as In, y as Ln, z as Rn } from "./keys-CoQtCqNv.js";
7
+ import { t as Q } from "./useI18n-BnJYydPv.js";
8
+ import { n as zn } from "./useLocalizedDisplay-yXbRKNrs.js";
9
+ import { t as Bn } from "./plural-CyxrJXL1.js";
10
+ import { t as Vn } from "./languageName-DEEOhDWI.js";
11
+ import { m as Hn, w as Un, x as Wn } from "./styleConstants-CgiNKdnc.js";
12
+ import { _ as Gn, h as Kn, v as qn, y as Jn } from "./dist-BzXULHvI.js";
13
+ import { a as Yn, c as Xn, i as Zn, l as Qn } from "./dist-DqGgijFI.js";
14
+ import { t as $n } from "./useEditorRoot-D_LuZ_hE.js";
15
+ import "./useCloudI18n-Cc5NZqiI.js";
16
+ import { t as er } from "./useMergeTag-C-32ETjj.js";
17
+ import { t as $ } from "./logger-CqQTfJGx.js";
18
+ import { a as tr, c as nr, i as rr, n as ir, o as ar, t as or } from "./usePopoverPosition-BWAXWeBv.js";
19
+ import { t as sr } from "./useLogicTag-B7RpqVFQ.js";
20
+ import { r as cr, t as lr } from "./templateSettingsFields-cjlP-jdw.js";
21
+ import { n as ur, t as dr } from "./sanitizeHtml-DYklmvgX.js";
22
+ import { t as fr } from "./LoadingTrack-DUYcDHOV.js";
23
+ import { t as pr } from "./readableTextColor-BfZUGnVj.js";
24
+ // src/composables/useFocusTrap.ts
25
+ var mr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
26
+ function hr(e, t) {
27
+ let n = $n(), r = null, i = null, a = null;
28
+ function s() {
29
+ return e.value ? Array.from(e.value.querySelectorAll(mr)).filter((e) => e.offsetParent !== null) : [];
30
+ }
31
+ function c(e) {
32
+ if (e.key !== "Tab") return;
33
+ let t = s();
34
+ if (t.length === 0) return;
35
+ let r = t[0], i = t[t.length - 1];
36
+ e.shiftKey ? n.activeElement === r && (e.preventDefault(), i.focus()) : n.activeElement === i && (e.preventDefault(), r.focus());
37
+ }
38
+ function l() {
39
+ let t = i !== null || a !== null;
40
+ t && u({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
41
+ a = null;
42
+ let t = s();
43
+ t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
44
+ }), i = Yn(e, "keydown", c);
45
+ }
46
+ function u(e = {}) {
47
+ let t = e.restoreFocus !== !1;
48
+ a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
49
+ }
50
+ let d = o([t, e], ([e, t]) => {
51
+ e && t ? l() : u();
52
+ }, { flush: "post" });
53
+ m(() => {
54
+ d(), u();
55
+ });
56
+ }
57
+ // src/composables/useEmoji.ts
58
+ function gr() {
59
+ let [e, t] = qn(!1), n = F([]), r = !1;
60
+ m(() => {
61
+ r = !0;
62
+ }), o(e, async (e) => {
63
+ if (e && n.value.length === 0) {
64
+ let { emojiCategories: e } = await import("./emojiData-CBNuCfum.js");
65
+ if (r) return;
66
+ n.value = e;
67
+ }
68
+ });
69
+ function i() {
70
+ t();
71
+ }
72
+ function a() {
73
+ e.value = !1;
74
+ }
75
+ return {
76
+ categories: n,
77
+ isOpen: e,
78
+ toggle: i,
79
+ close: a
80
+ };
81
+ }
82
+ // src/composables/useBlockRegistry.ts
83
+ function _r() {
84
+ let e = F(/* @__PURE__ */ new Map());
85
+ function t(t, n) {
86
+ e.value.set(t, n), L(e);
87
+ }
88
+ function n(t, n) {
89
+ let r = `custom:${t.type}`;
90
+ e.value.set(r, {
91
+ component: n,
92
+ createBlock: () => X(t),
93
+ definition: t
94
+ }), L(e);
95
+ }
96
+ function r(t) {
97
+ if (t.type === "custom") {
98
+ let n = `custom:${t.customType}`;
99
+ return e.value.get(n)?.component;
100
+ }
101
+ return e.value.get(t.type)?.component;
102
+ }
103
+ function i(t) {
104
+ return e.value.get(t)?.createBlock();
105
+ }
106
+ function a(t) {
107
+ let n = `custom:${t}`;
108
+ return e.value.get(n)?.definition;
109
+ }
110
+ function o(e) {
111
+ return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
112
+ }
113
+ async function s(e) {
114
+ let t = a(e.customType);
115
+ if (!t) return o("Block definition not found");
116
+ try {
117
+ return await se(await import("./liquid.browser-rubac0VA.js")).parseAndRender(t.template, e.fieldValues);
118
+ } catch (t) {
119
+ return $.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
120
+ }
121
+ }
122
+ function c(t) {
123
+ return e.value.has(t);
124
+ }
125
+ return {
126
+ registerBuiltIn: t,
127
+ registerCustom: n,
128
+ getComponent: r,
129
+ createBlock: i,
130
+ getDefinition: a,
131
+ renderCustomBlock: s,
132
+ isRegistered: c
133
+ };
134
+ }
135
+ // src/composables/useFonts.ts
136
+ var vr = [
137
+ {
138
+ value: "Arial",
139
+ label: "Arial"
140
+ },
141
+ {
142
+ value: "Helvetica",
143
+ label: "Helvetica"
144
+ },
145
+ {
146
+ value: "Georgia",
147
+ label: "Georgia"
148
+ },
149
+ {
150
+ value: "Times New Roman",
151
+ label: "Times New Roman"
152
+ },
153
+ {
154
+ value: "Verdana",
155
+ label: "Verdana"
156
+ },
157
+ {
158
+ value: "Trebuchet MS",
159
+ label: "Trebuchet MS"
160
+ },
161
+ {
162
+ value: "Courier New",
163
+ label: "Courier New"
164
+ }
165
+ ], yr = "Arial, sans-serif";
166
+ function br(e) {
167
+ if (e === void 0 || e === !0) return [...vr];
168
+ if (e === !1) return [];
169
+ let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
170
+ for (let i of e) {
171
+ let e = i.toLowerCase(), a = vr.find((t) => t.value.toLowerCase() === e);
172
+ a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e), $.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${vr.map((e) => e.value).join(", ")}.`));
173
+ }
174
+ return t;
175
+ }
176
+ function xr(e) {
177
+ let t = z(e?.customFonts ?? []), n = z(!1), r = br(e?.builtIns), i = N(() => e?.defaultFallback ?? yr), a = N(() => {
178
+ let e = [...r], n = t.value.map((e) => ({
179
+ value: e.name,
180
+ label: e.name,
181
+ isCustom: !0
182
+ })), i = [...e, ...n];
183
+ return i.sort((e, t) => e.label.localeCompare(t.label)), i;
184
+ });
185
+ function o(e) {
186
+ return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
187
+ }
188
+ let s = e?.defaultFont ?? yr.split(",")[0].trim();
189
+ o(s) || $.warn(`config.fonts: new templates seed "${s}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
190
+ function c() {
191
+ if (e?.defaultFont && o(e.defaultFont)) {
192
+ let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
193
+ if (t) return t.value;
194
+ }
195
+ return yr;
196
+ }
197
+ let l = N(() => c());
198
+ function u(e) {
199
+ return Xe(e, {
200
+ customFonts: t.value,
201
+ defaultFallback: i.value
202
+ });
203
+ }
204
+ let d = [], f = !1;
205
+ async function p() {
206
+ if (t.value.length === 0) {
207
+ f || (n.value = !0);
208
+ return;
209
+ }
210
+ let e = t.value.map(async (e) => {
211
+ try {
212
+ if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
213
+ let t = document.createElement("link");
214
+ t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), d.push(t), await new Promise((n, r) => {
215
+ t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
216
+ });
217
+ } catch (t) {
218
+ $.warn(`Failed to load custom font "${e.name}":`, t);
219
+ }
220
+ });
221
+ await Promise.allSettled(e), !f && (n.value = !0);
222
+ }
223
+ function h() {
224
+ for (let e of d) e.remove();
225
+ d.length = 0;
226
+ }
227
+ return y() && m(() => {
228
+ f = !0, h();
229
+ }), {
230
+ fonts: a,
231
+ defaultFont: l,
232
+ defaultFallback: i,
233
+ customFonts: t,
234
+ isLoaded: n,
235
+ loadCustomFonts: p,
236
+ cleanupFontLinks: h,
237
+ resolveFontFamily: u,
238
+ getDefaultFont: c
239
+ };
240
+ }
241
+ // src/composables/useThemeStyles.ts
242
+ var Sr = {
243
+ bg: "--tpl-bg",
244
+ bgElevated: "--tpl-bg-elevated",
245
+ bgHover: "--tpl-bg-hover",
246
+ bgActive: "--tpl-bg-active",
247
+ border: "--tpl-border",
248
+ borderLight: "--tpl-border-light",
249
+ text: "--tpl-text",
250
+ textMuted: "--tpl-text-muted",
251
+ textDim: "--tpl-text-dim",
252
+ primary: "--tpl-primary",
253
+ primaryHover: "--tpl-primary-hover",
254
+ primaryLight: "--tpl-primary-light",
255
+ secondary: "--tpl-secondary",
256
+ secondaryHover: "--tpl-secondary-hover",
257
+ secondaryLight: "--tpl-secondary-light",
258
+ success: "--tpl-success",
259
+ successLight: "--tpl-success-light",
260
+ warning: "--tpl-warning",
261
+ warningLight: "--tpl-warning-light",
262
+ danger: "--tpl-danger",
263
+ dangerLight: "--tpl-danger-light",
264
+ canvasBg: "--tpl-canvas-bg"
265
+ };
266
+ function Cr({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
267
+ return { themeStyles: N(() => {
268
+ let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
269
+ if (a) for (let [e, t] of Object.entries(Sr)) {
270
+ let n = a[e];
271
+ n && (r[t] = n);
272
+ }
273
+ return n && Object.assign(r, n()), r;
274
+ }) };
275
+ }
276
+ // src/utils/mergeTagNodeSpec.ts
277
+ function wr(e, t, n) {
278
+ return Ke(e, n) ? {
279
+ type: "logicMergeTagNode",
280
+ attrs: {
281
+ value: e,
282
+ keyword: Ee(e, n)
283
+ }
284
+ } : {
285
+ type: "mergeTagNode",
286
+ attrs: {
287
+ label: t,
288
+ value: e
289
+ }
290
+ };
291
+ }
292
+ // src/utils/insertLogicTag.ts
293
+ function Tr(e) {
294
+ return "before" in e && "after" in e;
295
+ }
296
+ function Er(e, t, n) {
297
+ if (!Tr(t)) {
298
+ e.chain().focus().insertContent(wr(t.value, t.label, n)).run();
299
+ return;
300
+ }
301
+ let r = wr(t.before, t.label, n), i = wr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
302
+ a === o ? e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run() : e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
303
+ }
304
+ // src/utils/linkColorExtension.ts
305
+ function Dr(e) {
306
+ if (!e) return null;
307
+ let t = e.trim();
308
+ return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
309
+ }
310
+ function Or(e) {
311
+ return e.extend({ addAttributes() {
312
+ return {
313
+ ...this.parent?.(),
314
+ color: {
315
+ default: null,
316
+ parseHTML: (e) => Dr(ar(e.style.color)),
317
+ renderHTML: (e) => {
318
+ let t = Dr(e.color);
319
+ return t ? { style: `color: ${t}` } : {};
320
+ }
321
+ }
322
+ };
323
+ } });
324
+ }
325
+ // src/composables/useRichTextLinkDialog.ts
326
+ function kr(e, t = Pe.liquid, n = () => !0) {
327
+ let r = z(!1), i = z(""), a = z(""), o = z(null);
328
+ hr(o, r);
329
+ function s() {
330
+ if (!n()) return;
331
+ let t = e.value?.getAttributes("link") ?? {};
332
+ i.value = t.href || "", a.value = t.color || "", r.value = !0;
333
+ }
334
+ function c() {
335
+ if (n()) {
336
+ if (i.value) {
337
+ let t = d(i.value);
338
+ if (t !== null) {
339
+ let n = Dr(a.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
340
+ n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
341
+ }
342
+ }
343
+ p();
344
+ }
345
+ }
346
+ let l = /^(?:\/|\.{1,2}\/|\?)/;
347
+ function u(e) {
348
+ return RegExp(`^(?:${t.value.source})`).test(e);
349
+ }
350
+ function d(e) {
351
+ let t = e.trim();
352
+ if (!t) return null;
353
+ if (t.startsWith("#")) return t;
354
+ if (t.startsWith("//")) return `https:${t}`;
355
+ if (l.test(t)) return t;
356
+ let n = ee(t);
357
+ return n ? Z.some((e) => e === n) ? t : null : u(t) ? t : `https://${t}`;
358
+ }
359
+ function f() {
360
+ n() && (e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p());
361
+ }
362
+ function p() {
363
+ r.value = !1, i.value = "", a.value = "";
364
+ }
365
+ function m(e) {
366
+ e.key === "Enter" ? (e.preventDefault(), c()) : e.key === "Escape" && p();
367
+ }
368
+ return {
369
+ showLinkDialog: r,
370
+ linkUrl: i,
371
+ linkColor: a,
372
+ linkDialogRef: o,
373
+ openLinkDialog: s,
374
+ insertLink: c,
375
+ removeLink: f,
376
+ closeLinkDialog: p,
377
+ handleLinkKeydown: m
378
+ };
379
+ }
380
+ // src/composables/useRichTextEditor.ts
381
+ function Ar(e) {
382
+ let t = f(Pn, null), n = nr(), { mergeTags: r, canRequestMergeTag: i, isRequesting: a, requestMergeTag: s, syntax: c, autocomplete: l } = er(), { canInsertLogicTag: d, isRequesting: p, requestLogicTag: m } = sr(), h = f(Mn, null), g = (v(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = _e(c), y = F(null), b = t?.content ? zn(t) : null, x = () => Ue(b?.settings.value ?? { locale: "en" });
383
+ o(x, (e) => {
384
+ let t = y.value?.view.dom;
385
+ t && t.setAttribute("dir", e);
386
+ });
387
+ let { showLinkDialog: S, linkUrl: C, linkColor: w, linkDialogRef: T, openLinkDialog: E, insertLink: D, removeLink: O, closeLinkDialog: k, handleLinkKeydown: A } = kr(y, c, () => n.value);
388
+ o(n, (e) => {
389
+ if (y.value?.setEditable(e, !1), !e) {
390
+ k();
391
+ let e = y.value;
392
+ e && e.view.dispatch(e.state.tr);
393
+ }
394
+ });
395
+ let { start: j, stop: M } = Gn(() => y.value?.commands.focus("end"), 0, { immediate: !1 }), N = F(null), P = z(!0), I = z(null), L = !1, R = null;
396
+ async function B() {
397
+ I.value = null, P.value = !0;
398
+ try {
399
+ let { TiptapEditor: i, EC: a, extensions: o } = await e.loadExtensions({
400
+ mergeTags: r,
401
+ syntax: c,
402
+ triggerChar: _,
403
+ autocompleteEnabled: l,
404
+ suggestionEmptyText: g
405
+ });
406
+ if (L) return;
407
+ N.value = a;
408
+ let s = /* @__PURE__ */ new Map();
409
+ o.forEach((e, t) => s.set(e.name, t));
410
+ let u = new i({
411
+ extensions: o.filter((e, t) => s.get(e.name) === t),
412
+ content: e.blockContent(),
413
+ editable: n.value,
414
+ editorProps: { attributes: { dir: x() } },
415
+ onUpdate: ({ editor: r }) => {
416
+ !L && n.value && t && (R = r.getHTML(), t.updateBlock(e.blockId(), { content: R }));
417
+ }
418
+ });
419
+ if (L) {
420
+ u.destroy();
421
+ return;
422
+ }
423
+ y.value = u, P.value = !1, j();
424
+ } catch (t) {
425
+ if (L) return;
426
+ $.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), I.value = t instanceof Error ? t.message : "Failed to load editor", P.value = !1;
427
+ }
428
+ }
429
+ function V() {
430
+ y.value?.destroy(), y.value = null, B();
431
+ }
432
+ B();
433
+ let H = o(() => e.blockContent(), (e) => {
434
+ y.value && e !== R && (R = e, y.value.getHTML() !== e && y.value.commands.setContent(e, { emitUpdate: !1 }));
435
+ });
436
+ function U(t) {
437
+ if (a.value || p.value) return;
438
+ let n = t.composedPath(), r = n.find((e) => e instanceof HTMLElement);
439
+ if (!r) return;
440
+ e.onClickOutsideSideEffect?.(r);
441
+ let i = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
442
+ r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || i || e.onDone();
443
+ }
444
+ Yn(document, "mousedown", U), u(() => {
445
+ L = !0, H(), M(), y.value?.destroy();
446
+ });
447
+ async function W() {
448
+ if (!n.value) return;
449
+ let e = await s();
450
+ !L && n.value && (e && y.value ? y.value.chain().focus().insertMergeTag({
451
+ label: e.label,
452
+ value: e.value
453
+ }).run() : y.value?.commands.focus());
454
+ }
455
+ async function G() {
456
+ if (!n.value) return;
457
+ let e = await m();
458
+ !L && n.value && (e && y.value ? Er(y.value, e, c) : y.value?.commands.focus());
459
+ }
460
+ return {
461
+ editor: y,
462
+ EditorContent: N,
463
+ isLoading: P,
464
+ isEditable: n,
465
+ initError: I,
466
+ retry: V,
467
+ showLinkDialog: S,
468
+ linkUrl: C,
469
+ linkColor: w,
470
+ linkDialogRef: T,
471
+ mergeTags: r,
472
+ canRequestMergeTag: i,
473
+ isRequestingMergeTag: a,
474
+ syntax: c,
475
+ canInsertLogicTag: d,
476
+ isRequestingLogicTag: p,
477
+ openLinkDialog: E,
478
+ insertLink: D,
479
+ removeLink: O,
480
+ closeLinkDialog: k,
481
+ handleLinkKeydown: A,
482
+ handleAddMergeTag: W,
483
+ handleAddLogicTag: G
484
+ };
485
+ }
486
+ // src/utils/activeEditorTracker.ts
487
+ var jr = /* @__PURE__ */ new Set(), Mr = 0, Nr = 0;
488
+ function Pr() {
489
+ let e = ++Nr;
490
+ return jr.add(e), Mr === 0 && (Mr = e), {
491
+ id: e,
492
+ isActive: () => jr.size <= 1 || Mr === e,
493
+ claim: () => {
494
+ Mr = e;
495
+ },
496
+ dispose: () => {
497
+ if (jr.delete(e), Mr === e) {
498
+ let e = Array.from(jr);
499
+ Mr = e[e.length - 1] ?? 0;
500
+ }
501
+ }
502
+ };
503
+ }
504
+ // src/utils/resolveLintOptions.ts
505
+ function Fr(e) {
506
+ let t = e.contentLocale ?? e.content?.settings.locale;
507
+ return {
508
+ ...e.lint,
509
+ locale: e.locale,
510
+ ...t === void 0 ? {} : { contentLocale: t }
511
+ };
512
+ }
513
+ // src/composables/usePreviewResolution.ts
514
+ var Ir = 500;
515
+ function Lr(e) {
516
+ let t = typeof e.resolvePreview == "function", n = z(null), r = z(!1), i = z(!1), a = 0, s = null;
517
+ function c() {
518
+ s !== null && (clearTimeout(s), s = null);
519
+ }
520
+ async function l() {
521
+ let t = e.resolvePreview;
522
+ if (!t) return;
523
+ let o = ++a;
524
+ r.value = !0;
525
+ let s = {
526
+ content: U(e.getContent()),
527
+ ...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
528
+ };
529
+ try {
530
+ let e = await t(s);
531
+ if (o !== a) return;
532
+ if (!We(e)) {
533
+ i.value = !0;
534
+ return;
535
+ }
536
+ n.value = e, i.value = !1;
537
+ } catch {
538
+ if (o !== a) return;
539
+ i.value = !0;
540
+ } finally {
541
+ o === a && (r.value = !1);
542
+ }
543
+ }
544
+ function u() {
545
+ t && (c(), n.value === null ? l() : s = setTimeout(() => {
546
+ s = null, l();
547
+ }, Ir));
548
+ }
549
+ return o(() => [
550
+ e.isActive(),
551
+ e.getRecipient?.(),
552
+ e.getLocale?.()
553
+ ], ([e, , t], o) => {
554
+ o && t !== o[2] && (c(), a++, n.value = null, r.value = !1, i.value = !1), e ? u() : (c(), a++, r.value = !1, n.value = null, i.value = !1);
555
+ }, {
556
+ immediate: !0,
557
+ flush: "sync"
558
+ }), m(() => {
559
+ c(), a++;
560
+ }), {
561
+ isConfigured: t,
562
+ content: N(() => n.value ?? e.getContent()),
563
+ isResolving: r,
564
+ isInitialResolve: N(() => r.value && n.value === null),
565
+ hasFailed: i,
566
+ supersedesSamples: N(() => t)
567
+ };
568
+ }
569
+ // src/composables/useMergeTagPicker.ts
570
+ function Rr() {
571
+ let e = z(!1), t = z([]), n = z(null), r = null;
572
+ function i(i, a) {
573
+ if (r) {
574
+ let e = r;
575
+ r = null, e(null);
576
+ }
577
+ return t.value = i, n.value = a?.current ?? null, e.value = !0, new Promise((e) => {
578
+ r = e;
579
+ });
580
+ }
581
+ function a(i) {
582
+ let a = r;
583
+ r = null, e.value = !1, t.value = [], n.value = null, a && a(i);
584
+ }
585
+ return y() && m(() => {
586
+ if (r) {
587
+ let e = r;
588
+ r = null, e(null);
589
+ }
590
+ e.value = !1, t.value = [], n.value = null;
591
+ }), {
592
+ isOpen: e,
593
+ tags: t,
594
+ current: n,
595
+ open: i,
596
+ resolve: a
597
+ };
598
+ }
599
+ // src/composables/useLogicTagPicker.ts
600
+ function zr() {
601
+ let e = z(!1), t = z([]), n = z([]), r = null;
602
+ function i(i, a) {
603
+ if (r) {
604
+ let e = r;
605
+ r = null, e(null);
606
+ }
607
+ return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
608
+ r = e;
609
+ });
610
+ }
611
+ function a(i) {
612
+ let a = r;
613
+ r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
614
+ }
615
+ return y() && m(() => {
616
+ if (r) {
617
+ let e = r;
618
+ r = null, e(null);
619
+ }
620
+ e.value = !1, t.value = [], n.value = [];
621
+ }), {
622
+ isOpen: e,
623
+ tags: t,
624
+ pairs: n,
625
+ open: i,
626
+ resolve: a
627
+ };
628
+ }
629
+ // src/composables/useTemplateLint.ts
630
+ function Br(e) {
631
+ return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 && e.deliverability === !1 && e.compatibility === !1 && e.localization === !1 : !1;
632
+ }
633
+ var Vr = !1;
634
+ function Hr(e) {
635
+ let t = z([]), n = z(0), r = z(-1), i = o(e.content, () => {
636
+ n.value++;
637
+ }, { deep: !0 }), a = z(!1), s = z(!1), c = F(null), l = Br(e.options), u = null, d = !1;
638
+ l || f();
639
+ async function f() {
640
+ try {
641
+ let t = await import("./src-DheBmnvF.js");
642
+ if (d) return;
643
+ c.value = { lintTemplate: t.lintTemplate }, a.value = !0, p(), u = Jn(n, p, { debounce: e.debounce ?? 500 });
644
+ } catch {
645
+ if (d) return;
646
+ s.value = !0, Vr || (Vr = !0, $.info("@templatical/quality isn't installed, so the Issues panel and its lint badges are off. Add @templatical/quality to your dependencies to turn them on."));
647
+ }
648
+ }
649
+ function p() {
650
+ if (!c.value) return;
651
+ let i = c.value.lintTemplate(e.content.value, {
652
+ ...e.options,
653
+ ...e.customBlocks === void 0 ? {} : { customBlocks: e.customBlocks },
654
+ ...e.mergeTagSyntax === void 0 ? {} : { mergeTagSyntax: e.mergeTagSyntax }
655
+ });
656
+ r.value = n.value, t.value = i;
657
+ }
658
+ let m = o(() => e.options, () => {
659
+ c.value && p();
660
+ }, { deep: !0 });
661
+ function h(t) {
662
+ t.fix && t.fix.apply({
663
+ updateBlock: e.updateBlock,
664
+ updateSettings: e.updateSettings,
665
+ removeBlock: (t) => {
666
+ let n = e.content.value.settings.locale ?? "en";
667
+ (e.options.contentLocale ?? n) === n && e.removeBlock(t);
668
+ }
669
+ });
670
+ }
671
+ function g() {
672
+ d = !0, u?.(), i(), m();
673
+ }
674
+ return {
675
+ issues: t,
676
+ contentVersion: n,
677
+ lintVersion: r,
678
+ ready: a,
679
+ unavailable: s,
680
+ applyFix: h,
681
+ destroy: g
682
+ };
683
+ }
684
+ // src/composables/useKeyboardReorder.ts
685
+ function Ur(e, t, n = []) {
686
+ let r = z(null), i = z(""), a = null;
687
+ function o(t) {
688
+ let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
689
+ if (r !== -1) return {
690
+ index: r,
691
+ total: n.length
692
+ };
693
+ for (let e of n) {
694
+ if (e.type !== "section") continue;
695
+ let n = e;
696
+ for (let e = 0; e < n.children.length; e++) {
697
+ let r = n.children[e], i = r.findIndex((e) => e.id === t);
698
+ if (i !== -1) return {
699
+ index: i,
700
+ total: r.length,
701
+ sectionId: n.id,
702
+ columnIndex: e
703
+ };
704
+ }
705
+ }
706
+ return null;
707
+ }
708
+ function s(r) {
709
+ let i = o(r);
710
+ if (!i) return "";
711
+ let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
712
+ return a ? _t(a, t.t, n) : "";
713
+ }
714
+ function c(t, n) {
715
+ return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
716
+ }
717
+ function l(e) {
718
+ i.value = "", queueMicrotask(() => {
719
+ i.value = e;
720
+ });
721
+ }
722
+ function u(e) {
723
+ return r.value === e;
724
+ }
725
+ function d(e) {
726
+ let n = o(e);
727
+ n && (r.value = e, a = n, l(t.format(t.t.blockActions.lifted, {
728
+ block: s(e),
729
+ position: String(n.index + 1),
730
+ total: String(n.total)
731
+ })));
732
+ }
733
+ function f(n, r) {
734
+ let i = o(n);
735
+ if (!i) return;
736
+ let a = i.index + r;
737
+ a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), l(t.format(t.t.blockActions.moved, {
738
+ block: s(n),
739
+ position: String(a + 1),
740
+ total: String(i.total)
741
+ })));
742
+ }
743
+ function p(e) {
744
+ f(e, -1);
745
+ }
746
+ function m(e) {
747
+ f(e, 1);
748
+ }
749
+ function h(e) {
750
+ let n = o(e);
751
+ n && l(t.format(t.t.blockActions.dropped, {
752
+ block: s(e),
753
+ position: String(n.index + 1),
754
+ total: String(n.total)
755
+ })), r.value = null, a = null;
756
+ }
757
+ function g() {
758
+ let n = r.value;
759
+ if (n && a) {
760
+ let r = o(n);
761
+ r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), l(t.format(t.t.blockActions.cancelled, {
762
+ block: s(n),
763
+ position: String(a.index + 1)
764
+ }));
765
+ }
766
+ r.value = null, a = null;
767
+ }
768
+ return {
769
+ liftedBlockId: r,
770
+ announcement: i,
771
+ isLifted: u,
772
+ lift: d,
773
+ cancel: g,
774
+ moveUp: p,
775
+ moveDown: m,
776
+ drop: h
777
+ };
778
+ }
779
+ // src/composables/useUiTheme.ts
780
+ function Wr(e) {
781
+ let t = Xn("(prefers-color-scheme: dark)");
782
+ return { resolvedTheme: N(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
783
+ }
784
+ // src/composables/useCustomBlockStylesheets.ts
785
+ function Gr(e, t) {
786
+ return N(() => {
787
+ let n = Kr(e.value.blocks);
788
+ if (n.size === 0) return [];
789
+ let r = /* @__PURE__ */ new Set(), i = [];
790
+ for (let e of n) {
791
+ let n = t.getDefinition(e)?.stylesheet;
792
+ if (!n) continue;
793
+ let a = n.trim();
794
+ a === "" || r.has(a) || (r.add(a), i.push(a));
795
+ }
796
+ return i;
797
+ });
798
+ }
799
+ function Kr(e) {
800
+ let t = /* @__PURE__ */ new Set();
801
+ return qr(e, t), t;
802
+ }
803
+ function qr(e, t) {
804
+ for (let n of e) if (Ne(n)) t.add(n.customType);
805
+ else if (n.type === "section") {
806
+ let e = n.children;
807
+ if (!e) continue;
808
+ for (let n of e) qr(n, t);
809
+ } else G(n) && qr(n.children, t);
810
+ }
811
+ // src/utils/registerBuiltInBlocks.ts
812
+ var Jr = [
813
+ {
814
+ type: "section",
815
+ createBlock: le
816
+ },
817
+ {
818
+ type: "title",
819
+ createBlock: ie
820
+ },
821
+ {
822
+ type: "paragraph",
823
+ createBlock: te
824
+ },
825
+ {
826
+ type: "image",
827
+ createBlock: W
828
+ },
829
+ {
830
+ type: "button",
831
+ createBlock: K
832
+ },
833
+ {
834
+ type: "divider",
835
+ createBlock: ce
836
+ },
837
+ {
838
+ type: "video",
839
+ createBlock: de
840
+ },
841
+ {
842
+ type: "social",
843
+ createBlock: q
844
+ },
845
+ {
846
+ type: "menu",
847
+ createBlock: ue
848
+ },
849
+ {
850
+ type: "table",
851
+ createBlock: ze
852
+ },
853
+ {
854
+ type: "spacer",
855
+ createBlock: Y
856
+ },
857
+ {
858
+ type: "html",
859
+ createBlock: Qe
860
+ },
861
+ {
862
+ type: "countdown",
863
+ createBlock: re
864
+ }
865
+ ];
866
+ function Yr(e, t) {
867
+ for (let n of Jr) {
868
+ let r = t[n.type];
869
+ r && e.registerBuiltIn(n.type, {
870
+ component: r,
871
+ createBlock: n.createBlock
872
+ });
873
+ }
874
+ }
875
+ // src/utils/resolveHtmlBlockPreview.ts
876
+ function Xr(e) {
877
+ return typeof e == "boolean" ? e : e?.enabled ?? !1;
878
+ }
879
+ // src/utils/collectOffPaletteDefaults.ts
880
+ function Zr(e) {
881
+ return typeof e == "object" && !!e && !Array.isArray(e);
882
+ }
883
+ function Qr(e, t, n) {
884
+ let r = new Set(e.map((e) => tr(e))), i = [], a = (e, t) => {
885
+ for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(tr(o)) && i.push(`${t}.${n}: ${o}`) : Zr(o) && a(o, `${t}.${n}`);
886
+ }, o = t;
887
+ for (let [e, t] of Object.entries(Ae)) {
888
+ let n = o?.[e];
889
+ a({
890
+ ...t,
891
+ ...Zr(n) ? n : {}
892
+ }, e);
893
+ }
894
+ return a({
895
+ ...Je,
896
+ ...n ?? {}
897
+ }, "template"), i;
898
+ }
899
+ // src/utils/localizedBlockDefaults.ts
900
+ function $r(e) {
901
+ return {
902
+ title: { content: `<p>${e.blockDefaults.title}</p>` },
903
+ paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
904
+ button: { text: e.blockDefaults.button }
905
+ };
906
+ }
907
+ // src/i18n/index.ts
908
+ var ei = /* #__PURE__ */ Object.assign({
909
+ "./locales/ca.ts": () => import("./ca-DOuIxWRv.js"),
910
+ "./locales/de.ts": () => import("./de-DaOUfYBX.js"),
911
+ "./locales/en.ts": () => import("./en-C0pHHMiR.js"),
912
+ "./locales/es.ts": () => import("./es-CxyEKr6n.js"),
913
+ "./locales/fr.ts": () => import("./fr-CYbamiI6.js"),
914
+ "./locales/ja.ts": () => import("./ja-DfaIAoGI.js"),
915
+ "./locales/nl.ts": () => import("./nl-DkrB-VKZ.js"),
916
+ "./locales/pt-BR.ts": () => import("./pt-BR-CY5Ye7eP.js")
917
+ }), ti = /* #__PURE__ */ Object.assign({
918
+ "./locales/cloud/de.ts": () => import("./de-6M4JoHoD.js"),
919
+ "./locales/cloud/en.ts": () => import("./en-FzUuJ8HW.js"),
920
+ "./locales/cloud/pt-BR.ts": () => import("./pt-BR-Bp92Fc6J.js")
921
+ });
922
+ function ni(e) {
923
+ return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
924
+ }
925
+ var ri = ni(ei), ii = ni(ti);
926
+ function ai(e) {
927
+ return e.trim().replace(/_/g, "-").toLowerCase();
928
+ }
929
+ function oi(e, t) {
930
+ let n = ai(e);
931
+ return t.find((e) => ai(e) === n);
932
+ }
933
+ function si(e) {
934
+ return ai(e).split("-")[0];
935
+ }
936
+ function ci(e, t) {
937
+ return oi(e, t) ?? oi(si(e), t);
938
+ }
939
+ function li(e, t) {
940
+ return ci(e, t) ?? "en";
941
+ }
942
+ async function ui(e) {
943
+ let t = ei[`./locales/${li(e, ri)}.ts`];
944
+ return (await t()).default;
945
+ }
946
+ async function di(e) {
947
+ let t = ti[`./locales/cloud/${li(e, ii)}.ts`];
948
+ return (await t()).default;
949
+ }
950
+ function fi(e) {
951
+ return ci(e, ri) !== void 0;
952
+ }
953
+ function pi(e) {
954
+ return ci(e, ii) !== void 0;
955
+ }
956
+ function mi() {
957
+ return [...ri];
958
+ }
959
+ function hi() {
960
+ return [...ii];
961
+ }
962
+ // src/i18n/contentDefaults.ts
963
+ var gi = {
964
+ en: {
965
+ video: "Video",
966
+ days: "Days",
967
+ hours: "Hours",
968
+ minutes: "Minutes",
969
+ seconds: "Seconds",
970
+ expired: "This offer has expired"
971
+ },
972
+ de: {
973
+ video: "Video",
974
+ days: "Tage",
975
+ hours: "Stunden",
976
+ minutes: "Minuten",
977
+ seconds: "Sekunden",
978
+ expired: "Dieses Angebot ist abgelaufen"
979
+ },
980
+ es: {
981
+ video: "Vídeo",
982
+ days: "Días",
983
+ hours: "Horas",
984
+ minutes: "Minutos",
985
+ seconds: "Segundos",
986
+ expired: "Esta oferta ha expirado"
987
+ },
988
+ fr: {
989
+ video: "Vidéo",
990
+ days: "Jours",
991
+ hours: "Heures",
992
+ minutes: "Minutes",
993
+ seconds: "Secondes",
994
+ expired: "Cette offre a expiré"
995
+ },
996
+ nl: {
997
+ video: "Video",
998
+ days: "Dagen",
999
+ hours: "Uren",
1000
+ minutes: "Minuten",
1001
+ seconds: "Seconden",
1002
+ expired: "Deze aanbieding is verlopen"
1003
+ },
1004
+ "pt-BR": {
1005
+ video: "Vídeo",
1006
+ days: "Dias",
1007
+ hours: "Horas",
1008
+ minutes: "Minutos",
1009
+ seconds: "Segundos",
1010
+ expired: "Esta oferta expirou"
1011
+ },
1012
+ ca: {
1013
+ video: "Vídeo",
1014
+ days: "Dies",
1015
+ hours: "Hores",
1016
+ minutes: "Minuts",
1017
+ seconds: "Segons",
1018
+ expired: "Aquesta oferta ha caducat"
1019
+ },
1020
+ ja: {
1021
+ video: "動画",
1022
+ days: "日",
1023
+ hours: "時間",
1024
+ minutes: "分",
1025
+ seconds: "秒",
1026
+ expired: "このオファーは終了しました"
1027
+ }
1028
+ }, _i = new Map(Object.keys(gi).map((e) => [e.toLowerCase(), e]));
1029
+ function vi(e) {
1030
+ if (!e) return gi.en;
1031
+ let t = e.trim().replace(/_/g, "-").toLowerCase(), n = _i.get(t);
1032
+ if (n) return gi[n];
1033
+ let r = _i.get(si(t));
1034
+ return r ? gi[r] : gi.en;
1035
+ }
1036
+ function yi(e) {
1037
+ let t = vi(e);
1038
+ return {
1039
+ video: { alt: t.video },
1040
+ countdown: {
1041
+ labelDays: t.days,
1042
+ labelHours: t.hours,
1043
+ labelMinutes: t.minutes,
1044
+ labelSeconds: t.seconds,
1045
+ expiredMessage: t.expired
1046
+ }
1047
+ };
1048
+ }
1049
+ // src/utils/collectColorFieldIssues.ts
1050
+ function bi(e, t) {
1051
+ let n = [], r = (r, i) => {
1052
+ let a = mt(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
1053
+ if (a.invalidPresets.length > 0 && n.push({
1054
+ id: s("invalid-presets"),
1055
+ message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
1056
+ }), a.emptyPresets && n.push({
1057
+ id: s("empty-presets"),
1058
+ message: `${o}: presets is empty — a field palette can only narrow the editor's, so an empty list is ignored and the field inherits colors.presets.`
1059
+ }), a.allowCustomIgnored && n.push({
1060
+ id: s("allow-custom-ignored"),
1061
+ message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
1062
+ }), !a.allowCustom && a.presets.length > 0) {
1063
+ let e = r.default ?? "", t = new Set(a.presets.map((e) => tr(e)));
1064
+ e !== "" && !t.has(tr(e)) && n.push({
1065
+ id: s("off-palette-default"),
1066
+ message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
1067
+ });
1068
+ }
1069
+ };
1070
+ for (let t of e.fields) if (t.type === "color") r(t, t.key);
1071
+ else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
1072
+ return n;
1073
+ }
1074
+ // src/utils/keyboardShortcuts.ts
1075
+ function xi(e) {
1076
+ for (let t of e.composedPath()) {
1077
+ if (!(t instanceof HTMLElement)) continue;
1078
+ if (t.isContentEditable) return !0;
1079
+ let e = t.tagName;
1080
+ if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
1081
+ }
1082
+ return !1;
1083
+ }
1084
+ function Si(e, t) {
1085
+ let n = e.metaKey || e.ctrlKey;
1086
+ if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
1087
+ else if (n && e.key.toLowerCase() === "z") {
1088
+ if (xi(e)) return;
1089
+ e.preventDefault(), e.shiftKey ? t.history.redo() : t.history.undo();
1090
+ } else {
1091
+ if (t.isPicking?.() && !xi(e)) {
1092
+ if (e.key === "Escape") {
1093
+ e.preventDefault(), t.onCancelPick?.();
1094
+ return;
1095
+ }
1096
+ if (e.key === "Enter") {
1097
+ e.preventDefault(), t.onConfirmPick?.();
1098
+ return;
1099
+ }
1100
+ if (e.key === "Delete" || e.key === "Backspace") {
1101
+ e.preventDefault();
1102
+ return;
1103
+ }
1104
+ }
1105
+ e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !xi(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
1106
+ }
1107
+ }
1108
+ // src/utils/blockComponentResolver.ts
1109
+ function Ci(e, t) {
1110
+ let n = { fontFamily: t(e.fontFamily) };
1111
+ return e.textColor && (n.color = e.textColor), e.linkColor && (n["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (n["--tpl-doc-link-underline"] = "underline"), n;
1112
+ }
1113
+ function wi(e, t, n) {
1114
+ if (t) {
1115
+ let n = t.getComponent(e);
1116
+ if (n) return n;
1117
+ }
1118
+ return n[e.type] ?? null;
1119
+ }
1120
+ var Ti = "--tpl-block-bg-layer", Ei = "tpl-has-bg-image";
1121
+ function Di(e, t) {
1122
+ if (t === null) return {};
1123
+ let n = ye(e);
1124
+ if (n === null) return {};
1125
+ let r = t?.trim(), i = r ? qe(r) : n.url;
1126
+ return {
1127
+ backgroundImage: `url("${i}")`,
1128
+ backgroundSize: n.size,
1129
+ backgroundPosition: n.position,
1130
+ backgroundRepeat: n.repeat,
1131
+ [Ti]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
1132
+ };
1133
+ }
1134
+ function Oi(e) {
1135
+ return e && Ti in e ? Ei : void 0;
1136
+ }
1137
+ var ki = {
1138
+ top: "flex-start",
1139
+ middle: "center",
1140
+ bottom: "flex-end"
1141
+ };
1142
+ function Ai(e, t) {
1143
+ let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${ji(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
1144
+ return {
1145
+ display: "flex",
1146
+ flexDirection: "column",
1147
+ justifyContent: ki[e.verticalAlign],
1148
+ boxSizing: "border-box",
1149
+ ...n
1150
+ };
1151
+ }
1152
+ function ji(e, t) {
1153
+ return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
1154
+ }
1155
+ function Mi(e, t = {}) {
1156
+ if (e.type === "wrapper") return {};
1157
+ let { padding: n, backgroundColor: r } = e.styles, i = {
1158
+ padding: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
1159
+ backgroundColor: r || "transparent"
1160
+ };
1161
+ if ((e.type === "paragraph" || e.type === "title") && (i["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Te.paragraphGap : Te.paragraphGap}px`), e.type === "section") {
1162
+ let n = Ze(e.borderRadius);
1163
+ n !== null && (i.borderRadius = n);
1164
+ let r = Le(e);
1165
+ r?.applied && e.backgroundImage ? (Object.assign(i, Ai(r, t.heroBoxWidth)), Object.assign(i, Di({
1166
+ ...e.backgroundImage,
1167
+ size: "cover",
1168
+ repeat: !1
1169
+ }, t.backgroundImageUrl))) : (Object.assign(i, Pi(e.border)), Object.assign(i, Di(e.backgroundImage, t.backgroundImageUrl)));
1170
+ }
1171
+ return i;
1172
+ }
1173
+ function Ni(e, t, n, r) {
1174
+ return e.type === "section" ? Mi(e, {
1175
+ backgroundImageUrl: et(t, e.backgroundImage, n),
1176
+ heroBoxWidth: r
1177
+ }) : Mi(e);
1178
+ }
1179
+ function Pi(e) {
1180
+ let t = {};
1181
+ for (let [n, r] of Object.entries(Ye(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
1182
+ return t;
1183
+ }
1184
+ function Fi(e, t = {}) {
1185
+ if (e.type !== "section" || !e.wrapper) return null;
1186
+ let n = e.wrapper, r = {};
1187
+ n.backgroundColor && (r.backgroundColor = n.backgroundColor), n.padding && (r.padding = `${n.padding.top}px ${n.padding.right}px ${n.padding.bottom}px ${n.padding.left}px`);
1188
+ let i = Ze(n.borderRadius);
1189
+ return i !== null && (r.borderRadius = i), Object.assign(r, Di(n.backgroundImage, t.backgroundImageUrl)), r;
1190
+ }
1191
+ function Ii(e, t = {}) {
1192
+ if (e.type !== "wrapper") return null;
1193
+ let n = {};
1194
+ if (e.styles.backgroundColor && (n.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
1195
+ let t = e.styles.padding;
1196
+ n.padding = `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
1197
+ }
1198
+ return e.borderRadius && e.borderRadius > 0 && (n.borderRadius = `${e.borderRadius}px`), Object.assign(n, Di(e.backgroundImage, t.backgroundImageUrl)), n;
1199
+ }
1200
+ // src/utils/mergeTagLabelSegments.ts
1201
+ function Li(e, t, n, r = !1) {
1202
+ if (!e) return [];
1203
+ let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
1204
+ for (; (s = i.exec(e)) !== null;) {
1205
+ s.index > o && a.push({
1206
+ type: "text",
1207
+ value: e.slice(o, s.index)
1208
+ });
1209
+ let i = s[0];
1210
+ if (ve(i, n)) {
1211
+ let e = r ? Ie(i, t) : void 0;
1212
+ a.push(e === void 0 ? {
1213
+ type: "tag",
1214
+ value: me(i, t)
1215
+ } : {
1216
+ type: "text",
1217
+ value: e
1218
+ });
1219
+ } else Ke(i, n) ? a.push({
1220
+ type: "tag",
1221
+ value: Ee(i, n)
1222
+ }) : a.push({
1223
+ type: "text",
1224
+ value: i
1225
+ });
1226
+ o = s.index + i.length;
1227
+ }
1228
+ return o < e.length && a.push({
1229
+ type: "text",
1230
+ value: e.slice(o)
1231
+ }), a;
1232
+ }
1233
+ // src/components/MergeTagPreviewText.vue
1234
+ var Ri = n({
1235
+ name: "MergeTagPreviewText",
1236
+ props: { text: {
1237
+ type: String,
1238
+ required: !0
1239
+ } },
1240
+ setup(e) {
1241
+ let t = f(en, sn), n = f(Vt, Pe.liquid), i = f(fn, null), a = N(() => Li(e.text, t.value, n, i?.value ?? !1));
1242
+ return () => a.value.map((e, t) => e.type === "tag" ? r("span", {
1243
+ key: t,
1244
+ class: "tpl-merge-tag-label"
1245
+ }, e.value) : e.value);
1246
+ }
1247
+ }), zi = ["href"], Bi = /* @__PURE__ */ n({
1248
+ __name: "ButtonBlock",
1249
+ props: {
1250
+ block: {},
1251
+ viewport: {}
1252
+ },
1253
+ setup(e) {
1254
+ let t = e, n = En(pn, "ButtonBlock"), r = N(() => {
1255
+ let e = {
1256
+ display: "inline-block",
1257
+ padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
1258
+ backgroundColor: t.block.backgroundColor,
1259
+ color: t.block.textColor,
1260
+ fontSize: `${t.block.fontSize}px`,
1261
+ fontWeight: "bold",
1262
+ textDecoration: "none",
1263
+ borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : Ze(t.block.borderRadius) ?? "0px",
1264
+ textAlign: "center"
1265
+ };
1266
+ return Object.assign(e, Pi(t.block.border)), t.block.fontFamily && (e.fontFamily = n.resolveFontFamily(t.block.fontFamily)), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
1267
+ }), a = N(() => ({ textAlign: t.block.align ?? "center" }));
1268
+ return (t, n) => (i(), b("div", { style: P(a.value) }, [A("a", {
1269
+ href: e.block.url || "#",
1270
+ style: P(r.value),
1271
+ class: "tpl:cursor-default",
1272
+ onClick: n[0] ||= k(() => {}, ["prevent"])
1273
+ }, [V(Ri, { text: e.block.text }, null, 8, ["text"])], 12, zi)], 4));
1274
+ }
1275
+ }), Vi = ["innerHTML"], Hi = [
1276
+ "src",
1277
+ "width",
1278
+ "height"
1279
+ ], Ui = /* @__PURE__ */ n({
1280
+ __name: "CustomBlockIcon",
1281
+ props: {
1282
+ icon: {},
1283
+ size: {}
1284
+ },
1285
+ setup(e) {
1286
+ let t = e, n = N(() => t.size ?? 20), r = N(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), a = N(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/"))), o = N(() => r.value ? ur(t.icon ?? "") : "");
1287
+ return (t, s) => r.value ? (i(), b("span", {
1288
+ key: 0,
1289
+ class: "tpl:inline-flex tpl:items-center tpl:justify-center",
1290
+ style: P({
1291
+ width: `${n.value}px`,
1292
+ height: `${n.value}px`
1293
+ }),
1294
+ innerHTML: o.value
1295
+ }, null, 12, Vi)) : a.value ? (i(), b("img", {
1296
+ key: 1,
1297
+ src: e.icon,
1298
+ width: n.value,
1299
+ height: n.value,
1300
+ class: "tpl:inline-block",
1301
+ alt: ""
1302
+ }, null, 8, Hi)) : (i(), D(C(Et), {
1303
+ key: 2,
1304
+ size: n.value,
1305
+ "stroke-width": 1.5
1306
+ }, null, 8, ["size"]));
1307
+ }
1308
+ }), Wi = { class: "tpl:w-full" }, Gi = {
1309
+ key: 0,
1310
+ class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
1311
+ }, Ki = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, qi = {
1312
+ key: 1,
1313
+ class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
1314
+ }, Ji = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Yi = {
1315
+ key: 2,
1316
+ class: "tpl:relative"
1317
+ }, Xi = ["innerHTML"], Zi = {
1318
+ key: 0,
1319
+ class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
1320
+ style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
1321
+ }, Qi = /* @__PURE__ */ n({
1322
+ __name: "CustomBlock",
1323
+ props: {
1324
+ block: {},
1325
+ viewport: {}
1326
+ },
1327
+ emits: ["fetchData"],
1328
+ setup(e, { emit: t }) {
1329
+ let n = e, r = t, { t: a } = Q(), s = f(Cn, null), c = z(""), l = N(() => dr(c.value)), u = z(!1), p = N(() => s?.getDefinition(n.block.customType)), m = N(() => !!p.value), h = N(() => n.block), { isFetching: g, fetch: _, needsFetch: v, hasDataSource: y } = tt({
1330
+ definition: p,
1331
+ block: h,
1332
+ onUpdate: (e, t) => {
1333
+ r("fetchData", {
1334
+ fieldValues: e,
1335
+ dataSourceFetched: t
1336
+ });
1337
+ }
1338
+ }), S = f(en, sn), w = f(fn, null), T = N(() => {
1339
+ if (!w?.value) return n.block;
1340
+ let e = {};
1341
+ for (let [t, r] of Object.entries(n.block.fieldValues)) e[t] = typeof r == "string" ? Se(r, S.value) : r;
1342
+ return {
1343
+ ...n.block,
1344
+ fieldValues: e
1345
+ };
1346
+ });
1347
+ async function O() {
1348
+ if (s) {
1349
+ u.value = !1;
1350
+ try {
1351
+ let e = await s.renderCustomBlock(T.value);
1352
+ e.includes("Template render error:") && (u.value = !0), c.value = e;
1353
+ } catch {
1354
+ u.value = !0, c.value = "";
1355
+ }
1356
+ }
1357
+ }
1358
+ let M = Kn(O, 150);
1359
+ return d(() => {
1360
+ O();
1361
+ }), o(() => n.block.fieldValues, () => {
1362
+ M();
1363
+ }, { deep: !0 }), o(() => w?.value, () => {
1364
+ M();
1365
+ }), (e, t) => (i(), b("div", Wi, [m.value ? u.value ? (i(), b("div", qi, [V(C(jt), {
1366
+ size: 24,
1367
+ class: "tpl:text-[var(--tpl-danger)]"
1368
+ }), A("span", Ji, j(C(a).customBlocks.renderError), 1)])) : (i(), b("div", Yi, [A("div", { innerHTML: l.value }, null, 8, Xi), C(y) && C(v) ? (i(), b("div", Zi, [C(g) ? (i(), D(fr, {
1369
+ key: 1,
1370
+ class: "tpl:w-48"
1371
+ })) : (i(), b("button", {
1372
+ key: 0,
1373
+ type: "button",
1374
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
1375
+ onClick: t[0] ||= k((...e) => C(_) && C(_)(...e), ["stop"])
1376
+ }, [p.value?.icon ? (i(), D(Ui, {
1377
+ key: 0,
1378
+ icon: p.value.icon,
1379
+ size: 16
1380
+ }, null, 8, ["icon"])) : E("", !0), x(" " + j(p.value?.dataSource?.label || C(a).customBlocks.dataSource.fetchButton), 1)]))])) : E("", !0)])) : (i(), b("div", Gi, [V(C(Dt), {
1381
+ size: 24,
1382
+ class: "tpl:text-[var(--tpl-warning)]"
1383
+ }), A("span", Ki, j(C(a).customBlocks.definitionNotFound), 1)]))]));
1384
+ }
1385
+ }), $i = { class: "tpl:w-full" }, ea = /* @__PURE__ */ n({
1386
+ __name: "DividerBlock",
1387
+ props: {
1388
+ block: {},
1389
+ viewport: {}
1390
+ },
1391
+ setup(e) {
1392
+ let t = e, n = N(() => ({
1393
+ borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
1394
+ width: t.block.width === "full" ? "100%" : typeof t.block.width == "number" ? `${t.block.width}px` : t.block.width,
1395
+ margin: t.block.width === "full" ? "0" : "0 auto"
1396
+ }));
1397
+ return (e, t) => (i(), b("div", $i, [A("hr", {
1398
+ class: "tpl:m-0 tpl:border-none",
1399
+ style: P(n.value)
1400
+ }, null, 4)]));
1401
+ }
1402
+ }), ta = { class: "tpl:w-full" }, na = ["srcdoc", "title"], ra = {
1403
+ key: 1,
1404
+ class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
1405
+ }, ia = {
1406
+ key: 0,
1407
+ class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
1408
+ }, aa = {
1409
+ key: 1,
1410
+ class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
1411
+ }, oa = /* @__PURE__ */ n({
1412
+ __name: "HtmlBlock",
1413
+ props: {
1414
+ block: {},
1415
+ viewport: {}
1416
+ },
1417
+ setup(e) {
1418
+ let t = e, { t: n } = Q(), r = f(rn, !1), a = N(() => t.block.content.trim().length > 0), s = N(() => r && a.value), c = f(en, sn), l = f(fn, null), d = N(() => l?.value ? Se(t.block.content, c.value) : t.block.content), p = z(null), m = z(60), h = null;
1419
+ function g() {
1420
+ let e = p.value?.contentDocument;
1421
+ e && (m.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
1422
+ }
1423
+ function _() {
1424
+ h?.disconnect(), h = null, g();
1425
+ let e = p.value?.contentDocument?.documentElement;
1426
+ e && typeof ResizeObserver < "u" && (h = new ResizeObserver(() => g()), h.observe(e));
1427
+ }
1428
+ return o(s, (e) => {
1429
+ e || (h?.disconnect(), h = null);
1430
+ }), u(() => {
1431
+ h?.disconnect(), h = null;
1432
+ }), (e, t) => (i(), b("div", ta, [s.value ? (i(), b("iframe", {
1433
+ key: 0,
1434
+ ref_key: "iframeRef",
1435
+ ref: p,
1436
+ srcdoc: d.value,
1437
+ sandbox: "allow-same-origin",
1438
+ title: C(n).html.preview,
1439
+ class: "tpl:block tpl:w-full tpl:border-0",
1440
+ style: P({ height: `${m.value}px` }),
1441
+ onLoad: _
1442
+ }, null, 44, na)) : (i(), b("div", ra, [V(C(St), {
1443
+ size: 24,
1444
+ class: "tpl:text-[var(--tpl-text-dim)]"
1445
+ }), a.value ? (i(), b("span", ia, j(C(n).html.preview), 1)) : (i(), b("span", aa, j(C(n).html.empty), 1))]))]));
1446
+ }
1447
+ }), sa = ["data-drop-enabled"], ca = ["href"], la = ["src", "alt"], ua = ["src", "alt"], da = {
1448
+ class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
1449
+ style: { opacity: "0.7" }
1450
+ }, fa = ["href"], pa = ["src", "alt"], ma = ["src", "alt"], ha = {
1451
+ key: 4,
1452
+ class: "tpl:flex tpl:box-border tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
1453
+ }, ga = ["aria-label"], _a = { key: 1 }, va = /* @__PURE__ */ n({
1454
+ __name: "ImageBlock",
1455
+ props: {
1456
+ block: {},
1457
+ viewport: {}
1458
+ },
1459
+ emits: ["update"],
1460
+ setup(e, { emit: t }) {
1461
+ let n = e, r = t, { t: a } = Q(), { syntax: o } = er(), s = N(() => Ve(n.block.src, o));
1462
+ function c(e) {
1463
+ let t = {
1464
+ src: e.url,
1465
+ ...lt(ot(e.width, e.height))
1466
+ };
1467
+ e.alt && (t.alt = e.alt), r("update", t);
1468
+ }
1469
+ let l = z(), { canBrowse: u, dropEnabled: d, isUploading: f, showOverlay: p, openMediaBrowser: m } = pt({
1470
+ target: l,
1471
+ blocked: s,
1472
+ apply: c
1473
+ }), h = N(() => ({ textAlign: n.block.align })), g = N(() => {
1474
+ let e = n.block.border, t = ["left", "right"].map((t) => pe(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
1475
+ return t > 0 ? `calc(100% - ${t}px)` : "100%";
1476
+ }), _ = N(() => {
1477
+ let e = n.block.align;
1478
+ return {
1479
+ maxWidth: "100%",
1480
+ width: n.block.width === "full" ? g.value : `${n.block.width}px`,
1481
+ height: n.block.height ? `${n.block.height}px` : void 0,
1482
+ borderRadius: Ze(n.block.borderRadius) ?? void 0,
1483
+ ...Pi(n.block.border),
1484
+ display: "block",
1485
+ marginLeft: e === "center" || e === "right" ? "auto" : void 0,
1486
+ marginRight: e === "center" ? "auto" : void 0
1487
+ };
1488
+ }), v = at(() => s.value ? void 0 : n.block.src), y = at(() => s.value ? n.block.placeholderUrl : void 0);
1489
+ return (t, n) => (i(), b("div", {
1490
+ ref_key: "dropZoneRef",
1491
+ ref: l,
1492
+ "data-testid": "image-drop-zone",
1493
+ "data-drop-enabled": C(d),
1494
+ class: "tpl:relative tpl:w-full",
1495
+ style: P(h.value)
1496
+ }, [C(p) ? (i(), D(ct, {
1497
+ key: 0,
1498
+ uploading: C(f),
1499
+ size: "canvas"
1500
+ }, null, 8, ["uploading"])) : E("", !0), e.block.src && s.value && e.block.placeholderUrl ? (i(), b(B, { key: 1 }, [e.block.linkUrl ? (i(), b("a", {
1501
+ key: 0,
1502
+ href: e.block.linkUrl,
1503
+ target: "_blank",
1504
+ rel: "noopener noreferrer",
1505
+ onClick: n[0] ||= k(() => {}, ["prevent"])
1506
+ }, [A("img", {
1507
+ class: "tpl:border-0",
1508
+ loading: "lazy",
1509
+ src: C(y),
1510
+ alt: e.block.alt || C(a).image.altTextPlaceholder,
1511
+ style: P(_.value)
1512
+ }, null, 12, la)], 8, ca)) : (i(), b("img", {
1513
+ key: 1,
1514
+ class: "tpl:border-0",
1515
+ src: C(y),
1516
+ alt: e.block.alt,
1517
+ style: P(_.value)
1518
+ }, null, 12, ua))], 64)) : e.block.src && s.value ? (i(), b("div", {
1519
+ key: 2,
1520
+ class: "tpl:!flex tpl:box-border tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
1521
+ style: P([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, _.value])
1522
+ }, [V(C(At), {
1523
+ size: 32,
1524
+ "stroke-width": 1.5,
1525
+ class: "tpl:text-[var(--tpl-primary)]",
1526
+ style: { opacity: "0.5" }
1527
+ }), A("span", da, [V(Ri, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (i(), b(B, { key: 3 }, [e.block.linkUrl ? (i(), b("a", {
1528
+ key: 0,
1529
+ href: e.block.linkUrl,
1530
+ target: "_blank",
1531
+ rel: "noopener noreferrer",
1532
+ onClick: n[1] ||= k(() => {}, ["prevent"])
1533
+ }, [A("img", {
1534
+ class: "tpl:border-0",
1535
+ loading: "lazy",
1536
+ src: C(v),
1537
+ alt: e.block.alt || C(a).image.altTextPlaceholder,
1538
+ style: P(_.value)
1539
+ }, null, 12, pa)], 8, fa)) : (i(), b("img", {
1540
+ key: 1,
1541
+ class: "tpl:border-0",
1542
+ src: C(v),
1543
+ alt: e.block.alt,
1544
+ style: P(_.value)
1545
+ }, null, 12, ma))], 64)) : (i(), b("div", ha, [C(u) ? (i(), b("button", {
1546
+ key: 0,
1547
+ "aria-label": C(a).image.browseMedia,
1548
+ class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1549
+ onClick: n[2] ||= k((...e) => C(m) && C(m)(...e), ["stop"])
1550
+ }, [V(C(At), {
1551
+ size: 14,
1552
+ "stroke-width": 1.5
1553
+ }), x(" " + j(C(a).image.browseMedia), 1)], 8, ga)) : (i(), b("span", _a, j(C(a).image.clickToAdd), 1))]))], 12, sa));
1554
+ }
1555
+ }), ya = { class: "tpl:w-full" }, ba = ["href"], xa = {
1556
+ key: 1,
1557
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
1558
+ }, Sa = /* @__PURE__ */ n({
1559
+ __name: "MenuBlock",
1560
+ props: {
1561
+ block: {},
1562
+ viewport: {}
1563
+ },
1564
+ setup(e) {
1565
+ let t = e, { t: n } = Q(), r = En(pn, "MenuBlock"), a = N(() => ({
1566
+ display: "flex",
1567
+ flexWrap: "wrap",
1568
+ gap: `0 ${t.block.spacing}px`,
1569
+ justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
1570
+ fontSize: `${t.block.fontSize}px`,
1571
+ fontFamily: t.block.fontFamily ? r.resolveFontFamily(t.block.fontFamily) : "inherit",
1572
+ alignItems: "center"
1573
+ })), o = N(() => t.block.items.length > 0);
1574
+ function s(e) {
1575
+ return e || t.block.linkColor || t.block.color;
1576
+ }
1577
+ return (t, r) => (i(), b("div", ya, [o.value ? (i(), b("div", {
1578
+ key: 0,
1579
+ style: P(a.value)
1580
+ }, [(i(!0), b(B, null, l(e.block.items, (t, n) => (i(), b(B, { key: t.id }, [A("a", {
1581
+ href: t.url || "#",
1582
+ class: "tpl:cursor-default tpl:no-underline",
1583
+ style: P({
1584
+ color: s(t.color),
1585
+ fontWeight: t.bold ? "bold" : "normal",
1586
+ textDecoration: t.underline ? "underline" : "none"
1587
+ }),
1588
+ onClick: r[0] ||= k(() => {}, ["prevent"])
1589
+ }, [V(Ri, { text: t.text || "..." }, null, 8, ["text"])], 12, ba), n < e.block.items.length - 1 ? (i(), b("span", {
1590
+ key: 0,
1591
+ style: P({
1592
+ color: e.block.separatorColor,
1593
+ padding: `0 ${e.block.spacing}px`
1594
+ })
1595
+ }, j(e.block.separator), 5)) : E("", !0)], 64))), 128))], 4)) : (i(), b("div", xa, [V(C(kt), { size: 16 }), A("span", null, j(C(n).menu.addLinks), 1)]))]));
1596
+ }
1597
+ });
1598
+ // src/composables/useEditableTextBlock.ts
1599
+ function Ca(e) {
1600
+ let t = f(en, sn), n = f(fn, null), { syntax: r } = er(), i = N(() => n?.value ? we(e(), t.value) : Re(e(), t.value)), a = N(() => ge(dr(xe(i.value, r)))), o = z(!1), s = z(null), { top: c, left: l } = Zn(s), { toLocal: u } = or(), d = N(() => u({
1601
+ top: c.value - 8,
1602
+ left: l.value
1603
+ }));
1604
+ function p() {
1605
+ o.value = !0;
1606
+ }
1607
+ function m() {
1608
+ o.value = !1;
1609
+ }
1610
+ return {
1611
+ isEditing: o,
1612
+ blockRef: s,
1613
+ toolbarPosition: d,
1614
+ resolvedContent: a,
1615
+ handleDoubleClick: p,
1616
+ handleEditorDone: m
1617
+ };
1618
+ }
1619
+ // src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
1620
+ var wa = ["innerHTML"], Ta = /* @__PURE__ */ n({
1621
+ __name: "ParagraphBlock",
1622
+ props: {
1623
+ block: {},
1624
+ viewport: {}
1625
+ },
1626
+ setup(e) {
1627
+ let t = e, n = g(() => import("./ParagraphEditor-DDolH_Pf.js").then((e) => e.t)), { isEditing: r, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Ca(() => t.block.content);
1628
+ return (t, u) => (i(), b("div", {
1629
+ ref_key: "blockRef",
1630
+ ref: a,
1631
+ class: "tpl:min-h-[1em] tpl:w-full",
1632
+ onDblclick: u[0] ||= (...e) => C(c) && C(c)(...e)
1633
+ }, [C(r) ? (i(), D(C(n), {
1634
+ key: 0,
1635
+ block: e.block,
1636
+ "toolbar-position": C(o),
1637
+ onDone: C(l)
1638
+ }, null, 8, [
1639
+ "block",
1640
+ "toolbar-position",
1641
+ "onDone"
1642
+ ])) : (i(), b("div", {
1643
+ key: 1,
1644
+ class: "tpl-text-content tpl:outline-none",
1645
+ innerHTML: C(s)
1646
+ }, null, 8, wa))], 544));
1647
+ }
1648
+ });
1649
+ // src/utils/updateBlockList.ts
1650
+ function Ea(e, t, n, r = 0, i) {
1651
+ let a = n ? e.content.value.blocks.find((e) => e.id === n) : void 0, o = n ? a?.type === "section" ? a.children[r] ?? [] : [] : e.content.value.blocks, s = t.map((e) => e.id);
1652
+ if (o.some((e) => !s.includes(e.id))) return;
1653
+ let c = t.filter((e) => !o.some((t) => t.id === e.id)), l, u = -1;
1654
+ if (c.length === 1) l = c[0], u = s.indexOf(l.id);
1655
+ else if (c.length === 0 && i) {
1656
+ let e = i.oldDraggableIndex ?? i.oldIndex, t = i.newDraggableIndex ?? i.newIndex;
1657
+ if (t === void 0 || !Number.isInteger(t) || t < 0 || t >= o.length || (l = i.data?.id ? o.find((e) => e.id === i.data.id) : e === void 0 ? void 0 : o[e], !l || o.indexOf(l) === t)) return;
1658
+ u = t;
1659
+ }
1660
+ l && (e.findBlockLocation(l.id) ? e.moveBlock(l.id, u, n, r) : e.addBlock(JSON.parse(JSON.stringify(l)), n, r, u));
1661
+ }
1662
+ // src/utils/mergeTagTokens.ts
1663
+ function Da(e, t, n) {
1664
+ let r = [], i = "\0MT";
1665
+ for (; e.includes(i);) i += "_";
1666
+ let a = n === "html" ? Oe(e, (e) => {
1667
+ let t = r.push(e) - 1;
1668
+ return `${i}${t}\u0000`;
1669
+ }) : e, o = Array.from(a.matchAll(RegExp(`${i}\\d+\u0000`, "g")), (e) => ({
1670
+ start: e.index,
1671
+ end: e.index + e[0].length
1672
+ })), s = [];
1673
+ for (let e of [t.logic, t.value]) {
1674
+ let t = new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g");
1675
+ for (let e of a.matchAll(t)) {
1676
+ let t = e.index, r = t + e[0].length;
1677
+ o.some((e) => t < e.end && r > e.start) || s.some((e) => t < e.end && r > e.start) || s.push({
1678
+ start: t,
1679
+ end: r,
1680
+ value: n === "html" ? he(e[0]) : e[0]
1681
+ });
1682
+ }
1683
+ }
1684
+ return [...r, ...s.map((e) => e.value)].sort();
1685
+ }
1686
+ function Oa(e, t, n, r) {
1687
+ return JSON.stringify(Da(e, n, r)) !== JSON.stringify(Da(t, n, r));
1688
+ }
1689
+ // src/components/localization/LocaleStatusChip.vue?vue&type=script&setup=true&lang.ts
1690
+ var ka = [
1691
+ "data-state",
1692
+ "aria-label",
1693
+ "title",
1694
+ "aria-expanded",
1695
+ "aria-controls",
1696
+ "onKeydown"
1697
+ ], Aa = [
1698
+ "aria-label",
1699
+ "aria-labelledby",
1700
+ "aria-describedby",
1701
+ "onKeydown"
1702
+ ], ja = ["id"], Ma = ["id"], Na = { class: "tpl:mt-2 tpl:flex tpl:flex-wrap tpl:justify-end tpl:gap-2" }, Pa = ["disabled"], Fa = {
1703
+ key: 0,
1704
+ class: "tpl:m-0 tpl:mb-2 tpl:text-xs tpl:font-medium"
1705
+ }, Ia = {
1706
+ key: 1,
1707
+ class: "tpl:m-0"
1708
+ }, La = { class: "tpl:m-0" }, Ra = { class: "tpl:mt-2 tpl:mb-0 tpl:break-words tpl:text-[var(--tpl-chrome-text-muted)]" }, za = {
1709
+ key: 3,
1710
+ class: "tpl:m-0"
1711
+ }, Ba = {
1712
+ key: 4,
1713
+ class: "tpl:m-0"
1714
+ }, Va = {
1715
+ key: 5,
1716
+ class: "tpl:m-0"
1717
+ }, Ha = {
1718
+ key: 6,
1719
+ class: "tpl:m-0 tpl:list-none tpl:p-0"
1720
+ }, Ua = ["onClick"], Wa = {
1721
+ key: 7,
1722
+ class: "tpl:mt-2 tpl:flex tpl:flex-wrap tpl:gap-1"
1723
+ }, Ga = ["data-testid", "disabled"], Ka = /*#__PURE__*/ yt(/* @__PURE__ */ n({
1724
+ __name: "LocaleStatusChip",
1725
+ props: {
1726
+ blockId: {},
1727
+ state: {},
1728
+ count: {},
1729
+ popoverState: {},
1730
+ popoverCount: {},
1731
+ stale: {},
1732
+ tagsDiffer: {},
1733
+ setPaths: {},
1734
+ staleLocales: {},
1735
+ excerpt: {},
1736
+ eligibleGaps: { type: Boolean },
1737
+ translationCount: {},
1738
+ replacesCurrent: { type: Boolean },
1739
+ editable: { type: Boolean }
1740
+ },
1741
+ emits: ["target"],
1742
+ setup(e, { emit: n }) {
1743
+ let r = e, a = n, s = f(Pn, null), c = f(Tn, null), u = f(Ut, null), d = f(An, "en") ?? "en", { t: m, format: h } = Q(), g = $n(), _ = ir(), { toLocal: v } = or(), y = z(null), x = z(null), M = z(!1), F = z(!1), I = z(null), L = z(null), R = null, V = z({
1744
+ top: 0,
1745
+ left: 0
1746
+ }), H = z({
1747
+ maxHeight: 0,
1748
+ maxWidth: 0
1749
+ }), U = `tpl-locale-popover-${fe()}`, W = N(() => Vn(s?.activeLocale?.value ?? "")), G = N(() => Vn(s?.content.value.settings.locale ?? "en"));
1750
+ function ee(e, t) {
1751
+ switch (e) {
1752
+ case "tags-differ": return m.localization.tagsDiffer;
1753
+ case "hidden": return h(m.localization.hidden, { language: W.value });
1754
+ case "changed": return h(m.localization.changed, { language: W.value });
1755
+ case "default-stale": return Bn(m.localization.staleLanguages, t, d);
1756
+ case "missing": return t === 1 ? m.localization.notTranslated : Bn(m.localization.notTranslatedCount, t, d);
1757
+ default: return t === 1 ? m.localization.outOfDate : Bn(m.localization.staleCount, t, d);
1758
+ }
1759
+ }
1760
+ let K = N(() => ee(r.state, r.count)), q = N(() => r.popoverState ?? r.state), te = N(() => r.popoverCount ?? r.count), ne = N(() => ee(q.value, te.value)), re = N(() => r.state === "hidden" ? wt : r.state === "changed" ? xt : r.state === "default-stale" ? Pt : r.state === "stale" ? Ct : jt), ie = N(() => q.value === "default-stale" || (q.value === "missing" || q.value === "stale") && te.value > 1), J = N(() => r.editable && r.eligibleGaps && c?.isAvailable.value);
1761
+ function Y(e = !1) {
1762
+ M.value = !1, F.value = !1, R = null, e && y.value?.focus({ preventScroll: !0 });
1763
+ }
1764
+ async function X() {
1765
+ if (M.value) return Y();
1766
+ _.value && (M.value = !0, await ae());
1767
+ }
1768
+ async function ae() {
1769
+ let e = _.value;
1770
+ if (!e || !M.value) return;
1771
+ let t = e.ownerDocument.defaultView, n = t?.visualViewport, r = n?.offsetTop ?? 0, i = n?.offsetLeft ?? 0, a = r + (n?.height ?? t?.innerHeight ?? 0), o = i + (n?.width ?? t?.innerWidth ?? 0), s = e.parentElement?.getBoundingClientRect(), c = Math.max(r, s?.height ? s.top : r) + 8, l = Math.max(i, s?.width ? s.left : i) + 8, u = Math.max(c, Math.min(a, s?.height ? s.bottom : a) - 8), d = Math.max(l, Math.min(o, s?.width ? s.right : o) - 8);
1772
+ H.value = {
1773
+ maxHeight: u - c,
1774
+ maxWidth: d - l
1775
+ };
1776
+ let f = y.value.getBoundingClientRect();
1777
+ if (R = f, V.value = v({
1778
+ top: c,
1779
+ left: l
1780
+ }), await O(), !M.value || !x.value) return;
1781
+ let p = x.value.getBoundingClientRect(), m = Math.min(p.height, H.value.maxHeight), h = Math.min(p.width, H.value.maxWidth), g = f.bottom + 4, b = g + m <= u ? g : f.top - m - 4;
1782
+ V.value = v({
1783
+ top: Math.max(c, Math.min(b, u - m)),
1784
+ left: Math.max(l, Math.min(f.left, d - h))
1785
+ }), await O(), M.value && (F.value ? L.value : x.value)?.focus({ preventScroll: !0 });
1786
+ }
1787
+ o(F, async () => {
1788
+ M.value && (await ae(), M.value && !F.value && I.value?.focus({ preventScroll: !0 }));
1789
+ });
1790
+ function oe(e) {
1791
+ let t = e.composedPath();
1792
+ !t.includes(y.value) && !t.includes(x.value) && Y();
1793
+ }
1794
+ function se(e) {
1795
+ if (e.composedPath().includes(x.value)) return;
1796
+ let t = y.value?.getBoundingClientRect();
1797
+ t && R && t.top === R.top && t.right === R.right || Y();
1798
+ }
1799
+ function ce() {
1800
+ g.removeEventListener("click", oe, !0), g.removeEventListener("scroll", se, !0);
1801
+ }
1802
+ o(M, (e) => {
1803
+ ce(), e ? (g.addEventListener("click", oe, !0), g.addEventListener("scroll", se, !0)) : a("target", null);
1804
+ }, { flush: "sync" }), o(q, () => {
1805
+ F.value = !1, M.value && ae();
1806
+ }), o([
1807
+ () => r.blockId,
1808
+ () => r.state,
1809
+ () => s?.activeLocale?.value,
1810
+ () => s?.state.template?.id,
1811
+ () => s?.loadVersion?.value
1812
+ ], () => Y()), p(ce);
1813
+ let Z = (e) => {
1814
+ (M.value || _.value) && (a("target", e ?? null), M.value || X());
1815
+ };
1816
+ o(() => r.blockId, (e, t) => {
1817
+ t && u?.get(t) === Z && u.delete(t), u?.set(e, Z);
1818
+ }, { immediate: !0 }), p(() => {
1819
+ u?.get(r.blockId) === Z && u.delete(r.blockId);
1820
+ });
1821
+ function le() {
1822
+ s?.keepTranslations?.(r.blockId, r.stale), Y(!0);
1823
+ }
1824
+ function ue(e) {
1825
+ s?.resetLocaleFields?.(r.blockId, e), Y(!0);
1826
+ }
1827
+ function de() {
1828
+ s?.setBlockHidden?.(r.blockId, !1), Y(!0);
1829
+ }
1830
+ function pe(e) {
1831
+ s?.setActiveLocale?.(e), Y();
1832
+ }
1833
+ function me() {
1834
+ J.value && !c?.running.value && (q.value === "tags-differ" && r.replacesCurrent ? F.value = !0 : c?.translate({
1835
+ only: q.value === "tags-differ" ? "all" : "gaps",
1836
+ blockId: r.blockId
1837
+ }));
1838
+ }
1839
+ function he() {
1840
+ F.value = !1;
1841
+ }
1842
+ function ge() {
1843
+ F.value ? he() : Y(!0);
1844
+ }
1845
+ function _e() {
1846
+ J.value && !c?.running.value && r.translationCount && (F.value = !1, c?.translate({
1847
+ only: "all",
1848
+ blockId: r.blockId
1849
+ }));
1850
+ }
1851
+ return (n, r) => (i(), b(B, null, [A("button", {
1852
+ ref_key: "trigger",
1853
+ ref: y,
1854
+ type: "button",
1855
+ "data-testid": "locale-chip",
1856
+ "data-state": e.state,
1857
+ "aria-label": K.value,
1858
+ title: K.value,
1859
+ "aria-expanded": M.value,
1860
+ "aria-controls": M.value ? U : void 0,
1861
+ "aria-haspopup": "dialog",
1862
+ class: "tpl-locale-chip tpl:flex tpl:size-5 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:p-0 tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:ring-1 tpl:ring-[var(--tpl-border)] tpl:transition-colors tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:shadow-[var(--tpl-shadow-sm)] tpl:focus-visible:outline-none tpl:focus-visible:shadow-[var(--tpl-ring)] tpl:hover:focus-visible:shadow-[var(--tpl-ring),var(--tpl-shadow-sm)]",
1863
+ onClick: k(X, ["stop"]),
1864
+ onKeydown: [S(k(X, ["stop", "prevent"]), ["enter"]), S(k(ge, ["stop", "prevent"]), ["esc"])]
1865
+ }, [(i(), D(t(re.value), {
1866
+ size: 12,
1867
+ "stroke-width": 2,
1868
+ "aria-hidden": "true"
1869
+ }))], 40, ka), C(_) && M.value ? (i(), D(T, {
1870
+ key: 0,
1871
+ to: C(_)
1872
+ }, [A("div", {
1873
+ id: U,
1874
+ ref_key: "popover",
1875
+ ref: x,
1876
+ role: "dialog",
1877
+ "aria-label": F.value ? void 0 : ne.value,
1878
+ "aria-labelledby": F.value ? `${U}-question` : void 0,
1879
+ "aria-describedby": F.value ? `${U}-warning` : void 0,
1880
+ tabindex: "-1",
1881
+ "data-testid": "locale-popover",
1882
+ class: "tpl-locale-popover tpl:absolute tpl:z-[10000] tpl:w-[300px] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:text-sm tpl:text-[var(--tpl-chrome-text)] tpl:shadow-[var(--tpl-shadow-md)] tpl:outline-none",
1883
+ style: P({
1884
+ top: `${V.value.top}px`,
1885
+ left: `${V.value.left}px`,
1886
+ maxHeight: `${H.value.maxHeight}px`,
1887
+ maxWidth: `${H.value.maxWidth}px`
1888
+ }),
1889
+ onClick: r[2] ||= k(() => {}, ["stop"]),
1890
+ onKeydown: S(k(ge, ["stop", "prevent"]), ["esc"])
1891
+ }, [F.value ? (i(), b(B, { key: 0 }, [
1892
+ A("h3", {
1893
+ id: `${U}-question`,
1894
+ class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
1895
+ }, j(C(Bn)(C(m).localization.translationConfirmation, e.translationCount ?? 0, C(d))), 9, ja),
1896
+ A("p", {
1897
+ id: `${U}-warning`,
1898
+ class: "tpl:m-0 tpl:text-[var(--tpl-text-muted)]"
1899
+ }, j(C(h)(C(m).localization.translationDescription, { language: W.value })), 9, Ma),
1900
+ A("div", Na, [A("button", {
1901
+ ref_key: "confirmationCancel",
1902
+ ref: L,
1903
+ type: "button",
1904
+ "data-testid": "translation-confirm-cancel",
1905
+ class: w(C(Un)),
1906
+ onClick: he
1907
+ }, j(C(m).localization.cancel), 3), A("button", {
1908
+ type: "button",
1909
+ "data-testid": "translation-confirm",
1910
+ class: w(C(Wn)),
1911
+ disabled: !J.value || !!C(c)?.running.value || !e.translationCount,
1912
+ onClick: _e
1913
+ }, j(C(Bn)(C(m).localization.translateAllFields, e.translationCount ?? 0, C(d))), 11, Pa)])
1914
+ ], 64)) : (i(), b(B, { key: 1 }, [
1915
+ ie.value ? (i(), b("p", Fa, j(ne.value), 1)) : E("", !0),
1916
+ q.value === "missing" ? (i(), b("p", Ia, j(C(h)(C(m).localization.missingExplanation, { default: G.value })), 1)) : q.value === "stale" ? (i(), b(B, { key: 2 }, [A("p", La, j(C(h)(C(m).localization.staleExplanation, { default: G.value })), 1), A("p", Ra, j(C(h)(C(m).localization.currentExcerpt, { excerpt: e.excerpt })), 1)], 64)) : q.value === "tags-differ" ? (i(), b("p", za, j(C(h)(C(m).localization.tagsDifferExplanation, { default: G.value })), 1)) : q.value === "changed" ? (i(), b("p", Ba, j(C(Bn)(C(m).localization.changedProperties, te.value, C(d), { default: G.value })), 1)) : q.value === "hidden" ? (i(), b("p", Va, j(C(h)(C(m).localization.hiddenExplanation, { language: W.value })), 1)) : (i(), b("ul", Ha, [(i(!0), b(B, null, l(e.staleLocales, (e) => (i(), b("li", {
1917
+ key: e,
1918
+ class: "tpl:flex tpl:items-center tpl:justify-between tpl:gap-3"
1919
+ }, [A("span", null, j(C(Vn)(e)), 1), A("button", {
1920
+ type: "button",
1921
+ class: w(C(Hn)),
1922
+ onClick: (t) => pe(e)
1923
+ }, j(C(m).localization.open), 11, Ua)]))), 128))])),
1924
+ e.editable && q.value !== "default-stale" ? (i(), b("div", Wa, [
1925
+ J.value && (q.value === "missing" || q.value === "stale" || q.value === "tags-differ") ? (i(), b("button", {
1926
+ key: 0,
1927
+ type: "button",
1928
+ ref_key: "retranslate",
1929
+ ref: I,
1930
+ "data-testid": q.value === "missing" ? "locale-translate" : "locale-retranslate",
1931
+ class: w(C(Un)),
1932
+ disabled: !!C(c)?.running.value,
1933
+ onClick: me
1934
+ }, j(q.value === "missing" ? C(m).localization.translate : C(m).localization.retranslate), 11, Ga)) : E("", !0),
1935
+ q.value === "stale" || q.value === "tags-differ" ? (i(), b(B, { key: 1 }, [q.value === "stale" ? (i(), b("button", {
1936
+ key: 0,
1937
+ type: "button",
1938
+ "data-testid": "locale-keep",
1939
+ class: w(C(J.value ? Hn : Un)),
1940
+ onClick: le
1941
+ }, j(C(m).localization.keep), 3)) : E("", !0), A("button", {
1942
+ type: "button",
1943
+ "data-testid": "locale-use-default",
1944
+ class: w(C(q.value === "tags-differ" && !J.value ? Un : Hn)),
1945
+ onClick: r[0] ||= (t) => ue(q.value === "tags-differ" ? e.tagsDiffer ?? [] : e.stale)
1946
+ }, j(C(h)(C(m).localization.useDefaultLanguage, { default: G.value })), 3)], 64)) : E("", !0),
1947
+ q.value === "changed" ? (i(), b("button", {
1948
+ key: 2,
1949
+ type: "button",
1950
+ "data-testid": "locale-reset",
1951
+ class: w(C(Un)),
1952
+ onClick: r[1] ||= (t) => ue(e.setPaths)
1953
+ }, j(C(m).localization.resetChanges), 3)) : E("", !0),
1954
+ q.value === "hidden" ? (i(), b("button", {
1955
+ key: 3,
1956
+ type: "button",
1957
+ "data-testid": "locale-show",
1958
+ class: w(C(Un)),
1959
+ onClick: de
1960
+ }, j(C(m).localization.show), 3)) : E("", !0)
1961
+ ])) : E("", !0)
1962
+ ], 64))], 44, Aa)], 8, ["to"])) : E("", !0)], 64));
1963
+ }
1964
+ }), [["__scopeId", "data-v-3343ae7d"]]), qa = /* @__PURE__ */ n({
1965
+ __name: "LocaleMarkers",
1966
+ props: { block: {} },
1967
+ setup(e) {
1968
+ let t = e, n = f(Pn, null), r = f($t, void 0), a = f(vn, []), s = f(Vt, Pe.liquid), c = f(yn, N(() => /* @__PURE__ */ new Set())), l = N(() => n?.activeLocale?.value), u = N(() => l.value ? t.block.l10n?.[l.value] : void 0), d = N(() => ({
1969
+ blocks: [t.block.type === "section" || t.block.type === "wrapper" ? {
1970
+ ...t.block,
1971
+ children: []
1972
+ } : t.block],
1973
+ settings: {
1974
+ locale: n.content.value.settings.locale,
1975
+ locales: n.content.value.settings.locales
1976
+ }
1977
+ })), p = N(() => n && l.value && !c.value.has(l.value) ? ne(d.value, l.value, a) : {
1978
+ missing: [],
1979
+ stale: [],
1980
+ translated: []
1981
+ }), m = N(() => p.value.stale.map((e) => e.slice(t.block.id.length + 1))), h = N(() => p.value.translated.flatMap((e) => {
1982
+ let n = e.slice(t.block.id.length + 1), r = Be(t.block, n), i = u.value?.text?.[n]?.value, a = t.block.type === "html" || H[t.block.type]?.includes(n) ? "html" : "text";
1983
+ return typeof r == "string" && i !== void 0 && Oa(r, i, s, a) ? [n] : [];
1984
+ })), g = z(null), _ = N(() => n && l.value && !c.value.has(l.value) ? Ge(d.value, l.value, {
1985
+ syntax: s,
1986
+ definitions: a,
1987
+ doNotTranslate: r?.doNotTranslate,
1988
+ blockId: t.block.id,
1989
+ only: T.value === "tags-differ" ? "all" : "gaps"
1990
+ }).strings : []), v = N(() => _.value.some(({ id: e }) => {
1991
+ let n = e.slice(t.block.id.length + 1);
1992
+ return p.value.translated.includes(e) && !h.value.includes(n);
1993
+ })), y = N(() => Object.keys(u.value?.set ?? {}).filter((e) => {
1994
+ let n = e.split("."), r = n.pop(), i = n.length ? Be(t.block, n.join(".")) : t.block;
1995
+ return Array.isArray(i) ? Be(i, r) !== void 0 : i !== void 0;
1996
+ })), b = N(() => !l.value && n ? (n.content.value.settings.locales ?? []).filter((e) => !c.value.has(e) && ne(d.value, e, a).stale.length > 0) : []), x = N(() => l.value ? c.value.has(l.value) ? null : u.value?.hidden ? "hidden" : p.value.missing.length ? "missing" : m.value.length ? "stale" : h.value.length ? "tags-differ" : y.value.length ? "changed" : null : b.value.length ? "default-stale" : null);
1997
+ function S(e) {
1998
+ return e === "missing" ? p.value.missing.length : e === "stale" ? m.value.length : e === "tags-differ" ? h.value.length : e === "default-stale" ? b.value.length : y.value.length;
1999
+ }
2000
+ let w = N(() => S(x.value)), T = N(() => g.value && S(g.value) > 0 ? g.value : x.value), O = N(() => S(T.value));
2001
+ o([x, () => T.value !== (g.value ?? x.value)], () => {
2002
+ g.value = null;
2003
+ });
2004
+ let k = N(() => {
2005
+ let e = Be(t.block, m.value[0] ?? "");
2006
+ if (typeof e != "string") return "";
2007
+ let n = e.split(/<[^>]*>/).join("");
2008
+ return Array.from(n).slice(0, 60).join("");
2009
+ });
2010
+ return (t, n) => C(r) && x.value ? (i(), D(Ka, {
2011
+ key: 0,
2012
+ "block-id": e.block.id,
2013
+ state: x.value,
2014
+ count: w.value,
2015
+ "popover-state": T.value ?? void 0,
2016
+ "popover-count": O.value,
2017
+ stale: m.value,
2018
+ "tags-differ": h.value,
2019
+ "set-paths": y.value,
2020
+ "stale-locales": b.value,
2021
+ excerpt: k.value,
2022
+ "eligible-gaps": _.value.length > 0,
2023
+ "translation-count": _.value.length,
2024
+ "replaces-current": v.value,
2025
+ editable: !!l.value && C(r).locales.includes(l.value),
2026
+ onTarget: n[0] ||= (e) => g.value = e
2027
+ }, null, 8, [
2028
+ "block-id",
2029
+ "state",
2030
+ "count",
2031
+ "popover-state",
2032
+ "popover-count",
2033
+ "stale",
2034
+ "tags-differ",
2035
+ "set-paths",
2036
+ "stale-locales",
2037
+ "excerpt",
2038
+ "eligible-gaps",
2039
+ "translation-count",
2040
+ "replaces-current",
2041
+ "editable"
2042
+ ])) : E("", !0);
2043
+ }
2044
+ }), Ja = [
2045
+ "data-block-id",
2046
+ "data-block-type",
2047
+ "data-tpl-picked"
2048
+ ], Ya = ["aria-label"], Xa = ["data-lock-holder"], Za = ["aria-label"], Qa = [
2049
+ "aria-label",
2050
+ "aria-pressed",
2051
+ "title"
2052
+ ], $a = ["aria-label", "title"], eo = ["aria-label", "title"], to = ["aria-label", "title"], no = {
2053
+ key: 3,
2054
+ class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
2055
+ }, ro = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, io = {
2056
+ key: 4,
2057
+ class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
2058
+ }, ao = ["aria-label", "title"], oo = /*#__PURE__*/ yt(/* @__PURE__ */ n({
2059
+ __name: "BlockWrapper",
2060
+ props: {
2061
+ block: {},
2062
+ displayBlock: {},
2063
+ isSelected: { type: Boolean },
2064
+ viewport: {},
2065
+ previewMode: { type: Boolean },
2066
+ nested: { type: Boolean },
2067
+ picked: { type: Boolean }
2068
+ },
2069
+ emits: ["select"],
2070
+ setup(e, { emit: t }) {
2071
+ let n = g(() => import("./BlockIssueBadge-DyEgBZtR.js")), r = e, a = N(() => r.displayBlock ?? r.block), s = t, { t: c, format: l } = Q(), u = f(Fn, null), d = z(null), p = N(() => u?.liftedBlockId.value === r.block.id), m = N(() => p.value ? l(c.blockActions.dragLifted, { block: r.block.type }) : c.blockActions.drag);
2072
+ async function v() {
2073
+ await O(), d.value?.focus();
2074
+ }
2075
+ function y(e) {
2076
+ u && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), p.value ? u.drop(r.block.id) : u.lift(r.block.id)) : p.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), u.cancel(), v()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), u.moveUp(r.block.id), v()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), u.moveDown(r.block.id), v())));
2077
+ }
2078
+ let S = N(() => !r.viewport || !a.value.visibility ? !1 : a.value.visibility[r.viewport] === !1), T = N(() => !!(Z?.activeLocale?.value && r.block.l10n?.[Z.activeLocale.value]?.hidden)), M = N(() => r.previewMode === !0 && (S.value || T.value)), F = N(() => r.viewport ? {
2079
+ desktop: c.viewport.desktop,
2080
+ mobile: c.viewport.mobile
2081
+ }[r.viewport] ?? r.viewport : ""), I = N(() => !!a.value.displayCondition), L = f(jn, null), R = f(wn, null), B = f(hn, {}), H = N(() => B.savedBlocks?.isPicking.value === !0), U = N(() => !r.nested && B.savedBlocks?.isAvailable.value === !0 && B.savedBlocks?.canCreate.value === !0), W = N(() => r.isSelected && !H.value), G = N(() => B.comments?.getBlockCount(r.block.id) ?? 0), ee = z(null), K = z(null), q = z(null), te = z(null), ne = z({
2082
+ left: "calc(100% + 8px)",
2083
+ top: "50%"
2084
+ }), re = z(!1), ie = N(() => K.value ?? te.value), J = N(() => ie.value?.closest(".tpl-body"));
2085
+ function Y() {
2086
+ let e = re.value, t = K.value, n = te.value, r = ee.value;
2087
+ if (!t && !n || !r?.offsetWidth) return;
2088
+ let i = r.getBoundingClientRect(), a = i.width / r.offsetWidth || 1, o = J.value, s = o ? (o.getBoundingClientRect().left - i.left) / a + o.clientLeft : -Infinity, c = o ? s + o.clientWidth : Infinity, l = getComputedStyle(r).direction === "rtl";
2089
+ if (n?.offsetWidth) {
2090
+ let t = l ? -4 - n.offsetWidth : r.offsetWidth + 4, i = t >= s + 4 && t + n.offsetWidth + 4 <= c;
2091
+ if (e === i) {
2092
+ re.value = !i, O(Y);
2093
+ return;
2094
+ }
2095
+ }
2096
+ if (!t?.offsetWidth) return;
2097
+ let u = Math.max(s + 4, Math.min(r.offsetWidth + 8, c - t.offsetWidth - 4)), d = q.value, f = Math.max(28, d?.offsetHeight ? d.offsetTop + d.offsetHeight + 4 : 0), p = Math.max(f + t.offsetHeight / 2, r.offsetHeight / 2), m = u < r.offsetWidth && p + t.offsetHeight / 2 <= r.offsetHeight + 8 ? `${p}px` : "50%";
2098
+ if (u >= r.offsetWidth && n?.offsetWidth && !e && !l) {
2099
+ let e = (n.getBoundingClientRect().bottom - i.top) / a + 4 + t.offsetHeight / 2;
2100
+ e > r.offsetHeight / 2 && (m = `${e}px`);
2101
+ }
2102
+ if (u < r.offsetWidth && m === "50%") {
2103
+ let e = d?.getBoundingClientRect();
2104
+ if (e?.width) {
2105
+ let n = l ? (e.right - i.left) / a + 8 : (e.left - i.left) / a - t.offsetWidth - 8;
2106
+ u = Math.max(s + 4, Math.min(n, c - t.offsetWidth - 4));
2107
+ }
2108
+ }
2109
+ (ne.value.left !== `${u}px` || ne.value.top !== m) && (ne.value = {
2110
+ left: `${u}px`,
2111
+ top: m
2112
+ });
2113
+ }
2114
+ _(Y), Qn(N(() => ie.value ? [
2115
+ ee.value,
2116
+ K.value,
2117
+ q.value,
2118
+ te.value,
2119
+ J.value
2120
+ ].filter((e) => !!e) : []), Y), Yn(J, "scroll", Y, { passive: !0 });
2121
+ let X = N(() => B.collaboration?.lockOf(r.block.id) ?? null), ae = N(() => X.value?.holder.type === "guest" ? c.collaboration.guest : X.value?.holder.name ?? ""), oe = N(() => B.collaboration?.agentHighlightOf(r.block.id) ?? B.ai?.highlightOf(r.block.id) ?? null), se = ht(() => a.value.type === "section" ? a.value.backgroundImage : void 0), ce = ht(() => a.value.type === "section" ? a.value.wrapper?.backgroundImage : void 0), Z = f(Pn, null), le = Z ? zn(Z) : null, ue = f(Sn, null) ?? le?.content ?? null;
2122
+ o([() => Z?.activeLocale?.value, () => le && Ue(le.settings.value)], Y, { flush: "post" });
2123
+ let de = f(an, void 0), fe = N(() => Mi(a.value, {
2124
+ backgroundImageUrl: se.value,
2125
+ heroBoxWidth: st(a.value) ? dt(a.value, ue?.value, de) : void 0
2126
+ })), pe = N(() => Fi(a.value, { backgroundImageUrl: ce.value }));
2127
+ function me(e) {
2128
+ r.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), s("select"));
2129
+ }
2130
+ function he() {
2131
+ L?.deleteBlock(r.block.id);
2132
+ }
2133
+ function ge() {
2134
+ L?.duplicateBlock(r.block);
2135
+ }
2136
+ function _e() {
2137
+ B.savedBlocks?.startPicking(r.block.id);
2138
+ }
2139
+ function ve() {
2140
+ R?.toggleBlock(r.block.id);
2141
+ }
2142
+ return (t, r) => M.value ? E("", !0) : (i(), b("div", {
2143
+ key: 0,
2144
+ ref_key: "blockElement",
2145
+ ref: ee,
2146
+ class: w(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
2147
+ "tpl-block--selected": e.isSelected,
2148
+ "tpl-block--locale-hidden": T.value,
2149
+ "tpl-block--picked": e.picked,
2150
+ "tpl-block--idle": !e.isSelected && !e.picked,
2151
+ "tpl-block--lifted": p.value
2152
+ }]),
2153
+ "data-block-id": e.block.id,
2154
+ "data-block-type": e.block.type,
2155
+ "data-tpl-picked": e.picked || void 0,
2156
+ onClick: me
2157
+ }, [
2158
+ A("div", {
2159
+ ref_key: "badgesElement",
2160
+ ref: q,
2161
+ class: "tpl-block-badges tpl:absolute tpl:top-1 tpl:inset-e-1 tpl:z-10 tpl:flex tpl:gap-1"
2162
+ }, [
2163
+ G.value > 0 && !S.value ? (i(), b("button", {
2164
+ key: 0,
2165
+ ref_key: "commentElement",
2166
+ ref: te,
2167
+ class: w(["tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]", re.value ? void 0 : "tpl:absolute tpl:-top-2 tpl:inset-s-full tpl:ms-2"]),
2168
+ "aria-label": C(l)(C(c).blockActions.comments, { count: String(G.value) }),
2169
+ onClick: r[0] ||= k((t) => C(B).comments?.openForBlock(e.block.id), ["stop"])
2170
+ }, [V(C(Ft), {
2171
+ size: 12,
2172
+ "stroke-width": 2.5
2173
+ }), x(" " + j(G.value), 1)], 10, Ya)) : E("", !0),
2174
+ V(C(n), { "block-id": e.block.id }, null, 8, ["block-id"]),
2175
+ e.previewMode ? E("", !0) : (i(), D(qa, {
2176
+ key: 1,
2177
+ block: e.block
2178
+ }, null, 8, ["block"]))
2179
+ ], 512),
2180
+ X.value ? (i(), b("div", {
2181
+ key: 0,
2182
+ "data-testid": "block-lock",
2183
+ "data-lock-holder": X.value.holder.sessionId,
2184
+ class: "tpl-block-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
2185
+ style: P({
2186
+ outline: `2px solid ${X.value.holder.color}`,
2187
+ outlineOffset: "-1px"
2188
+ })
2189
+ }, [A("span", {
2190
+ class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:-translate-x-1/2 tpl:-translate-y-full tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
2191
+ style: P({
2192
+ backgroundColor: X.value.holder.color,
2193
+ color: C(pr)(X.value.holder.color)
2194
+ })
2195
+ }, j(C(l)(C(c).collaboration.editing, { name: ae.value })), 5)], 12, Xa)) : E("", !0),
2196
+ oe.value === null ? E("", !0) : (i(), b("div", {
2197
+ key: oe.value,
2198
+ "data-testid": "block-agent-highlight",
2199
+ "aria-hidden": "true",
2200
+ class: "tpl-block-agent-highlight tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm"
2201
+ })),
2202
+ W.value ? (i(), b("div", {
2203
+ key: 2,
2204
+ ref_key: "actionsElement",
2205
+ ref: K,
2206
+ style: P(ne.value),
2207
+ role: "toolbar",
2208
+ "aria-label": C(c).blockActions.drag,
2209
+ class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:top-1/2 tpl:z-20 tpl:flex tpl:-translate-y-1/2 tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
2210
+ }, [
2211
+ A("button", {
2212
+ ref_key: "dragButtonRef",
2213
+ ref: d,
2214
+ class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:active:cursor-grabbing",
2215
+ "aria-label": m.value,
2216
+ "aria-pressed": p.value,
2217
+ "aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
2218
+ title: C(c).blockActions.drag,
2219
+ onKeydown: y
2220
+ }, [V(C(Rt), {
2221
+ size: 14,
2222
+ "stroke-width": 1.5
2223
+ })], 40, Qa),
2224
+ A("button", {
2225
+ class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
2226
+ "aria-label": C(c).blockActions.duplicate,
2227
+ title: C(c).blockActions.duplicate,
2228
+ onClick: k(ge, ["stop"])
2229
+ }, [V(C(bt), {
2230
+ size: 14,
2231
+ "stroke-width": 1.5
2232
+ })], 8, $a),
2233
+ U.value ? (i(), b("button", {
2234
+ key: 0,
2235
+ class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
2236
+ "aria-label": C(c).blockActions.saveAsBlock,
2237
+ title: C(c).blockActions.saveAsBlock,
2238
+ onClick: k(_e, ["stop"])
2239
+ }, [V(C(Ot), {
2240
+ size: 14,
2241
+ "stroke-width": 1.5
2242
+ })], 8, eo)) : E("", !0),
2243
+ A("button", {
2244
+ class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
2245
+ "aria-label": C(c).blockActions.delete,
2246
+ title: C(c).blockActions.delete,
2247
+ onClick: k(he, ["stop"])
2248
+ }, [V(C(Mt), {
2249
+ size: 14,
2250
+ "stroke-width": 1.5
2251
+ })], 8, to)
2252
+ ], 12, Za)) : E("", !0),
2253
+ S.value ? (i(), b("div", no, [A("span", ro, [V(C(wt), {
2254
+ size: 12,
2255
+ "stroke-width": 1.5
2256
+ }), x(" " + j(C(l)(C(c).blockActions.hiddenOnViewport, { viewport: F.value })), 1)])])) : E("", !0),
2257
+ I.value && !S.value ? (i(), b("div", io, [A("button", {
2258
+ "data-testid": "condition-toggle",
2259
+ class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
2260
+ "aria-label": C(c).blockActions.conditionToggle,
2261
+ title: e.block.displayCondition?.label,
2262
+ onClick: k(ve, ["stop"])
2263
+ }, [V(C(Tt), {
2264
+ size: 12,
2265
+ "stroke-width": 2
2266
+ })], 8, ao)])) : E("", !0),
2267
+ pe.value ? (i(), b("div", {
2268
+ key: 5,
2269
+ class: w(["tpl-section-wrapper tpl-email-surface", C(Oi)(pe.value)]),
2270
+ style: P(pe.value)
2271
+ }, [A("div", {
2272
+ class: w(["tpl-block-content tpl-email-surface", C(Oi)(fe.value)]),
2273
+ style: P(fe.value)
2274
+ }, [h(t.$slots, "default", {}, void 0, !0)], 6)], 6)) : (i(), b("div", {
2275
+ key: 6,
2276
+ class: w(["tpl-block-content tpl-email-surface", C(Oi)(fe.value)]),
2277
+ style: P(fe.value)
2278
+ }, [h(t.$slots, "default", {}, void 0, !0)], 6))
2279
+ ], 10, Ja));
2280
+ }
2281
+ }), [["__scopeId", "data-v-8c371dc9"]]);
2282
+ // src/utils/unwrapParagraph.ts
2283
+ function so(e) {
2284
+ let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
2285
+ return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
2286
+ }
2287
+ // src/components/blocks/TitleBlock.vue
2288
+ var co = /* @__PURE__ */ n({
2289
+ __name: "TitleBlock",
2290
+ props: {
2291
+ block: {},
2292
+ viewport: {}
2293
+ },
2294
+ setup(e) {
2295
+ let n = e, r = g(() => import("./TitleEditor-Bv3SmSO6.js")), a = En(pn, "TitleBlock"), { isEditing: o, blockRef: s, toolbarPosition: c, resolvedContent: l, handleDoubleClick: u, handleEditorDone: d } = Ca(() => n.block.content), f = N(() => {
2296
+ let e = {
2297
+ fontSize: `${Me[n.block.level]}px`,
2298
+ lineHeight: String(Ce),
2299
+ fontWeight: "700",
2300
+ textAlign: n.block.textAlign
2301
+ };
2302
+ return n.block.color && (e.color = n.block.color), n.block.fontFamily && (e.fontFamily = a.resolveFontFamily(n.block.fontFamily)), e;
2303
+ }), p = N(() => `h${n.block.level}`), m = N(() => so(l.value));
2304
+ return (n, a) => (i(), b("div", {
2305
+ ref_key: "blockRef",
2306
+ ref: s,
2307
+ class: "tpl:min-h-[1em] tpl:w-full",
2308
+ style: P(f.value),
2309
+ onDblclick: a[0] ||= (...e) => C(u) && C(u)(...e)
2310
+ }, [C(o) ? (i(), D(C(r), {
2311
+ key: 0,
2312
+ block: e.block,
2313
+ "toolbar-position": C(c),
2314
+ onDone: C(d)
2315
+ }, null, 8, [
2316
+ "block",
2317
+ "toolbar-position",
2318
+ "onDone"
2319
+ ])) : (i(), D(t(p.value), {
2320
+ key: 1,
2321
+ class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
2322
+ style: {
2323
+ color: "inherit",
2324
+ fontWeight: "inherit"
2325
+ },
2326
+ innerHTML: m.value
2327
+ }, null, 8, ["innerHTML"]))], 36));
2328
+ }
2329
+ }), lo = "hero", uo = "#1f2937", fo = "#ffffff";
2330
+ function po(e, t) {
2331
+ let n = oe("title", e);
2332
+ n.color = fo, n.textAlign = "center";
2333
+ let r = oe("paragraph", e);
2334
+ r.content = `<p style="text-align: center"><span style="color: ${fo}">${mo(t)}</span></p>`;
2335
+ let i = oe("button", e);
2336
+ return i.align = "center", le({
2337
+ columns: "1",
2338
+ children: [[
2339
+ n,
2340
+ r,
2341
+ i
2342
+ ]],
2343
+ hero: {
2344
+ height: "image",
2345
+ verticalAlign: "middle"
2346
+ },
2347
+ styles: {
2348
+ padding: {
2349
+ top: 48,
2350
+ right: 24,
2351
+ bottom: 48,
2352
+ left: 24
2353
+ },
2354
+ backgroundColor: uo
2355
+ }
2356
+ });
2357
+ }
2358
+ function mo(e) {
2359
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2360
+ }
2361
+ // src/utils/sectionColumnDrop.ts
2362
+ var ho = /* @__PURE__ */ new Set(["section", lo]);
2363
+ function go(e) {
2364
+ return e.dataset.blockType !== "section" && !ho.has(e.dataset.paletteType ?? "");
2365
+ }
2366
+ // src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
2367
+ var _o = { class: "tpl:relative tpl:w-full" }, vo = {
2368
+ key: 0,
2369
+ "data-testid": "hero-image-hint",
2370
+ class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-full tpl:mb-2 tpl:flex tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
2371
+ }, yo = {
2372
+ key: 0,
2373
+ "data-testid": "section-drop-hint",
2374
+ class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
2375
+ }, bo = /* @__PURE__ */ n({
2376
+ __name: "SectionBlock",
2377
+ props: {
2378
+ block: {},
2379
+ sourceBlock: {},
2380
+ viewport: {}
2381
+ },
2382
+ setup(n) {
2383
+ let r = {
2384
+ title: co,
2385
+ paragraph: Ta,
2386
+ image: va,
2387
+ button: Bi,
2388
+ divider: ea,
2389
+ custom: Qi
2390
+ }, o = n, { t: u } = Q(), d = En(Pn, "SectionBlock"), { displayBlock: p } = zn(d), m = N(() => o.sourceBlock ?? o.block), h = f(yn, N(() => /* @__PURE__ */ new Set()));
2391
+ s(yn, N(() => /* @__PURE__ */ new Set([...h.value, ...Object.entries(m.value.l10n ?? {}).filter(([, e]) => e.hidden).map(([e]) => e)])));
2392
+ let g = f(wn, null), _ = f(Cn, null), v = f(hn, {}), y = f(dn, null);
2393
+ function x(e) {
2394
+ let t = v.savedBlocks;
2395
+ t?.isPicking.value ? t.togglePick(o.block.id) : d.selectBlock(e);
2396
+ }
2397
+ let S = N(() => {
2398
+ switch (o.block.columns) {
2399
+ case "2": return ["50%", "50%"];
2400
+ case "3": return [
2401
+ "33.33%",
2402
+ "33.33%",
2403
+ "33.33%"
2404
+ ];
2405
+ case "1-2": return ["33.33%", "66.67%"];
2406
+ case "2-1": return ["66.67%", "33.33%"];
2407
+ default: return ["100%"];
2408
+ }
2409
+ }), T = N(() => {
2410
+ let e = S.value.length, t = [...(d.state.previewMode ? o.block : m.value).children];
2411
+ for (; t.length < e;) t.push([]);
2412
+ return t.slice(0, e);
2413
+ }), O = N(() => o.viewport === "mobile" && o.block.stackOnMobile !== !1);
2414
+ function k(e) {
2415
+ return T.value[e] || [];
2416
+ }
2417
+ function M(e) {
2418
+ return y?.value === !1 || !g?.isHidden(e);
2419
+ }
2420
+ function F(e) {
2421
+ return !k(e).some((e) => M(e.id));
2422
+ }
2423
+ let L = z(null);
2424
+ function H(e) {
2425
+ return d.state.previewMode ? !1 : F(e) ? !0 : L.value === e && k(e).filter((e) => M(e.id)).length <= 1;
2426
+ }
2427
+ let U = N(() => {
2428
+ if (d.state.previewMode) return !1;
2429
+ let e = Le(o.block);
2430
+ return e !== null && !e.applied && e.reason === "image";
2431
+ });
2432
+ function W(e) {
2433
+ return k(e).length === 0 && !d.state.previewMode;
2434
+ }
2435
+ function G(e) {
2436
+ return k(e).length === 0 && d.state.previewMode;
2437
+ }
2438
+ function ee(e, t) {
2439
+ Ea(d, t, o.block.id, e);
2440
+ }
2441
+ function K(e) {
2442
+ return wi(e, _, r);
2443
+ }
2444
+ function q(e, t) {
2445
+ e.type === "custom" && d.updateBlock(e.id, {
2446
+ fieldValues: t.fieldValues,
2447
+ dataSourceFetched: t.dataSourceFetched
2448
+ });
2449
+ }
2450
+ return (r, s) => (i(), b("div", _o, [U.value ? (i(), b("div", vo, [A("span", null, j(C(u).section.heroAddImage), 1)])) : E("", !0), A("div", { class: w(["tpl:flex tpl:gap-0", { "tpl:flex-col": O.value }]) }, [(i(!0), b(B, null, l(T.value, (r, f) => (i(), b("div", {
2451
+ key: f,
2452
+ class: w(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", W(f) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
2453
+ style: P({ width: O.value ? "100%" : S.value[f] })
2454
+ }, [V(C(R), {
2455
+ "model-value": k(f),
2456
+ group: {
2457
+ name: "blocks",
2458
+ pull: !0,
2459
+ put: (e, t, n) => C(go)(n)
2460
+ },
2461
+ animation: 150,
2462
+ "ghost-class": "tpl-ghost",
2463
+ "drag-class": "tpl-dragging",
2464
+ handle: ".tpl-block-btn",
2465
+ "invert-swap": !0,
2466
+ "inverted-swap-threshold": .65,
2467
+ "empty-insert-threshold": 20,
2468
+ "force-fallback": !0,
2469
+ class: w(["tpl:grow", {
2470
+ "tpl:min-h-[60px]": H(f),
2471
+ "tpl:min-h-[34px]": G(f)
2472
+ }]),
2473
+ onUpdate: (e) => C(Ea)(C(d), k(f), o.block.id, f, e),
2474
+ onStart: (e) => L.value = f,
2475
+ onEnd: s[0] ||= (e) => L.value = null,
2476
+ "onUpdate:modelValue": (e) => ee(f, e)
2477
+ }, {
2478
+ default: a(() => [(i(!0), b(B, null, l(k(f), (r) => c((i(), b("div", { key: r.id }, [V(oo, {
2479
+ block: r,
2480
+ "display-block": C(p)(r),
2481
+ "is-selected": C(d).state.selectedBlockId === r.id,
2482
+ viewport: n.viewport,
2483
+ "preview-mode": C(d).state.previewMode,
2484
+ nested: "",
2485
+ onSelect: (e) => x(r.id)
2486
+ }, {
2487
+ default: a(() => [(i(), D(t(K(r)), e({ block: C(p)(r) }, { ref_for: !0 }, r.type === "section" ? { sourceBlock: r } : {}, {
2488
+ viewport: n.viewport,
2489
+ onFetchData: (e) => q(r, e),
2490
+ onUpdate: (e) => C(d).updateBlock(r.id, e)
2491
+ }), null, 16, [
2492
+ "block",
2493
+ "viewport",
2494
+ "onFetchData",
2495
+ "onUpdate"
2496
+ ]))]),
2497
+ _: 2
2498
+ }, 1032, [
2499
+ "block",
2500
+ "display-block",
2501
+ "is-selected",
2502
+ "viewport",
2503
+ "preview-mode",
2504
+ "onSelect"
2505
+ ])])), [[I, M(r.id)]])), 128))]),
2506
+ _: 2
2507
+ }, 1032, [
2508
+ "model-value",
2509
+ "group",
2510
+ "class",
2511
+ "onUpdate",
2512
+ "onStart",
2513
+ "onUpdate:modelValue"
2514
+ ]), W(f) ? (i(), b("div", yo, [A("span", null, j(C(u).section.dropHere), 1)])) : E("", !0)], 6))), 128))], 2)]));
2515
+ }
2516
+ }), xo = ["width", "height"], So = [
2517
+ "d",
2518
+ "stroke",
2519
+ "stroke-opacity",
2520
+ "stroke-width"
2521
+ ], Co = ["d", "fill"], wo = /* @__PURE__ */ n({
2522
+ __name: "SocialIconSvg",
2523
+ props: {
2524
+ platform: {},
2525
+ iconStyle: {},
2526
+ iconTone: {},
2527
+ iconSize: {}
2528
+ },
2529
+ setup(e) {
2530
+ let t = e, n = N(() => ut[t.platform]), r = N(() => ft[t.iconSize]), a = N(() => Fe(t.platform, t.iconTone)), o = N(() => De(t.iconStyle, t.iconTone)), s = N(() => {
2531
+ let e = {
2532
+ display: "inline-flex",
2533
+ alignItems: "center",
2534
+ justifyContent: "center",
2535
+ width: `${r.value}px`,
2536
+ height: `${r.value}px`
2537
+ }, n = a.value.fill;
2538
+ switch (t.iconStyle) {
2539
+ case "solid": return {
2540
+ ...e,
2541
+ backgroundColor: n,
2542
+ borderRadius: "4px"
2543
+ };
2544
+ case "outlined": return {
2545
+ ...e,
2546
+ backgroundColor: "transparent",
2547
+ border: `2px solid ${n}`,
2548
+ borderRadius: "4px",
2549
+ ...o.value && { boxShadow: u(o.value) }
2550
+ };
2551
+ case "rounded": return {
2552
+ ...e,
2553
+ backgroundColor: n,
2554
+ borderRadius: "8px"
2555
+ };
2556
+ case "square": return {
2557
+ ...e,
2558
+ backgroundColor: n,
2559
+ borderRadius: "0"
2560
+ };
2561
+ case "circle": return {
2562
+ ...e,
2563
+ backgroundColor: n,
2564
+ borderRadius: "50%"
2565
+ };
2566
+ default: return e;
2567
+ }
2568
+ }), c = N(() => He(t.iconStyle)), l = N(() => Math.floor(r.value * c.value));
2569
+ function u(e) {
2570
+ let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
2571
+ return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
2572
+ }
2573
+ let d = N(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? a.value.fill : a.value.onFill);
2574
+ return (e, t) => (i(), b("span", { style: P(s.value) }, [(i(), b("svg", {
2575
+ width: l.value,
2576
+ height: l.value,
2577
+ viewBox: "0 0 24 24",
2578
+ overflow: "visible",
2579
+ xmlns: "http://www.w3.org/2000/svg"
2580
+ }, [o.value ? (i(), b("path", {
2581
+ key: 0,
2582
+ "data-testid": "social-icon-halo",
2583
+ d: n.value.path,
2584
+ fill: "none",
2585
+ stroke: o.value.color,
2586
+ "stroke-opacity": o.value.opacity,
2587
+ "stroke-width": o.value.width / c.value,
2588
+ "stroke-linejoin": "round"
2589
+ }, null, 8, So)) : E("", !0), A("path", {
2590
+ d: n.value.path,
2591
+ fill: d.value
2592
+ }, null, 8, Co)], 8, xo))], 4));
2593
+ }
2594
+ }), To = { class: "tpl:w-full" }, Eo = ["href"], Do = {
2595
+ key: 1,
2596
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
2597
+ }, Oo = /* @__PURE__ */ n({
2598
+ __name: "SocialIconsBlock",
2599
+ props: {
2600
+ block: {},
2601
+ viewport: {}
2602
+ },
2603
+ setup(e) {
2604
+ let t = e, { t: n } = Q(), r = N(() => ({
2605
+ display: "flex",
2606
+ flexWrap: "wrap",
2607
+ gap: `${t.block.spacing}px`,
2608
+ justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
2609
+ })), a = N(() => t.block.icons.length > 0);
2610
+ return (t, o) => (i(), b("div", To, [a.value ? (i(), b("div", {
2611
+ key: 0,
2612
+ style: P(r.value)
2613
+ }, [(i(!0), b(B, null, l(e.block.icons, (t) => (i(), b("a", {
2614
+ key: t.id,
2615
+ href: t.url || "#",
2616
+ class: "tpl:cursor-default",
2617
+ onClick: o[0] ||= k(() => {}, ["prevent"])
2618
+ }, [V(wo, {
2619
+ platform: t.platform,
2620
+ "icon-style": e.block.iconStyle,
2621
+ "icon-tone": e.block.iconTone,
2622
+ "icon-size": e.block.iconSize
2623
+ }, null, 8, [
2624
+ "platform",
2625
+ "icon-style",
2626
+ "icon-tone",
2627
+ "icon-size"
2628
+ ])], 8, Eo))), 128))], 4)) : (i(), b("div", Do, [V(C(Nt), { size: 16 }), A("span", null, j(C(n).social.addIcons), 1)]))]));
2629
+ }
2630
+ }), ko = { class: "tpl:w-full" }, Ao = {
2631
+ key: 0,
2632
+ class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
2633
+ style: {
2634
+ "background-color": "var(--tpl-bg-hover)",
2635
+ color: "var(--tpl-text-dim)"
2636
+ }
2637
+ }, jo = /* @__PURE__ */ n({
2638
+ __name: "SpacerBlock",
2639
+ props: {
2640
+ block: {},
2641
+ viewport: {}
2642
+ },
2643
+ setup(e) {
2644
+ let t = e, n = En(Pn, "SpacerBlock"), r = N(() => ({
2645
+ height: `${t.block.height}px`,
2646
+ minHeight: `${t.block.height}px`,
2647
+ ...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
2648
+ }));
2649
+ return (t, a) => (i(), b("div", ko, [A("div", {
2650
+ style: P(r.value),
2651
+ class: w(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !C(n).state.previewMode }])
2652
+ }, [C(n).state.previewMode ? E("", !0) : (i(), b("span", Ao, j(e.block.height) + "px ", 1))], 6)]));
2653
+ }
2654
+ }), Mo = { class: "tpl:w-full" }, No = { key: 0 }, Po = [
2655
+ "aria-label",
2656
+ "data-placeholder",
2657
+ "onBlur"
2658
+ ], Fo = [
2659
+ "aria-label",
2660
+ "data-placeholder",
2661
+ "onBlur"
2662
+ ], Io = {
2663
+ key: 1,
2664
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
2665
+ }, Lo = /*#__PURE__*/ yt(/* @__PURE__ */ n({
2666
+ __name: "TableBlock",
2667
+ props: {
2668
+ block: {},
2669
+ viewport: {}
2670
+ },
2671
+ setup(e) {
2672
+ let t = {
2673
+ mounted(e, t) {
2674
+ e.textContent = t.value ?? "";
2675
+ },
2676
+ updated(e, t) {
2677
+ t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
2678
+ }
2679
+ }, n = e, { t: r } = Q(), a = En(Pn, "TableBlock"), o = En(pn, "TableBlock"), s = N(() => n.block.rows.length > 0), u = N(() => {
2680
+ let e = {
2681
+ width: "100%",
2682
+ borderCollapse: "collapse",
2683
+ fontSize: `${n.block.fontSize}px`,
2684
+ textAlign: n.block.textAlign,
2685
+ fontFamily: n.block.fontFamily ? o.resolveFontFamily(n.block.fontFamily) : "inherit"
2686
+ };
2687
+ return n.block.color && (e.color = n.block.color), e;
2688
+ }), d = N(() => ({
2689
+ border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
2690
+ padding: `${n.block.cellPadding}px`,
2691
+ textAlign: n.block.textAlign
2692
+ })), f = N(() => ({
2693
+ ...d.value,
2694
+ fontWeight: "bold",
2695
+ backgroundColor: n.block.headerBackgroundColor || "transparent"
2696
+ })), p = N(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), m = N(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
2697
+ function h() {
2698
+ a.selectBlock(n.block.id);
2699
+ }
2700
+ function g(e, t, r) {
2701
+ let i = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
2702
+ ...n,
2703
+ cells: n.cells.map((e) => e.id === t ? {
2704
+ ...e,
2705
+ content: i
2706
+ } : e)
2707
+ } : n);
2708
+ a.updateBlock(n.block.id, { rows: o });
2709
+ }
2710
+ return (e, n) => (i(), b("div", Mo, [s.value ? (i(), b("table", {
2711
+ key: 0,
2712
+ style: P(u.value),
2713
+ class: "tpl-table-editable"
2714
+ }, [p.value ? (i(), b("thead", No, [A("tr", null, [(i(!0), b(B, null, l(p.value.cells, (e) => c((i(), b("th", {
2715
+ key: e.id,
2716
+ style: P(f.value),
2717
+ "aria-label": C(r).table.cellPlaceholder,
2718
+ contenteditable: "true",
2719
+ "data-placeholder": C(r).table.cellPlaceholder,
2720
+ onBlur: (t) => g(p.value.id, e.id, t),
2721
+ onKeydown: n[0] ||= S(k((e) => e.target.blur(), ["prevent"]), ["enter"]),
2722
+ onClick: k(h, ["stop"])
2723
+ }, null, 44, Po)), [[t, e.content]])), 128))])])) : E("", !0), A("tbody", null, [(i(!0), b(B, null, l(m.value, (e) => (i(), b("tr", { key: e.id }, [(i(!0), b(B, null, l(e.cells, (a) => c((i(), b("td", {
2724
+ key: a.id,
2725
+ style: P(d.value),
2726
+ "aria-label": C(r).table.cellPlaceholder,
2727
+ contenteditable: "true",
2728
+ "data-placeholder": C(r).table.cellPlaceholder,
2729
+ onBlur: (t) => g(e.id, a.id, t),
2730
+ onKeydown: n[1] ||= S(k((e) => e.target.blur(), ["prevent"]), ["enter"]),
2731
+ onClick: k(h, ["stop"])
2732
+ }, null, 44, Fo)), [[t, a.content]])), 128))]))), 128))])], 4)) : (i(), b("div", Io, [V(C(Lt), { size: 16 }), A("span", null, j(C(r).table.empty), 1)]))]));
2733
+ }
2734
+ }), [["__scopeId", "data-v-6751d456"]]), Ro = /* @__PURE__ */ n({
2735
+ __name: "VideoPlayButton",
2736
+ props: { hoverEffect: {
2737
+ type: Boolean,
2738
+ default: !1
2739
+ } },
2740
+ setup(e) {
2741
+ return (t, n) => (i(), b("div", { class: w(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [A("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[color-mix(in_srgb,var(--tpl-bg)_90%,transparent)] tpl:shadow-[var(--tpl-shadow-lg)]" }, [A("svg", {
2742
+ class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
2743
+ width: "28",
2744
+ height: "28",
2745
+ viewBox: "0 0 24 24",
2746
+ fill: "currentColor"
2747
+ }, [A("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
2748
+ }
2749
+ });
2750
+ // src/utils/videoThumbnail.ts
2751
+ function zo(e) {
2752
+ if (!e) return {
2753
+ platform: "unknown",
2754
+ videoId: null,
2755
+ thumbnailUrl: null
2756
+ };
2757
+ for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/i, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/i]) {
2758
+ let n = e.match(t);
2759
+ if (n) {
2760
+ let e = n[1];
2761
+ return {
2762
+ platform: "youtube",
2763
+ videoId: e,
2764
+ thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
2765
+ };
2766
+ }
2767
+ }
2768
+ let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
2769
+ if (t) {
2770
+ let e = t[1];
2771
+ return {
2772
+ platform: "vimeo",
2773
+ videoId: e,
2774
+ thumbnailUrl: `https://vumbnail.com/${e}.jpg`
2775
+ };
2776
+ }
2777
+ return {
2778
+ platform: "unknown",
2779
+ videoId: null,
2780
+ thumbnailUrl: null
2781
+ };
2782
+ }
2783
+ function Bo(e, t) {
2784
+ return t || zo(e).thumbnailUrl;
2785
+ }
2786
+ // src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
2787
+ var Vo = ["src", "alt"], Ho = {
2788
+ class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
2789
+ style: { opacity: "0.7" }
2790
+ }, Uo = ["href"], Wo = ["src", "alt"], Go = ["src", "alt"], Ko = {
2791
+ key: 3,
2792
+ class: "tpl:flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
2793
+ }, qo = /* @__PURE__ */ n({
2794
+ __name: "VideoBlock",
2795
+ props: {
2796
+ block: {},
2797
+ viewport: {}
2798
+ },
2799
+ setup(e) {
2800
+ let t = e, { t: n } = Q(), { syntax: r } = er(), a = N(() => Ve(t.block.url, r) || Ve(t.block.thumbnailUrl, r)), o = at(() => a.value ? void 0 : t.block.thumbnailUrl || void 0), s = at(() => a.value ? t.block.placeholderUrl : void 0), c = N(() => a.value ? null : t.block.thumbnailUrl ? o.value ?? null : Bo(t.block.url)), l = N(() => ({ textAlign: t.block.align })), u = N(() => {
2801
+ let e = t.block.align;
2802
+ return {
2803
+ maxWidth: "100%",
2804
+ width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
2805
+ height: t.block.height ? `${t.block.height}px` : void 0,
2806
+ display: "block",
2807
+ marginLeft: e === "center" || e === "right" ? "auto" : void 0,
2808
+ marginRight: e === "center" ? "auto" : void 0
2809
+ };
2810
+ }), d = N(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = N(() => Ve(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
2811
+ return (t, r) => (i(), b("div", {
2812
+ class: "tpl:w-full",
2813
+ style: P(l.value)
2814
+ }, [a.value && e.block.placeholderUrl ? (i(), b("div", {
2815
+ key: 0,
2816
+ class: "tpl:relative tpl:inline-block",
2817
+ style: P(u.value)
2818
+ }, [A("img", {
2819
+ class: "tpl:block tpl:w-full tpl:border-0",
2820
+ src: C(s),
2821
+ alt: e.block.alt,
2822
+ style: P(d.value)
2823
+ }, null, 12, Vo), V(Ro)], 4)) : a.value ? (i(), b("div", {
2824
+ key: 1,
2825
+ class: "tpl:relative tpl:!flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
2826
+ style: P([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
2827
+ }, [V(C(It), {
2828
+ size: 36,
2829
+ "stroke-width": 1.5,
2830
+ class: "tpl:text-[var(--tpl-primary)]",
2831
+ style: { opacity: "0.5" }
2832
+ }), A("span", Ho, [V(Ri, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (i(), b(B, { key: 2 }, [e.block.url ? (i(), b("a", {
2833
+ key: 0,
2834
+ href: e.block.url,
2835
+ target: "_blank",
2836
+ rel: "noopener noreferrer",
2837
+ class: "tpl:group tpl:relative tpl:inline-block",
2838
+ style: P(u.value),
2839
+ onClick: r[0] ||= k(() => {}, ["prevent"])
2840
+ }, [A("img", {
2841
+ class: "tpl:block tpl:w-full tpl:border-0",
2842
+ src: c.value,
2843
+ alt: e.block.alt,
2844
+ style: P(d.value)
2845
+ }, null, 12, Wo), V(Ro, { "hover-effect": "" })], 12, Uo)) : (i(), b("div", {
2846
+ key: 1,
2847
+ class: "tpl:relative tpl:inline-block",
2848
+ style: P(u.value)
2849
+ }, [A("img", {
2850
+ class: "tpl:block tpl:w-full tpl:border-0",
2851
+ src: c.value,
2852
+ alt: e.block.alt,
2853
+ style: P(d.value)
2854
+ }, null, 12, Go), V(Ro)], 4))], 64)) : (i(), b("div", Ko, [V(C(It), {
2855
+ size: 40,
2856
+ "stroke-width": 1.5,
2857
+ class: "tpl:text-[var(--tpl-border-light)]"
2858
+ }), A("span", null, j(C(n).video.addVideo), 1)]))], 4));
2859
+ }
2860
+ }), Jo = {
2861
+ section: bo,
2862
+ title: co,
2863
+ paragraph: Ta,
2864
+ image: va,
2865
+ button: Bi,
2866
+ divider: ea,
2867
+ video: qo,
2868
+ social: Oo,
2869
+ menu: Sa,
2870
+ table: Lo,
2871
+ spacer: jo,
2872
+ html: oa,
2873
+ countdown: g(() => import("./CountdownBlock-CjMhMhnv.js"))
2874
+ };
2875
+ function Yo(e) {
2876
+ let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: c } = Q(r), l = N(() => be(be(be($r(r), yi(t.content.value.settings?.locale)), Ue(t.content.value.settings) === "rtl" ? {
2877
+ title: { textAlign: "right" },
2878
+ table: { textAlign: "right" }
2879
+ } : {}), n.blockDefaults ?? {}));
2880
+ t.setUiTheme(n.uiTheme ?? "auto");
2881
+ let { resolvedTheme: u } = Wr(N(() => t.state.uiTheme)), d = z(n.theme ?? {}), { themeStyles: f } = Cr({
2882
+ themeOverrides: d,
2883
+ resolvedTheme: u,
2884
+ extraStyles: () => ({
2885
+ "--tpl-drop-text": `"${r.canvas.dropHere}"`,
2886
+ ...e.themeExtraStyles?.()
2887
+ })
2888
+ }), p = e.history ?? $e({
2889
+ content: t.content,
2890
+ setContent: (e, n) => t.setContent(e, n)
2891
+ });
2892
+ e.history || rt(t, p);
2893
+ let h = vt({
2894
+ addBlock: t.addBlock,
2895
+ removeBlock: t.removeBlock,
2896
+ updateBlock: t.updateBlock,
2897
+ selectBlock: t.selectBlock,
2898
+ findBlockLocation: t.findBlockLocation,
2899
+ blockDefaults: () => l.value
2900
+ }), g = nt(t), _ = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? it({
2901
+ content: t.content,
2902
+ isDirty: () => t.state.isDirty,
2903
+ ...e.autoSaveOptions
2904
+ }) : null, v = null;
2905
+ _ && (v = o(p.isNavigating, (e) => {
2906
+ e ? _.pause() : _.resume();
2907
+ }));
2908
+ let b = Ur(t, {
2909
+ t: a,
2910
+ format: c
2911
+ }, n.customBlocks ?? []), x = rr(n.colors);
2912
+ if (x.allowCustomIgnored && $.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), x.invalidPresets.length > 0 && $.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
2913
+ let e = Qr(x.presets, n.blockDefaults, n.templateDefaults);
2914
+ e.length > 0 && $.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
2915
+ }
2916
+ let S = cr(n.templateSettings);
2917
+ for (let e of S.unknown) $.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${lr.join(", ")}) — skipping it.`);
2918
+ let C = _r();
2919
+ Yr(C, Jo);
2920
+ let w = /* @__PURE__ */ new Set();
2921
+ function T(e) {
2922
+ for (let t of e) {
2923
+ C.registerCustom(t, Qi);
2924
+ for (let e of bi(t, x)) w.has(e.id) || (w.add(e.id), $.warn(e.message));
2925
+ }
2926
+ }
2927
+ n.customBlocks?.length && T(n.customBlocks);
2928
+ let E = Pr();
2929
+ if (y() && m(E.dispose), e.containerEl) {
2930
+ let t = e.containerEl;
2931
+ Yn(document, "pointerdown", (e) => {
2932
+ let n = t.value;
2933
+ n && (e.composedPath?.() ?? []).includes(n) && E.claim();
2934
+ }, { capture: !0 });
2935
+ }
2936
+ function D() {
2937
+ let t = e.capabilities?.templates;
2938
+ t ? t.save() : _?.flush();
2939
+ }
2940
+ function O(n) {
2941
+ E.isActive() && Si(n, {
2942
+ history: p,
2943
+ selectBlock: (e) => t.selectBlock(e),
2944
+ getSelectedBlockId: () => t.state.selectedBlockId,
2945
+ removeBlock: (e) => t.removeBlock(e),
2946
+ onSave: D,
2947
+ isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
2948
+ onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
2949
+ onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
2950
+ });
2951
+ }
2952
+ Yn(document, "keydown", O);
2953
+ let k = z(null), A = e.editorRoot ?? document;
2954
+ s(Ln, A), s(Yt, k), s(Ut, /* @__PURE__ */ new Map()), s(Mn, r), s(Pn, t), s(In, p), s(jn, h), s(wn, g), s(pn, i), s(gn, f), s(bn, u), s(mn, l), s(An, n.locale), s(Cn, C), s(vn, n.customBlocks ?? []), s(Gt, n.paletteBlocks), s(rn, Xr(n.htmlBlockPreview)), s(an, n.layout), s(ln, n.sectionWrapper), s(Dn, x), s(zt, S.fields), s(_n, Gr(t.content, C));
2955
+ let j = je(n.mergeTags?.syntax);
2956
+ for (let e of ["opener", "closer"]) {
2957
+ let t = j[e];
2958
+ typeof t == "string" && t.trim() === "" && $.warn(`config.mergeTags.syntax.${e} is blank — ignoring it.`);
2959
+ }
2960
+ typeof j.opener != "string" && typeof j.closer == "string" && j.closer.trim() !== "" && _e(j) === null && $.warn("config.mergeTags.syntax.closer has no effect without an opener — set opener to turn on autocomplete for this syntax.");
2961
+ let M = F(n.mergeTags?.tags ?? []);
2962
+ function P(e) {
2963
+ Array.isArray(e) ? M.value = e : $.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
2964
+ }
2965
+ s(en, M), s(Vt, j), s(cn, n.mergeTags?.onRequest ?? null), s(Wt, n.mergeTags?.autocomplete !== !1), s(Rn, n.mergeTags?.showRawValue !== !1);
2966
+ let I = z(ke(n.mergeTags?.tags ?? []));
2967
+ s(nn, I);
2968
+ let L = Lr({
2969
+ resolvePreview: n.resolvePreview,
2970
+ getContent: () => {
2971
+ let e = t.content.value;
2972
+ if (!t.state.previewMode) return e;
2973
+ let r = t.activeLocale?.value ?? e.settings.locale ?? "en", i = J(e, r);
2974
+ return n.layout ? ae(J(n.layout, r, { missing: "default" }), i) : i;
2975
+ },
2976
+ isActive: () => t.state.previewMode,
2977
+ getLocale: () => t.activeLocale?.value ?? t.content.value.settings.locale
2978
+ });
2979
+ s(On, L), s(Jt, n.resolvePreview);
2980
+ let R = N(() => !(t.state.previewMode && L.isConfigured));
2981
+ s(dn, R);
2982
+ let B = Rr();
2983
+ s(qt, B), s(Xt, z(!1)), s(Qt, z(!1)), s(xn, n.logicTags?.tags ?? []), s(Bt, n.logicTags?.pairs ?? []), s(Kt, n.logicTags?.onRequest ?? null), s(Zt, zr()), s(on, n.onRequestMedia ?? null), s(Nn, n.canDropMedia ?? null), s(Ht, n.resolveImageUrl ? gt(n.resolveImageUrl) : null), s(un, n.displayConditions?.conditions ?? []), s(kn, n.displayConditions?.allowCustom ?? !1), s(hn, e.capabilities ?? {}), s(Fn, b);
2984
+ let V = Br(n.lint) ? null : Hr({
2985
+ content: t.content,
2986
+ get options() {
2987
+ return Fr({
2988
+ ...n,
2989
+ content: t.content.value,
2990
+ contentLocale: t.activeLocale?.value ?? void 0
2991
+ });
2992
+ },
2993
+ customBlocks: n.customBlocks,
2994
+ mergeTagSyntax: j,
2995
+ updateBlock: t.updateBlock,
2996
+ updateSettings: t.updateSettings,
2997
+ removeBlock: t.removeBlock
2998
+ });
2999
+ s(tn, V);
3000
+ function H() {
3001
+ v?.(), V?.destroy(), _?.destroy(), p.destroy();
3002
+ }
3003
+ return {
3004
+ t: a,
3005
+ format: c,
3006
+ editorRoot: A,
3007
+ history: p,
3008
+ blockActions: h,
3009
+ conditionPreview: g,
3010
+ autoSave: _,
3011
+ resolvedTheme: u,
3012
+ themeStyles: f,
3013
+ themeOverrides: d,
3014
+ registry: C,
3015
+ keyboardReorder: b,
3016
+ templateLint: V,
3017
+ popoverRoot: k,
3018
+ mergeTagSampleMode: I,
3019
+ previewResolution: L,
3020
+ appliesConditionFilter: R,
3021
+ registerCustomBlocks: T,
3022
+ setMergeTags: P,
3023
+ mergeTags: M,
3024
+ mergeTagSyntax: j,
3025
+ destroy: H
3026
+ };
3027
+ }
3028
+ // src/composables/useSmallScreenNotice.ts
3029
+ var Xo = "(max-width: 767px)";
3030
+ function Zo(e) {
3031
+ let t = Xn(Xo);
3032
+ return {
3033
+ isSmallScreen: t,
3034
+ showNotice: N(() => (M(e) ?? !0) && t.value)
3035
+ };
3036
+ }
3037
+ export { pi as A, hr as B, Ni as C, si as D, wi as E, Fr as F, Ar as I, Or as L, di as M, ui as N, hi as O, Lr as P, xr as R, Mi as S, Ii as T, ea as _, jo as a, Bi as b, lo as c, oo as d, Ea as f, oa as g, va as h, Lo as i, fi as j, mi as k, po as l, Sa as m, Yo as n, Oo as o, Ta as p, qo as r, bo as s, Zo as t, co as u, Qi as v, Ci as w, Oi as x, Ui as y, gr as z };
3038
+
3039
+ //# sourceMappingURL=composables-D0UYam2P.js.map