@useinsider/guido 3.17.0-beta.ddd4dde → 3.17.0-beta.e324492

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 (95) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +82 -76
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  11. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  12. package/dist/composables/useRecommendation.js +41 -34
  13. package/dist/composables/useStripo.js +14 -14
  14. package/dist/config/i18n/en/labels.json.js +1 -1
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  17. package/dist/config/migrator/recommendation/extractors.js +29 -24
  18. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  19. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  20. package/dist/config/migrator/recommendationMigrator.js +31 -25
  21. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  22. package/dist/enums/academy.js +2 -1
  23. package/dist/enums/date.js +5 -3
  24. package/dist/enums/extensions/recommendationBlock.js +3 -1
  25. package/dist/extensions/Blocks/Items/block.js +49 -98
  26. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
  27. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +11 -12
  28. package/dist/extensions/Blocks/Items/template.js +152 -153
  29. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  30. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  32. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  33. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  34. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  35. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +247 -180
  36. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  37. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  39. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  40. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  41. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  42. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +177 -80
  43. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  44. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  45. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  46. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  47. package/dist/extensions/Blocks/common-control.js +22 -19
  48. package/dist/guido.css +1 -1
  49. package/dist/services/recommendationApi.js +69 -30
  50. package/dist/src/@types/config/schemas.d.ts +2 -0
  51. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  52. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  53. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  54. package/dist/src/composables/useConfig.d.ts +2 -0
  55. package/dist/src/composables/useRecommendation.d.ts +1 -0
  56. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  57. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  58. package/dist/src/enums/academy.d.ts +1 -0
  59. package/dist/src/enums/date.d.ts +1 -0
  60. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  61. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -21
  62. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  63. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  64. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  65. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  66. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  67. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  68. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  69. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +48 -8
  70. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  73. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  74. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +188 -10
  75. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  76. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  78. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  79. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  80. package/dist/src/services/recommendationApi.d.ts +4 -1
  81. package/dist/src/stores/config.d.ts +18 -0
  82. package/dist/src/stores/save-as-template.d.ts +4 -3
  83. package/dist/src/utils/genericUtil.d.ts +5 -0
  84. package/dist/static/assets/icons/line-change.svg.js +5 -0
  85. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  86. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  87. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  88. package/dist/static/styles/customEditorStyle.css.js +3 -1
  89. package/dist/utils/dateUtil.js +23 -10
  90. package/dist/utils/genericUtil.js +28 -27
  91. package/dist/utils/pairProductVariables.js +59 -60
  92. package/dist/utils/templatePreparation.js +47 -45
  93. package/package.json +2 -1
  94. package/dist/extensions/Blocks/Items/constants/currency.js +0 -11
  95. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -19
@@ -1,25 +1,24 @@
1
1
  import { escapeHtml as m } from "../../../utils/htmlEscape.js";
2
- import { BlockType as R, BlockAttr as w } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { ITEMS_CURRENCY_ATTR as U, currencyPositionFromLocation as z } from "./constants/currency.js";
4
- import { ItemsBlockId as _ } from "./enums/controlEnums.js";
5
- import { productPairs as h, templateFirstLine as j } from "./enums/productEnums.js";
6
- import { ItemInCartOptions as J, SETTINGS_ENUMS as y, DefaultConfigValues as k } from "./enums/settingsEnums.js";
7
- import Z from "./layouts/horizontal.html.js";
8
- import f from "./layouts/vertical.html.js";
9
- import { deriveItemNumber as tt, escapeReplacement as g } from "./utils/nodeConfigUtils.js";
10
- let [G] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [L] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [x] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [v] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
11
- const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), V = (a) => M(a, "text-align"), S = (a, e) => {
12
- const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), s = a.match(r);
13
- return s ? s[1].trim() : null;
14
- }, N = (a) => `<tr>${a}</tr>`, et = (a, e, r, s) => {
15
- const i = r || k.productImageHeight, d = (s == null ? void 0 : s.imageVisible) === !1 ? "display: none; " : "";
16
- return N(`
2
+ import { BlockType as R, BlockAttr as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { ItemsBlockId as O } from "./enums/controlEnums.js";
4
+ import { productPairs as h, templateFirstLine as q } from "./enums/productEnums.js";
5
+ import { ItemInCartOptions as j, SETTINGS_ENUMS as N, DefaultConfigValues as M } from "./enums/settingsEnums.js";
6
+ import C from "./layouts/horizontal.html.js";
7
+ import J from "./layouts/vertical.html.js";
8
+ import { deriveItemNumber as Z, escapeReplacement as g } from "./utils/nodeConfigUtils.js";
9
+ let [v] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [X] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
10
+ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), k = (s) => U(s, "text-align"), y = (s, e) => {
11
+ const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(r);
12
+ return a ? a[1].trim() : null;
13
+ }, w = (s) => `<tr>${s}</tr>`, f = (s, e, r, a) => {
14
+ const i = r || M.productImageHeight, d = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
15
+ return w(`
17
16
  <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
18
17
  align="center"
19
- esd-extension-block-id="${_.IMAGE}"
18
+ esd-extension-block-id="${O.IMAGE}"
20
19
  data-slot-1=""
21
20
  product-attr="imageSrc"
22
- data-type="${a}"
21
+ data-type="${s}"
23
22
  data-number="${e}"
24
23
  style="${d}font-size: 0px;">
25
24
  <a class="document-node-component ng-star-inserted"
@@ -27,27 +26,27 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
27
26
  href="#!">
28
27
  <img class="adapt-img document-node-component ng-star-inserted"
29
28
  style="object-fit: contain;"
30
- src="${G}"
29
+ src="${v}"
31
30
  alt="${F}"
32
31
  width="${i}"
33
32
  height="${i}">
34
33
  </a>
35
34
  </td>
36
35
  `);
37
- }, at = (a, e) => `
36
+ }, tt = (s, e) => `
38
37
  <${R.BLOCK_IMAGE}
39
- ${w.BLOCK_IMAGE.src}="${G}"
40
- ${w.BLOCK_IMAGE.alt}="${F}"
41
- ${w.BLOCK_IMAGE.href}="#!"
42
- ${w.BLOCK_IMAGE.width}="${k.productImageWidth}"
43
- ${w.BLOCK_IMAGE.height}="${k.productImageWidth}"
44
- esd-extension-block-id="${_.IMAGE}"
38
+ ${S.BLOCK_IMAGE.src}="${v}"
39
+ ${S.BLOCK_IMAGE.alt}="${F}"
40
+ ${S.BLOCK_IMAGE.href}="#!"
41
+ ${S.BLOCK_IMAGE.width}="${M.productImageWidth}"
42
+ ${S.BLOCK_IMAGE.height}="${M.productImageWidth}"
43
+ esd-extension-block-id="${O.IMAGE}"
45
44
  data-slot-1
46
45
  product-attr="imageSrc"
47
- data-type="${a}"
46
+ data-type="${s}"
48
47
  data-number="${e}"
49
48
  />
50
- `, st = (a, e, r, s) => {
49
+ `, et = (s, e, r, a) => {
51
50
  const i = `
52
51
  word-wrap: break-word;
53
52
  white-space: nowrap;
@@ -57,27 +56,27 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
57
56
  max-width: 100%;
58
57
  `;
59
58
  if (e) {
60
- const d = S(r || "", "text-align") || "center", n = V(r || i), c = S(n, "font-weight"), l = S(n, "font-style"), o = c === "bold" || c === "700", t = l === "italic", p = M(
61
- M(
62
- M(n, "font-weight"),
59
+ const d = y(r || "", "text-align") || "center", n = k(r || i), c = y(n, "font-weight"), l = y(n, "font-style"), o = c === "bold" || c === "700", t = l === "italic", p = U(
60
+ U(
61
+ U(n, "font-weight"),
63
62
  "font-style"
64
63
  ),
65
64
  "text-decoration"
66
- ), T = (s == null ? void 0 : s.nameVisible) === !1 ? "display: none;" : "display: table-cell;", u = p ? ` style="${m(p)}"` : "";
67
- let $ = F;
68
- return o && ($ = `<strong>${$}</strong>`), t && ($ = `<em>${$}</em>`), N(`
65
+ ), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ = p ? ` style="${m(p)}"` : "";
66
+ let E = F;
67
+ return o && (E = `<strong>${E}</strong>`), t && (E = `<em>${E}</em>`), w(`
69
68
  <td class="esd-block-text es-p10"
70
69
  align="${d}"
71
70
  width="100%"
72
71
  colspan="2"
73
- data-type="${a}"
74
- esd-extension-block-id="${_.NAME}"
72
+ data-type="${s}"
73
+ esd-extension-block-id="${O.NAME}"
75
74
  style="${T}">
76
75
  <p contenteditable="false"
77
76
  path="1"
78
77
  product-attr="name"
79
- data-slot-2${u}>
80
- ${$}
78
+ data-slot-2${_}>
79
+ ${E}
81
80
  </p>
82
81
  </td>
83
82
  `);
@@ -87,8 +86,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
87
86
  align="center"
88
87
  colspan="2"
89
88
  class="es-p10"
90
- data-type="${a}"
91
- esd-extension-block-id="${_.NAME}"
89
+ data-type="${s}"
90
+ esd-extension-block-id="${O.NAME}"
92
91
  >
93
92
  <p contenteditable="false"
94
93
  product-attr="name"
@@ -98,31 +97,31 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
98
97
  </p>
99
98
  </${R.BLOCK_TEXT}>
100
99
  `;
101
- }, lt = (a, e, r, s, i, d, n, c, l, o) => {
102
- let t = L;
103
- if (s && s.trim()) {
104
- const E = `${s.trim()}`;
105
- t = (i || "0") === "1" ? `${L}&nbsp;${E}` : `${E}&nbsp;${L}`;
100
+ }, at = (s, e, r, a, i, d, n, c, l, o) => {
101
+ let t = x;
102
+ if (a && a.trim()) {
103
+ const $ = `${a.trim()}`;
104
+ t = (i || "0") === "1" ? `${x}&nbsp;${$}` : `${$}&nbsp;${x}`;
106
105
  }
107
- const p = z(i), T = `data-formated="${r ? "true" : "false"}"`, u = `${U.POSITION}="${p}"`, $ = s ? `${U.SYMBOL}="${s}"` : "", O = `data-single_price="${c ? "true" : "false"}"`, b = l === y.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
106
+ const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = a ? `data-currency_symbol="${a}"` : "", u = `data-single_price="${c ? "true" : "false"}"`, I = l === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
108
107
  if (d) {
109
- const I = V(n || "color: #060606; white-space: nowrap; font-size: 20px;"), P = o ? "" : ' style="display: none;"';
110
- return N(`
111
- <td class="esd-block-text items-block-price${b}"
108
+ const b = k(n || "color: #060606; white-space: nowrap; font-size: 20px;"), A = o ? "" : ' style="display: none;"';
109
+ return w(`
110
+ <td class="esd-block-text items-block-price${I}"
112
111
  align="center"
113
- esd-extension-block-id="${_.PRICE}"
112
+ esd-extension-block-id="${O.PRICE}"
114
113
  width="100%"
115
- ${P}>
114
+ ${A}>
116
115
  <p product-attr="price"
117
116
  contenteditable="false"
118
117
  data-slot-4
119
- data-type="${a}"
118
+ data-type="${s}"
120
119
  data-number="${e}"
121
120
  ${T}
121
+ ${_}
122
+ ${E}
122
123
  ${u}
123
- ${$}
124
- ${O}
125
- style="${m(I)}">
124
+ style="${m(b)}">
126
125
  ${t}
127
126
  </p>
128
127
  </td>
@@ -130,8 +129,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
130
129
  }
131
130
  return `
132
131
  <${R.BLOCK_TEXT}
133
- esd-extension-block-id="${_.PRICE}"
134
- class="items-block-price ${b}"
132
+ esd-extension-block-id="${O.PRICE}"
133
+ class="items-block-price ${I}"
135
134
  width="100%"
136
135
  align="center"
137
136
  >
@@ -139,42 +138,42 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
139
138
  product-attr="price"
140
139
  contenteditable="false"
141
140
  data-slot-4
142
- data-type="${a}"
141
+ data-type="${s}"
143
142
  data-number="${e}"
144
143
  ${T}
144
+ ${_}
145
+ ${a ? `data-currency_symbol="${a}"` : ""}
145
146
  ${u}
146
- ${$}
147
- ${O}
148
147
  >
149
148
  ${t}
150
149
  </p>
151
150
  </${R.BLOCK_TEXT}>
152
151
  `;
153
- }, rt = (a, e, r, s, i, d, n = !0, c, l, o) => {
154
- let t = x;
155
- if (s && s.trim()) {
156
- const I = `${s.trim()}`;
157
- t = (i || "0") === "1" ? `${x}&nbsp;${I}` : `${I}&nbsp;${x}`;
152
+ }, st = (s, e, r, a, i, d, n = !0, c, l, o) => {
153
+ let t = L;
154
+ if (a && a.trim()) {
155
+ const $ = `${a.trim()}`;
156
+ t = (i || "0") === "1" ? `${L}&nbsp;${$}` : `${$}&nbsp;${L}`;
158
157
  }
159
- const p = z(i), T = `data-formated="${r ? "true" : "false"}"`, u = `${U.POSITION}="${p}"`, $ = s ? `${U.SYMBOL}="${s}"` : "", O = n ? "" : ' style="display: none;"', A = `data-single_price="${l ? "true" : "false"}"`, E = o === y.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
158
+ const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = n ? "" : ' style="display: none;"', u = `data-single_price="${l ? "true" : "false"}"`, I = o === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
160
159
  if (d) {
161
- const P = V(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
162
- return N(`
163
- <td class="esd-block-text items-block-price${E}"
164
- esd-extension-block-id="${_.ORIGINAL_PRICE}"
160
+ const b = k(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
161
+ return w(`
162
+ <td class="esd-block-text items-block-price${I}"
163
+ esd-extension-block-id="${O.ORIGINAL_PRICE}"
165
164
  width="100%"
166
- align="center"${O}>
165
+ align="center"${E}>
167
166
  <p
168
167
  product-attr="originalPrice"
169
168
  contenteditable="false"
170
169
  data-slot-5
171
- data-type="${a}"
170
+ data-type="${s}"
172
171
  data-number="${e}"
173
172
  ${T}
173
+ ${_}
174
+ ${a ? `data-currency_symbol="${a}"` : ""}
174
175
  ${u}
175
- ${$}
176
- ${A}
177
- style="${m(P)}">
176
+ style="${m(b)}">
178
177
  <s>${t}</s>
179
178
  </p>
180
179
  </td>
@@ -182,8 +181,8 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
182
181
  }
183
182
  return `
184
183
  <${R.BLOCK_TEXT}
185
- class="items-block-price ${E}"
186
- esd-extension-block-id="${_.ORIGINAL_PRICE}"
184
+ class="items-block-price ${I}"
185
+ esd-extension-block-id="${O.ORIGINAL_PRICE}"
187
186
  width="100%"
188
187
  align="center"
189
188
  ${n ? "" : 'style="display: none;"'}
@@ -193,33 +192,33 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
193
192
  contenteditable="false"
194
193
  data-slot-5
195
194
  style="color: #cc0000"
196
- data-type="${a}"
195
+ data-type="${s}"
197
196
  data-number="${e}"
198
197
  ${T}
198
+ ${_}
199
+ ${a ? `data-currency_symbol="${a}"` : ""}
199
200
  ${u}
200
- ${$}
201
- ${A}
202
201
  >
203
202
  <s>${t}</s>
204
203
  </p>
205
204
  </${R.BLOCK_TEXT}>
206
205
  `;
207
- }, ct = (a = !0, e, r) => {
208
- const s = a ? "" : 'style="display: none;"';
206
+ }, lt = (s = !0, e, r) => {
207
+ const a = s ? "" : 'style="display: none;"';
209
208
  if (e) {
210
- const i = "font-size: 14px;", d = S(r || "", "text-align") || "center", n = V(r || i);
211
- return N(`
209
+ const i = "font-size: 14px;", d = y(r || "", "text-align") || "center", n = k(r || i);
210
+ return w(`
212
211
  <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
213
212
  width="100%" align="${d}"
214
- esd-extension-block-id="${_.QUANTITY}"
215
- ${s}>
213
+ esd-extension-block-id="${O.QUANTITY}"
214
+ ${a}>
216
215
  <p product-attr="quantity"
217
216
  data-slot-3=""
218
217
  contenteditable="false"
219
218
  width="100%"
220
219
  path="1"
221
220
  style="${m(n)}">
222
- ${v}
221
+ ${X}
223
222
  </p>
224
223
  </td>
225
224
  `);
@@ -229,26 +228,26 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
229
228
  width="100%"
230
229
  align="center"
231
230
  class="es-p10"
232
- esd-extension-block-id="${_.QUANTITY}"
233
- ${a ? "" : 'style="display: none;"'}
231
+ esd-extension-block-id="${O.QUANTITY}"
232
+ ${s ? "" : 'style="display: none;"'}
234
233
  >
235
234
  <p
236
235
  product-attr="quantity"
237
236
  data-slot-3
238
237
  contenteditable="false"
239
238
  width="100%">
240
- ${v}
239
+ ${X}
241
240
  </p>
242
241
  </${R.BLOCK_TEXT}>
243
242
  `;
244
- }, it = (a, e, r = "Buy", s, i, d = !0, n = !0) => {
245
- if (s) {
246
- const c = S(i || "", "background") || S(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", o = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
247
- return N(`
243
+ }, rt = (s, e, r = "Buy", a, i, d = !0, n = !0) => {
244
+ if (a) {
245
+ const c = y(i || "", "background") || y(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", o = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
246
+ return w(`
248
247
  <td class="esd-block-button ins-button default-block-component selectable"
249
248
  align="center" width="100%" name="buy-button" caption="${r}"
250
- esd-extension-block-id="${_.BUTTON}"
251
- product-attr="button" data-slot-6="" data-type="${a}" data-number="${e}"
249
+ esd-extension-block-id="${O.BUTTON}"
250
+ product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
252
251
  ${n ? "" : ' style="display: none;"'}>
253
252
  <span class="es-button-border ${o}" style="${m(l)}">
254
253
  <a
@@ -269,19 +268,19 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
269
268
  name="buy-button"
270
269
  caption="${r}"
271
270
  align="center"
272
- esd-extension-block-id="${_.BUTTON}"
271
+ esd-extension-block-id="${O.BUTTON}"
273
272
  product-attr="button"
274
273
  data-slot-6
275
- data-type="${a}"
274
+ data-type="${s}"
276
275
  data-number="${e}"
277
276
  >${r}
278
277
  </${R.BLOCK_BUTTON}>
279
278
  `;
280
- }, nt = (a, e, r, s = !0, i = !0) => {
281
- const d = e === y.ORIENTATION.VERTICAL, n = r === "horizontal";
279
+ }, ct = (s, e, r, a = !0, i = !0) => {
280
+ const d = e === N.ORIENTATION.VERTICAL, n = r === "horizontal";
282
281
  if (d) {
283
- const c = !n, l = c || !i ? "100%" : "50%", o = c || !s ? "100%" : "50%";
284
- let t = a.replace(
282
+ const c = !n, l = c || !i ? "100%" : "50%", o = c || !a ? "100%" : "50%";
283
+ let t = s.replace(
285
284
  /<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
286
285
  (p) => p.replace(/width="[^"]*"/gi, `width="${l}"`).replace(/width:\s*[^;]+;/gi, `width: ${l};`)
287
286
  );
@@ -290,64 +289,64 @@ const M = (a, e) => a.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
290
289
  (p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
291
290
  ), t;
292
291
  }
293
- return n ? a : a.replace(
292
+ return n ? s : s.replace(
294
293
  /<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
295
294
  (c) => /style\s*=\s*"/i.test(c) ? c.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : c.replace(/>$/, ' style="display: none;">')
296
295
  ).replace(
297
296
  /<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
298
297
  (c) => c.replace(/display:\s*none;?/gi, "display: table-cell;")
299
298
  );
300
- }, dt = (a) => a ? `<td align="center"
299
+ }, it = (s) => s ? `<td align="center"
301
300
  esd-extension-block-id="items-block"
302
- class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : j, W = (a, e, r, s, i, d, n, c, l, o, t, p, T, u = "horizontal", $, O, A, b) => {
303
- const E = o !== void 0 ? ` data-nodup="${o}"` : "", P = `${`data-type="${e}" data-number="${r}"`} data-orientation="${s}"${E}`, D = l == null ? void 0 : l["data-product_image_control_image-height"], X = d ? et(e, r, D, t) : at(e, r), H = (t == null ? void 0 : t.buttonLabel) || "Buy", Q = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, Y = e === y.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", K = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", B = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", C = a.replace("{-{-TEMPLATE_FIRST_LINE-}-}", dt(d)).replace("{-{-PRODUCT_IMAGE-}-}", X).replace("{-{-PRODUCT_NAME-}-}", st(e, d, p, t)).replaceAll(
301
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : q, B = (s, e, r, a, i, d, n, c, l, o, t, p, T, _ = "horizontal", E, u, P, I) => {
302
+ const $ = o !== void 0 ? ` data-nodup="${o}"` : "", A = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"${$}`, D = l == null ? void 0 : l["data-product_image_control_image-height"], V = d ? f(e, r, D, t) : tt(e, r), W = (t == null ? void 0 : t.buttonLabel) || "Buy", z = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, H = e === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", G = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", K = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", Y = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(d)).replace("{-{-PRODUCT_IMAGE-}-}", V).replace("{-{-PRODUCT_NAME-}-}", et(e, d, p, t)).replaceAll(
304
303
  "{-{-PRODUCT_PRICE-}-}",
305
- g(lt(
304
+ g(at(
306
305
  e,
307
306
  r,
308
307
  i,
309
308
  n,
310
309
  c,
311
310
  d,
312
- $,
313
- b,
314
- s,
315
- K
311
+ E,
312
+ I,
313
+ a,
314
+ G
316
315
  ))
317
316
  ).replaceAll(
318
317
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
319
- g(rt(
318
+ g(st(
320
319
  e,
321
320
  r,
322
321
  i,
323
322
  n,
324
323
  c,
325
324
  d,
326
- B,
327
- O,
328
- b,
329
- s
325
+ K,
326
+ u,
327
+ I,
328
+ a
330
329
  ))
331
- ).replace("{-{-PRODUCT_QUANTITY-}-}", ct(Y, d, A)).replace(
330
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", lt(H, d, P)).replace(
332
331
  "{-{-PRODUCT_BUTTON-}-}",
333
- it(e, r, H, d, T, Q, q)
332
+ rt(e, r, W, d, T, z, Q)
334
333
  ).replace(
335
334
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
336
- `<td$1 ${P}>`
335
+ `<td$1 ${A}>`
337
336
  );
338
- return nt(
339
- C,
340
- s,
341
- u,
342
- K,
343
- B
337
+ return ct(
338
+ Y,
339
+ a,
340
+ _,
341
+ G,
342
+ K
344
343
  );
345
344
  };
346
- function bt({
347
- orientation: a,
348
- itemsType: e = y.ITEMS_TYPE.CART_ITEMS,
345
+ function It({
346
+ orientation: s,
347
+ itemsType: e = N.ITEMS_TYPE.CART_ITEMS,
349
348
  itemId: r,
350
- currencySymbol: s,
349
+ currencySymbol: a,
351
350
  currencyLocation: i,
352
351
  migrate: d = !1,
353
352
  formattedPrice: n = !0,
@@ -357,22 +356,22 @@ function bt({
357
356
  buttonStyles: t,
358
357
  priceStyles: p,
359
358
  originalPriceStyles: T,
360
- quantityStyles: u,
361
- priceOrientation: $
359
+ quantityStyles: _,
360
+ priceOrientation: E
362
361
  }) {
363
- const O = J[e].findIndex((X) => X.value === r), A = tt(r, e), b = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
364
- G = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[O >= 0 ? O : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[O >= 0 ? O : 0];
365
- const E = h.PAIRS_FOR_EXTENSION.price[e], I = h.PAIRS_FOR_EXTENSION.originalPrice[e];
366
- b ? (L = n ? E.DEFAULT_SINGLE_PRICE_FORMATTED : E.DEFAULT_SINGLE_PRICE, x = n ? I.DEFAULT_SINGLE_PRICE_FORMATTED : I.DEFAULT_SINGLE_PRICE) : (L = n ? E.DEFAULT_PRICE_FORMATTED : E.DEFAULT_PRICE, x = n ? I.DEFAULT_PRICE_FORMATTED : I.DEFAULT_PRICE), v = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
367
- const P = $ || (l == null ? void 0 : l.priceOrientation) || "horizontal", D = (l == null ? void 0 : l.priceHideDiscount) ?? k.productPriceHideDiscountControlValue === "1";
368
- return a === y.ORIENTATION.VERTICAL ? W(
369
- f,
362
+ const u = j[e].findIndex((V) => V.value === r), P = Z(r, e), I = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
363
+ v = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[u >= 0 ? u : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[u >= 0 ? u : 0];
364
+ const $ = h.PAIRS_FOR_EXTENSION.price[e], b = h.PAIRS_FOR_EXTENSION.originalPrice[e];
365
+ I ? (x = n ? $.DEFAULT_SINGLE_PRICE_FORMATTED : $.DEFAULT_SINGLE_PRICE, L = n ? b.DEFAULT_SINGLE_PRICE_FORMATTED : b.DEFAULT_SINGLE_PRICE) : (x = n ? $.DEFAULT_PRICE_FORMATTED : $.DEFAULT_PRICE, L = n ? b.DEFAULT_PRICE_FORMATTED : b.DEFAULT_PRICE), X = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
366
+ const A = E || (l == null ? void 0 : l.priceOrientation) || "horizontal", D = (l == null ? void 0 : l.priceHideDiscount) ?? M.productPriceHideDiscountControlValue === "1";
367
+ return s === N.ORIENTATION.VERTICAL ? B(
368
+ J,
370
369
  e,
371
- A,
372
- a,
370
+ P,
371
+ s,
373
372
  n,
374
373
  d,
375
- s,
374
+ a,
376
375
  i,
377
376
  c,
378
377
  String(D),
@@ -380,19 +379,19 @@ function bt({
380
379
  l,
381
380
  o,
382
381
  t,
383
- P,
382
+ A,
384
383
  p,
385
384
  T,
386
- u,
387
- b
388
- ) : W(
389
- Z,
385
+ _,
386
+ I
387
+ ) : B(
388
+ C,
390
389
  e,
391
- A,
392
- a,
390
+ P,
391
+ s,
393
392
  n,
394
393
  d,
395
- s,
394
+ a,
396
395
  i,
397
396
  c,
398
397
  String(D),
@@ -400,14 +399,14 @@ function bt({
400
399
  l,
401
400
  o,
402
401
  t,
403
- P,
402
+ A,
404
403
  p,
405
404
  T,
406
- u,
407
- b
405
+ _,
406
+ I
408
407
  );
409
408
  }
410
409
  export {
411
- bt as getDefaultTemplate,
412
- N as wrapInTableRow
410
+ It as getDefaultTemplate,
411
+ w as wrapInTableRow
413
412
  };