@rebuy/rebuy 2.29.0-rc.8 → 2.29.0
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/index.js +868 -1201
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +101 -434
- package/dist/index.mjs.map +4 -4
- package/dist/schema/checkout-and-beyond/constants.js +0 -1
- package/dist/schema/checkout-and-beyond/constants.js.map +2 -2
- package/dist/schema/checkout-and-beyond/constants.mjs +0 -1
- package/dist/schema/checkout-and-beyond/constants.mjs.map +2 -2
- package/dist/schema/checkout-and-beyond/index.js +299 -590
- package/dist/schema/checkout-and-beyond/index.js.map +4 -4
- package/dist/schema/checkout-and-beyond/index.mjs +70 -361
- package/dist/schema/checkout-and-beyond/index.mjs.map +4 -4
- package/dist/schema/metadata.d.ts +1 -1
- package/dist/schema/metadata.d.ts.map +1 -1
- package/dist/schema/product.d.ts +1 -1
- package/dist/schema/product.d.ts.map +1 -1
- package/dist/schema/shop-config.js +60 -60
- package/dist/schema/shop-config.js.map +2 -2
- package/dist/schema/shop-config.mjs +1 -1
- package/dist/schema/shop-config.mjs.map +1 -1
- package/dist/schema/shopConfig.d.ts +1 -1
- package/dist/schema/shopConfig.d.ts.map +1 -1
- package/dist/schema/user-config.js +64 -64
- package/dist/schema/user-config.js.map +3 -3
- package/dist/schema/user-config.mjs +2 -2
- package/dist/schema/user-config.mjs.map +1 -1
- package/dist/schema/userConfig.d.ts +1 -1
- package/dist/schema/userConfig.d.ts.map +1 -1
- package/dist/schema/widget-data.js +344 -604
- package/dist/schema/widget-data.js.map +4 -4
- package/dist/schema/widget-data.mjs +50 -310
- package/dist/schema/widget-data.mjs.map +4 -4
- package/dist/schema/widgetData.d.ts +5 -8
- package/dist/schema/widgetData.d.ts.map +1 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts +1 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +0 -2
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +29 -57
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +130 -148
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts +1 -13
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +1 -5
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +7 -9
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts.map +1 -1
- package/dist/schema/widgets/checkoutExtension.d.ts +1 -1
- package/dist/schema/widgets/checkoutExtension.d.ts.map +1 -1
- package/dist/schema/widgets/contentBlock.d.ts +2 -3
- package/dist/schema/widgets/contentBlock.d.ts.map +1 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts +1 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts.map +1 -1
- package/dist/schema/widgets/lineItemEditor.d.ts +2 -3
- package/dist/schema/widgets/lineItemEditor.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts +1 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +1 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +20 -20
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +12 -12
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +11 -11
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +11 -11
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts.map +1 -1
- package/dist/schema/widgets/progressBar.d.ts +1 -1
- package/dist/schema/widgets/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyButton.d.ts +2 -3
- package/dist/schema/widgets/rebuyButton.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts +1 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts.map +1 -1
- package/dist/server/dataSourceResults.d.ts.map +1 -1
- package/dist/server/index.js +385 -815
- package/dist/server/index.js.map +4 -4
- package/dist/server/index.mjs +94 -524
- package/dist/server/index.mjs.map +4 -4
- package/dist/server/widgetSettings.d.ts.map +1 -1
- package/dist/transforms/index.d.ts +0 -2
- package/dist/transforms/index.d.ts.map +1 -1
- package/dist/transforms/index.js +455 -873
- package/dist/transforms/index.js.map +4 -4
- package/dist/transforms/index.mjs +226 -644
- package/dist/transforms/index.mjs.map +4 -4
- package/dist/transforms/normalizeTokens.d.ts.map +1 -1
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -1
- package/dist/transforms/offerV1/offerCard.d.ts.map +1 -1
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts +3 -100
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +1 -1
- package/dist/transforms/offerV1/types.d.ts +2 -6
- package/dist/transforms/offerV1/types.d.ts.map +1 -1
- package/dist/transforms/parseShielded.d.ts +1 -1
- package/dist/transforms/parseShielded.d.ts.map +1 -1
- package/package.json +4 -9
- package/dist/pricing/amountToCents.d.ts +0 -10
- package/dist/pricing/amountToCents.d.ts.map +0 -1
- package/dist/pricing/computeCompareAtPrice.d.ts +0 -10
- package/dist/pricing/computeCompareAtPrice.d.ts.map +0 -1
- package/dist/pricing/computeDisplayPrice.d.ts +0 -26
- package/dist/pricing/computeDisplayPrice.d.ts.map +0 -1
- package/dist/pricing/currencyDecimals.d.ts +0 -12
- package/dist/pricing/currencyDecimals.d.ts.map +0 -1
- package/dist/pricing/index.d.ts +0 -7
- package/dist/pricing/index.d.ts.map +0 -1
- package/dist/pricing/index.js +0 -128
- package/dist/pricing/index.js.map +0 -7
- package/dist/pricing/index.mjs +0 -105
- package/dist/pricing/index.mjs.map +0 -7
- package/dist/pricing/priceVariant.d.ts +0 -10
- package/dist/pricing/priceVariant.d.ts.map +0 -1
- package/dist/pricing/types.d.ts +0 -38
- package/dist/pricing/types.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts +0 -121
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts +0 -66
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts +0 -24
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/types.d.ts +0 -44
- package/dist/transforms/progressBarV1/types.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -55,7 +55,6 @@ __export(src_exports, {
|
|
|
55
55
|
CABRule: () => CABRule,
|
|
56
56
|
CABSection: () => CABSection,
|
|
57
57
|
CABTextSection: () => CABTextSection,
|
|
58
|
-
CABTextTier: () => CABTextTier,
|
|
59
58
|
CABTracking: () => CABTracking,
|
|
60
59
|
CABVariantContent: () => CABVariantContent,
|
|
61
60
|
CABVariantsSection: () => CABVariantsSection,
|
|
@@ -71,7 +70,6 @@ __export(src_exports, {
|
|
|
71
70
|
DiscountSource: () => DiscountSource,
|
|
72
71
|
DiscountType: () => DiscountType,
|
|
73
72
|
EditorMode: () => EditorMode,
|
|
74
|
-
GIFT_LABELS: () => GIFT_LABELS,
|
|
75
73
|
Geolocation: () => Geolocation,
|
|
76
74
|
GiftWithPurchase: () => GiftWithPurchase,
|
|
77
75
|
GridItem: () => GridItem,
|
|
@@ -102,7 +100,6 @@ __export(src_exports, {
|
|
|
102
100
|
ProgressBar: () => ProgressBar,
|
|
103
101
|
ProgressTierType: () => ProgressTierType,
|
|
104
102
|
QuantityInput: () => QuantityInput,
|
|
105
|
-
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
106
103
|
RebuyButton: () => RebuyButton,
|
|
107
104
|
RebuyButtonV1: () => RebuyButtonV1,
|
|
108
105
|
RebuyClient: () => RebuyClient,
|
|
@@ -970,289 +967,289 @@ var RebuyClient = class {
|
|
|
970
967
|
};
|
|
971
968
|
|
|
972
969
|
// src/schema/metadata.ts
|
|
973
|
-
var
|
|
970
|
+
var import_zod2 = require("zod");
|
|
974
971
|
|
|
975
972
|
// src/schema/product.ts
|
|
976
|
-
var
|
|
977
|
-
var zDatetime =
|
|
978
|
-
var CacheInfo =
|
|
979
|
-
cachedAtTime:
|
|
980
|
-
cacheExpires:
|
|
981
|
-
cacheKey:
|
|
982
|
-
cacheKeyReadable:
|
|
983
|
-
cacheType:
|
|
984
|
-
loadedOptions:
|
|
985
|
-
});
|
|
986
|
-
var Category =
|
|
987
|
-
adminGraphqlApiId:
|
|
988
|
-
fullName:
|
|
989
|
-
name:
|
|
990
|
-
});
|
|
991
|
-
var Metafield =
|
|
992
|
-
key:
|
|
993
|
-
namespace:
|
|
994
|
-
type:
|
|
995
|
-
value:
|
|
996
|
-
});
|
|
997
|
-
var Image =
|
|
998
|
-
adminGraphqlApiId:
|
|
999
|
-
alt:
|
|
973
|
+
var import_zod = require("zod");
|
|
974
|
+
var zDatetime = import_zod.z.iso.datetime({ offset: true });
|
|
975
|
+
var CacheInfo = import_zod.z.object({
|
|
976
|
+
cachedAtTime: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]),
|
|
977
|
+
cacheExpires: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).optional(),
|
|
978
|
+
cacheKey: import_zod.z.string(),
|
|
979
|
+
cacheKeyReadable: import_zod.z.string(),
|
|
980
|
+
cacheType: import_zod.z.string().optional(),
|
|
981
|
+
loadedOptions: import_zod.z.record(import_zod.z.string(), import_zod.z.boolean()).optional()
|
|
982
|
+
});
|
|
983
|
+
var Category = import_zod.z.object({
|
|
984
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
985
|
+
fullName: import_zod.z.string(),
|
|
986
|
+
name: import_zod.z.string()
|
|
987
|
+
});
|
|
988
|
+
var Metafield = import_zod.z.object({
|
|
989
|
+
key: import_zod.z.string(),
|
|
990
|
+
namespace: import_zod.z.string(),
|
|
991
|
+
type: import_zod.z.string(),
|
|
992
|
+
value: import_zod.z.string()
|
|
993
|
+
});
|
|
994
|
+
var Image = import_zod.z.object({
|
|
995
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
996
|
+
alt: import_zod.z.string().nullable(),
|
|
1000
997
|
createdAt: zDatetime.optional(),
|
|
1001
|
-
height:
|
|
1002
|
-
id:
|
|
1003
|
-
metafields:
|
|
1004
|
-
position:
|
|
1005
|
-
productId:
|
|
1006
|
-
src:
|
|
998
|
+
height: import_zod.z.number(),
|
|
999
|
+
id: import_zod.z.number(),
|
|
1000
|
+
metafields: import_zod.z.array(Metafield).optional(),
|
|
1001
|
+
position: import_zod.z.number(),
|
|
1002
|
+
productId: import_zod.z.number(),
|
|
1003
|
+
src: import_zod.z.url(),
|
|
1007
1004
|
updatedAt: zDatetime.optional(),
|
|
1008
|
-
variantIds:
|
|
1009
|
-
width:
|
|
1005
|
+
variantIds: import_zod.z.array(import_zod.z.number()),
|
|
1006
|
+
width: import_zod.z.number()
|
|
1010
1007
|
});
|
|
1011
|
-
var Media =
|
|
1012
|
-
adminGraphqlApiId:
|
|
1013
|
-
alt:
|
|
1008
|
+
var Media = import_zod.z.object({
|
|
1009
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1010
|
+
alt: import_zod.z.string().nullable(),
|
|
1014
1011
|
createdAt: zDatetime,
|
|
1015
|
-
id:
|
|
1016
|
-
mediaContentType:
|
|
1017
|
-
position:
|
|
1018
|
-
previewImage:
|
|
1019
|
-
productId:
|
|
1020
|
-
status:
|
|
1012
|
+
id: import_zod.z.number(),
|
|
1013
|
+
mediaContentType: import_zod.z.string(),
|
|
1014
|
+
position: import_zod.z.number(),
|
|
1015
|
+
previewImage: import_zod.z.object({ height: import_zod.z.number(), src: import_zod.z.url(), status: import_zod.z.string(), width: import_zod.z.number() }),
|
|
1016
|
+
productId: import_zod.z.number(),
|
|
1017
|
+
status: import_zod.z.string(),
|
|
1021
1018
|
updatedAt: zDatetime,
|
|
1022
|
-
variantIds:
|
|
1023
|
-
});
|
|
1024
|
-
var Option =
|
|
1025
|
-
id:
|
|
1026
|
-
name:
|
|
1027
|
-
position:
|
|
1028
|
-
productId:
|
|
1029
|
-
values:
|
|
1030
|
-
});
|
|
1031
|
-
var PriceAdjustment =
|
|
1032
|
-
orderCount:
|
|
1033
|
-
position:
|
|
1034
|
-
value:
|
|
1035
|
-
valueType:
|
|
1036
|
-
});
|
|
1037
|
-
var Ratings =
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1019
|
+
variantIds: import_zod.z.array(import_zod.z.number())
|
|
1020
|
+
});
|
|
1021
|
+
var Option = import_zod.z.object({
|
|
1022
|
+
id: import_zod.z.number(),
|
|
1023
|
+
name: import_zod.z.string(),
|
|
1024
|
+
position: import_zod.z.number(),
|
|
1025
|
+
productId: import_zod.z.number(),
|
|
1026
|
+
values: import_zod.z.array(import_zod.z.string())
|
|
1027
|
+
});
|
|
1028
|
+
var PriceAdjustment = import_zod.z.object({
|
|
1029
|
+
orderCount: import_zod.z.number().optional(),
|
|
1030
|
+
position: import_zod.z.number(),
|
|
1031
|
+
value: import_zod.z.string(),
|
|
1032
|
+
valueType: import_zod.z.string()
|
|
1033
|
+
});
|
|
1034
|
+
var Ratings = import_zod.z.union([
|
|
1035
|
+
import_zod.z.object({ judgemeAverageStarRating: import_zod.z.number(), judgemeTotalReviews: import_zod.z.number() }),
|
|
1036
|
+
import_zod.z.object({ junipAverageStarRating: import_zod.z.number(), junipTotalReviews: import_zod.z.number() }),
|
|
1037
|
+
import_zod.z.object({ klaviyoAverageStarRating: import_zod.z.number(), klaviyoTotalReviews: import_zod.z.number() }),
|
|
1038
|
+
import_zod.z.object({ looxAverageStarRating: import_zod.z.number(), looxTotalReviews: import_zod.z.number() }),
|
|
1039
|
+
import_zod.z.object({ okendoAverageStarRating: import_zod.z.number(), okendoTotalReviews: import_zod.z.number() }),
|
|
1040
|
+
import_zod.z.object({ opinewAverageStarRating: import_zod.z.number(), opinewTotalReviews: import_zod.z.number() }),
|
|
1041
|
+
import_zod.z.object({ reviewsioAverageStarRating: import_zod.z.number(), reviewsioTotalReviews: import_zod.z.number() }),
|
|
1042
|
+
import_zod.z.object({ stampedAverageStarRating: import_zod.z.number(), stampedTotalReviews: import_zod.z.number() }),
|
|
1043
|
+
import_zod.z.object({ yotpoAverageStarRating: import_zod.z.number(), yotpoTotalReviews: import_zod.z.number() })
|
|
1047
1044
|
]);
|
|
1048
|
-
var SellingPlan =
|
|
1049
|
-
description:
|
|
1050
|
-
id:
|
|
1051
|
-
name:
|
|
1052
|
-
options:
|
|
1053
|
-
orderIntervalFrequency:
|
|
1054
|
-
orderIntervalUnitType:
|
|
1055
|
-
position:
|
|
1056
|
-
priceAdjustments:
|
|
1057
|
-
shopifyVariantId:
|
|
1058
|
-
});
|
|
1059
|
-
var SellingPlanAllocation =
|
|
1060
|
-
compareAtPrice:
|
|
1061
|
-
perDeliveryPrice:
|
|
1062
|
-
price:
|
|
1063
|
-
priceAdjustments:
|
|
1064
|
-
sellingPlanGroupId:
|
|
1065
|
-
sellingPlanId:
|
|
1066
|
-
});
|
|
1067
|
-
var SellingPlanGroup =
|
|
1068
|
-
appId:
|
|
1069
|
-
description:
|
|
1070
|
-
discountAmount:
|
|
1071
|
-
discountType:
|
|
1072
|
-
id:
|
|
1073
|
-
name:
|
|
1074
|
-
options:
|
|
1075
|
-
requiresSellingPlan:
|
|
1076
|
-
sellingPlans:
|
|
1077
|
-
variants:
|
|
1078
|
-
});
|
|
1079
|
-
var Variant =
|
|
1080
|
-
adminGraphqlApiId:
|
|
1081
|
-
barcode:
|
|
1082
|
-
compareAtPrice:
|
|
1045
|
+
var SellingPlan = import_zod.z.object({
|
|
1046
|
+
description: import_zod.z.string().optional(),
|
|
1047
|
+
id: import_zod.z.number(),
|
|
1048
|
+
name: import_zod.z.string(),
|
|
1049
|
+
options: import_zod.z.array(import_zod.z.object({ name: import_zod.z.string(), position: import_zod.z.number(), value: import_zod.z.string() })),
|
|
1050
|
+
orderIntervalFrequency: import_zod.z.string().optional(),
|
|
1051
|
+
orderIntervalUnitType: import_zod.z.string().optional(),
|
|
1052
|
+
position: import_zod.z.number().optional(),
|
|
1053
|
+
priceAdjustments: import_zod.z.array(PriceAdjustment),
|
|
1054
|
+
shopifyVariantId: import_zod.z.string().optional()
|
|
1055
|
+
});
|
|
1056
|
+
var SellingPlanAllocation = import_zod.z.object({
|
|
1057
|
+
compareAtPrice: import_zod.z.number(),
|
|
1058
|
+
perDeliveryPrice: import_zod.z.number(),
|
|
1059
|
+
price: import_zod.z.number(),
|
|
1060
|
+
priceAdjustments: import_zod.z.array(PriceAdjustment),
|
|
1061
|
+
sellingPlanGroupId: import_zod.z.string(),
|
|
1062
|
+
sellingPlanId: import_zod.z.number()
|
|
1063
|
+
});
|
|
1064
|
+
var SellingPlanGroup = import_zod.z.object({
|
|
1065
|
+
appId: import_zod.z.string().optional(),
|
|
1066
|
+
description: import_zod.z.string().optional(),
|
|
1067
|
+
discountAmount: import_zod.z.number().optional(),
|
|
1068
|
+
discountType: import_zod.z.string().optional(),
|
|
1069
|
+
id: import_zod.z.string(),
|
|
1070
|
+
name: import_zod.z.string(),
|
|
1071
|
+
options: import_zod.z.array(Option),
|
|
1072
|
+
requiresSellingPlan: import_zod.z.boolean().optional(),
|
|
1073
|
+
sellingPlans: import_zod.z.array(SellingPlan),
|
|
1074
|
+
variants: import_zod.z.array(import_zod.z.number())
|
|
1075
|
+
});
|
|
1076
|
+
var Variant = import_zod.z.object({
|
|
1077
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1078
|
+
barcode: import_zod.z.string().nullable(),
|
|
1079
|
+
compareAtPrice: import_zod.z.string().nullable(),
|
|
1083
1080
|
createdAt: zDatetime,
|
|
1084
|
-
fulfillmentService:
|
|
1085
|
-
grams:
|
|
1086
|
-
id:
|
|
1087
|
-
imageId:
|
|
1088
|
-
inventoryItemId:
|
|
1089
|
-
inventoryManagement:
|
|
1090
|
-
inventoryPolicy:
|
|
1091
|
-
inventoryQuantity:
|
|
1092
|
-
link:
|
|
1093
|
-
oldInventoryQuantity:
|
|
1094
|
-
option1:
|
|
1095
|
-
option2:
|
|
1096
|
-
option3:
|
|
1097
|
-
position:
|
|
1098
|
-
price:
|
|
1099
|
-
productId:
|
|
1100
|
-
requiresShipping:
|
|
1101
|
-
sellingPlanAllocations:
|
|
1102
|
-
sku:
|
|
1103
|
-
taxable:
|
|
1104
|
-
taxCode:
|
|
1105
|
-
title:
|
|
1081
|
+
fulfillmentService: import_zod.z.string().nullish(),
|
|
1082
|
+
grams: import_zod.z.number(),
|
|
1083
|
+
id: import_zod.z.number(),
|
|
1084
|
+
imageId: import_zod.z.number().nullable(),
|
|
1085
|
+
inventoryItemId: import_zod.z.number().optional(),
|
|
1086
|
+
inventoryManagement: import_zod.z.string().nullable(),
|
|
1087
|
+
inventoryPolicy: import_zod.z.string(),
|
|
1088
|
+
inventoryQuantity: import_zod.z.number(),
|
|
1089
|
+
link: import_zod.z.url(),
|
|
1090
|
+
oldInventoryQuantity: import_zod.z.number().optional(),
|
|
1091
|
+
option1: import_zod.z.string(),
|
|
1092
|
+
option2: import_zod.z.string().nullable(),
|
|
1093
|
+
option3: import_zod.z.string().nullable(),
|
|
1094
|
+
position: import_zod.z.number(),
|
|
1095
|
+
price: import_zod.z.string(),
|
|
1096
|
+
productId: import_zod.z.number(),
|
|
1097
|
+
requiresShipping: import_zod.z.boolean(),
|
|
1098
|
+
sellingPlanAllocations: import_zod.z.array(SellingPlanAllocation).optional(),
|
|
1099
|
+
sku: import_zod.z.string().nullable(),
|
|
1100
|
+
taxable: import_zod.z.boolean(),
|
|
1101
|
+
taxCode: import_zod.z.string().optional(),
|
|
1102
|
+
title: import_zod.z.string(),
|
|
1106
1103
|
updatedAt: zDatetime,
|
|
1107
|
-
weight:
|
|
1108
|
-
weightUnit:
|
|
1104
|
+
weight: import_zod.z.number(),
|
|
1105
|
+
weightUnit: import_zod.z.string().optional()
|
|
1109
1106
|
});
|
|
1110
|
-
var Product =
|
|
1111
|
-
adminGraphqlApiId:
|
|
1112
|
-
bodyHtml:
|
|
1107
|
+
var Product = import_zod.z.object({
|
|
1108
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1109
|
+
bodyHtml: import_zod.z.string().nullable(),
|
|
1113
1110
|
cacheInfo: CacheInfo,
|
|
1114
1111
|
category: Category.nullish(),
|
|
1115
|
-
collectionIds:
|
|
1112
|
+
collectionIds: import_zod.z.array(import_zod.z.number()),
|
|
1116
1113
|
createdAt: zDatetime,
|
|
1117
|
-
description:
|
|
1118
|
-
handle:
|
|
1119
|
-
hasVariantsThatRequiresComponents:
|
|
1120
|
-
id:
|
|
1114
|
+
description: import_zod.z.string(),
|
|
1115
|
+
handle: import_zod.z.string(),
|
|
1116
|
+
hasVariantsThatRequiresComponents: import_zod.z.boolean().optional(),
|
|
1117
|
+
id: import_zod.z.number(),
|
|
1121
1118
|
image: Image.nullable(),
|
|
1122
|
-
images:
|
|
1123
|
-
link:
|
|
1124
|
-
media:
|
|
1125
|
-
metafields:
|
|
1126
|
-
options:
|
|
1127
|
-
owner:
|
|
1128
|
-
productType:
|
|
1119
|
+
images: import_zod.z.array(Image).nullable(),
|
|
1120
|
+
link: import_zod.z.url(),
|
|
1121
|
+
media: import_zod.z.array(Media).optional(),
|
|
1122
|
+
metafields: import_zod.z.array(Metafield).optional(),
|
|
1123
|
+
options: import_zod.z.array(Option),
|
|
1124
|
+
owner: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]),
|
|
1125
|
+
productType: import_zod.z.string(),
|
|
1129
1126
|
publishedAt: zDatetime.nullable(),
|
|
1130
|
-
publishedScope:
|
|
1131
|
-
purchaseOptions:
|
|
1127
|
+
publishedScope: import_zod.z.string().optional(),
|
|
1128
|
+
purchaseOptions: import_zod.z.array(import_zod.z.object({ discountOptions: import_zod.z.array(import_zod.z.never()) })).optional(),
|
|
1132
1129
|
ratings: Ratings.optional(),
|
|
1133
|
-
selectedIndexPurchasedOption:
|
|
1130
|
+
selectedIndexPurchasedOption: import_zod.z.number().optional(),
|
|
1134
1131
|
sellingPlanAllocation: SellingPlanAllocation.optional(),
|
|
1135
|
-
sellingPlanGroups:
|
|
1136
|
-
status:
|
|
1137
|
-
tags:
|
|
1138
|
-
templateSuffix:
|
|
1139
|
-
title:
|
|
1132
|
+
sellingPlanGroups: import_zod.z.array(SellingPlanGroup).optional(),
|
|
1133
|
+
status: import_zod.z.string(),
|
|
1134
|
+
tags: import_zod.z.string(),
|
|
1135
|
+
templateSuffix: import_zod.z.string().nullable(),
|
|
1136
|
+
title: import_zod.z.string(),
|
|
1140
1137
|
updatedAt: zDatetime,
|
|
1141
|
-
variantGids:
|
|
1142
|
-
variantIds:
|
|
1143
|
-
variants:
|
|
1144
|
-
vendor:
|
|
1138
|
+
variantGids: import_zod.z.array(import_zod.z.object({ adminGraphqlApiId: import_zod.z.string(), updatedAt: zDatetime })).optional(),
|
|
1139
|
+
variantIds: import_zod.z.array(import_zod.z.object({ id: import_zod.z.number() })).optional(),
|
|
1140
|
+
variants: import_zod.z.array(Variant),
|
|
1141
|
+
vendor: import_zod.z.string()
|
|
1145
1142
|
});
|
|
1146
1143
|
|
|
1147
1144
|
// src/schema/metadata.ts
|
|
1148
|
-
var BaseRule =
|
|
1149
|
-
operator:
|
|
1150
|
-
type:
|
|
1151
|
-
value:
|
|
1145
|
+
var BaseRule = import_zod2.z.object({
|
|
1146
|
+
operator: import_zod2.z.string(),
|
|
1147
|
+
type: import_zod2.z.string(),
|
|
1148
|
+
value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()])
|
|
1152
1149
|
});
|
|
1153
1150
|
var Rule = BaseRule.extend({
|
|
1154
|
-
conditions:
|
|
1155
|
-
products:
|
|
1156
|
-
|
|
1157
|
-
productId:
|
|
1158
|
-
subRules:
|
|
1159
|
-
variantIds:
|
|
1151
|
+
conditions: import_zod2.z.array(import_zod2.z.object({ type: import_zod2.z.string(), value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]) })).optional(),
|
|
1152
|
+
products: import_zod2.z.array(
|
|
1153
|
+
import_zod2.z.object({
|
|
1154
|
+
productId: import_zod2.z.number(),
|
|
1155
|
+
subRules: import_zod2.z.object({ logic: import_zod2.z.array(import_zod2.z.object({ rules: import_zod2.z.array(BaseRule) })) }).optional(),
|
|
1156
|
+
variantIds: import_zod2.z.array(import_zod2.z.number())
|
|
1160
1157
|
})
|
|
1161
1158
|
).optional()
|
|
1162
1159
|
});
|
|
1163
|
-
var Output =
|
|
1164
|
-
channel:
|
|
1165
|
-
collectionId:
|
|
1166
|
-
collectionSort:
|
|
1167
|
-
collectionSortType:
|
|
1168
|
-
days:
|
|
1169
|
-
discount:
|
|
1170
|
-
endpoint:
|
|
1171
|
-
key:
|
|
1172
|
-
operator:
|
|
1173
|
-
productPrice:
|
|
1174
|
-
products:
|
|
1175
|
-
productWithTagsSort:
|
|
1176
|
-
trendingSort:
|
|
1177
|
-
type:
|
|
1178
|
-
value:
|
|
1179
|
-
});
|
|
1180
|
-
var MatchedRule =
|
|
1181
|
-
collapsed:
|
|
1182
|
-
exitIfMatched:
|
|
1183
|
-
index:
|
|
1184
|
-
logic:
|
|
1185
|
-
output:
|
|
1186
|
-
});
|
|
1187
|
-
var Metadata =
|
|
1160
|
+
var Output = import_zod2.z.object({
|
|
1161
|
+
channel: import_zod2.z.string().optional(),
|
|
1162
|
+
collectionId: import_zod2.z.number().optional(),
|
|
1163
|
+
collectionSort: import_zod2.z.string().optional(),
|
|
1164
|
+
collectionSortType: import_zod2.z.string().nullish(),
|
|
1165
|
+
days: import_zod2.z.string().optional(),
|
|
1166
|
+
discount: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1167
|
+
endpoint: import_zod2.z.string().optional(),
|
|
1168
|
+
key: import_zod2.z.string().optional(),
|
|
1169
|
+
operator: import_zod2.z.string().optional(),
|
|
1170
|
+
productPrice: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1171
|
+
products: import_zod2.z.array(import_zod2.z.object({ productId: import_zod2.z.number(), variantIds: import_zod2.z.array(import_zod2.z.number()) })).optional(),
|
|
1172
|
+
productWithTagsSort: import_zod2.z.string().optional(),
|
|
1173
|
+
trendingSort: import_zod2.z.string().optional(),
|
|
1174
|
+
type: import_zod2.z.string(),
|
|
1175
|
+
value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number(), import_zod2.z.boolean()]).optional()
|
|
1176
|
+
});
|
|
1177
|
+
var MatchedRule = import_zod2.z.object({
|
|
1178
|
+
collapsed: import_zod2.z.boolean().optional(),
|
|
1179
|
+
exitIfMatched: import_zod2.z.boolean(),
|
|
1180
|
+
index: import_zod2.z.number(),
|
|
1181
|
+
logic: import_zod2.z.array(import_zod2.z.object({ rules: import_zod2.z.array(Rule) })),
|
|
1182
|
+
output: import_zod2.z.array(Output)
|
|
1183
|
+
});
|
|
1184
|
+
var Metadata = import_zod2.z.object({
|
|
1188
1185
|
cacheInfo: CacheInfo.optional(),
|
|
1189
|
-
cartItems:
|
|
1190
|
-
errors:
|
|
1191
|
-
filteredInputProducts:
|
|
1192
|
-
filteredOosProducts:
|
|
1193
|
-
globalExcludedProducts:
|
|
1194
|
-
inputProducts:
|
|
1195
|
-
matchedRules:
|
|
1196
|
-
topSellersFilled:
|
|
1197
|
-
unevaluatedRules:
|
|
1198
|
-
unmatchedRules:
|
|
1199
|
-
widget:
|
|
1200
|
-
discount:
|
|
1201
|
-
language:
|
|
1186
|
+
cartItems: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1187
|
+
errors: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1188
|
+
filteredInputProducts: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1189
|
+
filteredOosProducts: import_zod2.z.array(Product).optional(),
|
|
1190
|
+
globalExcludedProducts: import_zod2.z.array(Product).optional(),
|
|
1191
|
+
inputProducts: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1192
|
+
matchedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1193
|
+
topSellersFilled: import_zod2.z.boolean().optional(),
|
|
1194
|
+
unevaluatedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1195
|
+
unmatchedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1196
|
+
widget: import_zod2.z.object({
|
|
1197
|
+
discount: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1198
|
+
language: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional()
|
|
1202
1199
|
}).optional()
|
|
1203
1200
|
});
|
|
1204
1201
|
|
|
1205
1202
|
// src/schema/shopConfig.ts
|
|
1206
|
-
var
|
|
1207
|
-
var ShopConfig =
|
|
1208
|
-
activeExperiments:
|
|
1209
|
-
|
|
1210
|
-
data:
|
|
1211
|
-
|
|
1212
|
-
aliasName:
|
|
1213
|
-
cssInput:
|
|
1214
|
-
elementId:
|
|
1215
|
-
id:
|
|
1216
|
-
javascriptInput:
|
|
1217
|
-
traffic:
|
|
1203
|
+
var import_zod3 = require("zod");
|
|
1204
|
+
var ShopConfig = import_zod3.z.object({
|
|
1205
|
+
activeExperiments: import_zod3.z.array(
|
|
1206
|
+
import_zod3.z.object({
|
|
1207
|
+
data: import_zod3.z.array(
|
|
1208
|
+
import_zod3.z.object({
|
|
1209
|
+
aliasName: import_zod3.z.string(),
|
|
1210
|
+
cssInput: import_zod3.z.string().nullish(),
|
|
1211
|
+
elementId: import_zod3.z.coerce.number(),
|
|
1212
|
+
id: import_zod3.z.coerce.number(),
|
|
1213
|
+
javascriptInput: import_zod3.z.string().nullish(),
|
|
1214
|
+
traffic: import_zod3.z.coerce.number()
|
|
1218
1215
|
})
|
|
1219
1216
|
),
|
|
1220
|
-
id:
|
|
1221
|
-
name:
|
|
1222
|
-
pageTarget:
|
|
1223
|
-
pageTargetUrl:
|
|
1224
|
-
placeholderId:
|
|
1225
|
-
type:
|
|
1217
|
+
id: import_zod3.z.coerce.number(),
|
|
1218
|
+
name: import_zod3.z.string(),
|
|
1219
|
+
pageTarget: import_zod3.z.string().nullable(),
|
|
1220
|
+
pageTargetUrl: import_zod3.z.string().nullable(),
|
|
1221
|
+
placeholderId: import_zod3.z.coerce.number().nullable(),
|
|
1222
|
+
type: import_zod3.z.string()
|
|
1226
1223
|
})
|
|
1227
1224
|
),
|
|
1228
|
-
activePackages:
|
|
1229
|
-
|
|
1230
|
-
cancelledAt:
|
|
1231
|
-
id:
|
|
1232
|
-
installedAt:
|
|
1233
|
-
isActive:
|
|
1234
|
-
isBillable:
|
|
1235
|
-
packageId:
|
|
1236
|
-
packageName:
|
|
1237
|
-
shortName:
|
|
1238
|
-
trialDays:
|
|
1239
|
-
uninstalledAt:
|
|
1225
|
+
activePackages: import_zod3.z.array(
|
|
1226
|
+
import_zod3.z.object({
|
|
1227
|
+
cancelledAt: import_zod3.z.string().nullable(),
|
|
1228
|
+
id: import_zod3.z.number(),
|
|
1229
|
+
installedAt: import_zod3.z.string().nullable(),
|
|
1230
|
+
isActive: import_zod3.z.boolean(),
|
|
1231
|
+
isBillable: import_zod3.z.boolean(),
|
|
1232
|
+
packageId: import_zod3.z.number(),
|
|
1233
|
+
packageName: import_zod3.z.string(),
|
|
1234
|
+
shortName: import_zod3.z.string(),
|
|
1235
|
+
trialDays: import_zod3.z.number(),
|
|
1236
|
+
uninstalledAt: import_zod3.z.string().nullable()
|
|
1240
1237
|
})
|
|
1241
1238
|
),
|
|
1242
|
-
apiKey:
|
|
1243
|
-
billingVersion:
|
|
1244
|
-
cacheKey:
|
|
1245
|
-
carousel:
|
|
1246
|
-
currency:
|
|
1247
|
-
currencySymbol:
|
|
1248
|
-
domain:
|
|
1249
|
-
enabledJquery:
|
|
1250
|
-
enabledPresentmentCurrencies:
|
|
1251
|
-
hasSmartCollectionsEnabled:
|
|
1252
|
-
hasSmartSearchEnabled:
|
|
1253
|
-
id:
|
|
1254
|
-
integrations:
|
|
1255
|
-
|
|
1239
|
+
apiKey: import_zod3.z.string(),
|
|
1240
|
+
billingVersion: import_zod3.z.string().nullable(),
|
|
1241
|
+
cacheKey: import_zod3.z.coerce.number(),
|
|
1242
|
+
carousel: import_zod3.z.enum(["flickity", "splide"]),
|
|
1243
|
+
currency: import_zod3.z.string(),
|
|
1244
|
+
currencySymbol: import_zod3.z.string(),
|
|
1245
|
+
domain: import_zod3.z.string(),
|
|
1246
|
+
enabledJquery: import_zod3.z.boolean(),
|
|
1247
|
+
enabledPresentmentCurrencies: import_zod3.z.array(import_zod3.z.string()),
|
|
1248
|
+
hasSmartCollectionsEnabled: import_zod3.z.boolean(),
|
|
1249
|
+
hasSmartSearchEnabled: import_zod3.z.boolean(),
|
|
1250
|
+
id: import_zod3.z.coerce.number(),
|
|
1251
|
+
integrations: import_zod3.z.record(
|
|
1252
|
+
import_zod3.z.enum([
|
|
1256
1253
|
"attentive",
|
|
1257
1254
|
"judgeme",
|
|
1258
1255
|
"junip",
|
|
@@ -1265,42 +1262,42 @@ var ShopConfig = import_v43.z.object({
|
|
|
1265
1262
|
"stamped",
|
|
1266
1263
|
"yotpo"
|
|
1267
1264
|
]),
|
|
1268
|
-
|
|
1265
|
+
import_zod3.z.union([import_zod3.z.boolean(), import_zod3.z.unknown()])
|
|
1269
1266
|
),
|
|
1270
|
-
markets:
|
|
1271
|
-
enabled:
|
|
1267
|
+
markets: import_zod3.z.object({
|
|
1268
|
+
enabled: import_zod3.z.boolean()
|
|
1272
1269
|
}),
|
|
1273
|
-
monetize:
|
|
1274
|
-
publisherKey:
|
|
1270
|
+
monetize: import_zod3.z.object({
|
|
1271
|
+
publisherKey: import_zod3.z.string().nullable()
|
|
1275
1272
|
}).nullish(),
|
|
1276
|
-
moneyFormat:
|
|
1277
|
-
myshopifyDomain:
|
|
1278
|
-
primaryLocale:
|
|
1279
|
-
productGroupsEnabled:
|
|
1280
|
-
rechargeCustomDomain:
|
|
1281
|
-
sellingPlansEnabled:
|
|
1282
|
-
shopId:
|
|
1283
|
-
shopifySellingPlansEnabled:
|
|
1284
|
-
shopName:
|
|
1285
|
-
storefrontAccessToken:
|
|
1286
|
-
useRebuyIcons:
|
|
1273
|
+
moneyFormat: import_zod3.z.string(),
|
|
1274
|
+
myshopifyDomain: import_zod3.z.string(),
|
|
1275
|
+
primaryLocale: import_zod3.z.string(),
|
|
1276
|
+
productGroupsEnabled: import_zod3.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
1277
|
+
rechargeCustomDomain: import_zod3.z.string().nullable(),
|
|
1278
|
+
sellingPlansEnabled: import_zod3.z.boolean(),
|
|
1279
|
+
shopId: import_zod3.z.number(),
|
|
1280
|
+
shopifySellingPlansEnabled: import_zod3.z.boolean(),
|
|
1281
|
+
shopName: import_zod3.z.string(),
|
|
1282
|
+
storefrontAccessToken: import_zod3.z.string().nullable(),
|
|
1283
|
+
useRebuyIcons: import_zod3.z.boolean()
|
|
1287
1284
|
});
|
|
1288
1285
|
|
|
1289
1286
|
// src/schema/userConfig.ts
|
|
1290
|
-
var
|
|
1291
|
-
var UserConfig =
|
|
1287
|
+
var import_zod4 = require("zod");
|
|
1288
|
+
var UserConfig = import_zod4.z.object({
|
|
1292
1289
|
shop: ShopConfig,
|
|
1293
|
-
smartCart:
|
|
1294
|
-
smartFlows:
|
|
1290
|
+
smartCart: import_zod4.z.unknown(),
|
|
1291
|
+
smartFlows: import_zod4.z.array(import_zod4.z.unknown())
|
|
1295
1292
|
});
|
|
1296
1293
|
|
|
1297
1294
|
// src/schema/widgetData.ts
|
|
1298
|
-
var
|
|
1295
|
+
var import_zod33 = require("zod");
|
|
1299
1296
|
|
|
1300
1297
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1301
|
-
var
|
|
1302
|
-
var ABTestingPlaceholder =
|
|
1303
|
-
type:
|
|
1298
|
+
var import_zod5 = require("zod");
|
|
1299
|
+
var ABTestingPlaceholder = import_zod5.z.looseObject({
|
|
1300
|
+
type: import_zod5.z.literal("placeholder")
|
|
1304
1301
|
});
|
|
1305
1302
|
|
|
1306
1303
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
@@ -1347,7 +1344,6 @@ var buttonFields = [
|
|
|
1347
1344
|
"payNow",
|
|
1348
1345
|
"progressReached",
|
|
1349
1346
|
"progressRemaining",
|
|
1350
|
-
"redirectToCheckout",
|
|
1351
1347
|
"removeFromOrder",
|
|
1352
1348
|
"showVariant",
|
|
1353
1349
|
"showVariants",
|
|
@@ -1536,23 +1532,23 @@ var widgetTypes = [
|
|
|
1536
1532
|
var WidgetType = freezeEnum(widgetTypes);
|
|
1537
1533
|
|
|
1538
1534
|
// src/schema/widgets/checkoutExtension.ts
|
|
1539
|
-
var
|
|
1540
|
-
var CheckoutExtension =
|
|
1541
|
-
type:
|
|
1535
|
+
var import_zod6 = require("zod");
|
|
1536
|
+
var CheckoutExtension = import_zod6.z.looseObject({
|
|
1537
|
+
type: import_zod6.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
1542
1538
|
});
|
|
1543
1539
|
|
|
1544
1540
|
// src/schema/widgets/contentBlock.ts
|
|
1545
|
-
var
|
|
1541
|
+
var import_zod27 = require("zod");
|
|
1546
1542
|
|
|
1547
1543
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1548
|
-
var
|
|
1544
|
+
var import_zod26 = require("zod");
|
|
1549
1545
|
|
|
1550
1546
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1547
|
+
var import_uuid13 = require("uuid");
|
|
1548
|
+
var import_zod25 = require("zod");
|
|
1553
1549
|
|
|
1554
1550
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1555
|
-
var
|
|
1551
|
+
var import_zod7 = require("zod");
|
|
1556
1552
|
var ruleTypes = [
|
|
1557
1553
|
"cart",
|
|
1558
1554
|
"cart_count",
|
|
@@ -1571,7 +1567,7 @@ var ruleTypes = [
|
|
|
1571
1567
|
"product_type",
|
|
1572
1568
|
"product_vendor"
|
|
1573
1569
|
];
|
|
1574
|
-
var ruleType =
|
|
1570
|
+
var ruleType = import_zod7.z.enum(ruleTypes);
|
|
1575
1571
|
var RuleType = ruleType.enum;
|
|
1576
1572
|
var ruleOperators = [
|
|
1577
1573
|
"after",
|
|
@@ -1586,65 +1582,65 @@ var ruleOperators = [
|
|
|
1586
1582
|
"greater_than",
|
|
1587
1583
|
"less_than"
|
|
1588
1584
|
];
|
|
1589
|
-
var ruleOperator =
|
|
1585
|
+
var ruleOperator = import_zod7.z.enum(ruleOperators);
|
|
1590
1586
|
var RuleOperator = ruleOperator.enum;
|
|
1591
|
-
var RuleCondition =
|
|
1592
|
-
operator:
|
|
1593
|
-
products:
|
|
1594
|
-
type:
|
|
1595
|
-
value:
|
|
1596
|
-
});
|
|
1597
|
-
var RuleLogicBlock =
|
|
1598
|
-
rules:
|
|
1599
|
-
});
|
|
1600
|
-
var CABRule =
|
|
1601
|
-
dataSourceId:
|
|
1602
|
-
enabled:
|
|
1603
|
-
ruleset:
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
exitIfMatched:
|
|
1607
|
-
logic:
|
|
1608
|
-
output:
|
|
1609
|
-
|
|
1610
|
-
key:
|
|
1611
|
-
type:
|
|
1612
|
-
value:
|
|
1587
|
+
var RuleCondition = import_zod7.z.object({
|
|
1588
|
+
operator: import_zod7.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
1589
|
+
products: import_zod7.z.union([import_zod7.z.array(import_zod7.z.unknown()), import_zod7.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1590
|
+
type: import_zod7.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1591
|
+
value: import_zod7.z.coerce.string().default("")
|
|
1592
|
+
});
|
|
1593
|
+
var RuleLogicBlock = import_zod7.z.object({
|
|
1594
|
+
rules: import_zod7.z.array(RuleCondition).default(() => [])
|
|
1595
|
+
});
|
|
1596
|
+
var CABRule = import_zod7.z.object({
|
|
1597
|
+
dataSourceId: import_zod7.z.number().nullable().default(null),
|
|
1598
|
+
enabled: import_zod7.z.boolean().default(false),
|
|
1599
|
+
ruleset: import_zod7.z.union([
|
|
1600
|
+
import_zod7.z.array(
|
|
1601
|
+
import_zod7.z.object({
|
|
1602
|
+
exitIfMatched: import_zod7.z.boolean().default(true),
|
|
1603
|
+
logic: import_zod7.z.array(RuleLogicBlock).default(() => []),
|
|
1604
|
+
output: import_zod7.z.array(
|
|
1605
|
+
import_zod7.z.object({
|
|
1606
|
+
key: import_zod7.z.string().default("should_show"),
|
|
1607
|
+
type: import_zod7.z.literal("data_json").default("data_json"),
|
|
1608
|
+
value: import_zod7.z.string().default("true")
|
|
1613
1609
|
})
|
|
1614
1610
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1615
1611
|
})
|
|
1616
1612
|
),
|
|
1617
|
-
|
|
1613
|
+
import_zod7.z.strictObject({}).transform(() => [])
|
|
1618
1614
|
]).default(() => [])
|
|
1619
1615
|
});
|
|
1620
1616
|
|
|
1621
1617
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1622
|
-
var
|
|
1618
|
+
var import_zod24 = require("zod");
|
|
1623
1619
|
|
|
1624
1620
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1625
|
-
var
|
|
1626
|
-
var CABBannerSection =
|
|
1621
|
+
var import_zod8 = require("zod");
|
|
1622
|
+
var CABBannerSection = import_zod8.z.lazy(
|
|
1627
1623
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1628
|
-
buttonField:
|
|
1629
|
-
color:
|
|
1630
|
-
dismissible:
|
|
1631
|
-
sectionType:
|
|
1624
|
+
buttonField: import_zod8.z.enum(buttonFields).optional(),
|
|
1625
|
+
color: import_zod8.z.enum(bannerColors).default("info"),
|
|
1626
|
+
dismissible: import_zod8.z.boolean().default(true),
|
|
1627
|
+
sectionType: import_zod8.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1632
1628
|
})
|
|
1633
1629
|
);
|
|
1634
1630
|
|
|
1635
1631
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1636
1632
|
var import_uuid3 = require("uuid");
|
|
1637
|
-
var
|
|
1633
|
+
var import_zod11 = require("zod");
|
|
1638
1634
|
|
|
1639
1635
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1640
1636
|
var import_uuid = require("uuid");
|
|
1641
|
-
var
|
|
1637
|
+
var import_zod9 = require("zod");
|
|
1642
1638
|
|
|
1643
1639
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
1644
1640
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
1645
1641
|
var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
|
|
1646
1642
|
var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
1647
|
-
var HTML_TAGS_REGEX = /<\/?[
|
|
1643
|
+
var HTML_TAGS_REGEX = /<\/?[^>]+>/g;
|
|
1648
1644
|
|
|
1649
1645
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1650
1646
|
var import_es_toolkit2 = require("es-toolkit");
|
|
@@ -1656,7 +1652,7 @@ var isHTML = (html = "") => {
|
|
|
1656
1652
|
const hasHTML = (nodeList) => Array.from(nodeList).some((node) => node.nodeType === 1);
|
|
1657
1653
|
return hasHTML(doc.body.childNodes) || hasHTML(doc.head.childNodes);
|
|
1658
1654
|
}
|
|
1659
|
-
return
|
|
1655
|
+
return HTML_TAGS_REGEX.test(html);
|
|
1660
1656
|
};
|
|
1661
1657
|
var hasHTMLInDoc = (doc) => doc.content.some(({ content = [] }) => content.some(({ text }) => isHTML(text)));
|
|
1662
1658
|
var checkForHTML = (input) => !((0, import_compat.isString)(input) && isHTML(input) || (0, import_es_toolkit2.isPlainObject)(input) && hasHTMLInDoc(input));
|
|
@@ -1691,90 +1687,90 @@ var convertNumericObjects = (input) => {
|
|
|
1691
1687
|
};
|
|
1692
1688
|
|
|
1693
1689
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1694
|
-
var CABImageSection =
|
|
1695
|
-
altText:
|
|
1696
|
-
aspectRatio:
|
|
1697
|
-
border:
|
|
1698
|
-
buttonField:
|
|
1699
|
-
category:
|
|
1700
|
-
name:
|
|
1701
|
-
naturalHeight:
|
|
1702
|
-
naturalWidth:
|
|
1690
|
+
var CABImageSection = import_zod9.z.object({
|
|
1691
|
+
altText: import_zod9.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1692
|
+
aspectRatio: import_zod9.z.literal(1).nullable().default(null),
|
|
1693
|
+
border: import_zod9.z.lazy(() => CABBorder),
|
|
1694
|
+
buttonField: import_zod9.z.enum(buttonFields).optional(),
|
|
1695
|
+
category: import_zod9.z.enum(["gallery", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1696
|
+
name: import_zod9.z.string().optional(),
|
|
1697
|
+
naturalHeight: import_zod9.z.number().default(0),
|
|
1698
|
+
naturalWidth: import_zod9.z.number().default(0),
|
|
1703
1699
|
/**
|
|
1704
1700
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
1705
1701
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
1706
1702
|
*/
|
|
1707
|
-
objectFit:
|
|
1703
|
+
objectFit: import_zod9.z.enum(objectFits).default(ObjectFit.contain),
|
|
1708
1704
|
rule: CABRule.optional(),
|
|
1709
|
-
sectionId:
|
|
1710
|
-
sectionType:
|
|
1711
|
-
source:
|
|
1712
|
-
width:
|
|
1705
|
+
sectionId: import_zod9.z.uuid().default(() => (0, import_uuid.v7)()),
|
|
1706
|
+
sectionType: import_zod9.z.literal(SectionType.image).default(SectionType.image),
|
|
1707
|
+
source: import_zod9.z.union([import_zod9.z.url(), import_zod9.z.literal(""), import_zod9.z.string().regex(DYNAMIC_TOKEN_REGEX)]).default(""),
|
|
1708
|
+
width: import_zod9.z.number().default(100)
|
|
1713
1709
|
});
|
|
1714
1710
|
|
|
1715
1711
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1716
1712
|
var import_compat2 = require("es-toolkit/compat");
|
|
1717
1713
|
var import_uuid2 = require("uuid");
|
|
1718
|
-
var
|
|
1719
|
-
var enumOrOmit = (...vals) =>
|
|
1720
|
-
var TiptapText =
|
|
1721
|
-
marks:
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
attrs:
|
|
1728
|
-
class:
|
|
1729
|
-
href:
|
|
1730
|
-
rel:
|
|
1731
|
-
target:
|
|
1714
|
+
var import_zod10 = require("zod");
|
|
1715
|
+
var enumOrOmit = (...vals) => import_zod10.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1716
|
+
var TiptapText = import_zod10.z.object({
|
|
1717
|
+
marks: import_zod10.z.union([
|
|
1718
|
+
import_zod10.z.array(
|
|
1719
|
+
import_zod10.z.discriminatedUnion("type", [
|
|
1720
|
+
import_zod10.z.object({ type: import_zod10.z.literal("bold") }),
|
|
1721
|
+
import_zod10.z.object({ type: import_zod10.z.literal("italic") }),
|
|
1722
|
+
import_zod10.z.object({
|
|
1723
|
+
attrs: import_zod10.z.object({
|
|
1724
|
+
class: import_zod10.z.string().nullable(),
|
|
1725
|
+
href: import_zod10.z.union([import_zod10.z.url(), import_zod10.z.literal("#"), import_zod10.z.string().regex(DYNAMIC_TOKEN_REGEX)]),
|
|
1726
|
+
rel: import_zod10.z.string().default("noopener noreferrer nofollow"),
|
|
1727
|
+
target: import_zod10.z.string().default("_blank")
|
|
1732
1728
|
}),
|
|
1733
|
-
type:
|
|
1729
|
+
type: import_zod10.z.literal("link")
|
|
1734
1730
|
}),
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
attrs:
|
|
1731
|
+
import_zod10.z.object({ type: import_zod10.z.literal("strike") }),
|
|
1732
|
+
import_zod10.z.object({
|
|
1733
|
+
attrs: import_zod10.z.object({
|
|
1738
1734
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1739
1735
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1740
1736
|
}),
|
|
1741
|
-
type:
|
|
1737
|
+
type: import_zod10.z.literal("textStyle")
|
|
1742
1738
|
})
|
|
1743
1739
|
])
|
|
1744
1740
|
),
|
|
1745
|
-
|
|
1741
|
+
import_zod10.z.strictObject({}).transform(() => [])
|
|
1746
1742
|
]).optional(),
|
|
1747
|
-
text:
|
|
1748
|
-
type:
|
|
1743
|
+
text: import_zod10.z.string().default(""),
|
|
1744
|
+
type: import_zod10.z.literal("text").default("text")
|
|
1749
1745
|
});
|
|
1750
|
-
var TiptapParagraph =
|
|
1751
|
-
attrs:
|
|
1746
|
+
var TiptapParagraph = import_zod10.z.object({
|
|
1747
|
+
attrs: import_zod10.z.object({
|
|
1752
1748
|
textAlign: enumOrOmit(...textAlignments)
|
|
1753
1749
|
}).default({ textAlign: TextAlignment.start }),
|
|
1754
|
-
content:
|
|
1755
|
-
type:
|
|
1750
|
+
content: import_zod10.z.union([import_zod10.z.array(TiptapText), import_zod10.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1751
|
+
type: import_zod10.z.literal("paragraph").default("paragraph")
|
|
1756
1752
|
});
|
|
1757
|
-
var TiptapDocument =
|
|
1758
|
-
attrs:
|
|
1753
|
+
var TiptapDocument = import_zod10.z.object({
|
|
1754
|
+
attrs: import_zod10.z.object({
|
|
1759
1755
|
blockSpacing: enumOrOmit(...spacings)
|
|
1760
1756
|
}).default({ blockSpacing: Spacing.base }),
|
|
1761
|
-
content:
|
|
1762
|
-
type:
|
|
1763
|
-
});
|
|
1764
|
-
var
|
|
1765
|
-
threshold:
|
|
1766
|
-
thresholds:
|
|
1767
|
-
tierType:
|
|
1768
|
-
});
|
|
1769
|
-
var CABTextSection =
|
|
1770
|
-
buttonField:
|
|
1771
|
-
content:
|
|
1772
|
-
name:
|
|
1773
|
-
optionId:
|
|
1757
|
+
content: import_zod10.z.union([import_zod10.z.array(TiptapParagraph), import_zod10.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
1758
|
+
type: import_zod10.z.literal("doc").default("doc")
|
|
1759
|
+
});
|
|
1760
|
+
var CABProgressTier = import_zod10.z.object({
|
|
1761
|
+
threshold: import_zod10.z.number().int().nonnegative(),
|
|
1762
|
+
thresholds: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.number().int().nonnegative()).default(() => ({})),
|
|
1763
|
+
tierType: import_zod10.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
1764
|
+
});
|
|
1765
|
+
var CABTextSection = import_zod10.z.object({
|
|
1766
|
+
buttonField: import_zod10.z.enum(buttonFields).optional(),
|
|
1767
|
+
content: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.union([import_zod10.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
1768
|
+
name: import_zod10.z.string().optional(),
|
|
1769
|
+
optionId: import_zod10.z.number().optional(),
|
|
1774
1770
|
rule: CABRule.optional(),
|
|
1775
|
-
sectionId:
|
|
1776
|
-
sectionType:
|
|
1777
|
-
tier:
|
|
1771
|
+
sectionId: import_zod10.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
1772
|
+
sectionType: import_zod10.z.literal(SectionType.text).default(SectionType.text),
|
|
1773
|
+
tier: CABProgressTier.optional()
|
|
1778
1774
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
1779
1775
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
1780
1776
|
(0, import_compat2.forEach)(content, (value, lang) => {
|
|
@@ -1795,114 +1791,112 @@ var CABTextSection = import_v410.z.object({
|
|
|
1795
1791
|
});
|
|
1796
1792
|
|
|
1797
1793
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1798
|
-
var CABButtonContent =
|
|
1799
|
-
() =>
|
|
1794
|
+
var CABButtonContent = import_zod11.z.lazy(
|
|
1795
|
+
() => import_zod11.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
1800
1796
|
);
|
|
1801
|
-
var CABButtonSection =
|
|
1802
|
-
action:
|
|
1803
|
-
buttonStyle:
|
|
1804
|
-
custom:
|
|
1805
|
-
color:
|
|
1806
|
-
height:
|
|
1807
|
-
width:
|
|
1797
|
+
var CABButtonSection = import_zod11.z.object({
|
|
1798
|
+
action: import_zod11.z.union([import_zod11.z.literal(""), import_zod11.z.enum(buttonActions)]).default(""),
|
|
1799
|
+
buttonStyle: import_zod11.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
1800
|
+
custom: import_zod11.z.object({
|
|
1801
|
+
color: import_zod11.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
1802
|
+
height: import_zod11.z.number().default(52),
|
|
1803
|
+
width: import_zod11.z.number().default(300)
|
|
1808
1804
|
}).default({
|
|
1809
1805
|
color: "#005bd3",
|
|
1810
1806
|
height: 52,
|
|
1811
1807
|
width: 300
|
|
1812
1808
|
}),
|
|
1813
|
-
disableDowngrade:
|
|
1814
|
-
name:
|
|
1815
|
-
optionId:
|
|
1816
|
-
popover:
|
|
1817
|
-
alignment:
|
|
1818
|
-
position:
|
|
1809
|
+
disableDowngrade: import_zod11.z.boolean().default(false),
|
|
1810
|
+
name: import_zod11.z.string().optional(),
|
|
1811
|
+
optionId: import_zod11.z.number().optional(),
|
|
1812
|
+
popover: import_zod11.z.object({
|
|
1813
|
+
alignment: import_zod11.z.enum(textAlignments).default(TextAlignment.center),
|
|
1814
|
+
position: import_zod11.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
1819
1815
|
}).optional().default(() => ({
|
|
1820
1816
|
alignment: TextAlignment.center,
|
|
1821
1817
|
position: PopoverPosition.blockStart
|
|
1822
1818
|
})),
|
|
1823
1819
|
rule: CABRule.optional(),
|
|
1824
|
-
sectionId:
|
|
1825
|
-
sections:
|
|
1826
|
-
sectionType:
|
|
1820
|
+
sectionId: import_zod11.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
1821
|
+
sections: import_zod11.z.union([import_zod11.z.array(CABButtonContent), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1822
|
+
sectionType: import_zod11.z.literal(SectionType.button).default(SectionType.button),
|
|
1827
1823
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
1828
|
-
trackingUrl:
|
|
1824
|
+
trackingUrl: import_zod11.z.string().optional()
|
|
1829
1825
|
});
|
|
1830
1826
|
|
|
1831
1827
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1832
|
-
var
|
|
1828
|
+
var import_zod16 = require("zod");
|
|
1833
1829
|
|
|
1834
1830
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1835
|
-
var
|
|
1831
|
+
var import_zod15 = require("zod");
|
|
1836
1832
|
|
|
1837
1833
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
1838
1834
|
var import_uuid4 = require("uuid");
|
|
1839
|
-
var
|
|
1840
|
-
var CABDiscount =
|
|
1841
|
-
amount:
|
|
1842
|
-
discountedBy:
|
|
1843
|
-
discountedFrom:
|
|
1844
|
-
type:
|
|
1845
|
-
});
|
|
1846
|
-
var CABIntegrations =
|
|
1847
|
-
judgeme:
|
|
1848
|
-
junip:
|
|
1849
|
-
klaviyo:
|
|
1850
|
-
loox:
|
|
1851
|
-
okendo:
|
|
1852
|
-
opinew:
|
|
1853
|
-
reviewsio:
|
|
1854
|
-
stamped:
|
|
1855
|
-
yotpo:
|
|
1856
|
-
});
|
|
1857
|
-
var CABDataSourceSection =
|
|
1858
|
-
dataSourceId:
|
|
1859
|
-
dataSourcePath:
|
|
1835
|
+
var import_zod12 = require("zod");
|
|
1836
|
+
var CABDiscount = import_zod12.z.object({
|
|
1837
|
+
amount: import_zod12.z.union([import_zod12.z.number(), import_zod12.z.string()]).catch(0),
|
|
1838
|
+
discountedBy: import_zod12.z.string().optional(),
|
|
1839
|
+
discountedFrom: import_zod12.z.enum(discountSources).optional().catch(void 0),
|
|
1840
|
+
type: import_zod12.z.enum(discountTypes).catch("none")
|
|
1841
|
+
});
|
|
1842
|
+
var CABIntegrations = import_zod12.z.object({
|
|
1843
|
+
judgeme: import_zod12.z.boolean().default(false),
|
|
1844
|
+
junip: import_zod12.z.boolean().default(false),
|
|
1845
|
+
klaviyo: import_zod12.z.boolean().default(false),
|
|
1846
|
+
loox: import_zod12.z.boolean().default(false),
|
|
1847
|
+
okendo: import_zod12.z.boolean().default(false),
|
|
1848
|
+
opinew: import_zod12.z.boolean().default(false),
|
|
1849
|
+
reviewsio: import_zod12.z.boolean().default(false),
|
|
1850
|
+
stamped: import_zod12.z.boolean().default(false),
|
|
1851
|
+
yotpo: import_zod12.z.boolean().default(false)
|
|
1852
|
+
});
|
|
1853
|
+
var CABDataSourceSection = import_zod12.z.object({
|
|
1854
|
+
dataSourceId: import_zod12.z.number().nullable().default(null),
|
|
1855
|
+
dataSourcePath: import_zod12.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
1860
1856
|
discount: CABDiscount.optional(),
|
|
1861
1857
|
integrations: CABIntegrations.optional(),
|
|
1862
|
-
limit:
|
|
1863
|
-
matchVariant:
|
|
1864
|
-
matchVariantOutOfStock:
|
|
1865
|
-
name:
|
|
1866
|
-
productType:
|
|
1867
|
-
sectionId:
|
|
1868
|
-
sectionType:
|
|
1869
|
-
|
|
1870
|
-
subscriptionIsDefault: import_v412.z.boolean().default(false),
|
|
1871
|
-
treatAsGwp: import_v412.z.boolean().default(false)
|
|
1858
|
+
limit: import_zod12.z.number().default(1),
|
|
1859
|
+
matchVariant: import_zod12.z.boolean().default(false),
|
|
1860
|
+
matchVariantOutOfStock: import_zod12.z.boolean().default(false),
|
|
1861
|
+
name: import_zod12.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
1862
|
+
productType: import_zod12.z.enum(productTypes).optional(),
|
|
1863
|
+
sectionId: import_zod12.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
1864
|
+
sectionType: import_zod12.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
1865
|
+
treatAsGwp: import_zod12.z.boolean().default(false)
|
|
1872
1866
|
});
|
|
1873
1867
|
|
|
1874
1868
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1875
1869
|
var import_uuid6 = require("uuid");
|
|
1876
|
-
var
|
|
1870
|
+
var import_zod14 = require("zod");
|
|
1877
1871
|
|
|
1878
1872
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
1879
1873
|
var import_uuid5 = require("uuid");
|
|
1880
|
-
var
|
|
1881
|
-
var CABVariantContent =
|
|
1882
|
-
() =>
|
|
1874
|
+
var import_zod13 = require("zod");
|
|
1875
|
+
var CABVariantContent = import_zod13.z.lazy(
|
|
1876
|
+
() => import_zod13.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
1883
1877
|
);
|
|
1884
|
-
var CABProductSection =
|
|
1885
|
-
name:
|
|
1886
|
-
productId:
|
|
1887
|
-
sectionId:
|
|
1888
|
-
sections:
|
|
1889
|
-
sectionType:
|
|
1890
|
-
selectors:
|
|
1891
|
-
variantMode:
|
|
1878
|
+
var CABProductSection = import_zod13.z.object({
|
|
1879
|
+
name: import_zod13.z.string().optional(),
|
|
1880
|
+
productId: import_zod13.z.number().nullable().default(null),
|
|
1881
|
+
sectionId: import_zod13.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
1882
|
+
sections: import_zod13.z.union([import_zod13.z.array(CABVariantContent), import_zod13.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1883
|
+
sectionType: import_zod13.z.literal(SectionType.product).default(SectionType.product),
|
|
1884
|
+
selectors: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
1885
|
+
variantMode: import_zod13.z.enum(variantModes).default(VariantMode.multiple)
|
|
1892
1886
|
});
|
|
1893
1887
|
|
|
1894
1888
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1895
|
-
var CABProductsSection =
|
|
1896
|
-
name:
|
|
1897
|
-
sectionId:
|
|
1898
|
-
sections:
|
|
1899
|
-
sectionType:
|
|
1889
|
+
var CABProductsSection = import_zod14.z.object({
|
|
1890
|
+
name: import_zod14.z.string().optional(),
|
|
1891
|
+
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
1892
|
+
sections: import_zod14.z.union([import_zod14.z.array(import_zod14.z.lazy(() => CABProductSection)), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1893
|
+
sectionType: import_zod14.z.literal(SectionType.products).default(SectionType.products)
|
|
1900
1894
|
});
|
|
1901
1895
|
|
|
1902
1896
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1903
|
-
var CABOffersSection =
|
|
1897
|
+
var CABOffersSection = import_zod15.z.lazy(
|
|
1904
1898
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1905
|
-
sections:
|
|
1899
|
+
sections: import_zod15.z.union([import_zod15.z.array(import_zod15.z.lazy(() => CABSection)), import_zod15.z.strictObject({}).transform(() => [])]).default(() => [
|
|
1906
1900
|
CABBannerSection.parse({
|
|
1907
1901
|
buttonField: "undoAddToOrder",
|
|
1908
1902
|
color: "success",
|
|
@@ -1916,263 +1910,77 @@ var CABOffersSection = import_v415.z.lazy(
|
|
|
1916
1910
|
CABDataSourceSection.parse({}),
|
|
1917
1911
|
CABProductsSection.parse({})
|
|
1918
1912
|
]),
|
|
1919
|
-
sectionType:
|
|
1913
|
+
sectionType: import_zod15.z.literal(SectionType.offers).default(SectionType.offers)
|
|
1920
1914
|
})
|
|
1921
1915
|
);
|
|
1922
1916
|
|
|
1923
1917
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1924
|
-
var CABCarouselSection =
|
|
1918
|
+
var CABCarouselSection = import_zod16.z.lazy(
|
|
1925
1919
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1926
|
-
autoAdvanceInterval:
|
|
1927
|
-
itemsAtOnce:
|
|
1928
|
-
sections:
|
|
1929
|
-
sectionType:
|
|
1920
|
+
autoAdvanceInterval: import_zod16.z.number().default(0),
|
|
1921
|
+
itemsAtOnce: import_zod16.z.number().min(1).default(1),
|
|
1922
|
+
sections: import_zod16.z.union([import_zod16.z.array(import_zod16.z.lazy(() => CABSection)), import_zod16.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
1923
|
+
sectionType: import_zod16.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
1930
1924
|
})
|
|
1931
1925
|
);
|
|
1932
1926
|
|
|
1933
1927
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
1934
|
-
var
|
|
1935
|
-
var CABCartLineSection =
|
|
1928
|
+
var import_zod17 = require("zod");
|
|
1929
|
+
var CABCartLineSection = import_zod17.z.lazy(
|
|
1936
1930
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1937
|
-
sections:
|
|
1938
|
-
sectionType:
|
|
1931
|
+
sections: import_zod17.z.union([import_zod17.z.array(import_zod17.z.lazy(() => CABSection)), import_zod17.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
1932
|
+
sectionType: import_zod17.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
1939
1933
|
})
|
|
1940
1934
|
);
|
|
1941
1935
|
|
|
1942
1936
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
1943
1937
|
var import_uuid7 = require("uuid");
|
|
1944
|
-
var
|
|
1945
|
-
var CABDiscountSection =
|
|
1946
|
-
amount:
|
|
1947
|
-
discountedBy:
|
|
1948
|
-
discountedFrom:
|
|
1949
|
-
message:
|
|
1950
|
-
name:
|
|
1951
|
-
quantity:
|
|
1952
|
-
sectionId:
|
|
1953
|
-
sectionType:
|
|
1954
|
-
type:
|
|
1938
|
+
var import_zod18 = require("zod");
|
|
1939
|
+
var CABDiscountSection = import_zod18.z.object({
|
|
1940
|
+
amount: import_zod18.z.union([import_zod18.z.number(), import_zod18.z.string()]).catch(0),
|
|
1941
|
+
discountedBy: import_zod18.z.string().optional(),
|
|
1942
|
+
discountedFrom: import_zod18.z.enum(discountSources).optional().catch(void 0),
|
|
1943
|
+
message: import_zod18.z.string().optional(),
|
|
1944
|
+
name: import_zod18.z.string().optional(),
|
|
1945
|
+
quantity: import_zod18.z.number().default(1),
|
|
1946
|
+
sectionId: import_zod18.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
1947
|
+
sectionType: import_zod18.z.literal(SectionType.discount).default(SectionType.discount),
|
|
1948
|
+
type: import_zod18.z.enum(discountTypes).catch("none")
|
|
1955
1949
|
});
|
|
1956
1950
|
|
|
1957
1951
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
1958
1952
|
var import_uuid8 = require("uuid");
|
|
1959
|
-
var
|
|
1960
|
-
var CABMonetizeSection =
|
|
1961
|
-
name:
|
|
1953
|
+
var import_zod19 = require("zod");
|
|
1954
|
+
var CABMonetizeSection = import_zod19.z.object({
|
|
1955
|
+
name: import_zod19.z.string().optional(),
|
|
1962
1956
|
rule: CABRule.optional(),
|
|
1963
|
-
sectionId:
|
|
1964
|
-
sectionType:
|
|
1957
|
+
sectionId: import_zod19.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
1958
|
+
sectionType: import_zod19.z.literal(SectionType.monetize).default(SectionType.monetize)
|
|
1965
1959
|
});
|
|
1966
1960
|
|
|
1967
1961
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
1968
|
-
var
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
es: "A\xF1adir regalo",
|
|
1979
|
-
fi: "Lis\xE4\xE4 lahja",
|
|
1980
|
-
fr: "Ajouter le cadeau",
|
|
1981
|
-
ga: "Cuir bronntanas leis",
|
|
1982
|
-
he: "\u05D4\u05D5\u05E1\u05E3 \u05DE\u05EA\u05E0\u05D4",
|
|
1983
|
-
hi: "\u0909\u092A\u0939\u093E\u0930 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
1984
|
-
id: "Tambahkan hadiah",
|
|
1985
|
-
it: "Aggiungi regalo",
|
|
1986
|
-
ja: "\u30AE\u30D5\u30C8\u3092\u8FFD\u52A0",
|
|
1987
|
-
ko: "\uC0AC\uC740\uD488 \uCD94\uAC00",
|
|
1988
|
-
nl: "Cadeau toevoegen",
|
|
1989
|
-
no: "Legg til gave",
|
|
1990
|
-
pl: "Dodaj prezent",
|
|
1991
|
-
pt: "Adicionar presente",
|
|
1992
|
-
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u043E\u0434\u0430\u0440\u043E\u043A",
|
|
1993
|
-
sv: "L\xE4gg till g\xE5va",
|
|
1994
|
-
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E02\u0E2D\u0E07\u0E02\u0E27\u0E31\u0E0D",
|
|
1995
|
-
tr: "Hediye ekle",
|
|
1996
|
-
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u043F\u043E\u0434\u0430\u0440\u0443\u043D\u043E\u043A",
|
|
1997
|
-
vi: "Th\xEAm qu\xE0 t\u1EB7ng",
|
|
1998
|
-
zh: "\u6DFB\u52A0\u8D60\u54C1"
|
|
1999
|
-
},
|
|
2000
|
-
remove: {
|
|
2001
|
-
ar: "\u0625\u0632\u0627\u0644\u0629",
|
|
2002
|
-
cs: "Odebrat",
|
|
2003
|
-
da: "Fjern",
|
|
2004
|
-
de: "Entfernen",
|
|
2005
|
-
en: "Remove",
|
|
2006
|
-
es: "Eliminar",
|
|
2007
|
-
fi: "Poista",
|
|
2008
|
-
fr: "Retirer",
|
|
2009
|
-
ga: "Bain",
|
|
2010
|
-
he: "\u05D4\u05E1\u05E8",
|
|
2011
|
-
hi: "\u0939\u091F\u093E\u090F\u0901",
|
|
2012
|
-
id: "Hapus",
|
|
2013
|
-
it: "Rimuovi",
|
|
2014
|
-
ja: "\u524A\u9664",
|
|
2015
|
-
ko: "\uC81C\uAC70",
|
|
2016
|
-
nl: "Verwijderen",
|
|
2017
|
-
no: "Fjern",
|
|
2018
|
-
pl: "Usu\u0144",
|
|
2019
|
-
pt: "Remover",
|
|
2020
|
-
ru: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
|
|
2021
|
-
sv: "Ta bort",
|
|
2022
|
-
th: "\u0E19\u0E33\u0E2D\u0E2D\u0E01",
|
|
2023
|
-
tr: "Kald\u0131r",
|
|
2024
|
-
uk: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
|
|
2025
|
-
vi: "X\xF3a",
|
|
2026
|
-
zh: "\u79FB\u9664"
|
|
2027
|
-
},
|
|
2028
|
-
selectOptions: {
|
|
2029
|
-
ar: "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",
|
|
2030
|
-
cs: "Vyberte mo\u017Enosti",
|
|
2031
|
-
da: "V\xE6lg muligheder",
|
|
2032
|
-
de: "Optionen w\xE4hlen",
|
|
2033
|
-
en: "Select Options",
|
|
2034
|
-
es: "Seleccionar opciones",
|
|
2035
|
-
fi: "Valitse vaihtoehdot",
|
|
2036
|
-
fr: "Choisir les options",
|
|
2037
|
-
ga: "Roghnaigh roghanna",
|
|
2038
|
-
he: "\u05D1\u05D7\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",
|
|
2039
|
-
hi: "\u0935\u093F\u0915\u0932\u094D\u092A \u091A\u0941\u0928\u0947\u0902",
|
|
2040
|
-
id: "Pilih opsi",
|
|
2041
|
-
it: "Seleziona le opzioni",
|
|
2042
|
-
ja: "\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E",
|
|
2043
|
-
ko: "\uC635\uC158 \uC120\uD0DD",
|
|
2044
|
-
nl: "Opties kiezen",
|
|
2045
|
-
no: "Velg alternativer",
|
|
2046
|
-
pl: "Wybierz opcje",
|
|
2047
|
-
pt: "Selecionar op\xE7\xF5es",
|
|
2048
|
-
ru: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
|
|
2049
|
-
sv: "V\xE4lj alternativ",
|
|
2050
|
-
th: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
2051
|
-
tr: "Se\xE7enekleri se\xE7",
|
|
2052
|
-
uk: "\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438",
|
|
2053
|
-
vi: "Ch\u1ECDn t\xF9y ch\u1ECDn",
|
|
2054
|
-
zh: "\u9009\u62E9\u9009\u9879"
|
|
2055
|
-
},
|
|
2056
|
-
yourGift: {
|
|
2057
|
-
ar: "\u0647\u062F\u064A\u062A\u0643",
|
|
2058
|
-
cs: "V\xE1\u0161 d\xE1rek",
|
|
2059
|
-
da: "Din gave",
|
|
2060
|
-
de: "Ihr Geschenk",
|
|
2061
|
-
en: "Your gift",
|
|
2062
|
-
es: "Tu regalo",
|
|
2063
|
-
fi: "Lahjasi",
|
|
2064
|
-
fr: "Votre cadeau",
|
|
2065
|
-
ga: "Do bhronntanas",
|
|
2066
|
-
he: "\u05D4\u05DE\u05EA\u05E0\u05D4 \u05E9\u05DC\u05DA",
|
|
2067
|
-
hi: "\u0906\u092A\u0915\u093E \u0909\u092A\u0939\u093E\u0930",
|
|
2068
|
-
id: "Hadiah Anda",
|
|
2069
|
-
it: "Il tuo regalo",
|
|
2070
|
-
ja: "\u3042\u306A\u305F\u306E\u30AE\u30D5\u30C8",
|
|
2071
|
-
ko: "\uACE0\uAC1D\uB2D8\uC758 \uC0AC\uC740\uD488",
|
|
2072
|
-
nl: "Uw cadeau",
|
|
2073
|
-
no: "Din gave",
|
|
2074
|
-
pl: "Tw\xF3j prezent",
|
|
2075
|
-
pt: "Seu presente",
|
|
2076
|
-
ru: "\u0412\u0430\u0448 \u043F\u043E\u0434\u0430\u0440\u043E\u043A",
|
|
2077
|
-
sv: "Din g\xE5va",
|
|
2078
|
-
th: "\u0E02\u0E2D\u0E07\u0E02\u0E27\u0E31\u0E0D\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
|
|
2079
|
-
tr: "Hediyeniz",
|
|
2080
|
-
uk: "\u0412\u0430\u0448 \u043F\u043E\u0434\u0430\u0440\u0443\u043D\u043E\u043A",
|
|
2081
|
-
vi: "Qu\xE0 c\u1EE7a b\u1EA1n",
|
|
2082
|
-
zh: "\u60A8\u7684\u8D60\u54C1"
|
|
2083
|
-
}
|
|
2084
|
-
};
|
|
2085
|
-
|
|
2086
|
-
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2087
|
-
var CABProgressTier = import_v420.z.object({
|
|
2088
|
-
/**
|
|
2089
|
-
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2090
|
-
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
2091
|
-
* when the tier is reached (attribution `_tier` = {@link CABProgressTier.tierId}). Absent on shipping
|
|
2092
|
-
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2093
|
-
* tree is complete.
|
|
2094
|
-
*/
|
|
2095
|
-
gift: import_v420.z.object({
|
|
2096
|
-
productId: import_v420.z.number().int().positive(),
|
|
2097
|
-
title: import_v420.z.string().optional(),
|
|
2098
|
-
variantIds: import_v420.z.array(import_v420.z.number().int().positive()).default(() => [])
|
|
2099
|
-
}).optional(),
|
|
2100
|
-
/**
|
|
2101
|
-
* The tier's goal in the SHOP's base currency, in cents. Always present — the canonical fallback:
|
|
2102
|
-
* when the buyer's presentment currency has no entry in `thresholds`, the client multiplies this by
|
|
2103
|
-
* the live FX rate. (Converter maps the v1 `unlock_price`, e.g. `75` → `7500`.)
|
|
2104
|
-
*/
|
|
2105
|
-
threshold: import_v420.z.number().int().nonnegative(),
|
|
2106
|
-
/**
|
|
2107
|
-
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2108
|
-
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2109
|
-
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2110
|
-
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2111
|
-
*/
|
|
2112
|
-
thresholds: import_v420.z.record(import_v420.z.string(), import_v420.z.number().int().nonnegative()).default(() => ({})),
|
|
2113
|
-
/**
|
|
2114
|
-
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2115
|
-
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2116
|
-
* shipping bar (single unlabeled tier, no gift).
|
|
2117
|
-
*/
|
|
2118
|
-
tierId: import_v420.z.string().optional(),
|
|
2119
|
-
tierType: import_v420.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
1962
|
+
var import_uuid9 = require("uuid");
|
|
1963
|
+
var import_zod20 = require("zod");
|
|
1964
|
+
var CABProgressBarSection = import_zod20.z.object({
|
|
1965
|
+
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
1966
|
+
countryCodes: import_zod20.z.array(import_zod20.z.string()).default(() => []),
|
|
1967
|
+
name: import_zod20.z.string().optional(),
|
|
1968
|
+
rule: CABRule.optional(),
|
|
1969
|
+
sectionId: import_zod20.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
1970
|
+
sections: import_zod20.z.union([import_zod20.z.array(CABTextSection), import_zod20.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1971
|
+
sectionType: import_zod20.z.literal(SectionType.progressBar).default(SectionType.progressBar)
|
|
2120
1972
|
});
|
|
2121
|
-
var CABProgressBarSection = import_v420.z.lazy(
|
|
2122
|
-
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2123
|
-
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2124
|
-
countryCodes: import_v420.z.array(import_v420.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2125
|
-
/**
|
|
2126
|
-
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2127
|
-
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2128
|
-
*/
|
|
2129
|
-
excludeCountryCodes: import_v420.z.array(import_v420.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2130
|
-
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2131
|
-
excludedVariantIds: import_v420.z.array(import_v420.z.number().int().positive()).default(() => []),
|
|
2132
|
-
/**
|
|
2133
|
-
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2134
|
-
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2135
|
-
*/
|
|
2136
|
-
freeShippingOnSubscription: import_v420.z.boolean().default(false),
|
|
2137
|
-
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2138
|
-
giftLabels: import_v420.z.object({
|
|
2139
|
-
addGift: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2140
|
-
remove: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2141
|
-
selectOptions: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2142
|
-
yourGift: import_v420.z.record(import_v420.z.string(), import_v420.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2143
|
-
}).default(() => ({
|
|
2144
|
-
addGift: { ...GIFT_LABELS.addGift },
|
|
2145
|
-
remove: { ...GIFT_LABELS.remove },
|
|
2146
|
-
selectOptions: { ...GIFT_LABELS.selectOptions },
|
|
2147
|
-
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2148
|
-
})),
|
|
2149
|
-
/**
|
|
2150
|
-
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2151
|
-
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2152
|
-
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2153
|
-
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2154
|
-
*/
|
|
2155
|
-
progressColor: import_v420.z.string().optional(),
|
|
2156
|
-
sectionType: import_v420.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2157
|
-
/**
|
|
2158
|
-
* The bar's milestones, in any order — the renderer sorts by resolved threshold. Drives the fill
|
|
2159
|
-
* (even slot per tier) and, for smart-cart product tiers, the gift add/remove. The visual tier
|
|
2160
|
-
* display lives in `sections` (composable), NOT here.
|
|
2161
|
-
*/
|
|
2162
|
-
tiers: import_v420.z.union([import_v420.z.array(CABProgressTier), import_v420.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
2163
|
-
})
|
|
2164
|
-
);
|
|
2165
1973
|
|
|
2166
1974
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2167
|
-
var
|
|
2168
|
-
var
|
|
2169
|
-
var CABQuantitySection =
|
|
2170
|
-
errorMessages:
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
max:
|
|
2174
|
-
min:
|
|
2175
|
-
neg:
|
|
1975
|
+
var import_uuid10 = require("uuid");
|
|
1976
|
+
var import_zod21 = require("zod");
|
|
1977
|
+
var CABQuantitySection = import_zod21.z.object({
|
|
1978
|
+
errorMessages: import_zod21.z.record(
|
|
1979
|
+
import_zod21.z.string(),
|
|
1980
|
+
import_zod21.z.object({
|
|
1981
|
+
max: import_zod21.z.string().optional(),
|
|
1982
|
+
min: import_zod21.z.string().optional(),
|
|
1983
|
+
neg: import_zod21.z.string().optional()
|
|
2176
1984
|
})
|
|
2177
1985
|
).default({
|
|
2178
1986
|
en: {
|
|
@@ -2181,124 +1989,53 @@ var CABQuantitySection = import_v421.z.object({
|
|
|
2181
1989
|
neg: "Quantity cannot be negative"
|
|
2182
1990
|
}
|
|
2183
1991
|
}),
|
|
2184
|
-
inputType:
|
|
2185
|
-
max:
|
|
2186
|
-
min:
|
|
2187
|
-
name:
|
|
1992
|
+
inputType: import_zod21.z.enum(quantityInputs).default(QuantityInput.select),
|
|
1993
|
+
max: import_zod21.z.number().min(1).max(100).default(10),
|
|
1994
|
+
min: import_zod21.z.number().min(1).default(1),
|
|
1995
|
+
name: import_zod21.z.string().optional(),
|
|
2188
1996
|
rule: CABRule.optional(),
|
|
2189
|
-
sectionId:
|
|
2190
|
-
sectionType:
|
|
1997
|
+
sectionId: import_zod21.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
1998
|
+
sectionType: import_zod21.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2191
1999
|
});
|
|
2192
2000
|
|
|
2193
2001
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2194
|
-
var
|
|
2195
|
-
var
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
one: {
|
|
2200
|
-
ar: "({{reviewCount}} \u062A\u0642\u064A\u064A\u0645)",
|
|
2201
|
-
cs: "({{reviewCount}} recenze)",
|
|
2202
|
-
da: "({{reviewCount}} anmeldelse)",
|
|
2203
|
-
de: "({{reviewCount}} Bewertung)",
|
|
2204
|
-
en: "({{reviewCount}} review)",
|
|
2205
|
-
es: "({{reviewCount}} rese\xF1a)",
|
|
2206
|
-
fi: "({{reviewCount}} arvostelu)",
|
|
2207
|
-
fr: "({{reviewCount}} avis)",
|
|
2208
|
-
ga: "({{reviewCount}} l\xE9irmheas)",
|
|
2209
|
-
he: "({{reviewCount}} \u05D1\u05D9\u05E7\u05D5\u05E8\u05EA)",
|
|
2210
|
-
hi: "({{reviewCount}} \u0938\u092E\u0940\u0915\u094D\u0937\u093E)",
|
|
2211
|
-
id: "({{reviewCount}} ulasan)",
|
|
2212
|
-
it: "({{reviewCount}} recensione)",
|
|
2213
|
-
ja: "({{reviewCount}}\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC)",
|
|
2214
|
-
ko: "({{reviewCount}}\uAC1C \uB9AC\uBDF0)",
|
|
2215
|
-
nl: "({{reviewCount}} beoordeling)",
|
|
2216
|
-
no: "({{reviewCount}} anmeldelse)",
|
|
2217
|
-
pl: "({{reviewCount}} opinia)",
|
|
2218
|
-
pt: "({{reviewCount}} avalia\xE7\xE3o)",
|
|
2219
|
-
ru: "({{reviewCount}} \u043E\u0442\u0437\u044B\u0432)",
|
|
2220
|
-
sv: "({{reviewCount}} recension)",
|
|
2221
|
-
th: "({{reviewCount}} \u0E23\u0E35\u0E27\u0E34\u0E27)",
|
|
2222
|
-
tr: "({{reviewCount}} de\u011Ferlendirme)",
|
|
2223
|
-
uk: "({{reviewCount}} \u0432\u0456\u0434\u0433\u0443\u043A)",
|
|
2224
|
-
vi: "({{reviewCount}} \u0111\xE1nh gi\xE1)",
|
|
2225
|
-
zh: "({{reviewCount}} \u6761\u8BC4\u4EF7)"
|
|
2226
|
-
},
|
|
2227
|
-
other: {
|
|
2228
|
-
ar: "({{reviewCount}} \u062A\u0642\u064A\u064A\u0645\u0627\u062A)",
|
|
2229
|
-
cs: "({{reviewCount}} recenz\xED)",
|
|
2230
|
-
da: "({{reviewCount}} anmeldelser)",
|
|
2231
|
-
de: "({{reviewCount}} Bewertungen)",
|
|
2232
|
-
en: "({{reviewCount}} reviews)",
|
|
2233
|
-
es: "({{reviewCount}} rese\xF1as)",
|
|
2234
|
-
fi: "({{reviewCount}} arvostelua)",
|
|
2235
|
-
fr: "({{reviewCount}} avis)",
|
|
2236
|
-
ga: "({{reviewCount}} l\xE9irmheasanna)",
|
|
2237
|
-
he: "({{reviewCount}} \u05D1\u05D9\u05E7\u05D5\u05E8\u05D5\u05EA)",
|
|
2238
|
-
hi: "({{reviewCount}} \u0938\u092E\u0940\u0915\u094D\u0937\u093E\u090F\u0901)",
|
|
2239
|
-
id: "({{reviewCount}} ulasan)",
|
|
2240
|
-
it: "({{reviewCount}} recensioni)",
|
|
2241
|
-
ja: "({{reviewCount}}\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC)",
|
|
2242
|
-
ko: "({{reviewCount}}\uAC1C \uB9AC\uBDF0)",
|
|
2243
|
-
nl: "({{reviewCount}} beoordelingen)",
|
|
2244
|
-
no: "({{reviewCount}} anmeldelser)",
|
|
2245
|
-
pl: "({{reviewCount}} opinii)",
|
|
2246
|
-
pt: "({{reviewCount}} avalia\xE7\xF5es)",
|
|
2247
|
-
ru: "({{reviewCount}} \u043E\u0442\u0437\u044B\u0432\u043E\u0432)",
|
|
2248
|
-
sv: "({{reviewCount}} recensioner)",
|
|
2249
|
-
th: "({{reviewCount}} \u0E23\u0E35\u0E27\u0E34\u0E27)",
|
|
2250
|
-
tr: "({{reviewCount}} de\u011Ferlendirme)",
|
|
2251
|
-
uk: "({{reviewCount}} \u0432\u0456\u0434\u0433\u0443\u043A\u0456\u0432)",
|
|
2252
|
-
vi: "({{reviewCount}} \u0111\xE1nh gi\xE1)",
|
|
2253
|
-
zh: "({{reviewCount}} \u6761\u8BC4\u4EF7)"
|
|
2254
|
-
}
|
|
2255
|
-
};
|
|
2256
|
-
|
|
2257
|
-
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2258
|
-
var CABReviewsSection = import_v422.z.object({
|
|
2259
|
-
color: import_v422.z.string().default("#fadb14"),
|
|
2260
|
-
/**
|
|
2261
|
-
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2262
|
-
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2263
|
-
* or merchant work.
|
|
2264
|
-
*/
|
|
2265
|
-
countLabels: import_v422.z.object({
|
|
2266
|
-
one: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2267
|
-
other: import_v422.z.record(import_v422.z.string(), import_v422.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2268
|
-
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2269
|
-
name: import_v422.z.string().optional(),
|
|
2002
|
+
var import_uuid11 = require("uuid");
|
|
2003
|
+
var import_zod22 = require("zod");
|
|
2004
|
+
var CABReviewsSection = import_zod22.z.object({
|
|
2005
|
+
color: import_zod22.z.string().default("#fadb14"),
|
|
2006
|
+
name: import_zod22.z.string().optional(),
|
|
2270
2007
|
rule: CABRule.optional(),
|
|
2271
|
-
sectionId:
|
|
2272
|
-
sectionType:
|
|
2273
|
-
size:
|
|
2008
|
+
sectionId: import_zod22.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
2009
|
+
sectionType: import_zod22.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2010
|
+
size: import_zod22.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2274
2011
|
});
|
|
2275
2012
|
|
|
2276
2013
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2277
2014
|
var import_compat3 = require("es-toolkit/compat");
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
2280
|
-
var CABVariantsSection =
|
|
2281
|
-
hideOutOfStockVariants:
|
|
2282
|
-
name:
|
|
2015
|
+
var import_uuid12 = require("uuid");
|
|
2016
|
+
var import_zod23 = require("zod");
|
|
2017
|
+
var CABVariantsSection = import_zod23.z.object({
|
|
2018
|
+
hideOutOfStockVariants: import_zod23.z.boolean().default(false),
|
|
2019
|
+
name: import_zod23.z.string().optional(),
|
|
2283
2020
|
rule: CABRule.optional(),
|
|
2284
|
-
sectionId:
|
|
2285
|
-
sectionType:
|
|
2286
|
-
selector:
|
|
2287
|
-
variantMode:
|
|
2021
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
2022
|
+
sectionType: import_zod23.z.literal(SectionType.variants).default(SectionType.variants),
|
|
2023
|
+
selector: import_zod23.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2024
|
+
variantMode: import_zod23.z.enum(variantModes).default(VariantMode.multiple)
|
|
2288
2025
|
});
|
|
2289
2026
|
|
|
2290
2027
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2291
|
-
var CABBorder =
|
|
2292
|
-
radius:
|
|
2293
|
-
style:
|
|
2294
|
-
width:
|
|
2028
|
+
var CABBorder = import_zod24.z.object({
|
|
2029
|
+
radius: import_zod24.z.enum(borderRadii).default(BorderRadius.base),
|
|
2030
|
+
style: import_zod24.z.enum(borderStyles).default(BorderStyle.none),
|
|
2031
|
+
width: import_zod24.z.enum(borderWidths).default(BorderWidth.base)
|
|
2295
2032
|
}).default({
|
|
2296
2033
|
radius: BorderRadius.base,
|
|
2297
2034
|
style: BorderStyle.none,
|
|
2298
2035
|
width: BorderWidth.base
|
|
2299
2036
|
});
|
|
2300
|
-
var CABSection =
|
|
2301
|
-
() =>
|
|
2037
|
+
var CABSection = import_zod24.z.lazy(
|
|
2038
|
+
() => import_zod24.z.discriminatedUnion("sectionType", [
|
|
2302
2039
|
CABBannerSection,
|
|
2303
2040
|
CABButtonSection,
|
|
2304
2041
|
CABCarouselSection,
|
|
@@ -2320,155 +2057,155 @@ var CABSection = import_v424.z.lazy(
|
|
|
2320
2057
|
);
|
|
2321
2058
|
|
|
2322
2059
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2323
|
-
var GridItem =
|
|
2324
|
-
var CABLayoutSection =
|
|
2325
|
-
alignment:
|
|
2326
|
-
horizontal:
|
|
2327
|
-
vertical:
|
|
2060
|
+
var GridItem = import_zod25.z.union([import_zod25.z.literal("auto"), import_zod25.z.literal("fill"), import_zod25.z.string().regex(/^\d+%$/), import_zod25.z.number()]);
|
|
2061
|
+
var CABLayoutSection = import_zod25.z.object({
|
|
2062
|
+
alignment: import_zod25.z.object({
|
|
2063
|
+
horizontal: import_zod25.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2064
|
+
vertical: import_zod25.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2328
2065
|
}).default({
|
|
2329
2066
|
horizontal: HorizontalAlignment.start,
|
|
2330
2067
|
vertical: VerticalAlignment.top
|
|
2331
2068
|
}),
|
|
2332
|
-
border:
|
|
2333
|
-
buttonField:
|
|
2334
|
-
direction:
|
|
2335
|
-
grid:
|
|
2336
|
-
columns:
|
|
2337
|
-
rows:
|
|
2069
|
+
border: import_zod25.z.lazy(() => CABBorder),
|
|
2070
|
+
buttonField: import_zod25.z.enum(buttonFields).optional(),
|
|
2071
|
+
direction: import_zod25.z.enum(directions).default(Direction.rows),
|
|
2072
|
+
grid: import_zod25.z.object({
|
|
2073
|
+
columns: import_zod25.z.union([import_zod25.z.array(GridItem), import_zod25.z.undefined()]).default(() => ["auto"]),
|
|
2074
|
+
rows: import_zod25.z.union([import_zod25.z.array(GridItem), import_zod25.z.undefined()]).default(() => ["auto"])
|
|
2338
2075
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2339
|
-
name:
|
|
2340
|
-
padding:
|
|
2076
|
+
name: import_zod25.z.string().optional(),
|
|
2077
|
+
padding: import_zod25.z.enum(spacings).default(Spacing.none),
|
|
2341
2078
|
rule: CABRule.optional(),
|
|
2342
|
-
sectionId:
|
|
2343
|
-
sections:
|
|
2344
|
-
sectionType:
|
|
2345
|
-
spacing:
|
|
2079
|
+
sectionId: import_zod25.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
2080
|
+
sections: import_zod25.z.union([import_zod25.z.array(import_zod25.z.lazy(() => CABSection)), import_zod25.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2081
|
+
sectionType: import_zod25.z.literal(SectionType.layout).default(SectionType.layout),
|
|
2082
|
+
spacing: import_zod25.z.enum(spacings).default(Spacing.base),
|
|
2346
2083
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2347
|
-
viewUrl:
|
|
2348
|
-
width:
|
|
2084
|
+
viewUrl: import_zod25.z.string().optional(),
|
|
2085
|
+
width: import_zod25.z.number().default(100)
|
|
2349
2086
|
});
|
|
2350
2087
|
|
|
2351
2088
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2352
|
-
var TargetArea =
|
|
2353
|
-
fill:
|
|
2354
|
-
flip:
|
|
2355
|
-
icon:
|
|
2356
|
-
label:
|
|
2357
|
-
width:
|
|
2089
|
+
var TargetArea = import_zod26.z.object({
|
|
2090
|
+
fill: import_zod26.z.boolean().optional(),
|
|
2091
|
+
flip: import_zod26.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
2092
|
+
icon: import_zod26.z.string(),
|
|
2093
|
+
label: import_zod26.z.string(),
|
|
2094
|
+
width: import_zod26.z.string()
|
|
2358
2095
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2359
|
-
var CABTracking =
|
|
2360
|
-
enableAttribution:
|
|
2361
|
-
enableSource:
|
|
2362
|
-
enableWidget:
|
|
2096
|
+
var CABTracking = import_zod26.z.object({
|
|
2097
|
+
enableAttribution: import_zod26.z.boolean().default(true),
|
|
2098
|
+
enableSource: import_zod26.z.boolean().default(true),
|
|
2099
|
+
enableWidget: import_zod26.z.boolean().default(true)
|
|
2363
2100
|
}).default({ enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2364
2101
|
var CABRootSection = CABLayoutSection.extend({
|
|
2365
|
-
editorMode:
|
|
2366
|
-
previewMode:
|
|
2367
|
-
storeId:
|
|
2102
|
+
editorMode: import_zod26.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2103
|
+
previewMode: import_zod26.z.boolean().default(false),
|
|
2104
|
+
storeId: import_zod26.z.number().nullable().default(null),
|
|
2368
2105
|
targetArea: TargetArea.nullable(),
|
|
2369
2106
|
tracking: CABTracking,
|
|
2370
|
-
type:
|
|
2371
|
-
version:
|
|
2372
|
-
widgetId:
|
|
2107
|
+
type: import_zod26.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2108
|
+
version: import_zod26.z.literal(2).default(2),
|
|
2109
|
+
widgetId: import_zod26.z.number().nullable().default(null)
|
|
2373
2110
|
});
|
|
2374
2111
|
|
|
2375
2112
|
// src/schema/widgets/contentBlock.ts
|
|
2376
|
-
var ContentBlockV1 =
|
|
2377
|
-
blockSpacing:
|
|
2378
|
-
imageBlocks:
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
altText:
|
|
2382
|
-
description:
|
|
2383
|
-
id:
|
|
2384
|
-
imagePlacement:
|
|
2385
|
-
imageSize:
|
|
2386
|
-
imageUrl:
|
|
2387
|
-
textAlignment:
|
|
2388
|
-
textSize:
|
|
2113
|
+
var ContentBlockV1 = import_zod27.z.object({
|
|
2114
|
+
blockSpacing: import_zod27.z.enum(spacings).optional(),
|
|
2115
|
+
imageBlocks: import_zod27.z.union([
|
|
2116
|
+
import_zod27.z.array(
|
|
2117
|
+
import_zod27.z.object({
|
|
2118
|
+
altText: import_zod27.z.string().nullable(),
|
|
2119
|
+
description: import_zod27.z.string().nullable(),
|
|
2120
|
+
id: import_zod27.z.uuid(),
|
|
2121
|
+
imagePlacement: import_zod27.z.enum(["top", "right", "bottom", "left"]),
|
|
2122
|
+
imageSize: import_zod27.z.number(),
|
|
2123
|
+
imageUrl: import_zod27.z.url(),
|
|
2124
|
+
textAlignment: import_zod27.z.enum(["left", "center", "right"]),
|
|
2125
|
+
textSize: import_zod27.z.enum(textSizeNames)
|
|
2389
2126
|
})
|
|
2390
2127
|
),
|
|
2391
|
-
|
|
2128
|
+
import_zod27.z.strictObject({}).transform(() => [])
|
|
2392
2129
|
]).optional(),
|
|
2393
|
-
imageLayout:
|
|
2394
|
-
language:
|
|
2395
|
-
description:
|
|
2396
|
-
superTitle:
|
|
2397
|
-
title:
|
|
2130
|
+
imageLayout: import_zod27.z.enum(["row", "column"]).optional(),
|
|
2131
|
+
language: import_zod27.z.object({
|
|
2132
|
+
description: import_zod27.z.string(),
|
|
2133
|
+
superTitle: import_zod27.z.string(),
|
|
2134
|
+
title: import_zod27.z.string()
|
|
2398
2135
|
}),
|
|
2399
|
-
previewMode:
|
|
2400
|
-
type:
|
|
2401
|
-
version:
|
|
2136
|
+
previewMode: import_zod27.z.boolean(),
|
|
2137
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
2138
|
+
version: import_zod27.z.literal(1)
|
|
2402
2139
|
});
|
|
2403
|
-
var ContentBlock =
|
|
2140
|
+
var ContentBlock = import_zod27.z.discriminatedUnion("version", [
|
|
2404
2141
|
ContentBlockV1,
|
|
2405
2142
|
CABRootSection.extend({
|
|
2406
|
-
type:
|
|
2143
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2407
2144
|
})
|
|
2408
2145
|
]);
|
|
2409
2146
|
|
|
2410
2147
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2411
|
-
var
|
|
2412
|
-
var GiftWithPurchase =
|
|
2413
|
-
type:
|
|
2148
|
+
var import_zod28 = require("zod");
|
|
2149
|
+
var GiftWithPurchase = import_zod28.z.looseObject({
|
|
2150
|
+
type: import_zod28.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2414
2151
|
});
|
|
2415
2152
|
|
|
2416
2153
|
// src/schema/widgets/lineItemEditor.ts
|
|
2417
|
-
var
|
|
2418
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2419
|
-
downgradeToOneTimeLabel:
|
|
2154
|
+
var import_zod29 = require("zod");
|
|
2155
|
+
var LineItemEditorSwitchLanguageV1 = import_zod29.z.object({
|
|
2156
|
+
downgradeToOneTimeLabel: import_zod29.z.string().optional(),
|
|
2420
2157
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2421
|
-
subscriptionOptionLabel:
|
|
2422
|
-
upgradeToSubscriptionLabel:
|
|
2423
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
2158
|
+
subscriptionOptionLabel: import_zod29.z.string().optional(),
|
|
2159
|
+
upgradeToSubscriptionLabel: import_zod29.z.string().optional(),
|
|
2160
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod29.z.string().optional()
|
|
2424
2161
|
});
|
|
2425
|
-
var LineItemEditorV1 =
|
|
2162
|
+
var LineItemEditorV1 = import_zod29.z.object({
|
|
2426
2163
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2427
|
-
button:
|
|
2428
|
-
previewMode:
|
|
2429
|
-
switchToSubscription:
|
|
2430
|
-
disableDowngrade:
|
|
2164
|
+
button: import_zod29.z.object({ kind: import_zod29.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
2165
|
+
previewMode: import_zod29.z.boolean().optional(),
|
|
2166
|
+
switchToSubscription: import_zod29.z.object({
|
|
2167
|
+
disableDowngrade: import_zod29.z.boolean().optional(),
|
|
2431
2168
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2432
2169
|
}).optional(),
|
|
2433
|
-
switchToSubscriptionEnabled:
|
|
2434
|
-
tracking:
|
|
2435
|
-
enableAttribution:
|
|
2436
|
-
enableSource:
|
|
2437
|
-
enableWidget:
|
|
2170
|
+
switchToSubscriptionEnabled: import_zod29.z.boolean().optional(),
|
|
2171
|
+
tracking: import_zod29.z.object({
|
|
2172
|
+
enableAttribution: import_zod29.z.boolean().optional(),
|
|
2173
|
+
enableSource: import_zod29.z.boolean().optional(),
|
|
2174
|
+
enableWidget: import_zod29.z.boolean().optional()
|
|
2438
2175
|
}).optional(),
|
|
2439
|
-
type:
|
|
2440
|
-
version:
|
|
2176
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
2177
|
+
version: import_zod29.z.literal(1)
|
|
2441
2178
|
});
|
|
2442
|
-
var LineItemEditor =
|
|
2179
|
+
var LineItemEditor = import_zod29.z.discriminatedUnion("version", [
|
|
2443
2180
|
LineItemEditorV1,
|
|
2444
2181
|
CABRootSection.extend({
|
|
2445
|
-
type:
|
|
2182
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
2446
2183
|
})
|
|
2447
2184
|
]);
|
|
2448
2185
|
|
|
2449
2186
|
// src/schema/widgets/progressBar.ts
|
|
2450
|
-
var
|
|
2451
|
-
var ProgressBar =
|
|
2452
|
-
type:
|
|
2187
|
+
var import_zod30 = require("zod");
|
|
2188
|
+
var ProgressBar = import_zod30.z.looseObject({
|
|
2189
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
2453
2190
|
});
|
|
2454
2191
|
|
|
2455
2192
|
// src/schema/widgets/rebuyButton.ts
|
|
2456
|
-
var
|
|
2457
|
-
var RebuyButtonV1 =
|
|
2458
|
-
type:
|
|
2459
|
-
version:
|
|
2193
|
+
var import_zod31 = require("zod");
|
|
2194
|
+
var RebuyButtonV1 = import_zod31.z.looseObject({
|
|
2195
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
2196
|
+
version: import_zod31.z.literal(1)
|
|
2460
2197
|
});
|
|
2461
|
-
var RebuyButton =
|
|
2198
|
+
var RebuyButton = import_zod31.z.discriminatedUnion("version", [
|
|
2462
2199
|
RebuyButtonV1,
|
|
2463
2200
|
CABRootSection.extend({
|
|
2464
|
-
type:
|
|
2201
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
2465
2202
|
})
|
|
2466
2203
|
]);
|
|
2467
2204
|
|
|
2468
2205
|
// src/schema/widgets/rebuyMonetize.ts
|
|
2469
|
-
var
|
|
2470
|
-
var RebuyMonetize =
|
|
2471
|
-
type:
|
|
2206
|
+
var import_zod32 = require("zod");
|
|
2207
|
+
var RebuyMonetize = import_zod32.z.looseObject({
|
|
2208
|
+
type: import_zod32.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
2472
2209
|
});
|
|
2473
2210
|
|
|
2474
2211
|
// src/schema/widgetData.ts
|
|
@@ -2482,7 +2219,7 @@ var extensionWidgetTypes = [
|
|
|
2482
2219
|
WidgetType.ui_extension_line_item_editor,
|
|
2483
2220
|
WidgetType.ui_extension_progress_bar
|
|
2484
2221
|
];
|
|
2485
|
-
var WidgetData =
|
|
2222
|
+
var WidgetData = import_zod33.z.discriminatedUnion("type", [
|
|
2486
2223
|
ABTestingPlaceholder,
|
|
2487
2224
|
CheckoutExtension,
|
|
2488
2225
|
ContentBlock,
|
|
@@ -2495,6 +2232,34 @@ var WidgetData = import_v433.z.discriminatedUnion("type", [
|
|
|
2495
2232
|
|
|
2496
2233
|
// src/schema/widgets/checkout-and-beyond/offerLabels.ts
|
|
2497
2234
|
var OFFER_LABELS = {
|
|
2235
|
+
addToCart: {
|
|
2236
|
+
ar: "\u0623\u0636\u0641 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
2237
|
+
cs: "P\u0159idat do ko\u0161\xEDku",
|
|
2238
|
+
da: "L\xE6g i kurv",
|
|
2239
|
+
de: "In den Warenkorb",
|
|
2240
|
+
en: "Add to cart",
|
|
2241
|
+
es: "A\xF1adir al carrito",
|
|
2242
|
+
fi: "Lis\xE4\xE4 ostoskoriin",
|
|
2243
|
+
fr: "Ajouter au panier",
|
|
2244
|
+
ga: "Cuir sa chairt",
|
|
2245
|
+
he: "\u05D4\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
2246
|
+
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
2247
|
+
id: "Tambahkan ke keranjang",
|
|
2248
|
+
it: "Aggiungi al carrello",
|
|
2249
|
+
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0",
|
|
2250
|
+
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00",
|
|
2251
|
+
nl: "In winkelwagen",
|
|
2252
|
+
no: "Legg i handlekurven",
|
|
2253
|
+
pl: "Dodaj do koszyka",
|
|
2254
|
+
pt: "Adicionar ao carrinho",
|
|
2255
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
2256
|
+
sv: "L\xE4gg i varukorgen",
|
|
2257
|
+
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E15\u0E30\u0E01\u0E23\u0E49\u0E32",
|
|
2258
|
+
tr: "Sepete ekle",
|
|
2259
|
+
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0432 \u043A\u043E\u0448\u0438\u043A",
|
|
2260
|
+
vi: "Th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
2261
|
+
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2262
|
+
},
|
|
2498
2263
|
addedToCart: {
|
|
2499
2264
|
ar: "\u062A\u0645\u062A \u0627\u0644\u0625\u0636\u0627\u0641\u0629!",
|
|
2500
2265
|
cs: "P\u0159id\xE1no!",
|
|
@@ -2528,7 +2293,7 @@ var OFFER_LABELS = {
|
|
|
2528
2293
|
cs: "{{quantity}} {{productTitle}} p\u0159id\xE1no do ko\u0161\xEDku.",
|
|
2529
2294
|
da: "{{quantity}} {{productTitle}} lagt i kurven.",
|
|
2530
2295
|
de: "{{quantity}} {{productTitle}} zum Warenkorb hinzugef\xFCgt.",
|
|
2531
|
-
en: "{{quantity}} {{productTitle}}
|
|
2296
|
+
en: "{{quantity}} {{productTitle}} added to cart.",
|
|
2532
2297
|
es: "{{quantity}} {{productTitle}} a\xF1adido al carrito.",
|
|
2533
2298
|
fi: "{{quantity}} {{productTitle}} lis\xE4tty ostoskoriin.",
|
|
2534
2299
|
fr: "{{quantity}} {{productTitle}} ajout\xE9 au panier.",
|
|
@@ -2579,62 +2344,6 @@ var OFFER_LABELS = {
|
|
|
2579
2344
|
vi: "\u0110ang th\xEAm...",
|
|
2580
2345
|
zh: "\u6B63\u5728\u6DFB\u52A0..."
|
|
2581
2346
|
},
|
|
2582
|
-
addToCart: {
|
|
2583
|
-
ar: "\u0623\u0636\u0641 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
2584
|
-
cs: "P\u0159idat do ko\u0161\xEDku",
|
|
2585
|
-
da: "L\xE6g i kurv",
|
|
2586
|
-
de: "In den Warenkorb",
|
|
2587
|
-
en: "Add to cart",
|
|
2588
|
-
es: "A\xF1adir al carrito",
|
|
2589
|
-
fi: "Lis\xE4\xE4 ostoskoriin",
|
|
2590
|
-
fr: "Ajouter au panier",
|
|
2591
|
-
ga: "Cuir sa chairt",
|
|
2592
|
-
he: "\u05D4\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
2593
|
-
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
2594
|
-
id: "Tambahkan ke keranjang",
|
|
2595
|
-
it: "Aggiungi al carrello",
|
|
2596
|
-
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0",
|
|
2597
|
-
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00",
|
|
2598
|
-
nl: "In winkelwagen",
|
|
2599
|
-
no: "Legg i handlekurven",
|
|
2600
|
-
pl: "Dodaj do koszyka",
|
|
2601
|
-
pt: "Adicionar ao carrinho",
|
|
2602
|
-
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
2603
|
-
sv: "L\xE4gg i varukorgen",
|
|
2604
|
-
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E15\u0E30\u0E01\u0E23\u0E49\u0E32",
|
|
2605
|
-
tr: "Sepete ekle",
|
|
2606
|
-
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0432 \u043A\u043E\u0448\u0438\u043A",
|
|
2607
|
-
vi: "Th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
2608
|
-
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2609
|
-
},
|
|
2610
|
-
redirectToCheckout: {
|
|
2611
|
-
ar: "\u0627\u0644\u062F\u0641\u0639",
|
|
2612
|
-
cs: "Pokladna",
|
|
2613
|
-
da: "Til kassen",
|
|
2614
|
-
de: "Zur Kasse",
|
|
2615
|
-
en: "Checkout",
|
|
2616
|
-
es: "Finalizar compra",
|
|
2617
|
-
fi: "Kassalle",
|
|
2618
|
-
fr: "Paiement",
|
|
2619
|
-
ga: "Seice\xE1il amach",
|
|
2620
|
-
he: "\u05DC\u05EA\u05E9\u05DC\u05D5\u05DD",
|
|
2621
|
-
hi: "\u091A\u0947\u0915\u0906\u0909\u091F",
|
|
2622
|
-
id: "Checkout",
|
|
2623
|
-
it: "Cassa",
|
|
2624
|
-
ja: "\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8",
|
|
2625
|
-
ko: "\uACB0\uC81C\uD558\uAE30",
|
|
2626
|
-
nl: "Afrekenen",
|
|
2627
|
-
no: "Til kassen",
|
|
2628
|
-
pl: "Do kasy",
|
|
2629
|
-
pt: "Finalizar compra",
|
|
2630
|
-
ru: "\u041E\u0444\u043E\u0440\u043C\u0438\u0442\u044C \u0437\u0430\u043A\u0430\u0437",
|
|
2631
|
-
sv: "Till kassan",
|
|
2632
|
-
th: "\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19",
|
|
2633
|
-
tr: "\xD6deme",
|
|
2634
|
-
uk: "\u041E\u0444\u043E\u0440\u043C\u0438\u0442\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F",
|
|
2635
|
-
vi: "Thanh to\xE1n",
|
|
2636
|
-
zh: "\u7ED3\u8D26"
|
|
2637
|
-
},
|
|
2638
2347
|
soldOut: {
|
|
2639
2348
|
ar: "\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",
|
|
2640
2349
|
cs: "Vyprod\xE1no",
|
|
@@ -2811,15 +2520,15 @@ var SWITCH_LABELS = {
|
|
|
2811
2520
|
|
|
2812
2521
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
2813
2522
|
var import_compat4 = require("es-toolkit/compat");
|
|
2814
|
-
var
|
|
2815
|
-
var strictNumber =
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2523
|
+
var import_zod34 = require("zod");
|
|
2524
|
+
var strictNumber = import_zod34.z.union([
|
|
2525
|
+
import_zod34.z.number(),
|
|
2526
|
+
import_zod34.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
2527
|
+
import_zod34.z.unknown().transform(() => 0)
|
|
2819
2528
|
]);
|
|
2820
2529
|
|
|
2821
2530
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
2822
|
-
var
|
|
2531
|
+
var import_zod35 = require("zod");
|
|
2823
2532
|
var blockTypes = [
|
|
2824
2533
|
"callout_banner",
|
|
2825
2534
|
"image",
|
|
@@ -2830,144 +2539,144 @@ var blockTypes = [
|
|
|
2830
2539
|
"text",
|
|
2831
2540
|
"timer"
|
|
2832
2541
|
];
|
|
2833
|
-
var blockType =
|
|
2542
|
+
var blockType = import_zod35.z.enum(blockTypes);
|
|
2834
2543
|
var BlockType = blockType.enum;
|
|
2835
2544
|
|
|
2836
2545
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
2837
2546
|
var import_compat5 = require("es-toolkit/compat");
|
|
2838
|
-
var
|
|
2839
|
-
var
|
|
2840
|
-
var TextAlignment2 =
|
|
2841
|
-
var TextSize =
|
|
2842
|
-
|
|
2843
|
-
|
|
2547
|
+
var import_uuid14 = require("uuid");
|
|
2548
|
+
var import_zod36 = require("zod");
|
|
2549
|
+
var TextAlignment2 = import_zod36.z.union([import_zod36.z.enum(["leading", "center", "trailing"]), import_zod36.z.unknown().transform(() => "leading")]);
|
|
2550
|
+
var TextSize = import_zod36.z.union([
|
|
2551
|
+
import_zod36.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
2552
|
+
import_zod36.z.unknown().transform(() => "medium")
|
|
2844
2553
|
]);
|
|
2845
|
-
var CalloutBannerBlock =
|
|
2846
|
-
id:
|
|
2847
|
-
name:
|
|
2848
|
-
settings:
|
|
2849
|
-
superTitle:
|
|
2850
|
-
title:
|
|
2554
|
+
var CalloutBannerBlock = import_zod36.z.object({
|
|
2555
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2556
|
+
name: import_zod36.z.string().optional(),
|
|
2557
|
+
settings: import_zod36.z.object({
|
|
2558
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
2559
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
2851
2560
|
}),
|
|
2852
|
-
styles:
|
|
2853
|
-
superTitleEmphasized:
|
|
2561
|
+
styles: import_zod36.z.object({
|
|
2562
|
+
superTitleEmphasized: import_zod36.z.boolean().default(false),
|
|
2854
2563
|
superTitleSize: TextSize.default("large"),
|
|
2855
2564
|
textAlignment: TextAlignment2.default("center"),
|
|
2856
|
-
titleEmphasized:
|
|
2565
|
+
titleEmphasized: import_zod36.z.boolean().default(true),
|
|
2857
2566
|
titleSize: TextSize.default("large")
|
|
2858
2567
|
}),
|
|
2859
|
-
type:
|
|
2568
|
+
type: import_zod36.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
2860
2569
|
});
|
|
2861
|
-
var ImageBlock =
|
|
2862
|
-
id:
|
|
2863
|
-
name:
|
|
2864
|
-
settings:
|
|
2865
|
-
|
|
2570
|
+
var ImageBlock = import_zod36.z.object({
|
|
2571
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2572
|
+
name: import_zod36.z.string().optional(),
|
|
2573
|
+
settings: import_zod36.z.union([
|
|
2574
|
+
import_zod36.z.object({
|
|
2866
2575
|
/** This isn't used in the post-purchase offer widget */
|
|
2867
|
-
alt:
|
|
2868
|
-
image:
|
|
2869
|
-
imageSize:
|
|
2870
|
-
imageType:
|
|
2576
|
+
alt: import_zod36.z.string().optional().default(""),
|
|
2577
|
+
image: import_zod36.z.union([import_zod36.z.literal(""), import_zod36.z.url()]).default(""),
|
|
2578
|
+
imageSize: import_zod36.z.number().default(20),
|
|
2579
|
+
imageType: import_zod36.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
2871
2580
|
}),
|
|
2872
|
-
|
|
2581
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({}))
|
|
2873
2582
|
]),
|
|
2874
|
-
type:
|
|
2875
|
-
});
|
|
2876
|
-
var ImageContentBlock =
|
|
2877
|
-
id:
|
|
2878
|
-
name:
|
|
2879
|
-
settings:
|
|
2880
|
-
alt:
|
|
2881
|
-
description:
|
|
2583
|
+
type: import_zod36.z.literal(BlockType.image).default(BlockType.image)
|
|
2584
|
+
});
|
|
2585
|
+
var ImageContentBlock = import_zod36.z.object({
|
|
2586
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2587
|
+
name: import_zod36.z.string().optional(),
|
|
2588
|
+
settings: import_zod36.z.object({
|
|
2589
|
+
alt: import_zod36.z.string().optional().default(""),
|
|
2590
|
+
description: import_zod36.z.union([import_zod36.z.string(), TiptapDocument, import_zod36.z.null()]).default(
|
|
2882
2591
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2883
2592
|
),
|
|
2884
2593
|
descriptionSize: TextSize.default("medium"),
|
|
2885
2594
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2886
|
-
image:
|
|
2887
|
-
imagePlacement:
|
|
2888
|
-
imageSize:
|
|
2889
|
-
superTitle:
|
|
2595
|
+
image: import_zod36.z.union([import_zod36.z.literal(""), import_zod36.z.url()]).default(""),
|
|
2596
|
+
imagePlacement: import_zod36.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
2597
|
+
imageSize: import_zod36.z.number().default(20),
|
|
2598
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
2890
2599
|
superTitleSize: TextSize.default("medium"),
|
|
2891
2600
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2892
|
-
swapContent:
|
|
2893
|
-
title:
|
|
2601
|
+
swapContent: import_zod36.z.boolean().optional().default(false),
|
|
2602
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
2894
2603
|
titleSize: TextSize.default("medium")
|
|
2895
2604
|
}),
|
|
2896
|
-
type:
|
|
2897
|
-
});
|
|
2898
|
-
var PayButtonBlock =
|
|
2899
|
-
id:
|
|
2900
|
-
name:
|
|
2901
|
-
settings:
|
|
2902
|
-
|
|
2903
|
-
label:
|
|
2605
|
+
type: import_zod36.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
2606
|
+
});
|
|
2607
|
+
var PayButtonBlock = import_zod36.z.object({
|
|
2608
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2609
|
+
name: import_zod36.z.string().optional(),
|
|
2610
|
+
settings: import_zod36.z.union([
|
|
2611
|
+
import_zod36.z.object({
|
|
2612
|
+
label: import_zod36.z.string().default("Pay Now")
|
|
2904
2613
|
}),
|
|
2905
|
-
|
|
2614
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({
|
|
2906
2615
|
label: "Pay Now"
|
|
2907
2616
|
}))
|
|
2908
2617
|
]),
|
|
2909
|
-
styles:
|
|
2910
|
-
|
|
2911
|
-
buttonWidth:
|
|
2618
|
+
styles: import_zod36.z.union([
|
|
2619
|
+
import_zod36.z.object({
|
|
2620
|
+
buttonWidth: import_zod36.z.number().min(10).max(100).default(50)
|
|
2912
2621
|
}),
|
|
2913
|
-
|
|
2622
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({
|
|
2914
2623
|
buttonWidth: 50
|
|
2915
2624
|
}))
|
|
2916
2625
|
]),
|
|
2917
|
-
type:
|
|
2626
|
+
type: import_zod36.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
2918
2627
|
});
|
|
2919
|
-
var ProductInformationBlock =
|
|
2628
|
+
var ProductInformationBlock = import_zod36.z.object({
|
|
2920
2629
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2921
|
-
hideProductImage:
|
|
2922
|
-
id:
|
|
2923
|
-
name:
|
|
2924
|
-
type:
|
|
2925
|
-
});
|
|
2926
|
-
var SeparatorBlock =
|
|
2927
|
-
id:
|
|
2928
|
-
name:
|
|
2929
|
-
type:
|
|
2930
|
-
});
|
|
2931
|
-
var TextBlock =
|
|
2932
|
-
id:
|
|
2933
|
-
name:
|
|
2934
|
-
settings:
|
|
2935
|
-
description:
|
|
2630
|
+
hideProductImage: import_zod36.z.boolean().optional().default(false),
|
|
2631
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2632
|
+
name: import_zod36.z.string().optional(),
|
|
2633
|
+
type: import_zod36.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
2634
|
+
});
|
|
2635
|
+
var SeparatorBlock = import_zod36.z.object({
|
|
2636
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2637
|
+
name: import_zod36.z.string().optional(),
|
|
2638
|
+
type: import_zod36.z.literal(BlockType.separator).default(BlockType.separator)
|
|
2639
|
+
});
|
|
2640
|
+
var TextBlock = import_zod36.z.object({
|
|
2641
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2642
|
+
name: import_zod36.z.string().optional(),
|
|
2643
|
+
settings: import_zod36.z.object({
|
|
2644
|
+
description: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).optional().default(
|
|
2936
2645
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2937
2646
|
),
|
|
2938
2647
|
/** This isn't used in the post-purchase offer widget */
|
|
2939
2648
|
descriptionSize: TextSize.default("medium"),
|
|
2940
2649
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2941
|
-
superTitle:
|
|
2650
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Super Title"),
|
|
2942
2651
|
/** This isn't used in the post-purchase offer widget */
|
|
2943
2652
|
superTitleSize: TextSize.default("medium"),
|
|
2944
|
-
title:
|
|
2653
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
2945
2654
|
/** This isn't used in the post-purchase offer widget */
|
|
2946
2655
|
titleSize: TextSize.default("medium")
|
|
2947
2656
|
}),
|
|
2948
|
-
type:
|
|
2949
|
-
});
|
|
2950
|
-
var TimerBlock =
|
|
2951
|
-
id:
|
|
2952
|
-
name:
|
|
2953
|
-
settings:
|
|
2954
|
-
durationMinutes:
|
|
2955
|
-
durationSeconds:
|
|
2956
|
-
endOffer:
|
|
2957
|
-
title:
|
|
2657
|
+
type: import_zod36.z.literal(BlockType.text).default(BlockType.text)
|
|
2658
|
+
});
|
|
2659
|
+
var TimerBlock = import_zod36.z.object({
|
|
2660
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2661
|
+
name: import_zod36.z.string().optional(),
|
|
2662
|
+
settings: import_zod36.z.object({
|
|
2663
|
+
durationMinutes: import_zod36.z.number().min(0).default(10),
|
|
2664
|
+
durationSeconds: import_zod36.z.union([import_zod36.z.number().min(0), import_zod36.z.unknown().transform(() => 0)]).default(0),
|
|
2665
|
+
endOffer: import_zod36.z.boolean().default(true),
|
|
2666
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
2958
2667
|
}),
|
|
2959
|
-
styles:
|
|
2668
|
+
styles: import_zod36.z.object({
|
|
2960
2669
|
textAlignment: TextAlignment2.default("center"),
|
|
2961
|
-
timerBackgroundColor:
|
|
2962
|
-
timerEmphasized:
|
|
2670
|
+
timerBackgroundColor: import_zod36.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
2671
|
+
timerEmphasized: import_zod36.z.union([import_zod36.z.boolean(), import_zod36.z.unknown().transform(() => true)]).default(true),
|
|
2963
2672
|
timerSize: TextSize.default("medium"),
|
|
2964
|
-
timerWidth:
|
|
2965
|
-
titleEmphasized:
|
|
2673
|
+
timerWidth: import_zod36.z.number().min(10).max(100).optional().default(100),
|
|
2674
|
+
titleEmphasized: import_zod36.z.union([import_zod36.z.boolean(), import_zod36.z.unknown().transform(() => true)]).default(false),
|
|
2966
2675
|
titleSize: TextSize.default("medium")
|
|
2967
2676
|
}),
|
|
2968
|
-
type:
|
|
2677
|
+
type: import_zod36.z.literal(BlockType.timer).default(BlockType.timer)
|
|
2969
2678
|
});
|
|
2970
|
-
var PostPurchaseBlock =
|
|
2679
|
+
var PostPurchaseBlock = import_zod36.z.discriminatedUnion("type", [
|
|
2971
2680
|
CalloutBannerBlock,
|
|
2972
2681
|
ImageBlock,
|
|
2973
2682
|
ImageContentBlock,
|
|
@@ -2987,68 +2696,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
2987
2696
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
2988
2697
|
|
|
2989
2698
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
2990
|
-
var
|
|
2699
|
+
var import_zod39 = require("zod");
|
|
2991
2700
|
|
|
2992
2701
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
2993
|
-
var
|
|
2702
|
+
var import_zod38 = require("zod");
|
|
2994
2703
|
|
|
2995
2704
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
2996
|
-
var
|
|
2997
|
-
var PostPurchaseSettings =
|
|
2998
|
-
advance:
|
|
2999
|
-
blocks:
|
|
2705
|
+
var import_zod37 = require("zod");
|
|
2706
|
+
var PostPurchaseSettings = import_zod37.z.object({
|
|
2707
|
+
advance: import_zod37.z.object({ removePartialOrder: import_zod37.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
2708
|
+
blocks: import_zod37.z.union([import_zod37.z.array(PostPurchaseBlock), import_zod37.z.unknown().transform(() => [])]).default(() => [
|
|
3000
2709
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3001
2710
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3002
2711
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3003
2712
|
]),
|
|
3004
|
-
columnLayout:
|
|
3005
|
-
discount:
|
|
2713
|
+
columnLayout: import_zod37.z.boolean().optional(),
|
|
2714
|
+
discount: import_zod37.z.object({
|
|
3006
2715
|
amount: strictNumber.default(30),
|
|
3007
|
-
shouldShowSavingText:
|
|
3008
|
-
type:
|
|
2716
|
+
shouldShowSavingText: import_zod37.z.boolean().optional().default(true),
|
|
2717
|
+
type: import_zod37.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3009
2718
|
}),
|
|
3010
|
-
discountedFrom:
|
|
3011
|
-
endpoint:
|
|
3012
|
-
integrations:
|
|
3013
|
-
judgeme:
|
|
3014
|
-
junip:
|
|
3015
|
-
klaviyo:
|
|
3016
|
-
loox:
|
|
3017
|
-
okendo:
|
|
3018
|
-
opinew:
|
|
3019
|
-
reviewsio:
|
|
3020
|
-
stamped:
|
|
3021
|
-
yotpo:
|
|
2719
|
+
discountedFrom: import_zod37.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
2720
|
+
endpoint: import_zod37.z.string().optional(),
|
|
2721
|
+
integrations: import_zod37.z.object({
|
|
2722
|
+
judgeme: import_zod37.z.boolean().default(false),
|
|
2723
|
+
junip: import_zod37.z.boolean().optional().default(false),
|
|
2724
|
+
klaviyo: import_zod37.z.boolean().default(false),
|
|
2725
|
+
loox: import_zod37.z.boolean().default(false),
|
|
2726
|
+
okendo: import_zod37.z.boolean().default(false),
|
|
2727
|
+
opinew: import_zod37.z.boolean().optional().default(false),
|
|
2728
|
+
reviewsio: import_zod37.z.boolean().optional().default(false),
|
|
2729
|
+
stamped: import_zod37.z.boolean().default(false),
|
|
2730
|
+
yotpo: import_zod37.z.boolean().default(false)
|
|
3022
2731
|
}),
|
|
3023
|
-
key:
|
|
3024
|
-
language:
|
|
3025
|
-
description:
|
|
3026
|
-
descriptionEnabled:
|
|
3027
|
-
descriptionRte:
|
|
3028
|
-
content:
|
|
3029
|
-
type:
|
|
2732
|
+
key: import_zod37.z.string().optional(),
|
|
2733
|
+
language: import_zod37.z.object({
|
|
2734
|
+
description: import_zod37.z.union([import_zod37.z.string(), import_zod37.z.unknown().transform(() => "")]).default(""),
|
|
2735
|
+
descriptionEnabled: import_zod37.z.boolean().optional().default(false),
|
|
2736
|
+
descriptionRte: import_zod37.z.object({
|
|
2737
|
+
content: import_zod37.z.array(import_zod37.z.unknown()),
|
|
2738
|
+
type: import_zod37.z.string()
|
|
3030
2739
|
}).optional(),
|
|
3031
|
-
descriptionSpacing:
|
|
3032
|
-
displayCtaPrice:
|
|
3033
|
-
global:
|
|
3034
|
-
declineAll:
|
|
3035
|
-
declineThisOffer:
|
|
3036
|
-
free:
|
|
3037
|
-
notAvailable:
|
|
3038
|
-
payNow:
|
|
3039
|
-
payNowUpgradeToSubscription:
|
|
3040
|
-
quantity:
|
|
2740
|
+
descriptionSpacing: import_zod37.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
2741
|
+
displayCtaPrice: import_zod37.z.boolean().default(true),
|
|
2742
|
+
global: import_zod37.z.object({
|
|
2743
|
+
declineAll: import_zod37.z.string().optional().default("Decline All"),
|
|
2744
|
+
declineThisOffer: import_zod37.z.string().default("Decline this offer"),
|
|
2745
|
+
free: import_zod37.z.string().optional().default("Free"),
|
|
2746
|
+
notAvailable: import_zod37.z.string().optional().default("Not available"),
|
|
2747
|
+
payNow: import_zod37.z.string().default("Pay Now"),
|
|
2748
|
+
payNowUpgradeToSubscription: import_zod37.z.string().optional().default("Upgrade to Subscription"),
|
|
2749
|
+
quantity: import_zod37.z.string().default("Quantity"),
|
|
3041
2750
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3042
|
-
recurringShipping:
|
|
3043
|
-
recurringSubtotal:
|
|
3044
|
-
reviewsPlural:
|
|
3045
|
-
reviewsSingular:
|
|
3046
|
-
save:
|
|
3047
|
-
shipping:
|
|
3048
|
-
subscriptionOption:
|
|
3049
|
-
subtotal:
|
|
3050
|
-
taxes:
|
|
3051
|
-
total:
|
|
2751
|
+
recurringShipping: import_zod37.z.string().optional().default("Recurring shipping"),
|
|
2752
|
+
recurringSubtotal: import_zod37.z.string().default("Recurring subtotal"),
|
|
2753
|
+
reviewsPlural: import_zod37.z.string().optional().default("Reviews"),
|
|
2754
|
+
reviewsSingular: import_zod37.z.string().optional().default("Review"),
|
|
2755
|
+
save: import_zod37.z.union([import_zod37.z.string(), import_zod37.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
2756
|
+
shipping: import_zod37.z.string().default("Shipping"),
|
|
2757
|
+
subscriptionOption: import_zod37.z.string().optional().default("Subscribe and Save"),
|
|
2758
|
+
subtotal: import_zod37.z.string().default("Subtotal"),
|
|
2759
|
+
taxes: import_zod37.z.string().default("Taxes"),
|
|
2760
|
+
total: import_zod37.z.string().default("Total")
|
|
3052
2761
|
}).optional().default(() => ({
|
|
3053
2762
|
declineAll: "Decline All",
|
|
3054
2763
|
declineThisOffer: "Decline this offer",
|
|
@@ -3069,70 +2778,70 @@ var PostPurchaseSettings = import_v437.z.object({
|
|
|
3069
2778
|
taxes: "Taxes",
|
|
3070
2779
|
total: "Total"
|
|
3071
2780
|
})),
|
|
3072
|
-
globalTranslation:
|
|
2781
|
+
globalTranslation: import_zod37.z.string().optional().default("english")
|
|
3073
2782
|
}),
|
|
3074
|
-
metafields:
|
|
2783
|
+
metafields: import_zod37.z.boolean().default(false),
|
|
3075
2784
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3076
|
-
offer:
|
|
3077
|
-
count:
|
|
2785
|
+
offer: import_zod37.z.object({
|
|
2786
|
+
count: import_zod37.z.number().default(1)
|
|
3078
2787
|
}),
|
|
3079
|
-
offersLayout:
|
|
3080
|
-
itemsPerPage:
|
|
3081
|
-
type:
|
|
2788
|
+
offersLayout: import_zod37.z.object({
|
|
2789
|
+
itemsPerPage: import_zod37.z.number().optional(),
|
|
2790
|
+
type: import_zod37.z.enum(["list", "grid", "carousel"]).default("list")
|
|
3082
2791
|
}).optional().default({
|
|
3083
2792
|
type: "list"
|
|
3084
2793
|
}),
|
|
3085
2794
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3086
|
-
previewMode:
|
|
3087
|
-
productLimit:
|
|
3088
|
-
productOptions:
|
|
2795
|
+
previewMode: import_zod37.z.boolean().default(false),
|
|
2796
|
+
productLimit: import_zod37.z.number().optional().default(1),
|
|
2797
|
+
productOptions: import_zod37.z.object({
|
|
3089
2798
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3090
|
-
hideOutOfStockVariants:
|
|
3091
|
-
matchVariant:
|
|
3092
|
-
showDeclineAll:
|
|
3093
|
-
showShipping:
|
|
3094
|
-
showSubtotal:
|
|
3095
|
-
showTaxes:
|
|
3096
|
-
showTotal:
|
|
3097
|
-
showVariantSelectors:
|
|
3098
|
-
variantSelectorDisplayMode:
|
|
2799
|
+
hideOutOfStockVariants: import_zod37.z.boolean().optional().default(false),
|
|
2800
|
+
matchVariant: import_zod37.z.boolean().optional().default(true),
|
|
2801
|
+
showDeclineAll: import_zod37.z.enum(["above", "below", "both", "none"]).optional(),
|
|
2802
|
+
showShipping: import_zod37.z.boolean().optional().default(true),
|
|
2803
|
+
showSubtotal: import_zod37.z.boolean().optional().default(true),
|
|
2804
|
+
showTaxes: import_zod37.z.boolean().optional().default(true),
|
|
2805
|
+
showTotal: import_zod37.z.boolean().optional().default(true),
|
|
2806
|
+
showVariantSelectors: import_zod37.z.boolean().optional().default(true),
|
|
2807
|
+
variantSelectorDisplayMode: import_zod37.z.enum(["separate", "single"]).optional().default("separate")
|
|
3099
2808
|
}),
|
|
3100
|
-
productType:
|
|
3101
|
-
productTypeSelector:
|
|
3102
|
-
quantityInputs:
|
|
3103
|
-
defaultQuantity:
|
|
3104
|
-
enabled:
|
|
3105
|
-
maxValue:
|
|
3106
|
-
minValue:
|
|
2809
|
+
productType: import_zod37.z.union([import_zod37.z.enum(["one-time", "subscription", "both"]), import_zod37.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
2810
|
+
productTypeSelector: import_zod37.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
2811
|
+
quantityInputs: import_zod37.z.object({
|
|
2812
|
+
defaultQuantity: import_zod37.z.union([import_zod37.z.number(), import_zod37.z.null().transform(() => 1)]).default(1),
|
|
2813
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
2814
|
+
maxValue: import_zod37.z.union([import_zod37.z.number(), import_zod37.z.null().transform(() => 15)]).default(15),
|
|
2815
|
+
minValue: import_zod37.z.union([import_zod37.z.number().min(0), import_zod37.z.unknown().transform(() => 0)]).default(1)
|
|
3107
2816
|
}),
|
|
3108
|
-
shipping:
|
|
2817
|
+
shipping: import_zod37.z.object({
|
|
3109
2818
|
amount: strictNumber.default(10),
|
|
3110
2819
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3111
|
-
enabled:
|
|
3112
|
-
title:
|
|
3113
|
-
type:
|
|
2820
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
2821
|
+
title: import_zod37.z.string().optional().default("Shipping Fees"),
|
|
2822
|
+
type: import_zod37.z.enum(["free", "fixed_amount"]).default("free")
|
|
3114
2823
|
}),
|
|
3115
|
-
styles:
|
|
3116
|
-
starColor:
|
|
3117
|
-
starSize:
|
|
3118
|
-
starStrokeColor:
|
|
3119
|
-
strokeWidth:
|
|
2824
|
+
styles: import_zod37.z.object({
|
|
2825
|
+
starColor: import_zod37.z.string().optional().default("#fadb14"),
|
|
2826
|
+
starSize: import_zod37.z.union([import_zod37.z.enum(["small", "medium", "large"]), import_zod37.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
2827
|
+
starStrokeColor: import_zod37.z.string().optional().default("#fadb14"),
|
|
2828
|
+
strokeWidth: import_zod37.z.string().optional().default("1")
|
|
3120
2829
|
}).optional(),
|
|
3121
|
-
subImages:
|
|
3122
|
-
subscription:
|
|
3123
|
-
discount:
|
|
2830
|
+
subImages: import_zod37.z.number().nullish().default(8),
|
|
2831
|
+
subscription: import_zod37.z.object({
|
|
2832
|
+
discount: import_zod37.z.object({
|
|
3124
2833
|
amount: strictNumber.default(30),
|
|
3125
|
-
shouldShowSavingText:
|
|
3126
|
-
type:
|
|
2834
|
+
shouldShowSavingText: import_zod37.z.boolean().optional().default(true),
|
|
2835
|
+
type: import_zod37.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3127
2836
|
}),
|
|
3128
|
-
shipping:
|
|
2837
|
+
shipping: import_zod37.z.object({
|
|
3129
2838
|
amount: strictNumber.default(1),
|
|
3130
2839
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3131
|
-
enabled:
|
|
2840
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
3132
2841
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3133
2842
|
recurringAmount: strictNumber.default(2),
|
|
3134
|
-
shippingTitle:
|
|
3135
|
-
type:
|
|
2843
|
+
shippingTitle: import_zod37.z.string().default("Shipping Fees"),
|
|
2844
|
+
type: import_zod37.z.enum(["free", "fixed_amount"]).default("free")
|
|
3136
2845
|
})
|
|
3137
2846
|
}).optional().default({
|
|
3138
2847
|
discount: {
|
|
@@ -3150,15 +2859,15 @@ var PostPurchaseSettings = import_v437.z.object({
|
|
|
3150
2859
|
type: "free"
|
|
3151
2860
|
}
|
|
3152
2861
|
}),
|
|
3153
|
-
subscriptionIsDefault:
|
|
2862
|
+
subscriptionIsDefault: import_zod37.z.boolean().optional(),
|
|
3154
2863
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3155
|
-
template:
|
|
3156
|
-
type:
|
|
3157
|
-
upgradeToSubscription:
|
|
3158
|
-
acceptButtonText:
|
|
3159
|
-
allow:
|
|
3160
|
-
emailRefundNotice:
|
|
3161
|
-
errorBannerText:
|
|
2864
|
+
template: import_zod37.z.string().optional().default(""),
|
|
2865
|
+
type: import_zod37.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
2866
|
+
upgradeToSubscription: import_zod37.z.object({
|
|
2867
|
+
acceptButtonText: import_zod37.z.string().optional().default("Upgrade"),
|
|
2868
|
+
allow: import_zod37.z.boolean().optional().default(false),
|
|
2869
|
+
emailRefundNotice: import_zod37.z.boolean().optional().default(false),
|
|
2870
|
+
errorBannerText: import_zod37.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3162
2871
|
}).optional().default(() => ({
|
|
3163
2872
|
acceptButtonText: "Upgrade",
|
|
3164
2873
|
allow: false,
|
|
@@ -3168,32 +2877,32 @@ var PostPurchaseSettings = import_v437.z.object({
|
|
|
3168
2877
|
});
|
|
3169
2878
|
|
|
3170
2879
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3171
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3172
|
-
id:
|
|
3173
|
-
name:
|
|
3174
|
-
});
|
|
3175
|
-
var PostPurchaseWidget =
|
|
3176
|
-
classification:
|
|
3177
|
-
createdAtTime:
|
|
3178
|
-
customEndpointName:
|
|
3179
|
-
id:
|
|
3180
|
-
lastViewed:
|
|
3181
|
-
linkedCustomEndpointId:
|
|
3182
|
-
linkedFlows:
|
|
3183
|
-
name:
|
|
3184
|
-
owner:
|
|
2880
|
+
var PostPurchaseWidgetLinkedFlow = import_zod38.z.object({
|
|
2881
|
+
id: import_zod38.z.number(),
|
|
2882
|
+
name: import_zod38.z.string()
|
|
2883
|
+
});
|
|
2884
|
+
var PostPurchaseWidget = import_zod38.z.object({
|
|
2885
|
+
classification: import_zod38.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
2886
|
+
createdAtTime: import_zod38.z.iso.datetime({ offset: true }).optional(),
|
|
2887
|
+
customEndpointName: import_zod38.z.string().nullish(),
|
|
2888
|
+
id: import_zod38.z.number().default(0),
|
|
2889
|
+
lastViewed: import_zod38.z.iso.datetime({ offset: true }).nullish(),
|
|
2890
|
+
linkedCustomEndpointId: import_zod38.z.number().nullish(),
|
|
2891
|
+
linkedFlows: import_zod38.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
2892
|
+
name: import_zod38.z.string().default(""),
|
|
2893
|
+
owner: import_zod38.z.number().nullish(),
|
|
3185
2894
|
settings: PostPurchaseSettings
|
|
3186
2895
|
});
|
|
3187
2896
|
|
|
3188
2897
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3189
|
-
var PostPurchaseOffer =
|
|
3190
|
-
|
|
3191
|
-
errors:
|
|
3192
|
-
message:
|
|
3193
|
-
successful:
|
|
2898
|
+
var PostPurchaseOffer = import_zod39.z.discriminatedUnion("successful", [
|
|
2899
|
+
import_zod39.z.strictObject({
|
|
2900
|
+
errors: import_zod39.z.array(import_zod39.z.object({ message: import_zod39.z.string() })),
|
|
2901
|
+
message: import_zod39.z.string(),
|
|
2902
|
+
successful: import_zod39.z.literal(false)
|
|
3194
2903
|
}),
|
|
3195
|
-
|
|
3196
|
-
successful:
|
|
2904
|
+
import_zod39.z.strictObject({
|
|
2905
|
+
successful: import_zod39.z.literal(true),
|
|
3197
2906
|
widget: PostPurchaseWidget
|
|
3198
2907
|
})
|
|
3199
2908
|
]);
|
|
@@ -3591,21 +3300,6 @@ var OFFER_TEMPLATE_SEED = {
|
|
|
3591
3300
|
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
3592
3301
|
},
|
|
3593
3302
|
sectionType: "text"
|
|
3594
|
-
},
|
|
3595
|
-
{
|
|
3596
|
-
buttonField: "addedToCart",
|
|
3597
|
-
content: OFFER_LABELS.addedToCart,
|
|
3598
|
-
sectionType: "text"
|
|
3599
|
-
},
|
|
3600
|
-
{
|
|
3601
|
-
buttonField: "soldOut",
|
|
3602
|
-
content: OFFER_LABELS.soldOut,
|
|
3603
|
-
sectionType: "text"
|
|
3604
|
-
},
|
|
3605
|
-
{
|
|
3606
|
-
buttonField: "redirectToCheckout",
|
|
3607
|
-
content: OFFER_LABELS.redirectToCheckout,
|
|
3608
|
-
sectionType: "text"
|
|
3609
3303
|
}
|
|
3610
3304
|
],
|
|
3611
3305
|
sectionType: "button"
|
|
@@ -3704,7 +3398,7 @@ var buildOfferTemplate = ({ location: location2, name } = {}) => CABRootSection.
|
|
|
3704
3398
|
// src/transforms/offerV1/offerCard.ts
|
|
3705
3399
|
var VARIANT_SELECTOR = { button: "button", radio: "radio", select: "menu" };
|
|
3706
3400
|
var localizedContent = (defaults, override) => {
|
|
3707
|
-
const trimmed =
|
|
3401
|
+
const trimmed = override?.trim();
|
|
3708
3402
|
return trimmed ? { ...defaults, en: trimmed } : defaults;
|
|
3709
3403
|
};
|
|
3710
3404
|
var buildStyledText = (token, style, color = "base") => {
|
|
@@ -3772,7 +3466,6 @@ var buildDescription = (settings) => {
|
|
|
3772
3466
|
return [{ content: { en: buildStyledText("{{productDescription}}", void 0) }, sectionType: "text" }];
|
|
3773
3467
|
};
|
|
3774
3468
|
var buildVariants = (settings) => {
|
|
3775
|
-
if (settings.viewOptions?.displayActions === false) return [];
|
|
3776
3469
|
if (settings.productOptions?.showVariantOptions === "never") return [];
|
|
3777
3470
|
const selector = settings.viewOptions?.variantSelector;
|
|
3778
3471
|
return [
|
|
@@ -3799,14 +3492,12 @@ var buildQuantity = (settings) => {
|
|
|
3799
3492
|
const quantity = settings.quantityInputs;
|
|
3800
3493
|
if (!quantity?.enabled) return [];
|
|
3801
3494
|
const inputType = quantity.type ? QUANTITY_INPUT_TYPE[quantity.type] : void 0;
|
|
3802
|
-
const max = Math.min(Math.max(quantity.maxValue ?? 10, 1), 100);
|
|
3803
|
-
const min = Math.min(Math.max(quantity.minValue ?? 1, 1), max);
|
|
3804
3495
|
return [
|
|
3805
3496
|
{
|
|
3806
3497
|
...buildQuantityErrors(quantity),
|
|
3807
3498
|
...inputType && { inputType },
|
|
3808
|
-
max,
|
|
3809
|
-
min,
|
|
3499
|
+
max: quantity.maxValue ?? 10,
|
|
3500
|
+
min: quantity.minValue ?? 1,
|
|
3810
3501
|
sectionType: "quantity"
|
|
3811
3502
|
}
|
|
3812
3503
|
];
|
|
@@ -3848,9 +3539,7 @@ var buildAddButton = (settings) => {
|
|
|
3848
3539
|
slot("addToCart", settings.language?.addToCart),
|
|
3849
3540
|
slot("addingToCart", settings.language?.addingToCart),
|
|
3850
3541
|
slot("addedToCart", settings.language?.addedToCart),
|
|
3851
|
-
slot("soldOut", settings.language?.soldOutLabel)
|
|
3852
|
-
// Off-checkout Buy Now: the label the button shows once it links to the created checkout.
|
|
3853
|
-
slot("redirectToCheckout", settings.language?.redirectToCheckout)
|
|
3542
|
+
slot("soldOut", settings.language?.soldOutLabel)
|
|
3854
3543
|
],
|
|
3855
3544
|
sectionType: "button"
|
|
3856
3545
|
};
|
|
@@ -3932,42 +3621,23 @@ var buildDiscountSection = (discount) => {
|
|
|
3932
3621
|
}
|
|
3933
3622
|
];
|
|
3934
3623
|
};
|
|
3935
|
-
var bannerMessageContent = (message) => {
|
|
3936
|
-
const sanitized = typeof message === "string" ? stripContentBlockHtml(message) : message;
|
|
3937
|
-
return sanitized ? { ...OFFER_LABELS.addedToCartMessage, en: sanitized } : OFFER_LABELS.addedToCartMessage;
|
|
3938
|
-
};
|
|
3939
|
-
var coerceIntegrations = (integrations) => Object.fromEntries(
|
|
3940
|
-
Object.entries(integrations).map(([key, value]) => [
|
|
3941
|
-
key,
|
|
3942
|
-
typeof value === "string" ? ["true", "yes"].includes(value.toLowerCase()) : value
|
|
3943
|
-
])
|
|
3944
|
-
);
|
|
3945
3624
|
var buildBanner = (language) => language?.successBannerEnabled ? [
|
|
3946
3625
|
{
|
|
3947
|
-
/**
|
|
3948
|
-
* The banner-level tag is the extraction/routing key on BOTH renderers (React CAB's
|
|
3949
|
-
* `isBannerType` + marker check; the Preact extension's `isUndoBanner`) — without it
|
|
3950
|
-
* the banner renders per card as an always-visible plain success banner and the
|
|
3951
|
-
* cart-scoped undo rail never runs. The schema's default offers tree carries it too.
|
|
3952
|
-
*/
|
|
3953
|
-
buttonField: "undoAddToOrder",
|
|
3954
3626
|
color: "success",
|
|
3955
3627
|
dismissible: true,
|
|
3956
3628
|
sections: [
|
|
3957
3629
|
{
|
|
3958
|
-
|
|
3630
|
+
/**
|
|
3631
|
+
* A defined v1 message (RTE doc or string) passes through verbatim as `en`;
|
|
3632
|
+
* absent falls back to the localized defaults (P4 language policy).
|
|
3633
|
+
*/
|
|
3634
|
+
content: language.successBannerMessageRte ? { ...OFFER_LABELS.addedToCartMessage, en: language.successBannerMessageRte } : OFFER_LABELS.addedToCartMessage,
|
|
3959
3635
|
sectionType: "text"
|
|
3960
3636
|
},
|
|
3961
3637
|
{
|
|
3962
3638
|
action: "undoAddToOrder",
|
|
3963
3639
|
buttonStyle: "plain",
|
|
3964
|
-
|
|
3965
|
-
* Tagged `undoAddToOrder`, never `buttonLabel` — the renderers (React CAB and
|
|
3966
|
-
* the Preact extension) and the schema's default offers tree resolve that slot.
|
|
3967
|
-
*/
|
|
3968
|
-
sections: [
|
|
3969
|
-
{ buttonField: "undoAddToOrder", content: OFFER_LABELS.undo, sectionType: "text" }
|
|
3970
|
-
],
|
|
3640
|
+
sections: [{ buttonField: "buttonLabel", content: OFFER_LABELS.undo, sectionType: "text" }],
|
|
3971
3641
|
sectionType: "button"
|
|
3972
3642
|
}
|
|
3973
3643
|
],
|
|
@@ -3982,13 +3652,12 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
3982
3652
|
const horizontalCard = direction === "rows";
|
|
3983
3653
|
const dataSource = {
|
|
3984
3654
|
...settings.endpoint && { dataSourcePath: settings.endpoint },
|
|
3985
|
-
...settings.integrations && { integrations:
|
|
3655
|
+
...settings.integrations && { integrations: settings.integrations },
|
|
3986
3656
|
...settings.limit !== void 0 && { limit: settings.limit },
|
|
3987
3657
|
matchVariant: !!settings.productOptions?.matchVariant,
|
|
3988
3658
|
matchVariantOutOfStock: !!settings.productOptions?.matchVariantOutOfStock,
|
|
3989
3659
|
...settings.productType && { productType: settings.productType },
|
|
3990
3660
|
sectionType: "dataSource",
|
|
3991
|
-
...settings.subscriptionIsDefault && { subscriptionIsDefault: true },
|
|
3992
3661
|
...settings.treatAsGwp && { treatAsGwp: true }
|
|
3993
3662
|
};
|
|
3994
3663
|
const offers = {
|
|
@@ -4002,9 +3671,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4002
3671
|
};
|
|
4003
3672
|
const display = {
|
|
4004
3673
|
autoAdvanceInterval: 0,
|
|
4005
|
-
|
|
4006
|
-
// otherwise throw at parse, so floor it at 1 (the carousel still shows a product per page).
|
|
4007
|
-
itemsAtOnce: Math.max(layout?.carousel ? columns : settings.limit ?? columns, 1),
|
|
3674
|
+
itemsAtOnce: layout?.carousel ? columns : settings.limit ?? columns,
|
|
4008
3675
|
...listLayout,
|
|
4009
3676
|
sections: [offers],
|
|
4010
3677
|
sectionType: "carousel"
|