@useinsider/guido 1.0.3-beta.ba79634 → 1.0.3-beta.bd6a5dd

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 (108) hide show
  1. package/README.md +3 -32
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
  4. package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
  5. package/dist/composables/useActionsApi.js +1 -1
  6. package/dist/composables/useHtmlValidator.js +36 -35
  7. package/dist/composables/useStripo.js +29 -25
  8. package/dist/extensions/Blocks/Checkbox/control.js +15 -14
  9. package/dist/extensions/Blocks/Checkbox/template.js +14 -9
  10. package/dist/extensions/Blocks/Items/block.js +26 -26
  11. package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
  12. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
  13. package/dist/extensions/Blocks/Items/controls/settingsControl.js +90 -83
  14. package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
  15. package/dist/extensions/Blocks/Items/enums/productEnums.js +63 -4
  16. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +3 -2
  17. package/dist/extensions/Blocks/Items/extension.js +7 -6
  18. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
  19. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +67 -56
  20. package/dist/extensions/Blocks/Items/settingsPanel.js +8 -8
  21. package/dist/extensions/Blocks/Items/store/items-block.js +8 -4
  22. package/dist/extensions/Blocks/Items/template.js +75 -72
  23. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
  24. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
  25. package/dist/extensions/Blocks/RadioButton/control.js +18 -17
  26. package/dist/extensions/Blocks/RadioButton/template.js +18 -9
  27. package/dist/extensions/Blocks/Unsubscribe/block.js +45 -41
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  30. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  31. package/dist/node_modules/lodash-es/_Set.js +6 -0
  32. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  33. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  34. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  35. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
  36. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  37. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  38. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  39. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  40. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  41. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  42. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  43. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  44. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  45. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  46. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  47. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  48. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  49. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  50. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  51. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  52. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  53. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  54. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  55. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  56. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  57. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  58. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  59. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  60. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  61. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  62. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  63. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  64. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  65. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  66. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  67. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  68. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  69. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  70. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  71. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  72. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  73. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  74. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  75. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  76. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  77. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  78. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  79. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  80. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  81. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  82. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  83. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  84. package/dist/node_modules/lodash-es/get.js +8 -0
  85. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  86. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  87. package/dist/node_modules/lodash-es/keys.js +9 -0
  88. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  89. package/dist/node_modules/lodash-es/map.js +11 -0
  90. package/dist/node_modules/lodash-es/property.js +10 -0
  91. package/dist/node_modules/lodash-es/range.js +5 -0
  92. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  93. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  94. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  95. package/dist/node_modules/lodash-es/toString.js +7 -0
  96. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  97. package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
  98. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
  99. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +5 -2
  100. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
  101. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  102. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +1 -0
  103. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
  104. package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
  105. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
  106. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  107. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
  108. package/package.json +5 -10
@@ -1,70 +1,70 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var s = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { ModificationDescription as n, UIElementType as a, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ var n = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ModificationDescription as a, UIElementType as l, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  import { CommonControl as c } from "../../../common-control.js";
6
- import { ItemsBlockControlId as l } from "../../enums/controlEnums.js";
6
+ import { ItemsBlockControlId as p } from "../../enums/controlEnums.js";
7
7
  import { SETTINGS_ENUMS as I } from "../../enums/settingsEnums.js";
8
8
  import { useItemsBlockStore as N } from "../../store/items-block.js";
9
- import { syncNameTrimmingFromAttributes as y } from "../../utils/syncAttributesFromConfigBlock.js";
10
- import { updateConfigBlockAttributes as M } from "../../utils/updateAttributes.js";
11
- const f = l.NAME_TRIMMING, r = {
9
+ import { syncNameTrimmingFromAttributes as M } from "../../utils/syncAttributesFromConfigBlock.js";
10
+ import { updateConfigBlockAttributes as u } from "../../utils/updateAttributes.js";
11
+ const y = p.NAME_TRIMMING, o = {
12
12
  TRIMMING: "trimming"
13
13
  };
14
- class R extends c {
14
+ class _ extends c {
15
15
  constructor() {
16
16
  super(...arguments);
17
- s(this, "store", N());
17
+ n(this, "store", N());
18
18
  }
19
19
  getId() {
20
- return f;
20
+ return y;
21
21
  }
22
22
  getTemplate() {
23
23
  return `
24
- <div class="${l.NAME_TRIMMING}">
24
+ <div class="${p.NAME_TRIMMING}">
25
25
  ${this._getTextTrimming()}
26
26
  </div>
27
27
  `;
28
28
  }
29
29
  onRender() {
30
- this.api.updateValues({ [r.TRIMMING]: this.store.nameTrimming }), this.api.onValueChanged(r.TRIMMING, (e) => {
30
+ this.api.updateValues({ [o.TRIMMING]: this.store.nameTrimming }), this.api.onValueChanged(o.TRIMMING, (e) => {
31
31
  this._onTrimmingChange(e);
32
32
  });
33
33
  }
34
34
  onTemplateNodeUpdated(e) {
35
35
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
36
- () => y(this.currentNode),
36
+ () => M(this.currentNode),
37
37
  () => {
38
- this.api.updateValues({ [r.TRIMMING]: this.store.nameTrimming });
38
+ this.api.updateValues({ [o.TRIMMING]: this.store.nameTrimming });
39
39
  }
40
- ), this.store.nameTrimming && this._applyTrimmingStyles();
40
+ );
41
41
  }
42
42
  _onTrimmingChange(e) {
43
- this.store.setNameTrimming(e), M(this.currentNode, this.api), this.api.updateValues({ [r.TRIMMING]: e }), this._applyTrimmingStyles(e);
43
+ this.store.setNameTrimming(e), u(this.currentNode, this.api), this.api.updateValues({ [o.TRIMMING]: e }), this._applyTrimmingStyles(e);
44
44
  }
45
45
  _applyTrimmingStyles(e) {
46
- var m;
47
- const o = (m = this.currentNode) == null ? void 0 : m.querySelector("p");
48
- if (!o)
46
+ var s;
47
+ const r = (s = this.currentNode) == null ? void 0 : s.querySelector("p > a");
48
+ if (!r)
49
49
  return;
50
- const p = e !== void 0 ? e : this.store.nameTrimming, T = this.store.orientation === I.ORIENTATION.VERTICAL;
51
- p ? this.api.getDocumentModifier().modifyHtml(o).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", T ? "130px" : "100%").apply(new n("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(o).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").apply(new n("Text Trimming Disabled"));
50
+ const T = e !== void 0 ? e : this.store.nameTrimming, m = this.store.orientation === I.ORIENTATION.VERTICAL;
51
+ T ? this.api.getDocumentModifier().modifyHtml(r).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", m ? "130px" : "520px").apply(new a("Text Trimming Enabled")) : this.api.getDocumentModifier().modifyHtml(r).removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow").removeStyle("max-width").setStyle("max-width", m ? "130px" : "520px").apply(new a("Text Trimming Disabled"));
52
52
  }
53
53
  _getTextTrimming() {
54
54
  return `
55
55
  <div class="container">
56
56
  <div class="display-flex align-items-center justify-content-between">
57
- <${a.LABEL}
57
+ <${l.LABEL}
58
58
  ${g.LABEL.text}="${this.api.translate("Text Trimming")}"
59
59
  >
60
- </${a.LABEL}>
61
- ${this._GuToggle(r.TRIMMING)}
60
+ </${l.LABEL}>
61
+ ${this._GuToggle(o.TRIMMING)}
62
62
  </div>
63
63
  </div>
64
64
  `;
65
65
  }
66
66
  }
67
67
  export {
68
- f as CONTROL_BLOCK_ID,
69
- R as NameTrimmingControl
68
+ y as CONTROL_BLOCK_ID,
69
+ _ as NameTrimmingControl
70
70
  };
@@ -0,0 +1,92 @@
1
+ var I = Object.defineProperty;
2
+ var y = (n, o, t) => o in n ? I(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
+ var m = (n, o, t) => y(n, typeof o != "symbol" ? o + "" : o, t);
4
+ import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
6
+ import { ItemsBlockControlId as O } from "../../enums/controlEnums.js";
7
+ import { SETTINGS_ENUMS as N } from "../../enums/settingsEnums.js";
8
+ import { useItemsBlockStore as f } from "../../store/items-block.js";
9
+ import { syncPriceOrientationFromAttributes as T } from "../../utils/syncAttributesFromConfigBlock.js";
10
+ import { updateConfigBlockAttributes as P } from "../../utils/updateAttributes.js";
11
+ const _ = O.PRICE_ORIENTATION, p = {
12
+ PRICE_ORIENTATION: "priceOrientation"
13
+ }, C = [
14
+ { icon: "vertical-orientation", value: "vertical" },
15
+ { icon: "horizontal-orientation", value: "horizontal" }
16
+ ];
17
+ class v extends E {
18
+ constructor() {
19
+ super(...arguments);
20
+ m(this, "store", f());
21
+ }
22
+ getId() {
23
+ return _;
24
+ }
25
+ getTemplate() {
26
+ return `
27
+ <div class="${O.PRICE_ORIENTATION}">
28
+ ${this._getPriceOrientation()}
29
+ </div>
30
+ `;
31
+ }
32
+ onRender() {
33
+ this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation }), this.api.onValueChanged(p.PRICE_ORIENTATION, (t) => {
34
+ this._onPriceOrientationChange(t);
35
+ });
36
+ }
37
+ onTemplateNodeUpdated(t) {
38
+ super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
39
+ () => {
40
+ T(this.currentNode);
41
+ },
42
+ () => {
43
+ this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation });
44
+ }
45
+ );
46
+ }
47
+ _onPriceOrientationChange(t) {
48
+ if (console.debug("Price orientation changed to: ", t), this.store.setPriceOrientation(t), P(this.currentNode, this.api), !this.currentNode)
49
+ return;
50
+ const { orientation: i } = this.store, r = i === N.ORIENTATION.VERTICAL, e = t === "horizontal";
51
+ r ? this._updateVerticalLayout(e) : this._updateHorizontalLayout(e);
52
+ }
53
+ _updateHorizontalLayout(t) {
54
+ var c, l, d, a;
55
+ const i = ((l = (c = this.currentNode) == null ? void 0 : c.closest(".ins-product-td")) == null ? void 0 : l.querySelectorAll(".product-price-class")) || [], r = ((a = (d = this.currentNode) == null ? void 0 : d.closest(".ins-product-td")) == null ? void 0 : a.querySelectorAll(".product-original-price-class")) || [];
56
+ if (!i || !r)
57
+ return;
58
+ const e = t ? "50%" : "100%", s = this.api.getDocumentModifier();
59
+ i.forEach((u) => {
60
+ s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
61
+ }), r.forEach((u) => {
62
+ s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
63
+ }), s.apply(new h(`Updated original price element width to ${e}`));
64
+ }
65
+ _updateVerticalLayout(t) {
66
+ var s, c, l, d;
67
+ const i = ((c = (s = this.currentNode) == null ? void 0 : s.closest(".ins-product-td")) == null ? void 0 : c.querySelectorAll(".horizontal-price")) || [], r = (d = (l = this.currentNode) == null ? void 0 : l.closest(".ins-product-td")) == null ? void 0 : d.querySelector(".vertical-price");
68
+ if (!i || !r || i.length === 0)
69
+ return;
70
+ const e = this.api.getDocumentModifier();
71
+ t ? (i.forEach((a) => {
72
+ e.modifyHtml(a).setStyle("display", "table-cell");
73
+ }), e.modifyHtml(r).setStyle("display", "none").apply(new h("Hide vertical price element"))) : (i.forEach((a) => {
74
+ e.modifyHtml(a).setStyle("display", "none");
75
+ }), e.modifyHtml(r).setStyle("display", "table-cell").apply(new h("Show vertical price element")));
76
+ }
77
+ _getPriceOrientation() {
78
+ return `
79
+ ${this._GuTwoColumns([
80
+ this._GuLabel({ text: "Price Orientation" }),
81
+ this._GuRadioButton({
82
+ name: p.PRICE_ORIENTATION,
83
+ buttons: C
84
+ })
85
+ ])}
86
+ `;
87
+ }
88
+ }
89
+ export {
90
+ _ as CONTROL_BLOCK_ID,
91
+ v as PriceOrientationControl
92
+ };
@@ -1,28 +1,29 @@
1
- var A = Object.defineProperty;
2
- var M = (T, u, e) => u in T ? A(T, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[u] = e;
3
- var b = (T, u, e) => M(T, typeof u != "symbol" ? u + "" : u, e);
4
- import { UEAttr as C, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as P } from "../../common-control.js";
6
- import { ItemsBlockId as m } from "../enums/controlEnums.js";
7
- import { productPairs as p } from "../enums/productEnums.js";
8
- import { ItemTypeOptions as R, OrientationOptions as D, ItemInCartOptions as y, SETTINGS_ENUMS as S } from "../enums/settingsEnums.js";
9
- import x from "../layouts/horizontal.html.js";
10
- import L from "../layouts/vertical.html.js";
11
- import { useItemsBlockStore as H } from "../store/items-block.js";
12
- import { getDefaultTemplate as U } from "../template.js";
1
+ var M = Object.defineProperty;
2
+ var D = (h, p, e) => p in h ? M(h, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[p] = e;
3
+ var b = (h, p, e) => D(h, typeof p != "symbol" ? p + "" : p, e);
4
+ import { UEAttr as A, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as x } from "../../common-control.js";
6
+ import { ItemsBlockId as l } from "../enums/controlEnums.js";
7
+ import { productPairs as T, templateFirstLine as R } from "../enums/productEnums.js";
8
+ import { ItemTypeOptions as P, OrientationOptions as L, ItemInCartOptions as N, SETTINGS_ENUMS as S, DefaultConfigValues as H } from "../enums/settingsEnums.js";
9
+ import U from "../layouts/horizontal.html.js";
10
+ import F from "../layouts/vertical.html.js";
11
+ import { useItemsBlockStore as $ } from "../store/items-block.js";
12
+ import { getDefaultTemplate as q } from "../template.js";
13
+ import { syncCurrencySymbolFromAttributes as k, syncCurrencyLocationFromAttributes as w, syncFormattedPriceFromAttributes as B } from "../utils/syncAttributesFromConfigBlock.js";
13
14
  import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
14
- const $ = "ui-elements-items-block", s = {
15
+ const G = "ui-elements-items-block", s = {
15
16
  ITEMS_TYPE: "itemsType",
16
17
  ORIENTATION: "orientation",
17
18
  ITEM_IDS: "itemIds"
18
19
  };
19
- class W extends P {
20
+ class te extends x {
20
21
  constructor() {
21
22
  super(...arguments);
22
- b(this, "store", H());
23
+ b(this, "store", $());
23
24
  }
24
25
  getId() {
25
- return $;
26
+ return G;
26
27
  }
27
28
  getTemplate() {
28
29
  return `
@@ -41,11 +42,18 @@ class W extends P {
41
42
  }), this._listenToFormUpdates();
42
43
  }
43
44
  onTemplateNodeUpdated(e) {
44
- this.currentNode = e, this.api.updateValues({
45
- [s.ORIENTATION]: this.store.orientation,
46
- [s.ITEMS_TYPE]: this.store.itemsType,
47
- [s.ITEM_IDS]: this.store.itemIds
48
- }), this._initializeSelectItems();
45
+ super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
46
+ () => {
47
+ k(this.currentNode), w(this.currentNode), B(this.currentNode);
48
+ },
49
+ () => {
50
+ this.api.updateValues({
51
+ [s.ORIENTATION]: this.store.orientation,
52
+ [s.ITEMS_TYPE]: this.store.itemsType,
53
+ [s.ITEM_IDS]: this.store.itemIds
54
+ }), this._initializeSelectItems();
55
+ }
56
+ );
49
57
  }
50
58
  onDestroy() {
51
59
  const e = this._getTemplateData();
@@ -59,7 +67,7 @@ class W extends P {
59
67
  name: s.ITEMS_TYPE,
60
68
  className: "es-100",
61
69
  placeholder: "Select Item Type",
62
- options: R
70
+ options: P
63
71
  })
64
72
  ])}
65
73
  `;
@@ -70,7 +78,7 @@ class W extends P {
70
78
  this._GuLabel({ text: "Orientation" }),
71
79
  this._GuRadioButton({
72
80
  name: s.ORIENTATION,
73
- buttons: D
81
+ buttons: L
74
82
  })
75
83
  ])}
76
84
  `;
@@ -89,11 +97,13 @@ class W extends P {
89
97
  `;
90
98
  }
91
99
  _onOrientationChange(e) {
92
- console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), this._recalculateTrimming();
100
+ console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.store.setPriceOrientation("horizontal"), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), setTimeout(() => {
101
+ this._recalculateTrimming();
102
+ }, 50);
93
103
  }
94
- _onItemsTypeChange(e, i) {
95
- const { itemIds: t } = this.store, r = S.ITEMS_TYPE[e], n = y[i].findIndex((a) => a.value === t), o = y[e][n];
96
- r && (this.store.setItemsType(r), this.store.setItemIds(o.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(r), this._initializeSelectItems(), this._reFillTemplate());
104
+ _onItemsTypeChange(e) {
105
+ const i = S.ITEMS_TYPE[e], t = N[e], r = t == null ? void 0 : t[0];
106
+ !i || !r || (this.store.setItemsType(i), this.store.setItemIds(r.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(i), this._initializeSelectItems(), this._reFillTemplate());
97
107
  }
98
108
  _onItemIdsChange(e) {
99
109
  console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
@@ -101,17 +111,17 @@ class W extends P {
101
111
  _initializeSelectItems() {
102
112
  this.api.setUIEAttribute(
103
113
  s.ITEMS_TYPE,
104
- C.SELECTPICKER.items,
105
- R
114
+ A.SELECTPICKER.items,
115
+ P
106
116
  );
107
117
  const { itemsType: e, itemIds: i } = this.store;
108
118
  this.api.updateValues({
109
119
  [s.ITEMS_TYPE]: e
110
120
  });
111
- const t = y[e];
121
+ const t = N[e];
112
122
  this.api.setUIEAttribute(
113
123
  s.ITEM_IDS,
114
- C.SELECTPICKER.items,
124
+ A.SELECTPICKER.items,
115
125
  t
116
126
  ), this.api.updateValues({
117
127
  [s.ITEM_IDS]: i
@@ -120,7 +130,7 @@ class W extends P {
120
130
  _listenToFormUpdates() {
121
131
  this.api.onValueChanged(
122
132
  s.ITEMS_TYPE,
123
- (e, i) => this._onItemsTypeChange(e, i)
133
+ (e) => this._onItemsTypeChange(e)
124
134
  ), this.api.onValueChanged(
125
135
  s.ORIENTATION,
126
136
  (e) => this._onOrientationChange(e)
@@ -138,7 +148,7 @@ class W extends P {
138
148
  currencyLocation: n,
139
149
  formattedPrice: o
140
150
  } = this.store;
141
- this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(U({
151
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(q({
142
152
  orientation: e,
143
153
  itemsType: i,
144
154
  itemId: t,
@@ -148,24 +158,24 @@ class W extends P {
148
158
  })).apply(new d("Updated template"));
149
159
  }
150
160
  _getTemplateData() {
151
- const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = y[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
161
+ const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = N[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
152
162
  return {
153
- imageSrc: p.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
154
- name: p.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
155
- price: t ? p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
156
- originalPrice: t ? p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
157
- quantity: p.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
158
- button: p.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
163
+ imageSrc: T.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
164
+ name: T.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
165
+ price: t ? T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
166
+ originalPrice: t ? T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
167
+ quantity: T.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
168
+ button: T.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
159
169
  };
160
170
  }
161
171
  _updateImageSrc(e) {
162
172
  var t;
163
- const i = (t = this.currentNode) == null ? void 0 : t.querySelector(`[esd-extension-block-id="${m.IMAGE}"] img`);
173
+ const i = (t = this.currentNode) == null ? void 0 : t.querySelector(`[esd-extension-block-id="${l.IMAGE}"] img`);
164
174
  i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("src", e).apply(new d("Updated image src"));
165
175
  }
166
176
  _updateName(e) {
167
177
  var n;
168
- const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.NAME}"]`);
178
+ const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${l.NAME}"]`);
169
179
  if (!i)
170
180
  return;
171
181
  const t = i.getInnerText().trim();
@@ -174,19 +184,19 @@ class W extends P {
174
184
  }
175
185
  _updatePrice(e) {
176
186
  var g;
177
- const i = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${m.PRICE}"]`);
187
+ const i = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${l.PRICE}"]`);
178
188
  if (!i)
179
189
  return;
180
190
  const t = this._getParagraphFromBlock(i);
181
191
  if (!t)
182
192
  return;
183
- const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, l = (o == null ? void 0 : o.trim()) || "", c = this._removeCurrencySymbol(n, l), I = this._replacePriceNumber(c, e), h = this._buildPriceContent(I, l, a), _ = r.replace(n, h);
193
+ const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, c = (o == null ? void 0 : o.trim()) || "", m = this._removeCurrencySymbol(n, c), u = this._replacePriceNumber(m, e), I = this._buildPriceContent(u, c, a), _ = r.replace(n, I);
184
194
  this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
185
195
  }
186
196
  _updateOriginalPrice(e) {
187
- var E;
188
- const i = (E = this.currentNode) == null ? void 0 : E.querySelector(
189
- `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
197
+ var y;
198
+ const i = (y = this.currentNode) == null ? void 0 : y.querySelector(
199
+ `[esd-extension-block-id="${l.ORIGINAL_PRICE}"]`
190
200
  );
191
201
  if (!i)
192
202
  return;
@@ -196,37 +206,34 @@ class W extends P {
196
206
  const r = t.querySelector("s");
197
207
  if (!r)
198
208
  return;
199
- const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: l } = this.store, c = (a == null ? void 0 : a.trim()) || "", I = this._removeCurrencySymbol(o, c), h = this._replacePriceNumber(I, e), _ = this._buildPriceContent(h, c, l), N = `<s>${n.replace(o, _)}</s>`;
200
- this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(N).apply(new d("Updated original price"));
209
+ const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: c } = this.store, m = (a == null ? void 0 : a.trim()) || "", u = this._removeCurrencySymbol(o, m), I = this._replacePriceNumber(u, e), _ = this._buildPriceContent(I, m, c), E = `<s>${n.replace(o, _)}</s>`;
210
+ this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(E).apply(new d("Updated original price"));
201
211
  }
202
212
  _updateQuantity(e) {
203
213
  var a;
204
- const i = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, t = (a = this.currentNode) == null ? void 0 : a.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`);
214
+ const i = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, t = (a = this.currentNode) == null ? void 0 : a.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`);
205
215
  if (!t)
206
216
  return;
207
217
  const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
208
218
  let o = t.getInnerHTML();
209
219
  o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
210
220
  }
211
- _updateButton(e) {
212
- var n;
213
- const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
214
- if (!i)
215
- return;
216
- const t = i.getInnerText().trim();
217
- let r = i.getInnerHTML();
218
- r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated button"));
219
- }
221
+ /**
222
+ * @todo Optimize template reordering for performance.
223
+ * @description Reorders the template structure based on current orientation and visibility settings.
224
+ */
220
225
  _reOrderTemplate() {
221
- var I, h, _, g, N, E, O;
222
- const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), i = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.NAME}"]`), t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (g = this.currentNode) == null ? void 0 : g.querySelector(
223
- `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
224
- ), n = (N = this.currentNode) == null ? void 0 : N.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), o = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`), a = (O = this.currentNode) == null ? void 0 : O.querySelector("esd-config-block");
226
+ var I, _, g, E, y, O, C;
227
+ const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${l.IMAGE}"]`), i = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${l.NAME}"]`), t = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${l.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
228
+ `[esd-extension-block-id="${l.ORIGINAL_PRICE}"]`
229
+ ), n = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`), o = (O = this.currentNode) == null ? void 0 : O.querySelector(`[esd-extension-block-id="${l.BUTTON}"]`), a = (C = this.currentNode) == null ? void 0 : C.querySelector("esd-config-block");
225
230
  if (!e || !i || !t || !r || !n || !o || !a)
226
231
  return;
227
- const { orientation: l } = this.store;
228
- let c = l === S.ORIENTATION.VERTICAL ? L : x;
229
- c = c.replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), c = c.trim().replace('<td align="center" class="ins-product-td items-block">', "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(c).apply(new d("Reordered template"));
232
+ const { orientation: c } = this.store, m = c === S.ORIENTATION.VERTICAL;
233
+ let u = m ? F : U;
234
+ this.api.getDocumentModifier().modifyHtml(e.querySelector("img")).setAttribute("width", H.productImageWidth).apply(new d("Updated image width")), setTimeout(() => {
235
+ u = u.replace("{-{-TEMPLATE_FIRST_LINE-}-}", m ? R : "").replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replaceAll("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), u = u.trim().replace(R, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(u).apply(new d("Reordered template"));
236
+ }, 50);
230
237
  }
231
238
  _updateDataTypeAttributes(e) {
232
239
  if (!this.currentNode)
@@ -240,39 +247,39 @@ class W extends P {
240
247
  _updateDataNumberAttributes(e) {
241
248
  if (!this.currentNode)
242
249
  return;
243
- const { itemsType: i } = this.store, t = y[i].findIndex((l) => l.value === e);
250
+ const { itemsType: i } = this.store, t = N[i].findIndex((c) => c.value === e);
244
251
  let r = "1";
245
252
  if (t >= 0)
246
253
  r = String(t + 1);
247
254
  else if (e) {
248
- const l = e.match(/\((\d+)\)/);
249
- if (l) {
250
- const [, c] = l;
251
- r = c;
255
+ const c = e.match(/\((\d+)\)/);
256
+ if (c) {
257
+ const [, m] = c;
258
+ r = m;
252
259
  }
253
260
  }
254
261
  const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
255
- n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
256
- const c = l;
257
- o.modifyHtml(c).setAttribute("data-number", r);
262
+ n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((c) => {
263
+ const m = c;
264
+ o.modifyHtml(m).setAttribute("data-number", r);
258
265
  }), o.apply(new d("Updated data-number attribute"));
259
266
  }
260
267
  _reFillTemplate() {
261
268
  const e = this._getTemplateData();
262
- this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity), this._updateButton(e.button);
269
+ this._updateImageSrc(e.imageSrc), this._updateName(e.name), this._updatePrice(e.price), this._updateOriginalPrice(e.originalPrice), this._updateQuantity(e.quantity);
263
270
  }
264
271
  _recalculateTrimming() {
265
- var r;
266
- if (!this.store.nameTrimming || !this.currentNode)
272
+ var n;
273
+ if (!this.currentNode)
267
274
  return;
268
- const e = (r = this.currentNode) == null ? void 0 : r.querySelector(`[esd-extension-block-id="${m.NAME}"]`);
275
+ const e = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${l.NAME}"]`);
269
276
  if (!e)
270
277
  return;
271
- const i = e.querySelector("p");
278
+ const i = e.querySelector("p > a");
272
279
  if (!i)
273
280
  return;
274
- const t = this.store.orientation === S.ORIENTATION.VERTICAL;
275
- this.api.getDocumentModifier().modifyHtml(i).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", t ? "130px" : "100%").apply(new d("Recalculated trimming after orientation change"));
281
+ const t = this.store.orientation === S.ORIENTATION.VERTICAL, r = this.store.nameTrimming;
282
+ this.api.getDocumentModifier().modifyHtml(i).setStyle("overflow", "hidden").setStyle("white-space", r ? "nowrap" : "normal").setStyle("text-overflow", r ? "ellipsis" : "unset").setStyle("max-width", t ? "130px" : "520px").setStyle("width", t ? "130px" : "520px").apply(new d("Recalculated trimming after orientation change"));
276
283
  }
277
284
  _getParagraphFromBlock(e) {
278
285
  return e.querySelector("p");
@@ -304,6 +311,6 @@ class W extends P {
304
311
  }
305
312
  }
306
313
  export {
307
- $ as CONTROL_BLOCK_ID,
308
- W as ItemsBlockControl
314
+ G as CONTROL_BLOCK_ID,
315
+ te as ItemsBlockControl
309
316
  };
@@ -1,5 +1,5 @@
1
- var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}), b = /* @__PURE__ */ ((i) => (i.BUTTON_ALIGN = "items-block-button-align-control", i.BUTTON_BORDER = "items-block-button-border-control", i.BUTTON_BORDER_RADIUS = "items-block-button-border-radius-control", i.BUTTON_COLOR = "items-block-button-color-control", i.BUTTON_FIT_TO_CONTENT = "items-block-button-fit-to-content-control", i.BUTTON_FONT_FAMILY = "items-block-button-font-family-control", i.BUTTON_MARGINS = "items-block-button-margins-control", i.BUTTON_PADDINGS = "items-block-button-paddings-control", i.BUTTON_TEXT = "items-block-button-text-control", i.BUTTON_TEXT_SIZE = "items-block-button-text-size-control", i.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "items-block-button-text-style-and-font-color-control", i.BUTTON_LINK = "items-block-button-link-control", i.IMAGE_SIZE = "items-block-image-size-control", i.IMAGE_MARGINS = "items-block-image-margins-control", i.IMAGE_LINK = "items-block-image-link-control", i.ORIGINAL_PRICE_ALIGN = "items-block-original-price-align-control", i.ORIGINAL_PRICE_COLOR = "items-block-original-price-color-control", i.ORIGINAL_PRICE_SIZE = "items-block-original-price-size-control", i.ORIGINAL_PRICE_STYLE = "items-block-original-price-style-control", i.ORIGINAL_PRICE_FONT_FAMILY = "items-block-original-price-font-family-control", i.ORIGINAL_PRICE_BACKGROUND = "items-block-original-price-background-control", i.ORIGINAL_PRICE_PADDINGS = "items-block-original-price-paddings-control", i.PRICE_ALIGN = "items-block-price-align-control", i.PRICE_COLOR = "items-block-price-color-control", i.PRICE_SIZE = "items-block-price-size-control", i.PRICE_STYLE = "items-block-price-style-control", i.PRICE_FONT_FAMILY = "items-block-price-font-family-control", i.PRICE_BACKGROUND = "items-block-price-background-control", i.PRICE_PADDINGS = "items-block-price-paddings-control", i.PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control", i.PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control", i.PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control", i.PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control", i.NAME_ALIGN = "items-block-name-align-control", i.NAME_COLOR = "items-block-name-color-control", i.NAME_SIZE = "items-block-name-size-control", i.NAME_STYLE = "items-block-name-style-control", i.NAME_FONT_FAMILY = "items-block-name-font-family-control", i.NAME_BACKGROUND = "items-block-name-background-control", i.NAME_TRIMMING = "items-block-name-trimming-control", i.NAME_PADDINGS = "items-block-name-paddings-control", i.QUANTITY_ALIGN = "items-block-quantity-align-control", i.QUANTITY_COLOR = "items-block-quantity-color-control", i.QUANTITY_FONT_FAMILY = "items-block-quantity-font-family-control", i.QUANTITY_PADDINGS = "items-block-quantity-paddings-control", i.QUANTITY_SIZE = "items-block-quantity-size-control", i.QUANTITY_STYLE = "items-block-quantity-style-control", i))(b || {});
1
+ var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}), t = /* @__PURE__ */ ((i) => (i.BUTTON_ALIGN = "items-block-button-align-control", i.BUTTON_BORDER = "items-block-button-border-control", i.BUTTON_BORDER_RADIUS = "items-block-button-border-radius-control", i.BUTTON_COLOR = "items-block-button-color-control", i.BUTTON_FIT_TO_CONTENT = "items-block-button-fit-to-content-control", i.BUTTON_FONT_FAMILY = "items-block-button-font-family-control", i.BUTTON_MARGINS = "items-block-button-margins-control", i.BUTTON_PADDINGS = "items-block-button-paddings-control", i.BUTTON_TEXT = "items-block-button-text-control", i.BUTTON_TEXT_SIZE = "items-block-button-text-size-control", i.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "items-block-button-text-style-and-font-color-control", i.BUTTON_LINK = "items-block-button-link-control", i.IMAGE_SIZE = "items-block-image-size-control", i.IMAGE_MARGINS = "items-block-image-margins-control", i.IMAGE_LINK = "items-block-image-link-control", i.ORIGINAL_PRICE_ALIGN = "items-block-original-price-align-control", i.ORIGINAL_PRICE_COLOR = "items-block-original-price-color-control", i.ORIGINAL_PRICE_SIZE = "items-block-original-price-size-control", i.ORIGINAL_PRICE_STYLE = "items-block-original-price-style-control", i.ORIGINAL_PRICE_FONT_FAMILY = "items-block-original-price-font-family-control", i.ORIGINAL_PRICE_BACKGROUND = "items-block-original-price-background-control", i.ORIGINAL_PRICE_PADDINGS = "items-block-original-price-paddings-control", i.PRICE_ALIGN = "items-block-price-align-control", i.PRICE_COLOR = "items-block-price-color-control", i.PRICE_SIZE = "items-block-price-size-control", i.PRICE_STYLE = "items-block-price-style-control", i.PRICE_FONT_FAMILY = "items-block-price-font-family-control", i.PRICE_BACKGROUND = "items-block-price-background-control", i.PRICE_PADDINGS = "items-block-price-paddings-control", i.PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control", i.PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control", i.PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control", i.PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control", i.PRICE_ORIENTATION = "items-block-price-orientation-control", i.NAME_ALIGN = "items-block-name-align-control", i.NAME_COLOR = "items-block-name-color-control", i.NAME_SIZE = "items-block-name-size-control", i.NAME_STYLE = "items-block-name-style-control", i.NAME_FONT_FAMILY = "items-block-name-font-family-control", i.NAME_BACKGROUND = "items-block-name-background-control", i.NAME_TRIMMING = "items-block-name-trimming-control", i.NAME_PADDINGS = "items-block-name-paddings-control", i.QUANTITY_ALIGN = "items-block-quantity-align-control", i.QUANTITY_COLOR = "items-block-quantity-color-control", i.QUANTITY_FONT_FAMILY = "items-block-quantity-font-family-control", i.QUANTITY_PADDINGS = "items-block-quantity-paddings-control", i.QUANTITY_SIZE = "items-block-quantity-size-control", i.QUANTITY_STYLE = "items-block-quantity-style-control", i))(t || {});
2
2
  export {
3
- b as ItemsBlockControlId,
3
+ t as ItemsBlockControlId,
4
4
  c as ItemsBlockId
5
5
  };
@@ -1,4 +1,6 @@
1
- const e = {
1
+ import _ from "../../../../node_modules/lodash-es/flatMap.js";
2
+ import i from "../../../../node_modules/lodash-es/range.js";
3
+ const o = '<td align="center" class="ins-product-td items-block items-block-v2">', R = {
2
4
  TYPE: "data-type",
3
5
  ITEMS_INDEX_SELECT_CONTROL_VALUE: "data-cart_items_select_control_value",
4
6
  ORIENTATION: "data-card_orientation_control_value",
@@ -7,6 +9,7 @@ const e = {
7
9
  PRODUCT_PRICE_FORMATTED: "data-product_price_formatted",
8
10
  PRODUCT_PRICE_CURRENCY_SYMBOL: "data-product_price_currency_symbol",
9
11
  PRODUCT_PRICE_CURRENCY_LOCATION: "data-product_price_currency_location",
12
+ PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: "data-product_original_price_control_orientation",
10
13
  PRODUCT_BUTTON_LINK: "data-product_button_link",
11
14
  PRODUCT_IMAGE_LINK: "data-product_image_link",
12
15
  PRODUCT_NAME_CONTROL_VALUE: "data-product_name_control_value",
@@ -22,7 +25,7 @@ const e = {
22
25
  PRODUCT_PRICE_VISIBLE: "data-product_price_visible",
23
26
  PRODUCT_ORIGINAL_PRICE_VISIBLE: "data-product_original_price_visible",
24
27
  PRODUCT_BUTTON_VISIBLE: "data-product_button_visible"
25
- }, s = { PAIRS_FOR_EXTENSION: {
28
+ }, t = { PAIRS_FOR_EXTENSION: {
26
29
  imageSrc: {
27
30
  CART_ITEMS: {
28
31
  ATTR: "ins_apr_img",
@@ -209,7 +212,63 @@ const e = {
209
212
  }
210
213
  }
211
214
  } };
215
+ function m(e, a = 8) {
216
+ return i(1, a + 1).map((s) => `${e}_${s}`);
217
+ }
218
+ function r() {
219
+ const { PAIRS_FOR_EXTENSION: e } = t, a = [];
220
+ return a.push(
221
+ e.imageSrc.CART_ITEMS.ATTR,
222
+ e.imageSrc.BROWSED_ITEMS.ATTR,
223
+ e.imageSrc.PURCHASED_ITEMS.ATTR
224
+ ), a.push(
225
+ e.name.CART_ITEMS.ATTR,
226
+ e.name.CART_ITEMS.HREF,
227
+ e.name.BROWSED_ITEMS.ATTR,
228
+ e.name.BROWSED_ITEMS.HREF,
229
+ e.name.PURCHASED_ITEMS.ATTR,
230
+ e.name.PURCHASED_ITEMS.HREF
231
+ ), a.push(
232
+ e.quantity.CART_ITEMS.ATTR,
233
+ e.quantity.BROWSED_ITEMS.ATTR,
234
+ e.quantity.PURCHASED_ITEMS.ATTR
235
+ ), a.push(
236
+ e.price.CART_ITEMS.PRICE,
237
+ e.price.CART_ITEMS.PRICE_FORMATTED,
238
+ e.price.CART_ITEMS.CURRENCY,
239
+ e.price.BROWSED_ITEMS.PRICE,
240
+ e.price.BROWSED_ITEMS.PRICE_FORMATTED,
241
+ e.price.BROWSED_ITEMS.CURRENCY,
242
+ e.price.PURCHASED_ITEMS.PRICE,
243
+ e.price.PURCHASED_ITEMS.PRICE_FORMATTED,
244
+ e.price.PURCHASED_ITEMS.CURRENCY
245
+ ), a.push(
246
+ e.originalPrice.CART_ITEMS.PRICE,
247
+ e.originalPrice.CART_ITEMS.PRICE_FORMATTED,
248
+ e.originalPrice.CART_ITEMS.CURRENCY,
249
+ e.originalPrice.BROWSED_ITEMS.PRICE,
250
+ e.originalPrice.BROWSED_ITEMS.PRICE_FORMATTED,
251
+ e.originalPrice.BROWSED_ITEMS.CURRENCY,
252
+ e.originalPrice.PURCHASED_ITEMS.PRICE,
253
+ e.originalPrice.PURCHASED_ITEMS.PRICE_FORMATTED,
254
+ e.originalPrice.PURCHASED_ITEMS.CURRENCY
255
+ ), a.push(
256
+ e.button.CART_ITEMS.HREF,
257
+ e.button.BROWSED_ITEMS.HREF,
258
+ e.button.PURCHASED_ITEMS.HREF
259
+ ), a.push(
260
+ e.itemLink.CART_ITEMS.HREF,
261
+ e.itemLink.BROWSED_ITEMS.HREF,
262
+ e.itemLink.PURCHASED_ITEMS.HREF
263
+ ), a;
264
+ }
265
+ const p = _(
266
+ r(),
267
+ (e) => m(e)
268
+ );
212
269
  export {
213
- e as configAttributes,
214
- s as productPairs
270
+ R as configAttributes,
271
+ p as itemsBlockDynamicVariables,
272
+ t as productPairs,
273
+ o as templateFirstLine
215
274
  };