@ikas/storefront 4.0.0-beta.2 → 4.0.0-beta.21
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/analytics/analytics.js +1 -1
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/googleUniversal.js +1 -1
- package/build/analytics/ikas.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/form-item/model.d.ts +8 -0
- package/build/components/checkout/components/form-item/model.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.js +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal/index.d.ts +1 -2
- package/build/components/checkout/components/master-pass/modal/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/{modal-success → modal}/svg/master-pass-by-master-card-small.d.ts +0 -0
- package/build/components/checkout/components/master-pass/{modal-success → modal}/svg/master-pass-by-master-card-small.js +0 -0
- package/build/components/checkout/components/master-pass/modal/svg/modal-close.js +1 -1
- package/build/components/checkout/components/master-pass/modal-link-card-to-client/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-success/index.js +1 -1
- package/build/components/checkout/components/master-pass/modal-success/style.module.scss.js +1 -1
- package/build/components/checkout/components/master-pass/payment-gateway/svg/troy.d.ts +6 -0
- package/build/components/checkout/components/master-pass/payment-gateway/svg/troy.js +1 -0
- package/build/components/checkout/components/master-pass/payment-gateway/svg/visa.d.ts +6 -0
- package/build/components/checkout/components/master-pass/payment-gateway/svg/visa.js +1 -0
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/offer-product/style.module.scss.js +1 -1
- package/build/components/checkout/components/quick-registration/completed.d.ts +7 -0
- package/build/components/checkout/components/quick-registration/completed.js +1 -0
- package/build/components/checkout/components/quick-registration/index.d.ts +7 -0
- package/build/components/checkout/components/quick-registration/index.js +1 -0
- package/build/components/checkout/components/quick-registration/model.d.ts +19 -0
- package/build/components/checkout/components/quick-registration/model.js +1 -0
- package/build/components/checkout/components/quick-registration/style.module.scss.js +1 -0
- package/build/components/checkout/components/svg/success-circle.js +1 -1
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +8 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/modelMasterPass.d.ts +3 -0
- package/build/components/checkout/modelMasterPass.js +1 -1
- package/build/components/checkout/steps/step-info/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/image/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.d.ts +2 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/model.d.ts +1 -0
- package/build/components/page-editor/model.js +1 -1
- package/build/models/data/blog/category/index.js +1 -1
- package/build/models/data/blog/content/index.js +1 -1
- package/build/models/data/blog/index.js +1 -1
- package/build/models/data/blog/meta-data/index.js +1 -1
- package/build/models/data/blog/tag/index.js +1 -1
- package/build/models/data/blog/writer/index.js +1 -1
- package/build/models/data/brand/index.js +1 -1
- package/build/models/data/brand/translation/index.js +1 -1
- package/build/models/data/category/index.js +1 -1
- package/build/models/data/category/path-item/index.js +1 -1
- package/build/models/data/category/translations/index.js +1 -1
- package/build/models/data/checkout-settings/index.d.ts +1 -0
- package/build/models/data/checkout-settings/index.js +1 -1
- package/build/models/data/checkout-settings/option/index.js +1 -1
- package/build/models/data/checkout-settings/price/index.js +1 -1
- package/build/models/data/city/index.js +1 -1
- package/build/models/data/html-meta-data/index.js +1 -1
- package/build/models/data/html-meta-data/translations/index.js +1 -1
- package/build/models/data/order/line-item/option/value/index.d.ts +2 -0
- package/build/models/data/order/line-item/option/value/index.js +1 -1
- package/build/models/data/product/attribute/index.js +1 -1
- package/build/models/data/product/attribute/option/index.js +1 -1
- package/build/models/data/product/attribute/table-cell/index.js +1 -1
- package/build/models/data/product/attribute/table-template/index.js +1 -1
- package/build/models/data/product/attribute/translation/index.js +1 -1
- package/build/models/data/product/attribute-value/index.js +1 -1
- package/build/models/data/product/back-in-stock-settings/index.js +1 -1
- package/build/models/data/product/base-unit/index.js +1 -1
- package/build/models/data/product/campaign/data/index.js +1 -1
- package/build/models/data/product/campaign/filter/index.js +1 -1
- package/build/models/data/product/campaign/index.js +1 -1
- package/build/models/data/product/campaign/product-buyx-then-gety/index.js +1 -1
- package/build/models/data/product/campaign/product-campaign-date-range-field/index.js +1 -1
- package/build/models/data/product/campaign/product-fixed-discount/index.js +1 -1
- package/build/models/data/product/filter/index.d.ts +1 -2
- package/build/models/data/product/filter/index.js +1 -1
- package/build/models/data/product/image/index.js +1 -1
- package/build/models/data/product/index.d.ts +8 -2
- package/build/models/data/product/index.js +1 -1
- package/build/models/data/product/option-set/index.js +1 -1
- package/build/models/data/product/option-set/option/index.js +1 -1
- package/build/models/data/product/tag/index.js +1 -1
- package/build/models/data/product/variant/index.js +1 -1
- package/build/models/data/product/variant/price/index.js +1 -1
- package/build/models/data/product/variant/unit/index.js +1 -1
- package/build/models/data/product/variant-type/index.js +1 -1
- package/build/models/data/theme-json/custom-data/index.js +1 -1
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/brand-list/index.d.ts +1 -1
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/index.d.ts +1 -1
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.js +1 -1
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/index.js +1 -1
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/page-data-init/index.d.ts +2 -1
- package/build/page-data-init/index.js +1 -1
- package/build/pages/checkout.js +1 -1
- package/build/store/base.d.ts +11 -12
- package/build/store/base.js +1 -1
- package/build/store/blog/index.js +1 -1
- package/build/store/brand/index.js +1 -1
- package/build/store/cart/index.js +1 -1
- package/build/store/category/index.js +1 -1
- package/build/store/checkout/index.js +1 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +13 -8
- package/build/store/customer/index.js +1 -1
- package/build/store/html-meta-data/index.js +1 -1
- package/build/store/index.d.ts +1 -0
- package/build/store/location/index.js +1 -1
- package/package.json +13 -13
- package/build/models/data/product/variant-type/init.d.ts +0 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export default class FormItemViewModel implements Props {
|
|
3
3
|
type: FormItemType;
|
|
4
4
|
inputType?: FormItemInputType;
|
|
5
|
+
inputMode?: FormItemInputMode;
|
|
5
6
|
options?: FormItemSelectOption[];
|
|
6
7
|
label: string;
|
|
7
8
|
value?: string;
|
|
@@ -27,6 +28,7 @@ export default class FormItemViewModel implements Props {
|
|
|
27
28
|
export interface Props {
|
|
28
29
|
type: FormItemType;
|
|
29
30
|
inputType?: FormItemInputType;
|
|
31
|
+
inputMode?: FormItemInputMode;
|
|
30
32
|
options?: FormItemSelectOption[];
|
|
31
33
|
label: string;
|
|
32
34
|
value?: string;
|
|
@@ -34,6 +36,8 @@ export interface Props {
|
|
|
34
36
|
errorText?: string;
|
|
35
37
|
name?: string;
|
|
36
38
|
autocomplete?: string;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
pattern?: string;
|
|
37
41
|
tooltipText?: string;
|
|
38
42
|
country?: string | null;
|
|
39
43
|
currentCountryCode?: string | null;
|
|
@@ -55,6 +59,10 @@ export declare type FormItemSelectOption = {
|
|
|
55
59
|
label: string;
|
|
56
60
|
};
|
|
57
61
|
export declare enum FormItemInputType {
|
|
62
|
+
TEXT = "text",
|
|
63
|
+
PASSWORD = "password"
|
|
64
|
+
}
|
|
65
|
+
export declare enum FormItemInputMode {
|
|
58
66
|
NUMERIC = "numeric",
|
|
59
67
|
TEL = "tel",
|
|
60
68
|
EMAIL = "email"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.type=t.type,this.inputType=t.inputType,this.options=t.options,this.label=t.label,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return this.value&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o,r=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.type=t.type,this.inputType=t.inputType,this.options=t.options,this.label=t.label,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return this.value&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.TEXT="text",e.PASSWORD="password"}(n||(n={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(o||(o={}));export{o as FormItemInputMode,n as FormItemInputType,i as FormItemType,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as a}from"mobx-react-lite";import t from"../svg/master-pass-by-master-card.js";import o from"../../../style.module.scss.js";import r from"./style.module.scss.js";import{createTranslationInputData as s,useTranslation as n}from"../../../../../utils/i18n.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{Button as i}from"../../button/index.js";import{Checkbox as c}from"../../checkbox/index.js";import{FormItem as d}from"../../form-item/index.js";import{FormItemType as l}from"../../form-item/model.js";var u=a((function(a){var u=a.vm,p=n().t,C=m.getTranslations()["checkout-page"],v=e.useMemo((function(){var e,a;return s(null===(a=null===(e=null==C?void 0:C.masterPass)||void 0===e?void 0:e.creditCardForm)||void 0===a?void 0:a.checkboxLabel)}),[C]),P=e.useMemo((function(){return e.createElement("div",{className:r.CheckboxLabel},v.map((function(a,o){return a.isVariable?e.createElement("span",{key:o,className:r.Logo},e.createElement(t,null)):e.createElement(e.Fragment,{key:o},a.value)})))}),[v]),M=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!0,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber;return e.createElement("div",null,e.createElement(c,{label:P,value:u.mpVM.saveCardToMasterPass.isCheckboxChecked,onChange:u.mpVM.onSaveCardToMasterPassCheckedChange}),u.mpVM.saveCardToMasterPass.isCheckboxChecked&&e.createElement("div",{className:r.FormWrapper},e.createElement("div",{className:o.RowPB},e.createElement(d,{name:"masterPassCardName",type:l.TEXT,label:p("checkout-page:masterPass.creditCardForm.cardName"),value:u.mpVM.saveCardToMasterPass.cardName,onChange:u.mpVM.onSaveCardToMasterPassCardNameChange})),u.mpVM.isSaveCardToMasterPassPhoneNumberInputVisible&&e.createElement("div",{className:o.RowPB},e.createElement(d,{name:"masterPassPhoneNumber",autocomplete:"tel",type:l.TEL,currentCountryCode:u.store.currentCountryCode,disabled:u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled,label:p("checkout-page:masterPass.creditCardForm.phoneNumber"),value:M,onChange:u.mpVM.onSaveCardToMasterPassPhoneNumberChange})),e.createElement(i,{style:{width:"100%"},text:p("checkout-page:masterPass.creditCardForm.button"),isDisabled:u.mpVM.isSendConfirmationButtonDisabled,isLoading:u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending,onClick:function(){if(!u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending&&(console.log("onSendConfirmationButtonClick 1"),u.checkout.selectedPaymentGateway&&(console.log("onSendConfirmationButtonClick 2"),u.cardData&&u.cardData.cardNumber&&u.cardData.expirationDate&&u.cardData.cvv&&(console.log("onSendConfirmationButtonClick 3"),u.mpVM.saveCardToMasterPass.cardName)))){console.log("onSendConfirmationButtonClick 4");var e=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!1,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber.replace("+","");if(e){var a,t,o,r,s={creditCard:{rtaPan:u.cardData.cardNumber.replace(/ /g,""),expiryDate:(a=u.cardData.expirationDate,t=a.replace(" / ",""),o=t.substring(0,2),r=t.substring(2,4),"".concat(r).concat(o)),cvc:u.cardData.cvv,accountAliasName:u.mpVM.saveCardToMasterPass.cardName,phoneNumber:e},store:u.store,checkout:u.checkout,paymentGateway:u.checkout.selectedPaymentGateway,callback:function(){u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!1}};console.log("onSendConfirmationButtonClick 5",s),u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!0,u.mpVM.onSaveCardToMasterPassSendConfirmationButtonClick(s)}}}})))}));export{u as default};
|
|
1
|
+
import e from"react";import{observer as a}from"mobx-react-lite";import t from"../svg/master-pass-by-master-card.js";import o from"../../../style.module.scss.js";import r from"./style.module.scss.js";import{createTranslationInputData as s,useTranslation as n}from"../../../../../utils/i18n.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{Button as i}from"../../button/index.js";import{Checkbox as c}from"../../checkbox/index.js";import{FormItem as d}from"../../form-item/index.js";import{FormItemType as l}from"../../form-item/model.js";var u=a((function(a){var u=a.vm,p=n().t,C=m.getTranslations()["checkout-page"],v=e.useMemo((function(){var e,a;return s(null===(a=null===(e=null==C?void 0:C.masterPass)||void 0===e?void 0:e.creditCardForm)||void 0===a?void 0:a.checkboxLabel)}),[C]),P=e.useMemo((function(){return e.createElement("div",{className:r.CheckboxLabel},v.map((function(a,o){var s,n,m,i;return a.isVariable?"{{ link }}"===a.value?e.createElement("a",{key:o,className:r.MasterPassInfoLink,title:null===(n=null===(s=null==C?void 0:C.masterPass)||void 0===s?void 0:s.creditCardForm)||void 0===n?void 0:n.moreInformation,target:"_blank",href:"https://www.masterpassturkiye.com/TermsAndConditions.aspx"},null===(i=null===(m=null==C?void 0:C.masterPass)||void 0===m?void 0:m.creditCardForm)||void 0===i?void 0:i.checkboxLabelLink):e.createElement("span",{key:o,className:r.Logo},e.createElement(t,null)):e.createElement(e.Fragment,{key:o},a.value)})))}),[v]),M=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!0,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber;return e.createElement("div",null,e.createElement(c,{label:P,value:u.mpVM.saveCardToMasterPass.isCheckboxChecked,onChange:u.mpVM.onSaveCardToMasterPassCheckedChange}),u.mpVM.saveCardToMasterPass.isCheckboxChecked&&e.createElement("div",{className:r.FormWrapper},e.createElement("div",{className:o.RowPB},e.createElement(d,{name:"masterPassCardName",type:l.TEXT,label:p("checkout-page:masterPass.creditCardForm.cardName"),value:u.mpVM.saveCardToMasterPass.cardName,onChange:u.mpVM.onSaveCardToMasterPassCardNameChange})),u.mpVM.isSaveCardToMasterPassPhoneNumberInputVisible&&e.createElement("div",{className:o.RowPB},e.createElement(d,{name:"masterPassPhoneNumber",autocomplete:"tel",type:l.TEL,currentCountryCode:u.store.currentCountryCode,disabled:u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled,label:p("checkout-page:masterPass.creditCardForm.phoneNumber"),value:M,onChange:u.mpVM.onSaveCardToMasterPassPhoneNumberChange})),e.createElement(i,{style:{width:"100%"},text:p("checkout-page:masterPass.creditCardForm.button"),isDisabled:u.mpVM.isSendConfirmationButtonDisabled,isLoading:u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending,onClick:function(){if(!u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending&&(console.log("onSendConfirmationButtonClick 1"),u.checkout.selectedPaymentGateway&&(console.log("onSendConfirmationButtonClick 2"),u.cardData&&u.cardData.cardNumber&&u.cardData.expirationDate&&u.cardData.cvv&&(console.log("onSendConfirmationButtonClick 3"),u.mpVM.saveCardToMasterPass.cardName)))){console.log("onSendConfirmationButtonClick 4");var e=u.mpVM.isSaveCardToMasterPassPhoneNumberInputDisabled?u.mpVM.saveCardToMasterPassPhoneNumberDisabledInputValue({withPlus:!1,store:u.store,checkout:u.checkout}):u.mpVM.saveCardToMasterPass.phoneNumber.replace("+","");if(e){var a,t,o,r,s={creditCard:{rtaPan:u.cardData.cardNumber.replace(/ /g,""),expiryDate:(a=u.cardData.expirationDate,t=a.replace(" / ",""),o=t.substring(0,2),r=t.substring(2,4),"".concat(r).concat(o)),cvc:u.cardData.cvv,accountAliasName:u.mpVM.saveCardToMasterPass.cardName,phoneNumber:e},store:u.store,checkout:u.checkout,paymentGateway:u.checkout.selectedPaymentGateway,callback:function(){u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!1}};console.log("onSendConfirmationButtonClick 5",s),u.mpVM.saveCardToMasterPass.isSendConfirmationButtonPending=!0,u.mpVM.onSaveCardToMasterPassSendConfirmationButtonClick(s)}}}})))}));export{u as default};
|
package/build/components/checkout/components/master-pass/credit-card-form/style.module.scss.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var o={FormWrapper:"style-module_FormWrapper__cXImD",CheckboxLabel:"style-module_CheckboxLabel__KFrUu",Logo:"style-module_Logo__83gZK"};e(".style-module_FormWrapper__cXImD {\n margin-top: 16px;\n}\n\n.style-module_CheckboxLabel__KFrUu {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckboxLabel__KFrUu .style-module_Logo__83gZK {\n display: inline-block;\n vertical-align: middle;\n margin: 0 8px;\n}");export{o as default};
|
|
1
|
+
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var o={FormWrapper:"style-module_FormWrapper__cXImD",MasterPassInfoLink:"style-module_MasterPassInfoLink__UsDhH",CheckboxLabel:"style-module_CheckboxLabel__KFrUu",Logo:"style-module_Logo__83gZK"};e(".style-module_FormWrapper__cXImD {\n margin-top: 16px;\n}\n\n.style-module_MasterPassInfoLink__UsDhH {\n text-decoration: underline;\n}\n\n.style-module_CheckboxLabel__KFrUu {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckboxLabel__KFrUu .style-module_Logo__83gZK {\n display: inline-block;\n vertical-align: middle;\n margin: 0 8px;\n}");export{o as default};
|
|
@@ -2,10 +2,9 @@ import React from "react";
|
|
|
2
2
|
declare type Props = {
|
|
3
3
|
visible: boolean;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
footer?: React.ReactNode;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
};
|
|
8
|
-
declare const Modal: (({ visible,
|
|
7
|
+
declare const Modal: (({ visible, children, onClose }: Props) => JSX.Element | null) & {
|
|
9
8
|
displayName: string;
|
|
10
9
|
};
|
|
11
10
|
export default Modal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as
|
|
1
|
+
import e from"react";import{observer as l}from"mobx-react-lite";import t from"./svg/modal-close.js";import a from"./style.module.scss.js";import o from"../../modal/useEscape.js";import r from"./svg/master-pass-by-master-card-small.js";var m=l((function(l){var m=l.visible,s=l.children,n=l.onClose;return o({callback:function(){return n()}}),m?e.createElement("div",{className:a.ModalContainer},e.createElement("div",{role:"dialog","aria-modal":"true",className:a.Modal},e.createElement("button",{className:a.CloseButton,onClick:n},e.createElement(t,null)),e.createElement("div",{className:a.ModalContent},s),e.createElement("footer",{className:a.ModalFooter},e.createElement("div",null,e.createElement(r,null))))):null}));export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from'./../../../../../ext/style-inject/dist/style-inject.es.js';var
|
|
1
|
+
import n from'./../../../../../ext/style-inject/dist/style-inject.es.js';var o={ModalContainer:"style-module_ModalContainer__-ISMu",Modal:"style-module_Modal__MIUmp",CloseButton:"style-module_CloseButton__TK27f",ModalContent:"style-module_ModalContent__E-xV-",ModalFooter:"style-module_ModalFooter__9oRTZ"};n(".style-module_ModalContainer__-ISMu {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(39, 39, 39, 0.7);\n z-index: 99999999;\n}\n\n.style-module_Modal__MIUmp {\n position: relative;\n border-radius: 8px;\n background-color: #fff;\n width: 100%;\n max-width: 440px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_Modal__MIUmp {\n width: calc(100% - 32px);\n margin: 0 16px;\n }\n}\n\n.style-module_CloseButton__TK27f {\n position: absolute;\n top: 16px;\n right: 16px;\n width: 24px;\n height: 24px;\n cursor: pointer;\n color: var(--checkout-primary-text-color);\n background-color: transparent;\n outline: none;\n padding: 0;\n margin: 0;\n border: none;\n}\n\n.style-module_ModalContent__E-xV- {\n padding: 24px;\n}\n\n.style-module_ModalFooter__9oRTZ {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 12px 0;\n border-top: 1px solid var(--checkout-border-color);\n}");export{o as default};
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";var t=function(){return e.createElement("svg",{
|
|
1
|
+
import e from"react";var t=function(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},e.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElement("path",{fill:"currentColor",d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}))};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var n={Logo:"style-module_Logo__M-qDd",Text:"style-module_Text__o9r-L",SubInfoText:"style-module_SubInfoText__prqP-"};e(".style-module_Logo__M-qDd[data-mb] {\n margin-bottom: 16px;\n}\n\n.style-module_Text__o9r-L {\n font-size: 16px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n margin-bottom: 32px;\n}\n\n.style-module_SubInfoText__prqP- {\n margin-top: 12px;\n font-size: 14px;\n line-height: 20px;\n text-align: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_SubInfoText__prqP- span {\n display: inline-block;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n}");export{n as default};
|
|
1
|
+
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var n={Logo:"style-module_Logo__M-qDd",Text:"style-module_Text__o9r-L",SubInfoText:"style-module_SubInfoText__prqP-"};e(".style-module_Logo__M-qDd[data-mb] {\n margin-bottom: 16px;\n}\n\n.style-module_Text__o9r-L {\n font-size: 16px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n margin-bottom: 32px;\n}\n\n.style-module_SubInfoText__prqP- {\n margin-top: 12px;\n font-size: 14px;\n line-height: 20px;\n text-align: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_SubInfoText__prqP- span {\n display: inline-block;\n vertical-align: middle;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n}");export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,
|
|
1
|
+
import e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,d=n.type,f=n.vm,v=n.onClose,b=m().t,h=t(),k=o(180),x=k[0],g=k[1],M=o(""),E=M[0],P=M[1],T=o(!1),y=T[0],C=T[1],j=o(!1),O=j[0],N=j[1],V=function(){if(!O&&E&&f.checkout.masterPassPaymentGateway){N(!0),f.mpVM.onOtpFormSubmit({validationCode:E,store:f.store,checkout:f.checkout,callback:function(){N(!1),P(""),R()}})}},R=function(){g(0)},w=function(){g(180)},I=function(){g(180)};a((function(){if(!(x<1&&h.current))return h.current&&clearInterval(h.current),h.current=setInterval((function(){g(x-1)}),1e3),function(){h.current&&clearInterval(h.current)};clearInterval(h.current)}),[x]);var L,S,B,D,F,q,A=x<=120,G=e.createElement("div",null,e.createElement("div",{className:c.Wrapper},"masterPassOtp"===d&&e.createElement("span",{"data-mr":!0,className:c.Logo},e.createElement(s,null)),e.createElement("p",{className:c.Text},b("masterPassOtp"===d?"checkout-page:masterPass.otpModal.otpTextMasterPass":"checkout-page:masterPass.otpModal.otpTextBank"))),e.createElement("div",{className:c.Countdown},b("checkout-page:masterPass.otpModal.countdownText"),e.createElement("strong",null,(L=x%3600,S=Math.floor(L/60),B=L%60,D=Math.ceil(B),F=S<10?"0".concat(S):S,q=D<10?"0".concat(D):D,"".concat(F,":").concat(q)))),f.mpVM.otpResponse.text&&e.createElement("div",{role:"error"===f.mpVM.otpResponse.status?"alert":"",className:c.OtpResponseText},f.mpVM.otpResponse.text),e.createElement("form",{onSubmit:function(e){e.preventDefault(),V()}},e.createElement(i,{required:!0,type:p.TEXT,label:b("checkout-page:masterPass.otpModal.inputLabel"),name:"one-time-code",autocomplete:"one-time-code",rightContent:f.mpVM.isOtpFormSubmitAtLeastOnce&&A?e.createElement("button",{type:"button",className:c.ResendButton,disabled:y,onClick:function(e){e.stopPropagation(),y||(C(!0),f.mpVM.resendOtp({store:f.store,checkout:f.checkout,callback:function(){C(!1),I(),P("")}}))}},b("checkout-page:masterPass.otpModal.resendText")):void 0,value:E,onChange:function(e){P(e)}}),e.createElement(l,{type:"submit",style:{width:"100%",marginTop:"16px"},text:b("checkout-page:masterPass.otpModal.buttonText"),isLoading:O,isDisabled:!E,onClick:V})));return a((function(){u?w():R()}),[u]),a((function(){w()}),[d]),console.log("calisti modal",u),e.createElement(r,{visible:u,onClose:v},G)}));export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{observer as s}from"mobx-react-lite";import t from"../modal/index.js";import r from"./svg/success.js";import a from"./
|
|
1
|
+
import e from"react";import{observer as s}from"mobx-react-lite";import t from"../modal/index.js";import r from"./svg/success.js";import a from"./style.module.scss.js";import{useTranslation as o}from"../../../../../utils/i18n.js";var c=s((function(s){var c=s.visible,l=s.type,m=s.onClose,i=o().t,n=e.createElement("div",{className:a.Wrapper},e.createElement("span",{"data-mr":!0,className:a.Logo},e.createElement(r,null)),e.createElement("p",{className:a.Text},"linkCardToClient"===l&&i("checkout-page:masterPass.successModal.linkCardToClientSuccessText"),"register"===l&&i("checkout-page:masterPass.successModal.otpSuccessText")));return e.createElement(t,{visible:c,onClose:m},n)}));export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var
|
|
1
|
+
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var t={Wrapper:"style-module_Wrapper__Um8hI",Logo:"style-module_Logo__JxQj2",Text:"style-module_Text__gNKCp"};e(".style-module_Wrapper__Um8hI {\n display: flex;\n padding-right: 24px;\n margin-bottom: 20px;\n}\n\n.style-module_Logo__JxQj2[data-mr] {\n margin-right: 16px;\n}\n\n.style-module_Text__gNKCp {\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n}");export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var l=function(l){var L=l.className;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",className:L,viewBox:"6 8 20 9.21"}," ",e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.331 9.4811C24.0522 9.4811 23.7446 9.63656 23.6219 9.91598L22.3183 12.9041L21.8488 9.91598C21.7937 9.63656 21.6037 9.4811 21.3033 9.4811L19.652 9.4811L21.0644 14.4436C21.0904 14.5389 21.0953 14.6443 21.0764 14.7553C21.0023 15.1694 20.6068 15.5054 20.1924 15.5054L19.2677 15.5054C19.0328 15.5054 18.8782 15.6509 18.8026 15.9801L18.5972 17.21L20.2258 17.21C21.0754 17.21 22.0733 16.7831 22.7389 15.6027L26 9.4811L24.331 9.4811Z",fill:"#2F3842"})," ",e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.2998 8.00041C8.78746 8.00041 9.02309 8.19493 8.93741 8.68384L8.79675 9.48037L9.91728 9.48037L9.67046 10.8795L8.54946 10.8795L8.24405 12.612C8.13851 13.2156 8.73595 13.2959 9.07869 13.2959C9.14705 13.2959 9.20376 13.2945 9.24439 13.2921L8.97033 14.8524C8.88574 14.8614 8.79848 14.873 8.61404 14.873C7.76333 14.873 6.15404 14.6453 6.47048 12.85L6.817 10.8795L6 10.8795L6.24587 9.48037L7.05484 9.48037L7.31521 8.00041L8.2998 8.00041Z",fill:"#2F3842"})," ",e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.7158 9.54448L17.428 11.1758C17.7829 11.3571 18.0261 11.7254 18.0261 12.1506C18.0261 12.7114 17.6057 13.171 17.0645 13.237L16.7769 14.868C16.8276 14.8713 16.8792 14.873 16.9307 14.873C18.4351 14.873 19.6536 13.6538 19.6536 12.1506C19.6536 10.9217 18.8376 9.88187 17.7158 9.54448Z",fill:"#00A6B6"})," ",e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.4343 13.1255C16.0797 12.9452 15.8359 12.5752 15.8359 12.1504C15.8359 11.5931 16.2572 11.1302 16.7983 11.0651L17.0856 9.43397C17.0346 9.43082 16.9826 9.42846 16.9314 9.42846C15.4281 9.42846 14.209 10.6485 14.209 12.1504C14.209 13.3799 15.0254 14.4204 16.1471 14.7578L16.4343 13.1255Z",fill:"#00A6B6"})," ",e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5661 9.48044L11.529 9.48044C12.0168 9.48044 12.2515 9.67543 12.1655 10.1645L12.0601 10.7561C12.4189 10.0279 13.197 9.4272 13.9951 9.4272C14.0999 9.4272 14.2007 9.44799 14.2007 9.44799L13.8894 11.2123C13.8894 11.2123 13.7497 11.1798 13.5317 11.1798C13.1064 11.1798 12.3871 11.3146 11.9867 12.1138C11.8913 12.3109 11.8179 12.5505 11.767 12.8392L11.4186 14.8213L9.625 14.8213L10.5661 9.48044Z",fill:"#2F3842"})," ")};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){return t.className,e.createElement("svg",{stroke:"currentColor",fill:"#1A1876","stroke-width":"0",viewBox:"0 0 24 24",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("g",null,e.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),e.createElement("path",{d:"M22.222 15.768l-.225-1.125h-2.514l-.4 1.117-2.015.004a4199.19 4199.19 0 0 1 2.884-6.918c.164-.391.455-.59.884-.588.328.003.863.003 1.606.001L24 15.765l-1.778.003zm-2.173-2.666h1.62l-.605-2.82-1.015 2.82zM7.06 8.257l2.026.002-3.132 7.51-2.051-.002a950.849 950.849 0 0 1-1.528-5.956c-.1-.396-.298-.673-.679-.804C1.357 8.89.792 8.71 0 8.465V8.26h3.237c.56 0 .887.271.992.827.106.557.372 1.975.8 4.254L7.06 8.257zm4.81.002l-1.602 7.508-1.928-.002L9.94 8.257l1.93.002zm3.91-.139c.577 0 1.304.18 1.722.345l-.338 1.557c-.378-.152-1-.357-1.523-.35-.76.013-1.23.332-1.23.638 0 .498.816.749 1.656 1.293.959.62 1.085 1.177 1.073 1.782-.013 1.256-1.073 2.495-3.309 2.495-1.02-.015-1.388-.101-2.22-.396l.352-1.625c.847.355 1.206.468 1.93.468.663 0 1.232-.268 1.237-.735.004-.332-.2-.497-.944-.907-.744-.411-1.788-.98-1.774-2.122.017-1.462 1.402-2.443 3.369-2.443z"})))};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../button/index.js";import r from"./select/index.js";import n from"../svg/cross.js";import{useTranslation as c}from"../../../../utils/i18n.js";import{formatCurrency as i}from"../../../../utils/currency.js";import o from"./style.module.scss.js";var m=function(t){var a=t.seconds,r=t.rejectOffer,n=c().t,i=e.useState(a),m=i[0],d=i[1];e.useEffect((function(){var e=m>0&&setInterval((function(){return d(m-1)}),1e3);return 0===m&&r(),function(){return clearInterval(e)}}),[m]);return e.createElement("div",{className:o.CountdownContainer},e.createElement("div",{className:o.CountdownText},n("checkout-page:timeRemaining",{value:function(e){var t=Math.floor(e/60/60),a=Math.floor(e/60)-60*t,r=e%60;return 0!==t?t.toString().padStart(2,"0")+":":a.toString().padStart(2,"0")+":"+r.toString().padStart(2,"0")}(m)})))},d=t((function(t){var d,f
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as a}from"../button/index.js";import r from"./select/index.js";import n from"../svg/cross.js";import{useTranslation as c}from"../../../../utils/i18n.js";import{formatCurrency as i}from"../../../../utils/currency.js";import o from"./style.module.scss.js";var m=function(t){var a=t.seconds,r=t.rejectOffer,n=c().t,i=e.useState(a),m=i[0],d=i[1];e.useEffect((function(){var e=m>0&&setInterval((function(){return d(m-1)}),1e3);return 0===m&&r(),function(){return clearInterval(e)}}),[m]);return e.createElement("div",{className:o.CountdownContainer},e.createElement("div",{className:o.CountdownText},n("checkout-page:timeRemaining",{value:function(e){var t=Math.floor(e/60/60),a=Math.floor(e/60)-60*t,r=e%60;return 0!==t?t.toString().padStart(2,"0")+":":a.toString().padStart(2,"0")+":"+r.toString().padStart(2,"0")}(m)})))},d=t((function(t){var d,s,f=t.vm,u=t.campaignOffer,l=c().t,p=e.useState(u.variants[0]),v=p[0],g=p[1],E=function(){f.updateCartCampaignOffer({accepted:!1,cartId:f.checkout.id,campaignOfferId:u.campaignOffer.campaignOfferId,campaignOfferProductId:u.offer.id,productId:u.offer.productId,variantId:v.id})},I=Math.round(((new Date).getTime()-new Date(u.campaignOffer.offerStartDate).getTime())/1e3);return e.createElement("div",{className:o.Container},u.offer.countdownMinutes&&e.createElement(m,{seconds:I>60*u.offer.countdownMinutes?0:60*u.offer.countdownMinutes-I,rejectOffer:E}),e.createElement("div",{className:o.ContentContainer},e.createElement("div",{className:o.Header},e.createElement("div",{className:o.Title},u.offer.title),e.createElement("div",{className:o.RejectButton,onClick:E},e.createElement(n,null))),e.createElement("div",{className:o.ProductContainer},e.createElement("div",{className:o.ImageContainer},e.createElement("img",{className:o.Image,src:null===(s=null===(d=v.mainImage)||void 0===d?void 0:d.image)||void 0===s?void 0:s.thumbnailSrc})),e.createElement("div",{className:o.ProductDetails},e.createElement("div",{className:o.ProductName},u.product.name),u.product.hasVariant&&1===u.variants.length&&e.createElement("div",{className:o.VariantName},v.variantValues.map((function(e){return e.name})).join(", ")),u.product.brand&&e.createElement("div",{className:o.Brand},u.product.brand.name),e.createElement("div",{className:o.ProductPrice},e.createElement("span",{className:o.Discount},v.price.formattedFinalPrice)," ",i(v.price.finalPrice-v.price.finalPrice*(u.offer.discountAmount||100)/100,f.checkout.currencyCode,f.checkout.currencySymbol)),e.createElement("div",{className:o.Actions},u.variants.length>1&&e.createElement(r,{value:v.id,onSelectChange:function(e){var t=u.variants.find((function(t){return t.id===e}));t&&g(t)},options:u.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))}),e.createElement(a,{style:{width:"100%",height:44,fontSize:14},text:l("checkout-page:actions.addToCart"),onClick:function(){f.updateCartCampaignOffer({accepted:!0,cartId:f.checkout.id,campaignOfferId:u.campaignOffer.campaignOfferId,campaignOfferProductId:u.offer.id,productId:u.offer.productId,variantId:v.id})}}))))))}));export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={Container:"style-module_Container__-EKYc",CountdownContainer:"style-module_CountdownContainer__bc-5v",CountdownText:"style-module_CountdownText__Hd-3I",ContentContainer:"style-module_ContentContainer__tC3zO",Header:"style-module_Header__J2wyt",Title:"style-module_Title__4T394",RejectButton:"style-module_RejectButton__3SwP8",ProductContainer:"style-module_ProductContainer__9qr9n",ImageContainer:"style-module_ImageContainer__gxlXU",Image:"style-module_Image__gDla7",ProductDetails:"style-module_ProductDetails__a-gJx",ProductName:"style-module_ProductName__yTmJx",Brand:"style-module_Brand__UxK7C",ProductPrice:"style-module_ProductPrice__U6Lhy",Discount:"style-module_Discount__tjllJ",Actions:"style-module_Actions__XZsJD"};n(".style-module_Container__-EKYc {\n margin: 32px 0 48px 0;\n background-color: var(--checkout-card-bg-color);\n border-radius: 8px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_Container__-EKYc {\n margin: 24px 0 24px 0;\n border-radius: 0;\n }\n}\n\n.style-module_CountdownContainer__bc-5v {\n display: flex;\n justify-content: center;\n padding: 6px;\n background-color: #cfced3;\n border-radius: 8px 8px 0 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CountdownContainer__bc-5v {\n border-radius: 0;\n }\n}\n\n.style-module_CountdownText__Hd-3I {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_ContentContainer__tC3zO {\n padding: 24px;\n width: 100%;\n}\n\n.style-module_Header__J2wyt {\n display: flex;\n justify-content: space-between;\n}\n\n.style-module_Title__4T394 {\n margin-bottom: 24px;\n font-size: 22px;\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n}\n\n.style-module_RejectButton__3SwP8 {\n height: 35px;\n width: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 20px;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.style-module_ProductContainer__9qr9n {\n display: flex;\n}\n\n.style-module_ImageContainer__gxlXU {\n height: 136px;\n width: 136px;\n position: relative;\n background-color: #fff;\n margin-right: 24px;\n border-radius: 8px;\n flex: 0 0 136px;\n}\n\n.style-module_Image__gDla7 {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 8px;\n}\n\n.style-module_ProductDetails__a-gJx {\n flex: 1;\n}\n\n.style-module_ProductName__yTmJx {\n margin-bottom: 2px;\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n line-height: 24px;\n}\n\n.style-module_Brand__UxK7C {\n margin-bottom: 2px;\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n}\n\n.style-module_ProductPrice__U6Lhy {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n}\n\n.style-module_Discount__tjllJ {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n\n.style-module_Actions__XZsJD {\n display: flex;\n margin-top: 24px;\n}");export{e as default};
|
|
1
|
+
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={Container:"style-module_Container__-EKYc",CountdownContainer:"style-module_CountdownContainer__bc-5v",CountdownText:"style-module_CountdownText__Hd-3I",ContentContainer:"style-module_ContentContainer__tC3zO",Header:"style-module_Header__J2wyt",Title:"style-module_Title__4T394",RejectButton:"style-module_RejectButton__3SwP8",ProductContainer:"style-module_ProductContainer__9qr9n",ImageContainer:"style-module_ImageContainer__gxlXU",Image:"style-module_Image__gDla7",ProductDetails:"style-module_ProductDetails__a-gJx",ProductName:"style-module_ProductName__yTmJx",VariantName:"style-module_VariantName__DF1mY",Brand:"style-module_Brand__UxK7C",ProductPrice:"style-module_ProductPrice__U6Lhy",Discount:"style-module_Discount__tjllJ",Actions:"style-module_Actions__XZsJD"};n(".style-module_Container__-EKYc {\n margin: 32px 0 48px 0;\n background-color: var(--checkout-card-bg-color);\n border-radius: 8px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_Container__-EKYc {\n margin: 24px 0 24px 0;\n border-radius: 0;\n }\n}\n\n.style-module_CountdownContainer__bc-5v {\n display: flex;\n justify-content: center;\n padding: 6px;\n background-color: #cfced3;\n border-radius: 8px 8px 0 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CountdownContainer__bc-5v {\n border-radius: 0;\n }\n}\n\n.style-module_CountdownText__Hd-3I {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_ContentContainer__tC3zO {\n padding: 24px;\n width: 100%;\n}\n\n.style-module_Header__J2wyt {\n display: flex;\n justify-content: space-between;\n}\n\n.style-module_Title__4T394 {\n margin-bottom: 24px;\n font-size: 22px;\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n}\n\n.style-module_RejectButton__3SwP8 {\n height: 35px;\n width: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 20px;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.style-module_ProductContainer__9qr9n {\n display: flex;\n}\n\n.style-module_ImageContainer__gxlXU {\n height: 136px;\n width: 136px;\n position: relative;\n background-color: #fff;\n margin-right: 24px;\n border-radius: 8px;\n flex: 0 0 136px;\n}\n\n.style-module_Image__gDla7 {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 8px;\n}\n\n.style-module_ProductDetails__a-gJx {\n flex: 1;\n}\n\n.style-module_ProductName__yTmJx {\n margin-bottom: 2px;\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n line-height: 24px;\n}\n\n.style-module_VariantName__DF1mY {\n margin-bottom: 2px;\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n}\n\n.style-module_Brand__UxK7C {\n margin-bottom: 2px;\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n}\n\n.style-module_ProductPrice__U6Lhy {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n}\n\n.style-module_Discount__tjllJ {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n\n.style-module_Actions__XZsJD {\n display: flex;\n margin-top: 24px;\n}");export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as o}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import c from"../svg/success-circle.js";import r from"./style.module.scss.js";var a=t((function(t){var a=t.vm,m=i().t;return e.createElement("div",{className:r.Container},e.createElement("div",{className:r.TitleContainer},e.createElement(c,{className:r.Icon}),e.createElement("div",{className:r.CompletedTitle},m("checkout-page:quickRegistration.completedTitle"))),e.createElement("div",{className:r.SubTitle},m("checkout-page:quickRegistration.completedSubtitle")),e.createElement(o,{text:m("checkout-page:actions.login"),onClick:a.onGoToLoginClick,style:{width:"100%",marginTop:32}}))}));export{a as QuickRegistrationCompleted};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as r}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as a}from"../form-item/model.js";import{Button as i}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../utils/i18n.js";import{QuickRegistrationCompleted as m}from"./completed.js";import{QuickRegistrationViewModel as c}from"./model.js";import n from"./style.module.scss.js";var l=t((function(t){var l=t.vm,u=s().t,p=e.useMemo((function(){return new c(l,u)}),[]);return l.checkout.customer?p.isRegisteredCustomer?e.createElement(m,{vm:l}):e.createElement("div",{className:n.Container},e.createElement("div",{className:n.Title},u("checkout-page:quickRegistration.title")),e.createElement("div",{className:n.SubTitle},u("checkout-page:quickRegistration.subtitle")),e.createElement("div",{className:n.EmailContainer},e.createElement("div",{className:n.Label},u("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:n.Email},l.checkout.customer.email)),e.createElement(r,{type:o.TEXT,inputType:a.PASSWORD,label:u("checkout-page:password"),value:p.password,onChange:p.onPasswordChange,hasError:!!p.passwordErrorMessage,errorText:p.passwordErrorMessage}),e.createElement(i,{style:{width:"100%",marginTop:16},text:u("checkout-page:actions.signup"),isLoading:p.isLoading,onClick:p.onSubmit})):null}));export{l as QuickRegistration};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TFunction } from "../../../../utils/i18n";
|
|
2
|
+
import CheckoutViewModel from "../../model";
|
|
3
|
+
export declare class QuickRegistrationViewModel {
|
|
4
|
+
private model;
|
|
5
|
+
private vm;
|
|
6
|
+
private validator;
|
|
7
|
+
private _isLoading;
|
|
8
|
+
private _isRegisteredCustomer;
|
|
9
|
+
t: TFunction;
|
|
10
|
+
constructor(vm: CheckoutViewModel, t: TFunction);
|
|
11
|
+
get password(): string;
|
|
12
|
+
get isLoading(): boolean;
|
|
13
|
+
get isRegisteredCustomer(): boolean;
|
|
14
|
+
get hasError(): boolean;
|
|
15
|
+
get passwordErrorMessage(): string | undefined;
|
|
16
|
+
onPasswordChange: (value: string) => void;
|
|
17
|
+
validateAll: () => Promise<boolean>;
|
|
18
|
+
onSubmit: () => Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as i}from"mobx";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import{Validator as r}from"../../../../models/ui/validator/index.js";import{RequiredRule as s,MinRule as d}from"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";var a=function(){function a(a,m){var n=this;this.model={password:""},this._isLoading=!1,this._isRegisteredCustomer=!1,this.onPasswordChange=function(e){n.model.password=e},this.validateAll=function(){return n.validator.validateAll()},this.onSubmit=function(){return e(n,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.validateAll()];case 1:return t.sent()?[3,3]:(this._isLoading=!0,[4,this.vm.registerCustomer(this.password)]);case 2:(null==(e=t.sent())?void 0:e.isSuccess)&&(this._isRegisteredCustomer=!0),this._isLoading=!1,t.label=3;case 3:return[2]}}))}))},o(this,{model:i}),this.vm=a,this.t=m,this.validator=new r(this.model,[new s({fieldKey:"password",valuePath:"password",message:m("checkout-page:passwordRequiredError")}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:m("checkout-page:passwordMinError",{value:6})})])}return Object.defineProperty(a.prototype,"password",{get:function(){return this.model.password},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isRegisteredCustomer",{get:function(){return this._isRegisteredCustomer},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),a}();export{a as QuickRegistrationViewModel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={Container:"style-module_Container__ejwC8",TitleContainer:"style-module_TitleContainer__yeYsl",Icon:"style-module_Icon__P-Ex0",CompletedTitle:"style-module_CompletedTitle__BpU3O",Title:"style-module_Title__bOXYV",SubTitle:"style-module_SubTitle__rgvCv",EmailContainer:"style-module_EmailContainer__-JwT-",Label:"style-module_Label__S4uXn",Email:"style-module_Email__Tm44f"};e(".style-module_Container__ejwC8 {\n margin: 32px 0 16px 0;\n padding: 24px;\n background-color: var(--checkout-secondary-bg-color);\n border-radius: 8px;\n}\n.style-module_Container__ejwC8 .style-module_TitleContainer__yeYsl {\n display: flex;\n align-items: center;\n}\n.style-module_Container__ejwC8 .style-module_Icon__P-Ex0 {\n width: 36px;\n height: 36px;\n color: #CFCED3;\n}\n.style-module_Container__ejwC8 .style-module_CompletedTitle__BpU3O {\n font-weight: 600;\n font-size: 22px;\n line-height: 32px;\n margin-left: 16px;\n}\n.style-module_Container__ejwC8 .style-module_Title__bOXYV {\n font-weight: 600;\n font-size: 22px;\n line-height: 32px;\n}\n.style-module_Container__ejwC8 .style-module_SubTitle__rgvCv {\n line-height: 24px;\n margin-top: 16px;\n}\n.style-module_Container__ejwC8 .style-module_EmailContainer__-JwT- {\n margin-top: 8px;\n margin-bottom: 32px;\n display: flex;\n flex-wrap: wrap;\n}\n.style-module_Container__ejwC8 .style-module_EmailContainer__-JwT- .style-module_Label__S4uXn {\n color: var(--checkout-secondary-text-color);\n margin-right: 4px;\n line-height: 24px;\n}\n.style-module_Container__ejwC8 .style-module_EmailContainer__-JwT- .style-module_Email__Tm44f {\n line-height: 24px;\n}");export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";var t=function(t){var r=t.className;return e.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r},e.createElement("circle",{cx:"20",cy:"20",r:"20",fill:"
|
|
1
|
+
import*as e from"react";var t=function(t){var r=t.className;return e.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r},e.createElement("circle",{cx:"20",cy:"20",r:"20",fill:"currentColor"}),e.createElement("path",{d:"M12 20L18 26L28.0005 15.9998",stroke:"white","stroke-width":"3.2","stroke-linecap":"round"}))};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from'./../../ext/react-tooltip/dist/index.es.js';import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"mobx";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-link-card-to-client/index.js";import j from"./components/master-pass/modal-response/index.js";import C from"./components/master-pass/modal-success/index.js";import{Image as b}from"../image/index.js";import N,{Step as M}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as T}from"./components/fullscreen-loading/index.js";import P from"./components/notification-box/index.js";import{FormItem as S}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as V}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var R=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,b=e.termsOfService,N=e.imprint,M=e.shippingPolicy,P=d().t,S=r(),A=o.useState((function(){return new l(m,p,S,v,E,b,N,M,P,u||{})}))[0];return A.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),B.beginCheckout(A.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),A.isCheckoutLoaded&&A.store.customerStore.initialized?A.checkout.hasCustomer&&(null===(t=A.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=A.checkout.customer)||void 0===i?void 0:i.id)?(S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=A.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+P("checkout-page:securePayment"),pageDescription:P("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),A.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:A,allowExpand:!0}),A.step===n.SUCCESS?o.createElement(f,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(I,{vm:A,campaignOffer:A.checkoutCampaignOffer}),o.createElement(U,{vm:A}))),o.createElement("div",{className:O.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:A}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(y,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(z,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isLinkCardToClientModalVisible&&o.createElement(k,{visible:A.mpVM.isLinkCardToClientModalVisible,vm:A,onClose:A.mpVM.hideLinkCardToClientModal}),A.mpVM.isOtpModalVisible&&o.createElement(x,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(j,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(C,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose}))):o.createElement(T,null)})),D=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(b,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),U=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new M(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0),new M(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new M(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(N,{steps:s,stepContent:r})})),H=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),z=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(P,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(S,{type:A.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(V,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{R as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from'./../../ext/react-tooltip/dist/index.es.js';import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-link-card-to-client/index.js";import j from"./components/master-pass/modal-response/index.js";import C from"./components/master-pass/modal-success/index.js";import{Image as b}from"../image/index.js";import N,{Step as M}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as T}from"./components/fullscreen-loading/index.js";import P from"./components/notification-box/index.js";import{FormItem as S}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as V}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import L from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var R=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,b=e.termsOfService,N=e.imprint,M=e.shippingPolicy,P=d().t,S=r(),A=o.useState((function(){return new l(m,p,S,v,E,b,N,M,P,u||{})}))[0];return A.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){A.checkoutSettings.isAccountRequired&&!A.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),B.beginCheckout(A.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){A.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),A.isCheckoutLoaded&&A.store.customerStore.initialized?A.checkout.hasCustomer&&(null===(t=A.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=A.checkout.customer)||void 0===i?void 0:i.id)?(S.push("/account/login?redirect="+encodeURIComponent(A.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=A.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+P("checkout-page:securePayment"),pageDescription:P("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(D,{vm:A}),A.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:A,error:A.error})),!A.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:A,allowExpand:!0}),A.step===n.SUCCESS?o.createElement(f,{vm:A}):o.createElement(o.Fragment,null,A.checkoutCampaignOffer&&o.createElement(I,{vm:A,campaignOffer:A.checkoutCampaignOffer}),o.createElement(U,{vm:A}))),o.createElement("div",{className:O.Space})),o.createElement(Y,{vm:A}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:A}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(L,null))))),!!A.policyModalText&&o.createElement(y,{title:A.policyModalTitle,modalContent:A.policyModalText,onClose:function(){A.policyModalText=""}}),A.isContactModalVisible&&o.createElement(z,{vm:A,setVisible:A.setContactModalVisible}),A.mpVM.isLinkCardToClientModalVisible&&o.createElement(k,{visible:A.mpVM.isLinkCardToClientModalVisible,vm:A,onClose:A.mpVM.hideLinkCardToClientModal}),A.mpVM.isOtpModalVisible&&o.createElement(x,{vm:A,visible:A.mpVM.isOtpModalVisible,type:A.mpVM.otpModalType,onClose:A.mpVM.hideOtpModal}),A.mpVM.isResponseModalVisible&&o.createElement(j,{visible:A.mpVM.isResponseModalVisible,text:A.mpVM.mfsResponseModalText,onClose:A.mpVM.onResponseModalClose}),A.mpVM.isSuccessModalVisible&&o.createElement(C,{visible:A.mpVM.isSuccessModalVisible,type:A.mpVM.successModalType,onClose:A.mpVM.onSuccessModalClose}))):o.createElement(T,null)})),D=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(b,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),U=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new M(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0),new M(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new M(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(G,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(G,{vm:t})):void 0)),o.createElement(N,{steps:s,stepContent:r})})),H=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),G=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),Y=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),z=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(P,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(S,{type:A.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(V,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{R as default};
|
|
@@ -8,6 +8,7 @@ import { IkasCheckoutSettings } from "../../models/data/checkout-settings";
|
|
|
8
8
|
import { TFunction } from "../../utils/i18n";
|
|
9
9
|
import { IkasCheckoutCustomizationProps } from ".";
|
|
10
10
|
import MasterPassModel from "./modelMasterPass";
|
|
11
|
+
import { APIResponse } from "@ikas/fe-api-client";
|
|
11
12
|
import { CreateStripePaymentIntentResponse, RetrieveInstallmentInfoResponse, UpdateCartCampaignOfferInput, CreateKlarnaTokenResponse } from "@ikas/storefront-api";
|
|
12
13
|
import { IkasBaseStore } from "../../store";
|
|
13
14
|
import { RetrieveInstallmentInfoQueryParams, SaveCartInput } from "@ikas/storefront-api";
|
|
@@ -74,6 +75,7 @@ export default class CheckoutViewModel {
|
|
|
74
75
|
get finalPrice(): number;
|
|
75
76
|
get hasStockError(): boolean;
|
|
76
77
|
get isPaymentGatewayHasMasterPass(): boolean;
|
|
78
|
+
get hasQuickRegistration(): boolean | null;
|
|
77
79
|
get canProceedToShipping(): boolean | undefined;
|
|
78
80
|
get canProceedToInStoreDelivery(): boolean;
|
|
79
81
|
get canProceedToPayment(): boolean | undefined;
|
|
@@ -114,6 +116,7 @@ export default class CheckoutViewModel {
|
|
|
114
116
|
saveAddress: (type: "billing" | "shipping") => Promise<void>;
|
|
115
117
|
onGoToCartClick: () => void;
|
|
116
118
|
onBackToShoppingClick: () => void;
|
|
119
|
+
onGoToLoginClick: () => void;
|
|
117
120
|
onProceedToShippingClick: () => Promise<void>;
|
|
118
121
|
onProceedToDigitalOnlyPaymentClick: () => Promise<void>;
|
|
119
122
|
onProceedToPaymentClick: () => Promise<void>;
|
|
@@ -140,6 +143,11 @@ export default class CheckoutViewModel {
|
|
|
140
143
|
} | undefined>;
|
|
141
144
|
getCampaignOffer: () => Promise<void>;
|
|
142
145
|
updateCartCampaignOffer: (props: UpdateCartCampaignOfferInput) => Promise<void>;
|
|
146
|
+
registerCustomer: (password: string) => Promise<APIResponse<{
|
|
147
|
+
customer: import("../../models").IkasCustomer | null;
|
|
148
|
+
token: string;
|
|
149
|
+
tokenExpiry: number;
|
|
150
|
+
} | null> | undefined>;
|
|
143
151
|
}
|
|
144
152
|
export declare enum CheckoutStep {
|
|
145
153
|
INFO = "info",
|