@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.
- package/dist/@types/config/schemas.js +1 -1
- package/dist/@types/config/validator.js +27 -34
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +76 -81
- package/dist/components/organisms/base/Toaster.vue2.js +10 -11
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
- package/dist/components/organisms/header/EditorActions.vue.js +11 -12
- package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
- package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +14 -17
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +20 -22
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +38 -41
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -43
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +27 -29
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +19 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +8 -9
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
- package/dist/composables/useActionsApi.js +37 -38
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +13 -0
- package/dist/composables/useHtmlCompiler.js +34 -26
- package/dist/composables/useHtmlValidator.js +101 -109
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +14 -15
- package/dist/composables/useSave.js +21 -22
- package/dist/composables/useStripo.js +47 -42
- package/dist/composables/useSyncModuleExtractor.js +31 -29
- package/dist/composables/useTimerClone.js +24 -25
- package/dist/composables/useTranslations.js +23 -16
- package/dist/composables/useValidation.js +7 -8
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/recommendationCompilerRules.js +72 -67
- package/dist/config/compiler/unsubscribeCompilerRules.js +38 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +36 -34
- package/dist/config/migrator/checkboxMigrator.js +20 -21
- package/dist/config/migrator/couponBlockMigrator.js +18 -19
- package/dist/config/migrator/itemsBlockMigrator.js +87 -89
- package/dist/config/migrator/radioButtonMigrator.js +12 -13
- package/dist/config/migrator/recommendationMigrator.js +107 -110
- package/dist/config/migrator/unsubscribeMigrator.js +10 -11
- package/dist/enums/displayConditions.js +78 -82
- package/dist/enums/extensions/recommendationBlock.js +41 -95
- package/dist/enums/unsubscribe.js +35 -30
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/Items/block.js +9 -9
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
- package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -135
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -23
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
- package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +24 -25
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
- package/dist/extensions/Blocks/common-control.js +25 -26
- package/dist/extensions/DynamicContent/dynamic-content.js +53 -58
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -167
- package/dist/node_modules/valibot/dist/index.js +122 -126
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +14 -17
- package/dist/services/templateLibraryApi.js +37 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
- package/dist/src/composables/useTranslations.d.ts +1 -1
- package/dist/src/enums/displayConditions.d.ts +1 -5
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
- package/dist/src/enums/unsubscribe.d.ts +8 -8
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/config.js +25 -81
- package/dist/stores/dynamic-content.js +6 -11
- package/dist/stores/onboarding.js +5 -5
- package/dist/stores/preview.js +6 -9
- package/dist/stores/unsubscribe.js +1 -4
- package/dist/utils/dateUtil.js +7 -10
- package/dist/utils/genericUtil.js +10 -13
- package/dist/utils/pairProductVariables.js +13 -14
- package/package.json +8 -5
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Hash.js +0 -20
- package/dist/node_modules/lodash-es/_ListCache.js +0 -20
- package/dist/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/lodash-es/_MapCache.js +0 -20
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_toSource.js +0 -17
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isFunction.js +0 -12
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/memoize.js +0 -18
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- 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
|
|
8
|
-
class
|
|
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"),
|
|
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((
|
|
19
|
-
|
|
20
|
-
}),
|
|
21
|
-
const r =
|
|
22
|
-
`<table id="tempDoc"><tbody><tr>${
|
|
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
|
-
|
|
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
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
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
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
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
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
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:
|
|
84
|
+
text: a,
|
|
86
85
|
isBold: !0,
|
|
87
86
|
isItalic: !1,
|
|
88
|
-
align:
|
|
87
|
+
align: u,
|
|
89
88
|
styles: "font-size: 28px; color: #333333;"
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
|
-
const
|
|
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:
|
|
95
|
-
isBold:
|
|
96
|
-
isItalic:
|
|
97
|
-
align:
|
|
98
|
-
styles:
|
|
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:
|
|
111
|
-
return this.generateProductRows(
|
|
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((
|
|
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
|
|
130
|
+
const o = this.unescapeJsonString(t), n = JSON.parse(o);
|
|
132
131
|
return {
|
|
133
|
-
totalCount:
|
|
134
|
-
productsPerRow:
|
|
132
|
+
totalCount: n.totalCount ?? 6,
|
|
133
|
+
productsPerRow: n.rowCount ?? 3
|
|
135
134
|
};
|
|
136
|
-
} catch (
|
|
137
|
-
return console.error("[RecommendationMigrator] Failed to parse product config:",
|
|
135
|
+
} catch (o) {
|
|
136
|
+
return console.error("[RecommendationMigrator] Failed to parse product config:", o), console.error(
|
|
138
137
|
"[RecommendationMigrator] Error details:",
|
|
139
|
-
|
|
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,
|
|
159
|
-
const
|
|
160
|
-
for (let
|
|
161
|
-
const
|
|
162
|
-
|
|
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(
|
|
165
|
-
return r = this.applyExtractedStyles(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 = {},
|
|
174
|
-
if (!
|
|
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
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
t.imageWidth =
|
|
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 =
|
|
182
|
+
const r = o.querySelector(".ext-product-name");
|
|
184
183
|
if (r) {
|
|
185
|
-
const
|
|
186
|
-
t.nameStyle =
|
|
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
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
t.priceStyle =
|
|
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 =
|
|
192
|
+
const c = o.querySelector(".ext-product-original-price");
|
|
199
193
|
if (c) {
|
|
200
|
-
const
|
|
201
|
-
t.
|
|
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
|
|
215
|
-
t.cardBgColor &&
|
|
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) &&
|
|
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
|
|
220
|
-
r.setAttribute("class",
|
|
218
|
+
const l = `${r.getAttribute("class") || ""} ${t.imageClasses}`.trim();
|
|
219
|
+
r.setAttribute("class", l);
|
|
221
220
|
}
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
}), (t.nameStyle || t.nameAlign || t.nameTdStyle || t.nameClasses) &&
|
|
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
|
|
227
|
-
r.setAttribute("class",
|
|
225
|
+
const l = `${r.getAttribute("class") || ""} ${t.nameClasses}`.trim();
|
|
226
|
+
r.setAttribute("class", l);
|
|
228
227
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
}), (t.priceStyle || t.priceAlign || t.priceTdStyle || t.priceClasses) &&
|
|
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
|
|
234
|
-
r.setAttribute("class",
|
|
232
|
+
const l = `${r.getAttribute("class") || ""} ${t.priceClasses}`.trim();
|
|
233
|
+
r.setAttribute("class", l);
|
|
235
234
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
}), (t.oldPriceStyle || t.oldPriceAlign || t.oldPriceTdStyle || t.oldPriceClasses) &&
|
|
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
|
|
241
|
-
r.setAttribute("class",
|
|
239
|
+
const l = `${r.getAttribute("class") || ""} ${t.oldPriceClasses}`.trim();
|
|
240
|
+
r.setAttribute("class", l);
|
|
242
241
|
}
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
}), (t.buttonBorderStyle || t.buttonLinkStyle || t.buttonAlign || t.buttonTdStyle || t.buttonClasses) &&
|
|
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
|
|
248
|
-
r.setAttribute("class",
|
|
246
|
+
const g = `${r.getAttribute("class") || ""} ${t.buttonClasses}`.trim();
|
|
247
|
+
r.setAttribute("class", g);
|
|
249
248
|
}
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
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
|
|
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"${
|
|
267
|
-
<p path="1"${
|
|
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((
|
|
278
|
-
const r = new RegExp(`${
|
|
279
|
-
return
|
|
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
|
|
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
|
|
4
|
-
import { MERGE_TAGS as
|
|
5
|
-
import { DATA_ATTRIBUTES as
|
|
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
|
-
|
|
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 =
|
|
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 ? ` ${
|
|
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 ? `${
|
|
99
|
-
${b}${f}${
|
|
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 ===
|
|
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(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
79
|
+
e as displayConditions
|
|
84
80
|
};
|