@useinsider/guido 2.0.0-beta.eee5ecc → 2.0.0-beta.f66b754

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 (64) hide show
  1. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  2. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
  3. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  4. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
  5. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
  7. package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
  8. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -15
  9. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
  10. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  11. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
  12. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  13. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  14. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  15. package/dist/components/organisms/header/EditorActions.vue.js +21 -0
  16. package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
  17. package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
  18. package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
  19. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
  20. package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
  21. package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
  22. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  23. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
  24. package/dist/components/organisms/header/RightSlot.vue.js +11 -14
  25. package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
  26. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
  27. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  28. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  29. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  30. package/dist/config/migrator/itemsBlockMigrator.js +72 -64
  31. package/dist/enums/academy.js +8 -0
  32. package/dist/enums/onboarding.js +1 -2
  33. package/dist/enums/unsubscribe.js +20 -21
  34. package/dist/extensions/Blocks/Items/block.js +23 -20
  35. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -32
  36. package/dist/extensions/Blocks/Items/controls/settingsControl.js +69 -75
  37. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
  38. package/dist/extensions/Blocks/Items/extension.js +8 -9
  39. package/dist/extensions/Blocks/Items/template.js +210 -221
  40. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +61 -53
  41. package/dist/guido.css +1 -1
  42. package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
  43. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
  44. package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
  45. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  46. package/dist/src/enums/academy.d.ts +12 -0
  47. package/dist/src/enums/onboarding.d.ts +0 -1
  48. package/dist/src/enums/unsubscribe.d.ts +0 -1
  49. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +2 -0
  50. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -1
  51. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -5
  52. package/dist/src/stores/editor.d.ts +21 -0
  53. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  54. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  55. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  56. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  57. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  58. package/dist/static/styles/components/wide-panel.css.js +1 -1
  59. package/dist/stores/editor.js +1 -0
  60. package/package.json +1 -1
  61. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  62. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  63. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  64. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,54 +1,52 @@
1
- import { BlockType as O, BlockAttr as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as I } from "./enums/controlEnums.js";
3
- import { productPairs as R, templateFirstLine as H } from "./enums/productEnums.js";
1
+ import { BlockType as h, BlockAttr as y } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as P } from "./enums/controlEnums.js";
3
+ import { productPairs as O, templateFirstLine as W } from "./enums/productEnums.js";
4
4
  import { ItemInCartOptions as C, SETTINGS_ENUMS as w, DefaultConfigValues as F } from "./enums/settingsEnums.js";
5
- import Y from "./layouts/horizontal.html.js";
6
- import q from "./layouts/vertical.html.js";
7
- import { escapeReplacement as g } from "./utils/nodeConfigUtils.js";
8
- let [M] = R.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [L] = R.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = R.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = R.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [D] = R.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
9
- const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), U = (s) => j(s, "text-align"), m = (s, e) => {
10
- const l = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(l);
11
- return a ? a[1].trim() : null;
12
- }, v = (s, e, l) => new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi").test(s) ? s.replace(
13
- new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
5
+ import Q from "./layouts/horizontal.html.js";
6
+ import H from "./layouts/vertical.html.js";
7
+ let [g] = O.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [N] = O.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = O.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = O.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [k] = O.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const q = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), D = (a) => q(a, "text-align"), m = (a, t) => {
9
+ const l = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), e = a.match(l);
10
+ return e ? e[1].trim() : null;
11
+ }, U = (a, t, l) => new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi").test(a) ? a.replace(
12
+ new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi"),
14
13
  `$1${l}`
15
- ) : s, Z = (s, e, l, a) => {
16
- const c = l || F.productImageHeight, n = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
14
+ ) : a, Y = (a, t, l, e) => {
15
+ const c = l || F.productImageHeight, n = (e == null ? void 0 : e.imageVisible) === !1 ? "display: none; " : "";
17
16
  return `
18
17
  <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
19
18
  align="center"
20
- esd-extension-block-id="${I.IMAGE}"
19
+ esd-extension-block-id="items-block-image"
21
20
  data-slot-1=""
22
21
  product-attr="imageSrc"
23
- data-type="${s}"
24
- data-number="${e}"
22
+ data-type="${a}"
23
+ data-number="${t}"
25
24
  style="${n}font-size: 0px;">
26
25
  <a class="document-node-component ng-star-inserted"
27
26
  target="_blank"
28
27
  href="#!">
29
28
  <img class="adapt-img document-node-component ng-star-inserted"
30
- src="${M}"
31
- alt="${L}"
32
- width="${c}"
29
+ src="${g}"
30
+ alt="${N}"
33
31
  height="${c}">
34
32
  </a>
35
33
  </td>
36
34
  `;
37
- }, J = (s, e) => `
38
- <${O.BLOCK_IMAGE}
39
- ${N.BLOCK_IMAGE.src}="${M}"
40
- ${N.BLOCK_IMAGE.alt}="${L}"
41
- ${N.BLOCK_IMAGE.href}="#!"
42
- ${N.BLOCK_IMAGE.width}="${F.productImageWidth}"
43
- ${N.BLOCK_IMAGE.height}="${F.productImageWidth}"
44
- esd-extension-block-id="${I.IMAGE}"
35
+ }, j = (a, t) => `
36
+ <${h.BLOCK_IMAGE}
37
+ ${y.BLOCK_IMAGE.src}="${g}"
38
+ ${y.BLOCK_IMAGE.alt}="${N}"
39
+ ${y.BLOCK_IMAGE.href}="#!"
40
+ ${y.BLOCK_IMAGE.width}="${F.productImageWidth}"
41
+ ${y.BLOCK_IMAGE.height}="${F.productImageWidth}"
42
+ esd-extension-block-id="${P.IMAGE}"
45
43
  data-slot-1
46
44
  product-attr="imageSrc"
47
- data-type="${s}"
48
- data-number="${e}"
45
+ data-type="${a}"
46
+ data-number="${t}"
49
47
  />
50
- `, tt = (s, e, l, a, c) => {
51
- const d = `
48
+ `, Z = (a, t, l, e, c) => {
49
+ const o = `
52
50
  text-decoration:none;
53
51
  font-size: inherit;
54
52
  font-weight: inherit;
@@ -62,41 +60,41 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
62
60
  overflow: hidden;
63
61
  text-overflow: ellipsis;
64
62
  `;
65
- if (e) {
66
- const i = m(a || "", "text-align") || "center", r = U(a || d), o = m(r, "color"), t = m(r, "font-size"), p = [
67
- o ? `color: ${o}` : "",
68
- t ? `font-size: ${t}` : ""
69
- ].filter(Boolean).join("; "), T = v(
70
- v(r, "color", "inherit"),
63
+ if (t) {
64
+ const i = m(e || "", "text-align") || "center", r = D(e || o), d = m(r, "color"), s = m(r, "font-size"), p = [
65
+ d ? `color: ${d}` : "",
66
+ s ? `font-size: ${s}` : ""
67
+ ].filter(Boolean).join("; "), E = U(
68
+ U(r, "color", "inherit"),
71
69
  "font-size",
72
70
  "inherit"
73
- ), u = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
71
+ ), _ = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
74
72
  return `
75
73
  <td class="esd-block-text es-p10"
76
74
  align="${i}"
77
75
  width="100%"
78
- data-type="${s}"
79
- esd-extension-block-id="${I.NAME}"
80
- style="${u}">
76
+ data-type="${a}"
77
+ esd-extension-block-id="${P.NAME}"
78
+ style="${_}">
81
79
  <p contenteditable="false" path="1"${p ? ` style="${p}"` : ""}>
82
80
  <a
83
81
  href="#!"
84
- style="${T}"
82
+ style="${E}"
85
83
  product-attr="name"
86
84
  data-slot-2
87
85
  width="100%">
88
- ${L}
86
+ ${N}
89
87
  </a>
90
88
  </p>
91
89
  </td>
92
90
  `;
93
91
  }
94
- return `<${O.BLOCK_TEXT}
92
+ return `<${h.BLOCK_TEXT}
95
93
  width="100%"
96
94
  align="center"
97
95
  class="es-p10"
98
- data-type="${s}"
99
- esd-extension-block-id="${I.NAME}"
96
+ data-type="${a}"
97
+ esd-extension-block-id="${P.NAME}"
100
98
  >
101
99
  <p contenteditable="false">
102
100
  <a
@@ -118,44 +116,43 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
118
116
  product-attr="name"
119
117
  data-slot-2
120
118
  width="100%">
121
- ${L}
119
+ ${N}
122
120
  </a>
123
121
  </p>
124
- </${O.BLOCK_TEXT}>
122
+ </${h.BLOCK_TEXT}>
125
123
  `;
126
- }, et = (s, e, l, a, c, n, d, i, r, o) => {
127
- let t = x;
128
- if (a && a.trim()) {
129
- const E = `${a.trim()}`;
130
- t = (c || "0") === "1" ? `${x}&nbsp;${E}` : `${E}&nbsp;${x}`;
124
+ }, J = (a, t, l, e, c, n, o, i, r) => {
125
+ let d = x;
126
+ if (e && e.trim()) {
127
+ const $ = `&nbsp;${e.trim()}&nbsp;`;
128
+ d = (c || "0") === "1" ? `${x}${$}` : `${$}${x}`;
131
129
  }
132
- const p = c === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${p}"`, P = a ? `data-currency_symbol="${a}"` : "", $ = `data-single_price="${i ? "true" : "false"}"`, _ = r === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
130
+ const s = c === "1" ? "after" : "before", p = `data-formated="${l ? "true" : "false"}"`, E = `data-curency="${s}"`, _ = e ? `data-currency_symbol="${e}"` : "", b = `data-single_price="${i ? "true" : "false"}"`, I = r === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
133
131
  if (n) {
134
- const h = U(d || "color: #060606; white-space: nowrap; font-size: 20px;"), y = o ? "" : ' style="display: none;"';
132
+ const T = D(o || "color: #060606; white-space: nowrap; font-size: 20px;");
135
133
  return `
136
- <td class="esd-block-text items-block-price${_}"
134
+ <td class="esd-block-text items-block-price${I}"
137
135
  align="center"
138
- esd-extension-block-id="${I.PRICE}"
139
- width="100%"
140
- ${y}>
136
+ esd-extension-block-id="items-block-price"
137
+ width="100%">
141
138
  <p product-attr="price"
142
139
  contenteditable="false"
143
140
  data-slot-4
144
- data-type="${s}"
145
- data-number="${e}"
146
- ${T}
147
- ${u}
148
- ${P}
149
- ${$}
150
- style="${h}">
151
- ${t}
141
+ data-type="${a}"
142
+ data-number="${t}"
143
+ ${p}
144
+ ${E}
145
+ ${_}
146
+ ${b}
147
+ style="${T}">
148
+ ${d}
152
149
  </p>
153
150
  </td>`;
154
151
  }
155
152
  return `
156
- <${O.BLOCK_TEXT}
157
- esd-extension-block-id="${I.PRICE}"
158
- class="items-block-price ${_}"
153
+ <${h.BLOCK_TEXT}
154
+ esd-extension-block-id="${P.PRICE}"
155
+ class="items-block-price ${I}"
159
156
  width="100%"
160
157
  align="center"
161
158
  >
@@ -163,281 +160,273 @@ const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
163
160
  product-attr="price"
164
161
  contenteditable="false"
165
162
  data-slot-4
166
- data-type="${s}"
167
- data-number="${e}"
168
- ${T}
169
- ${u}
170
- ${a ? `data-currency_symbol="${a}"` : ""}
171
- ${$}
163
+ data-type="${a}"
164
+ data-number="${t}"
165
+ ${p}
166
+ ${E}
167
+ ${e ? `data-currency_symbol="${e}"` : ""}
168
+ ${b}
172
169
  >
173
- ${t}
170
+ ${d}
174
171
  </p>
175
- </${O.BLOCK_TEXT}>
172
+ </${h.BLOCK_TEXT}>
176
173
  `;
177
- }, at = (s, e, l, a, c, n, d = !0, i, r, o) => {
178
- let t = S;
179
- if (a && a.trim()) {
180
- const E = `${a.trim()}`;
181
- t = (c || "0") === "1" ? `${S}&nbsp;${E}` : `${E}&nbsp;${S}`;
174
+ }, tt = (a, t, l, e, c, n, o = !0, i, r, d) => {
175
+ let s = S;
176
+ if (e && e.trim()) {
177
+ const T = `&nbsp;${e.trim()}&nbsp;`;
178
+ s = (c || "0") === "1" ? `${S}${T}` : `${T}${S}`;
182
179
  }
183
- const p = c === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${p}"`, P = d ? "" : ' style="display: none;"', $ = `data-single_price="${r ? "true" : "false"}"`, _ = o === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
180
+ const p = c === "1" ? "after" : "before", E = `data-formated="${l ? "true" : "false"}"`, _ = `data-curency="${p}"`, b = o ? "" : ' style="display: none;"', u = `data-single_price="${r ? "true" : "false"}"`, $ = d === w.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
184
181
  if (n) {
185
- const h = U(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
182
+ const R = D(i || "color: #cc0000; white-space: nowrap; font-size: 19px;");
186
183
  return `
187
- <td class="esd-block-text items-block-price${_}"
188
- esd-extension-block-id="${I.ORIGINAL_PRICE}"
184
+ <td class="esd-block-text items-block-price${$}"
185
+ esd-extension-block-id="items-block-original-price"
189
186
  width="100%"
190
- align="center"${P}>
187
+ align="center"${b}>
191
188
  <p
192
189
  product-attr="originalPrice"
193
190
  contenteditable="false"
194
191
  data-slot-5
195
- data-type="${s}"
196
- data-number="${e}"
197
- ${T}
192
+ data-type="${a}"
193
+ data-number="${t}"
194
+ ${E}
195
+ ${_}
196
+ ${e ? `data-currency_symbol="${e}"` : ""}
198
197
  ${u}
199
- ${a ? `data-currency_symbol="${a}"` : ""}
200
- ${$}
201
- style="${h}">
202
- <s>${t}</s>
198
+ style="${R}">
199
+ <s>${s}</s>
203
200
  </p>
204
201
  </td>
205
202
  `;
206
203
  }
207
204
  return `
208
- <${O.BLOCK_TEXT}
209
- class="items-block-price ${_}"
210
- esd-extension-block-id="${I.ORIGINAL_PRICE}"
205
+ <${h.BLOCK_TEXT}
206
+ class="items-block-price ${$}"
207
+ esd-extension-block-id="${P.ORIGINAL_PRICE}"
211
208
  width="100%"
212
209
  align="center"
213
- ${d ? "" : 'style="display: none;"'}
210
+ ${o ? "" : 'style="display: none;"'}
214
211
  >
215
212
  <p
216
213
  product-attr="originalPrice"
217
214
  contenteditable="false"
218
215
  data-slot-5
219
216
  style="color: #cc0000"
220
- data-type="${s}"
221
- data-number="${e}"
222
- ${T}
217
+ data-type="${a}"
218
+ data-number="${t}"
219
+ ${E}
220
+ ${_}
221
+ ${e ? `data-currency_symbol="${e}"` : ""}
223
222
  ${u}
224
- ${a ? `data-currency_symbol="${a}"` : ""}
225
- ${$}
226
223
  >
227
- <s>${t}</s>
224
+ <s>${s}</s>
228
225
  </p>
229
- </${O.BLOCK_TEXT}>
226
+ </${h.BLOCK_TEXT}>
230
227
  `;
231
- }, st = (s = !0, e, l) => {
232
- const a = s ? "" : 'style="display: none;"';
233
- if (e) {
234
- const n = l || "text-align: center; font-size: 14px;";
235
- return `
228
+ }, et = (a = !0, t, l) => {
229
+ const e = a ? "" : 'style="display: none;"';
230
+ return t ? `
236
231
  <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
237
- width="100%" align="center"
238
- esd-extension-block-id="${I.QUANTITY}"
239
- ${a}>
232
+ width="100%" align="center" esd-extension-block-id="items-block-quantity" ${e}>
240
233
  <p product-attr="quantity"
241
234
  data-slot-3=""
242
235
  contenteditable="false"
243
236
  width="100%"
244
237
  path="1"
245
- style="${n}">
246
- ${D}
238
+ style="${l || "text-align: center; font-size: 14px;"}">
239
+ ${k}
247
240
  </p>
248
- </td>`;
249
- }
250
- return `
251
- <${O.BLOCK_TEXT}
241
+ </td>` : `
242
+ <${h.BLOCK_TEXT}
252
243
  width="100%"
253
244
  align="center"
254
245
  class="es-p10"
255
- esd-extension-block-id="${I.QUANTITY}"
256
- ${s ? "" : 'style="display: none;"'}
246
+ esd-extension-block-id="${P.QUANTITY}"
247
+ ${a ? "" : 'style="display: none;"'}
257
248
  >
258
249
  <p
259
250
  product-attr="quantity"
260
251
  data-slot-3
261
252
  contenteditable="false"
262
253
  width="100%">
263
- ${D}
254
+ ${k}
264
255
  </p>
265
- </${O.BLOCK_TEXT}>
256
+ </${h.BLOCK_TEXT}>
266
257
  `;
267
- }, lt = (s, e, l = "Buy", a, c, n = !0, d = !0) => {
268
- if (a) {
269
- const i = m(c || "", "background") || m(c || "", "background-color"), r = i ? `border-width: 0px; background: ${i};` : "border-width: 0px;", o = n ? "es-fw" : "es-il", t = (c || "").replace("border-width: 0;", "");
258
+ }, at = (a, t, l = "Buy", e, c, n = !0) => {
259
+ if (e) {
260
+ const o = m(c || "", "background") || m(c || "", "background-color"), i = o ? `border-width: 0px; background: ${o};` : "border-width: 0px;", r = n ? "es-fw" : "es-il", d = (c || "").replace("border-width: 0;", "");
270
261
  return `
271
262
  <td class="esd-block-button ins-button default-block-component selectable"
272
263
  align="center" width="100%" name="buy-button" caption="${l}"
273
- esd-extension-block-id="${I.BUTTON}"
274
- product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
275
- ${d ? "" : ' style="display: none;"'}>
276
- <span class="es-button-border ${o}" style="${r}">
264
+ esd-extension-block-id="items-block-button"
265
+ product-attr="button" data-slot-6="" data-type="${a}" data-number="${t}">
266
+ <span class="es-button-border ${r}" style="${i}">
277
267
  <a
278
268
  class="es-button"
279
269
  href="#!"
280
270
  target="_blank"
281
- style="${t} padding: 5px 12px;">
271
+ style="${d} padding: 5px 12px;">
282
272
  ${l}
283
273
  </a>
284
274
  </span>
285
275
  </td>`;
286
276
  }
287
277
  return `
288
- <${O.BLOCK_BUTTON}
278
+ <${h.BLOCK_BUTTON}
289
279
  width="100%"
290
280
  class="ins-button"
291
281
  name="buy-button"
292
282
  caption="${l}"
293
283
  align="center"
294
- esd-extension-block-id="${I.BUTTON}"
284
+ esd-extension-block-id="${P.BUTTON}"
295
285
  product-attr="button"
296
286
  data-slot-6
297
- data-type="${s}"
298
- data-number="${e}"
287
+ data-type="${a}"
288
+ data-number="${t}"
299
289
  >${l}
300
- </${O.BLOCK_BUTTON}>
290
+ </${h.BLOCK_BUTTON}>
301
291
  `;
302
- }, rt = (s, e, l, a = !0, c = !0) => {
303
- const n = e === w.ORIENTATION.VERTICAL, d = l === "horizontal";
292
+ }, st = (a, t, l, e = !0, c = !0) => {
293
+ const n = t === w.ORIENTATION.VERTICAL, o = l === "horizontal";
304
294
  if (n) {
305
- const i = !d, r = i || !c ? "100%" : "50%", o = i || !a ? "100%" : "50%";
306
- let t = s.replace(
295
+ const i = !o, r = i || !c ? "100%" : "50%", d = i || !e ? "100%" : "50%";
296
+ let s = a.replace(
307
297
  /<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
308
298
  (p) => p.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
309
299
  );
310
- return t = t.replace(
300
+ return s = s.replace(
311
301
  /<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
312
- (p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
313
- ), t;
302
+ (p) => p.replace(/width="[^"]*"/gi, `width="${d}"`).replace(/width:\s*[^;]+;/gi, `width: ${d};`)
303
+ ), s;
314
304
  }
315
- return d ? s : s.replace(
305
+ return o ? a : a.replace(
316
306
  /<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
317
307
  (i) => /style\s*=\s*"/i.test(i) ? i.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : i.replace(/>$/, ' style="display: none;">')
318
308
  ).replace(
319
309
  /<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
320
310
  (i) => i.replace(/display:\s*none;?/gi, "display: table-cell;")
321
311
  );
322
- }, it = (s) => s ? `<td align="center"
312
+ }, lt = (a) => a ? `<td align="center"
323
313
  esd-extension-block-id="items-block" width="560"
324
314
  data-number="4"
325
- class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : H, z = (s, e, l, a, c, n, d, i, r, o, t, p, T, u = "horizontal", P, $, b, _) => {
326
- const y = `${`data-type="${e}" data-number="${l}"`} data-orientation="${a}"`, A = s.replace(
315
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : W, f = (a, t, l, e, c, n, o, i, r, d, s, p, E, _ = "horizontal", b, u, I, $) => {
316
+ const L = `${`data-type="${t}" data-number="${l}"`} data-orientation="${e}"`, A = a.replace(
327
317
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
328
- `<td$1 ${y}>`
329
- ), X = r == null ? void 0 : r["data-product_image_control_image-height"], G = n ? Z(e, l, X, t) : J(e, l), K = (t == null ? void 0 : t.buttonLabel) || "Buy", f = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, B = e === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, W = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", k = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", V = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", Q = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(n)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", tt(e, n, a, p, t)).replaceAll(
318
+ `<td$1 ${L}>`
319
+ ), V = r == null ? void 0 : r["data-product_image_control_image-height"], v = n ? Y(t, l, V, s) : j(t, l), z = (s == null ? void 0 : s.buttonLabel) || "Buy", X = (s == null ? void 0 : s.buttonFullWidth) !== void 0 ? s.buttonFullWidth : !0, B = t === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : s == null ? void 0 : s.quantityControlEnabled, K = (s == null ? void 0 : s.priceVisible) !== void 0 ? s.priceVisible : (r == null ? void 0 : r["data-product_price_visible"]) !== "false", M = (s == null ? void 0 : s.originalPriceVisible) !== void 0 ? s.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", G = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", lt(n)).replace("{-{-PRODUCT_IMAGE-}-}", v).replace("{-{-PRODUCT_NAME-}-}", Z(t, n, e, p, s)).replaceAll(
330
320
  "{-{-PRODUCT_PRICE-}-}",
331
- g(et(
332
- e,
321
+ J(
322
+ t,
333
323
  l,
334
324
  c,
335
- d,
325
+ o,
336
326
  i,
337
327
  n,
338
- P,
339
- _,
340
- a,
341
- k
342
- ))
328
+ b,
329
+ $,
330
+ e
331
+ )
343
332
  ).replaceAll(
344
333
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
345
- g(at(
346
- e,
334
+ tt(
335
+ t,
347
336
  l,
348
337
  c,
349
- d,
338
+ o,
350
339
  i,
351
340
  n,
352
- V,
341
+ M,
342
+ u,
353
343
  $,
354
- _,
355
- a
356
- ))
357
- ).replace("{-{-PRODUCT_QUANTITY-}-}", st(B, n, b)).replace(
344
+ e
345
+ )
346
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", et(B, n, I)).replace(
358
347
  "{-{-PRODUCT_BUTTON-}-}",
359
- lt(e, l, K, n, T, f, W)
348
+ at(t, l, z, n, E, X)
360
349
  );
361
- return rt(
362
- Q,
363
- a,
364
- u,
365
- k,
366
- V
350
+ return st(
351
+ G,
352
+ e,
353
+ _,
354
+ K,
355
+ M
367
356
  );
368
357
  };
369
- function Tt({
370
- orientation: s,
371
- itemsType: e = w.ITEMS_TYPE.CART_ITEMS,
358
+ function pt({
359
+ orientation: a,
360
+ itemsType: t = w.ITEMS_TYPE.CART_ITEMS,
372
361
  itemId: l,
373
- currencySymbol: a,
362
+ currencySymbol: e,
374
363
  currencyLocation: c,
375
364
  migrate: n = !1,
376
- formattedPrice: d = !0,
365
+ formattedPrice: o = !0,
377
366
  configBlockAttributes: i,
378
367
  nodeConfig: r,
379
- nameStyles: o,
380
- buttonStyles: t,
368
+ nameStyles: d,
369
+ buttonStyles: s,
381
370
  priceStyles: p,
382
- originalPriceStyles: T,
383
- quantityStyles: u,
384
- priceOrientation: P
371
+ originalPriceStyles: E,
372
+ quantityStyles: _,
373
+ priceOrientation: b
385
374
  }) {
386
- const $ = C[e].findIndex((A) => A.value === l);
387
- let b = "1";
388
- if ($ >= 0)
389
- b = String($ + 1);
375
+ const u = C[t].findIndex((A) => A.value === l);
376
+ let I = "1";
377
+ if (u >= 0)
378
+ I = String(u + 1);
390
379
  else if (l) {
391
380
  const A = l.match(/\((\d+)\)/);
392
- A && A[1] && ([, b] = A);
381
+ A && A[1] && ([, I] = A);
393
382
  }
394
- const _ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
395
- M = R.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[$ >= 0 ? $ : 0], L = R.PAIRS_FOR_EXTENSION.name[e].DEFAULT[$ >= 0 ? $ : 0];
396
- const E = R.PAIRS_FOR_EXTENSION.price[e], h = R.PAIRS_FOR_EXTENSION.originalPrice[e];
397
- _ ? (x = d ? E.DEFAULT_SINGLE_PRICE_FORMATTED : E.DEFAULT_SINGLE_PRICE, S = d ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (x = d ? E.DEFAULT_PRICE_FORMATTED : E.DEFAULT_PRICE, S = d ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), D = R.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
398
- const y = P || (r == null ? void 0 : r.priceOrientation) || "horizontal";
399
- return s === w.ORIENTATION.VERTICAL ? z(
400
- q,
401
- e,
402
- b,
403
- s,
404
- d,
405
- n,
383
+ const $ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
384
+ g = O.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[u >= 0 ? u : 0], N = O.PAIRS_FOR_EXTENSION.name[t].DEFAULT[u >= 0 ? u : 0];
385
+ const T = O.PAIRS_FOR_EXTENSION.price[t], R = O.PAIRS_FOR_EXTENSION.originalPrice[t];
386
+ $ ? (x = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, S = o ? R.DEFAULT_SINGLE_PRICE_FORMATTED : R.DEFAULT_SINGLE_PRICE) : (x = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, S = o ? R.DEFAULT_PRICE_FORMATTED : R.DEFAULT_PRICE), k = O.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
387
+ const L = b || (r == null ? void 0 : r.priceOrientation) || "horizontal";
388
+ return a === w.ORIENTATION.VERTICAL ? f(
389
+ H,
390
+ t,
391
+ I,
406
392
  a,
393
+ o,
394
+ n,
395
+ e,
407
396
  c,
408
397
  i,
409
398
  void 0,
410
399
  // nodup
411
400
  r,
412
- o,
413
- t,
414
- y,
415
- p,
416
- T,
417
- u,
418
- _
419
- ) : z(
420
- Y,
421
- e,
422
- b,
423
- s,
424
401
  d,
425
- n,
402
+ s,
403
+ L,
404
+ p,
405
+ E,
406
+ _,
407
+ $
408
+ ) : f(
409
+ Q,
410
+ t,
411
+ I,
426
412
  a,
413
+ o,
414
+ n,
415
+ e,
427
416
  c,
428
417
  i,
429
418
  void 0,
430
419
  // nodup
431
420
  r,
432
- o,
433
- t,
434
- y,
421
+ d,
422
+ s,
423
+ L,
435
424
  p,
436
- T,
437
- u,
438
- _
425
+ E,
426
+ _,
427
+ $
439
428
  );
440
429
  }
441
430
  export {
442
- Tt as getDefaultTemplate
431
+ pt as getDefaultTemplate
443
432
  };