@useinsider/guido 3.19.0-beta.2aff90b → 3.19.0-beta.3303d1f

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 (82) hide show
  1. package/README.md +21 -3
  2. package/dist/@types/config/schemas.js +59 -51
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +70 -68
  5. package/dist/components/organisms/base/Toaster.vue2.js +13 -12
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  9. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
  11. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  12. package/dist/components/organisms/header/EditorActions.vue2.js +23 -25
  13. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +28 -24
  14. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
  15. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
  16. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  17. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  18. package/dist/composables/useActionsApi.js +52 -47
  19. package/dist/composables/useCodeEditorApi.js +23 -9
  20. package/dist/composables/useCustomInterfaceAppearance.js +65 -51
  21. package/dist/composables/useHtmlValidator.js +87 -82
  22. package/dist/composables/useLegacyStrategyConversion.js +61 -0
  23. package/dist/composables/useRecommendation.js +40 -35
  24. package/dist/composables/useStripo.js +30 -30
  25. package/dist/composables/useToaster.js +14 -20
  26. package/dist/composables/useTranslations.js +3 -2
  27. package/dist/composables/useVersionHistoryApi.js +33 -24
  28. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  29. package/dist/enums/extensions/recommendationBlock.js +49 -33
  30. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  31. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  32. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  33. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  34. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  35. package/dist/extensions/Blocks/Items/template.js +219 -204
  36. package/dist/extensions/Blocks/Recommendation/block.js +61 -42
  37. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  38. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +100 -94
  39. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +130 -55
  40. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  41. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +273 -92
  42. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
  43. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  44. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  45. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  46. package/dist/guido.css +1 -1
  47. package/dist/services/recommendationApi.js +46 -37
  48. package/dist/src/@types/config/schemas.d.ts +16 -0
  49. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  50. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
  51. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  52. package/dist/src/composables/useConfig.d.ts +4 -0
  53. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  54. package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
  55. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  56. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  57. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  58. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  59. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  60. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  61. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +10 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  64. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
  65. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
  66. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  67. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  68. package/dist/src/services/recommendationApi.d.ts +2 -1
  69. package/dist/src/stores/config.d.ts +322 -0
  70. package/dist/src/stores/onboarding.d.ts +808 -10
  71. package/dist/src/utils/stripoEditorApi.d.ts +4 -0
  72. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  73. package/dist/static/assets/icons/line-info.svg.js +5 -0
  74. package/dist/static/styles/components/recommendation-strategy.css.js +104 -9
  75. package/dist/static/styles/components/skeleton.css.js +23 -0
  76. package/dist/stores/config.js +74 -60
  77. package/dist/stores/onboarding.js +46 -36
  78. package/dist/stores/unsubscribe.js +3 -3
  79. package/dist/utils/pairProductVariables.js +71 -71
  80. package/dist/utils/stripoEditorApi.js +11 -0
  81. package/dist/utils/templatePreparation.js +55 -55
  82. package/package.json +1 -1
@@ -1,14 +1,28 @@
1
- import { useTranslations as r } from "../../composables/useTranslations.js";
2
- const l = {
1
+ import { useTranslations as s } from "../../composables/useTranslations.js";
2
+ const a = {
3
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
4
4
  // Relative path → same-origin as the embedding inone dashboard.
5
5
  PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
6
  RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
7
- RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
8
- }, c = {
7
+ RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies",
8
+ NEWSLETTER_RECOMMENDATIONS_PATH: "/newsletter/recommendations",
9
+ MIGRATE_STRATEGIES_PATH: "/newsletter/recommendations/migrate-strategies",
10
+ // The template route narrows the recommendations resource before the action: the id
11
+ // travels in the body, not the path.
12
+ TEMPLATE_MIGRATE_STRATEGIES_PATH: "/newsletter/recommendations/template/migrate-strategies",
13
+ // Smart Recommender hides the Email channel unless the URL asks for it, so a strategy created
14
+ // without this flag can never be Email-suitable and would never reach the editor's list.
15
+ RECOMMENDATION_STRATEGY_CREATE_PATH: "/discovery/recommendation-strategies/create?isEmail=true"
16
+ }, d = (e) => {
17
+ const { RECOMMENDATION_STRATEGIES_PANEL_PATH: n } = a;
18
+ return `${n}/${e}/edit?isEmail=true`;
19
+ }, m = {
20
+ campaign: a.MIGRATE_STRATEGIES_PATH,
21
+ template: a.TEMPLATE_MIGRATE_STRATEGIES_PATH
22
+ }, T = {
9
23
  CLIENT_ID: "clientId"
10
- }, d = () => {
11
- const e = r();
24
+ }, E = () => {
25
+ const e = s();
12
26
  return [
13
27
  {
14
28
  id: 11,
@@ -71,73 +85,75 @@ const l = {
71
85
  path: "top-sellers"
72
86
  }
73
87
  ];
74
- }, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
88
+ }, p = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], A = [
75
89
  { text: "before the amount", value: "0" },
76
90
  { text: "after the amount", value: "1" }
77
91
  ], v = [
78
92
  { text: "dot(.)", value: "." },
79
93
  { text: "comma(,)", value: "," },
80
94
  { text: "space( )", value: " " }
81
- ], h = [
95
+ ], _ = [
82
96
  { text: "0", value: "0" },
83
97
  { text: "1", value: "1" },
84
98
  { text: "2", value: "2" },
85
99
  { text: "3", value: "3" },
86
100
  { text: "4", value: "4" },
87
101
  { text: "5", value: "5" }
88
- ], a = "||", t = [
102
+ ], r = "||", t = [
89
103
  { text: "is exactly", value: "=" },
90
104
  { text: "contains", value: "~" },
91
105
  { text: "does not contain", value: "!~" },
92
- { text: "any of", value: a }
93
- ], n = [
106
+ { text: "any of", value: r }
107
+ ], o = [
94
108
  { text: "is exactly", value: "=" },
95
109
  { text: "is not exactly", value: "!==" },
96
110
  { text: "contains", value: "~" },
97
111
  { text: "does not contain", value: "!~" },
98
- { text: "any of", value: a }
99
- ], o = [
112
+ { text: "any of", value: r }
113
+ ], i = [
100
114
  { text: "is equal to", value: "=" },
101
115
  { text: "is greater than", value: ">" },
102
116
  { text: "is less than", value: "<" }
103
- ], s = [
117
+ ], u = [
104
118
  { text: "is equal to", value: "=" },
105
119
  { text: "after", value: ">" },
106
120
  { text: "before", value: "<" }
107
- ], i = [
121
+ ], c = [
108
122
  { text: "true", value: "==" },
109
123
  { text: "false", value: "!=" }
110
- ], x = (e) => {
124
+ ], h = (e) => {
111
125
  if (!e)
112
126
  return t;
113
127
  switch (e) {
114
128
  case "Boolean":
115
- return i;
129
+ return c;
116
130
  case "Date":
117
- return s;
131
+ return u;
118
132
  case "Number":
119
- return o;
133
+ return i;
120
134
  case "String":
121
135
  return t;
122
136
  case "Strings":
123
- return n;
137
+ return o;
124
138
  default:
125
139
  return t;
126
140
  }
127
141
  };
128
142
  export {
129
- a as OP_ANY_OF,
130
- m as PriceAttributes,
131
- c as QUERY_PARAMS,
132
- l as URLS,
133
- h as currencyDecimalCounts,
134
- p as currencyLocationMaps,
143
+ m as MIGRATION_PATHS,
144
+ r as OP_ANY_OF,
145
+ p as PriceAttributes,
146
+ T as QUERY_PARAMS,
147
+ a as URLS,
148
+ _ as currencyDecimalCounts,
149
+ A as currencyLocationMaps,
135
150
  v as currencyOperators,
136
- x as getOperatorOptions,
137
- d as getRecommendationFeedSourceMaps,
138
- n as operatorOptionsForArrayOfStrings,
139
- i as operatorOptionsForBooleans,
140
- s as operatorOptionsForDates,
141
- o as operatorOptionsForNumbers,
142
- t as operatorOptionsForStrings
151
+ h as getOperatorOptions,
152
+ E as getRecommendationFeedSourceMaps,
153
+ o as operatorOptionsForArrayOfStrings,
154
+ c as operatorOptionsForBooleans,
155
+ u as operatorOptionsForDates,
156
+ i as operatorOptionsForNumbers,
157
+ t as operatorOptionsForStrings,
158
+ d as strategyEditPath
143
159
  };
@@ -0,0 +1,20 @@
1
+ import { SETTINGS_ENUMS as r } from "../enums/settingsEnums.js";
2
+ const I = "130px", L = "100%", R = (e) => e === r.ORIENTATION.HORIZONTAL ? I : L, n = {
3
+ VERTICAL: "es-p5b es-p5t",
4
+ HORIZONTAL: "es-p5l es-p5r"
5
+ }, o = "data-items-cell-pad", d = (e) => `${o}="${e ? "v" : "h"}"`, t = (e) => e ? ` ${n.VERTICAL}` : ` ${n.HORIZONTAL}`, E = (e, A) => {
6
+ if (!e.includes(o))
7
+ return e;
8
+ const T = A ? n.HORIZONTAL : n.VERTICAL, s = A ? n.VERTICAL : n.HORIZONTAL, c = A ? "v" : "h";
9
+ return e.includes(T) ? e.replace(T, s).replace(new RegExp(`${o}="[hv]"`), `${o}="${c}"`) : e;
10
+ };
11
+ export {
12
+ n as BLOCK_CELL_PADDING,
13
+ o as BLOCK_CELL_PAD_ATTR,
14
+ I as NAME_HORIZONTAL_MAX_WIDTH,
15
+ L as NAME_VERTICAL_MAX_WIDTH,
16
+ d as blockCellPadMarker,
17
+ t as blockCellPaddingFor,
18
+ R as nameMaxWidthFor,
19
+ E as reorientBlockCellPadding
20
+ };
@@ -1,14 +1,15 @@
1
- import { ModificationDescription as l, UIElementType as s, UEAttr as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as p } from "../../../common-control.js";
1
+ import { ModificationDescription as d, UIElementType as s, UEAttr as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as T } from "../../../common-control.js";
3
+ import { nameMaxWidthFor as h } from "../../constants/cardLayout.js";
3
4
  import { ItemsBlockControlId as a } from "../../enums/controlEnums.js";
4
- import { findNameTextNode as T } from "../../utils/nameNode.js";
5
- import { getItemsBlockConfig as r, setItemsBlockConfig as c } from "../../utils/nodeConfigUtils.js";
6
- const g = a.NAME_TRIMMING, i = {
5
+ import { findNameTextNode as c } from "../../utils/nameNode.js";
6
+ import { getItemsBlockConfig as r, setItemsBlockConfig as g } from "../../utils/nodeConfigUtils.js";
7
+ const I = a.NAME_TRIMMING, n = {
7
8
  TRIMMING: "trimming"
8
9
  };
9
- class y extends p {
10
+ class E extends T {
10
11
  getId() {
11
- return g;
12
+ return I;
12
13
  }
13
14
  getTemplate() {
14
15
  return `
@@ -19,39 +20,39 @@ class y extends p {
19
20
  }
20
21
  onRender() {
21
22
  const e = r(this.currentNode);
22
- this.api.updateValues({ [i.TRIMMING]: (e == null ? void 0 : e.nameTrimming) ?? !0 }), this.api.onValueChanged(i.TRIMMING, (t) => {
23
+ this.api.updateValues({ [n.TRIMMING]: (e == null ? void 0 : e.nameTrimming) ?? !0 }), this.api.onValueChanged(n.TRIMMING, (t) => {
23
24
  this._onTrimmingChange(t);
24
25
  });
25
26
  }
26
27
  onTemplateNodeUpdated(e) {
27
28
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
29
  const t = r(this.currentNode);
29
- this.api.updateValues({ [i.TRIMMING]: (t == null ? void 0 : t.nameTrimming) ?? !0 });
30
+ this.api.updateValues({ [n.TRIMMING]: (t == null ? void 0 : t.nameTrimming) ?? !0 });
30
31
  });
31
32
  }
32
33
  _onTrimmingChange(e) {
33
- c(this.currentNode, this.api, { nameTrimming: e }), this.api.updateValues({ [i.TRIMMING]: e }), this._applyTrimmingStyles(e);
34
+ g(this.currentNode, this.api, { nameTrimming: e }), this.api.updateValues({ [n.TRIMMING]: e }), this._applyTrimmingStyles(e);
34
35
  }
35
36
  _applyTrimmingStyles(e) {
36
- const t = T(this.currentNode);
37
+ const t = c(this.currentNode);
37
38
  if (!t)
38
39
  return;
39
- const n = r(this.currentNode), m = e !== void 0 ? e : (n == null ? void 0 : n.nameTrimming) ?? !0, o = this.api.getDocumentModifier().modifyHtml(t);
40
- m ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", "100%").apply(new l(`Text Trimming ${m ? "Enabled" : "Disabled"}`));
40
+ const i = r(this.currentNode), m = e !== void 0 ? e : (i == null ? void 0 : i.nameTrimming) ?? !0, l = h(i == null ? void 0 : i.orientation), o = this.api.getDocumentModifier().modifyHtml(t);
41
+ m ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", l).apply(new d(`Text Trimming ${m ? "Enabled" : "Disabled"}`));
41
42
  }
42
43
  _getTextTrimming() {
43
44
  return `
44
45
  <div class="display-flex align-items-center justify-content-between">
45
46
  <${s.LABEL}
46
- ${d.LABEL.text}="${this.api.translate("Text Trimming")}"
47
+ ${p.LABEL.text}="${this.api.translate("Text Trimming")}"
47
48
  >
48
49
  </${s.LABEL}>
49
- ${this._GuToggle(i.TRIMMING)}
50
+ ${this._GuToggle(n.TRIMMING)}
50
51
  </div>
51
52
  `;
52
53
  }
53
54
  }
54
55
  export {
55
- g as CONTROL_BLOCK_ID,
56
- y as NameTrimmingControl
56
+ I as CONTROL_BLOCK_ID,
57
+ E as NameTrimmingControl
57
58
  };
@@ -1,21 +1,22 @@
1
- import { ModificationDescription as S, UEAttr as L } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as k } from "../../common-control.js";
1
+ import { ModificationDescription as N, UEAttr as L } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as $ } from "../../common-control.js";
3
+ import { reorientBlockCellPadding as D, nameMaxWidthFor as f } from "../constants/cardLayout.js";
3
4
  import { ItemsBlockId as I } from "../enums/controlEnums.js";
4
- import { productPairs as y, templateFirstLine as D } from "../enums/productEnums.js";
5
- import { SETTINGS_ENUMS as d, ItemTypeOptions as x, OrientationOptions as F, ItemInCartOptions as O, DefaultConfigValues as H } from "../enums/settingsEnums.js";
6
- import $ from "../layouts/horizontal.html.js";
7
- import w from "../layouts/vertical.html.js";
8
- import { getDefaultTemplate as q, wrapInTableRow as C } from "../template.js";
9
- import { findNameTextNode as V } from "../utils/nameNode.js";
10
- import { getItemsBlockConfig as _, setItemsBlockConfig as M, escapeReplacement as g, deriveItemNumber as B } from "../utils/nodeConfigUtils.js";
11
- const G = "ui-elements-items-block", m = {
5
+ import { productPairs as y, templateFirstLine as x } from "../enums/productEnums.js";
6
+ import { SETTINGS_ENUMS as T, ItemTypeOptions as H, OrientationOptions as w, ItemInCartOptions as g, DefaultConfigValues as U } from "../enums/settingsEnums.js";
7
+ import q from "../layouts/horizontal.html.js";
8
+ import V from "../layouts/vertical.html.js";
9
+ import { getDefaultTemplate as B, wrapInTableRow as C, applyPriceOrientationStyles as G } from "../template.js";
10
+ import { findNameTextNode as Y } from "../utils/nameNode.js";
11
+ import { getItemsBlockConfig as _, setItemsBlockConfig as M, escapeReplacement as A, deriveItemNumber as v } from "../utils/nodeConfigUtils.js";
12
+ const Q = "ui-elements-items-block", p = {
12
13
  ITEMS_TYPE: "itemsType",
13
14
  ORIENTATION: "orientation",
14
15
  ITEM_IDS: "itemIds"
15
16
  };
16
- class te extends k {
17
+ class se extends $ {
17
18
  getId() {
18
- return G;
19
+ return Q;
19
20
  }
20
21
  getTemplate() {
21
22
  return `
@@ -29,18 +30,18 @@ class te extends k {
29
30
  onRender() {
30
31
  const e = _(this.currentNode);
31
32
  this.api.updateValues({
32
- [m.ORIENTATION]: (e == null ? void 0 : e.orientation) ?? d.ORIENTATION.VERTICAL,
33
- [m.ITEMS_TYPE]: (e == null ? void 0 : e.type) ?? d.ITEMS_TYPE.CART_ITEMS,
34
- [m.ITEM_IDS]: (e == null ? void 0 : e.itemsSelectValue) ?? ""
33
+ [p.ORIENTATION]: (e == null ? void 0 : e.orientation) ?? T.ORIENTATION.VERTICAL,
34
+ [p.ITEMS_TYPE]: (e == null ? void 0 : e.type) ?? T.ITEMS_TYPE.CART_ITEMS,
35
+ [p.ITEM_IDS]: (e == null ? void 0 : e.itemsSelectValue) ?? ""
35
36
  }), this._listenToFormUpdates();
36
37
  }
37
38
  onTemplateNodeUpdated(e) {
38
39
  super.onTemplateNodeUpdated(e), console.debug("Items Block Config", e.getNodeConfig()), this.handleBlockInstanceChange(() => {
39
40
  const r = _(this.currentNode);
40
41
  this.api.updateValues({
41
- [m.ORIENTATION]: (r == null ? void 0 : r.orientation) ?? d.ORIENTATION.VERTICAL,
42
- [m.ITEMS_TYPE]: (r == null ? void 0 : r.type) ?? d.ITEMS_TYPE.CART_ITEMS,
43
- [m.ITEM_IDS]: (r == null ? void 0 : r.itemsSelectValue) ?? ""
42
+ [p.ORIENTATION]: (r == null ? void 0 : r.orientation) ?? T.ORIENTATION.VERTICAL,
43
+ [p.ITEMS_TYPE]: (r == null ? void 0 : r.type) ?? T.ITEMS_TYPE.CART_ITEMS,
44
+ [p.ITEM_IDS]: (r == null ? void 0 : r.itemsSelectValue) ?? ""
44
45
  }), this._initializeSelectItems();
45
46
  });
46
47
  }
@@ -49,10 +50,10 @@ class te extends k {
49
50
  ${this._GuOneColumn([
50
51
  this._GuLabel({ text: "Item Type" }),
51
52
  this._GuSelect({
52
- name: m.ITEMS_TYPE,
53
+ name: p.ITEMS_TYPE,
53
54
  className: "es-100",
54
55
  placeholder: "Select Item Type",
55
- options: x
56
+ options: H
56
57
  })
57
58
  ])}
58
59
  `;
@@ -62,8 +63,8 @@ class te extends k {
62
63
  ${this._GuTwoColumns([
63
64
  this._GuLabel({ text: "Orientation" }),
64
65
  this._GuRadioButton({
65
- name: m.ORIENTATION,
66
- buttons: F
66
+ name: p.ORIENTATION,
67
+ buttons: w
67
68
  })
68
69
  ])}
69
70
  `;
@@ -73,7 +74,7 @@ class te extends k {
73
74
  ${this._GuTwoColumns([
74
75
  this._GuLabel({ text: "Item in Cart" }),
75
76
  this._GuSelect({
76
- name: m.ITEM_IDS,
77
+ name: p.ITEM_IDS,
77
78
  className: "es-100",
78
79
  placeholder: "Select Item In Cart",
79
80
  options: []
@@ -82,32 +83,32 @@ class te extends k {
82
83
  `;
83
84
  }
84
85
  _onOrientationChange(e) {
85
- this.api.updateValues({ [m.ORIENTATION]: e });
86
+ this.api.updateValues({ [p.ORIENTATION]: e });
86
87
  const r = this.api.getDocumentModifier();
87
88
  M(this.currentNode, this.api, {
88
89
  orientation: e,
89
90
  priceOrientation: "horizontal"
90
- }, r), r.apply(new S("Changed orientation")), this._reOrderTemplate(), setTimeout(() => {
91
+ }, r), r.apply(new N("Changed orientation")), this._reOrderTemplate(), setTimeout(() => {
91
92
  this._recalculateTrimming();
92
93
  }, 50);
93
94
  }
94
95
  _onItemsTypeChange(e) {
95
- const r = d.ITEMS_TYPE[e], t = O[e], i = t == null ? void 0 : t[0];
96
+ const r = T.ITEMS_TYPE[e], t = g[e], i = t == null ? void 0 : t[0];
96
97
  if (!r || !i)
97
98
  return;
98
- const n = i.value, s = i.value.replace("Url}}", "Image}}"), o = this.api.getDocumentModifier();
99
+ const n = i.value, s = i.value.replace("Url}}", "Image}}"), a = this.api.getDocumentModifier();
99
100
  M(this.currentNode, this.api, {
100
101
  source: r,
101
102
  type: r,
102
103
  itemsSelectValue: i.value,
103
104
  imageLink: s,
104
105
  buttonLink: n
105
- }, o), this._updateDataTypeAttributes(r, o), this._initializeSelectItems();
106
- const c = this._getTemplateData(r, i.value);
107
- this._updateImageSrc(c.imageSrc, o), this._updateName(c.name, o), this._updatePrice(c.price, o), this._updateOriginalPrice(c.originalPrice, o), this._updateQuantity(c.quantity, r, o), o.apply(new S("Updated items type"));
106
+ }, a), this._updateDataTypeAttributes(r, a), this._initializeSelectItems();
107
+ const l = this._getTemplateData(r, i.value);
108
+ this._updateImageSrc(l.imageSrc, a), this._updateName(l.name, a), this._updatePrice(l.price, a), this._updateOriginalPrice(l.originalPrice, a), this._updateQuantity(l.quantity, r, a), a.apply(new N("Updated items type"));
108
109
  }
109
110
  _onItemIdsChange(e) {
110
- this.api.updateValues({ [m.ITEM_IDS]: e });
111
+ this.api.updateValues({ [p.ITEM_IDS]: e });
111
112
  const r = e, t = e.replace("Url}}", "Image}}"), i = this.api.getDocumentModifier();
112
113
  M(this.currentNode, this.api, {
113
114
  itemsSelectValue: e,
@@ -115,58 +116,58 @@ class te extends k {
115
116
  buttonLink: r
116
117
  }, i), this._updateDataNumberAttributes(e, i);
117
118
  const n = this._getTemplateData(void 0, e);
118
- this._updateImageSrc(n.imageSrc, i), this._updateName(n.name, i), this._updatePrice(n.price, i), this._updateOriginalPrice(n.originalPrice, i), this._updateQuantity(n.quantity, void 0, i), i.apply(new S("Updated item selection"));
119
+ this._updateImageSrc(n.imageSrc, i), this._updateName(n.name, i), this._updatePrice(n.price, i), this._updateOriginalPrice(n.originalPrice, i), this._updateQuantity(n.quantity, void 0, i), i.apply(new N("Updated item selection"));
119
120
  }
120
121
  _initializeSelectItems() {
121
122
  this.api.setUIEAttribute(
122
- m.ITEMS_TYPE,
123
+ p.ITEMS_TYPE,
123
124
  L.SELECTPICKER.items,
124
- x
125
+ H
125
126
  );
126
- const e = _(this.currentNode), r = (e == null ? void 0 : e.type) ?? d.ITEMS_TYPE.CART_ITEMS, t = (e == null ? void 0 : e.itemsSelectValue) ?? "";
127
+ const e = _(this.currentNode), r = (e == null ? void 0 : e.type) ?? T.ITEMS_TYPE.CART_ITEMS, t = (e == null ? void 0 : e.itemsSelectValue) ?? "";
127
128
  this.api.updateValues({
128
- [m.ITEMS_TYPE]: r
129
+ [p.ITEMS_TYPE]: r
129
130
  });
130
- const i = O[r];
131
+ const i = g[r];
131
132
  this.api.setUIEAttribute(
132
- m.ITEM_IDS,
133
+ p.ITEM_IDS,
133
134
  L.SELECTPICKER.items,
134
135
  i
135
136
  ), this.api.updateValues({
136
- [m.ITEM_IDS]: t
137
+ [p.ITEM_IDS]: t
137
138
  });
138
139
  }
139
140
  _listenToFormUpdates() {
140
141
  this.api.onValueChanged(
141
- m.ITEMS_TYPE,
142
+ p.ITEMS_TYPE,
142
143
  (e) => this._onItemsTypeChange(e)
143
144
  ), this.api.onValueChanged(
144
- m.ORIENTATION,
145
+ p.ORIENTATION,
145
146
  (e) => this._onOrientationChange(e)
146
147
  ), this.api.onValueChanged(
147
- m.ITEM_IDS,
148
+ p.ITEM_IDS,
148
149
  (e) => this._onItemIdsChange(e)
149
150
  );
150
151
  }
151
152
  _renderTemplate() {
152
- const e = _(this.currentNode), r = (e == null ? void 0 : e.orientation) ?? d.ORIENTATION.VERTICAL, t = (e == null ? void 0 : e.type) ?? d.ITEMS_TYPE.CART_ITEMS, i = (e == null ? void 0 : e.itemsSelectValue) ?? "", n = (e == null ? void 0 : e.priceCurrencySymbol) ?? "", s = (e == null ? void 0 : e.priceCurrencyLocation) ?? "0", o = (e == null ? void 0 : e.priceFormatted) ?? !1;
153
- this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(q({
153
+ const e = _(this.currentNode), r = (e == null ? void 0 : e.orientation) ?? T.ORIENTATION.VERTICAL, t = (e == null ? void 0 : e.type) ?? T.ITEMS_TYPE.CART_ITEMS, i = (e == null ? void 0 : e.itemsSelectValue) ?? "", n = (e == null ? void 0 : e.priceCurrencySymbol) ?? "", s = (e == null ? void 0 : e.priceCurrencyLocation) ?? "0", a = (e == null ? void 0 : e.priceFormatted) ?? !1;
154
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(B({
154
155
  orientation: r,
155
156
  itemsType: t,
156
157
  itemId: i,
157
158
  currencySymbol: n,
158
159
  currencyLocation: s,
159
- formattedPrice: o
160
- })).apply(new S("Updated template"));
160
+ formattedPrice: a
161
+ })).apply(new N("Updated template"));
161
162
  }
162
163
  _getTemplateData(e, r) {
163
- const t = _(this.currentNode), i = e ?? (t == null ? void 0 : t.type) ?? d.ITEMS_TYPE.CART_ITEMS, n = r ?? (t == null ? void 0 : t.itemsSelectValue) ?? "", s = (t == null ? void 0 : t.priceFormatted) ?? !1, o = (t == null ? void 0 : t.priceSinglePrice) ?? !1, c = O[i].findIndex((h) => h.value === n), a = c > -1 ? c : 0, l = y.PAIRS_FOR_EXTENSION.price[i], T = y.PAIRS_FOR_EXTENSION.originalPrice[i];
164
- let u, p;
165
- return o ? (u = s ? l.DEFAULT_SINGLE_PRICE_FORMATTED : l.DEFAULT_SINGLE_PRICE, p = s ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE) : (u = s ? l.DEFAULT_PRICE_FORMATTED : l.DEFAULT_PRICE, p = s ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE), {
166
- imageSrc: y.PAIRS_FOR_EXTENSION.imageSrc[i].DEFAULT[a],
167
- name: y.PAIRS_FOR_EXTENSION.name[i].DEFAULT[a],
168
- price: u,
169
- originalPrice: p,
164
+ const t = _(this.currentNode), i = e ?? (t == null ? void 0 : t.type) ?? T.ITEMS_TYPE.CART_ITEMS, n = r ?? (t == null ? void 0 : t.itemsSelectValue) ?? "", s = (t == null ? void 0 : t.priceFormatted) ?? !1, a = (t == null ? void 0 : t.priceSinglePrice) ?? !1, l = g[i].findIndex((h) => h.value === n), c = l > -1 ? l : 0, o = y.PAIRS_FOR_EXTENSION.price[i], d = y.PAIRS_FOR_EXTENSION.originalPrice[i];
165
+ let m, u;
166
+ return a ? (m = s ? o.DEFAULT_SINGLE_PRICE_FORMATTED : o.DEFAULT_SINGLE_PRICE, u = s ? d.DEFAULT_SINGLE_PRICE_FORMATTED : d.DEFAULT_SINGLE_PRICE) : (m = s ? o.DEFAULT_PRICE_FORMATTED : o.DEFAULT_PRICE, u = s ? d.DEFAULT_PRICE_FORMATTED : d.DEFAULT_PRICE), {
167
+ imageSrc: y.PAIRS_FOR_EXTENSION.imageSrc[i].DEFAULT[c],
168
+ name: y.PAIRS_FOR_EXTENSION.name[i].DEFAULT[c],
169
+ price: m,
170
+ originalPrice: u,
170
171
  quantity: y.PAIRS_FOR_EXTENSION.quantity[i].DEFAULT,
171
172
  button: y.PAIRS_FOR_EXTENSION.button[i].DEFAULT_LABEL
172
173
  };
@@ -183,71 +184,79 @@ class te extends k {
183
184
  return;
184
185
  const i = t.getInnerText().trim();
185
186
  let n = t.getInnerHTML().trim();
186
- n = n.replace(i, g(e)), r.modifyHtml(t).setInnerHtml(n);
187
+ n = n.replace(i, A(e)), r.modifyHtml(t).setInnerHtml(n);
187
188
  }
188
189
  _updatePrice(e, r) {
189
- var o;
190
- const t = ((o = this.currentNode) == null ? void 0 : o.querySelectorAll(
190
+ var a;
191
+ const t = ((a = this.currentNode) == null ? void 0 : a.querySelectorAll(
191
192
  `[esd-extension-block-id="${I.PRICE}"]`
192
193
  )) || [], i = _(this.currentNode), n = (i == null ? void 0 : i.priceCurrencySymbol) ?? "", s = (i == null ? void 0 : i.priceCurrencyLocation) ?? "0";
193
- t.forEach((c) => {
194
- const a = this._getParagraphFromBlock(c);
195
- if (!a)
194
+ t.forEach((l) => {
195
+ const c = this._getParagraphFromBlock(l);
196
+ if (!c)
196
197
  return;
197
- const l = a.getInnerHTML().trim() || "", T = a.getInnerText().trim() || "", u = (n == null ? void 0 : n.trim()) || "", p = this._removeCurrencySymbol(T, u), h = this._replacePriceNumber(p, e), E = this._buildPriceContent(h, u, s), N = l.replace(T, g(E));
198
- r.modifyHtml(a).setInnerHtml(N);
198
+ const o = c.getInnerHTML().trim() || "", d = c.getInnerText().trim() || "", m = (n == null ? void 0 : n.trim()) || "", u = this._removeCurrencySymbol(d, m), h = this._replacePriceNumber(u, e), E = this._buildPriceContent(h, m, s), S = o.replace(d, A(E));
199
+ r.modifyHtml(c).setInnerHtml(S);
199
200
  });
200
201
  }
201
202
  _updateOriginalPrice(e, r) {
202
- var o;
203
- const t = ((o = this.currentNode) == null ? void 0 : o.querySelectorAll(
203
+ var a;
204
+ const t = ((a = this.currentNode) == null ? void 0 : a.querySelectorAll(
204
205
  `[esd-extension-block-id="${I.ORIGINAL_PRICE}"]`
205
206
  )) || [], i = _(this.currentNode), n = (i == null ? void 0 : i.priceCurrencySymbol) ?? "", s = (i == null ? void 0 : i.priceCurrencyLocation) ?? "0";
206
- t.forEach((c) => {
207
- const a = this._getParagraphFromBlock(c);
208
- if (!a)
207
+ t.forEach((l) => {
208
+ const c = this._getParagraphFromBlock(l);
209
+ if (!c)
209
210
  return;
210
- const l = a.querySelector("s");
211
- if (!l)
211
+ const o = c.querySelector("s");
212
+ if (!o)
212
213
  return;
213
- const T = l.getInnerHTML().trim() || "", u = l.getInnerText().trim() || "", p = (n == null ? void 0 : n.trim()) || "", h = this._removeCurrencySymbol(u, p), E = this._replacePriceNumber(h, e), N = this._buildPriceContent(E, p, s), R = `<s>${T.replace(u, g(N))}</s>`;
214
- r.modifyHtml(a).setInnerHtml(R);
214
+ const d = o.getInnerHTML().trim() || "", m = o.getInnerText().trim() || "", u = (n == null ? void 0 : n.trim()) || "", h = this._removeCurrencySymbol(m, u), E = this._replacePriceNumber(h, e), S = this._buildPriceContent(E, u, s), R = `<s>${d.replace(m, A(S))}</s>`;
215
+ r.modifyHtml(c).setInnerHtml(R);
215
216
  });
216
217
  }
217
218
  _updateQuantity(e, r, t) {
218
219
  var h;
219
- const i = _(this.currentNode), s = (r ?? (i == null ? void 0 : i.type) ?? d.ITEMS_TYPE.CART_ITEMS) !== d.ITEMS_TYPE.BROWSED_ITEMS, o = (i == null ? void 0 : i.quantityControlEnabled) !== !1, c = s && o, a = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${I.QUANTITY}"]`);
220
- if (!a)
220
+ const i = _(this.currentNode), s = (r ?? (i == null ? void 0 : i.type) ?? T.ITEMS_TYPE.CART_ITEMS) !== T.ITEMS_TYPE.BROWSED_ITEMS, a = (i == null ? void 0 : i.quantityControlEnabled) !== !1, l = s && a, c = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${I.QUANTITY}"]`);
221
+ if (!c)
221
222
  return;
222
- const l = this._getParagraphFromBlock(a);
223
- if (!l)
223
+ const o = this._getParagraphFromBlock(c);
224
+ if (!o)
224
225
  return;
225
- const T = l.getInnerText().trim();
226
- let u = l.getInnerHTML().trim();
227
- function p(E, N, A) {
226
+ const d = o.getInnerText().trim();
227
+ let m = o.getInnerHTML().trim();
228
+ function u(E, S, P) {
228
229
  return E.replace(
229
- new RegExp(`(>\\s*)?${N}(\\s*<)?`, "g"),
230
- `$1${A}$2`
230
+ new RegExp(`(>\\s*)?${S}(\\s*<)?`, "g"),
231
+ `$1${P}$2`
231
232
  );
232
233
  }
233
- u = p(u, T, e), t.modifyHtml(l).setInnerHtml(u), t.modifyHtml(a).setStyle("display", c ? "table-cell" : "none");
234
+ m = u(m, d, e), t.modifyHtml(o).setInnerHtml(m), t.modifyHtml(c).setStyle("display", l ? "table-cell" : "none");
234
235
  }
235
236
  _reOrderTemplate(e) {
236
- var h, E, N, A, R, b;
237
- const r = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${I.IMAGE}"]`), t = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${I.NAME}"]`), i = ((N = this.currentNode) == null ? void 0 : N.querySelectorAll(
237
+ var h, E, S, P, R, b;
238
+ const r = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${I.IMAGE}"]`), t = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${I.NAME}"]`), i = ((S = this.currentNode) == null ? void 0 : S.querySelectorAll(
238
239
  `[esd-extension-block-id="${I.PRICE}"]`
239
- )) || [], n = ((A = this.currentNode) == null ? void 0 : A.querySelectorAll(
240
+ )) || [], n = ((P = this.currentNode) == null ? void 0 : P.querySelectorAll(
240
241
  `[esd-extension-block-id="${I.ORIGINAL_PRICE}"]`
241
- )) || [], [s] = i, [o] = n, c = (R = this.currentNode) == null ? void 0 : R.querySelector(`[esd-extension-block-id="${I.QUANTITY}"]`), a = (b = this.currentNode) == null ? void 0 : b.querySelector(`[esd-extension-block-id="${I.BUTTON}"]`);
242
- if (!r || !t || !s || !o || !c || !a)
242
+ )) || [], [s] = i, [a] = n, l = (R = this.currentNode) == null ? void 0 : R.querySelector(`[esd-extension-block-id="${I.QUANTITY}"]`), c = (b = this.currentNode) == null ? void 0 : b.querySelector(`[esd-extension-block-id="${I.BUTTON}"]`);
243
+ if (!r || !t || !s || !a || !l || !c)
243
244
  return;
244
- const l = _(this.currentNode), u = ((l == null ? void 0 : l.orientation) ?? d.ORIENTATION.VERTICAL) === d.ORIENTATION.VERTICAL;
245
- let p = u ? w : $;
245
+ const o = _(this.currentNode), d = (o == null ? void 0 : o.orientation) ?? T.ORIENTATION.VERTICAL, m = d === T.ORIENTATION.VERTICAL;
246
+ let u = m ? V : q;
246
247
  setTimeout(() => {
247
- const f = g(s.getOuterHTML()), U = g(o.getOuterHTML());
248
- p = p.replace("{-{-TEMPLATE_FIRST_LINE-}-}", u ? D : "").replace("{-{-PRODUCT_IMAGE-}-}", C(r.getOuterHTML())).replace("{-{-PRODUCT_NAME-}-}", C(t.getOuterHTML())).replaceAll("{-{-PRODUCT_PRICE-}-}", C(f)).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", C(U)).replace("{-{-PRODUCT_QUANTITY-}-}", C(c.getOuterHTML())).replace("{-{-PRODUCT_BUTTON-}-}", C(a.getOuterHTML())), p = p.trim().replace(D, "").slice(0, -5);
249
- const P = e ?? this.api.getDocumentModifier();
250
- P.modifyHtml(r.querySelector("img")).setAttribute("width", H.productImageWidth).setAttribute("height", H.productImageWidth), P.modifyHtml(this.currentNode).setInnerHtml(p), e || P.apply(new S("Reordered template"));
248
+ const k = A(D(s.getOuterHTML(), m)), F = A(
249
+ D(a.getOuterHTML(), m)
250
+ );
251
+ u = u.replace("{-{-TEMPLATE_FIRST_LINE-}-}", m ? x : "").replace("{-{-PRODUCT_IMAGE-}-}", C(r.getOuterHTML())).replace("{-{-PRODUCT_NAME-}-}", C(t.getOuterHTML())).replaceAll("{-{-PRODUCT_PRICE-}-}", C(k)).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", C(F)).replace("{-{-PRODUCT_QUANTITY-}-}", C(l.getOuterHTML())).replace("{-{-PRODUCT_BUTTON-}-}", C(c.getOuterHTML())), u = G(
252
+ u,
253
+ d,
254
+ (o == null ? void 0 : o.priceOrientation) ?? "horizontal",
255
+ (o == null ? void 0 : o.priceVisible) ?? !0,
256
+ (o == null ? void 0 : o.originalPriceVisible) ?? !0
257
+ ), u = u.trim().replace(x, "").slice(0, -5);
258
+ const O = e ?? this.api.getDocumentModifier();
259
+ O.modifyHtml(r.querySelector("img")).setAttribute("width", U.productImageWidth).setAttribute("height", U.productImageWidth), O.modifyHtml(this.currentNode).setInnerHtml(u), e || O.apply(new N("Reordered template"));
251
260
  }, 50);
252
261
  }
253
262
  _updateDataTypeAttributes(e, r) {
@@ -262,28 +271,28 @@ class te extends k {
262
271
  _updateDataNumberAttributes(e, r) {
263
272
  if (!this.currentNode)
264
273
  return;
265
- const t = _(this.currentNode), i = (t == null ? void 0 : t.type) ?? d.ITEMS_TYPE.CART_ITEMS, n = B(e, i), s = this.currentNode.closest(".ins-product-td");
266
- s && r.modifyHtml(s).setAttribute("data-number", n), this.currentNode.querySelectorAll("[data-number]").forEach((c) => {
267
- const a = c;
268
- r.modifyHtml(a).setAttribute("data-number", n);
274
+ const t = _(this.currentNode), i = (t == null ? void 0 : t.type) ?? T.ITEMS_TYPE.CART_ITEMS, n = v(e, i), s = this.currentNode.closest(".ins-product-td");
275
+ s && r.modifyHtml(s).setAttribute("data-number", n), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
276
+ const c = l;
277
+ r.modifyHtml(c).setAttribute("data-number", n);
269
278
  });
270
279
  }
271
280
  _reFillTemplate(e) {
272
281
  const r = this._getTemplateData(e), t = this.api.getDocumentModifier();
273
- this._updateImageSrc(r.imageSrc, t), this._updateName(r.name, t), this._updatePrice(r.price, t), this._updateOriginalPrice(r.originalPrice, t), this._updateQuantity(r.quantity, e, t), t.apply(new S("Refilled template"));
282
+ this._updateImageSrc(r.imageSrc, t), this._updateName(r.name, t), this._updatePrice(r.price, t), this._updateOriginalPrice(r.originalPrice, t), this._updateQuantity(r.quantity, e, t), t.apply(new N("Refilled template"));
274
283
  }
275
284
  _recalculateTrimming() {
276
- var n;
285
+ var s;
277
286
  if (!this.currentNode)
278
287
  return;
279
- const e = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${I.NAME}"]`);
288
+ const e = (s = this.currentNode) == null ? void 0 : s.querySelector(`[esd-extension-block-id="${I.NAME}"]`);
280
289
  if (!e)
281
290
  return;
282
- const r = V(e);
291
+ const r = Y(e);
283
292
  if (!r)
284
293
  return;
285
- const t = _(this.currentNode), i = (t == null ? void 0 : t.nameTrimming) ?? !0;
286
- this.api.getDocumentModifier().modifyHtml(r).setStyle("overflow", "hidden").setStyle("white-space", i ? "nowrap" : "normal").setStyle("text-overflow", i ? "ellipsis" : "unset").setStyle("max-width", "100%").setStyle("width", "100%").apply(new S("Recalculated trimming after orientation change"));
294
+ const t = _(this.currentNode), i = (t == null ? void 0 : t.nameTrimming) ?? !0, n = f(t == null ? void 0 : t.orientation);
295
+ this.api.getDocumentModifier().modifyHtml(r).setStyle("overflow", "hidden").setStyle("white-space", i ? "nowrap" : "normal").setStyle("text-overflow", i ? "ellipsis" : "unset").setStyle("max-width", n).removeStyle("width").apply(new N("Recalculated trimming after orientation change"));
287
296
  }
288
297
  _getParagraphFromBlock(e) {
289
298
  return e.querySelector("p");
@@ -300,8 +309,8 @@ class te extends k {
300
309
  } else {
301
310
  const n = t.match(/([^0-9.,\s]+)/);
302
311
  if (n && n[1]) {
303
- const s = n[1].trim(), o = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
304
- i = t.replace(o, "").trim();
312
+ const s = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
313
+ i = t.replace(a, "").trim();
305
314
  }
306
315
  }
307
316
  return i;
@@ -315,6 +324,6 @@ class te extends k {
315
324
  }
316
325
  }
317
326
  export {
318
- G as CONTROL_BLOCK_ID,
319
- te as ItemsBlockControl
327
+ Q as CONTROL_BLOCK_ID,
328
+ se as ItemsBlockControl
320
329
  };