@commercelayer/react-components 4.15.6 → 4.15.7-beta.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.
Files changed (478) hide show
  1. package/lib/cjs/components/ExternalFunction.js +1 -1
  2. package/lib/cjs/components/MetadataInput.d.ts +0 -1
  3. package/lib/cjs/components/MetadataInput.js +1 -1
  4. package/lib/cjs/components/SubmitButton.js +1 -1
  5. package/lib/cjs/components/addresses/Address.d.ts +0 -1
  6. package/lib/cjs/components/addresses/Address.js +1 -1
  7. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +0 -1
  8. package/lib/cjs/components/addresses/AddressCountrySelector.js +1 -1
  9. package/lib/cjs/components/addresses/AddressField.js +1 -1
  10. package/lib/cjs/components/addresses/AddressInput.d.ts +0 -1
  11. package/lib/cjs/components/addresses/AddressInput.js +1 -1
  12. package/lib/cjs/components/addresses/AddressInputSelect.d.ts +0 -1
  13. package/lib/cjs/components/addresses/AddressInputSelect.js +1 -1
  14. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +0 -1
  15. package/lib/cjs/components/addresses/AddressStateSelector.js +1 -1
  16. package/lib/cjs/components/addresses/AddressesContainer.js +1 -1
  17. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +0 -1
  18. package/lib/cjs/components/addresses/AddressesEmpty.js +1 -1
  19. package/lib/cjs/components/addresses/BillingAddressContainer.js +1 -1
  20. package/lib/cjs/components/addresses/BillingAddressForm.js +1 -1
  21. package/lib/cjs/components/addresses/SaveAddressesButton.js +1 -1
  22. package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +0 -1
  23. package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -1
  24. package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -1
  25. package/lib/cjs/components/auth/CommerceLayer.d.ts +0 -1
  26. package/lib/cjs/components/auth/CommerceLayer.js +1 -1
  27. package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
  28. package/lib/cjs/components/customers/CustomerContainer.d.ts +0 -1
  29. package/lib/cjs/components/customers/CustomerContainer.js +1 -1
  30. package/lib/cjs/components/customers/CustomerField.d.ts +0 -1
  31. package/lib/cjs/components/customers/CustomerField.js +1 -1
  32. package/lib/cjs/components/customers/CustomerInput.d.ts +0 -1
  33. package/lib/cjs/components/customers/CustomerInput.js +1 -1
  34. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +0 -1
  35. package/lib/cjs/components/customers/CustomerPaymentSource.js +1 -1
  36. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -1
  37. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +1 -1
  38. package/lib/cjs/components/customers/MyAccountLink.d.ts +0 -1
  39. package/lib/cjs/components/customers/MyAccountLink.js +1 -1
  40. package/lib/cjs/components/customers/MyIdentityLink.d.ts +0 -1
  41. package/lib/cjs/components/customers/MyIdentityLink.js +1 -1
  42. package/lib/cjs/components/customers/SaveCustomerButton.js +1 -1
  43. package/lib/cjs/components/errors/Errors.d.ts +0 -1
  44. package/lib/cjs/components/errors/Errors.js +1 -1
  45. package/lib/cjs/components/gift_cards/GiftCard.d.ts +0 -1
  46. package/lib/cjs/components/gift_cards/GiftCard.js +1 -1
  47. package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -1
  48. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -1
  49. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -1
  50. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +0 -1
  51. package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -1
  52. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -1
  53. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +1 -1
  54. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -1
  55. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -1
  56. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -1
  57. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -1
  58. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -1
  59. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +1 -1
  60. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -1
  61. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +1 -1
  62. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -1
  63. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +1 -1
  64. package/lib/cjs/components/line_items/LineItem.d.ts +0 -1
  65. package/lib/cjs/components/line_items/LineItem.js +1 -1
  66. package/lib/cjs/components/line_items/LineItemAmount.d.ts +0 -1
  67. package/lib/cjs/components/line_items/LineItemAmount.js +1 -1
  68. package/lib/cjs/components/line_items/LineItemCode.d.ts +0 -1
  69. package/lib/cjs/components/line_items/LineItemCode.js +1 -1
  70. package/lib/cjs/components/line_items/LineItemField.d.ts +0 -1
  71. package/lib/cjs/components/line_items/LineItemField.js +1 -1
  72. package/lib/cjs/components/line_items/LineItemImage.d.ts +0 -1
  73. package/lib/cjs/components/line_items/LineItemImage.js +1 -1
  74. package/lib/cjs/components/line_items/LineItemName.d.ts +0 -1
  75. package/lib/cjs/components/line_items/LineItemName.js +1 -1
  76. package/lib/cjs/components/line_items/LineItemOption.js +1 -1
  77. package/lib/cjs/components/line_items/LineItemOptions.js +1 -1
  78. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +0 -1
  79. package/lib/cjs/components/line_items/LineItemQuantity.js +1 -1
  80. package/lib/cjs/components/line_items/LineItemRemoveLink.js +1 -1
  81. package/lib/cjs/components/line_items/LineItemsContainer.d.ts +0 -1
  82. package/lib/cjs/components/line_items/LineItemsContainer.js +1 -1
  83. package/lib/cjs/components/line_items/LineItemsCount.d.ts +0 -1
  84. package/lib/cjs/components/line_items/LineItemsCount.js +1 -1
  85. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +0 -1
  86. package/lib/cjs/components/line_items/LineItemsEmpty.js +1 -1
  87. package/lib/cjs/components/orders/AddToCartButton.js +1 -1
  88. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +0 -1
  89. package/lib/cjs/components/orders/AdjustmentAmount.js +1 -1
  90. package/lib/cjs/components/orders/CartLink.js +1 -1
  91. package/lib/cjs/components/orders/CheckoutLink.d.ts +0 -1
  92. package/lib/cjs/components/orders/CheckoutLink.js +1 -1
  93. package/lib/cjs/components/orders/DiscountAmount.d.ts +0 -1
  94. package/lib/cjs/components/orders/DiscountAmount.js +1 -1
  95. package/lib/cjs/components/orders/GiftCardAmount.d.ts +0 -1
  96. package/lib/cjs/components/orders/GiftCardAmount.js +1 -1
  97. package/lib/cjs/components/orders/HostedCart.js +1 -1
  98. package/lib/cjs/components/orders/OrderContainer.d.ts +0 -1
  99. package/lib/cjs/components/orders/OrderContainer.js +1 -1
  100. package/lib/cjs/components/orders/OrderList.d.ts +0 -1
  101. package/lib/cjs/components/orders/OrderList.js +1 -1
  102. package/lib/cjs/components/orders/OrderListEmpty.d.ts +0 -1
  103. package/lib/cjs/components/orders/OrderListEmpty.js +1 -1
  104. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +0 -1
  105. package/lib/cjs/components/orders/OrderListPaginationButtons.js +1 -1
  106. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +0 -1
  107. package/lib/cjs/components/orders/OrderListPaginationInfo.js +1 -1
  108. package/lib/cjs/components/orders/OrderListRow.d.ts +0 -1
  109. package/lib/cjs/components/orders/OrderListRow.js +1 -1
  110. package/lib/cjs/components/orders/OrderNumber.d.ts +0 -1
  111. package/lib/cjs/components/orders/OrderNumber.js +1 -1
  112. package/lib/cjs/components/orders/OrderStorage.js +1 -1
  113. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +0 -1
  114. package/lib/cjs/components/orders/PaymentMethodAmount.js +1 -1
  115. package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
  116. package/lib/cjs/components/orders/PlaceOrderContainer.js +1 -1
  117. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -1
  118. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +1 -1
  119. package/lib/cjs/components/orders/ShippingAmount.d.ts +0 -1
  120. package/lib/cjs/components/orders/ShippingAmount.js +1 -1
  121. package/lib/cjs/components/orders/SubTotalAmount.d.ts +0 -1
  122. package/lib/cjs/components/orders/SubTotalAmount.js +1 -1
  123. package/lib/cjs/components/orders/TaxesAmount.d.ts +0 -1
  124. package/lib/cjs/components/orders/TaxesAmount.js +1 -1
  125. package/lib/cjs/components/orders/TotalAmount.d.ts +0 -1
  126. package/lib/cjs/components/orders/TotalAmount.js +1 -1
  127. package/lib/cjs/components/parcels/ParcelField.d.ts +0 -1
  128. package/lib/cjs/components/parcels/ParcelField.js +1 -1
  129. package/lib/cjs/components/parcels/ParcelLineItem.d.ts +0 -1
  130. package/lib/cjs/components/parcels/ParcelLineItem.js +1 -1
  131. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +0 -1
  132. package/lib/cjs/components/parcels/ParcelLineItemField.js +1 -1
  133. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +0 -1
  134. package/lib/cjs/components/parcels/ParcelLineItemsCount.js +1 -1
  135. package/lib/cjs/components/parcels/Parcels.d.ts +0 -1
  136. package/lib/cjs/components/parcels/Parcels.js +1 -1
  137. package/lib/cjs/components/parcels/ParcelsCount.d.ts +0 -1
  138. package/lib/cjs/components/parcels/ParcelsCount.js +1 -1
  139. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +0 -1
  140. package/lib/cjs/components/payment_gateways/AdyenGateway.js +1 -1
  141. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +0 -1
  142. package/lib/cjs/components/payment_gateways/BraintreeGateway.js +1 -1
  143. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +0 -1
  144. package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +1 -1
  145. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +0 -1
  146. package/lib/cjs/components/payment_gateways/ExternalGateway.js +1 -1
  147. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +0 -1
  148. package/lib/cjs/components/payment_gateways/KlarnaGateway.js +1 -1
  149. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +0 -1
  150. package/lib/cjs/components/payment_gateways/PaymentGateway.js +1 -1
  151. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +0 -1
  152. package/lib/cjs/components/payment_gateways/PaypalGateway.js +1 -1
  153. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +0 -1
  154. package/lib/cjs/components/payment_gateways/StripeGateway.js +1 -1
  155. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +0 -1
  156. package/lib/cjs/components/payment_gateways/WireTransferGateway.js +1 -1
  157. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +0 -1
  158. package/lib/cjs/components/payment_methods/PaymentMethod.js +1 -1
  159. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +0 -1
  160. package/lib/cjs/components/payment_methods/PaymentMethodName.js +1 -1
  161. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +0 -1
  162. package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +1 -1
  163. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +1 -1
  164. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +1 -1
  165. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +2 -0
  166. package/lib/cjs/components/payment_source/AdyenPayment.js +1 -1
  167. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +0 -1
  168. package/lib/cjs/components/payment_source/BraintreePayment.js +1 -1
  169. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +0 -1
  170. package/lib/cjs/components/payment_source/CheckoutComPayment.js +1 -1
  171. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +0 -1
  172. package/lib/cjs/components/payment_source/ExternalPayment.js +1 -1
  173. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +0 -1
  174. package/lib/cjs/components/payment_source/KlarnaPayment.js +1 -1
  175. package/lib/cjs/components/payment_source/PaymentSource.d.ts +0 -1
  176. package/lib/cjs/components/payment_source/PaymentSource.js +1 -1
  177. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -1
  178. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +1 -1
  179. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +0 -1
  180. package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +1 -1
  181. package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +0 -1
  182. package/lib/cjs/components/payment_source/PaymentSourceDetail.js +1 -1
  183. package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +1 -1
  184. package/lib/cjs/components/payment_source/PaypalPayment.js +1 -1
  185. package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +0 -1
  186. package/lib/cjs/components/payment_source/StripeExpressPayment.js +1 -1
  187. package/lib/cjs/components/payment_source/StripePayment.d.ts +0 -1
  188. package/lib/cjs/components/payment_source/StripePayment.js +1 -1
  189. package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +0 -1
  190. package/lib/cjs/components/payment_source/WireTransferPayment.js +1 -1
  191. package/lib/cjs/components/prices/Price.d.ts +0 -1
  192. package/lib/cjs/components/prices/Price.js +1 -1
  193. package/lib/cjs/components/prices/PricesContainer.d.ts +0 -1
  194. package/lib/cjs/components/prices/PricesContainer.js +1 -1
  195. package/lib/cjs/components/shipments/Shipment.js +1 -1
  196. package/lib/cjs/components/shipments/ShipmentField.d.ts +0 -1
  197. package/lib/cjs/components/shipments/ShipmentField.js +1 -1
  198. package/lib/cjs/components/shipments/ShipmentsContainer.js +1 -1
  199. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +0 -1
  200. package/lib/cjs/components/shipments/ShipmentsCount.js +1 -1
  201. package/lib/cjs/components/shipping_methods/ShippingMethod.js +1 -1
  202. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +0 -1
  203. package/lib/cjs/components/shipping_methods/ShippingMethodName.js +1 -1
  204. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +0 -1
  205. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +1 -1
  206. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -1
  207. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
  208. package/lib/cjs/components/skus/AvailabilityContainer.js +1 -1
  209. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +0 -1
  210. package/lib/cjs/components/skus/AvailabilityTemplate.js +1 -1
  211. package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +0 -1
  212. package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -1
  213. package/lib/cjs/components/skus/SkuField.d.ts +0 -1
  214. package/lib/cjs/components/skus/SkuField.js +1 -1
  215. package/lib/cjs/components/skus/SkuList.js +1 -1
  216. package/lib/cjs/components/skus/SkuListsContainer.js +1 -1
  217. package/lib/cjs/components/skus/Skus.js +1 -1
  218. package/lib/cjs/components/skus/SkusContainer.js +1 -1
  219. package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +0 -1
  220. package/lib/cjs/components/stock_transfers/StockTransfer.js +1 -1
  221. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +0 -1
  222. package/lib/cjs/components/stock_transfers/StockTransferField.js +1 -1
  223. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +0 -1
  224. package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
  225. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +0 -1
  226. package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
  227. package/lib/cjs/components/utils/GenericFieldComponent.js +1 -1
  228. package/lib/cjs/components/utils/Parent.js +1 -1
  229. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +0 -1
  230. package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
  231. package/lib/cjs/components/utils/PriceTemplate.d.ts +0 -1
  232. package/lib/cjs/components/utils/PriceTemplate.js +1 -1
  233. package/lib/cjs/components/utils/getAllErrors.d.ts +0 -1
  234. package/lib/cjs/context/AddressChildrenContext.d.ts +0 -1
  235. package/lib/cjs/context/AddressContext.d.ts +0 -1
  236. package/lib/cjs/context/AvailabilityContext.d.ts +0 -1
  237. package/lib/cjs/context/BillingAddressContext.d.ts +0 -1
  238. package/lib/cjs/context/BillingAddressFormContext.d.ts +0 -1
  239. package/lib/cjs/context/CommerceLayerContext.d.ts +0 -1
  240. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +0 -1
  241. package/lib/cjs/context/CustomerAddressFormContext.d.ts +0 -1
  242. package/lib/cjs/context/CustomerContext.d.ts +0 -1
  243. package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +0 -1
  244. package/lib/cjs/context/ExternalFunctionContext.d.ts +0 -1
  245. package/lib/cjs/context/GiftCardContext.d.ts +0 -1
  246. package/lib/cjs/context/InStockSubscriptionContext.d.ts +0 -1
  247. package/lib/cjs/context/LineItemChildrenContext.d.ts +0 -1
  248. package/lib/cjs/context/LineItemContext.d.ts +0 -1
  249. package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +0 -1
  250. package/lib/cjs/context/OrderContext.d.ts +0 -1
  251. package/lib/cjs/context/OrderListChildrenContext.d.ts +0 -1
  252. package/lib/cjs/context/OrderListPaginationContext.d.ts +0 -1
  253. package/lib/cjs/context/OrderStorageContext.d.ts +0 -1
  254. package/lib/cjs/context/ParcelChildrenContext.d.ts +0 -1
  255. package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +0 -1
  256. package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +0 -1
  257. package/lib/cjs/context/PaymentMethodContext.d.ts +0 -1
  258. package/lib/cjs/context/PaymentSourceContext.d.ts +0 -1
  259. package/lib/cjs/context/PricesContext.d.ts +0 -1
  260. package/lib/cjs/context/ShipmentChildrenContext.d.ts +0 -1
  261. package/lib/cjs/context/ShipmentContext.d.ts +0 -1
  262. package/lib/cjs/context/ShippingAddressContext.d.ts +0 -1
  263. package/lib/cjs/context/ShippingAddressFormContext.d.ts +0 -1
  264. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +0 -1
  265. package/lib/cjs/context/SkuChildrenContext.d.ts +0 -1
  266. package/lib/cjs/context/SkuContext.d.ts +0 -1
  267. package/lib/cjs/context/SkuListsContext.d.ts +0 -1
  268. package/lib/cjs/context/StockTransferChildrenContext.d.ts +0 -1
  269. package/lib/cjs/hooks/useCommerceLayer.js +1 -1
  270. package/lib/cjs/hooks/useCustomerContainer.js +1 -1
  271. package/lib/cjs/hooks/useOrderContainer.js +1 -1
  272. package/lib/cjs/reducers/AddressReducer.js +1 -1
  273. package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
  274. package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
  275. package/lib/cjs/reducers/CustomerReducer.js +1 -1
  276. package/lib/cjs/reducers/GiftCardReducer.js +1 -1
  277. package/lib/cjs/reducers/InStockSubscriptionReducer.js +1 -1
  278. package/lib/cjs/reducers/LineItemReducer.js +1 -1
  279. package/lib/cjs/reducers/OrderReducer.js +1 -1
  280. package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
  281. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
  282. package/lib/cjs/reducers/PriceReducer.js +1 -1
  283. package/lib/cjs/reducers/ShipmentReducer.js +1 -1
  284. package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
  285. package/lib/cjs/reducers/SkuReducer.js +1 -1
  286. package/lib/cjs/typings/globals.d.ts +0 -1
  287. package/lib/cjs/utils/addressesManager.js +1 -1
  288. package/lib/cjs/utils/browserInfo.js +1 -1
  289. package/lib/cjs/utils/canPlaceOrder.js +1 -1
  290. package/lib/cjs/utils/checkIncludeResource.js +1 -1
  291. package/lib/cjs/utils/compareObjAttribute.js +1 -1
  292. package/lib/cjs/utils/countryStateCity.js +1 -1
  293. package/lib/cjs/utils/customMessages.js +1 -1
  294. package/lib/cjs/utils/customerOrderOptions.js +1 -1
  295. package/lib/cjs/utils/events.js +1 -1
  296. package/lib/cjs/utils/expressPaymentHelper.js +1 -1
  297. package/lib/cjs/utils/filterChildren.d.ts +0 -1
  298. package/lib/cjs/utils/filterChildren.js +1 -1
  299. package/lib/cjs/utils/formCleaner.js +1 -1
  300. package/lib/cjs/utils/getAmount.js +1 -1
  301. package/lib/cjs/utils/getApplicationLink.js +1 -1
  302. package/lib/cjs/utils/getCardDetails.d.ts +1 -1
  303. package/lib/cjs/utils/getCardDetails.js +1 -1
  304. package/lib/cjs/utils/getCustomerIdByToken.js +1 -1
  305. package/lib/cjs/utils/getDomain.js +1 -1
  306. package/lib/cjs/utils/getErrors.js +1 -1
  307. package/lib/cjs/utils/getLineItemsCount.js +1 -1
  308. package/lib/cjs/utils/getLoaderComponent.d.ts +0 -1
  309. package/lib/cjs/utils/getLoaderComponent.js +1 -1
  310. package/lib/cjs/utils/getPaymentAttributes.js +1 -1
  311. package/lib/cjs/utils/getPrices.d.ts +0 -1
  312. package/lib/cjs/utils/getPrices.js +1 -1
  313. package/lib/cjs/utils/getPublicIp.js +1 -1
  314. package/lib/cjs/utils/getSdk.js +1 -1
  315. package/lib/cjs/utils/hasSubscriptions.js +1 -1
  316. package/lib/cjs/utils/hooks/useCustomContext.js +1 -1
  317. package/lib/cjs/utils/hooks/useExternalScript.js +1 -1
  318. package/lib/cjs/utils/isDate.js +1 -1
  319. package/lib/cjs/utils/isEmpty.js +1 -1
  320. package/lib/cjs/utils/isGuestToken.js +1 -1
  321. package/lib/cjs/utils/isJSON.js +1 -1
  322. package/lib/cjs/utils/jwt.js +1 -1
  323. package/lib/cjs/utils/localStorage.js +1 -1
  324. package/lib/cjs/utils/omit.js +1 -1
  325. package/lib/cjs/utils/organization.js +1 -1
  326. package/lib/cjs/utils/pick.js +1 -1
  327. package/lib/cjs/utils/promisify.js +1 -1
  328. package/lib/cjs/utils/replace.js +1 -1
  329. package/lib/cjs/utils/scrollbarWidth.js +1 -1
  330. package/lib/cjs/utils/shipments.js +1 -1
  331. package/lib/cjs/utils/snakeToCamelCase.js +1 -1
  332. package/lib/cjs/utils/triggerAttributeHelper.js +1 -1
  333. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +1 -1
  334. package/lib/cjs/utils/validateFormFields.js +1 -1
  335. package/lib/esm/components/MetadataInput.d.ts +0 -1
  336. package/lib/esm/components/addresses/Address.d.ts +0 -1
  337. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +0 -1
  338. package/lib/esm/components/addresses/AddressInput.d.ts +0 -1
  339. package/lib/esm/components/addresses/AddressInputSelect.d.ts +0 -1
  340. package/lib/esm/components/addresses/AddressStateSelector.d.ts +0 -1
  341. package/lib/esm/components/addresses/AddressesEmpty.d.ts +0 -1
  342. package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +0 -1
  343. package/lib/esm/components/auth/CommerceLayer.d.ts +0 -1
  344. package/lib/esm/components/customers/CustomerContainer.d.ts +0 -1
  345. package/lib/esm/components/customers/CustomerField.d.ts +0 -1
  346. package/lib/esm/components/customers/CustomerInput.d.ts +0 -1
  347. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +0 -1
  348. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -1
  349. package/lib/esm/components/customers/MyAccountLink.d.ts +0 -1
  350. package/lib/esm/components/customers/MyIdentityLink.d.ts +0 -1
  351. package/lib/esm/components/errors/Errors.d.ts +0 -1
  352. package/lib/esm/components/gift_cards/GiftCard.d.ts +0 -1
  353. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -1
  354. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +0 -1
  355. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -1
  356. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -1
  357. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -1
  358. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -1
  359. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -1
  360. package/lib/esm/components/line_items/LineItem.d.ts +0 -1
  361. package/lib/esm/components/line_items/LineItemAmount.d.ts +0 -1
  362. package/lib/esm/components/line_items/LineItemCode.d.ts +0 -1
  363. package/lib/esm/components/line_items/LineItemField.d.ts +0 -1
  364. package/lib/esm/components/line_items/LineItemImage.d.ts +0 -1
  365. package/lib/esm/components/line_items/LineItemName.d.ts +0 -1
  366. package/lib/esm/components/line_items/LineItemQuantity.d.ts +0 -1
  367. package/lib/esm/components/line_items/LineItemsContainer.d.ts +0 -1
  368. package/lib/esm/components/line_items/LineItemsCount.d.ts +0 -1
  369. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +0 -1
  370. package/lib/esm/components/orders/AddToCartButton.js +1 -1
  371. package/lib/esm/components/orders/AdjustmentAmount.d.ts +0 -1
  372. package/lib/esm/components/orders/CheckoutLink.d.ts +0 -1
  373. package/lib/esm/components/orders/DiscountAmount.d.ts +0 -1
  374. package/lib/esm/components/orders/GiftCardAmount.d.ts +0 -1
  375. package/lib/esm/components/orders/OrderContainer.d.ts +0 -1
  376. package/lib/esm/components/orders/OrderList.d.ts +0 -1
  377. package/lib/esm/components/orders/OrderListEmpty.d.ts +0 -1
  378. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +0 -1
  379. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +0 -1
  380. package/lib/esm/components/orders/OrderListRow.d.ts +0 -1
  381. package/lib/esm/components/orders/OrderNumber.d.ts +0 -1
  382. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +0 -1
  383. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -1
  384. package/lib/esm/components/orders/ShippingAmount.d.ts +0 -1
  385. package/lib/esm/components/orders/SubTotalAmount.d.ts +0 -1
  386. package/lib/esm/components/orders/TaxesAmount.d.ts +0 -1
  387. package/lib/esm/components/orders/TotalAmount.d.ts +0 -1
  388. package/lib/esm/components/parcels/ParcelField.d.ts +0 -1
  389. package/lib/esm/components/parcels/ParcelLineItem.d.ts +0 -1
  390. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +0 -1
  391. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +0 -1
  392. package/lib/esm/components/parcels/Parcels.d.ts +0 -1
  393. package/lib/esm/components/parcels/ParcelsCount.d.ts +0 -1
  394. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +0 -1
  395. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +0 -1
  396. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +0 -1
  397. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +0 -1
  398. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +0 -1
  399. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +0 -1
  400. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +0 -1
  401. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +0 -1
  402. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +0 -1
  403. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +0 -1
  404. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +0 -1
  405. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +0 -1
  406. package/lib/esm/components/payment_source/AdyenPayment.d.ts +2 -0
  407. package/lib/esm/components/payment_source/AdyenPayment.js +1 -1
  408. package/lib/esm/components/payment_source/BraintreePayment.d.ts +0 -1
  409. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +0 -1
  410. package/lib/esm/components/payment_source/CheckoutComPayment.js +1 -1
  411. package/lib/esm/components/payment_source/ExternalPayment.d.ts +0 -1
  412. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +0 -1
  413. package/lib/esm/components/payment_source/PaymentSource.d.ts +0 -1
  414. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -1
  415. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +0 -1
  416. package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +0 -1
  417. package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +0 -1
  418. package/lib/esm/components/payment_source/StripePayment.d.ts +0 -1
  419. package/lib/esm/components/payment_source/WireTransferPayment.d.ts +0 -1
  420. package/lib/esm/components/prices/Price.d.ts +0 -1
  421. package/lib/esm/components/prices/PricesContainer.d.ts +0 -1
  422. package/lib/esm/components/shipments/ShipmentField.d.ts +0 -1
  423. package/lib/esm/components/shipments/ShipmentsCount.d.ts +0 -1
  424. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +0 -1
  425. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +0 -1
  426. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -1
  427. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +0 -1
  428. package/lib/esm/components/skus/DeliveryLeadTime.d.ts +0 -1
  429. package/lib/esm/components/skus/SkuField.d.ts +0 -1
  430. package/lib/esm/components/stock_transfers/StockTransfer.d.ts +0 -1
  431. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +0 -1
  432. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +0 -1
  433. package/lib/esm/components/utils/BaseOrderPrice.d.ts +0 -1
  434. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +0 -1
  435. package/lib/esm/components/utils/PriceTemplate.d.ts +0 -1
  436. package/lib/esm/components/utils/getAllErrors.d.ts +0 -1
  437. package/lib/esm/context/AddressChildrenContext.d.ts +0 -1
  438. package/lib/esm/context/AddressContext.d.ts +0 -1
  439. package/lib/esm/context/AvailabilityContext.d.ts +0 -1
  440. package/lib/esm/context/BillingAddressContext.d.ts +0 -1
  441. package/lib/esm/context/BillingAddressFormContext.d.ts +0 -1
  442. package/lib/esm/context/CommerceLayerContext.d.ts +0 -1
  443. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +0 -1
  444. package/lib/esm/context/CustomerAddressFormContext.d.ts +0 -1
  445. package/lib/esm/context/CustomerContext.d.ts +0 -1
  446. package/lib/esm/context/CustomerPaymentSourceContext.d.ts +0 -1
  447. package/lib/esm/context/ExternalFunctionContext.d.ts +0 -1
  448. package/lib/esm/context/GiftCardContext.d.ts +0 -1
  449. package/lib/esm/context/InStockSubscriptionContext.d.ts +0 -1
  450. package/lib/esm/context/LineItemChildrenContext.d.ts +0 -1
  451. package/lib/esm/context/LineItemContext.d.ts +0 -1
  452. package/lib/esm/context/LineItemOptionChildrenContext.d.ts +0 -1
  453. package/lib/esm/context/OrderContext.d.ts +0 -1
  454. package/lib/esm/context/OrderListChildrenContext.d.ts +0 -1
  455. package/lib/esm/context/OrderListPaginationContext.d.ts +0 -1
  456. package/lib/esm/context/OrderStorageContext.d.ts +0 -1
  457. package/lib/esm/context/ParcelChildrenContext.d.ts +0 -1
  458. package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +0 -1
  459. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +0 -1
  460. package/lib/esm/context/PaymentMethodContext.d.ts +0 -1
  461. package/lib/esm/context/PaymentSourceContext.d.ts +0 -1
  462. package/lib/esm/context/PricesContext.d.ts +0 -1
  463. package/lib/esm/context/ShipmentChildrenContext.d.ts +0 -1
  464. package/lib/esm/context/ShipmentContext.d.ts +0 -1
  465. package/lib/esm/context/ShippingAddressContext.d.ts +0 -1
  466. package/lib/esm/context/ShippingAddressFormContext.d.ts +0 -1
  467. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +0 -1
  468. package/lib/esm/context/SkuChildrenContext.d.ts +0 -1
  469. package/lib/esm/context/SkuContext.d.ts +0 -1
  470. package/lib/esm/context/SkuListsContext.d.ts +0 -1
  471. package/lib/esm/context/StockTransferChildrenContext.d.ts +0 -1
  472. package/lib/esm/reducers/OrderReducer.js +1 -1
  473. package/lib/esm/typings/globals.d.ts +0 -1
  474. package/lib/esm/utils/filterChildren.d.ts +0 -1
  475. package/lib/esm/utils/getCardDetails.d.ts +1 -1
  476. package/lib/esm/utils/getLoaderComponent.d.ts +0 -1
  477. package/lib/esm/utils/getPrices.d.ts +0 -1
  478. package/package.json +22 -22
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CodeErrorType } from '../../typings/errors';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export type TResourceError = 'addresses' | 'billing_address' | 'gift_cards' | 'gift_card_or_coupon_code' | 'line_items' | 'orders' | 'payment_methods' | 'prices' | 'shipments' | 'shipping_address' | 'customer_address' | 'sku_options' | 'variant' | 'in_stock_subscriptions';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseState } from '../../typings/index';
3
2
  import type { DefaultChildrenType } from '../../typings/globals';
4
3
  interface Props extends Omit<JSX.IntrinsicElements['form'], 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseSelectComponentProps } from '../../typings/index';
3
2
  type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
3
  required?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps, type GiftCardInputName } from '../../typings/index';
3
2
  type Props = {
4
3
  name: GiftCardInputName;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { CodeType } from '../../reducers/OrderReducer';
4
3
  interface ChildrenProps extends Omit<Props, 'children' | 'type'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { OrderCodeType } from '../../reducers/OrderReducer';
3
2
  import type { Order } from '@commercelayer/sdk';
4
3
  import type { DefaultChildrenType } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps } from '../../typings/index';
3
2
  import { type OrderCodeType } from '../../reducers/OrderReducer';
4
3
  type FieldName = 'gift_card_code' | 'coupon_code';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['button'], 'children' | 'onClick'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type TLineItem = 'gift_cards' | 'payment_methods' | 'promotions' | 'shipments' | 'skus' | 'bundles' | 'adjustments';
3
2
  interface Props {
4
3
  children: JSX.Element | JSX.Element[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent, type BasePriceType } from '../../typings/index';
3
2
  type Props = BaseAmountComponent & {
4
3
  type?: BasePriceType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LineItem } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export interface TLineItemCode extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type LineItemFieldChildrenProps = TGenericChildrenProps<TResources['LineItem']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LineItem } from '@commercelayer/sdk';
3
2
  import type { ChildrenFunction } from '../../typings/index';
4
3
  import { type TLineItem } from './LineItem';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LineItem } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export interface TLineItemName extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import { type LineItem } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TypeAccepted } from '../../utils/getLineItemsCount';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  quantity: number;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import SkuListsContext from"../../context/SkuListsContext";import ExternalFunctionContext from"../../context/ExternalFunctionContext";import SkuChildrenContext from"../../context/SkuChildrenContext";import{getApplicationLink}from"../../utils/getApplicationLink";import CommerceLayerContext from"../../context/CommerceLayerContext";import useCustomContext from"../../utils/hooks/useCustomContext";import{getDomain}from"../../utils/getDomain";import{publish}from"../../utils/events";export function AddToCartButton(props){const{label="Add to cart",children,skuCode,bundleCode,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,quantity,lineItemOption,protocol="https",...p}=props,{accessToken,endpoint}=useCustomContext({context:CommerceLayerContext,contextComponentName:"CommerceLayer",currentComponentName:"AddToCartButton",key:"accessToken"}),{addToCart,orderId,getOrder,setOrderErrors}=useCustomContext({context:OrderContext,contextComponentName:"OrderContainer",currentComponentName:"AddToCartButton",key:"addToCart"}),{url,callExternalFunction}=useContext(ExternalFunctionContext),{skuLists}=useContext(SkuListsContext),{sku}=useContext(SkuChildrenContext),sCode=sku?.code??skuCode,handleClick=async()=>{const qty=quantity!=null?parseInt(quantity):1;if(skuLists!=null&&skuListId&&url&&skuListId in skuLists){const lineItems=skuLists?.[skuListId]?.map(skuCode2=>({skuCode:skuCode2,quantity:qty,_update_quantity:1}));return await callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems}]}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),buyNowMode||publish("open-cart"),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}if(!url&&addToCart!=null){const res=await addToCart({bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart&&accessToken!=null&&endpoint!=null){const{slug,domain}=getDomain(endpoint),orderId2=res?.orderId;hostedCartUrl&&orderId2?location.href=`${protocol}://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`:orderId2&&slug&&(location.href=getApplicationLink({orderId:orderId2,slug,accessToken,domain,applicationType:"cart"}))}return res}else if(url)return await callExternalFunction({url,data:{bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),buyNowMode||publish("open-cart"),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))},parentProps={handleClick,label,...props};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{...p,onClick:()=>{handleClick()},children:label})}export default AddToCartButton;
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import SkuListsContext from"../../context/SkuListsContext";import ExternalFunctionContext from"../../context/ExternalFunctionContext";import SkuChildrenContext from"../../context/SkuChildrenContext";import{getApplicationLink}from"../../utils/getApplicationLink";import CommerceLayerContext from"../../context/CommerceLayerContext";import useCustomContext from"../../utils/hooks/useCustomContext";import{getDomain}from"../../utils/getDomain";import{publish}from"../../utils/events";import{getOrganizationConfig}from"../../utils/organization";export function AddToCartButton(props){const{label="Add to cart",children,skuCode,bundleCode,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,quantity,lineItemOption,protocol="https",...p}=props,{accessToken,endpoint}=useCustomContext({context:CommerceLayerContext,contextComponentName:"CommerceLayer",currentComponentName:"AddToCartButton",key:"accessToken"}),{addToCart,orderId,getOrder,setOrderErrors}=useCustomContext({context:OrderContext,contextComponentName:"OrderContainer",currentComponentName:"AddToCartButton",key:"addToCart"}),{url,callExternalFunction}=useContext(ExternalFunctionContext),{skuLists}=useContext(SkuListsContext),{sku}=useContext(SkuChildrenContext),sCode=sku?.code??skuCode,handleClick=async()=>{const qty=quantity!=null?parseInt(quantity):1;if(skuLists!=null&&skuListId&&url&&skuListId in skuLists){const lineItems=skuLists?.[skuListId]?.map(skuCode2=>({skuCode:skuCode2,quantity:qty,_update_quantity:1}));return await callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems}]}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),buyNowMode||publish("open-cart"),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}if(!url&&addToCart!=null){const res=await addToCart({bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart&&accessToken!=null&&endpoint!=null){const{slug,domain}=getDomain(endpoint),orderId2=res?.orderId;if(hostedCartUrl&&orderId2)location.href=`${protocol}://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`;else if(orderId2&&slug){const config=await getOrganizationConfig({accessToken,endpoint,params:{orderId:orderId2,accessToken}});location.href=config?.links?.cart??getApplicationLink({orderId:orderId2,slug,accessToken,domain,applicationType:"cart"})}}return res}else if(url)return await callExternalFunction({url,data:{bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),buyNowMode||publish("open-cart"),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))},parentProps={handleClick,label,...props};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{...p,onClick:()=>{handleClick()},children:label})}export default AddToCartButton;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function AdjustmentAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default AdjustmentAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  checkoutUrl: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function DiscountAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default DiscountAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function GiftCardAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default GiftCardAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseMetadataObject } from '../../typings/index';
3
2
  import type { OrderCreate, Order } from '@commercelayer/sdk';
4
3
  import type { DefaultChildrenType } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TOrderList, type InitialOrderListContext, type OrderListContent } from '../../context/OrderListChildrenContext';
3
2
  import { type ColumnDef, type SortingState } from '@tanstack/react-table';
4
3
  import type { DefaultChildrenType, TRange } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type OrderListPaginationContext as TOrderListPaginationContext } from '../../context/OrderListPaginationContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface PaginationButton extends Omit<JSX.IntrinsicElements['button'], 'children' | 'disabled'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  type TAsComponent = keyof Pick<JSX.IntrinsicElements, 'p' | 'span' | 'div'>;
4
3
  type ChildrenProps<A extends TAsComponent> = Omit<Props<A>, 'children'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TOrderList, type OrderListContent, type TableAccessor } from '../../context/OrderListChildrenContext';
3
2
  import { type Row } from '@tanstack/react-table';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseFieldProps } from '../utils/BaseField';
3
2
  type Props = Omit<BaseFieldProps, 'attribute'>;
4
3
  export declare function OrderNumber(props: Props): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function PaymentMethodAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default PaymentMethodAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputProps } from '../utils/BaseInput';
3
2
  export declare function PrivacyAndTermsCheckbox(props: Partial<BaseInputProps>): JSX.Element;
4
3
  export default PrivacyAndTermsCheckbox;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function ShippingAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default ShippingAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function SubTotalAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default SubTotalAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function TaxesAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default TaxesAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function TotalAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default TotalAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { Parcel } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  children: JSX.Element | JSX.Element[];
4
3
  filterBy?: string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { Parcel } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function AdyenGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function BraintreeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function CheckoutComGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function ExternalGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function KlarnaGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LoaderType } from '../../typings/index';
3
2
  import { type PaymentSourceProps } from '../payment_source/PaymentSource';
4
3
  export type GatewayBaseType = Props & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = Partial<GatewayBaseType>;
4
3
  export declare function PaypalGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function StripeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function WireTransferGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LoaderType } from '../../typings/index';
3
2
  import type { Order, PaymentMethod as PaymentMethodType } from '@commercelayer/sdk';
4
3
  import type { PaymentResource } from '../../reducers/PaymentMethodReducer';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  labelName: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  interface Props extends BaseAmountComponent {
4
3
  type?: 'amount';
@@ -1,5 +1,6 @@
1
1
  import { type CSSProperties } from 'react';
2
2
  import { type PaymentSourceProps } from './PaymentSource';
3
+ import type { CoreOptions } from '@adyen/adyen-web/dist/types/core/types';
3
4
  type Styles = Partial<{
4
5
  base: CSSProperties;
5
6
  error: CSSProperties;
@@ -43,6 +44,7 @@ export interface AdyenPaymentConfig {
43
44
  placed: boolean;
44
45
  }) => void;
45
46
  styles?: PaymentMethodsStyle;
47
+ paymentMethodsConfiguration?: CoreOptions['paymentMethodsConfiguration'];
46
48
  }
47
49
  interface Props {
48
50
  clientKey?: string;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import{setCustomerOrderParam}from"../../utils/localStorage";import Parent from"../utils/Parent";import getBrowserInfo,{cleanUrlBy}from"../../utils/browserInfo";import PlaceOrderContext from"../../context/PlaceOrderContext";import OrderContext from"../../context/OrderContext";import omit from"../../utils/omit";import{getPublicIP}from"../../utils/getPublicIp";const defaultConfig={};export function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,threeDSecureContainerClassName,styles}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),{placeOrderButtonRef}=useContext(PlaceOrderContext),ref=useRef(null),handleSubmit=async(e,component)=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),component?.submit&&component.submit(),!1},handleChange=async(state,component)=>{if(state.isValid){ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current,component),setPaymentRef({ref}));const browserInfo=getBrowserInfo(),shopperIp=await getPublicIP(),attributes={payment_request_data:{payment_method:state.data.paymentMethod,shopperInteraction:"Ecommerce",recurringProcessingModel:"CardOnFile",origin:window.location.origin,return_url:window.location.href,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,browser_info:{acceptHeader:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",...browserInfo}}};paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes})}},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),adyenAction=pSource?.payment_response?.action,resultCode=pSource?.payment_response?.resultCode;if(adyenAction&&component)return component.handleAction(adyenAction),!1;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0;if(["Cancelled","Refused"].includes(resultCode)){const message=pSource?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}return!1}catch(error){return console.error("Adyen additional details error:",error),!1}},onSubmit=async(state,component)=>{const saveCustomer=document.getElementById("save_payment_source_to_customer_wallet"),url=cleanUrlBy(),shopperIp=await getPublicIP();let control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"});if(control?.payment_response?.resultCode==="Authorised")return!0;const paymentDataAvailable=Object.keys(control?.payment_request_data).length>0,paymentMethodSelected=control?.payment_request_data?.payment_method?.type,paymentMethod=saveCustomer?.checked?state.data.paymentMethod:omit(state.data.paymentMethod,["encryptedCardNumber","encryptedExpiryMonth","encryptedExpiryYear"]);(!paymentDataAvailable||paymentMethodSelected!==state.data.paymentMethod.type)&&(control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{payment_request_data:{...state.data,payment_method:paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp}}}));const attributes={payment_request_data:{...state.data,payment_method:paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp},_authorize:1};delete attributes.payment_request_data.paymentMethod;try{const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),action=res?.payment_response?.action;if(component&&action)return component.handleAction(action),!1;const resultCode=res?.payment_response?.resultCode;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0;if(["Cancelled","Refused"].includes(resultCode)){const message=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.message;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}])}return!1}catch(error){return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),!1}};return useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]},[firstPaymentMethod]=paymentMethodsResponse.paymentMethods,isOnlyCard=paymentMethodsResponse.paymentMethods?.length===1&&firstPaymentMethod.type==="scheme";paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");const showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null,options={locale:order?.language_code??locale,environment,clientKey,amount:{currency:order?.currency_code||"",value:order?.total_amount_with_taxes_cents||0},countryCode:order?.country_code||"",paymentMethodsResponse,showPayButton:!1,paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1}},onAdditionalDetails:(state,element)=>{handleOnAdditionalDetails(state,element)},onChange:(state,element)=>{handleChange(state,element)},onSubmit:(state,element)=>{onSubmit(state,element)}};return!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout&&import("@adyen/adyen-web").then(({default:AdyenCheckout})=>{const type=isOnlyCard?"card":"dropin";AdyenCheckout(options).then(adyenCheckout=>{const component=adyenCheckout.create(type,{showRemovePaymentMethodButton:showStoredPaymentMethods,onSelect:component2=>{const id=component2._id;id.search("scheme")===-1&&ref.current&&(id.search("paypal")===-1?ref.current.onsubmit=async()=>await handleSubmit(ref.current,component2):ref.current.onsubmit=null,setPaymentRef({ref}))}}).mount("#adyen-dropin");component&&(setCheckout(component),setLoadAdyen(!0))})}),()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e,checkout)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet}),_jsx("div",{className:threeDSecureContainerClassName,id:"adyen-action"})]})}export default AdyenPayment;
2
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import{setCustomerOrderParam}from"../../utils/localStorage";import Parent from"../utils/Parent";import getBrowserInfo,{cleanUrlBy}from"../../utils/browserInfo";import PlaceOrderContext from"../../context/PlaceOrderContext";import OrderContext from"../../context/OrderContext";import omit from"../../utils/omit";import{getPublicIP}from"../../utils/getPublicIp";const defaultConfig={};export function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,threeDSecureContainerClassName,styles}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),{placeOrderButtonRef}=useContext(PlaceOrderContext),ref=useRef(null),handleSubmit=async(e,component)=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),component?.submit&&component.submit(),!1},handleChange=async(state,component)=>{if(state.isValid){ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current,component),setPaymentRef({ref}));const browserInfo=getBrowserInfo(),shopperIp=await getPublicIP(),attributes={payment_request_data:{payment_method:state.data.paymentMethod,shopperInteraction:"Ecommerce",recurringProcessingModel:"CardOnFile",origin:window.location.origin,return_url:window.location.href,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,browser_info:{acceptHeader:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",...browserInfo}}};paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes})}},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),adyenAction=pSource?.payment_response?.action,resultCode=pSource?.payment_response?.resultCode;if(adyenAction&&component)return component.handleAction(adyenAction),!1;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0;if(["Cancelled","Refused"].includes(resultCode)){const message=pSource?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}return!1}catch(error){return console.error("Adyen additional details error:",error),!1}},onSubmit=async(state,component)=>{const saveCustomer=document.getElementById("save_payment_source_to_customer_wallet"),url=cleanUrlBy(),shopperIp=await getPublicIP();let control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"});if(control?.payment_response?.resultCode==="Authorised")return!0;const paymentDataAvailable=Object.keys(control?.payment_request_data).length>0,paymentMethodSelected=control?.payment_request_data?.payment_method?.type,paymentMethod=saveCustomer?.checked?state.data.paymentMethod:omit(state.data.paymentMethod,["encryptedCardNumber","encryptedExpiryMonth","encryptedExpiryYear"]);(!paymentDataAvailable||paymentMethodSelected!==state.data.paymentMethod.type)&&(control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{payment_request_data:{...state.data,payment_method:paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp}}}));const attributes={payment_request_data:{...state.data,payment_method:paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp},_authorize:1};delete attributes.payment_request_data.paymentMethod;try{const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),action=res?.payment_response?.action;if(component&&action)return component.handleAction(action),!1;const resultCode=res?.payment_response?.resultCode;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0;if(["Cancelled","Refused"].includes(resultCode)){const message=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.message;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}])}return!1}catch(error){return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),!1}};return useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]},[firstPaymentMethod]=paymentMethodsResponse.paymentMethods,isOnlyCard=paymentMethodsResponse.paymentMethods?.length===1&&firstPaymentMethod.type==="scheme";paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");const showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null,options={locale:order?.language_code??locale,environment,clientKey,amount:{currency:order?.currency_code||"",value:order?.total_amount_with_taxes_cents||0},countryCode:order?.country_code||"",paymentMethodsResponse,showPayButton:!1,paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},...config?.paymentMethodsConfiguration},onAdditionalDetails:(state,element)=>{handleOnAdditionalDetails(state,element)},onChange:(state,element)=>{handleChange(state,element)},onSubmit:(state,element)=>{onSubmit(state,element)}};return!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout&&import("@adyen/adyen-web").then(({default:AdyenCheckout})=>{const type=isOnlyCard?"card":"dropin";AdyenCheckout(options).then(adyenCheckout=>{const component=adyenCheckout.create(type,{showRemovePaymentMethodButton:showStoredPaymentMethods,onSelect:component2=>{const id=component2._id;id.search("scheme")===-1&&ref.current&&(id.search("paypal")===-1?ref.current.onsubmit=async()=>await handleSubmit(ref.current,component2):ref.current.onsubmit=null,setPaymentRef({ref}))}}).mount("#adyen-dropin");component&&(setCheckout(component),setLoadAdyen(!0))})}),()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e,checkout)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet}),_jsx("div",{className:threeDSecureContainerClassName,id:"adyen-action"})]})}export default AdyenPayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentSourceProps } from './PaymentSource';
3
2
  import { type HostedFieldFieldOptions } from 'braintree-web';
4
3
  type BraintreeHostedFields<Type> = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
2
  import { type PaymentSourceProps } from './PaymentSource';
4
3
  import { type FramesStyle } from 'frames-react';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useRef}from"react";import useExternalScript from"../../utils/hooks/useExternalScript";import PaymentMethodContext from"../../context/PaymentMethodContext";import{Frames,CardNumber,ExpiryDate,Cvv}from"frames-react";import OrderContext from"../../context/OrderContext";import Parent from"../utils/Parent";import{setCustomerOrderParam}from"../../utils/localStorage";const scriptUrl="https://cdn.checkout.com/js/framesv2.min.js",systemLanguages=["DE-DE","EN-GB","ES-ES","FR-FR","IT-IT","KR-KR","NL-NL"],defaultOptions={style:{base:{color:"black",fontSize:"18px"},autofill:{backgroundColor:"yellow"},hover:{color:"blue"},focus:{color:"blue"},valid:{color:"green"},invalid:{color:"red"},placeholder:{base:{color:"gray"},focus:{border:"solid 1px blue"}}}};export function CheckoutComPayment({publicKey,options=defaultOptions,locale="EN-GB",...p}){const ref=useRef(null),loaded=useExternalScript(scriptUrl),{setPaymentRef,currentPaymentMethodType,paymentSource,setPaymentSource,setPaymentMethodErrors}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),{containerClassName,templateCustomerSaveToWallet,successUrl=window.location.href,failureUrl=window.location.href,show,...divProps}=p,handleSubmit=async()=>{const savePaymentSourceToCustomerWallet=ref?.current?.elements?.save_payment_source_to_customer_wallet?.checked;if(savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),window.Frames){window.Frames.cardholder={name:order?.billing_address?.full_name,billingAddress:{addressLine1:order?.billing_address?.line_1,addressLine2:order?.billing_address?.line_2??"",zip:order?.billing_address?.zip_code??"",city:order?.billing_address?.city,state:order?.billing_address?.state_code,country:order?.billing_address?.country_code},phone:order?.billing_address?.phone};try{const data=await window.Frames.submitCard();if(data.token&&paymentSource&&currentPaymentMethodType){const ps=await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{token:data.token,payment_type:"token",success_url:successUrl,failure_url:failureUrl,_authorize:!0}});ps?.redirect_uri&&(window.location.href=ps.redirect_uri)}}catch(error){console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error?.message}])}}return!1},lang=`${locale.toUpperCase()}-${locale.toUpperCase()}`,localization=systemLanguages.includes(lang)?lang:"EN-GB";return loaded&&show?_jsxs("form",{ref,children:[_jsx("div",{className:containerClassName,...divProps,children:_jsxs(Frames,{config:{debug:!0,publicKey,localization,...options},cardValidationChanged:e=>{e.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(),setPaymentRef({ref}))},cardTokenized:data=>data,children:[_jsx(CardNumber,{}),_jsx(ExpiryDate,{}),_jsx(Cvv,{})]})}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]}):null}export default CheckoutComPayment;
2
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useRef}from"react";import useExternalScript from"../../utils/hooks/useExternalScript";import PaymentMethodContext from"../../context/PaymentMethodContext";import{Frames,CardNumber,ExpiryDate,Cvv}from"frames-react";import OrderContext from"../../context/OrderContext";import Parent from"../utils/Parent";import{setCustomerOrderParam}from"../../utils/localStorage";const scriptUrl="https://cdn.checkout.com/js/framesv2.min.js",systemLanguages=["DE-DE","EN-GB","ES-ES","FR-FR","IT-IT","KO-KR","NL-NL"],defaultOptions={style:{base:{color:"black",fontSize:"18px"},autofill:{backgroundColor:"yellow"},hover:{color:"blue"},focus:{color:"blue"},valid:{color:"green"},invalid:{color:"red"},placeholder:{base:{color:"gray"},focus:{border:"solid 1px blue"}}}};export function CheckoutComPayment({publicKey,options=defaultOptions,locale="EN-GB",...p}){const ref=useRef(null),loaded=useExternalScript(scriptUrl),{setPaymentRef,currentPaymentMethodType,paymentSource,setPaymentSource,setPaymentMethodErrors}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),{containerClassName,templateCustomerSaveToWallet,successUrl=window.location.href,failureUrl=window.location.href,show,...divProps}=p,handleSubmit=async()=>{const savePaymentSourceToCustomerWallet=ref?.current?.elements?.save_payment_source_to_customer_wallet?.checked;if(savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),window.Frames){window.Frames.cardholder={name:order?.billing_address?.full_name,billingAddress:{addressLine1:order?.billing_address?.line_1,addressLine2:order?.billing_address?.line_2??"",zip:order?.billing_address?.zip_code??"",city:order?.billing_address?.city,state:order?.billing_address?.state_code,country:order?.billing_address?.country_code},phone:order?.billing_address?.phone};try{const data=await window.Frames.submitCard();if(data.token&&paymentSource&&currentPaymentMethodType){const ps=await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{token:data.token,payment_type:"token",success_url:successUrl,failure_url:failureUrl,_authorize:!0}});ps?.redirect_uri&&(window.location.href=ps.redirect_uri)}}catch(error){console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error?.message}])}}return!1},lang=`${locale.toUpperCase()}-${locale.toUpperCase()}`,localization=systemLanguages.includes(lang)?lang:"EN-GB";return loaded&&show?_jsxs("form",{ref,children:[_jsx("div",{className:containerClassName,...divProps,children:_jsxs(Frames,{config:{debug:!0,publicKey,localization,...options},cardValidationChanged:e=>{e.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(),setPaymentRef({ref}))},cardTokenized:data=>data,children:[_jsx(CardNumber,{}),_jsx(ExpiryDate,{}),_jsx(Cvv,{})]})}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]}):null}export default CheckoutComPayment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { StripeElementLocale } from '@stripe/stripe-js';
4
3
  import { type PaymentSourceProps } from './PaymentSource';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
2
  import { type PaymentSourceProps } from './PaymentSource';
4
3
  type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LoaderType } from '../../typings/index';
3
2
  import { type CustomerCardsTemplateChildren } from '../utils/PaymentCardsTemplate';
4
3
  export interface CustomerCardsProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface CustomComponent extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ChildrenFunction } from '../../typings/index';
3
2
  export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  clientSecret: string;
4
3
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type StripeElementLocale, type StripeElementsOptions, type StripePaymentElementOptions } from '@stripe/stripe-js';
3
2
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
3
  import { type PaymentSourceProps } from './PaymentSource';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface WireTransferConfig {
3
2
  infoMessage?: {
4
3
  text?: string | JSX.Element[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type Price as PriceType } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction, type LoaderType } from '../../typings/index';
4
3
  interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LoaderType } from '../../typings/index';
3
2
  import { type QueryPageSize } from '@commercelayer/sdk';
4
3
  interface Props {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type Shipment } from '@commercelayer/sdk';
3
2
  type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
4
3
  shipment: Shipment;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { Shipment } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ShippingMethod } from '@commercelayer/sdk';
3
2
  type ChildrenProps = Omit<Props, 'children'> & {
4
3
  label: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  type Props = BaseAmountComponent & {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Order, ShippingMethod } from '@commercelayer/sdk';
3
2
  interface ShippingMethodRadioButtonType extends Omit<Props, 'children'> {
4
3
  shippingMethod: ShippingMethod;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TimeFormat, type ChildrenFunction } from '../../typings/index';
3
2
  import { type DeliveryLeadTime } from '../../reducers/AvailabilityReducer';
4
3
  interface AvailabilityTemplateChildrenProps extends Omit<Props, 'children'>, DeliveryLeadTime {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type DeliveryLeadTimeField = 'min_hours' | 'max_hours' | 'min_days' | 'max_days';
3
2
  export type DeliveryLeadTimeComponentChildren = Omit<Props, 'children'>;
4
3
  type Props = Partial<JSX.IntrinsicElements['span']> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type SkuFieldChildrenProps = TGenericChildrenProps<TResources['Sku']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;