@useinsider/guido 3.17.0 → 3.18.0-beta.41e529d

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 (120) hide show
  1. package/README.md +6 -5
  2. package/dist/@types/config/schemas.js +10 -7
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +86 -78
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
  7. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
  8. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
  9. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  11. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  12. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  13. package/dist/composables/useCustomInterfaceAppearance.js +56 -38
  14. package/dist/composables/useLegacyStrategyConversion.js +52 -0
  15. package/dist/composables/useModuleRepair.js +33 -0
  16. package/dist/composables/useRecommendation.js +41 -34
  17. package/dist/composables/useSave.js +30 -29
  18. package/dist/composables/useStripo.js +15 -15
  19. package/dist/composables/useSyncModuleExtractor.js +15 -13
  20. package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
  21. package/dist/config/i18n/en/labels.json.js +1 -1
  22. package/dist/config/migrator/index.js +9 -8
  23. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  24. package/dist/config/migrator/recommendation/extractors.js +29 -24
  25. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  26. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  27. package/dist/config/migrator/recommendationMigrator.js +31 -25
  28. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  29. package/dist/enums/academy.js +2 -1
  30. package/dist/enums/date.js +5 -3
  31. package/dist/enums/extensions/recommendationBlock.js +4 -1
  32. package/dist/extensions/Blocks/Items/block.js +118 -49
  33. package/dist/extensions/Blocks/Items/constants/currency.js +25 -0
  34. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
  35. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
  36. package/dist/extensions/Blocks/Items/template.js +153 -152
  37. package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
  38. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  39. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  40. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  41. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  42. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  43. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  44. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -180
  45. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +159 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  48. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  49. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  50. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  51. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
  52. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  53. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  54. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  55. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
  56. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  57. package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
  58. package/dist/extensions/Blocks/common-control.js +22 -19
  59. package/dist/guido.css +1 -1
  60. package/dist/services/recommendationApi.js +81 -33
  61. package/dist/src/@types/config/schemas.d.ts +6 -0
  62. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  63. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
  64. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  65. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  66. package/dist/src/composables/useConfig.d.ts +4 -0
  67. package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
  68. package/dist/src/composables/useModuleRepair.d.ts +18 -0
  69. package/dist/src/composables/useRecommendation.d.ts +1 -0
  70. package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
  71. package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
  72. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  73. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  74. package/dist/src/enums/academy.d.ts +1 -0
  75. package/dist/src/enums/date.d.ts +1 -0
  76. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  77. package/dist/src/extensions/Blocks/Items/block.d.ts +35 -0
  78. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +43 -0
  79. package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
  80. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  81. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  82. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  83. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  84. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  87. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  88. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  91. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  92. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
  93. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  94. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  95. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
  96. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  97. package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
  98. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  99. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  100. package/dist/src/services/recommendationApi.d.ts +5 -1
  101. package/dist/src/stores/config.d.ts +178 -0
  102. package/dist/src/stores/save-as-template.d.ts +4 -3
  103. package/dist/src/utils/genericUtil.d.ts +5 -0
  104. package/dist/src/utils/itemsCurrencyRepair.d.ts +17 -0
  105. package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
  106. package/dist/static/assets/icons/line-change.svg.js +5 -0
  107. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  108. package/dist/static/assets/icons/line-info.svg.js +5 -0
  109. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  110. package/dist/static/styles/components/recommendation-strategy.css.js +220 -0
  111. package/dist/static/styles/customEditorStyle.css.js +3 -1
  112. package/dist/stores/config.js +66 -59
  113. package/dist/utils/dateUtil.js +23 -10
  114. package/dist/utils/genericUtil.js +28 -27
  115. package/dist/utils/itemsCurrencyRepair.js +39 -0
  116. package/dist/utils/pairProductVariables.js +58 -58
  117. package/dist/utils/templatePreparation.js +35 -34
  118. package/package.json +3 -2
  119. package/dist/composables/useModuleDynamicContentRepair.js +0 -37
  120. package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -13
@@ -0,0 +1,220 @@
1
+ const n = `.strategy-control-header {
2
+ padding: 16px 16px 0;
3
+ }
4
+
5
+ .strategy-control-title {
6
+ margin: 0;
7
+ color: var(--guido-color-gray-800);
8
+ font-size: 16px;
9
+ font-weight: 600;
10
+ line-height: 24px;
11
+ }
12
+
13
+ .strategy-control-description-row {
14
+ padding: 8px 16px 16px;
15
+ }
16
+
17
+ .strategy-control-description {
18
+ margin: 0;
19
+ color: var(--guido-color-gray-600);
20
+ font-size: 13px;
21
+ line-height: 16px;
22
+ }
23
+
24
+ .strategy-control-description a {
25
+ color: var(--guido-color-primary-500);
26
+ text-decoration: underline;
27
+ }
28
+
29
+ .strategy-control-notice-row {
30
+ padding: 0 16px 16px;
31
+ }
32
+
33
+ .strategy-control-notice {
34
+ display: flex;
35
+ gap: 8px;
36
+ align-items: center;
37
+ padding: 12px;
38
+ border: 1px solid var(--guido-color-border-onpage-message-info);
39
+ border-radius: 4px;
40
+ background-color: var(--guido-color-background-onpage-message-info);
41
+ }
42
+
43
+ .strategy-control-notice::before {
44
+ content: '';
45
+ flex: none;
46
+ width: 24px;
47
+ height: 24px;
48
+ background-color: var(--guido-color-border-onpage-message-info);
49
+ mask-image: var(--guido-icon-line-info);
50
+ mask-repeat: no-repeat;
51
+ mask-position: center;
52
+ mask-size: 24px 24px;
53
+ }
54
+
55
+ .strategy-control-notice-text {
56
+ margin: 0;
57
+ padding: 4px 0;
58
+ color: var(--guido-color-neutral-700);
59
+ font-size: 13px;
60
+ line-height: 16px;
61
+ }
62
+
63
+ .recommendation-controls-container .container.strategy-control-cta-row {
64
+ grid-template-columns: repeat(2, minmax(0, 180px));
65
+ justify-content: start;
66
+ gap: 16px;
67
+ padding: 0 16px 16px;
68
+ }
69
+
70
+ .strategy-control-cta {
71
+ width: 100%;
72
+ }
73
+
74
+ .strategy-control-cta > .button {
75
+ display: flex;
76
+ gap: 8px;
77
+ justify-content: center;
78
+ width: 100%;
79
+ border: none;
80
+ font-size: 15px;
81
+ font-weight: 400;
82
+ line-height: 24px;
83
+ white-space: nowrap;
84
+ }
85
+
86
+ .strategy-control-cta.primary > .button:disabled,
87
+ .strategy-control-cta.primary > .button.disabled {
88
+ opacity: 1;
89
+ color: var(--guido-color-gray-800);
90
+ cursor: default;
91
+ }
92
+
93
+ .strategy-control-name-band {
94
+ display: flex;
95
+ align-items: center;
96
+ min-height: 48px;
97
+ padding: 0 16px;
98
+ background-color: var(--guido-color-gray-0);
99
+ }
100
+
101
+ /* Figma gives the legacy band a 59px row: 17.5px above and below its 24px content. */
102
+ [data-strategy-legacy-state] .strategy-control-name-band {
103
+ gap: 8px;
104
+ justify-content: space-between;
105
+ min-height: auto;
106
+ padding: 17.5px 16px;
107
+ }
108
+
109
+ .strategy-control-name {
110
+ color: var(--guido-color-gray-800);
111
+ font-size: 15px;
112
+ font-weight: 600;
113
+ line-height: 24px;
114
+ }
115
+
116
+ .strategy-control-actions {
117
+ display: flex;
118
+ align-items: center;
119
+ padding: 16px;
120
+ }
121
+
122
+ .strategy-control-action {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ padding: 0;
126
+ border: none;
127
+ background: none;
128
+ font-size: 15px;
129
+ font-weight: 400;
130
+ line-height: 24px;
131
+ cursor: pointer;
132
+ }
133
+
134
+ .strategy-control-action > span {
135
+ padding: 0 8px;
136
+ }
137
+
138
+ .strategy-control-action::before,
139
+ .strategy-control-cta.on > .button::before {
140
+ content: '';
141
+ flex: none;
142
+ width: 24px;
143
+ height: 24px;
144
+ background-color: currentcolor;
145
+ mask-repeat: no-repeat;
146
+ mask-position: center;
147
+ mask-size: 24px 24px;
148
+ }
149
+
150
+ .strategy-control-action--change::before {
151
+ mask-image: var(--guido-icon-line-change);
152
+ }
153
+
154
+ .strategy-control-action--remove::before {
155
+ mask-image: var(--guido-icon-line-delete);
156
+ }
157
+
158
+ .strategy-control-cta.on > .button::before {
159
+ mask-image: var(--guido-icon-line-plus);
160
+ }
161
+
162
+ .strategy-control-action--update::before {
163
+ mask-image: var(--guido-icon-filled-arrow-rising);
164
+ }
165
+
166
+ .strategy-control-name-band .strategy-control-action > span {
167
+ padding: 0 0 0 8px;
168
+ }
169
+
170
+ .strategy-control-action--update,
171
+ .strategy-control-action--change {
172
+ color: var(--guido-color-primary-500);
173
+ }
174
+
175
+ .strategy-control-action--remove {
176
+ color: var(--guido-color-danger-500);
177
+ }
178
+
179
+ .strategy-control-action:hover {
180
+ text-decoration: underline;
181
+ }
182
+
183
+ .strategy-control-action:disabled,
184
+ .strategy-control-action:disabled:hover {
185
+ color: var(--guido-color-gray-700);
186
+ text-decoration: none;
187
+ cursor: default;
188
+ }
189
+
190
+ .recommendation-controls-container:not(.strategy-block):not(.legacy-strategy-block) .strategy-control-container,
191
+ .recommendation-controls-container.strategy-block .product-count-control-container,
192
+ .recommendation-controls-container.strategy-block .algorithm-control-container,
193
+ .recommendation-controls-container.strategy-block .filters-control-container,
194
+ .recommendation-controls-container.strategy-block .shuffle-control-container,
195
+ .recommendation-controls-container.legacy-strategy-block .product-count-control-container,
196
+ .recommendation-controls-container.legacy-strategy-block .algorithm-control-container,
197
+ .recommendation-controls-container.legacy-strategy-block .filters-control-container,
198
+ .recommendation-controls-container.legacy-strategy-block .shuffle-control-container {
199
+ display: none;
200
+ }
201
+
202
+ .recommendation-controls-container.strategy-block,
203
+ .recommendation-controls-container.legacy-strategy-block {
204
+ display: flex;
205
+ flex-direction: column;
206
+ }
207
+
208
+ .recommendation-controls-container.strategy-block .price-placement-control-container,
209
+ .recommendation-controls-container.legacy-strategy-block .price-placement-control-container {
210
+ order: 1;
211
+ }
212
+
213
+ .recommendation-controls-container.strategy-block .product-layout-control-container,
214
+ .recommendation-controls-container.legacy-strategy-block .product-layout-control-container {
215
+ order: 2;
216
+ }
217
+ `;
218
+ export {
219
+ n as default
220
+ };
@@ -43,7 +43,9 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel,
47
+ .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
+ .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
47
49
  display: none !important;
48
50
  }
49
51
 
@@ -1,8 +1,8 @@
1
1
  import "../@types/config/schemas.js";
2
2
  import "../@types/config/defaults.js";
3
3
  import { parseConfig as o } from "../@types/config/validator.js";
4
- import { defineStore as r } from "pinia";
5
- const f = r("guido-config", {
4
+ import { defineStore as a } from "pinia";
5
+ const s = a("guido-config", {
6
6
  state: () => ({
7
7
  initialized: !1,
8
8
  config: null
@@ -11,121 +11,128 @@ const f = r("guido-config", {
11
11
  /**
12
12
  * Get the identity configuration
13
13
  */
14
- identity: (i) => {
15
- var e;
16
- return ((e = i.config) == null ? void 0 : e.identity) ?? null;
14
+ identity: (e) => {
15
+ var i;
16
+ return ((i = e.config) == null ? void 0 : i.identity) ?? null;
17
17
  },
18
18
  /**
19
19
  * Get the partner configuration
20
20
  */
21
- partner: (i) => {
22
- var e;
23
- return ((e = i.config) == null ? void 0 : e.partner) ?? null;
21
+ partner: (e) => {
22
+ var i;
23
+ return ((i = e.config) == null ? void 0 : i.partner) ?? null;
24
24
  },
25
25
  /**
26
26
  * Get the template configuration
27
27
  */
28
- template: (i) => {
29
- var e;
30
- return ((e = i.config) == null ? void 0 : e.template) ?? null;
28
+ template: (e) => {
29
+ var i;
30
+ return ((i = e.config) == null ? void 0 : i.template) ?? null;
31
31
  },
32
32
  /**
33
33
  * Get the editor configuration
34
34
  */
35
- editor: (i) => {
36
- var e;
37
- return ((e = i.config) == null ? void 0 : e.editor) ?? null;
35
+ editor: (e) => {
36
+ var i;
37
+ return ((i = e.config) == null ? void 0 : i.editor) ?? null;
38
38
  },
39
39
  /**
40
40
  * Get the UI configuration
41
41
  */
42
- ui: (i) => {
43
- var e;
44
- return ((e = i.config) == null ? void 0 : e.ui) ?? null;
42
+ ui: (e) => {
43
+ var i;
44
+ return ((i = e.config) == null ? void 0 : i.ui) ?? null;
45
45
  },
46
46
  /**
47
47
  * Get the features configuration
48
48
  */
49
- features: (i) => {
50
- var e;
51
- return ((e = i.config) == null ? void 0 : e.features) ?? null;
49
+ features: (e) => {
50
+ var i;
51
+ return ((i = e.config) == null ? void 0 : i.features) ?? null;
52
52
  },
53
53
  /**
54
54
  * Get the blocks configuration
55
55
  */
56
- blocks: (i) => {
57
- var e;
58
- return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
56
+ blocks: (e) => {
57
+ var i;
58
+ return ((i = e.config) == null ? void 0 : i.blocks) ?? null;
59
59
  },
60
60
  /**
61
61
  * Get the compiler configuration
62
62
  */
63
- compiler: (i) => {
64
- var e;
65
- return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
63
+ compiler: (e) => {
64
+ var i;
65
+ return ((i = e.config) == null ? void 0 : i.compiler) ?? null;
66
66
  },
67
67
  /**
68
68
  * Get the callbacks configuration
69
69
  */
70
- callbacks: (i) => {
71
- var e;
72
- return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
70
+ callbacks: (e) => {
71
+ var i;
72
+ return ((i = e.config) == null ? void 0 : i.callbacks) ?? null;
73
73
  },
74
74
  /**
75
75
  * Get the template ID
76
76
  */
77
- templateId: (i) => {
78
- var e, n;
79
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.templateId) ?? "";
77
+ templateId: (e) => {
78
+ var i, n;
79
+ return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.templateId) ?? "";
80
80
  },
81
81
  /**
82
82
  * Get the user ID
83
83
  */
84
- userId: (i) => {
85
- var e, n;
86
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.userId) ?? "";
84
+ userId: (e) => {
85
+ var i, n;
86
+ return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.userId) ?? "";
87
87
  },
88
88
  /**
89
89
  * Get the variation ID
90
90
  */
91
- variationId: (i) => {
92
- var e, n;
93
- return ((n = (e = i.config) == null ? void 0 : e.identity) == null ? void 0 : n.variationId) ?? "";
91
+ variationId: (e) => {
92
+ var i, n;
93
+ return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.variationId) ?? "";
94
+ },
95
+ /**
96
+ * Get the campaign ID
97
+ */
98
+ campaignId: (e) => {
99
+ var i, n;
100
+ return ((n = (i = e.config) == null ? void 0 : i.identity) == null ? void 0 : n.campaignId) ?? "";
94
101
  },
95
102
  /**
96
103
  * Get the partner name
97
104
  */
98
- partnerName: (i) => {
99
- var e, n;
100
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.name) ?? "";
105
+ partnerName: (e) => {
106
+ var i, n;
107
+ return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.name) ?? "";
101
108
  },
102
109
  /**
103
110
  * Get the product type
104
111
  */
105
- productType: (i) => {
106
- var e, n;
107
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.productType) ?? 60;
112
+ productType: (e) => {
113
+ var i, n;
114
+ return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.productType) ?? 60;
108
115
  },
109
116
  /**
110
117
  * Get the message type
111
118
  */
112
- messageType: (i) => {
113
- var e, n;
114
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.messageType) ?? 1;
119
+ messageType: (e) => {
120
+ var i, n;
121
+ return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.messageType) ?? 1;
115
122
  },
116
123
  /**
117
124
  * Get the username
118
125
  */
119
- username: (i) => {
120
- var e, n;
121
- return ((n = (e = i.config) == null ? void 0 : e.partner) == null ? void 0 : n.username) ?? "Guido User";
126
+ username: (e) => {
127
+ var i, n;
128
+ return ((n = (i = e.config) == null ? void 0 : i.partner) == null ? void 0 : n.username) ?? "Guido User";
122
129
  },
123
130
  /**
124
131
  * Check if header should be shown
125
132
  */
126
- showHeader: (i) => {
127
- var e, n;
128
- return ((n = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : n.showHeader) ?? !0;
133
+ showHeader: (e) => {
134
+ var i, n;
135
+ return ((n = (i = e.config) == null ? void 0 : i.ui) == null ? void 0 : n.showHeader) ?? !0;
129
136
  },
130
137
  /**
131
138
  * Check if a specific feature is enabled.
@@ -133,18 +140,18 @@ const f = r("guido-config", {
133
140
  * flash on during loading, then disappear once config resolves.
134
141
  */
135
142
  // eslint-disable-next-line @stylistic/max-len
136
- isFeatureEnabled: (i) => (e) => {
143
+ isFeatureEnabled: (e) => (i) => {
137
144
  var n, t;
138
- return ((t = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : t[e]) ?? !1;
145
+ return ((t = (n = e.config) == null ? void 0 : n.features) == null ? void 0 : t[i]) ?? !1;
139
146
  }
140
147
  },
141
148
  actions: {
142
149
  /**
143
150
  * Initialize the config store with validated configuration
144
151
  */
145
- init(i) {
146
- const e = o(i);
147
- this.config = e, this.initialized = !0;
152
+ init(e) {
153
+ const i = o(e);
154
+ this.config = i, this.initialized = !0;
148
155
  },
149
156
  /**
150
157
  * Reset the config store
@@ -155,5 +162,5 @@ const f = r("guido-config", {
155
162
  }
156
163
  });
157
164
  export {
158
- f as useConfigStore
165
+ s as useConfigStore
159
166
  };
@@ -1,10 +1,19 @@
1
- import { DEFAULT_LOCALE as r, DEFAULT as o } from "../enums/date.js";
2
- const c = () => {
1
+ import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
2
+ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
3
3
  const t = window.l10n;
4
- return (t == null ? void 0 : t.locale) === o ? r : (t == null ? void 0 : t.locale) || r;
5
- };
6
- new Intl.DateTimeFormat().resolvedOptions().timeZone;
7
- const i = (t) => {
4
+ return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
5
+ }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
6
+ const t = window.l10n;
7
+ return (t == null ? void 0 : t.timezone) || u || c;
8
+ }, D = (t, e = s(), r = f()) => {
9
+ const o = {
10
+ year: "numeric",
11
+ month: "2-digit",
12
+ day: "2-digit",
13
+ timeZone: r
14
+ }, i = m(t);
15
+ return new Intl.DateTimeFormat(e, o).format(i);
16
+ }, T = (t) => {
8
17
  if (!t)
9
18
  return "";
10
19
  const e = new Date(t);
@@ -16,9 +25,13 @@ const i = (t) => {
16
25
  second: "2-digit",
17
26
  hour12: !1
18
27
  }).format(e);
19
- }, m = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
28
+ }, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
20
29
  export {
21
- i as formatPatchDate,
22
- m as isAfterDate,
23
- c as locale
30
+ m as convertToDateObject,
31
+ T as formatPatchDate,
32
+ D as formatShortDate,
33
+ h as isAfterDate,
34
+ u as localTz,
35
+ s as locale,
36
+ f as timezone
24
37
  };
@@ -1,26 +1,26 @@
1
- const o = (l) => {
2
- const a = l.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [c] = a, r = {
3
- text: l.label,
4
- value: c || ""
1
+ const o = (t) => {
2
+ const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [s] = a, r = {
3
+ text: t.label,
4
+ value: s || ""
5
5
  };
6
6
  if (a.length >= 2) {
7
- const [, t, e] = a;
8
- if (t.startsWith("default:")) {
9
- let n = t.slice(8).trim();
7
+ const [, l, e] = a;
8
+ if (l.startsWith("default:")) {
9
+ let n = l.slice(8).trim();
10
10
  n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
11
  } else {
12
- const n = t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null;
13
- n ? r.format = n : e || (r.fallback = t), e && (r.fallback = e);
12
+ const n = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
+ n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
14
14
  }
15
15
  }
16
16
  return r;
17
- }, f = (l, s = !1) => l.map((a) => {
17
+ }, f = (t, c = !1) => t.map((a) => {
18
18
  if (a.format)
19
19
  return {
20
20
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
21
  value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
22
  };
23
- if (s) {
23
+ if (c) {
24
24
  if (!a.fallback)
25
25
  return {
26
26
  label: a.text,
@@ -36,33 +36,34 @@ const o = (l) => {
36
36
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
37
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), b = (l) => {
40
- const s = [], a = /* @__PURE__ */ new Set(), c = (t) => {
41
- Array.isArray(t) && t.forEach((e) => {
39
+ }), b = (t) => {
40
+ const c = [], a = /* @__PURE__ */ new Set(), s = (l) => {
41
+ Array.isArray(l) && l.forEach((e) => {
42
42
  const n = [...e.children ?? [], ...e.select_items ?? []];
43
43
  if (n.length > 0) {
44
- c(n);
44
+ s(n);
45
45
  return;
46
46
  }
47
47
  const u = e.text || e.tag_text;
48
- u && e.value && !a.has(e.value) && (a.add(e.value), s.push({ text: u, value: e.value }));
48
+ u && e.value && !a.has(e.value) && (a.add(e.value), c.push({ text: u, value: e.value }));
49
49
  });
50
- }, [r] = Object.values(l ?? {});
51
- return c(r), s;
52
- }, v = (l, s, a = !1) => {
53
- const c = new Set(l.map((t) => t.value)), r = s.filter((t) => c.has(t.value) ? !1 : (c.add(t.value), !0));
50
+ }, [r] = Object.values(t ?? {});
51
+ return s(r), c;
52
+ }, i = (t, c, a = !1) => {
53
+ const s = new Set(t.map((l) => l.value)), r = c.filter((l) => s.has(l.value) ? !1 : (s.add(l.value), !0));
54
54
  return [
55
- ...f(l, a),
55
+ ...f(t, a),
56
56
  ...f(r, a)
57
57
  ];
58
- }, i = () => {
59
- var l;
60
- return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
61
- };
58
+ }, v = () => {
59
+ var t;
60
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
61
+ }, k = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "";
62
62
  export {
63
- v as buildMergeTagEntries,
63
+ k as asText,
64
+ i as buildMergeTagEntries,
64
65
  f as dynamicContentToMergeTags,
65
66
  b as flattenDynamicContentList,
66
- i as getCsrfToken,
67
+ v as getCsrfToken,
67
68
  o as mergeTagToDynamicContent
68
69
  };
@@ -0,0 +1,39 @@
1
+ import { currencyAttrTargets as u, ITEMS_CURRENCY_ATTR as c } from "../extensions/Blocks/Items/constants/currency.js";
2
+ import { ItemsBlockId as l } from "../extensions/Blocks/Items/enums/controlEnums.js";
3
+ const s = "items-block-v2";
4
+ function f(e) {
5
+ const i = e.getAttribute("esd-ext-config");
6
+ if (!i)
7
+ return !1;
8
+ let t, r;
9
+ try {
10
+ ({ position: t, symbol: r } = u(JSON.parse(i)));
11
+ } catch {
12
+ return !1;
13
+ }
14
+ let o = !1;
15
+ return e.querySelectorAll(`.${l.PRICE} p`).forEach((n) => {
16
+ t !== void 0 && n.getAttribute(c.POSITION) !== t && (n.setAttribute(c.POSITION, t), o = !0), r !== void 0 && n.getAttribute(c.SYMBOL) !== r && (n.setAttribute(c.SYMBOL, r), o = !0);
17
+ }), o;
18
+ }
19
+ function S(e) {
20
+ if (typeof e != "string" || !e.includes(s))
21
+ return e;
22
+ try {
23
+ const t = new DOMParser().parseFromString(
24
+ `<table><tbody><tr>${e}</tr></tbody></table>`,
25
+ "text/html"
26
+ ).querySelector("tr"), r = t.querySelectorAll(`.${s}`);
27
+ if (r.length === 0)
28
+ return e;
29
+ let o = !1;
30
+ return r.forEach((n) => {
31
+ f(n) && (o = !0);
32
+ }), o ? t.innerHTML : e;
33
+ } catch (i) {
34
+ return console.error("Failed to repair items currency on module add:", i), e;
35
+ }
36
+ }
37
+ export {
38
+ S as repairItemsCurrencyAttributes
39
+ };