@templatical/editor 0.48.0 → 0.49.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 (308) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiChatSidebar-DxPHFNoT.js → AiChatSidebar-CdjTb9ej.js} +14 -14
  3. package/dist/{AiFeatureMenu-C8GVqu1d.js → AiFeatureMenu-DKm7VYCs.js} +7 -7
  4. package/dist/{BlockIssueBadge-BShkuJis.js → BlockIssueBadge-BdpJwim0.js} +5 -5
  5. package/dist/{BlockPreviewCanvas-tzAtDkXH.js → BlockPreviewCanvas-D_sowkf0.js} +8 -8
  6. package/dist/CloudHeaderExtras-CI8RR9hG.js +55 -0
  7. package/dist/{CloudPanels-Dgw7tb4R.js → CloudPanels-1hwFiJ0G.js} +39 -68
  8. package/dist/CollaborationNotices-BWpKzueF.js +73 -0
  9. package/dist/CollaboratorBar-D87phJsw.js +123 -0
  10. package/dist/{CommentsPanel-DiWzYtnZ.js → CommentsPanel-BUvUzO3T.js} +2 -2
  11. package/dist/{CommentsSidebar-BOqj16Al.js → CommentsSidebar-J65znlrH.js} +14 -14
  12. package/dist/{CountdownBlock-zx39Dyby.js → CountdownBlock-DPQXWRvU.js} +4 -4
  13. package/dist/{CountdownToolbar-C4y3Ft7H.js → CountdownToolbar-CLMIwfK7.js} +7 -7
  14. package/dist/{DesignReferenceSidebar-BWAi3eQQ.js → DesignReferenceSidebar-BTwCFgz8.js} +13 -13
  15. package/dist/{IssuesPanel-C-x3I012.js → IssuesPanel-DeeVsfG7.js} +8 -8
  16. package/dist/{LoadingTrack-6XsqodoY.js → LoadingTrack-BXOptf5g.js} +1 -1
  17. package/dist/{LogicTagInsertButton-B1_Wy0AN.js → LogicTagInsertButton-CR5E4jSG.js} +17 -17
  18. package/dist/{MediaEditModal-ByOvznRC.js → MediaEditModal-C_wxoUMG.js} +3 -3
  19. package/dist/{MediaPanels-9mDBv4aL.js → MediaPanels-BVXDkqtH.js} +2 -2
  20. package/dist/{MergeTagInput-fOewuF27.js → MergeTagInput-BEw_r0PJ.js} +3 -3
  21. package/dist/{MergeTagModeToggle-BXamLcv7.js → MergeTagModeToggle-CJTpFmVd.js} +7 -7
  22. package/dist/{ParagraphEditor-BVjOwwHx.js → ParagraphEditor-zLV44z-R.js} +19 -19
  23. package/dist/{RestoreVersionDialog-BEKXx9xk.js → RestoreVersionDialog-BaDpy3cL.js} +6 -6
  24. package/dist/{RichTextEditorContent-D7kp7iig.js → RichTextEditorContent-CsvniFlI.js} +9 -9
  25. package/dist/{SaveBlockDialog-SJu0lecx.js → SaveBlockDialog-DzWURF_e.js} +12 -12
  26. package/dist/{SavedBlocksBrowserModal-DbmIS5uK.js → SavedBlocksBrowserModal-B8DCFW7t.js} +14 -14
  27. package/dist/{SavedBlocksPanels-Dr5Fxx9Z.js → SavedBlocksPanels-B3Af8ns2.js} +2 -2
  28. package/dist/{SavedBlocksPickBar-DnEWBZJy.js → SavedBlocksPickBar-Dj11-Lqp.js} +5 -5
  29. package/dist/{TemplateScoringPanel-ynbGl-sr.js → TemplateScoringPanel-Ba9sgvjS.js} +16 -16
  30. package/dist/{TemplateSettings-Bi01S3H3.js → TemplateSettings-Cu5X9DgA.js} +11 -11
  31. package/dist/{TestEmailModal-CbRY8HQx.js → TestEmailModal-BeRYV3eg.js} +14 -14
  32. package/dist/{TestEmailPanel-NAOmt3xi.js → TestEmailPanel-B8c3fQi2.js} +2 -2
  33. package/dist/{TitleEditor-Cc3DHbuN.js → TitleEditor-CvpNUoAp.js} +11 -11
  34. package/dist/{ToggleSwitch-Ozc7YU38.js → ToggleSwitch-DHweVJOr.js} +2 -2
  35. package/dist/{Toolbar-B-2lO0I8.js → Toolbar-BadDSkkF.js} +426 -429
  36. package/dist/{TplModal-Bz4-IZ9R.js → TplModal-BZgi9Tes.js} +5 -5
  37. package/dist/{VersionHistoryMenu-CjV1d1zk.js → VersionHistoryMenu-BRlcQ8wX.js} +10 -10
  38. package/dist/{VersionHistoryPanels-BtwxrKJn.js → VersionHistoryPanels-DGkllN3a.js} +2 -2
  39. package/dist/{VersionPreviewBanner-BLAei1kj.js → VersionPreviewBanner-F-811aps.js} +4 -4
  40. package/dist/{WrapperBlock-D0qgNqjD.js → WrapperBlock-DiiaxpMb.js} +5 -5
  41. package/dist/{blockTypeIcons-CEDZytqP.js → blockTypeIcons-CayLluou.js} +2 -2
  42. package/dist/bundle-stats.json +7 -7
  43. package/dist/{ca-CbNzJM3I.js → ca-DSJwJ5ov.js} +23 -1
  44. package/dist/cdn/chunks/{AiChatSidebar-Dk0rJBQN.js → AiChatSidebar-yXJ85Zcg.js} +8 -8
  45. package/dist/cdn/chunks/{AiChatSidebar-Dk0rJBQN.js.map → AiChatSidebar-yXJ85Zcg.js.map} +1 -1
  46. package/dist/cdn/chunks/{AiFeatureMenu-B7b0w8ZS.js → AiFeatureMenu-4ydjrhsQ.js} +6 -6
  47. package/dist/cdn/chunks/{AiFeatureMenu-B7b0w8ZS.js.map → AiFeatureMenu-4ydjrhsQ.js.map} +1 -1
  48. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js → BlockIssueBadge-D1VBS_6x.js} +5 -5
  49. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js.map → BlockIssueBadge-D1VBS_6x.js.map} +1 -1
  50. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js → BlockPreviewCanvas-m2tWRyWv.js} +8 -8
  51. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js.map → BlockPreviewCanvas-m2tWRyWv.js.map} +1 -1
  52. package/dist/cdn/chunks/{CloudHeaderExtras-B4fhuwc_.js → CloudHeaderExtras-DEkRww7n.js} +16 -20
  53. package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js.map +1 -0
  54. package/dist/cdn/chunks/{CloudPanels-awqHfJqC.js → CloudPanels-XufhBZYF.js} +38 -67
  55. package/dist/cdn/chunks/CloudPanels-XufhBZYF.js.map +1 -0
  56. package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js +75 -0
  57. package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js.map +1 -0
  58. package/dist/cdn/chunks/CollaboratorBar-DWW54Bn_.js +72 -0
  59. package/dist/cdn/chunks/CollaboratorBar-DWW54Bn_.js.map +1 -0
  60. package/dist/cdn/chunks/{CommentsPanel-CbzxwsyI.js → CommentsPanel-R8YLLO3v.js} +3 -3
  61. package/dist/cdn/chunks/{CommentsPanel-CbzxwsyI.js.map → CommentsPanel-R8YLLO3v.js.map} +1 -1
  62. package/dist/cdn/chunks/{CommentsSidebar-DWPHZuQm.js → CommentsSidebar-96NZHVq3.js} +5 -5
  63. package/dist/cdn/chunks/{CommentsSidebar-DWPHZuQm.js.map → CommentsSidebar-96NZHVq3.js.map} +1 -1
  64. package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js → CountdownBlock-DB4JNdqh.js} +5 -5
  65. package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js.map → CountdownBlock-DB4JNdqh.js.map} +1 -1
  66. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js → CountdownToolbar-tmiTPEXm.js} +8 -8
  67. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js.map → CountdownToolbar-tmiTPEXm.js.map} +1 -1
  68. package/dist/cdn/chunks/{DesignReferenceSidebar-BW9cHnA9.js → DesignReferenceSidebar-D14IIu_P.js} +39 -39
  69. package/dist/cdn/chunks/{DesignReferenceSidebar-BW9cHnA9.js.map → DesignReferenceSidebar-D14IIu_P.js.map} +1 -1
  70. package/dist/cdn/chunks/{IssuesPanel-cXf9ywA4.js → IssuesPanel-BoPiCLGc.js} +8 -8
  71. package/dist/cdn/chunks/{IssuesPanel-cXf9ywA4.js.map → IssuesPanel-BoPiCLGc.js.map} +1 -1
  72. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js → LoadingTrack-YU44CM8X.js} +2 -2
  73. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js.map → LoadingTrack-YU44CM8X.js.map} +1 -1
  74. package/dist/cdn/chunks/{LogicTagInsertButton-BMB9vShs.js → LogicTagInsertButton-BJ2t2vxC.js} +20 -20
  75. package/dist/cdn/chunks/{LogicTagInsertButton-BMB9vShs.js.map → LogicTagInsertButton-BJ2t2vxC.js.map} +1 -1
  76. package/dist/cdn/chunks/{MediaEditModal-zXfcArr4.js → MediaEditModal-DD0SZ-S3.js} +3 -3
  77. package/dist/cdn/chunks/{MediaEditModal-zXfcArr4.js.map → MediaEditModal-DD0SZ-S3.js.map} +1 -1
  78. package/dist/cdn/chunks/{MediaPanels-Cp4XB_dH.js → MediaPanels-CkdJ_kGp.js} +3 -3
  79. package/dist/cdn/chunks/{MediaPanels-Cp4XB_dH.js.map → MediaPanels-CkdJ_kGp.js.map} +1 -1
  80. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js → MergeTagInput-7wXX71DH.js} +4 -4
  81. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js.map → MergeTagInput-7wXX71DH.js.map} +1 -1
  82. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js → MergeTagModeToggle-r9vHH4u_.js} +6 -6
  83. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js.map → MergeTagModeToggle-r9vHH4u_.js.map} +1 -1
  84. package/dist/cdn/chunks/{ParagraphEditor-D4aq9eeC.js → ParagraphEditor-CJQjRHXV.js} +29 -29
  85. package/dist/cdn/chunks/{ParagraphEditor-D4aq9eeC.js.map → ParagraphEditor-CJQjRHXV.js.map} +1 -1
  86. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js → RestoreVersionDialog-C5cxBRKi.js} +6 -6
  87. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js.map → RestoreVersionDialog-C5cxBRKi.js.map} +1 -1
  88. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js → RichTextEditorContent-BfE7Bkge.js} +8 -8
  89. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js.map → RichTextEditorContent-BfE7Bkge.js.map} +1 -1
  90. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js → SaveBlockDialog-BKbjUnPM.js} +10 -10
  91. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js.map → SaveBlockDialog-BKbjUnPM.js.map} +1 -1
  92. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CtnB58p_.js → SavedBlocksBrowserModal-BMtyUrUP.js} +10 -10
  93. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CtnB58p_.js.map → SavedBlocksBrowserModal-BMtyUrUP.js.map} +1 -1
  94. package/dist/cdn/chunks/{SavedBlocksPanels-BhEOMzEQ.js → SavedBlocksPanels-s_gxi1im.js} +3 -3
  95. package/dist/cdn/chunks/{SavedBlocksPanels-BhEOMzEQ.js.map → SavedBlocksPanels-s_gxi1im.js.map} +1 -1
  96. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js → SavedBlocksPickBar-B8WHk5mI.js} +6 -6
  97. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js.map → SavedBlocksPickBar-B8WHk5mI.js.map} +1 -1
  98. package/dist/cdn/chunks/{TemplateScoringPanel-BrWqJCSP.js → TemplateScoringPanel-BBPnHILC.js} +6 -6
  99. package/dist/cdn/chunks/{TemplateScoringPanel-BrWqJCSP.js.map → TemplateScoringPanel-BBPnHILC.js.map} +1 -1
  100. package/dist/cdn/chunks/{TemplateSettings-BkkWTDHD.js → TemplateSettings-CtrzzQWl.js} +10 -10
  101. package/dist/cdn/chunks/{TemplateSettings-BkkWTDHD.js.map → TemplateSettings-CtrzzQWl.js.map} +1 -1
  102. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js → TestEmailModal-DuZKYMWD.js} +13 -13
  103. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js.map → TestEmailModal-DuZKYMWD.js.map} +1 -1
  104. package/dist/cdn/chunks/{TestEmailPanel-DxrKuctP.js → TestEmailPanel-DERaCdpG.js} +3 -3
  105. package/dist/cdn/chunks/{TestEmailPanel-DxrKuctP.js.map → TestEmailPanel-DERaCdpG.js.map} +1 -1
  106. package/dist/cdn/chunks/{TitleEditor-CsZiG3TT.js → TitleEditor-CEgxjtUX.js} +14 -14
  107. package/dist/cdn/chunks/{TitleEditor-CsZiG3TT.js.map → TitleEditor-CEgxjtUX.js.map} +1 -1
  108. package/dist/cdn/chunks/{ToggleSwitch-BB-bQADJ.js → ToggleSwitch-DGQ7iRc-.js} +3 -3
  109. package/dist/cdn/chunks/{ToggleSwitch-BB-bQADJ.js.map → ToggleSwitch-DGQ7iRc-.js.map} +1 -1
  110. package/dist/cdn/chunks/{Toolbar-C_x2TfFk.js → Toolbar-GFIZQHzw.js} +440 -443
  111. package/dist/cdn/chunks/Toolbar-GFIZQHzw.js.map +1 -0
  112. package/dist/cdn/chunks/{TplModal-DC_eodTV.js → TplModal-DDrbWJcE.js} +5 -5
  113. package/dist/cdn/chunks/{TplModal-DC_eodTV.js.map → TplModal-DDrbWJcE.js.map} +1 -1
  114. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js → VersionHistoryMenu-MlxsUmuT.js} +6 -6
  115. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js.map → VersionHistoryMenu-MlxsUmuT.js.map} +1 -1
  116. package/dist/cdn/chunks/{VersionHistoryPanels-DXSqmaLS.js → VersionHistoryPanels-DVOV8QLv.js} +3 -3
  117. package/dist/cdn/chunks/{VersionHistoryPanels-DXSqmaLS.js.map → VersionHistoryPanels-DVOV8QLv.js.map} +1 -1
  118. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js → VersionPreviewBanner-BQwRKc6S.js} +5 -5
  119. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js.map → VersionPreviewBanner-BQwRKc6S.js.map} +1 -1
  120. package/dist/cdn/chunks/{WrapperBlock-gG_Bleug.js → WrapperBlock-CFuP4R0c.js} +6 -6
  121. package/dist/cdn/chunks/{WrapperBlock-gG_Bleug.js.map → WrapperBlock-CFuP4R0c.js.map} +1 -1
  122. package/dist/cdn/chunks/{blockTypeIcons-HrMJDfVg.js → blockTypeIcons-BnAd8qsP.js} +2 -2
  123. package/dist/cdn/chunks/{blockTypeIcons-HrMJDfVg.js.map → blockTypeIcons-BnAd8qsP.js.map} +1 -1
  124. package/dist/cdn/chunks/{ca-CbNzJM3I.js → ca-DSJwJ5ov.js} +24 -2
  125. package/dist/cdn/chunks/ca-DSJwJ5ov.js.map +1 -0
  126. package/dist/{cloud-B5xwm_4X.js → cdn/chunks/cloud-CI_fgDyy.js} +116 -293
  127. package/dist/cdn/chunks/cloud-CI_fgDyy.js.map +1 -0
  128. package/dist/cdn/chunks/{createCloudRuntime-Vd0N4elZ.js → createCloudRuntime-DiYCJ21w.js} +127 -169
  129. package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js.map +1 -0
  130. package/dist/{de-DMquBpZM.js → cdn/chunks/de-CBE6O79z.js} +25 -1
  131. package/dist/cdn/chunks/de-CBE6O79z.js.map +1 -0
  132. package/dist/{de-mMY5yQJu.js → cdn/chunks/de-D_atmUVB.js} +2 -4
  133. package/dist/cdn/chunks/{de-mMY5yQJu.js.map → de-D_atmUVB.js.map} +1 -1
  134. package/dist/cdn/chunks/{dist-MNQYSEWU.js → dist-DdwjXLme.js} +3 -3
  135. package/dist/cdn/chunks/{dist-MNQYSEWU.js.map → dist-DdwjXLme.js.map} +1 -1
  136. package/dist/cdn/chunks/{dist-CjL6JHML.js → dist-Doy3r07H.js} +2 -2
  137. package/dist/cdn/chunks/{dist-CjL6JHML.js.map → dist-Doy3r07H.js.map} +1 -1
  138. package/dist/cdn/chunks/{draggable-DrsNwZuB.js → draggable-akeQH_JP.js} +1682 -1683
  139. package/dist/cdn/chunks/draggable-akeQH_JP.js.map +1 -0
  140. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js → editor-modal-HJBy9kLj.js} +88 -88
  141. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js.map → editor-modal-HJBy9kLj.js.map} +1 -1
  142. package/dist/cdn/chunks/{en-C8Mp71sO.js → en-CDexnk0p.js} +24 -2
  143. package/dist/cdn/chunks/en-CDexnk0p.js.map +1 -0
  144. package/dist/{en-ChVeGQBY.js → cdn/chunks/en-DhJLnaBx.js} +2 -4
  145. package/dist/cdn/chunks/en-DhJLnaBx.js.map +1 -0
  146. package/dist/cdn/chunks/en-Ve-PWSXu.js +1 -0
  147. package/dist/{es-Byq4tthI.js → cdn/chunks/es-BE42B6uN.js} +25 -1
  148. package/dist/cdn/chunks/es-BE42B6uN.js.map +1 -0
  149. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js → extensions-koOuDeZS.js} +23 -23
  150. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js.map → extensions-koOuDeZS.js.map} +1 -1
  151. package/dist/{fr-B3j35HEw.js → cdn/chunks/fr-DlJFPDQR.js} +25 -1
  152. package/dist/cdn/chunks/fr-DlJFPDQR.js.map +1 -0
  153. package/dist/cdn/chunks/{icons-aTYwH5-g.js → icons-CjlNV8xD.js} +46 -46
  154. package/dist/cdn/chunks/{icons-aTYwH5-g.js.map → icons-CjlNV8xD.js.map} +1 -1
  155. package/dist/{ja-D7txAuGS.js → cdn/chunks/ja-CUT8gkNI.js} +25 -1
  156. package/dist/cdn/chunks/ja-CUT8gkNI.js.map +1 -0
  157. package/dist/cdn/chunks/{keys-HI-INbkz.js → keys-UAWhQ3zW.js} +2 -2
  158. package/dist/cdn/chunks/{keys-HI-INbkz.js.map → keys-UAWhQ3zW.js.map} +1 -1
  159. package/dist/{nl-ClJ3BY3F.js → cdn/chunks/nl-bXWqqRyS.js} +25 -1
  160. package/dist/cdn/chunks/nl-bXWqqRyS.js.map +1 -0
  161. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js → preRenderCustomBlocks-DqKbdTJ8.js} +5 -5
  162. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js.map → preRenderCustomBlocks-DqKbdTJ8.js.map} +1 -1
  163. package/dist/cdn/chunks/{pt-BR-DibcXcmv.js → pt-BR-2_H4-wlb.js} +24 -2
  164. package/dist/cdn/chunks/pt-BR-2_H4-wlb.js.map +1 -0
  165. package/dist/{pt-BR-CoCwRUi0.js → cdn/chunks/pt-BR-BphMoUTw.js} +2 -4
  166. package/dist/cdn/chunks/{pt-BR-CoCwRUi0.js.map → pt-BR-BphMoUTw.js.map} +1 -1
  167. package/dist/cdn/chunks/{pusher-C8DeiO2X.js → pusher-Cs4GGEtd.js} +2 -2
  168. package/dist/cdn/chunks/pusher-Cs4GGEtd.js.map +1 -0
  169. package/dist/cdn/chunks/{rolldown-runtime-B0aSnxlc.js → rolldown-runtime-Y_bBpyJl.js} +1 -1
  170. package/dist/cdn/chunks/socialIcons-CkZSYpoG.js +2091 -0
  171. package/dist/cdn/chunks/socialIcons-CkZSYpoG.js.map +1 -0
  172. package/dist/cdn/chunks/{src-DlFlC9Tt.js → src-B1e5SSYP.js} +84 -84
  173. package/dist/cdn/chunks/{src-DlFlC9Tt.js.map → src-B1e5SSYP.js.map} +1 -1
  174. package/dist/cdn/chunks/{src-dZ4D_tuP.js → src-B77z1iw4.js} +117 -117
  175. package/dist/cdn/chunks/src-B77z1iw4.js.map +1 -0
  176. package/dist/cdn/chunks/{src-DYCDeBDM.js → src-CvLTYGdO.js} +549 -315
  177. package/dist/cdn/chunks/src-CvLTYGdO.js.map +1 -0
  178. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +2 -4
  179. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js.map → styleConstants-v1dNKgJf.js.map} +1 -1
  180. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js +6 -0
  181. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js.map +1 -0
  182. package/dist/cdn/chunks/{tiptap-BPigZk5G.js → tiptap-B1RfWFzB.js} +3 -3
  183. package/dist/cdn/chunks/tiptap-B1RfWFzB.js.map +1 -0
  184. package/dist/cdn/chunks/{useAliveFlag-DCB96vzR.js → useAliveFlag-PuXh83UK.js} +2 -2
  185. package/dist/cdn/chunks/{useAliveFlag-DCB96vzR.js.map → useAliveFlag-PuXh83UK.js.map} +1 -1
  186. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js → useCloudI18n-kp07GQmk.js} +3 -3
  187. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js.map → useCloudI18n-kp07GQmk.js.map} +1 -1
  188. package/dist/cdn/chunks/{useEditorCore-Bb2UcB20.js → useEditorCore-DpCFvHg_.js} +440 -419
  189. package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js.map +1 -0
  190. package/dist/cdn/chunks/useEditorRoot-5SBqm90x.js +10 -0
  191. package/dist/cdn/chunks/{useEditorRoot-CTc6O8al.js.map → useEditorRoot-5SBqm90x.js.map} +1 -1
  192. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js → useI18n-DEqtEgOs.js} +3 -3
  193. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js.map → useI18n-DEqtEgOs.js.map} +1 -1
  194. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js → useLogicTag-X8bc5qNl.js} +4 -4
  195. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js.map → useLogicTag-X8bc5qNl.js.map} +1 -1
  196. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js → useMergeTag-DFoOexIQ.js} +6 -6
  197. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js.map → useMergeTag-DFoOexIQ.js.map} +1 -1
  198. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js → usePopoverPosition-Cz9-XiXR.js} +3 -3
  199. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js.map → usePopoverPosition-Cz9-XiXR.js.map} +1 -1
  200. package/dist/cdn/chunks/{useScrollToBlock-uUa601I4.js → useScrollToBlock-MNzurEZV.js} +3 -3
  201. package/dist/cdn/chunks/{useScrollToBlock-uUa601I4.js.map → useScrollToBlock-MNzurEZV.js.map} +1 -1
  202. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js → withCurrentFont-D-f61ghC.js} +2 -2
  203. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js.map → withCurrentFont-D-f61ghC.js.map} +1 -1
  204. package/dist/cdn/editor.css +1 -1
  205. package/dist/cdn/editor.js +1319 -1066
  206. package/dist/cdn/editor.js.map +1 -1
  207. package/dist/{check-ClwqRMgv.js → check-DQQzkmIC.js} +1 -1
  208. package/dist/{chevron-down-te6qn-zE.js → chevron-down-CIF4bdon.js} +1 -1
  209. package/dist/{chevron-right-W2hbH1FM.js → chevron-right-Cg7Xu-ev.js} +1 -1
  210. package/dist/{chevron-up-Bf5Zo7o4.js → chevron-up-Csu7ISD-.js} +1 -1
  211. package/dist/{circle-alert-CIEGV5DN.js → circle-alert-YUvIJAgY.js} +1 -1
  212. package/dist/{clock-Y4cx0gkJ.js → clock-CnSIGKQW.js} +1 -1
  213. package/dist/{cdn/chunks/cloud-BHClP3e2.js → cloud-YUYDtdHt.js} +308 -569
  214. package/dist/{copy-BEcsAlfB.js → copy-CUC43md_.js} +1 -1
  215. package/dist/{createCloudRuntime-zNPkF6T9.js → createCloudRuntime-BMDRjL0k.js} +126 -168
  216. package/dist/{createLucideIcon-CYHXK9hn.js → createLucideIcon-BcP1sjdp.js} +6 -6
  217. package/dist/{cdn/chunks/de-DMquBpZM.js → de-CBE6O79z.js} +23 -3
  218. package/dist/{cdn/chunks/de-mMY5yQJu.js → de-D_atmUVB.js} +0 -6
  219. package/dist/{dist-CUWI-IvA.js → dist-Bv_GBr2l.js} +1 -1
  220. package/dist/{dist-DAAJogrx.js → dist-CCqn-RqE.js} +2 -2
  221. package/dist/{dist-DuufrR8O.js → dist-CNqjHA8e.js} +2 -2
  222. package/dist/{dist-tsmnQugO.js → dist-DBG3nh3k.js} +503 -273
  223. package/dist/{editor-modal-AlVLkU91.js → editor-modal--7_9A6j-.js} +20 -20
  224. package/dist/en-BHCMzqib.js +1 -0
  225. package/dist/{en-C8Mp71sO.js → en-CDexnk0p.js} +23 -1
  226. package/dist/{cdn/chunks/en-ChVeGQBY.js → en-DhJLnaBx.js} +0 -6
  227. package/dist/{cdn/chunks/es-Byq4tthI.js → es-BE42B6uN.js} +23 -3
  228. package/dist/{extensions-pjO8VGkM.js → extensions-zwsZlWjH.js} +23 -23
  229. package/dist/{eye-Ddnz8nnm.js → eye-B1bua-ck.js} +1 -1
  230. package/dist/{cdn/chunks/fr-B3j35HEw.js → fr-DlJFPDQR.js} +23 -3
  231. package/dist/{image-up-CM_HC0Dx.js → image-up-BqiO7KCO.js} +1 -1
  232. package/dist/index.d.ts +290 -35
  233. package/dist/{info-DXLmzoeY.js → info-x26nGOo2.js} +1 -1
  234. package/dist/{cdn/chunks/ja-D7txAuGS.js → ja-CUT8gkNI.js} +23 -3
  235. package/dist/{keys-BKFq19a2.js → keys-BymCnLHD.js} +1 -1
  236. package/dist/{link-Cel46wgo.js → link-CezhndyR.js} +1 -1
  237. package/dist/{list-Cl0GwiV9.js → list-DQqdptI0.js} +1 -1
  238. package/dist/{loader-circle-uAwpvfys.js → loader-circle-DCEeoYoi.js} +1 -1
  239. package/dist/{message-circle-DWU1pTM_.js → message-circle-BLGzfv_7.js} +1 -1
  240. package/dist/{cdn/chunks/nl-ClJ3BY3F.js → nl-bXWqqRyS.js} +23 -3
  241. package/dist/{package-CbyG_yU_.js → package-D_kEQCMU.js} +1 -1
  242. package/dist/{pencil-BzoDcwKu.js → pencil-Dct8zGLy.js} +1 -1
  243. package/dist/{plus-8cDvoCjZ.js → plus-BDd0gTEm.js} +1 -1
  244. package/dist/{preRenderCustomBlocks-DMP5RuHl.js → preRenderCustomBlocks-CtKJecE-.js} +3 -3
  245. package/dist/{pt-BR-DibcXcmv.js → pt-BR-2_H4-wlb.js} +23 -1
  246. package/dist/{cdn/chunks/pt-BR-CoCwRUi0.js → pt-BR-BphMoUTw.js} +0 -6
  247. package/dist/{refresh-cw-9WinWixo.js → refresh-cw-tGMRDxr8.js} +1 -1
  248. package/dist/{runtime-dom.esm-bundler-lFF-QG3j.js → runtime-dom.esm-bundler-DYn1z2Xf.js} +1 -1
  249. package/dist/{search-CqgGq1gG.js → search-Bm2cCQpe.js} +1 -1
  250. package/dist/{send-Ceo3c9Db.js → send-sVLaKZ7f.js} +1 -1
  251. package/dist/{shield-check-uDAwur5D.js → shield-check-YhsbXfQc.js} +1 -1
  252. package/dist/{smartphone-CcLaCpGK.js → smartphone-B2W81p02.js} +1 -1
  253. package/dist/socialIcons-Bwv-49EB.js +2167 -0
  254. package/dist/{sparkles-Do9XjAuT.js → sparkles-a1qkBZ8X.js} +1 -1
  255. package/dist/style.css +1 -1
  256. package/dist/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +1 -3
  257. package/dist/templatical-editor.js +1409 -1156
  258. package/dist/{text-align-start-DvzC0HQA.js → text-align-start-CTuwQ5YW.js} +1 -1
  259. package/dist/timeouts-o5Y9BuqI.js +4 -0
  260. package/dist/{trash-vlINTx32.js → trash-I3D2peFQ.js} +1 -1
  261. package/dist/{triangle-alert-MRYSJ9T2.js → triangle-alert-CenxmLRE.js} +1 -1
  262. package/dist/{upload-CtNOI6J2.js → upload-uU2cK0Ce.js} +1 -1
  263. package/dist/{useAliveFlag-Dd06mRxe.js → useAliveFlag-BjP0Gxza.js} +1 -1
  264. package/dist/{useCloudI18n-Nwqo7pI_.js → useCloudI18n-CGVEZV3o.js} +2 -2
  265. package/dist/{useEditorCore-PvErWWsp.js → useEditorCore-DRbMRe8F.js} +806 -785
  266. package/dist/{useEditorRoot-BD3piYtD.js → useEditorRoot-BVm2-1N8.js} +2 -2
  267. package/dist/{useI18n-CxVEpurs.js → useI18n-CSh4gO5c.js} +2 -2
  268. package/dist/{useLogicTag-BHn67tDd.js → useLogicTag-zcI6BWIf.js} +3 -3
  269. package/dist/{useMergeTag-CRkm5Ig6.js → useMergeTag-C-iBLlp0.js} +5 -5
  270. package/dist/{usePopoverPosition-CwnH1o5g.js → usePopoverPosition-CMcsMBtK.js} +2 -2
  271. package/dist/{useScrollToBlock-CXmcHQQN.js → useScrollToBlock-CdCQK9QQ.js} +3 -3
  272. package/dist/{vue.runtime.esm-bundler-CAzmrXdD.js → vue.runtime.esm-bundler-DV0Wx4r_.js} +1079 -1080
  273. package/dist/{withCurrentFont-CxRGeHO3.js → withCurrentFont-D62njRLu.js} +1 -1
  274. package/dist/{x-Cd6SFw8r.js → x-KFQ4S-Kz.js} +1 -1
  275. package/package.json +12 -12
  276. package/dist/CloudHeaderExtras-CUSftQdm.js +0 -59
  277. package/dist/CollaboratorBar-5rfopCPx.js +0 -103
  278. package/dist/cdn/chunks/CloudHeaderExtras-B4fhuwc_.js.map +0 -1
  279. package/dist/cdn/chunks/CloudPanels-awqHfJqC.js.map +0 -1
  280. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js +0 -52
  281. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js.map +0 -1
  282. package/dist/cdn/chunks/Toolbar-C_x2TfFk.js.map +0 -1
  283. package/dist/cdn/chunks/ca-CbNzJM3I.js.map +0 -1
  284. package/dist/cdn/chunks/cloud-BHClP3e2.js.map +0 -1
  285. package/dist/cdn/chunks/createCloudRuntime-Vd0N4elZ.js.map +0 -1
  286. package/dist/cdn/chunks/de-DMquBpZM.js.map +0 -1
  287. package/dist/cdn/chunks/draggable-DrsNwZuB.js.map +0 -1
  288. package/dist/cdn/chunks/en-C8Mp71sO.js.map +0 -1
  289. package/dist/cdn/chunks/en-ChVeGQBY.js.map +0 -1
  290. package/dist/cdn/chunks/en-eWpiXyZu.js +0 -1
  291. package/dist/cdn/chunks/es-Byq4tthI.js.map +0 -1
  292. package/dist/cdn/chunks/fr-B3j35HEw.js.map +0 -1
  293. package/dist/cdn/chunks/ja-D7txAuGS.js.map +0 -1
  294. package/dist/cdn/chunks/nl-ClJ3BY3F.js.map +0 -1
  295. package/dist/cdn/chunks/pt-BR-DibcXcmv.js.map +0 -1
  296. package/dist/cdn/chunks/pusher-C8DeiO2X.js.map +0 -1
  297. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js +0 -1279
  298. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js.map +0 -1
  299. package/dist/cdn/chunks/src-DYCDeBDM.js.map +0 -1
  300. package/dist/cdn/chunks/src-dZ4D_tuP.js.map +0 -1
  301. package/dist/cdn/chunks/timeouts-Cv2jvusx.js +0 -6
  302. package/dist/cdn/chunks/timeouts-Cv2jvusx.js.map +0 -1
  303. package/dist/cdn/chunks/tiptap-BPigZk5G.js.map +0 -1
  304. package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js.map +0 -1
  305. package/dist/cdn/chunks/useEditorRoot-CTc6O8al.js +0 -10
  306. package/dist/en-B0FUfNwz.js +0 -1
  307. package/dist/socialIcons-PTiwhLoC.js +0 -1359
  308. package/dist/timeouts-Cv2jvusx.js +0 -4
@@ -0,0 +1,2167 @@
1
+ import { $ as e, A as t, At as n, H as r, J as i, R as a, S as o, W as s, X as c, Y as l, Z as u, at as d, d as f, g as p, h as m, jt as h, kt as g, ot as _, r as v, rt as y, s as b, v as x } from "./vue.runtime.esm-bundler-DV0Wx4r_.js";
2
+ import { B as S, E as C, G as w, K as T, S as E, St as D, _ as O, b as k, c as A, d as j, f as M, ft as N, g as ee, gt as P, h as F, it as I, m as L, ot as R, u as te, v as z, y as ne } from "./dist-DBG3nh3k.js";
3
+ import { r as B } from "./dist-CCqn-RqE.js";
4
+ import { L as V, P as H, c as re, x as ie } from "./keys-BymCnLHD.js";
5
+ import { n as U } from "./timeouts-o5Y9BuqI.js";
6
+ import { t as ae } from "./useI18n-CSh4gO5c.js";
7
+ import { o as oe, s as W } from "./usePopoverPosition-CMcsMBtK.js";
8
+ import { t as G } from "./createLucideIcon-BcP1sjdp.js";
9
+ import { t as se } from "./loader-circle-DCEeoYoi.js";
10
+ import { t as ce } from "./upload-uU2cK0Ce.js";
11
+ import { t as le } from "./useAliveFlag-BjP0Gxza.js";
12
+ //#region ../core/dist/index.js
13
+ function ue(e) {
14
+ return e instanceof Error ? e : Error(String(e), { cause: e });
15
+ }
16
+ function K(e, t) {
17
+ try {
18
+ t();
19
+ } catch (t) {
20
+ e?.(ue(t));
21
+ }
22
+ }
23
+ function de(e) {
24
+ let t = e.content ?? C(e.defaultFontFamily, e.templateDefaults);
25
+ O(t), z(t);
26
+ let n = l({
27
+ template: null,
28
+ content: t,
29
+ selectedBlockId: null,
30
+ viewport: "desktop",
31
+ darkMode: !1,
32
+ previewMode: !1,
33
+ isDirty: !1,
34
+ isSaving: !1,
35
+ isLoading: !1,
36
+ uiTheme: "auto"
37
+ }), i = 0;
38
+ function a() {
39
+ n.isDirty = !0, i++;
40
+ }
41
+ let o = r({
42
+ get: () => n.content,
43
+ set: (e) => {
44
+ n.content = e, a();
45
+ }
46
+ }), s = r(() => n.selectedBlockId ? u(n.content.blocks, n.selectedBlockId) : null);
47
+ function u(e, t) {
48
+ for (let n of e) {
49
+ if (n.id === t) return n;
50
+ if (n.type === "section") for (let e of n.children) {
51
+ let n = u(e, t);
52
+ if (n) return n;
53
+ }
54
+ }
55
+ return null;
56
+ }
57
+ function d(e, t) {
58
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) d(e, t);
59
+ }
60
+ function f(e, t, n = { blocks: e }) {
61
+ for (let r = 0; r < e.length; r++) {
62
+ let i = e[r];
63
+ if (i.id === t) return n;
64
+ if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
65
+ let n = f(i.children[e], t, {
66
+ blocks: i.children[e],
67
+ sectionId: i.id,
68
+ columnIndex: e
69
+ });
70
+ if (n) return n;
71
+ }
72
+ }
73
+ return null;
74
+ }
75
+ function p(t) {
76
+ return e.lockedBlocks?.value.has(t) ?? !1;
77
+ }
78
+ function m(e) {
79
+ let t = f(n.content.blocks, e);
80
+ if (!t) return null;
81
+ let r = t.blocks.findIndex((t) => t.id === e);
82
+ return r === -1 ? null : {
83
+ targetSectionId: t.sectionId,
84
+ columnIndex: t.columnIndex,
85
+ index: r
86
+ };
87
+ }
88
+ function h(e, t = !0) {
89
+ O(e), z(e), n.content = e, t && a();
90
+ }
91
+ function g(e) {
92
+ e && p(e) || (n.selectedBlockId = e);
93
+ }
94
+ function _(e) {
95
+ n.viewport = e;
96
+ }
97
+ function v(e) {
98
+ n.darkMode = e;
99
+ }
100
+ function y(e) {
101
+ n.uiTheme = e;
102
+ }
103
+ function b(e) {
104
+ n.previewMode = e, e && (n.selectedBlockId = null);
105
+ }
106
+ function x(e, t) {
107
+ if (p(e)) return;
108
+ let r = u(n.content.blocks, e);
109
+ r && (Object.assign(r, t), a());
110
+ }
111
+ function S(e) {
112
+ n.content.settings = {
113
+ ...n.content.settings,
114
+ ...e
115
+ }, a();
116
+ }
117
+ function w(e, t, r = 0, i) {
118
+ let o = {
119
+ settings: n.content.settings,
120
+ blocks: [e]
121
+ };
122
+ if (O(o), z(o), !(t && e.type === "section")) {
123
+ if (t) {
124
+ if (p(t)) return;
125
+ let a = u(n.content.blocks, t);
126
+ if (a && a.type === "section") {
127
+ if (r < 0 || r >= T(a.columns)) return;
128
+ a.children[r] = a.children[r] || [];
129
+ let t = a.children[r];
130
+ i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
131
+ }
132
+ } else i !== void 0 && i < n.content.blocks.length ? n.content.blocks.splice(i, 0, e) : n.content.blocks.push(e);
133
+ a();
134
+ }
135
+ }
136
+ function E(e) {
137
+ if (p(e)) return;
138
+ let t = f(n.content.blocks, e);
139
+ if (t) {
140
+ let r = t.blocks.findIndex((t) => t.id === e);
141
+ if (r !== -1) {
142
+ let [e] = t.blocks.splice(r, 1);
143
+ if (n.selectedBlockId) {
144
+ let t = /* @__PURE__ */ new Set();
145
+ d(e, t), t.has(n.selectedBlockId) && (n.selectedBlockId = null);
146
+ }
147
+ a();
148
+ }
149
+ }
150
+ }
151
+ function D(e, t, r, i = 0) {
152
+ if (p(e) || r && p(r)) return;
153
+ let o = f(n.content.blocks, e);
154
+ if (!o) return;
155
+ let s = o.blocks.findIndex((t) => t.id === e);
156
+ if (s === -1 || r && o.blocks[s].type === "section") return;
157
+ let c;
158
+ if (r) {
159
+ let e = u(n.content.blocks, r);
160
+ if (!e || e.type !== "section" || i < 0 || i >= T(e.columns)) return;
161
+ e.children[i] = e.children[i] || [], c = e.children[i];
162
+ } else c = n.content.blocks;
163
+ let [l] = o.blocks.splice(s, 1);
164
+ c.splice(t, 0, l), a();
165
+ }
166
+ function k() {
167
+ a();
168
+ }
169
+ function A(e, t) {
170
+ throw new M(`[Templatical] Templates: ${e} ${t}`);
171
+ }
172
+ function j(t) {
173
+ K(e.onError, t);
174
+ }
175
+ function N(t) {
176
+ let { templates: n } = e;
177
+ return n || A(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
178
+ }
179
+ function ee(e) {
180
+ n.template && (n.template = {
181
+ ...n.template,
182
+ name: e
183
+ }, a());
184
+ }
185
+ async function P(t) {
186
+ let r = N("create()"), { create: a } = r;
187
+ typeof a != "function" && A("create()", "is disabled by the provider — its `create` is `false`.");
188
+ let o;
189
+ n.isLoading = !0;
190
+ try {
191
+ t?.content && (n.content = t.content);
192
+ let e = i;
193
+ o = await a(t?.name === void 0 ? { content: n.content } : {
194
+ name: t.name,
195
+ content: n.content
196
+ }), n.template = o, i === e && (n.isDirty = !1);
197
+ } catch (t) {
198
+ throw e.onError?.(t), t;
199
+ } finally {
200
+ n.isLoading = !1;
201
+ }
202
+ return j(() => r.onCreated?.(o)), o;
203
+ }
204
+ async function F(t) {
205
+ let r = N("load()"), i;
206
+ n.isLoading = !0;
207
+ try {
208
+ i = await r.load(t), O(i.content), z(i.content), n.template = i, n.content = i.content, n.isDirty = !1;
209
+ } catch (t) {
210
+ throw e.onError?.(t), t;
211
+ } finally {
212
+ n.isLoading = !1;
213
+ }
214
+ return j(() => r.onLoaded?.(i)), i;
215
+ }
216
+ async function I(t = "api") {
217
+ let r = N("save()"), { save: a } = r;
218
+ typeof a != "function" && A("save()", "is disabled by the provider — its `save` is `false`.");
219
+ let o = n.template;
220
+ o || A("save()", "has no template loaded. Call create() or load() first.");
221
+ let s = o.name === void 0 ? { content: n.content } : {
222
+ name: o.name,
223
+ content: n.content
224
+ }, c;
225
+ n.isSaving = !0;
226
+ try {
227
+ let e = i;
228
+ if (c = await a(o.id, s), n.template?.id === o.id) {
229
+ let e = n.template.name;
230
+ n.template = e === o.name ? c : {
231
+ ...c,
232
+ name: e
233
+ };
234
+ }
235
+ i === e && (n.isDirty = !1);
236
+ } catch (t) {
237
+ throw e.onError?.(t), t;
238
+ } finally {
239
+ n.isSaving = !1;
240
+ }
241
+ return j(() => r.onSaved?.(c, { trigger: t })), c;
242
+ }
243
+ function L() {
244
+ return n.template?.id !== void 0;
245
+ }
246
+ return {
247
+ state: c(n),
248
+ content: o,
249
+ selectedBlock: s,
250
+ isBlockLocked: p,
251
+ setContent: h,
252
+ selectBlock: g,
253
+ setViewport: _,
254
+ setDarkMode: v,
255
+ setUiTheme: y,
256
+ setPreviewMode: b,
257
+ updateBlock: x,
258
+ updateSettings: S,
259
+ addBlock: w,
260
+ removeBlock: E,
261
+ moveBlock: D,
262
+ markDirty: k,
263
+ findBlockLocation: m,
264
+ setName: ee,
265
+ create: P,
266
+ load: F,
267
+ save: I,
268
+ hasTemplate: L
269
+ };
270
+ }
271
+ var q = 50, fe = 300, pe = 1500;
272
+ function J(e) {
273
+ let { content: t, setContent: n, maxSize: i = q } = e, a = u([]), o = u([]), s = u(!1), c = null, l = null, d = r(() => a.value.length > 0), f = r(() => o.value.length > 0);
274
+ function p() {
275
+ return P(t.value);
276
+ }
277
+ function m(e) {
278
+ a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
279
+ }
280
+ function h() {
281
+ l &&= (clearTimeout(l.timeoutId), null);
282
+ }
283
+ function g() {
284
+ h(), m(p()), o.value = [];
285
+ }
286
+ function _(e) {
287
+ l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
288
+ l = null;
289
+ }, fe)) : (h(), m(p()), o.value = [], l = {
290
+ blockId: e,
291
+ timeoutId: setTimeout(() => {
292
+ l = null;
293
+ }, fe)
294
+ });
295
+ }
296
+ function v() {
297
+ s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
298
+ s.value = !1, c = null;
299
+ }, pe);
300
+ }
301
+ function y() {
302
+ if (a.value.length === 0) return;
303
+ h();
304
+ let e = a.value.pop();
305
+ o.value.push(p()), n(e, !0), v();
306
+ }
307
+ function b() {
308
+ if (o.value.length === 0) return;
309
+ h();
310
+ let e = o.value.pop();
311
+ a.value.push(p()), n(e, !0), v();
312
+ }
313
+ function x() {
314
+ a.value = [], o.value = [], h();
315
+ }
316
+ function S() {
317
+ x(), c &&= (clearTimeout(c), null);
318
+ }
319
+ return {
320
+ canUndo: d,
321
+ canRedo: f,
322
+ isNavigating: s,
323
+ undo: y,
324
+ redo: b,
325
+ record: g,
326
+ recordDebounced: _,
327
+ clear: x,
328
+ destroy: S
329
+ };
330
+ }
331
+ function me(e) {
332
+ let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
333
+ function o(n, r, a) {
334
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = E(n, o);
335
+ return t(s, r, a), i(s.id), s;
336
+ }
337
+ function s(e, n, r) {
338
+ let o = ne(e);
339
+ if (n !== void 0 || r !== void 0) t(o, n, r);
340
+ else {
341
+ let i = a?.(e.id) ?? null;
342
+ i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
343
+ }
344
+ return i(o.id), o;
345
+ }
346
+ function c(e) {
347
+ n(e);
348
+ }
349
+ function l(e, t, n) {
350
+ r(e, { [t]: n });
351
+ }
352
+ return {
353
+ createAndAddBlock: o,
354
+ duplicateBlock: s,
355
+ deleteBlock: c,
356
+ updateBlockProperty: l
357
+ };
358
+ }
359
+ var he = 2e3;
360
+ function ge(e) {
361
+ let { content: t, isDirty: n, onChange: r, debounce: i = he, enabled: a = !0 } = e, o = null, s = !1;
362
+ function c() {
363
+ return typeof a == "function" ? a() : a;
364
+ }
365
+ function l() {
366
+ s = !0, d();
367
+ }
368
+ function u() {
369
+ s = !1;
370
+ }
371
+ function d() {
372
+ o &&= (clearTimeout(o), null);
373
+ }
374
+ function f() {
375
+ d(), n() && r(JSON.parse(JSON.stringify(t.value)));
376
+ }
377
+ function p() {
378
+ c() && !s && (d(), o = setTimeout(() => {
379
+ o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
380
+ }, i));
381
+ }
382
+ let m = _(t, () => {
383
+ p();
384
+ }, { deep: !0 });
385
+ function h() {
386
+ m(), d();
387
+ }
388
+ return {
389
+ flush: f,
390
+ cancel: d,
391
+ pause: l,
392
+ resume: u,
393
+ destroy: h
394
+ };
395
+ }
396
+ function _e(e) {
397
+ let t = l(/* @__PURE__ */ new Set()), n = r(() => t.size > 0);
398
+ function i(e) {
399
+ return t.has(e);
400
+ }
401
+ function a(n) {
402
+ t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
403
+ }
404
+ function o() {
405
+ t.clear();
406
+ }
407
+ return {
408
+ isHidden: i,
409
+ toggleBlock: a,
410
+ reset: o,
411
+ hasHiddenBlocks: n
412
+ };
413
+ }
414
+ function ve(e) {
415
+ let t = u(!1), n = u(!1), i = r(() => !!e.definition.value?.dataSource), a = r(() => i.value && !e.block.value.dataSourceFetched);
416
+ async function o() {
417
+ let r = e.definition.value;
418
+ if (r?.dataSource) {
419
+ t.value = !0, n.value = !1;
420
+ try {
421
+ let t = await r.dataSource.onFetch({
422
+ fieldValues: { ...e.block.value.fieldValues },
423
+ blockId: e.block.value.id
424
+ });
425
+ if (t == null) return;
426
+ let n = { ...e.block.value.fieldValues };
427
+ for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
428
+ e.onUpdate(n, !0);
429
+ } catch (e) {
430
+ console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
431
+ } finally {
432
+ t.value = !1;
433
+ }
434
+ }
435
+ }
436
+ return {
437
+ isFetching: t,
438
+ fetchError: n,
439
+ fetch: o,
440
+ hasDataSource: i,
441
+ needsFetch: a
442
+ };
443
+ }
444
+ function ye(e, t) {
445
+ let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
446
+ e.addBlock = (r, i, a, o) => {
447
+ i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
448
+ }, e.removeBlock = (n) => {
449
+ e.isBlockLocked(n) || (t.record(), r(n));
450
+ }, e.moveBlock = (n, r, a, o) => {
451
+ e.isBlockLocked(n) || a && e.isBlockLocked(a) || (t.record(), i(n, r, a, o));
452
+ }, e.updateBlock = (n, r) => {
453
+ e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r));
454
+ }, e.updateSettings = (e) => {
455
+ t.record(), o(e);
456
+ };
457
+ }
458
+ var be = "root", xe = /* @__PURE__ */ new Set([
459
+ "id",
460
+ "type",
461
+ "children"
462
+ ]), Se = /* @__PURE__ */ new Set([
463
+ "id",
464
+ "type",
465
+ "children",
466
+ "columns"
467
+ ]), Ce = /* @__PURE__ */ new Set();
468
+ function we(e) {
469
+ return e === null ? be : JSON.stringify([e.sectionId, e.column]);
470
+ }
471
+ function Y(e) {
472
+ let t = e.children;
473
+ return e.type === "section" && Array.isArray(t) ? t : [];
474
+ }
475
+ function X(e) {
476
+ let t = /* @__PURE__ */ new Map(), n = (e, r) => {
477
+ e.forEach((e, i) => {
478
+ t.has(e.id) || t.set(e.id, {
479
+ block: e,
480
+ key: we(r),
481
+ index: i
482
+ }), Y(e).forEach((t, r) => {
483
+ Array.isArray(t) && n(t, {
484
+ sectionId: e.id,
485
+ column: r
486
+ });
487
+ });
488
+ });
489
+ };
490
+ return n(e, null), t;
491
+ }
492
+ function Te(e) {
493
+ let t = [], n = Array(e.length).fill(-1);
494
+ e.forEach((r, i) => {
495
+ let a = 0, o = t.length;
496
+ for (; a < o;) {
497
+ let n = a + o >> 1;
498
+ e[t[n]] < r ? a = n + 1 : o = n;
499
+ }
500
+ a > 0 && (n[i] = t[a - 1]), t[a] = i;
501
+ });
502
+ let r = /* @__PURE__ */ new Set(), i = t.length > 0 ? t[t.length - 1] : -1;
503
+ for (; i !== -1;) r.add(i), i = n[i];
504
+ return r;
505
+ }
506
+ function Ee(e, t, n) {
507
+ let r = {}, i = [];
508
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || S(e[i], t[i]) || (r[i] = P(t[i]));
509
+ for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
510
+ return {
511
+ set: r,
512
+ unset: i
513
+ };
514
+ }
515
+ function De(e, t) {
516
+ let n = X(e.blocks), r = X(t.blocks), i = [], a = (e) => {
517
+ let t = r.get(e), i = n.get(e);
518
+ return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
519
+ }, o = (e) => r.has(e.id) && !a(e.id), s = (e) => Y(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
520
+ let n = "kept";
521
+ t === "dropped" ? (c.add(e.id), n = "dropped") : a(e.id) ? (i.push({
522
+ op: "deleteBlock",
523
+ blockId: e.id
524
+ }), c.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : s(e) ? (l.push(e.id), n = "deferred") : (i.push({
525
+ op: "deleteBlock",
526
+ blockId: e.id
527
+ }), c.add(e.id), n = "dropped"));
528
+ for (let t of Y(e)) if (Array.isArray(t)) for (let e of t) u(e, n);
529
+ };
530
+ for (let t of e.blocks) u(t, "kept");
531
+ let d = (e) => n.has(e) && !c.has(e), f = (e) => {
532
+ let t = P(e);
533
+ return t.type === "section" && (t.children = Y(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => P(e)) : e)), t;
534
+ }, p = (e, t, r) => {
535
+ let a = we(e), o = [], s = [];
536
+ t.forEach((e, t) => {
537
+ let r = n.get(e.id);
538
+ d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
539
+ });
540
+ let c = new Set([...Te(o)].map((e) => s[e]));
541
+ t.forEach((n, a) => {
542
+ if (c.has(a) || r(n)) return;
543
+ let o = a > 0 ? t[a - 1].id : null;
544
+ i.push(d(n.id) ? {
545
+ op: "moveBlock",
546
+ blockId: n.id,
547
+ parent: e,
548
+ after: o
549
+ } : {
550
+ op: "addBlock",
551
+ block: f(n),
552
+ parent: e,
553
+ after: o
554
+ });
555
+ });
556
+ };
557
+ p(null, t.blocks, () => !1);
558
+ let m = t.blocks.filter((e) => e.type === "section"), h = /* @__PURE__ */ new Set(), g = (e) => {
559
+ for (let t of m) {
560
+ if (!d(t.id)) continue;
561
+ let r = Y(n.get(t.id).block).length, a = Y(t).length;
562
+ (e ? a > r : a < r) && (i.push({
563
+ op: "updateBlock",
564
+ blockId: t.id,
565
+ set: { columns: t.columns }
566
+ }), h.add(t.id));
567
+ }
568
+ };
569
+ g(!0);
570
+ for (let e of m) {
571
+ let t = !d(e.id);
572
+ Y(e).forEach((n, r) => {
573
+ Array.isArray(n) && p({
574
+ sectionId: e.id,
575
+ column: r
576
+ }, n, (e) => t && !d(e.id));
577
+ });
578
+ }
579
+ g(!1);
580
+ for (let e of l) i.push({
581
+ op: "deleteBlock",
582
+ blockId: e
583
+ });
584
+ for (let [e, t] of r) {
585
+ if (!d(e)) continue;
586
+ let { set: r, unset: a } = Ee(n.get(e).block, t.block, h.has(e) ? Se : xe);
587
+ (Object.keys(r).length !== 0 || a.length !== 0) && i.push({
588
+ op: "updateBlock",
589
+ blockId: e,
590
+ ...Object.keys(r).length > 0 ? { set: r } : {},
591
+ ...a.length > 0 ? { unset: a } : {}
592
+ });
593
+ }
594
+ let _ = Ee(e.settings, t.settings, Ce);
595
+ return (Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
596
+ op: "updateSettings",
597
+ ...Object.keys(_.set).length > 0 ? { set: _.set } : {},
598
+ ..._.unset.length > 0 ? { unset: _.unset } : {}
599
+ }), i;
600
+ }
601
+ function Oe(e) {
602
+ let t = e.children;
603
+ return e.type === "section" && Array.isArray(t) ? t : [];
604
+ }
605
+ function Z(e, t, n = null) {
606
+ for (let r = 0; r < e.length; r++) {
607
+ let i = e[r];
608
+ if (i.id === t) return {
609
+ block: i,
610
+ parent: n,
611
+ after: r > 0 ? e[r - 1].id : null
612
+ };
613
+ let a = Oe(i);
614
+ for (let e = 0; e < a.length; e++) {
615
+ if (!Array.isArray(a[e])) continue;
616
+ let n = Z(a[e], t, {
617
+ sectionId: i.id,
618
+ column: e
619
+ });
620
+ if (n) return n;
621
+ }
622
+ }
623
+ return null;
624
+ }
625
+ function Q(e, t, n) {
626
+ let r = Z(e.blocks, t);
627
+ if (!r) throw new A("block_missing", n, `No block with id "${t}".`, t);
628
+ return r;
629
+ }
630
+ function $(e, t, n) {
631
+ let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
632
+ for (let n of o) {
633
+ let o = e[n];
634
+ o === void 0 ? i.push(n) : r[n] = P(o);
635
+ let s = t && n in t ? t[n] : void 0;
636
+ a[n] = s === void 0 ? null : P(s);
637
+ }
638
+ return {
639
+ set: r,
640
+ unset: i,
641
+ expect: a
642
+ };
643
+ }
644
+ function ke(e, t, n) {
645
+ switch (t.op) {
646
+ case "addBlock": return {
647
+ op: "deleteBlock",
648
+ blockId: t.block.id,
649
+ expect: { block: P(t.block) }
650
+ };
651
+ case "deleteBlock": {
652
+ let r = Q(e, t.blockId, n);
653
+ return {
654
+ op: "addBlock",
655
+ block: P(r.block),
656
+ parent: r.parent,
657
+ after: r.after
658
+ };
659
+ }
660
+ case "moveBlock": {
661
+ let r = Q(e, t.blockId, n);
662
+ return {
663
+ op: "moveBlock",
664
+ blockId: t.blockId,
665
+ parent: r.parent,
666
+ after: r.after,
667
+ expect: {
668
+ parent: t.parent,
669
+ after: t.after
670
+ }
671
+ };
672
+ }
673
+ case "updateBlock": {
674
+ let r = Q(e, t.blockId, n).block, { set: i, unset: a, expect: o } = $(r, t.set, t.unset);
675
+ return {
676
+ op: "updateBlock",
677
+ blockId: t.blockId,
678
+ ...Object.keys(i).length > 0 ? { set: i } : {},
679
+ ...a.length > 0 ? { unset: a } : {},
680
+ expect: o
681
+ };
682
+ }
683
+ case "updateSettings": {
684
+ let { set: n, unset: r, expect: i } = $(e.settings, t.set, t.unset);
685
+ return {
686
+ op: "updateSettings",
687
+ ...Object.keys(n).length > 0 ? { set: n } : {},
688
+ ...r.length > 0 ? { unset: r } : {},
689
+ expect: i
690
+ };
691
+ }
692
+ case "setContent": return {
693
+ op: "setContent",
694
+ content: {
695
+ blocks: P(e.blocks),
696
+ settings: P(e.settings)
697
+ }
698
+ };
699
+ }
700
+ }
701
+ function Ae(e, t) {
702
+ let n = P(e), r = [];
703
+ return t.forEach((e, t) => {
704
+ r.push(ke(n, e, t));
705
+ try {
706
+ ee(n, [e]);
707
+ } catch (e) {
708
+ throw e instanceof A ? new A(e.code, t, e.message, e.blockId) : e;
709
+ }
710
+ }), r.reverse();
711
+ }
712
+ var je = 1e3, Me = 1e4, Ne = [
713
+ 1e3,
714
+ 2e3,
715
+ 5e3,
716
+ 1e4,
717
+ 3e4
718
+ ], Pe = 50, Fe = /* @__PURE__ */ new Set([
719
+ "block_exists",
720
+ "block_missing",
721
+ "anchor_missing",
722
+ "precondition_failed",
723
+ "lock_held",
724
+ "locked_by_others",
725
+ "invalid_operation",
726
+ "lock_lost",
727
+ "content_too_large"
728
+ ]);
729
+ function Ie(e) {
730
+ let t = e?.code;
731
+ return typeof t == "string" && Fe.has(t) ? t : null;
732
+ }
733
+ function Le(e) {
734
+ let t = e?.holder;
735
+ return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
736
+ }
737
+ function Re(e) {
738
+ let t = e?.statusCode;
739
+ return typeof t != "number" || t >= 500 || t === 408 || t === 429;
740
+ }
741
+ function ze(e, t) {
742
+ return e.some((e) => {
743
+ if (e.id === t) return !0;
744
+ let n = e.children;
745
+ return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && ze(e, t));
746
+ });
747
+ }
748
+ function Be(e) {
749
+ if (e.length === 1 && e[0].op === "updateSettings") return !0;
750
+ let t = e[0];
751
+ return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId);
752
+ }
753
+ function Ve(e) {
754
+ return e.map((e) => {
755
+ if (!("expect" in e)) return e;
756
+ let { expect: t, ...n } = e;
757
+ return n;
758
+ });
759
+ }
760
+ function He(t) {
761
+ let { provider: n } = t, a = t.sessionId ?? crypto.randomUUID(), o = t.maxUndo ?? Pe, c = typeof n.acquireLock == "function" && typeof n.renewLock == "function" && typeof n.releaseLock == "function", l = e([]), d = e(/* @__PURE__ */ new Map()), f = u(null), p = u(0), m = u(0), h = null, g = null, v = !1, y = !1, b = !1, x = null, C = 0, w = !1, T = [], E = null, D = null, O = Promise.resolve(), k = null, j = r(() => (m.value, (g?.undo.length ?? 0) > 0)), M = r(() => (m.value, (g?.redo.length ?? 0) > 0));
762
+ function N(e) {
763
+ t.onError?.(e instanceof Error ? e : Error(String(e)));
764
+ }
765
+ function I(e, n = g) {
766
+ n !== g || w || t.onNotice?.(e);
767
+ }
768
+ function L() {
769
+ return {
770
+ locks: [...d.value.values()].map((e) => ({
771
+ blockId: e.blockId,
772
+ sessionId: e.holder.sessionId
773
+ })),
774
+ session: a
775
+ };
776
+ }
777
+ function R() {
778
+ m.value++;
779
+ }
780
+ function te(e, t) {
781
+ e.push(t), e.length > o && e.splice(0, e.length - o);
782
+ }
783
+ function z(e) {
784
+ if (!h || v) return;
785
+ y = !0;
786
+ try {
787
+ let t = h.content.value, n = De(t, e);
788
+ if (n.length > 0) try {
789
+ ee(t, n);
790
+ } catch {
791
+ h.setContent(P(e), !1);
792
+ }
793
+ S(h.content.value, e) || h.setContent(P(e), !1);
794
+ } finally {
795
+ y = !1;
796
+ }
797
+ let t = h.state.selectedBlockId;
798
+ t && !ze(e.blocks, t) && h.selectBlock(null);
799
+ }
800
+ function ne() {
801
+ y || b || (b = !0, queueMicrotask(() => {
802
+ b = !1, V(!1);
803
+ }));
804
+ }
805
+ function B() {
806
+ x &&= (clearTimeout(x), null);
807
+ }
808
+ function V(e, t = !1) {
809
+ let n = g;
810
+ if (!h || !n || v || y || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
811
+ let r = De(n.view, h.content.value);
812
+ if (r.length === 0) B();
813
+ else {
814
+ if (!e && Be(r)) {
815
+ let e = Date.now();
816
+ if (x === null && (C = e), e - C < 1e3) {
817
+ x && clearTimeout(x), x = setTimeout(() => {
818
+ x = null, V(!0);
819
+ }, 300);
820
+ return;
821
+ }
822
+ }
823
+ B(), re(n, r);
824
+ }
825
+ }
826
+ function H() {
827
+ V(!0);
828
+ }
829
+ function re(e, t) {
830
+ let n = t, r;
831
+ try {
832
+ r = F(e.view, n, L());
833
+ } catch (t) {
834
+ if (!(t instanceof A)) throw t;
835
+ z(e.view);
836
+ let n = t.blockId === void 0 ? void 0 : d.value.get(t.blockId)?.holder;
837
+ I({
838
+ type: "editRefused",
839
+ code: t.code,
840
+ ...n ? { holder: n } : {}
841
+ }), t.code === "invalid_operation" && N(t);
842
+ return;
843
+ }
844
+ let i = h.content.value;
845
+ if (!S(r, i)) {
846
+ N(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
847
+ op: "setContent",
848
+ content: P(i)
849
+ }];
850
+ try {
851
+ r = F(e.view, n, L());
852
+ } catch (t) {
853
+ if (!(t instanceof A)) throw t;
854
+ z(e.view), I({
855
+ type: "editRefused",
856
+ code: t.code
857
+ });
858
+ return;
859
+ }
860
+ }
861
+ let a = { ops: Ae(e.view, n) };
862
+ te(e.undo, a), e.redo = [], R(), e.view = r, ie(e, n, "edit", a);
863
+ }
864
+ function ie(e, t, n, r) {
865
+ e.pending.push({
866
+ batchId: crypto.randomUUID(),
867
+ ops: t,
868
+ origin: n,
869
+ entry: r,
870
+ sent: !1,
871
+ revision: null
872
+ }), U(e);
873
+ }
874
+ function U(e) {
875
+ if (e.inFlight) return;
876
+ let t = e.pending.find((e) => !e.sent);
877
+ t ? (t.sent = !0, e.inFlight = t, ae(e, t, 0)) : ce(e);
878
+ }
879
+ function ae(e, t, r) {
880
+ n.submit(e.templateId, {
881
+ batchId: t.batchId,
882
+ baseRevision: e.revision,
883
+ ops: t.ops
884
+ }).then(({ revision: n }) => {
885
+ e.inFlight = null, oe(e, t, n), U(e);
886
+ }, (n) => {
887
+ if (Ie(n) !== null) e.inFlight = null, se(e, t, n), U(e);
888
+ else if (Re(n)) {
889
+ le(e, n);
890
+ let i = Ne[Math.min(r, Ne.length - 1)];
891
+ setTimeout(() => {
892
+ w || ae(e, t, r + 1);
893
+ }, i);
894
+ } else e.inFlight = null, N(n), se(e, t, n), U(e);
895
+ });
896
+ }
897
+ function oe(e, t, n) {
898
+ t.revision === null && (t.revision = n, n <= e.revision ? (W(e, t), q(e)) : (e.own.set(n, t), de(e)));
899
+ }
900
+ function W(e, t) {
901
+ e.pending = e.pending.filter((e) => e !== t), ce(e);
902
+ }
903
+ function G(e, t) {
904
+ if (t.entry) {
905
+ for (let n of [e.undo, e.redo]) {
906
+ let e = n.indexOf(t.entry);
907
+ e !== -1 && n.splice(e, 1);
908
+ }
909
+ R();
910
+ }
911
+ }
912
+ function se(e, t, n) {
913
+ W(e, t), G(e, t);
914
+ let r = Ie(n) ?? "invalid_operation";
915
+ if (t.origin === "edit") {
916
+ let t = Le(n);
917
+ I({
918
+ type: "editRefused",
919
+ code: r,
920
+ ...t ? { holder: t } : {}
921
+ }, e);
922
+ } else I({
923
+ type: "undoSkipped",
924
+ code: r
925
+ }, e);
926
+ q(e), e === g && J();
927
+ }
928
+ function ce(e) {
929
+ if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
930
+ }
931
+ function le(e, t) {
932
+ let n = t instanceof Error ? t : Error(String(t));
933
+ for (let t of e.waiters.splice(0)) t.reject(n);
934
+ }
935
+ function ue(e, t) {
936
+ if (t.revision <= e.revision) return;
937
+ let n = e.pending.find((e) => e.batchId === t.batchId);
938
+ n ? oe(e, n, t.revision) : (e.remote.set(t.revision, t), de(e));
939
+ }
940
+ function K(e, n) {
941
+ let r = n.ops;
942
+ if (t.normalizeRemoteOperations) try {
943
+ r = t.normalizeRemoteOperations(n.ops, e.confirmed);
944
+ } catch (e) {
945
+ N(e);
946
+ }
947
+ return Ve(r);
948
+ }
949
+ function de(e) {
950
+ let n = [];
951
+ for (;;) {
952
+ let t = e.revision + 1, r = e.remote.get(t), i = e.own.get(t);
953
+ if (!r && !i) break;
954
+ try {
955
+ e.confirmed = F(e.confirmed, r ? K(e, r) : i.ops);
956
+ } catch {
957
+ if (e.recovering) {
958
+ e.remote.clear(), e.own.clear(), N(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
959
+ return;
960
+ }
961
+ me(e);
962
+ return;
963
+ }
964
+ e.revision = t, r ? (e.remote.delete(t), n.push(r)) : (e.own.delete(t), W(e, i));
965
+ }
966
+ if (e === g && (p.value = e.revision), e.remote.size > 0 || e.own.size > 0 ? fe(e) : pe(e), n.length !== 0 && (q(e), e === g)) for (let e of n) try {
967
+ t.onRemoteChange?.({
968
+ actor: e.actor,
969
+ ops: e.ops
970
+ });
971
+ } catch (e) {
972
+ N(e);
973
+ }
974
+ }
975
+ function q(e) {
976
+ e === g && H();
977
+ let t = e.confirmed, n = [];
978
+ for (let r of e.pending) try {
979
+ t = F(t, r.ops), n.push(r);
980
+ } catch (t) {
981
+ if (r.sent) {
982
+ n.push(r);
983
+ continue;
984
+ }
985
+ G(e, r);
986
+ let i = t instanceof A ? t.code : "invalid_operation";
987
+ I(r.origin === "edit" ? {
988
+ type: "editRefused",
989
+ code: i
990
+ } : {
991
+ type: "undoSkipped",
992
+ code: i
993
+ }, e);
994
+ }
995
+ e.pending = n, e.view = t, ce(e), e === g && z(t);
996
+ }
997
+ function fe(e) {
998
+ e.gapTimer ||= setTimeout(() => {
999
+ e.gapTimer = null, e === g && J();
1000
+ }, je);
1001
+ }
1002
+ function pe(e) {
1003
+ e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1004
+ }
1005
+ function J() {
1006
+ let e = g;
1007
+ return e ? (e.catchingUp ||= (async () => {
1008
+ try {
1009
+ let t = await n.operationsAfter(e.templateId, e.revision);
1010
+ if (e.retired) return;
1011
+ if ("resync" in t) {
1012
+ await me(e);
1013
+ return;
1014
+ }
1015
+ for (let n of t.batches) ue(e, n);
1016
+ } catch (e) {
1017
+ N(e);
1018
+ } finally {
1019
+ e.catchingUp = null;
1020
+ }
1021
+ })(), e.catchingUp) : Promise.resolve();
1022
+ }
1023
+ async function me(e) {
1024
+ e.recovering = !0;
1025
+ try {
1026
+ let n = await t.loadTemplate(e.templateId);
1027
+ if (e.retired) return;
1028
+ let r = n.revision ?? e.revision;
1029
+ e.confirmed = P(n.content), e.revision = r, e.remote = new Map([...e.remote].filter(([e]) => e > r));
1030
+ for (let [t, n] of [...e.own]) t <= r && (e.own.delete(t), W(e, n));
1031
+ e === g && (p.value = r), q(e), de(e);
1032
+ } catch (e) {
1033
+ N(e);
1034
+ } finally {
1035
+ e.recovering = !1;
1036
+ }
1037
+ }
1038
+ function he(e) {
1039
+ let n = () => e === g && !e.retired;
1040
+ return {
1041
+ onBatch: (t) => {
1042
+ n() && ue(e, t);
1043
+ },
1044
+ onResync: (r, i) => {
1045
+ if (!(!n() || r <= e.revision)) {
1046
+ if (i) try {
1047
+ t.onRemoteResync?.({
1048
+ revision: r,
1049
+ actor: i
1050
+ });
1051
+ } catch (e) {
1052
+ N(e);
1053
+ }
1054
+ J();
1055
+ }
1056
+ },
1057
+ onLock: (e) => {
1058
+ n() && xe(e);
1059
+ },
1060
+ onUnlock: (e, t) => {
1061
+ n() && Se(e, t);
1062
+ },
1063
+ onMembers: (e) => {
1064
+ n() && we(e);
1065
+ },
1066
+ onConnectionChange: (t) => {
1067
+ n() && ye(e, t);
1068
+ }
1069
+ };
1070
+ }
1071
+ function ge(e, t) {
1072
+ n.join(e.templateId, { sessionId: a }, he(e)).then((n) => {
1073
+ e.retired || e !== g ? t || n.leave() : (e.leave = n.leave, Ce(n.locks, !t), we(n.members), n.members.length > 0 && (f.value = "connected"), n.revision > e.revision && J(), t && X());
1074
+ }, (e) => N(e));
1075
+ }
1076
+ function _e(e) {
1077
+ let t = P(e.content), n = {
1078
+ templateId: e.id,
1079
+ confirmed: t,
1080
+ revision: e.revision ?? 0,
1081
+ pending: [],
1082
+ view: P(t),
1083
+ remote: /* @__PURE__ */ new Map(),
1084
+ own: /* @__PURE__ */ new Map(),
1085
+ inFlight: null,
1086
+ gapTimer: null,
1087
+ catchingUp: null,
1088
+ leave: null,
1089
+ retired: !1,
1090
+ recovering: !1,
1091
+ undo: [],
1092
+ redo: [],
1093
+ waiters: []
1094
+ };
1095
+ g = n, p.value = n.revision, R(), ge(n, !1), h?.state.selectedBlockId && Q(h.state.selectedBlockId), ne();
1096
+ }
1097
+ function ve(e) {
1098
+ e.retired = !0, pe(e), e.leave?.(), e.leave = null, le(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1099
+ }
1100
+ function ye(e, t) {
1101
+ let n = f.value;
1102
+ f.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
1103
+ }
1104
+ function be(e) {
1105
+ g && g.templateId === e?.id || (g &&= (B(), ve(g), null), l.value = [], d.value = /* @__PURE__ */ new Map(), f.value = null, E = null, X(), R(), e && _e(e));
1106
+ }
1107
+ function xe(e) {
1108
+ if (e.holder.sessionId === a) return;
1109
+ let t = new Map([...d.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1110
+ t.set(e.blockId, e), d.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), I({
1111
+ type: "selectionRefused",
1112
+ blockId: e.blockId,
1113
+ holder: e.holder
1114
+ }));
1115
+ }
1116
+ function Se(e, t) {
1117
+ if (d.value.get(e)?.holder.sessionId !== t) return;
1118
+ let n = new Map(d.value);
1119
+ n.delete(e), d.value = n;
1120
+ }
1121
+ function Ce(e, t) {
1122
+ let n = t ? new Map(d.value) : /* @__PURE__ */ new Map();
1123
+ for (let r of e) r.holder.sessionId !== a && (t && n.has(r.blockId) || n.set(r.blockId, r));
1124
+ d.value = n;
1125
+ }
1126
+ function we(e) {
1127
+ let t = new Set(e.map((e) => e.sessionId)), n = new Set(l.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1128
+ if (l.value = e, n.size === 0) return;
1129
+ let r = new Map([...d.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1130
+ r.size !== d.value.size && (d.value = r);
1131
+ }
1132
+ function Y(e) {
1133
+ O = O.then(e).catch(N);
1134
+ }
1135
+ function X() {
1136
+ c && Y(async () => {
1137
+ if (D && (E === null || D.templateId !== E.templateId)) {
1138
+ let e = D;
1139
+ D = null, Z(), await n.releaseLock(e.templateId, e.blockId);
1140
+ }
1141
+ let e = E;
1142
+ if (!(!e || D?.templateId === e.templateId && D.blockId === e.blockId)) try {
1143
+ await n.acquireLock(e.templateId, e.blockId), D = e, Oe(), Te(e.blockId);
1144
+ } catch (t) {
1145
+ if (D?.templateId === e.templateId) {
1146
+ let e = D;
1147
+ D = null, Z(), await n.releaseLock(e.templateId, e.blockId).catch(() => {});
1148
+ }
1149
+ if (E !== e) return;
1150
+ Ee(e.blockId, t);
1151
+ }
1152
+ });
1153
+ }
1154
+ function Te(e) {
1155
+ if (!d.value.has(e)) return;
1156
+ let t = new Map(d.value);
1157
+ t.delete(e), d.value = t;
1158
+ }
1159
+ function Ee(e, t) {
1160
+ let n = Ie(t);
1161
+ if (n === "lock_held" || n === "block_missing") {
1162
+ E = null;
1163
+ let n = Le(t);
1164
+ n ? xe({
1165
+ blockId: e,
1166
+ holder: n,
1167
+ expiresAt: ""
1168
+ }) : h?.state.selectedBlockId === e && h.selectBlock(null);
1169
+ } else N(t), setTimeout(() => {
1170
+ E?.blockId === e && X();
1171
+ }, Ne[0]);
1172
+ }
1173
+ function Oe() {
1174
+ k ||= setInterval(() => {
1175
+ Y(async () => {
1176
+ let e = D;
1177
+ if (e) try {
1178
+ await n.renewLock(e.templateId, e.blockId);
1179
+ } catch (e) {
1180
+ if (Ie(e) === "lock_lost") {
1181
+ D = null, Z(), X();
1182
+ return;
1183
+ }
1184
+ N(e);
1185
+ }
1186
+ });
1187
+ }, Me);
1188
+ }
1189
+ function Z() {
1190
+ k &&= (clearInterval(k), null);
1191
+ }
1192
+ function Q(e) {
1193
+ H(), g && (E = e ? {
1194
+ templateId: g.templateId,
1195
+ blockId: e
1196
+ } : null, X());
1197
+ }
1198
+ function $() {
1199
+ H(), D && c && (n.releaseLock(D.templateId, D.blockId).catch(() => {}), D = null, Z()), g?.leave?.(), g && (g.leave = null);
1200
+ }
1201
+ function ke(e) {
1202
+ let t = g;
1203
+ if (!t || v) return;
1204
+ H();
1205
+ let n = (e === "undo" ? t.undo : t.redo).pop();
1206
+ if (!n) return;
1207
+ R();
1208
+ let r;
1209
+ try {
1210
+ r = F(t.view, n.ops, L());
1211
+ } catch (e) {
1212
+ if (!(e instanceof A)) throw e;
1213
+ I({
1214
+ type: "undoSkipped",
1215
+ code: e.code
1216
+ });
1217
+ return;
1218
+ }
1219
+ let i = { ops: Ae(t.view, n.ops) };
1220
+ te(e === "undo" ? t.redo : t.undo, i), t.view = r, z(r), h?.markDirty(), ie(t, n.ops, e, i);
1221
+ }
1222
+ function Fe(e) {
1223
+ h = e, T.push(_(() => e.state.template, (e) => be(e), { immediate: !0 }), _(() => e.content.value, ne, { deep: !0 }), _(() => e.state.selectedBlockId, Q), _(() => e.state.isLoading, (e) => e ? V(!0, !0) : ne())), typeof window < "u" && (window.addEventListener("pagehide", $), window.addEventListener("blur", H)), s() && i(Ge);
1224
+ }
1225
+ function He() {
1226
+ H();
1227
+ let e = g;
1228
+ return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1229
+ resolve: t,
1230
+ reject: n
1231
+ }));
1232
+ }
1233
+ function Ue() {
1234
+ H(), v = !0;
1235
+ }
1236
+ function We() {
1237
+ v = !1, g && z(g.view);
1238
+ }
1239
+ function Ge() {
1240
+ if (!w) {
1241
+ H();
1242
+ for (let e of T.splice(0)) e();
1243
+ B(), $(), w = !0, g && ve(g), g = null, Z(), typeof window < "u" && (window.removeEventListener("pagehide", $), window.removeEventListener("blur", H));
1244
+ }
1245
+ }
1246
+ return {
1247
+ sessionId: a,
1248
+ members: l,
1249
+ locks: d,
1250
+ connection: f,
1251
+ revision: p,
1252
+ canUndo: j,
1253
+ canRedo: M,
1254
+ attach: Fe,
1255
+ undo: () => ke("undo"),
1256
+ redo: () => ke("redo"),
1257
+ clearHistory: () => {
1258
+ g && (g.undo = [], g.redo = [], R());
1259
+ },
1260
+ flush: H,
1261
+ settle: He,
1262
+ suspend: Ue,
1263
+ resume: We,
1264
+ catchUp: J,
1265
+ hasConfirmedBlock: (e) => g ? ze(g.confirmed.blocks, e) : !1,
1266
+ destroy: Ge
1267
+ };
1268
+ }
1269
+ function Ue(e) {
1270
+ let { provider: t } = e, n = u([]), r = u(!1), i = b(() => {
1271
+ let e = /* @__PURE__ */ new Set();
1272
+ for (let t of n.value) {
1273
+ let n = t.category?.trim();
1274
+ n && e.add(n);
1275
+ }
1276
+ return [...e].sort((e, t) => e.localeCompare(t));
1277
+ }), a = b(() => typeof t.create == "function"), o = b(() => typeof t.update == "function"), s = b(() => typeof t.delete == "function");
1278
+ function c(e) {
1279
+ return o.value && e.canUpdate !== !1;
1280
+ }
1281
+ function l(e) {
1282
+ return s.value && e.canDelete !== !1;
1283
+ }
1284
+ function d(e, t) {
1285
+ throw new M(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1286
+ }
1287
+ function f(t) {
1288
+ K(e.onError, t);
1289
+ }
1290
+ async function p(i) {
1291
+ r.value = !0;
1292
+ try {
1293
+ n.value = await t.list(i);
1294
+ } catch (t) {
1295
+ throw e.onError?.(t), t;
1296
+ } finally {
1297
+ r.value = !1;
1298
+ }
1299
+ }
1300
+ async function m(r, i, a) {
1301
+ let { create: o } = t;
1302
+ typeof o != "function" && d("create", "disabled by the provider");
1303
+ try {
1304
+ let e = await o(a ? {
1305
+ name: r,
1306
+ content: i,
1307
+ category: a
1308
+ } : {
1309
+ name: r,
1310
+ content: i
1311
+ });
1312
+ return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
1313
+ } catch (t) {
1314
+ throw e.onError?.(t), t;
1315
+ }
1316
+ }
1317
+ async function h(r, i) {
1318
+ let { update: a } = t;
1319
+ typeof a != "function" && d("update", "disabled by the provider");
1320
+ let o = n.value.find((e) => e.id === r);
1321
+ o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
1322
+ try {
1323
+ let e = await a(r, i);
1324
+ return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
1325
+ } catch (t) {
1326
+ throw e.onError?.(t), t;
1327
+ }
1328
+ }
1329
+ async function g(r) {
1330
+ let { delete: i } = t;
1331
+ typeof i != "function" && d("delete", "disabled by the provider");
1332
+ let a = n.value.find((e) => e.id === r) ?? null;
1333
+ a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
1334
+ try {
1335
+ await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
1336
+ } catch (t) {
1337
+ throw e.onError?.(t), t;
1338
+ }
1339
+ }
1340
+ return {
1341
+ savedBlocks: n,
1342
+ isLoading: r,
1343
+ categories: i,
1344
+ canCreate: a,
1345
+ canUpdate: o,
1346
+ canDelete: s,
1347
+ canUpdateBlock: c,
1348
+ canDeleteBlock: l,
1349
+ load: p,
1350
+ create: m,
1351
+ update: h,
1352
+ remove: g
1353
+ };
1354
+ }
1355
+ var We = "templatical:saved-blocks";
1356
+ function Ge(e = {}) {
1357
+ let t = e.key ?? We;
1358
+ function n() {
1359
+ if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
1360
+ return localStorage;
1361
+ }
1362
+ function r() {
1363
+ let e = n().getItem(t);
1364
+ if (!e) return [];
1365
+ try {
1366
+ let t = JSON.parse(e);
1367
+ return Array.isArray(t) ? t : [];
1368
+ } catch {
1369
+ return [];
1370
+ }
1371
+ }
1372
+ function i(e) {
1373
+ n().setItem(t, JSON.stringify(e));
1374
+ }
1375
+ return {
1376
+ async list(e) {
1377
+ let t = r(), n = e?.search?.trim().toLowerCase(), i = e?.category?.trim();
1378
+ return t.filter((e) => !(n && !e.name.toLowerCase().includes(n) || i && e.category !== i));
1379
+ },
1380
+ async create(e) {
1381
+ let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1382
+ id: w(),
1383
+ name: e.name,
1384
+ content: e.content,
1385
+ ...e.category ? { category: e.category } : {},
1386
+ createdAt: t,
1387
+ updatedAt: t
1388
+ };
1389
+ return i([n, ...r()]), n;
1390
+ },
1391
+ async update(e, t) {
1392
+ let n = r(), a = n.findIndex((t) => t.id === e);
1393
+ if (a === -1) throw Error(`[Templatical] Saved block not found: ${e}`);
1394
+ let o = {
1395
+ ...n[a],
1396
+ ...t,
1397
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1398
+ }, s = [...n];
1399
+ return s[a] = o, i(s), o;
1400
+ },
1401
+ async delete(e) {
1402
+ let t = r();
1403
+ if (!t.some((t) => t.id === e)) throw Error(`[Templatical] Saved block not found: ${e}`);
1404
+ i(t.filter((t) => t.id !== e));
1405
+ }
1406
+ };
1407
+ }
1408
+ var Ke = "templatical:media", qe = 50;
1409
+ function Je(e = {}) {
1410
+ let t = e.key ?? Ke;
1411
+ function n() {
1412
+ if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
1413
+ return localStorage;
1414
+ }
1415
+ function r() {
1416
+ let e = n().getItem(t);
1417
+ if (!e) return [];
1418
+ try {
1419
+ let t = JSON.parse(e);
1420
+ return Array.isArray(t) ? t : [];
1421
+ } catch {
1422
+ return [];
1423
+ }
1424
+ }
1425
+ function i(e) {
1426
+ n().setItem(t, JSON.stringify(e));
1427
+ }
1428
+ function a(e) {
1429
+ return typeof FileReader > "u" ? Promise.reject(/* @__PURE__ */ Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with FileReader.")) : new Promise((t, n) => {
1430
+ let r = new FileReader();
1431
+ r.onload = () => {
1432
+ typeof r.result == "string" ? t(r.result) : n(/* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
1433
+ }, r.onerror = () => {
1434
+ n(r.error ?? /* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
1435
+ }, r.readAsDataURL(e);
1436
+ });
1437
+ }
1438
+ return {
1439
+ async list(e) {
1440
+ let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
1441
+ let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
1442
+ return t.includes(n) || r.includes(n);
1443
+ }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + qe), c = { items: s }, l = o + s.length;
1444
+ return l < i.length && (c.nextCursor = String(l)), c;
1445
+ },
1446
+ async create(e) {
1447
+ let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
1448
+ id: w(),
1449
+ url: t,
1450
+ filename: e.filename || e.file.name,
1451
+ createdAt: n,
1452
+ updatedAt: n,
1453
+ size: e.file.size
1454
+ };
1455
+ return e.alt !== void 0 && (o.alt = e.alt), e.file.type && (o.mimeType = e.file.type), e.folderId !== void 0 && (o.folderId = e.folderId), i([o, ...r()]), o;
1456
+ },
1457
+ async update(e, t) {
1458
+ let n = r(), a = n.findIndex((t) => t.id === e);
1459
+ if (a === -1) throw Error(`[Templatical] Media asset not found: ${e}`);
1460
+ let o = n[a], s = {
1461
+ ...o,
1462
+ ...t,
1463
+ id: o.id,
1464
+ url: o.url,
1465
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1466
+ }, c = [...n];
1467
+ return c[a] = s, i(c), s;
1468
+ },
1469
+ async delete(e) {
1470
+ let t = r();
1471
+ for (let n of e) if (!t.some((e) => e.id === n)) throw Error(`[Templatical] Media asset not found: ${n}`);
1472
+ let n = new Set(e);
1473
+ i(t.filter((e) => !n.has(e.id)));
1474
+ },
1475
+ folders: !1,
1476
+ replace: !1,
1477
+ importFromUrl: !1,
1478
+ checkUsage: !1,
1479
+ frequentlyUsed: !1,
1480
+ storage: !1
1481
+ };
1482
+ }
1483
+ function Ye(e) {
1484
+ let { provider: t, getTemplateId: n } = e, r = u([]), i = u(!1), a = u(void 0), o = u(!1), s = /* @__PURE__ */ new Map(), c = b(() => typeof t.create == "function"), l = b(() => typeof t.restore == "function");
1485
+ function d(e) {
1486
+ let t = n();
1487
+ if (!t) throw new M(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1488
+ return t;
1489
+ }
1490
+ function f(e) {
1491
+ throw new M(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1492
+ }
1493
+ function p(t) {
1494
+ K(e.onError, t);
1495
+ }
1496
+ async function m(n) {
1497
+ let o = d("list");
1498
+ i.value = !0;
1499
+ try {
1500
+ let e = await t.list(o, n);
1501
+ r.value = e.versions, a.value = e.nextCursor;
1502
+ } catch (t) {
1503
+ throw e.onError?.(t), t;
1504
+ } finally {
1505
+ i.value = !1;
1506
+ }
1507
+ }
1508
+ function h(e) {
1509
+ return e.content ?? s.get(e.id) ?? null;
1510
+ }
1511
+ async function g(n) {
1512
+ let r = h(n);
1513
+ if (r) return r;
1514
+ let i = d("get");
1515
+ try {
1516
+ let e = await t.get(i, n.id);
1517
+ return s.set(n.id, e), e;
1518
+ } catch (t) {
1519
+ throw e.onError?.(t), t;
1520
+ }
1521
+ }
1522
+ async function _(n, i) {
1523
+ let { create: a } = t;
1524
+ typeof a != "function" && f("create");
1525
+ let o = d("create");
1526
+ try {
1527
+ let e = await a(o, n, i);
1528
+ return r.value = [e, ...r.value], p(() => t.onCreated?.(e)), e;
1529
+ } catch (t) {
1530
+ throw e.onError?.(t), t;
1531
+ }
1532
+ }
1533
+ async function v(n) {
1534
+ let { restore: r } = t;
1535
+ typeof r != "function" && f("restore");
1536
+ let i = d("restore"), a;
1537
+ o.value = !0;
1538
+ try {
1539
+ a = await r(i, n);
1540
+ } catch (t) {
1541
+ throw e.onError?.(t), t;
1542
+ } finally {
1543
+ o.value = !1;
1544
+ }
1545
+ return p(() => t.onRestored?.(a)), a;
1546
+ }
1547
+ return {
1548
+ nextCursor: a,
1549
+ versions: r,
1550
+ isLoading: i,
1551
+ isRestoring: o,
1552
+ canCreate: c,
1553
+ canRestore: l,
1554
+ load: m,
1555
+ peekContent: h,
1556
+ resolveContent: g,
1557
+ create: _,
1558
+ restore: v
1559
+ };
1560
+ }
1561
+ function Xe(e) {
1562
+ let { provider: t, getTemplateId: n, getUser: r } = e, i = u([]), a = u(!1), o = u(!1), s = b(() => typeof t.create == "function"), c = b(() => typeof t.update == "function"), l = b(() => typeof t.delete == "function"), d = b(() => typeof t.setResolved == "function"), f = b(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = b(() => i.value.filter((e) => !e.resolvedAt).length), m = b(() => {
1563
+ let e = /* @__PURE__ */ new Map();
1564
+ for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1565
+ return e;
1566
+ });
1567
+ function h(e) {
1568
+ let t = n();
1569
+ if (!t) throw new M(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1570
+ return t;
1571
+ }
1572
+ function g(e) {
1573
+ let t = r();
1574
+ if (!t) throw new M(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1575
+ return t;
1576
+ }
1577
+ function _(e) {
1578
+ throw new M(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1579
+ }
1580
+ function v(e) {
1581
+ for (let t of i.value) {
1582
+ if (t.id === e) return t;
1583
+ for (let n of t.replies ?? []) if (n.id === e) return n;
1584
+ }
1585
+ return null;
1586
+ }
1587
+ function y(e) {
1588
+ let t = r();
1589
+ return t !== null && e.author.id === t.id;
1590
+ }
1591
+ function x(t) {
1592
+ let n = ue(t);
1593
+ throw e.onError?.(n), n;
1594
+ }
1595
+ function S(t) {
1596
+ K(e.onError, t);
1597
+ }
1598
+ function C(e, t, n) {
1599
+ return [
1600
+ ...e.slice(0, t),
1601
+ n,
1602
+ ...e.slice(t + 1)
1603
+ ];
1604
+ }
1605
+ function w(e, t) {
1606
+ return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
1607
+ }
1608
+ function T(e) {
1609
+ if (e.parentId) {
1610
+ let t = !1, n = i.value.map((n) => {
1611
+ if (n.id !== e.parentId) return n;
1612
+ let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
1613
+ return i !== -1 && w(r[i], e) ? n : (t = !0, {
1614
+ ...n,
1615
+ replies: i === -1 ? [...r, e] : C(r, i, e)
1616
+ });
1617
+ });
1618
+ return t && (i.value = n), t;
1619
+ }
1620
+ let t = i.value.findIndex((t) => t.id === e.id);
1621
+ if (t === -1) return i.value = [...i.value, e], !0;
1622
+ let n = {
1623
+ ...e,
1624
+ replies: e.replies ?? i.value[t].replies
1625
+ };
1626
+ return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
1627
+ }
1628
+ function E(e, t) {
1629
+ let n = v(e), r = t ?? n?.parentId ?? null;
1630
+ return r ? i.value = i.value.map((t) => t.id === r ? {
1631
+ ...t,
1632
+ replies: (t.replies ?? []).filter((t) => t.id !== e)
1633
+ } : t) : i.value = i.value.filter((t) => t.id !== e), n;
1634
+ }
1635
+ async function D(e) {
1636
+ let n = h("list");
1637
+ a.value = !0;
1638
+ try {
1639
+ i.value = await t.list(n, e);
1640
+ } catch (e) {
1641
+ x(e);
1642
+ } finally {
1643
+ a.value = !1;
1644
+ }
1645
+ }
1646
+ async function O(e) {
1647
+ let { create: n } = t;
1648
+ typeof n != "function" && _("create");
1649
+ let r = h("create");
1650
+ g("create"), o.value = !0;
1651
+ try {
1652
+ let i = await n(r, e);
1653
+ return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
1654
+ } catch (e) {
1655
+ x(e);
1656
+ } finally {
1657
+ o.value = !1;
1658
+ }
1659
+ }
1660
+ async function k(e, n) {
1661
+ let { update: r } = t;
1662
+ typeof r != "function" && _("update");
1663
+ let i = h("update");
1664
+ g("update"), o.value = !0;
1665
+ try {
1666
+ let a = await r(i, e, n);
1667
+ return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
1668
+ } catch (e) {
1669
+ x(e);
1670
+ } finally {
1671
+ o.value = !1;
1672
+ }
1673
+ }
1674
+ async function A(e) {
1675
+ let { delete: n } = t;
1676
+ typeof n != "function" && _("delete");
1677
+ let r = h("delete");
1678
+ g("delete");
1679
+ let i = v(e);
1680
+ o.value = !0;
1681
+ try {
1682
+ await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
1683
+ } catch (e) {
1684
+ x(e);
1685
+ } finally {
1686
+ o.value = !1;
1687
+ }
1688
+ }
1689
+ async function j(e, n) {
1690
+ let { setResolved: r } = t;
1691
+ typeof r != "function" && _("setResolved");
1692
+ let i = h("setResolved");
1693
+ g("setResolved"), o.value = !0;
1694
+ try {
1695
+ let a = await r(i, e, n);
1696
+ return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
1697
+ } catch (e) {
1698
+ x(e);
1699
+ } finally {
1700
+ o.value = !1;
1701
+ }
1702
+ }
1703
+ function N(e) {
1704
+ T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
1705
+ }
1706
+ function ee(e) {
1707
+ T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
1708
+ }
1709
+ function P(e, n) {
1710
+ let r = E(e, n);
1711
+ r && S(() => t.onDeleted?.(r, { origin: "remote" }));
1712
+ }
1713
+ return {
1714
+ comments: i,
1715
+ isLoading: a,
1716
+ isSubmitting: o,
1717
+ canCreate: s,
1718
+ canUpdate: c,
1719
+ canDelete: l,
1720
+ canResolve: d,
1721
+ totalCount: f,
1722
+ unresolvedCount: p,
1723
+ commentCountByBlock: m,
1724
+ load: D,
1725
+ create: O,
1726
+ update: k,
1727
+ remove: A,
1728
+ setResolved: j,
1729
+ find: v,
1730
+ isOwn: y,
1731
+ applyRemoteCreate: N,
1732
+ applyRemoteUpdate: ee,
1733
+ applyRemoteDelete: P
1734
+ };
1735
+ }
1736
+ function Ze(e) {
1737
+ let { comments: t, provider: n, getTemplateId: r } = e, { subscribe: o } = n;
1738
+ if (typeof o != "function") return;
1739
+ let s = null;
1740
+ function c() {
1741
+ s?.(), s = null;
1742
+ }
1743
+ a(() => r(), (e) => {
1744
+ c(), e && (s = o(e, (e) => {
1745
+ switch (e.type) {
1746
+ case "created":
1747
+ t.applyRemoteCreate(e.comment);
1748
+ break;
1749
+ case "updated":
1750
+ t.applyRemoteUpdate(e.comment);
1751
+ break;
1752
+ case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
1753
+ }
1754
+ }));
1755
+ }, { immediate: !0 }), i(c);
1756
+ }
1757
+ //#endregion
1758
+ //#region src/composables/useImageUrlResolver.ts
1759
+ function Qe(e) {
1760
+ let t = l(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1761
+ function r(e) {
1762
+ return t.get(e);
1763
+ }
1764
+ function i(e) {
1765
+ return t.has(e) || n.has(e);
1766
+ }
1767
+ function a(r) {
1768
+ if (i(r)) return;
1769
+ let a;
1770
+ try {
1771
+ a = e(r);
1772
+ } catch {
1773
+ t.set(r, null);
1774
+ return;
1775
+ }
1776
+ a === null || typeof a == "string" ? t.set(r, a) : (n.add(r), Promise.resolve(a).then((e) => {
1777
+ t.set(r, typeof e == "string" ? e : null);
1778
+ }, () => {
1779
+ t.set(r, null);
1780
+ }).finally(() => n.delete(r)));
1781
+ }
1782
+ return {
1783
+ get: r,
1784
+ has: i,
1785
+ lookup: a
1786
+ };
1787
+ }
1788
+ function $e(e) {
1789
+ let t = o(ie, null), n = b(e);
1790
+ if (!t) return n;
1791
+ let r;
1792
+ function c() {
1793
+ r !== void 0 && (clearTimeout(r), r = void 0);
1794
+ }
1795
+ s() && i(c);
1796
+ let l = !0;
1797
+ return a(n, (e) => {
1798
+ c();
1799
+ let n = l;
1800
+ l = !1, e && !t.has(e) && (n ? t.lookup(e) : r = setTimeout(() => {
1801
+ r = void 0, t.lookup(e);
1802
+ }, 300));
1803
+ }, { immediate: !0 }), b(() => {
1804
+ let e = n.value;
1805
+ if (!e) return e;
1806
+ let r = t.get(e);
1807
+ return typeof r == "string" && r.length > 0 ? r : e;
1808
+ });
1809
+ }
1810
+ function et(e, t) {
1811
+ if (!e || !t) return t;
1812
+ let n = e.get(t);
1813
+ return typeof n == "string" && n.length > 0 ? n : t;
1814
+ }
1815
+ function tt(e, t) {
1816
+ return typeof e?.url == "string" && k(e.url, t);
1817
+ }
1818
+ function nt(e, t) {
1819
+ let n = e?.url;
1820
+ if (typeof n == "string" && n.trim() !== "") return k(n, t) ? void 0 : n;
1821
+ }
1822
+ function rt(e) {
1823
+ let t = o(H, j.liquid), n = $e(() => nt(e(), t));
1824
+ return b(() => tt(e(), t) ? null : n.value);
1825
+ }
1826
+ function it(e, t, n) {
1827
+ return tt(t, n) ? null : et(e, nt(t, n));
1828
+ }
1829
+ //#endregion
1830
+ //#region src/utils/blockTypeLabels.ts
1831
+ function at(e, t) {
1832
+ return t.blocks[e] ?? e;
1833
+ }
1834
+ function ot(e, t, n = []) {
1835
+ if (e.type !== "custom") return at(e.type, t);
1836
+ let { customType: r } = e;
1837
+ return n.find((e) => e.type === r)?.name ?? r;
1838
+ }
1839
+ //#endregion
1840
+ //#region src/utils/resolveFieldColors.ts
1841
+ function st(e, t) {
1842
+ let n = W({ presets: e.presets }, oe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
1843
+ return {
1844
+ presets: r ? t.presets : n.presets,
1845
+ allowCustom: t.allowCustom !== !1 && i,
1846
+ invalidPresets: n.invalidPresets,
1847
+ emptyPresets: e.presets !== void 0 && e.presets.length === 0,
1848
+ presetsInherited: r,
1849
+ allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1850
+ };
1851
+ }
1852
+ var ct = G({
1853
+ name: "code",
1854
+ size: 24,
1855
+ node: [["path", {
1856
+ d: "m16 18 6-6-6-6",
1857
+ key: "eg8j8"
1858
+ }], ["path", {
1859
+ d: "m8 6-6 6 6 6",
1860
+ key: "ppft3o"
1861
+ }]]
1862
+ }), lt = G({
1863
+ name: "image",
1864
+ size: 24,
1865
+ node: [
1866
+ ["rect", {
1867
+ width: "18",
1868
+ height: "18",
1869
+ x: "3",
1870
+ y: "3",
1871
+ rx: "2",
1872
+ ry: "2",
1873
+ key: "1m3agn"
1874
+ }],
1875
+ ["circle", {
1876
+ cx: "9",
1877
+ cy: "9",
1878
+ r: "2",
1879
+ key: "af1f0g"
1880
+ }],
1881
+ ["path", {
1882
+ d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
1883
+ key: "1xmnt7"
1884
+ }]
1885
+ ]
1886
+ }), ut = G({
1887
+ name: "navigation",
1888
+ size: 24,
1889
+ node: [["polygon", {
1890
+ points: "3 11 22 2 13 21 11 13 3 11",
1891
+ key: "1ltx0t"
1892
+ }]]
1893
+ }), dt = G({
1894
+ name: "share-2",
1895
+ size: 24,
1896
+ node: [
1897
+ ["circle", {
1898
+ cx: "18",
1899
+ cy: "5",
1900
+ r: "3",
1901
+ key: "gq8acd"
1902
+ }],
1903
+ ["circle", {
1904
+ cx: "6",
1905
+ cy: "12",
1906
+ r: "3",
1907
+ key: "w7nqdw"
1908
+ }],
1909
+ ["circle", {
1910
+ cx: "18",
1911
+ cy: "19",
1912
+ r: "3",
1913
+ key: "1xt0gg"
1914
+ }],
1915
+ ["line", {
1916
+ x1: "8.59",
1917
+ x2: "15.42",
1918
+ y1: "13.51",
1919
+ y2: "17.49",
1920
+ key: "47mynk"
1921
+ }],
1922
+ ["line", {
1923
+ x1: "15.41",
1924
+ x2: "8.59",
1925
+ y1: "6.51",
1926
+ y2: "10.49",
1927
+ key: "1n3mei"
1928
+ }]
1929
+ ]
1930
+ }), ft = G({
1931
+ name: "table",
1932
+ size: 24,
1933
+ node: [
1934
+ ["path", {
1935
+ d: "M12 3v18",
1936
+ key: "108xh3"
1937
+ }],
1938
+ ["rect", {
1939
+ width: "18",
1940
+ height: "18",
1941
+ x: "3",
1942
+ y: "3",
1943
+ rx: "2",
1944
+ key: "afitv7"
1945
+ }],
1946
+ ["path", {
1947
+ d: "M3 9h18",
1948
+ key: "1pudct"
1949
+ }],
1950
+ ["path", {
1951
+ d: "M3 15h18",
1952
+ key: "5xshup"
1953
+ }]
1954
+ ]
1955
+ });
1956
+ //#endregion
1957
+ //#region src/utils/imageNaturalSize.ts
1958
+ function pt(e) {
1959
+ return typeof e == "number" && Number.isFinite(e) && e > 0;
1960
+ }
1961
+ function mt(e, t) {
1962
+ return pt(e) && pt(t) ? {
1963
+ width: e,
1964
+ height: t
1965
+ } : null;
1966
+ }
1967
+ function ht(e) {
1968
+ return mt(e.naturalWidth, e.naturalHeight);
1969
+ }
1970
+ function gt(e) {
1971
+ return e ? {
1972
+ naturalWidth: e.width,
1973
+ naturalHeight: e.height
1974
+ } : {
1975
+ naturalWidth: void 0,
1976
+ naturalHeight: void 0
1977
+ };
1978
+ }
1979
+ function _t(e, t) {
1980
+ if (typeof Image > "u") return t(null), () => {};
1981
+ let n = new Image(), r = () => {
1982
+ n.onload = null, n.onerror = null;
1983
+ };
1984
+ return n.onload = () => {
1985
+ r(), t(mt(n.naturalWidth, n.naturalHeight));
1986
+ }, n.onerror = () => {
1987
+ r(), t(null);
1988
+ }, n.src = e, r;
1989
+ }
1990
+ function vt(e) {
1991
+ return new Promise((t) => {
1992
+ let n = setTimeout(() => {
1993
+ r(), t(null);
1994
+ }, U), r = _t(e, (e) => {
1995
+ clearTimeout(n), t(e);
1996
+ });
1997
+ });
1998
+ }
1999
+ //#endregion
2000
+ //#region src/components/MediaDropOverlay.vue
2001
+ var yt = /* @__PURE__ */ x({
2002
+ __name: "MediaDropOverlay",
2003
+ props: {
2004
+ uploading: { type: Boolean },
2005
+ size: { default: "field" }
2006
+ },
2007
+ setup(e) {
2008
+ let r = e, { t: i } = ae(), a = {
2009
+ field: {
2010
+ gap: "tpl:gap-1.5",
2011
+ icon: 18,
2012
+ veil: "90%"
2013
+ },
2014
+ canvas: {
2015
+ gap: "tpl:gap-2",
2016
+ icon: 20,
2017
+ veil: "85%"
2018
+ }
2019
+ }, o = b(() => a[r.size]);
2020
+ return (r, a) => (t(), f("div", {
2021
+ class: g(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", o.value.gap]),
2022
+ style: n({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
2023
+ }, [e.uploading ? (t(), f(v, { key: 0 }, [p(d(se), {
2024
+ class: "tpl-spinner",
2025
+ size: o.value.icon,
2026
+ "stroke-width": 2
2027
+ }, null, 8, ["size"]), m(" " + h(d(i).image.uploading), 1)], 64)) : (t(), f(v, { key: 1 }, [p(d(ce), {
2028
+ size: o.value.icon,
2029
+ "stroke-width": 1.5
2030
+ }, null, 8, ["size"]), m(" " + h(d(i).image.dropToUpload), 1)], 64))], 6));
2031
+ }
2032
+ }), bt = "image/";
2033
+ function xt(e) {
2034
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || y(r), { isOverDropZone: a } = B(t, {
2035
+ preventDefaultForUnhandled: !0,
2036
+ onDrop: (e) => {
2037
+ if (!i()) return;
2038
+ let t = (e ?? []).filter((e) => e.type.startsWith(bt));
2039
+ t.length > 0 && n([t[0]]);
2040
+ }
2041
+ });
2042
+ return { isOver: b(() => i() && a.value) };
2043
+ }
2044
+ //#endregion
2045
+ //#region src/composables/useMediaDropField.ts
2046
+ function St(e) {
2047
+ let { target: t, blocked: n, apply: r } = e, i = o(V, null), a = o(re, null), s = le();
2048
+ async function c() {
2049
+ let e = await i?.({ accept: ["images"] });
2050
+ s.alive && e && r(e);
2051
+ }
2052
+ let l = u(!1), d = b(() => (a?.value ?? !!i) && !l.value && !y(n));
2053
+ async function f(e) {
2054
+ if (i) {
2055
+ l.value = !0;
2056
+ try {
2057
+ let t = await i({
2058
+ accept: ["images"],
2059
+ files: e
2060
+ });
2061
+ if (!s.alive) return;
2062
+ t && r(t);
2063
+ } finally {
2064
+ s.alive && (l.value = !1);
2065
+ }
2066
+ }
2067
+ }
2068
+ let { isOver: p } = xt({
2069
+ target: t,
2070
+ enabled: d,
2071
+ onFiles: f
2072
+ }), m = b(() => d.value && p.value || l.value);
2073
+ return {
2074
+ canBrowse: !!i,
2075
+ dropEnabled: d,
2076
+ isUploading: l,
2077
+ showOverlay: m,
2078
+ openMediaBrowser: c
2079
+ };
2080
+ }
2081
+ function Ct(e, t = "desktop") {
2082
+ return t === "mobile" ? 375 : e?.width ?? 600;
2083
+ }
2084
+ var wt = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", Tt = {
2085
+ 1: [100],
2086
+ 2: [50, 50],
2087
+ 3: [
2088
+ 33.33,
2089
+ 33.33,
2090
+ 33.34
2091
+ ],
2092
+ "1-2": [33.33, 66.67],
2093
+ "2-1": [66.67, 33.33]
2094
+ };
2095
+ function Et(e, t) {
2096
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => D(e) === null ? 0 : Math.trunc(e.width);
2097
+ return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2098
+ }
2099
+ function Dt(e, t) {
2100
+ return Math.floor(e) - Et(t);
2101
+ }
2102
+ function Ot(e, t) {
2103
+ let n = "border" in e ? e.border : void 0;
2104
+ return Math.floor(t) - Et(e.styles.padding, n);
2105
+ }
2106
+ function* kt(e, t) {
2107
+ for (let n of e) R(n) ? yield* kt(n.children, Dt(t, n.styles.padding)) : yield {
2108
+ block: n,
2109
+ bandWidth: I(n) && n.wrapper ? Dt(t, n.wrapper.padding) : t
2110
+ };
2111
+ }
2112
+ function At(e, t) {
2113
+ if (!t) return e;
2114
+ try {
2115
+ return L(t, e);
2116
+ } catch {
2117
+ return e;
2118
+ }
2119
+ }
2120
+ function jt(e, t, n) {
2121
+ let r = At(e, n);
2122
+ for (let { block: e, bandWidth: n } of kt(r.blocks, r.settings.width)) if (I(e)) {
2123
+ let r = N(e)?.applied ? void 0 : e.border, i = Math.floor(n) - Et(e.styles.padding, r), a = Tt[e.columns] ?? [100];
2124
+ for (let n = 0; n < e.children.length; n++) {
2125
+ let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2126
+ if (o) return Ot(o, r);
2127
+ }
2128
+ } else if (e.id === t) return Ot(e, n);
2129
+ return null;
2130
+ }
2131
+ function Mt(e, t, n) {
2132
+ let r = At(e, n);
2133
+ for (let { block: e, bandWidth: n } of kt(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
2134
+ return null;
2135
+ }
2136
+ function Nt(e, t, n) {
2137
+ if (!I(e)) return;
2138
+ let r = N(e);
2139
+ if (r?.applied && r.height === "image") return (t ? Mt(t, e.id, n) : null) ?? Ct(t?.settings);
2140
+ }
2141
+ //#endregion
2142
+ //#region src/constants/socialIcons.ts
2143
+ var Pt = te, Ft = {
2144
+ small: 24,
2145
+ medium: 32,
2146
+ large: 48
2147
+ }, It = [
2148
+ "facebook",
2149
+ "twitter",
2150
+ "instagram",
2151
+ "linkedin",
2152
+ "youtube",
2153
+ "tiktok",
2154
+ "pinterest",
2155
+ "email",
2156
+ "website",
2157
+ "whatsapp",
2158
+ "telegram",
2159
+ "discord",
2160
+ "snapchat",
2161
+ "reddit",
2162
+ "github",
2163
+ "dribbble",
2164
+ "behance"
2165
+ ];
2166
+ //#endregion
2167
+ export { Je as A, J as B, at as C, rt as D, it as E, Ze as F, Ue as H, Xe as I, _e as L, ge as M, me as N, $e as O, He as P, ve as R, ot as S, nt as T, Ye as U, ye as V, dt as _, Nt as a, ct as b, Ct as c, _t as d, vt as f, ft as g, mt as h, jt as i, Ge as j, he as k, St as l, ht as m, Pt as n, Mt as o, gt as p, It as r, wt as s, Ft as t, yt as u, ut as v, Qe as w, st as x, lt as y, de as z };