@adyen/adyen-web 6.6.0 → 6.8.0

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 (295) hide show
  1. package/dist/cjs/adyen.css +45 -45
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +224 -141
  6. package/dist/es/adyen.css +45 -45
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/ANCV.js +1 -1
  9. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  10. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +1 -1
  11. package/dist/es/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  12. package/dist/es/components/Ach/components/AchInput/defaultStyles.js.map +1 -1
  13. package/dist/es/components/AfterPay/AfterPayB2B.js.map +1 -1
  14. package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
  15. package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  16. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  17. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  18. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  19. package/dist/es/components/Boleto/Boleto.js.map +1 -1
  20. package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  21. package/dist/es/components/Card/Card.js.map +1 -1
  22. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  23. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  24. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  25. package/dist/es/components/Card/components/CardInput/handlers.js.map +1 -1
  26. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  27. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  28. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  29. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  30. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  31. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  32. package/dist/es/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  33. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  34. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  35. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  36. package/dist/es/components/Dropin/components/PaymentMethod/useBrandLogoConfiguration.js.map +1 -1
  37. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  38. package/dist/es/components/Dropin/elements/getComponentConfiguration.js.map +1 -1
  39. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  40. package/dist/es/components/Giftcard/Giftcard.js +1 -1
  41. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  42. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  43. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  44. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  45. package/dist/es/components/GooglePay/requests.js.map +1 -1
  46. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  47. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  48. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  49. package/dist/es/components/MBWay/MBWay.js.map +1 -1
  50. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  51. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  52. package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
  53. package/dist/es/components/PayPal/utils/get-paypal-styles.js.map +1 -1
  54. package/dist/es/components/Pix/Pix.js.map +1 -1
  55. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  56. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  57. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  58. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  59. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  60. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  61. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  62. package/dist/es/components/Twint/Twint.js.map +1 -1
  63. package/dist/es/components/UPI/UPI.js.map +1 -1
  64. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  65. package/dist/es/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  66. package/dist/es/components/internal/Address/Address.js.map +1 -1
  67. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  68. package/dist/es/components/internal/Button/Button.js.map +1 -1
  69. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js +1 -1
  70. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  71. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  72. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  73. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
  74. package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  75. package/dist/es/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
  76. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  77. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  78. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  79. package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
  80. package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
  81. package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
  82. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  83. package/dist/es/components/internal/OpenInvoice/utils.js.map +1 -1
  84. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  85. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  86. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  87. package/dist/es/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  88. package/dist/es/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  89. package/dist/es/components/internal/SecuredFields/lib/CSF/AbstractCSF.js.map +1 -1
  90. package/dist/es/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  91. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  92. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  93. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  94. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  95. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  96. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/handleBinValue.js.map +1 -1
  97. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/handleFocus.js.map +1 -1
  98. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/handleIframeConfigFeedback.js.map +1 -1
  99. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
  100. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.js.map +1 -1
  101. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.js.map +1 -1
  102. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  103. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/validateForm.js.map +1 -1
  104. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/callbackUtils.js.map +1 -1
  105. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/destroySecuredFields.js.map +1 -1
  106. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/processErrors.js.map +1 -1
  107. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  108. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  109. package/dist/es/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  110. package/dist/es/components/internal/SecuredFields/lib/utilities/addContextTranslations.js.map +1 -1
  111. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  112. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  113. package/dist/es/components/internal/UIElement/utils.js.map +1 -1
  114. package/dist/es/components/internal/Voucher/utils.js.map +1 -1
  115. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  116. package/dist/es/core/Analytics/constants.js.map +1 -1
  117. package/dist/es/core/Analytics/utils.js.map +1 -1
  118. package/dist/es/core/Errors/AdyenCheckoutError.js +1 -1
  119. package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
  120. package/dist/es/core/Errors/SRMessages.js.map +1 -1
  121. package/dist/es/core/Errors/constants.js.map +1 -1
  122. package/dist/es/core/Errors/utils.js.map +1 -1
  123. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  124. package/dist/es/core/Services/http.js +1 -1
  125. package/dist/es/core/Services/http.js.map +1 -1
  126. package/dist/es/core/Services/sessions/constants.js +1 -1
  127. package/dist/es/core/Services/sessions/constants.js.map +1 -1
  128. package/dist/es/core/Services/sessions/create-order.js +1 -1
  129. package/dist/es/core/Services/sessions/create-order.js.map +1 -1
  130. package/dist/es/core/Services/sessions/make-payment.js +1 -1
  131. package/dist/es/core/Services/sessions/make-payment.js.map +1 -1
  132. package/dist/es/core/Services/sessions/setup-session.js.map +1 -1
  133. package/dist/es/core/Services/sessions/submit-details.js +1 -1
  134. package/dist/es/core/Services/sessions/submit-details.js.map +1 -1
  135. package/dist/es/core/core.js +1 -1
  136. package/dist/es/core/core.registry.js.map +1 -1
  137. package/dist/es/core/utils.js.map +1 -1
  138. package/dist/es/external/classnames/index.js.map +1 -1
  139. package/dist/es/external/preact/dist/preact.js +1 -1
  140. package/dist/es/external/preact/dist/preact.js.map +1 -1
  141. package/dist/es/index.d.ts +224 -141
  142. package/dist/es/language/Language.js.map +1 -1
  143. package/dist/es/language/utils.js.map +1 -1
  144. package/dist/es/utils/Storage.js.map +1 -1
  145. package/dist/es/utils/commonUtils.js.map +1 -1
  146. package/dist/es/utils/get-process-message-handler.js.map +1 -1
  147. package/dist/es/utils/getOrigin.js.map +1 -1
  148. package/dist/es/utils/useForm/reducer.js.map +1 -1
  149. package/dist/es/utils/useForm/useForm.js.map +1 -1
  150. package/dist/es-legacy/adyen.css +45 -45
  151. package/dist/es-legacy/adyen.css.map +1 -1
  152. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  153. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  154. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  155. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  156. package/dist/es-legacy/components/Ach/components/AchInput/defaultStyles.js.map +1 -1
  157. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  158. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  159. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  160. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  161. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  162. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  163. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  164. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  165. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  166. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  167. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  168. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  169. package/dist/es-legacy/components/Card/components/CardInput/handlers.js.map +1 -1
  170. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  171. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  172. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  173. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  174. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  175. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  176. package/dist/es-legacy/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  177. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  178. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  179. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  180. package/dist/es-legacy/components/Dropin/components/PaymentMethod/useBrandLogoConfiguration.js.map +1 -1
  181. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  182. package/dist/es-legacy/components/Dropin/elements/getComponentConfiguration.js.map +1 -1
  183. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  184. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  185. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  186. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  187. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  188. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  189. package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
  190. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  191. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  192. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  193. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  194. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  195. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  196. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
  197. package/dist/es-legacy/components/PayPal/utils/get-paypal-styles.js.map +1 -1
  198. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  199. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  200. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  201. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  202. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  203. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  204. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  205. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  206. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  207. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  208. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  209. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  210. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  211. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  212. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  213. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js +1 -1
  214. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.js.map +1 -1
  215. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  216. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  217. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js +1 -1
  218. package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.js.map +1 -1
  219. package/dist/es-legacy/components/internal/ClickToPay/context/ClickToPayProvider.js.map +1 -1
  220. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  221. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  222. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  223. package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
  224. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  225. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  226. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  227. package/dist/es-legacy/components/internal/OpenInvoice/utils.js.map +1 -1
  228. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  229. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  230. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  231. package/dist/es-legacy/components/internal/SecuredFields/SFP/defaultProps.js.map +1 -1
  232. package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
  233. package/dist/es-legacy/components/internal/SecuredFields/binLookup/triggerBinLookUp.js.map +1 -1
  234. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/AbstractCSF.js.map +1 -1
  235. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/CSF.js.map +1 -1
  236. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  237. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  238. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  239. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  240. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  241. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/handleBinValue.js.map +1 -1
  242. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/handleFocus.js.map +1 -1
  243. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/handleIframeConfigFeedback.js.map +1 -1
  244. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/isConfigured.js.map +1 -1
  245. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.js.map +1 -1
  246. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.js.map +1 -1
  247. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  248. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/validateForm.js.map +1 -1
  249. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/callbackUtils.js.map +1 -1
  250. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/destroySecuredFields.js.map +1 -1
  251. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/processErrors.js.map +1 -1
  252. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  253. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  254. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.js.map +1 -1
  255. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/addContextTranslations.js.map +1 -1
  256. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  257. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  258. package/dist/es-legacy/components/internal/UIElement/utils.js.map +1 -1
  259. package/dist/es-legacy/components/internal/Voucher/utils.js.map +1 -1
  260. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  261. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  262. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  263. package/dist/es-legacy/core/Errors/AdyenCheckoutError.js +1 -1
  264. package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
  265. package/dist/es-legacy/core/Errors/SRMessages.js.map +1 -1
  266. package/dist/es-legacy/core/Errors/constants.js.map +1 -1
  267. package/dist/es-legacy/core/Errors/utils.js.map +1 -1
  268. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  269. package/dist/es-legacy/core/Services/http.js +1 -1
  270. package/dist/es-legacy/core/Services/http.js.map +1 -1
  271. package/dist/es-legacy/core/Services/sessions/constants.js +1 -1
  272. package/dist/es-legacy/core/Services/sessions/constants.js.map +1 -1
  273. package/dist/es-legacy/core/Services/sessions/create-order.js +1 -1
  274. package/dist/es-legacy/core/Services/sessions/create-order.js.map +1 -1
  275. package/dist/es-legacy/core/Services/sessions/make-payment.js +1 -1
  276. package/dist/es-legacy/core/Services/sessions/make-payment.js.map +1 -1
  277. package/dist/es-legacy/core/Services/sessions/setup-session.js.map +1 -1
  278. package/dist/es-legacy/core/Services/sessions/submit-details.js +1 -1
  279. package/dist/es-legacy/core/Services/sessions/submit-details.js.map +1 -1
  280. package/dist/es-legacy/core/core.js +1 -1
  281. package/dist/es-legacy/core/core.registry.js.map +1 -1
  282. package/dist/es-legacy/core/utils.js.map +1 -1
  283. package/dist/es-legacy/external/classnames/index.js.map +1 -1
  284. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  285. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  286. package/dist/es-legacy/language/Language.js.map +1 -1
  287. package/dist/es-legacy/language/utils.js.map +1 -1
  288. package/dist/es-legacy/utils/Storage.js.map +1 -1
  289. package/dist/es-legacy/utils/commonUtils.js.map +1 -1
  290. package/dist/es-legacy/utils/get-process-message-handler.js.map +1 -1
  291. package/dist/es-legacy/utils/getOrigin.js.map +1 -1
  292. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  293. package/dist/es-legacy/utils/useForm/useForm.js.map +1 -1
  294. package/package.json +22 -22
  295. package/styles/adyen.css +45 -45
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/core/Analytics/constants.ts"],"sourcesContent":["import {\n BOLETO_SOCIAL_SECURITY_NUMBER_INVALID,\n CREDITCARD_HOLDER_NAME_INVALID,\n CREDITCARD_TAX_NUMBER_INVALID,\n ERROR_FIELD_REQUIRED,\n ERROR_INVALID_FORMAT_EXPECTS\n} from '../Errors/constants';\n\nexport const ANALYTICS_PATH = 'v3/analytics';\n\nexport const ANALYTICS_INFO_TIMER_INTERVAL = process.env.NODE_ENV === 'development' ? 5000 : 10000;\n\nexport const ANALYTICS_SEARCH_DEBOUNCE_TIME = 3000;\n\nexport const ANALYTICS_EVENT = {\n log: 'log',\n error: 'error',\n info: 'info'\n};\n\nexport const ANALYTICS_ERROR_TYPE = {\n network: 'Network',\n implementation: 'ImplementationError',\n internal: 'Internal',\n apiError: 'ApiError',\n sdkError: 'SdkError',\n thirdParty: 'ThirdParty',\n generic: 'Generic',\n redirect: 'Redirect',\n threeDS2: 'ThreeDS2'\n};\n\nexport const ANALYTICS_ERROR_CODE = {\n redirect: '600'\n};\n\nexport const ANALYTICS_ACTION_STR = 'action';\nexport const ANALYTICS_SUBMIT_STR = 'submit';\nexport const ANALYTICS_SELECTED_STR = 'selected';\nexport const ANALYTICS_RENDERED_STR = 'rendered';\nexport const ANALYTICS_DISPLAYED_STR = 'displayed';\nexport const ANALYTICS_INPUT_STR = 'input';\n\nexport const ANALYTICS_DOWNLOAD_STR = 'download';\n\nexport const ANALYTICS_VALIDATION_ERROR_STR = 'validationError';\n\nexport const ANALYTICS_FOCUS_STR = 'focus';\nexport const ANALYTICS_UNFOCUS_STR = 'unfocus';\n\nexport const ANALYTICS_CONFIGURED_STR = 'configured';\n\nexport const ANALYTICS_QR_CODE_DOWNLOAD = 'qr_download_button';\n\nexport const ANALYTICS_INSTANT_PAYMENT_BUTTON = 'instant_payment_button';\nexport const ANALYTICS_FEATURED_ISSUER = 'featured_issuer';\nexport const ANALYTICS_LIST = 'list';\nexport const ANALYTICS_LIST_SEARCH = 'list_search';\n\nexport enum Analytics3DS2Errors {\n ACTION_IS_MISSING_PAYMENT_DATA = '700', // Missing 'paymentData' property from threeDS2 action\n ACTION_IS_MISSING_TOKEN = '701', // Missing 'token' property from threeDS2 action\n TOKEN_IS_MISSING_THREEDSMETHODURL = '702', // Decoded token is missing a valid threeDSMethodURL property\n\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n TOKEN_DECODE_OR_PARSING_FAILED = '704', // token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token')\n THREEDS2_TIMEOUT = '705', // 3DS2 process has timed out\n\n TOKEN_IS_MISSING_ACSURL = '800', // Decoded token is missing a valid acsURL property\n NO_TRANSSTATUS = '801', // Challenge has resulted in an error (no transStatus could be retrieved by the backend)\n NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802', // callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object\n NO_COMPONENT_FOR_ACTION = '803', // callSubmit3DS2Fingerprint cannot find a component to handle the action response\n NO_ACTION_FOR_CHALLENGE = '804', // callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object\n CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = '805' // The challenge process has happened, an object has been returned, parsed & accepted as legit, but the result prop on that object is either missing or doesn't have a transStatus prop\n}\n\nexport enum Analytics3DS2Events {\n FINGERPRINT_DATA_SENT = 'fingerprintDataSentWeb',\n FINGERPRINT_IFRAME_LOADED = 'fingerprintIframeLoaded',\n FINGERPRINT_COMPLETED = 'fingerprintCompleted',\n CHALLENGE_DATA_SENT = 'challengeDataSentWeb',\n CHALLENGE_IFRAME_LOADED = 'challengeIframeLoaded',\n CHALLENGE_COMPLETED = 'challengeCompleted'\n}\n\n/**\n * Function to map errorCodes based on translation keys to the codes expected by the analytics endpoint\n */\nexport const errorCodeMapping: Record<string, string> = {\n [CREDITCARD_HOLDER_NAME_INVALID]: '925',\n [CREDITCARD_TAX_NUMBER_INVALID]: '942',\n //\n [BOLETO_SOCIAL_SECURITY_NUMBER_INVALID]: '926',\n //\n [`${ERROR_FIELD_REQUIRED}.country`]: '930',\n [`${ERROR_FIELD_REQUIRED}.street`]: '931',\n [`${ERROR_FIELD_REQUIRED}.house_number_or_name`]: '932',\n [`${ERROR_FIELD_REQUIRED}.postal_code`]: '933',\n [`${ERROR_FIELD_REQUIRED}.city`]: '935',\n [`${ERROR_FIELD_REQUIRED}.state_or_province`]: '936',\n //\n [`${ERROR_INVALID_FORMAT_EXPECTS}.postal_code`]: '934'\n //\n};\n\nexport const ANALYTICS_EXPRESS_PAGES_ARRAY = ['cart', 'minicart', 'pdp', 'checkout'];\n\nexport const ALLOWED_ANALYTICS_DATA = ['applicationInfo', 'checkoutAttemptId'];\n\nexport const NO_CHECKOUT_ATTEMPT_ID = 'fetch-checkoutAttemptId-failed';\n\nexport const ANALYTIC_LEVEL = {\n all: 'all',\n initial: 'initial'\n};\n"],"names":["ANALYTICS_PATH","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_SEARCH_DEBOUNCE_TIME","ANALYTICS_EVENT","log","error","info","ANALYTICS_ERROR_TYPE","network","implementation","internal","apiError","sdkError","thirdParty","generic","redirect","threeDS2","ANALYTICS_ERROR_CODE","ANALYTICS_ACTION_STR","ANALYTICS_SUBMIT_STR","ANALYTICS_SELECTED_STR","ANALYTICS_RENDERED_STR","ANALYTICS_DISPLAYED_STR","ANALYTICS_INPUT_STR","ANALYTICS_DOWNLOAD_STR","ANALYTICS_VALIDATION_ERROR_STR","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","ANALYTICS_CONFIGURED_STR","ANALYTICS_QR_CODE_DOWNLOAD","ANALYTICS_INSTANT_PAYMENT_BUTTON","ANALYTICS_FEATURED_ISSUER","ANALYTICS_LIST","ANALYTICS_LIST_SEARCH","Analytics3DS2Errors","Analytics3DS2Events","errorCodeMapping","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","ANALYTICS_EXPRESS_PAGES_ARRAY","ALLOWED_ANALYTICS_DATA","NO_CHECKOUT_ATTEMPT_ID","ANALYTIC_LEVEL","all","initial"],"mappings":"kNAQO,MAAMA,EAAiB,eAEjBC,EAAgF,IAEhFC,EAAiC,IAEjCC,EAAkB,CAC3BC,IAAK,MACLC,MAAO,QACPC,KAAM,QAGGC,EAAuB,CAChCC,QAAS,UACTC,eAAgB,sBAChBC,SAAU,WACVC,SAAU,WACVC,SAAU,WACVC,WAAY,aACZC,QAAS,UACTC,SAAU,WACVC,SAAU,YAGDC,EAAuB,CAChCF,SAAU,OAGDG,EAAuB,SACvBC,EAAuB,SACvBC,EAAyB,WACzBC,EAAyB,WACzBC,EAA0B,YAC1BC,EAAsB,QAEtBC,EAAyB,WAEzBC,EAAiC,kBAEjCC,EAAsB,QACtBC,EAAwB,UAExBC,EAA2B,aAE3BC,EAA6B,qBAE7BC,EAAmC,yBACnCC,EAA4B,kBAC5BC,EAAiB,OACjBC,EAAwB,cAE9B,IAAAC,EAAKA,SAAAA,GAAAA,wHASPA,EAAA,6BAAA,2RATOA,CAqBX,CArBWA,CAqBX,IAEMC,EAAKA,SAAAA,GAAAA,uSAAAA,CAOX,CAPWA,CAOX,UAKYC,EAA2C,CACpDC,CAACA,GAAiC,MAClCC,CAACA,GAAgC,MAEjCC,CAACA,GAAwC,MAEzC,CAAC,GAAGC,aAAiC,MACrC,CAAC,GAAGA,YAAgC,MACpC,CAAC,GAAGA,0BAA8C,MAClD,CAAC,GAAGA,iBAAqC,MACzC,CAAC,GAAGA,UAA8B,MAClC,CAAC,GAAGA,uBAA2C,MAE/C,CAAC,GAAGC,iBAA6C,OAIxCC,EAAgC,CAAC,OAAQ,WAAY,MAAO,YAE5DC,EAAyB,CAAC,kBAAmB,qBAE7CC,EAAyB,iCAEzBC,EAAiB,CAC1BC,IAAK,MACLC,QAAS"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/core/Analytics/constants.ts"],"sourcesContent":["import {\n BOLETO_SOCIAL_SECURITY_NUMBER_INVALID,\n CREDITCARD_HOLDER_NAME_INVALID,\n CREDITCARD_TAX_NUMBER_INVALID,\n ERROR_FIELD_REQUIRED,\n ERROR_INVALID_FORMAT_EXPECTS\n} from '../Errors/constants';\n\nexport const ANALYTICS_PATH = 'v3/analytics';\n\nexport const ANALYTICS_INFO_TIMER_INTERVAL = process.env.NODE_ENV === 'development' ? 5000 : 10000;\n\nexport const ANALYTICS_SEARCH_DEBOUNCE_TIME = 3000;\n\nexport const ANALYTICS_EVENT = {\n log: 'log',\n error: 'error',\n info: 'info'\n};\n\nexport const ANALYTICS_ERROR_TYPE = {\n network: 'Network',\n implementation: 'ImplementationError',\n internal: 'Internal',\n apiError: 'ApiError',\n sdkError: 'SdkError',\n thirdParty: 'ThirdParty',\n generic: 'Generic',\n redirect: 'Redirect',\n threeDS2: 'ThreeDS2'\n};\n\nexport const ANALYTICS_ERROR_CODE = {\n redirect: '600'\n};\n\nexport const ANALYTICS_ACTION_STR = 'action';\nexport const ANALYTICS_SUBMIT_STR = 'submit';\nexport const ANALYTICS_SELECTED_STR = 'selected';\nexport const ANALYTICS_RENDERED_STR = 'rendered';\nexport const ANALYTICS_DISPLAYED_STR = 'displayed';\nexport const ANALYTICS_INPUT_STR = 'input';\n\nexport const ANALYTICS_DOWNLOAD_STR = 'download';\n\nexport const ANALYTICS_VALIDATION_ERROR_STR = 'validationError';\n\nexport const ANALYTICS_FOCUS_STR = 'focus';\nexport const ANALYTICS_UNFOCUS_STR = 'unfocus';\n\nexport const ANALYTICS_CONFIGURED_STR = 'configured';\n\nexport const ANALYTICS_QR_CODE_DOWNLOAD = 'qr_download_button';\n\nexport const ANALYTICS_INSTANT_PAYMENT_BUTTON = 'instant_payment_button';\nexport const ANALYTICS_FEATURED_ISSUER = 'featured_issuer';\nexport const ANALYTICS_LIST = 'list';\nexport const ANALYTICS_LIST_SEARCH = 'list_search';\n\nexport enum Analytics3DS2Errors {\n ACTION_IS_MISSING_PAYMENT_DATA = '700', // Missing 'paymentData' property from threeDS2 action\n ACTION_IS_MISSING_TOKEN = '701', // Missing 'token' property from threeDS2 action\n TOKEN_IS_MISSING_THREEDSMETHODURL = '702', // Decoded token is missing a valid threeDSMethodURL property\n\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n TOKEN_DECODE_OR_PARSING_FAILED = '704', // token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token')\n THREEDS2_TIMEOUT = '705', // 3DS2 process has timed out\n\n TOKEN_IS_MISSING_ACSURL = '800', // Decoded token is missing a valid acsURL property\n NO_TRANSSTATUS = '801', // Challenge has resulted in an error (no transStatus could be retrieved by the backend)\n NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802', // callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object\n NO_COMPONENT_FOR_ACTION = '803', // callSubmit3DS2Fingerprint cannot find a component to handle the action response\n NO_ACTION_FOR_CHALLENGE = '804', // callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object\n CHALLENGE_RESOLVED_WITHOUT_RESULT_PROP = '805' // The challenge process has happened, an object has been returned, parsed & accepted as legit, but the result prop on that object is either missing or doesn't have a transStatus prop\n}\n\nexport enum Analytics3DS2Events {\n FINGERPRINT_DATA_SENT = 'fingerprintDataSentWeb',\n FINGERPRINT_IFRAME_LOADED = 'fingerprintIframeLoaded',\n FINGERPRINT_COMPLETED = 'fingerprintCompleted',\n CHALLENGE_DATA_SENT = 'challengeDataSentWeb',\n CHALLENGE_IFRAME_LOADED = 'challengeIframeLoaded',\n CHALLENGE_COMPLETED = 'challengeCompleted'\n}\n\n/**\n * Function to map errorCodes based on translation keys to the codes expected by the analytics endpoint\n */\nexport const errorCodeMapping: Record<string, string> = {\n [CREDITCARD_HOLDER_NAME_INVALID]: '925',\n [CREDITCARD_TAX_NUMBER_INVALID]: '942',\n //\n [BOLETO_SOCIAL_SECURITY_NUMBER_INVALID]: '926',\n //\n [`${ERROR_FIELD_REQUIRED}.country`]: '930',\n [`${ERROR_FIELD_REQUIRED}.street`]: '931',\n [`${ERROR_FIELD_REQUIRED}.house_number_or_name`]: '932',\n [`${ERROR_FIELD_REQUIRED}.postal_code`]: '933',\n [`${ERROR_FIELD_REQUIRED}.city`]: '935',\n [`${ERROR_FIELD_REQUIRED}.state_or_province`]: '936',\n //\n [`${ERROR_INVALID_FORMAT_EXPECTS}.postal_code`]: '934'\n //\n};\n\nexport const ANALYTICS_EXPRESS_PAGES_ARRAY = ['cart', 'minicart', 'pdp', 'checkout'];\n\nexport const ALLOWED_ANALYTICS_DATA = ['applicationInfo', 'checkoutAttemptId'];\n\nexport const NO_CHECKOUT_ATTEMPT_ID = 'fetch-checkoutAttemptId-failed';\n\nexport const ANALYTIC_LEVEL = {\n all: 'all',\n initial: 'initial'\n};\n"],"names":["ANALYTICS_PATH","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_SEARCH_DEBOUNCE_TIME","ANALYTICS_EVENT","log","error","info","ANALYTICS_ERROR_TYPE","network","implementation","internal","apiError","sdkError","thirdParty","generic","redirect","threeDS2","ANALYTICS_ERROR_CODE","ANALYTICS_ACTION_STR","ANALYTICS_SUBMIT_STR","ANALYTICS_SELECTED_STR","ANALYTICS_RENDERED_STR","ANALYTICS_DISPLAYED_STR","ANALYTICS_INPUT_STR","ANALYTICS_DOWNLOAD_STR","ANALYTICS_VALIDATION_ERROR_STR","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","ANALYTICS_CONFIGURED_STR","ANALYTICS_QR_CODE_DOWNLOAD","ANALYTICS_INSTANT_PAYMENT_BUTTON","ANALYTICS_FEATURED_ISSUER","ANALYTICS_LIST","ANALYTICS_LIST_SEARCH","Analytics3DS2Errors","Analytics3DS2Events","errorCodeMapping","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","ANALYTICS_EXPRESS_PAGES_ARRAY","ALLOWED_ANALYTICS_DATA","NO_CHECKOUT_ATTEMPT_ID","ANALYTIC_LEVEL","all","initial"],"mappings":"kNAQO,MAAMA,EAAiB,eAEjBC,EAAgF,IAEhFC,EAAiC,IAEjCC,EAAkB,CAC3BC,IAAK,MACLC,MAAO,QACPC,KAAM,QAGGC,EAAuB,CAChCC,QAAS,UACTC,eAAgB,sBAChBC,SAAU,WACVC,SAAU,WACVC,SAAU,WACVC,WAAY,aACZC,QAAS,UACTC,SAAU,WACVC,SAAU,YAGDC,EAAuB,CAChCF,SAAU,OAGDG,EAAuB,SACvBC,EAAuB,SACvBC,EAAyB,WACzBC,EAAyB,WACzBC,EAA0B,YAC1BC,EAAsB,QAEtBC,EAAyB,WAEzBC,EAAiC,kBAEjCC,EAAsB,QACtBC,EAAwB,UAExBC,EAA2B,aAE3BC,EAA6B,qBAE7BC,EAAmC,yBACnCC,EAA4B,kBAC5BC,EAAiB,OACjBC,EAAwB,cAE9B,IAAAC,EAAKA,SAAAA,GAAAA,wHASPA,EAAA,6BAAA,2RATOA,CAqBX,CArBWA,CAqBX,CAAA,GAEMC,EAAKA,SAAAA,GAAAA,uSAAAA,CAOX,CAPWA,CAOX,CAAA,SAKYC,EAA2C,CACpDC,CAACA,GAAiC,MAClCC,CAACA,GAAgC,MAEjCC,CAACA,GAAwC,MAEzC,CAAC,GAAGC,aAAiC,MACrC,CAAC,GAAGA,YAAgC,MACpC,CAAC,GAAGA,0BAA8C,MAClD,CAAC,GAAGA,iBAAqC,MACzC,CAAC,GAAGA,UAA8B,MAClC,CAAC,GAAGA,uBAA2C,MAE/C,CAAC,GAAGC,iBAA6C,OAIxCC,EAAgC,CAAC,OAAQ,WAAY,MAAO,YAE5DC,EAAyB,CAAC,kBAAmB,qBAE7CC,EAAyB,iCAEzBC,EAAiB,CAC1BC,IAAK,MACLC,QAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/core/Analytics/utils.ts"],"sourcesContent":["import { AnalyticsObject, CreateAnalyticsObject, CardConfigData, AnalyticsData } from './types';\nimport { ANALYTICS_ACTION_STR, ANALYTICS_VALIDATION_ERROR_STR, errorCodeMapping, ALLOWED_ANALYTICS_DATA } from './constants';\nimport uuid from '../../utils/uuid';\nimport { digitsOnlyFormatter } from '../../utils/Formatters/formatters';\nimport { ERROR_FIELD_REQUIRED, ERROR_INVALID_FORMAT_EXPECTS } from '../Errors/constants';\nimport { DEFAULT_CHALLENGE_WINDOW_SIZE, THREEDS2_FULL } from '../../components/ThreeDS2/constants';\nimport { CardConfiguration } from '../../components/Card/types';\nimport CardInputDefaultProps from '../../components/Card/components/CardInput/defaultProps';\nimport { DEFAULT_CARD_GROUP_TYPES } from '../../components/internal/SecuredFields/lib/constants';\nimport { notFalsy } from '../../utils/commonUtils';\n\nconst MAX_LENGTH = 128;\nexport const getUTCTimestamp = () => Date.now();\n\n/**\n * All objects for the /checkoutanalytics endpoint have base props:\n * \"timestamp\" & \"component\"\n *\n * Error objects have, in addition to the base props:\n * \"code\", \"errorType\" & \"message\"\n *\n * Log objects have, in addition to the base props:\n * \"message\" & \"type\" &\n * \"subtype\" (e.g. when an action is handled)\n *\n * Info objects have, in addition to the base props:\n * \"type\" & \"target\" &\n * \"isStoredPaymentMethod\" & \"brand\" (when a storedCard is \"selected\"), or,\n * \"validationErrorCode\" & \"validationErrorMessage\" (when the event is describing a validation error)\n *\n * All objects can also have a \"metadata\" object of key-value pairs\n */\nexport const createAnalyticsObject = (aObj: CreateAnalyticsObject): AnalyticsObject => ({\n timestamp: String(getUTCTimestamp()),\n component: aObj.component,\n id: uuid(),\n /** ERROR */\n ...(aObj.event === 'error' && { code: aObj.code, errorType: aObj.errorType, message: aObj.message }), // error event\n /** LOG */\n ...(aObj.event === 'log' && { type: aObj.type, message: aObj.message }), // log event\n ...(aObj.event === 'log' && (aObj.type === ANALYTICS_ACTION_STR || aObj.type === THREEDS2_FULL) && { subType: aObj.subtype }), // only added if we have a log event of Action type or ThreeDS2\n ...(aObj.event === 'log' && aObj.type === THREEDS2_FULL && { result: aObj.result }), // only added if we have a log event of ThreeDS2 type\n /** INFO */\n ...(aObj.event === 'info' && { type: aObj.type, target: aObj.target }), // info event\n ...(aObj.event === 'info' && aObj.issuer && { issuer: aObj.issuer }), // relates to issuerLists\n ...(aObj.event === 'info' && { isExpress: aObj.isExpress, expressPage: aObj.expressPage }), // relates to Plugins & detecting Express PMs\n ...(aObj.event === 'info' && aObj.isStoredPaymentMethod && { isStoredPaymentMethod: aObj.isStoredPaymentMethod, brand: aObj.brand }), // only added if we have an info event about a storedPM\n ...(aObj.event === 'info' &&\n aObj.type === ANALYTICS_VALIDATION_ERROR_STR && {\n validationErrorCode: mapErrorCodesForAnalytics(aObj.validationErrorCode, aObj.target),\n validationErrorMessage: aObj.validationErrorMessage\n }), // only added if we have an info event describing a validation error\n ...(aObj.configData && { configData: aObj.configData }),\n /** All */\n ...(aObj.metadata && { metadata: aObj.metadata })\n});\n\nconst mapErrorCodesForAnalytics = (errorCode: string, target: string) => {\n // Some of the more generic error codes required combination with target to retrieve a specific code\n if (errorCode === ERROR_FIELD_REQUIRED || errorCode === ERROR_INVALID_FORMAT_EXPECTS) {\n return errorCodeMapping[`${errorCode}.${target}`] ?? errorCode;\n }\n\n let errCode = errorCodeMapping[errorCode] ?? errorCode;\n\n // If errCode isn't now a number - then we just need to remove any non-digits\n // since the correct error code is already contained within the string e.g. securedField related errors\n if (isNaN(Number(errCode))) {\n errCode = digitsOnlyFormatter(errCode);\n }\n\n return errCode;\n};\n\nexport const processAnalyticsData = (analyticsData: AnalyticsData): AnalyticsData => {\n return Object.keys(analyticsData).reduce((acc, prop) => {\n if (ALLOWED_ANALYTICS_DATA.includes(prop)) acc[prop] = analyticsData[prop];\n return acc;\n }, {});\n};\n\nexport const getCardConfigData = (cardProps: CardConfiguration): CardConfigData => {\n // Extract props from cardProps - mostly setting a default value, if prop not found\n const {\n autoFocus,\n billingAddressAllowedCountries,\n billingAddressMode,\n billingAddressRequired,\n billingAddressRequiredFields,\n brands = DEFAULT_CARD_GROUP_TYPES,\n brandsConfiguration,\n challengeWindowSize = DEFAULT_CHALLENGE_WINDOW_SIZE,\n configuration,\n countryCode,\n data,\n disclaimerMessage,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n forceCompat,\n hasHolderName,\n hideCVC,\n holderNameRequired,\n installmentOptions,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate,\n name, // = 'none',\n placeholders,\n positionHolderNameOnTop,\n showBrandIcon,\n showInstallmentAmounts,\n showPayButton = false, // hard coded default\n styles,\n onAllValid,\n onBinLookup,\n onBinValue,\n onBlur,\n onBrand,\n onConfigSuccess,\n onEnterKeyPressed,\n onFieldValid,\n onFocus,\n onLoad\n } = cardProps;\n\n const dataString = JSON.stringify(CardInputDefaultProps.data);\n\n const srPanelEnabled = cardProps.modules?.srPanel?.enabled;\n const srPanelMoveFocus = cardProps.modules?.srPanel?.moveFocus;\n\n const riskEnabled = cardProps.modules?.risk?.enabled;\n\n const billingAddressModeValue = cardProps.onAddressLookup ? 'lookup' : billingAddressMode;\n\n let showKCPType: 'none' | 'auto' | 'atStart' = 'none';\n if (configuration?.koreanAuthenticationRequired === true) {\n showKCPType = countryCode?.toLowerCase() === 'kr' ? 'atStart' : 'auto';\n }\n\n // @ts-ignore commenting out props until endpoint is ready\n const configData: CardConfigData = {\n autoFocus,\n ...(billingAddressAllowedCountries?.length > 0 && {\n billingAddressAllowedCountries: billingAddressAllowedCountries.toString().substring(0, MAX_LENGTH)\n }),\n billingAddressMode: billingAddressModeValue,\n billingAddressRequired,\n billingAddressRequiredFields: billingAddressRequiredFields?.toString()?.substring(0, MAX_LENGTH),\n // Probably just for development - in real life we wouldn't expect the number of supported brands to push the endpoint limit on 128 chars\n brands: brands?.toString()?.substring(0, MAX_LENGTH),\n challengeWindowSize,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n forceCompat,\n hasBrandsConfiguration: notFalsy(brandsConfiguration),\n hasData: data && JSON.stringify(cardProps.data) !== dataString,\n hasDisclaimerMessage: !!disclaimerMessage,\n hasHolderName,\n hasInstallmentOptions: notFalsy(installmentOptions),\n hasPlaceholders: notFalsy(placeholders), // has merchant defined placeholders\n hasStylesConfigured: notFalsy(styles),\n hideCVC,\n holderNameRequired,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate: !!minimumExpiryDate, // Potentially, in the future, we can send the actual string value\n name,\n positionHolderNameOnTop,\n riskEnabled,\n showBrandIcon,\n showInstallmentAmounts: !!showInstallmentAmounts,\n showKCPType,\n showPayButton,\n socialSecurityNumberMode: configuration?.socialSecurityNumberMode,\n srPanelEnabled,\n srPanelMoveFocus,\n /** callbacks */\n // We need to detect if the merchant themselves has defined these, not if we've set them as a default\n hasOnAllValid: onAllValid !== CardInputDefaultProps.onAllValid,\n hasOnBinValue: onBinValue !== CardInputDefaultProps.onBinValue,\n hasOnBlur: onBlur !== CardInputDefaultProps.onBlur,\n hasOnBrand: onBrand !== CardInputDefaultProps.onBrand,\n hasOnConfigSuccess: onConfigSuccess !== CardInputDefaultProps.onConfigSuccess,\n hasOnFieldValid: onFieldValid !== CardInputDefaultProps.onFieldValid,\n hasOnFocus: onFocus !== CardInputDefaultProps.onFocus,\n hasOnLoad: onLoad !== CardInputDefaultProps.onLoad,\n // Card level props\n hasOnBinLookup: !!onBinLookup,\n hasOnEnterKeyPressed: !!onEnterKeyPressed\n };\n\n return configData;\n};\n"],"names":["getUTCTimestamp","Date","now","createAnalyticsObject","aObj","timestamp","String","component","id","uuid","event","code","errorType","message","type","ANALYTICS_ACTION_STR","THREEDS2_FULL","subType","subtype","result","target","issuer","isExpress","expressPage","isStoredPaymentMethod","brand","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","mapErrorCodesForAnalytics","validationErrorMessage","configData","metadata","errorCode","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","errorCodeMapping","errCode","isNaN","Number","digitsOnlyFormatter","processAnalyticsData","analyticsData","Object","keys","reduce","acc","prop","ALLOWED_ANALYTICS_DATA","includes","getCardConfigData","cardProps","autoFocus","billingAddressAllowedCountries","billingAddressMode","billingAddressRequired","billingAddressRequiredFields","brands","DEFAULT_CARD_GROUP_TYPES","brandsConfiguration","challengeWindowSize","DEFAULT_CHALLENGE_WINDOW_SIZE","configuration","countryCode","data","disclaimerMessage","disableIOSArrowKeys","doBinLookup","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","hideCVC","holderNameRequired","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","showPayButton","styles","onAllValid","onBinLookup","onBinValue","onBlur","onBrand","onConfigSuccess","onEnterKeyPressed","onFieldValid","onFocus","onLoad","dataString","JSON","stringify","CardInputDefaultProps","srPanelEnabled","modules","srPanel","enabled","srPanelMoveFocus","moveFocus","riskEnabled","risk","billingAddressModeValue","onAddressLookup","showKCPType","koreanAuthenticationRequired","toLowerCase","length","toString","substring","hasBrandsConfiguration","notFalsy","hasData","hasDisclaimerMessage","hasInstallmentOptions","hasPlaceholders","hasStylesConfigured","socialSecurityNumberMode","hasOnAllValid","hasOnBinValue","hasOnBlur","hasOnBrand","hasOnConfigSuccess","hasOnFieldValid","hasOnFocus","hasOnLoad","hasOnBinLookup","hasOnEnterKeyPressed"],"mappings":"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"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/core/Analytics/utils.ts"],"sourcesContent":["import { AnalyticsObject, CreateAnalyticsObject, CardConfigData, AnalyticsData } from './types';\nimport { ANALYTICS_ACTION_STR, ANALYTICS_VALIDATION_ERROR_STR, errorCodeMapping, ALLOWED_ANALYTICS_DATA } from './constants';\nimport uuid from '../../utils/uuid';\nimport { digitsOnlyFormatter } from '../../utils/Formatters/formatters';\nimport { ERROR_FIELD_REQUIRED, ERROR_INVALID_FORMAT_EXPECTS } from '../Errors/constants';\nimport { DEFAULT_CHALLENGE_WINDOW_SIZE, THREEDS2_FULL } from '../../components/ThreeDS2/constants';\nimport { CardConfiguration } from '../../components/Card/types';\nimport CardInputDefaultProps from '../../components/Card/components/CardInput/defaultProps';\nimport { DEFAULT_CARD_GROUP_TYPES } from '../../components/internal/SecuredFields/lib/constants';\nimport { notFalsy } from '../../utils/commonUtils';\n\nconst MAX_LENGTH = 128;\nexport const getUTCTimestamp = () => Date.now();\n\n/**\n * All objects for the /checkoutanalytics endpoint have base props:\n * \"timestamp\" & \"component\"\n *\n * Error objects have, in addition to the base props:\n * \"code\", \"errorType\" & \"message\"\n *\n * Log objects have, in addition to the base props:\n * \"message\" & \"type\" &\n * \"subtype\" (e.g. when an action is handled)\n *\n * Info objects have, in addition to the base props:\n * \"type\" & \"target\" &\n * \"isStoredPaymentMethod\" & \"brand\" (when a storedCard is \"selected\"), or,\n * \"validationErrorCode\" & \"validationErrorMessage\" (when the event is describing a validation error)\n *\n * All objects can also have a \"metadata\" object of key-value pairs\n */\nexport const createAnalyticsObject = (aObj: CreateAnalyticsObject): AnalyticsObject => ({\n timestamp: String(getUTCTimestamp()),\n component: aObj.component,\n id: uuid(),\n /** ERROR */\n ...(aObj.event === 'error' && { code: aObj.code, errorType: aObj.errorType, message: aObj.message }), // error event\n /** LOG */\n ...(aObj.event === 'log' && { type: aObj.type, message: aObj.message }), // log event\n ...(aObj.event === 'log' && (aObj.type === ANALYTICS_ACTION_STR || aObj.type === THREEDS2_FULL) && { subType: aObj.subtype }), // only added if we have a log event of Action type or ThreeDS2\n ...(aObj.event === 'log' && aObj.type === THREEDS2_FULL && { result: aObj.result }), // only added if we have a log event of ThreeDS2 type\n /** INFO */\n ...(aObj.event === 'info' && { type: aObj.type, target: aObj.target }), // info event\n ...(aObj.event === 'info' && aObj.issuer && { issuer: aObj.issuer }), // relates to issuerLists\n ...(aObj.event === 'info' && { isExpress: aObj.isExpress, expressPage: aObj.expressPage }), // relates to Plugins & detecting Express PMs\n ...(aObj.event === 'info' && aObj.isStoredPaymentMethod && { isStoredPaymentMethod: aObj.isStoredPaymentMethod, brand: aObj.brand }), // only added if we have an info event about a storedPM\n ...(aObj.event === 'info' &&\n aObj.type === ANALYTICS_VALIDATION_ERROR_STR && {\n validationErrorCode: mapErrorCodesForAnalytics(aObj.validationErrorCode, aObj.target),\n validationErrorMessage: aObj.validationErrorMessage\n }), // only added if we have an info event describing a validation error\n ...(aObj.configData && { configData: aObj.configData }),\n /** All */\n ...(aObj.metadata && { metadata: aObj.metadata })\n});\n\nconst mapErrorCodesForAnalytics = (errorCode: string, target: string) => {\n // Some of the more generic error codes required combination with target to retrieve a specific code\n if (errorCode === ERROR_FIELD_REQUIRED || errorCode === ERROR_INVALID_FORMAT_EXPECTS) {\n return errorCodeMapping[`${errorCode}.${target}`] ?? errorCode;\n }\n\n let errCode = errorCodeMapping[errorCode] ?? errorCode;\n\n // If errCode isn't now a number - then we just need to remove any non-digits\n // since the correct error code is already contained within the string e.g. securedField related errors\n if (isNaN(Number(errCode))) {\n errCode = digitsOnlyFormatter(errCode);\n }\n\n return errCode;\n};\n\nexport const processAnalyticsData = (analyticsData: AnalyticsData): AnalyticsData => {\n return Object.keys(analyticsData).reduce((acc, prop) => {\n if (ALLOWED_ANALYTICS_DATA.includes(prop)) acc[prop] = analyticsData[prop];\n return acc;\n }, {});\n};\n\nexport const getCardConfigData = (cardProps: CardConfiguration): CardConfigData => {\n // Extract props from cardProps - mostly setting a default value, if prop not found\n const {\n autoFocus,\n billingAddressAllowedCountries,\n billingAddressMode,\n billingAddressRequired,\n billingAddressRequiredFields,\n brands = DEFAULT_CARD_GROUP_TYPES,\n brandsConfiguration,\n challengeWindowSize = DEFAULT_CHALLENGE_WINDOW_SIZE,\n configuration,\n countryCode,\n data,\n disclaimerMessage,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n forceCompat,\n hasHolderName,\n hideCVC,\n holderNameRequired,\n installmentOptions,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate,\n name, // = 'none',\n placeholders,\n positionHolderNameOnTop,\n showBrandIcon,\n showInstallmentAmounts,\n showPayButton = false, // hard coded default\n styles,\n onAllValid,\n onBinLookup,\n onBinValue,\n onBlur,\n onBrand,\n onConfigSuccess,\n onEnterKeyPressed,\n onFieldValid,\n onFocus,\n onLoad\n } = cardProps;\n\n const dataString = JSON.stringify(CardInputDefaultProps.data);\n\n const srPanelEnabled = cardProps.modules?.srPanel?.enabled;\n const srPanelMoveFocus = cardProps.modules?.srPanel?.moveFocus;\n\n const riskEnabled = cardProps.modules?.risk?.enabled;\n\n const billingAddressModeValue = cardProps.onAddressLookup ? 'lookup' : billingAddressMode;\n\n let showKCPType: 'none' | 'auto' | 'atStart' = 'none';\n if (configuration?.koreanAuthenticationRequired === true) {\n showKCPType = countryCode?.toLowerCase() === 'kr' ? 'atStart' : 'auto';\n }\n\n // @ts-ignore commenting out props until endpoint is ready\n const configData: CardConfigData = {\n autoFocus,\n ...(billingAddressAllowedCountries?.length > 0 && {\n billingAddressAllowedCountries: billingAddressAllowedCountries.toString().substring(0, MAX_LENGTH)\n }),\n billingAddressMode: billingAddressModeValue,\n billingAddressRequired,\n billingAddressRequiredFields: billingAddressRequiredFields?.toString()?.substring(0, MAX_LENGTH),\n // Probably just for development - in real life we wouldn't expect the number of supported brands to push the endpoint limit on 128 chars\n brands: brands?.toString()?.substring(0, MAX_LENGTH),\n challengeWindowSize,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n forceCompat,\n hasBrandsConfiguration: notFalsy(brandsConfiguration),\n hasData: data && JSON.stringify(cardProps.data) !== dataString,\n hasDisclaimerMessage: !!disclaimerMessage,\n hasHolderName,\n hasInstallmentOptions: notFalsy(installmentOptions),\n hasPlaceholders: notFalsy(placeholders), // has merchant defined placeholders\n hasStylesConfigured: notFalsy(styles),\n hideCVC,\n holderNameRequired,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate: !!minimumExpiryDate, // Potentially, in the future, we can send the actual string value\n name,\n positionHolderNameOnTop,\n riskEnabled,\n showBrandIcon,\n showInstallmentAmounts: !!showInstallmentAmounts,\n showKCPType,\n showPayButton,\n socialSecurityNumberMode: configuration?.socialSecurityNumberMode,\n srPanelEnabled,\n srPanelMoveFocus,\n /** callbacks */\n // We need to detect if the merchant themselves has defined these, not if we've set them as a default\n hasOnAllValid: onAllValid !== CardInputDefaultProps.onAllValid,\n hasOnBinValue: onBinValue !== CardInputDefaultProps.onBinValue,\n hasOnBlur: onBlur !== CardInputDefaultProps.onBlur,\n hasOnBrand: onBrand !== CardInputDefaultProps.onBrand,\n hasOnConfigSuccess: onConfigSuccess !== CardInputDefaultProps.onConfigSuccess,\n hasOnFieldValid: onFieldValid !== CardInputDefaultProps.onFieldValid,\n hasOnFocus: onFocus !== CardInputDefaultProps.onFocus,\n hasOnLoad: onLoad !== CardInputDefaultProps.onLoad,\n // Card level props\n hasOnBinLookup: !!onBinLookup,\n hasOnEnterKeyPressed: !!onEnterKeyPressed\n };\n\n return configData;\n};\n"],"names":["getUTCTimestamp","Date","now","createAnalyticsObject","aObj","timestamp","String","component","id","uuid","event","code","errorType","message","type","ANALYTICS_ACTION_STR","THREEDS2_FULL","subType","subtype","result","target","issuer","isExpress","expressPage","isStoredPaymentMethod","brand","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","mapErrorCodesForAnalytics","validationErrorMessage","configData","metadata","errorCode","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","errorCodeMapping","errCode","isNaN","Number","digitsOnlyFormatter","processAnalyticsData","analyticsData","Object","keys","reduce","acc","prop","ALLOWED_ANALYTICS_DATA","includes","getCardConfigData","cardProps","autoFocus","billingAddressAllowedCountries","billingAddressMode","billingAddressRequired","billingAddressRequiredFields","brands","DEFAULT_CARD_GROUP_TYPES","brandsConfiguration","challengeWindowSize","DEFAULT_CHALLENGE_WINDOW_SIZE","configuration","countryCode","data","disclaimerMessage","disableIOSArrowKeys","doBinLookup","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","hideCVC","holderNameRequired","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","showPayButton","styles","onAllValid","onBinLookup","onBinValue","onBlur","onBrand","onConfigSuccess","onEnterKeyPressed","onFieldValid","onFocus","onLoad","dataString","JSON","stringify","CardInputDefaultProps","srPanelEnabled","modules","srPanel","enabled","srPanelMoveFocus","moveFocus","riskEnabled","risk","billingAddressModeValue","onAddressLookup","showKCPType","koreanAuthenticationRequired","toLowerCase","length","toString","substring","hasBrandsConfiguration","notFalsy","hasData","hasDisclaimerMessage","hasInstallmentOptions","hasPlaceholders","hasStylesConfigured","socialSecurityNumberMode","hasOnAllValid","hasOnBinValue","hasOnBlur","hasOnBrand","hasOnConfigSuccess","hasOnFieldValid","hasOnFocus","hasOnLoad","hasOnBinLookup","hasOnEnterKeyPressed"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- function R(R,e,E){return e in R?Object.defineProperty(R,e,{value:E,enumerable:!0,configurable:!0,writable:!0}):R[e]=E,R}const e="NETWORK_ERROR",E="CANCEL",r="IMPLEMENTATION_ERROR",O="API_ERROR",s="ERROR",t="SCRIPT_ERROR",a="SDK_ERROR";class n extends Error{constructor(e,E,r){super(E),R(this,"cause",void 0),this.name=n.errorTypes[e],this.cause=r?.cause}}R(n,"errorTypes",{NETWORK_ERROR:e,CANCEL:E,IMPLEMENTATION_ERROR:r,API_ERROR:O,ERROR:s,SCRIPT_ERROR:t,SDK_ERROR:a});export{O as API_ERROR,E as CANCEL,s as ERROR,r as IMPLEMENTATION_ERROR,e as NETWORK_ERROR,t as SCRIPT_ERROR,a as SDK_ERROR,n as default};
1
+ function R(R,e,s){return e in R?Object.defineProperty(R,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):R[e]=s,R}const e="NETWORK_ERROR",s="CANCEL",E="IMPLEMENTATION_ERROR",r="API_ERROR",t="ERROR",o="SCRIPT_ERROR",O="SDK_ERROR";class i extends Error{constructor(e,s,E){super(s),R(this,"cause",void 0),R(this,"options",void 0),this.name=i.errorTypes[e],this.options=E||{},this.cause=this.options.cause}}R(i,"errorTypes",{NETWORK_ERROR:e,CANCEL:s,IMPLEMENTATION_ERROR:E,API_ERROR:r,ERROR:t,SCRIPT_ERROR:o,SDK_ERROR:O});export{r as API_ERROR,s as CANCEL,t as ERROR,E as IMPLEMENTATION_ERROR,e as NETWORK_ERROR,o as SCRIPT_ERROR,O as SDK_ERROR,i as default};
2
2
  //# sourceMappingURL=AdyenCheckoutError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdyenCheckoutError.js","sources":["../../../../src/core/Errors/AdyenCheckoutError.ts"],"sourcesContent":["interface CheckoutErrorOptions {\n cause?: any;\n}\n\nexport const NETWORK_ERROR = 'NETWORK_ERROR';\nexport const CANCEL = 'CANCEL';\nexport const IMPLEMENTATION_ERROR = 'IMPLEMENTATION_ERROR';\nexport const API_ERROR = 'API_ERROR';\nexport const ERROR = 'ERROR';\nexport const SCRIPT_ERROR = 'SCRIPT_ERROR';\nexport const SDK_ERROR = 'SDK_ERROR';\n\nclass AdyenCheckoutError extends Error {\n protected static errorTypes = {\n /** Network error. */\n NETWORK_ERROR,\n\n /** Shopper canceled the current transaction. */\n CANCEL,\n\n /** Implementation error. The method or parameter are incorrect or are not supported. */\n IMPLEMENTATION_ERROR,\n\n /** API error. The API has not returned the expected data */\n API_ERROR,\n\n /** Generic error. */\n ERROR,\n\n /** Script error. The browser failed to load 3rd party script */\n SCRIPT_ERROR,\n\n /** Something has gone wrong internally */\n SDK_ERROR\n };\n\n public cause: unknown;\n\n constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string, options?: CheckoutErrorOptions) {\n super(message);\n\n this.name = AdyenCheckoutError.errorTypes[type];\n\n this.cause = options?.cause;\n }\n}\n\nexport default AdyenCheckoutError;\n"],"names":["NETWORK_ERROR","CANCEL","IMPLEMENTATION_ERROR","API_ERROR","ERROR","SCRIPT_ERROR","SDK_ERROR","AdyenCheckoutError","Error","constructor","type","message","options","super","_define_property","cause","this","name","errorTypes"],"mappings":"wHAIO,MAAMA,EAAgB,gBAChBC,EAAS,SACTC,EAAuB,uBACvBC,EAAY,YACZC,EAAQ,QACRC,EAAe,eACfC,EAAY,YAEzB,MAAMC,UAA2BC,MA0B7BC,WAAAA,CAAYC,EAAkDC,EAAkBC,GAC5EC,MAAMF,GAHVG,EAAOC,KAAAA,aAAP,GAKIC,KAAKC,KAAOV,EAAmBW,WAAWR,GAE1CM,KAAKD,MAAQH,GAASG,KAC1B,EA/BAD,EADEP,EACeW,aAAa,CAE1BlB,gBAGAC,SAGAC,uBAGAC,YAGAC,QAGAC,eAGAC"}
1
+ {"version":3,"file":"AdyenCheckoutError.js","sources":["../../../../src/core/Errors/AdyenCheckoutError.ts"],"sourcesContent":["interface CheckoutErrorOptions {\n cause?: any;\n code?: string;\n}\n\nexport const NETWORK_ERROR = 'NETWORK_ERROR';\nexport const CANCEL = 'CANCEL';\nexport const IMPLEMENTATION_ERROR = 'IMPLEMENTATION_ERROR';\nexport const API_ERROR = 'API_ERROR';\nexport const ERROR = 'ERROR';\nexport const SCRIPT_ERROR = 'SCRIPT_ERROR';\nexport const SDK_ERROR = 'SDK_ERROR';\n\nclass AdyenCheckoutError extends Error {\n protected static errorTypes = {\n /** Network error. */\n NETWORK_ERROR,\n\n /** Shopper canceled the current transaction. */\n CANCEL,\n\n /** Implementation error. The method or parameter are incorrect or are not supported. */\n IMPLEMENTATION_ERROR,\n\n /** API error. The API has not returned the expected data */\n API_ERROR,\n\n /** Generic error. */\n ERROR,\n\n /** Script error. The browser failed to load 3rd party script */\n SCRIPT_ERROR,\n\n /** Something has gone wrong internally */\n SDK_ERROR\n };\n\n public cause: unknown;\n public options: CheckoutErrorOptions;\n\n constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string, options?: CheckoutErrorOptions) {\n super(message);\n\n this.name = AdyenCheckoutError.errorTypes[type];\n this.options = options || {};\n this.cause = this.options.cause;\n }\n}\n\nexport default AdyenCheckoutError;\n"],"names":["NETWORK_ERROR","CANCEL","IMPLEMENTATION_ERROR","API_ERROR","ERROR","SCRIPT_ERROR","SDK_ERROR","AdyenCheckoutError","Error","constructor","type","message","options","super","_define_property","cause","this","name","errorTypes"],"mappings":"wHAKO,MAAMA,EAAgB,gBAChBC,EAAS,SACTC,EAAuB,uBACvBC,EAAY,YACZC,EAAQ,QACRC,EAAe,eACfC,EAAY,YAEzB,MAAMC,UAA2BC,MA2B7BC,WAAAA,CAAYC,EAAkDC,EAAkBC,GAC5EC,MAAMF,GAJVG,EAAOC,KAAAA,aAAP,GACAD,EAAAE,KAAOJ,eAAP,GAKII,KAAKC,KAAOV,EAAmBW,WAAWR,GAC1CM,KAAKJ,QAAUA,GAAW,CAAC,EAC3BI,KAAKD,MAAQC,KAAKJ,QAAQG,KAC9B,EAhCAD,EADEP,EACeW,aAAa,CAE1BlB,gBAGAC,SAGAC,uBAGAC,YAGAC,QAGAC,eAGAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SRMessages.js","sources":["../../../../src/core/Errors/SRMessages.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useRef, useState } from 'preact/hooks';\nimport { SRMessagesProps } from './types';\n\n// An interface for the members exposed by SRMessages to its parent\nexport interface SRMessagesRef {\n setMessages?: (who: string[]) => void;\n}\n\nexport function SRMessages({ setComponentRef }: SRMessagesProps) {\n const messagesRef = useRef<SRMessagesRef>({});\n // Just call once to create the object by which we expose the members expected by the parent comp\n if (!Object.keys(messagesRef.current).length) {\n setComponentRef?.(messagesRef.current);\n }\n\n const [messages, setMessages] = useState(null);\n\n // Expose method expected by parent\n messagesRef.current.setMessages = (msgs: string[]) => {\n setMessages(msgs);\n };\n\n return messages ? (\n <Fragment>\n {messages.map(msg => {\n return (\n <div key={msg} className=\"adyen-checkout-sr-panel__msg\" {...(process.env.NODE_ENV !== 'production' && { 'data-testid': msg })}>\n {msg}\n </div>\n );\n })}\n </Fragment>\n ) : null;\n}\n"],"names":["SRMessages","setComponentRef","messagesRef","useRef","Object","keys","current","length","messages","setMessages","useState","msgs","h","Fragment","map","msg","div","key","className"],"mappings":"oKASO,SAASA,GAAWC,gBAAEA,IACzB,MAAMC,EAAcC,EAAsB,CAAA,GAErCC,OAAOC,KAAKH,EAAYI,SAASC,QAClCN,IAAkBC,EAAYI,SAGlC,MAAOE,EAAUC,GAAeC,EAAS,MAOzC,OAJAR,EAAYI,QAAQG,YAAeE,IAC/BF,EAAYE,EAAAA,EAGTH,EACHI,EAACC,EAAAA,KACIL,EAASM,KAAIC,GAENH,EAACI,MAAAA,CAAIC,IAAKF,EAAKG,UAAU,gCACpBH,MAKjB,IACR"}
1
+ {"version":3,"file":"SRMessages.js","sources":["../../../../src/core/Errors/SRMessages.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useRef, useState } from 'preact/hooks';\nimport { SRMessagesProps } from './types';\n\n// An interface for the members exposed by SRMessages to its parent\nexport interface SRMessagesRef {\n setMessages?: (who: string[]) => void;\n}\n\nexport function SRMessages({ setComponentRef }: SRMessagesProps) {\n const messagesRef = useRef<SRMessagesRef>({});\n // Just call once to create the object by which we expose the members expected by the parent comp\n if (!Object.keys(messagesRef.current).length) {\n setComponentRef?.(messagesRef.current);\n }\n\n const [messages, setMessages] = useState(null);\n\n // Expose method expected by parent\n messagesRef.current.setMessages = (msgs: string[]) => {\n setMessages(msgs);\n };\n\n return messages ? (\n <Fragment>\n {messages.map(msg => {\n return (\n <div key={msg} className=\"adyen-checkout-sr-panel__msg\" {...(process.env.NODE_ENV !== 'production' && { 'data-testid': msg })}>\n {msg}\n </div>\n );\n })}\n </Fragment>\n ) : null;\n}\n"],"names":["SRMessages","setComponentRef","messagesRef","useRef","Object","keys","current","length","messages","setMessages","useState","msgs","h","Fragment","map","msg","div","key","className"],"mappings":"oKASO,SAASA,GAAWC,gBAAEA,IACzB,MAAMC,EAAcC,EAAsB,IAErCC,OAAOC,KAAKH,EAAYI,SAASC,QAClCN,IAAkBC,EAAYI,SAGlC,MAAOE,EAAUC,GAAeC,EAAS,MAOzC,OAJAR,EAAYI,QAAQG,YAAeE,IAC/BF,EAAYE,EAAAA,EAGTH,EACHI,EAACC,EAAAA,KACIL,EAASM,KAAIC,GAENH,EAACI,MAAAA,CAAIC,IAAKF,EAAKG,UAAU,gCACpBH,MAKjB,IACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/core/Errors/constants.ts"],"sourcesContent":["import {\n ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,\n ENCRYPTED_BANK_LOCATION_FIELD,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_PWD_FIELD,\n ENCRYPTED_SECURITY_CODE\n} from '../../components/internal/SecuredFields/lib/constants';\n\nexport const ARIA_ERROR_SUFFIX = '-ariaError';\nexport const ARIA_CONTEXT_SUFFIX = '-ariaContext';\n\nexport const ERROR_ACTION_FOCUS_FIELD = 'focusField';\nexport const ERROR_ACTION_BLUR_SCENARIO = 'notValidating:blurScenario';\nexport const ERROR_FIELD_REQUIRED = 'field.error.required';\nexport const ERROR_FIELD_INVALID = 'field.error.invalid';\n\nexport const ERROR_INVALID_FORMAT_EXPECTS = 'invalid.format.expects';\nexport const CREDITCARD_HOLDER_NAME_INVALID = 'creditCard.holderName.invalid';\nexport const CREDITCARD_TAX_NUMBER_INVALID = 'creditCard.taxNumber.invalid';\nexport const BOLETO_SOCIAL_SECURITY_NUMBER_INVALID = 'boleto.socialSecurityNumber.invalid';\n\nexport enum ErrorCodePrefixes {\n CC_NUM = 'cc.num',\n CC_DAT = 'cc.dat',\n CC_MTH = 'cc.mth',\n CC_YR = 'cc.yr',\n CC_CVC = 'cc.cvc',\n KCP_PWD = 'kcp.pwd',\n ACH_NUM = 'ach.num',\n ACH_LOC = 'ach.loc'\n}\n\n/**\n * For SecuredFields\n * Human readable error strings mapped to the codes, used as keys, in the translations files\n */\nexport enum SF_ErrorCodes {\n ERROR_MSG_INCOMPLETE_FIELD = 'err.gen.9100',\n ERROR_MSG_INVALID_FIELD = 'err.gen.9101',\n\n ERROR_MSG_LUHN_CHECK_FAILED = `${ErrorCodePrefixes.CC_NUM}.902`,\n ERROR_MSG_EMPTY_PAN = `${ErrorCodePrefixes.CC_NUM}.900`,\n ERROR_MSG_UNSUPPORTED_CARD_ENTERED = `${ErrorCodePrefixes.CC_NUM}.903`,\n ERROR_MSG_INCORRECTLY_FILLED_PAN = `${ErrorCodePrefixes.CC_NUM}.901`, // 'Enter the complete card number'\n\n ERROR_MSG_CARD_TOO_OLD = `${ErrorCodePrefixes.CC_DAT}.912`,\n ERROR_MSG_CARD_TOO_FAR_IN_FUTURE = `${ErrorCodePrefixes.CC_DAT}.913`,\n ERROR_MSG_CARD_EXPIRES_TOO_SOON = `${ErrorCodePrefixes.CC_DAT}.914`,\n ERROR_MSG_EMPTY_DATE = `${ErrorCodePrefixes.CC_DAT}.910`,\n ERROR_MSG_INCORRECTLY_FILLED__DATE = `${ErrorCodePrefixes.CC_DAT}.911`,\n\n ERROR_MSG_EMPTY_YEAR = `${ErrorCodePrefixes.CC_YR}.917`,\n ERROR_MSG_INCORRECTLY_FILLED_YEAR = `${ErrorCodePrefixes.CC_YR}.918`,\n\n // ERROR_MSG_INCORRECTLY_FILLED_MONTH= `cc.mth.916`,\n ERROR_MSG_EMPTY_MONTH = `${ErrorCodePrefixes.CC_MTH}.915`,\n\n ERROR_MSG_EMPTY_CVC = `${ErrorCodePrefixes.CC_CVC}.920`,\n ERROR_MSG_INCORRECTLY_FILLED_CVC = `${ErrorCodePrefixes.CC_CVC}.921`,\n\n ERROR_MSG_EMPTY_KCP_PWD = `${ErrorCodePrefixes.KCP_PWD}.940`,\n ERROR_MSG_INCORRECTLY_FILLED_KCP_PWD = `${ErrorCodePrefixes.KCP_PWD}.941`,\n\n ERROR_MSG_EMPTY_ACH_ACCOUNT_NUMBER = `${ErrorCodePrefixes.ACH_NUM}.945`,\n ERROR_MSG_INCORRECTLY_FILLED_ACH_ACCOUNT_NUMBER = `${ErrorCodePrefixes.ACH_NUM}.946`,\n\n ERROR_MSG_EMPTY_ACH_BANK_LOCATION_ID = `${ErrorCodePrefixes.ACH_LOC}.947`,\n ERROR_MSG_INCORRECTLY_FILLED_ACH_BANK_LOCATION_ID = `${ErrorCodePrefixes.ACH_LOC}.948`\n}\n\nexport const EMPTY_FIELD_ERROR_MESSAGES = {\n [ENCRYPTED_CARD_NUMBER]: SF_ErrorCodes.ERROR_MSG_EMPTY_PAN,\n [ENCRYPTED_EXPIRY_DATE]: SF_ErrorCodes.ERROR_MSG_EMPTY_DATE,\n [ENCRYPTED_EXPIRY_MONTH]: SF_ErrorCodes.ERROR_MSG_EMPTY_MONTH,\n [ENCRYPTED_EXPIRY_YEAR]: SF_ErrorCodes.ERROR_MSG_EMPTY_YEAR,\n [ENCRYPTED_SECURITY_CODE]: SF_ErrorCodes.ERROR_MSG_EMPTY_CVC,\n [ENCRYPTED_PWD_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_KCP_PWD,\n [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_ACH_ACCOUNT_NUMBER,\n [ENCRYPTED_BANK_LOCATION_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_ACH_BANK_LOCATION_ID\n};\n"],"names":["ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","ERROR_ACTION_FOCUS_FIELD","ERROR_ACTION_BLUR_SCENARIO","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","ERROR_INVALID_FORMAT_EXPECTS","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ErrorCodePrefixes","SF_ErrorCodes","EMPTY_FIELD_ERROR_MESSAGES","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ENCRYPTED_BANK_LOCATION_FIELD"],"mappings":"mTAWO,MAAMA,EAAoB,aACpBC,EAAsB,eAEtBC,EAA2B,aAC3BC,EAA6B,6BAC7BC,EAAuB,uBACvBC,EAAsB,sBAEtBC,EAA+B,yBAC/BC,EAAiC,gCACjCC,EAAgC,+BAChCC,EAAwC,sCAE9C,IAAAC,EAAKA,SAAAA,GAAAA,2JAAAA,CASX,CATWA,CASX,IAMWC,EAAAA,SAAAA,GAAAA,y/BAAAA,CAgCX,CAhCWA,CAgCX,UAEYC,EAA6B,CACtCC,CAACA,GAAsB,aACvBC,CAACA,GAAsB,aACvBC,CAACA,GAAuB,aACxBC,CAACA,GAAsB,YACvBC,CAACA,GAAwB,aACzBC,CAACA,GAAoB,cACrBC,CAACA,GAAkC,cACnCC,CAACA,GAA8B"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/core/Errors/constants.ts"],"sourcesContent":["import {\n ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,\n ENCRYPTED_BANK_LOCATION_FIELD,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_PWD_FIELD,\n ENCRYPTED_SECURITY_CODE\n} from '../../components/internal/SecuredFields/lib/constants';\n\nexport const ARIA_ERROR_SUFFIX = '-ariaError';\nexport const ARIA_CONTEXT_SUFFIX = '-ariaContext';\n\nexport const ERROR_ACTION_FOCUS_FIELD = 'focusField';\nexport const ERROR_ACTION_BLUR_SCENARIO = 'notValidating:blurScenario';\nexport const ERROR_FIELD_REQUIRED = 'field.error.required';\nexport const ERROR_FIELD_INVALID = 'field.error.invalid';\n\nexport const ERROR_INVALID_FORMAT_EXPECTS = 'invalid.format.expects';\nexport const CREDITCARD_HOLDER_NAME_INVALID = 'creditCard.holderName.invalid';\nexport const CREDITCARD_TAX_NUMBER_INVALID = 'creditCard.taxNumber.invalid';\nexport const BOLETO_SOCIAL_SECURITY_NUMBER_INVALID = 'boleto.socialSecurityNumber.invalid';\n\nexport enum ErrorCodePrefixes {\n CC_NUM = 'cc.num',\n CC_DAT = 'cc.dat',\n CC_MTH = 'cc.mth',\n CC_YR = 'cc.yr',\n CC_CVC = 'cc.cvc',\n KCP_PWD = 'kcp.pwd',\n ACH_NUM = 'ach.num',\n ACH_LOC = 'ach.loc'\n}\n\n/**\n * For SecuredFields\n * Human readable error strings mapped to the codes, used as keys, in the translations files\n */\nexport enum SF_ErrorCodes {\n ERROR_MSG_INCOMPLETE_FIELD = 'err.gen.9100',\n ERROR_MSG_INVALID_FIELD = 'err.gen.9101',\n\n ERROR_MSG_LUHN_CHECK_FAILED = `${ErrorCodePrefixes.CC_NUM}.902`,\n ERROR_MSG_EMPTY_PAN = `${ErrorCodePrefixes.CC_NUM}.900`,\n ERROR_MSG_UNSUPPORTED_CARD_ENTERED = `${ErrorCodePrefixes.CC_NUM}.903`,\n ERROR_MSG_INCORRECTLY_FILLED_PAN = `${ErrorCodePrefixes.CC_NUM}.901`, // 'Enter the complete card number'\n\n ERROR_MSG_CARD_TOO_OLD = `${ErrorCodePrefixes.CC_DAT}.912`,\n ERROR_MSG_CARD_TOO_FAR_IN_FUTURE = `${ErrorCodePrefixes.CC_DAT}.913`,\n ERROR_MSG_CARD_EXPIRES_TOO_SOON = `${ErrorCodePrefixes.CC_DAT}.914`,\n ERROR_MSG_EMPTY_DATE = `${ErrorCodePrefixes.CC_DAT}.910`,\n ERROR_MSG_INCORRECTLY_FILLED__DATE = `${ErrorCodePrefixes.CC_DAT}.911`,\n\n ERROR_MSG_EMPTY_YEAR = `${ErrorCodePrefixes.CC_YR}.917`,\n ERROR_MSG_INCORRECTLY_FILLED_YEAR = `${ErrorCodePrefixes.CC_YR}.918`,\n\n // ERROR_MSG_INCORRECTLY_FILLED_MONTH= `cc.mth.916`,\n ERROR_MSG_EMPTY_MONTH = `${ErrorCodePrefixes.CC_MTH}.915`,\n\n ERROR_MSG_EMPTY_CVC = `${ErrorCodePrefixes.CC_CVC}.920`,\n ERROR_MSG_INCORRECTLY_FILLED_CVC = `${ErrorCodePrefixes.CC_CVC}.921`,\n\n ERROR_MSG_EMPTY_KCP_PWD = `${ErrorCodePrefixes.KCP_PWD}.940`,\n ERROR_MSG_INCORRECTLY_FILLED_KCP_PWD = `${ErrorCodePrefixes.KCP_PWD}.941`,\n\n ERROR_MSG_EMPTY_ACH_ACCOUNT_NUMBER = `${ErrorCodePrefixes.ACH_NUM}.945`,\n ERROR_MSG_INCORRECTLY_FILLED_ACH_ACCOUNT_NUMBER = `${ErrorCodePrefixes.ACH_NUM}.946`,\n\n ERROR_MSG_EMPTY_ACH_BANK_LOCATION_ID = `${ErrorCodePrefixes.ACH_LOC}.947`,\n ERROR_MSG_INCORRECTLY_FILLED_ACH_BANK_LOCATION_ID = `${ErrorCodePrefixes.ACH_LOC}.948`\n}\n\nexport const EMPTY_FIELD_ERROR_MESSAGES = {\n [ENCRYPTED_CARD_NUMBER]: SF_ErrorCodes.ERROR_MSG_EMPTY_PAN,\n [ENCRYPTED_EXPIRY_DATE]: SF_ErrorCodes.ERROR_MSG_EMPTY_DATE,\n [ENCRYPTED_EXPIRY_MONTH]: SF_ErrorCodes.ERROR_MSG_EMPTY_MONTH,\n [ENCRYPTED_EXPIRY_YEAR]: SF_ErrorCodes.ERROR_MSG_EMPTY_YEAR,\n [ENCRYPTED_SECURITY_CODE]: SF_ErrorCodes.ERROR_MSG_EMPTY_CVC,\n [ENCRYPTED_PWD_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_KCP_PWD,\n [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_ACH_ACCOUNT_NUMBER,\n [ENCRYPTED_BANK_LOCATION_FIELD]: SF_ErrorCodes.ERROR_MSG_EMPTY_ACH_BANK_LOCATION_ID\n};\n"],"names":["ARIA_ERROR_SUFFIX","ARIA_CONTEXT_SUFFIX","ERROR_ACTION_FOCUS_FIELD","ERROR_ACTION_BLUR_SCENARIO","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","ERROR_INVALID_FORMAT_EXPECTS","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ErrorCodePrefixes","SF_ErrorCodes","EMPTY_FIELD_ERROR_MESSAGES","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ENCRYPTED_BANK_LOCATION_FIELD"],"mappings":"mTAWO,MAAMA,EAAoB,aACpBC,EAAsB,eAEtBC,EAA2B,aAC3BC,EAA6B,6BAC7BC,EAAuB,uBACvBC,EAAsB,sBAEtBC,EAA+B,yBAC/BC,EAAiC,gCACjCC,EAAgC,+BAChCC,EAAwC,sCAE9C,IAAAC,EAAKA,SAAAA,GAAAA,2JAAAA,CASX,CATWA,CASX,CAAA,GAMWC,EAAAA,SAAAA,GAAAA,y/BAAAA,CAgCX,CAhCWA,CAgCX,CAAA,SAEYC,EAA6B,CACtCC,CAACA,GAAsB,aACvBC,CAACA,GAAsB,aACvBC,CAACA,GAAuB,aACxBC,CAACA,GAAsB,YACvBC,CAACA,GAAwB,aACzBC,CAACA,GAAoB,cACrBC,CAACA,GAAkC,cACnCC,CAACA,GAA8B"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/core/Errors/utils.ts"],"sourcesContent":["import { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD, ErrorCodePrefixes, SF_ErrorCodes } from './constants';\nimport { SFError } from '../../components/Card/components/CardInput/types';\nimport { SortErrorsObj, SortedErrorObject, GenericError, SetSRMessagesReturnObject } from './types';\nimport { ValidationRuleResult } from '../../utils/Validator/ValidationRuleResult';\nimport { ErrorMessageObject } from '../../utils/Validator/types';\nimport {\n ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,\n ENCRYPTED_BANK_LOCATION_FIELD,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_PWD_FIELD,\n ENCRYPTED_SECURITY_CODE\n} from '../../components/internal/SecuredFields/lib/constants';\nimport { AriaConfigObject } from '../../components/internal/SecuredFields/lib/types';\nimport type Language from '../../language';\n\n/**\n * Extract and translate all the errorCodes related to a specific securedField\n * @param i18n\n * @param errorCodeIdentifier - the identifier for which type of errorCodes we need to collect e.g. 'cc-num'\n */\nexport const getTranslatedErrors = (i18n: Language, errorCodeIdentifier: string): Record<SF_ErrorCodes, string> => {\n const transObj = Object.values(SF_ErrorCodes).reduce((acc, value) => {\n // Limit to errors related to specific sf\n if (value.includes(errorCodeIdentifier)) {\n acc[value] = i18n.get(value);\n }\n return acc;\n }, {}) as Record<SF_ErrorCodes, string>;\n\n return transObj;\n};\n\n/**\n * Adds a new error property to an object.\n * This error property is an object containing the translated errors, stored by code, that relate to the securedFields\n * @param originalObject - object we want to duplicate and enhance\n * @param i18n - an i18n object to use to get translations\n * @returns a duplicate of the original object with a new property: \"error\" whose value is a object containing the translated errors\n */\nexport const addErrorTranslationsToObject = (originalObj: AriaConfigObject, i18n: Language, fieldType: string): AriaConfigObject => {\n const nuObj: AriaConfigObject = { ...originalObj };\n\n const errorCodeIdentifier = fieldTypeToErrorCodeIdentifier(fieldType);\n nuObj.error = getTranslatedErrors(i18n, errorCodeIdentifier);\n\n return nuObj;\n};\n\nexport const getErrorMessageFromCode = (errorCode: string, codeMap: Record<string, string>): string => {\n let errMsg = errorCode;\n for (const [key, value] of Object.entries(codeMap)) {\n if (value === errorCode) {\n errMsg = key;\n break;\n }\n }\n return errMsg?.toLowerCase().replace(/[_.\\s]/g, '-');\n};\n\n/**\n * errorCodeIdentifiers must match the prefixes to the numbers in ERROR_CODES (Errors/constants.ts)\n * (Which in turn must match the keys in the translations files)\n */\nconst fieldTypeToErrorCodeIdentifier = (fieldType: string): string => {\n let errorCodeIdentifier;\n switch (fieldType) {\n case ENCRYPTED_CARD_NUMBER:\n errorCodeIdentifier = ErrorCodePrefixes.CC_NUM;\n break;\n case ENCRYPTED_EXPIRY_DATE:\n errorCodeIdentifier = ErrorCodePrefixes.CC_DAT;\n break;\n case ENCRYPTED_EXPIRY_MONTH:\n errorCodeIdentifier = ErrorCodePrefixes.CC_MTH;\n break;\n case ENCRYPTED_EXPIRY_YEAR:\n errorCodeIdentifier = ErrorCodePrefixes.CC_YR;\n break;\n case ENCRYPTED_SECURITY_CODE:\n errorCodeIdentifier = ErrorCodePrefixes.CC_CVC;\n break;\n case ENCRYPTED_PWD_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.KCP_PWD;\n break;\n case ENCRYPTED_BANK_ACCNT_NUMBER_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.ACH_NUM;\n break;\n case ENCRYPTED_BANK_LOCATION_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.ACH_LOC;\n break;\n default:\n }\n return errorCodeIdentifier;\n};\n\n/**\n * sortErrorsByLayout - takes a list of errors and a layout, and returns a sorted array of error objects with translated error messages\n *\n * @param errors - an object containing errors, referenced by field type\n * @param layout - a string[] controlling how the output error objects will be ordered. Required when it is known that the way the error object is populated can vary e.g. Card comp, &/or anything with a country selector\n * @param i18n - our internal Language mechanism\n * @param countrySpecificLabels - some errors are region specific, e.g. in the US \"postal code\" = \"zip code\", so map the fieldType value accordingly (if it is being added to the errorMessage string)\n * @param fieldTypeMappingFn - a component specific lookup function that will tell us both if we need to prepend the field type to the SR panel message, and, if so, will retrieve the correct translation for the field type\n */\nexport const sortErrorsByLayout = ({ errors, i18n, layout, countrySpecificLabels, fieldTypeMappingFn }: SortErrorsObj): SortedErrorObject[] => {\n const SR_INDICATOR_PREFIX = process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test' ? '' : '-sr'; // Useful for testing whether SR is reading out aria-live errors (sr) or aria-describedby ones\n\n // Create array of error objects, sorted by layout\n const sortedErrors: SortedErrorObject[] = Object.entries(errors).reduce((acc, [key, value]) => {\n if (value) {\n const errObj: ValidationRuleResult | SFError | GenericError = errors[key];\n\n const TREAT_AS_SF_ERROR = 'errorI18n' in errObj && `rootNode` in errObj; // look for expected props, unique to an SFError\n\n // Some ValidationRuleResults can be passed an object in the 'errorMessage' prop (to give country specific errors)\n const ERROR_MSG_IS_OBJECT = typeof errObj.errorMessage === 'object';\n\n /**\n * Get error codes - these are used if we need to distinguish between showValidation & onBlur errors\n * - For a ValidationRuleResult or GenericError the error \"code\" is contained in the errorMessage prop.\n * - For an SFError the error \"code\" is contained in the error prop.\n */\n let errorCode: string;\n if (TREAT_AS_SF_ERROR) {\n errorCode = errObj.error;\n } else {\n /** Special handling for Address~postalCode (where the errorMessage is an object) */\n if (ERROR_MSG_IS_OBJECT) {\n /** is ValidationRuleResult w. country specific error */\n errorCode = (errObj.errorMessage as ErrorMessageObject).translationKey;\n } else {\n /** is ValidationRuleResult || GenericError || an as yet incorrectly formed error */\n errorCode = errObj.errorMessage as string;\n }\n }\n\n /**\n * Get corresponding error msg - a translated string we can place into the SRPanel\n * NOTE: the error object for a secured field already contains the error in a translated form (errorI18n).\n * For other fields we still need to translate it, so we use the errObj.errorMessage prop as a translation key\n */\n let errorMsg: string;\n if (TREAT_AS_SF_ERROR && 'errorI18n' in errObj) {\n errorMsg = errObj.errorI18n + SR_INDICATOR_PREFIX;\n } else {\n /**\n * For some fields, for a11y reasons (when the translated error msg doesn't contain a reference to the field it refers to), we need to\n * add the field type into the translated error message.\n *\n * This happens with generic errors\n * e.g. \"field.error.required\": \"Enter the %{label}\"\n * or \"invalid.format.expects\": \"%{label} Invalid format. Expected format: %{format}\"\n */\n const mappedLabel = fieldTypeMappingFn ? fieldTypeMappingFn(key, i18n, countrySpecificLabels) : ''; // Retrieve the translated field name, if required\n\n /** Special handling for Address~postalCode where the errorMessage object contains the details of the country specific format that should have been used for the postcode */\n if (ERROR_MSG_IS_OBJECT) {\n /** is ValidationRuleResult w. country specific error */\n const translationKey = (errObj.errorMessage as ErrorMessageObject).translationKey;\n const countrySpecificFormat = (errObj.errorMessage as ErrorMessageObject).translationObject.values.format;\n\n errorMsg = `${i18n.get(translationKey, { values: { label: mappedLabel, format: countrySpecificFormat } })}${SR_INDICATOR_PREFIX}`;\n } else {\n /** is ValidationRuleResult || GenericError || an as yet incorrectly formed error */\n errorMsg = i18n.get(errObj.errorMessage as string, { values: { label: mappedLabel } }) + SR_INDICATOR_PREFIX;\n }\n }\n\n acc.push({ field: key, errorMessage: errorMsg, errorCode });\n\n if (layout) acc.sort((a, b) => layout.indexOf(a.field) - layout.indexOf(b.field));\n }\n return acc;\n }, []);\n\n return sortedErrors;\n};\n\n/**\n * Implemented as a partial, with an object containing the first 6 arguments; then the final argument, errors, is passed to the partial\n *\n * NOTE: using this generic error setting fny is only suitable when errors for the SRPanel are *only* generated by showValidation().\n * When errors are also generated onBlur, as the user leaves the input, the SR message generation becomes more complex - see CardInput as an example\n */\nexport const setSRMessagesFromErrors = (\n { i18n, fieldTypeMappingFn, SRPanelRef },\n { errors, isValidating, layout, countrySpecificLabels }\n): SetSRMessagesReturnObject => {\n const currentErrorsSortedByLayout = sortErrorsByLayout({\n errors,\n i18n,\n fieldTypeMappingFn,\n countrySpecificLabels,\n layout\n });\n\n const doLog = false;\n\n if (doLog) console.log('### setSRMessagesFromErrors::currentErrorsSortedByLayout:: ', currentErrorsSortedByLayout);\n\n if (currentErrorsSortedByLayout.length) {\n /** If validating i.e. \"on submit\" type event - then display all errors in the SR panel */\n if (isValidating) {\n const errorMsgArr: string[] = currentErrorsSortedByLayout.map(errObj => errObj.errorMessage);\n if (doLog) console.log('### setSRMessagesFromErrors:: #1 multiple errors:: (validating) errorMsgArr=', errorMsgArr);\n SRPanelRef.setMessages(errorMsgArr);\n\n const fieldListArr: string[] = currentErrorsSortedByLayout.map(errObj => errObj.field);\n return { currentErrorsSortedByLayout, action: ERROR_ACTION_FOCUS_FIELD, fieldToFocus: fieldListArr[0] };\n } else {\n // prettier-ignore\n if (doLog) console.log('### setSRMessagesFromErrors:: #3 on blur scenario:: not validating but there might be an error, either to set or to clear');\n SRPanelRef?.setMessages(null);\n\n return { currentErrorsSortedByLayout, action: ERROR_ACTION_BLUR_SCENARIO }; // on blur scenario: not validating but there might be an error, either to set or to clear\n }\n } else {\n if (doLog) console.log('### setSRMessagesFromErrors::componentDidUpdate:: #4 clearing errors:: NO currentErrorsSortedByLayout');\n SRPanelRef?.setMessages(null); // no errors - so clear SR panel\n return { currentErrorsSortedByLayout, action: 'none' };\n }\n};\n\nexport const enhanceErrorObjectKeys = (errorObj, keyPrefix) => {\n if (!errorObj) return null;\n const enhancedObj = Object.entries(errorObj).reduce((acc, [key, value]) => {\n if (value) {\n const newKey = `${keyPrefix}${key}`;\n acc[newKey] = value;\n }\n return acc;\n }, {});\n\n return enhancedObj;\n};\n"],"names":["getTranslatedErrors","i18n","errorCodeIdentifier","Object","values","SF_ErrorCodes","reduce","acc","value","includes","get","addErrorTranslationsToObject","originalObj","fieldType","nuObj","fieldTypeToErrorCodeIdentifier","error","getErrorMessageFromCode","errorCode","codeMap","errMsg","key","entries","toLowerCase","replace","ENCRYPTED_CARD_NUMBER","ErrorCodePrefixes","CC_NUM","ENCRYPTED_EXPIRY_DATE","CC_DAT","ENCRYPTED_EXPIRY_MONTH","CC_MTH","ENCRYPTED_EXPIRY_YEAR","CC_YR","ENCRYPTED_SECURITY_CODE","CC_CVC","ENCRYPTED_PWD_FIELD","KCP_PWD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ACH_NUM","ENCRYPTED_BANK_LOCATION_FIELD","ACH_LOC","sortErrorsByLayout","errors","layout","countrySpecificLabels","fieldTypeMappingFn","errObj","TREAT_AS_SF_ERROR","ERROR_MSG_IS_OBJECT","errorMessage","errorMsg","translationKey","errorI18n","mappedLabel","countrySpecificFormat","translationObject","format","label","push","field","sort","a","b","indexOf","setSRMessagesFromErrors","SRPanelRef","isValidating","currentErrorsSortedByLayout","length","errorMsgArr","map","setMessages","fieldListArr","action","ERROR_ACTION_FOCUS_FIELD","fieldToFocus","ERROR_ACTION_BLUR_SCENARIO","enhanceErrorObjectKeys","errorObj","keyPrefix","enhancedObj"],"mappings":"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"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/core/Errors/utils.ts"],"sourcesContent":["import { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD, ErrorCodePrefixes, SF_ErrorCodes } from './constants';\nimport { SFError } from '../../components/Card/components/CardInput/types';\nimport { SortErrorsObj, SortedErrorObject, GenericError, SetSRMessagesReturnObject } from './types';\nimport { ValidationRuleResult } from '../../utils/Validator/ValidationRuleResult';\nimport { ErrorMessageObject } from '../../utils/Validator/types';\nimport {\n ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,\n ENCRYPTED_BANK_LOCATION_FIELD,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_PWD_FIELD,\n ENCRYPTED_SECURITY_CODE\n} from '../../components/internal/SecuredFields/lib/constants';\nimport { AriaConfigObject } from '../../components/internal/SecuredFields/lib/types';\nimport type Language from '../../language';\n\n/**\n * Extract and translate all the errorCodes related to a specific securedField\n * @param i18n\n * @param errorCodeIdentifier - the identifier for which type of errorCodes we need to collect e.g. 'cc-num'\n */\nexport const getTranslatedErrors = (i18n: Language, errorCodeIdentifier: string): Record<SF_ErrorCodes, string> => {\n const transObj = Object.values(SF_ErrorCodes).reduce((acc, value) => {\n // Limit to errors related to specific sf\n if (value.includes(errorCodeIdentifier)) {\n acc[value] = i18n.get(value);\n }\n return acc;\n }, {}) as Record<SF_ErrorCodes, string>;\n\n return transObj;\n};\n\n/**\n * Adds a new error property to an object.\n * This error property is an object containing the translated errors, stored by code, that relate to the securedFields\n * @param originalObject - object we want to duplicate and enhance\n * @param i18n - an i18n object to use to get translations\n * @returns a duplicate of the original object with a new property: \"error\" whose value is a object containing the translated errors\n */\nexport const addErrorTranslationsToObject = (originalObj: AriaConfigObject, i18n: Language, fieldType: string): AriaConfigObject => {\n const nuObj: AriaConfigObject = { ...originalObj };\n\n const errorCodeIdentifier = fieldTypeToErrorCodeIdentifier(fieldType);\n nuObj.error = getTranslatedErrors(i18n, errorCodeIdentifier);\n\n return nuObj;\n};\n\nexport const getErrorMessageFromCode = (errorCode: string, codeMap: Record<string, string>): string => {\n let errMsg = errorCode;\n for (const [key, value] of Object.entries(codeMap)) {\n if (value === errorCode) {\n errMsg = key;\n break;\n }\n }\n return errMsg?.toLowerCase().replace(/[_.\\s]/g, '-');\n};\n\n/**\n * errorCodeIdentifiers must match the prefixes to the numbers in ERROR_CODES (Errors/constants.ts)\n * (Which in turn must match the keys in the translations files)\n */\nconst fieldTypeToErrorCodeIdentifier = (fieldType: string): string => {\n let errorCodeIdentifier;\n switch (fieldType) {\n case ENCRYPTED_CARD_NUMBER:\n errorCodeIdentifier = ErrorCodePrefixes.CC_NUM;\n break;\n case ENCRYPTED_EXPIRY_DATE:\n errorCodeIdentifier = ErrorCodePrefixes.CC_DAT;\n break;\n case ENCRYPTED_EXPIRY_MONTH:\n errorCodeIdentifier = ErrorCodePrefixes.CC_MTH;\n break;\n case ENCRYPTED_EXPIRY_YEAR:\n errorCodeIdentifier = ErrorCodePrefixes.CC_YR;\n break;\n case ENCRYPTED_SECURITY_CODE:\n errorCodeIdentifier = ErrorCodePrefixes.CC_CVC;\n break;\n case ENCRYPTED_PWD_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.KCP_PWD;\n break;\n case ENCRYPTED_BANK_ACCNT_NUMBER_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.ACH_NUM;\n break;\n case ENCRYPTED_BANK_LOCATION_FIELD:\n errorCodeIdentifier = ErrorCodePrefixes.ACH_LOC;\n break;\n default:\n }\n return errorCodeIdentifier;\n};\n\n/**\n * sortErrorsByLayout - takes a list of errors and a layout, and returns a sorted array of error objects with translated error messages\n *\n * @param errors - an object containing errors, referenced by field type\n * @param layout - a string[] controlling how the output error objects will be ordered. Required when it is known that the way the error object is populated can vary e.g. Card comp, &/or anything with a country selector\n * @param i18n - our internal Language mechanism\n * @param countrySpecificLabels - some errors are region specific, e.g. in the US \"postal code\" = \"zip code\", so map the fieldType value accordingly (if it is being added to the errorMessage string)\n * @param fieldTypeMappingFn - a component specific lookup function that will tell us both if we need to prepend the field type to the SR panel message, and, if so, will retrieve the correct translation for the field type\n */\nexport const sortErrorsByLayout = ({ errors, i18n, layout, countrySpecificLabels, fieldTypeMappingFn }: SortErrorsObj): SortedErrorObject[] => {\n const SR_INDICATOR_PREFIX = process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test' ? '' : '-sr'; // Useful for testing whether SR is reading out aria-live errors (sr) or aria-describedby ones\n\n // Create array of error objects, sorted by layout\n const sortedErrors: SortedErrorObject[] = Object.entries(errors).reduce((acc, [key, value]) => {\n if (value) {\n const errObj: ValidationRuleResult | SFError | GenericError = errors[key];\n\n const TREAT_AS_SF_ERROR = 'errorI18n' in errObj && `rootNode` in errObj; // look for expected props, unique to an SFError\n\n // Some ValidationRuleResults can be passed an object in the 'errorMessage' prop (to give country specific errors)\n const ERROR_MSG_IS_OBJECT = typeof errObj.errorMessage === 'object';\n\n /**\n * Get error codes - these are used if we need to distinguish between showValidation & onBlur errors\n * - For a ValidationRuleResult or GenericError the error \"code\" is contained in the errorMessage prop.\n * - For an SFError the error \"code\" is contained in the error prop.\n */\n let errorCode: string;\n if (TREAT_AS_SF_ERROR) {\n errorCode = errObj.error;\n } else {\n /** Special handling for Address~postalCode (where the errorMessage is an object) */\n if (ERROR_MSG_IS_OBJECT) {\n /** is ValidationRuleResult w. country specific error */\n errorCode = (errObj.errorMessage as ErrorMessageObject).translationKey;\n } else {\n /** is ValidationRuleResult || GenericError || an as yet incorrectly formed error */\n errorCode = errObj.errorMessage as string;\n }\n }\n\n /**\n * Get corresponding error msg - a translated string we can place into the SRPanel\n * NOTE: the error object for a secured field already contains the error in a translated form (errorI18n).\n * For other fields we still need to translate it, so we use the errObj.errorMessage prop as a translation key\n */\n let errorMsg: string;\n if (TREAT_AS_SF_ERROR && 'errorI18n' in errObj) {\n errorMsg = errObj.errorI18n + SR_INDICATOR_PREFIX;\n } else {\n /**\n * For some fields, for a11y reasons (when the translated error msg doesn't contain a reference to the field it refers to), we need to\n * add the field type into the translated error message.\n *\n * This happens with generic errors\n * e.g. \"field.error.required\": \"Enter the %{label}\"\n * or \"invalid.format.expects\": \"%{label} Invalid format. Expected format: %{format}\"\n */\n const mappedLabel = fieldTypeMappingFn ? fieldTypeMappingFn(key, i18n, countrySpecificLabels) : ''; // Retrieve the translated field name, if required\n\n /** Special handling for Address~postalCode where the errorMessage object contains the details of the country specific format that should have been used for the postcode */\n if (ERROR_MSG_IS_OBJECT) {\n /** is ValidationRuleResult w. country specific error */\n const translationKey = (errObj.errorMessage as ErrorMessageObject).translationKey;\n const countrySpecificFormat = (errObj.errorMessage as ErrorMessageObject).translationObject.values.format;\n\n errorMsg = `${i18n.get(translationKey, { values: { label: mappedLabel, format: countrySpecificFormat } })}${SR_INDICATOR_PREFIX}`;\n } else {\n /** is ValidationRuleResult || GenericError || an as yet incorrectly formed error */\n errorMsg = i18n.get(errObj.errorMessage as string, { values: { label: mappedLabel } }) + SR_INDICATOR_PREFIX;\n }\n }\n\n acc.push({ field: key, errorMessage: errorMsg, errorCode });\n\n if (layout) acc.sort((a, b) => layout.indexOf(a.field) - layout.indexOf(b.field));\n }\n return acc;\n }, []);\n\n return sortedErrors;\n};\n\n/**\n * Implemented as a partial, with an object containing the first 6 arguments; then the final argument, errors, is passed to the partial\n *\n * NOTE: using this generic error setting fny is only suitable when errors for the SRPanel are *only* generated by showValidation().\n * When errors are also generated onBlur, as the user leaves the input, the SR message generation becomes more complex - see CardInput as an example\n */\nexport const setSRMessagesFromErrors = (\n { i18n, fieldTypeMappingFn, SRPanelRef },\n { errors, isValidating, layout, countrySpecificLabels }\n): SetSRMessagesReturnObject => {\n const currentErrorsSortedByLayout = sortErrorsByLayout({\n errors,\n i18n,\n fieldTypeMappingFn,\n countrySpecificLabels,\n layout\n });\n\n const doLog = false;\n\n if (doLog) console.log('### setSRMessagesFromErrors::currentErrorsSortedByLayout:: ', currentErrorsSortedByLayout);\n\n if (currentErrorsSortedByLayout.length) {\n /** If validating i.e. \"on submit\" type event - then display all errors in the SR panel */\n if (isValidating) {\n const errorMsgArr: string[] = currentErrorsSortedByLayout.map(errObj => errObj.errorMessage);\n if (doLog) console.log('### setSRMessagesFromErrors:: #1 multiple errors:: (validating) errorMsgArr=', errorMsgArr);\n SRPanelRef.setMessages(errorMsgArr);\n\n const fieldListArr: string[] = currentErrorsSortedByLayout.map(errObj => errObj.field);\n return { currentErrorsSortedByLayout, action: ERROR_ACTION_FOCUS_FIELD, fieldToFocus: fieldListArr[0] };\n } else {\n // prettier-ignore\n if (doLog) console.log('### setSRMessagesFromErrors:: #3 on blur scenario:: not validating but there might be an error, either to set or to clear');\n SRPanelRef?.setMessages(null);\n\n return { currentErrorsSortedByLayout, action: ERROR_ACTION_BLUR_SCENARIO }; // on blur scenario: not validating but there might be an error, either to set or to clear\n }\n } else {\n if (doLog) console.log('### setSRMessagesFromErrors::componentDidUpdate:: #4 clearing errors:: NO currentErrorsSortedByLayout');\n SRPanelRef?.setMessages(null); // no errors - so clear SR panel\n return { currentErrorsSortedByLayout, action: 'none' };\n }\n};\n\nexport const enhanceErrorObjectKeys = (errorObj, keyPrefix) => {\n if (!errorObj) return null;\n const enhancedObj = Object.entries(errorObj).reduce((acc, [key, value]) => {\n if (value) {\n const newKey = `${keyPrefix}${key}`;\n acc[newKey] = value;\n }\n return acc;\n }, {});\n\n return enhancedObj;\n};\n"],"names":["getTranslatedErrors","i18n","errorCodeIdentifier","Object","values","SF_ErrorCodes","reduce","acc","value","includes","get","addErrorTranslationsToObject","originalObj","fieldType","nuObj","fieldTypeToErrorCodeIdentifier","error","getErrorMessageFromCode","errorCode","codeMap","errMsg","key","entries","toLowerCase","replace","ENCRYPTED_CARD_NUMBER","ErrorCodePrefixes","CC_NUM","ENCRYPTED_EXPIRY_DATE","CC_DAT","ENCRYPTED_EXPIRY_MONTH","CC_MTH","ENCRYPTED_EXPIRY_YEAR","CC_YR","ENCRYPTED_SECURITY_CODE","CC_CVC","ENCRYPTED_PWD_FIELD","KCP_PWD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ACH_NUM","ENCRYPTED_BANK_LOCATION_FIELD","ACH_LOC","sortErrorsByLayout","errors","layout","countrySpecificLabels","fieldTypeMappingFn","errObj","TREAT_AS_SF_ERROR","ERROR_MSG_IS_OBJECT","errorMessage","errorMsg","translationKey","errorI18n","mappedLabel","countrySpecificFormat","translationObject","format","label","push","field","sort","a","b","indexOf","setSRMessagesFromErrors","SRPanelRef","isValidating","currentErrorsSortedByLayout","length","errorMsgArr","map","setMessages","fieldListArr","action","ERROR_ACTION_FOCUS_FIELD","fieldToFocus","ERROR_ACTION_BLUR_SCENARIO","enhanceErrorObjectKeys","errorObj","keyPrefix","enhancedObj"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:c,bundleType:a})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${c}?clientKey=${r}`};return n=>{const c={version:"6.6.0",channel:"Web",platform:"Web",buildType:a,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),d=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(d)?Promise.resolve(d.id):(l=e(s,c).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
1
+ import{httpPost as e}from"../http.js";import t from"../../../utils/Storage.js";const o='WARNING: Failed to retrieve "checkoutAttemptId". Consequently, analytics will not be available for this payment. The payment process, however, will not be affected.';const n=({analyticsContext:n,clientKey:r,locale:i,analyticsPath:c,bundleType:a})=>{let l;const s={errorLevel:"fatal",loadingContext:n,path:`${c}?clientKey=${r}`};return n=>{const c={version:"6.8.0",channel:"Web",platform:"Web",buildType:a,locale:i,referrer:window.location.href,screenWidth:window.screen.width,...n};if(l)return l;if(!r)return Promise.reject("no-client-key");const m=new t("checkout-attempt-id","sessionStorage"),d=m.get();return function(e){if(!e?.id)return!1;const t=Date.now()-9e5;return e.timestamp>t}(d)?Promise.resolve(d.id):(l=e(s,c).then((e=>{if(e?.checkoutAttemptId)return m.set({id:e.checkoutAttemptId,timestamp:Date.now()}),e.checkoutAttemptId})).catch((()=>Promise.reject(o))),l)}};export{o as FAILURE_MSG,n as default};
2
2
  //# sourceMappingURL=collect-id.js.map
@@ -1,2 +1,2 @@
1
- import{FALLBACK_CONTEXT as e,DEFAULT_HTTP_TIMEOUT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,a){const{headers:i=[],errorLevel:s="warn",loadingContext:c=e,method:l="GET",path:f,timeout:d=r}=t,u={method:l,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===l?"application/json":"text/plain",...i},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(d)},...a&&{body:JSON.stringify(a)}},h=`${c}${f}`;return fetch(h,u).then((async e=>{const r=await e.json();if(e.ok)return r;if(function(e){return e&&e.errorCode&&e.errorType&&e.message&&e.status}(r))return void n(r.message,s,r);n(t.errorMessage||`Service at ${h} is not available`,s,r)})).catch((e=>{if(e instanceof o)throw e;n(t.errorMessage||`Call to ${h} failed. Error= ${e}`,s,e)}))}function n(e,r,t){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e,{cause:t})}}function a(e,r){return t({...e,method:"GET"},r)}function i(e,r){return t({...e,method:"POST"},r)}export{t as http,a as httpGet,i as httpPost};
1
+ import{FALLBACK_CONTEXT as e,DEFAULT_HTTP_TIMEOUT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,n){const{headers:s=[],errorLevel:c="warn",errorCode:i,loadingContext:l=e,method:d="GET",path:u,timeout:f=r}=t,m={method:d,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===d?"application/json":"text/plain",...s},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(f)},...n&&{body:JSON.stringify(n)}},g=`${l}${u}`;return fetch(g,m).then((async e=>{const r=await e.json();if(e.ok)return r;if(function(e){return e&&e.errorCode&&e.errorType&&e.message&&e.status}(r))return void a({message:r.message,level:c,cause:r,code:i});a({message:t.errorMessage||`Service at ${g} is not available`,level:c,cause:r,code:i})})).catch((e=>{if(e instanceof o)throw e;a({message:t.errorMessage||`Call to ${g} failed. Error= ${e}`,level:c,cause:e,code:i})}))}function a({message:e,level:r,cause:t,code:a}){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e,{cause:t,code:a})}}function n(e,r){return t({...e,method:"GET"},r)}function s(e,r){return t({...e,method:"POST"},r)}export{t as http,n as httpGet,s as httpPost};
2
2
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n headers?;\n loadingContext?: string;\n method?: string;\n path: string;\n timeout?: number;\n errorLevel?: ErrorLevel;\n errorMessage?: string;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\ntype AdyenApiErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenApiErrorResponse(data: any): data is AdyenApiErrorResponse {\n return data && data.errorCode && data.errorType && data.message && data.status;\n}\n\nexport function http<T>(options: HttpOptions, data?: any): Promise<T> {\n const { headers = [], errorLevel = 'warn', loadingContext = FALLBACK_CONTEXT, method = 'GET', path, timeout = DEFAULT_HTTP_TIMEOUT } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) }),\n ...(data && { body: JSON.stringify(data) })\n };\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n const data = await response.json();\n\n if (response.ok) {\n return data;\n }\n\n if (isAdyenApiErrorResponse(data)) {\n handleFetchError(data.message, errorLevel, data);\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError(errorMessage, errorLevel, data);\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch((error: unknown) => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string,@typescript-eslint/restrict-template-expressions\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError(errorMessage, errorLevel, error);\n })\n );\n}\n\nfunction handleFetchError(message: string, level: ErrorLevel, error: unknown): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message, { cause: error });\n }\n}\n\nexport function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","data","headers","errorLevel","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","json","ok","errorCode","errorType","message","status","isAdyenApiErrorResponse","handleFetchError","errorMessage","catch","error","AdyenCheckoutError","level","console","cause","httpGet","httpPost"],"mappings":"yHA4BO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QAAEA,EAAU,GAAEC,WAAEA,EAAa,OAAMC,eAAEA,EAAiBC,EAAgBC,OAAEA,EAAS,MAAKC,KAAEA,EAAIC,QAAEA,EAAUC,GAAyBT,EAEjIU,EAAuB,CACzBJ,SACAK,KAAM,OACNC,MAAO,UACPC,YAAa,cACbX,QAAS,CACLY,OAAQ,oCACR,eAA2B,SAAXR,EAAoB,mBAAqB,gBACtDJ,GAEPa,SAAU,SACVC,eAAgB,gCACZC,aAAaT,SAAW,CAAEU,OAAQD,aAAaT,QAAQA,OACvDP,GAAQ,CAAEkB,KAAMC,KAAKC,UAAUpB,KAGjCqB,EAAM,GAAGlB,IAAiBG,IAEhC,OACIgB,MAAMD,EAAKZ,GACNc,MAAKC,MAAMC,IACR,MAAMzB,QAAayB,EAASC,OAE5B,GAAID,EAASE,GACT,OAAO3B,EAGX,GAlChB,SAAiCA,GAC7B,OAAOA,GAAQA,EAAK4B,WAAa5B,EAAK6B,WAAa7B,EAAK8B,SAAW9B,EAAK+B,MAC5E,CAgCoBC,CAAwBhC,GAExB,YADAiC,EAAiBjC,EAAK8B,QAAS5B,EAAYF,GAK/CiC,EADqBlC,EAAQmC,cAAgB,cAAcb,qBAC5BnB,EAAYF,EAC3C,IAMHmC,OAAOC,IAMJ,GAAIA,aAAiBC,EACjB,MAAMD,EAKVH,EADqBlC,EAAQmC,cAAgB,WAAWb,oBAAsBe,IAC/ClC,EAAYkC,EAAAA,GAG3D,CAEA,SAASH,EAAiBH,EAAiBQ,EAAmBF,GAC1D,OAAQE,GACJ,IAAK,SACD,MAEJ,IAAK,OACL,IAAK,OACL,IAAK,QACDC,QAAQD,GAAOR,GACf,MAEJ,QACI,MAAM,IAAIO,EAAmB,gBAAiBP,EAAS,CAAEU,MAAOJ,IAE5E,CAEO,SAASK,EAAiB1C,EAAsBC,GACnD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,OAASL,EAClD,CAEO,SAAS0C,EAAkB3C,EAAsBC,GACpD,OAAOF,EAAQ,IAAKC,EAASM,OAAQ,QAAUL,EACnD"}
1
+ {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n headers?;\n loadingContext?: string;\n method?: string;\n path: string;\n timeout?: number;\n errorLevel?: ErrorLevel;\n errorMessage?: string;\n errorCode?: string;\n}\n\ninterface FetchErrorOptions {\n message?: string;\n level?: ErrorLevel;\n cause?: unknown;\n code?: string;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\ntype AdyenApiErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenApiErrorResponse(data: any): data is AdyenApiErrorResponse {\n return data && data.errorCode && data.errorType && data.message && data.status;\n}\n\nexport function http<T>(options: HttpOptions, data?: any): Promise<T> {\n const {\n headers = [],\n errorLevel = 'warn',\n errorCode,\n loadingContext = FALLBACK_CONTEXT,\n method = 'GET',\n path,\n timeout = DEFAULT_HTTP_TIMEOUT\n } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) }),\n ...(data && { body: JSON.stringify(data) })\n };\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n const data = await response.json();\n\n if (response.ok) {\n return data;\n }\n\n if (isAdyenApiErrorResponse(data)) {\n handleFetchError({ message: data.message, level: errorLevel, cause: data, code: errorCode });\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: data, code: errorCode });\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch((error: unknown) => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string,@typescript-eslint/restrict-template-expressions\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: error, code: errorCode });\n })\n );\n}\n\nfunction handleFetchError({ message, level, cause, code }: FetchErrorOptions): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message, { cause, code });\n }\n}\n\nexport function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","data","headers","errorLevel","errorCode","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","json","ok","errorType","message","status","isAdyenApiErrorResponse","handleFetchError","level","cause","code","errorMessage","catch","error","AdyenCheckoutError","console","httpGet","httpPost"],"mappings":"yHAoCO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QACFA,EAAU,GAAEC,WACZA,EAAa,OAAMC,UACnBA,EAASC,eACTA,EAAiBC,EAAgBC,OACjCA,EAAS,MAAKC,KACdA,EAAIC,QACJA,EAAUC,GACVV,EAEEW,EAAuB,CACzBJ,SACAK,KAAM,OACNC,MAAO,UACPC,YAAa,cACbZ,QAAS,CACLa,OAAQ,oCACR,eAA2B,SAAXR,EAAoB,mBAAqB,gBACtDL,GAEPc,SAAU,SACVC,eAAgB,gCACZC,aAAaT,SAAW,CAAEU,OAAQD,aAAaT,QAAQA,OACvDR,GAAQ,CAAEmB,KAAMC,KAAKC,UAAUrB,KAGjCsB,EAAM,GAAGlB,IAAiBG,IAEhC,OACIgB,MAAMD,EAAKZ,GACNc,MAAKC,MAAMC,IACR,MAAM1B,QAAa0B,EAASC,OAE5B,GAAID,EAASE,GACT,OAAO5B,EAGX,GA1ChB,SAAiCA,GAC7B,OAAOA,GAAQA,EAAKG,WAAaH,EAAK6B,WAAa7B,EAAK8B,SAAW9B,EAAK+B,MAC5E,CAwCoBC,CAAwBhC,GAExB,YADAiC,EAAiB,CAAEH,QAAS9B,EAAK8B,QAASI,MAAOhC,EAAYiC,MAAOnC,EAAMoC,KAAMjC,IAKpF8B,EAAiB,CAAEH,QADE/B,EAAQsC,cAAgB,cAAcf,qBACjBY,MAAOhC,EAAYiC,MAAOnC,EAAMoC,KAAMjC,GAChF,IAMHmC,OAAOC,IAMJ,GAAIA,aAAiBC,EACjB,MAAMD,EAKVN,EAAiB,CAAEH,QADE/B,EAAQsC,cAAgB,WAAWf,oBAAsBiB,IACpCL,MAAOhC,EAAYiC,MAAOI,EAAOH,KAAMjC,GAAU,GAG3G,CAEA,SAAS8B,GAAiBH,QAAEA,EAAOI,MAAEA,EAAKC,MAAEA,EAAKC,KAAEA,IAC/C,OAAQF,GACJ,IAAK,SACD,MAEJ,IAAK,OACL,IAAK,OACL,IAAK,QACDO,QAAQP,GAAOJ,GACf,MAEJ,QACI,MAAM,IAAIU,EAAmB,gBAAiBV,EAAS,CAAEK,QAAOC,SAE5E,CAEO,SAASM,EAAiB3C,EAAsBC,GACnD,OAAOF,EAAQ,IAAKC,EAASO,OAAQ,OAASN,EAClD,CAEO,SAAS2C,EAAkB5C,EAAsBC,GACpD,OAAOF,EAAQ,IAAKC,EAASO,OAAQ,QAAUN,EACnD"}
@@ -1,2 +1,2 @@
1
- const o="v1";export{o as API_VERSION};
1
+ const e="v1",t={makePayments:"620",submitPaymentDetails:"621",submitThreeDS2Fingerprint:"622",createOrder:"623"};export{t as API_ERROR_CODE,e as API_VERSION};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/core/Services/sessions/constants.ts"],"sourcesContent":["export const API_VERSION = 'v1';\n"],"names":["API_VERSION"],"mappings":"AAAO,MAAMA,EAAc"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/core/Services/sessions/constants.ts"],"sourcesContent":["export const API_VERSION = 'v1';\n\n// Same error code will be sent to the analytics\nexport const API_ERROR_CODE = {\n makePayments: '620',\n submitPaymentDetails: '621',\n submitThreeDS2Fingerprint: '622',\n createOrder: '623'\n};\n"],"names":["API_VERSION","API_ERROR_CODE","makePayments","submitPaymentDetails","submitThreeDS2Fingerprint","createOrder"],"mappings":"AAAO,MAAMA,EAAc,KAGdC,EAAiB,CAC1BC,aAAc,MACdC,qBAAsB,MACtBC,0BAA2B,MAC3BC,YAAa"}
@@ -1,2 +1,2 @@
1
- import{httpPost as t}from"../http.js";import{API_VERSION as o}from"./constants.js";function e(e){const n=`${o}/sessions/${e.id}/orders?clientKey=${e.clientKey}`,s={sessionData:e.data};return t({loadingContext:e.loadingContext,path:n,errorLevel:"fatal"},s)}export{e as default};
1
+ import{httpPost as t}from"../http.js";import{API_VERSION as e,API_ERROR_CODE as o}from"./constants.js";function r(r){const n=`${e}/sessions/${r.id}/orders?clientKey=${r.clientKey}`,s={sessionData:r.data};return t({loadingContext:r.loadingContext,path:n,errorLevel:"fatal",errorCode:o.createOrder},s)}export{r as default};
2
2
  //# sourceMappingURL=create-order.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-order.js","sources":["../../../../../src/core/Services/sessions/create-order.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionOrdersResponse } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\n/**\n */\nfunction createOrder(session: Session): Promise<CheckoutSessionOrdersResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/orders?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal' }, data);\n}\n\nexport default createOrder;\n"],"names":["createOrder","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel"],"mappings":"mFAOA,SAASA,EAAYC,GACjB,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,uBAAuBH,EAAQI,YACzEC,EAAO,CACTC,YAAaN,EAAQK,MAGzB,OAAOE,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,SAAWJ,EAC3F"}
1
+ {"version":3,"file":"create-order.js","sources":["../../../../../src/core/Services/sessions/create-order.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionOrdersResponse } from '../../CheckoutSession/types';\nimport { API_ERROR_CODE, API_VERSION } from './constants';\n\n/**\n */\nfunction createOrder(session: Session): Promise<CheckoutSessionOrdersResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/orders?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal', errorCode: API_ERROR_CODE.createOrder }, data);\n}\n\nexport default createOrder;\n"],"names":["createOrder","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel","errorCode","API_ERROR_CODE"],"mappings":"uGAOA,SAASA,EAAYC,GACjB,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,uBAAuBH,EAAQI,YACzEC,EAAO,CACTC,YAAaN,EAAQK,MAGzB,OAAOE,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,QAASC,UAAWC,EAAeZ,aAAeM,EAClI"}
@@ -1,2 +1,2 @@
1
- import{httpPost as t}from"../http.js";import{API_VERSION as e}from"./constants.js";function n(n,o){const s=`${e}/sessions/${o.id}/payments?clientKey=${o.clientKey}`,a={sessionData:o.data,...n};return t({loadingContext:o.loadingContext,path:s,errorLevel:"fatal"},a)}export{n as default};
1
+ import{httpPost as t}from"../http.js";import{API_VERSION as e,API_ERROR_CODE as o}from"./constants.js";function n(n,a){const s=`${e}/sessions/${a.id}/payments?clientKey=${a.clientKey}`,r={sessionData:a.data,...n};return t({loadingContext:a.loadingContext,path:s,errorLevel:"fatal",errorCode:o.makePayments},r)}export{n as default};
2
2
  //# sourceMappingURL=make-payment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"make-payment.js","sources":["../../../../../src/core/Services/sessions/make-payment.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionPaymentResponse } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\n/**\n */\nfunction makePayment(paymentRequest, session: Session): Promise<CheckoutSessionPaymentResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/payments?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...paymentRequest\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal' }, data);\n}\n\nexport default makePayment;\n"],"names":["makePayment","paymentRequest","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel"],"mappings":"mFAOA,SAASA,EAAYC,EAAgBC,GACjC,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,yBAAyBH,EAAQI,YAC3EC,EAAO,CACTC,YAAaN,EAAQK,QAClBN,GAGP,OAAOQ,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,SAAWJ,EAC3F"}
1
+ {"version":3,"file":"make-payment.js","sources":["../../../../../src/core/Services/sessions/make-payment.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionPaymentResponse } from '../../CheckoutSession/types';\nimport { API_ERROR_CODE, API_VERSION } from './constants';\n\n/**\n */\nfunction makePayment(paymentRequest, session: Session): Promise<CheckoutSessionPaymentResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/payments?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...paymentRequest\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal', errorCode: API_ERROR_CODE.makePayments }, data);\n}\n\nexport default makePayment;\n"],"names":["makePayment","paymentRequest","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel","errorCode","API_ERROR_CODE","makePayments"],"mappings":"uGAOA,SAASA,EAAYC,EAAgBC,GACjC,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,yBAAyBH,EAAQI,YAC3EC,EAAO,CACTC,YAAaN,EAAQK,QAClBN,GAGP,OAAOQ,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,QAASC,UAAWC,EAAeC,cAAgBP,EACnI"}
@@ -1 +1 @@
1
- {"version":3,"file":"setup-session.js","sources":["../../../../../src/core/Services/sessions/setup-session.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionSetupResponse, SetupSessionOptions } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\nfunction setupSession(session: Session, options: SetupSessionOptions): Promise<CheckoutSessionSetupResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/setup?clientKey=${session.clientKey}`;\n const data = {\n browserInfo: options.browserInfo,\n sessionData: session.data,\n ...(options.order\n ? {\n order: { orderData: options.order.orderData, pspReference: options.order.pspReference }\n }\n : {})\n };\n\n return httpPost<CheckoutSessionSetupResponse>(\n {\n loadingContext: session.loadingContext,\n path,\n errorLevel: 'fatal'\n },\n data\n );\n}\n\nexport default setupSession;\n"],"names":["setupSession","session","options","path","API_VERSION","id","clientKey","data","browserInfo","sessionData","order","orderData","pspReference","httpPost","loadingContext","errorLevel"],"mappings":"mFAKA,SAASA,EAAaC,EAAkBC,GACpC,MAAMC,EAAO,GAAGC,cAAwBH,EAAQI,sBAAsBJ,EAAQK,YACxEC,EAAO,CACTC,YAAaN,EAAQM,YACrBC,YAAaR,EAAQM,QACjBL,EAAQQ,MACN,CACIA,MAAO,CAAEC,UAAWT,EAAQQ,MAAMC,UAAWC,aAAcV,EAAQQ,MAAME,eAE7E,CAAE,GAGZ,OAAOC,EACH,CACIC,eAAgBb,EAAQa,eACxBX,OACAY,WAAY,SAEhBR,EAER"}
1
+ {"version":3,"file":"setup-session.js","sources":["../../../../../src/core/Services/sessions/setup-session.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { CheckoutSessionSetupResponse, SetupSessionOptions } from '../../CheckoutSession/types';\nimport { API_VERSION } from './constants';\n\nfunction setupSession(session: Session, options: SetupSessionOptions): Promise<CheckoutSessionSetupResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/setup?clientKey=${session.clientKey}`;\n const data = {\n browserInfo: options.browserInfo,\n sessionData: session.data,\n ...(options.order\n ? {\n order: { orderData: options.order.orderData, pspReference: options.order.pspReference }\n }\n : {})\n };\n\n return httpPost<CheckoutSessionSetupResponse>(\n {\n loadingContext: session.loadingContext,\n path,\n errorLevel: 'fatal'\n },\n data\n );\n}\n\nexport default setupSession;\n"],"names":["setupSession","session","options","path","API_VERSION","id","clientKey","data","browserInfo","sessionData","order","orderData","pspReference","httpPost","loadingContext","errorLevel"],"mappings":"mFAKA,SAASA,EAAaC,EAAkBC,GACpC,MAAMC,EAAO,GAAGC,cAAwBH,EAAQI,sBAAsBJ,EAAQK,YACxEC,EAAO,CACTC,YAAaN,EAAQM,YACrBC,YAAaR,EAAQM,QACjBL,EAAQQ,MACN,CACIA,MAAO,CAAEC,UAAWT,EAAQQ,MAAMC,UAAWC,aAAcV,EAAQQ,MAAME,eAE7E,CAAA,GAGV,OAAOC,EACH,CACIC,eAAgBb,EAAQa,eACxBX,OACAY,WAAY,SAEhBR,EAER"}
@@ -1,2 +1,2 @@
1
- import{httpPost as t}from"../http.js";import{API_VERSION as e}from"./constants.js";function n(n,o){const a=`${e}/sessions/${o.id}/paymentDetails?clientKey=${o.clientKey}`,s={sessionData:o.data,...n};return t({loadingContext:o.loadingContext,path:a,errorLevel:"fatal"},s)}export{n as default};
1
+ import{httpPost as t}from"../http.js";import{API_VERSION as e,API_ERROR_CODE as o}from"./constants.js";function a(a,n){const s=`${e}/sessions/${n.id}/paymentDetails?clientKey=${n.clientKey}`,i={sessionData:n.data,...a};return t({loadingContext:n.loadingContext,path:s,errorLevel:"fatal",errorCode:o.submitPaymentDetails},i)}export{a as default};
2
2
  //# sourceMappingURL=submit-details.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"submit-details.js","sources":["../../../../../src/core/Services/sessions/submit-details.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { API_VERSION } from './constants';\nimport { CheckoutSessionDetailsResponse } from '../../CheckoutSession/types';\n\n/**\n */\nfunction submitDetails(details, session: Session): Promise<CheckoutSessionDetailsResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/paymentDetails?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...details\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal' }, data);\n}\n\nexport default submitDetails;\n"],"names":["submitDetails","details","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel"],"mappings":"mFAOA,SAASA,EAAcC,EAASC,GAC5B,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,+BAA+BH,EAAQI,YACjFC,EAAO,CACTC,YAAaN,EAAQK,QAClBN,GAGP,OAAOQ,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,SAAWJ,EAC3F"}
1
+ {"version":3,"file":"submit-details.js","sources":["../../../../../src/core/Services/sessions/submit-details.ts"],"sourcesContent":["import { httpPost } from '../http';\nimport Session from '../../CheckoutSession';\nimport { API_ERROR_CODE, API_VERSION } from './constants';\nimport { CheckoutSessionDetailsResponse } from '../../CheckoutSession/types';\n\n/**\n */\nfunction submitDetails(details, session: Session): Promise<CheckoutSessionDetailsResponse> {\n const path = `${API_VERSION}/sessions/${session.id}/paymentDetails?clientKey=${session.clientKey}`;\n const data = {\n sessionData: session.data,\n ...details\n };\n\n return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal', errorCode: API_ERROR_CODE.submitPaymentDetails }, data);\n}\n\nexport default submitDetails;\n"],"names":["submitDetails","details","session","path","API_VERSION","id","clientKey","data","sessionData","httpPost","loadingContext","errorLevel","errorCode","API_ERROR_CODE","submitPaymentDetails"],"mappings":"uGAOA,SAASA,EAAcC,EAASC,GAC5B,MAAMC,EAAO,GAAGC,cAAwBF,EAAQG,+BAA+BH,EAAQI,YACjFC,EAAO,CACTC,YAAaN,EAAQK,QAClBN,GAGP,OAAOQ,EAAS,CAAEC,eAAgBR,EAAQQ,eAAgBP,OAAMQ,WAAY,QAASC,UAAWC,EAAeC,sBAAwBP,EAC3I"}
@@ -1,2 +1,2 @@
1
- import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import i from"./Analytics/Analytics.js";import{processGlobalOptions as n,assertConfigurationPropertiesAreValid as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as g}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as f}from"./Analytics/constants.js";import{THREEDS2_FULL as C}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import v from"./Services/get-translations.js";import{defaultProps as b}from"./core.defaultProps.js";import{formatLocale as j,formatCustomTranslations as E}from"../language/utils.js";import{resolveEnvironments as A}from"./Environment/Environment.js";function P(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}class M{static setBundleType(t){M.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:i,...n}=t;return this.setOptions({...n,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(i),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await v(this.cdnTranslationsUrl,M.metadata.version,this.options.locale)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(g,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=j(this.options.locale),this.options.translations=E(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===C?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:f,subtype:t.type,message:`${s} action was handled by the SDK`});const i={...this.getCorePropsForComponent(),...o};return e(this,p,t,i)}return this.handleCreateError()}getCorePropsForComponent(){return{...n(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:i({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:M.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}constructor(t){P(this,"session",void 0),P(this,"paymentMethodsResponse",void 0),P(this,"modules",void 0),P(this,"options",void 0),P(this,"analyticsContext",void 0),P(this,"loadingContext",void 0),P(this,"cdnImagesUrl",void 0),P(this,"cdnTranslationsUrl",void 0),P(this,"components",[]),P(this,"update",((t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this)))))),P(this,"remove",(t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this))),P(this,"setOptions",(t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}})),a(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...b,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:i}=A(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=i,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const n=this.options.clientKey?.substring(0,4);if(("test"===n||"live"===n)&&!this.loadingContext.includes(n))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${n} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);"pub."===n&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=M.metadata)}}P(M,"metadata",{version:"6.6.0",bundleType:"esm"}),P(M,"registry",p);export{M as default};
1
+ import{Language as t}from"../language/Language.js";import o from"./RiskModule/RiskModule.js";import s from"./ProcessResponse/PaymentMethods/PaymentMethods.js";import{getComponentForAction as e}from"./ProcessResponse/PaymentAction/PaymentAction.js";import i from"./Analytics/Analytics.js";import{processGlobalOptions as n,assertConfigurationPropertiesAreValid as a}from"./utils.js";import r from"./CheckoutSession/CheckoutSession.js";import{hasOwnProperty as h}from"../utils/hasOwnProperty.js";import{Resources as l}from"./Context/Resources.js";import{SRPanel as c}from"./Errors/SRPanel.js";import p from"./core.registry.js";import{sanitizeResponse as m,verifyPaymentDidNotFail as d,cleanupFinalResult as u}from"../components/internal/UIElement/utils.js";import y,{IMPLEMENTATION_ERROR as g}from"./Errors/AdyenCheckoutError.js";import{ANALYTICS_ACTION_STR as f}from"./Analytics/constants.js";import{THREEDS2_FULL as C}from"../components/ThreeDS2/constants.js";import{DEFAULT_LOCALE as w}from"../language/constants.js";import v from"./Services/get-translations.js";import{defaultProps as b}from"./core.defaultProps.js";import{formatLocale as j,formatCustomTranslations as E}from"../language/utils.js";import{resolveEnvironments as A}from"./Environment/Environment.js";function P(t,o,s){return o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}class M{static setBundleType(t){M.metadata.bundleType=t}static register(...t){p.add(...t)}register(...t){p.add(...t)}getComponent(t){return p.getComponent(t)}async initialize(){return await this.initializeCore(),this.validateCoreConfiguration(),await this.createCoreModules(),this}async initializeCore(){return this.session?this.session.setupSession(this.options).then((t=>{const{amount:o,shopperLocale:s,countryCode:e,paymentMethods:i,...n}=t;return this.setOptions({...n,amount:this.options.order?this.options.order.remainingAmount:o,locale:this.options.locale||s,countryCode:this.options.countryCode||e}),this.createPaymentMethodsList(i),this})).catch((t=>(this.options.onError&&this.options.onError(t),Promise.reject(t)))):(this.createPaymentMethodsList(),Promise.resolve(this))}async fetchLocaleTranslations(){try{return await v(this.cdnTranslationsUrl,M.metadata.version,this.options.locale)}catch(t){t instanceof y?this.options.onError?.(t):this.options.onError?.(new y("ERROR","Failed to fetch translation",{cause:t}))}}validateCoreConfiguration(){if(this.options.paymentMethodsConfiguration&&console.warn('WARNING: "paymentMethodsConfiguration" is supported only by Drop-in.'),!this.options.countryCode)throw new y(g,"You must specify a countryCode when initializing checkout.");this.options.locale||this.setOptions({locale:w}),this.options.locale=j(this.options.locale),this.options.translations=E(this.options.translations)}submitDetails(t){let o=null;this.options.onAdditionalDetails&&(o=new Promise(((o,s)=>{this.options.onAdditionalDetails({data:t},void 0,{resolve:o,reject:s})}))),this.session&&(o=this.session.submitDetails(t).catch((t=>(this.options.onError?.(t),Promise.reject(t))))),o?o.then(m).then(d).then((t=>{u(t),this.options.onPaymentCompleted?.(t)})).catch((t=>{u(t),this.options.onPaymentFailed?.(t)})):this.options.onError?.(new y("IMPLEMENTATION_ERROR",'It can not submit the details. The callback "onAdditionalDetails" or the Session is not setup correctly.'))}createFromAction(t,o={}){if(!t||!t.type){if(h(t,"action")&&h(t,"resultCode"))throw new Error('createFromAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('createFromAction::Invalid Action - the passed action object does not have a "type" property')}if(t.type){const s=t.type===C?`${t.type}${t.subtype}`:t.paymentMethodType;this.modules.analytics.sendAnalytics(s,{type:f,subtype:t.type,message:`${s} action was handled by the SDK`});const i={...this.getCorePropsForComponent(),...o};return e(this,p,t,i)}return this.handleCreateError()}getCorePropsForComponent(){return{...n(this.options),core:this,i18n:this.modules.i18n,modules:this.modules,session:this.session,loadingContext:this.loadingContext,cdnContext:this.cdnImagesUrl,createFromAction:this.createFromAction}}storeElementReference(t){t&&this.components.push(t)}handleCreateError(t){const o=t?`${t?.name??"The passed payment method"} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(t)}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`:"No Payment Method component was passed";throw new Error(o)}createPaymentMethodsList(t){this.paymentMethodsResponse=new s(this.options.paymentMethodsResponse||t,this.options)}async createCoreModules(){if(this.modules)return;const s=await this.fetchLocaleTranslations();this.modules=Object.freeze({risk:new o(this,{...this.options,loadingContext:this.loadingContext}),analytics:i({loadingContext:this.loadingContext,analyticsContext:this.analyticsContext,clientKey:this.options.clientKey,locale:this.options.locale,analytics:this.options.analytics,amount:this.options.amount,bundleType:M.metadata.bundleType}),resources:new l(this.cdnImagesUrl),i18n:new t({locale:this.options.locale,translations:s,customTranslations:this.options.translations}),srPanel:new c(this,{...this.options.srConfig})})}constructor(t){P(this,"session",void 0),P(this,"paymentMethodsResponse",void 0),P(this,"modules",void 0),P(this,"options",void 0),P(this,"analyticsContext",void 0),P(this,"loadingContext",void 0),P(this,"cdnImagesUrl",void 0),P(this,"cdnTranslationsUrl",void 0),P(this,"components",[]),P(this,"update",((t={})=>(this.setOptions(t),this.initialize().then((()=>(this.components.forEach((o=>{const s={...t,...this.session&&{session:this.session}};o.update(s)})),this)))))),P(this,"remove",(t=>(this.components=this.components.filter((o=>o._id!==t._id)),t.unmount(),this))),P(this,"setOptions",(t=>{this.options={...this.options,...t,locale:t?.locale||this.options?.locale}})),a(t),this.createFromAction=this.createFromAction.bind(this),this.setOptions({...b,...t});const{apiUrl:o,analyticsUrl:s,cdnImagesUrl:e,cdnTranslationsUrl:i}=A(this.options.environment,this.options._environmentUrls);this.loadingContext=o,this.analyticsContext=s,this.cdnImagesUrl=e,this.cdnTranslationsUrl=i,this.session=this.options.session&&new r(this.options.session,this.options.clientKey,this.loadingContext);const n=this.options.clientKey?.substring(0,4);if(("test"===n||"live"===n)&&!this.loadingContext.includes(n))throw new y("IMPLEMENTATION_ERROR",`Error: you are using a ${n} clientKey against the ${this.options._environmentUrls?.api||this.options.environment} environment`);"pub."===n&&console.debug(`The value you are passing as your "clientKey" looks like an originKey (${this.options.clientKey?.substring(0,12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`),this.options.exposeLibraryMetadata&&(window.AdyenWebMetadata=M.metadata)}}P(M,"metadata",{version:"6.8.0",bundleType:"esm"}),P(M,"registry",p);export{M as default};
2
2
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport type { ICore } from './types';\n\nfunction assertClassHasType(Class: any): Class is typeof UIElement {\n const hasValidType = typeof Class.type === 'string' && !!Class.type;\n return hasValidType;\n}\n\nexport type NewableComponent = new (checkout: ICore, props?) => UIElement;\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","registry","add","items","this","componentsMap","createComponentsMap","getComponent","type","Component","supportedTxVariants","has","components","reduce","memo","component","Class","console","error","txVariants","filter","txVariant","forEach","_define_property","Set","Object","values"],"mappings":"kWAmBA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,GAwD5C,IAAeC,EAAA,IArDf,MAKWC,GAAAA,IAAOC,GACVC,KAAKC,cAAgB,IACdD,KAAKC,iBACLD,KAAKE,oBAAoBH,GAEpC,CAEOI,YAAAA,CAAaC,GAChB,MAAMC,EAAYL,KAAKC,cAAcG,GACrC,OAAIC,IAIAL,KAAKM,oBAAoBC,IAAIH,QAAjC,EAIOZ,EACX,CAEOU,mBAAAA,CAAoBM,GAwBvB,OAvBsBA,EAAWC,QAAO,CAACC,EAAMC,KA5CvD,IAA4BC,EA+ChB,KA9CmC,iBADnBA,EA6CmBD,GA5CTP,QAAuBQ,EAAMR,MAgDnD,OADAS,QAAQC,MAAM,sFACPJ,EAEX,GAAuB,WAAnBC,EAAUP,KACV,OAAOM,EAYX,MAT4B,CAACC,EAAUP,QAASO,EAAUI,YAAYC,QAAOC,GAAaA,IAEtEC,SAAQD,IACxBP,EAAO,IACAA,EACHO,CAACA,GAAYN,EACjB,IAGGD,CAAAA,GACR,CAAC,EAGR,eAjDAS,EAAAnB,KAAOC,gBAAkDZ,GAEzD8B,EAAAnB,KAAOM,sBAAmC,IAAIc,IAAIC,OAAOC,OAAOhC"}
1
+ {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport type { ICore } from './types';\n\nfunction assertClassHasType(Class: any): Class is typeof UIElement {\n const hasValidType = typeof Class.type === 'string' && !!Class.type;\n return hasValidType;\n}\n\nexport type NewableComponent = new (checkout: ICore, props?) => UIElement;\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","registry","add","items","this","componentsMap","createComponentsMap","getComponent","type","Component","supportedTxVariants","has","components","reduce","memo","component","Class","console","error","txVariants","filter","txVariant","forEach","_define_property","Set","Object","values"],"mappings":"kWAmBA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,GAwD5C,IAAeC,EAAA,IArDf,MAKWC,GAAAA,IAAOC,GACVC,KAAKC,cAAgB,IACdD,KAAKC,iBACLD,KAAKE,oBAAoBH,GAEpC,CAEOI,YAAAA,CAAaC,GAChB,MAAMC,EAAYL,KAAKC,cAAcG,GACrC,OAAIC,IAIAL,KAAKM,oBAAoBC,IAAIH,QAAjC,EAIOZ,EACX,CAEOU,mBAAAA,CAAoBM,GAwBvB,OAvBsBA,EAAWC,QAAO,CAACC,EAAMC,KA5CvD,IAA4BC,EA+ChB,KA9CmC,iBADnBA,EA6CmBD,GA5CTP,QAAuBQ,EAAMR,MAgDnD,OADAS,QAAQC,MAAM,sFACPJ,EAEX,GAAuB,WAAnBC,EAAUP,KACV,OAAOM,EAYX,MAT4B,CAACC,EAAUP,QAASO,EAAUI,YAAYC,QAAOC,GAAaA,IAEtEC,SAAQD,IACxBP,EAAO,IACAA,EACHO,CAACA,GAAYN,EACjB,IAGGD,CAAAA,GACR,GAGP,eAjDAS,EAAAnB,KAAOC,gBAAkDZ,GAEzD8B,EAAAnB,KAAOM,sBAAmC,IAAIc,IAAIC,OAAOC,OAAOhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/core/utils.ts"],"sourcesContent":["import { GENERIC_OPTIONS } from './config';\nimport type { CoreConfiguration } from './types';\n\n/**\n * Filter properties in a global configuration object from an allow list (GENERIC_OPTIONS)\n * @param globalOptions -\n * @returns any\n */\nexport function processGlobalOptions(globalOptions) {\n return Object.keys(globalOptions).reduce((r, e) => {\n if (GENERIC_OPTIONS.includes(e)) r[e] = globalOptions[e];\n return r;\n }, {});\n}\n\n/**\n * Validates that there is no unknown property as part of the CoreConfiguration.\n * The validator makes sure to throw a lint error in case a property is added to CoreConfiguration, but it is not added here\n *\n * @param props - AdyenCheckout props\n */\nexport function assertConfigurationPropertiesAreValid(propsSetByMerchant: CoreConfiguration): void {\n /** Helper that creates a function that validates the array contain ALL CoreConfiguration properties in it */\n function createConfigurationKeysValidator<T>() {\n const arrayOfAll =\n <T>() =>\n <U extends T[]>(array: U & ([T] extends [U[number]] ? unknown : 'Invalid')) =>\n array;\n const arrayWithAllKeys = arrayOfAll<T>();\n return arrayWithAllKeys;\n }\n\n const validator = createConfigurationKeysValidator<keyof CoreConfiguration>();\n const possibleFields = validator([\n 'session',\n 'environment',\n '_environmentUrls',\n 'showPayButton',\n 'clientKey',\n 'locale',\n 'translations',\n 'paymentMethodsResponse',\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'allowPaymentMethods',\n 'removePaymentMethods',\n 'srConfig',\n 'analytics',\n 'risk',\n 'order',\n 'exposeLibraryMetadata',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'onSubmit',\n 'onAdditionalDetails',\n 'onActionHandled',\n 'onChange',\n 'onError',\n 'onBalanceCheck',\n 'onOrderRequest',\n 'onPaymentMethodsRequest',\n 'onOrderCancel',\n 'onOrderUpdated',\n 'loadingContext',\n 'onEnterKeyPressed'\n ]);\n\n Object.keys(propsSetByMerchant).forEach((prop: keyof CoreConfiguration) => {\n if (!possibleFields.includes(prop)) {\n console.warn(\n `AdyenCheckout - Configuration property \"${prop}\" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to \"paymentMethodsConfiguration\" object`\n );\n }\n });\n}\n"],"names":["processGlobalOptions","globalOptions","Object","keys","reduce","r","e","GENERIC_OPTIONS","includes","assertConfigurationPropertiesAreValid","propsSetByMerchant","possibleFields","array","validator","forEach","prop","console","warn"],"mappings":"8CAQO,SAASA,EAAqBC,GACjC,OAAOC,OAAOC,KAAKF,GAAeG,QAAO,CAACC,EAAGC,KACrCC,EAAgBC,SAASF,KAAID,EAAEC,GAAKL,EAAcK,IAC/CD,IACR,CAAC,EACR,CAQO,SAASI,EAAsCC,GAWlD,MACMC,EAPE,CAAgBC,GACZA,EAMWC,CAAU,CAC7B,UACA,cACA,mBACA,gBACA,YACA,SACA,eACA,yBACA,SACA,kBACA,cACA,sBACA,uBACA,WACA,YACA,OACA,QACA,wBACA,iBACA,eACA,qBACA,kBACA,WACA,sBACA,kBACA,WACA,UACA,iBACA,iBACA,0BACA,gBACA,iBACA,iBACA,sBAGJX,OAAOC,KAAKO,GAAoBI,SAASC,IAChCJ,EAAeH,SAASO,IACzBC,QAAQC,KACJ,2CAA2CF,4NAEnD,GAER"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/core/utils.ts"],"sourcesContent":["import { GENERIC_OPTIONS } from './config';\nimport type { CoreConfiguration } from './types';\n\n/**\n * Filter properties in a global configuration object from an allow list (GENERIC_OPTIONS)\n * @param globalOptions -\n * @returns any\n */\nexport function processGlobalOptions(globalOptions) {\n return Object.keys(globalOptions).reduce((r, e) => {\n if (GENERIC_OPTIONS.includes(e)) r[e] = globalOptions[e];\n return r;\n }, {});\n}\n\n/**\n * Validates that there is no unknown property as part of the CoreConfiguration.\n * The validator makes sure to throw a lint error in case a property is added to CoreConfiguration, but it is not added here\n *\n * @param props - AdyenCheckout props\n */\nexport function assertConfigurationPropertiesAreValid(propsSetByMerchant: CoreConfiguration): void {\n /** Helper that creates a function that validates the array contain ALL CoreConfiguration properties in it */\n function createConfigurationKeysValidator<T>() {\n const arrayOfAll =\n <T>() =>\n <U extends T[]>(array: U & ([T] extends [U[number]] ? unknown : 'Invalid')) =>\n array;\n const arrayWithAllKeys = arrayOfAll<T>();\n return arrayWithAllKeys;\n }\n\n const validator = createConfigurationKeysValidator<keyof CoreConfiguration>();\n const possibleFields = validator([\n 'session',\n 'environment',\n '_environmentUrls',\n 'showPayButton',\n 'clientKey',\n 'locale',\n 'translations',\n 'paymentMethodsResponse',\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'allowPaymentMethods',\n 'removePaymentMethods',\n 'srConfig',\n 'analytics',\n 'risk',\n 'order',\n 'exposeLibraryMetadata',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'onSubmit',\n 'onAdditionalDetails',\n 'onActionHandled',\n 'onChange',\n 'onError',\n 'onBalanceCheck',\n 'onOrderRequest',\n 'onPaymentMethodsRequest',\n 'onOrderCancel',\n 'onOrderUpdated',\n 'loadingContext',\n 'onEnterKeyPressed'\n ]);\n\n Object.keys(propsSetByMerchant).forEach((prop: keyof CoreConfiguration) => {\n if (!possibleFields.includes(prop)) {\n console.warn(\n `AdyenCheckout - Configuration property \"${prop}\" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to \"paymentMethodsConfiguration\" object`\n );\n }\n });\n}\n"],"names":["processGlobalOptions","globalOptions","Object","keys","reduce","r","e","GENERIC_OPTIONS","includes","assertConfigurationPropertiesAreValid","propsSetByMerchant","possibleFields","array","validator","forEach","prop","console","warn"],"mappings":"8CAQO,SAASA,EAAqBC,GACjC,OAAOC,OAAOC,KAAKF,GAAeG,QAAO,CAACC,EAAGC,KACrCC,EAAgBC,SAASF,KAAID,EAAEC,GAAKL,EAAcK,IAC/CD,IACR,GACP,CAQO,SAASI,EAAsCC,GAWlD,MACMC,EAPE,CAAgBC,GACZA,EAMWC,CAAU,CAC7B,UACA,cACA,mBACA,gBACA,YACA,SACA,eACA,yBACA,SACA,kBACA,cACA,sBACA,uBACA,WACA,YACA,OACA,QACA,wBACA,iBACA,eACA,qBACA,kBACA,WACA,sBACA,kBACA,WACA,UACA,iBACA,iBACA,0BACA,gBACA,iBACA,iBACA,sBAGJX,OAAOC,KAAKO,GAAoBI,SAASC,IAChCJ,EAAeH,SAASO,IACzBC,QAAQC,KACJ,2CAA2CF,4NAEnD,GAER"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","appendClass","parseValue","Array","isArray","apply","toString","Object","prototype","includes","key","call","value","newClass","module","exports","default","window"],"mappings":";;;;;YAOC,WAGA,IAAIA,EAAS,CAAE,EAACC,eAEhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GAChBG,IACHJ,EAAUK,EAAYL,EAASM,EAAWF,IAE3C,CAED,OAAOJ,CACP,CAED,SAASM,EAAYF,GACpB,GAAmB,iBAARA,GAAmC,iBAARA,EACrC,OAAOA,EAGR,GAAmB,iBAARA,EACV,MAAO,GAGR,GAAIG,MAAMC,QAAQJ,GACjB,OAAOL,EAAWU,MAAM,KAAML,GAG/B,GAAIA,EAAIM,WAAaC,OAAOC,UAAUF,WAAaN,EAAIM,SAASA,WAAWG,SAAS,iBACnF,OAAOT,EAAIM,WAGZ,IAAIV,EAAU,GAEd,IAAK,IAAIc,KAAOV,EACXP,EAAOkB,KAAKX,EAAKU,IAAQV,EAAIU,KAChCd,EAAUK,EAAYL,EAASc,IAIjC,OAAOd,CACP,CAED,SAASK,EAAaW,EAAOC,GAC5B,OAAKA,EAIDD,EACIA,EAAQ,IAAMC,EAGfD,EAAQC,EAPPD,CAQR,CAEoCE,EAAOC,SAC3CpB,EAAWqB,QAAUrB,EACrBmB,EAAAC,QAAiBpB,GAOjBsB,OAAOtB,WAAaA,CAEtB,CArEA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","appendClass","parseValue","Array","isArray","apply","toString","Object","prototype","includes","key","call","value","newClass","module","exports","default","window"],"mappings":";;;;;YAOC,WAGA,IAAIA,EAAS,CAAA,EAAGC,eAEhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GAChBG,IACHJ,EAAUK,EAAYL,EAASM,EAAWF,KAI5C,OAAOJ,EAGR,SAASM,EAAYF,GACpB,GAAmB,iBAARA,GAAmC,iBAARA,EACrC,OAAOA,EAGR,GAAmB,iBAARA,EACV,MAAO,GAGR,GAAIG,MAAMC,QAAQJ,GACjB,OAAOL,EAAWU,MAAM,KAAML,GAG/B,GAAIA,EAAIM,WAAaC,OAAOC,UAAUF,WAAaN,EAAIM,SAASA,WAAWG,SAAS,iBACnF,OAAOT,EAAIM,WAGZ,IAAIV,EAAU,GAEd,IAAK,IAAIc,KAAOV,EACXP,EAAOkB,KAAKX,EAAKU,IAAQV,EAAIU,KAChCd,EAAUK,EAAYL,EAASc,IAIjC,OAAOd,EAGR,SAASK,EAAaW,EAAOC,GAC5B,OAAKA,EAIDD,EACIA,EAAQ,IAAMC,EAGfD,EAAQC,EAPPD,EAU4BE,EAAOC,SAC3CpB,EAAWqB,QAAUrB,EACrBmB,EAAAC,QAAiBpB,GAOjBsB,OAAOtB,WAAaA,CAEtB,CArEA","x_google_ignoreList":[0]}