@useinsider/guido 3.17.0-beta.00eb243 → 3.17.0-beta.11939b0

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