@useinsider/guido 3.11.0-beta.f2b79f2 → 3.11.0-beta.f4ab671

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.
@@ -1,5 +1,5 @@
1
- import { ModuleFolderDefaults as S } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as h, boolean as o, array as c, record as k, literal as i, looseObject as g, variant as R, union as f, unknown as s } from "../../node_modules/valibot/dist/index.js";
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 l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -12,7 +12,7 @@ const d = {
12
12
  ARCHITECT: 49,
13
13
  /** Unsubscribe page builder */
14
14
  UNSUBSCRIBE_PAGES: 97
15
- }, C = a({
15
+ }, A = a({
16
16
  /** Unique identifier for the template being edited */
17
17
  templateId: p(
18
18
  t(),
@@ -25,12 +25,12 @@ const d = {
25
25
  ),
26
26
  /** Optional variation ID for A/B testing */
27
27
  variationId: e(t())
28
- }), T = a({
28
+ }), I = 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
- }), A = a({
33
+ }), L = a({
34
34
  /** Partner/organization name (required) */
35
35
  name: p(
36
36
  t(),
@@ -53,8 +53,8 @@ const d = {
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(T)
57
- }), y = a({
56
+ fallbackFont: e(I)
57
+ }), v = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -68,11 +68,22 @@ const d = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), I = g({
71
+ }), S = T(() => g({
72
+ text: e(t()),
73
+ // eslint-disable-next-line camelcase -- backend field name
74
+ tag_text: e(t()),
75
+ value: e(t()),
76
+ children: e(c(S)),
77
+ // eslint-disable-next-line camelcase -- backend field name
78
+ select_items: e(c(S))
79
+ })), P = k(
80
+ t(),
81
+ C(c(S), [])
82
+ ), D = g({
72
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
73
84
  id: e(n()),
74
85
  /** Decimal places for price display (legacy data may use string or number) */
75
- decimalCount: e(f([t(), n()])),
86
+ decimalCount: e(h([t(), n()])),
76
87
  /** Pinned product IDs (empty array when filter-driven) */
77
88
  productIds: e(c(s())),
78
89
  /** Whether the block requested live products at send time */
@@ -106,14 +117,14 @@ const d = {
106
117
  /** Block type marker used by some legacy variants */
107
118
  blockType: e(t()),
108
119
  /** Size variant marker (legacy data may use string or number) */
109
- size: e(f([t(), n()])),
120
+ size: e(h([t(), n()])),
110
121
  /** Vertical responsiveness flag (legacy size=1 variants) */
111
122
  verticalResponsiveness: e(o()),
112
123
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
113
124
  isPriceMovedToNextLine: e(o()),
114
125
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
115
126
  isPriceDeletedForZeroSale: e(o())
116
- }), v = a({
127
+ }), E = a({
117
128
  /**
118
129
  * Legacy recommendation block configs keyed by block ID.
119
130
  * Pass this when loading a template authored with the v1
@@ -121,28 +132,27 @@ const d = {
121
132
  * strategy, currency, locale, and layout data.
122
133
  */
123
134
  recommendationConfigs: e(
124
- k(t(), I),
135
+ k(t(), D),
125
136
  {}
126
137
  )
127
- }), L = a({
138
+ }), M = a({
128
139
  /** Initial HTML content */
129
140
  html: e(t(), ""),
130
141
  /** Initial CSS content */
131
142
  css: e(t(), ""),
132
143
  /** Preselected dynamic content items */
133
144
  preselectedDynamicContent: e(
134
- c(y),
145
+ c(v),
135
146
  []
136
147
  ),
137
148
  /**
138
- * Full set of dynamic-content items the account offers (label + token).
139
- * Used as the label→token map that repairs label-form placeholders
140
- * (e.g. `{{ Phone Number }}`) in dropped saved modules.
149
+ * Partner-keyed set of dynamic-content items the account offers, e.g.
150
+ * `{ [partnerName]: [{ text, value, children }] }`. Guido flattens it
151
+ * (union across partners, leaf attributes only) into the label→token map
152
+ * that repairs label-form placeholders (`{{ Phone Number }}`) in dropped
153
+ * saved modules.
141
154
  */
142
- availableDynamicContent: e(
143
- c(y),
144
- []
145
- ),
155
+ dynamicContentList: e(P, {}),
146
156
  /** Valid custom field attribute names from the partner's categorized fields */
147
157
  customFieldAttributes: e(c(t()), []),
148
158
  /** Selected unsubscribe page IDs */
@@ -150,13 +160,13 @@ const d = {
150
160
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
151
161
  forceRecreate: e(o(), !1),
152
162
  /** Migration-only inputs (legacy block configs) */
153
- migration: e(v, {})
154
- }), P = a({
163
+ migration: e(E, {})
164
+ }), N = a({
155
165
  /** Sender display name */
156
166
  senderName: e(t(), ""),
157
167
  /** Email subject line */
158
168
  subject: e(t(), "")
159
- }), E = a({
169
+ }), O = a({
160
170
  /** Locale for the editor UI */
161
171
  locale: e(t(), "en"),
162
172
  /** Path to translations object */
@@ -164,17 +174,17 @@ const d = {
164
174
  /** Migration date for template compatibility */
165
175
  migrationDate: e(n(), 1759696858),
166
176
  /** Email header settings */
167
- emailHeader: e(P, { senderName: "", subject: "" }),
177
+ emailHeader: e(N, { senderName: "", subject: "" }),
168
178
  /** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
169
- savedModulesFolderName: e(t(), S.SAVED_MODULES),
179
+ savedModulesFolderName: e(t(), y.SAVED_MODULES),
170
180
  /** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
171
- defaultModulesFolderName: e(t(), S.DEFAULT_MODULES)
172
- }), M = a({
181
+ defaultModulesFolderName: e(t(), y.DEFAULT_MODULES)
182
+ }), x = a({
173
183
  /** Whether to show the header bar */
174
184
  showHeader: e(o(), !0),
175
185
  /** Custom label for back button (if shown) */
176
186
  backButtonLabel: e(t())
177
- }), O = a({
187
+ }), F = a({
178
188
  /** Enable dynamic content insertion */
179
189
  dynamicContent: e(o(), !0),
180
190
  /** Enable save as template functionality */
@@ -193,7 +203,7 @@ const d = {
193
203
  liquidSyntax: e(o(), !1),
194
204
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
195
205
  autosave: e(o(), !1)
196
- }), D = l([
206
+ }), U = l([
197
207
  "amp-accordion",
198
208
  "amp-carousel",
199
209
  "amp-form-controls",
@@ -207,7 +217,7 @@ const d = {
207
217
  "text-block",
208
218
  "timer-block",
209
219
  "video-block"
210
- ]), N = l([
220
+ ]), B = l([
211
221
  "dynamic-content",
212
222
  "checkbox-block",
213
223
  "radio-button-block",
@@ -215,15 +225,15 @@ const d = {
215
225
  "unsubscribe-block",
216
226
  "coupon-block",
217
227
  "items-block"
218
- ]), x = a({
228
+ ]), w = a({
219
229
  /** Default blocks to exclude from the editor */
220
230
  excludeDefaults: e(
221
- c(D),
231
+ c(U),
222
232
  []
223
233
  ),
224
234
  /** Custom blocks to include in the editor */
225
235
  includeCustoms: e(
226
- c(N),
236
+ c(B),
227
237
  []
228
238
  )
229
239
  }), m = a({
@@ -233,7 +243,7 @@ const d = {
233
243
  description: e(t()),
234
244
  /** Priority for rule ordering (lower = earlier) */
235
245
  priority: n()
236
- }), F = a({
246
+ }), H = a({
237
247
  ...m.entries,
238
248
  type: i("replace"),
239
249
  /** String to search for */
@@ -242,7 +252,7 @@ const d = {
242
252
  replacement: t(),
243
253
  /** Replace all occurrences (default: false) */
244
254
  replaceAll: e(o())
245
- }), U = a({
255
+ }), _ = a({
246
256
  ...m.entries,
247
257
  type: i("regex"),
248
258
  /** Regex pattern string */
@@ -251,85 +261,87 @@ const d = {
251
261
  replacement: t(),
252
262
  /** Regex flags (e.g., 'gi') */
253
263
  flags: e(t())
254
- }), B = a({
264
+ }), j = a({
255
265
  ...m.entries,
256
266
  type: i("remove"),
257
267
  /** Strings or patterns to remove */
258
268
  targets: c(t())
259
- }), w = a({
269
+ }), q = a({
260
270
  ...m.entries,
261
271
  type: i("custom"),
262
272
  /** Custom processor function */
263
- processor: h(
273
+ processor: f(
264
274
  (u) => typeof u == "function",
265
275
  "processor must be a function"
266
276
  )
267
- }), H = R("type", [
268
- F,
269
- U,
270
- B,
271
- w
272
- ]), j = a({
277
+ }), G = R("type", [
278
+ H,
279
+ _,
280
+ j,
281
+ q
282
+ ]), V = a({
273
283
  /** Custom compiler rules to apply */
274
- customRules: e(c(H), []),
284
+ customRules: e(c(G), []),
275
285
  /** Skip default compiler rules */
276
286
  ignoreDefaultRules: e(o(), !1)
277
- }), q = a({
287
+ }), z = a({
278
288
  /**
279
289
  * External validation handler called before save completes.
280
290
  * Return false to cancel the save operation.
281
291
  */
282
292
  externalValidation: e(
283
- h(
293
+ f(
284
294
  (u) => typeof u == "function",
285
295
  "externalValidation must be a function"
286
296
  )
287
297
  )
288
- }), V = a({
298
+ }), K = a({
289
299
  // Required sections
290
300
  /** Identity configuration (required) */
291
- identity: C,
301
+ identity: A,
292
302
  /** Partner configuration (required) */
293
- partner: A,
303
+ partner: L,
294
304
  // Optional sections (with defaults)
295
305
  /** Template content and presets */
296
- template: e(L, {}),
306
+ template: e(M, {}),
297
307
  /** Editor settings */
298
- editor: e(E, {}),
308
+ editor: e(O, {}),
299
309
  /** UI configuration */
300
- ui: e(M, {}),
310
+ ui: e(x, {}),
301
311
  /** Feature toggles */
302
- features: e(O, {}),
312
+ features: e(F, {}),
303
313
  /** Block configuration */
304
- blocks: e(x, {}),
314
+ blocks: e(w, {}),
305
315
  /** Compiler configuration */
306
- compiler: e(j, {}),
316
+ compiler: e(V, {}),
307
317
  /** Callbacks and event handlers */
308
- callbacks: e(q, {})
318
+ callbacks: e(z, {})
309
319
  });
310
320
  export {
311
- x as BlocksSchema,
312
- q as CallbacksSchema,
313
- H as CompilerRuleSchema,
314
- j as CompilerSchema,
315
- N as CustomBlockTypeSchema,
316
- w as CustomRuleSchema,
317
- D as DefaultBlockTypeSchema,
318
- y as DynamicContentSchema,
319
- E as EditorSchema,
320
- P as EmailHeaderSchema,
321
- T as FallbackFontSchema,
322
- O as FeaturesSchema,
323
- V as GuidoConfigSchema,
324
- C as IdentitySchema,
325
- I as LegacyRecommendationConfigSchema,
321
+ w as BlocksSchema,
322
+ z as CallbacksSchema,
323
+ G as CompilerRuleSchema,
324
+ V as CompilerSchema,
325
+ B as CustomBlockTypeSchema,
326
+ q as CustomRuleSchema,
327
+ U as DefaultBlockTypeSchema,
328
+ P as DynamicContentListSchema,
329
+ S as DynamicContentNodeSchema,
330
+ v as DynamicContentSchema,
331
+ O as EditorSchema,
332
+ N as EmailHeaderSchema,
333
+ I as FallbackFontSchema,
334
+ F as FeaturesSchema,
335
+ K as GuidoConfigSchema,
336
+ A as IdentitySchema,
337
+ D as LegacyRecommendationConfigSchema,
326
338
  d as MessageType,
327
- A as PartnerSchema,
339
+ L as PartnerSchema,
328
340
  r as ProductType,
329
- U as RegexRuleSchema,
330
- B as RemoveRuleSchema,
331
- F as ReplaceRuleSchema,
332
- v as TemplateMigrationSchema,
333
- L as TemplateSchema,
334
- M as UISchema
341
+ _ as RegexRuleSchema,
342
+ j as RemoveRuleSchema,
343
+ H as ReplaceRuleSchema,
344
+ E as TemplateMigrationSchema,
345
+ M as TemplateSchema,
346
+ x as UISchema
335
347
  };
@@ -1,36 +1,37 @@
1
- import { useConfig as D } from "./useConfig.js";
2
- import { useToaster as T } from "./useToaster.js";
3
- import { useTranslations as g } from "./useTranslations.js";
4
- import { ToasterTypeOptions as C } from "../enums/toaster.js";
1
+ import { useConfig as C } from "./useConfig.js";
2
+ import { useToaster as D } from "./useToaster.js";
3
+ import { useTranslations as T } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
5
  import { buildDynamicContentLookup as h, convertModuleDynamicContent as O } from "../utils/dynamicContentConverter.js";
6
- const M = "dynamic-content.unresolved-attributes-on-drop", A = () => {
7
- const { template: i, isFeatureEnabled: p } = D(), { showToaster: a } = T(), m = g();
8
- return { handleModuleAdd: (n, e) => {
6
+ import { flattenDynamicContentList as f } from "../utils/genericUtil.js";
7
+ const M = "dynamic-content.unresolved-attributes-on-drop", b = () => {
8
+ const { template: i, isFeatureEnabled: p } = C(), { showToaster: m } = D(), a = T();
9
+ return { handleModuleAdd: (n, o) => {
9
10
  var s, c, l;
10
11
  try {
11
12
  if ((n == null ? void 0 : n.action) !== "ADD" && (n == null ? void 0 : n.action) !== "COPY")
12
13
  return;
13
- const o = h(((s = i.value) == null ? void 0 : s.availableDynamicContent) ?? []);
14
- if (o.size === 0)
14
+ const e = h(f((s = i.value) == null ? void 0 : s.dynamicContentList));
15
+ if (e.size === 0)
15
16
  return;
16
- const t = (c = e == null ? void 0 : e.getTargetNode) == null ? void 0 : c.call(e), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
17
+ const t = (c = o == null ? void 0 : o.getTargetNode) == null ? void 0 : c.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
17
18
  if (!t || typeof r != "string")
18
19
  return;
19
20
  const { html: u, unresolved: y } = O(
20
21
  r,
21
- o,
22
+ e,
22
23
  p("liquidSyntax")
23
24
  );
24
- u !== r && e.modifyHtml(t).replaceWith(u), y.length > 0 && a({
25
- type: C.Warning,
26
- message: m(M)
25
+ u !== r && o.modifyHtml(t).replaceWith(u), y.length > 0 && m({
26
+ type: g.Warning,
27
+ message: a(M)
27
28
  });
28
- } catch (o) {
29
- console.error("Failed to repair dynamic content on module add:", o);
29
+ } catch (e) {
30
+ console.error("Failed to repair dynamic content on module add:", e);
30
31
  }
31
32
  } };
32
33
  };
33
34
  export {
34
35
  M as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
35
- A as useModuleDynamicContentRepair
36
+ b as useModuleDynamicContentRepair
36
37
  };
@@ -2,23 +2,23 @@ import { useActionsApi as x } from "./useActionsApi.js";
2
2
  import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
3
  import { useConfig as q } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
- import { useModuleDynamicContentRepair as z } from "./useModuleDynamicContentRepair.js";
7
- import { useStripoEventHandler as L } from "./useStripoEventHandler.js";
5
+ import { useFullStoryBridge as L } from "./useFullStoryBridge.js";
6
+ import { useModuleDynamicContentRepair as N } from "./useModuleDynamicContentRepair.js";
7
+ import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
8
  import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
9
  import { useToaster as G } from "./useToaster.js";
10
10
  import { localePatch as J } from "../config/i18n/index.js";
11
- import { en as C } from "../config/i18n/en/index.js";
11
+ import { en as E } from "../config/i18n/en/index.js";
12
12
  import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
13
  import { useStripoApi as j } from "../services/stripoApi.js";
14
14
  import K from "../static/styles/customEditorStyle.css.js";
15
15
  import { useEditorStore as w } from "../stores/editor.js";
16
- import { buildMergeTagEntries as Q } from "../utils/genericUtil.js";
17
- import W from "../package.json.js";
18
- const ye = (b, l) => {
19
- const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: v, getCustomFonts: T, getSyncModulesStatus: B } = j(), { handleEvent: F } = L(), { handleModuleAdd: M } = z(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (s, i = [], r = !1) => {
20
- var S, y, h, E;
21
- const e = w(), { html: f, css: a } = s, { baseBlocks: t, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
16
+ import { buildMergeTagEntries as Q, flattenDynamicContentList as W } from "../utils/genericUtil.js";
17
+ import Y from "../package.json.js";
18
+ const he = (b, l) => {
19
+ const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = j(), { handleEvent: F } = z(), { handleModuleAdd: M } = N(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), _ = async (n, i = [], r = !1) => {
20
+ var S, y, h, C;
21
+ const e = w(), { html: f, css: a } = n, { baseBlocks: o, extensions: d } = await A(), g = ((S = c.value) == null ? void 0 : S.displayConditions) ?? !0, P = ((y = c.value) == null ? void 0 : y.modulesDisabled) ?? !1, I = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
22
22
  await window.UIEditor.initEditor(
23
23
  document.querySelector("#guido-editor"),
24
24
  {
@@ -49,7 +49,7 @@ const ye = (b, l) => {
49
49
  selectElementAfterDrop: !0,
50
50
  sameFontSizeForOutlook: !0,
51
51
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
52
- ...t ? { baseBlocks: t } : {},
52
+ ...o ? { baseBlocks: o } : {},
53
53
  editorFonts: {
54
54
  showDefaultStandardFonts: !0,
55
55
  showDefaultNotStandardFonts: !0,
@@ -59,37 +59,37 @@ const ye = (b, l) => {
59
59
  {
60
60
  entries: Q(
61
61
  l.preselectedDynamicContentList,
62
- ((E = u.value) == null ? void 0 : E.availableDynamicContent) ?? [],
62
+ W((C = u.value) == null ? void 0 : C.dynamicContentList),
63
63
  m("liquidSyntax")
64
64
  )
65
65
  }
66
66
  ],
67
- async onTokenRefreshRequest(o) {
67
+ async onTokenRefreshRequest(t) {
68
68
  try {
69
- const n = await v();
70
- o(n);
71
- } catch (n) {
72
- p(n, "Failed to refresh token");
69
+ const s = await T();
70
+ t(s);
71
+ } catch (s) {
72
+ p(s, "Failed to refresh token");
73
73
  }
74
74
  },
75
75
  onTemplateLoaded() {
76
76
  try {
77
- const { importCss: o } = H(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = N();
78
- o(), n(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
77
+ const { importCss: t } = H(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: R } = x(), { injectFullStory: U } = L();
78
+ t(), s(), U(), R(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
79
79
  e.hasChanges = !1;
80
80
  }, 1e3);
81
- } catch (o) {
82
- p(o, "Failed to load custom interface appearance");
81
+ } catch (t) {
82
+ p(t, "Failed to load custom interface appearance");
83
83
  }
84
84
  },
85
- onCodeEditorVisibilityChanged(o) {
86
- e.isCodeEditorOpen = o;
85
+ onCodeEditorVisibilityChanged(t) {
86
+ e.isCodeEditorOpen = t;
87
87
  },
88
- onEditorVisualModeChanged(o) {
89
- e.editorVisualMode = o.toLowerCase();
88
+ onEditorVisualModeChanged(t) {
89
+ e.editorVisualMode = t.toLowerCase();
90
90
  },
91
- onVersionHistoryVisibilityChanged(o) {
92
- e.isVersionHistoryOpen = o;
91
+ onVersionHistoryVisibilityChanged(t) {
92
+ e.isVersionHistoryOpen = t;
93
93
  },
94
94
  onDataChanged() {
95
95
  e.hasChanges = !0;
@@ -106,35 +106,35 @@ const ye = (b, l) => {
106
106
  localePatch: J
107
107
  }
108
108
  );
109
- }, D = (s) => new Promise((i, r) => {
109
+ }, D = (n) => new Promise((i, r) => {
110
110
  var d;
111
111
  if (document.getElementById("UiEditorScript")) {
112
- Promise.resolve(s()).then(i, r);
112
+ Promise.resolve(n()).then(i, r);
113
113
  return;
114
114
  }
115
- const e = W.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
116
- t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
117
- Promise.resolve(s()).then(i, r);
118
- }, t.onerror = () => {
115
+ const e = Y.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
116
+ o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
117
+ Promise.resolve(n()).then(i, r);
118
+ }, o.onerror = () => {
119
119
  r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
120
- }, document.body.appendChild(t);
120
+ }, document.body.appendChild(o);
121
121
  });
122
- return { initPlugin: async (s) => {
122
+ return { initPlugin: async (n) => {
123
123
  const i = w();
124
124
  try {
125
125
  await D(async () => {
126
126
  const [r, e] = await Promise.all([
127
- T(),
127
+ v(),
128
128
  B()
129
129
  ]);
130
- i.syncModulesEnabled = e, await _(s, r, e);
130
+ i.syncModulesEnabled = e, await _(n, r, e);
131
131
  });
132
132
  } catch {
133
133
  i.loadingStatus = !1, k({
134
134
  type: X.Error,
135
- message: C["An error has occurred. Please report the error code to support."],
135
+ message: E["An error has occurred. Please report the error code to support."],
136
136
  actionButton: {
137
- text: C["Reload page"],
137
+ text: E["Reload page"],
138
138
  onClick: () => window.location.reload()
139
139
  }
140
140
  });
@@ -142,5 +142,5 @@ const ye = (b, l) => {
142
142
  } };
143
143
  };
144
144
  export {
145
- ye as useStripo
145
+ he as useStripo
146
146
  };