@useinsider/guido 3.2.0-beta.565bfaf → 3.2.0-beta.570fb6d

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 (282) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/@types/config/validator.js +27 -34
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +76 -81
  5. package/dist/components/organisms/base/Toaster.vue2.js +10 -11
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
  9. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
  12. package/dist/components/organisms/header/EditorActions.vue.js +11 -12
  13. package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
  14. package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
  16. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
  17. package/dist/components/organisms/header/RightSlot.vue2.js +14 -17
  18. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +20 -22
  20. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +11 -12
  21. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +38 -41
  22. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +11 -12
  23. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -43
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +11 -12
  27. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +27 -29
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
  29. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +19 -21
  30. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +8 -9
  31. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
  32. package/dist/composables/useActionsApi.js +37 -38
  33. package/dist/composables/useBlocksConfig.js +26 -26
  34. package/dist/composables/useFullStoryBridge.js +13 -0
  35. package/dist/composables/useHtmlCompiler.js +34 -26
  36. package/dist/composables/useHtmlValidator.js +101 -109
  37. package/dist/composables/useHttp.js +30 -30
  38. package/dist/composables/usePartner.js +1 -1
  39. package/dist/composables/useRecommendation.js +14 -15
  40. package/dist/composables/useSave.js +21 -22
  41. package/dist/composables/useStripo.js +47 -42
  42. package/dist/composables/useSyncModuleExtractor.js +31 -29
  43. package/dist/composables/useTimerClone.js +24 -25
  44. package/dist/composables/useTranslations.js +23 -16
  45. package/dist/composables/useValidation.js +7 -8
  46. package/dist/composables/validators/useLiquidValidator.js +13 -13
  47. package/dist/config/compiler/recommendationCompilerRules.js +72 -67
  48. package/dist/config/compiler/unsubscribeCompilerRules.js +38 -37
  49. package/dist/config/compiler/utils/recommendationCompilerUtils.js +36 -34
  50. package/dist/config/migrator/checkboxMigrator.js +20 -21
  51. package/dist/config/migrator/couponBlockMigrator.js +18 -19
  52. package/dist/config/migrator/itemsBlockMigrator.js +87 -89
  53. package/dist/config/migrator/radioButtonMigrator.js +12 -13
  54. package/dist/config/migrator/recommendationMigrator.js +107 -110
  55. package/dist/config/migrator/unsubscribeMigrator.js +10 -11
  56. package/dist/enums/displayConditions.js +78 -82
  57. package/dist/enums/extensions/recommendationBlock.js +41 -95
  58. package/dist/enums/unsubscribe.js +35 -30
  59. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  60. package/dist/extensions/Blocks/Items/block.js +9 -9
  61. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  62. package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
  63. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  64. package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
  65. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
  66. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
  67. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  68. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  69. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
  70. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  71. package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
  72. package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
  73. package/dist/extensions/Blocks/Items/template.js +210 -210
  74. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  75. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  76. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  77. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
  78. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
  79. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  80. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  81. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
  82. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
  83. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
  84. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  85. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  86. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
  87. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -135
  88. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  89. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  90. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  91. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  92. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  93. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  94. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  95. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  96. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  97. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  98. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  99. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  100. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
  101. package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
  102. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
  103. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
  104. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -23
  105. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  106. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  107. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  108. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +24 -25
  109. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  110. package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
  111. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  112. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
  113. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  114. package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
  115. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
  116. package/dist/extensions/Blocks/common-control.js +25 -26
  117. package/dist/extensions/DynamicContent/dynamic-content.js +53 -58
  118. package/dist/guido.css +1 -1
  119. package/dist/library.js +11 -12
  120. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -167
  121. package/dist/node_modules/valibot/dist/index.js +122 -126
  122. package/dist/package.json.js +1 -1
  123. package/dist/services/recommendationApi.js +14 -17
  124. package/dist/services/templateLibraryApi.js +37 -38
  125. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  126. package/dist/src/composables/useActionsApi.d.ts +1 -1
  127. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  128. package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
  129. package/dist/src/composables/useTranslations.d.ts +1 -1
  130. package/dist/src/enums/displayConditions.d.ts +1 -5
  131. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
  132. package/dist/src/enums/unsubscribe.d.ts +8 -8
  133. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  134. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  135. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  136. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  137. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  138. package/dist/src/stores/dynamic-content.d.ts +3 -3
  139. package/dist/static/styles/components/button.css.js +16 -9
  140. package/dist/static/styles/components/loader.css.js +4 -0
  141. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  142. package/dist/stores/config.js +25 -81
  143. package/dist/stores/dynamic-content.js +6 -11
  144. package/dist/stores/onboarding.js +5 -5
  145. package/dist/stores/preview.js +6 -9
  146. package/dist/stores/unsubscribe.js +1 -4
  147. package/dist/utils/dateUtil.js +7 -10
  148. package/dist/utils/genericUtil.js +10 -13
  149. package/dist/utils/pairProductVariables.js +13 -14
  150. package/package.json +8 -5
  151. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  152. package/dist/node_modules/lodash-es/_Hash.js +0 -20
  153. package/dist/node_modules/lodash-es/_ListCache.js +0 -20
  154. package/dist/node_modules/lodash-es/_Map.js +0 -6
  155. package/dist/node_modules/lodash-es/_MapCache.js +0 -20
  156. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  157. package/dist/node_modules/lodash-es/_Set.js +0 -6
  158. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  159. package/dist/node_modules/lodash-es/_Stack.js +0 -18
  160. package/dist/node_modules/lodash-es/_Symbol.js +0 -5
  161. package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
  162. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  163. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  164. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
  165. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  166. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  167. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  168. package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
  169. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  170. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  171. package/dist/node_modules/lodash-es/_baseFor.js +0 -5
  172. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  173. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  174. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  175. package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
  176. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  177. package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
  178. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  179. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  180. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  181. package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
  182. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
  183. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  184. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  185. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  186. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  187. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  188. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  189. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  190. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  191. package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
  192. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  193. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  194. package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
  195. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  196. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  197. package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
  198. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  199. package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
  200. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  201. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  202. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  203. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  204. package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
  205. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  206. package/dist/node_modules/lodash-es/_getMapData.js +0 -8
  207. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  208. package/dist/node_modules/lodash-es/_getNative.js +0 -9
  209. package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
  210. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  211. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  212. package/dist/node_modules/lodash-es/_getValue.js +0 -6
  213. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  214. package/dist/node_modules/lodash-es/_hashClear.js +0 -7
  215. package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
  216. package/dist/node_modules/lodash-es/_hashGet.js +0 -13
  217. package/dist/node_modules/lodash-es/_hashHas.js +0 -9
  218. package/dist/node_modules/lodash-es/_hashSet.js +0 -9
  219. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  220. package/dist/node_modules/lodash-es/_isIndex.js +0 -8
  221. package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
  222. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  223. package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
  224. package/dist/node_modules/lodash-es/_isMasked.js +0 -11
  225. package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
  226. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  227. package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
  228. package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
  229. package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
  230. package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
  231. package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
  232. package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
  233. package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  234. package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
  235. package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
  236. package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
  237. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  238. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  239. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  240. package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
  241. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  242. package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
  243. package/dist/node_modules/lodash-es/_objectToString.js +0 -7
  244. package/dist/node_modules/lodash-es/_overArg.js +0 -8
  245. package/dist/node_modules/lodash-es/_root.js +0 -5
  246. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  247. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  248. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  249. package/dist/node_modules/lodash-es/_stackClear.js +0 -7
  250. package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
  251. package/dist/node_modules/lodash-es/_stackGet.js +0 -6
  252. package/dist/node_modules/lodash-es/_stackHas.js +0 -6
  253. package/dist/node_modules/lodash-es/_stackSet.js +0 -17
  254. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  255. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  256. package/dist/node_modules/lodash-es/_toSource.js +0 -17
  257. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  258. package/dist/node_modules/lodash-es/eq.js +0 -6
  259. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  260. package/dist/node_modules/lodash-es/get.js +0 -8
  261. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  262. package/dist/node_modules/lodash-es/identity.js +0 -6
  263. package/dist/node_modules/lodash-es/isArguments.js +0 -10
  264. package/dist/node_modules/lodash-es/isArray.js +0 -4
  265. package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
  266. package/dist/node_modules/lodash-es/isBuffer.js +0 -6
  267. package/dist/node_modules/lodash-es/isFunction.js +0 -12
  268. package/dist/node_modules/lodash-es/isLength.js +0 -7
  269. package/dist/node_modules/lodash-es/isObject.js +0 -7
  270. package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
  271. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  272. package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
  273. package/dist/node_modules/lodash-es/keys.js +0 -9
  274. package/dist/node_modules/lodash-es/map.js +0 -11
  275. package/dist/node_modules/lodash-es/memoize.js +0 -18
  276. package/dist/node_modules/lodash-es/property.js +0 -10
  277. package/dist/node_modules/lodash-es/range.js +0 -5
  278. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  279. package/dist/node_modules/lodash-es/stubFalse.js +0 -6
  280. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  281. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  282. package/dist/node_modules/lodash-es/toString.js +0 -7
@@ -4,25 +4,25 @@ var A = (d, e, t) => T(d, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { BLOCK_ID as S } from "../../extensions/Blocks/Recommendation/block.js";
5
5
  import P, { prepareProductRows as q } from "../../extensions/Blocks/Recommendation/templates/grid/migration.js";
6
6
  import { useTemplateStore as w } from "../../stores/template.js";
7
- import { getDefaultProducts as $ } from "../../extensions/Blocks/Recommendation/templates/utils.js";
8
- class B {
7
+ import { getDefaultProducts as B } from "../../extensions/Blocks/Recommendation/templates/utils.js";
8
+ class $ {
9
9
  constructor() {
10
10
  A(this, "parser");
11
11
  this.parser = new DOMParser();
12
12
  }
13
13
  migrate(e) {
14
14
  try {
15
- const t = this.parser.parseFromString(e, "text/html"), s = t.querySelectorAll(
16
- 'td.ins-recommendation-v3-block-1, td.product-block[esd-handler-name*="EmailRecommendationV3"]'
15
+ const t = this.parser.parseFromString(e, "text/html"), o = t.querySelectorAll(
16
+ 'td.ins-recommendation-v3-block-1:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"]:not(.recommendation-block-v2)'
17
17
  );
18
- return w().$patch((i) => {
19
- i.migrations = { ...i.migrations, [S]: s.length };
20
- }), s.length === 0 ? e : (s.forEach((i) => {
21
- const r = i.getAttribute("id"), n = this.extractBgColor(i), u = this.extractTitle(i), c = this.extractProductRows(i), l = P.replace("{-{-TITLE-}-}", u).replace("{-{-PRODUCT_ROWS-}-}", c), a = this.parser.parseFromString(
22
- `<table id="tempDoc"><tbody><tr>${l}</tr></tbody></table>`,
18
+ return w().$patch((s) => {
19
+ s.migrations = { ...s.migrations, [S]: o.length };
20
+ }), o.length === 0 ? e : (o.forEach((s) => {
21
+ const r = s.getAttribute("id"), i = this.extractBgColor(s), c = this.extractTitle(s), l = this.extractProductRows(s), g = P.replace("{-{-TITLE-}-}", c).replace("{-{-PRODUCT_ROWS-}-}", l), u = this.parser.parseFromString(
22
+ `<table id="tempDoc"><tbody><tr>${g}</tr></tbody></table>`,
23
23
  "text/html"
24
24
  ).querySelector(".recommendation-block-v2");
25
- a && i.parentNode && (r && a.setAttribute("id", r), n && a.setAttribute("bgcolor", n), i.parentNode.replaceChild(a, i));
25
+ u && s.parentNode && (r && u.setAttribute("id", r), i && u.setAttribute("bgcolor", i), s.parentNode.replaceChild(u, s));
26
26
  }), t.documentElement.outerHTML);
27
27
  } catch (t) {
28
28
  return console.error("RecommendationMigrator failed:", t), e;
@@ -37,11 +37,11 @@ class B {
37
37
  const t = e.getAttribute("bgcolor");
38
38
  if (t)
39
39
  return t.trim();
40
- const s = e.getAttribute("style");
41
- if (s) {
42
- const o = s.match(/background-color\s*:\s*([^;]+)/i);
43
- if (o && o[1])
44
- return o[1].trim();
40
+ const o = e.getAttribute("style");
41
+ if (o) {
42
+ const n = o.match(/background-color\s*:\s*([^;]+)/i);
43
+ if (n && n[1])
44
+ return n[1].trim();
45
45
  }
46
46
  return "";
47
47
  }
@@ -54,11 +54,11 @@ class B {
54
54
  const t = e.getAttribute("bgcolor");
55
55
  if (t)
56
56
  return t.trim();
57
- const s = e.getAttribute("style");
58
- if (s) {
59
- const o = s.match(/background-color\s*:\s*([^;]+)/i);
60
- if (o && o[1])
61
- return o[1].trim();
57
+ const o = e.getAttribute("style");
58
+ if (o) {
59
+ const n = o.match(/background-color\s*:\s*([^;]+)/i);
60
+ if (n && n[1])
61
+ return n[1].trim();
62
62
  }
63
63
  return "";
64
64
  }
@@ -68,7 +68,6 @@ class B {
68
68
  * @returns HTML string for the title block
69
69
  */
70
70
  extractTitle(e) {
71
- var g, a;
72
71
  const t = e.querySelector(".ext-recommendation-title");
73
72
  if (!t)
74
73
  return this.buildTitleBlock({
@@ -78,24 +77,24 @@ class B {
78
77
  align: "center",
79
78
  styles: "font-size: 28px; color: #333333;"
80
79
  });
81
- const s = t.querySelector("p");
82
- if (!s) {
83
- const p = ((g = t.textContent) == null ? void 0 : g.trim()) || "You May Also Like!", b = t.getAttribute("align") || "center";
80
+ const o = t.querySelector("p");
81
+ if (!o) {
82
+ const a = t.textContent?.trim() || "You May Also Like!", u = t.getAttribute("align") || "center";
84
83
  return this.buildTitleBlock({
85
- text: p,
84
+ text: a,
86
85
  isBold: !0,
87
86
  isItalic: !1,
88
- align: b,
87
+ align: u,
89
88
  styles: "font-size: 28px; color: #333333;"
90
89
  });
91
90
  }
92
- const o = ((a = s.textContent) == null ? void 0 : a.trim()) || "You May Also Like!", i = t.getAttribute("align") || s.getAttribute("align") || "center", r = s.getAttribute("style") || "", n = /font-weight\s*:\s*bold/i.test(r) || !!s.querySelector("b, strong"), u = /font-style\s*:\s*italic/i.test(r) || !!s.querySelector("i, em"), c = this.removeStyleProperties(r, ["font-weight", "font-style"]), l = this.convertInlineToBlock(c);
91
+ const n = o.textContent?.trim() || "You May Also Like!", s = t.getAttribute("align") || o.getAttribute("align") || "center", r = o.getAttribute("style") || "", i = /font-weight\s*:\s*bold/i.test(r) || !!o.querySelector("b, strong"), c = /font-style\s*:\s*italic/i.test(r) || !!o.querySelector("i, em"), l = this.removeStyleProperties(r, ["font-weight", "font-style"]), g = this.convertInlineToBlock(l);
93
92
  return this.buildTitleBlock({
94
- text: o,
95
- isBold: n,
96
- isItalic: u,
97
- align: i,
98
- styles: l
93
+ text: n,
94
+ isBold: i,
95
+ isItalic: c,
96
+ align: s,
97
+ styles: g
99
98
  });
100
99
  }
101
100
  /**
@@ -107,8 +106,8 @@ class B {
107
106
  const t = this.extractProductConfig(e);
108
107
  if (!t)
109
108
  return console.warn("[RecommendationMigrator] No product config found, using defaults"), this.generateProductRows(6, 3, {});
110
- const { totalCount: s, productsPerRow: o } = t, i = this.extractProductStyles(e);
111
- return this.generateProductRows(s, o, i);
109
+ const { totalCount: o, productsPerRow: n } = t, s = this.extractProductStyles(e);
110
+ return this.generateProductRows(o, n, s);
112
111
  }
113
112
  /**
114
113
  * Extracts Stripo padding/margin utility classes from a class string
@@ -116,7 +115,7 @@ class B {
116
115
  * @returns Filtered Stripo utility classes as a space-separated string
117
116
  */
118
117
  extractStripoClasses(e) {
119
- return e ? e.split(/\s+/).filter((o) => /^es-(p\d+|m[-\d])/.test(o)).join(" ") : "";
118
+ return e ? e.split(/\s+/).filter((n) => /^es-(p\d+|m[-\d])/.test(n)).join(" ") : "";
120
119
  }
121
120
  /**
122
121
  * Extracts product configuration from old block
@@ -128,15 +127,15 @@ class B {
128
127
  if (!t)
129
128
  return null;
130
129
  try {
131
- const s = this.unescapeJsonString(t), o = JSON.parse(s);
130
+ const o = this.unescapeJsonString(t), n = JSON.parse(o);
132
131
  return {
133
- totalCount: o.totalCount ?? 6,
134
- productsPerRow: o.rowCount ?? 3
132
+ totalCount: n.totalCount ?? 6,
133
+ productsPerRow: n.rowCount ?? 3
135
134
  };
136
- } catch (s) {
137
- return console.error("[RecommendationMigrator] Failed to parse product config:", s), console.error(
135
+ } catch (o) {
136
+ return console.error("[RecommendationMigrator] Failed to parse product config:", o), console.error(
138
137
  "[RecommendationMigrator] Error details:",
139
- s instanceof Error ? s.message : String(s)
138
+ o instanceof Error ? o.message : String(o)
140
139
  ), null;
141
140
  }
142
141
  }
@@ -155,14 +154,14 @@ class B {
155
154
  * @param extractedStyles - Styles extracted from old product elements
156
155
  * @returns HTML string for product rows with applied styles
157
156
  */
158
- generateProductRows(e, t, s) {
159
- const o = $(), i = [];
160
- for (let n = 0; n < e; n++) {
161
- const u = o[n % o.length];
162
- i.push({ ...u });
157
+ generateProductRows(e, t, o) {
158
+ const n = B(), s = [];
159
+ for (let i = 0; i < e; i++) {
160
+ const c = n[i % n.length];
161
+ s.push({ ...c });
163
162
  }
164
- let r = q(i, t);
165
- return r = this.applyExtractedStyles(r, s), r;
163
+ let r = q(s, t);
164
+ return r = this.applyExtractedStyles(r, o), r;
166
165
  }
167
166
  /**
168
167
  * Extracts styles from old product elements
@@ -170,35 +169,35 @@ class B {
170
169
  * @returns Object with extracted styles for each element type
171
170
  */
172
171
  extractProductStyles(e) {
173
- const t = {}, s = e.querySelector(".product-card");
174
- if (!s)
172
+ const t = {}, o = e.querySelector(".product-card");
173
+ if (!o)
175
174
  return console.warn("[RecommendationMigrator] No product card found, using default styles"), t;
176
- const o = this.extractCardBgColor(s);
177
- o && (t.cardBgColor = o);
178
- const i = s.querySelector(".ext-product-image");
179
- if (i) {
180
- const l = i.querySelector("img"), g = l == null ? void 0 : l.getAttribute("width"), a = i.getAttribute("style") || "", p = i.getAttribute("align") || "center", b = i.getAttribute("class") || "", m = this.extractStripoClasses(b);
181
- t.imageWidth = g || "120", t.imageAlign = p, t.imageTdStyle = a, t.imageClasses = m;
175
+ const n = this.extractCardBgColor(o);
176
+ n && (t.cardBgColor = n);
177
+ const s = o.querySelector(".ext-product-image");
178
+ if (s) {
179
+ const a = s.querySelector("img")?.getAttribute("width"), u = s.getAttribute("style") || "", p = s.getAttribute("align") || "center", b = s.getAttribute("class") || "", m = this.extractStripoClasses(b);
180
+ t.imageWidth = a || "120", t.imageAlign = p, t.imageTdStyle = u, t.imageClasses = m;
182
181
  }
183
- const r = s.querySelector(".ext-product-name");
182
+ const r = o.querySelector(".ext-product-name");
184
183
  if (r) {
185
- const l = r.querySelector("p"), g = (l == null ? void 0 : l.getAttribute("style")) || "", a = r.getAttribute("align") || "center", p = r.getAttribute("style") || "", b = r.getAttribute("class") || "", m = this.extractStripoClasses(b);
186
- t.nameStyle = g, t.nameAlign = a, t.nameTdStyle = p, t.nameClasses = m;
184
+ const a = r.querySelector("p")?.getAttribute("style") || "", u = r.getAttribute("align") || "center", p = r.getAttribute("style") || "", b = r.getAttribute("class") || "", m = this.extractStripoClasses(b);
185
+ t.nameStyle = a, t.nameAlign = u, t.nameTdStyle = p, t.nameClasses = m;
187
186
  }
188
- const n = s.querySelector(".ext-product-price");
189
- if (n) {
190
- const l = n.querySelector("p"), g = (l == null ? void 0 : l.getAttribute("style")) || "", a = n.getAttribute("align") || "center", p = n.getAttribute("style") || "", b = n.getAttribute("class") || "", m = this.extractStripoClasses(b);
191
- t.priceStyle = g, t.priceAlign = a, t.priceTdStyle = p, t.priceClasses = m;
192
- }
193
- const u = s.querySelector(".ext-product-original-price");
194
- if (u) {
195
- const l = u.querySelector("p"), g = (l == null ? void 0 : l.getAttribute("style")) || "", a = u.getAttribute("align") || "center", p = u.getAttribute("style") || "", b = u.getAttribute("class") || "", m = this.extractStripoClasses(b);
196
- t.oldPriceStyle = g, t.oldPriceAlign = a, t.oldPriceTdStyle = p, t.oldPriceClasses = m;
187
+ const i = o.querySelector(".ext-product-price");
188
+ if (i) {
189
+ const a = i.querySelector("p")?.getAttribute("style") || "", u = i.getAttribute("align") || "center", p = i.getAttribute("style") || "", b = i.getAttribute("class") || "", m = this.extractStripoClasses(b);
190
+ t.priceStyle = a, t.priceAlign = u, t.priceTdStyle = p, t.priceClasses = m;
197
191
  }
198
- const c = s.querySelector(".ext-product-button");
192
+ const c = o.querySelector(".ext-product-original-price");
199
193
  if (c) {
200
- const l = c.querySelector(".es-button-border"), g = c.querySelector("a.es-button"), a = (l == null ? void 0 : l.getAttribute("style")) || "", p = (g == null ? void 0 : g.getAttribute("style")) || "", b = c.getAttribute("align") || "center", m = c.getAttribute("style") || "", f = c.getAttribute("class") || "", C = this.extractStripoClasses(f), y = ((c == null ? void 0 : c.textContent) || "").trim();
201
- t.buttonBorderStyle = a, t.buttonLinkStyle = p, t.buttonAlign = b, t.buttonTdStyle = m, t.buttonClasses = C, t.buttonText = y;
194
+ const a = c.querySelector("p")?.getAttribute("style") || "", u = c.getAttribute("align") || "center", p = c.getAttribute("style") || "", b = c.getAttribute("class") || "", m = this.extractStripoClasses(b);
195
+ t.oldPriceStyle = a, t.oldPriceAlign = u, t.oldPriceTdStyle = p, t.oldPriceClasses = m;
196
+ }
197
+ const l = o.querySelector(".ext-product-button");
198
+ if (l) {
199
+ const g = l.querySelector(".es-button-border"), a = l.querySelector("a.es-button"), u = g?.getAttribute("style") || "", p = a?.getAttribute("style") || "", b = l.getAttribute("align") || "center", m = l.getAttribute("style") || "", f = l.getAttribute("class") || "", C = this.extractStripoClasses(f), y = (l?.textContent || "").trim();
200
+ t.buttonBorderStyle = u, t.buttonLinkStyle = p, t.buttonAlign = b, t.buttonTdStyle = m, t.buttonClasses = C, t.buttonText = y;
202
201
  }
203
202
  return t;
204
203
  }
@@ -211,49 +210,47 @@ class B {
211
210
  applyExtractedStyles(e, t) {
212
211
  if (!t || Object.keys(t).length === 0)
213
212
  return e;
214
- const s = this.parser.parseFromString(`<table>${e}</table>`, "text/html");
215
- t.cardBgColor && s.querySelectorAll(".product-attribute-cell").forEach((r) => {
213
+ const o = this.parser.parseFromString(`<table>${e}</table>`, "text/html");
214
+ return t.cardBgColor && o.querySelectorAll(".product-attribute-cell").forEach((r) => {
216
215
  r.setAttribute("bgcolor", t.cardBgColor);
217
- }), (t.imageWidth || t.imageAlign || t.imageTdStyle || t.imageClasses) && s.querySelectorAll(".product-image").forEach((r) => {
216
+ }), (t.imageWidth || t.imageAlign || t.imageTdStyle || t.imageClasses) && o.querySelectorAll(".product-image").forEach((r) => {
218
217
  if (t.imageAlign && r.setAttribute("align", t.imageAlign), t.imageTdStyle && r.setAttribute("style", t.imageTdStyle), t.imageClasses) {
219
- const c = `${r.getAttribute("class") || ""} ${t.imageClasses}`.trim();
220
- r.setAttribute("class", c);
218
+ const l = `${r.getAttribute("class") || ""} ${t.imageClasses}`.trim();
219
+ r.setAttribute("class", l);
221
220
  }
222
- const n = r.querySelector("img");
223
- n && t.imageWidth && n.setAttribute("width", t.imageWidth);
224
- }), (t.nameStyle || t.nameAlign || t.nameTdStyle || t.nameClasses) && s.querySelectorAll(".product-name").forEach((r) => {
221
+ const i = r.querySelector("img");
222
+ i && t.imageWidth && i.setAttribute("width", t.imageWidth);
223
+ }), (t.nameStyle || t.nameAlign || t.nameTdStyle || t.nameClasses) && o.querySelectorAll(".product-name").forEach((r) => {
225
224
  if (t.nameAlign && r.setAttribute("align", t.nameAlign), t.nameTdStyle && r.setAttribute("style", t.nameTdStyle), t.nameClasses) {
226
- const c = `${r.getAttribute("class") || ""} ${t.nameClasses}`.trim();
227
- r.setAttribute("class", c);
225
+ const l = `${r.getAttribute("class") || ""} ${t.nameClasses}`.trim();
226
+ r.setAttribute("class", l);
228
227
  }
229
- const n = r.querySelector("p");
230
- n && t.nameStyle && n.setAttribute("style", t.nameStyle);
231
- }), (t.priceStyle || t.priceAlign || t.priceTdStyle || t.priceClasses) && s.querySelectorAll(".product-price").forEach((r) => {
228
+ const i = r.querySelector("p");
229
+ i && t.nameStyle && i.setAttribute("style", t.nameStyle);
230
+ }), (t.priceStyle || t.priceAlign || t.priceTdStyle || t.priceClasses) && o.querySelectorAll(".product-price").forEach((r) => {
232
231
  if (t.priceAlign && r.setAttribute("align", t.priceAlign), t.priceTdStyle && r.setAttribute("style", t.priceTdStyle), t.priceClasses) {
233
- const c = `${r.getAttribute("class") || ""} ${t.priceClasses}`.trim();
234
- r.setAttribute("class", c);
232
+ const l = `${r.getAttribute("class") || ""} ${t.priceClasses}`.trim();
233
+ r.setAttribute("class", l);
235
234
  }
236
- const n = r.querySelector("p");
237
- n && t.priceStyle && n.setAttribute("style", t.priceStyle);
238
- }), (t.oldPriceStyle || t.oldPriceAlign || t.oldPriceTdStyle || t.oldPriceClasses) && s.querySelectorAll(".product-old-price").forEach((r) => {
235
+ const i = r.querySelector("p");
236
+ i && t.priceStyle && i.setAttribute("style", t.priceStyle);
237
+ }), (t.oldPriceStyle || t.oldPriceAlign || t.oldPriceTdStyle || t.oldPriceClasses) && o.querySelectorAll(".product-old-price").forEach((r) => {
239
238
  if (t.oldPriceAlign && r.setAttribute("align", t.oldPriceAlign), t.oldPriceTdStyle && r.setAttribute("style", t.oldPriceTdStyle), t.oldPriceClasses) {
240
- const c = `${r.getAttribute("class") || ""} ${t.oldPriceClasses}`.trim();
241
- r.setAttribute("class", c);
239
+ const l = `${r.getAttribute("class") || ""} ${t.oldPriceClasses}`.trim();
240
+ r.setAttribute("class", l);
242
241
  }
243
- const n = r.querySelector("p");
244
- n && t.oldPriceStyle && n.setAttribute("style", t.oldPriceStyle);
245
- }), (t.buttonBorderStyle || t.buttonLinkStyle || t.buttonAlign || t.buttonTdStyle || t.buttonClasses) && s.querySelectorAll(".product-button").forEach((r) => {
242
+ const i = r.querySelector("p");
243
+ i && t.oldPriceStyle && i.setAttribute("style", t.oldPriceStyle);
244
+ }), (t.buttonBorderStyle || t.buttonLinkStyle || t.buttonAlign || t.buttonTdStyle || t.buttonClasses) && o.querySelectorAll(".product-button").forEach((r) => {
246
245
  if (t.buttonAlign && r.setAttribute("align", t.buttonAlign), t.buttonTdStyle && r.setAttribute("style", t.buttonTdStyle), t.buttonClasses) {
247
- const l = `${r.getAttribute("class") || ""} ${t.buttonClasses}`.trim();
248
- r.setAttribute("class", l);
246
+ const g = `${r.getAttribute("class") || ""} ${t.buttonClasses}`.trim();
247
+ r.setAttribute("class", g);
249
248
  }
250
- const n = r.querySelector(".es-button-border");
251
- n && t.buttonBorderStyle && n.setAttribute("style", t.buttonBorderStyle);
252
- const u = r.querySelector("a.es-button");
253
- u && (t.buttonLinkStyle && u.setAttribute("style", t.buttonLinkStyle), t.buttonText && (u.textContent = t.buttonText));
254
- });
255
- const o = s.querySelector("table");
256
- return (o == null ? void 0 : o.innerHTML) || e;
249
+ const i = r.querySelector(".es-button-border");
250
+ i && t.buttonBorderStyle && i.setAttribute("style", t.buttonBorderStyle);
251
+ const c = r.querySelector("a.es-button");
252
+ c && (t.buttonLinkStyle && c.setAttribute("style", t.buttonLinkStyle), t.buttonText && (c.textContent = t.buttonText));
253
+ }), o.querySelector("table")?.innerHTML || e;
257
254
  }
258
255
  /**
259
256
  * Builds title block with proper structure
@@ -261,10 +258,10 @@ class B {
261
258
  buildTitleBlock(e) {
262
259
  let t = e.text;
263
260
  e.isBold && e.isItalic ? t = `<strong path="1,0"><em path="1,0,0">${t}</em></strong>` : e.isBold ? t = `<strong path="1,0">${t}</strong>` : e.isItalic && (t = `<em path="1,0">${t}</em>`);
264
- const s = e.align ? ` align="${e.align}"` : "", o = e.styles ? ` style="${e.styles}"` : "";
261
+ const o = e.align ? ` align="${e.align}"` : "", n = e.styles ? ` style="${e.styles}"` : "";
265
262
  return `
266
- <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r"${s}>
267
- <p path="1"${o}>
263
+ <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r"${o}>
264
+ <p path="1"${n}>
268
265
  ${t}
269
266
  </p>
270
267
  </td>
@@ -274,9 +271,9 @@ class B {
274
271
  * Removes specified style properties from a style string
275
272
  */
276
273
  removeStyleProperties(e, t) {
277
- return e ? t.reduce((o, i) => {
278
- const r = new RegExp(`${i}\\s*:\\s*[^;]*;?`, "gi");
279
- return o.replace(r, "");
274
+ return e ? t.reduce((n, s) => {
275
+ const r = new RegExp(`${s}\\s*:\\s*[^;]*;?`, "gi");
276
+ return n.replace(r, "");
280
277
  }, e).replace(/;\s*;/g, ";").replace(/^;|;$/g, "").trim() : "";
281
278
  }
282
279
  /**
@@ -290,7 +287,7 @@ class B {
290
287
  }
291
288
  }
292
289
  function v(d) {
293
- return new B().migrate(d);
290
+ return new $().migrate(d);
294
291
  }
295
292
  export {
296
293
  v as migrateRecommendation
@@ -1,12 +1,12 @@
1
1
  var h = Object.defineProperty;
2
2
  var x = (l, e, t) => e in l ? h(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
- var S = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
4
- import { MERGE_TAGS as k, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
5
- import { DATA_ATTRIBUTES as A } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ var y = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
4
+ import { MERGE_TAGS as m, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
5
+ import { DATA_ATTRIBUTES as S } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
6
6
  import { useUnsubscribeStore as T } from "../../stores/unsubscribe.js";
7
7
  class C {
8
8
  constructor() {
9
- S(this, "parser");
9
+ y(this, "parser");
10
10
  this.parser = new DOMParser();
11
11
  }
12
12
  async migrate(e) {
@@ -45,7 +45,6 @@ class C {
45
45
  return i ? i[0] : "";
46
46
  }
47
47
  extractUnsubscribeContent(e) {
48
- var m;
49
48
  const t = e.querySelector("p");
50
49
  if (!t)
51
50
  return {
@@ -72,7 +71,7 @@ class C {
72
71
  align: i,
73
72
  paragraphStyle: o
74
73
  };
75
- const c = ((m = r.textContent) == null ? void 0 : m.trim()) || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
74
+ const c = r.textContent?.trim() || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
76
75
  return {
77
76
  textBefore: b,
78
77
  linkText: c,
@@ -90,13 +89,13 @@ class C {
90
89
  e.textBefore && n.push(e.textBefore), n.push(u), e.textAfter && n.push(e.textAfter);
91
90
  let s = n.join(" ");
92
91
  e.isBold && e.isItalic ? s = `<strong path="1,0"><em path="1,0,0">${s}</em></strong>` : e.isBold ? s = `<strong path="1,0">${s}</strong>` : e.isItalic && (s = `<em path="1,0">${s}</em>`);
93
- const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${A.PAGE_LIST}="${i.join(",")}"` : "", m = ` ${A.PAGE_TYPE}="${t}"`, y = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
92
+ const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${S.PAGE_LIST}="${i.join(",")}"` : "", A = ` ${S.PAGE_TYPE}="${t}"`, k = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
94
93
  return `
95
94
  <td
96
95
  data-migration="true"
97
96
  esd-extension-block-id="unsubscribe-block"
98
- class="${o ? `${y} ${o}` : y}"
99
- ${b}${f}${m}${a}
97
+ class="${o ? `${k} ${o}` : k}"
98
+ ${b}${f}${A}${a}
100
99
  >
101
100
  <p path="1"${d}>
102
101
  ${s}
@@ -105,10 +104,10 @@ class C {
105
104
  `;
106
105
  }
107
106
  getCollectionTypeFromMergeTag(e) {
108
- return e === k[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === k[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
107
+ return e === m[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === m[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
109
108
  }
110
109
  normalizeUnsubscribeHref(e) {
111
- if (Object.values(k).includes(e))
110
+ if (Object.values(m).includes(e))
112
111
  return e;
113
112
  const i = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
114
113
  return i ? i[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
@@ -1,84 +1,80 @@
1
- import { useTranslations as i } from "../composables/useTranslations.js";
2
- const t = () => {
3
- const e = i();
4
- return [
5
- {
6
- category: e("journey-builder.demographics"),
7
- conditions: [
8
- {
9
- id: 1,
10
- name: e("condition.language"),
11
- description: e("journey-builder.display-condition-language-description"),
12
- beforeScript: '{% if language == "en_US" %}',
13
- afterScript: "{% endif %}"
14
- },
15
- {
16
- id: 2,
17
- name: e("condition.country"),
18
- description: e("journey-builder.display-condition-country-description"),
19
- beforeScript: '{% if country == "Australia" %}',
20
- afterScript: "{% endif %}"
21
- },
22
- {
23
- id: 3,
24
- name: e("stripo-editor.country-and-city"),
25
- description: e("journey-builder.display-condition-country-city-description"),
26
- beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
27
- afterScript: "{% endif %}"
28
- },
29
- {
30
- id: 4,
31
- name: e("stripo-editor.age-less-than-operator"),
32
- description: e("journey-builder.display-condition-age-less-than"),
33
- beforeScript: "{% if age < 18 %}",
34
- afterScript: "{% endif %}"
35
- },
36
- {
37
- id: 5,
38
- name: e("stripo-editor.age-equal-greater-operator"),
39
- description: e("journey-builder.display-condition-age-equal-greater"),
40
- beforeScript: "{% if age >= 25 %}",
41
- afterScript: "{% endif %}"
42
- },
43
- {
44
- id: 6,
45
- name: e("stripo-editor.age-greater-less-operators"),
46
- description: e("journey-builder.display-condition-age-between"),
47
- beforeScript: "{% if age > 18 and age < 25 %}",
48
- afterScript: "{% endif %}"
49
- },
50
- {
51
- id: 7,
52
- name: e("condition.gender"),
53
- description: e("journey-builder.display-condition-gender-female"),
54
- beforeScript: '{% if gender == "Female" %}',
55
- afterScript: "{% endif %}"
56
- },
57
- {
58
- id: 8,
59
- name: e("journey-builder.state"),
60
- description: e("stripo-editor.state-description"),
61
- beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
62
- afterScript: "{% endif %}"
63
- },
64
- {
65
- id: 9,
66
- name: e("journey-builder.vip-user"),
67
- description: e("stripo-editor.vip-user-description"),
68
- beforeScript: "{% if c_is_vip_user %}",
69
- afterScript: "{% endif %}"
70
- },
71
- {
72
- id: 10,
73
- name: e("journey-builder.membership-type"),
74
- description: e("stripo-editor.membership-type-description"),
75
- beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
76
- afterScript: "{% endif %}"
77
- }
78
- ]
79
- }
80
- ];
81
- };
1
+ const e = [
2
+ {
3
+ category: "Demographics",
4
+ conditions: [
5
+ {
6
+ id: 1,
7
+ name: "Language",
8
+ description: "Users who are in the English will see the banner",
9
+ beforeScript: '{% if language == "en_US" %}',
10
+ afterScript: "{% endif %}"
11
+ },
12
+ {
13
+ id: 2,
14
+ name: "Country",
15
+ description: "Only people who live in Australia will see the banner",
16
+ beforeScript: '{% if country == "Australia" %}',
17
+ afterScript: "{% endif %}"
18
+ },
19
+ {
20
+ id: 3,
21
+ name: "Country & City",
22
+ description: "Only people who are located in that country and city",
23
+ beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
24
+ afterScript: "{% endif %}"
25
+ },
26
+ {
27
+ id: 4,
28
+ name: "Age (Less than operator)",
29
+ description: "Users whose age is less than 18",
30
+ beforeScript: "{% if age < 18 %}",
31
+ afterScript: "{% endif %}"
32
+ },
33
+ {
34
+ id: 5,
35
+ name: "Age (Equal and greater than operator)",
36
+ description: "Users whose age is equal or greater than 25",
37
+ beforeScript: "{% if age >= 25 %}",
38
+ afterScript: "{% endif %}"
39
+ },
40
+ {
41
+ id: 6,
42
+ name: "Age (Greater than & less than operators)",
43
+ description: "Users whose age is between 18 and 25",
44
+ beforeScript: "{% if age > 18 and age < 25 %}",
45
+ afterScript: "{% endif %}"
46
+ },
47
+ {
48
+ id: 7,
49
+ name: "Gender",
50
+ description: "Users whose gender is Female",
51
+ beforeScript: '{% if gender == "Female" %}',
52
+ afterScript: "{% endif %}"
53
+ },
54
+ {
55
+ id: 8,
56
+ name: "State",
57
+ description: "Users whose state is one of the followings. c_state is a custom attribute. Use this condition if you have the attribute with the same naming. ",
58
+ beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
59
+ afterScript: "{% endif %}"
60
+ },
61
+ {
62
+ id: 9,
63
+ name: "VIP User",
64
+ description: "Users who are VIP users for that brand. c_is_vip_user = true. c_is_vip_user is a custom attribute. Use this condition if you have the attribute with the same naming.",
65
+ beforeScript: "{% if c_is_vip_user %}",
66
+ afterScript: "{% endif %}"
67
+ },
68
+ {
69
+ id: 10,
70
+ name: "Membership Type",
71
+ description: "Users who belong to gold or silver membership type. c_is_gold_member = true, c_is_silver_member = true. These are custom attributes. Use this condition if you have the attribute with the same naming.",
72
+ beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
73
+ afterScript: "{% endif %}"
74
+ }
75
+ ]
76
+ }
77
+ ];
82
78
  export {
83
- t as getDisplayConditions
79
+ e as displayConditions
84
80
  };