@ikas/loyalty-widget-renderer 1.0.0-alpha.80 → 1.0.0-alpha.82
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/build/assets/index.d.ts +4 -0
- package/build/assets/widget-icons/illustraions/refundIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/refundIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/scenery.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/scenery.js +1 -0
- package/build/assets/widget-icons/normal/album02.d.ts +2 -0
- package/build/assets/widget-icons/normal/album02.js +1 -0
- package/build/assets/widget-icons/normal/refund.d.ts +2 -0
- package/build/assets/widget-icons/normal/refund.js +1 -0
- package/build/index.js +1 -1
- package/build/locales.d.ts +30 -0
- package/build/models/index.d.ts +6 -1
- package/build/models/index.js +1 -1
- package/build/models/loyalty-customer-info/index.d.ts +1 -1
- package/build/models/loyalty-customer-info/index.js +1 -1
- package/build/models/loyalty-program-point-history/index.d.ts +2 -0
- package/build/models/loyalty-program-point-history/index.js +1 -1
- package/build/models/loyalty-program-spending-method/index.d.ts +1 -0
- package/build/models/loyalty-program-spending-method/index.js +1 -1
- package/build/models/loyalty-widget/header/header-background/index.d.ts +1 -0
- package/build/models/loyalty-widget/header/header-background/index.js +1 -1
- package/build/models/types/index.d.ts +9 -1
- package/build/models/types/index.js +1 -1
- package/build/renderer/index.js +1 -1
- package/build/renderer/screens/credit-history-screen/index.js +1 -1
- package/build/renderer/screens/gift-product-selection-screen/index.d.ts +9 -0
- package/build/renderer/screens/gift-product-selection-screen/index.js +1 -0
- package/build/renderer/screens/gift-product-selection-screen/style.d.ts +20 -0
- package/build/renderer/screens/gift-product-selection-screen/style.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +3 -1
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +3 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
- package/build/renderer/style.d.ts +1 -1
- package/build/renderer/style.js +1 -1
- package/build/renderer/utils/locales/de.json.js +1 -1
- package/build/renderer/utils/locales/en.json.js +1 -1
- package/build/renderer/utils/locales/fr.json.js +1 -1
- package/build/renderer/utils/locales/nl.json.js +1 -1
- package/build/renderer/utils/locales/tr.json.js +1 -1
- package/build/renderer/utils/spending-method-utils.d.ts +20 -0
- package/build/renderer/utils/spending-method-utils.js +1 -0
- package/build/storefront-widget-script-injector.iife.js +6 -6
- package/build/storefront-widget-script-injector.iife.js.map +1 -1
- package/build/utils.d.ts +1 -0
- package/build/utils.js +1 -1
- package/package.json +1 -1
package/build/assets/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { SaveMoneyDollar } from "./widget-icons/normal/saveMoneyDollar";
|
|
|
19
19
|
export { ShoppingBasketAdd02 } from "./widget-icons/normal/shoppingBasketAdd02";
|
|
20
20
|
export { UserAdd01 } from "./widget-icons/normal/userAdd01";
|
|
21
21
|
export { InformationCircle } from "./widget-icons/normal/informationCircle";
|
|
22
|
+
export { Refund } from "./widget-icons/normal/refund";
|
|
23
|
+
export { Album02 } from "./widget-icons/normal/album02";
|
|
22
24
|
export { UsersIllustration } from "./widget-icons/illustraions/usersIllustration";
|
|
23
25
|
export { BubbleChatIllustration } from "./widget-icons/illustraions/bubbleChatIllustration";
|
|
24
26
|
export { ApprovedChatIllustration } from "./widget-icons/illustraions/approvedChatIllustration";
|
|
@@ -30,3 +32,5 @@ export { BigSaleMedal } from "./widget-icons/illustraions/bigSaleMedal";
|
|
|
30
32
|
export { ShoppingCartIllustration } from "./widget-icons/illustraions/shoppingCartIllustration";
|
|
31
33
|
export { InformationCircleIllustration } from "./widget-icons/illustraions/informationCircleIllustration";
|
|
32
34
|
export { CheckFillIllustration } from "./widget-icons/illustraions/check-fill";
|
|
35
|
+
export { RefundIllustration } from "./widget-icons/illustraions/refundIllustration";
|
|
36
|
+
export { Scenery } from "./widget-icons/illustraions/scenery";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){return e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M2.37602 1.35156L1 4.8899H15.0878L13.7773 1.35156H2.37602Z",fill:"#FCEEB5"}),e.createElement("path",{d:"M15.0878 4.88867H1V18.5834H15.0878V4.88867Z",fill:"#C5B883"}),e.createElement("path",{d:"M9.32147 1.35156H6.83153L6.50391 4.8899H9.6491L9.32147 1.35156Z",fill:"#C5B883"}),e.createElement("path",{d:"M6.50391 7.64071V4.88867H9.6491V7.64071H6.50391Z",fill:"#937450"}),e.createElement("path",{d:"M6.50391 18.6485V15.8965H9.6491V18.6485H6.50391Z",fill:"#937450"}),e.createElement("rect",{x:"8.04297",y:"1.39258",width:"10.9572",height:"10.9572",rx:"5.4786",fill:"#FE5561"}),e.createElement("path",{d:"M13.1968 8.82812H14.6643C15.4748 8.82812 16.1318 8.17111 16.1318 7.36064C16.1318 6.55017 15.4748 5.89316 14.6643 5.89316H10.9141",stroke:"#FFEEE9",strokeWidth:"0.782658",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M11.8924 6.87109C11.8924 6.87109 10.9141 6.15056 10.9141 5.89277C10.9141 5.63495 11.8924 4.91445 11.8924 4.91445",stroke:"#FFEEE9",strokeWidth:"0.782658",strokeLinecap:"round",strokeLinejoin:"round"}))};export{t as RefundIllustration};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e.createElement("path",{d:"M11.25 7.5C10.5596 7.5 10 6.94036 10 6.25C10 5.55964 10.5596 5 11.25 5C11.9404 5 12.5 5.55964 12.5 6.25C12.4992 6.94004 11.94 7.49925 11.25 7.5Z",fill:"url(#paint0_linear_17303_24744)"}),e.createElement("path",{d:"M15.8346 1.66602H4.16797C2.78893 1.67004 1.67199 2.78697 1.66797 4.16602V11.5493L4.9013 8.31602C5.89086 7.37435 7.44508 7.37435 8.43464 8.31602L10.8275 10.7218L11.5671 9.98226C12.5449 9.01007 14.1243 9.01007 15.1022 9.98226L18.3346 13.2147V4.16602C18.3306 2.78697 17.2137 1.67004 15.8346 1.66602ZM11.2513 7.49935C10.5609 7.49935 10.0013 6.93971 10.0013 6.24935C10.0013 5.55899 10.5609 4.99935 11.2513 4.99935C11.9417 4.99935 12.5013 5.55899 12.5013 6.24935C12.5006 6.93939 11.9413 7.4986 11.2513 7.49935Z",fill:"url(#paint1_linear_17303_24744)"}),e.createElement("path",{d:"M8.43464 8.31758C7.44508 7.37591 5.89086 7.37591 4.9013 8.31758L1.66797 11.5509V15.8342C1.672 17.2133 2.78894 18.3302 4.16797 18.3342H15.8346C16.5139 18.334 17.1638 18.0572 17.6346 17.5676L8.43464 8.31758Z",fill:"url(#paint2_linear_17303_24744)"}),e.createElement("path",{d:"M18.3314 13.2155L15.099 9.98303C14.1211 9.01086 12.5417 9.01086 11.5638 9.98303L10.8242 10.7226L17.6278 17.5631C18.0795 17.1008 18.3321 16.4798 18.3314 15.8335V13.2155Z",fill:"url(#paint3_linear_17303_24744)"}),e.createElement("defs",null,e.createElement("linearGradient",{id:"paint0_linear_17303_24744",x1:"11.25",y1:"5",x2:"11.25",y2:"7.5",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#FFDB53"}),e.createElement("stop",{offset:"1",stopColor:"#F09B13"})),e.createElement("linearGradient",{id:"paint1_linear_17303_24744",x1:"10.0013",y1:"1.66602",x2:"10.0013",y2:"13.2147",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#CDE7FF"}),e.createElement("stop",{offset:"1",stopColor:"#EAF5FF"})),e.createElement("linearGradient",{id:"paint2_linear_17303_24744",x1:"9.6513",y1:"7.61133",x2:"9.6513",y2:"18.3342",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#4BC67D"}),e.createElement("stop",{offset:"1",stopColor:"#1F857D"})),e.createElement("linearGradient",{id:"paint3_linear_17303_24744",x1:"14.5778",y1:"9.25391",x2:"14.5778",y2:"17.5631",gradientUnits:"userSpaceOnUse"},e.createElement("stop",{stopColor:"#62E39B"}),e.createElement("stop",{offset:"1",stopColor:"#29CCAD"}))))};export{t as Scenery};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(t){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e.createElement("path",{d:"M4.5 13.4809C4.59653 14.4622 4.81467 15.1227 5.30768 15.6157C6.19197 16.5 7.6152 16.5 10.4617 16.5C13.3082 16.5 14.7314 16.5 15.6157 15.6157C16.5 14.7314 16.5 13.3082 16.5 10.4617C16.5 7.6152 16.5 6.19197 15.6157 5.30768C15.1227 4.81467 14.4622 4.59653 13.4809 4.5",stroke:"#4B5565",strokeWidth:"1.4"}),e.createElement("path",{d:"M1.5 7.5C1.5 4.67157 1.5 3.25736 2.37868 2.37868C3.25736 1.5 4.67157 1.5 7.5 1.5C10.3284 1.5 11.7427 1.5 12.6213 2.37868C13.5 3.25736 13.5 4.67157 13.5 7.5C13.5 10.3284 13.5 11.7427 12.6213 12.6213C11.7427 13.5 10.3284 13.5 7.5 13.5C4.67157 13.5 3.25736 13.5 2.37868 12.6213C1.5 11.7427 1.5 10.3284 1.5 7.5Z",stroke:"#4B5565",strokeWidth:"1.4"}),e.createElement("path",{d:"M1.5 8.3389C1.96426 8.27988 2.43363 8.25078 2.90378 8.25175C4.89274 8.215 6.83298 8.75725 8.37832 9.78183C9.8115 10.7321 10.8185 12.0398 11.25 13.5",stroke:"#4B5565",strokeWidth:"1.4",strokeLinejoin:"round"}),e.createElement("path",{d:"M9.75 5.25H9.75675",stroke:"#4B5565",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}))};export{t as Album02};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var r=function(r){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e.createElement("path",{d:"M11.625 16.125H7.875C5.04657 16.125 3.63236 16.125 2.75368 15.2463C1.875 14.3677 1.875 12.9534 1.875 10.125V4.875H16.125V10.125",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M1.875 4.875L2.325 4.275C3.20828 3.09729 3.64992 2.50844 4.28336 2.19172C4.9168 1.875 5.65286 1.875 7.125 1.875H10.875C12.3471 1.875 13.0832 1.875 13.7167 2.19172C14.3501 2.50844 14.7917 3.09729 15.675 4.275L16.125 4.875",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{d:"M12 10.123C12 10.123 10.125 11.5039 10.125 11.998C10.125 12.4921 12 13.873 12 13.873M10.5 11.998L14.0627 11.9986C15.2017 11.9988 16.125 12.9223 16.125 14.0614C16.125 15.2004 15.2016 16.1239 14.0625 16.1239",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}))};export{r as Refund};
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as locales}from"./locales.js";export{LoyaltyWidget}from"./models/loyalty-widget/index.js";export{BadgeIconTypeEnum,HeaderBackgroundTypeEnum,ImageTypeEnum,LoyaltyWidgetLayoutTypeEnum,WidgetIconTypeEnum,WidgetPositionEnum}from"./models/loyalty-widget/types/index.js";export{LoyaltyWidgetHeader}from"./models/loyalty-widget/header/index.js";export{LoyaltyWidgetHeaderBackground}from"./models/loyalty-widget/header/header-background/index.js";export{LoyaltyWidgetTranslations}from"./models/loyalty-widget/translations.js";export{IMAGE_SIZE,LoyaltyWidgetImage}from"./models/image/index.js";export{LoyaltyWidgetButton}from"./models/button/index.js";export{CampaignTypeEnum,CartLoyaltyLineData,LoyaltyCustomerInfo,LoyaltyProgramTier,LoyaltyProgramTierTranslation,OrderAmountTypeEnum}from"./models/loyalty-customer-info/index.js";export{LoyaltyProgramPointHistory}from"./models/loyalty-program-point-history/index.js";export{LoyaltyProgramDiscountSettings,LoyaltyProgramSpendingMethod}from"./models/loyalty-program-spending-method/index.js";export{LoyaltyProgramEarningMethod,LoyaltyProgramEarningMethodOrderSettings,LoyaltyProgramEarningMethodProductSettings}from"./models/loyalty-program-earning-method/index.js";export{LoyaltyWidgetSettings}from"./models/loyalty-widget/settings/index.js";export{LoyaltyWidgetViewModel}from"./models/index.js";export{EarningMethodTypeEnum,LoyaltyProgramFilterTypeEnum,LoyaltyProgramMethodSpendingTypeEnum,LoyaltyProgramPointEarningTypeEnum,LoyaltyProgramPointHistoryTypeEnum,LoyaltyWidgetScreenTypeEnum,PeriodTypeEnum,WidgetMode}from"./models/types/index.js";export{BadgeLevel1}from"./assets/badgeLevel1.js";export{BadgeLevel2}from"./assets/badgeLevel2.js";export{BadgeLevel3}from"./assets/badgeLevel3.js";export{BadgeLevel4}from"./assets/badgeLevel4.js";export{XClose}from"./assets/icons/x-close.js";export{CheckCircleFill}from"./assets/icons/check-circle-fill.js";export{ChevronLeft}from"./assets/icons/chevron-left.js";export{Check}from"./assets/icons/check.js";export{ArrowRight}from"./assets/icons/arrow-right.js";export{CheckCircle}from"./assets/icons/check-circle.js";export{BubbleChatDone}from"./assets/widget-icons/normal/bubbleChatDone.js";export{CommentAdd01}from"./assets/widget-icons/normal/commentAdd01.js";export{CouponPercent}from"./assets/widget-icons/normal/couponPercent.js";export{DiscountTag02}from"./assets/widget-icons/normal/discountTag02.js";export{Gift}from"./assets/widget-icons/normal/gift.js";export{MoneyAdd01}from"./assets/widget-icons/normal/moneyAdd01.js";export{PackageDelivered}from"./assets/widget-icons/normal/packageDelivered.js";export{SaveMoneyDollar}from"./assets/widget-icons/normal/saveMoneyDollar.js";export{ShoppingBasketAdd02}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";export{UserAdd01}from"./assets/widget-icons/normal/userAdd01.js";export{InformationCircle}from"./assets/widget-icons/normal/informationCircle.js";export{UsersIllustration}from"./assets/widget-icons/illustraions/usersIllustration.js";export{BubbleChatIllustration}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";export{ApprovedChatIllustration}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";export{TshirtIllustration}from"./assets/widget-icons/illustraions/tshirtIllustration.js";export{Medal}from"./assets/widget-icons/illustraions/medal.js";export{GiftIllustration}from"./assets/widget-icons/illustraions/giftIllustration.js";export{ShippingBox}from"./assets/widget-icons/illustraions/shippingBox.js";export{BigSaleMedal}from"./assets/widget-icons/illustraions/bigSaleMedal.js";export{ShoppingCartIllustration}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";export{InformationCircleIllustration}from"./assets/widget-icons/illustraions/informationCircleIllustration.js";export{CheckFillIllustration}from"./assets/widget-icons/illustraions/check-fill.js";export{default as LoyaltyWidgetRenderer}from"./renderer/index.js";export{flatten,unflatten}from"./renderer/utils/object-utils.js";
|
|
1
|
+
export{default as locales}from"./locales.js";export{LoyaltyWidget}from"./models/loyalty-widget/index.js";export{BadgeIconTypeEnum,HeaderBackgroundTypeEnum,ImageTypeEnum,LoyaltyWidgetLayoutTypeEnum,WidgetIconTypeEnum,WidgetPositionEnum}from"./models/loyalty-widget/types/index.js";export{LoyaltyWidgetHeader}from"./models/loyalty-widget/header/index.js";export{LoyaltyWidgetHeaderBackground}from"./models/loyalty-widget/header/header-background/index.js";export{LoyaltyWidgetTranslations}from"./models/loyalty-widget/translations.js";export{IMAGE_SIZE,LoyaltyWidgetImage}from"./models/image/index.js";export{LoyaltyWidgetButton}from"./models/button/index.js";export{CampaignTypeEnum,CartLoyaltyLineData,LoyaltyCustomerInfo,LoyaltyProgramTier,LoyaltyProgramTierTranslation,OrderAmountTypeEnum}from"./models/loyalty-customer-info/index.js";export{LoyaltyProgramPointHistory}from"./models/loyalty-program-point-history/index.js";export{LoyaltyProgramDiscountSettings,LoyaltyProgramSpendingMethod}from"./models/loyalty-program-spending-method/index.js";export{LoyaltyProgramEarningMethod,LoyaltyProgramEarningMethodOrderSettings,LoyaltyProgramEarningMethodProductSettings}from"./models/loyalty-program-earning-method/index.js";export{LoyaltyWidgetSettings}from"./models/loyalty-widget/settings/index.js";export{LoyaltyWidgetViewModel}from"./models/index.js";export{EarningMethodTypeEnum,LoyaltyProgramFilterTypeEnum,LoyaltyProgramMethodSpendingTypeEnum,LoyaltyProgramPointEarningTypeEnum,LoyaltyProgramPointHistoryTypeEnum,LoyaltyWidgetScreenTypeEnum,PeriodTypeEnum,WidgetMode}from"./models/types/index.js";export{BadgeLevel1}from"./assets/badgeLevel1.js";export{BadgeLevel2}from"./assets/badgeLevel2.js";export{BadgeLevel3}from"./assets/badgeLevel3.js";export{BadgeLevel4}from"./assets/badgeLevel4.js";export{XClose}from"./assets/icons/x-close.js";export{CheckCircleFill}from"./assets/icons/check-circle-fill.js";export{ChevronLeft}from"./assets/icons/chevron-left.js";export{Check}from"./assets/icons/check.js";export{ArrowRight}from"./assets/icons/arrow-right.js";export{CheckCircle}from"./assets/icons/check-circle.js";export{BubbleChatDone}from"./assets/widget-icons/normal/bubbleChatDone.js";export{CommentAdd01}from"./assets/widget-icons/normal/commentAdd01.js";export{CouponPercent}from"./assets/widget-icons/normal/couponPercent.js";export{DiscountTag02}from"./assets/widget-icons/normal/discountTag02.js";export{Gift}from"./assets/widget-icons/normal/gift.js";export{MoneyAdd01}from"./assets/widget-icons/normal/moneyAdd01.js";export{PackageDelivered}from"./assets/widget-icons/normal/packageDelivered.js";export{SaveMoneyDollar}from"./assets/widget-icons/normal/saveMoneyDollar.js";export{ShoppingBasketAdd02}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";export{UserAdd01}from"./assets/widget-icons/normal/userAdd01.js";export{InformationCircle}from"./assets/widget-icons/normal/informationCircle.js";export{Refund}from"./assets/widget-icons/normal/refund.js";export{Album02}from"./assets/widget-icons/normal/album02.js";export{UsersIllustration}from"./assets/widget-icons/illustraions/usersIllustration.js";export{BubbleChatIllustration}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";export{ApprovedChatIllustration}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";export{TshirtIllustration}from"./assets/widget-icons/illustraions/tshirtIllustration.js";export{Medal}from"./assets/widget-icons/illustraions/medal.js";export{GiftIllustration}from"./assets/widget-icons/illustraions/giftIllustration.js";export{ShippingBox}from"./assets/widget-icons/illustraions/shippingBox.js";export{BigSaleMedal}from"./assets/widget-icons/illustraions/bigSaleMedal.js";export{ShoppingCartIllustration}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";export{InformationCircleIllustration}from"./assets/widget-icons/illustraions/informationCircleIllustration.js";export{CheckFillIllustration}from"./assets/widget-icons/illustraions/check-fill.js";export{RefundIllustration}from"./assets/widget-icons/illustraions/refundIllustration.js";export{Scenery}from"./assets/widget-icons/illustraions/scenery.js";export{default as LoyaltyWidgetRenderer}from"./renderer/index.js";export{flatten,unflatten}from"./renderer/utils/object-utils.js";
|
package/build/locales.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ declare const locales: {
|
|
|
42
42
|
FREE_PRODUCT: {
|
|
43
43
|
title: string;
|
|
44
44
|
description: string;
|
|
45
|
+
groupedDescription: string;
|
|
46
|
+
singleDescription: string;
|
|
47
|
+
selectGift: string;
|
|
48
|
+
addFree: string;
|
|
45
49
|
};
|
|
46
50
|
};
|
|
47
51
|
header: {
|
|
@@ -105,10 +109,12 @@ declare const locales: {
|
|
|
105
109
|
BUY_PRODUCT: string;
|
|
106
110
|
CUSTOMER_SEGMENT: string;
|
|
107
111
|
};
|
|
112
|
+
orderRefund: string;
|
|
108
113
|
};
|
|
109
114
|
screens: {
|
|
110
115
|
creditEarningMethods: string;
|
|
111
116
|
creditSpendingMethods: string;
|
|
117
|
+
giftProductSelection: string;
|
|
112
118
|
creditHistory: string;
|
|
113
119
|
loyaltyLevel: string;
|
|
114
120
|
loyaltyLevelScreen: {
|
|
@@ -168,6 +174,10 @@ declare const locales: {
|
|
|
168
174
|
FREE_PRODUCT: {
|
|
169
175
|
title: string;
|
|
170
176
|
description: string;
|
|
177
|
+
groupedDescription: string;
|
|
178
|
+
singleDescription: string;
|
|
179
|
+
selectGift: string;
|
|
180
|
+
addFree: string;
|
|
171
181
|
};
|
|
172
182
|
};
|
|
173
183
|
header: {
|
|
@@ -231,10 +241,12 @@ declare const locales: {
|
|
|
231
241
|
BUY_PRODUCT: string;
|
|
232
242
|
CUSTOMER_SEGMENT: string;
|
|
233
243
|
};
|
|
244
|
+
orderRefund: string;
|
|
234
245
|
};
|
|
235
246
|
screens: {
|
|
236
247
|
creditEarningMethods: string;
|
|
237
248
|
creditSpendingMethods: string;
|
|
249
|
+
giftProductSelection: string;
|
|
238
250
|
creditHistory: string;
|
|
239
251
|
loyaltyLevel: string;
|
|
240
252
|
loyaltyLevelScreen: {
|
|
@@ -294,6 +306,10 @@ declare const locales: {
|
|
|
294
306
|
FREE_PRODUCT: {
|
|
295
307
|
title: string;
|
|
296
308
|
description: string;
|
|
309
|
+
groupedDescription: string;
|
|
310
|
+
singleDescription: string;
|
|
311
|
+
selectGift: string;
|
|
312
|
+
addFree: string;
|
|
297
313
|
};
|
|
298
314
|
};
|
|
299
315
|
header: {
|
|
@@ -357,10 +373,12 @@ declare const locales: {
|
|
|
357
373
|
BUY_PRODUCT: string;
|
|
358
374
|
CUSTOMER_SEGMENT: string;
|
|
359
375
|
};
|
|
376
|
+
orderRefund: string;
|
|
360
377
|
};
|
|
361
378
|
screens: {
|
|
362
379
|
creditEarningMethods: string;
|
|
363
380
|
creditSpendingMethods: string;
|
|
381
|
+
giftProductSelection: string;
|
|
364
382
|
creditHistory: string;
|
|
365
383
|
loyaltyLevel: string;
|
|
366
384
|
loyaltyLevelScreen: {
|
|
@@ -420,6 +438,10 @@ declare const locales: {
|
|
|
420
438
|
FREE_PRODUCT: {
|
|
421
439
|
title: string;
|
|
422
440
|
description: string;
|
|
441
|
+
groupedDescription: string;
|
|
442
|
+
singleDescription: string;
|
|
443
|
+
selectGift: string;
|
|
444
|
+
addFree: string;
|
|
423
445
|
};
|
|
424
446
|
};
|
|
425
447
|
header: {
|
|
@@ -483,10 +505,12 @@ declare const locales: {
|
|
|
483
505
|
BUY_PRODUCT: string;
|
|
484
506
|
CUSTOMER_SEGMENT: string;
|
|
485
507
|
};
|
|
508
|
+
orderRefund: string;
|
|
486
509
|
};
|
|
487
510
|
screens: {
|
|
488
511
|
creditEarningMethods: string;
|
|
489
512
|
creditSpendingMethods: string;
|
|
513
|
+
giftProductSelection: string;
|
|
490
514
|
creditHistory: string;
|
|
491
515
|
loyaltyLevel: string;
|
|
492
516
|
loyaltyLevelScreen: {
|
|
@@ -546,6 +570,10 @@ declare const locales: {
|
|
|
546
570
|
FREE_PRODUCT: {
|
|
547
571
|
title: string;
|
|
548
572
|
description: string;
|
|
573
|
+
groupedDescription: string;
|
|
574
|
+
singleDescription: string;
|
|
575
|
+
selectGift: string;
|
|
576
|
+
addFree: string;
|
|
549
577
|
};
|
|
550
578
|
};
|
|
551
579
|
header: {
|
|
@@ -609,10 +637,12 @@ declare const locales: {
|
|
|
609
637
|
BUY_PRODUCT: string;
|
|
610
638
|
CUSTOMER_SEGMENT: string;
|
|
611
639
|
};
|
|
640
|
+
orderRefund: string;
|
|
612
641
|
};
|
|
613
642
|
screens: {
|
|
614
643
|
creditEarningMethods: string;
|
|
615
644
|
creditSpendingMethods: string;
|
|
645
|
+
giftProductSelection: string;
|
|
616
646
|
creditHistory: string;
|
|
617
647
|
loyaltyLevel: string;
|
|
618
648
|
loyaltyLevelScreen: {
|
package/build/models/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { LoyaltyProgramSpendingMethod } from "./loyalty-program-spending-method"
|
|
|
5
5
|
import { LoyaltyWidget } from "./loyalty-widget";
|
|
6
6
|
import { Brand, Category, LoyaltyWidgetCallbacks, LoyaltyWidgetScreenTypeEnum, Product, Tag, WidgetMode } from "./types";
|
|
7
7
|
export declare class LoyaltyWidgetViewModel {
|
|
8
|
-
|
|
8
|
+
navigationStack: LoyaltyWidgetScreenTypeEnum[];
|
|
9
9
|
currentWidgetMode: WidgetMode;
|
|
10
10
|
isMiniModeDescriptionClosed: boolean;
|
|
11
11
|
isLoading: boolean;
|
|
@@ -31,6 +31,11 @@ export declare class LoyaltyWidgetViewModel {
|
|
|
31
31
|
pointHistory: LoyaltyProgramPointHistory[];
|
|
32
32
|
callbacks?: LoyaltyWidgetCallbacks;
|
|
33
33
|
constructor(data: Partial<LoyaltyWidgetViewModel> | undefined, cdnURL: string, merchantId: string, currency: string, storeURL?: string | null, isPreviewMode?: boolean, callbacks?: LoyaltyWidgetCallbacks);
|
|
34
|
+
get currentScreen(): LoyaltyWidgetScreenTypeEnum;
|
|
35
|
+
get isMainScreen(): boolean;
|
|
36
|
+
pushScreen(screen: LoyaltyWidgetScreenTypeEnum): void;
|
|
37
|
+
popScreen(): void;
|
|
38
|
+
resetNavigation(): void;
|
|
34
39
|
get shouldShowSpendingMethods(): boolean;
|
|
35
40
|
setWidgetMode(mode: WidgetMode): void;
|
|
36
41
|
closeMiniModeDescription(): void;
|
package/build/models/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as e,observable as i,
|
|
1
|
+
import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{makeObservable as e,observable as i,computed as n,action as r}from"mobx";import{markDescriptionClosedForSession as o,isDescriptionClosedForCurrentSession as s}from"../utils.js";import{LoyaltyCustomerInfo as a}from"./loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as c}from"./loyalty-program-earning-method/index.js";import{LoyaltyProgramSpendingMethod as d}from"./loyalty-program-spending-method/index.js";import{LoyaltyWidget as h}from"./loyalty-widget/index.js";import{LoyaltyWidgetScreenTypeEnum as u,WidgetMode as p}from"./types/index.js";var g=function(){function g(o,g,l,M,y,f,m){void 0===o&&(o={}),this.userRefreshTrigger=0,this.cartRefreshTrigger=0,this.navigationStack=[u.MAIN_SCREEN],this.currentWidgetMode=f?p.WIDGET_MODE:p.MINI_MODE,this.isMiniModeDescriptionClosed=s(),this.isLoading=o.isLoading||!1,this.isActionLoading=o.isActionLoading||!1,this.loyaltyWidget=new h(o.loyaltyWidget),this.cdnURL=g,this.merchantId=l,this.storeUrl=y||o.storeUrl||"",this.currency=M,this.isPreviewMode=f||!1,this.cartId=o.cartId||null,this.ikasEventUser=o.ikasEventUser||null,this.user=o.user?new a(o.user):null,this.earningMethods=o.earningMethods?o.earningMethods.map(function(t){return new c(t)}):[],this.spendingMethods=o.spendingMethods?o.spendingMethods.map(function(t){return new d(t)}):[],this.tiers=o.tiers?o.tiers:[],this.categories=o.categories?o.categories:[],this.products=o.products?o.products:[],this.brands=o.brands?o.brands:[],this.tags=o.tags?o.tags:[],this.pointHistory=o.pointHistory?o.pointHistory:[],this.callbacks=m||void 0,e(this,t(t({cartId:i},f?{}:{loyaltyWidget:i}),{isLoading:i,isActionLoading:i,cdnURL:i,merchantId:i,storeUrl:i,currency:i,navigationStack:i,currentScreen:n,isMainScreen:n,pushScreen:r.bound,popScreen:r.bound,resetNavigation:r.bound,setWidgetMode:r.bound,closeMiniModeDescription:r.bound,formatCurrency:r.bound,currentWidgetMode:i,isMiniModeDescriptionClosed:i,user:i,earningMethods:i,spendingMethods:i,tiers:i,categories:i,products:i,brands:i,tags:i,pointHistory:i,ikasEventUser:i,userRefreshTrigger:i,cartRefreshTrigger:i,shouldShowSpendingMethods:n}))}return Object.defineProperty(g.prototype,"currentScreen",{get:function(){return this.navigationStack[this.navigationStack.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"isMainScreen",{get:function(){return this.currentScreen===u.MAIN_SCREEN},enumerable:!1,configurable:!0}),g.prototype.pushScreen=function(t){this.currentScreen!==t&&this.navigationStack.push(t)},g.prototype.popScreen=function(){this.navigationStack.length>1&&this.navigationStack.pop()},g.prototype.resetNavigation=function(){this.navigationStack=[u.MAIN_SCREEN]},Object.defineProperty(g.prototype,"shouldShowSpendingMethods",{get:function(){return!!this.user&&(!(this.user.totalPoint<=0)&&0!==this.spendingMethods.length)},enumerable:!1,configurable:!0}),g.prototype.setWidgetMode=function(t){this.currentWidgetMode=t,t!==p.WIDGET_MODE||this.isPreviewMode||(this.isMiniModeDescriptionClosed=!0,o())},g.prototype.closeMiniModeDescription=function(){this.isMiniModeDescriptionClosed=!0,o()},g.prototype.formatCurrency=function(t){var e;return(null===(e=this.callbacks)||void 0===e?void 0:e.formatCurrency)?this.callbacks.formatCurrency(t):"".concat(t.toFixed(2)," ").concat(this.currency)},g}();export{g as LoyaltyWidgetViewModel};
|
|
@@ -23,7 +23,7 @@ export declare class CartLoyaltyLineData {
|
|
|
23
23
|
campaignType: CampaignTypeEnum | null;
|
|
24
24
|
discountAmount: number;
|
|
25
25
|
discountAmountType: OrderAmountTypeEnum;
|
|
26
|
-
discountPercentage
|
|
26
|
+
discountPercentage: number | null;
|
|
27
27
|
loyaltySpendingMethodId: string;
|
|
28
28
|
pointUsed: number;
|
|
29
29
|
constructor(data?: Partial<CartLoyaltyLineData>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as
|
|
1
|
+
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPeriod as i}from"../common/index.js";var n,o,r=function(i){void 0===i&&(i={}),this.locale=i.locale||"",this.name=i.name||"",t(this,{locale:e,name:e})},l=function(n){void 0===n&&(n={}),this.id=n.id||"",this.name=n.name||"",this.pointsRequired=n.pointsRequired||null,this.tierPointMultiplier=n.tierPointMultiplier||null,this.loyaltyProgramId=n.loyaltyProgramId||"",this.customerSegmentId=n.customerSegmentId||null,this.createdAt=n.createdAt||null,this.updatedAt=n.updatedAt||null,this.deleted=n.deleted||!1,this.isActive=n.isActive||!1,this.period=n.period?new i(n.period):null,this.translations=n.translations?n.translations.map(function(t){return new r(t)}):null,t(this,{id:e,name:e,pointsRequired:e,tierPointMultiplier:e,loyaltyProgramId:e,customerSegmentId:e,createdAt:e,updatedAt:e,deleted:e,isActive:e,period:e,translations:e})},s=function(i){void 0===i&&(i={}),this.campaignType=i.campaignType||null,this.discountAmount=i.discountAmount||0,this.discountAmountType=i.discountAmountType||o.AMOUNT,this.discountPercentage=void 0!==i.discountPercentage&&null!==i.discountPercentage?i.discountPercentage:null,this.loyaltySpendingMethodId=i.loyaltySpendingMethodId||"",this.pointUsed=i.pointUsed||0,t(this,{campaignType:e,discountAmount:e,discountAmountType:e,discountPercentage:e,loyaltySpendingMethodId:e,pointUsed:e})},d=function(i){void 0===i&&(i={}),this.customerTier=i.customerTier?new l(i.customerTier):null,this.loyaltyProgramCustomerId=i.loyaltyProgramCustomerId||"",this.loyaltyProgramId=i.loyaltyProgramId||"",this.totalPoint=i.totalPoint||0,this.nextTierRequiredPoint=void 0!==i.nextTierRequiredPoint&&null!==i.nextTierRequiredPoint?i.nextTierRequiredPoint:null,this.cartLoyaltyLines=i.cartLoyaltyLines?i.cartLoyaltyLines.map(function(t){return new s(t)}):null,t(this,{customerTier:e,loyaltyProgramCustomerId:e,loyaltyProgramId:e,totalPoint:e,nextTierRequiredPoint:e,cartLoyaltyLines:e})};!function(t){t.BUY_X_THEN_GET_Y="BUY_X_THEN_GET_Y",t.FIXED_AMOUNT="FIXED_AMOUNT",t.FREE_SHIPPING="FREE_SHIPPING",t.RATIO="RATIO"}(n||(n={})),function(t){t.AMOUNT="AMOUNT",t.RATIO="RATIO"}(o||(o={}));export{n as CampaignTypeEnum,s as CartLoyaltyLineData,d as LoyaltyCustomerInfo,l as LoyaltyProgramTier,r as LoyaltyProgramTierTranslation,o as OrderAmountTypeEnum};
|
|
@@ -3,6 +3,7 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
3
3
|
amount: number;
|
|
4
4
|
createdAt: any | null;
|
|
5
5
|
customerId: string;
|
|
6
|
+
customerReviewId: string | null;
|
|
6
7
|
deleted: boolean;
|
|
7
8
|
expireDate: any | null;
|
|
8
9
|
id: string;
|
|
@@ -12,6 +13,7 @@ export declare class LoyaltyProgramPointHistory {
|
|
|
12
13
|
loyaltyProgramSpendingMethodId: string | null;
|
|
13
14
|
orderId: string | null;
|
|
14
15
|
type: LoyaltyProgramPointHistoryTypeEnum;
|
|
16
|
+
productVariantId: string | null;
|
|
15
17
|
updatedAt: any | null;
|
|
16
18
|
constructor(data?: Partial<LoyaltyProgramPointHistory>);
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPointHistoryTypeEnum as r}from"../types/index.js";var d=function(d){void 0===d&&(d={}),this.amount=d.amount||0,this.createdAt=d.createdAt||null,this.customerId=d.customerId||"",this.deleted=d.deleted||!1,this.expireDate=d.expireDate||null,this.id=d.id||"",this.loyaltyProgramCustomerId=d.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=d.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=d.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=d.loyaltyProgramSpendingMethodId||null,this.orderId=d.orderId||null,this.type=d.type||r.EARN,this.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
|
|
1
|
+
import{makeObservable as t,observable as e}from"mobx";import{LoyaltyProgramPointHistoryTypeEnum as r}from"../types/index.js";var d=function(d){void 0===d&&(d={}),this.amount=d.amount||0,this.createdAt=d.createdAt||null,this.customerId=d.customerId||"",this.customerReviewId=d.customerReviewId||null,this.deleted=d.deleted||!1,this.expireDate=d.expireDate||null,this.id=d.id||"",this.loyaltyProgramCustomerId=d.loyaltyProgramCustomerId||"",this.loyaltyProgramEarningMethodId=d.loyaltyProgramEarningMethodId||null,this.loyaltyProgramId=d.loyaltyProgramId||"",this.loyaltyProgramSpendingMethodId=d.loyaltyProgramSpendingMethodId||null,this.orderId=d.orderId||null,this.type=d.type||r.EARN,this.productVariantId=d.productVariantId||null,this.updatedAt=d.updatedAt||null,t(this,{amount:e,createdAt:e,customerId:e,customerReviewId:e,deleted:e,expireDate:e,id:e,loyaltyProgramCustomerId:e,loyaltyProgramEarningMethodId:e,loyaltyProgramId:e,loyaltyProgramSpendingMethodId:e,orderId:e,type:e,productVariantId:e,updatedAt:e})};export{d as LoyaltyProgramPointHistory};
|
|
@@ -3,6 +3,7 @@ import { LoyaltyProgramPointLimit, LoyaltyProgramFilter, LoyaltyProgramMethodTra
|
|
|
3
3
|
export declare class LoyaltyProgramDiscountSettings {
|
|
4
4
|
discountAmount: number | null;
|
|
5
5
|
freeProductId: string | null;
|
|
6
|
+
freeProductVariantId: string | null;
|
|
6
7
|
point: number;
|
|
7
8
|
constructor(data?: Partial<LoyaltyProgramDiscountSettings>);
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as
|
|
1
|
+
import{makeObservable as t,observable as i}from"mobx";import{LoyaltyProgramMethodSpendingTypeEnum as n}from"../types/index.js";import{LoyaltyProgramPointLimit as e,LoyaltyProgramFilter as s,LoyaltyProgramMethodTranslation as o}from"../common/index.js";var d=function(n){void 0===n&&(n={}),this.discountAmount=n.discountAmount||null,this.freeProductId=n.freeProductId||null,this.freeProductVariantId=n.freeProductVariantId||null,this.point=n.point||0,t(this,{discountAmount:i,freeProductId:i,freeProductVariantId:i,point:i})},l=function(l){void 0===l&&(l={}),this.createdAt=l.createdAt||null,this.deleted=l.deleted||!1,this.description=l.description||null,this.discountSettings=l.discountSettings?new d(l.discountSettings):null,this.id=l.id||"",this.isActive=l.isActive||!1,this.isAvailable=void 0!==l.isAvailable&&null!==l.isAvailable?l.isAvailable:null,this.isDynamic=l.isDynamic||!1,this.loyaltyProgramId=l.loyaltyProgramId||"",this.pointUsageLimit=l.pointUsageLimit?new e(l.pointUsageLimit):null,this.productFilters=l.productFilters?l.productFilters.map(function(t){return new s(t)}):null,this.translations=l.translations?l.translations.map(function(t){return new o(t)}):null,this.type=l.type||n.FIXED_AMOUNT,this.updatedAt=l.updatedAt||null,t(this,{createdAt:i,deleted:i,description:i,discountSettings:i,id:i,isActive:i,isAvailable:i,isDynamic:i,loyaltyProgramId:i,pointUsageLimit:i,productFilters:i,translations:i,type:i,updatedAt:i})};export{d as LoyaltyProgramDiscountSettings,l as LoyaltyProgramSpendingMethod};
|
|
@@ -2,6 +2,7 @@ import { LoyaltyWidgetImage } from "models/image";
|
|
|
2
2
|
import { HeaderBackgroundTypeEnum } from "../../types";
|
|
3
3
|
export declare class LoyaltyWidgetHeaderBackground {
|
|
4
4
|
bgColor: string | null;
|
|
5
|
+
progressBarContainerColor: string | null;
|
|
5
6
|
image: LoyaltyWidgetImage | null;
|
|
6
7
|
type: HeaderBackgroundTypeEnum;
|
|
7
8
|
constructor(data: Partial<LoyaltyWidgetHeaderBackground>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeObservable as
|
|
1
|
+
import{makeObservable as o,observable as r}from"mobx";import{LoyaltyWidgetImage as e}from"../../../image/index.js";import{HeaderBackgroundTypeEnum as i}from"../../types/index.js";var t=function(t){this.bgColor=t.bgColor||null,this.image=t.image?new e(t.image):null,this.type=t.type||i.COLOR,this.progressBarContainerColor=t.progressBarContainerColor||"#eef2f6",o(this,{bgColor:r,image:r,type:r,progressBarContainerColor:r})};export{t as LoyaltyWidgetHeaderBackground};
|
|
@@ -9,7 +9,8 @@ export declare enum LoyaltyWidgetScreenTypeEnum {
|
|
|
9
9
|
CREDIT_SPENDING_METHODS_SCREEN = "CREDIT_SPENDING_METHODS_SCREEN",
|
|
10
10
|
CREDIT_EARNING_METHODS_SCREEN = "CREDIT_EARNING_METHODS_SCREEN",
|
|
11
11
|
CREDIT_HISTORY_SCREEN = "CREDIT_HISTORY_SCREEN",
|
|
12
|
-
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN"
|
|
12
|
+
LOYALTY_LEVEL_SCREEN = "LOYALTY_LEVEL_SCREEN",
|
|
13
|
+
GIFT_PRODUCT_SELECTION_SCREEN = "GIFT_PRODUCT_SELECTION_SCREEN"
|
|
13
14
|
}
|
|
14
15
|
export declare enum WidgetMode {
|
|
15
16
|
MINI_MODE = "MINI_MODE",
|
|
@@ -50,9 +51,16 @@ export type Category = {
|
|
|
50
51
|
id: string;
|
|
51
52
|
name: string;
|
|
52
53
|
};
|
|
54
|
+
export type ProductVariant = {
|
|
55
|
+
id: string;
|
|
56
|
+
mainImageSrc?: string | null;
|
|
57
|
+
variantText?: string | null;
|
|
58
|
+
};
|
|
53
59
|
export type Product = {
|
|
54
60
|
id: string;
|
|
55
61
|
name: string;
|
|
62
|
+
mainImageSrc?: string | null;
|
|
63
|
+
variants?: ProductVariant[];
|
|
56
64
|
};
|
|
57
65
|
export type Brand = {
|
|
58
66
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E,R,T,_,N,
|
|
1
|
+
var E,R,T,_,N,C,I,D;!function(E){E.MAIN_SCREEN="MAIN_SCREEN",E.CREDIT_SPENDING_METHODS_SCREEN="CREDIT_SPENDING_METHODS_SCREEN",E.CREDIT_EARNING_METHODS_SCREEN="CREDIT_EARNING_METHODS_SCREEN",E.CREDIT_HISTORY_SCREEN="CREDIT_HISTORY_SCREEN",E.LOYALTY_LEVEL_SCREEN="LOYALTY_LEVEL_SCREEN",E.GIFT_PRODUCT_SELECTION_SCREEN="GIFT_PRODUCT_SELECTION_SCREEN"}(E||(E={})),function(E){E.MINI_MODE="MINI_MODE",E.WIDGET_MODE="WIDGET_MODE"}(R||(R={})),function(E){E.BUY_PRODUCT="BUY_PRODUCT",E.CUSTOMER_REGISTER="CUSTOMER_REGISTER",E.CUSTOMER_REVIEW="CUSTOMER_REVIEW",E.CUSTOMER_SEGMENT="CUSTOMER_SEGMENT",E.ENABLE_SUBSCRIPTION="ENABLE_SUBSCRIPTION",E.ORDER_CREATE="ORDER_CREATE"}(T||(T={})),function(E){E.DYNAMIC_ORDER_AMOUNT="DYNAMIC_ORDER_AMOUNT",E.DYNAMIC_ORDER_QUANTITY="DYNAMIC_ORDER_QUANTITY",E.STATIC="STATIC"}(_||(_={})),function(E){E.FIXED_AMOUNT="FIXED_AMOUNT",E.FREE_PRODUCT="FREE_PRODUCT",E.FREE_SHIPPING="FREE_SHIPPING",E.RATIO="RATIO"}(N||(N={})),function(E){E.CATEGORY="CATEGORY",E.DYNAMIC_CATEGORY="DYNAMIC_CATEGORY",E.PRODUCT_AND_VARIANT="PRODUCT_AND_VARIANT",E.PRODUCT_BRAND="PRODUCT_BRAND",E.PRODUCT_TAG="PRODUCT_TAG"}(C||(C={})),function(E){E.MONTH="MONTH",E.WEEK="WEEK",E.YEAR="YEAR"}(I||(I={})),function(E){E.EARN="EARN",E.SPEND="SPEND",E.REFUND="REFUND",E.REFILL="REFILL"}(D||(D={}));export{T as EarningMethodTypeEnum,C as LoyaltyProgramFilterTypeEnum,N as LoyaltyProgramMethodSpendingTypeEnum,_ as LoyaltyProgramPointEarningTypeEnum,D as LoyaltyProgramPointHistoryTypeEnum,E as LoyaltyWidgetScreenTypeEnum,I as PeriodTypeEnum,R as WidgetMode};
|
package/build/renderer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import{toJS as r}from"mobx";import{observer as i}from"mobx-react";import o,{useState as s,useEffect as a}from"react";import'./../ext/react-i18next/dist/es/context.js';import{I18nextProvider as l}from'./../ext/react-i18next/dist/es/I18nextProvider.js';import{LoyaltyWidgetViewModel as c}from"../models/index.js";import{LoyaltyCustomerInfo as d}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as u}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as f}from"../models/loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as m}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyWidget as v}from"../models/loyalty-widget/index.js";import{WidgetPositionEnum as g,LoyaltyWidgetLayoutTypeEnum as E}from"../models/loyalty-widget/types/index.js";import{WidgetMode as y,LoyaltyWidgetScreenTypeEnum as p,EarningMethodTypeEnum as h,LoyaltyProgramFilterTypeEnum as T,LoyaltyProgramMethodSpendingTypeEnum as R}from"../models/types/index.js";import I from"./components/mini-mode-button/index.js";import b from"./components/mini-mode-description/index.js";import w from"./screens/credit-earning-methods-screen/index.js";import M from"./screens/credit-history-screen/index.js";import k from"./screens/credit-spending-methods-screen/index.js";import _ from"./screens/loyalty-level-screen/index.js";import C from"./screens/main-screen/index.js";import S from"./utils/i18n.js";import{unflatten as N}from"./utils/object-utils.js";import{Container as A,MiniModeWrapper as O,Panel as D,ScreenWrapper as L}from"./style.js";var P=i(function(i){var P,j,x=i.config,U=s(function(){var e=x||window.ikasLoyaltyWidgetConfig;return new c({cartId:(null==e?void 0:e.cartId)||null,ikasEventUser:(null==e?void 0:e.userId)?{id:e.userId}:null},(null==e?void 0:e.cdnURL)||"",(null==e?void 0:e.merchantId)||"",(null==e?void 0:e.currency)||"",(null==e?void 0:e.storeURL)||null,null==e?void 0:e.isPreviewMode,null==e?void 0:e.callbacks)})[0],W=s(!1),$=W[0],G=W[1],V=s(!1),B=V[0],F=V[1],z=s(!1),Y=z[0],H=z[1],J=U.loyaltyWidget.translations,q=JSON.stringify(r(null==J?void 0:J.custom));a(function(){var e=null==J?void 0:J.language,t=(null==J?void 0:J.custom)?r(J.custom):{};if(e){var n=["tr","en","de","nl","fr"].includes(e)?e:"en";if(S.language!==n&&S.changeLanguage(n),Object.keys(t).length>0){var i=N(t);S.addResourceBundle(n,"translation",i,!0,!0)}}},[null==J?void 0:J.language,q]),a(function(){var e=x||window.ikasLoyaltyWidgetConfig;(null==e?void 0:e.onViewModelInitialized)&&e.onViewModelInitialized(U)},[U,x]);var K=function(){return e(void 0,void 0,void 0,function(){var e,r,i,o,s;return t(this,function(t){switch(t.label){case 0:return U.callbacks?(e=new Set,r=new Set,i=new Set,o=new Set,U.earningMethods.forEach(function(t){var s,a;t.methodType===h.ORDER_CREATE&&n(n([],(null===(s=t.orderSettings)||void 0===s?void 0:s.productFilters)||[],!0),(null===(a=t.productSettings)||void 0===a?void 0:a.productFilters)||[],!0).forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),U.spendingMethods&&U.spendingMethods.forEach(function(t){var n,s;t.type===R.FREE_PRODUCT&&(null===(n=t.discountSettings)||void 0===n?void 0:n.freeProductId)&&e.add(t.discountSettings.freeProductId),null===(s=t.productFilters)||void 0===s||s.forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),s=[],e.size>0&&U.callbacks.getProducts&&s.push(U.callbacks.getProducts(Array.from(e)).then(function(e){return U.products=e})),r.size>0&&U.callbacks.getCategories&&s.push(U.callbacks.getCategories(Array.from(r)).then(function(e){return U.categories=e})),i.size>0&&U.callbacks.getBrands&&s.push(U.callbacks.getBrands(Array.from(i)).then(function(e){return U.brands=e})),o.size>0&&U.callbacks.getTags&&s.push(U.callbacks.getTags(Array.from(o)).then(function(e){return U.tags=e})),[4,Promise.all(s)]):[2];case 1:return t.sent(),[2]}})})};a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o,s;return t(this,function(t){switch(t.label){case 0:if(!U.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[U.callbacks.getLoyaltyWidget(),U.callbacks.listEarningMethods(),U.callbacks.listLoyaltyProgramTier({})],[4,Promise.all(e)];case 2:return n=t.sent(),r=n[0],i=n[1],o=n[2],U.loyaltyWidget=r instanceof v?r:new v(r||{}),U.earningMethods=i.map(function(e){return new u(e)}),U.tiers=o||[],[4,K()];case 3:return t.sent(),[3,6];case 4:return s=t.sent(),console.error("Failed to initialize loyalty data",s),[3,6];case 5:return G(!0),[7];case 6:return[2]}})})},[]),a(function(){if(window.IkasEvents){var e=function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer,i=(null===(n=U.ikasEventUser)||void 0===n?void 0:n.id)===r.id;r&&!i&&(U.ikasEventUser=r,U.userRefreshTrigger++,U.cartRefreshTrigger++)},t=function(e){var t,n,r,i,o,s=U.cartId,a=null===(n=null===(t=e.data)||void 0===t?void 0:t.cart)||void 0===n?void 0:n.id;0===(null===(o=null===(i=null===(r=e.data)||void 0===r?void 0:r.cart)||void 0===i?void 0:i.orderLineItems)||void 0===o?void 0:o.length)?U.cartId=null:U.cartId=a,s!==U.cartId&&U.cartRefreshTrigger++},n={CUSTOMER_LOGIN:e,CUSTOMER_VISIT:e,CUSTOMER_LOGOUT:function(){U.userRefreshTrigger++,U.cartRefreshTrigger++},ADD_TO_CART:t,REMOVE_FROM_CART:t,REMOVE_LOYALTY_POINTS:function(e){U.cartRefreshTrigger++,U.userRefreshTrigger++},PAGE_VIEW:function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer;if(r){var i=!U.ikasEventUser,o=(null===(n=U.ikasEventUser)||void 0===n?void 0:n.subscriptionStatus)!==r.subscriptionStatus;(i||o)&&(U.ikasEventUser=r,U.userRefreshTrigger++,U.cartRefreshTrigger++)}}},r="ikas-loyalty-widget-subscriber";try{window.IkasEvents.subscribe({id:r,callback:function(e){console.log("--------------------------------EVENT TYPE--------------------------------"),console.log(e.type),console.log("--------------------------------EVENT DATA--------------------------------"),console.log(e.data);var t=n[e.type];t&&t(e)}})}catch(e){console.error("Failed to subscribe to IkasEvents",e)}return function(){var e;(null===(e=window.IkasEvents)||void 0===e?void 0:e.unsubscribe)&&window.IkasEvents.unsubscribe(r)}}},[U]),a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o;return t(this,function(t){switch(t.label){case 0:if(B)return[2];if(F(!0),!U.callbacks||!(null===(o=U.ikasEventUser)||void 0===o?void 0:o.id))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all([U.callbacks.getLoyaltyCustomerInfo(),U.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),n=e[0],r=e[1],U.user=n?new d(n):null,n||(U.ikasEventUser=null),U.pointHistory=r?r.map(function(e){return new f(e)}):[],[3,4];case 3:return i=t.sent(),console.error("Failed to fetch user data",i),[3,4];case 4:return F(!1),[2]}})})},[null===(P=U.ikasEventUser)||void 0===P?void 0:P.id,U.userRefreshTrigger]),a(function(){e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:if(Y)return[2];if(H(!0),!U.callbacks)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,U.callbacks.listSpendingMethodsByCartId(U.cartId)];case 2:return e=t.sent(),U.spendingMethods=e.map(function(e){return new m(e)}),[4,K()];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),console.error("Failed to fetch cart data",n),[3,5];case 5:return H(!1),[2]}})})},[U.cartId,U.cartRefreshTrigger]);var Q=function(e){U.selectedScreen=e},X=function(){U.setWidgetMode(y.MINI_MODE),setTimeout(function(){U.selectedScreen=p.MAIN_SCREEN},300)};a(function(){return U.currentWidgetMode===y.WIDGET_MODE?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[U.currentWidgetMode]);var Z=U.selectedScreen===p.MAIN_SCREEN,ee=s(null),te=ee[0],ne=ee[1];a(function(){U.selectedScreen!==p.MAIN_SCREEN&&ne(U.selectedScreen)},[U.selectedScreen]);var re=Z?te:U.selectedScreen,ie=U.loyaltyWidget.settings.position||g.RIGHT,oe=U.loyaltyWidget.settings.type||E.DRAWER;if(!$)return null;var se=(null==x?void 0:x.position)||(null===(j=window.ikasLoyaltyWidgetConfig)||void 0===j?void 0:j.position)||"fixed";return o.createElement(l,{i18n:S},o.createElement(A,{$layoutType:oe,$widgetPosition:ie,$widgetMode:U.currentWidgetMode,$position:se,onClick:function(){U.currentWidgetMode===y.WIDGET_MODE&&X()},className:"ikas-storefront-widget"},o.createElement(O,{$isVisible:U.currentWidgetMode===y.MINI_MODE,$widgetPosition:ie},o.createElement(b,{viewModel:U,isInitialized:$}),o.createElement(I,{viewModel:U})),o.createElement(D,{$layoutType:oe,$isOpen:U.currentWidgetMode===y.WIDGET_MODE,$widgetPosition:ie,onClick:function(e){return e.stopPropagation()}},o.createElement(L,{$isActive:Z,$isMain:!0,$layoutType:oe},o.createElement(C,{viewModel:U,onClose:X,onNavigate:Q})),o.createElement(L,{$isActive:!Z,$isMain:!1,$layoutType:oe},function(){switch(re){case p.CREDIT_SPENDING_METHODS_SCREEN:return o.createElement(k,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.CREDIT_EARNING_METHODS_SCREEN:return o.createElement(w,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.CREDIT_HISTORY_SCREEN:return o.createElement(M,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});case p.LOYALTY_LEVEL_SCREEN:return o.createElement(_,{viewModel:U,onBack:function(){return Q(p.MAIN_SCREEN)},onClose:X});default:return null}}()))))});export{P as default};
|
|
1
|
+
import{__awaiter as e,__generator as t,__spreadArray as n}from'./../ext/tslib/tslib.es6.mjs.js';import{toJS as r}from"mobx";import{observer as i}from"mobx-react";import o,{useState as s,useEffect as a}from"react";import'./../ext/react-i18next/dist/es/context.js';import{I18nextProvider as l}from'./../ext/react-i18next/dist/es/I18nextProvider.js';import{LoyaltyWidgetViewModel as c}from"../models/index.js";import{LoyaltyCustomerInfo as d}from"../models/loyalty-customer-info/index.js";import{LoyaltyProgramEarningMethod as u}from"../models/loyalty-program-earning-method/index.js";import{LoyaltyProgramPointHistory as f}from"../models/loyalty-program-point-history/index.js";import{LoyaltyProgramSpendingMethod as v}from"../models/loyalty-program-spending-method/index.js";import{LoyaltyWidget as m}from"../models/loyalty-widget/index.js";import{WidgetPositionEnum as g,LoyaltyWidgetLayoutTypeEnum as p}from"../models/loyalty-widget/types/index.js";import{WidgetMode as y,LoyaltyWidgetScreenTypeEnum as E,EarningMethodTypeEnum as h,LoyaltyProgramFilterTypeEnum as T,LoyaltyProgramMethodSpendingTypeEnum as R}from"../models/types/index.js";import b from"./components/mini-mode-button/index.js";import w from"./components/mini-mode-description/index.js";import k from"./screens/credit-earning-methods-screen/index.js";import I from"./screens/credit-history-screen/index.js";import M from"./screens/credit-spending-methods-screen/index.js";import _ from"./screens/gift-product-selection-screen/index.js";import C from"./screens/loyalty-level-screen/index.js";import S from"./screens/main-screen/index.js";import O from"./utils/i18n.js";import{unflatten as D}from"./utils/object-utils.js";import{Container as A,MiniModeWrapper as L,Panel as P,ScreenWrapper as j}from"./style.js";var x=i(function(i){var x,N,U=i.config,W=s(function(){var e=U||window.ikasLoyaltyWidgetConfig;return new c({cartId:(null==e?void 0:e.cartId)||null,ikasEventUser:(null==e?void 0:e.userId)?{id:e.userId}:null},(null==e?void 0:e.cdnURL)||"",(null==e?void 0:e.merchantId)||"",(null==e?void 0:e.currency)||"",(null==e?void 0:e.storeURL)||null,null==e?void 0:e.isPreviewMode,null==e?void 0:e.callbacks)})[0],$=s(!1),G=$[0],B=$[1],F=s(!1),V=F[0],z=F[1],Y=s(!1),H=Y[0],J=Y[1],q=W.loyaltyWidget.translations,K=JSON.stringify(r(null==q?void 0:q.custom));a(function(){var e=null==q?void 0:q.language,t=(null==q?void 0:q.custom)?r(q.custom):{};if(e){var n=["tr","en","de","nl","fr"].includes(e)?e:"en";if(O.language!==n&&O.changeLanguage(n),Object.keys(t).length>0){var i=D(t);O.addResourceBundle(n,"translation",i,!0,!0)}}},[null==q?void 0:q.language,K]),a(function(){var e=U||window.ikasLoyaltyWidgetConfig;(null==e?void 0:e.onViewModelInitialized)&&e.onViewModelInitialized(W)},[W,U]);var Q=function(){return e(void 0,void 0,void 0,function(){var e,r,i,o,s;return t(this,function(t){switch(t.label){case 0:return W.callbacks?(e=new Set,r=new Set,i=new Set,o=new Set,W.earningMethods.forEach(function(t){var s,a;t.methodType===h.ORDER_CREATE&&n(n([],(null===(s=t.orderSettings)||void 0===s?void 0:s.productFilters)||[],!0),(null===(a=t.productSettings)||void 0===a?void 0:a.productFilters)||[],!0).forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),W.spendingMethods&&W.spendingMethods.forEach(function(t){var n,s;t.type===R.FREE_PRODUCT&&(null===(n=t.discountSettings)||void 0===n?void 0:n.freeProductId)&&e.add(t.discountSettings.freeProductId),null===(s=t.productFilters)||void 0===s||s.forEach(function(t){t.type===T.PRODUCT_AND_VARIANT?t.idList.forEach(function(t){return e.add(t)}):t.type===T.CATEGORY?t.idList.forEach(function(e){return r.add(e)}):t.type===T.PRODUCT_BRAND?t.idList.forEach(function(e){return i.add(e)}):t.type===T.PRODUCT_TAG&&t.idList.forEach(function(e){return o.add(e)})})}),s=[],e.size>0&&W.callbacks.getProducts&&s.push(W.callbacks.getProducts(Array.from(e)).then(function(e){return W.products=e})),r.size>0&&W.callbacks.getCategories&&s.push(W.callbacks.getCategories(Array.from(r)).then(function(e){return W.categories=e})),i.size>0&&W.callbacks.getBrands&&s.push(W.callbacks.getBrands(Array.from(i)).then(function(e){return W.brands=e})),o.size>0&&W.callbacks.getTags&&s.push(W.callbacks.getTags(Array.from(o)).then(function(e){return W.tags=e})),[4,Promise.all(s)]):[2];case 1:return t.sent(),[2]}})})};a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o,s;return t(this,function(t){switch(t.label){case 0:if(!W.callbacks)return[3,6];t.label=1;case 1:return t.trys.push([1,4,5,6]),e=[W.callbacks.getLoyaltyWidget(),W.callbacks.listEarningMethods(),W.callbacks.listLoyaltyProgramTier({})],[4,Promise.all(e)];case 2:return n=t.sent(),r=n[0],i=n[1],o=n[2],W.loyaltyWidget=r instanceof m?r:new m(r||{}),W.earningMethods=i.map(function(e){return new u(e)}),W.tiers=o||[],[4,Q()];case 3:return t.sent(),[3,6];case 4:return s=t.sent(),console.error("Failed to initialize loyalty data",s),[3,6];case 5:return B(!0),[7];case 6:return[2]}})})},[]),a(function(){if(window.IkasEvents){var e=function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer,i=(null===(n=W.ikasEventUser)||void 0===n?void 0:n.id)===r.id;r&&!i&&(W.ikasEventUser=r,W.userRefreshTrigger++,W.cartRefreshTrigger++)},t=function(e){var t,n,r,i,o,s=W.cartId,a=null===(n=null===(t=e.data)||void 0===t?void 0:t.cart)||void 0===n?void 0:n.id;0===(null===(o=null===(i=null===(r=e.data)||void 0===r?void 0:r.cart)||void 0===i?void 0:i.orderLineItems)||void 0===o?void 0:o.length)?W.cartId=null:W.cartId=a,s!==W.cartId&&W.cartRefreshTrigger++},n={CUSTOMER_LOGIN:e,CUSTOMER_VISIT:e,CUSTOMER_LOGOUT:function(){W.userRefreshTrigger++,W.cartRefreshTrigger++},ADD_TO_CART:t,REMOVE_FROM_CART:t,REMOVE_LOYALTY_POINTS:function(){W.cartRefreshTrigger++,W.userRefreshTrigger++},PAGE_VIEW:function(e){var t,n,r=null===(t=e.data)||void 0===t?void 0:t.customer;if(r){var i=!W.ikasEventUser,o=(null===(n=W.ikasEventUser)||void 0===n?void 0:n.subscriptionStatus)!==r.subscriptionStatus;(i||o)&&(W.ikasEventUser=r,W.userRefreshTrigger++,W.cartRefreshTrigger++)}}},r="ikas-loyalty-widget-subscriber";try{window.IkasEvents.subscribe({id:r,callback:function(e){var t=n[e.type];t&&t(e)}})}catch(e){console.error("Failed to subscribe to IkasEvents",e)}return function(){var e;(null===(e=window.IkasEvents)||void 0===e?void 0:e.unsubscribe)&&window.IkasEvents.unsubscribe(r)}}},[W]),a(function(){e(void 0,void 0,void 0,function(){var e,n,r,i,o;return t(this,function(t){switch(t.label){case 0:if(V)return[2];if(z(!0),!W.callbacks||!(null===(o=W.ikasEventUser)||void 0===o?void 0:o.id))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all([W.callbacks.getLoyaltyCustomerInfo(),W.callbacks.listLoyaltyProgramPointHistory({})])];case 2:return e=t.sent(),n=e[0],r=e[1],W.user=n?new d(n):null,n||(W.ikasEventUser=null),W.pointHistory=r?r.map(function(e){return new f(e)}):[],[3,4];case 3:return i=t.sent(),console.error("Failed to fetch user data",i),[3,4];case 4:return z(!1),[2]}})})},[null===(x=W.ikasEventUser)||void 0===x?void 0:x.id,W.userRefreshTrigger]),a(function(){e(void 0,void 0,void 0,function(){var e,n;return t(this,function(t){switch(t.label){case 0:if(H)return[2];if(J(!0),!W.callbacks)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,W.callbacks.listSpendingMethodsByCartId(W.cartId)];case 2:return e=t.sent(),W.spendingMethods=e.map(function(e){return new v(e)}),[4,Q()];case 3:return t.sent(),[3,5];case 4:return n=t.sent(),console.error("Failed to fetch cart data",n),[3,5];case 5:return J(!1),[2]}})})},[W.cartId,W.cartRefreshTrigger]);var X=function(){W.setWidgetMode(y.MINI_MODE),setTimeout(function(){W.resetNavigation()},300)};a(function(){return W.currentWidgetMode===y.WIDGET_MODE?document.body.style.overflow="hidden":document.body.style.overflow="",function(){document.body.style.overflow=""}},[W.currentWidgetMode]);var Z=s(null),ee=Z[0],te=Z[1],ne=s(null),re=ne[0],ie=ne[1],oe=W.navigationStack.length,se=oe>1?W.navigationStack[1]:null,ae=oe>2?W.navigationStack[2]:null;a(function(){se&&te(se)},[se]),a(function(){ae&&ie(ae)},[ae]);var le=W.loyaltyWidget.settings.position||g.RIGHT,ce=W.loyaltyWidget.settings.type||p.DRAWER,de=function(e){switch(e){case E.CREDIT_SPENDING_METHODS_SCREEN:return o.createElement(M,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.CREDIT_EARNING_METHODS_SCREEN:return o.createElement(k,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.CREDIT_HISTORY_SCREEN:return o.createElement(I,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.LOYALTY_LEVEL_SCREEN:return o.createElement(C,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});case E.GIFT_PRODUCT_SELECTION_SCREEN:return o.createElement(_,{viewModel:W,onBack:function(){return W.popScreen()},onClose:X});default:return null}};if(!G)return null;var ue=(null==U?void 0:U.position)||(null===(N=window.ikasLoyaltyWidgetConfig)||void 0===N?void 0:N.position)||"fixed";return o.createElement(l,{i18n:O},o.createElement(A,{$layoutType:ce,$widgetPosition:le,$widgetMode:W.currentWidgetMode,$position:ue,onClick:function(){W.currentWidgetMode===y.WIDGET_MODE&&X()},className:"ikas-storefront-widget"},o.createElement(L,{$isVisible:W.currentWidgetMode===y.MINI_MODE,$widgetPosition:le},o.createElement(w,{viewModel:W,isInitialized:G}),o.createElement(b,{viewModel:W})),o.createElement(P,{$layoutType:ce,$isOpen:W.currentWidgetMode===y.WIDGET_MODE,$widgetPosition:le,onClick:function(e){return e.stopPropagation()}},o.createElement(j,{$isActive:W.isMainScreen,$layer:0,$layoutType:ce},o.createElement(S,{viewModel:W,onClose:X,onNavigate:function(e){return W.pushScreen(e)}})),o.createElement(j,{$isActive:!!se,$layer:1,$layoutType:ce},de(se||ee)),o.createElement(j,{$isActive:!!ae,$layer:2,$layoutType:ce},de(ae||re)))))});export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{observer as e}from"mobx-react";import t from"react";import'./../../../ext/react-i18next/dist/es/context.js';import{useTranslation as n}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{XClose as r}from"../../../assets/icons/x-close.js";import{ChevronLeft as l}from"../../../assets/icons/chevron-left.js";import{LoyaltyProgramPointHistoryTypeEnum as o}from"../../../models/types/index.js";import
|
|
1
|
+
import{observer as e}from"mobx-react";import t from"react";import'./../../../ext/react-i18next/dist/es/context.js';import{useTranslation as n}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{XClose as r}from"../../../assets/icons/x-close.js";import{ChevronLeft as l}from"../../../assets/icons/chevron-left.js";import{LoyaltyProgramPointHistoryTypeEnum as o,EarningMethodTypeEnum as a}from"../../../models/types/index.js";import i from"../../components/count-up/index.js";import{getRefundIcon as m,getHistoryEarningMethodLabel as c,getEarningMethodIcon as s}from"../../../utils.js";import{Container as u,Header as d,IconButton as E,Title as y,Content as p,PointsSection as f,PointsTitle as h,PointsValue as g,HistoryList as T,HistoryItem as R,HistoryItemLeft as j,HistoryItemTitle as x,EarningMethodInfo as v,EarningMethodIcon as F,HistoryItemDate as w,HistoryItemAmount as D,Divider as I}from"./style.js";var N=e(function(e){var N=e.viewModel,b=e.onBack,A=e.onClose,k=n(),C=k.t,L=k.i18n,P=N.user,M=N.pointHistory,W=N.earningMethods;return t.createElement(u,null,t.createElement(d,null,t.createElement(E,{onClick:b},t.createElement(l,null)),t.createElement(y,null,C("screens.creditHistory")),t.createElement(E,{onClick:A},t.createElement(r,null))),t.createElement(p,null,P&&t.createElement(f,{$borderRadius:N.loyaltyWidget.settings.cartBorderRadius},t.createElement(h,null,C("header.earnedPoints")),t.createElement(g,null,t.createElement(i,{end:P.totalPoint}))),t.createElement(T,null,M.map(function(e,n){var r=e.type===o.EARN||e.type===o.REFILL,l=function(e){var t=e.loyaltyProgramEarningMethodId;if(!t)return null;var n=W.find(function(e){return e.id===t});return e.type===o.REFUND?{label:C("history.orderRefund"),icon:m(N.loyaltyWidget.settings.widgetIconType),methodType:a.ORDER_CREATE}:n&&e.type===o.EARN?{label:c(n.methodType),icon:s(n.methodType,N.loyaltyWidget.settings.widgetIconType),methodType:n.methodType}:null}(e);return t.createElement(t.Fragment,{key:e.id},t.createElement(R,null,t.createElement(j,null,t.createElement(x,null,function(){switch(e.type){case o.EARN:return C("history.earnedTitle");case o.SPEND:return C("history.spentTitle");case o.REFUND:return C("history.refundTitle");case o.REFILL:return C("history.refillTitle");default:return C("history.earnedTitle")}}()),l&&t.createElement(t.Fragment,null,t.createElement(v,null,l.icon&&t.createElement(F,null,l.icon),l.label)),t.createElement(w,null,function(e){if(!e)return"";try{return new Intl.DateTimeFormat(L.language,{day:"numeric",month:"long",year:"numeric"}).format(new Date(e))}catch(t){return e}}(e.createdAt))),t.createElement(D,{$isEarn:r},r?"":"-",e.amount)),n<M.length-1&&t.createElement(I,null))}))))});export{N as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LoyaltyWidgetViewModel } from "models";
|
|
3
|
+
type Props = {
|
|
4
|
+
viewModel: LoyaltyWidgetViewModel;
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const GiftProductSelectionScreen: React.FC<Props>;
|
|
9
|
+
export default GiftProductSelectionScreen;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__spreadArray as e,__awaiter as t,__generator as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import{observer as l}from"mobx-react";import i,{useState as o}from"react";import'./../../../ext/react-i18next/dist/es/context.js';import{useTranslation as r}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import{ChevronLeft as s}from"../../../assets/icons/chevron-left.js";import{XClose as a}from"../../../assets/icons/x-close.js";import{Album02 as d}from"../../../assets/widget-icons/normal/album02.js";import{Scenery as u}from"../../../assets/widget-icons/illustraions/scenery.js";import{WidgetIconTypeEnum as c}from"../../../models/loyalty-widget/types/index.js";import m from"../../components/button/index.js";import v from"../../components/count-up/index.js";import{getFreeProductMethods as f}from"../../utils/spending-method-utils.js";import{ProductCard as p,ProductCardContent as g,ProductImageContainer as E,ProductImage as y,ProductInfo as b,ProductNameContainer as h,ProductName as I,VariantText as j,PointBadge as S,Container as x,Header as P,IconButton as M,Title as w,Content as T,PointsSection as A,PointsTitle as R,PointsValue as k,ProductList as C}from"./style.js";var L=l(function(e){var l,s,a,v,f=e.method,x=e.viewModel,P=r().t,M=o(!1),w=M[0],T=M[1],A=x.loyaltyWidget,R=null===(l=f.discountSettings)||void 0===l?void 0:l.freeProductId,k=null===(s=f.discountSettings)||void 0===s?void 0:s.freeProductVariantId,C=R?x.products.find(function(e){return e.id===R}):null,L=k?null===(a=null==C?void 0:C.variants)||void 0===a?void 0:a.find(function(e){return e.id===k}):null,_=(null==L?void 0:L.mainImageSrc)||(null==C?void 0:C.mainImageSrc),W=(null==L?void 0:L.variantText)||null,z=(null===(v=f.discountSettings)||void 0===v?void 0:v.point)||0,B=A.settings.widgetIconType===c.ILLUSTRATION?u:d;return i.createElement(p,null,i.createElement(g,null,i.createElement(E,null,_?i.createElement(y,{src:_,alt:(null==C?void 0:C.name)||""}):i.createElement(B,null)),i.createElement(b,null,i.createElement(h,null,i.createElement(I,null,(null==C?void 0:C.name)||"-"),W&&i.createElement(j,null,W)),i.createElement(S,null,P("earningMethods.xPoints",{points:z})))),i.createElement(m,{button:A.button,paddingSize:"small",fontSize:"textSMMedium",onClick:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:if(!x.cartId||!f.isAvailable)return[2];T(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,null===(e=x.callbacks)||void 0===e?void 0:e.useLoyaltyPoints({cartId:x.cartId,loyaltyProgramId:f.loyaltyProgramId,loyaltySpendingMethodId:f.id})];case 2:return t.sent()&&(x.userRefreshTrigger++,x.cartRefreshTrigger++,x.resetNavigation()),[3,4];case 3:return T(!1),[7];case 4:return[2]}})})},isLoading:w,disabled:!f.isAvailable||!x.cartId,fullWidth:!0},P("spendingMethods.FREE_PRODUCT.addFree")))}),_=l(function(t){var n=t.viewModel,l=t.onBack,o=t.onClose,d=r().t,u=n.user,c=f(n.spendingMethods),m=e([],c,!0).sort(function(e,t){var n,l;return e.isAvailable&&!t.isAvailable?-1:!e.isAvailable&&t.isAvailable?1:((null===(n=e.discountSettings)||void 0===n?void 0:n.point)||0)-((null===(l=t.discountSettings)||void 0===l?void 0:l.point)||0)});return i.createElement(x,null,i.createElement(P,null,i.createElement(M,{onClick:l},i.createElement(s,null)),i.createElement(w,null,d("screens.giftProductSelection")),i.createElement(M,{onClick:o},i.createElement(a,null))),i.createElement(T,null,u&&i.createElement(A,{$borderRadius:n.loyaltyWidget.settings.cartBorderRadius},i.createElement(R,null,d("header.earnedPoints")),i.createElement(k,null,i.createElement(v,{end:u.totalPoint}))),i.createElement(C,null,m.map(function(e){return i.createElement(L,{key:e.id,method:e,viewModel:n})}))))});export{_ as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const IconButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
5
|
+
export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const PointsSection: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
+
$borderRadius: number;
|
|
8
|
+
}, never>;
|
|
9
|
+
export declare const PointsTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const PointsValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const ProductList: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const ProductCard: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const ProductCardContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const ProductImageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const ProductImage: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
16
|
+
export declare const ProductInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const ProductNameContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const ProductName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const VariantText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const PointBadge: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import e from"styled-components";import{textMDMedium as o,textSMMedium as i,textXLSemiBold as d,textSM as r}from"../../components/style/typography.js";var t,p,l,f,a,x,c,s,g,b,u,y,m,h,v,w,k,j,z=e.div(t||(t=n(["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"],["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"]))),R=e.div(p||(p=n(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"]))),$=e.div(l||(l=n(["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"],["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"])),o),_=e.button(f||(f=n(["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"],["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"]))),q=e.div(a||(a=n(["\n padding-top: 20px;\n padding-bottom: 20px;\n flex: 1;\n overflow-y: auto;\n"],["\n padding-top: 20px;\n padding-bottom: 20px;\n flex: 1;\n overflow-y: auto;\n"]))),A=e.div(x||(x=n(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n margin: 0 16px 20px 16px;\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n margin: 0 16px 20px 16px;\n"])),function(n){var e=n.$borderRadius;return"".concat(e,"px")}),B=e.div(c||(c=n(["\n ","\n color: #121926;\n"],["\n ","\n color: #121926;\n"])),i),C=e.div(s||(s=n(["\n ","\n color: #121926;\n"],["\n ","\n color: #121926;\n"])),d),D=e.div(g||(g=n(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 0 16px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 0 16px;\n"]))),E=e.div(b||(b=n(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 12px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n"],["\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 12px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n"]))),F=e.div(u||(u=n(["\n display: flex;\n gap: 12px;\n align-items: flex-start;\n"],["\n display: flex;\n gap: 12px;\n align-items: flex-start;\n"]))),G=e.div(y||(y=n(["\n width: 48px;\n height: 48px;\n min-width: 48px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background-color: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"],["\n width: 48px;\n height: 48px;\n min-width: 48px;\n border-radius: 6px;\n border: 1px solid #eef2f6;\n background-color: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"]))),H=e.img(m||(m=n(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"],["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"]))),I=e.div(h||(h=n(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-width: 0;\n"],["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-width: 0;\n"]))),J=e.div(v||(v=n(["\n display: flex;\n flex-direction: column;\n gap: 2px;\n"],["\n display: flex;\n flex-direction: column;\n gap: 2px;\n"]))),K=e.div(w||(w=n(["\n ","\n color: #121926;\n word-break: break-word;\n"],["\n ","\n color: #121926;\n word-break: break-word;\n"])),i),L=e.div(k||(k=n(["\n ","\n color: #697586;\n"],["\n ","\n color: #697586;\n"])),r),M=e.div(j||(j=n(["\n display: inline-flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n width: fit-content;\n"],["\n display: inline-flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n width: fit-content;\n"])),r);export{z as Container,q as Content,R as Header,_ as IconButton,M as PointBadge,A as PointsSection,B as PointsTitle,C as PointsValue,E as ProductCard,F as ProductCardContent,H as ProductImage,G as ProductImageContainer,I as ProductInfo,D as ProductList,K as ProductName,J as ProductNameContainer,$ as Title,L as VariantText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{observer as t}from"mobx-react";import n,{useMemo as r}from"react";import{Trans as l}from'./../../../ext/react-i18next/dist/es/Trans.js';import{useTranslation as o}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import'./../../../ext/react-i18next/dist/es/context.js';import{XClose as i}from"../../../assets/icons/x-close.js";import{ChevronLeft as
|
|
1
|
+
import{__spreadArray as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{observer as t}from"mobx-react";import n,{useMemo as r}from"react";import{Trans as l}from'./../../../ext/react-i18next/dist/es/Trans.js';import{useTranslation as o}from'./../../../ext/react-i18next/dist/es/useTranslation.js';import'./../../../ext/react-i18next/dist/es/context.js';import{XClose as i}from"../../../assets/icons/x-close.js";import{ChevronLeft as a}from"../../../assets/icons/chevron-left.js";import{Check as c}from"../../../assets/icons/check.js";import s from"../../components/count-up/index.js";import{Container as u,Header as m,IconButton as d,Title as p,Content as E,PointsSection as y,PointsText as f,PointsValue as v,ProgressBarContainer as g,ProgressBarFill as h,DescriptionText as R,TimelineContainer as $,TimelineItem as k,TimelineLine as x,CheckIconContainer as b,CurrentIndicator as j,CurrentIndicatorDot as T,UpcomingIndicator as q,TimelineContent as P,TimelineTitle as C,TimelineDescription as L,MultiplierSection as M,MultiplierValue as S}from"./style.js";var W=t(function(t){var W=t.viewModel,B=t.onBack,G=t.onClose,_=o().t,D=W.user,N=W.tiers,I=r(function(){return e([],N,!0).sort(function(e,t){return(e.pointsRequired||0)-(t.pointsRequired||0)})},[N]),w=r(function(){return(null==D?void 0:D.customerTier)?I.findIndex(function(e){var t;return e.id===(null===(t=D.customerTier)||void 0===t?void 0:t.id)}):-1},[I,null==D?void 0:D.customerTier]),A=r(function(){return D?-1===w?I.find(function(e){return(e.pointsRequired||0)>D.totalPoint})||I[0]:I[w+1]||null:null},[I,w,D]),K=r(function(){return D?A?0===(A.pointsRequired||0)?100:Math.min(D.totalPoint/(A.pointsRequired||1)*100,100):100:0},[D,A]),z=r(function(){return D&&A?Math.max(0,(A.pointsRequired||0)-D.totalPoint):0},[D,A]);return D?n.createElement(u,null,n.createElement(m,null,n.createElement(d,{onClick:B},n.createElement(a,null)),n.createElement(p,null,_("screens.loyaltyLevel")),n.createElement(d,{onClick:G},n.createElement(i,null))),n.createElement(E,null,n.createElement(y,{$borderRadius:W.loyaltyWidget.settings.cartBorderRadius},n.createElement("div",null,n.createElement(f,null,_("header.earnedPoints")),n.createElement(v,null,n.createElement(s,{end:D.totalPoint})," ",_("common.points"))),n.createElement(g,{$color:W.loyaltyWidget.header.background.progressBarContainerColor||void 0},n.createElement(h,{$percentage:K,$color:W.loyaltyWidget.header.background.bgColor||void 0,$isGradient:"GRADIENT"===W.loyaltyWidget.header.background.type})),n.createElement(R,null,A?_("screens.loyaltyLevelScreen.reachNextTier",{tierName:A.name,points:z}):_("screens.loyaltyLevelScreen.allTiersCompleted"))),n.createElement($,null,I.map(function(e,t){var r="upcoming";w>-1?r=t<w?"completed":t===w?"current":"upcoming":D.totalPoint>=(e.pointsRequired||0)&&(r="completed");var o=t===I.length-1,i="solid-light",a=!0,s=!0;return"completed"===r?w>-1&&t+1===w?(i="solid-dark",a=!0,s=!1):w>-1&&t+1<w?(i="solid-dark",a=!0,s=!0):(i="solid-light",a=!0,s=!0):"current"===r?(i="split",a=!1,s=!0):(i="solid-light",a=!0,s=!0),n.createElement(k,{key:e.id},n.createElement(x,{$isLast:o,$connectionType:i,$topGap:a,$bottomGap:s}),"completed"===r?n.createElement(b,null,n.createElement(c,null)):"current"===r?n.createElement(j,null,n.createElement(T,null)):n.createElement(q,null),n.createElement(P,null,n.createElement(C,{$status:r},e.name),n.createElement(L,{$status:r},"current"===r?_("screens.loyaltyLevelScreen.currentTierDescription"):"".concat(e.pointsRequired||0," ").concat(_("common.points")," ").concat(_("screens.loyaltyLevelScreen.afterEarning"))),(e.tierPointMultiplier||1)>1&&n.createElement(M,{$borderRadius:W.loyaltyWidget.settings.cartBorderRadius},n.createElement(l,{i18nKey:"screens.loyaltyLevelScreen.multiplierDescription",values:{multiplier:e.tierPointMultiplier||1},components:[n.createElement(S,{key:"0"})]}))))})))):null});export{W as default};
|
|
@@ -8,7 +8,9 @@ export declare const PointsSection: import("styled-components").StyledComponent<
|
|
|
8
8
|
}, never>;
|
|
9
9
|
export declare const PointsText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
10
|
export declare const PointsValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
-
export declare const ProgressBarContainer: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
export declare const ProgressBarContainer: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
$color?: string;
|
|
13
|
+
}, never>;
|
|
12
14
|
export declare const ProgressBarFill: import("styled-components").StyledComponent<"div", any, {
|
|
13
15
|
$percentage: number;
|
|
14
16
|
$color?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import e,{css as i}from"styled-components";import{textMDMedium as t,textSM as o,textSMMedium as r,textSMSemiBold as d}from"../../components/style/typography.js";var p,a,l,x,c,f,s,g,u,b,h,m,y,v,w,k,j
|
|
1
|
+
import{__makeTemplateObject as n}from'./../../../ext/tslib/tslib.es6.mjs.js';import e,{css as i}from"styled-components";import{textMDMedium as t,textSM as o,textSMMedium as r,textSMSemiBold as d}from"../../components/style/typography.js";var p,a,l,x,c,f,s,g,u,b,h,m,y,v,w,k,j,$,z,B,A,E,C,G,F,R=e.div(p||(p=n(["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"],["\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: #ffffff;\n"]))),L=e.div(a||(a=n(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px;\n border-bottom: 1px solid #eef2f6;\n position: sticky;\n top: 0;\n background-color: #ffffff;\n z-index: 10;\n"]))),T=e.div(l||(l=n(["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"],["\n ","\n color: #121926;\n text-align: center;\n flex: 1;\n"])),t),_=e.button(x||(x=n(["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"],["\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #697586;\n\n &:hover {\n opacity: 0.8;\n }\n"]))),q=e.div(c||(c=n(["\n padding: 20px 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 32px;\n flex: 1;\n"],["\n padding: 20px 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 32px;\n flex: 1;\n"]))),D=e.div(f||(f=n(["\n display: flex;\n width: 100%;\n padding: 16px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n box-sizing: border-box;\n"],["\n display: flex;\n width: 100%;\n padding: 16px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 16px;\n border-radius: ",";\n border: 1px solid #eef2f6;\n background: #fff;\n box-shadow:\n 0 7px 2px 0 rgba(0, 0, 0, 0),\n 0 5px 2px 0 rgba(0, 0, 0, 0.01),\n 0 3px 2px 0 rgba(0, 0, 0, 0.02),\n 0 1px 1px 0 rgba(0, 0, 0, 0.03),\n 0 0 1px 0 rgba(0, 0, 0, 0.04);\n box-sizing: border-box;\n"])),function(n){var e=n.$borderRadius;return"".concat(e,"px")}),H=e.div(s||(s=n(["\n ","\n color: #4B5565;\n text-align: center;\n"],["\n ","\n color: #4B5565;\n text-align: center;\n"])),o),I=e.div(g||(g=n(["\n ","\n color: #121926;\n margin-top: 2px;\n text-align: center;\n"],["\n ","\n color: #121926;\n margin-top: 2px;\n text-align: center;\n"])),t),J=e.div(u||(u=n(["\n width: 100%;\n height: 8px;\n border-radius: 4px;\n background: ",";\n overflow: hidden;\n"],["\n width: 100%;\n height: 8px;\n border-radius: 4px;\n background: ",";\n overflow: hidden;\n"])),function(n){return n.$color||"#eef2f6"}),K=e.div(b||(b=n(["\n width: ","%;\n height: 100%;\n border-radius: 4px;\n background: ",";\n transition: width 0.3s ease-in-out;\n"],["\n width: ","%;\n height: 100%;\n border-radius: 4px;\n background: ",";\n transition: width 0.3s ease-in-out;\n"])),function(n){return n.$percentage},function(n){return n.$isGradient?"linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%), ".concat(n.$color||"#4F46E5"):n.$color||"#4F46E5"}),M=e.div(h||(h=n(["\n color: #4b5565;\n text-align: center;\n ","\n"],["\n color: #4b5565;\n text-align: center;\n ","\n"])),o),N=e.div(m||(m=n(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 0 6px;\n box-sizing: border-box;\n"],["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 0 6px;\n box-sizing: border-box;\n"]))),O=e.div(y||(y=n(["\n display: flex;\n gap: 16px;\n position: relative;\n padding-bottom: 48px;\n\n &:last-child {\n padding-bottom: 0;\n }\n"],["\n display: flex;\n gap: 16px;\n position: relative;\n padding-bottom: 48px;\n\n &:last-child {\n padding-bottom: 0;\n }\n"]))),P=e.div(v||(v=n(["\n position: absolute;\n left: 10px; /* Center of the 20px icon */\n top: ",";\n bottom: ",";\n width: 1px;\n display: ",";\n background: ",";\n"],["\n position: absolute;\n left: 10px; /* Center of the 20px icon */\n top: ",";\n bottom: ",";\n width: 1px;\n display: ",";\n background: ",";\n"])),function(n){return n.$topGap?"26px":"20px"},function(n){return n.$bottomGap?"6px":"0"},function(n){return n.$isLast?"none":"block"},function(n){switch(n.$connectionType){case"solid-dark":return"#9AA4B2";case"solid-light":default:return"#E3E8EF";case"split":return"linear-gradient(to bottom, #9AA4B2 50%, #E3E8EF 50%)"}}),Q=e.div(w||(w=n(["\n flex: 1;\n display: flex;\n flex-direction: column;\n"],["\n flex: 1;\n display: flex;\n flex-direction: column;\n"]))),S=e.div(j||(j=n(["\n ","\n color: ",";\n\n ","\n"],["\n ","\n color: ",";\n\n ","\n"])),r,function(n){return"completed"===n.$status?"#697586":"#121926"},function(e){return"completed"===e.$status&&i(k||(k=n(["\n text-decoration-line: line-through;\n "],["\n text-decoration-line: line-through;\n "])))}),U=e.div(z||(z=n(["\n ","\n margin-top: 2px;\n color: ","; /* Current #4B5565. Completed #9AA4B2 */\n\n ","\n"],["\n ","\n margin-top: 2px;\n color: ","; /* Current #4B5565. Completed #9AA4B2 */\n\n ","\n"])),o,function(n){return"completed"===n.$status?"#9AA4B2":"#4B5565"},function(e){return"completed"===e.$status&&i($||($=n(["\n text-decoration-line: line-through;\n "],["\n text-decoration-line: line-through;\n "])))}),V=e.div(B||(B=n(["\n padding: 8px 16px;\n align-self: stretch;\n border-radius: ",";\n background: var(--Gray-Blue-50, #f8fafc);\n margin-top: 12px;\n ","\n color: #4B5565;\n"],["\n padding: 8px 16px;\n align-self: stretch;\n border-radius: ",";\n background: var(--Gray-Blue-50, #f8fafc);\n margin-top: 12px;\n ","\n color: #4B5565;\n"])),function(n){var e=n.$borderRadius;return"".concat(e,"px")},o),W=e.span(A||(A=n(["\n ","\n color: #121926;\n"],["\n ","\n color: #121926;\n"])),d),X=e.div(E||(E=n(["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n border-radius: 10px;\n background: #eef2f6;\n z-index: 2;\n\n svg {\n width: 14px;\n height: 14px;\n color: #121926;\n }\n"],["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n border-radius: 10px;\n background: #eef2f6;\n z-index: 2;\n\n svg {\n width: 14px;\n height: 14px;\n color: #121926;\n }\n"]))),Y=e.div(C||(C=n(["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n border-radius: 10px;\n border: 0.8px solid #121926;\n background: #fff;\n z-index: 2;\n box-sizing: border-box;\n"],["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n border-radius: 10px;\n border: 0.8px solid #121926;\n background: #fff;\n z-index: 2;\n box-sizing: border-box;\n"]))),Z=e.div(G||(G=n(["\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n\n border-radius: 5px;\n background: #121926;\n"],["\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n\n border-radius: 5px;\n background: #121926;\n"]))),nn=e.div(F||(F=n(["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 10px;\n background: #eef2f6;\n z-index: 2;\n"],["\n display: flex;\n width: 20px;\n height: 20px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 10px;\n background: #eef2f6;\n z-index: 2;\n"])));export{X as CheckIconContainer,R as Container,q as Content,Y as CurrentIndicator,Z as CurrentIndicatorDot,M as DescriptionText,L as Header,_ as IconButton,V as MultiplierSection,W as MultiplierValue,D as PointsSection,H as PointsText,I as PointsValue,J as ProgressBarContainer,K as ProgressBarFill,N as TimelineContainer,Q as TimelineContent,U as TimelineDescription,O as TimelineItem,P as TimelineLine,S as TimelineTitle,T as Title,nn as UpcomingIndicator};
|