@aswin.dev/editor 0.7.1 → 0.7.2

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 (144) hide show
  1. package/LICENSE +56 -0
  2. package/dist/{AccessibilityPanel-COL6Wm7p.js → AccessibilityPanel-EmQ19wiS.js} +1 -1
  3. package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-DeB0w_32.js} +38 -52
  4. package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-DoLD5Cde.js} +5 -5
  5. package/dist/{BlockA11yBadge-Qs6HtXid.js → BlockA11yBadge-DkNbDvJA.js} +1 -1
  6. package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-zo9PjjvY.js} +255 -248
  7. package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-BsXMY-8e.js} +3 -3
  8. package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DIWIa4rS.js} +6 -6
  9. package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-BuS8p5ju.js} +2 -2
  10. package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-RDlnhL-6.js} +5 -5
  11. package/dist/{LoadingTrack-Ba2pfF57.js → LoadingTrack-BJ59h9ok.js} +1 -1
  12. package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-b7HbpByz.js} +7 -7
  13. package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-D__YlOLS.js} +1 -1
  14. package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-Ca3vNY84.js} +1 -1
  15. package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-B1aYPO-6.js} +18 -18
  16. package/dist/{RichTextEditorContent-CrqPQdnk.js → RichTextEditorContent-BmEVMrkJ.js} +1 -1
  17. package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-ClovqI6h.js} +3 -3
  18. package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-DoqtH0cw.js} +3 -3
  19. package/dist/{TemplateScoringPanel-CS7o62zS.js → TemplateScoringPanel-DQv2ZAiL.js} +7 -7
  20. package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-iIeYJYsj.js} +3 -3
  21. package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CTDIwRF_.js} +7 -7
  22. package/dist/{TplModal-BAsVzcTb.js → TplModal-CBq1J1pG.js} +1 -1
  23. package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-QkC6f5UE.js} +1 -1
  24. package/dist/bundle-stats.json +7 -7
  25. package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js +97 -0
  26. package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js.map +1 -0
  27. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js +59 -0
  28. package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
  29. package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js +33 -0
  30. package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js.map +1 -0
  31. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js +1183 -0
  32. package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
  33. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js +51 -0
  34. package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
  35. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
  36. package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
  38. package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
  39. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js +195 -0
  40. package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
  41. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
  42. package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
  43. package/dist/cdn/chunks/NumberWithSuffix-Ty1bp9vB.js +423 -0
  44. package/dist/cdn/chunks/NumberWithSuffix-Ty1bp9vB.js.map +1 -0
  45. package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js +544 -0
  46. package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js.map +1 -0
  47. package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js +106 -0
  48. package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js.map +1 -0
  49. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js +119 -0
  50. package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
  51. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js +171 -0
  52. package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
  53. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
  54. package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
  55. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  56. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  57. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  58. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  59. package/dist/cdn/chunks/de-_tooy3Q8.js +771 -0
  60. package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
  61. package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
  62. package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
  63. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  64. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  65. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  66. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  67. package/dist/cdn/chunks/en-CNqLoIm9.js +771 -0
  68. package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
  69. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  70. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  71. package/dist/cdn/chunks/extensions-BVKQw_sp.js +598 -0
  72. package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
  73. package/dist/cdn/chunks/features-DIBEo4xl.js +7913 -0
  74. package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
  75. package/dist/cdn/chunks/icons-C1Gg-ov-.js +992 -0
  76. package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
  77. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  78. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  79. package/dist/cdn/chunks/media-library-BTF_Ko70.js +6014 -0
  80. package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
  81. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  82. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  83. package/dist/cdn/chunks/quality-C5AmotmP.js +1456 -0
  84. package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
  85. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  86. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  87. package/dist/cdn/chunks/renderer-D0L44Vlp.js +642 -0
  88. package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
  89. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  90. package/dist/cdn/chunks/src-RKexlYjA.js +497 -0
  91. package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
  92. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
  93. package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
  94. package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
  95. package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
  96. package/dist/cdn/chunks/tiptap-CDzAbF2j.js +14654 -0
  97. package/dist/cdn/chunks/tiptap-CDzAbF2j.js.map +1 -0
  98. package/dist/cdn/editor.css +2 -0
  99. package/dist/cdn/editor.js +338 -0
  100. package/dist/cdn/editor.js.map +1 -0
  101. package/dist/{cloud-6ZmAvF0j.js → cloud-DJG4tb4_.js} +1 -1
  102. package/dist/{de-DWcgp-7T.js → de-2LEvILeZ.js} +40 -0
  103. package/dist/{dist-DtiDUrX-.js → dist-BHAeXaUY.js} +1 -1
  104. package/dist/{dist-BUzw1buG.js → dist-BSJvAvH3.js} +1 -1
  105. package/dist/{dist-COSzWQUs.js → dist-BeFnymxK.js} +1 -1
  106. package/dist/dist-Bmir0gYb.js +1167 -0
  107. package/dist/{dist-C3T2AKtB.js → dist-BvPgo-UK.js} +1 -1
  108. package/dist/{dist-C9ckKEZL.js → dist-CPVBKMmd.js} +1 -1
  109. package/dist/{dist-BadNx4qo.js → dist-Df4ie7vZ.js} +1 -1
  110. package/dist/{dist-CBItRG-Z.js → dist-DxOoemkW.js} +1 -1
  111. package/dist/{dist-Dzt5foyL.js → dist-HEQ52gTJ.js} +1 -1
  112. package/dist/{dist-BZyY-SS4.js → dist-b-XUqAoF.js} +1 -1
  113. package/dist/{dist-Bz3M4RXG.js → dist-kZfaVUpW.js} +3 -3
  114. package/dist/{dist-BesOh2mk.js → dist-wfAedlzi.js} +1 -1
  115. package/dist/{en-Cxd4fhNm.js → en-D2RU2Poj.js} +40 -0
  116. package/dist/{extensions-D__hOlV1.js → extensions-BQ1xXx3d.js} +21 -21
  117. package/dist/index.d.ts +17 -6
  118. package/dist/style.css +1 -1
  119. package/dist/{styles-B4tjX5SP.js → styles-CavWjvol.js} +1573 -1310
  120. package/dist/templatical-editor.js +161 -132
  121. package/dist/undo-2-Cg8I7obC.js +16 -0
  122. package/dist/{useEditorCore-wslttMH-.js → useEditorCore-BGnzcT7p.js} +37 -37
  123. package/dist/{useMergeTag-DX0XG5V9.js → useMergeTag-CfuZq2fF.js} +3 -3
  124. package/package.json +12 -12
  125. package/dist/dist-C04s_fLA.js +0 -563
  126. /package/dist/{CountdownBlock-DaYGxKqo.js → CountdownBlock-BCi7-DAM.js} +0 -0
  127. /package/dist/{_plugin-vue_export-helper-BVAJ4lgT.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
  128. /package/dist/{de-GOtR9DwW.js → de-D2npYjrZ.js} +0 -0
  129. /package/dist/{dist-DXa1uAMh.js → dist-DvHLtWVP.js} +0 -0
  130. /package/dist/{emojiData-DrBuvEoP.js → emojiData-DvQBBzmO.js} +0 -0
  131. /package/dist/{en-dFFQVzNn.js → en-ib-4h3_o.js} +0 -0
  132. /package/dist/{formatRelativeTime-BhhO8yCl.js → formatRelativeTime-CFDZnEIs.js} +0 -0
  133. /package/dist/{liquid.browser-BvCyLQII.js → liquid.browser-7Rv0QDiO.js} +0 -0
  134. /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
  135. /package/dist/{scan-line-CzfFJO1o.js → scan-line-DlghmhNf.js} +0 -0
  136. /package/dist/{send-D2eSo4GH.js → send-DDdhIRj8.js} +0 -0
  137. /package/dist/{shield-check-jkpgcC0-.js → shield-check-OSQ-JVTX.js} +0 -0
  138. /package/dist/{sparkles-Chm5CZfb.js → sparkles-BN4a-CoF.js} +0 -0
  139. /package/dist/{styleConstants-34eUKPOZ.js → styleConstants-wWRbcuEK.js} +0 -0
  140. /package/dist/{text-align-start-CzBnJsW8.js → text-align-start-D1weisjS.js} +0 -0
  141. /package/dist/{trash-2-CtK2apEH.js → trash-2-CMWvQ5KX.js} +0 -0
  142. /package/dist/{triangle-alert-KpDVNbpn.js → triangle-alert-DyidRNX_.js} +0 -0
  143. /package/dist/{useCloudI18n-DOKSZql1.js → useCloudI18n-BTTNBk5i.js} +0 -0
  144. /package/dist/{x-BkaOMosX.js → x-CgIhNcT9.js} +0 -0
@@ -0,0 +1,1183 @@
1
+ import { C as e, F as t, G as n, H as r, I as i, M as a, N as o, P as s, Q as c, S as l, W as u, _ as d, b as f, ct as p, d as m, dt as h, f as g, ft as _, g as v, h as y, l as b, m as x, n as S, rt as C, tt as w, ut as T, v as E, x as D, y as O } from "./draggable-C-1_gch3.js";
2
+ import { C as k, D as A, Dt as j, Ft as ee, Gt as M, Kt as N, Lt as P, Mt as F, Nn as I, On as L, Ot as R, Pn as te, S as z, Vn as B, Vt as V, Wt as ne, X as re, _ as H, b as ie, bn as U, c as W, cn as ae, d as G, et as K, f as q, g as J, h as Y, in as oe, k as se, l as X, ln as Z, m as ce, nn as le, nt as ue, p as de, pt as fe, rn as pe, st as me, tn as he, tr as Q, u as ge, ut as $, v as _e, vt as ve, x as ye, y as be, yt as xe, zt as Se } from "./features-DIBEo4xl.js";
3
+ import { T as Ce, w as we } from "./icons-C1Gg-ov-.js";
4
+ import { a as Te, c as Ee, d as De, f as Oe, h as ke, i as Ae, l as je, m as Me, n as Ne, p as Pe, r as Fe, s as Ie, t as Le, u as Re } from "./styles-CQR6ed13.js";
5
+ import { d as ze } from "./styleConstants-PgmvNBzQ.js";
6
+ //#region src/cloud/composables/useSnapshotPreview.ts
7
+ function Be(e) {
8
+ let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: a, onError: o } = e, s = C(null), l = w(null), u = w(null), d = !1;
9
+ c(() => {
10
+ d = !0;
11
+ });
12
+ let f = x(() => l.value !== null), p = x(() => s.value?.snapshots.value ?? []), m = x(() => s.value?.isLoading.value ?? !1), h = x(() => s.value?.isRestoring.value ?? !1);
13
+ function g() {
14
+ n.state.template?.id && !s.value && (s.value = de({
15
+ authManager: t,
16
+ templateId: n.state.template.id,
17
+ onRestore: _,
18
+ onError: o
19
+ }), s.value.loadSnapshots());
20
+ }
21
+ function _(e) {
22
+ n.setContent(e.content, !1), r.clear(), i.reset();
23
+ }
24
+ async function v(e) {
25
+ if (!d) {
26
+ if (l.value) {
27
+ l.value = e, n.setContent(e.content, !1);
28
+ return;
29
+ }
30
+ n.state.isDirty && n.hasTemplate() && (await n.createSnapshot(), d) || (u.value = structuredClone(n.content.value), a?.pause(), l.value = e, n.setContent(e.content, !1));
31
+ }
32
+ }
33
+ async function y() {
34
+ if (!(!l.value || !s.value)) try {
35
+ if (await s.value.restoreSnapshot(l.value.id), d || (await s.value.loadSnapshots(), d)) return;
36
+ } finally {
37
+ d || (l.value = null, u.value = null, a?.resume());
38
+ }
39
+ }
40
+ function b() {
41
+ !l.value || !u.value || (n.setContent(u.value, !1), l.value = null, u.value = null, a?.resume());
42
+ }
43
+ async function S() {
44
+ d || s.value && await s.value.loadSnapshots();
45
+ }
46
+ return {
47
+ snapshotHistoryInstance: s,
48
+ previewingSnapshot: l,
49
+ contentBeforePreview: u,
50
+ isPreviewingSnapshot: f,
51
+ snapshotHistorySnapshots: p,
52
+ snapshotHistoryIsLoading: m,
53
+ snapshotHistoryIsRestoring: h,
54
+ initSnapshotHistory: g,
55
+ handleRestore: _,
56
+ handleSnapshotNavigate: v,
57
+ confirmRestoreSnapshot: y,
58
+ cancelPreview: b,
59
+ loadSnapshotHistory: S
60
+ };
61
+ }
62
+ //#endregion
63
+ //#region src/cloud/composables/useCloudPanelState.ts
64
+ function Ve() {
65
+ let e = w(null), t = x({
66
+ get: () => e.value === "ai-chat",
67
+ set: (t) => e.value = t ? "ai-chat" : null
68
+ }), n = x({
69
+ get: () => e.value === "scoring",
70
+ set: (t) => e.value = t ? "scoring" : null
71
+ }), r = x({
72
+ get: () => e.value === "design-reference",
73
+ set: (t) => e.value = t ? "design-reference" : null
74
+ }), i = x({
75
+ get: () => e.value === "comments",
76
+ set: (t) => e.value = t ? "comments" : null
77
+ }), a = w(!1), o = w(!1), s = w(void 0), c = w(!1), l = w(null), u = x(() => e.value !== null), d = x(() => {
78
+ let t = e.value;
79
+ return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
80
+ }), f = x(() => c.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
81
+ function p() {
82
+ c.value = !c.value;
83
+ }
84
+ function m(t) {
85
+ c.value = !1, e.value = e.value === t ? null : t;
86
+ }
87
+ return Z(l, () => {
88
+ c.value = !1;
89
+ }), {
90
+ activePanel: e,
91
+ aiChatOpen: t,
92
+ scoringPanelOpen: n,
93
+ designReferenceOpen: r,
94
+ commentsOpen: i,
95
+ testEmailModalOpen: a,
96
+ mediaLibraryOpen: o,
97
+ mediaLibraryAccept: s,
98
+ aiMenuOpen: c,
99
+ aiMenuRef: l,
100
+ rightPanelOpen: u,
101
+ activeAiFeature: d,
102
+ aiButtonActive: f,
103
+ toggleAiMenu: p,
104
+ handleAiFeatureSelect: m
105
+ };
106
+ }
107
+ //#endregion
108
+ //#region src/cloud/composables/useCollabUndoWarning.ts
109
+ function He(e) {
110
+ let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = w(!1), a = w(!1), { start: o } = U(() => {
111
+ a.value = !1;
112
+ }, Q, { immediate: !1 });
113
+ function s() {
114
+ i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, o());
115
+ }
116
+ return {
117
+ collabUndoWarningVisible: a,
118
+ showCollabUndoWarning: s
119
+ };
120
+ }
121
+ //#endregion
122
+ //#region src/cloud/composables/useCloudFeatureFlags.ts
123
+ function Ue(e) {
124
+ let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = x(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = x(() => t.hasFeature("test_email")), o = x(() => !!r.state.template?.id), s = x(() => t.hasFeature("white_label")), c = x(() => t.config.value?.limits.max_templates ?? null), l = x(() => t.config.value?.template_count ?? 0), u = w(!1), d = w("idle"), f = w(""), { start: p } = U(() => {
125
+ d.value = "idle";
126
+ }, 3e3, { immediate: !1 });
127
+ return {
128
+ canUseAiGeneration: i,
129
+ canSendTestEmail: a,
130
+ hasTemplateSaved: o,
131
+ isWhiteLabeled: s,
132
+ templateLimit: c,
133
+ templateCount: l,
134
+ isSaveExporting: u,
135
+ saveStatus: d,
136
+ saveErrorMessage: f,
137
+ startSaveStatusClear: p
138
+ };
139
+ }
140
+ //#endregion
141
+ //#region src/cloud/composables/useCloudMediaLibrary.ts
142
+ function We(e) {
143
+ let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
144
+ async function a() {
145
+ if (t) {
146
+ let e = await t({ accept: ["images"] });
147
+ return e ? {
148
+ url: e.url,
149
+ alt: e.alt_text || void 0
150
+ } : null;
151
+ }
152
+ return i &&= (i(null), null), r.value = ["images"], n.value = !0, new Promise((e) => {
153
+ i = (t) => {
154
+ e(t);
155
+ };
156
+ });
157
+ }
158
+ function o(e) {
159
+ n.value = !1, i?.({
160
+ url: e.url,
161
+ alt: e.alt_text || void 0
162
+ }), i = null;
163
+ }
164
+ function s() {
165
+ n.value = !1, i?.(null), i = null;
166
+ }
167
+ return c(() => {
168
+ i &&= (i(null), null);
169
+ }), {
170
+ handleRequestMedia: a,
171
+ handleMediaSelect: o,
172
+ handleMediaLibraryClose: s
173
+ };
174
+ }
175
+ //#endregion
176
+ //#region src/cloud/composables/useCloudInitialization.ts
177
+ function Ge(e) {
178
+ let { config: n, translations: i, fontsManager: a, emit: o, getCommentsSidebar: s } = e, c = w(!0), l = w(!1), u = w(null), d = !1, f = { value: null }, p = null, m = null, h = new A({
179
+ ...n.auth,
180
+ onError: n.onError
181
+ }), g = ge({
182
+ authManager: h,
183
+ onError: n.onError
184
+ }), _ = w(/* @__PURE__ */ new Map()), v = z({
185
+ authManager: h,
186
+ defaultFontFamily: n.fonts?.defaultFont,
187
+ templateDefaults: n.templateDefaults,
188
+ onError: n.onError,
189
+ lockedBlocks: _
190
+ }), y = Y({
191
+ authManager: h,
192
+ onError: n.onError
193
+ });
194
+ n.mcp?.enabled && W({
195
+ editor: v,
196
+ channel: y.channel,
197
+ onOperation: n.mcp.onOperation
198
+ });
199
+ let b = null;
200
+ n.collaboration?.enabled && (b = H({
201
+ authManager: h,
202
+ editor: v,
203
+ channel: y.channel,
204
+ onError: n.onError,
205
+ onCollaboratorJoined: n.collaboration.onCollaboratorJoined,
206
+ onCollaboratorLeft: n.collaboration.onCollaboratorLeft,
207
+ onBlockLocked: n.collaboration.onBlockLocked,
208
+ onBlockUnlocked: n.collaboration.onBlockUnlocked
209
+ }), r(() => b.lockedBlocks.value, (e) => {
210
+ _.value = e;
211
+ }, { immediate: !0 }), J(v, b));
212
+ let S = x(() => !!n.collaboration?.enabled && g.hasFeature("collaboration")), C = se({
213
+ editor: v,
214
+ config: {
215
+ uiTheme: n.uiTheme,
216
+ theme: void 0,
217
+ blockDefaults: n.blockDefaults,
218
+ customBlocks: [],
219
+ mergeTags: n.mergeTags,
220
+ displayConditions: n.displayConditions,
221
+ onRequestMedia: null,
222
+ editorType: n.editorType,
223
+ accessibility: ke(n),
224
+ onSave: () => {
225
+ f.value?.().catch((e) => {
226
+ n.onError?.(e);
227
+ });
228
+ }
229
+ },
230
+ translations: i,
231
+ fontsManager: a,
232
+ historyOptions: b ? { isRemoteOperation: () => b._isProcessingRemoteOperation() } : void 0,
233
+ autoSaveOptions: {
234
+ onChange: async () => {
235
+ v.hasTemplate() && (await v.createSnapshot(), p?.snapshotHistoryInstance.value?.loadSnapshots());
236
+ },
237
+ debounce: n.autoSaveDebounce ?? 5e3,
238
+ enabled: () => n.autoSave !== !1 && g.hasFeature("auto_save")
239
+ },
240
+ themeExtraStyles: () => ({ "--tpl-drop-text": `"${i.canvas.dropHere}"` }),
241
+ keyboardOptions: { onBeforeUndo: () => m?.showCollabUndoWarning() }
242
+ }), T = He({
243
+ isCollaborationEnabled: S,
244
+ getCollaboratorCount: () => b?.collaborators.value.length ?? 0,
245
+ canUndo: C.history.canUndo
246
+ });
247
+ m = T;
248
+ let E = Be({
249
+ authManager: h,
250
+ editor: v,
251
+ history: C.history,
252
+ conditionPreview: C.conditionPreview,
253
+ autoSave: C.autoSave,
254
+ onError: n.onError
255
+ });
256
+ p = E;
257
+ let D = Ve(), O = ye(n.ai), k = Ue({
258
+ planConfigInstance: g,
259
+ aiConfig: O,
260
+ editor: v
261
+ }), j = We({
262
+ onRequestMedia: n.onRequestMedia,
263
+ mediaLibraryOpen: D.mediaLibraryOpen,
264
+ mediaLibraryAccept: D.mediaLibraryAccept
265
+ });
266
+ re({
267
+ onBlockMove: v.moveBlock,
268
+ onBlockAdd: v.addBlock
269
+ });
270
+ let M = G({
271
+ authManager: h,
272
+ getFontsConfig: () => n.fonts,
273
+ canUseCustomFonts: () => g.hasFeature("custom_fonts")
274
+ }), P = q({
275
+ authManager: h,
276
+ getTemplateId: () => v.state.template?.id ?? null,
277
+ save: () => v.save(),
278
+ exportHtml: (e) => M.exportHtml(e),
279
+ onError: n.onError,
280
+ isAuthReady: l,
281
+ onBeforeTestEmail: n.onBeforeTestEmail
282
+ }), F = be({
283
+ authManager: h,
284
+ getTemplateId: () => v.state.template?.id ?? null,
285
+ getSocketId: () => y.getSocketId(),
286
+ onComment: n.onComment,
287
+ onError: n.onError,
288
+ isAuthReady: l,
289
+ hasCommentingFeature: () => n.commenting !== !1 && g.hasFeature("commenting")
290
+ });
291
+ _e({
292
+ comments: F,
293
+ channel: y.channel
294
+ });
295
+ let I = ce({
296
+ authManager: h,
297
+ onError: n.onError
298
+ }), L = w(!1), R = w(null), te = w(!1), B = ie({
299
+ authManager: h,
300
+ getTemplateId: () => v.state.template?.id ?? null
301
+ });
302
+ function U(e) {
303
+ D.commentsOpen.value = !0, queueMicrotask(() => {
304
+ s()?.filterByBlock(e);
305
+ });
306
+ }
307
+ t(he, j.handleRequestMedia), t(V, h), t(Se, O), t(N, F), t(pe, I), t(oe, B), t(ne, {
308
+ plan: g,
309
+ ai: O,
310
+ comments: {
311
+ getBlockCount: (e) => F.commentCountByBlock.value.get(e) ?? 0,
312
+ openForBlock: U
313
+ },
314
+ savedModules: {
315
+ openSaveDialog: (e) => {
316
+ R.value = e ?? null, L.value = !0;
317
+ },
318
+ openBrowser: () => {
319
+ te.value = !0;
320
+ },
321
+ moduleCount: x(() => I.modules.value.length)
322
+ }
323
+ });
324
+ function ae(e) {
325
+ g.hasFeature("theme_customization") && (C.themeOverrides.value = e);
326
+ }
327
+ function K(e) {
328
+ v.setUiTheme(e);
329
+ }
330
+ async function Z() {
331
+ c.value = !0, u.value = null;
332
+ try {
333
+ if (await h.initialize(), d) return;
334
+ l.value = !0;
335
+ let e = await X({ authManager: h });
336
+ if (d) return;
337
+ if (!e.api.ok) throw Error("Health check failed: API is not reachable");
338
+ if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
339
+ if (e.websocket.ok || ee.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await g.fetchConfig(), d) return;
340
+ a.setCustomFontsEnabled(g.hasFeature("custom_fonts")), n.customBlocks?.length && g.hasFeature("custom_blocks") && C.registerCustomBlocks(n.customBlocks), n.theme && g.hasFeature("theme_customization") && (C.themeOverrides.value = n.theme), n.modules !== !1 && g.hasFeature("saved_modules") && I.loadModules(), o("ready");
341
+ } catch (e) {
342
+ if (d) return;
343
+ let t = e instanceof Error ? e : Error("Initialization failed", { cause: e });
344
+ u.value = t, n.onError?.(t);
345
+ } finally {
346
+ d || (c.value = !1);
347
+ }
348
+ }
349
+ function le() {
350
+ d = !0, a.cleanupFontLinks(), y.disconnect(), C.destroy(), n.onUnmount?.();
351
+ }
352
+ return {
353
+ isInitializing: c,
354
+ isAuthReady: l,
355
+ initError: u,
356
+ isDestroyed: () => d,
357
+ authManager: h,
358
+ planConfigInstance: g,
359
+ websocket: y,
360
+ collaboration: b,
361
+ isCollaborationEnabled: S,
362
+ editor: v,
363
+ core: C,
364
+ aiConfig: O,
365
+ featureFlags: k,
366
+ mediaLib: j,
367
+ exporter: M,
368
+ testEmail: P,
369
+ commentsInstance: F,
370
+ savedModulesHeadless: I,
371
+ scoringInstance: B,
372
+ panelState: D,
373
+ snapshotPreview: E,
374
+ collabWarning: T,
375
+ showSaveModuleDialog: L,
376
+ showModuleBrowserModal: te,
377
+ saveModulePreSelectedBlockId: R,
378
+ onSaveHook: f,
379
+ initialize: Z,
380
+ destroy: le,
381
+ setThemeOverrides: ae,
382
+ setUiTheme: K,
383
+ openCommentsForBlock: U
384
+ };
385
+ }
386
+ //#endregion
387
+ //#region src/utils/preRenderCustomBlocks.ts
388
+ async function Ke(e, t) {
389
+ let n = async (e) => {
390
+ if (B(e)) {
391
+ let n = e;
392
+ try {
393
+ n.renderedHtml = await t.renderCustomBlock(n);
394
+ } catch {
395
+ n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
396
+ }
397
+ }
398
+ if (e.type === "section" && "children" in e) {
399
+ let t = e;
400
+ for (let e of t.children) for (let t of e) await n(t);
401
+ }
402
+ };
403
+ for (let t of e.blocks) await n(t);
404
+ }
405
+ //#endregion
406
+ //#region src/cloud/composables/useCloudLifecycle.ts
407
+ function qe(e) {
408
+ let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
409
+ function u() {
410
+ return k(i.config.value.websocket);
411
+ }
412
+ async function d(e) {
413
+ let i = await n.create(e);
414
+ return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
415
+ }
416
+ async function f(e) {
417
+ let i = await n.load(e);
418
+ return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
419
+ }
420
+ async function p() {
421
+ c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
422
+ try {
423
+ if (await Ke(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
424
+ let e = await n.save();
425
+ if (l()) throw Error("Component unmounted during save");
426
+ a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
427
+ let r = await s.exportHtml(e.id);
428
+ if (l()) throw Error("Component unmounted during save");
429
+ let i = {
430
+ templateId: e.id,
431
+ html: r.html,
432
+ mjml: r.mjml,
433
+ content: e.content
434
+ };
435
+ return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
436
+ } catch (e) {
437
+ throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
438
+ } finally {
439
+ l() || (c.isSaveExporting.value = !1);
440
+ }
441
+ }
442
+ return {
443
+ createTemplate: d,
444
+ loadTemplate: f,
445
+ saveTemplate: p
446
+ };
447
+ }
448
+ //#endregion
449
+ //#region src/cloud/composables/useCloudSaveGate.ts
450
+ function Je(e) {
451
+ let t = w(!1), n = null, r = x(() => e.planConfig.value?.accessibility?.blockOnError === !0), i = x(() => r.value ? e.issues.value.filter((e) => e.severity === "error") : []), a = x(() => i.value.length > 0);
452
+ async function o(e) {
453
+ return a.value ? (n = e, t.value = !0, !1) : (await e(), !0);
454
+ }
455
+ async function s() {
456
+ let e = n;
457
+ n = null, t.value = !1, e && await e();
458
+ }
459
+ function c() {
460
+ n = null, t.value = !1;
461
+ }
462
+ return {
463
+ shouldBlock: a,
464
+ blockingIssues: i,
465
+ modalOpen: t,
466
+ tryRunSave: o,
467
+ confirmAndSave: s,
468
+ cancel: c
469
+ };
470
+ }
471
+ //#endregion
472
+ //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
473
+ var Ye = ["aria-label"], Xe = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-md)]" }, Ze = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Qe = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, $e = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, et = { class: "tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2" }, tt = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, nt = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, rt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, it = /* @__PURE__ */ e({
474
+ __name: "CloudSaveGateModal",
475
+ props: {
476
+ open: { type: Boolean },
477
+ issues: {}
478
+ },
479
+ emits: ["cancel", "confirm"],
480
+ setup(e, { emit: t }) {
481
+ let n = t, { t: r } = K();
482
+ return (t, a) => (s(), v(S, {
483
+ "enter-active-class": "tpl:transition-opacity tpl:duration-150",
484
+ "leave-active-class": "tpl:transition-opacity tpl:duration-150",
485
+ "enter-from-class": "tpl:opacity-0",
486
+ "leave-to-class": "tpl:opacity-0"
487
+ }, {
488
+ default: u(() => [e.open ? (s(), E("div", {
489
+ key: 0,
490
+ role: "dialog",
491
+ "aria-modal": "true",
492
+ "aria-label": p(r).saveGate.title,
493
+ class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
494
+ onClick: a[2] ||= m((e) => n("cancel"), ["self"])
495
+ }, [y("div", Xe, [
496
+ y("header", Ze, [D(p(me), {
497
+ size: 18,
498
+ "stroke-width": 2,
499
+ class: "tpl:text-[var(--tpl-warning)]"
500
+ }), y("h2", Qe, _(p(r).saveGate.title), 1)]),
501
+ y("p", $e, _(p(r).saveGate.body), 1),
502
+ y("ul", et, [(s(!0), E(g, null, i(e.issues, (e) => (s(), E("li", {
503
+ key: `${e.ruleId}-${e.blockId ?? "template"}`,
504
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
505
+ }, [y("span", tt, _(e.message), 1), y("span", nt, _(e.ruleId), 1)]))), 128))]),
506
+ y("footer", rt, [y("button", {
507
+ type: "button",
508
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]",
509
+ onClick: a[0] ||= (e) => n("cancel")
510
+ }, _(p(r).saveGate.cancel), 1), y("button", {
511
+ type: "button",
512
+ class: "tpl:rounded-md tpl:bg-[var(--tpl-danger)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white",
513
+ onClick: a[1] ||= (e) => n("confirm")
514
+ }, _(p(r).saveGate.confirm), 1)])
515
+ ])], 8, Ye)) : d("", !0)]),
516
+ _: 1
517
+ }));
518
+ }
519
+ }), at = {
520
+ class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",
521
+ style: {
522
+ "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
523
+ "backdrop-filter": "blur(12px)",
524
+ "-webkit-backdrop-filter": "blur(12px)",
525
+ "box-shadow": "var(--tpl-shadow-md)",
526
+ "border-bottom": "1px solid var(--tpl-border)"
527
+ }
528
+ }, ot = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, st = {
529
+ key: 0,
530
+ class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
531
+ }, ct = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, lt = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, ut = ["data-tooltip"], dt = {
532
+ key: 1,
533
+ "aria-live": "polite",
534
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
535
+ }, ft = {
536
+ key: 2,
537
+ "aria-live": "polite",
538
+ class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
539
+ }, pt = ["aria-label", "aria-expanded"], mt = {
540
+ key: 0,
541
+ class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
542
+ }, ht = ["aria-expanded"], gt = {
543
+ key: 0,
544
+ class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
545
+ }, _t = ["disabled"], vt = ["disabled"], yt = /* @__PURE__ */ e({
546
+ __name: "CloudHeader",
547
+ props: {
548
+ editor: {},
549
+ onBeforeHistoryUndo: { type: Function },
550
+ featureFlags: {},
551
+ panelState: {},
552
+ snapshotPreview: {},
553
+ commentsInstance: {},
554
+ testEmail: {},
555
+ websocket: {},
556
+ collaboration: {},
557
+ isCollaborationEnabled: { type: Boolean },
558
+ isSaveDisabled: { type: Boolean },
559
+ isSaving: { type: Boolean }
560
+ },
561
+ emits: ["save"],
562
+ setup(e) {
563
+ let t = l(() => import("./CollaboratorBar-YBiIjiRh.js")), n = l(() => import("./features-DIBEo4xl.js").then((e) => e.r)), r = l(() => import("./AiFeatureMenu-B2mhscyP.js")), { t: i, format: a } = K();
564
+ return (o, c) => (s(), E("header", at, [
565
+ y("div", ot, [e.featureFlags.templateLimit.value === null ? d("", !0) : (s(), E("span", st, _(p(a)(p(i).header.templatesUsed, {
566
+ used: e.featureFlags.templateCount.value,
567
+ max: e.featureFlags.templateLimit.value
568
+ })), 1))]),
569
+ y("div", ct, [
570
+ D(De, { "on-before-undo": e.onBeforeHistoryUndo }, null, 8, ["on-before-undo"]),
571
+ D(Re, {
572
+ viewport: e.editor.state.viewport,
573
+ onChange: e.editor.setViewport
574
+ }, null, 8, ["viewport", "onChange"]),
575
+ D(Ee, {
576
+ "dark-mode": e.editor.state.darkMode,
577
+ onChange: e.editor.setDarkMode
578
+ }, null, 8, ["dark-mode", "onChange"]),
579
+ D(je, {
580
+ "preview-mode": e.editor.state.previewMode,
581
+ onChange: e.editor.setPreviewMode
582
+ }, null, 8, ["preview-mode", "onChange"]),
583
+ e.collaboration && e.isCollaborationEnabled ? (s(), v(p(t), {
584
+ key: 0,
585
+ collaborators: e.collaboration.collaborators.value,
586
+ "is-connected": e.websocket.isConnected.value
587
+ }, null, 8, ["collaborators", "is-connected"])) : d("", !0),
588
+ e.snapshotPreview.snapshotHistoryInstance.value ? (s(), v(p(n), {
589
+ key: 1,
590
+ snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
591
+ "is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
592
+ "is-restoring": e.snapshotPreview.snapshotHistoryIsRestoring.value,
593
+ onLoad: e.snapshotPreview.loadSnapshotHistory,
594
+ onNavigate: e.snapshotPreview.handleSnapshotNavigate
595
+ }, null, 8, [
596
+ "snapshots",
597
+ "is-loading",
598
+ "is-restoring",
599
+ "onLoad",
600
+ "onNavigate"
601
+ ])) : d("", !0)
602
+ ]),
603
+ y("div", lt, [
604
+ e.featureFlags.saveStatus.value === "error" ? (s(), E("div", {
605
+ key: 0,
606
+ "aria-live": "assertive",
607
+ class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
608
+ "data-tooltip": e.featureFlags.saveErrorMessage.value
609
+ }, [D(p(R), {
610
+ size: 12,
611
+ "stroke-width": 2.5
612
+ }), f(" " + _(p(i).header.saveFailed), 1)], 8, ut)) : e.featureFlags.saveStatus.value === "saved" ? (s(), E("div", dt, [D(p(F), {
613
+ size: 12,
614
+ "stroke-width": 2.5
615
+ }), f(" " + _(p(i).header.saved), 1)])) : e.editor.state.isDirty ? (s(), E("div", ft, [c[4] ||= y("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), f(" " + _(p(i).header.unsaved), 1)])) : d("", !0),
616
+ e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (s(), E("button", {
617
+ key: 3,
618
+ "aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${p(i).comments.button} (${e.commentsInstance.unresolvedCount.value})` : p(i).comments.button,
619
+ "aria-expanded": e.panelState.commentsOpen.value,
620
+ class: T(p(ze)),
621
+ style: h({
622
+ backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
623
+ color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
624
+ borderColor: "var(--tpl-primary)"
625
+ }),
626
+ onClick: c[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
627
+ }, [
628
+ D(p(ve), {
629
+ size: 16,
630
+ "stroke-width": 2
631
+ }),
632
+ f(" " + _(p(i).comments.button) + " ", 1),
633
+ e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (s(), E("span", mt, _(e.commentsInstance.unresolvedCount.value), 1)) : d("", !0)
634
+ ], 14, pt)) : d("", !0),
635
+ e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (s(), E("div", {
636
+ key: 4,
637
+ ref: (t) => e.panelState.aiMenuRef.value = t,
638
+ class: "tpl:relative"
639
+ }, [y("button", {
640
+ "aria-expanded": e.panelState.aiMenuOpen.value,
641
+ class: T(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
642
+ onClick: c[1] ||= m((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
643
+ }, [D(p($), {
644
+ size: 16,
645
+ "stroke-width": 2,
646
+ class: "tpl-ai-btn-icon"
647
+ }), f(" " + _(p(i).aiChat.button), 1)], 10, ht), D(S, {
648
+ "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
649
+ "enter-from-class": "tpl:scale-95 tpl:opacity-0",
650
+ "enter-to-class": "tpl:scale-100 tpl:opacity-100",
651
+ "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
652
+ "leave-from-class": "tpl:scale-100 tpl:opacity-100",
653
+ "leave-to-class": "tpl:scale-95 tpl:opacity-0"
654
+ }, {
655
+ default: u(() => [e.panelState.aiMenuOpen.value ? (s(), E("div", gt, [D(p(r), {
656
+ "active-feature": e.panelState.activeAiFeature.value,
657
+ onSelect: e.panelState.handleAiFeatureSelect
658
+ }, null, 8, ["active-feature", "onSelect"])])) : d("", !0)]),
659
+ _: 1
660
+ })], 512)) : d("", !0),
661
+ e.testEmail.isEnabled.value && e.featureFlags.canSendTestEmail.value ? (s(), E("button", {
662
+ key: 5,
663
+ class: T(p(ze)),
664
+ style: {
665
+ "background-color": "transparent",
666
+ color: "var(--tpl-primary)",
667
+ "border-color": "var(--tpl-primary)"
668
+ },
669
+ disabled: e.testEmail.isSending.value || !e.featureFlags.hasTemplateSaved.value,
670
+ onClick: c[2] ||= (t) => e.panelState.testEmailModalOpen.value = !0
671
+ }, [e.testEmail.isSending.value ? (s(), v(p(xe), {
672
+ key: 1,
673
+ class: "tpl-spinner",
674
+ size: 16,
675
+ "stroke-width": 2
676
+ })) : (s(), v(p(fe), {
677
+ key: 0,
678
+ size: 16,
679
+ "stroke-width": 2
680
+ })), f(" " + _(p(i).testEmail.button), 1)], 10, _t)) : d("", !0),
681
+ y("button", {
682
+ class: T(p(ze)),
683
+ style: {
684
+ "background-color": "transparent",
685
+ color: "var(--tpl-primary)",
686
+ "border-color": "var(--tpl-primary)"
687
+ },
688
+ disabled: e.isSaveDisabled,
689
+ onClick: c[3] ||= (e) => o.$emit("save")
690
+ }, [e.isSaving ? (s(), v(p(xe), {
691
+ key: 1,
692
+ class: "tpl-spinner",
693
+ size: 16,
694
+ "stroke-width": 2
695
+ })) : (s(), v(p(we), {
696
+ key: 0,
697
+ size: 16,
698
+ "stroke-width": 2
699
+ })), f(" " + _(e.isSaving ? p(i).header.saving : p(i).header.save), 1)], 10, vt)
700
+ ])
701
+ ]));
702
+ }
703
+ }), bt = /* @__PURE__ */ e({
704
+ __name: "CloudPanels",
705
+ props: {
706
+ config: {},
707
+ editor: {},
708
+ core: {},
709
+ panelState: {},
710
+ planConfigInstance: {},
711
+ testEmail: {},
712
+ mediaLib: {},
713
+ savedModulesHeadless: {},
714
+ showSaveModuleDialog: { type: Boolean },
715
+ saveModulePreSelectedBlockId: {},
716
+ showModuleBrowserModal: { type: Boolean }
717
+ },
718
+ emits: [
719
+ "update:showSaveModuleDialog",
720
+ "update:saveModulePreSelectedBlockId",
721
+ "update:showModuleBrowserModal",
722
+ "send-test-email",
723
+ "module-insert"
724
+ ],
725
+ setup(e, { expose: t, emit: n }) {
726
+ let r = l(() => import("./features-DIBEo4xl.js").then((e) => e.s)), i = l(() => import("./features-DIBEo4xl.js").then((e) => e.o)), a = l(() => import("./features-DIBEo4xl.js").then((e) => e.a)), o = l(() => import("./features-DIBEo4xl.js").then((e) => e.n)), c = l(() => import("./features-DIBEo4xl.js").then((e) => e.t)), u = l(() => import("./SaveModuleDialog-AwL0tkCV.js")), f = l(() => import("./ModuleBrowserModal-C2CDWKW6.js")), m = l(async () => (await import("./src-RKexlYjA.js")).MediaLibraryModal), h = n;
727
+ function _(e, t, n) {
728
+ t.history.record(), n.setContent(e), t.conditionPreview.reset();
729
+ }
730
+ function y(e, t) {
731
+ h("module-insert", e, t);
732
+ }
733
+ let b = w(null);
734
+ function x(e) {
735
+ b.value?.filterByBlock(e);
736
+ }
737
+ return t({ filterCommentsByBlock: x }), (t, n) => (s(), E(g, null, [
738
+ D(p(r), {
739
+ visible: e.panelState.aiChatOpen.value,
740
+ "on-apply": (t) => _(t, e.core, e.editor),
741
+ onClose: n[0] ||= (t) => e.panelState.aiChatOpen.value = !1
742
+ }, null, 8, ["visible", "on-apply"]),
743
+ D(p(o), {
744
+ visible: e.panelState.scoringPanelOpen.value,
745
+ onClose: n[1] ||= (t) => e.panelState.scoringPanelOpen.value = !1
746
+ }, null, 8, ["visible"]),
747
+ D(p(a), {
748
+ visible: e.panelState.designReferenceOpen.value,
749
+ "has-existing-blocks": e.editor.content.value.blocks.length > 0,
750
+ onClose: n[2] ||= (t) => e.panelState.designReferenceOpen.value = !1,
751
+ onApply: n[3] ||= (t) => _(t, e.core, e.editor)
752
+ }, null, 8, ["visible", "has-existing-blocks"]),
753
+ D(p(i), {
754
+ ref_key: "commentsSidebar",
755
+ ref: b,
756
+ visible: e.panelState.commentsOpen.value,
757
+ onClose: n[4] ||= (t) => e.panelState.commentsOpen.value = !1
758
+ }, null, 8, ["visible"]),
759
+ D(p(c), {
760
+ visible: e.panelState.testEmailModalOpen.value,
761
+ "allowed-emails": e.testEmail.allowedEmails.value,
762
+ "is-sending": e.testEmail.isSending.value,
763
+ error: e.testEmail.error.value,
764
+ onSend: n[5] ||= (e) => h("send-test-email", e),
765
+ onClose: n[6] ||= (t) => e.panelState.testEmailModalOpen.value = !1
766
+ }, null, 8, [
767
+ "visible",
768
+ "allowed-emails",
769
+ "is-sending",
770
+ "error"
771
+ ]),
772
+ e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (s(), v(p(u), {
773
+ key: 0,
774
+ visible: e.showSaveModuleDialog,
775
+ "pre-selected-block-id": e.saveModulePreSelectedBlockId,
776
+ onClose: n[7] ||= (e) => {
777
+ h("update:showSaveModuleDialog", !1), h("update:saveModulePreSelectedBlockId", null);
778
+ },
779
+ onSaved: n[8] ||= (t) => e.savedModulesHeadless.loadModules()
780
+ }, null, 8, ["visible", "pre-selected-block-id"])) : d("", !0),
781
+ e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (s(), v(p(f), {
782
+ key: 1,
783
+ visible: e.showModuleBrowserModal,
784
+ onClose: n[9] ||= (e) => h("update:showModuleBrowserModal", !1),
785
+ onInsert: y
786
+ }, null, 8, ["visible"])) : d("", !0),
787
+ D(p(m), {
788
+ visible: e.panelState.mediaLibraryOpen.value,
789
+ accept: e.panelState.mediaLibraryAccept.value,
790
+ onSelect: e.mediaLib.handleMediaSelect,
791
+ onClose: e.mediaLib.handleMediaLibraryClose
792
+ }, null, 8, [
793
+ "visible",
794
+ "accept",
795
+ "onSelect",
796
+ "onClose"
797
+ ])
798
+ ], 64));
799
+ }
800
+ }), xt = {
801
+ key: 0,
802
+ class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
803
+ }, St = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, Ct = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, wt = /* @__PURE__ */ e({
804
+ __name: "CloudLoadingOverlay",
805
+ props: { visible: { type: Boolean } },
806
+ setup(e) {
807
+ return (t, n) => e.visible ? (s(), E("div", xt, [n[1] ||= O("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), y("div", St, [y("div", Ct, [(s(), E(g, null, i(5, (e) => y("div", {
808
+ key: e,
809
+ class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
810
+ })), 64))]), n[0] ||= O("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : d("", !0);
811
+ }
812
+ }), Tt = {
813
+ key: 0,
814
+ role: "alert",
815
+ class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
816
+ }, Et = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, Dt = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, Ot = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, kt = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, At = /* @__PURE__ */ e({
817
+ __name: "CloudErrorOverlay",
818
+ props: {
819
+ error: {},
820
+ visible: { type: Boolean }
821
+ },
822
+ emits: ["retry"],
823
+ setup(e, { emit: t }) {
824
+ let n = t, { t: r } = K();
825
+ function i(e) {
826
+ return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
827
+ }
828
+ function a(e) {
829
+ return "isNotFound" in e && !!e.isNotFound;
830
+ }
831
+ return (t, o) => e.visible && e.error ? (s(), E("div", Tt, [
832
+ y("div", Et, [D(p(R), {
833
+ size: 32,
834
+ "stroke-width": 1.5,
835
+ class: "tpl:text-[var(--tpl-danger)]"
836
+ })]),
837
+ y("div", Dt, [y("h2", Ot, _(p(r).error.title), 1), y("p", kt, _(i(e.error)), 1)]),
838
+ a(e.error) ? d("", !0) : (s(), E("button", {
839
+ key: 0,
840
+ class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
841
+ onClick: o[0] ||= (e) => n("retry")
842
+ }, _(p(r).error.retry), 1))
843
+ ])) : d("", !0);
844
+ }
845
+ }), jt = {
846
+ key: 0,
847
+ class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
848
+ }, Mt = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, Nt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Pt = /* @__PURE__ */ e({
849
+ __name: "SnapshotPreviewBanner",
850
+ props: { visible: { type: Boolean } },
851
+ emits: ["cancel", "confirm"],
852
+ setup(e, { emit: t }) {
853
+ let n = t, { t: r } = K();
854
+ return (t, i) => e.visible ? (s(), E("div", jt, [y("div", Mt, [D(p(j), {
855
+ size: 18,
856
+ "stroke-width": 2,
857
+ class: "tpl:text-[var(--tpl-primary)]"
858
+ }), y("span", null, _(p(r).snapshotPreview.message), 1)]), y("div", Nt, [y("button", {
859
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
860
+ style: { "background-color": "transparent" },
861
+ onClick: i[0] ||= (e) => n("cancel")
862
+ }, _(p(r).snapshotPreview.cancel), 1), y("button", {
863
+ class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
864
+ onClick: i[1] ||= (e) => n("confirm")
865
+ }, _(p(r).snapshotPreview.restore), 1)])])) : d("", !0);
866
+ }
867
+ }), Ft = {
868
+ key: 0,
869
+ role: "status",
870
+ "aria-live": "polite",
871
+ class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
872
+ style: {
873
+ "background-color": "var(--tpl-warning-light)",
874
+ color: "var(--tpl-text)",
875
+ border: "1px solid var(--tpl-warning)"
876
+ }
877
+ }, It = /* @__PURE__ */ e({
878
+ __name: "CollabUndoToast",
879
+ props: { visible: { type: Boolean } },
880
+ setup(e) {
881
+ let { t } = P();
882
+ return (n, r) => e.visible ? (s(), E("div", Ft, _(p(t).history.collabWarning), 1)) : d("", !0);
883
+ }
884
+ }), Lt = ["data-tpl-theme"], Rt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, zt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Bt = ["aria-label"], Vt = /* @__PURE__ */ ue(/* @__PURE__ */ e({
885
+ __name: "CloudEditor",
886
+ props: {
887
+ config: {},
888
+ translations: {},
889
+ cloudTranslations: {},
890
+ fontsManager: {}
891
+ },
892
+ emits: ["ready"],
893
+ setup(e, { expose: i, emit: c }) {
894
+ let l = e;
895
+ t(M, l.cloudTranslations);
896
+ let m = c, C = w(null), O = w(null), k = Ge({
897
+ config: l.config,
898
+ translations: l.translations,
899
+ fontsManager: l.fontsManager,
900
+ emit: m,
901
+ getCommentsSidebar: () => C.value ? { filterByBlock: C.value.filterCommentsByBlock } : null
902
+ }), { isInitializing: A, isAuthReady: j, initError: ee, planConfigInstance: N, websocket: P, collaboration: F, isCollaborationEnabled: R, editor: z, core: B, featureFlags: V, mediaLib: ne, exporter: re, testEmail: H, commentsInstance: ie, savedModulesHeadless: U, panelState: W, snapshotPreview: G, collabWarning: K, showSaveModuleDialog: q, showModuleBrowserModal: J, saveModulePreSelectedBlockId: Y, setThemeOverrides: oe, setUiTheme: se } = k, X = w("blocks");
903
+ t(le, X);
904
+ let Z = x(() => ae(l.config.editorType) === "popup"), ce = x(() => Z.value && X.value === "displayRules"), ue = x(() => Z.value && X.value === "schedule"), de = x(() => X.value === "design"), fe = x(() => Z.value && (ce.value || ue.value || de.value)), pe = x(() => ce.value || ue.value);
905
+ r(() => [j.value, z.content.value.settings.popup], ([e]) => {
906
+ if (!e || !Z.value || z.content.value.settings.popup) return;
907
+ let t = te();
908
+ z.updateSettings({
909
+ popup: t,
910
+ width: I[t.design.sizePreset]
911
+ });
912
+ }, { immediate: !0 });
913
+ async function me(e) {
914
+ try {
915
+ await H.sendTestEmail(e), W.testEmailModalOpen.value = !1;
916
+ } catch {}
917
+ }
918
+ function he(e, t) {
919
+ for (let n = 0; n < e.content.length; n++) {
920
+ let r = L(e.content[n]), i = t === void 0 ? void 0 : t + n;
921
+ z.addBlock(r, void 0, void 0, i);
922
+ }
923
+ J.value = !1;
924
+ }
925
+ let Q = qe({
926
+ config: l.config,
927
+ editor: z,
928
+ websocket: P,
929
+ planConfigInstance: N,
930
+ snapshotPreview: G,
931
+ core: B,
932
+ exporter: re,
933
+ featureFlags: V,
934
+ isDestroyed: k.isDestroyed
935
+ }), ge = x(() => {
936
+ if (z.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
937
+ let e = W.rightPanelOpen.value ? "tpl:right-[680px]" : "tpl:right-[320px]";
938
+ if (!Z.value) return ["tpl:left-12", e];
939
+ let t;
940
+ return t = X.value === "blocks" ? "tpl:left-[272px]" : de.value ? "tpl:left-[392px]" : "tpl:left-[72px]", [t, fe.value ? "tpl:right-0" : e];
941
+ }), $ = Je({
942
+ issues: B.accessibilityLint ? B.accessibilityLint.issues : w([]),
943
+ planConfig: N.config
944
+ });
945
+ async function _e() {
946
+ await $.tryRunSave(() => Q.saveTemplate().catch((e) => l.config.onError?.(e)));
947
+ }
948
+ return k.onSaveHook.value = _e, a(() => {
949
+ k.initialize();
950
+ }), o(() => {
951
+ k.destroy();
952
+ }), i({
953
+ getContent: () => z.content.value,
954
+ setContent: (e) => z.setContent(e),
955
+ setTheme: se,
956
+ setThemeOverrides: oe,
957
+ undo: () => {
958
+ K.showCollabUndoWarning(), B.history.undo();
959
+ },
960
+ redo: () => B.history.redo(),
961
+ canUndo: () => B.history.canUndo.value,
962
+ canRedo: () => B.history.canRedo.value,
963
+ create: Q.createTemplate,
964
+ load: Q.loadTemplate,
965
+ save: Q.saveTemplate,
966
+ sendTestEmail: H.sendTestEmail,
967
+ startTour: (e) => O.value?.start(e),
968
+ dismissTour: () => O.value?.dismiss(),
969
+ resetTourDismissed: () => Ae(l.config.tour),
970
+ isTourDismissed: () => l.config.tour ? Te(l.config.tour) : !0
971
+ }), (t, r) => (s(), E("div", {
972
+ class: T(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": p(z).state.darkMode }]),
973
+ "data-tpl-theme": p(B).resolvedTheme.value,
974
+ style: h(p(B).themeStyles.value)
975
+ }, [
976
+ D(S, {
977
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
978
+ "enter-from-class": "tpl:opacity-100",
979
+ "enter-to-class": "tpl:opacity-100",
980
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
981
+ "leave-from-class": "tpl:opacity-100",
982
+ "leave-to-class": "tpl:opacity-0"
983
+ }, {
984
+ default: u(() => [D(wt, { visible: p(A) || p(z).state.isLoading }, null, 8, ["visible"])]),
985
+ _: 1
986
+ }),
987
+ D(S, {
988
+ "enter-active-class": "tpl:transition-opacity tpl:duration-200",
989
+ "enter-from-class": "tpl:opacity-0",
990
+ "enter-to-class": "tpl:opacity-100",
991
+ "leave-active-class": "tpl:transition-opacity tpl:duration-300",
992
+ "leave-from-class": "tpl:opacity-100",
993
+ "leave-to-class": "tpl:opacity-0"
994
+ }, {
995
+ default: u(() => [D(At, {
996
+ error: p(ee),
997
+ visible: !!p(ee) && !p(A),
998
+ onRetry: p(k).initialize
999
+ }, null, 8, [
1000
+ "error",
1001
+ "visible",
1002
+ "onRetry"
1003
+ ])]),
1004
+ _: 1
1005
+ }),
1006
+ D(yt, {
1007
+ editor: p(z),
1008
+ "on-before-history-undo": p(K).showCollabUndoWarning,
1009
+ "feature-flags": p(V),
1010
+ "panel-state": p(W),
1011
+ "snapshot-preview": p(G),
1012
+ "comments-instance": p(ie),
1013
+ "test-email": p(H),
1014
+ websocket: p(P),
1015
+ collaboration: p(F),
1016
+ "is-collaboration-enabled": p(R),
1017
+ "is-saving": p(z).state.isSaving || p(V).isSaveExporting.value,
1018
+ "is-save-disabled": p(z).state.isSaving || p(V).isSaveExporting.value || !p(z).state.isDirty,
1019
+ onSave: _e
1020
+ }, null, 8, [
1021
+ "editor",
1022
+ "on-before-history-undo",
1023
+ "feature-flags",
1024
+ "panel-state",
1025
+ "snapshot-preview",
1026
+ "comments-instance",
1027
+ "test-email",
1028
+ "websocket",
1029
+ "collaboration",
1030
+ "is-collaboration-enabled",
1031
+ "is-saving",
1032
+ "is-save-disabled"
1033
+ ]),
1034
+ D(it, {
1035
+ open: p($).modalOpen.value,
1036
+ issues: p($).blockingIssues.value,
1037
+ onCancel: p($).cancel,
1038
+ onConfirm: p($).confirmAndSave
1039
+ }, null, 8, [
1040
+ "open",
1041
+ "issues",
1042
+ "onCancel",
1043
+ "onConfirm"
1044
+ ]),
1045
+ D(Pt, {
1046
+ visible: p(G).isPreviewingSnapshot.value,
1047
+ onCancel: p(G).cancelPreview,
1048
+ onConfirm: p(G).confirmRestoreSnapshot
1049
+ }, null, 8, [
1050
+ "visible",
1051
+ "onCancel",
1052
+ "onConfirm"
1053
+ ]),
1054
+ D(S, {
1055
+ "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1056
+ "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1057
+ "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1058
+ "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1059
+ "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1060
+ "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1061
+ }, {
1062
+ default: u(() => [D(It, { visible: p(K).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1063
+ _: 1
1064
+ }),
1065
+ n(D(Pe, null, null, 512), [[b, !p(z).state.previewMode]]),
1066
+ y("div", {
1067
+ class: T(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...ge.value, p(G).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1068
+ style: h({
1069
+ transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1070
+ backgroundColor: pe.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
1071
+ })
1072
+ }, [Z.value && X.value === "displayRules" ? (s(), v(Ne, { key: 0 })) : Z.value && X.value === "schedule" ? (s(), v(Le, {
1073
+ key: 1,
1074
+ layout: "standalone"
1075
+ })) : (s(), E(g, { key: 2 }, [y("div", Rt, [D(S, { name: "tpl-restore-btn" }, {
1076
+ default: u(() => [p(B).conditionPreview.hasHiddenBlocks.value ? (s(), E("button", {
1077
+ key: 0,
1078
+ class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
1079
+ style: {
1080
+ "background-color": "var(--tpl-warning-light)",
1081
+ color: "var(--tpl-warning)",
1082
+ "border-color": "var(--tpl-warning)",
1083
+ "backdrop-filter": "blur(8px)"
1084
+ },
1085
+ onClick: r[0] ||= (e) => p(B).conditionPreview.reset()
1086
+ }, [D(p(Ce), {
1087
+ size: 13,
1088
+ "stroke-width": 2
1089
+ }), f(" " + _(p(B).t.blockSettings.restoreHiddenBlocks), 1)])) : d("", !0)]),
1090
+ _: 1
1091
+ })]), y("main", zt, [D(Me, {
1092
+ viewport: p(z).state.viewport,
1093
+ content: p(z).content.value,
1094
+ "selected-block-id": p(z).state.selectedBlockId,
1095
+ "dark-mode": p(z).state.darkMode,
1096
+ "preview-mode": p(z).state.previewMode,
1097
+ "multi-page-canvas": e.config.multiPageCanvas ?? !1,
1098
+ "locked-blocks": p(F)?.lockedBlocks.value ?? void 0,
1099
+ onSelectBlock: p(z).selectBlock,
1100
+ onOpenAiChat: r[1] ||= (e) => p(W).aiChatOpen.value = !0,
1101
+ onOpenDesignReference: r[2] ||= (e) => p(W).designReferenceOpen.value = !0
1102
+ }, null, 8, [
1103
+ "viewport",
1104
+ "content",
1105
+ "selected-block-id",
1106
+ "dark-mode",
1107
+ "preview-mode",
1108
+ "multi-page-canvas",
1109
+ "locked-blocks",
1110
+ "onSelectBlock"
1111
+ ])])], 64))], 6),
1112
+ e.config.branding !== !1 && !p(V).isWhiteLabeled.value ? (s(), v(Ie, {
1113
+ key: 0,
1114
+ "position-class": ge.value
1115
+ }, null, 8, ["position-class"])) : d("", !0),
1116
+ y("div", {
1117
+ class: "tpl-sr-only",
1118
+ role: "status",
1119
+ "aria-live": "polite",
1120
+ "aria-atomic": "true",
1121
+ "aria-label": p(B).t.landmarks.reorderAnnouncements
1122
+ }, _(p(B).keyboardReorder.announcement.value), 9, Bt),
1123
+ n(D(Oe, {
1124
+ "selected-block": p(z).selectedBlock.value,
1125
+ settings: p(z).content.value.settings,
1126
+ "shifted-left": p(W).rightPanelOpen.value,
1127
+ onUpdateBlock: r[3] ||= (e) => p(z).updateBlock(p(z).selectedBlock.value.id, e),
1128
+ onDeleteBlock: r[4] ||= (e) => p(B).blockActions.deleteBlock(p(z).selectedBlock.value.id),
1129
+ onDuplicateBlock: r[5] ||= (e) => p(B).blockActions.duplicateBlock(p(z).selectedBlock.value),
1130
+ onUpdateSettings: p(z).updateSettings
1131
+ }, null, 8, [
1132
+ "selected-block",
1133
+ "settings",
1134
+ "shifted-left",
1135
+ "onUpdateSettings"
1136
+ ]), [[b, !p(z).state.previewMode && !fe.value]]),
1137
+ !p(A) && p(j) ? (s(), v(bt, {
1138
+ key: 1,
1139
+ ref_key: "cloudPanelsRef",
1140
+ ref: C,
1141
+ config: l.config,
1142
+ editor: p(z),
1143
+ core: p(B),
1144
+ "panel-state": p(W),
1145
+ "plan-config-instance": p(N),
1146
+ "test-email": p(H),
1147
+ "media-lib": p(ne),
1148
+ "saved-modules-headless": p(U),
1149
+ "show-save-module-dialog": p(q),
1150
+ "save-module-pre-selected-block-id": p(Y),
1151
+ "show-module-browser-modal": p(J),
1152
+ "onUpdate:showSaveModuleDialog": r[6] ||= (e) => q.value = e,
1153
+ "onUpdate:saveModulePreSelectedBlockId": r[7] ||= (e) => Y.value = e,
1154
+ "onUpdate:showModuleBrowserModal": r[8] ||= (e) => J.value = e,
1155
+ onSendTestEmail: me,
1156
+ onModuleInsert: he
1157
+ }, null, 8, [
1158
+ "config",
1159
+ "editor",
1160
+ "core",
1161
+ "panel-state",
1162
+ "plan-config-instance",
1163
+ "test-email",
1164
+ "media-lib",
1165
+ "saved-modules-headless",
1166
+ "show-save-module-dialog",
1167
+ "save-module-pre-selected-block-id",
1168
+ "show-module-browser-modal"
1169
+ ])) : d("", !0),
1170
+ e.config.tour ? (s(), v(Fe, {
1171
+ key: 2,
1172
+ ref_key: "editorTourRef",
1173
+ ref: O,
1174
+ "tour-config": e.config.tour,
1175
+ "dark-mode": p(z).state.darkMode
1176
+ }, null, 8, ["tour-config", "dark-mode"])) : d("", !0)
1177
+ ], 14, Lt));
1178
+ }
1179
+ }), [["__scopeId", "data-v-6985a9ad"]]);
1180
+ //#endregion
1181
+ export { Vt as default };
1182
+
1183
+ //# sourceMappingURL=CloudEditor-Btyr0b0_.js.map