@useinsider/guido 3.2.0-beta.e69fb3b → 3.2.0-beta.ecc7c6c
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 +34 -27
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +81 -76
- package/dist/components/organisms/base/Toaster.vue2.js +11 -10
- 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 +15 -9
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
- package/dist/components/organisms/header/EditorActions.vue.js +12 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
- package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -14
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
- package/dist/composables/useActionsApi.js +38 -37
- package/dist/composables/useBlocksConfig.js +26 -26
- package/dist/composables/useFullStoryBridge.js +9 -8
- package/dist/composables/useHtmlCompiler.js +26 -34
- package/dist/composables/useHtmlValidator.js +114 -101
- package/dist/composables/useHttp.js +30 -30
- package/dist/composables/usePartner.js +1 -1
- package/dist/composables/useRecommendation.js +15 -14
- package/dist/composables/useRibbonOffset.js +15 -15
- package/dist/composables/useSave.js +23 -19
- package/dist/composables/useStripo.js +48 -53
- package/dist/composables/useSyncModuleExtractor.js +29 -31
- package/dist/composables/useTimerClone.js +25 -24
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useValidation.js +8 -7
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/composables/validators/useLiquidValidator.js +13 -13
- package/dist/config/compiler/recommendationCompilerRules.js +27 -27
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
- package/dist/config/migrator/checkboxMigrator.js +21 -20
- package/dist/config/migrator/couponBlockMigrator.js +19 -18
- package/dist/config/migrator/itemsBlockMigrator.js +89 -87
- package/dist/config/migrator/radioButtonMigrator.js +63 -42
- package/dist/config/migrator/recommendationMigrator.js +109 -106
- package/dist/config/migrator/unsubscribeMigrator.js +11 -10
- package/dist/enums/unsubscribe.js +19 -18
- 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 +97 -89
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
- 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 +40 -38
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
- package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
- package/dist/extensions/Blocks/Items/template.js +210 -210
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -17
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
- 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 +36 -35
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
- 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/spacing/index.js +32 -32
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
- package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +64 -54
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
- 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 +25 -24
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
- package/dist/extensions/Blocks/common-control.js +26 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
- package/dist/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
- package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
- package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
- package/dist/node_modules/lodash-es/_arraySome.js +9 -0
- package/dist/node_modules/lodash-es/_baseEach.js +6 -0
- package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
- package/dist/node_modules/lodash-es/_baseGet.js +11 -0
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
- package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
- package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
- package/dist/node_modules/lodash-es/_baseMap.js +11 -0
- package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
- package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
- package/dist/node_modules/lodash-es/_baseRange.js +9 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseToString.js +18 -0
- package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_createRange.js +11 -0
- package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
- package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
- package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
- package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
- package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/lodash-es/_getTag.js +28 -0
- package/dist/node_modules/lodash-es/_getValue.js +1 -1
- package/dist/node_modules/lodash-es/_hasPath.js +19 -0
- package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isKey.js +12 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
- package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
- package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/node_modules/lodash-es/flatMap.js +8 -0
- package/dist/node_modules/lodash-es/get.js +8 -0
- package/dist/node_modules/lodash-es/hasIn.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/lodash-es/map.js +11 -0
- package/dist/node_modules/lodash-es/property.js +10 -0
- package/dist/node_modules/lodash-es/range.js +5 -0
- package/dist/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toFinite.js +14 -0
- package/dist/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/valibot/dist/index.js +126 -122
- package/dist/services/recommendationApi.js +17 -14
- package/dist/services/templateLibraryApi.js +40 -38
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/stores/config.js +81 -25
- package/dist/stores/dynamic-content.js +11 -6
- package/dist/stores/onboarding.js +1 -1
- package/dist/stores/preview.js +9 -6
- package/dist/stores/unsubscribe.js +4 -1
- package/dist/utils/dateUtil.js +10 -7
- package/dist/utils/genericUtil.js +13 -10
- package/dist/utils/pairProductVariables.js +89 -87
- package/package.json +1 -6
- package/dist/enums/displayConditions.js +0 -80
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
var
|
|
1
|
+
var v;
|
|
2
2
|
// @__NO_SIDE_EFFECTS__
|
|
3
|
-
function
|
|
3
|
+
function E(n) {
|
|
4
4
|
return {
|
|
5
|
-
lang: n
|
|
6
|
-
message: n
|
|
7
|
-
abortEarly: n
|
|
8
|
-
abortPipeEarly: n
|
|
5
|
+
lang: (n == null ? void 0 : n.lang) ?? (v == null ? void 0 : v.lang),
|
|
6
|
+
message: n == null ? void 0 : n.message,
|
|
7
|
+
abortEarly: (n == null ? void 0 : n.abortEarly) ?? (v == null ? void 0 : v.abortEarly),
|
|
8
|
+
abortPipeEarly: (n == null ? void 0 : n.abortPipeEarly) ?? (v == null ? void 0 : v.abortPipeEarly)
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
var
|
|
11
|
+
var g;
|
|
12
12
|
// @__NO_SIDE_EFFECTS__
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function D(n) {
|
|
14
|
+
return g == null ? void 0 : g.get(n);
|
|
15
15
|
}
|
|
16
|
-
var
|
|
16
|
+
var d;
|
|
17
17
|
// @__NO_SIDE_EFFECTS__
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function w(n) {
|
|
19
|
+
return d == null ? void 0 : d.get(n);
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var x;
|
|
22
22
|
// @__NO_SIDE_EFFECTS__
|
|
23
23
|
function A(n, r) {
|
|
24
|
-
|
|
24
|
+
var e;
|
|
25
|
+
return (e = x == null ? void 0 : x.get(n)) == null ? void 0 : e.get(r);
|
|
25
26
|
}
|
|
26
27
|
// @__NO_SIDE_EFFECTS__
|
|
27
|
-
function
|
|
28
|
+
function $(n) {
|
|
29
|
+
var e, t;
|
|
28
30
|
const r = typeof n;
|
|
29
|
-
return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && Object.getPrototypeOf(n)
|
|
31
|
+
return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((t = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : t.name)) ?? "null" : r;
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
+
function y(n, r, e, t, i) {
|
|
34
|
+
const a = i && "input" in i ? i.input : e.value, s = (i == null ? void 0 : i.expected) ?? n.expects ?? null, l = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ $(a), u = {
|
|
33
35
|
kind: n.kind,
|
|
34
36
|
type: n.type,
|
|
35
|
-
input:
|
|
36
|
-
expected:
|
|
37
|
-
received:
|
|
38
|
-
message: `Invalid ${r}: ${
|
|
37
|
+
input: a,
|
|
38
|
+
expected: s,
|
|
39
|
+
received: l,
|
|
40
|
+
message: `Invalid ${r}: ${s ? `Expected ${s} but r` : "R"}eceived ${l}`,
|
|
39
41
|
requirement: n.requirement,
|
|
40
|
-
path:
|
|
41
|
-
issues:
|
|
42
|
+
path: i == null ? void 0 : i.path,
|
|
43
|
+
issues: i == null ? void 0 : i.issues,
|
|
42
44
|
lang: t.lang,
|
|
43
45
|
abortEarly: t.abortEarly,
|
|
44
46
|
abortPipeEarly: t.abortPipeEarly
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
+
}, p = n.kind === "schema", c = (i == null ? void 0 : i.message) ?? n.message ?? /* @__PURE__ */ A(n.reference, u.lang) ?? (p ? /* @__PURE__ */ w(u.lang) : null) ?? t.message ?? /* @__PURE__ */ D(u.lang);
|
|
48
|
+
c !== void 0 && (u.message = typeof c == "function" ? (
|
|
47
49
|
// @ts-expect-error
|
|
48
|
-
|
|
49
|
-
) :
|
|
50
|
+
c(u)
|
|
51
|
+
) : c), p && (e.typed = !1), e.issues ? e.issues.push(u) : e.issues = [u];
|
|
50
52
|
}
|
|
51
53
|
// @__NO_SIDE_EFFECTS__
|
|
52
54
|
function f(n) {
|
|
@@ -54,12 +56,12 @@ function f(n) {
|
|
|
54
56
|
version: 1,
|
|
55
57
|
vendor: "valibot",
|
|
56
58
|
validate(r) {
|
|
57
|
-
return n["~run"]({ value: r }, /* @__PURE__ */
|
|
59
|
+
return n["~run"]({ value: r }, /* @__PURE__ */ E());
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
// @__NO_SIDE_EFFECTS__
|
|
62
|
-
function
|
|
64
|
+
function S(n, r) {
|
|
63
65
|
const e = [...new Set(n)];
|
|
64
66
|
return e.length > 1 ? `(${e.join(` ${r} `)})` : e[0] ?? "never";
|
|
65
67
|
}
|
|
@@ -74,7 +76,7 @@ function O(n, r) {
|
|
|
74
76
|
requirement: n,
|
|
75
77
|
message: r,
|
|
76
78
|
async "~run"(e, t) {
|
|
77
|
-
return e.typed && !await this.requirement(e.value) &&
|
|
79
|
+
return e.typed && !await this.requirement(e.value) && y(this, "input", e, t), e;
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
82
|
}
|
|
@@ -89,7 +91,7 @@ function I(n, r) {
|
|
|
89
91
|
requirement: n,
|
|
90
92
|
message: r,
|
|
91
93
|
"~run"(e, t) {
|
|
92
|
-
return e.typed && e.value.length > this.requirement &&
|
|
94
|
+
return e.typed && e.value.length > this.requirement && y(this, "length", e, t, {
|
|
93
95
|
received: `${e.value.length}`
|
|
94
96
|
}), e;
|
|
95
97
|
}
|
|
@@ -106,7 +108,7 @@ function q(n, r) {
|
|
|
106
108
|
requirement: n,
|
|
107
109
|
message: r,
|
|
108
110
|
"~run"(e, t) {
|
|
109
|
-
return e.typed && e.value.length < this.requirement &&
|
|
111
|
+
return e.typed && e.value.length < this.requirement && y(this, "length", e, t, {
|
|
110
112
|
received: `${e.value.length}`
|
|
111
113
|
}), e;
|
|
112
114
|
}
|
|
@@ -122,7 +124,7 @@ function M(n) {
|
|
|
122
124
|
expects: "!0",
|
|
123
125
|
message: n,
|
|
124
126
|
"~run"(r, e) {
|
|
125
|
-
return r.typed && r.value.length === 0 &&
|
|
127
|
+
return r.typed && r.value.length === 0 && y(this, "length", r, e, {
|
|
126
128
|
received: "0"
|
|
127
129
|
}), r;
|
|
128
130
|
}
|
|
@@ -151,7 +153,7 @@ function L(n, r, e) {
|
|
|
151
153
|
);
|
|
152
154
|
}
|
|
153
155
|
// @__NO_SIDE_EFFECTS__
|
|
154
|
-
function
|
|
156
|
+
function _(n, r, e) {
|
|
155
157
|
return typeof n.default == "function" ? (
|
|
156
158
|
// @ts-expect-error
|
|
157
159
|
n.default(r, e)
|
|
@@ -174,30 +176,31 @@ function N(n, r) {
|
|
|
174
176
|
return /* @__PURE__ */ f(this);
|
|
175
177
|
},
|
|
176
178
|
"~run"(e, t) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
var a;
|
|
180
|
+
const i = e.value;
|
|
181
|
+
if (Array.isArray(i)) {
|
|
179
182
|
e.typed = !0, e.value = [];
|
|
180
|
-
for (let
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
183
|
+
for (let s = 0; s < i.length; s++) {
|
|
184
|
+
const l = i[s], u = this.item["~run"]({ value: l }, t);
|
|
185
|
+
if (u.issues) {
|
|
186
|
+
const p = {
|
|
184
187
|
type: "array",
|
|
185
188
|
origin: "value",
|
|
186
|
-
input:
|
|
187
|
-
key:
|
|
188
|
-
value:
|
|
189
|
+
input: i,
|
|
190
|
+
key: s,
|
|
191
|
+
value: l
|
|
189
192
|
};
|
|
190
|
-
for (const
|
|
191
|
-
|
|
192
|
-
if (e.issues || (e.issues =
|
|
193
|
+
for (const c of u.issues)
|
|
194
|
+
c.path ? c.path.unshift(p) : c.path = [p], (a = e.issues) == null || a.push(c);
|
|
195
|
+
if (e.issues || (e.issues = u.issues), t.abortEarly) {
|
|
193
196
|
e.typed = !1;
|
|
194
197
|
break;
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
|
-
|
|
200
|
+
u.typed || (e.typed = !1), e.value.push(u.value);
|
|
198
201
|
}
|
|
199
202
|
} else
|
|
200
|
-
|
|
203
|
+
y(this, "type", e, t);
|
|
201
204
|
return e;
|
|
202
205
|
}
|
|
203
206
|
};
|
|
@@ -215,7 +218,7 @@ function C(n) {
|
|
|
215
218
|
return /* @__PURE__ */ f(this);
|
|
216
219
|
},
|
|
217
220
|
"~run"(r, e) {
|
|
218
|
-
return typeof r.value == "boolean" ? r.typed = !0 :
|
|
221
|
+
return typeof r.value == "boolean" ? r.typed = !0 : y(this, "type", r, e), r;
|
|
219
222
|
}
|
|
220
223
|
};
|
|
221
224
|
}
|
|
@@ -233,7 +236,7 @@ function F(n, r) {
|
|
|
233
236
|
return /* @__PURE__ */ f(this);
|
|
234
237
|
},
|
|
235
238
|
"~run"(e, t) {
|
|
236
|
-
return this.check(e.value) ? e.typed = !0 :
|
|
239
|
+
return this.check(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
|
|
237
240
|
}
|
|
238
241
|
};
|
|
239
242
|
}
|
|
@@ -243,7 +246,7 @@ function K(n, r) {
|
|
|
243
246
|
kind: "schema",
|
|
244
247
|
type: "literal",
|
|
245
248
|
reference: K,
|
|
246
|
-
expects: /* @__PURE__ */
|
|
249
|
+
expects: /* @__PURE__ */ $(n),
|
|
247
250
|
async: !1,
|
|
248
251
|
literal: n,
|
|
249
252
|
message: r,
|
|
@@ -251,7 +254,7 @@ function K(n, r) {
|
|
|
251
254
|
return /* @__PURE__ */ f(this);
|
|
252
255
|
},
|
|
253
256
|
"~run"(e, t) {
|
|
254
|
-
return e.value === this.literal ? e.typed = !0 :
|
|
257
|
+
return e.value === this.literal ? e.typed = !0 : y(this, "type", e, t), e;
|
|
255
258
|
}
|
|
256
259
|
};
|
|
257
260
|
}
|
|
@@ -268,7 +271,7 @@ function R(n) {
|
|
|
268
271
|
return /* @__PURE__ */ f(this);
|
|
269
272
|
},
|
|
270
273
|
"~run"(r, e) {
|
|
271
|
-
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 :
|
|
274
|
+
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : y(this, "type", r, e), r;
|
|
272
275
|
}
|
|
273
276
|
};
|
|
274
277
|
}
|
|
@@ -286,53 +289,54 @@ function V(n, r) {
|
|
|
286
289
|
return /* @__PURE__ */ f(this);
|
|
287
290
|
},
|
|
288
291
|
"~run"(e, t) {
|
|
289
|
-
|
|
290
|
-
|
|
292
|
+
var a;
|
|
293
|
+
const i = e.value;
|
|
294
|
+
if (i && typeof i == "object") {
|
|
291
295
|
e.typed = !0, e.value = {};
|
|
292
|
-
for (const
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
const
|
|
296
|
+
for (const s in this.entries) {
|
|
297
|
+
const l = this.entries[s];
|
|
298
|
+
if (s in i || (l.type === "exact_optional" || l.type === "optional" || l.type === "nullish") && // @ts-expect-error
|
|
299
|
+
l.default !== void 0) {
|
|
300
|
+
const u = s in i ? (
|
|
297
301
|
// @ts-expect-error
|
|
298
|
-
s
|
|
299
|
-
) : /* @__PURE__ */
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
+
i[s]
|
|
303
|
+
) : /* @__PURE__ */ _(l), p = l["~run"]({ value: u }, t);
|
|
304
|
+
if (p.issues) {
|
|
305
|
+
const c = {
|
|
302
306
|
type: "object",
|
|
303
307
|
origin: "value",
|
|
304
|
-
input:
|
|
305
|
-
key:
|
|
306
|
-
value:
|
|
308
|
+
input: i,
|
|
309
|
+
key: s,
|
|
310
|
+
value: u
|
|
307
311
|
};
|
|
308
|
-
for (const
|
|
309
|
-
|
|
310
|
-
if (e.issues || (e.issues =
|
|
312
|
+
for (const m of p.issues)
|
|
313
|
+
m.path ? m.path.unshift(c) : m.path = [c], (a = e.issues) == null || a.push(m);
|
|
314
|
+
if (e.issues || (e.issues = p.issues), t.abortEarly) {
|
|
311
315
|
e.typed = !1;
|
|
312
316
|
break;
|
|
313
317
|
}
|
|
314
318
|
}
|
|
315
|
-
|
|
316
|
-
} else if (
|
|
317
|
-
e.value[
|
|
318
|
-
else if (
|
|
319
|
+
p.typed || (e.typed = !1), e.value[s] = p.value;
|
|
320
|
+
} else if (l.fallback !== void 0)
|
|
321
|
+
e.value[s] = /* @__PURE__ */ L(l);
|
|
322
|
+
else if (l.type !== "exact_optional" && l.type !== "optional" && l.type !== "nullish" && (y(this, "key", e, t, {
|
|
319
323
|
input: void 0,
|
|
320
|
-
expected: `"${
|
|
324
|
+
expected: `"${s}"`,
|
|
321
325
|
path: [
|
|
322
326
|
{
|
|
323
327
|
type: "object",
|
|
324
328
|
origin: "key",
|
|
325
|
-
input:
|
|
326
|
-
key:
|
|
329
|
+
input: i,
|
|
330
|
+
key: s,
|
|
327
331
|
// @ts-expect-error
|
|
328
|
-
value: s
|
|
332
|
+
value: i[s]
|
|
329
333
|
}
|
|
330
334
|
]
|
|
331
335
|
}), t.abortEarly))
|
|
332
336
|
break;
|
|
333
337
|
}
|
|
334
338
|
} else
|
|
335
|
-
|
|
339
|
+
y(this, "type", e, t);
|
|
336
340
|
return e;
|
|
337
341
|
}
|
|
338
342
|
};
|
|
@@ -351,7 +355,7 @@ function z(n, r) {
|
|
|
351
355
|
return /* @__PURE__ */ f(this);
|
|
352
356
|
},
|
|
353
357
|
"~run"(e, t) {
|
|
354
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
358
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ _(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
355
359
|
}
|
|
356
360
|
};
|
|
357
361
|
}
|
|
@@ -361,7 +365,7 @@ function B(n, r) {
|
|
|
361
365
|
kind: "schema",
|
|
362
366
|
type: "picklist",
|
|
363
367
|
reference: B,
|
|
364
|
-
expects: /* @__PURE__ */
|
|
368
|
+
expects: /* @__PURE__ */ S(n.map($), "|"),
|
|
365
369
|
async: !1,
|
|
366
370
|
options: n,
|
|
367
371
|
message: r,
|
|
@@ -369,7 +373,7 @@ function B(n, r) {
|
|
|
369
373
|
return /* @__PURE__ */ f(this);
|
|
370
374
|
},
|
|
371
375
|
"~run"(e, t) {
|
|
372
|
-
return this.options.includes(e.value) ? e.typed = !0 :
|
|
376
|
+
return this.options.includes(e.value) ? e.typed = !0 : y(this, "type", e, t), e;
|
|
373
377
|
}
|
|
374
378
|
};
|
|
375
379
|
}
|
|
@@ -386,7 +390,7 @@ function H(n) {
|
|
|
386
390
|
return /* @__PURE__ */ f(this);
|
|
387
391
|
},
|
|
388
392
|
"~run"(r, e) {
|
|
389
|
-
return typeof r.value == "string" ? r.typed = !0 :
|
|
393
|
+
return typeof r.value == "string" ? r.typed = !0 : y(this, "type", r, e), r;
|
|
390
394
|
}
|
|
391
395
|
};
|
|
392
396
|
}
|
|
@@ -404,58 +408,58 @@ function J(n, r, e) {
|
|
|
404
408
|
get "~standard"() {
|
|
405
409
|
return /* @__PURE__ */ f(this);
|
|
406
410
|
},
|
|
407
|
-
"~run"(t,
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
let
|
|
411
|
-
const
|
|
412
|
-
for (const h of
|
|
411
|
+
"~run"(t, i) {
|
|
412
|
+
const a = t.value;
|
|
413
|
+
if (a && typeof a == "object") {
|
|
414
|
+
let s, l = 0, u = this.key, p = [];
|
|
415
|
+
const c = (m, j) => {
|
|
416
|
+
for (const h of m.options) {
|
|
413
417
|
if (h.type === "variant")
|
|
414
|
-
|
|
418
|
+
c(h, new Set(j).add(h.key));
|
|
415
419
|
else {
|
|
416
|
-
let
|
|
417
|
-
for (const
|
|
418
|
-
const
|
|
419
|
-
if (
|
|
420
|
+
let P = !0, b = 0;
|
|
421
|
+
for (const o of j) {
|
|
422
|
+
const k = h.entries[o];
|
|
423
|
+
if (o in a ? k["~run"](
|
|
420
424
|
// @ts-expect-error
|
|
421
|
-
{ typed: !1, value:
|
|
425
|
+
{ typed: !1, value: a[o] },
|
|
422
426
|
{ abortEarly: !0 }
|
|
423
|
-
).issues :
|
|
424
|
-
|
|
425
|
-
h.entries[
|
|
427
|
+
).issues : k.type !== "exact_optional" && k.type !== "optional" && k.type !== "nullish") {
|
|
428
|
+
P = !1, u !== o && (l < b || l === b && o in a && !(u in a)) && (l = b, u = o, p = []), u === o && p.push(
|
|
429
|
+
h.entries[o].expects
|
|
426
430
|
);
|
|
427
431
|
break;
|
|
428
432
|
}
|
|
429
|
-
|
|
433
|
+
b++;
|
|
430
434
|
}
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
433
|
-
(!
|
|
435
|
+
if (P) {
|
|
436
|
+
const o = h["~run"]({ value: a }, i);
|
|
437
|
+
(!s || !s.typed && o.typed) && (s = o);
|
|
434
438
|
}
|
|
435
439
|
}
|
|
436
|
-
if (
|
|
440
|
+
if (s && !s.issues)
|
|
437
441
|
break;
|
|
438
442
|
}
|
|
439
443
|
};
|
|
440
|
-
if (
|
|
441
|
-
return
|
|
442
|
-
|
|
444
|
+
if (c(this, /* @__PURE__ */ new Set([this.key])), s)
|
|
445
|
+
return s;
|
|
446
|
+
y(this, "type", t, i, {
|
|
443
447
|
// @ts-expect-error
|
|
444
|
-
input:
|
|
445
|
-
expected: /* @__PURE__ */
|
|
448
|
+
input: a[u],
|
|
449
|
+
expected: /* @__PURE__ */ S(p, "|"),
|
|
446
450
|
path: [
|
|
447
451
|
{
|
|
448
452
|
type: "object",
|
|
449
453
|
origin: "value",
|
|
450
|
-
input:
|
|
451
|
-
key:
|
|
454
|
+
input: a,
|
|
455
|
+
key: u,
|
|
452
456
|
// @ts-expect-error
|
|
453
|
-
value:
|
|
457
|
+
value: a[u]
|
|
454
458
|
}
|
|
455
459
|
]
|
|
456
460
|
});
|
|
457
461
|
} else
|
|
458
|
-
|
|
462
|
+
y(this, "type", t, i);
|
|
459
463
|
return t;
|
|
460
464
|
}
|
|
461
465
|
};
|
|
@@ -505,7 +509,7 @@ function T(...n) {
|
|
|
505
509
|
}
|
|
506
510
|
// @__NO_SIDE_EFFECTS__
|
|
507
511
|
function U(n, r, e) {
|
|
508
|
-
const t = n["~run"]({ value: r }, /* @__PURE__ */
|
|
512
|
+
const t = n["~run"]({ value: r }, /* @__PURE__ */ E(e));
|
|
509
513
|
return {
|
|
510
514
|
typed: t.typed,
|
|
511
515
|
success: !t.issues,
|
|
@@ -517,7 +521,7 @@ function U(n, r, e) {
|
|
|
517
521
|
async function W(n, r, e) {
|
|
518
522
|
const t = await n["~run"](
|
|
519
523
|
{ value: r },
|
|
520
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ E(e)
|
|
521
525
|
);
|
|
522
526
|
return {
|
|
523
527
|
typed: t.typed,
|
|
@@ -527,19 +531,19 @@ async function W(n, r, e) {
|
|
|
527
531
|
};
|
|
528
532
|
}
|
|
529
533
|
export {
|
|
530
|
-
|
|
534
|
+
y as _addIssue,
|
|
531
535
|
f as _getStandardProps,
|
|
532
|
-
|
|
533
|
-
|
|
536
|
+
S as _joinExpects,
|
|
537
|
+
$ as _stringify,
|
|
534
538
|
N as array,
|
|
535
539
|
C as boolean,
|
|
536
540
|
O as checkAsync,
|
|
537
541
|
F as custom,
|
|
538
|
-
|
|
542
|
+
_ as getDefault,
|
|
539
543
|
L as getFallback,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
544
|
+
E as getGlobalConfig,
|
|
545
|
+
D as getGlobalMessage,
|
|
546
|
+
w as getSchemaMessage,
|
|
543
547
|
A as getSpecificMessage,
|
|
544
548
|
K as literal,
|
|
545
549
|
I as maxLength,
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { QUERY_PARAMS as
|
|
3
|
-
const
|
|
4
|
-
const { get:
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = () => {
|
|
4
|
+
const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
|
|
5
5
|
return {
|
|
6
6
|
fetchRecommendationCreateData: async () => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await r("/newsletter/recommendations/create-data")).data;
|
|
9
9
|
} catch (e) {
|
|
10
10
|
throw console.error("fetchUserModalState error:", e), e;
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
fetchRecommendationFilters: async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { data: e } = await
|
|
15
|
+
const { data: e } = await r("/stripo/email-recommendation-attributes");
|
|
16
16
|
return e;
|
|
17
17
|
} catch (e) {
|
|
18
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
fetchRecommendationProducts: async (e,
|
|
21
|
+
fetchRecommendationProducts: async (e, i) => {
|
|
22
|
+
var n;
|
|
22
23
|
try {
|
|
23
|
-
const t = new URLSearchParams(Object.entries(
|
|
24
|
-
t.set(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const t = new URLSearchParams(Object.entries(i));
|
|
25
|
+
t.set(d.CLIENT_ID, m);
|
|
26
|
+
const c = decodeURIComponent(t.toString());
|
|
27
|
+
console.debug("🏁 Recommendation API Query:", c);
|
|
28
|
+
const o = await s(
|
|
29
|
+
`${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
|
|
30
|
+
);
|
|
31
|
+
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
29
32
|
} catch (t) {
|
|
30
33
|
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
31
34
|
}
|
|
@@ -33,5 +36,5 @@ const p = () => {
|
|
|
33
36
|
};
|
|
34
37
|
};
|
|
35
38
|
export {
|
|
36
|
-
|
|
39
|
+
y as useRecommendationApi
|
|
37
40
|
};
|