@adyen/adyen-web 6.0.0-beta.1 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/adyen.css +9 -5
  3. package/dist/cjs/adyen.css.map +1 -1
  4. package/dist/cjs/index.cjs +2 -2
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/index.d.cts +802 -849
  7. package/dist/es/adyen.css +9 -5
  8. package/dist/es/adyen.css.map +1 -1
  9. package/dist/es/components/ANCV/ANCV.js +1 -1
  10. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  11. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  12. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  13. package/dist/es/components/Card/Card.js +1 -1
  14. package/dist/es/components/Card/Card.js.map +1 -1
  15. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  16. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  18. package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
  19. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  20. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  21. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  22. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  23. package/dist/es/components/Card/components/CardInput/components/{IframeLabelAlternative.js → FieldLabelAlternative.js} +1 -1
  24. package/dist/es/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  25. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  26. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  27. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  28. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  29. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  31. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  32. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  33. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  34. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  35. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  36. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  37. package/dist/es/components/Donation/components/FixedAmounts.js +2 -0
  38. package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -0
  39. package/dist/es/components/Donation/components/Roundup.js +2 -0
  40. package/dist/es/components/Donation/components/Roundup.js.map +1 -0
  41. package/dist/es/components/Donation/components/utils.js +2 -0
  42. package/dist/es/components/Donation/components/utils.js.map +1 -0
  43. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  44. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  45. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  46. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  47. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  48. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  49. package/dist/es/components/Dropin/elements/createElements.js +1 -1
  50. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  51. package/dist/es/components/Dropin/elements/filters.js +1 -1
  52. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  53. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  54. package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
  55. package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  56. package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
  57. package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  58. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  59. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  60. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  61. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  62. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  63. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  64. package/dist/es/components/PayPal/Paypal.js +1 -1
  65. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  66. package/dist/es/components/PayPal/components/PaypalComponent.js +1 -1
  67. package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
  68. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  69. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  70. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  71. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  72. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  73. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  74. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  75. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  76. package/dist/es/components/UPI/UPI.js +1 -1
  77. package/dist/es/components/UPI/UPI.js.map +1 -1
  78. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  79. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  80. package/dist/es/components/UPI/components/UPIComponent/constants.js +2 -0
  81. package/dist/es/components/UPI/components/UPIComponent/constants.js.map +1 -0
  82. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  83. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  84. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  85. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  86. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  87. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  88. package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
  89. package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  90. package/dist/es/components/components-name-map.js +1 -1
  91. package/dist/es/components/components-name-map.js.map +1 -1
  92. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  93. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  94. package/dist/es/components/internal/Await/Await.js +1 -1
  95. package/dist/es/components/internal/Await/Await.js.map +1 -1
  96. package/dist/es/components/internal/Countdown/index.js +1 -1
  97. package/dist/es/components/internal/Countdown/index.js.map +1 -1
  98. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  99. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  100. package/dist/es/components/internal/ExpandButton/ExpandButton.js +2 -0
  101. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  102. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  103. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  104. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  105. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  106. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  107. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  108. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  109. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  110. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  111. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  112. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  113. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  114. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  115. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  116. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  117. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  118. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  119. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  120. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  121. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  122. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  123. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  124. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  125. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  126. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  127. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  128. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  129. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  130. package/dist/es/components/internal/SecuredFields/utils.js +1 -1
  131. package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
  132. package/dist/es/components/tx-variants.js +1 -1
  133. package/dist/es/components/tx-variants.js.map +1 -1
  134. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  135. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  136. package/dist/es/core/Analytics/utils.js +1 -1
  137. package/dist/es/core/Analytics/utils.js.map +1 -1
  138. package/dist/es/core/Environment/constants.js +1 -1
  139. package/dist/es/core/Environment/constants.js.map +1 -1
  140. package/dist/es/core/RiskModule/RiskModule.js +1 -1
  141. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  142. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  143. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  144. package/dist/es/core/Services/get-translations.js +1 -1
  145. package/dist/es/core/Services/get-translations.js.map +1 -1
  146. package/dist/es/core/config.js +1 -1
  147. package/dist/es/core/config.js.map +1 -1
  148. package/dist/es/core/core.js +1 -1
  149. package/dist/es/core/core.js.map +1 -1
  150. package/dist/es/external/preact/dist/preact.js +1 -1
  151. package/dist/es/external/preact/dist/preact.js.map +1 -1
  152. package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
  153. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  154. package/dist/es/index.d.ts +802 -849
  155. package/dist/es/language/constants.js +1 -1
  156. package/dist/es/language/constants.js.map +1 -1
  157. package/dist/es/utils/amount-util.js.map +1 -1
  158. package/dist/es/utils/commonUtils.js +2 -0
  159. package/dist/es/utils/commonUtils.js.map +1 -0
  160. package/dist/es-legacy/adyen.css +9 -5
  161. package/dist/es-legacy/adyen.css.map +1 -1
  162. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  163. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  164. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  165. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  166. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  167. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  168. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  169. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  170. package/dist/es-legacy/components/Address/Address.js +1 -1
  171. package/dist/es-legacy/components/Address/Address.js.map +1 -1
  172. package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
  173. package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
  174. package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
  175. package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
  176. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  177. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  178. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  179. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  180. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  181. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  182. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  183. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  184. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  185. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  186. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  187. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  188. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  189. package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
  190. package/dist/es-legacy/components/Atome/config.js +1 -1
  191. package/dist/es-legacy/components/Atome/config.js.map +1 -1
  192. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  193. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  194. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  195. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  196. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
  197. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
  198. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
  199. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
  200. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  201. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  202. package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
  203. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  204. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  205. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  206. package/dist/es-legacy/components/Card/Bancontact.js +1 -1
  207. package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
  208. package/dist/es-legacy/components/Card/Card.js +1 -1
  209. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  210. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  211. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  212. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  213. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
  214. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  215. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  216. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  217. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  218. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js +2 -0
  219. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  220. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  221. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  222. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  223. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  224. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  225. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  226. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  227. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  228. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  229. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  230. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  231. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  232. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  233. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  234. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  235. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  236. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  237. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  238. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  239. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  240. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  241. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  242. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  243. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  244. package/dist/es-legacy/components/Donation/components/FixedAmounts.js +2 -0
  245. package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -0
  246. package/dist/es-legacy/components/Donation/components/Roundup.js +2 -0
  247. package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -0
  248. package/dist/es-legacy/components/Donation/components/utils.js +2 -0
  249. package/dist/es-legacy/components/Donation/components/utils.js.map +1 -0
  250. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  251. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  252. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  253. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  254. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  255. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  256. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  257. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  258. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  259. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  260. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  261. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  262. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  263. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  264. package/dist/es-legacy/components/Dropin/elements/createElements.js +1 -1
  265. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  266. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
  267. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  268. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
  269. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  270. package/dist/es-legacy/components/Dropin/elements/filters.js +1 -1
  271. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  272. package/dist/es-legacy/components/EPS/index.js +1 -1
  273. package/dist/es-legacy/components/EPS/index.js.map +1 -1
  274. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  275. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  276. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
  277. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
  278. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
  279. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
  280. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
  281. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
  282. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
  283. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
  284. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
  285. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
  286. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  287. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  288. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  289. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  290. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
  291. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
  292. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
  293. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  294. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
  295. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  296. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  297. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  298. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  299. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  300. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  301. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  302. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  303. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  304. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  305. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  306. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  307. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  308. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  309. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  310. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
  311. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
  312. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  313. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  314. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
  315. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
  316. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  317. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  318. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  319. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  320. package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
  321. package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
  322. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
  323. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
  324. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  325. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  326. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  327. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  328. package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
  329. package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
  330. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  331. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  332. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  333. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  334. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  335. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  336. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  337. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  338. package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
  339. package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
  340. package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
  341. package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
  342. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  343. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  344. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  345. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  346. package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
  347. package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
  348. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
  349. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
  350. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  351. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  352. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  353. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  354. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  355. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  356. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  357. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  358. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  359. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  360. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  361. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  362. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  363. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  364. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  365. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  366. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  367. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  368. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  369. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  370. package/dist/es-legacy/components/Twint/Twint.js +1 -1
  371. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  372. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  373. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  374. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  375. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  376. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js +2 -0
  377. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js.map +1 -0
  378. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  379. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  380. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  381. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  382. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  383. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  384. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
  385. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  386. package/dist/es-legacy/components/WalletIN/index.js +1 -1
  387. package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
  388. package/dist/es-legacy/components/components-name-map.js +1 -1
  389. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  390. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  391. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  392. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  393. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  394. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  395. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  396. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  397. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  398. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  399. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  400. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  401. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  402. package/dist/es-legacy/components/internal/Await/Await.js +1 -1
  403. package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
  404. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  405. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  406. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  407. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  408. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  409. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  410. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  411. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  412. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  413. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  414. package/dist/es-legacy/components/internal/Countdown/index.js +1 -1
  415. package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
  416. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  417. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  418. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +2 -0
  419. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  420. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  421. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  422. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  423. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  424. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  425. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  426. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  427. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  428. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  429. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  430. package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
  431. package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
  432. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
  433. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
  434. package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
  435. package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
  436. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  437. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  438. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  439. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  440. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  441. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  442. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  443. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  444. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  445. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  446. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
  447. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
  448. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  449. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  450. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  451. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  452. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  453. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  454. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
  455. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +1 -1
  456. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  457. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  458. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  459. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  460. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  461. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  462. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  463. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  464. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  465. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  466. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  467. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  468. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  469. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  470. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  471. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  472. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  473. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  474. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  475. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  476. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  477. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  478. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
  479. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
  480. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  481. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  482. package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
  483. package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
  484. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  485. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  486. package/dist/es-legacy/components/tx-variants.js +1 -1
  487. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  488. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  489. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  490. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  491. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  492. package/dist/es-legacy/core/Context/Resources.js +1 -1
  493. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  494. package/dist/es-legacy/core/Environment/constants.js +1 -1
  495. package/dist/es-legacy/core/Environment/constants.js.map +1 -1
  496. package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
  497. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  498. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  499. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  500. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  501. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  502. package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
  503. package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
  504. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  505. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  506. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  507. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  508. package/dist/es-legacy/core/Services/get-translations.js +1 -1
  509. package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
  510. package/dist/es-legacy/core/Services/http.js +1 -1
  511. package/dist/es-legacy/core/Services/http.js.map +1 -1
  512. package/dist/es-legacy/core/config.js +1 -1
  513. package/dist/es-legacy/core/config.js.map +1 -1
  514. package/dist/es-legacy/core/core.js +1 -1
  515. package/dist/es-legacy/core/core.js.map +1 -1
  516. package/dist/es-legacy/core/core.registry.js +1 -1
  517. package/dist/es-legacy/core/core.registry.js.map +1 -1
  518. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  519. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  520. package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
  521. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  522. package/dist/es-legacy/language/constants.js +1 -1
  523. package/dist/es-legacy/language/constants.js.map +1 -1
  524. package/dist/es-legacy/utils/amount-util.js.map +1 -1
  525. package/dist/es-legacy/utils/commonUtils.js +2 -0
  526. package/dist/es-legacy/utils/commonUtils.js.map +1 -0
  527. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  528. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  529. package/package.json +21 -21
  530. package/dist/es/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  531. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  532. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
  533. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js +0 -2
  534. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  535. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  536. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import i from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{reject as s,fieldTypeToSnakeCase as n}from"../internal/SecuredFields/utils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import l from"../internal/ClickToPay/services/create-clicktopay-service.js";import d from"./components/ClickToPayWrapper.js";import u from"../../core/Errors/SRPanelProvider.js";import{TxVariants as c}from"../tx-variants.js";import{UIElement as p}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as v,ANALYTICS_UNFOCUS_STR as f,ANALYTICS_VALIDATION_ERROR_STR as b}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as P}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as g}from"../../utils/hasOwnProperty.js";import C,{IMPLEMENTATION_ERROR as S}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as k}from"../../core/Errors/utils.js";import{SF_ErrorCodes as j}from"../../core/Errors/constants.js";function O(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function T(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},i=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),i.forEach((function(o){O(t,o,e[o])}))}return t}function B(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):function(t,o){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e.push.apply(e,i)}return e}(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})),t}class R extends p{setStatus(t,o){var e,i;return(null===(e=this.componentRef)||void 0===e?void 0:e.setStatus)&&this.componentRef.setStatus(t,o),(null===(i=this.clickToPayRef)||void 0===i?void 0:i.setStatus)&&this.clickToPayRef.setStatus(t,o),this}formatProps(t){var o,e,i,r,s,n,a,l,d,u,p,h,m,y,v,f,b,P,g,k;const j=null!==(k=null===(e=t.session)||void 0===e||null===(o=e.configuration)||void 0===o?void 0:o.enableStoreDetails)&&void 0!==k?k:t.enableStoreDetails,O=!(0===(null===(i=t.amount)||void 0===i?void 0:i.value))&&j,R=t.storedPaymentMethodId||t.id,I=R&&(null==t||null===(r=t.supportedShopperInteractions)||void 0===r?void 0:r.includes("Ecommerce"));if(R&&!I)throw new C(S,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");var w,E;return T(B(T({},t),{holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,brand:null!==(w=t.brand)&&void 0!==w?w:c.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:B(T({},t.configuration),{socialSecurityNumberMode:null!==(E=null===(s=t.configuration)||void 0===s?void 0:s.socialSecurityNumberMode)&&void 0!==E?E:"auto"}),brandsConfiguration:t.brandsConfiguration||(null===(n=t.configuration)||void 0===n?void 0:n.brandsConfiguration)||{},icon:t.icon||(null===(a=t.configuration)||void 0===a?void 0:a.icon),installmentOptions:(null===(d=t.session)||void 0===d||null===(l=d.configuration)||void 0===l?void 0:l.installmentOptions)||t.installmentOptions,enableStoreDetails:j,showStoreDetailsCheckbox:O,clickToPayConfiguration:B(T({},t.clickToPayConfiguration),{disableOtpAutoFocus:(null===(u=t.clickToPayConfiguration)||void 0===u?void 0:u.disableOtpAutoFocus)||!1,shopperEmail:(null===(p=t.clickToPayConfiguration)||void 0===p?void 0:p.shopperEmail)||(null===(m=this.core.options)||void 0===m||null===(h=m.session)||void 0===h?void 0:h.shopperEmail),telephoneNumber:(null===(y=t.clickToPayConfiguration)||void 0===y?void 0:y.telephoneNumber)||(null===(f=this.core.options)||void 0===f||null===(v=f.session)||void 0===v?void 0:v.telephoneNumber),locale:(null===(b=t.clickToPayConfiguration)||void 0===b?void 0:b.locale)||(null===(g=t.i18n)||void 0===g||null===(P=g.locale)||void 0===P?void 0:P.replace("-","_"))})}),R&&{storedPaymentMethodId:R})}formatData(){const t=this.state.selectedBrandValue;return B(T({paymentMethod:T({type:R.type},this.state.data,this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},t&&{brand:t},this.props.fundingSource&&{fundingSource:this.props.fundingSource})},this.state.billingAddress&&{billingAddress:this.state.billingAddress},this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},this.storePaymentMethodPayload,a(this.state.installments)&&{installments:this.state.installments}),{browserInfo:this.browserInfo,origin:!!window&&window.location.origin})}updateStyles(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.updateStyles)&&this.componentRef.updateStyles(t),this}setFocusOn(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.setFocusOn)&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,o=!1){var e;return(null===(e=this.componentRef)||void 0===e?void 0:e.processBinLookupResponse)&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.handleUnsupportedCard)&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){const o=s("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&g(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t)}get storePaymentMethodPayload(){var t,o;if((null===(t=this.props.storedPaymentMethodId)||void 0===t?void 0:t.length)>0)return{};if(0===(null===(o=this.props.amount)||void 0===o?void 0:o.value))return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){var t;return null!==(t=this.props.icon)&&void 0!==t?t:this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>{var e,i;return{icon:null!==(i=null===(e=o[t])||void 0===e?void 0:e.icon)&&void 0!==i?i:this.props.modules.resources.getImage()(t),name:t}})):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||R.type}get accessibleName(){return(this.props.name||R.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return i()}renderCardInput(e=!0){return t(o,B(T({setComponentRef:this.setComponentRef},this.props,this.state),{onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess}))}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(u,{srPanel:this.props.modules.srPanel},t(d,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}constructor(o,e){var i;(super(o,e),O(this,"clickToPayService",void 0),O(this,"clickToPayRef",null),O(this,"setClickToPayRef",(t=>{this.clickToPayRef=t})),O(this,"onBrand",(t=>{var o,e;null===(o=(e=this.props).onBrand)||void 0===o||o.call(e,t)})),O(this,"handleClickToPaySubmit",(t=>{this.setState({data:T({},t),valid:{},errors:{},isValid:!0}),this.submit()})),O(this,"onConfigSuccess",(t=>{var o,e;this.submitAnalytics({type:y}),null===(o=(e=this.props).onConfigSuccess)||void 0===o||o.call(e,t)})),O(this,"onFocus",(t=>{var o,e,i,r;(this.submitAnalytics({type:v,target:n(t.fieldType)}),P.includes(t.fieldType))?null===(o=(e=this.props).onFocus)||void 0===o||o.call(e,t.event):null===(i=(r=this.props).onFocus)||void 0===i||i.call(r,t)})),O(this,"onBlur",(t=>{var o,e,i,r;(this.submitAnalytics({type:f,target:n(t.fieldType)}),P.includes(t.fieldType))?null===(o=(e=this.props).onBlur)||void 0===o||o.call(e,t.event):null===(i=(r=this.props).onBlur)||void 0===i||i.call(r,t)})),O(this,"onValidationErrorAnalytics",(t=>{this.submitAnalytics({type:b,target:n(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:k(t.errorCode,j)})})),O(this,"onBinValue",r(this)),O(this,"payButton",(o=>{var e,i;const r=0===(null===(e=this.props.amount)||void 0===e?void 0:e.value),s=(null===(i=this.props.storedPaymentMethodId)||void 0===i?void 0:i.length)>0;return t(h,B(T({},o),{amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:r&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit}))})),e&&!e._disableClickToPay)&&(this.clickToPayService=l(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),null===(i=this.clickToPayService)||void 0===i||i.initialize())}}O(R,"type",c.scheme),O(R,"defaultProps",{onBinLookup:()=>{},_disableClickToPay:!1});export{R as CardElement,R as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import i from"../../utils/browserInfo.js";import s from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as r}from"../internal/SecuredFields/utils.js";import{reject as n}from"../../utils/commonUtils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import l from"../internal/ClickToPay/services/create-clicktopay-service.js";import d from"./components/ClickToPayWrapper.js";import u from"../../core/Errors/SRPanelProvider.js";import{TxVariants as p}from"../tx-variants.js";import{UIElement as c}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as v,ANALYTICS_UNFOCUS_STR as f,ANALYTICS_VALIDATION_ERROR_STR as b}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as g}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import C,{IMPLEMENTATION_ERROR as S}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as k}from"../../core/Errors/utils.js";import{SF_ErrorCodes as j}from"../../core/Errors/constants.js";import O from"./components/CardInput/defaultProps.js";function T(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function R(t){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},i=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e).filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})))),i.forEach((function(o){T(t,o,e[o])}))}return t}function B(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):function(t){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);o.push.apply(o,e)}return o}(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})),t}class I extends c{setStatus(t,o){var e,i;return(null===(e=this.componentRef)||void 0===e?void 0:e.setStatus)&&this.componentRef.setStatus(t,o),(null===(i=this.clickToPayRef)||void 0===i?void 0:i.setStatus)&&this.clickToPayRef.setStatus(t,o),this}formatProps(t){var o,e,i,s,r,n,a,l,d,u,c,h,m,y,v,f,b,g,P,k;const j=null!==(k=null===(e=t.session)||void 0===e||null===(o=e.configuration)||void 0===o?void 0:o.enableStoreDetails)&&void 0!==k?k:t.enableStoreDetails,T=!(0===(null===(i=t.amount)||void 0===i?void 0:i.value))&&j,I=t.storedPaymentMethodId||t.id,w=I&&(null==t||null===(s=t.supportedShopperInteractions)||void 0===s?void 0:s.includes("Ecommerce"));if(I&&!w)throw new C(S,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");var M,A;return R(B(R({},t),{holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?O.billingAddressMode:t.billingAddressMode,brand:null!==(M=t.brand)&&void 0!==M?M:p.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:B(R({},t.configuration),{socialSecurityNumberMode:null!==(A=null===(r=t.configuration)||void 0===r?void 0:r.socialSecurityNumberMode)&&void 0!==A?A:"auto"}),brandsConfiguration:t.brandsConfiguration||(null===(n=t.configuration)||void 0===n?void 0:n.brandsConfiguration)||{},icon:t.icon||(null===(a=t.configuration)||void 0===a?void 0:a.icon),installmentOptions:(null===(d=t.session)||void 0===d||null===(l=d.configuration)||void 0===l?void 0:l.installmentOptions)||t.installmentOptions,enableStoreDetails:j,showStoreDetailsCheckbox:T,clickToPayConfiguration:B(R({},t.clickToPayConfiguration),{disableOtpAutoFocus:(null===(u=t.clickToPayConfiguration)||void 0===u?void 0:u.disableOtpAutoFocus)||!1,shopperEmail:(null===(c=t.clickToPayConfiguration)||void 0===c?void 0:c.shopperEmail)||(null===(m=this.core.options)||void 0===m||null===(h=m.session)||void 0===h?void 0:h.shopperEmail),telephoneNumber:(null===(y=t.clickToPayConfiguration)||void 0===y?void 0:y.telephoneNumber)||(null===(f=this.core.options)||void 0===f||null===(v=f.session)||void 0===v?void 0:v.telephoneNumber),locale:(null===(b=t.clickToPayConfiguration)||void 0===b?void 0:b.locale)||(null===(P=t.i18n)||void 0===P||null===(g=P.locale)||void 0===g?void 0:g.replace("-","_"))})}),I&&{storedPaymentMethodId:I})}formatData(){const t=this.state.selectedBrandValue;return B(R({paymentMethod:R({type:I.type},this.state.data,this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},t&&{brand:t},this.props.fundingSource&&{fundingSource:this.props.fundingSource})},this.state.billingAddress&&{billingAddress:this.state.billingAddress},this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},this.storePaymentMethodPayload,a(this.state.installments)&&{installments:this.state.installments}),{browserInfo:this.browserInfo,origin:!!window&&window.location.origin})}updateStyles(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.updateStyles)&&this.componentRef.updateStyles(t),this}setFocusOn(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.setFocusOn)&&this.componentRef.setFocusOn(t),this}processBinLookupResponse(t,o=!1){var e;return(null===(e=this.componentRef)||void 0===e?void 0:e.processBinLookupResponse)&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){var o;return(null===(o=this.componentRef)||void 0===o?void 0:o.handleUnsupportedCard)&&this.componentRef.handleUnsupportedCard(t),this}onBinLookup(t){if(!t.isReset){const o=n("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t,this.props)}get storePaymentMethodPayload(){var t,o;if((null===(t=this.props.storedPaymentMethodId)||void 0===t?void 0:t.length)>0)return{};if(0===(null===(o=this.props.amount)||void 0===o?void 0:o.value))return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){var t;return null!==(t=this.props.icon)&&void 0!==t?t:this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>{var e,i;return{icon:null!==(i=null===(e=o[t])||void 0===e?void 0:e.icon)&&void 0!==i?i:this.props.modules.resources.getImage()(t),name:t}})):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||I.type}get accessibleName(){return(this.props.name||I.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return i()}renderCardInput(e=!0){return t(o,B(R({setComponentRef:this.setComponentRef},this.props,this.state),{onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess}))}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(u,{srPanel:this.props.modules.srPanel},t(d,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}constructor(o,e){var i;(super(o,e),T(this,"clickToPayService",void 0),T(this,"clickToPayRef",null),T(this,"setClickToPayRef",(t=>{this.clickToPayRef=t})),T(this,"onBrand",(t=>{var o,e;null===(o=(e=this.props).onBrand)||void 0===o||o.call(e,t)})),T(this,"handleClickToPaySubmit",(t=>{this.setState({data:R({},t),valid:{},errors:{},isValid:!0}),this.submit()})),T(this,"onConfigSuccess",(t=>{var o,e;this.submitAnalytics({type:y}),null===(o=(e=this.props).onConfigSuccess)||void 0===o||o.call(e,t)})),T(this,"onFocus",(t=>{var o,e,i,s;(this.submitAnalytics({type:v,target:r(t.fieldType)}),g.includes(t.fieldType))?null===(o=(e=this.props).onFocus)||void 0===o||o.call(e,t.event):null===(i=(s=this.props).onFocus)||void 0===i||i.call(s,t)})),T(this,"onBlur",(t=>{var o,e,i,s;(this.submitAnalytics({type:f,target:r(t.fieldType)}),g.includes(t.fieldType))?null===(o=(e=this.props).onBlur)||void 0===o||o.call(e,t.event):null===(i=(s=this.props).onBlur)||void 0===i||i.call(s,t)})),T(this,"onValidationErrorAnalytics",(t=>{this.submitAnalytics({type:b,target:r(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:k(t.errorCode,j)})})),T(this,"onBinValue",s(this)),T(this,"payButton",(o=>{var e,i;const s=0===(null===(e=this.props.amount)||void 0===e?void 0:e.value),r=(null===(i=this.props.storedPaymentMethodId)||void 0===i?void 0:i.length)>0;return t(h,B(R({},o),{amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:s&&!r?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit}))})),e&&!e._disableClickToPay)&&(this.clickToPayService=l(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),null===(i=this.clickToPayService)||void 0===i||i.initialize())}}T(I,"type",p.scheme),T(I,"defaultProps",R({showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0},n(["type","setComponentRef"]).from(O)));export{I as CardElement,I as default};
2
2
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase, reject } from '../internal/SecuredFields/utils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport { UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n onBinLookup: () => {},\n _disableClickToPay: false\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration) {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // ...(props.brands && !props.groupTypes && { groupTypes: props.brands }),\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n // Override\n protected payButton = (props: PayButtonProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","_object_spread","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","TxVariants","card","countryCode","toLowerCase","_object_spread_props","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","super","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onValidationErrorAnalytics","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_this_clickToPayService","_define_property","ref","event","_this_props_onBrand","_this_props","call","payload","valid","errors","_this_props_onConfigSuccess","_this_props_onFocus","_this_props_onFocus1","_this_props1","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","_this_props_onBlur","_this_props_onBlur1","ANALYTICS_UNFOCUS_STR","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps"],"mappings":"snEAkCO,MAAMA,UAAoBC,EAwBtBC,SAAAA,CAAUC,EAAyBC,OAClCC,EAGAC,EAGJ,eANID,EAAAE,KAAKC,oBAAL,IAAAH,OAAA,EAAAA,EAAmBH,YACnBK,KAAKC,aAAaN,UAAUC,EAAQC,YAEpCE,EAAAC,KAAKE,qBAAL,IAAAH,OAAA,EAAAA,EAAoBJ,YACpBK,KAAKE,cAAcP,UAAUC,EAAQ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1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","_object_spread","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","CardInputDefaultProps","TxVariants","card","countryCode","toLowerCase","_object_spread_props","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","super","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onValidationErrorAnalytics","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_this_clickToPayService","_define_property","ref","event","_this_props_onBrand","_this_props","call","payload","valid","errors","_this_props_onConfigSuccess","_this_props_onFocus","_this_props_onFocus1","_this_props1","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","_this_props_onBlur","_this_props_onBlur1","ANALYTICS_UNFOCUS_STR","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"ktEAmCO,MAAMA,UAAoBC,EA2BtBC,SAAAA,CAAUC,EAAyBC,OAClCC,EAGAC,EAGJ,eANID,EAAAE,KAAKC,oBAAL,IAAAH,OAAA,EAAAA,EAAmBH,YACnBK,KAAKC,aAAaN,UAAUC,EAAQC,YAEpCE,EAAAC,KAAKE,qBAAL,IAAAH,OAAA,EAAAA,EAAoBJ,YACpBK,KAAKE,cAAcP,UAAUC,EA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AErC,EAhBArC,EADSrJ,EACK8D,OAAOvB,EAAWoJ,QAkBhCtC,EAnBSrJ,EAmBQ4L,eAAe/J,EAAA,CAC5BgK,qBAAqB,EACrBN,oBAAoB,EACpBO,aAAa,GAEVxG,EAAO,CAAC,OAAQ,oBAAoBC,KAAKjD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as t,useMemo as o,useState as n,useCallback as s,useEffect as l}from"../../../../external/preact/hooks/dist/hooks.js";import a from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import i from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as b,getRuleByNameAndMode as f}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import h from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as S,extractPropsForCardFields as N,extractPropsForSFP as g,getLayout as A}from"./utils.js";import v from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as j}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as O}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as F,getFocusHandler as P,getAddressHandler as w}from"./handlers.js";import C from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as k}from"../../../internal/Address/validate.js";import x from"../../../../core/Context/useImage.js";import{getArrayDifferences as R}from"../../../../utils/arrayUtils.js";import I from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as B}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";function V(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function D(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){V(e,r,t[r])}))}return e}function q(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t.push.apply(t,o)}return t}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const M=i=>{var V,M;const _=t(null),L=t(!1),T=x(),K=t(null),H=e=>{K.current=e},U=t({});Object.keys(U.current).length||i.setComponentRef(U.current);const z=t(0),W=t(!1),$=o((()=>new v(i.specifications)),[i.specifications]);U.current.sfp=_;const[G,J]=n("ready"),[Q,X]=n({}),[Y,Z]=n(D({},i.holderNameRequired&&{holderName:!1}));var ee;const[re,te]=n(D({},i.hasHolderName&&{holderName:null!==(ee=i.data.holderName)&&void 0!==ee?ee:""})),[oe,ne]=n(""),[se,le]=n(!1),[ae,ie]=n(c),[de,ue]=n(m),[ce,me]=n(null),[pe,be]=n([]),[fe,ye]=n(i.storedPaymentMethodId?i.brand:""),he=i.billingAddressMode!==d.none&&i.billingAddressRequired,Se=S(i.billingAddressMode),Ne=t(Se&&(null===(M=i.data)||void 0===M||null===(V=M.billingAddress)||void 0===V?void 0:V.country)),[ge,Ae]=n(!1),[ve,je]=n(he?i.data.billingAddress:null),[Oe,Fe]=n(!1),[Pe,we]=n(""),[Ce,ke]=n({value:null}),[xe,Re]=n(null),{handleChangeFor:Ie,triggerValidation:Be,data:Ee,valid:Ve,errors:De,setSchema:qe,setData:Me,setValid:_e,setErrors:Le}=h({schema:[],defaultData:i.data,formatters:p,rules:b}),Te=!!Object.keys(i.installmentOptions).length&&"debit"!==i.fundingSource;var Ke;const He=null===(Ke=i.showInstallmentAmounts)||void 0===Ke||Ke,Ue="kr"===(null!=ce?ce:i.countryCode),ze=i.configuration.koreanAuthenticationRequired&&Ue,We=Oe&&"auto"===i.configuration.socialSecurityNumberMode||"show"===i.configuration.socialSecurityNumberMode,$e=(e,r)=>{i.onFocus({fieldType:e,event:r})},Ge=(e,r)=>{i.onBlur({fieldType:e,event:r})},Je=P(ne,$e,Ge),Qe=()=>A(D({props:i,showKCP:ze,showBrazilianSSN:We},i.billingAddressRequired&&{countrySpecificSchemas:$.getAddressSchemaForCountry(null==ve?void 0:ve.country),billingAddressRequiredFields:i.billingAddressRequiredFields})),Xe=s((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;Re(r)}),[]),Ye=w(Me,_e,Le),Ze=F(W,_,Qe()),er=o((()=>y(i,{sfp:_},{dualBrandSelectElements:pe,setDualBrandSelectElements:be,setSelectedBrandValue:ye,issuingCountryCode:ce,setIssuingCountryCode:me},z)),[pe,ce]);U.current.showValidation=()=>{L.current=!0,null==or||or(),_.current.showValidation(),Be(["holderName","socialSecurityNumber","taxNumber"]),(null==K?void 0:K.current)&&K.current.showValidation()},U.current.processBinLookupResponse=(e,r)=>{er.processBinLookup(e,r)},U.current.setStatus=J,l((()=>(U.current.setFocusOn=_.current.setFocusOn,U.current.updateStyles=_.current.updateStyles,U.current.handleUnsupportedCard=_.current.handleUnsupportedCard,()=>{_.current.destroy()})),[]),l((()=>{const e=[...i.hasHolderName?["holderName"]:[],...We?["socialSecurityNumber"]:[],...ze?["taxNumber"]:[],...he?["billingAddress"]:[]];qe(e)}),[i.hasHolderName,We,ze]),l((()=>{var e;te(q(D({},re),{holderName:null!==(e=Ee.holderName)&&void 0!==e?e:"",taxNumber:Ee.taxNumber})),we(Ee.socialSecurityNumber),he&&je(D({},Ee.billingAddress)),Z(q(D({},Y),{holderName:!i.holderNameRequired||Ve.holderName,socialSecurityNumber:!!Ve.socialSecurityNumber&&Ve.socialSecurityNumber,taxNumber:!!Ve.taxNumber&&Ve.taxNumber,billingAddress:!!Ve.billingAddress&&Ve.billingAddress}));const r=!!De.billingAddress&&Object.entries(De.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);X(q(D({},Q),{holderName:i.holderNameRequired&&De.holderName?De.holderName:null,socialSecurityNumber:We&&De.socialSecurityNumber?De.socialSecurityNumber:null,taxNumber:ze&&De.taxNumber?De.taxNumber:null,billingAddress:he&&r?De.billingAddress:null}))}),[Ee,Ve,De]);const{sortedErrorList:rr,previousSortedErrors:tr,clearSRPanel:or}=E({errors:Q,props:i,isValidating:L,retrieveLayout:Qe,specifications:$,billingAddress:ve,sfp:_});l((()=>{const e=Y.holderName,r=se,t=!he||Y.billingAddress,o=!ze||!!Y.taxNumber&&!!Y.encryptedPassword,n=!We||!!Y.socialSecurityNumber,s=r&&e&&t&&o&&n,l=_.current.mapErrorsToValidationRuleResult(),a=D({},Q,l);if(rr){const e=R(rr,tr,"field");null==e||e.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};i.onValidationErrorAnalytics(r)}))}i.onChange({data:re,valid:Y,errors:a,isValid:s,billingAddress:ve,selectedBrandValue:fe,storePaymentMethod:ge,socialSecurityNumber:Pe,installments:Ce})}),[re,Y,Q,fe,ge,Ce]);const nr=i.storedPaymentMethodId?j:O;return e(r,null,e(a,q(D({ref:_},g(i)),{styles:D({},i.styles),koreanAuthenticationRequired:i.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!i.configuration.koreanAuthenticationRequired||"kr"!==i.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!i.hasHolderName)return;const r=f("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Me("holderName",r),_e("holderName",!0),Le("holderName",null))}else i.autoFocus&&z.current>0&&"handleOnFieldValid"===(null==r?void 0:r.event)&&(null==r?void 0:r.fieldType)===u&&e.valid.encryptedCardNumber&&Ze(),te(D({},re,e.data)),X(D({},Q,e.errors)),Z(D({},Y,e.valid)),le(e.isSfpValid),ue(e.cvcPolicy),Fe(e.showSocialSecurityNumber),ie(e.expiryDatePolicy)},onBrand:i.onBrand,onFocus:Je,type:i.brand,disableIOSArrowKeys:i.disableIOSArrowKeys?Xe:null,render:({setRootNode:r,setFocusOn:t},o)=>{var n;return e("div",{ref:r,className:C({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${null!==(n=i.fundingSource)&&void 0!==n?n:"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===G}),role:"form"},e(I,null),e(nr,q(D({},N(i)),{data:re,valid:Y,errors:Q,handleChangeFor:Ie,focusedElement:oe,setFocusOn:t,sfpState:o,cvcPolicy:de,hasInstallments:Te,showAmountsInInstallments:He,handleInstallments:ke,brandsIcons:i.brandsIcons,formData:Ee,formErrors:De,formValid:Ve,expiryDatePolicy:ae,dualBrandSelectElements:pe,extensions:er,selectedBrandValue:fe,showKCP:ze,showBrazilianSSN:We,socialSecurityNumber:Pe,handleOnStoreDetails:Ae,setAddressRef:H,billingAddress:ve,billingAddressValidationRules:Se&&k(Ne.current),partialAddressSchema:Se,handleAddress:Ye,onAddressLookup:i.onAddressLookup,onAddressSelected:i.onAddressSelected,addressSearchDebounceMs:i.addressSearchDebounceMs,iOSFocusedField:xe,onFieldFocusAnalytics:$e,onFieldBlurAnalytics:Ge})))}})),i.showPayButton&&i.payButton({status:G,variant:i.isPayButtonPrimaryVariant?"primary":"secondary",icon:T({imageFolder:"components/"})(`${B}lock`)}))};M.defaultProps=i;export{M as default};
1
+ import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as t,useMemo as o,useState as n,useCallback as s,useEffect as l}from"../../../../external/preact/hooks/dist/hooks.js";import a from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import i from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as b,getRuleByNameAndMode as f}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import h from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as S,extractPropsForCardFields as N,extractPropsForSFP as g,getLayout as A}from"./utils.js";import v from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as j}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as O}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as F,getFocusHandler as P,getAddressHandler as w}from"./handlers.js";import C from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as k}from"../../../internal/Address/validate.js";import x from"../../../../core/Context/useImage.js";import{getArrayDifferences as R}from"../../../../utils/arrayUtils.js";import I from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as B}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";function V(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function D(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){V(e,r,t[r])}))}return e}function q(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const M=i=>{var V,M;const _=t(null),L=t(!1),T=x(),K=t(null),H=e=>{K.current=e},U=t({});Object.keys(U.current).length||i.setComponentRef(U.current);const z=t(0),W=t(!1),$=o((()=>new v(i.specifications)),[i.specifications]);U.current.sfp=_;const[G,J]=n("ready"),[Q,X]=n({}),[Y,Z]=n(D({},i.holderNameRequired&&{holderName:!1}));var ee;const[re,te]=n(D({},i.hasHolderName&&{holderName:null!==(ee=i.data.holderName)&&void 0!==ee?ee:""})),[oe,ne]=n(""),[se,le]=n(!1),[ae,ie]=n(c),[de,ue]=n(m),[ce,me]=n(null),[pe,be]=n([]),[fe,ye]=n(i.storedPaymentMethodId?i.brand:""),he=i.billingAddressMode!==d.none&&i.billingAddressRequired,Se=S(i.billingAddressMode),Ne=t(Se&&(null===(M=i.data)||void 0===M||null===(V=M.billingAddress)||void 0===V?void 0:V.country)),[ge,Ae]=n(!1),[ve,je]=n(he?i.data.billingAddress:null),[Oe,Fe]=n(!1),[Pe,we]=n(""),[Ce,ke]=n({value:null}),[xe,Re]=n(null),{handleChangeFor:Ie,triggerValidation:Be,data:Ee,valid:Ve,errors:De,setSchema:qe,setData:Me,setValid:_e,setErrors:Le}=h({schema:[],defaultData:i.data,formatters:p,rules:b}),Te=!!Object.keys(i.installmentOptions).length&&"debit"!==i.fundingSource;var Ke;const He=null===(Ke=i.showInstallmentAmounts)||void 0===Ke||Ke,Ue="kr"===(null!=ce?ce:i.countryCode),ze=i.configuration.koreanAuthenticationRequired&&Ue,We=Oe&&"auto"===i.configuration.socialSecurityNumberMode||"show"===i.configuration.socialSecurityNumberMode,$e=(e,r)=>{i.onFocus({fieldType:e,event:r})},Ge=(e,r)=>{i.onBlur({fieldType:e,event:r})},Je=P(ne,$e,Ge),Qe=()=>A(D({props:i,showKCP:ze,showBrazilianSSN:We},i.billingAddressRequired&&{countrySpecificSchemas:$.getAddressSchemaForCountry(null==ve?void 0:ve.country),billingAddressRequiredFields:i.billingAddressRequiredFields})),Xe=s((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;Re(r)}),[]),Ye=w(Me,_e,Le),Ze=F(W,_,Qe()),er=o((()=>y(i,{sfp:_},{dualBrandSelectElements:pe,setDualBrandSelectElements:be,setSelectedBrandValue:ye,issuingCountryCode:ce,setIssuingCountryCode:me},z)),[pe,ce]);U.current.showValidation=()=>{L.current=!0,null==or||or(),_.current.showValidation(),Be(["holderName","socialSecurityNumber","taxNumber"]),(null==K?void 0:K.current)&&K.current.showValidation()},U.current.processBinLookupResponse=(e,r)=>{er.processBinLookup(e,r)},U.current.setStatus=J,l((()=>(U.current.setFocusOn=_.current.setFocusOn,U.current.updateStyles=_.current.updateStyles,U.current.handleUnsupportedCard=_.current.handleUnsupportedCard,()=>{_.current.destroy()})),[]),l((()=>{const e=[...i.hasHolderName?["holderName"]:[],...We?["socialSecurityNumber"]:[],...ze?["taxNumber"]:[],...he?["billingAddress"]:[]];qe(e)}),[i.hasHolderName,We,ze]),l((()=>{var e;te(q(D({},re),{holderName:null!==(e=Ee.holderName)&&void 0!==e?e:"",taxNumber:Ee.taxNumber})),we(Ee.socialSecurityNumber),he&&je(D({},Ee.billingAddress)),Z(q(D({},Y),{holderName:!i.holderNameRequired||Ve.holderName,socialSecurityNumber:!!Ve.socialSecurityNumber&&Ve.socialSecurityNumber,taxNumber:!!Ve.taxNumber&&Ve.taxNumber,billingAddress:!!Ve.billingAddress&&Ve.billingAddress}));const r=!!De.billingAddress&&Object.entries(De.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);X(q(D({},Q),{holderName:i.holderNameRequired&&De.holderName?De.holderName:null,socialSecurityNumber:We&&De.socialSecurityNumber?De.socialSecurityNumber:null,taxNumber:ze&&De.taxNumber?De.taxNumber:null,billingAddress:he&&r?De.billingAddress:null}))}),[Ee,Ve,De]);const{sortedErrorList:rr,previousSortedErrors:tr,clearSRPanel:or}=E({errors:Q,props:i,isValidating:L,retrieveLayout:Qe,specifications:$,billingAddress:ve,sfp:_});if(rr){const e=R(rr,tr,"field");null==e||e.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};i.onValidationErrorAnalytics(r)}))}l((()=>{const e=Y.holderName,r=se,t=!he||Y.billingAddress,o=!ze||!!Y.taxNumber&&!!Y.encryptedPassword,n=!We||!!Y.socialSecurityNumber,s=r&&e&&t&&o&&n,l=_.current.mapErrorsToValidationRuleResult(),a=D({},Q,l);i.onChange({data:re,valid:Y,errors:a,isValid:s,billingAddress:ve,selectedBrandValue:fe,storePaymentMethod:ge,socialSecurityNumber:Pe,installments:Ce})}),[re,Y,Q,fe,ge,Ce]);const nr=i.storedPaymentMethodId?j:O;return e(r,null,e(a,q(D({ref:_},g(i)),{styles:D({},i.styles),koreanAuthenticationRequired:i.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!i.configuration.koreanAuthenticationRequired||"kr"!==i.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!i.hasHolderName)return;const r=f("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Me("holderName",r),_e("holderName",!0),Le("holderName",null))}else i.autoFocus&&z.current>0&&"handleOnFieldValid"===(null==r?void 0:r.event)&&(null==r?void 0:r.fieldType)===u&&e.valid.encryptedCardNumber&&Ze(),te(D({},re,e.data)),X(D({},Q,e.errors)),Z(D({},Y,e.valid)),le(e.isSfpValid),ue(e.cvcPolicy),Fe(e.showSocialSecurityNumber),ie(e.expiryDatePolicy)},onBrand:i.onBrand,onFocus:Je,type:i.brand,disableIOSArrowKeys:i.disableIOSArrowKeys?Xe:null,render:({setRootNode:r,setFocusOn:t},o)=>{var n;return e("div",{ref:r,className:C({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${null!==(n=i.fundingSource)&&void 0!==n?n:"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===G}),role:"form"},e(I,null),e(nr,q(D({},N(i)),{data:re,valid:Y,errors:Q,handleChangeFor:Ie,focusedElement:oe,setFocusOn:t,sfpState:o,cvcPolicy:de,hasInstallments:Te,showAmountsInInstallments:He,handleInstallments:ke,brandsIcons:i.brandsIcons,formData:Ee,formErrors:De,formValid:Ve,expiryDatePolicy:ae,dualBrandSelectElements:pe,extensions:er,selectedBrandValue:fe,showKCP:ze,showBrazilianSSN:We,socialSecurityNumber:Pe,handleOnStoreDetails:Ae,setAddressRef:H,billingAddress:ve,billingAddressValidationRules:Se&&k(Ne.current),partialAddressSchema:Se,handleAddress:Ye,onAddressLookup:i.onAddressLookup,onAddressSelected:i.onAddressSelected,addressSearchDebounceMs:i.addressSearchDebounceMs,iOSFocusedField:xe,onFieldFocusAnalytics:$e,onFieldBlurAnalytics:Ge})))}})),i.showPayButton&&i.payButton({status:G,variant:i.isPayButtonPrimaryVariant?"primary":"secondary",icon:T({imageFolder:"components/"})(`${B}lock`)}))};M.defaultProps=i;export{M as default};
2
2
  //# sourceMappingURL=CardInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n // Analytics\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={props.onBrand}\n onFocus={handleFocus}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n <FormInstruction />\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","_object_spread","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","_object_spread_props","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"y4EA+BA,MAAMA,EAAaC,QAkDsDA,EAAAA,EAjDrE,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,CAAA,GAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,EAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,EAA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A,MAEDzB,EAACH,GAAAA,EAAAA,EAAAA,CAAAA,EAEO6B,EAA0BtM,IAAAA,CAG9B8B,KAAMA,GACNL,MAAOA,EACPF,OAAQA,EACRkD,gBAAiBA,GACjBxC,eAAgBA,GAChBqG,WAAYA,EACZ0D,SAAUA,EACVxJ,UAAWA,GACXiD,gBAAiBA,GACjBG,0BAA2BA,GAC3B2G,mBAAoBlI,GAEpBmI,YAAaxM,EAAMwM,YACnB7H,SAAUA,GACVE,WAAYA,GACZD,UAAWA,GACXvC,iBAAkBA,GAClBQ,wBAAyBA,GACzBgF,WAAYA,GACZ9E,mBAAoBA,GAEpBiD,QAASA,GAETG,iBAAkBA,GAClBjC,qBAAsBA,GAEtBuI,qBAAsB3I,GAEtBvD,cAAeA,EACfoD,eAAgBA,GAChB+I,8BAA+BlJ,IAAwBmJ,EAAiCjJ,GAAsBjD,SAC9G+C,qBAAsBA,GACtBiE,cAAeA,GACfmF,gBAAiB5M,EAAM4M,gBACvBC,kBAAmB7M,EAAM6M,kBACzBC,wBAAyB9M,EAAM8M,wBAE/BvI,gBAAiBA,GAEjB8B,sBAAuBA,GACvBM,qBAAsBA,WAKrC3G,EAAM+M,eACH/M,EAAMgN,UAAU,CACZ5L,SACA6L,QAASjN,EAAMkN,0BAA4B,UAAY,YACvDC,KAAM/M,EAAS,CAAEgN,YAAa,eAAxBhN,CAAyC,GAAGiN,WACtD,EAKhBtN,EAAUuN,aAAeA"}
1
+ {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={props.onBrand}\n onFocus={handleFocus}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n <FormInstruction />\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","_object_spread","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","_object_spread_props","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"u4EA+BA,MAAMA,EAAaC,QAkDsDA,EAAAA,EAjDrE,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,CAAA,GAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,EAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,EAAQC,GAAaC,EAAS,UAE9BC,EAAQC,GAAaF,EAA8B,CAAC,IACpDG,EAAOC,GAAYJ,EAA8BK,EAChD3B,CAAAA,EAAAA,EAAM4B,oBAAsB,CAAEC,YAAY,KAGL7B,IAAAA,GAD7C,MAAO8B,GAAMC,IAAWT,EAA6BK,EAC7C3B,CAAAA,EAAAA,EAAMgC,eAAiB,CAAEH,WAAiC,QAArB7B,GAAAA,EAAM8B,KAAKD,sBAAX7B,GAAAA,GAAyB,OAG/DiC,GAAgBC,IAAqBZ,EAAS,KAC9Ca,GAAYC,IAAiBd,GAAS,IACtCe,GAAkBC,IAAuBhB,EAASiB,IAClDC,GAAWC,IAAgBnB,EAASoB,IACpCC,GAAoBC,IAAyBtB,EAAiB,OAE9DuB,GAAyBC,IAA8BxB,EAAS,KAChEyB,GAAoBC,IAAyB1B,EAAStB,EAAMiD,sBAAwBjD,EAAMkD,MAAQ,IAEnGC,GAAqBnD,EAAMoD,qBAAuBC,EAAmBC,MAAQtD,EAAMuD,uBAEnFC,GAAuBC,EA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yB9M,EAAM8M,wBAE/BvI,gBAAiBA,GAEjB8B,sBAAuBA,GACvBM,qBAAsBA,WAKrC3G,EAAM+M,eACH/M,EAAMgN,UAAU,CACZ5L,SACA6L,QAASjN,EAAMkN,0BAA4B,UAAY,YACvDC,KAAM/M,EAAS,CAAEgN,YAAa,eAAxBhN,CAAyC,GAAGiN,WACtD,EAKhBtN,EAAUuN,aAAeA"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import o from"./CVCHint.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as c,CVC_POLICY_OPTIONAL as i,ENCRYPTED_SECURITY_CODE as n,CVC_POLICY_REQUIRED as l}from"../../../../internal/SecuredFields/lib/constants.js";import s from"./DataSfSpan.js";import{alternativeLabelContent as d}from"./IframeLabelAlternative.js";function u(u){const{label:m,onFocusField:_=(()=>{}),error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:b=l,showContextualElement:k,contextualText:v}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":b===c,"adyen-checkout__field__cvc--optional":b===i}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=b!==i?m:j.get("creditCard.securityCode.label.optional");return e(a,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>_(n),className:V,errorMessage:f,isValid:x,dir:"ltr",name:n,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:d,showContextualElement:k,contextualText:v},e(s,{encryptedFieldType:n,className:N}),e(o,{frontCVC:F,fieldLabel:T}))}export{u as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import o from"./CVCHint.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as i,CVC_POLICY_OPTIONAL as c,ENCRYPTED_SECURITY_CODE as l,CVC_POLICY_REQUIRED as n}from"../../../../internal/SecuredFields/lib/constants.js";import s from"./DataSfSpan.js";import{alternativeLabelContent as d}from"./FieldLabelAlternative.js";function u(u){const{label:_,onFocusField:m=()=>{},error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:b=n,showContextualElement:k,contextualText:v}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":b===i,"adyen-checkout__field__cvc--optional":b===c}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=b!==c?_:j.get("creditCard.securityCode.label.optional");return e(a,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>m(l),className:V,errorMessage:f,isValid:x,dir:"ltr",name:l,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:d,showContextualElement:k,contextualText:v},e(s,{encryptedFieldType:l,className:N}),e(o,{frontCVC:F,fieldLabel:T}))}export{u as default};
2
2
  //# sourceMappingURL=CVC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './IframeLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={fieldLabel} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"4jBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,SAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAExE,OACIC,EAACC,EAAAA,CACGvB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAauB,GACjCrB,UAAWY,EACXU,aAAcvB,EACdK,QAASA,EACTmB,IAAK,MACLC,KAAMH,EACNX,KAAMA,EACNe,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BpB,sBAAuBA,EACvBC,eAAgBA,GAEhBU,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBrB,UAAWgB,IAEpEG,EAACY,EAAAA,CAAQ1B,SAAUA,EAAUY,WAAYA,IAGrD"}
1
+ {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={fieldLabel} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"2jBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,OAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAExE,OACIC,EAACC,EAAAA,CACGvB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAauB,GACjCrB,UAAWY,EACXU,aAAcvB,EACdK,QAASA,EACTmB,IAAK,MACLC,KAAMH,EACNX,KAAMA,EACNe,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BpB,sBAAuBA,EACvBC,eAAgBA,GAEhBU,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBrB,UAAWgB,IAEpEG,EAACY,EAAAA,CAAQ1B,SAAUA,EAAUY,WAAYA,IAGrD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import a from"./BrandIcon.js";import r from"./DualBrandingIcon/DualBrandingIcon.js";import d from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import i from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./IframeLabelAlternative.js";function l(l){const{i18n:s}=o(),{error:u="",isValid:_=!1,onFocusField:m=(()=>{}),dualBrandingElements:f,dualBrandingChangeHandler:p,dualBrandingSelected:b}=l;return e(d,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>m(t),errorMessage:u,isValid:_,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(i,{encryptedFieldType:t,className:n({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":_,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(a,{brandsConfiguration:l.brandsConfiguration,brand:l.brand}),f&&!u&&e("div",{className:n(["adyen-checkout__card__dual-branding__buttons",{"adyen-checkout__card__dual-branding__buttons--active":_}])},f.map((n=>e(r,{key:n.id,brand:n.id,brandsConfiguration:l.brandsConfiguration,onClick:p,dataValue:n.id,notSelected:""!==b&&b!==n.id})))))}export{l as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import a from"./BrandIcon.js";import r from"./DualBrandingIcon/DualBrandingIcon.js";import d from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import i from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./FieldLabelAlternative.js";function l(l){const{i18n:s}=o(),{error:u="",isValid:_=!1,onFocusField:m=()=>{},dualBrandingElements:f,dualBrandingChangeHandler:p,dualBrandingSelected:b}=l;return e(d,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>m(t),errorMessage:u,isValid:_,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(i,{encryptedFieldType:t,className:n({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":_,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(a,{brandsConfiguration:l.brandsConfiguration,brand:l.brand}),f&&!u&&e("div",{className:n(["adyen-checkout__card__dual-branding__buttons",{"adyen-checkout__card__dual-branding__buttons--active":_}])},f.map((n=>e(r,{key:n.id,brand:n.id,brandsConfiguration:l.brandsConfiguration,onClick:p,dataValue:n.id,notSelected:""!==b&&b!==n.id})))))}export{l as default};
2
2
  //# sourceMappingURL=CardNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './IframeLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements, dualBrandingChangeHandler, dualBrandingSelected } = props;\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\n\n {dualBrandingElements && !error && (\n <div\n className={classNames([\n 'adyen-checkout__card__dual-branding__buttons',\n { 'adyen-checkout__card__dual-branding__buttons--active': isValid }\n ])}\n >\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n onClick={dualBrandingChangeHandler}\n dataValue={element.id}\n notSelected={dualBrandingSelected !== '' && dualBrandingSelected !== element.id}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","h","Field","label","focused","filled","classNameModifiers","ENCRYPTED_CARD_NUMBER","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","div","map","element","DualBrandingIcon","key","id","onClick","dataValue","notSelected"],"mappings":"yiBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,SAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAExI,OACIS,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaU,GACjCC,aAAcb,EACdC,QAASA,EACTa,IAAK,MACLC,KAAMH,EACNI,eAAe,EACflB,KAAMA,EACNmB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bd,EAACe,EAAAA,CACGC,mBAAoBV,EACpBW,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCxB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM4B,kBAIlE5B,EAAM4B,gBAAkBtB,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,EAAQG,QAOzG"}
1
+ {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements, dualBrandingChangeHandler, dualBrandingSelected } = props;\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\n\n {dualBrandingElements && !error && (\n <div\n className={classNames([\n 'adyen-checkout__card__dual-branding__buttons',\n { 'adyen-checkout__card__dual-branding__buttons--active': isValid }\n ])}\n >\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n onClick={dualBrandingChangeHandler}\n dataValue={element.id}\n notSelected={dualBrandingSelected !== '' && dualBrandingSelected !== element.id}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","h","Field","label","focused","filled","classNameModifiers","ENCRYPTED_CARD_NUMBER","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","div","map","element","DualBrandingIcon","key","id","onClick","dataValue","notSelected"],"mappings":"wiBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAExI,OACIS,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaU,GACjCC,aAAcb,EACdC,QAASA,EACTa,IAAK,MACLC,KAAMH,EACNI,eAAe,EACflB,KAAMA,EACNmB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bd,EAACe,EAAAA,CACGC,mBAAoBV,EACpBW,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCxB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM4B,kBAIlE5B,EAAM4B,gBAAkBtB,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,EAAQG,QAOzG"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import n from"./DataSfSpan.js";import{DATE_POLICY_HIDDEN as o,DATE_POLICY_OPTIONAL as r,ENCRYPTED_EXPIRY_DATE as l,DATE_POLICY_REQUIRED as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as s}from"./IframeLabelAlternative.js";function _(_){const{label:p,focused:m,filled:u,onFocusField:f,className:x="",error:h="",isValid:y=!1,expiryDatePolicy:k=d,showContextualElement:F,contextualText:j}=_,{i18n:b}=i(),N=c(),g=t(x,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":k===o,"adyen-checkout__field__exp-date--optional":k===r}),C=k!==r?p:`${p} ${b.get("field.title.optional")}`;return e(a,{label:C,classNameModifiers:["expiryDate"],className:g,focused:m,filled:u,onFocusField:()=>f(l),errorMessage:h,isValid:y,dir:"ltr",name:"encryptedExpiryDate",i18n:b,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:s,showContextualElement:F,contextualText:j},e(n,{encryptedFieldType:l,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":h,"adyen-checkout__input--focus":m,"adyen-checkout__input--valid":y})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":h||y})},e("img",{src:N({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:C})))}export{_ as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import n from"./DataSfSpan.js";import{DATE_POLICY_HIDDEN as o,DATE_POLICY_OPTIONAL as r,ENCRYPTED_EXPIRY_DATE as l,DATE_POLICY_REQUIRED as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as s}from"./FieldLabelAlternative.js";function _(_){const{label:p,focused:m,filled:u,onFocusField:x,className:f="",error:h="",isValid:y=!1,expiryDatePolicy:k=d,showContextualElement:F,contextualText:j}=_,{i18n:b}=i(),N=c(),g=t(f,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":k===o,"adyen-checkout__field__exp-date--optional":k===r}),C=k!==r?p:`${p} ${b.get("field.title.optional")}`;return e(a,{label:C,classNameModifiers:["expiryDate"],className:g,focused:m,filled:u,onFocusField:()=>x(l),errorMessage:h,isValid:y,dir:"ltr",name:"encryptedExpiryDate",i18n:b,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:s,showContextualElement:F,contextualText:j},e(n,{encryptedFieldType:l,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":h,"adyen-checkout__input--focus":m,"adyen-checkout__input--valid":y})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":h||y})},e("img",{src:N({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:C})))}export{_ as default};
2
2
  //# sourceMappingURL=ExpirationDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './IframeLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={['expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={fieldLabel}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","h","Field","classNameModifiers","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt"],"mappings":"wlBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,MACdA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAX,GACEY,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWZ,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDG,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBlB,EAAQ,GAAGA,KAASW,EAAKS,IAAI,0BAE5F,OACIC,EAACC,EAAAA,CACGtB,MAAOmB,EACPI,mBAAoB,CAAC,cACrBnB,UAAWW,EACXd,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAaqB,GACjCC,aAAcpB,EACdC,QAASA,EACToB,IAAK,MACLC,KAAM,sBACNhB,KAAMA,EACNiB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BtB,sBAAuBA,EACvBC,eAAgBA,GAEhBW,EAACW,EAAAA,CACGC,mBAAoBT,EACpBpB,UAAWY,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCJ,EAChC,+BAAgCK,MAGxCe,EAACa,OAAAA,CACG9B,UAAWY,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAGrEe,EAACc,MAAAA,CACGC,IAAKvB,EAAS,CAAEwB,YAAa,eAAxBxB,CAAyC,oBAC9CT,UAAU,uCACVkC,IAAKnB,KAKzB"}
1
+ {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={['expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={fieldLabel}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","h","Field","classNameModifiers","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt"],"mappings":"ulBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,MACdA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAX,GACEY,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWZ,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDG,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBlB,EAAQ,GAAGA,KAASW,EAAKS,IAAI,0BAE5F,OACIC,EAACC,EAAAA,CACGtB,MAAOmB,EACPI,mBAAoB,CAAC,cACrBnB,UAAWW,EACXd,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAaqB,GACjCC,aAAcpB,EACdC,QAASA,EACToB,IAAK,MACLC,KAAM,sBACNhB,KAAMA,EACNiB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BtB,sBAAuBA,EACvBC,eAAgBA,GAEhBW,EAACW,EAAAA,CACGC,mBAAoBT,EACpBpB,UAAWY,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCJ,EAChC,+BAAgCK,MAGxCe,EAACa,OAAAA,CACG9B,UAAWY,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAGrEe,EAACc,MAAAA,CACGC,IAAKvB,EAAS,CAAEwB,YAAa,eAAxBxB,CAAyC,oBAC9CT,UAAU,uCACVkC,IAAKnB,KAKzB"}
@@ -0,0 +1,2 @@
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const n=(n,o)=>e("div",r(function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(r){t(e,r,n[r])}))}return e}({},n),{"aria-hidden":"true"}),o);export{n as alternativeLabelContent};
2
+ //# sourceMappingURL=FieldLabelAlternative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldLabelAlternative.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/FieldLabelAlternative.tsx"],"sourcesContent":["import { h } from 'preact';\n\nexport const alternativeLabelContent = (defaultWrapperProps, children) => {\n return (\n <div {...defaultWrapperProps} aria-hidden={'true'}>\n {children}\n </div>\n );\n};\n"],"names":["alternativeLabelContent","defaultWrapperProps","children","h","div","aria-hidden"],"mappings":"qjBAEO,MAAMA,EAA0B,CAACC,EAAqBC,IAErDC,EAACC,MAAQH,wUAAAA,CAAAA,CAAAA,EAAAA,GAAAA,CAAqBI,cAAa,SACtCH"}