@ikas/storefront 3.0.0-alpha.42 → 3.0.0-alpha.43
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/__api/mutations/updateCartCampaignOffer.js +1 -0
- package/build/assets/translations/checkout/en.js +1 -1
- package/build/assets/translations/checkout/tr.js +1 -1
- package/build/components/checkout/components/offer-product/index.d.ts +8 -0
- package/build/components/checkout/components/offer-product/index.js +1 -0
- package/build/components/checkout/components/offer-product/select/arrows.d.ts +6 -0
- package/build/components/checkout/components/offer-product/select/arrows.js +1 -0
- package/build/components/checkout/components/offer-product/select/index.d.ts +11 -0
- package/build/components/checkout/components/offer-product/select/index.js +1 -0
- package/build/components/checkout/components/offer-product/select/style.module.scss.js +1 -0
- package/build/components/checkout/components/offer-product/style.module.scss.js +1 -0
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +21 -1
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/store/cart/api.d.ts +2 -0
- package/build/store/cart/api.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as _,__generator as e}from'../../ext/tslib/tslib.es6.js';import{handleAPIError as I,APIResponse as i}from'../../ext/@ikas/fe-api-client/build/utils/api.js';import t from'../../ext/@ikas/fe-api-client/build/utils/fetch-query.js';var a,r=function(a,r,n){return _(void 0,void 0,void 0,(function(){var _,A,s,d;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t({operationName:"updateCartCampaignOffer",config:n,variables:a,allReturnFields:E,fields:r,query:function(_){return"\n\t\t\t\tmutation updateCartCampaignOffer (\n\t\t\t\t\t$input: UpdateCartCampaignOfferInput!,\n\t\t\t\t) {\n\t\t\t\t\tupdateCartCampaignOffer (\n\t\t\t\t\t\tinput: $input,\n\t\t\t\t\t) ".concat(_,"\n\t\t\t\t}\n\t\t\t")}})];case 1:return _=e.sent(),A=_.data,s=_.errors,[2,new i(null==A?void 0:A.updateCartCampaignOffer,s)];case 2:return d=e.sent(),[2,I(d)];case 3:return[2]}}))}))},E="{abandonedCartFlows {campaignId canApplicable couponId customerFilters {sendOnlyActiveAccount sendOnlySubscribedToEmail } flowId mailSendDate mailTranslationId recoverEmailStatus sendAfter } availableShippingMethods {price rateName shippingMethod shippingSettingsId shippingZoneRateId } billingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } campaignOffers {appliedOrderLineId campaignOffer {availableSalesChannelIds createdAt deleted endDate followUpActionType id minimumRequiredCartAmount name offers {countdownMinutes description discountAmount discountType excludedVariantIdList id order productId showCriteria skipOfferIfProductExistsInCart title translations {description locale title } } startDate targetPageTypes triggerSettings {filterType valueList } type updatedAt } campaignOfferId campaignOfferProductId offerEndDate offerStartDate status targetPageTypes triggerSourceOrderLineId } cartId cartStatus checkoutId clientIp couponCode createdAt createdBy currencyCode currencyRates {code originalRate rate } customer {email firstName fullName id isGuestCheckout lastName notificationsAccepted } customerId deleted dueDate giftPackageLines {price taxValue } giftPackageNote host id isGiftPackage itemCount merchantId note orderAdjustments {amount amountType appliedOrderLines {amount appliedQuantity isAutoCreated orderLineId } campaignId campaignType couponId name order type } orderLineItems {createdAt currencyCode deleted discount {amount amountType campaignOfferId campaignOfferProductId maxApplicableQuantity reason } discountPrice finalPrice id options {name productOptionId productOptionsSetId type values {name price value } } originalOrderLineItemId price quantity status statusUpdatedAt stockLocationId taxValue updatedAt variant {barcodeList brand {id name } categories {categoryPath {id name } id name } id mainImageId name prices {buyPrice currency discountPrice priceListId sellPrice } productId sku slug tagIds taxValue type variantValues {order variantTypeId variantTypeName variantValueId variantValueName } weight } } orderNumber orderPackageStatus orderedAt priceListId recoverEmailStatus recoveryStatus salesChannelId shippingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } shippingLines {finalPrice isRefunded paymentMethod price shippingSettingsId shippingZoneRateId taxValue title } shippingMethod shippingSettingsId shippingZoneRateId status stockLocationId storefrontId storefrontRouting {domain dynamicCurrencySettings {roundingFormat targetCurrencyCode } id locale path priceListId } storefrontRoutingId storefrontThemeId taxLines {price rate } totalFinalPrice totalPrice updatedAt userAgent }";!function(_){_.ABANDONED_CART_FLOWS__CAMPAIGN_ID="abandonedCartFlows.campaignId",_.ABANDONED_CART_FLOWS__CAN_APPLICABLE="abandonedCartFlows.canApplicable",_.ABANDONED_CART_FLOWS__COUPON_ID="abandonedCartFlows.couponId",_.ABANDONED_CART_FLOWS__CUSTOMER_FILTERS__SEND_ONLY_ACTIVE_ACCOUNT="abandonedCartFlows.customerFilters.sendOnlyActiveAccount",_.ABANDONED_CART_FLOWS__CUSTOMER_FILTERS__SEND_ONLY_SUBSCRIBED_TO_EMAIL="abandonedCartFlows.customerFilters.sendOnlySubscribedToEmail",_.ABANDONED_CART_FLOWS__FLOW_ID="abandonedCartFlows.flowId",_.ABANDONED_CART_FLOWS__MAIL_SEND_DATE="abandonedCartFlows.mailSendDate",_.ABANDONED_CART_FLOWS__MAIL_TRANSLATION_ID="abandonedCartFlows.mailTranslationId",_.ABANDONED_CART_FLOWS__RECOVER_EMAIL_STATUS="abandonedCartFlows.recoverEmailStatus",_.ABANDONED_CART_FLOWS__SEND_AFTER="abandonedCartFlows.sendAfter",_.AVAILABLE_SHIPPING_METHODS__PRICE="availableShippingMethods.price",_.AVAILABLE_SHIPPING_METHODS__RATE_NAME="availableShippingMethods.rateName",_.AVAILABLE_SHIPPING_METHODS__SHIPPING_METHOD="availableShippingMethods.shippingMethod",_.AVAILABLE_SHIPPING_METHODS__SHIPPING_SETTINGS_ID="availableShippingMethods.shippingSettingsId",_.AVAILABLE_SHIPPING_METHODS__SHIPPING_ZONE_RATE_ID="availableShippingMethods.shippingZoneRateId",_.BILLING_ADDRESS__ADDRESS_LINE1="billingAddress.addressLine1",_.BILLING_ADDRESS__ADDRESS_LINE2="billingAddress.addressLine2",_.BILLING_ADDRESS__CITY__CODE="billingAddress.city.code",_.BILLING_ADDRESS__CITY__ID="billingAddress.city.id",_.BILLING_ADDRESS__CITY__NAME="billingAddress.city.name",_.BILLING_ADDRESS__COMPANY="billingAddress.company",_.BILLING_ADDRESS__COUNTRY__CODE="billingAddress.country.code",_.BILLING_ADDRESS__COUNTRY__ID="billingAddress.country.id",_.BILLING_ADDRESS__COUNTRY__ISO2="billingAddress.country.iso2",_.BILLING_ADDRESS__COUNTRY__ISO3="billingAddress.country.iso3",_.BILLING_ADDRESS__COUNTRY__NAME="billingAddress.country.name",_.BILLING_ADDRESS__DISTRICT__CODE="billingAddress.district.code",_.BILLING_ADDRESS__DISTRICT__ID="billingAddress.district.id",_.BILLING_ADDRESS__DISTRICT__NAME="billingAddress.district.name",_.BILLING_ADDRESS__FIRST_NAME="billingAddress.firstName",_.BILLING_ADDRESS__ID="billingAddress.id",_.BILLING_ADDRESS__IDENTITY_NUMBER="billingAddress.identityNumber",_.BILLING_ADDRESS__IS_DEFAULT="billingAddress.isDefault",_.BILLING_ADDRESS__LAST_NAME="billingAddress.lastName",_.BILLING_ADDRESS__PHONE="billingAddress.phone",_.BILLING_ADDRESS__POSTAL_CODE="billingAddress.postalCode",_.BILLING_ADDRESS__STATE__CODE="billingAddress.state.code",_.BILLING_ADDRESS__STATE__ID="billingAddress.state.id",_.BILLING_ADDRESS__STATE__NAME="billingAddress.state.name",_.BILLING_ADDRESS__TAX_NUMBER="billingAddress.taxNumber",_.BILLING_ADDRESS__TAX_OFFICE="billingAddress.taxOffice",_.CAMPAIGN_OFFERS__APPLIED_ORDER_LINE_ID="campaignOffers.appliedOrderLineId",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__AVAILABLE_SALES_CHANNEL_IDS="campaignOffers.campaignOffer.availableSalesChannelIds",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__CREATED_AT="campaignOffers.campaignOffer.createdAt",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__DELETED="campaignOffers.campaignOffer.deleted",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__END_DATE="campaignOffers.campaignOffer.endDate",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__FOLLOW_UP_ACTION_TYPE="campaignOffers.campaignOffer.followUpActionType",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__ID="campaignOffers.campaignOffer.id",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__MINIMUM_REQUIRED_CART_AMOUNT="campaignOffers.campaignOffer.minimumRequiredCartAmount",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__NAME="campaignOffers.campaignOffer.name",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__COUNTDOWN_MINUTES="campaignOffers.campaignOffer.offers.countdownMinutes",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__DESCRIPTION="campaignOffers.campaignOffer.offers.description",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__DISCOUNT_AMOUNT="campaignOffers.campaignOffer.offers.discountAmount",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__DISCOUNT_TYPE="campaignOffers.campaignOffer.offers.discountType",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__EXCLUDED_VARIANT_ID_LIST="campaignOffers.campaignOffer.offers.excludedVariantIdList",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__ID="campaignOffers.campaignOffer.offers.id",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__ORDER="campaignOffers.campaignOffer.offers.order",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__PRODUCT_ID="campaignOffers.campaignOffer.offers.productId",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__SHOW_CRITERIA="campaignOffers.campaignOffer.offers.showCriteria",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__SKIP_OFFER_IF_PRODUCT_EXISTS_IN_CART="campaignOffers.campaignOffer.offers.skipOfferIfProductExistsInCart",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__TITLE="campaignOffers.campaignOffer.offers.title",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__TRANSLATIONS__DESCRIPTION="campaignOffers.campaignOffer.offers.translations.description",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__TRANSLATIONS__LOCALE="campaignOffers.campaignOffer.offers.translations.locale",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__OFFERS__TRANSLATIONS__TITLE="campaignOffers.campaignOffer.offers.translations.title",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__START_DATE="campaignOffers.campaignOffer.startDate",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__TARGET_PAGE_TYPES="campaignOffers.campaignOffer.targetPageTypes",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__TRIGGER_SETTINGS__FILTER_TYPE="campaignOffers.campaignOffer.triggerSettings.filterType",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__TRIGGER_SETTINGS__VALUE_LIST="campaignOffers.campaignOffer.triggerSettings.valueList",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__TYPE="campaignOffers.campaignOffer.type",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER__UPDATED_AT="campaignOffers.campaignOffer.updatedAt",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER_ID="campaignOffers.campaignOfferId",_.CAMPAIGN_OFFERS__CAMPAIGN_OFFER_PRODUCT_ID="campaignOffers.campaignOfferProductId",_.CAMPAIGN_OFFERS__OFFER_END_DATE="campaignOffers.offerEndDate",_.CAMPAIGN_OFFERS__OFFER_START_DATE="campaignOffers.offerStartDate",_.CAMPAIGN_OFFERS__STATUS="campaignOffers.status",_.CAMPAIGN_OFFERS__TARGET_PAGE_TYPES="campaignOffers.targetPageTypes",_.CAMPAIGN_OFFERS__TRIGGER_SOURCE_ORDER_LINE_ID="campaignOffers.triggerSourceOrderLineId",_.CART_ID="cartId",_.CART_STATUS="cartStatus",_.CHECKOUT_ID="checkoutId",_.CLIENT_IP="clientIp",_.COUPON_CODE="couponCode",_.CREATED_AT="createdAt",_.CREATED_BY="createdBy",_.CURRENCY_CODE="currencyCode",_.CURRENCY_RATES__CODE="currencyRates.code",_.CURRENCY_RATES__ORIGINAL_RATE="currencyRates.originalRate",_.CURRENCY_RATES__RATE="currencyRates.rate",_.CUSTOMER__EMAIL="customer.email",_.CUSTOMER__FIRST_NAME="customer.firstName",_.CUSTOMER__FULL_NAME="customer.fullName",_.CUSTOMER__ID="customer.id",_.CUSTOMER__IS_GUEST_CHECKOUT="customer.isGuestCheckout",_.CUSTOMER__LAST_NAME="customer.lastName",_.CUSTOMER__NOTIFICATIONS_ACCEPTED="customer.notificationsAccepted",_.CUSTOMER_ID="customerId",_.DELETED="deleted",_.DUE_DATE="dueDate",_.GIFT_PACKAGE_LINES__PRICE="giftPackageLines.price",_.GIFT_PACKAGE_LINES__TAX_VALUE="giftPackageLines.taxValue",_.GIFT_PACKAGE_NOTE="giftPackageNote",_.HOST="host",_.ID="id",_.IS_GIFT_PACKAGE="isGiftPackage",_.ITEM_COUNT="itemCount",_.MERCHANT_ID="merchantId",_.NOTE="note",_.ORDER_ADJUSTMENTS__AMOUNT="orderAdjustments.amount",_.ORDER_ADJUSTMENTS__AMOUNT_TYPE="orderAdjustments.amountType",_.ORDER_ADJUSTMENTS__APPLIED_ORDER_LINES__AMOUNT="orderAdjustments.appliedOrderLines.amount",_.ORDER_ADJUSTMENTS__APPLIED_ORDER_LINES__APPLIED_QUANTITY="orderAdjustments.appliedOrderLines.appliedQuantity",_.ORDER_ADJUSTMENTS__APPLIED_ORDER_LINES__IS_AUTO_CREATED="orderAdjustments.appliedOrderLines.isAutoCreated",_.ORDER_ADJUSTMENTS__APPLIED_ORDER_LINES__ORDER_LINE_ID="orderAdjustments.appliedOrderLines.orderLineId",_.ORDER_ADJUSTMENTS__CAMPAIGN_ID="orderAdjustments.campaignId",_.ORDER_ADJUSTMENTS__CAMPAIGN_TYPE="orderAdjustments.campaignType",_.ORDER_ADJUSTMENTS__COUPON_ID="orderAdjustments.couponId",_.ORDER_ADJUSTMENTS__NAME="orderAdjustments.name",_.ORDER_ADJUSTMENTS__ORDER="orderAdjustments.order",_.ORDER_ADJUSTMENTS__TYPE="orderAdjustments.type",_.ORDER_LINE_ITEMS__CREATED_AT="orderLineItems.createdAt",_.ORDER_LINE_ITEMS__CURRENCY_CODE="orderLineItems.currencyCode",_.ORDER_LINE_ITEMS__DELETED="orderLineItems.deleted",_.ORDER_LINE_ITEMS__DISCOUNT__AMOUNT="orderLineItems.discount.amount",_.ORDER_LINE_ITEMS__DISCOUNT__AMOUNT_TYPE="orderLineItems.discount.amountType",_.ORDER_LINE_ITEMS__DISCOUNT__CAMPAIGN_OFFER_ID="orderLineItems.discount.campaignOfferId",_.ORDER_LINE_ITEMS__DISCOUNT__CAMPAIGN_OFFER_PRODUCT_ID="orderLineItems.discount.campaignOfferProductId",_.ORDER_LINE_ITEMS__DISCOUNT__MAX_APPLICABLE_QUANTITY="orderLineItems.discount.maxApplicableQuantity",_.ORDER_LINE_ITEMS__DISCOUNT__REASON="orderLineItems.discount.reason",_.ORDER_LINE_ITEMS__DISCOUNT_PRICE="orderLineItems.discountPrice",_.ORDER_LINE_ITEMS__FINAL_PRICE="orderLineItems.finalPrice",_.ORDER_LINE_ITEMS__ID="orderLineItems.id",_.ORDER_LINE_ITEMS__OPTIONS__NAME="orderLineItems.options.name",_.ORDER_LINE_ITEMS__OPTIONS__PRODUCT_OPTION_ID="orderLineItems.options.productOptionId",_.ORDER_LINE_ITEMS__OPTIONS__PRODUCT_OPTIONS_SET_ID="orderLineItems.options.productOptionsSetId",_.ORDER_LINE_ITEMS__OPTIONS__TYPE="orderLineItems.options.type",_.ORDER_LINE_ITEMS__OPTIONS__VALUES__NAME="orderLineItems.options.values.name",_.ORDER_LINE_ITEMS__OPTIONS__VALUES__PRICE="orderLineItems.options.values.price",_.ORDER_LINE_ITEMS__OPTIONS__VALUES__VALUE="orderLineItems.options.values.value",_.ORDER_LINE_ITEMS__ORIGINAL_ORDER_LINE_ITEM_ID="orderLineItems.originalOrderLineItemId",_.ORDER_LINE_ITEMS__PRICE="orderLineItems.price",_.ORDER_LINE_ITEMS__QUANTITY="orderLineItems.quantity",_.ORDER_LINE_ITEMS__STATUS="orderLineItems.status",_.ORDER_LINE_ITEMS__STATUS_UPDATED_AT="orderLineItems.statusUpdatedAt",_.ORDER_LINE_ITEMS__STOCK_LOCATION_ID="orderLineItems.stockLocationId",_.ORDER_LINE_ITEMS__TAX_VALUE="orderLineItems.taxValue",_.ORDER_LINE_ITEMS__UPDATED_AT="orderLineItems.updatedAt",_.ORDER_LINE_ITEMS__VARIANT__BARCODE_LIST="orderLineItems.variant.barcodeList",_.ORDER_LINE_ITEMS__VARIANT__BRAND__ID="orderLineItems.variant.brand.id",_.ORDER_LINE_ITEMS__VARIANT__BRAND__NAME="orderLineItems.variant.brand.name",_.ORDER_LINE_ITEMS__VARIANT__CATEGORIES__CATEGORY_PATH__ID="orderLineItems.variant.categories.categoryPath.id",_.ORDER_LINE_ITEMS__VARIANT__CATEGORIES__CATEGORY_PATH__NAME="orderLineItems.variant.categories.categoryPath.name",_.ORDER_LINE_ITEMS__VARIANT__CATEGORIES__ID="orderLineItems.variant.categories.id",_.ORDER_LINE_ITEMS__VARIANT__CATEGORIES__NAME="orderLineItems.variant.categories.name",_.ORDER_LINE_ITEMS__VARIANT__ID="orderLineItems.variant.id",_.ORDER_LINE_ITEMS__VARIANT__MAIN_IMAGE_ID="orderLineItems.variant.mainImageId",_.ORDER_LINE_ITEMS__VARIANT__NAME="orderLineItems.variant.name",_.ORDER_LINE_ITEMS__VARIANT__PRICES__BUY_PRICE="orderLineItems.variant.prices.buyPrice",_.ORDER_LINE_ITEMS__VARIANT__PRICES__CURRENCY="orderLineItems.variant.prices.currency",_.ORDER_LINE_ITEMS__VARIANT__PRICES__DISCOUNT_PRICE="orderLineItems.variant.prices.discountPrice",_.ORDER_LINE_ITEMS__VARIANT__PRICES__PRICE_LIST_ID="orderLineItems.variant.prices.priceListId",_.ORDER_LINE_ITEMS__VARIANT__PRICES__SELL_PRICE="orderLineItems.variant.prices.sellPrice",_.ORDER_LINE_ITEMS__VARIANT__PRODUCT_ID="orderLineItems.variant.productId",_.ORDER_LINE_ITEMS__VARIANT__SKU="orderLineItems.variant.sku",_.ORDER_LINE_ITEMS__VARIANT__SLUG="orderLineItems.variant.slug",_.ORDER_LINE_ITEMS__VARIANT__TAG_IDS="orderLineItems.variant.tagIds",_.ORDER_LINE_ITEMS__VARIANT__TAX_VALUE="orderLineItems.variant.taxValue",_.ORDER_LINE_ITEMS__VARIANT__TYPE="orderLineItems.variant.type",_.ORDER_LINE_ITEMS__VARIANT__VARIANT_VALUES__ORDER="orderLineItems.variant.variantValues.order",_.ORDER_LINE_ITEMS__VARIANT__VARIANT_VALUES__VARIANT_TYPE_ID="orderLineItems.variant.variantValues.variantTypeId",_.ORDER_LINE_ITEMS__VARIANT__VARIANT_VALUES__VARIANT_TYPE_NAME="orderLineItems.variant.variantValues.variantTypeName",_.ORDER_LINE_ITEMS__VARIANT__VARIANT_VALUES__VARIANT_VALUE_ID="orderLineItems.variant.variantValues.variantValueId",_.ORDER_LINE_ITEMS__VARIANT__VARIANT_VALUES__VARIANT_VALUE_NAME="orderLineItems.variant.variantValues.variantValueName",_.ORDER_LINE_ITEMS__VARIANT__WEIGHT="orderLineItems.variant.weight",_.ORDER_NUMBER="orderNumber",_.ORDER_PACKAGE_STATUS="orderPackageStatus",_.ORDERED_AT="orderedAt",_.PRICE_LIST_ID="priceListId",_.RECOVER_EMAIL_STATUS="recoverEmailStatus",_.RECOVERY_STATUS="recoveryStatus",_.SALES_CHANNEL_ID="salesChannelId",_.SHIPPING_ADDRESS__ADDRESS_LINE1="shippingAddress.addressLine1",_.SHIPPING_ADDRESS__ADDRESS_LINE2="shippingAddress.addressLine2",_.SHIPPING_ADDRESS__CITY__CODE="shippingAddress.city.code",_.SHIPPING_ADDRESS__CITY__ID="shippingAddress.city.id",_.SHIPPING_ADDRESS__CITY__NAME="shippingAddress.city.name",_.SHIPPING_ADDRESS__COMPANY="shippingAddress.company",_.SHIPPING_ADDRESS__COUNTRY__CODE="shippingAddress.country.code",_.SHIPPING_ADDRESS__COUNTRY__ID="shippingAddress.country.id",_.SHIPPING_ADDRESS__COUNTRY__ISO2="shippingAddress.country.iso2",_.SHIPPING_ADDRESS__COUNTRY__ISO3="shippingAddress.country.iso3",_.SHIPPING_ADDRESS__COUNTRY__NAME="shippingAddress.country.name",_.SHIPPING_ADDRESS__DISTRICT__CODE="shippingAddress.district.code",_.SHIPPING_ADDRESS__DISTRICT__ID="shippingAddress.district.id",_.SHIPPING_ADDRESS__DISTRICT__NAME="shippingAddress.district.name",_.SHIPPING_ADDRESS__FIRST_NAME="shippingAddress.firstName",_.SHIPPING_ADDRESS__ID="shippingAddress.id",_.SHIPPING_ADDRESS__IDENTITY_NUMBER="shippingAddress.identityNumber",_.SHIPPING_ADDRESS__IS_DEFAULT="shippingAddress.isDefault",_.SHIPPING_ADDRESS__LAST_NAME="shippingAddress.lastName",_.SHIPPING_ADDRESS__PHONE="shippingAddress.phone",_.SHIPPING_ADDRESS__POSTAL_CODE="shippingAddress.postalCode",_.SHIPPING_ADDRESS__STATE__CODE="shippingAddress.state.code",_.SHIPPING_ADDRESS__STATE__ID="shippingAddress.state.id",_.SHIPPING_ADDRESS__STATE__NAME="shippingAddress.state.name",_.SHIPPING_ADDRESS__TAX_NUMBER="shippingAddress.taxNumber",_.SHIPPING_ADDRESS__TAX_OFFICE="shippingAddress.taxOffice",_.SHIPPING_LINES__FINAL_PRICE="shippingLines.finalPrice",_.SHIPPING_LINES__IS_REFUNDED="shippingLines.isRefunded",_.SHIPPING_LINES__PAYMENT_METHOD="shippingLines.paymentMethod",_.SHIPPING_LINES__PRICE="shippingLines.price",_.SHIPPING_LINES__SHIPPING_SETTINGS_ID="shippingLines.shippingSettingsId",_.SHIPPING_LINES__SHIPPING_ZONE_RATE_ID="shippingLines.shippingZoneRateId",_.SHIPPING_LINES__TAX_VALUE="shippingLines.taxValue",_.SHIPPING_LINES__TITLE="shippingLines.title",_.SHIPPING_METHOD="shippingMethod",_.SHIPPING_SETTINGS_ID="shippingSettingsId",_.SHIPPING_ZONE_RATE_ID="shippingZoneRateId",_.STATUS="status",_.STOCK_LOCATION_ID="stockLocationId",_.STOREFRONT_ID="storefrontId",_.STOREFRONT_ROUTING__DOMAIN="storefrontRouting.domain",_.STOREFRONT_ROUTING__DYNAMIC_CURRENCY_SETTINGS__ROUNDING_FORMAT="storefrontRouting.dynamicCurrencySettings.roundingFormat",_.STOREFRONT_ROUTING__DYNAMIC_CURRENCY_SETTINGS__TARGET_CURRENCY_CODE="storefrontRouting.dynamicCurrencySettings.targetCurrencyCode",_.STOREFRONT_ROUTING__ID="storefrontRouting.id",_.STOREFRONT_ROUTING__LOCALE="storefrontRouting.locale",_.STOREFRONT_ROUTING__PATH="storefrontRouting.path",_.STOREFRONT_ROUTING__PRICE_LIST_ID="storefrontRouting.priceListId",_.STOREFRONT_ROUTING_ID="storefrontRoutingId",_.STOREFRONT_THEME_ID="storefrontThemeId",_.TAX_LINES__PRICE="taxLines.price",_.TAX_LINES__RATE="taxLines.rate",_.TOTAL_FINAL_PRICE="totalFinalPrice",_.TOTAL_PRICE="totalPrice",_.UPDATED_AT="updatedAt",_.USER_AGENT="userAgent"}(a||(a={}));export{a as ResponseField,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={actions:{login:"Login",edit:"Edit",apply:"Apply",close:"Close",cancel:"Cancel",save:"Save",continue:"Continue",show:"Show",hide:"Hide",sendMessage:"Send Message",continueWithShipping:"Continue with Shipping",continueWithPayment:"Continue with Payment",completeOrder:"Complete the Order",backToShopping:"Back to Shopping",backToCart:"Back to Cart"},securePayment:"Secure Payment",alreadyHaveAnAccount:"Already have an account?",address:"Address",addressError:"Enter address",missingAddressFields:"There are some missing required fields in this address.",editAddress:"Edit Address",deleteAddress:"Delete Address",saveAddressCta:"Save this address for future purchases",firstName:"Name",firstNameError:"Enter name",lastName:"Surname",lastNameError:"Enter surname",identityNumber:"Identity Number",identityNumberError:"Enter identity number",addressTitle:"Adress Title",adressTitleError:"Enter address title",addressLine1:"Address",addressLine2:"Address Second Line",postalCode:"Postal Code",postalCodeError:"Enter postal code",country:"Country",countryError:"Select country",state:"State",stateError:"Select state",city:"City",cityError:"Select city",district:"District",districtError:"Select district",phone:"Phone",phoneError:"Enter a valid phone number",companyName:"Company Name",taxOffice:"Tax Office",taxNumber:"Tax Number",deliveryMethod:"Delivery Method",deliveryToAddress:"Delivery to Address",inStoreDelivery:"In Store Delivery",stockLocation:{deliveryTime:{WITHIN_ONE_HOUR:"Usually ready in 1 hour",WITHIN_TWO_HOURS:"Usually ready in 2 hours",WITHIN_FOUR_HOURS:"Usually ready in 4 hours",WITHIN_TWENTY_FOUR_HOURS:"Usually ready in 24 hours",TWO_IN_FOUR_DAYS:"Usually ready in 2-4 days",WITHIN_PLUS_FIVE_DAYS:"Usually ready in +5 days"}},recipientsInfo:"Recipient Information",pickUpLocation:"Pick Up Location",receiver:"Receiver",shipping:"Shipping",payment:"Payment",summary:"Summary",free:"Free",standartShipping:"Standart Shipping",returnPolicy:"Return Policy",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",newAddress:"New Address",billingAddress:"Billing Address",shippingAddress:"Shipping Address",corporateInvoice:"Corporate invoice",contactInfo:"Contact Information",email:"E-Mail",emailError:"Enter a valid e-mail",guestEmailTooltip:"Your order information will be sent to this e-mail address",customerConsentCta:"Contact me about the news and promotions",useShippingForBilling:"Use shipping address for billing",installmentOptions:"Installment Options",singleInstallment:"Single Payment",installments:"Installments",creditCard:"Credit Card",ackPrivacyPolicy:"Privacy Policy",ackTermsOfService:"Terms of Service",ackPoliciesSentence:"I acknowledge the {{ ackPrivacyPolicy }} and {{ ackTermsOfService }}.",securePaymentTooltip:"All payments are secure and encrypted",giftPackage:"Gift Package",giftPackageCta:"Gift wrap this order",giftPackageCtaPlaceholder:"Enter your gift message",paymentMethod:"Payment Method",paymentMethodDiscount:"Discount",paymentMethodAdditionalPrice:"Fee",orderSuccessTitle:"Thank you for your order!",orderSuccessDescription:"Dear {{ customerName }}, we have received your order. We will notify you when your order is shipped.",orderSuccessInStoreDeliveryDescription:"Dear {{ customerName }}, we have received your order. We will notify you by e-mail when your order is delivered to the store.",orderNoAndDate:"Order Number / Date",paymentSummary:"Payment Summary",shippingSummary:"Shipping Summary",helpCtaQuestion:"Do you need help?",helpCta:"Contact us",contactForm:"Contact Form",contactFormSent:"Message sent successfully",contactFormDescription:"We will respond to your message as soon as possible",contactFormCta:"Type your message",orderPackageStatus:{unfulfilled:"Unfulfilled",readyForShipment:"Ready For Shipment",fulfilled:"Fulfilled",partiallyFulfilled:"Partially Fulfilled",delivered:"Delivered",unableToDeliver:"Unable to Deliver",cancelled:"Cancelled",cancelRejected:"Cancel Rejected",cancelRequested:"Cancel Requested",refunded:"Refunded",refundRequestAccepted:"Refund Request Accepted",refundRejected:"Refund Rejected",refundRequested:"Refund Requested"},quantity:"Quantity",cartItemProduct:"product",giftCodeErrorTitle:"Gift Code Error",giftCodeErrorDescription:"The gift code you entered is not valid or not applicable to the products in your cart. Please check your code and try again.",subtotal:"Subtotal",total:"Total",subtotalTooltip:"Subtotal reflects the total for your cart before the discounts and does not include the shipping fees.",cartShippingTitle:"Delivery / Shipping",cartTaxTitle:"Tax",cartInterest:"Interest",couponCode:"Coupon Code",addCouponCode:"Add coupon code",addOrderNote:"Add order note",editOrderNote:"Edit order note",orderNote:"Order Note",enterPhoneNumber:"Enter phone number",cardNumber:"Card Number",cardNumberError:"Please enter a valid card number",cardHolderName:"Cardholder Name",cardHolderError:"Enter cardholder name",cardExpiry:"Month / Year",cardExpiryError:"Enter a valid date",cardCVC:"CVC",cardCVCError:"Enter a valid CVC",cardCVCTooltip:"CVC is the 3 digit number behind your card",masterPass:{paymentGatewaySelectBox:{delete:"Delete"},creditCardForm:{checkboxLabel:"I want to store my card in the {{ masterpassLogo }} infrastructure.",cardName:"Card Name",phoneNumber:"Phone Number",button:"Send Verification Code"},linkCardToClientModal:{text:"You have a card registered to Masterpass. Click OK to use your card for your shopping.",buttonText:"OK",subInfoText:"Payment process will not be made at this stage."},otpModal:{otpTextBank:"Enter the SMS verification code sent to the cardholder by your bank.",otpTextMasterPass:"Enter the SMS verification code sent by Masterpass.",countdownText:"Remaining time: ",resendText:"Resend code",inputLabel:"Enter the verification code",buttonText:"Verify"},successModal:{otpSuccessText:"Your card successfully registered.",linkCardToClientSuccessText:"Your Masterpass account has been successfully confirmed."}},errorCustomerRequired:"This e-mail address belongs to a registered user. Please login to your account.",errorNoShipping:"Your region is not available for shipping.",errorPayment:"Your payment could not be received. Please check your information and try again.",errorStockTitle:"Stock Update!",errorStockDescription:"Some items in your cart are out of stock. Would you like to continue by removing these products from your cart?",errorUnknown:"An unexpected error has occurred. Please try again.",errorPickupLocationRequired:"Choose pickup location",customizedProduct:"Customized Product",yes:"Yes",no:"No"};export{e as default};
|
|
1
|
+
var e={actions:{login:"Login",edit:"Edit",apply:"Apply",close:"Close",cancel:"Cancel",save:"Save",continue:"Continue",show:"Show",hide:"Hide",sendMessage:"Send Message",continueWithShipping:"Continue with Shipping",continueWithPayment:"Continue with Payment",completeOrder:"Complete the Order",backToShopping:"Back to Shopping",backToCart:"Back to Cart",addToCart:"Add to Cart"},securePayment:"Secure Payment",alreadyHaveAnAccount:"Already have an account?",address:"Address",addressError:"Enter address",missingAddressFields:"There are some missing required fields in this address.",editAddress:"Edit Address",deleteAddress:"Delete Address",saveAddressCta:"Save this address for future purchases",firstName:"Name",firstNameError:"Enter name",lastName:"Surname",lastNameError:"Enter surname",identityNumber:"Identity Number",identityNumberError:"Enter identity number",addressTitle:"Adress Title",adressTitleError:"Enter address title",addressLine1:"Address",addressLine2:"Address Second Line",postalCode:"Postal Code",postalCodeError:"Enter postal code",country:"Country",countryError:"Select country",state:"State",stateError:"Select state",city:"City",cityError:"Select city",district:"District",districtError:"Select district",phone:"Phone",phoneError:"Enter a valid phone number",companyName:"Company Name",taxOffice:"Tax Office",taxNumber:"Tax Number",deliveryMethod:"Delivery Method",deliveryToAddress:"Delivery to Address",inStoreDelivery:"In Store Delivery",stockLocation:{deliveryTime:{WITHIN_ONE_HOUR:"Usually ready in 1 hour",WITHIN_TWO_HOURS:"Usually ready in 2 hours",WITHIN_FOUR_HOURS:"Usually ready in 4 hours",WITHIN_TWENTY_FOUR_HOURS:"Usually ready in 24 hours",TWO_IN_FOUR_DAYS:"Usually ready in 2-4 days",WITHIN_PLUS_FIVE_DAYS:"Usually ready in +5 days"}},recipientsInfo:"Recipient Information",pickUpLocation:"Pick Up Location",receiver:"Receiver",shipping:"Shipping",payment:"Payment",summary:"Summary",free:"Free",standartShipping:"Standart Shipping",returnPolicy:"Return Policy",privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",newAddress:"New Address",billingAddress:"Billing Address",shippingAddress:"Shipping Address",corporateInvoice:"Corporate invoice",contactInfo:"Contact Information",email:"E-Mail",emailError:"Enter a valid e-mail",guestEmailTooltip:"Your order information will be sent to this e-mail address",customerConsentCta:"Contact me about the news and promotions",useShippingForBilling:"Use shipping address for billing",installmentOptions:"Installment Options",singleInstallment:"Single Payment",installments:"Installments",creditCard:"Credit Card",ackPrivacyPolicy:"Privacy Policy",ackTermsOfService:"Terms of Service",ackPoliciesSentence:"I acknowledge the {{ ackPrivacyPolicy }} and {{ ackTermsOfService }}.",securePaymentTooltip:"All payments are secure and encrypted",giftPackage:"Gift Package",giftPackageCta:"Gift wrap this order",giftPackageCtaPlaceholder:"Enter your gift message",paymentMethod:"Payment Method",paymentMethodDiscount:"Discount",paymentMethodAdditionalPrice:"Fee",orderSuccessTitle:"Thank you for your order!",orderSuccessDescription:"Dear {{ customerName }}, we have received your order. We will notify you when your order is shipped.",orderSuccessInStoreDeliveryDescription:"Dear {{ customerName }}, we have received your order. We will notify you by e-mail when your order is delivered to the store.",orderNoAndDate:"Order Number / Date",paymentSummary:"Payment Summary",shippingSummary:"Shipping Summary",helpCtaQuestion:"Do you need help?",helpCta:"Contact us",contactForm:"Contact Form",contactFormSent:"Message sent successfully",contactFormDescription:"We will respond to your message as soon as possible",contactFormCta:"Type your message",orderPackageStatus:{unfulfilled:"Unfulfilled",readyForShipment:"Ready For Shipment",fulfilled:"Fulfilled",partiallyFulfilled:"Partially Fulfilled",delivered:"Delivered",unableToDeliver:"Unable to Deliver",cancelled:"Cancelled",cancelRejected:"Cancel Rejected",cancelRequested:"Cancel Requested",refunded:"Refunded",refundRequestAccepted:"Refund Request Accepted",refundRejected:"Refund Rejected",refundRequested:"Refund Requested"},quantity:"Quantity",cartItemProduct:"product",giftCodeErrorTitle:"Gift Code Error",giftCodeErrorDescription:"The gift code you entered is not valid or not applicable to the products in your cart. Please check your code and try again.",subtotal:"Subtotal",total:"Total",subtotalTooltip:"Subtotal reflects the total for your cart before the discounts and does not include the shipping fees.",cartShippingTitle:"Delivery / Shipping",cartTaxTitle:"Tax",cartInterest:"Interest",couponCode:"Coupon Code",addCouponCode:"Add coupon code",addOrderNote:"Add order note",editOrderNote:"Edit order note",orderNote:"Order Note",enterPhoneNumber:"Enter phone number",cardNumber:"Card Number",cardNumberError:"Please enter a valid card number",cardHolderName:"Cardholder Name",cardHolderError:"Enter cardholder name",cardExpiry:"Month / Year",cardExpiryError:"Enter a valid date",cardCVC:"CVC",cardCVCError:"Enter a valid CVC",cardCVCTooltip:"CVC is the 3 digit number behind your card",masterPass:{paymentGatewaySelectBox:{delete:"Delete"},creditCardForm:{checkboxLabel:"I want to store my card in the {{ masterpassLogo }} infrastructure.",cardName:"Card Name",phoneNumber:"Phone Number",button:"Send Verification Code"},linkCardToClientModal:{text:"You have a card registered to Masterpass. Click OK to use your card for your shopping.",buttonText:"OK",subInfoText:"Payment process will not be made at this stage."},otpModal:{otpTextBank:"Enter the SMS verification code sent to the cardholder by your bank.",otpTextMasterPass:"Enter the SMS verification code sent by Masterpass.",countdownText:"Remaining time: ",resendText:"Resend code",inputLabel:"Enter the verification code",buttonText:"Verify"},successModal:{otpSuccessText:"Your card successfully registered.",linkCardToClientSuccessText:"Your Masterpass account has been successfully confirmed."}},timeRemaining:"Time Remaining {{value}}",errorCustomerRequired:"This e-mail address belongs to a registered user. Please login to your account.",errorNoShipping:"Your region is not available for shipping.",errorPayment:"Your payment could not be received. Please check your information and try again.",errorStockTitle:"Stock Update!",errorStockDescription:"Some items in your cart are out of stock. Would you like to continue by removing these products from your cart?",errorUnknown:"An unexpected error has occurred. Please try again.",errorPickupLocationRequired:"Choose pickup location",customizedProduct:"Customized Product",yes:"Yes",no:"No"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={actions:{login:"Giriş Yap",edit:"Düzenle",apply:"Uygula",close:"Kapat",cancel:"Vazgeç",save:"Kaydet",continue:"Devam Et",show:"Göster",hide:"Gizle",sendMessage:"Mesajı Gönder",continueWithShipping:"Kargo ile Devam Et",continueWithPayment:"Ödeme ile Devam Et",completeOrder:"Siparişi Tamamla",backToShopping:"Alışverişe Dön",backToCart:"Sepete Dön"},securePayment:"Güvenli Ödeme",alreadyHaveAnAccount:"Zaten hesabınız var mı?",address:"Adres",addressError:"Adres girin",missingAddressFields:"Adres bilgilerinde bazı zorunlu alanlar eksik.",editAddress:"Adres Düzenle",deleteAddress:"Adresi Sil",saveAddressCta:"Bir sonraki işlem için bu adresi kaydet",firstName:"Ad",firstNameError:"Ad girin",lastName:"Soyad",lastNameError:"Soyad girin",identityNumber:"TC Kimlik No",identityNumberError:"TC kimlik no girin",addressTitle:"Adres Başlığı",adressTitleError:"Adres başlığı girin",addressLine1:"Adres",addressLine2:"Apartman, daire, vb.",postalCode:"Posta Kodu",postalCodeError:"Posta kodu girin",country:"Ülke",countryError:"Ülke seçin",state:"Eyalet",stateError:"Eyalet seçin",city:"İl",cityError:"İl seçin",district:"İlçe",districtError:"İlçe seçin",phone:"Telefon",phoneError:"Geçerli bir telefon girin",companyName:"Firma Adı",taxOffice:"Vergi Dairesi",taxNumber:"Vergi Numarası",deliveryMethod:"Teslimat Yöntemi",deliveryToAddress:"Adrese Teslimat",inStoreDelivery:"Mağazadan Teslimat",stockLocation:{deliveryTime:{WITHIN_ONE_HOUR:"Genelde 1 saat içinde hazır olur",WITHIN_TWO_HOURS:"Genelde 2 saat içinde hazır olur",WITHIN_FOUR_HOURS:"Genelde 4 saat içinde hazır olur",WITHIN_TWENTY_FOUR_HOURS:"Genelde 24 saat içinde hazır olur",TWO_IN_FOUR_DAYS:"Genelde 2-4 gün içinde hazır olur",WITHIN_PLUS_FIVE_DAYS:"Genelde +5 gün içinde hazır olur"}},recipientsInfo:"Teslim Alacak Kişi Bilgileri",pickUpLocation:"Teslim Alınacak Konum",receiver:"Teslim Alacak Kişi",shipping:"Kargo",payment:"Ödeme",summary:"Özet",free:"Ücretsiz",standartShipping:"Standart Kargo",returnPolicy:"Para İade Politikası",privacyPolicy:"Gizlilik Politikası",termsOfService:"Hizmet Şartları",newAddress:"Yeni Adres",billingAddress:"Fatura Adresi",shippingAddress:"Teslimat Adresi",corporateInvoice:"Kurumsal fatura",contactInfo:"İletişim Bilgileri",email:"E-Posta",emailError:"Geçerli bir e-posta girin",guestEmailTooltip:"Sipariş bilgileri bu e-posta adresine gönderilecektir",customerConsentCta:"Beni haberlerden ve özel tekliflerden haberdar et",useShippingForBilling:"Fatura adresim teslimat adresimle aynı",installmentOptions:"Taksit Seçenekleri",singleInstallment:"Tek Çekim",installments:"Taksit",creditCard:"Kredi Kartı",ackPrivacyPolicy:"Gizlilik Sözleşmesini",ackTermsOfService:"Satış Sözleşmesini",ackPoliciesSentence:"{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",securePaymentTooltip:"Ödemeler güvenli ve şifrelidir",giftPackage:"Hediye Paketi",giftPackageCta:"Hediye paketi istiyorum",giftPackageCtaPlaceholder:"Hediye mesajınızı giriniz",paymentMethod:"Ödeme Yöntemi",paymentMethodDiscount:"İndirim",paymentMethodAdditionalPrice:"İşlem Bedeli",orderSuccessTitle:"Siparişiniz için teşekkür ederiz!",orderSuccessDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",orderSuccessInStoreDeliveryDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz mağazaya teslim edildiğinde sizi e-posta ile bilgilendireceğiz.",orderNoAndDate:"Sipariş No / Tarih",paymentSummary:"Ödeme Özeti",shippingSummary:"Teslimat Özeti",helpCtaQuestion:"Yardıma mı ihtiyacınız var?",helpCta:"Bizimle iletişime geçin",contactForm:"İletişim Formu",contactFormSent:"Mesaj başarıyla gönderildi",contactFormDescription:"Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",contactFormCta:"Mesajınızı yazın",orderPackageStatus:{unfulfilled:"Oluşturuldu",readyForShipment:"Kargoya Hazır",fulfilled:"Gönderildi",partiallyFulfilled:"Kısmi Gönderildi",delivered:"Teslim Edildi",unableToDeliver:"Teslim Edilemedi",cancelled:"İptal Edildi",cancelRejected:"İptal Talebi Reddedildi",cancelRequested:"İptal İstendi",refunded:"İade Edildi",refundRequestAccepted:"İade Talebi Onaylandı",refundRejected:"İade Talebi Reddedildi",refundRequested:"İade Talep Edildi"},quantity:"Adet",cartItemProduct:"ürün",giftCodeErrorTitle:"İndirim Kodu Hatası",giftCodeErrorDescription:"İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",subtotal:"Ara Toplam",total:"Toplam",subtotalTooltip:"Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",cartShippingTitle:"Teslimat / Kargo",cartTaxTitle:"Vergi",cartInterest:"Vade Farkı",couponCode:"İndirim Kodu",addCouponCode:"İndirim kodu ekle",addOrderNote:"Sipariş notu ekle",editOrderNote:"Sipariş notu düzenle",orderNote:"Sipariş Notu",enterPhoneNumber:"Telefon numarası girin",cardNumber:"Kart Numarası",cardNumberError:"Geçerli bir kart numarası girin",cardHolderName:"Kart Üzerindeki İsim",cardHolderError:"Ad soyad girin",cardExpiry:"Ay / Yıl",cardExpiryError:"Geçerli bir tarih girin",cardCVC:"CVC",cardCVCError:"Geçerli bir güvenlik kodu girin",cardCVCTooltip:"Kartınızın arkasındaki 3 haneli güvenlik kodu",masterPass:{paymentGatewaySelectBox:{delete:"Sil"},creditCardForm:{checkboxLabel:"Kartımı {{ masterPassLogo }} altyapısında saklamak istiyorum.",cardName:"Kart İsmi",phoneNumber:"Telefon Numarası",button:"Onay Kodu Gönder"},linkCardToClientModal:{text:"MasterPass’e kayıtlı kartınız bulunmaktadır. Kartınızı alışverişinizde kullanmak için TAMAM’a tıklayınız.",buttonText:"Tamam",subInfoText:"Bu aşamada kartınızdan tahsilat yapılmayacaktır."},otpModal:{otpTextBank:"Bankanız tarafından kart sahibine gönderilen doğrulama kodunu giriniz.",otpTextMasterPass:"Masterpass tarafından gönderilen SMS doğrulama kodunu giriniz.",countdownText:"Kalan Süre: ",resendText:"Yeni kod gönder",inputLabel:"Doğrulama Kodunu Giriniz",buttonText:"Doğrula"},successModal:{otpSuccessText:"Kartınız başarılı bir şekilde tanımlandı.",linkCardToClientSuccessText:"Masterpass hesabınız başarılı bir şekilde doğrulandı."}},errorCustomerRequired:"Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",errorNoShipping:"Bulunduğunuz konuma gönderim yapılmamaktadır.",errorPayment:"Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",errorStockTitle:"Stoklar Güncellendi!",errorStockDescription:"Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",errorUnknown:"Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",errorPickupLocationRequired:"Teslim alınacak konumu seçin",customizedProduct:"Kişiselleştirilmiş Ürün",yes:"Evet",no:"Hayır"};export{e as default};
|
|
1
|
+
var e={actions:{login:"Giriş Yap",edit:"Düzenle",apply:"Uygula",close:"Kapat",cancel:"Vazgeç",save:"Kaydet",continue:"Devam Et",show:"Göster",hide:"Gizle",sendMessage:"Mesajı Gönder",continueWithShipping:"Kargo ile Devam Et",continueWithPayment:"Ödeme ile Devam Et",completeOrder:"Siparişi Tamamla",backToShopping:"Alışverişe Dön",backToCart:"Sepete Dön",addToCart:"Sepete Ekle"},securePayment:"Güvenli Ödeme",alreadyHaveAnAccount:"Zaten hesabınız var mı?",address:"Adres",addressError:"Adres girin",missingAddressFields:"Adres bilgilerinde bazı zorunlu alanlar eksik.",editAddress:"Adres Düzenle",deleteAddress:"Adresi Sil",saveAddressCta:"Bir sonraki işlem için bu adresi kaydet",firstName:"Ad",firstNameError:"Ad girin",lastName:"Soyad",lastNameError:"Soyad girin",identityNumber:"TC Kimlik No",identityNumberError:"TC kimlik no girin",addressTitle:"Adres Başlığı",adressTitleError:"Adres başlığı girin",addressLine1:"Adres",addressLine2:"Apartman, daire, vb.",postalCode:"Posta Kodu",postalCodeError:"Posta kodu girin",country:"Ülke",countryError:"Ülke seçin",state:"Eyalet",stateError:"Eyalet seçin",city:"İl",cityError:"İl seçin",district:"İlçe",districtError:"İlçe seçin",phone:"Telefon",phoneError:"Geçerli bir telefon girin",companyName:"Firma Adı",taxOffice:"Vergi Dairesi",taxNumber:"Vergi Numarası",deliveryMethod:"Teslimat Yöntemi",deliveryToAddress:"Adrese Teslimat",inStoreDelivery:"Mağazadan Teslimat",stockLocation:{deliveryTime:{WITHIN_ONE_HOUR:"Genelde 1 saat içinde hazır olur",WITHIN_TWO_HOURS:"Genelde 2 saat içinde hazır olur",WITHIN_FOUR_HOURS:"Genelde 4 saat içinde hazır olur",WITHIN_TWENTY_FOUR_HOURS:"Genelde 24 saat içinde hazır olur",TWO_IN_FOUR_DAYS:"Genelde 2-4 gün içinde hazır olur",WITHIN_PLUS_FIVE_DAYS:"Genelde +5 gün içinde hazır olur"}},recipientsInfo:"Teslim Alacak Kişi Bilgileri",pickUpLocation:"Teslim Alınacak Konum",receiver:"Teslim Alacak Kişi",shipping:"Kargo",payment:"Ödeme",summary:"Özet",free:"Ücretsiz",standartShipping:"Standart Kargo",returnPolicy:"Para İade Politikası",privacyPolicy:"Gizlilik Politikası",termsOfService:"Hizmet Şartları",newAddress:"Yeni Adres",billingAddress:"Fatura Adresi",shippingAddress:"Teslimat Adresi",corporateInvoice:"Kurumsal fatura",contactInfo:"İletişim Bilgileri",email:"E-Posta",emailError:"Geçerli bir e-posta girin",guestEmailTooltip:"Sipariş bilgileri bu e-posta adresine gönderilecektir",customerConsentCta:"Beni haberlerden ve özel tekliflerden haberdar et",useShippingForBilling:"Fatura adresim teslimat adresimle aynı",installmentOptions:"Taksit Seçenekleri",singleInstallment:"Tek Çekim",installments:"Taksit",creditCard:"Kredi Kartı",ackPrivacyPolicy:"Gizlilik Sözleşmesini",ackTermsOfService:"Satış Sözleşmesini",ackPoliciesSentence:"{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",securePaymentTooltip:"Ödemeler güvenli ve şifrelidir",giftPackage:"Hediye Paketi",giftPackageCta:"Hediye paketi istiyorum",giftPackageCtaPlaceholder:"Hediye mesajınızı giriniz",paymentMethod:"Ödeme Yöntemi",paymentMethodDiscount:"İndirim",paymentMethodAdditionalPrice:"İşlem Bedeli",orderSuccessTitle:"Siparişiniz için teşekkür ederiz!",orderSuccessDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",orderSuccessInStoreDeliveryDescription:"Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz mağazaya teslim edildiğinde sizi e-posta ile bilgilendireceğiz.",orderNoAndDate:"Sipariş No / Tarih",paymentSummary:"Ödeme Özeti",shippingSummary:"Teslimat Özeti",helpCtaQuestion:"Yardıma mı ihtiyacınız var?",helpCta:"Bizimle iletişime geçin",contactForm:"İletişim Formu",contactFormSent:"Mesaj başarıyla gönderildi",contactFormDescription:"Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",contactFormCta:"Mesajınızı yazın",orderPackageStatus:{unfulfilled:"Oluşturuldu",readyForShipment:"Kargoya Hazır",fulfilled:"Gönderildi",partiallyFulfilled:"Kısmi Gönderildi",delivered:"Teslim Edildi",unableToDeliver:"Teslim Edilemedi",cancelled:"İptal Edildi",cancelRejected:"İptal Talebi Reddedildi",cancelRequested:"İptal İstendi",refunded:"İade Edildi",refundRequestAccepted:"İade Talebi Onaylandı",refundRejected:"İade Talebi Reddedildi",refundRequested:"İade Talep Edildi"},quantity:"Adet",cartItemProduct:"ürün",giftCodeErrorTitle:"İndirim Kodu Hatası",giftCodeErrorDescription:"İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",subtotal:"Ara Toplam",total:"Toplam",subtotalTooltip:"Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",cartShippingTitle:"Teslimat / Kargo",cartTaxTitle:"Vergi",cartInterest:"Vade Farkı",couponCode:"İndirim Kodu",addCouponCode:"İndirim kodu ekle",addOrderNote:"Sipariş notu ekle",editOrderNote:"Sipariş notu düzenle",orderNote:"Sipariş Notu",enterPhoneNumber:"Telefon numarası girin",cardNumber:"Kart Numarası",cardNumberError:"Geçerli bir kart numarası girin",cardHolderName:"Kart Üzerindeki İsim",cardHolderError:"Ad soyad girin",cardExpiry:"Ay / Yıl",cardExpiryError:"Geçerli bir tarih girin",cardCVC:"CVC",cardCVCError:"Geçerli bir güvenlik kodu girin",cardCVCTooltip:"Kartınızın arkasındaki 3 haneli güvenlik kodu",masterPass:{paymentGatewaySelectBox:{delete:"Sil"},creditCardForm:{checkboxLabel:"Kartımı {{ masterPassLogo }} altyapısında saklamak istiyorum.",cardName:"Kart İsmi",phoneNumber:"Telefon Numarası",button:"Onay Kodu Gönder"},linkCardToClientModal:{text:"MasterPass’e kayıtlı kartınız bulunmaktadır. Kartınızı alışverişinizde kullanmak için TAMAM’a tıklayınız.",buttonText:"Tamam",subInfoText:"Bu aşamada kartınızdan tahsilat yapılmayacaktır."},otpModal:{otpTextBank:"Bankanız tarafından kart sahibine gönderilen doğrulama kodunu giriniz.",otpTextMasterPass:"Masterpass tarafından gönderilen SMS doğrulama kodunu giriniz.",countdownText:"Kalan Süre: ",resendText:"Yeni kod gönder",inputLabel:"Doğrulama Kodunu Giriniz",buttonText:"Doğrula"},successModal:{otpSuccessText:"Kartınız başarılı bir şekilde tanımlandı.",linkCardToClientSuccessText:"Masterpass hesabınız başarılı bir şekilde doğrulandı."}},timeRemaining:"Kalan Süre {{value}}",errorCustomerRequired:"Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",errorNoShipping:"Bulunduğunuz konuma gönderim yapılmamaktadır.",errorPayment:"Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",errorStockTitle:"Stoklar Güncellendi!",errorStockDescription:"Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",errorUnknown:"Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",errorPickupLocationRequired:"Teslim alınacak konumu seçin",customizedProduct:"Kişiselleştirilmiş Ürün",yes:"Evet",no:"Hayır"};export{e as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import CheckoutViewModel, { CampaignOfferType } from "../../model";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
vm: CheckoutViewModel;
|
|
5
|
+
campaignOffer: CampaignOfferType;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: React.FunctionComponent<Props>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as a}from"../../../../utils/currency.js";import{useTranslation as r}from"../../../../utils/i18n.js";import{Button as n}from"../button/index.js";import c from"./select/index.js";import o from"./style.module.scss.js";var i=function(t){var a=t.seconds,n=t.rejectOffer,c=r().t,i=e.useState(a),d=i[0],s=i[1];e.useEffect((function(){var e=d>0&&setInterval((function(){return s(d-1)}),1e3);return 0===d&&n(),function(){return clearInterval(e)}}),[d]);return e.createElement("div",{className:o.CountdownContainer},e.createElement("div",{className:o.CountdownText},c("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")}(d)})))},d=t((function(t){var d,s=t.vm,l=t.campaignOffer,u=r().t,m=e.useState(l.productDetail.selectedVariant.id),f=m[0],p=m[1];return e.createElement("div",{className:o.Container},l.offer.countdownMinutes&&e.createElement(i,{seconds:60*l.offer.countdownMinutes,rejectOffer:function(){s.updateCartCampaignOffer({accepted:!1,cartId:s.checkout.id,campaignOfferId:l.campaignOffer.id,campaignOfferProductId:l.offer.id,productId:l.offer.productId,variantId:f})}}),e.createElement("div",{className:o.ContentContainer},e.createElement("div",{className:o.Title},l.offer.title),e.createElement("div",{className:o.ProductContainer},e.createElement("div",{className:o.ImageContainer},e.createElement("img",{className:o.Image,src:null===(d=l.productDetail.selectedVariant.mainImage)||void 0===d?void 0:d.thumbnailSrc})),e.createElement("div",{className:o.ProductDetails},e.createElement("div",{className:o.ProductName},l.productDetail.product.name),l.productDetail.product.brand&&e.createElement("div",{className:o.Brand},l.productDetail.product.brand.name),e.createElement("div",{className:o.ProductPrice},e.createElement("span",{className:o.Discount},a(l.productDetail.selectedVariant.price.finalPrice,s.checkout.currencyCode))," ",a(l.productDetail.selectedVariant.price.finalPrice-l.productDetail.selectedVariant.price.finalPrice*(l.offer.discountAmount||100)/100,s.checkout.currencyCode)),e.createElement("div",{className:o.Actions},l.productDetail.product.hasVariant&&e.createElement(c,{value:f,onSelectChange:function(e){p(e)},options:l.productDetail.product.variants.map((function(e){return{label:e.variantValues.map((function(e){return e.name})).join(", "),value:e.id}}))}),e.createElement(n,{style:{width:"100%",height:44,fontSize:14},isDisabled:!l.productDetail.hasStock,text:u("checkout-page:actions.addToCart"),onClick:function(){s.updateCartCampaignOffer({accepted:!0,cartId:s.checkout.id,campaignOfferId:l.campaignOffer.id,campaignOfferProductId:l.offer.id,productId:l.offer.productId,variantId:f})}}))))))}));export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t=function(t){var r=t.className;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 9 12",width:"9",height:"12",className:r},e.createElement("path",{d:"M4.5 12 .603 7.5h7.794L4.5 12ZM4.5 0l3.897 4.5H.603L4.5 0Z",fill:"currentColor"}))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import a from"./style.module.scss.js";import l from"./arrows.js";var r=t((function(t){var r=t.value,n=t.options,o=t.onSelectChange;return e.createElement("div",{className:a.Container},e.createElement("select",{className:a.Select,onChange:function(e){return o(e.target.value)}},!r&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null==n?void 0:n.map((function(t,a){return e.createElement("option",{key:a+t.value,value:t.label,selected:r===t.value},t.label)}))),e.createElement("div",{className:a.ArrowContainer},e.createElement(l,null)))}));export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from'../../../../../ext/style-inject/dist/style-inject.es.js';var n={Container:"style-module_Container__2ba6d",Select:"style-module_Select__1zjWz",ArrowContainer:"style-module_ArrowContainer__19Qj8"};e(".style-module_Container__2ba6d {\n position: relative;\n margin-right: 12px;\n}\n\n.style-module_Select__1zjWz {\n height: 44px;\n width: 80px;\n appearance: none;\n border: 1px solid var(--checkout-border-color);\n border-radius: 8px;\n padding-left: 16px;\n padding-right: 25px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.style-module_ArrowContainer__19Qj8 {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n flex-direction: column;\n}");export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from'../../../../ext/style-inject/dist/style-inject.es.js';var o={Container:"style-module_Container__3zW3x",CountdownContainer:"style-module_CountdownContainer__2-1gy",CountdownText:"style-module_CountdownText__X4H5U",ContentContainer:"style-module_ContentContainer__2Xs-1",Title:"style-module_Title__2BmRm",ProductContainer:"style-module_ProductContainer__1oWuO",ImageContainer:"style-module_ImageContainer__3HIYg",Image:"style-module_Image__3CWsj",ProductDetails:"style-module_ProductDetails__3qkC5",ProductName:"style-module_ProductName__hjoHz",Brand:"style-module_Brand__3LHOL",ProductPrice:"style-module_ProductPrice__2NcwT",Discount:"style-module_Discount__2mg3j",Actions:"style-module_Actions__1lwfq"};n(".style-module_Container__3zW3x {\n margin-top: 32px;\n margin-bottom: 48px;\n background-color: var(--checkout-card-bg-color);\n border-radius: 8px;\n}\n\n.style-module_CountdownContainer__2-1gy {\n display: flex;\n justify-content: center;\n padding: 6px;\n background-color: #cfced3;\n border-radius: 8px 8px 0 0;\n}\n\n.style-module_CountdownText__X4H5U {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n}\n\n.style-module_ContentContainer__2Xs-1 {\n padding: 24px;\n width: 100%;\n}\n\n.style-module_Title__2BmRm {\n margin-bottom: 24px;\n font-size: 22px;\n color: var(--checkout-primary-text-color);\n font-weight: 600;\n}\n\n.style-module_ProductContainer__1oWuO {\n display: flex;\n}\n\n.style-module_ImageContainer__3HIYg {\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__3CWsj {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 8px;\n}\n\n.style-module_ProductDetails__3qkC5 {\n flex: 1;\n}\n\n.style-module_ProductName__hjoHz {\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__3LHOL {\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__2NcwT {\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__2mg3j {\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__1lwfq {\n display: flex;\n margin-top: 24px;\n}");export{o 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 r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import s from"next/link.js";import a from'../../ext/react-tooltip/dist/index.es.js';import m,{CheckoutStep as n}from"./model.js";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";import'../../ext/lodash/isArguments.js';import'../../ext/lodash/isBuffer.js';import'../../ext/lodash/isTypedArray.js';import'../../ext/lodash/_baseGetTag.js';import{formatMoney as d}from"../../utils/currency.js";import{useTranslation as p}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as v}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as h}from"./steps/step-payment/index.js";import{CartSummary as g}from"./components/cart-summary/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as E}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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 x}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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as j}from"./components/modal/index.js";import y from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-link-card-to-client/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as M}from"../image/index.js";import N,{Step as F}from"./components/step-container/index.js";import{StockError as T}from"./components/error/stock-error/index.js";import{FullscreenLoading as P}from"./components/fullscreen-loading/index.js";import S from"./components/notification-box/index.js";import{FormItem as V}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";import{IkasPageHead as L}from"../page/head.js";import I from"./components/svg/ikas.js";import B from"./style.module.scss.js";var O=r((function(e){var t,r,s,d=e.checkout,u=e.checkoutSettings,v=e.merchantSettings,h=e.customizationProps,x=e.returnPolicy,M=e.privacyPolicy,N=e.termsOfService,F=p().t,S=i(),V=o.useState((function(){return new m(d,u,v,S,x,M,N,F,h||{})}))[0];return V.step===n.PAYMENT&&l.disableHTML(),o.useEffect((function(){V.checkoutSettings.isAccountRequired&&!V.checkout.hasCustomer&&S.push("/account/login?redirect="+encodeURIComponent(V.checkoutUrl)),l.beginCheckout(V.checkout),l.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){V.customizationProps=h,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")}(h)}),[h]),V.isCheckoutLoaded&&V.store.customerStore.initialized?V.checkout.hasCustomer&&(null===(t=V.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=V.checkout.customer)||void 0===r?void 0:r.id)?(S.push("/account/login?redirect="+encodeURIComponent(V.checkoutUrl)),null):(console.log("vm.mpVM.visibleModal",V.mpVM.visibleModal),o.createElement(o.Fragment,null,o.createElement(L,{pageType:E.CHECKOUT,pageTitle:((null===(s=V.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+F("checkout-page:securePayment"),pageDescription:F("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:B.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:B.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:B.Left},o.createElement("div",{className:B.LeftContent},o.createElement("div",null,o.createElement(R,{vm:V}),V.hasStockError&&o.createElement("div",{className:B.ErrorContainer},o.createElement(T,{vm:V,error:V.error})),!V.hasStockError&&o.createElement(o.Fragment,null,o.createElement(g,{vm:V,allowExpand:!0}),V.step===n.SUCCESS?o.createElement(f,{vm:V}):o.createElement(U,{vm:V})),o.createElement("div",{className:B.Space})),o.createElement(D,{vm:V}))),o.createElement("div",{className:B.Right},o.createElement("div",{className:B.RightContent},o.createElement(g,{vm:V}),o.createElement("div",{className:B.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(I,null))))),!!V.policyModalText&&o.createElement(j,{title:V.policyModalTitle,modalContent:V.policyModalText,onClose:function(){V.policyModalText=""}}),V.isContactModalVisible&&o.createElement(G,{vm:V,setVisible:V.setContactModalVisible}),V.mpVM.isLinkCardToClientModalVisible&&o.createElement(k,{visible:V.mpVM.isLinkCardToClientModalVisible,vm:V,onClose:V.mpVM.hideLinkCardToClientModal}),V.mpVM.isOtpModalVisible&&o.createElement(y,{vm:V,visible:V.mpVM.isOtpModalVisible,type:V.mpVM.otpModalType,onClose:V.mpVM.hideOtpModal}),V.mpVM.isResponseModalVisible&&o.createElement(C,{visible:V.mpVM.isResponseModalVisible,text:V.mpVM.mfsResponseModalText,onClose:V.mpVM.onResponseModalClose}),V.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:V.mpVM.isSuccessModalVisible,type:V.mpVM.successModalType,onClose:V.mpVM.onSuccessModalClose})))):o.createElement(P,null)})),R=r((function(e){var t,r,i=e.vm,a=p().t;return o.createElement("div",{className:B.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=i.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:B.Logo},o.createElement(M,{layout:"fill",image:i.merchantSettings.logo,sizes:"360px"})):(null===(r=i.merchantSettings)||void 0===r?void 0:r.merchantName)||"")),!i.checkout.hasCustomer&&o.createElement("div",{className:B.LoginText},o.createElement("span",{className:B.LoginCta},a("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(i.checkoutUrl),passHref:!0},o.createElement("a",{className:B.LoginBtn},a("checkout-page:actions.login")))),i.checkout.hasCustomer&&o.createElement("div",{className:B.CustomerInfo},o.createElement("div",{className:B.Name},i.checkout.customerFullName),o.createElement("div",{className:B.Email},i.checkout.customerEmail)))})),U=r((function(e){var t=e.vm,r=p().t,i=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(u,{vm:t});case n.SHIPPING:return o.createElement(v,{vm:t});case n.PAYMENT:return o.createElement(h,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new F(r("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:B.AdressStepInfo},o.createElement(H,{vm:t}),o.createElement("div",{className:B.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:B.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0),new F(r("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"===t.deliveryMethod&&s.splice(1,0,new F(r("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:B.AdressStepInfo},o.createElement(_,{vm:t}),t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1&&o.createElement("div",{className:B.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:B.AddressStepInfoMobile},o.createElement(_,{vm:t})):void 0)),o.createElement(N,{steps:s,stepContent:i})})),H=r((function(e){var t,r,i,s,a,m=e.vm,n=p().t,l=((null===(t=m.checkout.shippingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=m.checkout.shippingAddress)||void 0===r?void 0:r.lastName)||"");return o.createElement("div",{className:B.Address},o.createElement("div",{className:[B.Text,B.WithMBottom].join(" ")},(null===(i=m.checkout.customer)||void 0===i?void 0:i.email)||""),"address"===m.deliveryMethod?o.createElement("div",{className:B.Text},l):o.createElement(o.Fragment,null,o.createElement("div",{className:B.Text},n("checkout-page:receiver")),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},l)),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},null===(s=m.checkout.shippingAddress)||void 0===s?void 0:s.phone),"in-store"===m.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[B.Text,B.WithMTop].join(" ")},n("checkout-page:pickUpLocation"))),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},null===(a=m.checkout.shippingAddress)||void 0===a?void 0:a.addressText))})),_=r((function(e){var t=e.vm,r=p().t;return o.createElement("div",{className:B.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:B.LightText}," / "+(0===t.checkout.shippingLines[0].price?r("checkout-page:free"):d(t.checkout.shippingLines[0].price,t.checkout.currencyCode)))):r("checkout-page:standartShipping"))})),D=r((function(e){var t=e.vm,r=p().t;return o.createElement("div",{className:B.Footer},o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")))})),G=r((function(r){var i,s,a=r.vm,m=r.setVisible,n=p().t,l=o.useState(!1),c=l[0],d=l[1],u=o.useState(!1),v=u[0],h=u[1],g=o.useState(new x({message:{requiredRule:"",emailRule:"",minRule:""},store:a.store}))[0];g.email=a.checkout.customerEmail,g.firstName=(null===(i=a.checkout.customer)||void 0===i?void 0:i.firstName)||"",g.lastName=(null===(s=a.checkout.customer)||void 0===s?void 0:s.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return v?[2,m(!1)]:(d(!0),[4,g.saveContactForm()]);case 1:return e.sent()&&h(!0),d(!1),[2]}}))}))}),[c]);return o.createElement(j,{title:n("checkout-page:contactForm"),modalContent:o.createElement("div",null,v&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(S,{type:"success",title:n("checkout-page:contactFormSent"),content:n("checkout-page:contactFormDescription")})),o.createElement(V,{type:A.TEXT_AREA,label:"",value:g.message||"",onChange:g.onMessageChange,textAreaPlaceholder:n("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:n(v?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:c,isDisabled:!g.message,onClick:E})),onClose:function(){return m(!1)}})}));export{O as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import{useRouter as i}from"next/router.js";import s from"next/link.js";import a from'../../ext/react-tooltip/dist/index.es.js';import m,{CheckoutStep as n}from"./model.js";import{Analytics as l}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{IkasStorefrontConfig as c}from"../../storefront/index.js";import'../../ext/lodash/isArguments.js';import'../../ext/lodash/isBuffer.js';import'../../ext/lodash/isTypedArray.js';import'../../ext/lodash/_baseGetTag.js';import{formatMoney as d}from"../../utils/currency.js";import{useTranslation as p}from"../../utils/i18n.js";import u from"./steps/step-info/index.js";import{CheckoutStepShipping as v}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as h}from"./steps/step-payment/index.js";import{CartSummary as g}from"./components/cart-summary/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"mobx";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import{IkasThemePageType as E}from"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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 f}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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import{StepSuccess as x}from"./steps/step-success/index.js";import{Modal as j}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import y from"./components/master-pass/modal-link-card-to-client/index.js";import C from"./components/master-pass/modal-response/index.js";import b from"./components/master-pass/modal-success/index.js";import{Image as M}from"../image/index.js";import N,{Step as F}from"./components/step-container/index.js";import{StockError as T}from"./components/error/stock-error/index.js";import{FullscreenLoading as S}from"./components/fullscreen-loading/index.js";import P from"./components/notification-box/index.js";import{FormItem as V}from"./components/form-item/index.js";import{FormItemType as A}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";import{IkasPageHead as L}from"../page/head.js";import I from"./components/offer-product/index.js";import B from"./components/svg/ikas.js";import O from"./style.module.scss.js";var R=r((function(e){var t,r,s,d=e.checkout,u=e.checkoutSettings,v=e.merchantSettings,h=e.customizationProps,f=e.returnPolicy,M=e.privacyPolicy,N=e.termsOfService,F=p().t,P=i(),V=o.useState((function(){return new m(d,u,v,P,f,M,N,F,h||{})}))[0];return V.step===n.PAYMENT&&l.disableHTML(),o.useEffect((function(){V.checkoutSettings.isAccountRequired&&!V.checkout.hasCustomer&&P.push("/account/login?redirect="+encodeURIComponent(V.checkoutUrl)),l.beginCheckout(V.checkout),l.pageView(E.CHECKOUT)}),[]),o.useEffect((function(){V.customizationProps=h,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")}(h)}),[h]),V.isCheckoutLoaded&&V.store.customerStore.initialized?V.checkout.hasCustomer&&(null===(t=V.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(r=V.checkout.customer)||void 0===r?void 0:r.id)?(P.push("/account/login?redirect="+encodeURIComponent(V.checkoutUrl)),null):(console.log("vm.mpVM.visibleModal",V.mpVM.visibleModal),o.createElement(o.Fragment,null,o.createElement(L,{pageType:E.CHECKOUT,pageTitle:((null===(s=V.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+F("checkout-page:securePayment"),pageDescription:F("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(U,{vm:V}),V.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(T,{vm:V,error:V.error})),V.checkoutCampaignOffer&&V.step!==n.SUCCESS&&o.createElement(I,{vm:V,campaignOffer:V.checkoutCampaignOffer}),!V.hasStockError&&o.createElement(o.Fragment,null,o.createElement(g,{vm:V,allowExpand:!0}),V.step===n.SUCCESS?o.createElement(x,{vm:V}):o.createElement(H,{vm:V})),o.createElement("div",{className:O.Space})),o.createElement(G,{vm:V}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(g,{vm:V}),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(B,null))))),!!V.policyModalText&&o.createElement(j,{title:V.policyModalTitle,modalContent:V.policyModalText,onClose:function(){V.policyModalText=""}}),V.isContactModalVisible&&o.createElement(Y,{vm:V,setVisible:V.setContactModalVisible}),V.mpVM.isLinkCardToClientModalVisible&&o.createElement(y,{visible:V.mpVM.isLinkCardToClientModalVisible,vm:V,onClose:V.mpVM.hideLinkCardToClientModal}),V.mpVM.isOtpModalVisible&&o.createElement(k,{vm:V,visible:V.mpVM.isOtpModalVisible,type:V.mpVM.otpModalType,onClose:V.mpVM.hideOtpModal}),V.mpVM.isResponseModalVisible&&o.createElement(C,{visible:V.mpVM.isResponseModalVisible,text:V.mpVM.mfsResponseModalText,onClose:V.mpVM.onResponseModalClose}),V.mpVM.isSuccessModalVisible&&o.createElement(b,{visible:V.mpVM.isSuccessModalVisible,type:V.mpVM.successModalType,onClose:V.mpVM.onSuccessModalClose})))):o.createElement(S,null)})),U=r((function(e){var t,r,i=e.vm,a=p().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=i.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(M,{layout:"fill",image:i.merchantSettings.logo,sizes:"360px"})):(null===(r=i.merchantSettings)||void 0===r?void 0:r.merchantName)||"")),!i.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},a("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(i.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},a("checkout-page:actions.login")))),i.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},i.checkout.customerFullName),o.createElement("div",{className:O.Email},i.checkout.customerEmail)))})),H=r((function(e){var t=e.vm,r=p().t,i=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(u,{vm:t});case n.SHIPPING:return o.createElement(v,{vm:t});case n.PAYMENT:return o.createElement(h,{vm:t});case n.SUCCESS:return o.createElement(x,{vm:t})}}),[t,t.step]),s=[new F(r("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(_,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},r("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(_,{vm:t})):void 0),new F(r("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"===t.deliveryMethod&&s.splice(1,0,new F(r("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(D,{vm:t}),t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},r("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(D,{vm:t})):void 0)),o.createElement(N,{steps:s,stepContent:i})})),_=r((function(e){var t,r,i,s,a,m=e.vm,n=p().t,l=((null===(t=m.checkout.shippingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(r=m.checkout.shippingAddress)||void 0===r?void 0:r.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(i=m.checkout.customer)||void 0===i?void 0:i.email)||""),"address"===m.deliveryMethod?o.createElement("div",{className:O.Text},l):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},n("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},l)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},null===(s=m.checkout.shippingAddress)||void 0===s?void 0:s.phone),"in-store"===m.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},n("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},null===(a=m.checkout.shippingAddress)||void 0===a?void 0:a.addressText))})),D=r((function(e){var t=e.vm,r=p().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?r("checkout-page:free"):d(t.checkout.shippingLines[0].price,t.checkout.currencyCode)))):r("checkout-page:standartShipping"))})),G=r((function(e){var t=e.vm,r=p().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},r("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},r("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=r("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},r("checkout-page:termsOfService")))})),Y=r((function(r){var i,s,a=r.vm,m=r.setVisible,n=p().t,l=o.useState(!1),c=l[0],d=l[1],u=o.useState(!1),v=u[0],h=u[1],g=o.useState(new f({message:{requiredRule:"",emailRule:"",minRule:""},store:a.store}))[0];g.email=a.checkout.customerEmail,g.firstName=(null===(i=a.checkout.customer)||void 0===i?void 0:i.firstName)||"",g.lastName=(null===(s=a.checkout.customer)||void 0===s?void 0:s.lastName)||"";var E=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return v?[2,m(!1)]:(d(!0),[4,g.saveContactForm()]);case 1:return e.sent()&&h(!0),d(!1),[2]}}))}))}),[c]);return o.createElement(j,{title:n("checkout-page:contactForm"),modalContent:o.createElement("div",null,v&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(P,{type:"success",title:n("checkout-page:contactFormSent"),content:n("checkout-page:contactFormDescription")})),o.createElement(V,{type:A.TEXT_AREA,label:"",value:g.message||"",onChange:g.onMessageChange,textAreaPlaceholder:n("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:n(v?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:c,isDisabled:!g.message,onClick:E})),onClose:function(){return m(!1)}})}));export{R as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRouter } from "next/router.js";
|
|
2
|
-
import { IkasMerchantSettings, IkasAvailableShippingMethod, IkasOrderLineItem, IkasOrderTransaction } from "../../models";
|
|
2
|
+
import { IkasMerchantSettings, IkasAvailableShippingMethod, IkasOrderLineItem, IkasOrderTransaction, IkasProductDetail, IkasCartCampaignOffer } from "../../models";
|
|
3
3
|
import { IkasPaymentGateway } from "../../models/data/payment-gateway";
|
|
4
4
|
import { IkasOrderLineVariant } from "../../models/data/order/line-item/variant";
|
|
5
5
|
import { IkasStorefront } from "../../models/data/storefront";
|
|
@@ -15,6 +15,9 @@ import { GetAvailableStockLocation } from "../../__api/models/GetAvailableStockL
|
|
|
15
15
|
import { CreateStripePaymentIntentResponse } from "../../__api/models/CreateStripePaymentIntentResponse";
|
|
16
16
|
import { IkasCheckoutCustomizationProps } from ".";
|
|
17
17
|
import MasterPassModel from "./modelMasterPass";
|
|
18
|
+
import { CampaignOfferTargetPageTypeEnum, UpdateCartCampaignOfferInput } from "src/__api/types";
|
|
19
|
+
import { CampaignOffer } from "src/__api/models/CampaignOffer";
|
|
20
|
+
import { CampaignOfferProduct } from "src/__api/models/CampaignOfferProduct";
|
|
18
21
|
export default class CheckoutViewModel {
|
|
19
22
|
checkout: IkasCheckout;
|
|
20
23
|
checkoutSettings: IkasCheckoutSettings;
|
|
@@ -43,6 +46,8 @@ export default class CheckoutViewModel {
|
|
|
43
46
|
availableStockLocations: GetAvailableStockLocation[];
|
|
44
47
|
deliveryMethod: "address" | "in-store";
|
|
45
48
|
stripeResponse: CreateStripePaymentIntentResponse | null;
|
|
49
|
+
checkoutCampaignOffer: CampaignOfferType | undefined;
|
|
50
|
+
postCheckoutCampaignOffer: CampaignOfferType | undefined;
|
|
46
51
|
returnPolicy: string;
|
|
47
52
|
privacyPolicy: string;
|
|
48
53
|
termsOfService: string;
|
|
@@ -120,6 +125,16 @@ export default class CheckoutViewModel {
|
|
|
120
125
|
changeStep: (step: CheckoutStep) => Promise<void>;
|
|
121
126
|
logout: () => Promise<void>;
|
|
122
127
|
setContactModalVisible: (value: boolean) => void;
|
|
128
|
+
getWaitingForActionCampaignOffer: (tagetPage: CampaignOfferTargetPageTypeEnum) => IkasCartCampaignOffer | null;
|
|
129
|
+
getOffer: (waitingForActionCampaignOffer: IkasCartCampaignOffer) => import("src/__api/models/CampaignOfferProduct").CampaignOfferProductData | null | undefined;
|
|
130
|
+
getProduct: (productId: string) => Promise<IkasProductDetail | null>;
|
|
131
|
+
getCampaignOfferProducts: (tagetPage: CampaignOfferTargetPageTypeEnum) => Promise<{
|
|
132
|
+
productDetail: IkasProductDetail;
|
|
133
|
+
campaignOffer: import("src/__api/models/CampaignOffer").CampaignOfferData;
|
|
134
|
+
offer: import("src/__api/models/CampaignOfferProduct").CampaignOfferProductData;
|
|
135
|
+
} | undefined>;
|
|
136
|
+
getCampaignOffer: () => Promise<void>;
|
|
137
|
+
updateCartCampaignOffer: (props: UpdateCartCampaignOfferInput) => Promise<void>;
|
|
123
138
|
}
|
|
124
139
|
export declare enum CheckoutStep {
|
|
125
140
|
INFO = "info",
|
|
@@ -143,3 +158,8 @@ export declare type StockErrorData = {
|
|
|
143
158
|
variant: IkasOrderLineVariant;
|
|
144
159
|
availableQuantity: number;
|
|
145
160
|
};
|
|
161
|
+
export declare type CampaignOfferType = {
|
|
162
|
+
productDetail: IkasProductDetail;
|
|
163
|
+
campaignOffer: CampaignOffer;
|
|
164
|
+
offer: CampaignOfferProduct;
|
|
165
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from'../../ext/lodash/cloneDeep.js';import r from'../../ext/lodash/sortBy.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import{IkasCustomerAddress as o}from"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import{IkasOrderAddress as a}from"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import{IkasOrderCustomer as d}from"../../models/data/order/customer/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import"../../models/data/payment-gateway/index.js";import c from"./components/credit-card-form/model.js";import{IkasStorefrontConfig as l}from"../../storefront/index.js";import{IkasCheckoutSettings as u}from"../../models/data/checkout-settings/index.js";import{Analytics as h}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import p from"../../models/data/checkout/index.js";import m from"../../store/customer/api.js";import v from"../../store/merchant/index.js";import f from"../../store/checkout/index.js";import{CheckStocksLineInput as g}from"../../__api/models/CheckStocksLineInput.js";import y from"../../store/cart/api.js";import{SaveCartInput as S}from"../../__api/models/SaveCartInput.js";import{PaymentMethodEnum as k,PaymentGatewayTypeEnum as b,TransactionStatusEnum as I}from"../../__api/types/index.js";import C from"./modelMasterPass.js";import P from'../../ext/uuid/dist/esm-node/v4.js';var A,w,j=/^\d+$/,N="undefined"==typeof localStorage,R=function(){function j(j,R,T,O,D,M,G,_,L){var U=this;this.checkout=new p,this.checkoutSettings=new u,this.storefront=null,this.store=l.store,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=A.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.showTestModal=!1,this.init=function(){return t(U,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.store.customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getMerchantSettings()];case 2:return t.sent(),[4,this.initStep()];case 3:return t.sent(),[2]}}))}))},this.initStep=function(){return t(U,void 0,void 0,(function(){var t,i,s,n,r,o,d;return e(this,(function(e){switch(e.label){case 0:if(l.isEditor)return this.step=A.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===A.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(A.INFO)];if(this.step!==A.PAYMENT||this.canProceedToPayment){if(![A.INFO,A.SUCCESS,A.SHIPPING,A.PAYMENT].includes(this.step))return[2,this.changeStep(A.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(A.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:w.PAYMENT_ERROR,data:n||null}),this.step!==A.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==A.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=A.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==A.SHIPPING||(null===(d=this.checkout.availableShippingMethods)||void 0===d?void 0:d.length)?this.step!==A.PAYMENT&&this.step!==A.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:w.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:w.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===A.PAYMENT&&this.isInStoreDelivery&&(this.checkout.billingAddress=new a),this.step===A.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(A.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,h.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getMerchantSettings=function(){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.merchantSettings?[3,2]:[4,v.listMerchantSettings({})];case 1:t=e.sent(),this.merchantSettings=t.data||void 0,e.label=2;case 2:return[2]}}))}))},this.getSuccessTransaction=function(){return t(U,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,m.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[0]:void 0,[2]}}))}))},this.saveCart=function(){return t(U,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return(t=new S(this.checkout)).cartId=this.checkout.id,"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step===A.INFO&&(t.billingAddress=null),[4,y.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:w.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:w.API_ERROR};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(U,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(U,void 0,void 0,(function(){var t,i,s,n,r,o,a,d,c,u,h,p;return e(this,(function(e){switch(e.label){case 0:return t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,f.checkStocks({lines:t.map((function(t){return new g(t)})),stockLocationIdList:l.stockLocationIds||[]})];case 1:if(!(i=e.sent()).isSuccess)throw{type:w.API_ERROR};if(null==(s=null===(h=null===(u=i.data)||void 0===u?void 0:u.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=null===(p=o.store.cartStore.cart)||void 0===p?void 0:p.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push(e)},o=this,a=0,d=s;a<d.length;a++)c=d[a],r(c);throw{type:w.STOCK_ERROR,data:n}}return[2]}}))}))},this.removeUnavailableItems=function(i){return t(U,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,this.store.cartStore.removeItem(n)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,f.getAvailableShippingCountries({salesChannelId:l.salesChannelId})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(U,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return l.pickUpStockLocationIds?[4,f.listStockLocation({id:{in:l.pickUpStockLocationIds}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:w.API_ERROR},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(U,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return l.pickUpStockLocationIds?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,f.getAvailableStockLocations({lines:t.map((function(t){return new g(t)})),stockLocationIdList:l.pickUpStockLocationIds})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:w.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=U.shippingCountryIds)||void 0===t?void 0:t.length)||(U.error={type:w.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(U.checkout.stockLocationId=null),U.deliveryMethod=t,U.isErrorsVisible=!1},this.initialStockCheck=function(){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:w.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(U,void 0,void 0,(function(){var t,i,s,n,o,a,d,c,u,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=l.paymentGateways.map((function(t){return t.id})),[4,f.listPaymentGateway({id:t?void 0:{in:i}})];case 1:return(s=e.sent()).isSuccess&&(null===(c=s.data)||void 0===c?void 0:c.length)?(n=s.data,this.step===A.PAYMENT&&(n=n.filter((function(t){return!t.supportedCurrencies.length||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(u=this.checkout.shippingAddress)||void 0===u?void 0:u.country)&&o.iso2&&(n=n.filter((function(t){return!t.availableCountries.length||t.availableCountries.includes(o.iso2||"")})))),a=[],r(l.paymentGateways,"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),console.log("1"),this.step===A.PAYMENT&&(console.log("2",{paymentGateways:n}),(d=n.find((function(t){return!!t.masterPassClientId})))&&(console.log("3"),this.checkout.masterPassPaymentGateway=d,this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),[2]):(this.error={type:w.API_ERROR},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(U,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,f.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;U.store.customerStore.customer?(null===(t=U.store.customerStore.customer.addresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=U.checkoutSettings})),U.checkout.customer=new d(U.store.customerStore.customer)):U.checkout.customer||(U.checkout.customer=new d({}))},this.createShippingAddress=function(){var t;if(U.checkout.shippingAddress)U.selectedShippingAddressId=U.checkout.shippingAddress.id||"-1",U.checkout.shippingAddress.checkoutSettings=U.checkoutSettings;else{var e=null===(t=U.store.customerStore.customer)||void 0===t?void 0:t.addresses;U.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}},this.createBillingAddress=function(){"undefined"!=typeof localStorage&&(U.useDifferentAddress=!!localStorage.getItem("sAddr"),U.useDifferentAddress?(U.checkout.billingAddress&&(U.selectedBillingAddressId=U.checkout.billingAddress.id||"-1"),U.checkout.billingAddress=U.checkout.billingAddress||new a):U.isInStoreDelivery?U.checkout.billingAddress=new a(n(U.checkout.billingAddress)||{}):U.checkout.billingAddress=new a(n(U.checkout.shippingAddress)||{}),U.checkout.billingAddress.checkoutSettings=U.checkoutSettings)},this.onShippingMethodChange=function(i){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new p(t)),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(U,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(U,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,y.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data&&(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===A.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),s&&(r=this.checkout,this.checkout=new p(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway})))),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e,i;if(U.selectedShippingAddressId=t,"-1"===t)U.checkout.shippingAddress=new a;else{var s=null===(i=null===(e=U.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(U.checkout.shippingAddress=new a(s))}U.checkout.shippingAddress&&(U.checkout.shippingAddress.checkoutSettings=U.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e,i;if(U.selectedBillingAddressId=t,"-1"===t)U.checkout.billingAddress=new a;else{var s=null===(i=null===(e=U.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(U.checkout.billingAddress=new a(s))}U.checkout.billingAddress&&(U.checkout.billingAddress.checkoutSettings=U.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){U.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(U.cardData&&(!(t.length>U.cardData.cardNumber.length)||E(t))){var e=(U.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!U.installmentInfo?U.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:U.checkout.selectedPaymentGateway.id,price:U.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(U.cardData.installmentCount=1,U.installmentInfo=void 0),U.cardData.cardNumber=x(i,4).join(" "))}},this.onCardHolderNameChange=function(t){U.cardData&&(U.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(U.cardData&&(!(t.length>U.cardData.expirationDate.length)||E(t))){if(0===(null===(e=U.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(U.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(U.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var a=t.split(" / ").join("");a.length>4||(U.cardData.expirationDate=x(a,2).join(" / "))}},this.onCvcChange=function(t){U.cardData&&(t.length>U.cardData.cvv.length&&!E(t)||t.length>4||(U.cardData.cvv=t))},this.saveAddress=function(s){return t(U,void 0,void 0,(function(){var t,r,a,d,c;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(c=this.store.customerStore.customer.addresses)||void 0===c?void 0:c.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=new o(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress"),id:P()})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(r),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:e.sent(),"shipping"===s?(this.checkout.shippingAddress.id=r.id,this.selectedShippingAddressId=r.id||"-1"):(this.checkout.billingAddress.id=r.id,this.selectedBillingAddressId=r.id||"-1"),e.label=2;case 2:return[3,4];case 3:return d=e.sent(),console.error(d),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){U.router.push("/cart")},this.onBackToShoppingClick=function(){U.router.push("/")},this.onProceedToShippingClick=function(){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(A.SHIPPING):this.changeStep(A.PAYMENT),[3,7];case 6:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:w.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(U,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(A.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:w.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(U,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),e.label=1;case 1:return e.trys.push([1,7,,8]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),"address"!==this.deliveryMethod?[3,4]:[4,this.saveAddress("billing")];case 3:e.sent(),e.label=4;case 4:return[4,this.saveCart()];case 5:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 6:return e.sent(),[3,8];case 7:return(i=e.sent()).type?this.error=i:this.error={type:w.UNKNOWN},this.isStepLoading=!1,[3,8];case 8:return[2]}}))}))},this.createSaleTransaction=function(){return t(U,void 0,void 0,(function(){var t,i,s,n,r,o,a,d,c,l,u,h,p,m,v;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(d=this.mpVM.selectedCard)||void 0===d?void 0:d.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(c=this.cardData)||void 0===c?void 0:c.installmentCount)?[2]:[4,f.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.Name},paymentGatewayId:null===(u=this.mpVM.selectedCard)||void 0===u?void 0:u.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(h=this.cardData)||void 0===h?void 0:h.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,f.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===k.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===b.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(m=null==s?void 0:s.data)||void 0===m?void 0:m.transactionStatus,o=r&&[I.SUCCESS,I.AUTHORIZED].includes(r),a=r===I.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!a||!(null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.returnSlug))throw{type:w.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(U,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(A.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){U.changeStep(A.INFO)},this.onBackToShippingClick=function(){U.changeStep(A.SHIPPING)},this.setCustomerConsentGranted=function(t){U.checkout.customer&&(U.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){U.useDifferentAddress=t,U.useDifferentAddress?(localStorage.setItem("sAddr","1"),U.checkout.billingAddress=U.checkout.billingAddress||new a):(localStorage.removeItem("sAddr"),U.checkout.billingAddress=U.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){U.shouldSaveAddress=t},this.setAddressTitle=function(t){U.addressTitle=t},this.setPaymentGateway=function(i){return t(U,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))||this.stripeResponse?[3,2]:[4,f.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return this.checkout.selectedPaymentGateway=t,this.step!==A.SUCCESS&&(t.paymentMethodType===k.CREDIT_CARD&&t.type===b.INTERNAL&&(this.cardData=new c),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){U.cardData&&(U.cardData.installmentCount=t)},this.changeStep=function(i){return t(U,void 0,void 0,(function(){return e(this,(function(t){return N||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(U,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){U.isContactModalVisible=t},this.checkout=j,this.checkoutSettings=R,this.router=O,this.returnPolicy=D,this.privacyPolicy=M,this.termsOfService=G,this.t=_,this.customizationProps=L,this.mpVM=new C,T&&(this.merchantSettings=T),this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.init(),s(this)}return Object.defineProperty(j.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"finalPrice",{get:function(){return this.step===A.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===w.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"canProceedToShipping",{get:function(){var t,e;return(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValid)&&this.checkout.hasValidCustomerEmail&&(null===(e=this.error)||void 0===e?void 0:e.type)!==w.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===k.CREDIT_CARD&&i.type===b.INTERNAL?!!this.isCustomFlowStripe||(null===(e=this.cardData)||void 0===e?void 0:e.isValid):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),j}();function x(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function E(t){return t&&j.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(A||(A={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(w||(w={}));export{A as CheckoutStep,w as ErrorType,R as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from'../../ext/lodash/cloneDeep.js';import r from'../../ext/lodash/sortBy.js';import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import{IkasCustomerAddress as o}from"../../models/data/customer/address/index.js";import"../../models/data/customer/attribute-value/index.js";import"../../models/data/customer/index.js";import"../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../models/data/customer-attribute/index.js";import"../../models/data/customer-review/index.js";import"../../models/data/customer-review-summary/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/merchant-settings/index.js";import{IkasOrderAddress as a}from"../../models/data/order/address/index.js";import"../../models/data/order/adjustment/index.js";import{IkasOrderCustomer as c}from"../../models/data/order/customer/index.js";import"../../models/data/order/gift-line/index.js";import"../../models/data/order/invoice/index.js";import"../../models/data/order/line-item/discount/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/option/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/tracking-info/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/payment-method/index.js";import"../../models/data/order/refund/line-item/index.js";import"../../models/data/order/shipping-line/index.js";import"../../models/data/order/tax-line/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../models/data/product-filter/index.js";import"../../models/data/product-campaign/campaign/index.js";import"../../models/data/product-campaign/filter/index.js";import"../../models/data/product-option-set/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/variant-type/variant-value/index.js";import"../../models/theme/theme.js";import"../../models/theme/page/index.js";import"../../models/theme/component/prop/index.js";import"../../models/theme/page/component/prop-value/link.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/category-list/index.js";import{IkasProductDetail as d}from"../../models/ui/product-detail/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"../../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"../../models/theme/settings/index.js";import"../../models/theme/custom-data/index.js";import"../../models/data/payment-gateway/index.js";import u from"./components/credit-card-form/model.js";import{IkasStorefrontConfig as l}from"../../storefront/index.js";import{IkasCheckoutSettings as h}from"../../models/data/checkout-settings/index.js";import{Analytics as p}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import m from"../../models/data/checkout/index.js";import f from"../../store/customer/api.js";import v from"../../store/merchant/index.js";import g from"../../store/checkout/index.js";import{CheckStocksLineInput as y}from"../../__api/models/CheckStocksLineInput.js";import S from"../../store/cart/api.js";import{SaveCartInput as k}from"../../__api/models/SaveCartInput.js";import{PaymentMethodEnum as b,PaymentGatewayTypeEnum as C,CartCampaignOfferStatus as I,TransactionStatusEnum as P,CampaignOfferTargetPageTypeEnum as A}from"../../__api/types/index.js";import w from"./modelMasterPass.js";import j from"../../store/product/index.js";import N from'../../ext/uuid/dist/esm-node/v4.js';var O,R,x=/^\d+$/,E="undefined"==typeof localStorage,T=function(){function x(x,T,G,_,L,U,V,F,H){var Y=this;this.checkout=new m,this.checkoutSettings=new h,this.storefront=null,this.store=l.store,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=O.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.showTestModal=!1,this.init=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.store.customerStore.waitUntilInitialized()];case 1:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getMerchantSettings()];case 2:return t.sent(),[4,this.getCampaignOffer()];case 3:return t.sent(),[4,this.initStep()];case 4:return t.sent(),[2]}}))}))},this.initStep=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,c;return e(this,(function(e){switch(e.label){case 0:if(l.isEditor)return this.step=O.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===O.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(O.INFO)];if(this.step!==O.PAYMENT||this.canProceedToPayment){if(![O.INFO,O.SUCCESS,O.SHIPPING,O.PAYMENT].includes(this.step))return[2,this.changeStep(O.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(O.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:R.PAYMENT_ERROR,data:n||null}),this.step!==O.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==O.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=O.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==O.SHIPPING||(null===(c=this.checkout.availableShippingMethods)||void 0===c?void 0:c.length)?this.step!==O.PAYMENT&&this.step!==O.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:R.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:R.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===O.PAYMENT&&this.isInStoreDelivery&&(this.checkout.billingAddress=new a),this.step===O.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(O.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,p.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getMerchantSettings=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.merchantSettings?[3,2]:[4,v.listMerchantSettings({})];case 1:t=e.sent(),this.merchantSettings=t.data||void 0,e.label=2;case 2:return[2]}}))}))},this.getSuccessTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,f.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[0]:void 0,[2]}}))}))},this.saveCart=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return(t=new k(this.checkout)).cartId=this.checkout.id,"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step===O.INFO&&(t.billingAddress=null),[4,S.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:R.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:R.API_ERROR};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(Y,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,h,p;return e(this,(function(e){switch(e.label){case 0:return t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,g.checkStocks({lines:t.map((function(t){return new y(t)})),stockLocationIdList:l.stockLocationIds||[]})];case 1:if(!(i=e.sent()).isSuccess)throw{type:R.API_ERROR};if(null==(s=null===(h=null===(u=i.data)||void 0===u?void 0:u.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=null===(p=o.store.cartStore.cart)||void 0===p?void 0:p.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push(e)},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:R.STOCK_ERROR,data:n}}return[2]}}))}))},this.removeUnavailableItems=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,this.store.cartStore.removeItem(n)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,g.getAvailableShippingCountries({salesChannelId:l.salesChannelId})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return l.pickUpStockLocationIds?[4,g.listStockLocation({id:{in:l.pickUpStockLocationIds}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:R.API_ERROR},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return l.pickUpStockLocationIds?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,g.getAvailableStockLocations({lines:t.map((function(t){return new y(t)})),stockLocationIdList:l.pickUpStockLocationIds})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:R.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=Y.shippingCountryIds)||void 0===t?void 0:t.length)||(Y.error={type:R.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(Y.checkout.stockLocationId=null),Y.deliveryMethod=t,Y.isErrorsVisible=!1},this.initialStockCheck=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:R.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,o,a,c,d,u,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=l.paymentGateways.map((function(t){return t.id})),[4,g.listPaymentGateway({id:t?void 0:{in:i}})];case 1:return(s=e.sent()).isSuccess&&(null===(d=s.data)||void 0===d?void 0:d.length)?(n=s.data,this.step===O.PAYMENT&&(n=n.filter((function(t){return!t.supportedCurrencies.length||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(u=this.checkout.shippingAddress)||void 0===u?void 0:u.country)&&o.iso2&&(n=n.filter((function(t){return!t.availableCountries.length||t.availableCountries.includes(o.iso2||"")})))),a=[],r(l.paymentGateways,"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),console.log("1"),this.step===O.PAYMENT&&(console.log("2",{paymentGateways:n}),(c=n.find((function(t){return!!t.masterPassClientId})))&&(console.log("3"),this.checkout.masterPassPaymentGateway=c,this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),[2]):(this.error={type:R.API_ERROR},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,g.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;Y.store.customerStore.customer?(null===(t=Y.store.customerStore.customer.addresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=Y.checkoutSettings})),Y.checkout.customer=new c(Y.store.customerStore.customer)):Y.checkout.customer||(Y.checkout.customer=new c({}))},this.createShippingAddress=function(){var t;if(Y.checkout.shippingAddress)Y.selectedShippingAddressId=Y.checkout.shippingAddress.id||"-1",Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings;else{var e=null===(t=Y.store.customerStore.customer)||void 0===t?void 0:t.addresses;Y.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}},this.createBillingAddress=function(){"undefined"!=typeof localStorage&&(Y.useDifferentAddress=!!localStorage.getItem("sAddr"),Y.useDifferentAddress?(Y.checkout.billingAddress&&(Y.selectedBillingAddressId=Y.checkout.billingAddress.id||"-1"),Y.checkout.billingAddress=Y.checkout.billingAddress||new a):Y.isInStoreDelivery?Y.checkout.billingAddress=new a(n(Y.checkout.billingAddress)||{}):Y.checkout.billingAddress=new a(n(Y.checkout.shippingAddress)||{}),Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onShippingMethodChange=function(i){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new m(t)),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(Y,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,S.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data&&(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.step===O.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),s&&(r=this.checkout,this.checkout=new m(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway})))),[3,3];case 2:return e.sent(),[3,3];case 3:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e,i;if(Y.selectedShippingAddressId=t,"-1"===t)Y.checkout.shippingAddress=new a;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.shippingAddress=new a(s))}Y.checkout.shippingAddress&&(Y.checkout.shippingAddress.checkoutSettings=Y.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e,i;if(Y.selectedBillingAddressId=t,"-1"===t)Y.checkout.billingAddress=new a;else{var s=null===(i=null===(e=Y.store.customerStore.customer)||void 0===e?void 0:e.addresses)||void 0===i?void 0:i.find((function(e){return e.id===t}));s&&(Y.checkout.billingAddress=new a(s))}Y.checkout.billingAddress&&(Y.checkout.billingAddress.checkoutSettings=Y.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){Y.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(Y.cardData&&(!(t.length>Y.cardData.cardNumber.length)||M(t))){var e=(Y.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!Y.installmentInfo?Y.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:Y.checkout.selectedPaymentGateway.id,price:Y.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(Y.cardData.installmentCount=1,Y.installmentInfo=void 0),Y.cardData.cardNumber=D(i,4).join(" "))}},this.onCardHolderNameChange=function(t){Y.cardData&&(Y.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(Y.cardData&&(!(t.length>Y.cardData.expirationDate.length)||M(t))){if(0===(null===(e=Y.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(Y.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var a=t.split(" / ").join("");a.length>4||(Y.cardData.expirationDate=D(a,2).join(" / "))}},this.onCvcChange=function(t){Y.cardData&&(t.length>Y.cardData.cvv.length&&!M(t)||t.length>4||(Y.cardData.cvv=t))},this.saveAddress=function(s){return t(Y,void 0,void 0,(function(){var t,r,a,c,d;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(d=this.store.customerStore.customer.addresses)||void 0===d?void 0:d.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=new o(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress"),id:N()})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(r),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:e.sent(),"shipping"===s?(this.checkout.shippingAddress.id=r.id,this.selectedShippingAddressId=r.id||"-1"):(this.checkout.billingAddress.id=r.id,this.selectedBillingAddressId=r.id||"-1"),e.label=2;case 2:return[3,4];case 3:return c=e.sent(),console.error(c),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){Y.router.push("/cart")},this.onBackToShoppingClick=function(){Y.router.push("/")},this.onProceedToShippingClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(O.SHIPPING):this.changeStep(O.PAYMENT),[3,7];case 6:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:R.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(Y,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(O.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:R.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onCompletePaymentClick=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!this.canPerformPayment)return this.isErrorsVisible=!0,[2];this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),e.label=1;case 1:return e.trys.push([1,7,,8]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),"address"!==this.deliveryMethod?[3,4]:[4,this.saveAddress("billing")];case 3:e.sent(),e.label=4;case 4:return[4,this.saveCart()];case 5:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):[4,this.createSaleTransaction()];case 6:return e.sent(),[3,8];case 7:return(i=e.sent()).type?this.error=i:this.error={type:R.UNKNOWN},this.isStepLoading=!1,[3,8];case 8:return[2]}}))}))},this.createSaleTransaction=function(){return t(Y,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,l,h,p,m,f;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(c=this.mpVM.selectedCard)||void 0===c?void 0:c.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(d=this.cardData)||void 0===d?void 0:d.installmentCount)?[2]:[4,g.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(u=this.mpVM.selectedCard)||void 0===u?void 0:u.Name},paymentGatewayId:null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(h=this.cardData)||void 0===h?void 0:h.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,g.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===b.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===C.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(m=null==s?void 0:s.data)||void 0===m?void 0:m.transactionStatus,o=r&&[P.SUCCESS,P.AUTHORIZED].includes(r),a=r===P.PENDING,o?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!a||!(null===(f=null==s?void 0:s.data)||void 0===f?void 0:f.returnSlug))throw{type:R.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(O.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){Y.changeStep(O.INFO)},this.onBackToShippingClick=function(){Y.changeStep(O.SHIPPING)},this.setCustomerConsentGranted=function(t){Y.checkout.customer&&(Y.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){Y.useDifferentAddress=t,Y.useDifferentAddress?(localStorage.setItem("sAddr","1"),Y.checkout.billingAddress=Y.checkout.billingAddress||new a):(localStorage.removeItem("sAddr"),Y.checkout.billingAddress=Y.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){Y.shouldSaveAddress=t},this.setAddressTitle=function(t){Y.addressTitle=t},this.setPaymentGateway=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))||this.stripeResponse?[3,2]:[4,g.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return this.checkout.selectedPaymentGateway=t,this.step!==O.SUCCESS&&(t.paymentMethodType===b.CREDIT_CARD&&t.type===C.INTERNAL&&(this.cardData=new u),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){Y.cardData&&(Y.cardData.installmentCount=t)},this.changeStep=function(i){return t(Y,void 0,void 0,(function(){return e(this,(function(t){return E||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(Y,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){Y.isContactModalVisible=t},this.getWaitingForActionCampaignOffer=function(t){if(Y.checkout.campaignOffers&&Y.checkout.campaignOffers.length){var e=Y.checkout.campaignOffers.filter((function(e){var i;return e.status===I.WAITING_FOR_ACTION&&(null===(i=e.campaignOffer)||void 0===i?void 0:i.targetPageTypes.some((function(e){return e===t})))}));if(e.length)return e[0]}return null},this.getOffer=function(t){return t.campaignOffer?t.campaignOffer.offers.find((function(e){return e.id===t.campaignOfferProductId})):null},this.getProduct=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,j.searchProducts({input:{productIdList:[i]}})];case 1:return(t=e.sent()).isSuccess&&t.data&&t.data.data&&t.data.data.length?(s=t.data.data[0],n=s.variants.find((function(t){return t.isActive})),[2,new d(s,(n||s.variants[0]).variantValues)]):[2,null]}}))}))},this.getCampaignOfferProducts=function(i){return t(Y,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return(t=this.getWaitingForActionCampaignOffer(i))&&t.campaignOffer&&(s=this.getOffer(t))?[4,this.getProduct(s.productId)]:[3,2];case 1:if(n=e.sent())return[2,{productDetail:n,campaignOffer:t.campaignOffer,offer:s}];e.label=2;case 2:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return t(Y,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getCampaignOfferProducts(A.CHECKOUT)];case 1:return t.checkoutCampaignOffer=e.sent(),i=this,[4,this.getCampaignOfferProducts(A.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=e.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return t(Y,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return this.isCheckoutLoaded=!1,[4,S.updateCartCampaignOffer({input:i})];case 1:return(t=e.sent())&&t.isSuccess&&t.data?(s=new m(t.data),[4,this.getCampaignOffer()]):[3,4];case 2:return e.sent(),this.checkout=s,[4,this.init()];case 3:e.sent(),e.label=4;case 4:return this.isCheckoutLoaded=!0,[2]}}))}))},this.checkout=x,this.checkoutSettings=T,this.router=_,this.returnPolicy=L,this.privacyPolicy=U,this.termsOfService=V,this.t=F,this.customizationProps=H,this.mpVM=new w,G&&(this.merchantSettings=G),this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.init(),s(this)}return Object.defineProperty(x.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"finalPrice",{get:function(){return this.step===O.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===R.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToShipping",{get:function(){var t,e;return(null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.isValid)&&this.checkout.hasValidCustomerEmail&&(null===(e=this.error)||void 0===e?void 0:e.type)!==R.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"true"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValid),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===b.CREDIT_CARD&&i.type===C.INTERNAL?!!this.isCustomFlowStripe||(null===(e=this.cardData)||void 0===e?void 0:e.isValid):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),x}();function D(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function M(t){return t&&x.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(O||(O={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(R||(R={}));export{O as CheckoutStep,R as ErrorType,T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as a}from"../../../../store/cart/index.js";import i from"./style.module.scss.js";import s from"../../components/svg/success-circle.js";import r from"../../components/expandable-section/index.js";import d from"../../components/credit-card-form/svg/amex.js";import n from"../../components/credit-card-form/svg/master-card.js";import l from"../../components/credit-card-form/svg/troy.js";import m from"../../components/credit-card-form/svg/visa.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as c}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/city/index.js";import"mobx";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/attribute-value/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-review/index.js";import"../../../../models/data/customer-review-summary/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/merchant-settings/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/adjustment/index.js";import"../../../../models/data/order/gift-line/index.js";import"../../../../models/data/order/invoice/index.js";import"../../../../models/data/order/line-item/discount/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/option/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/tracking-info/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/payment-method/index.js";import"../../../../models/data/order/refund/line-item/index.js";import"../../../../models/data/order/shipping-line/index.js";import"../../../../models/data/order/tax-line/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/product-campaign/campaign/index.js";import"../../../../models/data/product-campaign/filter/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/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"../../../../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"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import"../../../../models/data/payment-gateway/index.js";import{PaymentMethodEnum as p,PaymentGatewayTypeEnum as v,OrderPackageStatusEnum as E,TransactionCardAssociationEnum as x}from"../../../../__api/types/index.js";var f=t((function(t){var E,f,j,h,k,T,N=t.vm,y=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(a);e&&e===N.checkout.id&&localStorage.removeItem(a)}}),[]);var I=((null===(E=N.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(f=N.checkout.customer)||void 0===f?void 0:f.lastName)||""),L=((null===(j=N.checkout.shippingAddress)||void 0===j?void 0:j.firstName)||"")+" "+((null===(h=N.checkout.shippingAddress)||void 0===h?void 0:h.lastName)||""),A=N.paymentGateways.find((function(e){var t;return e.id===(null===(t=N.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),D=null===(k=N.successTransaction)||void 0===k?void 0:k.paymentMethodDetail,S=e.useMemo((function(){var t,o,a,s;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:paymentMethod")),A&&e.createElement(e.Fragment,null,!!A.logoUrl&&e.createElement("div",{className:i.PaymentLogoContainer},e.createElement("img",{src:A.logoUrl})),!A.logoUrl&&e.createElement("div",{className:i.InfoText},A.paymentMethodType===p.CREDIT_CARD&&A.type===v.INTERNAL?y("checkout-page:creditCard"):A.name),!!A.description&&A.type!==v.EXTERNAL&&e.createElement("div",{className:i.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:A.description}}))),"CREDIT_CARD"===(null===(t=N.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},e.createElement("div",{className:i.CardLogoContainer},function(){var t,o;switch(null===(o=null===(t=N.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation){case x.AMERICAN_EXPRESS:return e.createElement(d,null);case x.MASTER_CARD:return e.createElement(n,null);case x.TROY:return e.createElement(l,null);case x.VISA:return e.createElement(m,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==D?void 0:D.lastFourDigits)||""))),(null===(o=null==D?void 0:D.installment)||void 0===o?void 0:o.installmentCount)&&D.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},"".concat(D.installment.installmentCount," ").concat(y("checkout-page:installments"))),null!==D.installment.installmentPrice&&e.createElement("div",{className:i.InfoText},"".concat(D.installment.installmentCount," x ").concat(c(D.installment.installmentPrice,N.checkout.currencyCode)))))),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:billingAddress")),!!(null===(a=N.checkout.billingAddress)||void 0===a?void 0:a.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},N.checkout.billingAddress.company),e.createElement("div",{className:i.InfoText},null===(s=N.checkout.billingAddress)||void 0===s?void 0:s.addressText)))}),[]),C=e.useMemo((function(){var t,o,a,s,r;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(t=N.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:i.InfoText},I),!!(null===(o=N.checkout.shippingAddress)||void 0===o?void 0:o.phone)&&e.createElement("div",{className:i.InfoText},null===(a=N.checkout.shippingAddress)||void 0===a?void 0:a.phone)),e.createElement("div",null,"in-store"===N.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:receiver")),e.createElement("div",{className:[i.InfoText,i.withMBottom].join(" ")},L)),e.createElement("div",{className:i.InfoTitle},"address"===N.deliveryMethod?y("checkout-page:shippingAddress"):y("checkout-page:pickUpLocation")),!!(null===(s=N.checkout.shippingAddress)||void 0===s?void 0:s.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},N.checkout.shippingAddress.company),e.createElement("div",{className:i.InfoText},null===(r=N.checkout.shippingAddress)||void 0===r?void 0:r.addressText)))}),[]);return e.createElement("div",{className:i.StepSuccess},e.createElement("div",{className:i.SuccessTitleContainer},e.createElement(s,null),e.createElement("span",{className:i.SuccessTitle},y("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:i.SuccessSubTitle},y("address"===N.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:I})),e.createElement("div",{className:[i.InfoGrid,i.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:orderNoAndDate")),e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},"#"+(N.checkout.orderNumber||"")),e.createElement("div",{className:i.InfoText},N.checkout.dateStr),e.createElement(g,{vm:N})),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},y("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(T=N.checkout.customer)||void 0===T?void 0:T.email),e.createElement("div",{className:i.InfoText},I))),e.createElement(r,{title:y("checkout-page:paymentSummary")},S),e.createElement(r,{title:y("checkout-page:shippingSummary")},C),e.createElement("div",{className:i.Actions},e.createElement("div",{className:i.HelpText},e.createElement("span",null,y("checkout-page:helpCtaQuestion")),e.createElement("span",{className:i.Cta,onClick:function(){return N.setContactModalVisible(!0)}},y("checkout-page:helpCta"))),e.createElement(o,{text:y("checkout-page:actions.backToShopping"),onClick:N.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),g=t((function(t){var o,a=t.vm,s=u().t,r=i.Yellow;switch(a.checkout.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:r=i.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:r=i.Red}return e.createElement("div",{className:[i.OrderStatus,r].join(" ")},a.checkout.orderPackageStatus?null===(o=[{types:[E.UNFULFILLED],text:s("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:s("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:s("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:s("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:s("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:s("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:s("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:s("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:s("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:s("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:s("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:s("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(a.checkout.orderPackageStatus)})))||void 0===o?void 0:o.text:"")}));export{f as StepSuccess};
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import{Button as o}from"../../components/button/index.js";import{CART_LS_KEY as a}from"../../../../store/cart/index.js";import i from"./style.module.scss.js";import r from"../../components/svg/success-circle.js";import s from"../../components/expandable-section/index.js";import d from"../../components/credit-card-form/svg/amex.js";import n from"../../components/credit-card-form/svg/master-card.js";import m from"../../components/credit-card-form/svg/troy.js";import l from"../../components/credit-card-form/svg/visa.js";import"../../../../storefront/index.js";import'../../../../ext/lodash/isArguments.js';import'../../../../ext/lodash/isBuffer.js';import'../../../../ext/lodash/isTypedArray.js';import'../../../../ext/lodash/_baseGetTag.js';import{formatMoney as c}from"../../../../utils/currency.js";import{useTranslation as u}from"../../../../utils/i18n.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/city/index.js";import"mobx";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/attribute-value/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/customer-attribute/customer-attribute-option/index.js";import"../../../../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../../../../models/data/customer-attribute/index.js";import"../../../../models/data/customer-review/index.js";import"../../../../models/data/customer-review-summary/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/merchant-settings/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/adjustment/index.js";import"../../../../models/data/order/gift-line/index.js";import"../../../../models/data/order/invoice/index.js";import"../../../../models/data/order/line-item/discount/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/option/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/tracking-info/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/payment-method/index.js";import"../../../../models/data/order/refund/line-item/index.js";import"../../../../models/data/order/shipping-line/index.js";import"../../../../models/data/order/tax-line/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/product/attribute-value/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/product-attribute/index.js";import"../../../../models/data/product-filter/index.js";import"../../../../models/data/product-campaign/campaign/index.js";import"../../../../models/data/product-campaign/filter/index.js";import"../../../../models/data/product-option-set/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/theme/theme.js";import"../../../../models/theme/page/index.js";import"../../../../models/theme/component/prop/index.js";import"../../../../models/theme/page/component/prop-value/link.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-detail/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"../../../../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"../../../../models/theme/settings/index.js";import"../../../../models/theme/custom-data/index.js";import"../../../../models/data/payment-gateway/index.js";import{PaymentMethodEnum as p,PaymentGatewayTypeEnum as v,OrderPackageStatusEnum as E,TransactionCardAssociationEnum as x}from"../../../../__api/types/index.js";import f from"../../components/offer-product/index.js";var g=t((function(t){var E,g,h,k,T,N,y=t.vm,I=u().t;e.useEffect((function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(a);e&&e===y.checkout.id&&localStorage.removeItem(a)}}),[]);var L=((null===(E=y.checkout.customer)||void 0===E?void 0:E.firstName)||"")+" "+((null===(g=y.checkout.customer)||void 0===g?void 0:g.lastName)||""),A=((null===(h=y.checkout.shippingAddress)||void 0===h?void 0:h.firstName)||"")+" "+((null===(k=y.checkout.shippingAddress)||void 0===k?void 0:k.lastName)||""),C=y.paymentGateways.find((function(e){var t;return e.id===(null===(t=y.successTransaction)||void 0===t?void 0:t.paymentGatewayId)})),D=null===(T=y.successTransaction)||void 0===T?void 0:T.paymentMethodDetail,S=e.useMemo((function(){var t,o,a,r;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:paymentMethod")),C&&e.createElement(e.Fragment,null,!!C.logoUrl&&e.createElement("div",{className:i.PaymentLogoContainer},e.createElement("img",{src:C.logoUrl})),!C.logoUrl&&e.createElement("div",{className:i.InfoText},C.paymentMethodType===p.CREDIT_CARD&&C.type===v.INTERNAL?I("checkout-page:creditCard"):C.name),!!C.description&&C.type!==v.EXTERNAL&&e.createElement("div",{className:i.InfoText},e.createElement("div",{dangerouslySetInnerHTML:{__html:C.description}}))),"CREDIT_CARD"===(null===(t=y.successTransaction)||void 0===t?void 0:t.paymentMethod)&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},e.createElement("div",{className:i.CardLogoContainer},function(){var t,o;switch(null===(o=null===(t=y.successTransaction)||void 0===t?void 0:t.paymentMethodDetail)||void 0===o?void 0:o.cardAssociation){case x.AMERICAN_EXPRESS:return e.createElement(d,null);case x.MASTER_CARD:return e.createElement(n,null);case x.TROY:return e.createElement(m,null);case x.VISA:return e.createElement(l,null);default:return e.createElement("div",null)}}()),e.createElement("span",null,"**** ".concat((null==D?void 0:D.lastFourDigits)||""))),(null===(o=null==D?void 0:D.installment)||void 0===o?void 0:o.installmentCount)&&D.installment.installmentCount>1&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoText},"".concat(D.installment.installmentCount," ").concat(I("checkout-page:installments"))),null!==D.installment.installmentPrice&&e.createElement("div",{className:i.InfoText},"".concat(D.installment.installmentCount," x ").concat(c(D.installment.installmentPrice,y.checkout.currencyCode)))))),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:billingAddress")),!!(null===(a=y.checkout.billingAddress)||void 0===a?void 0:a.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},y.checkout.billingAddress.company),e.createElement("div",{className:i.InfoText},null===(r=y.checkout.billingAddress)||void 0===r?void 0:r.addressText)))}),[]),R=e.useMemo((function(){var t,o,a,r,s;return e.createElement("div",{className:[i.InfoGrid].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(t=y.checkout.customer)||void 0===t?void 0:t.email),e.createElement("div",{className:i.InfoText},L),!!(null===(o=y.checkout.shippingAddress)||void 0===o?void 0:o.phone)&&e.createElement("div",{className:i.InfoText},null===(a=y.checkout.shippingAddress)||void 0===a?void 0:a.phone)),e.createElement("div",null,"in-store"===y.deliveryMethod&&e.createElement(e.Fragment,null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:receiver")),e.createElement("div",{className:[i.InfoText,i.withMBottom].join(" ")},A)),e.createElement("div",{className:i.InfoTitle},"address"===y.deliveryMethod?I("checkout-page:shippingAddress"):I("checkout-page:pickUpLocation")),!!(null===(r=y.checkout.shippingAddress)||void 0===r?void 0:r.company)&&e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},y.checkout.shippingAddress.company),e.createElement("div",{className:i.InfoText},null===(s=y.checkout.shippingAddress)||void 0===s?void 0:s.addressText)))}),[]);return e.createElement("div",{className:i.StepSuccess},e.createElement("div",{className:i.SuccessTitleContainer},e.createElement(r,null),e.createElement("span",{className:i.SuccessTitle},I("checkout-page:orderSuccessTitle"))),e.createElement("div",{className:i.SuccessSubTitle},I("address"===y.deliveryMethod?"checkout-page:orderSuccessDescription":"checkout-page:orderSuccessInStoreDeliveryDescription",{customerName:L})),e.createElement("div",{className:[i.InfoGrid,i.WithBorder].join(" ")},e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:orderNoAndDate")),e.createElement("div",{className:[i.InfoText,i.InfoTextBold].join(" ")},"#"+(y.checkout.orderNumber||"")),e.createElement("div",{className:i.InfoText},y.checkout.dateStr),e.createElement(j,{vm:y})),e.createElement("div",null,e.createElement("div",{className:i.InfoTitle},I("checkout-page:contactInfo")),e.createElement("div",{className:i.InfoText},null===(N=y.checkout.customer)||void 0===N?void 0:N.email),e.createElement("div",{className:i.InfoText},L))),y.postCheckoutCampaignOffer&&e.createElement(f,{vm:y,campaignOffer:y.postCheckoutCampaignOffer}),e.createElement(s,{title:I("checkout-page:paymentSummary")},S),e.createElement(s,{title:I("checkout-page:shippingSummary")},R),e.createElement("div",{className:i.Actions},e.createElement("div",{className:i.HelpText},e.createElement("span",null,I("checkout-page:helpCtaQuestion")),e.createElement("span",{className:i.Cta,onClick:function(){return y.setContactModalVisible(!0)}},I("checkout-page:helpCta"))),e.createElement(o,{text:I("checkout-page:actions.backToShopping"),onClick:y.onBackToShoppingClick,style:{flex:"0 0 auto"}})))})),j=t((function(t){var o,a=t.vm,r=u().t,s=i.Yellow;switch(a.checkout.orderPackageStatus){case E.FULFILLED:case E.PARTIALLY_FULFILLED:case E.DELIVERED:case E.PARTIALLY_DELIVERED:s=i.Green;break;case E.CANCELLED:case E.PARTIALLY_CANCELLED:case E.CANCEL_REJECTED:case E.CANCEL_REQUESTED:s=i.Red}return e.createElement("div",{className:[i.OrderStatus,s].join(" ")},a.checkout.orderPackageStatus?null===(o=[{types:[E.UNFULFILLED],text:r("checkout-page:orderPackageStatus.unfulfilled")},{types:[E.READY_FOR_SHIPMENT],text:r("checkout-page:orderPackageStatus.readyForShipment")},{types:[E.PARTIALLY_FULFILLED],text:r("checkout-page:orderPackageStatus.partiallyFulfilled")},{types:[E.FULFILLED],text:r("checkout-page:orderPackageStatus.fulfilled")},{types:[E.DELIVERED,E.PARTIALLY_DELIVERED],text:r("checkout-page:orderPackageStatus.delivered")},{types:[E.UNABLE_TO_DELIVER],text:r("checkout-page:orderPackageStatus.unableToDeliver")},{types:[E.CANCELLED,E.PARTIALLY_CANCELLED],text:r("checkout-page:orderPackageStatus.cancelled")},{types:[E.CANCEL_REJECTED],text:r("checkout-page:orderPackageStatus.cancelRejected")},{types:[E.REFUNDED,E.PARTIALLY_REFUNDED],text:r("checkout-page:orderPackageStatus.refunded")},{types:[E.REFUND_REQUEST_ACCEPTED],text:r("checkout-page:orderPackageStatus.refundRequestAccepted")},{types:[E.REFUND_REJECTED],text:r("checkout-page:orderPackageStatus.refundRejected")},{types:[E.REFUND_REQUESTED],text:r("checkout-page:orderPackageStatus.refundRequested")}].find((function(e){return e.types.includes(a.checkout.orderPackageStatus)})))||void 0===o?void 0:o.text:"")}));export{g as StepSuccess};
|
|
@@ -3,10 +3,12 @@ import { APIResponse } from "@ikas/fe-api-client";
|
|
|
3
3
|
import { QueryParams as SaveCartQueryParams } from "src/__api/mutations/saveCart";
|
|
4
4
|
import { QueryParams as SaveCartCouponCodeQueryParams } from "src/__api/mutations/saveCartCouponCode";
|
|
5
5
|
import { QueryParams as AddItemToCartQueryParams } from "src/__api/mutations/addItemToCart";
|
|
6
|
+
import { QueryParams as UpdateCartCampaignOfferQueryParams } from "src/__api/mutations/updateCartCampaignOffer";
|
|
6
7
|
import { IkasCart } from "src";
|
|
7
8
|
export default class CartStoreAPI {
|
|
8
9
|
static getCartById: (params: GetCartByIdQueryParams) => Promise<APIResponse<IkasCart | null>>;
|
|
9
10
|
static saveCart: (params: SaveCartQueryParams) => Promise<APIResponse<IkasCart | null>>;
|
|
10
11
|
static saveCartCouponCode: (params: SaveCartCouponCodeQueryParams) => Promise<APIResponse<IkasCart | null>>;
|
|
11
12
|
static addItemToCart: (params: AddItemToCartQueryParams) => Promise<APIResponse<IkasCart | null>>;
|
|
13
|
+
static updateCartCampaignOffer: (params: UpdateCartCampaignOfferQueryParams) => Promise<APIResponse<IkasCart | null>>;
|
|
12
14
|
}
|
package/build/store/cart/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as t,__awaiter as
|
|
1
|
+
import{__spreadArray as t,__awaiter as r,__generator as e}from'../../ext/tslib/tslib.es6.js';import n,{ResponseField as a}from"../../__api/queries/getCartById.js";import{APIResponse as i}from'../../ext/@ikas/fe-api-client/build/utils/api.js';import'../../ext/axios/lib/axios.js';import'../../ext/@ikas/fe-api-client/build/ext/lodash/_defineProperty.js';import'../../ext/@ikas/fe-api-client/build/ext/lodash/_baseGetTag.js';import'../../ext/@ikas/fe-api-client/build/ext/lodash/_stringToPath.js';import'../../ext/@ikas/fe-api-client/build/ext/lodash/_baseToString.js';import o from"../../__api/mutations/saveCart.js";import s from"../../__api/mutations/saveCartCouponCode.js";import u from"../../__api/mutations/addItemToCart.js";import d from"../../__api/mutations/updateCartCampaignOffer.js";import{IkasCart as l}from"../../models/data/cart/index.js";var c=function(){function t(){}var a;return a=t,t.getCartById=function(t){return r(void 0,void 0,void 0,(function(){var r;return e(a,(function(e){switch(e.label){case 0:return[4,n(t,p)];case 1:return r=e.sent(),[2,new i(r.data?new l(r.data):null,r.graphQLErrors)]}}))}))},t.saveCart=function(t){return r(void 0,void 0,void 0,(function(){var r;return e(a,(function(e){switch(e.label){case 0:return[4,o(t,p)];case 1:return r=e.sent(),[2,new i(r.data?new l(r.data):null,r.graphQLErrors)]}}))}))},t.saveCartCouponCode=function(t){return r(void 0,void 0,void 0,(function(){var r;return e(a,(function(e){switch(e.label){case 0:return[4,s(t,p)];case 1:return r=e.sent(),[2,new i(r.data?new l(r.data):null,r.graphQLErrors)]}}))}))},t.addItemToCart=function(t){return r(void 0,void 0,void 0,(function(){var r;return e(a,(function(e){switch(e.label){case 0:return[4,u(t,p)];case 1:return r=e.sent(),[2,new i(r.data?new l(r.data):null,r.graphQLErrors)]}}))}))},t.updateCartCampaignOffer=function(t){return r(void 0,void 0,void 0,(function(){var r;return e(a,(function(e){switch(e.label){case 0:return[4,d(t)];case 1:return r=e.sent(),[2,new i(r.data?new l(r.data):null,r.graphQLErrors)]}}))}))},t}(),f=t(t(["MERCHANT_ID","ORDER_LINE_ITEMS__VARIANT__TAG_IDS"],Object.keys(a).filter((function(t){return t.startsWith("CURRENCY_RATES")})),!0),Object.keys(a).filter((function(t){return t.startsWith("ABANDONED_CART_FLOWS")})),!0),p=Object.entries(a).filter((function(t){var r=t[0];return!f.includes(r)})).map((function(t){return t[1]}));export{c as default};
|