@useinsider/guido 1.4.4 → 2.0.0-beta.087a24f

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 (111) hide show
  1. package/README.md +295 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +231 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +1 -1
  6. package/dist/components/Guido.vue2.js +64 -86
  7. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  9. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  10. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  11. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  12. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  13. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  14. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  15. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  16. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  17. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  18. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  19. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  20. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  21. package/dist/composables/useActionsApi.js +42 -25
  22. package/dist/composables/useBlocksConfig.js +23 -20
  23. package/dist/composables/useConfig.js +51 -5
  24. package/dist/composables/useHtmlCompiler.js +20 -19
  25. package/dist/composables/useHtmlValidator.js +41 -41
  26. package/dist/composables/usePartner.js +19 -9
  27. package/dist/composables/useStripo.js +55 -56
  28. package/dist/composables/useTimerClone.js +53 -0
  29. package/dist/composables/useTranslations.js +3 -2
  30. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  31. package/dist/config/migrator/index.js +9 -8
  32. package/dist/config/migrator/itemsBlockMigrator.js +283 -0
  33. package/dist/enums/defaults.js +4 -67
  34. package/dist/enums/unsubscribe.js +23 -20
  35. package/dist/extensions/Blocks/Items/block.js +39 -40
  36. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
  37. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +28 -26
  38. package/dist/extensions/Blocks/Items/controls/settingsControl.js +132 -127
  39. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
  40. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
  41. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
  42. package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
  43. package/dist/extensions/Blocks/Items/template.js +296 -123
  44. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
  45. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +11 -20
  46. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  47. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  48. package/dist/extensions/Blocks/common-control.js +64 -53
  49. package/dist/guido.css +1 -1
  50. package/dist/library.js +12 -2
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +366 -287
  52. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  53. package/dist/node_modules/valibot/dist/index.js +476 -103
  54. package/dist/services/stripoApi.js +13 -14
  55. package/dist/services/templateLibraryApi.js +18 -18
  56. package/dist/src/@types/config/defaults.d.ts +68 -0
  57. package/dist/src/@types/config/index.d.ts +14 -0
  58. package/dist/src/@types/config/schemas.d.ts +509 -0
  59. package/dist/src/@types/config/types.d.ts +142 -0
  60. package/dist/src/@types/config/validator.d.ts +119 -0
  61. package/dist/src/@types/generic.d.ts +4 -45
  62. package/dist/src/components/Guido.vue.d.ts +13 -12
  63. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  64. package/dist/src/composables/useActionsApi.d.ts +2 -0
  65. package/dist/src/composables/useConfig.d.ts +186 -2
  66. package/dist/src/composables/usePartner.d.ts +8 -0
  67. package/dist/src/composables/useTimerClone.d.ts +6 -0
  68. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
  69. package/dist/src/enums/defaults.d.ts +5 -6
  70. package/dist/src/enums/unsubscribe.d.ts +5 -1
  71. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  72. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
  73. package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
  74. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
  75. package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
  76. package/dist/src/library.d.ts +3 -1
  77. package/dist/src/stores/config.d.ts +1564 -102
  78. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  79. package/dist/stores/config.js +141 -9
  80. package/package.json +3 -3
  81. package/dist/node_modules/lodash-es/_apply.js +0 -16
  82. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  83. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  84. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  85. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  86. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  87. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  88. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  89. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  90. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  91. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  92. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  93. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  94. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  95. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  96. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  97. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  98. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  99. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  100. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  101. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  102. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  103. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  104. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  105. package/dist/node_modules/lodash-es/constant.js +0 -8
  106. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  107. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  108. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  109. package/dist/node_modules/lodash-es/merge.js +0 -8
  110. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
  111. package/dist/package.json.js +0 -7
@@ -1,65 +1,55 @@
1
1
  const t = `{-{-TEMPLATE_FIRST_LINE-}-}
2
- <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
2
+ <table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
3
3
  {-{-CONFIG_BLOCK-}-}
4
4
  <tbody>
5
5
  <tr>
6
- <td style="padding: 16px 9px;">
7
- <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left" width="100%">
8
- <tbody>
9
- <tr>
10
- <td class="product-image-class" data-slot-1>
11
- {-{-PRODUCT_IMAGE-}-}
12
- </td>
13
- <td class="product-name-class" data-slot-2>
14
- <table>
15
- <tbody>
16
- {-{-PRODUCT_NAME-}-}
17
- </tbody>
18
- </table>
19
- </td>
20
- <td class="product-quantity-class" data-slot-3>
21
- <table width="100%">
22
- <tbody>
23
- {-{-PRODUCT_QUANTITY-}-}
24
- </tbody>
25
- </table>
26
- </td>
27
- <td class="product-price-class horizontal-price" data-slot-4>
28
- <table width="100%">
29
- <tbody>
30
- {-{-PRODUCT_PRICE-}-}
31
- </tbody>
32
- </table>
33
- </td>
34
- <td class="product-original-price-class horizontal-price" data-slot-5>
35
- <table width="100%">
36
- <tbody>
37
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
38
- </tbody>
39
- </table>
40
- </td>
41
- <td class="product-price-container vertical-price" data-slot-4 style="display: none;">
42
- <table class="product-price-class" width="100%" data-slot-4>
43
- <tbody>
44
- {-{-PRODUCT_PRICE-}-}
45
- </tbody>
46
- </table>
47
- <table class="product-original-price-class product-original-price-container"
48
- width="100%" data-slot-5>
49
- <tbody>
50
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
51
- </tbody>
52
- </table>
53
- </td>
54
- <td class="product-button-class" data-slot-6>
55
- <table width="100%">
56
- <tbody>
57
- {-{-PRODUCT_BUTTON-}-}
58
- </tbody>
59
- </table>
60
- </td>
61
- </tr>
62
- </tbody>
6
+ <td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
7
+ <table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
8
+ <tr style="vertical-align: top">
9
+ <td colspan="2" width="100%" align="center" data-slot-1>
10
+ <table width="100%">
11
+ <tbody>
12
+ {-{-PRODUCT_IMAGE-}-}
13
+ </tbody>
14
+ </table>
15
+ </td>
16
+ </tr>
17
+ {-{-PRODUCT_NAME-}-}
18
+ <tr>
19
+ <td width="50%" style=" width: 50%;display: block;float: left;" class="product-price-class">
20
+ <table width="100%">
21
+ <tbody>
22
+ {-{-PRODUCT_PRICE-}-}
23
+ </tbody>
24
+ </table>
25
+ </td>
26
+ <td width="50%" style=" width: 50%;display: block;float: left;"
27
+ class="product-original-price-class">
28
+ <table width="100%">
29
+ <tbody>
30
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
31
+ </tbody>
32
+ </table>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td width="100%" class="product-quantity-class" data-slot-3>
37
+ <table width="100%">
38
+ <tbody>
39
+ {-{-PRODUCT_QUANTITY-}-}
40
+ </tbody>
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td width="100%" class="product-button-class" data-slot-6>
46
+ <table width="100%">
47
+ <tbody>
48
+ {-{-PRODUCT_BUTTON-}-}
49
+ </tbody>
50
+ </table>
51
+ </td>
52
+ </tr>
63
53
  </table>
64
54
  </td>
65
55
  </tr>
@@ -9,11 +9,11 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
9
9
  buttonLink: o(t),
10
10
  orientation: e.cardOrientationControlValue,
11
11
  nameTrimming: !0,
12
- hideDiscount: !1,
12
+ hideDiscount: !0,
13
13
  currencySymbol: "USD",
14
14
  currencyLocation: "0",
15
15
  formattedPrice: !0,
16
- priceOrientation: "horizontal",
16
+ priceOrientation: "vertical",
17
17
  templateData: {
18
18
  imageSrc: "",
19
19
  name: "",
@@ -1,29 +1,86 @@
1
- import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as T } from "./enums/controlEnums.js";
3
- import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
4
- import { ItemInCartOptions as f, SETTINGS_ENUMS as O, DefaultConfigValues as P } from "./enums/settingsEnums.js";
5
- import B from "./layouts/horizontal.html.js";
6
- import g from "./layouts/vertical.html.js";
7
- let [C] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [p] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [I] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
- const h = (a, t) => `
9
- <${l.BLOCK_IMAGE}
10
- ${_.BLOCK_IMAGE.src}="${C}"
11
- ${_.BLOCK_IMAGE.alt}="${A}"
12
- ${_.BLOCK_IMAGE.href}="#!"
13
- ${_.BLOCK_IMAGE.width}=${P.productImageWidth}
14
- esd-extension-block-id="${T.IMAGE}"
1
+ import { BlockType as $, BlockAttr as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as b } from "./enums/controlEnums.js";
3
+ import { productPairs as c, templateFirstLine as v } from "./enums/productEnums.js";
4
+ import { ItemInCartOptions as X, SETTINGS_ENUMS as y, DefaultConfigValues as P } from "./enums/settingsEnums.js";
5
+ import K from "./layouts/horizontal.html.js";
6
+ import z from "./layouts/vertical.html.js";
7
+ let [N] = c.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = c.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [f] = c.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [k] = c.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [m] = c.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const S = (e) => e.split(";").map((t) => t.trim()).filter((t) => !t.toLowerCase().startsWith("text-align")).join("; ").replace(/;\s*$/, ""), G = (e, t, n) => {
9
+ const a = n || P.productImageWidth;
10
+ return `
11
+ <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
12
+ align="center"
13
+ esd-extension-block-id="items-block-image"
14
+ data-slot-1=""
15
+ product-attr="imageSrc"
16
+ data-type="${e}"
17
+ data-number="${t}"
18
+ style="font-size: 0px;">
19
+ <a class="document-node-component ng-star-inserted"
20
+ target="_blank"
21
+ href="#!">
22
+ <img class="adapt-img document-node-component ng-star-inserted"
23
+ src="${N}"
24
+ alt="${A}"
25
+ width="${a}">
26
+ </a>
27
+ </td>
28
+ `;
29
+ }, Q = (e, t) => `
30
+ <${$.BLOCK_IMAGE}
31
+ ${R.BLOCK_IMAGE.src}="${N}"
32
+ ${R.BLOCK_IMAGE.alt}="${A}"
33
+ ${R.BLOCK_IMAGE.href}="#!"
34
+ ${R.BLOCK_IMAGE.width}="${P.productImageWidth}"
35
+ ${R.BLOCK_IMAGE.height}="${P.productImageWidth}"
36
+ esd-extension-block-id="${b.IMAGE}"
15
37
  data-slot-1
16
38
  product-attr="imageSrc"
17
- data-type="${a}"
39
+ data-type="${e}"
18
40
  data-number="${t}"
19
41
  />
20
- `, F = (a) => `
21
- <${l.BLOCK_TEXT}
42
+ `, W = (e, t, n, a) => {
43
+ const l = `
44
+ text-decoration:none;
45
+ font-size: inherit;
46
+ font-weight: inherit;
47
+ line-height: inherit;
48
+ font-family: inherit;
49
+ color: inherit;
50
+ display: block;
51
+ word-wrap:break-word;
52
+ white-space: nowrap;
53
+ width: ${n === y.ORIENTATION.HORIZONTAL ? "130px" : "520px"};
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ `, o = a || l;
57
+ return t ? `
58
+ <td class="esd-block-text es-p10"
59
+ align="center"
60
+ width="100%"
61
+ data-type="${e}"
62
+ esd-extension-block-id="${b.NAME}"
63
+ style="display: table-cell;">
64
+ <div id="renderedContent" class="service-element text-block-input-area text-block-preview-area"
65
+ style="outline: none;" contenteditable="">
66
+ <p contenteditable="false" path="1">
67
+ <a
68
+ href="#!"
69
+ style="${o}"
70
+ product-attr="name"
71
+ data-slot-2
72
+ width="100%">
73
+ ${A}
74
+ </a>
75
+ </p>
76
+ </div>
77
+ </td>
78
+ ` : `<${$.BLOCK_TEXT}
22
79
  width="100%"
23
80
  align="center"
24
81
  class="es-p10"
25
- data-type="${a}"
26
- esd-extension-block-id="${T.NAME}"
82
+ data-type="${e}"
83
+ esd-extension-block-id="${b.NAME}"
27
84
  >
28
85
  <p contenteditable="false">
29
86
  <a
@@ -48,148 +105,264 @@ const h = (a, t) => `
48
105
  ${A}
49
106
  </a>
50
107
  </p>
51
- </${l.BLOCK_TEXT}>
52
- `, S = (a, t, o, e, c) => {
53
- let n = p;
54
- if (e && e.trim()) {
55
- const E = `&nbsp;${e.trim()}&nbsp;`;
56
- n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
108
+ </${$.BLOCK_TEXT}>
109
+ `;
110
+ }, q = (e, t, n, a, r, l, o) => {
111
+ let d = f;
112
+ if (a && a.trim()) {
113
+ const u = `&nbsp;${a.trim()}&nbsp;`;
114
+ d = (r || "0") === "1" ? `${f}${u}` : `${u}${f}`;
115
+ }
116
+ const s = r === "1" ? "after" : "before", T = `data-formated="${n ? "true" : "false"}"`, i = `data-curency="${s}"`, E = a ? `data-currency_symbol="${a}"` : "";
117
+ if (l) {
118
+ const p = S(o || "color: #060606; white-space: nowrap; font-size: 20px;");
119
+ return `
120
+ <td class="esd-block-text items-block-price"
121
+ align="center"
122
+ esd-extension-block-id="items-block-price"
123
+ width="100%">
124
+ <p product-attr="price"
125
+ contenteditable="false"
126
+ data-slot-4
127
+ data-type="${e}"
128
+ data-number="${t}"
129
+ ${T}
130
+ ${i}
131
+ ${E}
132
+ style="${p}">
133
+ ${d}
134
+ </p>
135
+ </td>`;
57
136
  }
58
- const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
59
137
  return `
60
- <${l.BLOCK_TEXT}
61
- esd-extension-block-id="${T.PRICE}"
138
+ <${$.BLOCK_TEXT}
139
+ esd-extension-block-id="${b.PRICE}"
62
140
  class="items-block-price"
63
- width="100%"
64
- align="center"
141
+ width="100%"
142
+ align="center"
65
143
  >
66
- <p
144
+ <p
67
145
  product-attr="price"
68
146
  contenteditable="false"
69
147
  data-slot-4
70
- data-type="${a}"
148
+ data-type="${e}"
71
149
  data-number="${t}"
72
- ${d}
73
- ${s}
74
- ${e ? `data-currency_symbol="${e}"` : ""}
150
+ ${T}
151
+ ${i}
152
+ ${a ? `data-currency_symbol="${a}"` : ""}
75
153
  >
76
- ${n}
154
+ ${d}
77
155
  </p>
78
- </${l.BLOCK_TEXT}>
156
+ </${$.BLOCK_TEXT}>
79
157
  `;
80
- }, L = (a, t, o, e, c) => {
81
- let n = I;
82
- if (e && e.trim()) {
83
- const E = `&nbsp;${e.trim()}&nbsp;`;
84
- n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
158
+ }, V = (e, t, n, a, r, l, o = !0, d) => {
159
+ let s = k;
160
+ if (a && a.trim()) {
161
+ const p = `&nbsp;${a.trim()}&nbsp;`;
162
+ s = (r || "0") === "1" ? `${k}${p}` : `${p}${k}`;
163
+ }
164
+ const T = r === "1" ? "after" : "before", i = `data-formated="${n ? "true" : "false"}"`, E = `data-curency="${T}"`, u = o ? "" : ' style="display: none;"';
165
+ if (l) {
166
+ const O = S(d || "color: #cc0000; white-space: nowrap; font-size: 19px;");
167
+ return `
168
+ <td class="esd-block-text items-block-price"
169
+ esd-extension-block-id="items-block-original-price"
170
+ width="100%"
171
+ align="center"${u}>
172
+ <p
173
+ product-attr="originalPrice"
174
+ contenteditable="false"
175
+ data-slot-5
176
+ data-type="${e}"
177
+ data-number="${t}"
178
+ ${i}
179
+ ${E}
180
+ ${a ? `data-currency_symbol="${a}"` : ""}
181
+ style="${O}">
182
+ <s>${s}</s>
183
+ </p>
184
+ </td>`;
85
185
  }
86
- const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
87
186
  return `
88
- <${l.BLOCK_TEXT}
187
+ <${$.BLOCK_TEXT}
89
188
  class="items-block-price"
90
- esd-extension-block-id="${T.ORIGINAL_PRICE}"
91
- width="100%"
92
- align="center"
189
+ esd-extension-block-id="${b.ORIGINAL_PRICE}"
190
+ width="100%"
191
+ align="center"
192
+ ${o ? "" : 'style="display: none;"'}
93
193
  >
94
194
  <p
95
195
  product-attr="originalPrice"
96
- contenteditable="false"
196
+ contenteditable="false"
97
197
  data-slot-5
98
198
  style="color: #cc0000"
99
- data-type="${a}"
199
+ data-type="${e}"
100
200
  data-number="${t}"
101
- ${d}
102
- ${s}
103
- ${e ? `data-currency_symbol="${e}"` : ""}
201
+ ${i}
202
+ ${E}
203
+ ${a ? `data-currency_symbol="${a}"` : ""}
104
204
  >
105
- <s>${n}</s>
205
+ <s>${s}</s>
106
206
  </p>
107
- </${l.BLOCK_TEXT}>
207
+ </${$.BLOCK_TEXT}>
108
208
  `;
109
- }, b = () => `
110
- <${l.BLOCK_TEXT}
111
- width="100%"
112
- align="center"
113
- class="es-p10"
114
- esd-extension-block-id="${T.QUANTITY}"
115
- >
116
- <p
117
- product-attr="quantity"
118
- data-slot-3
119
- contenteditable="false"
120
- width="100%">
121
- ${u}
122
- </p>
123
- </${l.BLOCK_TEXT}>
124
- `, U = (a, t) => `
125
- <${l.BLOCK_BUTTON}
126
- width="100%"
127
- class="ins-button"
128
- name="buy-button"
129
- caption="Buy"
130
- align="center"
131
- esd-extension-block-id="${T.BUTTON}"
132
- product-attr="button"
133
- data-slot-6
134
- data-type="${a}"
135
- data-number="${t}"
136
- >Buy
137
- </${l.BLOCK_BUTTON}>
138
- `, D = () => `
139
- <esd-config-block style="display: none;"></esd-config-block>
140
- `, R = (a, t, o, e, c, n, r, d) => {
141
- const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
142
- return a.replace(
209
+ }, H = (e = !0, t, n) => {
210
+ const a = e ? "" : 'style="display: none;"';
211
+ return t ? `
212
+ <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
213
+ width="100%" align="center" esd-extension-block-id="items-block-quantity" ${a}>
214
+ <div class="service-element text-block-input-area text-block-preview-area"
215
+ style="outline: none;" contenteditable="">
216
+ <p product-attr="quantity" data-slot-3="" contenteditable="false" width="100%" path="1"
217
+ style="${n || "text-align: center; font-size: 14px;"}">
218
+ ${m}
219
+ </p>
220
+ </div>
221
+ </td>` : `
222
+ <${$.BLOCK_TEXT}
223
+ width="100%"
224
+ align="center"
225
+ class="es-p10"
226
+ esd-extension-block-id="${b.QUANTITY}"
227
+ ${e ? "" : 'style="display: none;"'}
228
+ >
229
+ <p
230
+ product-attr="quantity"
231
+ data-slot-3
232
+ contenteditable="false"
233
+ width="100%">
234
+ ${m}
235
+ </p>
236
+ </${$.BLOCK_TEXT}>
237
+ `;
238
+ }, j = (e, t, n = "Buy", a, r) => a ? `
239
+ <td class="esd-block-button ins-button default-block-component selectable"
240
+ align="center" width="100%" name="buy-button" caption="${n}"
241
+ esd-extension-block-id="items-block-button"
242
+ product-attr="button" data-slot-6="" data-type="${e}" data-number="${t}">
243
+ <span class="es-button-border" style="border-width: 0px;">
244
+ <a class="es-button" href="#!" target="_blank" style="${r || ""}">
245
+ ${n}
246
+ </a>
247
+ </span>
248
+ </td>` : `
249
+ <${$.BLOCK_BUTTON}
250
+ width="100%"
251
+ class="ins-button"
252
+ name="buy-button"
253
+ caption="${n}"
254
+ align="center"
255
+ esd-extension-block-id="${b.BUTTON}"
256
+ product-attr="button"
257
+ data-slot-6
258
+ data-type="${e}"
259
+ data-number="${t}"
260
+ >${n}
261
+ </${$.BLOCK_BUTTON}>
262
+ `, Y = (e) => !e || Object.keys(e).length === 0 ? '<esd-config-block style="display: none;"></esd-config-block>' : `<esd-config-block style="display: none;" ${Object.entries(e).map(([n, a]) => `${n}="${a}"`).join(" ")}></esd-config-block>`, Z = (e, t, n) => {
263
+ const a = t === y.ORIENTATION.VERTICAL, r = n === "horizontal";
264
+ return a ? r ? e : e.replace(
265
+ /<td\s+[^>]*class="[^"]*product-(?:original-)?price-class[^"]*"[^>]*>/gi,
266
+ (l) => l.replace(/width="50%"/gi, 'width="100%"').replace(/width:\s*50%;/gi, "width: 100%;")
267
+ ) : r ? e : e.replace(
268
+ /<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
269
+ (l) => /style\s*=\s*"/i.test(l) ? l.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : l.replace(/>$/, ' style="display: none;">')
270
+ ).replace(
271
+ /<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
272
+ (l) => l.replace(/display:\s*none;?/gi, "display: table-cell;")
273
+ );
274
+ }, J = (e) => e ? `<td align="center"
275
+ esd-extension-block-id="items-block" width="560"
276
+ data-number="4"
277
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : v, g = (e, t, n, a, r, l, o, d, s, T, i, E, u, p = "horizontal", O, _, I) => {
278
+ const x = `${`data-type="${t}" data-number="${n}"`} data-orientation="${a}"`, L = e.replace(
143
279
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
144
- `<td$1 ${$}>`
145
- ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
280
+ `<td$1 ${x}>`
281
+ ), F = s == null ? void 0 : s["data-product_image_control_image-width"], C = l ? G(t, n, F) : Q(t, n), M = (i == null ? void 0 : i.buttonLabel) || "Buy", U = (i == null ? void 0 : i.quantityControlEnabled) !== void 0 ? i.quantityControlEnabled : !0, D = (i == null ? void 0 : i.originalPriceVisible) !== void 0 ? i.originalPriceVisible : (s == null ? void 0 : s["data-product_original_price_control_enabled"]) !== "false", B = L.replace("{-{-TEMPLATE_FIRST_LINE-}-}", J(l)).replace("{-{-PRODUCT_IMAGE-}-}", C).replace("{-{-PRODUCT_NAME-}-}", W(t, l, a, E)).replaceAll(
146
282
  "{-{-PRODUCT_PRICE-}-}",
147
- S(t, o, c, n, r)
283
+ q(t, n, r, o, d, l, O)
148
284
  ).replaceAll(
149
285
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
150
- L(
286
+ V(
151
287
  t,
152
- o,
153
- c,
154
288
  n,
155
- r
289
+ r,
290
+ o,
291
+ d,
292
+ l,
293
+ D,
294
+ _
156
295
  )
157
- ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
296
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", H(U, l, I)).replace("{-{-PRODUCT_BUTTON-}-}", j(t, n, M, l, u)).replace("{-{-CONFIG_BLOCK-}-}", Y(s));
297
+ return Z(B, a, p);
158
298
  };
159
- function G({
160
- orientation: a,
161
- itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
162
- itemId: o,
163
- currencySymbol: e,
164
- currencyLocation: c,
165
- formattedPrice: n = !0
299
+ function st({
300
+ orientation: e,
301
+ itemsType: t = y.ITEMS_TYPE.CART_ITEMS,
302
+ itemId: n,
303
+ currencySymbol: a,
304
+ currencyLocation: r,
305
+ migrate: l = !1,
306
+ formattedPrice: o = !0,
307
+ configBlockAttributes: d,
308
+ nodeConfig: s,
309
+ nameStyles: T,
310
+ buttonStyles: i,
311
+ priceStyles: E,
312
+ originalPriceStyles: u,
313
+ quantityStyles: p,
314
+ priceOrientation: O
166
315
  }) {
167
- const r = f[t].findIndex((s) => s.value === o);
168
- let d = "1";
169
- if (r >= 0)
170
- d = String(r + 1);
171
- else if (o) {
172
- const s = o.match(/\((\d+)\)/);
173
- s && s[1] && ([, d] = s);
316
+ const _ = X[t].findIndex((h) => h.value === n);
317
+ let I = "1";
318
+ if (_ >= 0)
319
+ I = String(_ + 1);
320
+ else if (n) {
321
+ const h = n.match(/\((\d+)\)/);
322
+ h && h[1] && ([, I] = h);
174
323
  }
175
- return C = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], A = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], p = n ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, I = n ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? R(
176
- g,
324
+ N = c.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[_ >= 0 ? _ : 0], A = c.PAIRS_FOR_EXTENSION.name[t].DEFAULT[_ >= 0 ? _ : 0], f = o ? c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, k = o ? c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, m = c.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
325
+ const w = O || (s == null ? void 0 : s.priceOrientation) || "horizontal";
326
+ return e === y.ORIENTATION.VERTICAL ? g(
327
+ z,
177
328
  t,
178
- d,
179
- a,
180
- n,
329
+ I,
181
330
  e,
182
- c
183
- ) : R(
184
- B,
185
- t,
186
- d,
331
+ o,
332
+ l,
187
333
  a,
188
- n,
334
+ r,
335
+ d,
336
+ void 0,
337
+ // nodup
338
+ s,
339
+ T,
340
+ i,
341
+ w,
342
+ E,
343
+ u,
344
+ p
345
+ ) : g(
346
+ K,
347
+ t,
348
+ I,
189
349
  e,
190
- c
350
+ o,
351
+ l,
352
+ a,
353
+ r,
354
+ d,
355
+ void 0,
356
+ // nodup
357
+ s,
358
+ T,
359
+ i,
360
+ w,
361
+ E,
362
+ u,
363
+ p
191
364
  );
192
365
  }
193
366
  export {
194
- G as getDefaultTemplate
367
+ st as getDefaultTemplate
195
368
  };