@commercelayer/react-components 2.49.0 → 2.49.1
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/lib/cjs/components/AddToCartButton.js +1 -1
- package/lib/cjs/components/Address.js +1 -1
- package/lib/cjs/components/AddressCountrySelector.js +1 -1
- package/lib/cjs/components/AddressField.js +1 -1
- package/lib/cjs/components/AddressInput.js +1 -1
- package/lib/cjs/components/AddressStateSelector.js +1 -1
- package/lib/cjs/components/AddressesContainer.js +1 -1
- package/lib/cjs/components/AdyenPayment.js +1 -1
- package/lib/cjs/components/AvailabilityContainer.js +1 -1
- package/lib/cjs/components/AvailabilityTemplate.js +1 -1
- package/lib/cjs/components/BillingAddressContainer.js +1 -1
- package/lib/cjs/components/BillingAddressForm.js +1 -1
- package/lib/cjs/components/BraintreePayment.js +1 -1
- package/lib/cjs/components/CheckoutLink.js +1 -1
- package/lib/cjs/components/CommerceLayer.js +1 -1
- package/lib/cjs/components/CustomerContainer.js +1 -1
- package/lib/cjs/components/CustomerInput.js +1 -1
- package/lib/cjs/components/DeliveryLeadTime.js +1 -1
- package/lib/cjs/components/DiscountAmount.js +1 -1
- package/lib/cjs/components/Errors.js +1 -1
- package/lib/cjs/components/ExternalFunction.js +1 -1
- package/lib/cjs/components/GiftCard.js +1 -1
- package/lib/cjs/components/GiftCardAmount.js +1 -1
- package/lib/cjs/components/GiftCardContainer.js +1 -1
- package/lib/cjs/components/GiftCardCurrencySelector.js +1 -1
- package/lib/cjs/components/GiftCardInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponCode.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponForm.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/cjs/components/ItemContainer.js +1 -1
- package/lib/cjs/components/LineItem.js +1 -1
- package/lib/cjs/components/LineItemAmount.js +1 -1
- package/lib/cjs/components/LineItemCode.js +1 -1
- package/lib/cjs/components/LineItemImage.js +1 -1
- package/lib/cjs/components/LineItemName.js +1 -1
- package/lib/cjs/components/LineItemOption.js +1 -1
- package/lib/cjs/components/LineItemOptions.js +1 -1
- package/lib/cjs/components/LineItemQuantity.js +1 -1
- package/lib/cjs/components/LineItemRemoveLink.js +1 -1
- package/lib/cjs/components/LineItemsContainer.js +1 -1
- package/lib/cjs/components/LineItemsCount.js +1 -1
- package/lib/cjs/components/MetadataInput.js +1 -1
- package/lib/cjs/components/OrderContainer.js +1 -1
- package/lib/cjs/components/OrderNumber.js +1 -1
- package/lib/cjs/components/OrderStorage.js +1 -1
- package/lib/cjs/components/PaymentGateway.js +1 -1
- package/lib/cjs/components/PaymentMethod.js +1 -1
- package/lib/cjs/components/PaymentMethodAmount.js +1 -1
- package/lib/cjs/components/PaymentMethodName.js +1 -1
- package/lib/cjs/components/PaymentMethodPrice.js +1 -1
- package/lib/cjs/components/PaymentMethodRadioButton.js +1 -1
- package/lib/cjs/components/PaymentMethodsContainer.js +1 -1
- package/lib/cjs/components/PaymentSource.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandName.js +1 -1
- package/lib/cjs/components/PaymentSourceDetail.js +1 -1
- package/lib/cjs/components/PaymentSourceEditButton.js +1 -1
- package/lib/cjs/components/PaypalPayment.js +1 -1
- package/lib/cjs/components/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/PlaceOrderContainer.js +1 -1
- package/lib/cjs/components/Price.js +1 -1
- package/lib/cjs/components/PricesContainer.js +1 -1
- package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/cjs/components/QuantitySelector.js +1 -1
- package/lib/cjs/components/SaveAddressesButton.js +1 -1
- package/lib/cjs/components/SaveCustomerButton.js +1 -1
- package/lib/cjs/components/Shipment.js +1 -1
- package/lib/cjs/components/ShipmentField.js +1 -1
- package/lib/cjs/components/ShipmentsContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressForm.js +1 -1
- package/lib/cjs/components/ShippingAmount.js +1 -1
- package/lib/cjs/components/ShippingMethod.js +1 -1
- package/lib/cjs/components/ShippingMethodName.js +1 -1
- package/lib/cjs/components/ShippingMethodPrice.js +1 -1
- package/lib/cjs/components/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/SkuList.js +1 -1
- package/lib/cjs/components/SkuListsContainer.js +1 -1
- package/lib/cjs/components/SkuOption.js +1 -1
- package/lib/cjs/components/SkuOptionInput.js +1 -1
- package/lib/cjs/components/SkuOptionsContainer.js +1 -1
- package/lib/cjs/components/StockTransfer.js +1 -1
- package/lib/cjs/components/StockTransferField.js +1 -1
- package/lib/cjs/components/StripePayment.js +1 -1
- package/lib/cjs/components/SubTotalAmount.js +1 -1
- package/lib/cjs/components/SubmitButton.js +1 -1
- package/lib/cjs/components/TaxesAmount.js +1 -1
- package/lib/cjs/components/TotalAmount.js +1 -1
- package/lib/cjs/components/VariantSelector.js +1 -1
- package/lib/cjs/components/VariantsContainer.js +1 -1
- package/lib/cjs/components/WireTransferPayment.js +1 -1
- package/lib/cjs/components/gateways/AdyenGateway.js +1 -1
- package/lib/cjs/components/gateways/BraintreeGateway.js +1 -1
- package/lib/cjs/components/gateways/PaypalGateway.js +1 -1
- package/lib/cjs/components/gateways/StripeGateway.js +1 -1
- package/lib/cjs/components/gateways/WireTransferGateway.js +1 -1
- package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/BaseField.js +1 -1
- package/lib/cjs/components/utils/BaseInput.js +1 -1
- package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
- package/lib/cjs/components/utils/BaseSelect.js +1 -1
- package/lib/cjs/components/utils/Parent.js +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/PriceTemplate.js +1 -1
- package/lib/cjs/components/utils/VariantTemplate.js +1 -1
- package/lib/cjs/components/utils/getAllErrors.js +1 -1
- package/lib/cjs/config/components.js +1 -1
- package/lib/cjs/config/currency.js +1 -1
- package/lib/cjs/context/AddressChildrenContext.js +1 -1
- package/lib/cjs/context/AddressContext.js +1 -1
- package/lib/cjs/context/AvailabilityContext.js +1 -1
- package/lib/cjs/context/BillingAddressContext.js +1 -1
- package/lib/cjs/context/BillingAddressFormContext.js +1 -1
- package/lib/cjs/context/CommerceLayerContext.js +1 -1
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/cjs/context/CustomerContext.js +1 -1
- package/lib/cjs/context/ExternalFunctionContext.js +1 -1
- package/lib/cjs/context/GiftCardContext.js +1 -1
- package/lib/cjs/context/ItemContext.js +1 -1
- package/lib/cjs/context/LineItemChildrenContext.js +1 -1
- package/lib/cjs/context/LineItemContext.js +1 -1
- package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/cjs/context/OrderContext.js +1 -1
- package/lib/cjs/context/OrderStorageContext.js +1 -1
- package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/cjs/context/PaymentMethodContext.js +1 -1
- package/lib/cjs/context/PaymentSourceContext.js +1 -1
- package/lib/cjs/context/PlaceOrderContext.js +1 -1
- package/lib/cjs/context/PricesContext.js +1 -1
- package/lib/cjs/context/ShipmentChildrenContext.js +1 -1
- package/lib/cjs/context/ShipmentContext.js +1 -1
- package/lib/cjs/context/ShippingAddressContext.js +1 -1
- package/lib/cjs/context/ShippingAddressFormContext.js +1 -1
- package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/cjs/context/SkuListsContext.js +1 -1
- package/lib/cjs/context/SkuOptionChildrenContext.js +1 -1
- package/lib/cjs/context/SkuOptionsContext.js +1 -1
- package/lib/cjs/context/StockTransferChildrenContext.js +1 -1
- package/lib/cjs/context/VariantsContext.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/AddressReducer.js +1 -1
- package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
- package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
- package/lib/cjs/reducers/CustomerReducer.js +1 -1
- package/lib/cjs/reducers/GiftCardReducer.js +1 -1
- package/lib/cjs/reducers/ItemReducer.js +1 -1
- package/lib/cjs/reducers/LineItemReducer.js +1 -1
- package/lib/cjs/reducers/OrderReducer.js +1 -1
- package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
- package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
- package/lib/cjs/reducers/PriceReducer.js +1 -1
- package/lib/cjs/reducers/ShipmentReducer.js +1 -1
- package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
- package/lib/cjs/reducers/SkuListsReducer.js +1 -1
- package/lib/cjs/reducers/SkuOptionsReducer.js +1 -1
- package/lib/cjs/reducers/VariantReducer.js +1 -1
- package/lib/cjs/typings/errors.js +1 -1
- package/lib/cjs/typings/index.js +1 -1
- package/lib/cjs/utils/PropsType.js +1 -1
- package/lib/cjs/utils/addressesManager.js +1 -1
- package/lib/cjs/utils/baseReducer.js +1 -1
- package/lib/cjs/utils/browserInfo.js +1 -1
- package/lib/cjs/utils/childrenTypes.js +1 -1
- package/lib/cjs/utils/countryStateCity.js +1 -1
- package/lib/cjs/utils/customMessages.js +1 -1
- package/lib/cjs/utils/customerOrderOptions.js +1 -1
- package/lib/cjs/utils/getAmount.js +1 -1
- package/lib/cjs/utils/getCurrentItemKey.js +1 -1
- package/lib/cjs/utils/getErrors.js +1 -1
- package/lib/cjs/utils/getLineItemsCount.js +1 -1
- package/lib/cjs/utils/getLoaderComponent.js +1 -1
- package/lib/cjs/utils/getPrices.js +1 -1
- package/lib/cjs/utils/getSdk.js +1 -1
- package/lib/cjs/utils/getSkus.js +1 -1
- package/lib/cjs/utils/isEmptyStates.js +1 -1
- package/lib/cjs/utils/isJSON.js +1 -1
- package/lib/cjs/utils/jwt.js +1 -1
- package/lib/cjs/utils/localStorage.js +1 -1
- package/lib/cjs/utils/organization.js +1 -1
- package/lib/cjs/utils/paypalPayment.js +1 -1
- package/lib/cjs/utils/promisify.js +1 -1
- package/lib/cjs/utils/shipments.js +1 -1
- package/lib/cjs/utils/validateFormFields.js +1 -1
- package/lib/esm/components/AddToCartButton.js +1 -1
- package/lib/esm/components/Address.js +1 -1
- package/lib/esm/components/AddressCountrySelector.js +1 -1
- package/lib/esm/components/AddressField.js +1 -1
- package/lib/esm/components/AddressInput.js +1 -1
- package/lib/esm/components/AddressStateSelector.js +1 -1
- package/lib/esm/components/AddressesContainer.js +1 -1
- package/lib/esm/components/AdyenPayment.js +1 -1
- package/lib/esm/components/AvailabilityContainer.js +1 -1
- package/lib/esm/components/AvailabilityTemplate.js +1 -1
- package/lib/esm/components/BillingAddressContainer.js +1 -1
- package/lib/esm/components/BillingAddressForm.js +1 -1
- package/lib/esm/components/BraintreePayment.js +1 -1
- package/lib/esm/components/CheckoutLink.js +1 -1
- package/lib/esm/components/CommerceLayer.js +1 -1
- package/lib/esm/components/CustomerContainer.js +1 -1
- package/lib/esm/components/CustomerInput.js +1 -1
- package/lib/esm/components/DeliveryLeadTime.js +1 -1
- package/lib/esm/components/DiscountAmount.js +1 -1
- package/lib/esm/components/Errors.js +1 -1
- package/lib/esm/components/ExternalFunction.js +1 -1
- package/lib/esm/components/GiftCard.js +1 -1
- package/lib/esm/components/GiftCardAmount.js +1 -1
- package/lib/esm/components/GiftCardContainer.js +1 -1
- package/lib/esm/components/GiftCardCurrencySelector.js +1 -1
- package/lib/esm/components/GiftCardInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponCode.js +1 -1
- package/lib/esm/components/GiftCardOrCouponForm.js +1 -1
- package/lib/esm/components/GiftCardOrCouponInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/esm/components/ItemContainer.js +1 -1
- package/lib/esm/components/LineItem.js +1 -1
- package/lib/esm/components/LineItemAmount.js +1 -1
- package/lib/esm/components/LineItemCode.js +1 -1
- package/lib/esm/components/LineItemImage.js +1 -1
- package/lib/esm/components/LineItemName.js +1 -1
- package/lib/esm/components/LineItemOption.js +1 -1
- package/lib/esm/components/LineItemOptions.js +1 -1
- package/lib/esm/components/LineItemQuantity.js +1 -1
- package/lib/esm/components/LineItemRemoveLink.js +1 -1
- package/lib/esm/components/LineItemsContainer.js +1 -1
- package/lib/esm/components/LineItemsCount.js +1 -1
- package/lib/esm/components/MetadataInput.js +1 -1
- package/lib/esm/components/OrderContainer.js +1 -1
- package/lib/esm/components/OrderNumber.js +1 -1
- package/lib/esm/components/OrderStorage.js +1 -1
- package/lib/esm/components/PaymentGateway.js +1 -1
- package/lib/esm/components/PaymentMethod.js +1 -1
- package/lib/esm/components/PaymentMethodAmount.js +1 -1
- package/lib/esm/components/PaymentMethodName.js +1 -1
- package/lib/esm/components/PaymentMethodPrice.js +1 -1
- package/lib/esm/components/PaymentMethodRadioButton.js +1 -1
- package/lib/esm/components/PaymentMethodsContainer.js +1 -1
- package/lib/esm/components/PaymentSource.js +1 -1
- package/lib/esm/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/esm/components/PaymentSourceBrandName.js +1 -1
- package/lib/esm/components/PaymentSourceDetail.js +1 -1
- package/lib/esm/components/PaymentSourceEditButton.js +1 -1
- package/lib/esm/components/PaypalPayment.js +1 -1
- package/lib/esm/components/PlaceOrderButton.js +1 -1
- package/lib/esm/components/PlaceOrderContainer.js +1 -1
- package/lib/esm/components/Price.js +1 -1
- package/lib/esm/components/PricesContainer.js +1 -1
- package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/esm/components/QuantitySelector.js +1 -1
- package/lib/esm/components/SaveAddressesButton.js +1 -1
- package/lib/esm/components/SaveCustomerButton.js +1 -1
- package/lib/esm/components/Shipment.js +1 -1
- package/lib/esm/components/ShipmentField.js +1 -1
- package/lib/esm/components/ShipmentsContainer.js +1 -1
- package/lib/esm/components/ShippingAddressContainer.js +1 -1
- package/lib/esm/components/ShippingAddressForm.js +1 -1
- package/lib/esm/components/ShippingAmount.js +1 -1
- package/lib/esm/components/ShippingMethod.js +1 -1
- package/lib/esm/components/ShippingMethodName.js +1 -1
- package/lib/esm/components/ShippingMethodPrice.js +1 -1
- package/lib/esm/components/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/SkuList.js +1 -1
- package/lib/esm/components/SkuListsContainer.js +1 -1
- package/lib/esm/components/SkuOption.js +1 -1
- package/lib/esm/components/SkuOptionInput.js +1 -1
- package/lib/esm/components/SkuOptionsContainer.js +1 -1
- package/lib/esm/components/StockTransfer.js +1 -1
- package/lib/esm/components/StockTransferField.js +1 -1
- package/lib/esm/components/StripePayment.js +1 -1
- package/lib/esm/components/SubTotalAmount.js +1 -1
- package/lib/esm/components/SubmitButton.js +1 -1
- package/lib/esm/components/TaxesAmount.js +1 -1
- package/lib/esm/components/TotalAmount.js +1 -1
- package/lib/esm/components/VariantSelector.js +1 -1
- package/lib/esm/components/VariantsContainer.js +1 -1
- package/lib/esm/components/WireTransferPayment.js +1 -1
- package/lib/esm/components/gateways/AdyenGateway.js +1 -1
- package/lib/esm/components/gateways/BraintreeGateway.js +1 -1
- package/lib/esm/components/gateways/PaypalGateway.js +1 -1
- package/lib/esm/components/gateways/StripeGateway.js +1 -1
- package/lib/esm/components/gateways/WireTransferGateway.js +1 -1
- package/lib/esm/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/esm/components/utils/BaseField.js +1 -1
- package/lib/esm/components/utils/BaseInput.js +1 -1
- package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
- package/lib/esm/components/utils/BaseSelect.js +1 -1
- package/lib/esm/components/utils/Parent.js +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/esm/components/utils/PriceTemplate.js +1 -1
- package/lib/esm/components/utils/VariantTemplate.js +1 -1
- package/lib/esm/components/utils/getAllErrors.js +1 -1
- package/lib/esm/config/components.js +1 -1
- package/lib/esm/context/AddressChildrenContext.js +1 -1
- package/lib/esm/context/AddressContext.js +1 -1
- package/lib/esm/context/AvailabilityContext.js +1 -1
- package/lib/esm/context/BillingAddressContext.js +1 -1
- package/lib/esm/context/BillingAddressFormContext.js +1 -1
- package/lib/esm/context/CommerceLayerContext.js +1 -1
- package/lib/esm/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/esm/context/CustomerContext.js +1 -1
- package/lib/esm/context/ExternalFunctionContext.js +1 -1
- package/lib/esm/context/GiftCardContext.js +1 -1
- package/lib/esm/context/ItemContext.js +1 -1
- package/lib/esm/context/LineItemChildrenContext.js +1 -1
- package/lib/esm/context/LineItemContext.js +1 -1
- package/lib/esm/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/esm/context/OrderContext.js +1 -1
- package/lib/esm/context/OrderStorageContext.js +1 -1
- package/lib/esm/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/esm/context/PaymentMethodContext.js +1 -1
- package/lib/esm/context/PaymentSourceContext.js +1 -1
- package/lib/esm/context/PlaceOrderContext.js +1 -1
- package/lib/esm/context/PricesContext.js +1 -1
- package/lib/esm/context/ShipmentChildrenContext.js +1 -1
- package/lib/esm/context/ShipmentContext.js +1 -1
- package/lib/esm/context/ShippingAddressContext.js +1 -1
- package/lib/esm/context/ShippingAddressFormContext.js +1 -1
- package/lib/esm/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/esm/context/SkuListsContext.js +1 -1
- package/lib/esm/context/SkuOptionChildrenContext.js +1 -1
- package/lib/esm/context/SkuOptionsContext.js +1 -1
- package/lib/esm/context/StockTransferChildrenContext.js +1 -1
- package/lib/esm/context/VariantsContext.js +1 -1
- package/lib/esm/reducers/AddressReducer.js +1 -1
- package/lib/esm/reducers/AvailabilityReducer.js +1 -1
- package/lib/esm/reducers/BillingAddressReducer.js +1 -1
- package/lib/esm/reducers/CustomerReducer.js +1 -1
- package/lib/esm/reducers/GiftCardReducer.js +1 -1
- package/lib/esm/reducers/ItemReducer.js +1 -1
- package/lib/esm/reducers/LineItemReducer.js +1 -1
- package/lib/esm/reducers/OrderReducer.js +1 -1
- package/lib/esm/reducers/PaymentMethodReducer.js +1 -1
- package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
- package/lib/esm/reducers/PriceReducer.js +1 -1
- package/lib/esm/reducers/ShipmentReducer.js +1 -1
- package/lib/esm/reducers/ShippingAddressReducer.js +1 -1
- package/lib/esm/reducers/SkuListsReducer.js +1 -1
- package/lib/esm/reducers/SkuOptionsReducer.js +1 -1
- package/lib/esm/reducers/VariantReducer.js +1 -1
- package/lib/esm/typings/errors.js +1 -1
- package/lib/esm/typings/index.js +1 -1
- package/lib/esm/utils/addressesManager.js +1 -1
- package/lib/esm/utils/baseReducer.js +1 -1
- package/lib/esm/utils/browserInfo.js +1 -1
- package/lib/esm/utils/childrenTypes.js +1 -1
- package/lib/esm/utils/countryStateCity.js +1 -1
- package/lib/esm/utils/customMessages.js +1 -1
- package/lib/esm/utils/customerOrderOptions.js +1 -1
- package/lib/esm/utils/getAmount.js +1 -1
- package/lib/esm/utils/getCurrentItemKey.js +1 -1
- package/lib/esm/utils/getErrors.js +1 -1
- package/lib/esm/utils/getLineItemsCount.js +1 -1
- package/lib/esm/utils/getLoaderComponent.js +1 -1
- package/lib/esm/utils/getPrices.js +1 -1
- package/lib/esm/utils/getSdk.js +1 -1
- package/lib/esm/utils/getSkus.js +1 -1
- package/lib/esm/utils/isEmptyStates.js +1 -1
- package/lib/esm/utils/isJSON.js +1 -1
- package/lib/esm/utils/jwt.js +1 -1
- package/lib/esm/utils/localStorage.js +1 -1
- package/lib/esm/utils/organization.js +1 -1
- package/lib/esm/utils/paypalPayment.js +1 -1
- package/lib/esm/utils/promisify.js +1 -1
- package/lib/esm/utils/shipments.js +1 -1
- package/lib/esm/utils/validateFormFields.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import isEmpty from"lodash/isEmpty";import{setCustomerOrderParam}from"../utils/localStorage";import Parent from"./utils/Parent";import getBrowserInfo from"../utils/browserInfo";import PlaceOrderContext from"../context/PlaceOrderContext";const threeDSConfiguration={challengeWindowSize:"05"};const defaultConfig={};const AdyenPayment=({clientKey:e,config:t,templateCustomerSaveToWallet:n,environment:o="test",locale:a="en_US"})=>{const{cardContainerClassName:r,threeDSecureContainerClassName:s,placeOrderCallback:i,styles:d}=Object.assign(Object.assign({},defaultConfig),t);const[c,l]=useState(false);const[m,u]=useState({});const{setPaymentSource:y,paymentSource:p,setPaymentMethodErrors:_,currentPaymentMethodType:f,setPaymentRef:v}=useContext(PaymentMethodContext);const{setPlaceOrder:h}=useContext(PlaceOrderContext);const g=useRef(null);const C=async(e,t)=>{var n,o,a,r,s,i,d;const c=(o=(n=e===null||e===void 0?void 0:e.elements)===null||n===void 0?void 0:n["save_payment_source_to_customer_wallet"])===null||o===void 0?void 0:o.checked;if(c)setCustomerOrderParam("_save_payment_source_to_customer_wallet",c);const l={_authorize:1};try{const e=p&&await y({paymentSourceId:p.id,paymentResource:"adyen_payments",attributes:l});debugger;const n=(a=e===null||e===void 0?void 0:e.payment_response)===null||a===void 0?void 0:a.action;const o=(r=e===null||e===void 0?void 0:e.payment_response)===null||r===void 0?void 0:r.resultCode;if(n&&o==="IdentifyShopper"){t.createFromAction(n,threeDSConfiguration).mount("#adyen-action")}else if(["Authorised","Pending","Received"].includes(o)){const t=(i=(s=e===null||e===void 0?void 0:e.payment_request_data)===null||s===void 0?void 0:s.payment_method)===null||i===void 0?void 0:i.brand;if(t){const n={metadata:{card:{brand:t}}};await y({paymentSourceId:e===null||e===void 0?void 0:e.id,paymentResource:"adyen_payments",attributes:n})}return true}const c=(d=e===null||e===void 0?void 0:e.payment_response)===null||d===void 0?void 0:d.refusalReason;_([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:f,message:c}]);return false}catch(e){_([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:f,message:e.message}]);return false}};const w=async(e,t,n,o)=>{if(e.isValid){if(g.current){const e=require("@adyen/adyen-web");const t=await e(n);g.current.onsubmit=()=>C(g.current,t);v({ref:g})}let t=getBrowserInfo();const a={payment_request_data:{payment_method:e.data.paymentMethod,shopperInteraction:"Ecommerce",recurringProcessingModel:"CardOnFile",origin:window.location.origin,return_url:window.location.href,browser_info:Object.assign({acceptHeader:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},t)}};o&&await y({paymentSourceId:o.id,paymentResource:"adyen_payments",attributes:a})}};const P=async(e,t,n)=>{var o,a;const r={payment_request_details:e.data,_details:1};try{const e=p&&await y({paymentSourceId:p.id,paymentResource:"adyen_payments",attributes:r});const t=(o=e===null||e===void 0?void 0:e.payment_response)===null||o===void 0?void 0:o.action;const s=(a=e===null||e===void 0?void 0:e.payment_response)===null||a===void 0?void 0:a.resultCode;const d=require("@adyen/adyen-web");if(t){const e=await d(n);e.createFromAction(t,threeDSConfiguration).mount("#adyen-action")}if(["Authorised","Pending","Received"].includes(s)){const{placed:t}=h&&await h({paymentSource:e})||{placed:false};t&&i&&i({placed:t})}}catch(e){console.error("Adyen additional details error:",e)}};useEffect((()=>{const t=!isEmpty(p===null||p===void 0?void 0:p.payment_methods)?p===null||p===void 0?void 0:p.payment_methods:{};if(isEmpty(t))console.error("Payment methods are not available. Please, check your Adyen configuration.");const n={locale:a,environment:o,clientKey:e,paymentMethodsResponse:t};n.onChange=(e,t)=>w(e,t,n,p);n.onAdditionalDetails=(e,t)=>P(e,t,n);if(!g&&e)setCustomerOrderParam("_save_payment_source_to_customer_wallet","false");if(e&&!c&&!isEmpty(window)){const e=require("@adyen/adyen-web");e(n).then((e=>{const t=e.create("card",{styles:d}).mount("#adyen-card");if(t){u(e);l(true)}}))}return()=>{v({ref:{current:null}});l(false)}}),[e,g]);return!e&&!c&&!m?null:_jsxs("form",Object.assign({ref:g,onSubmit:e=>C(e,m)},{children:[_jsx("div",{className:r,id:"adyen-card"},void 0),n&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:n}),void 0),_jsx("div",{className:s,id:"adyen-action"},void 0)]}),void 0)};export default AdyenPayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useReducer,useEffect}from"react";import availabilityReducer,{availabilityInitialState,getAvailability}from"../reducers/AvailabilityReducer";import AvailabilityContext from"../context/AvailabilityContext";import{isEmpty}from"lodash";import ItemContext from"../context/ItemContext";import getCurrentItemKey from"../utils/getCurrentItemKey";import components from"../config/components";import CommerceLayerContext from"../context/CommerceLayerContext";import LineItemChildrenContext from"../context/LineItemChildrenContext";const propTypes=components.AvailabilityContainer.propTypes;const displayName=components.AvailabilityContainer.displayName;const AvailabilityContainer=t=>{const{children:e,skuCode:i}=t;const{item:o,skuCode:n}=useContext(ItemContext);const{lineItem:a}=useContext(LineItemChildrenContext);const l=useContext(CommerceLayerContext);const[r,s]=useReducer(availabilityReducer,availabilityInitialState);useEffect((()=>{var t,e,r;const m=i||getCurrentItemKey(o)||n||(a===null||a===void 0?void 0:a.sku_code);if(m){const[i]=((e=(t=o[m])===null||t===void 0?void 0:t.inventory)===null||e===void 0?void 0:e.levels)||{quantity:null,delivery_lead_times:[]};if(!isEmpty(i)&&((r=i===null||i===void 0?void 0:i.delivery_lead_times)===null||r===void 0?void 0:r.length)>0){const[t]=i===null||i===void 0?void 0:i.delivery_lead_times;s({type:"setAvailability",payload:Object.assign(Object.assign({},t),{quantity:i===null||i===void 0?void 0:i.quantity})})}else if(l.accessToken){getAvailability({skuCode:m,config:l,dispatch:s})}}return()=>{s({type:"setAvailability",payload:{}})}}),[l.accessToken,o,n]);return _jsx(AvailabilityContext.Provider,Object.assign({value:Object.assign({},r)},{children:e}),void 0)};AvailabilityContainer.propTypes=propTypes;AvailabilityContainer.displayName=displayName;export default AvailabilityContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import AvailabilityContext from"../context/AvailabilityContext";import Parent from"./utils/Parent";import{isEmpty}from"lodash";import components from"../config/components";const propTypes=components.AvailabilityTemplate.propTypes;const defaultProps=components.AvailabilityTemplate.defaultProps;const displayName=components.AvailabilityTemplate.displayName;const AvailabilityTemplate=t=>{const{timeFormat:i,showShippingMethodName:o,showShippingMethodPrice:e,children:a}=t,p=__rest(t,["timeFormat","showShippingMethodName","showShippingMethodPrice","children"]);const{min:s,max:n,shipping_method:l,quantity:m}=useContext(AvailabilityContext);const r=!isEmpty(s)&&i?s===null||s===void 0?void 0:s[i]:"";const c=!isEmpty(n)&&i?n===null||n===void 0?void 0:n[i]:"";const d=[];const h=e&&(l===null||l===void 0?void 0:l.formatted_price_amount)?`(${l===null||l===void 0?void 0:l.formatted_price_amount})`:"";const y=o&&l?`with ${l.name}`:"";if(m&&m>0){d.push("Available");if(r&&c){d.push(`in ${r} - ${c} ${i} ${y} ${h}`)}}else if(m===0){d.push("Out of stock")}const u=Object.assign({min:s,max:n,shipping_method:l,quantity:m,text:d.join(" ")},t);return a?_jsx(Parent,Object.assign({},u,{children:a}),void 0):_jsx("p",Object.assign({},p,{children:d.join(" ")}),void 0)};AvailabilityTemplate.propTypes=propTypes;AvailabilityTemplate.defaultProps=defaultProps;AvailabilityTemplate.displayName=displayName;export default AvailabilityTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BillingAddressContext from"../context/BillingAddressContext";import{useContext,useEffect,useReducer}from"react";import billingAddressReducer,{billingAddressInitialState,setBillingAddress,setBillingCustomerAddressId}from"../reducers/BillingAddressReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import OrderContext from"../context/OrderContext";import AddressContext from"../context/AddressContext";const propTypes=components.BillingAddressContainer.propTypes;const BillingAddressContainer=e=>{const{children:s}=e;const[r,t]=useReducer(billingAddressReducer,billingAddressInitialState);const d=useContext(CommerceLayerContext);const{order:n,include:o,addResourceToInclude:i}=useContext(OrderContext);const{shipToDifferentAddress:l,setCloneAddress:c}=useContext(AddressContext);useEffect((()=>{if(!(o===null||o===void 0?void 0:o.includes("billing_address"))){i({newResource:"billing_address"})}if(n&&d){setBillingCustomerAddressId({dispatch:t,order:n,setCloneAddress:c})}return()=>{t({type:"cleanup",payload:{}})}}),[n]);const a=Object.assign(Object.assign({},r),{setBillingAddress:async(e,s)=>{await setBillingAddress(e,{config:d,dispatch:t,order:n,shipToDifferentAddress:l,customerAddressId:s===null||s===void 0?void 0:s.customerAddressId});c(e,"billing_address")}});return _jsx(BillingAddressContext.Provider,Object.assign({value:a},{children:s}),void 0)};BillingAddressContainer.propTypes=propTypes;export default BillingAddressContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import BillingAddressFormContext from"../context/BillingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";const propTypes=components.BillingAddressForm.propTypes;const BillingAddressForm=e=>{const{children:s,errorClassName:r,autoComplete:o="on",reset:i=false}=e,t=__rest(e,["children","errorClassName","autoComplete","reset"]);const{validation:d,values:l,errors:n,reset:a}=useRapidForm();const{setAddressErrors:c,setAddress:u}=useContext(AddressesContext);const{saveAddressToCustomerAddressBook:m,order:p,include:f,addResourceToInclude:g}=useContext(OrderContext);const _=useRef(null);useEffect((()=>{var e;if(!(f===null||f===void 0?void 0:f.includes("billing_address"))){g({newResource:"billing_address"})}if(!isEmpty(n)){const e=[];for(const s in n){const{code:r,message:o}=n[s];if(["billing_address_state_code"].includes(s)){if(isEmpty(l["state_code"])){delete n[s]}else{e.push({code:r,message:o,resource:"billing_address",field:s})}}else{e.push({code:r,message:o,resource:"billing_address",field:s})}}c(e,"billing_address")}else if(!isEmpty(l)){c([],"billing_address");for(const e in l){const s=l[e];if(s===null||s===void 0?void 0:s.value){l[e.replace("billing_address_","")]=s.value;delete l[e]}if((s===null||s===void 0?void 0:s.type)==="checkbox"){delete l[e];m({type:"billing_address",value:s.checked})}}u({values:l,resource:"billing_address"})}if(i&&(!isEmpty(l)||!isEmpty(n))){m&&m({type:"billing_address",value:false});if(_){(e=_.current)===null||e===void 0?void 0:e.reset();a({target:_.current});c([],"billing_address");u({values:{},resource:"billing_address"})}}}),[n,l,i,f]);const v=(e,s)=>{const r={[e.replace("billing_address_","")]:s};u({values:Object.assign(Object.assign({},l),r),resource:"billing_address"})};const b={values:l,validation:d,setValue:v,errorClassName:r,requiresBillingInfo:(p===null||p===void 0?void 0:p.requires_billing_info)||false,errors:n,resetField:e=>a({currentTarget:_.current},e)};return _jsx(BillingAddressFormContext.Provider,Object.assign({value:b},{children:_jsx("form",Object.assign({ref:_,autoComplete:o},t,{children:s}),void 0)}),void 0)};BillingAddressForm.propTypes=propTypes;export default BillingAddressForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import isEmpty from"lodash/isEmpty";import OrderContext from"../context/OrderContext";import Parent from"./utils/Parent";import{setCustomerOrderParam}from"../utils/localStorage";import promisify from"../utils/promisify";const defaultConfig={styles:{input:{"font-size":"16px",color:"#3A3A3A"},".number":{"font-family":"monospace"},":focus":{color:"blue"},".valid":{color:"green"},".invalid":{color:"red"},"@media screen and (max-width: 700px)":{input:{"font-size":"14px"}}},fields:{number:{label:"Card Number",selector:"#card-number",placeholder:"4111 1111 1111 1111"},cvv:{label:"CVV",selector:"#cvv",placeholder:"123"},expirationDate:{label:"Expiration Date",selector:"#expiration-date",placeholder:"10/2022"}},submitLabel:"Set payment method"};const BraintreePayment=({authorization:e,config:t,templateCustomerSaveToWallet:o})=>{var a,s,r;const{fields:i,styles:n,containerClassName:l,cardContainerClassName:d,fieldsContainerClassName:c,expDateContainerClassName:m,fieldLabelClassName:u,cvvContainerClassName:v,inputWrapperClassName:f,cardDetailsContainerClassName:p}=Object.assign(Object.assign({},defaultConfig),t);const[_,b]=useState(false);const{setPaymentSource:x,paymentSource:h,setPaymentMethodErrors:y,currentPaymentMethodType:C,setPaymentRef:N}=useContext(PaymentMethodContext);const{order:j}=useContext(OrderContext);const g=useRef(null);const O=async(e,t,o)=>{var a,s;const r=(s=(a=e===null||e===void 0?void 0:e.elements)===null||a===void 0?void 0:a["save_payment_source_to_customer_wallet"])===null||s===void 0?void 0:s.checked;if(r)setCustomerOrderParam("_save_payment_source_to_customer_wallet",r);if(t){try{const e=await promisify(t).then((e=>e));const a=j===null||j===void 0?void 0:j.billing_address;const s={nonce:e.nonce,bin:e.details.bin,amount:j===null||j===void 0?void 0:j.total_amount_with_taxes_float,email:j===null||j===void 0?void 0:j.customer_email,billingAddress:{givenName:a===null||a===void 0?void 0:a.first_name,surname:a===null||a===void 0?void 0:a.last_name,phoneNumber:a===null||a===void 0?void 0:a.phone,streetAddress:a===null||a===void 0?void 0:a.line_1,countryCodeAlpha2:a===null||a===void 0?void 0:a.country_code,postalCode:a===null||a===void 0?void 0:a.zip_code,region:a===null||a===void 0?void 0:a.state_code,locality:a===null||a===void 0?void 0:a.city},onLookupComplete:(e,t)=>{t()}};const r=await o.verifyCard(s);if(r.rawCardinalSDKVerificationData.Validated&&h){h&&await x({paymentSourceId:h.id,paymentResource:"braintree_payments",attributes:{paymentMethodNonce:r.nonce,options:{id:r.nonce,card:{last4:r.details.lastFour,expYear:r.details.expirationYear,expMonth:r.details.expirationMonth,brand:r.details.cardType.toLowerCase()}}}});return true}return false}catch(e){console.error(e);y([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:C,message:e.message}]);return false}}return false};useEffect((()=>{if(!g&&e)setCustomerOrderParam("_save_payment_source_to_customer_wallet","false");if(e&&!_&&!isEmpty(window)){const t=require("braintree-web/client");const o=require("braintree-web/hosted-fields");const a=require("braintree-web/three-d-secure");t.create({authorization:e},((t,s)=>{if(t){console.error(t);return}o.create({client:s,fields:i,styles:n},((t,o)=>{if(t){console.error(t);return}b(true);a.create({authorization:e,version:2},((e,t)=>{if(e){console.error("3DSecure error",e);y([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:C,message:e.message}])}if(g.current){g.current.onsubmit=()=>O(g.current,o,t);N({ref:g})}}))}))}))}return()=>{N({ref:{current:null}});b(false)}}),[e,g]);return!e&&!_?null:_jsx("div",Object.assign({className:l},{children:_jsxs("form",Object.assign({ref:g,id:"braintree-form",onSubmit:O,className:l},{children:[_jsxs("div",Object.assign({className:c},{children:[_jsxs("div",Object.assign({className:d},{children:[_jsx("label",Object.assign({className:u,htmlFor:"card-number"},{children:(a=i===null||i===void 0?void 0:i.number)===null||a===void 0?void 0:a.label}),void 0),_jsx("div",{className:f,id:"card-number"},void 0)]}),void 0),_jsxs("div",Object.assign({className:p},{children:[_jsxs("div",Object.assign({className:m},{children:[_jsx("label",Object.assign({className:u,htmlFor:"expiration-date"},{children:(s=i===null||i===void 0?void 0:i.expirationDate)===null||s===void 0?void 0:s.label}),void 0),_jsx("div",{className:f,id:"expiration-date"},void 0)]}),void 0),_jsxs("div",Object.assign({className:v},{children:[_jsx("label",Object.assign({className:u,htmlFor:"cvv"},{children:(r=i===null||i===void 0?void 0:i.cvv)===null||r===void 0?void 0:r.label}),void 0),_jsx("div",{className:f,id:"cvv"},void 0)]}),void 0)]}),void 0)]}),void 0),_jsx("div",Object.assign({className:c},{children:o&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:o}),void 0)}),void 0)]}),void 0)}),void 0)};export default BraintreePayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import OrderContext from"../context/OrderContext";import components from"../config/components";import Parent from"./utils/Parent";const propTypes=components.CheckoutLink.propTypes;const defaultProps=components.CheckoutLink.defaultProps;const displayName=components.CheckoutLink.displayName;const CheckoutLink=o=>{const{label:e,children:t}=o,r=__rest(o,["label","children"]);const{order:n}=useContext(OrderContext);const s=Object.assign({checkoutUrl:n===null||n===void 0?void 0:n.checkout_url,label:e},r);return t?_jsx(Parent,Object.assign({},s,{children:t}),void 0):_jsx("a",Object.assign({href:n===null||n===void 0?void 0:n.checkout_url},r,{children:e}),void 0)};CheckoutLink.propTypes=propTypes;CheckoutLink.defaultProps=defaultProps;CheckoutLink.displayName=displayName;export default CheckoutLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";const propTypes=components.CommerceLayer.propTypes;const CommerceLayer=e=>{const{children:r}=e,o=__rest(e,["children"]);return _jsx(CommerceLayerContext.Provider,Object.assign({value:Object.assign({},o)},{children:r}),void 0)};CommerceLayer.propTypes=propTypes;export default CommerceLayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useReducer}from"react";import customerReducer,{customerInitialState,getCustomerAddresses,getCustomerPaymentSources}from"../reducers/CustomerReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{saveCustomerUser}from"../reducers/CustomerReducer";import CustomerContext from"../context/CustomerContext";import{defaultCustomerContext}from"../context/CustomerContext";import{isEmpty}from"lodash";const propTypes=components.CustomerContainer.propTypes;const displayName=components.CustomerContainer.displayName;const CustomerContainer=e=>{const{children:t,isGuest:o=false}=e;const[r,s]=useReducer(customerReducer,customerInitialState);const{order:m,addResourceToInclude:u,include:n,updateOrder:a}=useContext(OrderContext);const c=useContext(CommerceLayerContext);useEffect((()=>{if(!(n===null||n===void 0?void 0:n.includes("available_customer_payment_sources.payment_source"))&&!o){u({newResource:"available_customer_payment_sources.payment_source"})}if(c.accessToken&&isEmpty(r.addresses)&&!o){getCustomerAddresses({config:c,dispatch:s})}if(m&&(n===null||n===void 0?void 0:n.includes("available_customer_payment_sources.payment_source"))&&!o){getCustomerPaymentSources({dispatch:s,order:m})}return()=>{s({type:"setCustomerEmail",payload:{}})}}),[c.accessToken,m,o]);const i=Object.assign(Object.assign({isGuest:o},r),{saveCustomerUser:async e=>{await saveCustomerUser({config:c,customerEmail:e,dispatch:s,updateOrder:a,order:m})},setCustomerErrors:e=>defaultCustomerContext["setCustomerErrors"](e,s),setCustomerEmail:e=>defaultCustomerContext["setCustomerEmail"](e,s),getCustomerPaymentSources:()=>getCustomerPaymentSources({dispatch:s,order:m})});return _jsx(CustomerContext.Provider,Object.assign({value:i},{children:t}),void 0)};CustomerContainer.propTypes=propTypes;CustomerContainer.displayName=displayName;export default CustomerContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}from"react";import BaseInput from"./utils/BaseInput";import components from"../config/components";import useRapidForm from"rapid-form";import CustomerContext from"../context/CustomerContext";import isEmpty from"lodash/isEmpty";const propTypes=components.CustomerInput.propTypes;const displayName=components.CustomerInput.displayName;const CustomerInput=e=>{const{name:s="customer_email",placeholder:t="",required:r=true,saveOnBlur:o=false,type:a="email",value:m,onBlur:p,className:u,errorClassName:n}=e,i=__rest(e,["name","placeholder","required","saveOnBlur","type","value","onBlur","className","errorClassName"]);const{validation:l,values:c,errors:f}=useRapidForm({fieldEvent:"blur"});const{saveCustomerUser:d,setCustomerErrors:y,setCustomerEmail:C}=useContext(CustomerContext);const[E,v]=useState(false);const x=async()=>{if(o&&isEmpty(f)&&!isEmpty(c)){await d(c[s].value);p&&p()}};useEffect((()=>{if(!isEmpty(f)){const e=[];for(const s in f){const{code:t,message:r}=f[s];e.push({code:t,message:r,resource:"orders",field:s})}if(!isEmpty(e)){v(true);y(e)}}else if(!isEmpty(c)){y([]);C(c[s].value);v(false)}return()=>{v(false)}}),[f]);const I=`${u} ${E?n:""}`;return _jsx(BaseInput,Object.assign({name:s,type:a,ref:l,required:r,placeholder:t,defaultValue:m,onBlur:x,className:I},i),void 0)};CustomerInput.propTypes=propTypes;CustomerInput.displayName=displayName;export default CustomerInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.DeliveryLeadTime.propTypes;const displayName=components.DeliveryLeadTime.displayName;const DeliveryLeadTime=e=>{const{type:t}=e,i=__rest(e,["type"]);const[o,r]=useState();const{deliveryLeadTimeForShipment:n}=useContext(ShippingMethodChildrenContext);useEffect((()=>{if(n&&n[t])r(n[t]);return()=>{r("")}}),[n]);const s=Object.assign({text:o},i);return e.children?_jsx(Parent,Object.assign({},s,{children:e.children}),void 0):_jsx("span",Object.assign({},i,{children:o}),void 0)};DeliveryLeadTime.propTypes=propTypes;DeliveryLeadTime.displayName=displayName;export default DeliveryLeadTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.DiscountAmount.propTypes;const defaultProps=components.DiscountAmount.defaultProps;const displayName=components.DiscountAmount.displayName;const DiscountAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"discount"},o),void 0);DiscountAmount.propTypes=propTypes;DiscountAmount.defaultProps=defaultProps;DiscountAmount.displayName=displayName;export default DiscountAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,Fragment,useMemo}from"react";import Parent from"./utils/Parent";import GiftCardContext from"../context/GiftCardContext";import OrderContext from"../context/OrderContext";import AddressContext from"../context/AddressContext";import getAllErrors from"./utils/getAllErrors";import LineItemContext from"../context/LineItemContext";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import CustomerContext from"../context/CustomerContext";import PaymentMethodContext from"../context/PaymentMethodContext";import PaymentMethodChildrenContext from"../context/PaymentMethodChildrenContext";const propTypes=components.Errors.propTypes;const displayName=components.Errors.displayName;const Errors=t=>{const{children:e,messages:o=[],resource:r,field:n}=t,s=__rest(t,["children","messages","resource","field"]);const{payment:m}=useContext(PaymentMethodChildrenContext);const{errors:i}=useContext(OrderContext);const{errors:d}=useContext(GiftCardContext);const{errors:x}=useContext(LineItemContext);const{errors:C}=useContext(AddressContext);const{errors:c}=useContext(CustomerContext);const{errors:l,currentPaymentMethodType:p,currentPaymentMethodId:a}=useContext(PaymentMethodContext);const{lineItem:u}=useContext(LineItemChildrenContext);const f=useMemo((()=>[...d||[],...i||[],...x||[],...C||[],...c||[],...(l===null||l===void 0?void 0:l.filter((t=>t.field===p&&(m===null||m===void 0?void 0:m.id)===a)))||[]]),[d,i,x,C,c,l]);const h=getAllErrors({allErrors:f,field:n,messages:o,props:s,lineItem:u,resource:r,returnHtml:!e});const y=Object.assign({messages:o,resource:r,field:n,errors:h},s);return e?_jsx(Parent,Object.assign({},y,{children:e}),void 0):_jsx(Fragment,{children:h},void 0)};Errors.propTypes=propTypes;Errors.displayName=displayName;export default Errors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import ExternalFunctionContext,{callExternalFunction}from"../context/ExternalFunctionContext";import components from"../config/components";const propTypes=components.ExternalFunction.propTypes;const displayName=components.ExternalFunction.displayName;const ExternalFunction=({children:n,url:t})=>_jsx(ExternalFunctionContext.Provider,Object.assign({value:{url:t,callExternalFunction:callExternalFunction}},{children:n}),void 0);ExternalFunction.propTypes=propTypes;ExternalFunction.displayName=displayName;export default ExternalFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useRef,useContext}from"react";import validateFormFields from"../utils/validateFormFields";import{isEmpty}from"lodash";import GiftCardContext from"../context/GiftCardContext";import components from"../config/components";const propTypes=components.GiftCard.propTypes;const defaultProps=components.GiftCard.defaultProps;const displayName=components.GiftCard.displayName;const GiftCard=t=>{const{children:e,onSubmit:o}=t;const r="giftCardForm";const s=useRef(null);const{addGiftCard:i,addGiftCardError:n}=useContext(GiftCardContext);const a=t=>{t.preventDefault();const e=s.current;const r=e===null||e===void 0?void 0:e.elements;const{errors:a,values:d}=validateFormFields(r,["currencyCode","balanceCents"],"gift_cards");if(isEmpty(a)){i(d);e===null||e===void 0?void 0:e.reset();if(o){o(d)}}else{n(a)}};return _jsx(Fragment,{children:_jsx("form",Object.assign({name:r,ref:s,onSubmit:a},{children:e}),r)},void 0)};GiftCard.propTypes=propTypes;GiftCard.defaultProps=defaultProps;GiftCard.displayName=displayName;export default GiftCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.GiftCardAmount.propTypes;const displayName=components.GiftCardAmount.displayName;const GiftCardAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"gift_card"},o),void 0);GiftCardAmount.propTypes=propTypes;GiftCardAmount.displayName=displayName;export default GiftCardAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext}from"react";import GiftCardContext from"../context/GiftCardContext";import CommerceLayerContext from"../context/CommerceLayerContext";import giftCardReducer,{giftCardInitialState,addGiftCardRecipient,addGiftCard,addGiftCardError,addGiftCardLoading}from"../reducers/GiftCardReducer";import OrderContext from"../context/OrderContext";import components from"../config/components";const propTypes=components.GiftCardContainer.propTypes;const displayName=components.GiftCardContainer.displayName;const GiftCardContainer=t=>{const{children:r}=t;const[e,d]=useReducer(giftCardReducer,giftCardInitialState);const a=useContext(CommerceLayerContext);const{getOrder:o,createOrder:i,order:n}=useContext(OrderContext);const C=Object.assign(Object.assign({},e),{addGiftCardRecipient:t=>addGiftCardRecipient(t,a,d),addGiftCard:t=>addGiftCard(Object.assign({},t),{config:a,dispatch:d,getOrder:o,createOrder:i,order:n}),addGiftCardError:t=>addGiftCardError(t,d),addGiftCardLoading:t=>addGiftCardLoading(t,d)});return _jsx(GiftCardContext.Provider,Object.assign({value:C},{children:r}),void 0)};GiftCardContainer.propTypes=propTypes;GiftCardContainer.displayName=displayName;export default GiftCardContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseSelect from"./utils/BaseSelect";import currencyOptions from"../config/currency";import components from"../config/components";const propTypes=components.GiftCardCurrencySelector.propTypes;const defaultProps=components.GiftCardCurrencySelector.defaultProps;const displayName=components.GiftCardCurrencySelector.displayName;const GiftCardCurrencySelector=e=>_jsx(BaseSelect,Object.assign({options:currencyOptions,name:"currencyCode"},e),void 0);GiftCardCurrencySelector.propTypes=propTypes;GiftCardCurrencySelector.defaultProps=defaultProps;GiftCardCurrencySelector.displayName=displayName;export default GiftCardCurrencySelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import BaseInput from"./utils/BaseInput";import components from"../config/components";const propTypes=components.GiftCardInput.propTypes;const displayName=components.GiftCardInput.displayName;const GiftCardInput=p=>{const{placeholder:t=""}=p,o=__rest(p,["placeholder"]);return _jsx(BaseInput,Object.assign({placeholder:t},o),void 0)};GiftCardInput.propTypes=propTypes;GiftCardInput.displayName=displayName;export default GiftCardInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import components from"../config/components";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{has,isEmpty}from"lodash";const propTypes=components.GiftCardOrCouponCode.propTypes;const displayName=components.GiftCardOrCouponCode.displayName;const GiftCardOrCouponCode=o=>{var{children:e,type:t}=o,r=__rest(o,["children","type"]);const{order:s}=useContext(OrderContext);let n=t&&`${t}Code`;if(!t&&s&&has(s,"couponCode")&&!isEmpty(s.coupon_code))n="coupon_code";else if(!t)n="gift_card_code";const p=s&&n?s[n]:"";const i=s&&p?false:true;const d=Object.assign(Object.assign({},r),{code:p,hide:i});return e?_jsx(Parent,Object.assign({},d,{children:e}),void 0):i?null:_jsx("span",Object.assign({},r,{children:p}),void 0)};GiftCardOrCouponCode.propTypes=propTypes;GiftCardOrCouponCode.displayName=displayName;export default GiftCardOrCouponCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import CouponAndGiftCardFormContext from"../context/CouponAndGiftCardFormContext";import OrderContext from"../context/OrderContext";import isEmpty from"lodash/isEmpty";import components from"../config/components";import camelCase from"lodash/camelCase";import dropWhile from"lodash/dropWhile";import has from"lodash/has";import{findIndex}from"lodash";const propTypes=components.GiftCardOrCouponForm.propTypes;const GiftCardOrCouponForm=o=>{const{children:r,autoComplete:e="on",reset:t=false,onSubmit:s}=o,n=__rest(o,["children","autoComplete","reset","onSubmit"]);const{validation:i,values:d}=useRapidForm();const{setGiftCardOrCouponCode:a,order:m,errors:p,setOrderErrors:c}=useContext(OrderContext);const f=useRef(null);const u="gift_card_or_coupon_code";useEffect((()=>{var o;if(((o=d[u])===null||o===void 0?void 0:o.value)===""&&findIndex(p,{field:camelCase(u)})!==-1){const o=dropWhile(p,(o=>o.field===camelCase(u)));c({errors:o});s&&s({success:true})}}),[d]);const l=async o=>{o.preventDefault();const r=has(d,u)?d[u].value:undefined;if(r){const{success:e}=await a({code:r});s&&s({success:e});e&&o.target.reset()}};return(m===null||m===void 0?void 0:m.gift_card_or_coupon_code)||isEmpty(m)?null:_jsx(CouponAndGiftCardFormContext.Provider,Object.assign({value:{validation:i}},{children:_jsx("form",Object.assign({ref:f,autoComplete:e,onSubmit:l},n,{children:r}),void 0)}),void 0)};GiftCardOrCouponForm.propTypes=propTypes;export default GiftCardOrCouponForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import components from"../config/components";import BaseInput from"./utils/BaseInput";import CouponAndGiftCardFormContext from"../context/CouponAndGiftCardFormContext";const propTypes=components.GiftCardOrCouponInput.propTypes;const displayName=components.GiftCardOrCouponInput.displayName;const GiftCardOrCouponInput=o=>{const{placeholder:t="",required:e,value:r}=o,p=__rest(o,["placeholder","required","value"]);const{validation:n}=useContext(CouponAndGiftCardFormContext);return _jsx(BaseInput,Object.assign({type:"text",name:"gift_card_or_coupon_code",ref:n,required:e!==undefined?e:true,placeholder:t,defaultValue:r},p),void 0)};GiftCardOrCouponInput.propTypes=propTypes;GiftCardOrCouponInput.displayName=displayName;export default GiftCardOrCouponInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";import OrderContext from"../context/OrderContext";import{has,isEmpty}from"lodash";const propTypes=components.GiftCardOrCouponRemoveButton.propTypes;const displayName=components.GiftCardOrCouponRemoveButton.displayName;const GiftCardOrCouponRemoveButton=o=>{const{children:e,label:t="Remove",onClick:n,type:r}=o,s=__rest(o,["children","label","onClick","type"]);const{order:p,removeGiftCardOrCouponCode:i}=useContext(OrderContext);let c=`${r}Code`;if(!r&&p&&has(p,"couponCode")&&!isEmpty(p.coupon_code))c="coupon_code";else if(!r)c="gift_card_code";const a=p&&c?p[c]:"";const d=p&&a?false:true;const m=()=>{i&&i({codeType:c});n&&n()};const l=Object.assign(Object.assign({},s),{label:t,handleClick:m,codeType:c});return e?_jsx(Parent,Object.assign({},l,{children:e}),void 0):d?null:_jsx("button",Object.assign({type:"button",onClick:m},s,{children:t}),void 0)};GiftCardOrCouponRemoveButton.propTypes=propTypes;GiftCardOrCouponRemoveButton.displayName=displayName;export default GiftCardOrCouponRemoveButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.GiftCardOrCouponSubmit.propTypes;const displayName=components.GiftCardOrCouponSubmit.displayName;const GiftCardOrCouponSubmit=t=>{const{children:o,label:r="Submit"}=t,i=__rest(t,["children","label"]);const s=Object.assign(Object.assign({},i),{label:r});return o?_jsx(Parent,Object.assign({},s,{children:o}),void 0):_jsx("button",Object.assign({type:"submit"},i,{children:r}),void 0)};GiftCardOrCouponSubmit.propTypes=propTypes;GiftCardOrCouponSubmit.displayName=displayName;export default GiftCardOrCouponSubmit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useEffect}from"react";import ItemContext,{initialItemContext}from"../context/ItemContext";import itemReducer,{itemInitialState,setItemState}from"../reducers/ItemReducer";import components from"../config/components";const propTypes=components.ItemContainer.propTypes;const displayName=components.ItemContainer.displayName;const ItemContainer=t=>{const{children:e,skuCode:s,lineItem:n}=t;const[o,m]=useReducer(itemReducer,itemInitialState);useEffect((()=>{if(s){setItemState(s,{type:"setSkuCode",key:"skuCode"},m)}if(n){setItemState(n,{type:"setCustomLineItem",key:"lineItem"},m)}}),[]);const i=t=>setItemState(t,{type:"setItems",key:"items"},m);const a=t=>setItemState(t,{type:"setItem",key:"item"},m);const r=t=>setItemState(t,{type:"setQuantity",key:"quantity"},m);const p=t=>setItemState(t,{type:"setOption",key:"option"},m);const c=t=>setItemState(t,{type:"setPrices",key:"prices"},m);const I=t=>setItemState(t,{type:"setCustomLineItems",key:"lineItems"},m);const y=Object.assign(Object.assign(Object.assign({},initialItemContext),o),{setItems:i,setItem:a,setQuantity:r,setOption:p,setPrices:c,setCustomLineItems:I});return _jsx(ItemContext.Provider,Object.assign({value:y},{children:e}),void 0)};ItemContainer.propTypes=propTypes;ItemContainer.displayName=displayName;export default ItemContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import LineItemContext from"../context/LineItemContext";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import{isEmpty}from"lodash";const propTypes=components.LineItem.propTypes;const displayName=components.LineItem.displayName;const LineItem=e=>{const{type:t="skus",children:n}=e;const{lineItems:o}=useContext(LineItemContext);const{lineItems:i}=useContext(ShipmentChildrenContext);const m=isEmpty(i)?o:i;const r=m&&m.filter((e=>e.item_type===t)).map(((e,t)=>{const o={lineItem:e};return _jsx(LineItemChildrenContext.Provider,Object.assign({value:o},{children:n}),t)}));return _jsx(Fragment,{children:r},void 0)};LineItem.propTypes=propTypes;LineItem.displayName=displayName;export default LineItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import getAmount from"../utils/getAmount";import LineItemChildrenContext from"../context/LineItemChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.LineItemAmount.propTypes;const defaultProps=components.LineItemAmount.defaultProps;const displayName=components.LineItemAmount.displayName;const LineItemAmount=t=>{const{format:e="formatted",type:o="total"}=t,n=__rest(t,["format","type"]);const{lineItem:m}=useContext(LineItemChildrenContext);const[s,r]=useState("");useEffect((()=>{if(m){const t=getAmount({base:"amount",type:o,format:e,obj:m});r(t)}return()=>{r("")}}),[m]);const i=Object.assign({price:s},n);return t.children?_jsx(Parent,Object.assign({},i,{children:t.children}),void 0):_jsx("span",Object.assign({},n,{children:s}),void 0)};LineItemAmount.propTypes=propTypes;LineItemAmount.defaultProps=defaultProps;LineItemAmount.displayName=displayName;export default LineItemAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.LineItemCode.propTypes;const displayName=components.LineItemCode.displayName;const LineItemCode=e=>{var{type:t="sku_code",children:o}=e,n=__rest(e,["type","children"]);const{lineItem:i}=useContext(LineItemChildrenContext);const s=i===null||i===void 0?void 0:i[t];const r=Object.assign({},n);return o?_jsx(Parent,Object.assign({},r,{children:o}),void 0):_jsx("p",Object.assign({},n,{children:s}),void 0)};LineItemCode.propTypes=propTypes;LineItemCode.displayName=displayName;export default LineItemCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"./utils/Parent";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";const propTypes=components.LineItemImage.propTypes;const displayName=components.LineItemImage.displayName;const LineItemImage=e=>{const{lineItem:t}=useContext(LineItemChildrenContext);const n=t===null||t===void 0?void 0:t.image_url;const o=Object.assign({src:n},e);return e.children?_jsx(Parent,Object.assign({},o,{children:e.children}),void 0):_jsx("img",Object.assign({alt:"",src:n},e),void 0)};LineItemImage.propTypes=propTypes;LineItemImage.displayName=displayName;export default LineItemImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.LineItemName.propTypes;const displayName=components.LineItemName.displayName;const LineItemName=e=>{const{lineItem:t}=useContext(LineItemChildrenContext);const n=t===null||t===void 0?void 0:t["name"];const o=Object.assign({label:n},e);return e.children?_jsx(Parent,Object.assign({},o,{children:e.children}),void 0):_jsx("p",Object.assign({},e,{children:n}),void 0)};LineItemName.propTypes=propTypes;LineItemName.displayName=displayName;export default LineItemName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext}from"react";import LineItemOptionChildrenContext from"../context/LineItemOptionChildrenContext";import get from"lodash/get";import has from"lodash/has";import map from"lodash/map";import Parent from"./utils/Parent";import components from"../config/components";import isJSON from"../utils/isJSON";const propTypes=components.LineItemOption.propTypes;const displayName=components.LineItemOption.displayName;const LineItemOption=t=>{const{name:e,children:n,valueClassName:s,id:i,key:o,tagElement:a="li",tagContainer:m="ul"}=t,p=__rest(t,["name","children","valueClassName","id","key","tagElement","tagContainer"]);const{lineItemOption:r,showAll:l}=useContext(LineItemOptionChildrenContext);const c=Object.assign(Object.assign({},t),{lineItemOption:r});const d=a;const O=m;const h=l&&isJSON(JSON.stringify(r===null||r===void 0?void 0:r.options))?map(r===null||r===void 0?void 0:r.options,((t,e)=>_jsxs(d,Object.assign({},p,{children:[`${e}:`,_jsx("span",Object.assign({className:s},{children:`${t}`}),void 0)]}),e))):has(r,`options.${e}`)?_jsxs(d,Object.assign({},p,{children:[`${e}:`,_jsx("span",Object.assign({className:s},p,{children:`${get(r,`options.${e}`)}`}),void 0)]}),o):null;return n?_jsx(Parent,Object.assign({},c,{children:t.children}),void 0):_jsx(O,{children:h},void 0)};LineItemOption.propTypes=propTypes;LineItemOption.displayName=displayName;export default LineItemOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,Fragment}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import LineItemOptionChildrenContext from"../context/LineItemOptionChildrenContext";import{isEmpty}from"lodash";import components from"../config/components";const displayName=components.LineItemOptions.displayName;const LineItemOptions=t=>{const{skuOptionId:e,title:n,children:i,showName:o=true,showAll:s}=t,r=__rest(t,["skuOptionId","title","children","showName","showAll"]);const{lineItem:m}=useContext(LineItemChildrenContext);const l=!isEmpty(m)?(m===null||m===void 0?void 0:m["line_item_options"])||[]:[];const p=l.filter((t=>{if(s)return true;return t.skuOption().id===e})).map(((t,e)=>{const m=o?_jsx("span",Object.assign({},r,{children:n||t.name}),void 0):null;const l={lineItemOption:t,showAll:s};return _jsxs(Fragment,{children:[m,_jsx(LineItemOptionChildrenContext.Provider,Object.assign({value:l},{children:i}),void 0)]},e)}));return _jsx(Fragment,{children:p},void 0)};LineItemOptions.displayName=displayName;export default LineItemOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import LineItemContext from"../context/LineItemContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.LineItemQuantity.propTypes;const defaultProps=components.LineItemQuantity.defaultProps;const displayName=components.LineItemQuantity.displayName;const LineItemQuantity=t=>{const{max:e=50,readonly:n=false}=t,o=__rest(t,["max","readonly"]);const{lineItem:i}=useContext(LineItemChildrenContext);const{updateLineItem:s}=useContext(LineItemContext);const a=[];for(let t=1;t<=e;t++){a.push(_jsx("option",Object.assign({value:`${t}`},{children:t}),t))}const r=t=>{const e=Number(t.target.value);s&&i&&s(i["id"],e)};const m=i===null||i===void 0?void 0:i["quantity"];const p=Object.assign({handleChange:r,quantity:m},t);return t.children?_jsx(Parent,Object.assign({},p,{children:t.children}),void 0):n?_jsx("span",Object.assign({},o,{children:m}),void 0):_jsx("select",Object.assign({title:i===null||i===void 0?void 0:i.name,value:m,onChange:r},o,{children:a}),void 0)};LineItemQuantity.propTypes=propTypes;LineItemQuantity.defaultProps=defaultProps;LineItemQuantity.displayName=displayName;export default LineItemQuantity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import LineItemContext from"../context/LineItemContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.LineItemRemoveLink.propTypes;const defaultProps=components.LineItemRemoveLink.defaultProps;const displayName=components.LineItemRemoveLink.displayName;const LineItemRemoveLink=e=>{const{label:t="Remove"}=e;const{lineItem:n}=useContext(LineItemChildrenContext);const{deleteLineItem:o}=useContext(LineItemContext);const i=e=>{e.preventDefault();o&&n&&o(n["id"])};const m=Object.assign({handleRemove:i},e);return e.children?_jsx(Parent,Object.assign({},m,{children:e.children}),void 0):_jsx("a",Object.assign({},e,{href:"#",onClick:i},{children:t}),void 0)};LineItemRemoveLink.propTypes=propTypes;LineItemRemoveLink.defaultProps=defaultProps;LineItemRemoveLink.displayName=displayName;export default LineItemRemoveLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import lineItemReducer,{lineItemInitialState,updateLineItem,deleteLineItem}from"../reducers/LineItemReducer";import OrderContext from"../context/OrderContext";import LineItemContext from"../context/LineItemContext";import CommerceLayerContext from"../context/CommerceLayerContext";import{isEmpty}from"lodash";import components from"../config/components";const propTypes=components.LineItemsContainer.propTypes;const defaultProps=components.LineItemsContainer.defaultProps;const displayName=components.LineItemsContainer.displayName;const LineItemsContainer=e=>{const{children:t,loader:n="Loading..."}=e;const{order:o,addResourceToInclude:i,include:r,orderId:s,getOrder:m}=useContext(OrderContext);const d=useContext(CommerceLayerContext);const[a,p]=useReducer(lineItemReducer,lineItemInitialState);useEffect((()=>{if(!(r===null||r===void 0?void 0:r.includes("line_items.line_item_options.sku_option"))){i({newResource:"line_items.line_item_options.sku_option"})}else if(!isEmpty(o)&&(o===null||o===void 0?void 0:o.line_items)){p({type:"setLineItems",payload:{lineItems:o.line_items}})}return()=>{if(isEmpty(o)){p({type:"setLineItems",payload:{lineItems:[]}})}}}),[o,r]);const c=Object.assign(Object.assign({},a),{loader:n,updateLineItem:(e,t=1)=>updateLineItem({lineItemId:e,quantity:t,dispatch:p,config:d,getOrder:m,orderId:s,errors:a.errors}),deleteLineItem:e=>deleteLineItem({lineItemId:e,dispatch:p,config:d,getOrder:m,orderId:s,errors:a.errors})});return _jsx(LineItemContext.Provider,Object.assign({value:c},{children:a.loading?n:t}),void 0)};LineItemsContainer.propTypes=propTypes;LineItemsContainer.defaultProps=defaultProps;LineItemsContainer.displayName=displayName;export default LineItemsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import Parent from"./utils/Parent";import getLineItemsCount from"../utils/getLineItemsCount";import{isEmpty}from"lodash";import LineItemContext from"../context/LineItemContext";import components from"../config/components";const propTypes=components.LineItemsCount.propTypes;const displayName=components.LineItemsCount.displayName;const LineItemsCount=t=>{const{children:e}=t,n=__rest(t,["children"]);const{lineItems:s}=useContext(LineItemContext);const[o,i]=useState(0);useEffect((()=>{if(!isEmpty(s)){const t=getLineItemsCount(s||[]);i(t)}return()=>{i(0)}}),[s]);const m=Object.assign({quantity:o},n);return e?_jsx(Parent,Object.assign({},m,{children:e}),void 0):_jsx("span",Object.assign({},n,{children:o}),void 0)};LineItemsCount.propTypes=propTypes;LineItemsCount.displayName=displayName;export default LineItemsCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseInput from"./utils/BaseInput";import components from"../config/components";const propTypes=components.MetadataInput.propTypes;const displayName=components.MetadataInput.displayName;const MetadataInput=t=>_jsx(BaseInput,Object.assign({"data-metadata":true},t),void 0);MetadataInput.propTypes=propTypes;MetadataInput.displayName=displayName;export default MetadataInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext,useMemo}from"react";import orderReducer,{createOrder,getApiOrder,setOrderErrors,setOrder,orderInitialState}from"../reducers/OrderReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import OrderContext,{defaultOrderContext}from"../context/OrderContext";import{unsetOrderState}from"../reducers/OrderReducer";import components from"../config/components";import OrderStorageContext from"../context/OrderStorageContext";const propTypes=components.OrderContainer.propTypes;const defaultProps=components.OrderContainer.defaultProps;const displayName=components.OrderContainer.displayName;const OrderContainer=e=>{const{orderId:r,children:t,metadata:o,attributes:d}=e;const[s,a]=useReducer(orderReducer,orderInitialState);const n=useContext(CommerceLayerContext);const{persistKey:c,clearWhenPlaced:i,getLocalOrder:p,setLocalOrder:O,deleteLocalOrder:u}=useContext(OrderStorageContext);useEffect((()=>{if(n.accessToken){const e=c?p(c):r;if(e){a({type:"setOrderId",payload:{orderId:e}});if(!s.order){getApiOrder({id:e,dispatch:a,config:n,persistKey:c,clearWhenPlaced:i,deleteLocalOrder:u,state:s})}}}return()=>unsetOrderState(a)}),[n.accessToken,r]);const C=useMemo((()=>Object.assign(Object.assign({},s),{setOrder:e=>setOrder(e,a),getOrder:e=>getApiOrder({id:e,dispatch:a,config:n,state:s}),setOrderErrors:e=>setOrderErrors({dispatch:a,errors:e}),createOrder:async()=>await createOrder({persistKey:c,dispatch:a,config:n,state:s,orderMetadata:o,orderAttributes:d}),addToCart:e=>defaultOrderContext["addToCart"](Object.assign(Object.assign({},e),{persistKey:c,dispatch:a,state:s,config:n,errors:s.errors,orderMetadata:o||{},orderAttributes:d,setLocalOrder:O})),saveAddressToCustomerAddressBook:e=>defaultOrderContext["saveAddressToCustomerAddressBook"](Object.assign(Object.assign({},e),{dispatch:a})),setGiftCardOrCouponCode:({code:e})=>defaultOrderContext["setGiftCardOrCouponCode"]({code:e,dispatch:a,order:s.order,config:n}),removeGiftCardOrCouponCode:({codeType:e})=>defaultOrderContext["removeGiftCardOrCouponCode"]({codeType:e,dispatch:a,order:s.order,config:n}),addResourceToInclude:e=>defaultOrderContext["addResourceToInclude"](Object.assign(Object.assign({},e),{dispatch:a,resourcesIncluded:s.include})),updateOrder:async e=>await defaultOrderContext["updateOrder"](Object.assign(Object.assign({},e),{dispatch:a,config:n,include:s.include}))})),[s]);return _jsx(OrderContext.Provider,Object.assign({value:C},{children:t}),void 0)};OrderContainer.propTypes=propTypes;OrderContainer.defaultProps=defaultProps;OrderContainer.displayName=displayName;export default OrderContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import components from"../config/components";import BaseField from"./utils/BaseField";const propTypes=components.OrderNumber.propTypes;const displayName=components.OrderNumber.displayName;const OrderNumber=e=>_jsx(BaseField,Object.assign({attribute:"number"},e),void 0);OrderNumber.propTypes=propTypes;OrderNumber.displayName=displayName;export default OrderNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderStorageContext from"../context/OrderStorageContext";import components from"../config/components";import{getLocalOrder,setLocalOrder,deleteLocalOrder}from"../utils/localStorage";const propTypes=components.OrderStorage.propTypes;const displayName=components.OrderStorage.displayName;const OrderStorage=e=>{const{children:r,clearWhenPlaced:o=true}=e,t=__rest(e,["children","clearWhenPlaced"]);return _jsx(OrderStorageContext.Provider,Object.assign({value:Object.assign(Object.assign({},t),{setLocalOrder:setLocalOrder,getLocalOrder:getLocalOrder,deleteLocalOrder:deleteLocalOrder,clearWhenPlaced:o})},{children:r}),void 0)};OrderStorage.propTypes=propTypes;OrderStorage.displayName=displayName;export default OrderStorage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../context/OrderContext";import PaymentMethodChildrenContext from"../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../context/PaymentMethodContext";import getPaypalConfig from"../utils/paypalPayment";import{useContext,useEffect,useState}from"react";import getLoaderComponent from"../utils/getLoaderComponent";import AdyenGateway from"./gateways/AdyenGateway";import StripeGateway from"./gateways/StripeGateway";import BraintreeGateway from"./gateways/BraintreeGateway";import PaypalGateway from"./gateways/PaypalGateway";import WireTransferGateway from"./gateways/WireTransferGateway";import CustomerContext from"../context/CustomerContext";const PaymentGateway=e=>{var t;var{readonly:a,showCard:o,handleEditClick:r,children:n,templateCustomerCards:s,templateCustomerSaveToWallet:i,onClickCustomerCards:m,show:d,loader:y="Loading..."}=e,l=__rest(e,["readonly","showCard","handleEditClick","children","templateCustomerCards","templateCustomerSaveToWallet","onClickCustomerCards","show","loader"]);const p=getLoaderComponent(y);const[c,C]=useState(true);const{payment:u}=useContext(PaymentMethodChildrenContext);const{order:h}=useContext(OrderContext);const{getCustomerPaymentSources:f}=useContext(CustomerContext);const{currentPaymentMethodId:w,config:x,paymentSource:_,currentPaymentMethodType:v,setPaymentSource:g}=useContext(PaymentMethodContext);const P=a?v:u===null||u===void 0?void 0:u.payment_source_type;useEffect((()=>{var e;if((u===null||u===void 0?void 0:u.id)===w&&P&&((e=h===null||h===void 0?void 0:h.payment_method)===null||e===void 0?void 0:e.payment_source_type)===P){const e=x&&P==="paypal_payments"?getPaypalConfig(P,x):{};if(!_||_.type!==P){g({paymentResource:P,order:h,attributes:e});f&&f()}C(false)}return()=>{C(true)}}),[(t=h===null||h===void 0?void 0:h.payment_method)===null||t===void 0?void 0:t.payment_source_type,d,_]);const G=Object.assign({readonly:a,showCard:o,handleEditClick:r,children:n,templateCustomerCards:s,show:d,loading:c,onClickCustomerCards:m,loaderComponent:p,templateCustomerSaveToWallet:i},l);switch(P){case"stripe_payments":return _jsx(StripeGateway,Object.assign({},G,{children:n}),void 0);case"adyen_payments":return _jsx(AdyenGateway,Object.assign({},G,{children:n}),void 0);case"braintree_payments":return _jsx(BraintreeGateway,Object.assign({},G,{children:n}),void 0);case"wire_transfers":return _jsx(WireTransferGateway,Object.assign({},G,{children:n}),void 0);case"paypal_payments":return _jsx(PaypalGateway,Object.assign({},G,{children:n}),void 0);default:return null}};export default PaymentGateway;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useState,useEffect}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import PaymentMethodChildrenContext from"../context/PaymentMethodChildrenContext";import components from"../config/components";import getLoaderComponent from"../utils/getLoaderComponent";const propTypes=components.PaymentMethod.propTypes;const displayName=components.PaymentMethod.displayName;const PaymentMethod=e=>{var{children:t,className:o,activeClass:n,loader:a="Loading...",clickableContainer:s,onClick:r}=e,i=__rest(e,["children","className","activeClass","loader","clickableContainer","onClick"]);const[d,m]=useState(true);const[c,l]=useState("");const{paymentMethods:p,currentPaymentMethodId:y,setPaymentMethod:h,setLoading:u}=useContext(PaymentMethodContext);useEffect((()=>{if(p)m(false);if(y)l(y);return()=>{m(true)}}),[p,y]);const C=p&&p.map(((e,a)=>{const d=y===(e===null||e===void 0?void 0:e.id);const m={payment:e,clickableContainer:s,paymentSelected:c,setPaymentSelected:l};const p=!s?undefined:async t=>{t.stopPropagation();u({loading:true});l(e.id);const o=e===null||e===void 0?void 0:e.payment_source_type;const n=e===null||e===void 0?void 0:e.id;await h({paymentResource:o,paymentMethodId:n});r&&r(e);u({loading:false})};return _jsx("div",Object.assign({className:`${o} ${d?n:""}`,onClick:p},i,{children:_jsx(PaymentMethodChildrenContext.Provider,Object.assign({value:m},{children:t}),void 0)}),a)}));return!d?_jsx(Fragment,{children:C},void 0):getLoaderComponent(a)};PaymentMethod.propTypes=propTypes;PaymentMethod.displayName=displayName;export default PaymentMethod;
|