@useinsider/guido 3.13.1 → 3.14.0-beta.8d5df20

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 (30) hide show
  1. package/dist/@types/config/schemas.js +108 -92
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +91 -85
  4. package/dist/components/organisms/header/ViewOptions.vue.js +1 -1
  5. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
  6. package/dist/composables/useActionsApi.js +30 -22
  7. package/dist/composables/useEmailTemplateApplier.js +8 -6
  8. package/dist/composables/useTimerClone.js +21 -19
  9. package/dist/config/migrator/index.js +11 -10
  10. package/dist/config/migrator/trackIdMigrator.js +11 -0
  11. package/dist/guido.css +1 -1
  12. package/dist/library.js +8 -5
  13. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +12 -12
  14. package/dist/node_modules/valibot/dist/index.js +230 -216
  15. package/dist/package.json.js +1 -1
  16. package/dist/src/@types/config/schemas.d.ts +20 -0
  17. package/dist/src/composables/useActionsApi.d.ts +1 -1
  18. package/dist/src/composables/useConfig.d.ts +4 -0
  19. package/dist/src/config/migrator/index.d.ts +6 -1
  20. package/dist/src/config/migrator/trackIdMigrator.d.ts +6 -0
  21. package/dist/src/library.d.ts +1 -0
  22. package/dist/src/stores/config.d.ts +36 -0
  23. package/dist/src/stores/editor.d.ts +25 -0
  24. package/dist/src/utils/linkTrackingIds.d.ts +25 -0
  25. package/dist/static/styles/components/wide-panel.css.js +7 -0
  26. package/dist/static/styles/customEditorStyle.css.js +8 -0
  27. package/dist/stores/editor.js +4 -1
  28. package/dist/utils/linkTrackingIds.js +46 -0
  29. package/dist/utils/templatePreparation.js +72 -61
  30. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
- import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as r, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as f, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
- const d = {
1
+ import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as k, boolean as o, array as c, transform as C, record as y, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
+ const p = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
6
6
  /** Transactional/system emails */
@@ -14,31 +14,31 @@ const d = {
14
14
  UNSUBSCRIBE_PAGES: 97
15
15
  }, A = a({
16
16
  /** Unique identifier for the template being edited */
17
- templateId: p(
17
+ templateId: m(
18
18
  t(),
19
19
  b(1, "templateId is required")
20
20
  ),
21
21
  /** Unique identifier for the user editing the template */
22
- userId: p(
22
+ userId: m(
23
23
  t(),
24
24
  b(1, "userId is required")
25
25
  ),
26
26
  /** Optional variation ID for A/B testing */
27
27
  variationId: e(t())
28
- }), I = a({
28
+ }), L = a({
29
29
  /** Fallback font name (e.g., "Georgia") */
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), L = a({
33
+ }), M = a({
34
34
  /** Partner/organization name (required) */
35
- name: p(
35
+ name: m(
36
36
  t(),
37
37
  b(1, "partner.name is required")
38
38
  ),
39
39
  /** Product type identifier */
40
40
  productType: e(
41
- r([
41
+ i([
42
42
  l.EMAIL,
43
43
  l.ARCHITECT,
44
44
  l.UNSUBSCRIBE_PAGES
@@ -47,14 +47,14 @@ const d = {
47
47
  ),
48
48
  /** Message type (promotional or transactional) */
49
49
  messageType: e(
50
- r([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
- d.PROMOTIONAL
50
+ i([p.PROMOTIONAL, p.TRANSACTIONAL]),
51
+ p.PROMOTIONAL
52
52
  ),
53
53
  /** Display name for the current user */
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
- fallbackFont: e(I)
57
- }), v = a({
56
+ fallbackFont: e(L)
57
+ }), E = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -68,7 +68,7 @@ const d = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), S = T(() => g({
71
+ }), S = I(() => g({
72
72
  text: e(t()),
73
73
  // eslint-disable-next-line camelcase -- backend field name
74
74
  tag_text: e(t()),
@@ -76,32 +76,32 @@ const d = {
76
76
  children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
78
  select_items: e(c(S))
79
- })), E = k(
79
+ })), N = y(
80
80
  t(),
81
- C(c(S), [])
81
+ R(c(S), [])
82
82
  ), P = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
86
- decimalCount: e(f([t(), n()])),
86
+ decimalCount: e(h([t(), n()])),
87
87
  /** Pinned product IDs (empty array when filter-driven) */
88
- productIds: e(c(s())),
88
+ productIds: e(c(r())),
89
89
  /** Whether the block requested live products at send time */
90
90
  sendProductRequestFlag: e(o()),
91
91
  /** Whether to randomize product order */
92
92
  shuffleProducts: e(o()),
93
93
  /** Filter rules driving product selection */
94
- filters: e(c(s())),
94
+ filters: e(c(r())),
95
95
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
96
96
  currency: e(t()),
97
97
  /** Currency display settings (separators, alignment, decimals) */
98
- currencySettings: e(s()),
98
+ currencySettings: e(r()),
99
99
  /** Locale (e.g. 'nl_NL') */
100
100
  language: e(t()),
101
101
  /** Recommendation strategy key (e.g. 'newArrivals') */
102
102
  strategy: e(t()),
103
103
  /** Snapshot of products as rendered by the legacy block */
104
- recommendedProducts: e(c(s())),
104
+ recommendedProducts: e(c(r())),
105
105
  /** Number of product cards per row */
106
106
  cardsInRow: e(n()),
107
107
  /** Mobile-only padding (right) */
@@ -117,14 +117,14 @@ const d = {
117
117
  /** Block type marker used by some legacy variants */
118
118
  blockType: e(t()),
119
119
  /** Size variant marker (legacy data may use string or number) */
120
- size: e(f([t(), n()])),
120
+ size: e(h([t(), n()])),
121
121
  /** Vertical responsiveness flag (legacy size=1 variants) */
122
122
  verticalResponsiveness: e(o()),
123
123
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
124
124
  isPriceMovedToNextLine: e(o()),
125
125
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
126
126
  isPriceDeletedForZeroSale: e(o())
127
- }), D = a({
127
+ }), v = a({
128
128
  /**
129
129
  * Legacy recommendation block configs keyed by block ID.
130
130
  * Pass this when loading a template authored with the v1
@@ -132,17 +132,17 @@ const d = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- k(t(), P),
135
+ y(t(), P),
136
136
  {}
137
137
  )
138
- }), M = a({
138
+ }), x = a({
139
139
  /** Initial HTML content */
140
140
  html: e(t(), ""),
141
141
  /** Initial CSS content */
142
142
  css: e(t(), ""),
143
143
  /** Preselected dynamic content items */
144
144
  preselectedDynamicContent: e(
145
- c(v),
145
+ c(E),
146
146
  []
147
147
  ),
148
148
  /**
@@ -151,16 +151,30 @@ const d = {
151
151
  * (first) partner's leaf attributes into the label→token map that repairs
152
152
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
153
153
  */
154
- dynamicContentList: e(E, {}),
154
+ dynamicContentList: e(N, {}),
155
155
  /** Valid custom field attribute names from the partner's categorized fields */
156
156
  customFieldAttributes: e(c(t()), []),
157
157
  /** Selected unsubscribe page IDs */
158
158
  selectedUnsubscribePages: e(c(n()), []),
159
159
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
160
160
  forceRecreate: e(o(), !1),
161
+ /**
162
+ * Consumer-persisted tracking-id high-water mark (SD-141414). Used as the id floor
163
+ * during migration so a rolled-back document never re-mints retired tracking ids.
164
+ * Out-of-range numbers are coerced rather than rejected — this value arrives from
165
+ * stored partner data, and rejecting it would fail parseConfig and block the editor
166
+ * mount. Non-numbers still fail, like every other field in this schema.
167
+ */
168
+ trackIdCounter: e(
169
+ m(
170
+ n(),
171
+ C((s) => Number.isFinite(s) ? Math.max(0, Math.floor(s)) : 0)
172
+ ),
173
+ 0
174
+ ),
161
175
  /** Migration-only inputs (legacy block configs) */
162
- migration: e(D, {})
163
- }), N = a({
176
+ migration: e(v, {})
177
+ }), D = a({
164
178
  /** Sender display name */
165
179
  senderName: e(t(), ""),
166
180
  /** Email subject line */
@@ -173,17 +187,17 @@ const d = {
173
187
  /** Migration date for template compatibility */
174
188
  migrationDate: e(n(), 1759696858),
175
189
  /** Email header settings */
176
- emailHeader: e(N, { senderName: "", subject: "" }),
190
+ emailHeader: e(D, { senderName: "", subject: "" }),
177
191
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
178
- savedModulesFolderName: e(t(), y.SAVED_MODULES),
192
+ savedModulesFolderName: e(t(), f.SAVED_MODULES),
179
193
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
180
- defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
181
- }), x = a({
194
+ defaultModulesFolderName: e(t(), f.DEFAULT_MODULES)
195
+ }), F = a({
182
196
  /** Whether to show the header bar */
183
197
  showHeader: e(o(), !0),
184
198
  /** Custom label for back button (if shown) */
185
199
  backButtonLabel: e(t())
186
- }), F = a({
200
+ }), U = a({
187
201
  /** Enable dynamic content insertion */
188
202
  dynamicContent: e(o(), !0),
189
203
  /** Enable save as template functionality */
@@ -203,8 +217,10 @@ const d = {
203
217
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
204
218
  autosave: e(o(), !1),
205
219
  /** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
206
- allowlistEnabled: e(o(), !1)
207
- }), U = r([
220
+ allowlistEnabled: e(o(), !1),
221
+ /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
222
+ linkTrackingIds: e(o(), !1)
223
+ }), B = i([
208
224
  "amp-accordion",
209
225
  "amp-carousel",
210
226
  "amp-form-controls",
@@ -218,7 +234,7 @@ const d = {
218
234
  "text-block",
219
235
  "timer-block",
220
236
  "video-block"
221
- ]), B = r([
237
+ ]), w = i([
222
238
  "dynamic-content",
223
239
  "checkbox-block",
224
240
  "radio-button-block",
@@ -226,123 +242,123 @@ const d = {
226
242
  "unsubscribe-block",
227
243
  "coupon-block",
228
244
  "items-block"
229
- ]), w = a({
245
+ ]), H = a({
230
246
  /** Default blocks to exclude from the editor */
231
247
  excludeDefaults: e(
232
- c(U),
248
+ c(B),
233
249
  []
234
250
  ),
235
251
  /** Custom blocks to include in the editor */
236
252
  includeCustoms: e(
237
- c(B),
253
+ c(w),
238
254
  []
239
255
  )
240
- }), m = a({
256
+ }), d = a({
241
257
  /** Unique identifier for the rule */
242
258
  id: t(),
243
259
  /** Human-readable description */
244
260
  description: e(t()),
245
261
  /** Priority for rule ordering (lower = earlier) */
246
262
  priority: n()
247
- }), H = a({
248
- ...m.entries,
249
- type: i("replace"),
263
+ }), _ = a({
264
+ ...d.entries,
265
+ type: u("replace"),
250
266
  /** String to search for */
251
267
  search: t(),
252
268
  /** Replacement string */
253
269
  replacement: t(),
254
270
  /** Replace all occurrences (default: false) */
255
271
  replaceAll: e(o())
256
- }), _ = a({
257
- ...m.entries,
258
- type: i("regex"),
272
+ }), j = a({
273
+ ...d.entries,
274
+ type: u("regex"),
259
275
  /** Regex pattern string */
260
276
  pattern: t(),
261
277
  /** Replacement string (supports $1, $2, etc.) */
262
278
  replacement: t(),
263
279
  /** Regex flags (e.g., 'gi') */
264
280
  flags: e(t())
265
- }), j = a({
266
- ...m.entries,
267
- type: i("remove"),
281
+ }), q = a({
282
+ ...d.entries,
283
+ type: u("remove"),
268
284
  /** Strings or patterns to remove */
269
285
  targets: c(t())
270
- }), q = a({
271
- ...m.entries,
272
- type: i("custom"),
286
+ }), G = a({
287
+ ...d.entries,
288
+ type: u("custom"),
273
289
  /** Custom processor function */
274
- processor: h(
275
- (u) => typeof u == "function",
290
+ processor: k(
291
+ (s) => typeof s == "function",
276
292
  "processor must be a function"
277
293
  )
278
- }), G = R("type", [
279
- H,
294
+ }), V = T("type", [
280
295
  _,
281
296
  j,
282
- q
283
- ]), V = a({
297
+ q,
298
+ G
299
+ ]), z = a({
284
300
  /** Custom compiler rules to apply */
285
- customRules: e(c(G), []),
301
+ customRules: e(c(V), []),
286
302
  /** Skip default compiler rules */
287
303
  ignoreDefaultRules: e(o(), !1)
288
- }), z = a({
304
+ }), Z = a({
289
305
  /**
290
306
  * External validation handler called before save completes.
291
307
  * Return false to cancel the save operation.
292
308
  */
293
309
  externalValidation: e(
294
- h(
295
- (u) => typeof u == "function",
310
+ k(
311
+ (s) => typeof s == "function",
296
312
  "externalValidation must be a function"
297
313
  )
298
314
  )
299
- }), K = a({
315
+ }), Q = a({
300
316
  // Required sections
301
317
  /** Identity configuration (required) */
302
318
  identity: A,
303
319
  /** Partner configuration (required) */
304
- partner: L,
320
+ partner: M,
305
321
  // Optional sections (with defaults)
306
322
  /** Template content and presets */
307
- template: e(M, {}),
323
+ template: e(x, {}),
308
324
  /** Editor settings */
309
325
  editor: e(O, {}),
310
326
  /** UI configuration */
311
- ui: e(x, {}),
327
+ ui: e(F, {}),
312
328
  /** Feature toggles */
313
- features: e(F, {}),
329
+ features: e(U, {}),
314
330
  /** Block configuration */
315
- blocks: e(w, {}),
331
+ blocks: e(H, {}),
316
332
  /** Compiler configuration */
317
- compiler: e(V, {}),
333
+ compiler: e(z, {}),
318
334
  /** Callbacks and event handlers */
319
- callbacks: e(z, {})
335
+ callbacks: e(Z, {})
320
336
  });
321
337
  export {
322
- w as BlocksSchema,
323
- z as CallbacksSchema,
324
- G as CompilerRuleSchema,
325
- V as CompilerSchema,
326
- B as CustomBlockTypeSchema,
327
- q as CustomRuleSchema,
328
- U as DefaultBlockTypeSchema,
329
- E as DynamicContentListSchema,
338
+ H as BlocksSchema,
339
+ Z as CallbacksSchema,
340
+ V as CompilerRuleSchema,
341
+ z as CompilerSchema,
342
+ w as CustomBlockTypeSchema,
343
+ G as CustomRuleSchema,
344
+ B as DefaultBlockTypeSchema,
345
+ N as DynamicContentListSchema,
330
346
  S as DynamicContentNodeSchema,
331
- v as DynamicContentSchema,
347
+ E as DynamicContentSchema,
332
348
  O as EditorSchema,
333
- N as EmailHeaderSchema,
334
- I as FallbackFontSchema,
335
- F as FeaturesSchema,
336
- K as GuidoConfigSchema,
349
+ D as EmailHeaderSchema,
350
+ L as FallbackFontSchema,
351
+ U as FeaturesSchema,
352
+ Q as GuidoConfigSchema,
337
353
  A as IdentitySchema,
338
354
  P as LegacyRecommendationConfigSchema,
339
- d as MessageType,
340
- L as PartnerSchema,
355
+ p as MessageType,
356
+ M as PartnerSchema,
341
357
  l as ProductType,
342
- _ as RegexRuleSchema,
343
- j as RemoveRuleSchema,
344
- H as ReplaceRuleSchema,
345
- D as TemplateMigrationSchema,
346
- M as TemplateSchema,
347
- x as UISchema
358
+ j as RegexRuleSchema,
359
+ q as RemoveRuleSchema,
360
+ _ as ReplaceRuleSchema,
361
+ v as TemplateMigrationSchema,
362
+ x as TemplateSchema,
363
+ F as UISchema
348
364
  };
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "5079a1c8"
15
+ "840614fd"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,50 +1,51 @@
1
- import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
2
- import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as X } from "../composables/usePartner.js";
6
- import { useStripo as Y } from "../composables/useStripo.js";
7
- import { useTimerClone as Z } from "../composables/useTimerClone.js";
8
- import { migrate as I } from "../config/migrator/index.js";
1
+ import { defineComponent as j, defineAsyncComponent as R, ref as B, computed as O, watch as U, onMounted as J, onUnmounted as Q } from "vue";
2
+ import { useCortexBlueprintBridge as X } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as Z } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ee } from "../composables/usePartner.js";
6
+ import { useStripo as te } from "../composables/useStripo.js";
7
+ import { useTimerClone as oe } from "../composables/useTimerClone.js";
8
+ import { migrate as _ } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as N } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
- import oe from "./organisms/AutoSaveController.vue.js";
13
- import ne from "./organisms/base/Toaster.vue.js";
14
- import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import se from "./organisms/header/HeaderWrapper.vue.js";
16
- import ie from "./organisms/LoadingWrapper.vue.js";
17
- import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as de } from "../services/stripoApi.js";
20
- import { useConfigStore as me } from "../stores/config.js";
21
- import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
22
- import { useEditorStore as O } from "../stores/editor.js";
23
- import { usePreviewStore as ue } from "../stores/preview.js";
24
- import { useTemplateStore as pe } from "../stores/template.js";
25
- import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
26
- const xe = /* @__PURE__ */ q({
10
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
+ import se from "./organisms/AutoSaveController.vue.js";
13
+ import ae from "./organisms/base/Toaster.vue.js";
14
+ import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
+ import ce from "./organisms/header/HeaderWrapper.vue.js";
16
+ import de from "./organisms/LoadingWrapper.vue.js";
17
+ import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
+ import le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
+ import { useStripoApi as ue } from "../services/stripoApi.js";
20
+ import { useConfigStore as pe } from "../stores/config.js";
21
+ import { useDynamicContentStore as fe } from "../stores/dynamic-content.js";
22
+ import { useEditorStore as P } from "../stores/editor.js";
23
+ import { usePreviewStore as ye } from "../stores/preview.js";
24
+ import { useTemplateStore as ve } from "../stores/template.js";
25
+ import { useUnsubscribeStore as ge } from "../stores/unsubscribe.js";
26
+ import { readTrackSeq as A } from "../utils/linkTrackingIds.js";
27
+ const ze = /* @__PURE__ */ j({
27
28
  __name: "Guido",
28
29
  props: {
29
30
  config: null,
30
31
  ready: { type: Boolean, default: !0 }
31
32
  },
32
33
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
33
- setup(P, { expose: A, emit: n }) {
34
- const i = P, W = M(
34
+ setup(W, { expose: x, emit: r }) {
35
+ const a = W, G = R(
35
36
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
36
- ), x = M(
37
+ ), H = R(
37
38
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
38
- ), g = U(), l = U(), u = le(), S = fe(), o = me();
39
- i.ready && o.init(i.config);
40
- const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
39
+ ), S = B(), u = B(), p = fe(), h = ge(), o = pe();
40
+ a.ready && o.init(a.config);
41
+ const c = P(), $ = ye(), m = O(() => c.hasChanges), { isTestPartner: z } = ee(), b = () => {
41
42
  var t;
42
- return (t = g.value) == null ? void 0 : t.handleSave(!0);
43
- }, b = (t) => {
44
- d.loadingStatus = t;
43
+ return (t = S.value) == null ? void 0 : t.handleSave(!0);
44
+ }, k = (t) => {
45
+ c.loadingStatus = t;
45
46
  };
46
- j(), Q();
47
- const p = () => {
47
+ X(), Z();
48
+ const f = () => {
48
49
  var t, e;
49
50
  return {
50
51
  emailId: o.templateId,
@@ -54,96 +55,101 @@ const xe = /* @__PURE__ */ q({
54
55
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
55
56
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
56
57
  };
57
- }, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
58
+ }, { initPlugin: E, preloadRuntime: w } = te(), { getDefaultTemplate: C } = ue(), { cloneTimersOnSave: D, hasTimerBlocks: T } = oe(), q = O(() => {
58
59
  var t;
59
60
  return !((t = o.ui) != null && t.showHeader);
60
61
  });
61
- J({
62
+ Y({
62
63
  onBack: () => {
63
- console.debug("guido:back"), n("back");
64
+ console.debug("guido:back"), r("back");
64
65
  },
65
66
  onSaveStart: () => {
66
- console.debug("guido:save:start"), n("save:start");
67
+ console.debug("guido:save:start"), r("save:start");
67
68
  },
68
69
  onSaveComplete: (t) => {
69
- const e = { ...t, metadata: p() };
70
- console.debug("guido:save:complete", e), n("save:complete", e);
70
+ const e = { ...t, metadata: f() };
71
+ console.debug("guido:save:complete", e), r("save:complete", e);
71
72
  },
72
73
  onTestEmailClick: () => {
73
- console.debug("guido:test-email:click"), n("test-email:click");
74
+ console.debug("guido:test-email:click"), r("test-email:click");
74
75
  }
75
76
  });
76
- const L = (t) => {
77
- console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
78
- }, R = () => {
77
+ const I = (t) => {
78
+ console.debug("dynamic-content:close", t), p.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
79
+ }, F = () => {
79
80
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
80
81
  };
81
- B(() => m.value, () => {
82
- n("on-change", m.value);
82
+ U(() => m.value, () => {
83
+ r("on-change", m.value);
83
84
  });
84
- const f = (t) => {
85
- const e = t, { attribute: s, position: c } = e.detail;
86
- console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
85
+ const y = (t) => {
86
+ const e = t, { attribute: s, position: d } = e.detail;
87
+ console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
87
88
  };
88
- let a = null;
89
- const y = () => {
89
+ let i = null;
90
+ const v = () => {
90
91
  var e;
91
- const t = document.querySelector(ee);
92
- (e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
93
- }, v = async () => {
92
+ const t = document.querySelector(ne);
93
+ (e = u.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
94
+ }, g = async () => {
94
95
  var t;
95
96
  try {
96
- o.initialized || o.init(i.config), d.templateId = o.templateId;
97
- const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
98
- S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
99
- const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
100
- let r = {
101
- html: s && await I(s, F),
102
- css: c
97
+ o.initialized || o.init(a.config), c.templateId = o.templateId;
98
+ const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
99
+ h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
100
+ const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, l = {
101
+ linkTrackingIds: o.isFeatureEnabled("linkTrackingIds"),
102
+ trackIdFloor: (e == null ? void 0 : e.trackIdCounter) || 0
103
103
  };
104
- r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
105
- const z = {
106
- preselectedDynamicContentList: k,
104
+ let n = {
105
+ html: s && await _(s, M, l),
106
+ css: d
107
+ };
108
+ n.html || (n = await C(), n.html = await _(n.html, M, l));
109
+ const K = l.linkTrackingIds ? A(n.html) : 0;
110
+ T(n.html) && (n.html = await D(n.html)), l.linkTrackingIds && (c.trackIdSessionFloor = Math.max(K, A(n.html)));
111
+ const V = {
112
+ preselectedDynamicContentList: L,
107
113
  onReady: () => {
108
- console.debug("guido:ready"), n("ready");
114
+ console.debug("guido:ready"), r("ready");
109
115
  }
110
116
  };
111
- await E(r, p(), z), u.selectedDynamicContentList = k;
117
+ await E(n, f(), V), p.selectedDynamicContentList = L;
112
118
  } catch (e) {
113
119
  console.error("Failed to initialize Stripo editor:", e);
114
120
  }
115
121
  };
116
- return K(async () => {
122
+ return J(async () => {
117
123
  var e;
118
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
119
- const t = (e = l.value) == null ? void 0 : e.parentElement;
120
- if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
121
- await v();
124
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), re().$reset(), P().$reset(), ve().$reset(), v();
125
+ const t = (e = u.value) == null ? void 0 : e.parentElement;
126
+ if (t && (i = new ResizeObserver(v), i.observe(t)), w(), a.ready)
127
+ await g();
122
128
  else {
123
- const s = B(() => i.ready, (c) => {
124
- c && (s(), v());
129
+ const s = U(() => a.ready, (d) => {
130
+ d && (s(), g());
125
131
  });
126
132
  }
127
- document.addEventListener("dynamic-content:open", f);
128
- }), V(() => {
129
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
133
+ document.addEventListener("dynamic-content:open", y);
134
+ }), Q(() => {
135
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", y);
130
136
  try {
131
137
  window.UIEditor.removeEditor();
132
138
  } catch {
133
139
  console.debug("Failed to remove Stripo editor: No editor found");
134
140
  }
135
141
  o.reset();
136
- }), A({
142
+ }), x({
137
143
  dynamicContent: {
138
- insert: L,
139
- close: R
144
+ insert: I,
145
+ close: F
140
146
  },
141
147
  hasChanges: m,
142
- saveSilent: h,
143
- setLoading: b
144
- }), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
148
+ saveSilent: b,
149
+ setLoading: k
150
+ }), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: S, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: z, saveSilent: b, setLoading: k, emit: r, buildMetadata: f, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: q, insertDynamicContent: I, closeDynamicContent: F, handleDynamicContentOpen: y, ribbonObserver: i, updateRibbonOffset: v, startEditor: g, AutoSaveController: se, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: ce, LoadingWrapper: de, SaveAsTemplateDrawer: me, UnsubscribeWrapper: le };
145
151
  }
146
152
  });
147
153
  export {
148
- xe as default
154
+ ze as default
149
155
  };