@aswin.dev/editor 0.7.1 → 0.7.3

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