@adyen/adyen-web 6.11.0 → 6.12.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 (274) hide show
  1. package/dist/cjs/adyen.css +4 -4
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +166 -99
  6. package/dist/es/adyen.css +4 -4
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/components/ANCVAwait/config.js +1 -1
  9. package/dist/es/components/ANCV/components/ANCVAwait/config.js.map +1 -1
  10. package/dist/es/components/Ach/Ach.js +1 -1
  11. package/dist/es/components/Ach/Ach.js.map +1 -1
  12. package/dist/es/components/Ach/components/AccountTypeSelector.js +2 -0
  13. package/dist/es/components/Ach/components/AccountTypeSelector.js.map +1 -0
  14. package/dist/es/components/Ach/components/AchComponent.js +2 -0
  15. package/dist/es/components/Ach/components/AchComponent.js.map +1 -0
  16. package/dist/es/components/Ach/components/useSRPanelForACHErrors.js +2 -0
  17. package/dist/es/components/Ach/components/useSRPanelForACHErrors.js.map +1 -0
  18. package/dist/es/components/Ach/components/validate.js +2 -0
  19. package/dist/es/components/Ach/components/validate.js.map +1 -0
  20. package/dist/es/components/Ach/defaultProps.js +2 -0
  21. package/dist/es/components/Ach/defaultProps.js.map +1 -0
  22. package/dist/es/components/AmazonPay/utils.js +1 -1
  23. package/dist/es/components/ApplePay/ApplePay.js +1 -1
  24. package/dist/es/components/Atome/Atome.js +1 -1
  25. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  26. package/dist/es/components/BcmcMobile/BcmcMobile.js +1 -1
  27. package/dist/es/components/Boleto/components/BoletoInput/validate.js +1 -1
  28. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  29. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/components/CardFields.js +1 -1
  31. package/dist/es/components/Card/components/CardInput/components/DataSfSpan.js +1 -1
  32. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  33. package/dist/es/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
  34. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  35. package/dist/es/components/Card/components/CardInput/validate.js +1 -1
  36. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  37. package/dist/es/components/DuitNow/DuitNow.js +1 -1
  38. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  39. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  40. package/dist/es/components/PayNow/PayNow.js +1 -1
  41. package/dist/es/components/PayPal/constants.js +1 -1
  42. package/dist/es/components/PayPal/constants.js.map +1 -1
  43. package/dist/es/components/PayTo/PayTo.js.map +1 -1
  44. package/dist/es/components/Pix/PixInput/PixInput.js.map +1 -1
  45. package/dist/es/components/PromptPay/PromptPay.js +1 -1
  46. package/dist/es/components/Redirect/Redirect.js +1 -1
  47. package/dist/es/components/Riverty/Riverty.js +1 -1
  48. package/dist/es/components/Riverty/config.js +1 -1
  49. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  50. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  51. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  52. package/dist/es/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
  53. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  54. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  55. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js +1 -1
  56. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  57. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  58. package/dist/es/components/WeChat/WeChat.js +1 -1
  59. package/dist/es/components/internal/Address/Address.js +1 -1
  60. package/dist/es/components/internal/Address/validate.formats.js.map +1 -1
  61. package/dist/es/components/internal/Countdown/utils.js.map +1 -1
  62. package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  63. package/dist/es/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  64. package/dist/es/components/internal/FormFields/InputDate/utils.js.map +1 -1
  65. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  66. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  67. package/dist/es/components/internal/IbanInput/validate.js +1 -1
  68. package/dist/es/components/internal/IssuerList/IssuerList.js +1 -1
  69. package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
  70. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  71. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  72. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  73. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  74. package/dist/es/components/internal/PhoneInput/validate.js +1 -1
  75. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  76. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  77. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  78. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  79. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  80. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  81. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleTab.js +1 -1
  82. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleTab.js.map +1 -1
  83. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.js.map +1 -1
  84. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  85. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/tabbing/utils.js.map +1 -1
  86. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
  87. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
  88. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  89. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  90. package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js +1 -1
  91. package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
  92. package/dist/es/components/internal/SecuredFields/lib/utilities/addContextTranslations.js +1 -1
  93. package/dist/es/components/internal/StoreDetails/StoreDetails.js +1 -1
  94. package/dist/es/components/internal/StoreDetails/StoreDetails.js.map +1 -1
  95. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  96. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  97. package/dist/es/core/Analytics/Analytics.js +1 -1
  98. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  99. package/dist/es/core/Analytics/constants.js +1 -1
  100. package/dist/es/core/Analytics/constants.js.map +1 -1
  101. package/dist/es/core/Analytics/utils.js +1 -1
  102. package/dist/es/core/Errors/constants.js +1 -1
  103. package/dist/es/core/Errors/constants.js.map +1 -1
  104. package/dist/es/core/Errors/utils.js +1 -1
  105. package/dist/es/core/Errors/utils.js.map +1 -1
  106. package/dist/es/core/RiskModule/components/DeviceFingerprint/utils.js +1 -1
  107. package/dist/es/core/RiskModule/constants.js +1 -1
  108. package/dist/es/core/RiskModule/constants.js.map +1 -1
  109. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  110. package/dist/es/core/Services/http.js +1 -1
  111. package/dist/es/core/core.js +1 -1
  112. package/dist/es/external/preact/dist/preact.js +1 -1
  113. package/dist/es/external/preact/dist/preact.js.map +1 -1
  114. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  115. package/dist/es/index.d.ts +166 -99
  116. package/dist/es/index.js +1 -1
  117. package/dist/es/utils/Validator/defaultRules.js +1 -1
  118. package/dist/es/utils/base64.js.map +1 -1
  119. package/dist/es/utils/browserInfo.js +1 -1
  120. package/dist/es/utils/browserInfo.js.map +1 -1
  121. package/dist/es/utils/setFocus.js +1 -1
  122. package/dist/es/utils/setFocus.js.map +1 -1
  123. package/dist/es/utils/textUtils.js +1 -1
  124. package/dist/es/utils/textUtils.js.map +1 -1
  125. package/dist/es/utils/useForm/useForm.js +1 -1
  126. package/dist/es-legacy/adyen.css +4 -4
  127. package/dist/es-legacy/adyen.css.map +1 -1
  128. package/dist/es-legacy/components/ANCV/components/ANCVAwait/config.js +1 -1
  129. package/dist/es-legacy/components/ANCV/components/ANCVAwait/config.js.map +1 -1
  130. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  131. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  132. package/dist/es-legacy/components/Ach/components/AccountTypeSelector.js +2 -0
  133. package/dist/es-legacy/components/Ach/components/AccountTypeSelector.js.map +1 -0
  134. package/dist/es-legacy/components/Ach/components/AchComponent.js +2 -0
  135. package/dist/es-legacy/components/Ach/components/AchComponent.js.map +1 -0
  136. package/dist/es-legacy/components/Ach/components/useSRPanelForACHErrors.js +2 -0
  137. package/dist/es-legacy/components/Ach/components/useSRPanelForACHErrors.js.map +1 -0
  138. package/dist/es-legacy/components/Ach/components/validate.js +2 -0
  139. package/dist/es-legacy/components/Ach/components/validate.js.map +1 -0
  140. package/dist/es-legacy/components/Ach/defaultProps.js +2 -0
  141. package/dist/es-legacy/components/Ach/defaultProps.js.map +1 -0
  142. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  143. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  144. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  145. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  146. package/dist/es-legacy/components/BcmcMobile/BcmcMobile.js +1 -1
  147. package/dist/es-legacy/components/Boleto/components/BoletoInput/validate.js +1 -1
  148. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  149. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  150. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js +1 -1
  151. package/dist/es-legacy/components/Card/components/CardInput/components/DataSfSpan.js +1 -1
  152. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  153. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
  154. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  155. package/dist/es-legacy/components/Card/components/CardInput/validate.js +1 -1
  156. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  157. package/dist/es-legacy/components/DuitNow/DuitNow.js +1 -1
  158. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  159. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  160. package/dist/es-legacy/components/PayNow/PayNow.js +1 -1
  161. package/dist/es-legacy/components/PayPal/constants.js +1 -1
  162. package/dist/es-legacy/components/PayPal/constants.js.map +1 -1
  163. package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -1
  164. package/dist/es-legacy/components/Pix/PixInput/PixInput.js.map +1 -1
  165. package/dist/es-legacy/components/PromptPay/PromptPay.js +1 -1
  166. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  167. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  168. package/dist/es-legacy/components/Riverty/config.js +1 -1
  169. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  170. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  171. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  172. package/dist/es-legacy/components/ThreeDS2/components/Challenge/DoChallenge3DS2.js +1 -1
  173. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  174. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  175. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js +1 -1
  176. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  177. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  178. package/dist/es-legacy/components/WeChat/WeChat.js +1 -1
  179. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  180. package/dist/es-legacy/components/internal/Address/validate.formats.js.map +1 -1
  181. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  182. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  183. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  184. package/dist/es-legacy/components/internal/Countdown/utils.js.map +1 -1
  185. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  186. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  187. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  188. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  189. package/dist/es-legacy/components/internal/FormFields/InputDate/utils.js.map +1 -1
  190. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  191. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  192. package/dist/es-legacy/components/internal/IbanInput/validate.js +1 -1
  193. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  194. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  195. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  196. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  197. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  198. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  199. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  200. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  201. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  202. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  203. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  204. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  205. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleTab.js +1 -1
  206. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleTab.js.map +1 -1
  207. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.js.map +1 -1
  208. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.js.map +1 -1
  209. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/tabbing/utils.js.map +1 -1
  210. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js +1 -1
  211. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/userAgent.js.map +1 -1
  212. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  213. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  214. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js +1 -1
  215. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
  216. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/addContextTranslations.js +1 -1
  217. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js +1 -1
  218. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js.map +1 -1
  219. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  220. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  221. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  222. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  223. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  224. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  225. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  226. package/dist/es-legacy/core/Errors/constants.js +1 -1
  227. package/dist/es-legacy/core/Errors/constants.js.map +1 -1
  228. package/dist/es-legacy/core/Errors/utils.js +1 -1
  229. package/dist/es-legacy/core/Errors/utils.js.map +1 -1
  230. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  231. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/utils.js +1 -1
  232. package/dist/es-legacy/core/RiskModule/constants.js +1 -1
  233. package/dist/es-legacy/core/RiskModule/constants.js.map +1 -1
  234. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  235. package/dist/es-legacy/core/core.js +1 -1
  236. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  237. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  238. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  239. package/dist/es-legacy/index.js +1 -1
  240. package/dist/es-legacy/utils/Validator/defaultRules.js +1 -1
  241. package/dist/es-legacy/utils/base64.js.map +1 -1
  242. package/dist/es-legacy/utils/browserInfo.js +1 -1
  243. package/dist/es-legacy/utils/browserInfo.js.map +1 -1
  244. package/dist/es-legacy/utils/setFocus.js +1 -1
  245. package/dist/es-legacy/utils/setFocus.js.map +1 -1
  246. package/dist/es-legacy/utils/textUtils.js +1 -1
  247. package/dist/es-legacy/utils/textUtils.js.map +1 -1
  248. package/dist/es-legacy/utils/useForm/useForm.js +1 -1
  249. package/package.json +23 -23
  250. package/styles/adyen.css +4 -4
  251. package/dist/es/components/Ach/components/AchInput/AchInput.js +0 -2
  252. package/dist/es/components/Ach/components/AchInput/AchInput.js.map +0 -1
  253. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +0 -2
  254. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +0 -1
  255. package/dist/es/components/Ach/components/AchInput/components/AchSecuredFields.js +0 -2
  256. package/dist/es/components/Ach/components/AchInput/components/AchSecuredFields.js.map +0 -1
  257. package/dist/es/components/Ach/components/AchInput/defaultProps.js +0 -2
  258. package/dist/es/components/Ach/components/AchInput/defaultProps.js.map +0 -1
  259. package/dist/es/components/Ach/components/AchInput/defaultStyles.js +0 -2
  260. package/dist/es/components/Ach/components/AchInput/defaultStyles.js.map +0 -1
  261. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/tabbing/tabScenarioACH.js +0 -2
  262. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/tabbing/tabScenarioACH.js.map +0 -1
  263. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +0 -2
  264. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +0 -1
  265. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +0 -2
  266. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +0 -1
  267. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSecuredFields.js +0 -2
  268. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSecuredFields.js.map +0 -1
  269. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js +0 -2
  270. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js.map +0 -1
  271. package/dist/es-legacy/components/Ach/components/AchInput/defaultStyles.js +0 -2
  272. package/dist/es-legacy/components/Ach/components/AchInput/defaultStyles.js.map +0 -1
  273. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/tabbing/tabScenarioACH.js +0 -2
  274. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/tabbing/tabScenarioACH.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import o from"../Countdown/index.js";import r from"../Button/Button.js";import s from"../Spinner/Spinner.js";import a from"../../../core/Services/payment-status.js";import{processResponse as i}from"../../../core/ProcessResponse/process-response.js";import{copyToClipboard as n}from"../../../utils/clipboard.js";import c from"../../../core/Errors/AdyenCheckoutError.js";import{useCoreContext as p}from"../../../core/Context/CoreProvider.js";import d from"../ContentSeparator/ContentSeparator.js";import l from"../../../core/Context/useImage.js";import{useA11yReporter as m}from"../../../core/Errors/useA11yReporter.js";import u from"../../../utils/useAutoFocus.js";import{ANALYTICS_DOWNLOAD_STR as h,ANALYTICS_QR_CODE_DOWNLOAD as _}from"../../../core/Analytics/constants.js";import{PREFIX as y}from"../Icon/constants.js";function g(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class f extends t{componentDidMount(){this.statusInterval()}componentWillUnmount(){clearTimeout(this.timeoutId)}pollStatus(t){clearTimeout(this.timeoutId),this.timeoutId=setTimeout((async()=>{const t=performance.now();await this.checkStatus();const e=performance.now();this.statusInterval(Math.round(e-t))}),t)}render({amount:t,url:a,brandLogo:i,brandName:c,countdownTime:g,type:f,onActionHandled:k},{expired:q,completed:b,loading:v}){const{i18n:C,loadingContext:N}=p(),w=l(),T=this.props.qrCodeData?`${N}utility/v1/barcode.png?type=qrCode&data=${this.props.qrCodeData}&clientKey=${this.props.clientKey}`:this.props.qrCodeImage,I=(t,o)=>{const r=C.get(o);return m(r),e("div",{className:"adyen-checkout__qr-loader adyen-checkout__qr-loader--result"},e("img",{className:"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result",src:w({imageFolder:"components/"})(t),alt:r}),e("div",{className:"adyen-checkout__qr-loader__subtitle"},r))};if(q)return I("error","error.subtitle.payment");if(b)return I("success","creditCard.success");if(v)return e("div",{className:"adyen-checkout__qr-loader"},i&&e("div",{className:"adyen-checkout__qr-loader__brand-logo-wrapper"},e("img",{alt:c,src:i,className:"adyen-checkout__qr-loader__brand-logo"})),e(s,null));const j=C.get(this.props.timeToPay).split("%@"),S=u(),x=this.props.classNameModifiers.map((t=>`adyen-checkout__qr-loader--${t}`));return e("div",{className:`adyen-checkout__qr-loader adyen-checkout__qr-loader--${f} ${x.join(" ")}`},i&&e("div",{className:"adyen-checkout__qr-loader__brand-logo-wrapper"},e("img",{src:i,alt:c,className:"adyen-checkout__qr-loader__brand-logo"})),t&&t.value&&t.currency&&e("div",{className:"adyen-checkout__qr-loader__payment_amount"},C.amount(t.value,t.currency)),a&&e("div",{className:"adyen-checkout__qr-loader__app-link"},this.props.redirectIntroduction&&e("div",{className:"adyen-checkout__qr-loader__subtitle"},C.get(this.props.redirectIntroduction)),e(r,{classNameModifiers:["qr-loader"],onClick:()=>this.redirectToApp(a),label:C.get(this.props.buttonLabel)}),e(d,null)),e("div",{ref:S,tabIndex:0,className:"adyen-checkout__qr-loader__subtitle"},"string"==typeof this.props.introduction?C.get(this.props.introduction):this.props.introduction?.()),e("img",{src:T,alt:C.get("wechatpay.scanqrcode"),onLoad:()=>{k?.({componentType:this.props.type,actionDescription:"qr-code-loaded"})}}),e("div",{className:"adyen-checkout__qr-loader__progress"},e("span",{className:"adyen-checkout__qr-loader__percentage",style:{width:`${this.state.percentage}%`}})),e("div",{className:"adyen-checkout__qr-loader__countdown"},j[0]," ",e(o,{minutesFromNow:g,onTick:this.onTick,onCompleted:this.onTimeUp})," ",j[1]),this.props.instructions&&e("div",{className:"adyen-checkout__qr-loader__instructions"},"string"==typeof this.props.instructions?C.get(this.props.instructions):this.props.instructions?.()),this.props.copyBtn&&e("div",{className:"adyen-checkout__qr-loader__actions"},e(r,{inline:!0,variant:"action",onClick:(t,{complete:e})=>{n(this.props.qrCodeData),this.props.onSubmitAnalytics({type:h,target:_}),e()},icon:w({imageFolder:"components/"})(`${y}copy`),label:C.get("button.copy")})))}constructor(t){super(t),g(this,"timeoutId",void 0),g(this,"redirectToApp",(t=>{window.location.assign(t)})),g(this,"statusInterval",((t=0)=>{if(this.state.expired||this.state.completed)return;this.setState((e=>({timePassed:e.timePassed+this.props.delay+t})));const e=this.state.timePassed>=this.props.throttleTime?this.props.throttledInterval:this.state.delay;this.pollStatus(e)})),g(this,"onTick",(t=>{this.setState({percentage:t.percentage})})),g(this,"onTimeUp",(()=>{this.setState({expired:!0}),clearTimeout(this.timeoutId),this.props.onError(new c("ERROR","Payment Expired"))})),g(this,"onComplete",(t=>{clearTimeout(this.timeoutId),this.setState({completed:!0,loading:!1});const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)})),g(this,"onError",(t=>{if(clearTimeout(this.timeoutId),this.setState({expired:!0,loading:!1}),t.props.payload){const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)}const e=new c("ERROR","error result with no payload in response");return this.props.onError(e)})),g(this,"checkStatus",(()=>{const{paymentData:t,clientKey:e,loadingContext:o,throttledInterval:r}=this.props;return a(t,e,o,r).then(i).catch((t=>({type:"network-error",props:t}))).then((t=>{switch(t.type){case"success":this.onComplete(t);break;case"error":this.onError(t);break;default:this.setState({loading:!1})}return t}))})),this.state={buttonStatus:"default",completed:!1,delay:t.delay,expired:!1,loading:!0,percentage:100,timePassed:0}}}g(f,"defaultProps",{delay:2e3,countdownTime:15,onError:()=>{},onComplete:()=>{},throttleTime:6e4,classNameModifiers:[],throttledInterval:1e4,introduction:"wechatpay.scanqrcode",timeToPay:"wechatpay.timetopay",buttonLabel:"openApp"});export{f as default};
1
+ import{Component as t,createElement as e}from"../../../external/preact/dist/preact.js";import o from"../Countdown/index.js";import r from"../Button/Button.js";import s from"../Spinner/Spinner.js";import a from"../../../core/Services/payment-status.js";import{processResponse as i}from"../../../core/ProcessResponse/process-response.js";import{copyToClipboard as n}from"../../../utils/clipboard.js";import c from"../../../core/Errors/AdyenCheckoutError.js";import{useCoreContext as p}from"../../../core/Context/CoreProvider.js";import d from"../ContentSeparator/ContentSeparator.js";import l from"../../../core/Context/useImage.js";import{useA11yReporter as m}from"../../../core/Errors/useA11yReporter.js";import u from"../../../utils/useAutoFocus.js";import{ANALYTICS_QR_CODE_DOWNLOAD as h,ANALYTICS_DOWNLOAD_STR as _}from"../../../core/Analytics/constants.js";import{PREFIX as y}from"../Icon/constants.js";function g(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class f extends t{componentDidMount(){this.statusInterval()}componentWillUnmount(){clearTimeout(this.timeoutId)}pollStatus(t){clearTimeout(this.timeoutId),this.timeoutId=setTimeout((async()=>{const t=performance.now();await this.checkStatus();const e=performance.now();this.statusInterval(Math.round(e-t))}),t)}render({amount:t,url:a,brandLogo:i,brandName:c,countdownTime:g,type:f,onActionHandled:k},{expired:q,completed:b,loading:v}){const{i18n:C,loadingContext:N}=p(),w=l(),T=this.props.qrCodeData?`${N}utility/v1/barcode.png?type=qrCode&data=${this.props.qrCodeData}&clientKey=${this.props.clientKey}`:this.props.qrCodeImage,I=(t,o)=>{const r=C.get(o);return m(r),e("div",{className:"adyen-checkout__qr-loader adyen-checkout__qr-loader--result"},e("img",{className:"adyen-checkout__qr-loader__icon adyen-checkout__qr-loader__icon--result",src:w({imageFolder:"components/"})(t),alt:r}),e("div",{className:"adyen-checkout__qr-loader__subtitle"},r))};if(q)return I("error","error.subtitle.payment");if(b)return I("success","creditCard.success");if(v)return e("div",{className:"adyen-checkout__qr-loader"},i&&e("div",{className:"adyen-checkout__qr-loader__brand-logo-wrapper"},e("img",{alt:c,src:i,className:"adyen-checkout__qr-loader__brand-logo"})),e(s,null));const j=C.get(this.props.timeToPay).split("%@"),S=u(),x=this.props.classNameModifiers.map((t=>`adyen-checkout__qr-loader--${t}`));return e("div",{className:`adyen-checkout__qr-loader adyen-checkout__qr-loader--${f} ${x.join(" ")}`},i&&e("div",{className:"adyen-checkout__qr-loader__brand-logo-wrapper"},e("img",{src:i,alt:c,className:"adyen-checkout__qr-loader__brand-logo"})),t&&t.value&&t.currency&&e("div",{className:"adyen-checkout__qr-loader__payment_amount"},C.amount(t.value,t.currency)),a&&e("div",{className:"adyen-checkout__qr-loader__app-link"},this.props.redirectIntroduction&&e("div",{className:"adyen-checkout__qr-loader__subtitle"},C.get(this.props.redirectIntroduction)),e(r,{classNameModifiers:["qr-loader"],onClick:()=>this.redirectToApp(a),label:C.get(this.props.buttonLabel)}),e(d,null)),e("div",{ref:S,tabIndex:0,className:"adyen-checkout__qr-loader__subtitle"},"string"==typeof this.props.introduction?C.get(this.props.introduction):this.props.introduction?.()),e("img",{src:T,alt:C.get("wechatpay.scanqrcode"),onLoad:()=>{k?.({componentType:this.props.type,actionDescription:"qr-code-loaded"})}}),e("div",{className:"adyen-checkout__qr-loader__progress"},e("span",{className:"adyen-checkout__qr-loader__percentage",style:{width:`${this.state.percentage}%`}})),e("div",{className:"adyen-checkout__qr-loader__countdown"},j[0]," ",e(o,{minutesFromNow:g,onTick:this.onTick,onCompleted:this.onTimeUp})," ",j[1]),this.props.instructions&&e("div",{className:"adyen-checkout__qr-loader__instructions"},"string"==typeof this.props.instructions?C.get(this.props.instructions):this.props.instructions?.()),this.props.copyBtn&&e("div",{className:"adyen-checkout__qr-loader__actions"},e(r,{inline:!0,variant:"action",onClick:(t,{complete:e})=>{n(this.props.qrCodeData),this.props.onSubmitAnalytics({type:_,target:h}),e()},icon:w({imageFolder:"components/"})(`${y}copy`),label:C.get("button.copy")})))}constructor(t){super(t),g(this,"timeoutId",void 0),g(this,"redirectToApp",(t=>{window.location.assign(t)})),g(this,"statusInterval",((t=0)=>{if(this.state.expired||this.state.completed)return;this.setState((e=>({timePassed:e.timePassed+this.props.delay+t})));const e=this.state.timePassed>=this.props.throttleTime?this.props.throttledInterval:this.state.delay;this.pollStatus(e)})),g(this,"onTick",(t=>{this.setState({percentage:t.percentage})})),g(this,"onTimeUp",(()=>{this.setState({expired:!0}),clearTimeout(this.timeoutId),this.props.onError(new c("ERROR","Payment Expired"))})),g(this,"onComplete",(t=>{clearTimeout(this.timeoutId),this.setState({completed:!0,loading:!1});const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)})),g(this,"onError",(t=>{if(clearTimeout(this.timeoutId),this.setState({expired:!0,loading:!1}),t.props.payload){const e={data:{details:{payload:t.props.payload},paymentData:this.props.paymentData}};this.props.onComplete(e,this)}const e=new c("ERROR","error result with no payload in response");return this.props.onError(e)})),g(this,"checkStatus",(()=>{const{paymentData:t,clientKey:e,loadingContext:o,throttledInterval:r}=this.props;return a(t,e,o,r).then(i).catch((t=>({type:"network-error",props:t}))).then((t=>{switch(t.type){case"success":this.onComplete(t);break;case"error":this.onError(t);break;default:this.setState({loading:!1})}return t}))})),this.state={buttonStatus:"default",completed:!1,delay:t.delay,expired:!1,loading:!0,percentage:100,timePassed:0}}}g(f,"defaultProps",{delay:2e3,countdownTime:15,onError:()=>{},onComplete:()=>{},throttleTime:6e4,classNameModifiers:[],throttledInterval:1e4,introduction:"wechatpay.scanqrcode",timeToPay:"wechatpay.timetopay",buttonLabel:"openApp"});export{f as default};
2
2
  //# sourceMappingURL=QRLoader.js.map
@@ -1,2 +1,2 @@
1
- import{Component as s}from"../../../../external/preact/dist/preact.js";import{getFields as t,validFieldsReducer as e,getErrorReducer as i,getErrorObject as o}from"./SFPUtils.js";import n from"../lib/CSF/initCSF.js";import r from"./SecuredFieldsProviderHandlers.js";import d from"./defaultProps.js";import{ENCRYPTED_PWD_FIELD as a,ENCRYPTED_CARD_NUMBER as h,DEDICATED_CARD_COMPONENTS as l,CVC_POLICY_REQUIRED as p,DATE_POLICY_REQUIRED as c}from"../lib/constants.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as f}from"../../../../core/Errors/utils.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";function F(s,t,e){return t in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}class C extends s{componentDidMount(){this.props.rootNode&&this.setRootNode(this.props.rootNode);const s=t(this.rootNode),i=s.reduce(e,{});this.setState({valid:i}),s.forEach((s=>{this.numCharsInField[s]=0})),this.numDateFields=s.filter((s=>s.match(/Expiry/))).length,s.length?(this.destroy(),this.initializeCSF(this.rootNode)):this.handleOnNoDataRequired()}componentDidUpdate(){this.checkForKCPFields()}componentWillUnmount(){this.csf=null,clearTimeout(this.csfLoadFailTimeout),clearTimeout(this.csfConfigFailTimeout)}initializeCSF(s){let t=this.props.loadingContext;const e={rootNode:s,type:this.props.type,clientKey:this.props.clientKey,cardGroupTypes:this.props.brands,autoFocus:this.props.autoFocus,trimTrailingSeparator:this.props.trimTrailingSeparator,loadingContext:t,keypadFix:this.props.keypadFix,showWarnings:this.props.showWarnings,iframeUIConfig:{sfStyles:this.props.styles},i18n:this.props.i18n,callbacks:{onLoad:this.handleOnLoad,onConfigSuccess:this.handleOnConfigSuccess,onFieldValid:this.handleOnFieldValid,onAllValid:this.handleOnAllValid,onBrand:this.handleOnBrand,onError:this.handleOnError,onFocus:this.handleFocus,onBinValue:this.props.onBinValue,onAutoComplete:this.handleOnAutoComplete,onAdditionalSFConfig:this.props.onAdditionalSFConfig,onAdditionalSFRemoved:this.props.onAdditionalSFRemoved,onTouchstartIOS:this.handleOnTouchstartIOS,onKeyPressed:this.handleKeyPressed},isKCP:this.state.hasKoreanFields,legacyInputMode:this.props.legacyInputMode,minimumExpiryDate:this.props.minimumExpiryDate,implementationType:this.props.implementationType||"components",forceCompat:this.props.forceCompat,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,shouldDisableIOSArrowKeys:!!this.props.disableIOSArrowKeys,placeholders:this.props.placeholders??{},showContextualElement:this.props.showContextualElement};this.csf=n(e),this.csfLoadFailTimeout=setTimeout((()=>{"ready"!==this.state.status&&(this.setState({status:"csfLoadFailure"}),this.props.onError(new u("ERROR","secured field iframes have failed to load")))}),this.csfLoadFailTimeoutMS)}checkForKCPFields(){let s=!1;if(this.props.koreanAuthenticationRequired&&(s=this.issuingCountryCode?"kr"===this.issuingCountryCode:"kr"===this.props.countryCode),this.state.hasKoreanFields&&!s){const s=s=>({data:{...s.data,[a]:void 0},valid:{...s.valid,[a]:!1},errors:{...s.errors,[a]:!1},hasKoreanFields:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.removeSecuredField(a),this.csf.setKCPStatus(!1)}if(!this.state.hasKoreanFields&&s){const s=s=>({valid:{...s.valid,[a]:!1},hasKoreanFields:!0,isSfpValid:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.addSecuredField(a),this.csf.setKCPStatus(!0)}}getChildContext(){return{i18n:this.props.i18n}}handleUnsupportedCard(s){const t=!!s.error;return t&&this.setState({detectedUnsupportedBrands:s.detectedBrands}),s.rootNode=this.rootNode,this.handleOnError(s,t),this.csf&&this.csf.hasUnsupportedCard(h,s.error),t}setFocusOn(s){this.csf&&this.csf.setFocusOnFrame(s)}updateStyles(s){this.csf&&this.csf.updateStyles(s)}sfIsOptionalOrHidden(s){return this.csf.sfIsOptionalOrHidden(s)}destroy(){this.csf&&this.csf.destroy()}showValidation(){const{numDateFields:s,state:t}=this;Object.keys(t.valid).reduce(i(s,t),[]).forEach((s=>{const e=o(s,this.rootNode,t);this.handleOnError(e,!!t.detectedUnsupportedBrands),this.csf&&this.csf.isValidated&&this.csf.isValidated(s,e.error)}))}mapErrorsToValidationRuleResult(){return Object.keys(this.state.errors).reduce(((s,t)=>{const e=this.state.errors[t];return s[t]=e?{isValid:!1,errorMessage:f(e,m),errorI18n:this.props.i18n.get(e),error:e,rootNode:this.rootNode,...this.state.detectedUnsupportedBrands&&{detectedBrands:this.state.detectedUnsupportedBrands}}:null,s}),{})}processBinLookupResponse(s,t){if(this.state.detectedUnsupportedBrands&&(this.setState((s=>({errors:{...s.errors,[h]:!1},detectedUnsupportedBrands:null}))),this.csf&&s)){const s={type:"card",fieldType:"encryptedCardNumber",error:""};this.handleUnsupportedCard(s)}this.issuingCountryCode=s?.issuingCountryCode?.toLowerCase();const e=t?.brand,i=e&&l.includes(t.brand);i&&this.setState(t,(()=>{this.props.onChange(this.state)})),this.csf&&this.csf.brandsFromBinLookup(s,i?t:null)}render(s,t){return s.render({setRootNode:this.setRootNode,setFocusOn:this.setFocusOn},t)}constructor(s){super(s),F(this,"csfLoadFailTimeout",void 0),F(this,"csfLoadFailTimeoutMS",void 0),F(this,"csfConfigFailTimeout",void 0),F(this,"csfConfigFailTimeoutMS",void 0),F(this,"numCharsInField",void 0),F(this,"rootNode",void 0),F(this,"numDateFields",void 0),F(this,"csf",void 0),F(this,"handleOnLoad",void 0),F(this,"handleOnConfigSuccess",void 0),F(this,"handleOnFieldValid",void 0),F(this,"handleOnAllValid",void 0),F(this,"handleOnBrand",void 0),F(this,"handleFocus",void 0),F(this,"handleOnError",void 0),F(this,"handleOnAutoComplete",void 0),F(this,"handleOnNoDataRequired",void 0),F(this,"handleOnTouchstartIOS",void 0),F(this,"handleKeyPressed",void 0),F(this,"state",void 0),F(this,"props",void 0),F(this,"issuingCountryCode",void 0),F(this,"setRootNode",(s=>{this.rootNode=s}));const t={status:"loading",brand:s.type,errors:{},valid:{},data:{},cvcPolicy:p,expiryDatePolicy:c,isSfpValid:!1,hasKoreanFields:s.hasKoreanFields};this.state=t,this.csfLoadFailTimeout=null,this.csfLoadFailTimeoutMS=3e4,this.csfConfigFailTimeout=null,this.csfConfigFailTimeoutMS=15e3,this.numCharsInField={},this.handleOnLoad=r.handleOnLoad.bind(this),this.handleOnConfigSuccess=r.handleOnConfigSuccess.bind(this),this.handleOnFieldValid=r.handleOnFieldValid.bind(this),this.handleOnAllValid=r.handleOnAllValid.bind(this),this.handleOnBrand=r.handleOnBrand.bind(this),this.handleFocus=r.handleFocus.bind(this),this.handleOnError=r.handleOnError.bind(this),this.handleOnNoDataRequired=r.handleOnNoDataRequired.bind(this),this.handleOnAutoComplete=r.handleOnAutoComplete.bind(this),this.handleOnTouchstartIOS=r.handleOnTouchstartIOS.bind(this),this.handleKeyPressed=r.handleKeyPressed.bind(this),this.processBinLookupResponse=this.processBinLookupResponse.bind(this),this.setFocusOn=this.setFocusOn.bind(this),this.updateStyles=this.updateStyles.bind(this),this.handleUnsupportedCard=this.handleUnsupportedCard.bind(this),this.showValidation=this.showValidation.bind(this),this.destroy=this.destroy.bind(this)}}F(C,"defaultProps",d);export{C as default};
1
+ import{Component as s}from"../../../../external/preact/dist/preact.js";import{getFields as t,validFieldsReducer as e,getErrorReducer as i,getErrorObject as o}from"./SFPUtils.js";import n from"../lib/CSF/initCSF.js";import r from"./SecuredFieldsProviderHandlers.js";import d from"./defaultProps.js";import{ENCRYPTED_PWD_FIELD as a,ENCRYPTED_CARD_NUMBER as h,DEDICATED_CARD_COMPONENTS as l,DATE_POLICY_REQUIRED as p,CVC_POLICY_REQUIRED as c}from"../lib/constants.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as f}from"../../../../core/Errors/utils.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";function F(s,t,e){return t in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}class C extends s{componentDidMount(){this.props.rootNode&&this.setRootNode(this.props.rootNode);const s=t(this.rootNode),i=s.reduce(e,{});this.setState({valid:i}),s.forEach((s=>{this.numCharsInField[s]=0})),this.numDateFields=s.filter((s=>s.match(/Expiry/))).length,s.length?(this.destroy(),this.initializeCSF(this.rootNode)):this.handleOnNoDataRequired()}componentDidUpdate(){this.checkForKCPFields()}componentWillUnmount(){this.csf=null,clearTimeout(this.csfLoadFailTimeout),clearTimeout(this.csfConfigFailTimeout)}initializeCSF(s){let t=this.props.loadingContext;const e={rootNode:s,type:this.props.type,clientKey:this.props.clientKey,cardGroupTypes:this.props.brands,autoFocus:this.props.autoFocus,trimTrailingSeparator:this.props.trimTrailingSeparator,loadingContext:t,keypadFix:this.props.keypadFix,showWarnings:this.props.showWarnings,iframeUIConfig:{sfStyles:this.props.styles},i18n:this.props.i18n,callbacks:{onLoad:this.handleOnLoad,onConfigSuccess:this.handleOnConfigSuccess,onFieldValid:this.handleOnFieldValid,onAllValid:this.handleOnAllValid,onBrand:this.handleOnBrand,onError:this.handleOnError,onFocus:this.handleFocus,onBinValue:this.props.onBinValue,onAutoComplete:this.handleOnAutoComplete,onAdditionalSFConfig:this.props.onAdditionalSFConfig,onAdditionalSFRemoved:this.props.onAdditionalSFRemoved,onTouchstartIOS:this.handleOnTouchstartIOS,onKeyPressed:this.handleKeyPressed},isKCP:this.state.hasKoreanFields,legacyInputMode:this.props.legacyInputMode,minimumExpiryDate:this.props.minimumExpiryDate,implementationType:this.props.implementationType||"components",forceCompat:this.props.forceCompat,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,shouldDisableIOSArrowKeys:!!this.props.disableIOSArrowKeys,placeholders:this.props.placeholders??{},showContextualElement:this.props.showContextualElement};this.csf=n(e),this.csfLoadFailTimeout=setTimeout((()=>{"ready"!==this.state.status&&(this.setState({status:"csfLoadFailure"}),this.props.onError(new u("ERROR","secured field iframes have failed to load")))}),this.csfLoadFailTimeoutMS)}checkForKCPFields(){let s=!1;if(this.props.koreanAuthenticationRequired&&(s=this.issuingCountryCode?"kr"===this.issuingCountryCode:"kr"===this.props.countryCode),this.state.hasKoreanFields&&!s){const s=s=>({data:{...s.data,[a]:void 0},valid:{...s.valid,[a]:!1},errors:{...s.errors,[a]:!1},hasKoreanFields:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.removeSecuredField(a),this.csf.setKCPStatus(!1)}if(!this.state.hasKoreanFields&&s){const s=s=>({valid:{...s.valid,[a]:!1},hasKoreanFields:!0,isSfpValid:!1});this.setState(s,(()=>{this.props.onChange(this.state)})),this.csf.addSecuredField(a),this.csf.setKCPStatus(!0)}}getChildContext(){return{i18n:this.props.i18n}}handleUnsupportedCard(s){const t=!!s.error;return t&&this.setState({detectedUnsupportedBrands:s.detectedBrands}),s.rootNode=this.rootNode,this.handleOnError(s,t),this.csf&&this.csf.hasUnsupportedCard(h,s.error),t}setFocusOn(s){this.csf&&this.csf.setFocusOnFrame(s)}updateStyles(s){this.csf&&this.csf.updateStyles(s)}sfIsOptionalOrHidden(s){return this.csf.sfIsOptionalOrHidden(s)}destroy(){this.csf&&this.csf.destroy()}showValidation(){const{numDateFields:s,state:t}=this;Object.keys(t.valid).reduce(i(s,t),[]).forEach((s=>{const e=o(s,this.rootNode,t);this.handleOnError(e,!!t.detectedUnsupportedBrands),this.csf&&this.csf.isValidated&&this.csf.isValidated(s,e.error)}))}mapErrorsToValidationRuleResult(){return Object.keys(this.state.errors).reduce(((s,t)=>{const e=this.state.errors[t];return s[t]=e?{isValid:!1,errorMessage:f(e,m),errorI18n:this.props.i18n.get(e),error:e,rootNode:this.rootNode,...this.state.detectedUnsupportedBrands&&{detectedBrands:this.state.detectedUnsupportedBrands}}:null,s}),{})}processBinLookupResponse(s,t){if(this.state.detectedUnsupportedBrands&&(this.setState((s=>({errors:{...s.errors,[h]:!1},detectedUnsupportedBrands:null}))),this.csf&&s)){const s={type:"card",fieldType:"encryptedCardNumber",error:""};this.handleUnsupportedCard(s)}this.issuingCountryCode=s?.issuingCountryCode?.toLowerCase();const e=t?.brand,i=e&&l.includes(t.brand);i&&this.setState(t,(()=>{this.props.onChange(this.state)})),this.csf&&this.csf.brandsFromBinLookup(s,i?t:null)}render(s,t){return s.render({setRootNode:this.setRootNode,setFocusOn:this.setFocusOn},t)}constructor(s){super(s),F(this,"csfLoadFailTimeout",void 0),F(this,"csfLoadFailTimeoutMS",void 0),F(this,"csfConfigFailTimeout",void 0),F(this,"csfConfigFailTimeoutMS",void 0),F(this,"numCharsInField",void 0),F(this,"rootNode",void 0),F(this,"numDateFields",void 0),F(this,"csf",void 0),F(this,"handleOnLoad",void 0),F(this,"handleOnConfigSuccess",void 0),F(this,"handleOnFieldValid",void 0),F(this,"handleOnAllValid",void 0),F(this,"handleOnBrand",void 0),F(this,"handleFocus",void 0),F(this,"handleOnError",void 0),F(this,"handleOnAutoComplete",void 0),F(this,"handleOnNoDataRequired",void 0),F(this,"handleOnTouchstartIOS",void 0),F(this,"handleKeyPressed",void 0),F(this,"state",void 0),F(this,"props",void 0),F(this,"issuingCountryCode",void 0),F(this,"setRootNode",(s=>{this.rootNode=s}));const t={status:"loading",brand:s.type,errors:{},valid:{},data:{},cvcPolicy:c,expiryDatePolicy:p,isSfpValid:!1,hasKoreanFields:s.hasKoreanFields};this.state=t,this.csfLoadFailTimeout=null,this.csfLoadFailTimeoutMS=3e4,this.csfConfigFailTimeout=null,this.csfConfigFailTimeoutMS=15e3,this.numCharsInField={},this.handleOnLoad=r.handleOnLoad.bind(this),this.handleOnConfigSuccess=r.handleOnConfigSuccess.bind(this),this.handleOnFieldValid=r.handleOnFieldValid.bind(this),this.handleOnAllValid=r.handleOnAllValid.bind(this),this.handleOnBrand=r.handleOnBrand.bind(this),this.handleFocus=r.handleFocus.bind(this),this.handleOnError=r.handleOnError.bind(this),this.handleOnNoDataRequired=r.handleOnNoDataRequired.bind(this),this.handleOnAutoComplete=r.handleOnAutoComplete.bind(this),this.handleOnTouchstartIOS=r.handleOnTouchstartIOS.bind(this),this.handleKeyPressed=r.handleKeyPressed.bind(this),this.processBinLookupResponse=this.processBinLookupResponse.bind(this),this.setFocusOn=this.setFocusOn.bind(this),this.updateStyles=this.updateStyles.bind(this),this.handleUnsupportedCard=this.handleUnsupportedCard.bind(this),this.showValidation=this.showValidation.bind(this),this.destroy=this.destroy.bind(this)}}F(C,"defaultProps",d);export{C as default};
2
2
  //# sourceMappingURL=SecuredFieldsProvider.js.map
@@ -1,2 +1,2 @@
1
- import{getCardImageUrl as e}from"../utils.js";import{ENCRYPTED_CARD_NUMBER as t,ENCRYPTED_SECURITY_CODE as s,ENCRYPTED_EXPIRY_DATE as i,ENCRYPTED_EXPIRY_MONTH as n,ENCRYPTED_EXPIRY_YEAR as r,CVC_POLICY_REQUIRED as o,DATE_POLICY_REQUIRED as a,OPTIONAL as l,HIDDEN as d}from"../lib/constants.js";import{existy as h}from"../../../../utils/commonUtils.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";function p(e,t,s,i){return(t!==l&&t!==d||0!==s[e])&&i[e]}var c={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},(()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)})),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},(()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})})),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==t)&&(this.setState((t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]??!1}})),(()=>{this.props.onChange(this.state,{event:"handleOnFieldValid",fieldType:e.fieldType}),this.props.onFieldValid(e)})),!0)},handleOnLoad:function(e){clearTimeout(this.csfLoadFailTimeout),this.csfLoadFailTimeout=null,this.props.onLoad(e),this.csfConfigFailTimeout=setTimeout((()=>{"ready"!==this.state.status&&(this.setState({status:"csfConfigFailure"}),this.props.onError(new u("ERROR","secured fields have failed to configure")))}),this.csfConfigFailTimeoutMS)},handleOnConfigSuccess:function(e){clearTimeout(this.csfConfigFailTimeout),this.csfConfigFailTimeout=null,this.setState({status:"ready"},(()=>{this.props.onConfigSuccess(e)}))},handleOnBrand:function(t){this.setState((e=>{const l=p(s,t.cvcPolicy,this.numCharsInField,e.errors),d=1===this.numDateFields?p(i,t.expiryDatePolicy,this.numCharsInField,e.errors):null,u=2===this.numDateFields?p(n,t.expiryDatePolicy,this.numCharsInField,e.errors):null,c=2===this.numDateFields?p(r,t.expiryDatePolicy,this.numCharsInField,e.errors):null;return{brand:t.brand,cvcPolicy:t.cvcPolicy??o,showSocialSecurityNumber:t.showSocialSecurityNumber,errors:{...e.errors,...h(l)&&{[s]:l},...h(d)&&{[i]:d},...h(u)&&{[n]:u},...h(c)&&{[r]:c}},expiryDatePolicy:t.expiryDatePolicy??a}}),(()=>{this.props.onChange(this.state,{event:"handleOnBrand"});const s=this.props.brandsConfiguration[t.brand]?.icon??e(t.brand,this.props.resources);this.props.onBrand({...t,brandImageUrl:s})}))},handleOnError:function(e,s=null){const i=e.error;return this.setState((n=>({errors:{...n.errors,[e.fieldType]:i||!1},...s&&{data:{...n.data,[t]:void 0}},...s&&{valid:{...n.valid,[t]:!1}},...s&&{isSfpValid:!1}})),(()=>{this.props.onChange(this.state,{event:"handleOnError",fieldType:e.fieldType})})),!0},handleOnNoDataRequired:function(){this.setState({status:"ready"},(()=>this.props.onChange({isSfpValid:!0})))},handleOnTouchstartIOS:function(e){this.props.disableIOSArrowKeys?.(e)},handleKeyPressed:function(e){if("enterKeyPressed"===e.action){const e=new KeyboardEvent("keypress",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter"});this.props.handleKeyPress?.(e)}}};export{c as default};
1
+ import{getCardImageUrl as e}from"../utils.js";import{ENCRYPTED_CARD_NUMBER as t,ENCRYPTED_SECURITY_CODE as s,ENCRYPTED_EXPIRY_DATE as i,ENCRYPTED_EXPIRY_MONTH as n,ENCRYPTED_EXPIRY_YEAR as r,DATE_POLICY_REQUIRED as o,CVC_POLICY_REQUIRED as a,OPTIONAL as l,HIDDEN as d}from"../lib/constants.js";import{existy as h}from"../../../../utils/commonUtils.js";import u from"../../../../core/Errors/AdyenCheckoutError.js";function p(e,t,s,i){return(t!==l&&t!==d||0!==s[e])&&i[e]}var c={handleFocus:function(e){this.numCharsInField[e.fieldType]=e.numChars,this.props.onFocus(e)},handleOnAllValid:function(e){return!this.state.detectedUnsupportedBrands&&(this.setState({isSfpValid:e.allValid},(()=>{this.props.onChange(this.state,{event:"handleOnAllValid"}),this.props.onAllValid(e)})),!0)},handleOnAutoComplete:function(e){this.setState({autoCompleteName:e.value},(()=>{this.props.onChange(this.state,{event:"handleOnAutoComplete",fieldType:e.fieldType}),this.setState({autoCompleteName:null})})),this.props.onAutoComplete(e)},handleOnFieldValid:function(e){return(!this.state.detectedUnsupportedBrands||e.fieldType!==t)&&(this.setState((t=>({data:{...t.data,[e.encryptedFieldName]:e.blob},valid:{...t.valid,[e.encryptedFieldName]:e.valid},errors:{...t.errors,[e.fieldType]:t.errors[e.fieldType]??!1}})),(()=>{this.props.onChange(this.state,{event:"handleOnFieldValid",fieldType:e.fieldType}),this.props.onFieldValid(e)})),!0)},handleOnLoad:function(e){clearTimeout(this.csfLoadFailTimeout),this.csfLoadFailTimeout=null,this.props.onLoad(e),this.csfConfigFailTimeout=setTimeout((()=>{"ready"!==this.state.status&&(this.setState({status:"csfConfigFailure"}),this.props.onError(new u("ERROR","secured fields have failed to configure")))}),this.csfConfigFailTimeoutMS)},handleOnConfigSuccess:function(e){clearTimeout(this.csfConfigFailTimeout),this.csfConfigFailTimeout=null,this.setState({status:"ready"},(()=>{this.props.onConfigSuccess(e)}))},handleOnBrand:function(t){this.setState((e=>{const l=p(s,t.cvcPolicy,this.numCharsInField,e.errors),d=1===this.numDateFields?p(i,t.expiryDatePolicy,this.numCharsInField,e.errors):null,u=2===this.numDateFields?p(n,t.expiryDatePolicy,this.numCharsInField,e.errors):null,c=2===this.numDateFields?p(r,t.expiryDatePolicy,this.numCharsInField,e.errors):null;return{brand:t.brand,cvcPolicy:t.cvcPolicy??a,showSocialSecurityNumber:t.showSocialSecurityNumber,errors:{...e.errors,...h(l)&&{[s]:l},...h(d)&&{[i]:d},...h(u)&&{[n]:u},...h(c)&&{[r]:c}},expiryDatePolicy:t.expiryDatePolicy??o}}),(()=>{this.props.onChange(this.state,{event:"handleOnBrand"});const s=this.props.brandsConfiguration[t.brand]?.icon??e(t.brand,this.props.resources);this.props.onBrand({...t,brandImageUrl:s})}))},handleOnError:function(e,s=null){const i=e.error;return this.setState((n=>({errors:{...n.errors,[e.fieldType]:i||!1},...s&&{data:{...n.data,[t]:void 0}},...s&&{valid:{...n.valid,[t]:!1}},...s&&{isSfpValid:!1}})),(()=>{this.props.onChange(this.state,{event:"handleOnError",fieldType:e.fieldType})})),!0},handleOnNoDataRequired:function(){this.setState({status:"ready"},(()=>this.props.onChange({isSfpValid:!0})))},handleOnTouchstartIOS:function(e){this.props.disableIOSArrowKeys?.(e)},handleKeyPressed:function(e){if("enterKeyPressed"===e.action){const e=new KeyboardEvent("keypress",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter"});this.props.handleKeyPress?.(e)}}};export{c as default};
2
2
  //# sourceMappingURL=SecuredFieldsProviderHandlers.js.map
@@ -1,2 +1,2 @@
1
- import{select as e,getAttribute as t}from"../../utilities/dom.js";import{DATA_ENCRYPTED_FIELD_ATTR as i,CVC_POLICY_REQUIRED as s,DATE_POLICY_REQUIRED as o,ENCRYPTED_EXPIRY_YEAR as n,SF_CONFIG_TIMEOUT as r,ALL_SECURED_FIELDS as a,DATA_INFO as d,DATA_UID as l}from"../../constants.js";import{existy as c}from"../../../../../../utils/commonUtils.js";import h from"../utils/cardType.js";import u from"../../securedField/SecuredField.js";import p from"../../../../../../core/Errors/AdyenCheckoutError.js";function f(){this.encryptedAttrName=i;const n=e(this.props.rootNode,`[${this.encryptedAttrName}]`).filter((e=>{const i=t(e,this.encryptedAttrName),s=a.includes(i);return s||console.warn(`WARNING: '${i}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),s})),r=s,d=o;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(n,r,d),n.length):(this.createNonCardSecuredFields(n),n.length)}async function m(e){for(let t=0;t<e.length;t++){const i=e[t];await this.setupSecuredField(i).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)}))}}async function y(e,t,i){let n=this.state.type;if("card"===n&&1===this.config.cardGroupTypes.length&&(n=this.config.cardGroupTypes[0],this.state.type=n),this.isSingleBrandedCard="card"!==n,this.isSingleBrandedCard){const e=h.getCardByBrand(n);c(e)?(t=e.cvcPolicy||s,i=e.expiryDatePolicy||o,this.securityCode=e.securityCode):this.state.type="unrecognised-single-brand"}for(let s=0;s<e.length;s++){const o=e[s];window._b$dl&&console.log("\nAbout to set up securedField:",o),await this.setupSecuredField(o,t,i).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)})),window._b$dl&&console.log("Finished setting up securedField:",o)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const e={type:this.state.type,rootNode:this.props.rootNode,brand:n,cvcPolicy:t,expiryDatePolicy:i,cvcText:this.securityCode};setTimeout((()=>{this.callbacks.onBrand(e)}),0)}}function g(e,i,s){return new Promise(((o,a)=>{const c=t(e,this.encryptedAttrName);c===n&&(this.state.hasSeparateDateFields=!0);const h={fieldType:c,extraFieldData:t(e,d),uid:t(e,l),cvcPolicy:i,holderEl:e,expiryDatePolicy:s,txVariant:this.state.type,cardGroupTypes:this.config.cardGroupTypes,iframeUIConfig:this.config.iframeUIConfig,sfLogAtStart:this.config.sfLogAtStart,trimTrailingSeparator:this.config.trimTrailingSeparator,isCreditCardType:this.config.isCreditCardType,iframeSrc:this.config.iframeSrc,loadingContext:this.config.loadingContext,showWarnings:this.config.showWarnings,legacyInputMode:this.config.legacyInputMode,minimumExpiryDate:this.config.minimumExpiryDate,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,disableIOSArrowKeys:this.props.shouldDisableIOSArrowKeys,implementationType:this.props.implementationType,showContextualElement:this.props.showContextualElement,placeholders:this.props.placeholders},f=new u(h,this.props.i18n).onIframeLoaded((()=>{if(this.state.iframeCount+=1,window._b$dl&&console.log("### createSecuredFields::onIframeLoaded:: this.state.iframeCount=",this.state.iframeCount),this.state.iframeCount>this.state.numIframes)throw this.destroySecuredFields(),new p("ERROR",`One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(f.loadToConfigTimeout=setTimeout((()=>{a({type:h.fieldType,failReason:"sf took too long to config"})}),r),this.state.iframeCount===this.state.originalNumIframes){const e={iframesLoaded:!0};this.callbacks.onLoad(e)}})).onConfig((e=>{this.handleIframeConfigFeedback(e),clearTimeout(f.loadToConfigTimeout),f.loadToConfigTimeout=null,o(e)})).onFocus((e=>{this.handleFocus(e)})).onBinValue((e=>{this.handleBinValue(e)})).onTouchstart((e=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||e.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:e.fieldType}),(e.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:e.fieldType,fieldClick:!0})})).onShiftTab((e=>{this.handleSFShiftTab(e.fieldType)})).onEncryption((e=>{this.handleEncryption(e)})).onValidation((e=>{this.handleValidation(e)})).onAutoComplete((e=>{this.processAutoComplete(e)})).onKeyPressed((e=>{const{numKey:t,...i}=e;this.callbacks.onKeyPressed(i)}));this.state.securedFields[c]=f}))}export{y as createCardSecuredFields,m as createNonCardSecuredFields,f as createSecuredFields,g as setupSecuredField};
1
+ import{select as e,getAttribute as t}from"../../utilities/dom.js";import{DATA_ENCRYPTED_FIELD_ATTR as i,ALL_SECURED_FIELDS as s,CVC_POLICY_REQUIRED as o,DATE_POLICY_REQUIRED as n,ENCRYPTED_EXPIRY_YEAR as r,SF_CONFIG_TIMEOUT as a,DATA_UID as d,DATA_INFO as l}from"../../constants.js";import{existy as c}from"../../../../../../utils/commonUtils.js";import h from"../utils/cardType.js";import u from"../../securedField/SecuredField.js";import p from"../../../../../../core/Errors/AdyenCheckoutError.js";function f(){this.encryptedAttrName=i;const r=e(this.props.rootNode,`[${this.encryptedAttrName}]`).filter((e=>{const i=t(e,this.encryptedAttrName),o=s.includes(i);return o||console.warn(`WARNING: '${i}' is not a valid type for the '${this.encryptedAttrName}' attribute. A SecuredField will not be created for this element.`),o})),a=o,d=n;return this.config.isCreditCardType?(this.isSingleBrandedCard=!1,this.securityCode="",this.createCardSecuredFields(r,a,d),r.length):(this.createNonCardSecuredFields(r),r.length)}async function m(e){for(let t=0;t<e.length;t++){const i=e[t];await this.setupSecuredField(i).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)}))}}async function y(e,t,i){let s=this.state.type;if("card"===s&&1===this.config.cardGroupTypes.length&&(s=this.config.cardGroupTypes[0],this.state.type=s),this.isSingleBrandedCard="card"!==s,this.isSingleBrandedCard){const e=h.getCardByBrand(s);c(e)?(t=e.cvcPolicy||o,i=e.expiryDatePolicy||n,this.securityCode=e.securityCode):this.state.type="unrecognised-single-brand"}for(let s=0;s<e.length;s++){const o=e[s];window._b$dl&&console.log("\nAbout to set up securedField:",o),await this.setupSecuredField(o,t,i).catch((e=>{window._b$dl&&console.log("Secured fields setup failure. e=",e)})),window._b$dl&&console.log("Finished setting up securedField:",o)}if(window._b$dl&&console.log("Finished setting up all securedFields"),this.isSingleBrandedCard){const e={type:this.state.type,rootNode:this.props.rootNode,brand:s,cvcPolicy:t,expiryDatePolicy:i,cvcText:this.securityCode};setTimeout((()=>{this.callbacks.onBrand(e)}),0)}}function g(e,i,s){return new Promise(((o,n)=>{const c=t(e,this.encryptedAttrName);c===r&&(this.state.hasSeparateDateFields=!0);const h={fieldType:c,extraFieldData:t(e,l),uid:t(e,d),cvcPolicy:i,holderEl:e,expiryDatePolicy:s,txVariant:this.state.type,cardGroupTypes:this.config.cardGroupTypes,iframeUIConfig:this.config.iframeUIConfig,sfLogAtStart:this.config.sfLogAtStart,trimTrailingSeparator:this.config.trimTrailingSeparator,isCreditCardType:this.config.isCreditCardType,iframeSrc:this.config.iframeSrc,loadingContext:this.config.loadingContext,showWarnings:this.config.showWarnings,legacyInputMode:this.config.legacyInputMode,minimumExpiryDate:this.config.minimumExpiryDate,maskSecurityCode:this.props.maskSecurityCode,exposeExpiryDate:this.props.exposeExpiryDate,disableIOSArrowKeys:this.props.shouldDisableIOSArrowKeys,implementationType:this.props.implementationType,showContextualElement:this.props.showContextualElement,placeholders:this.props.placeholders},f=new u(h,this.props.i18n).onIframeLoaded((()=>{if(this.state.iframeCount+=1,window._b$dl&&console.log("### createSecuredFields::onIframeLoaded:: this.state.iframeCount=",this.state.iframeCount),this.state.iframeCount>this.state.numIframes)throw this.destroySecuredFields(),new p("ERROR",`One or more securedFields has just loaded new content. This should never happen. securedFields have been removed.\n iframe load count=${this.state.iframeCount}. Expected count:${this.state.numIframes}`);if(f.loadToConfigTimeout=setTimeout((()=>{n({type:h.fieldType,failReason:"sf took too long to config"})}),a),this.state.iframeCount===this.state.originalNumIframes){const e={iframesLoaded:!0};this.callbacks.onLoad(e)}})).onConfig((e=>{this.handleIframeConfigFeedback(e),clearTimeout(f.loadToConfigTimeout),f.loadToConfigTimeout=null,o(e)})).onFocus((e=>{this.handleFocus(e)})).onBinValue((e=>{this.handleBinValue(e)})).onTouchstart((e=>{this.props.shouldDisableIOSArrowKeys&&(this.hasGenuineTouchEvents||e.hasGenuineTouchEvents)&&this.callbacks.onTouchstartIOS({fieldType:e.fieldType}),(e.hasGenuineTouchEvents||this.hasGenuineTouchEvents)&&this.postMessageToAllIframes({fieldType:e.fieldType,fieldClick:!0})})).onShiftTab((e=>{this.handleSFShiftTab(e.fieldType)})).onEncryption((e=>{this.handleEncryption(e)})).onValidation((e=>{this.handleValidation(e)})).onAutoComplete((e=>{this.processAutoComplete(e)})).onKeyPressed((e=>{const{numKey:t,...i}=e;this.callbacks.onKeyPressed(i)}));this.state.securedFields[c]=f}))}export{y as createCardSecuredFields,m as createNonCardSecuredFields,f as createSecuredFields,g as setupSecuredField};
2
2
  //# sourceMappingURL=createSecuredFields.js.map
@@ -1,2 +1,2 @@
1
- import{getCardGroupTypes as i}from"../utils/getCardGroupTypes.js";import{NON_CREDIT_CARD_TYPE_SECURED_FIELDS as o,SF_VERSION as t}from"../../constants.js";import{warn as n}from"../../utilities/logger.js";function e(e){this.config.cardGroupTypes=i(e.cardGroupTypes);const r=e.loadingContext;if(!r)return void n("WARNING Config :: no loadingContext has been specified!");var a;this.config.loadingContext="/"===(a=r).charAt(a.length-1)?r:`${r}/`,this.config.isCreditCardType=!1===o.includes(e.type),this.config.iframeUIConfig=e.iframeUIConfig??{},this.config.autoFocus=!(!1===e.autoFocus||"false"===e.autoFocus),this.config.showWarnings=!0===e.showWarnings||"true"===e.showWarnings,this.config.trimTrailingSeparator=!(!1===e.trimTrailingSeparator||"false"===e.trimTrailingSeparator),this.config.keypadFix=!(!1===e.keypadFix||"false"===e.keypadFix),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=!0===window._b$dl;let s=this.config.isCreditCardType?"card":e.type;s.indexOf("sepa")>-1&&(s="iban");const c=btoa(window.location.origin),f=`${s}${!!e.forceCompat||!("function"==typeof window.TextEncoder)?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/${t}/securedFields.html?type=${f}&d=${c}`}export{e as handleConfig};
1
+ import{getCardGroupTypes as i}from"../utils/getCardGroupTypes.js";import{NON_CREDIT_CARD_TYPE_SECURED_FIELDS as o,SF_VERSION as t}from"../../constants.js";import{warn as n}from"../../utilities/logger.js";function e(e){this.config.cardGroupTypes=i(e.cardGroupTypes);const r=e.loadingContext;if(!r)return void n("WARNING Config :: no loadingContext has been specified!");var s;this.config.loadingContext="/"===(s=r).charAt(s.length-1)?r:`${r}/`,this.config.isCreditCardType=!1===o.includes(e.type),this.config.iframeUIConfig=e.iframeUIConfig??{},this.config.autoFocus=!(!1===e.autoFocus||"false"===e.autoFocus),this.config.showWarnings=!0===e.showWarnings||"true"===e.showWarnings,this.config.trimTrailingSeparator=!(!1===e.trimTrailingSeparator||"false"===e.trimTrailingSeparator),this.config.keypadFix=!(!1===e.keypadFix||"false"===e.keypadFix),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=!0===window._b$dl;const a=this.config.isCreditCardType?"card":e.type,c=btoa(window.location.origin),g=`${a}${!!e.forceCompat||!("function"==typeof window.TextEncoder)?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/${t}/securedFields.html?type=${g}&d=${c}`}export{e as handleConfig};
2
2
  //# sourceMappingURL=handleConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleConfig.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.ts"],"sourcesContent":["import { getCardGroupTypes } from '../utils/getCardGroupTypes';\nimport { NON_CREDIT_CARD_TYPE_SECURED_FIELDS, SF_VERSION } from '../../constants';\nimport * as logger from '../../utilities/logger';\nimport { CSFSetupObject } from '../types';\n\n/**\n * Parses this.props to set 'config' type vars on this (CSFComp)\n * - properties that just need to be set once, at startup, and then don't change\n *\n * See interface CSFConfigObject in types.ts\n */\nexport function handleConfig(props: CSFSetupObject): void {\n // --\n this.config.cardGroupTypes = getCardGroupTypes(props.cardGroupTypes);\n\n if (process.env.NODE_ENV === 'development' && window._b$dl) {\n logger.log('### StoreCls::init:: this.config.cardGroupTypes=', this.config.cardGroupTypes);\n }\n\n const loadingContext: string = props.loadingContext;\n\n if (!loadingContext) {\n logger.warn('WARNING Config :: no loadingContext has been specified!');\n return;\n }\n\n // Ensure passed loadingContext has trailing slash\n const lastChar = str => str.charAt(str.length - 1);\n this.config.loadingContext = lastChar(loadingContext) === '/' ? loadingContext : `${loadingContext}/`;\n\n // Is this for the regular creditCard or for another use-case for securedFields e.g. 'ach' or 'giftcard'\n this.config.isCreditCardType = NON_CREDIT_CARD_TYPE_SECURED_FIELDS.includes(props.type) === false;\n\n // Configuration object for individual txVariants - contains styling object values for securedFields inputs\n this.config.iframeUIConfig = props.iframeUIConfig ?? {};\n\n // By default CSF is allowed to automatically shift focus from the date to CVC fields - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.autoFocus = !(props.autoFocus === false || props.autoFocus === 'false');\n\n // By default CSF will NOT perform a console.warn when receiving postMessages with origin or numKey mismatches - user of CSF must explicitly 'opt-in' to get this\n this.config.showWarnings = props.showWarnings === true || props.showWarnings === 'true';\n\n // By default CSF will strip the trailing separator character from valid credit card numbers - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.trimTrailingSeparator = !(props.trimTrailingSeparator === false || props.trimTrailingSeparator === 'false');\n\n // By default CSF is allowed to add a fix for iOS to force the keypad to retract - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.keypadFix = !(props.keypadFix === false || props.keypadFix === 'false');\n\n // To set the type on the iframe input fields to 'tel' c.f. the default 'text' (with inputmode='numeric')\n this.config.legacyInputMode = props.legacyInputMode || null;\n\n // To configure the minimum expiry date to a merchant defined value - this means the card has to be valid until at least this date\n this.config.minimumExpiryDate = props.minimumExpiryDate || null;\n\n this.config.sfLogAtStart = window._b$dl === true;\n\n let sfBundleType: string = this.config.isCreditCardType ? 'card' : props.type;\n if (sfBundleType.indexOf('sepa') > -1) sfBundleType = 'iban';\n\n // Add a hash of the origin to ensure urls are different across domains\n const d = btoa(window.location.origin);\n\n /**\n * Unless we are forcing the use of the compat version via card config\n * - detect Edge vn \\<= 18 & IE11 - who don't support TextEncoder; and use this as an indicator to load a different, compatible, version of SF\n */\n const needsJWECompatVersion = props.forceCompat ? true : !(typeof window.TextEncoder === 'function');\n\n const bundleType = `${sfBundleType}${needsJWECompatVersion ? 'Compat' : ''}`; // e.g. 'card' or 'cardCompat'\n\n this.config.iframeSrc = `${this.config.loadingContext}securedfields/${props.clientKey}/${SF_VERSION}/securedFields.html?type=${bundleType}&d=${d}`;\n\n // TODO###### FOR QUICK LOCAL TESTING of sf\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n this.config.iframeSrc = `${process.env.__SF_ENV__}securedFields.${SF_VERSION}.html?type=${sfBundleType}`;\n }\n // TODO######\n}\n"],"names":["handleConfig","props","this","config","cardGroupTypes","getCardGroupTypes","loadingContext","logger","str","charAt","length","isCreditCardType","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","includes","type","iframeUIConfig","autoFocus","showWarnings","trimTrailingSeparator","keypadFix","legacyInputMode","minimumExpiryDate","sfLogAtStart","window","_b$dl","sfBundleType","indexOf","d","btoa","location","origin","bundleType","forceCompat","TextEncoder","iframeSrc","clientKey","SF_VERSION"],"mappings":"4MAWO,SAASA,EAAaC,GAEzBC,KAAKC,OAAOC,eAAiBC,EAAkBJ,EAAMG,gBAMrD,MAAME,EAAyBL,EAAMK,eAErC,IAAKA,EAED,YADAC,EAAY,2DAKCC,IAAAA,EACjBN,KAAKC,OAAOG,eAA8C,OADzCE,EACqBF,GADVG,OAAOD,EAAIE,OAAS,GACgBJ,EAAiB,GAAGA,KAGpFJ,KAAKC,OAAOQ,kBAAgF,IAA7DC,EAAoCC,SAASZ,EAAMa,MAGlFZ,KAAKC,OAAOY,eAAiBd,EAAMc,gBAAkB,CAAC,EAGtDb,KAAKC,OAAOa,aAAkC,IAApBf,EAAMe,WAA2C,UAApBf,EAAMe,WAG7Dd,KAAKC,OAAOc,cAAsC,IAAvBhB,EAAMgB,cAAgD,SAAvBhB,EAAMgB,aAGhEf,KAAKC,OAAOe,yBAA0D,IAAhCjB,EAAMiB,uBAAmE,UAAhCjB,EAAMiB,uBAGrFhB,KAAKC,OAAOgB,aAAkC,IAApBlB,EAAMkB,WAA2C,UAApBlB,EAAMkB,WAG7DjB,KAAKC,OAAOiB,gBAAkBnB,EAAMmB,iBAAmB,KAGvDlB,KAAKC,OAAOkB,kBAAoBpB,EAAMoB,mBAAqB,KAE3DnB,KAAKC,OAAOmB,cAAgC,IAAjBC,OAAOC,MAElC,IAAIC,EAAuBvB,KAAKC,OAAOQ,iBAAmB,OAASV,EAAMa,KACrEW,EAAaC,QAAQ,SAAW,IAAGD,EAAe,QAGtD,MAAME,EAAIC,KAAKL,OAAOM,SAASC,QAQzBC,EAAa,GAAGN,MAFQxB,EAAM+B,eAAqD,mBAAvBT,OAAOU,aAEZ,SAAW,KAExE/B,KAAKC,OAAO+B,UAAY,GAAGhC,KAAKC,OAAOG,+BAA+BL,EAAMkC,aAAaC,6BAAsCL,OAAgBJ,GAOnJ"}
1
+ {"version":3,"file":"handleConfig.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.ts"],"sourcesContent":["import { getCardGroupTypes } from '../utils/getCardGroupTypes';\nimport { NON_CREDIT_CARD_TYPE_SECURED_FIELDS, SF_VERSION } from '../../constants';\nimport * as logger from '../../utilities/logger';\nimport { CSFSetupObject } from '../types';\n\n/**\n * Parses this.props to set 'config' type vars on this (CSFComp)\n * - properties that just need to be set once, at startup, and then don't change\n *\n * See interface CSFConfigObject in types.ts\n */\nexport function handleConfig(props: CSFSetupObject): void {\n // --\n this.config.cardGroupTypes = getCardGroupTypes(props.cardGroupTypes);\n\n if (process.env.NODE_ENV === 'development' && window._b$dl) {\n logger.log('### StoreCls::init:: this.config.cardGroupTypes=', this.config.cardGroupTypes);\n }\n\n const loadingContext: string = props.loadingContext;\n\n if (!loadingContext) {\n logger.warn('WARNING Config :: no loadingContext has been specified!');\n return;\n }\n\n // Ensure passed loadingContext has trailing slash\n const lastChar = str => str.charAt(str.length - 1);\n this.config.loadingContext = lastChar(loadingContext) === '/' ? loadingContext : `${loadingContext}/`;\n\n // Is this for the regular creditCard or for another use-case for securedFields e.g. 'ach' or 'giftcard'\n this.config.isCreditCardType = NON_CREDIT_CARD_TYPE_SECURED_FIELDS.includes(props.type) === false;\n\n // Configuration object for individual txVariants - contains styling object values for securedFields inputs\n this.config.iframeUIConfig = props.iframeUIConfig ?? {};\n\n // By default CSF is allowed to automatically shift focus from the date to CVC fields - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.autoFocus = !(props.autoFocus === false || props.autoFocus === 'false');\n\n // By default CSF will NOT perform a console.warn when receiving postMessages with origin or numKey mismatches - user of CSF must explicitly 'opt-in' to get this\n this.config.showWarnings = props.showWarnings === true || props.showWarnings === 'true';\n\n // By default CSF will strip the trailing separator character from valid credit card numbers - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.trimTrailingSeparator = !(props.trimTrailingSeparator === false || props.trimTrailingSeparator === 'false');\n\n // By default CSF is allowed to add a fix for iOS to force the keypad to retract - user of CSF must explicitly 'opt-out' to prevent this happening\n this.config.keypadFix = !(props.keypadFix === false || props.keypadFix === 'false');\n\n // To set the type on the iframe input fields to 'tel' c.f. the default 'text' (with inputmode='numeric')\n this.config.legacyInputMode = props.legacyInputMode || null;\n\n // To configure the minimum expiry date to a merchant defined value - this means the card has to be valid until at least this date\n this.config.minimumExpiryDate = props.minimumExpiryDate || null;\n\n this.config.sfLogAtStart = window._b$dl === true;\n\n const sfBundleType: string = this.config.isCreditCardType ? 'card' : props.type;\n\n // Add a hash of the origin to ensure urls are different across domains\n const d = btoa(window.location.origin);\n\n /**\n * Unless we are forcing the use of the compat version via card config\n * - detect Edge vn \\<= 18 & IE11 - who don't support TextEncoder; and use this as an indicator to load a different, compatible, version of SF\n */\n const needsJWECompatVersion = props.forceCompat ? true : !(typeof window.TextEncoder === 'function');\n\n const bundleType = `${sfBundleType}${needsJWECompatVersion ? 'Compat' : ''}`; // e.g. 'card' or 'cardCompat'\n\n this.config.iframeSrc = `${this.config.loadingContext}securedfields/${props.clientKey}/${SF_VERSION}/securedFields.html?type=${bundleType}&d=${d}`;\n\n // TODO###### FOR QUICK LOCAL TESTING of sf\n if (process.env.NODE_ENV === 'development' && process.env.__SF_ENV__ !== 'build') {\n this.config.iframeSrc = `${process.env.__SF_ENV__}securedFields.${SF_VERSION}.html?type=${sfBundleType}`;\n }\n // TODO######\n}\n"],"names":["handleConfig","props","this","config","cardGroupTypes","getCardGroupTypes","loadingContext","logger","str","charAt","length","isCreditCardType","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","includes","type","iframeUIConfig","autoFocus","showWarnings","trimTrailingSeparator","keypadFix","legacyInputMode","minimumExpiryDate","sfLogAtStart","window","_b$dl","sfBundleType","d","btoa","location","origin","bundleType","forceCompat","TextEncoder","iframeSrc","clientKey","SF_VERSION"],"mappings":"4MAWO,SAASA,EAAaC,GAEzBC,KAAKC,OAAOC,eAAiBC,EAAkBJ,EAAMG,gBAMrD,MAAME,EAAyBL,EAAMK,eAErC,IAAKA,EAED,YADAC,EAAY,2DAKCC,IAAAA,EACjBN,KAAKC,OAAOG,eAA8C,OADzCE,EACqBF,GADVG,OAAOD,EAAIE,OAAS,GACgBJ,EAAiB,GAAGA,KAGpFJ,KAAKC,OAAOQ,kBAAgF,IAA7DC,EAAoCC,SAASZ,EAAMa,MAGlFZ,KAAKC,OAAOY,eAAiBd,EAAMc,gBAAkB,CAAC,EAGtDb,KAAKC,OAAOa,aAAkC,IAApBf,EAAMe,WAA2C,UAApBf,EAAMe,WAG7Dd,KAAKC,OAAOc,cAAsC,IAAvBhB,EAAMgB,cAAgD,SAAvBhB,EAAMgB,aAGhEf,KAAKC,OAAOe,yBAA0D,IAAhCjB,EAAMiB,uBAAmE,UAAhCjB,EAAMiB,uBAGrFhB,KAAKC,OAAOgB,aAAkC,IAApBlB,EAAMkB,WAA2C,UAApBlB,EAAMkB,WAG7DjB,KAAKC,OAAOiB,gBAAkBnB,EAAMmB,iBAAmB,KAGvDlB,KAAKC,OAAOkB,kBAAoBpB,EAAMoB,mBAAqB,KAE3DnB,KAAKC,OAAOmB,cAAgC,IAAjBC,OAAOC,MAElC,MAAMC,EAAuBvB,KAAKC,OAAOQ,iBAAmB,OAASV,EAAMa,KAGrEY,EAAIC,KAAKJ,OAAOK,SAASC,QAQzBC,EAAa,GAAGL,MAFQxB,EAAM8B,eAAqD,mBAAvBR,OAAOS,aAEZ,SAAW,KAExE9B,KAAKC,OAAO8B,UAAY,GAAG/B,KAAKC,OAAOG,+BAA+BL,EAAMiC,aAAaC,6BAAsCL,OAAgBJ,GAOnJ"}
@@ -1,2 +1,2 @@
1
- import t from"../utils/userAgent.js";import"../../utilities/logger.js";import{shiftTabCreditCard as i}from"../utils/tabbing/tabScenarioCreditCard.js";import{shiftTabACH as a}from"../utils/tabbing/tabScenarioACH.js";import{shiftTabGiftCard as s}from"../utils/tabbing/tabScenarioGiftCard.js";import{shiftTabKCP as e}from"../utils/tabbing/tabScenarioKCP.js";import{focusExternalField as o}from"../utils/tabbing/utils.js";var r={handleShiftTab:function(t){let r;switch(this.state.type){case"ach":r=a(t);break;case"giftcard":r=s(t,this.props.rootNode);break;default:r=this.state.isKCP?e(t,this.props.rootNode,this.state.hasSeparateDateFields):i(t,this.props.rootNode,this.state.hasSeparateDateFields,this.state.numIframes)}const l=r.fieldToFocus,n=r.additionalField;l?this.setFocusOnFrame(l,false):n&&o(n)},handleSFShiftTab:function(i){(t.__IS_FIREFOX||t.__IS_IE&&t.__IS_IE<=11)&&this.handleShiftTab(i)}};export{r as default};
1
+ import t from"../utils/userAgent.js";import"../../utilities/logger.js";import{shiftTabCreditCard as i}from"../utils/tabbing/tabScenarioCreditCard.js";import{shiftTabGiftCard as s}from"../utils/tabbing/tabScenarioGiftCard.js";import{shiftTabKCP as a}from"../utils/tabbing/tabScenarioKCP.js";import{focusExternalField as e}from"../utils/tabbing/utils.js";var o={handleShiftTab:function(t){let o;if("giftcard"===this.state.type)o=s(t,this.props.rootNode);else o=this.state.isKCP?a(t,this.props.rootNode,this.state.hasSeparateDateFields):i(t,this.props.rootNode,this.state.hasSeparateDateFields,this.state.numIframes);const r=o.fieldToFocus,l=o.additionalField;r?this.setFocusOnFrame(r,false):l&&e(l)},handleSFShiftTab:function(i){(t.__IS_FIREFOX||t.__IS_IE&&t.__IS_IE<=11)&&this.handleShiftTab(i)}};export{o as default};
2
2
  //# sourceMappingURL=handleTab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleTab.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleTab.ts"],"sourcesContent":["import ua from '../utils/userAgent';\nimport * as logger from '../../utilities/logger';\nimport { shiftTabCreditCard } from '../utils/tabbing/tabScenarioCreditCard';\nimport { shiftTabACH } from '../utils/tabbing/tabScenarioACH';\nimport { shiftTabGiftCard } from '../utils/tabbing/tabScenarioGiftCard';\nimport { shiftTabKCP } from '../utils/tabbing/tabScenarioKCP';\nimport { SFFieldType, ShiftTabObject } from '../../types';\nimport { focusExternalField } from '../utils/tabbing/utils';\n\nconst logTab = false;\n\nfunction handleShiftTab(fieldType: SFFieldType): void {\n if (logTab) logger.log('### handleTab::handleShiftTab:: fieldType', fieldType);\n\n let shiftTabObj: ShiftTabObject;\n\n switch (this.state.type) {\n // ACH scenario: bankAccountNumber SF followed by a bankLocationId SF\n case 'ach':\n shiftTabObj = shiftTabACH(fieldType);\n break;\n\n // GIFT CARD scenario: SecurityCode preceded by CardNumber\n case 'giftcard':\n shiftTabObj = shiftTabGiftCard(fieldType, this.props.rootNode);\n break;\n\n // Credit Card scenarios\n default:\n // KCP scenario: Regular credit card but with additional fields\n // - an encrypted pin/password field preceded by a form field of a non-SF type (d.o.b/taxRefNum)\n if (this.state.isKCP) {\n shiftTabObj = shiftTabKCP(fieldType, this.props.rootNode, this.state.hasSeparateDateFields);\n } else {\n // Regular Credit Card\n shiftTabObj = shiftTabCreditCard(fieldType, this.props.rootNode, this.state.hasSeparateDateFields, this.state.numIframes);\n }\n break;\n }\n\n const fieldToFocus: string = shiftTabObj.fieldToFocus;\n const additionalField: HTMLElement = shiftTabObj.additionalField;\n\n if (fieldToFocus) {\n this.setFocusOnFrame(fieldToFocus, logTab);\n } else if (additionalField) {\n focusExternalField(additionalField);\n }\n}\n\nconst eligibleForTabFix = (): boolean => ua.__IS_FIREFOX || (ua.__IS_IE && ua.__IS_IE <= 11);\n\nfunction handleSFShiftTab(fieldType: SFFieldType): void {\n if (eligibleForTabFix()) {\n this.handleShiftTab(fieldType);\n }\n}\n\nexport default {\n handleShiftTab,\n handleSFShiftTab\n};\n"],"names":["handleTab","handleShiftTab","fieldType","shiftTabObj","this","state","type","shiftTabACH","shiftTabGiftCard","props","rootNode","isKCP","shiftTabKCP","hasSeparateDateFields","shiftTabCreditCard","numIframes","fieldToFocus","additionalField","setFocusOnFrame","focusExternalField","handleSFShiftTab","ua","__IS_FIREFOX","__IS_IE"],"mappings":"kaA0DA,IAAeA,EAAA,CACXC,eAhDJ,SAAwBC,GAGpB,IAAIC,EAEJ,OAAQC,KAAKC,MAAMC,MAEf,IAAK,MACDH,EAAcI,EAAYL,GAC1B,MAGJ,IAAK,WACDC,EAAcK,EAAiBN,EAAWE,KAAKK,MAAMC,UACrD,MAGJ,QAIQP,EADAC,KAAKC,MAAMM,MACGC,EAAYV,EAAWE,KAAKK,MAAMC,SAAUN,KAAKC,MAAMQ,uBAGvDC,EAAmBZ,EAAWE,KAAKK,MAAMC,SAAUN,KAAKC,MAAMQ,sBAAuBT,KAAKC,MAAMU,YAK1H,MAAMC,EAAuBb,EAAYa,aACnCC,EAA+Bd,EAAYc,gBAE7CD,EACAZ,KAAKc,gBAAgBF,EAnCd,OAoCAC,GACPE,EAAmBF,EAE3B,EAYIG,iBARJ,SAA0BlB,IAFemB,EAAGC,cAAiBD,EAAGE,SAAWF,EAAGE,SAAW,KAIjFnB,KAAKH,eAAeC,EAE5B"}
1
+ {"version":3,"file":"handleTab.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleTab.ts"],"sourcesContent":["import ua from '../utils/userAgent';\nimport * as logger from '../../utilities/logger';\nimport { shiftTabCreditCard } from '../utils/tabbing/tabScenarioCreditCard';\nimport { shiftTabGiftCard } from '../utils/tabbing/tabScenarioGiftCard';\nimport { shiftTabKCP } from '../utils/tabbing/tabScenarioKCP';\nimport { SFFieldType, ShiftTabObject } from '../../types';\nimport { focusExternalField } from '../utils/tabbing/utils';\n\nconst logTab = false;\n\nfunction handleShiftTab(fieldType: SFFieldType): void {\n if (logTab) logger.log('### handleTab::handleShiftTab:: fieldType', fieldType);\n\n let shiftTabObj: ShiftTabObject;\n\n switch (this.state.type) {\n // GIFT CARD scenario: SecurityCode preceded by CardNumber\n case 'giftcard':\n shiftTabObj = shiftTabGiftCard(fieldType, this.props.rootNode);\n break;\n\n // Credit Card scenarios\n default:\n // KCP scenario: Regular credit card but with additional fields\n // - an encrypted pin/password field preceded by a form field of a non-SF type (d.o.b/taxRefNum)\n if (this.state.isKCP) {\n shiftTabObj = shiftTabKCP(fieldType, this.props.rootNode, this.state.hasSeparateDateFields);\n } else {\n // Regular Credit Card\n shiftTabObj = shiftTabCreditCard(fieldType, this.props.rootNode, this.state.hasSeparateDateFields, this.state.numIframes);\n }\n break;\n }\n\n const fieldToFocus: string = shiftTabObj.fieldToFocus;\n const additionalField: HTMLElement = shiftTabObj.additionalField;\n\n if (fieldToFocus) {\n this.setFocusOnFrame(fieldToFocus, logTab);\n } else if (additionalField) {\n focusExternalField(additionalField);\n }\n}\n\nconst eligibleForTabFix = (): boolean => ua.__IS_FIREFOX || (ua.__IS_IE && ua.__IS_IE <= 11);\n\nfunction handleSFShiftTab(fieldType: SFFieldType): void {\n if (eligibleForTabFix()) {\n this.handleShiftTab(fieldType);\n }\n}\n\nexport default {\n handleShiftTab,\n handleSFShiftTab\n};\n"],"names":["handleTab","handleShiftTab","fieldType","shiftTabObj","this","state","type","shiftTabGiftCard","props","rootNode","isKCP","shiftTabKCP","hasSeparateDateFields","shiftTabCreditCard","numIframes","fieldToFocus","additionalField","setFocusOnFrame","focusExternalField","handleSFShiftTab","ua","__IS_FIREFOX","__IS_IE"],"mappings":"iWAoDA,IAAeA,EAAA,CACXC,eA3CJ,SAAwBC,GAGpB,IAAIC,EAEJ,GAES,aAFDC,KAAKC,MAAMC,KAGXH,EAAcI,EAAiBL,EAAWE,KAAKI,MAAMC,eAQjDN,EADAC,KAAKC,MAAMK,MACGC,EAAYT,EAAWE,KAAKI,MAAMC,SAAUL,KAAKC,MAAMO,uBAGvDC,EAAmBX,EAAWE,KAAKI,MAAMC,SAAUL,KAAKC,MAAMO,sBAAuBR,KAAKC,MAAMS,YAK1H,MAAMC,EAAuBZ,EAAYY,aACnCC,EAA+Bb,EAAYa,gBAE7CD,EACAX,KAAKa,gBAAgBF,EA9Bd,OA+BAC,GACPE,EAAmBF,EAE3B,EAYIG,iBARJ,SAA0BjB,IAFekB,EAAGC,cAAiBD,EAAGE,SAAWF,EAAGE,SAAW,KAIjFlB,KAAKH,eAAeC,EAE5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"processAutoComplete.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.ts"],"sourcesContent":["import postMessageToIframe from '../utils/iframes/postMessageToIframe';\nimport { ENCRYPTED_EXPIRY_DATE, ENCRYPTED_EXPIRY_MONTH, ENCRYPTED_EXPIRY_YEAR } from '../../constants';\nimport { SFFeedbackObj, CardAutoCompleteData } from '../../types';\nimport { hasOwnProperty } from '../../../../../../utils/hasOwnProperty';\nimport getIframeContentWin from '../utils/iframes/getIframeContentWin';\nimport { CSFThisObject } from '../types';\n\n/**\n *\n * @param csfState - comes from initial, partial, implementation\n * @param csfConfig - comes from initial, partial, implementation\n * @param csfCallbacks - comes from initial, partial, implementation\n *\n * @param pFeedbackObj -\n */\nexport function processAutoComplete({ csfState, csfConfig, csfCallbacks }: CSFThisObject, pFeedbackObj: SFFeedbackObj): boolean {\n /**\n * NOTE: It seems Chrome has started autofilling across cross-origin iframes. Have tested as far back as v104 but have no resources to test further back\n * So, in theory for Chrome \\>= v104 we don't need to do any of this, including having special listeners in the securedFields\n */\n\n // Specifically for cc-name (but no reason not to propagate all AC objects to the merchant)\n if (pFeedbackObj.name === 'cc-name') {\n const feedbackObj: SFFeedbackObj = { ...pFeedbackObj };\n delete feedbackObj.numKey;\n const ACFeedbackObj: CardAutoCompleteData = feedbackObj as CardAutoCompleteData;\n csfCallbacks.onAutoComplete(ACFeedbackObj);\n return true;\n }\n\n // Send date info to relevant secured fields (needed for Safari whose Security model won't allow direct population of fields in 3rd party iframes)\n if (pFeedbackObj.name === 'cc-exp') {\n const splittableDateVal = pFeedbackObj.value.replace(/[^0-9]/gi, '/'); // Replace any non-digits with a fwd-slash so we can always split it\n\n const dateValArr: string[] = splittableDateVal.split('/');\n\n if (dateValArr.length !== 2) {\n // To avoid bug in some versions of Safari where date doesn't come through as expected\n return false;\n }\n\n if (dateValArr[0].length === 1) dateValArr[0] = `0${dateValArr[0]}`; // pad, if required\n\n const acMonthVal: string = dateValArr[0];\n\n // Extra checks that passed year is a valid value\n const year = dateValArr[1];\n const isValidYear = (year?.length === 4 || year?.length === 2) && !isNaN(parseInt(year));\n if (!isValidYear) {\n return false;\n }\n\n const acYearVal: string = year.slice(-2); // take last 2 digits of year\n const acDateVal = `${acMonthVal}/${acYearVal}`;\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_DATE)) {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_DATE,\n autoComplete: acDateVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_DATE].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_DATE), csfConfig.loadingContext);\n return true;\n }\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_MONTH)) {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_MONTH,\n autoComplete: acMonthVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_MONTH].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_MONTH), csfConfig.loadingContext);\n }\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_YEAR)) {\n // Dirty! - Need to wait til next page draw if setting month and year at the same time, otherwise only year gets set\n setTimeout(() => {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_YEAR,\n autoComplete: acYearVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_YEAR].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_YEAR), csfConfig.loadingContext);\n }, 0);\n }\n return true;\n }\n\n return false;\n}\n"],"names":["processAutoComplete","csfState","csfConfig","csfCallbacks","pFeedbackObj","name","feedbackObj","numKey","ACFeedbackObj","onAutoComplete","dateValArr","value","replace","split","length","acMonthVal","year","isNaN","parseInt","acYearVal","slice","acDateVal","hasOwnProperty","securedFields","ENCRYPTED_EXPIRY_DATE","dataObj","txVariant","type","fieldType","autoComplete","postMessageToIframe","getIframeContentWin","loadingContext","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","setTimeout"],"mappings":"2SAeO,SAASA,GAAoBC,SAAEA,EAAQC,UAAEA,EAASC,aAAEA,GAA+BC,GAOtF,GAA0B,YAAtBA,EAAaC,KAAoB,CACjC,MAAMC,EAA6B,IAAKF,UACjCE,EAAYC,OACnB,MAAMC,EAAsCF,EAE5C,OADAH,EAAaM,eAAeD,IACrB,CACX,CAGA,GAA0B,WAAtBJ,EAAaC,KAAmB,CAChC,MAEMK,EAFoBN,EAAaO,MAAMC,QAAQ,WAAY,KAElBC,MAAM,KAErD,GAA0B,IAAtBH,EAAWI,OAEX,OAAO,EAGkB,IAAzBJ,EAAW,GAAGI,SAAcJ,EAAW,GAAK,IAAIA,EAAW,MAE/D,MAAMK,EAAqBL,EAAW,GAGhCM,EAAON,EAAW,GAExB,MADsC,IAAjBM,GAAMF,QAAiC,IAAjBE,GAAMF,UAAkBG,MAAMC,SAASF,KAE9E,OAAO,EAGX,MAAMG,EAAoBH,EAAKI,OAAO,GAChCC,EAAY,GAAGN,KAAcI,IAEnC,GAAIG,EAAerB,EAASsB,cAAeC,GAAwB,CAC/D,MAAMC,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWJ,EACXK,aAAcR,EACdd,OAAQN,EAASsB,cAAcC,GAAuBjB,QAG1D,OADAuB,EAAoBL,EAASM,EAAoB9B,EAAUuB,GAAwBtB,EAAU8B,iBACtF,CACX,CAEA,GAAIV,EAAerB,EAASsB,cAAeU,GAAyB,CAChE,MAAMR,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWK,EACXJ,aAAcd,EACdR,OAAQN,EAASsB,cAAcU,GAAwB1B,QAE3DuB,EAAoBL,EAASM,EAAoB9B,EAAUgC,GAAyB/B,EAAU8B,eAClG,CAcA,OAZIV,EAAerB,EAASsB,cAAeW,IAEvCC,YAAW,KACP,MAAMV,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWM,EACXL,aAAcV,EACdZ,OAAQN,EAASsB,cAAcW,GAAuB3B,QAE1DuB,EAAoBL,EAASM,EAAoB9B,EAAUiC,GAAwBhC,EAAU8B,eAAc,GAC5G,IAEA,CACX,CAEA,OAAO,CACX"}
1
+ {"version":3,"file":"processAutoComplete.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.ts"],"sourcesContent":["import postMessageToIframe from '../utils/iframes/postMessageToIframe';\nimport { ENCRYPTED_EXPIRY_DATE, ENCRYPTED_EXPIRY_MONTH, ENCRYPTED_EXPIRY_YEAR } from '../../constants';\nimport { SFFeedbackObj, CardAutoCompleteData } from '../../types';\nimport { hasOwnProperty } from '../../../../../../utils/hasOwnProperty';\nimport getIframeContentWin from '../utils/iframes/getIframeContentWin';\nimport { CSFThisObject } from '../types';\n\n/**\n *\n * @param csfState - comes from initial, partial, implementation\n * @param csfConfig - comes from initial, partial, implementation\n * @param csfCallbacks - comes from initial, partial, implementation\n *\n * @param pFeedbackObj -\n */\nexport function processAutoComplete({ csfState, csfConfig, csfCallbacks }: CSFThisObject, pFeedbackObj: SFFeedbackObj): boolean {\n /**\n * NOTE: It seems Chrome has started autofilling across cross-origin iframes. Have tested as far back as v104 but have no resources to test further back\n * So, in theory for Chrome \\>= v104 we don't need to do any of this, including having special listeners in the securedFields\n */\n\n // Specifically for cc-name (but no reason not to propagate all AC objects to the merchant)\n if (pFeedbackObj.name === 'cc-name') {\n const feedbackObj: SFFeedbackObj = { ...pFeedbackObj };\n delete feedbackObj.numKey;\n const ACFeedbackObj: CardAutoCompleteData = feedbackObj as CardAutoCompleteData;\n csfCallbacks.onAutoComplete(ACFeedbackObj);\n return true;\n }\n\n // Send date info to relevant secured fields (needed for Safari whose Security model won't allow direct population of fields in 3rd party iframes)\n if (pFeedbackObj.name === 'cc-exp') {\n const splittableDateVal = pFeedbackObj.value.replace(/[^0-9]/gi, '/'); // Replace any non-digits with a fwd-slash so we can always split it\n\n const dateValArr: string[] = splittableDateVal.split('/');\n\n if (dateValArr.length !== 2) {\n // To avoid bug in some versions of Safari where date doesn't come through as expected\n return false;\n }\n\n if (dateValArr[0].length === 1) dateValArr[0] = `0${dateValArr[0]}`; // pad, if required\n\n const acMonthVal: string = dateValArr[0];\n\n // Extra checks that passed year is a valid value\n const year = dateValArr[1];\n const isValidYear = (year?.length === 4 || year?.length === 2) && !isNaN(parseInt(year));\n if (!isValidYear) {\n return false;\n }\n\n const acYearVal: string = year.slice(-2); // take last 2 digits of year\n const acDateVal = `${acMonthVal}/${acYearVal}`;\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_DATE)) {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_DATE,\n autoComplete: acDateVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_DATE].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_DATE), csfConfig.loadingContext);\n return true;\n }\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_MONTH)) {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_MONTH,\n autoComplete: acMonthVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_MONTH].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_MONTH), csfConfig.loadingContext);\n }\n\n if (hasOwnProperty(csfState.securedFields, ENCRYPTED_EXPIRY_YEAR)) {\n // Dirty! - Need to wait til next page draw if setting month and year at the same time, otherwise only year gets set\n setTimeout(() => {\n const dataObj: object = {\n txVariant: csfState.type,\n fieldType: ENCRYPTED_EXPIRY_YEAR,\n autoComplete: acYearVal,\n numKey: csfState.securedFields[ENCRYPTED_EXPIRY_YEAR].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(csfState, ENCRYPTED_EXPIRY_YEAR), csfConfig.loadingContext);\n }, 0);\n }\n return true;\n }\n\n return false;\n}\n"],"names":["processAutoComplete","csfState","csfConfig","csfCallbacks","pFeedbackObj","name","feedbackObj","numKey","ACFeedbackObj","onAutoComplete","dateValArr","value","replace","split","length","acMonthVal","year","isNaN","parseInt","acYearVal","slice","acDateVal","hasOwnProperty","securedFields","ENCRYPTED_EXPIRY_DATE","dataObj","txVariant","type","fieldType","autoComplete","postMessageToIframe","getIframeContentWin","loadingContext","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","setTimeout"],"mappings":"2SAeO,SAASA,GAAoBC,SAAEA,EAAQC,UAAEA,EAASC,aAAEA,GAA+BC,GAOtF,GAA0B,YAAtBA,EAAaC,KAAoB,CACjC,MAAMC,EAA6B,IAAKF,UACjCE,EAAYC,OACnB,MAAMC,EAAsCF,EAE5C,OADAH,EAAaM,eAAeD,IACrB,CACX,CAGA,GAA0B,WAAtBJ,EAAaC,KAAmB,CAChC,MAEMK,EAFoBN,EAAaO,MAAMC,QAAQ,WAAY,KAElBC,MAAM,KAErD,GAA0B,IAAtBH,EAAWI,OAEX,OAAO,EAGkB,IAAzBJ,EAAW,GAAGI,SAAcJ,EAAW,GAAK,IAAIA,EAAW,MAE/D,MAAMK,EAAqBL,EAAW,GAGhCM,EAAON,EAAW,GAExB,MADsC,IAAjBM,GAAMF,QAAiC,IAAjBE,GAAMF,UAAkBG,MAAMC,SAASF,KAE9E,OAAO,EAGX,MAAMG,EAAoBH,EAAKI,UACzBC,EAAY,GAAGN,KAAcI,IAEnC,GAAIG,EAAerB,EAASsB,cAAeC,GAAwB,CAC/D,MAAMC,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWJ,EACXK,aAAcR,EACdd,OAAQN,EAASsB,cAAcC,GAAuBjB,QAG1D,OADAuB,EAAoBL,EAASM,EAAoB9B,EAAUuB,GAAwBtB,EAAU8B,iBACtF,CACX,CAEA,GAAIV,EAAerB,EAASsB,cAAeU,GAAyB,CAChE,MAAMR,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWK,EACXJ,aAAcd,EACdR,OAAQN,EAASsB,cAAcU,GAAwB1B,QAE3DuB,EAAoBL,EAASM,EAAoB9B,EAAUgC,GAAyB/B,EAAU8B,eAClG,CAcA,OAZIV,EAAerB,EAASsB,cAAeW,IAEvCC,YAAW,KACP,MAAMV,EAAkB,CACpBC,UAAWzB,EAAS0B,KACpBC,UAAWM,EACXL,aAAcV,EACdZ,OAAQN,EAASsB,cAAcW,GAAuB3B,QAE1DuB,EAAoBL,EAASM,EAAoB9B,EAAUiC,GAAwBhC,EAAU8B,eAAc,GAC5G,IAEA,CACX,CAEA,OAAO,CACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"postMessageValidation.js","sources":["../../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.ts"],"sourcesContent":["import * as logger from '../../../utilities/logger';\n\nexport const originCheckPassed = (event: MessageEvent, pLoadingContext: string, pShowWarnings: boolean): boolean => {\n const origin = event.origin; // || event.originalEvent.origin;\n\n const isCheckoutUrl: number = pLoadingContext.indexOf('/checkoutshopper/');\n let adyenDomain: string = isCheckoutUrl > -1 ? pLoadingContext.substring(0, isCheckoutUrl) : pLoadingContext;\n\n // Strip trailing /\n const lastCharIndex: number = adyenDomain.length - 1;\n if (adyenDomain.charAt(lastCharIndex) === '/') {\n adyenDomain = adyenDomain.substring(0, lastCharIndex);\n }\n\n if (origin !== adyenDomain) {\n if (pShowWarnings) {\n logger.warn(\n 'WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!\\n Received message with origin:',\n origin,\n 'but the only allowed origin for messages to CSF is',\n adyenDomain,\n '### event.data=',\n event.data\n );\n }\n return false;\n }\n\n return true;\n};\n\n// Catch webpack postMessages responses\nexport const isWebpackPostMsg = (event: MessageEvent): boolean =>\n event.data && event.data.type && typeof event.data.type === 'string' && event.data.type.indexOf('webpack') > -1;\n\n// Catch ChromeVox postMessages responses\nexport const isChromeVoxPostMsg = (event: MessageEvent): boolean => event.data && typeof event.data === 'string' && event.data.indexOf('cvox') > -1;\n"],"names":["originCheckPassed","event","pLoadingContext","pShowWarnings","origin","isCheckoutUrl","indexOf","adyenDomain","substring","lastCharIndex","length","charAt","logger","data","isWebpackPostMsg","type","isChromeVoxPostMsg"],"mappings":"oDAEaA,MAAAA,EAAoB,CAACC,EAAqBC,EAAyBC,KAC5E,MAAMC,EAASH,EAAMG,OAEfC,EAAwBH,EAAgBI,QAAQ,qBACtD,IAAIC,EAAsBF,GAAiB,EAAIH,EAAgBM,UAAU,EAAGH,GAAiBH,EAG7F,MAAMO,EAAwBF,EAAYG,OAAS,EAKnD,MAJ0C,MAAtCH,EAAYI,OAAOF,KACnBF,EAAcA,EAAYC,UAAU,EAAGC,IAGvCL,IAAWG,IACPJ,GACAS,EACI,mHACAR,EACA,qDACAG,EACA,kBACAN,EAAMY,OAGP,EAGJ,EAIEC,EAAoBb,GAC7BA,EAAMY,MAAQZ,EAAMY,KAAKE,MAAmC,iBAApBd,EAAMY,KAAKE,MAAqBd,EAAMY,KAAKE,KAAKT,QAAQ,YAAc,EAGrGU,EAAsBf,GAAiCA,EAAMY,MAA8B,iBAAfZ,EAAMY,MAAqBZ,EAAMY,KAAKP,QAAQ,SAAW"}
1
+ {"version":3,"file":"postMessageValidation.js","sources":["../../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/iframes/postMessageValidation.ts"],"sourcesContent":["import * as logger from '../../../utilities/logger';\n\nexport const originCheckPassed = (event: MessageEvent, pLoadingContext: string, pShowWarnings: boolean): boolean => {\n const origin = event.origin; // || event.originalEvent.origin;\n\n const isCheckoutUrl: number = pLoadingContext.indexOf('/checkoutshopper/');\n let adyenDomain: string = isCheckoutUrl > -1 ? pLoadingContext.substring(0, isCheckoutUrl) : pLoadingContext;\n\n // Strip trailing /\n const lastCharIndex: number = adyenDomain.length - 1;\n if (adyenDomain.charAt(lastCharIndex) === '/') {\n adyenDomain = adyenDomain.substring(0, lastCharIndex);\n }\n\n if (origin !== adyenDomain) {\n if (pShowWarnings) {\n logger.warn(\n 'WARNING postMessageValidation: postMessage listener for iframe::origin mismatch!\\n Received message with origin:',\n origin,\n 'but the only allowed origin for messages to CSF is',\n adyenDomain,\n '### event.data=',\n event.data\n );\n }\n return false;\n }\n\n return true;\n};\n\n// Catch webpack postMessages responses\nexport const isWebpackPostMsg = (event: MessageEvent): boolean =>\n event.data && event.data.type && typeof event.data.type === 'string' && event.data.type.indexOf('webpack') > -1;\n\n// Catch ChromeVox postMessages responses\nexport const isChromeVoxPostMsg = (event: MessageEvent): boolean => event.data && typeof event.data === 'string' && event.data.indexOf('cvox') > -1;\n"],"names":["originCheckPassed","event","pLoadingContext","pShowWarnings","origin","isCheckoutUrl","indexOf","adyenDomain","substring","lastCharIndex","length","charAt","logger","data","isWebpackPostMsg","type","isChromeVoxPostMsg"],"mappings":"oDAEaA,MAAAA,EAAoB,CAACC,EAAqBC,EAAyBC,KAC5E,MAAMC,EAASH,EAAMG,OAEfC,EAAwBH,EAAgBI,QAAQ,qBACtD,IAAIC,EAAsBF,KAAqBH,EAAgBM,UAAU,EAAGH,GAAiBH,EAG7F,MAAMO,EAAwBF,EAAYG,OAAS,EAKnD,MAJ0C,MAAtCH,EAAYI,OAAOF,KACnBF,EAAcA,EAAYC,UAAU,EAAGC,IAGvCL,IAAWG,IACPJ,GACAS,EACI,mHACAR,EACA,qDACAG,EACA,kBACAN,EAAMY,OAGP,EAGJ,EAIEC,EAAoBb,GAC7BA,EAAMY,MAAQZ,EAAMY,KAAKE,MAAmC,iBAApBd,EAAMY,KAAKE,MAAqBd,EAAMY,KAAKE,KAAKT,QAAQ,YAAa,EAGpGU,EAAsBf,GAAiCA,EAAMY,MAA8B,iBAAfZ,EAAMY,MAAqBZ,EAAMY,KAAKP,QAAQ,SAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/tabbing/utils.ts"],"sourcesContent":["import { selectOne, select } from '../../../utilities/dom';\n\nconst getPreviousTabbableEl = (matchEl, getPrevious = true) => {\n const selStr =\n '*[data-cse], a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), ' +\n 'button:not([disabled]), object, embed, *[tabindex], *[contenteditable]';\n const allPotentialTabEls = Array.prototype.slice.call(select(document, selStr));\n const actualTabEls = [];\n\n allPotentialTabEls.forEach(potentialTabEl => {\n const tabIndex = potentialTabEl.getAttribute('tabindex');\n const isValidTabEl = !tabIndex || parseInt(tabIndex, 10) >= 0; // If tabindex hasn't been set, or is set and is >= 0\n const bounds = potentialTabEl.getBoundingClientRect();\n const hasDimensions = bounds.width > 0 && bounds.height > 0;\n\n if (isValidTabEl && hasDimensions) {\n actualTabEls.push(potentialTabEl);\n }\n });\n\n // Loop through an array until it finds an element based on a test fn, and then return the elements index\n const getIndexThruTest = (arr, testFn) => {\n for (let n = 0; n < arr.length; n += 1) {\n if (testFn(arr[n])) {\n return n;\n }\n }\n return -1;\n };\n\n // Test function\n const isElOrContainsEl = tabEl => tabEl === matchEl || matchEl.contains(tabEl);\n\n // Loop through the actualTabEls array until it finds the matchEl, returning its index\n const matchElIndex = getIndexThruTest(actualTabEls, isElOrContainsEl);\n\n // Are we actually getting the previous element OR the next?\n const indexModifier = getPrevious ? -1 : 1;\n\n return actualTabEls[matchElIndex + indexModifier];\n};\n\nexport const getPreviousTabbableNonSFElement = (passedFieldType, rootNode, getPrevious?) => {\n // --\n const sfEl = selectOne(rootNode, `[data-cse=${passedFieldType}]`);\n return getPreviousTabbableEl(sfEl, getPrevious);\n};\n\nexport const focusExternalField = (pAdditionalField: HTMLElement): void => {\n if (pAdditionalField) {\n pAdditionalField.focus();\n\n // Quirky! - Needed to work in the Components scenario\n pAdditionalField.blur();\n pAdditionalField.focus();\n }\n};\n"],"names":["getPreviousTabbableNonSFElement","passedFieldType","rootNode","getPrevious","matchEl","allPotentialTabEls","Array","prototype","slice","call","select","document","actualTabEls","forEach","potentialTabEl","tabIndex","getAttribute","isValidTabEl","parseInt","bounds","getBoundingClientRect","hasDimensions","width","height","push","matchElIndex","arr","testFn","n","length","getIndexThruTest","tabEl","contains","getPreviousTabbableEl","selectOne","focusExternalField","pAdditionalField","focus","blur"],"mappings":"kEAEA,MAwCaA,EAAkC,CAACC,EAAiBC,EAAUC,IAxC7C,EAACC,EAASD,GAAc,KAClD,MAGME,EAAqBC,MAAMC,UAAUC,MAAMC,KAAKC,EAAOC,SAFzD,sLAGEC,EAAe,GAErBP,EAAmBQ,SAAQC,IACvB,MAAMC,EAAWD,EAAeE,aAAa,YACvCC,GAAgBF,GAAYG,SAASH,EAAU,KAAO,EACtDI,EAASL,EAAeM,wBACxBC,EAAgBF,EAAOG,MAAQ,GAAKH,EAAOI,OAAS,EAEtDN,GAAgBI,GAChBT,EAAaY,KAAKV,EACtB,IAIJ,MAaMW,EAbmB,EAACC,EAAKC,KAC3B,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAIG,OAAQD,GAAK,EACjC,GAAID,EAAOD,EAAIE,IACX,OAAOA,EAGf,OAAQ,CAAA,EAOSE,CAAiBlB,GAHbmB,GAASA,IAAU3B,GAAWA,EAAQ4B,SAASD,KAQxE,OAAOnB,EAAaa,GAFEtB,GAAe,EAAI,GAEQ,EAM1C8B,CADMC,EAAUhC,EAAU,aAAaD,MACXE,GAG1BgC,EAAsBC,IAC3BA,IACAA,EAAiBC,QAGjBD,EAAiBE,OACjBF,EAAiBC,QACrB"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/tabbing/utils.ts"],"sourcesContent":["import { selectOne, select } from '../../../utilities/dom';\n\nconst getPreviousTabbableEl = (matchEl, getPrevious = true) => {\n const selStr =\n '*[data-cse], a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), ' +\n 'button:not([disabled]), object, embed, *[tabindex], *[contenteditable]';\n const allPotentialTabEls = Array.prototype.slice.call(select(document, selStr));\n const actualTabEls = [];\n\n allPotentialTabEls.forEach(potentialTabEl => {\n const tabIndex = potentialTabEl.getAttribute('tabindex');\n const isValidTabEl = !tabIndex || parseInt(tabIndex, 10) >= 0; // If tabindex hasn't been set, or is set and is >= 0\n const bounds = potentialTabEl.getBoundingClientRect();\n const hasDimensions = bounds.width > 0 && bounds.height > 0;\n\n if (isValidTabEl && hasDimensions) {\n actualTabEls.push(potentialTabEl);\n }\n });\n\n // Loop through an array until it finds an element based on a test fn, and then return the elements index\n const getIndexThruTest = (arr, testFn) => {\n for (let n = 0; n < arr.length; n += 1) {\n if (testFn(arr[n])) {\n return n;\n }\n }\n return -1;\n };\n\n // Test function\n const isElOrContainsEl = tabEl => tabEl === matchEl || matchEl.contains(tabEl);\n\n // Loop through the actualTabEls array until it finds the matchEl, returning its index\n const matchElIndex = getIndexThruTest(actualTabEls, isElOrContainsEl);\n\n // Are we actually getting the previous element OR the next?\n const indexModifier = getPrevious ? -1 : 1;\n\n return actualTabEls[matchElIndex + indexModifier];\n};\n\nexport const getPreviousTabbableNonSFElement = (passedFieldType, rootNode, getPrevious?) => {\n // --\n const sfEl = selectOne(rootNode, `[data-cse=${passedFieldType}]`);\n return getPreviousTabbableEl(sfEl, getPrevious);\n};\n\nexport const focusExternalField = (pAdditionalField: HTMLElement): void => {\n if (pAdditionalField) {\n pAdditionalField.focus();\n\n // Quirky! - Needed to work in the Components scenario\n pAdditionalField.blur();\n pAdditionalField.focus();\n }\n};\n"],"names":["getPreviousTabbableNonSFElement","passedFieldType","rootNode","getPrevious","matchEl","allPotentialTabEls","Array","prototype","slice","call","select","document","actualTabEls","forEach","potentialTabEl","tabIndex","getAttribute","isValidTabEl","parseInt","bounds","getBoundingClientRect","hasDimensions","width","height","push","matchElIndex","arr","testFn","n","length","getIndexThruTest","tabEl","contains","getPreviousTabbableEl","selectOne","focusExternalField","pAdditionalField","focus","blur"],"mappings":"kEAEA,MAwCaA,EAAkC,CAACC,EAAiBC,EAAUC,IAxC7C,EAACC,EAASD,GAAc,KAClD,MAGME,EAAqBC,MAAMC,UAAUC,MAAMC,KAAKC,EAAOC,SAFzD,sLAGEC,EAAe,GAErBP,EAAmBQ,SAAQC,IACvB,MAAMC,EAAWD,EAAeE,aAAa,YACvCC,GAAgBF,GAAYG,SAASH,EAAU,KAAO,EACtDI,EAASL,EAAeM,wBACxBC,EAAgBF,EAAOG,MAAQ,GAAKH,EAAOI,OAAS,EAEtDN,GAAgBI,GAChBT,EAAaY,KAAKV,EACtB,IAIJ,MAaMW,EAbmB,EAACC,EAAKC,KAC3B,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAIG,OAAQD,GAAK,EACjC,GAAID,EAAOD,EAAIE,IACX,OAAOA,EAGf,OAAQ,CAAA,EAOSE,CAAiBlB,GAHbmB,GAASA,IAAU3B,GAAWA,EAAQ4B,SAASD,KAQxE,OAAOnB,EAAaa,GAFEtB,GAAc,EAAK,GAEQ,EAM1C8B,CADMC,EAAUhC,EAAU,aAAaD,MACXE,GAG1BgC,EAAsBC,IAC3BA,IACAA,EAAiBC,QAGjBD,EAAiBE,OACjBF,EAAiBC,QACrB"}
@@ -1,2 +1,2 @@
1
- let e="undefined"!=typeof navigator&&/(android)/i.test(navigator.userAgent),n="undefined"!=typeof navigator&&function(){const e=navigator.userAgent,n=e.indexOf("MSIE ");if(n>0)return parseInt(e.substring(n+5,e.indexOf(".",n)),10);if(e.indexOf("Trident/")>0){const n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}const t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}();var t={__IS_ANDROID:e,__IS_IE:n,__IS_IOS:"undefined"!=typeof navigator&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:"undefined"!=typeof navigator&&/(firefox)/i.test(navigator.userAgent),__IS_SAFARI:"undefined"!=typeof navigator&&/(safari)/i.test(navigator.userAgent)&&!/(chrome)/i.test(navigator.userAgent)};export{t as default};
1
+ let n="undefined"!=typeof navigator&&function(){const n=navigator.userAgent,e=n.indexOf("MSIE ");if(e>0)return parseInt(n.substring(e+5,n.indexOf(".",e)),10);if(n.indexOf("Trident/")>0){const e=n.indexOf("rv:");return parseInt(n.substring(e+3,n.indexOf(".",e)),10)}const t=n.indexOf("Edge/");return t>0&&parseInt(n.substring(t+5,n.indexOf(".",t)),10)}();var e={__IS_IE:n,__IS_IOS:"undefined"!=typeof navigator&&/iphone|ipod|ipad/i.test(navigator.userAgent),__IS_FIREFOX:"undefined"!=typeof navigator&&/(firefox)/i.test(navigator.userAgent)};export{e as default};
2
2
  //# sourceMappingURL=userAgent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"userAgent.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/userAgent.ts"],"sourcesContent":["function isIE() {\n const ua = navigator.userAgent;\n\n const msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n const trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n const rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n const edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n// NOTE: change from const to let for the purposes of testing (the values get set in some tests)\n/* eslint-disable */\nlet __IS_ANDROID = typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent);\nlet __IS_IE = typeof navigator !== 'undefined' && isIE();\nlet __IS_IOS = typeof navigator !== 'undefined' && /iphone|ipod|ipad/i.test(navigator.userAgent);\nlet __IS_FIREFOX = typeof navigator !== 'undefined' && /(firefox)/i.test(navigator.userAgent);\nlet __IS_SAFARI = typeof navigator !== 'undefined' && /(safari)/i.test(navigator.userAgent) && !/(chrome)/i.test(navigator.userAgent);\n/* eslint-enable */\n\nexport default {\n __IS_ANDROID,\n __IS_IE,\n __IS_IOS,\n __IS_FIREFOX,\n __IS_SAFARI\n};\n"],"names":["__IS_ANDROID","navigator","test","userAgent","__IS_IE","ua","msie","indexOf","parseInt","substring","rv","edge","isIE","__IS_IOS","__IS_FIREFOX","__IS_SAFARI"],"mappings":"AA4BA,IAAIA,EAAoC,oBAAdC,WAA6B,aAAaC,KAAKD,UAAUE,WAC/EC,EAA+B,oBAAdH,WA7BrB,WACI,MAAMI,EAAKJ,UAAUE,UAEfG,EAAOD,EAAGE,QAAQ,SACxB,GAAID,EAAO,EAEP,OAAOE,SAASH,EAAGI,UAAUH,EAAO,EAAGD,EAAGE,QAAQ,IAAKD,IAAQ,IAInE,GADgBD,EAAGE,QAAQ,YACb,EAAG,CAEb,MAAMG,EAAKL,EAAGE,QAAQ,OACtB,OAAOC,SAASH,EAAGI,UAAUC,EAAK,EAAGL,EAAGE,QAAQ,IAAKG,IAAM,GAC/D,CAEA,MAAMC,EAAON,EAAGE,QAAQ,SACxB,OAAII,EAAO,GAEAH,SAASH,EAAGI,UAAUE,EAAO,EAAGN,EAAGE,QAAQ,IAAKI,IAAQ,GAKvE,CAKkDC,GAMlD,IAAeP,EAAA,CACXL,eACAI,UACAS,SARgC,oBAAdZ,WAA6B,oBAAoBC,KAAKD,UAAUE,WASlFW,aARoC,oBAAdb,WAA6B,aAAaC,KAAKD,UAAUE,WAS/EY,YARmC,oBAAdd,WAA6B,YAAYC,KAAKD,UAAUE,aAAe,YAAYD,KAAKD,UAAUE"}
1
+ {"version":3,"file":"userAgent.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/utils/userAgent.ts"],"sourcesContent":["function isIE() {\n const ua = navigator.userAgent;\n\n const msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n const trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n const rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n const edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}\n\n// NOTE: change from const to let for the purposes of testing (the values get set in some tests)\n/* eslint-disable */\nlet __IS_ANDROID = typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent);\nlet __IS_IE = typeof navigator !== 'undefined' && isIE();\nlet __IS_IOS = typeof navigator !== 'undefined' && /iphone|ipod|ipad/i.test(navigator.userAgent);\nlet __IS_FIREFOX = typeof navigator !== 'undefined' && /(firefox)/i.test(navigator.userAgent);\nlet __IS_SAFARI = typeof navigator !== 'undefined' && /(safari)/i.test(navigator.userAgent) && !/(chrome)/i.test(navigator.userAgent);\n/* eslint-enable */\n\nexport default {\n __IS_ANDROID,\n __IS_IE,\n __IS_IOS,\n __IS_FIREFOX,\n __IS_SAFARI\n};\n"],"names":["__IS_IE","navigator","ua","userAgent","msie","indexOf","parseInt","substring","rv","edge","isIE","__IS_IOS","test","__IS_FIREFOX"],"mappings":"AA6BA,IAAIA,EAA+B,oBAAdC,WA7BrB,WACI,MAAMC,EAAKD,UAAUE,UAEfC,EAAOF,EAAGG,QAAQ,SACxB,GAAID,EAAO,EAEP,OAAOE,SAASJ,EAAGK,UAAUH,EAAO,EAAGF,EAAGG,QAAQ,IAAKD,IAAQ,IAInE,GADgBF,EAAGG,QAAQ,YACb,EAAG,CAEb,MAAMG,EAAKN,EAAGG,QAAQ,OACtB,OAAOC,SAASJ,EAAGK,UAAUC,EAAK,EAAGN,EAAGG,QAAQ,IAAKG,IAAM,GAC/D,CAEA,MAAMC,EAAOP,EAAGG,QAAQ,SACxB,OAAII,EAAO,GAEAH,SAASJ,EAAGK,UAAUE,EAAO,EAAGP,EAAGG,QAAQ,IAAKI,IAAQ,GAKvE,CAKkDC,GAMlD,IAAeR,EAAA,CAEXF,UACAW,SARgC,oBAAdV,WAA6B,oBAAoBW,KAAKX,UAAUE,WASlFU,aARoC,oBAAdZ,WAA6B,aAAaW,KAAKX,UAAUE"}
@@ -1,2 +1,2 @@
1
- const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",t="encryptedExpiryMonth",a="encryptedExpiryYear",d="encryptedSecurityCode",i="encryptedPassword",n="encryptedBankAccountNumber",o="encryptedBankLocationId",s="encryptedSecurityCode3digits",y="encryptedSecurityCode4digits",p="giftcard",u="5.5.1",m=["amex","mc","visa"],C=["ach",p],b=[r,c,t,a,d,i],x=[n,o],h=b.concat(x),D=["bcmc"],g="required",k="optional",B="hidden",l=g,v=k,A=B,E=g,M=k,N=B,S="data-cse",f="data-info",j="data-uid",I=["accel","pulse","star","nyce"],w={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},L={[r]:"cardNumber",[c]:"expiryDate",[d]:"securityCode",[t]:"expiryMonth",[a]:"expiryYear",[i]:"password",[n]:"bankAccountNumber",[o]:"bankLocationId",[s]:"securityCodeThreeDigits",[y]:"securityCodeFourDigits"},P=6e3;export{h as ALL_SECURED_FIELDS,I as BRAND_ICON_UI_EXCLUSION_LIST,w as BRAND_READABLE_NAME_MAP,b as CREDIT_CARD_SF_FIELDS,A as CVC_POLICY_HIDDEN,v as CVC_POLICY_OPTIONAL,l as CVC_POLICY_REQUIRED,S as DATA_ENCRYPTED_FIELD_ATTR,f as DATA_INFO,j as DATA_UID,N as DATE_POLICY_HIDDEN,M as DATE_POLICY_OPTIONAL,E as DATE_POLICY_REQUIRED,D as DEDICATED_CARD_COMPONENTS,m as DEFAULT_CARD_GROUP_TYPES,e as ENCRYPTED,n as ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,o as ENCRYPTED_BANK_LOCATION_FIELD,r as ENCRYPTED_CARD_NUMBER,c as ENCRYPTED_EXPIRY_DATE,t as ENCRYPTED_EXPIRY_MONTH,a as ENCRYPTED_EXPIRY_YEAR,i as ENCRYPTED_PWD_FIELD,d as ENCRYPTED_SECURITY_CODE,s as ENCRYPTED_SECURITY_CODE_3_DIGITS,y as ENCRYPTED_SECURITY_CODE_4_DIGITS,p as GIFT_CARD,B as HIDDEN,C as NON_CREDIT_CARD_TYPE_SECURED_FIELDS,k as OPTIONAL,x as OTHER_SF_FIELDS,g as REQUIRED,P as SF_CONFIG_TIMEOUT,L as SF_FIELDS_MAP,u as SF_VERSION};
1
+ const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",i="encryptedExpiryMonth",d="encryptedExpiryYear",t="encryptedSecurityCode",a="encryptedPassword",s="encryptedSecurityCode3digits",n="encryptedSecurityCode4digits",o="giftcard",y="5.5.2",p=["amex","mc","visa"],u=[o],C=[r,c,i,d,t,a],m=C,x=["bcmc"],b="required",D="optional",g="hidden",h=b,l=D,v=g,E=b,M=D,S=g,f="data-cse",j="data-info",B="data-uid",w=["accel","pulse","star","nyce"],A={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},N={[r]:"cardNumber",[c]:"expiryDate",[t]:"securityCode",[i]:"expiryMonth",[d]:"expiryYear",[a]:"password",[s]:"securityCodeThreeDigits",[n]:"securityCodeFourDigits"},P=6e3;export{m as ALL_SECURED_FIELDS,w as BRAND_ICON_UI_EXCLUSION_LIST,A as BRAND_READABLE_NAME_MAP,C as CREDIT_CARD_SF_FIELDS,v as CVC_POLICY_HIDDEN,l as CVC_POLICY_OPTIONAL,h as CVC_POLICY_REQUIRED,f as DATA_ENCRYPTED_FIELD_ATTR,j as DATA_INFO,B as DATA_UID,S as DATE_POLICY_HIDDEN,M as DATE_POLICY_OPTIONAL,E as DATE_POLICY_REQUIRED,x as DEDICATED_CARD_COMPONENTS,p as DEFAULT_CARD_GROUP_TYPES,e as ENCRYPTED,r as ENCRYPTED_CARD_NUMBER,c as ENCRYPTED_EXPIRY_DATE,i as ENCRYPTED_EXPIRY_MONTH,d as ENCRYPTED_EXPIRY_YEAR,a as ENCRYPTED_PWD_FIELD,t as ENCRYPTED_SECURITY_CODE,s as ENCRYPTED_SECURITY_CODE_3_DIGITS,n as ENCRYPTED_SECURITY_CODE_4_DIGITS,o as GIFT_CARD,g as HIDDEN,u as NON_CREDIT_CARD_TYPE_SECURED_FIELDS,D as OPTIONAL,b as REQUIRED,P as SF_CONFIG_TIMEOUT,N as SF_FIELDS_MAP,y as SF_VERSION};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\nexport const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = 'encryptedBankAccountNumber';\nexport const ENCRYPTED_BANK_LOCATION_FIELD = 'encryptedBankLocationId';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '5.5.1';\n\nexport const DEFAULT_CARD_GROUP_TYPES = ['amex', 'mc', 'visa'];\n\nexport const NON_CREDIT_CARD_TYPE_SECURED_FIELDS = ['ach', GIFT_CARD]; // Maybe, sometime in the future will include 'sepa' & 'sepadirectdebit'\n\n// Credit card (CardInput) related securedFields (based on the data-cse attribute)\nexport const CREDIT_CARD_SF_FIELDS = [\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_PWD_FIELD\n // ENCRYPTED_PIN_FIELD,// probably redundant - it was an alt. name for KCP's encryptedPassword. But maybe has a role to play if we ever encrypt ibans.\n];\n\nexport const OTHER_SF_FIELDS = [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD, ENCRYPTED_BANK_LOCATION_FIELD]; // ACH fields\n\n/** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard or ach) */\nexport const ALL_SECURED_FIELDS = CREDIT_CARD_SF_FIELDS.concat(OTHER_SF_FIELDS);\n\n// Card components created as: checkout.create({BRAND}) e.g. checkout.create('bcmc')\n// - which are dedicated to a single, core, brand e.g. 'bcmc' BUT which can in effect handle multiple brands e.g. \"bcmc\", \"maestro\", \"visa\"\nexport const DEDICATED_CARD_COMPONENTS = ['bcmc'];\n\nexport const REQUIRED = 'required';\nexport const OPTIONAL = 'optional';\nexport const HIDDEN = 'hidden';\n\nexport const CVC_POLICY_REQUIRED: CVCPolicyType = REQUIRED;\nexport const CVC_POLICY_OPTIONAL: CVCPolicyType = OPTIONAL;\nexport const CVC_POLICY_HIDDEN: CVCPolicyType = HIDDEN;\n\nexport const DATE_POLICY_REQUIRED: DatePolicyType = REQUIRED;\nexport const DATE_POLICY_OPTIONAL: DatePolicyType = OPTIONAL;\nexport const DATE_POLICY_HIDDEN: DatePolicyType = HIDDEN;\n\nexport const DATA_ENCRYPTED_FIELD_ATTR = 'data-cse';\nexport const DATA_INFO = 'data-info';\nexport const DATA_UID = 'data-uid';\n\nexport const BRAND_ICON_UI_EXCLUSION_LIST = ['accel', 'pulse', 'star', 'nyce'];\n\nexport const BRAND_READABLE_NAME_MAP = {\n visa: 'VISA',\n mc: 'MasterCard',\n amex: 'American Express',\n discover: 'Discover',\n cup: 'China Union Pay',\n jcb: 'JCB',\n diners: 'Diners Club',\n maestro: 'Maestro',\n bcmc: 'Bancontact card',\n bijcard: 'de Bijenkorf Card'\n};\n\nexport const SF_FIELDS_MAP = {\n [ENCRYPTED_CARD_NUMBER]: 'cardNumber', // ph\n [ENCRYPTED_EXPIRY_DATE]: 'expiryDate', // ph\n [ENCRYPTED_SECURITY_CODE]: 'securityCode',\n [ENCRYPTED_EXPIRY_MONTH]: 'expiryMonth', // ph\n [ENCRYPTED_EXPIRY_YEAR]: 'expiryYear', // ph\n //\n [ENCRYPTED_PWD_FIELD]: 'password',\n [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]: 'bankAccountNumber',\n [ENCRYPTED_BANK_LOCATION_FIELD]: 'bankLocationId',\n //\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: 'securityCodeThreeDigits', // ph\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: 'securityCodeFourDigits' // ph\n};\n\n/** time within which we expect to receive a \"configured\" message from a securedField iframe, once it has registered as having loaded */\nexport const SF_CONFIG_TIMEOUT = 6000;\n"],"names":["ENCRYPTED","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ENCRYPTED_BANK_LOCATION_FIELD","ENCRYPTED_SECURITY_CODE_3_DIGITS","ENCRYPTED_SECURITY_CODE_4_DIGITS","GIFT_CARD","SF_VERSION","DEFAULT_CARD_GROUP_TYPES","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","CREDIT_CARD_SF_FIELDS","OTHER_SF_FIELDS","ALL_SECURED_FIELDS","concat","DEDICATED_CARD_COMPONENTS","REQUIRED","OPTIONAL","HIDDEN","CVC_POLICY_REQUIRED","CVC_POLICY_OPTIONAL","CVC_POLICY_HIDDEN","DATE_POLICY_REQUIRED","DATE_POLICY_OPTIONAL","DATE_POLICY_HIDDEN","DATA_ENCRYPTED_FIELD_ATTR","DATA_INFO","DATA_UID","BRAND_ICON_UI_EXCLUSION_LIST","BRAND_READABLE_NAME_MAP","visa","mc","amex","discover","cup","jcb","diners","maestro","bcmc","bijcard","SF_FIELDS_MAP","SF_CONFIG_TIMEOUT"],"mappings":"AAEO,MAAMA,EAAY,YAEZC,EAAwB,sBACxBC,EAAwB,sBACxBC,EAAyB,uBACzBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAsB,oBAEtBC,EAAoC,6BACpCC,EAAgC,0BAEhCC,EAAmC,+BACnCC,EAAmC,+BAEnCC,EAAY,WAEZC,EAAa,QAEbC,EAA2B,CAAC,OAAQ,KAAM,QAE1CC,EAAsC,CAAC,MAAOH,GAG9CI,EAAwB,CACjCd,EACAC,EACAC,EACAC,EACAC,EACAC,GAISU,EAAkB,CAACT,EAAmCC,GAGtDS,EAAqBF,EAAsBG,OAAOF,GAIlDG,EAA4B,CAAC,QAE7BC,EAAW,WACXC,EAAW,WACXC,EAAS,SAETC,EAAqCH,EACrCI,EAAqCH,EACrCI,EAAmCH,EAEnCI,EAAuCN,EACvCO,EAAuCN,EACvCO,EAAqCN,EAErCO,EAA4B,WAC5BC,EAAY,YACZC,EAAW,WAEXC,EAA+B,CAAC,QAAS,QAAS,OAAQ,QAE1DC,EAA0B,CACnCC,KAAM,OACNC,GAAI,aACJC,KAAM,mBACNC,SAAU,WACVC,IAAK,kBACLC,IAAK,MACLC,OAAQ,cACRC,QAAS,UACTC,KAAM,kBACNC,QAAS,qBAGAC,EAAgB,CACzB3C,CAACA,GAAwB,aACzBC,CAACA,GAAwB,aACzBG,CAACA,GAA0B,eAC3BF,CAACA,GAAyB,cAC1BC,CAACA,GAAwB,aAEzBE,CAACA,GAAsB,WACvBC,CAACA,GAAoC,oBACrCC,CAACA,GAAgC,iBAEjCC,CAACA,GAAmC,0BACpCC,CAACA,GAAmC,0BAI3BmC,EAAoB"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '5.5.2';\n\nexport const DEFAULT_CARD_GROUP_TYPES = ['amex', 'mc', 'visa'];\n\nexport const NON_CREDIT_CARD_TYPE_SECURED_FIELDS = [GIFT_CARD]; // Maybe, sometime in the future will include 'sepa' & 'sepadirectdebit'\n\n// Credit card (CardInput) related securedFields (based on the data-cse attribute)\nexport const CREDIT_CARD_SF_FIELDS = [\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_PWD_FIELD\n // ENCRYPTED_PIN_FIELD,// probably redundant - it was an alt. name for KCP's encryptedPassword. But maybe has a role to play if we ever encrypt ibans.\n];\n\n/** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard) */\nexport const ALL_SECURED_FIELDS = CREDIT_CARD_SF_FIELDS;\n\n// Card components created as: checkout.create({BRAND}) e.g. checkout.create('bcmc')\n// - which are dedicated to a single, core, brand e.g. 'bcmc' BUT which can in effect handle multiple brands e.g. \"bcmc\", \"maestro\", \"visa\"\nexport const DEDICATED_CARD_COMPONENTS = ['bcmc'];\n\nexport const REQUIRED = 'required';\nexport const OPTIONAL = 'optional';\nexport const HIDDEN = 'hidden';\n\nexport const CVC_POLICY_REQUIRED: CVCPolicyType = REQUIRED;\nexport const CVC_POLICY_OPTIONAL: CVCPolicyType = OPTIONAL;\nexport const CVC_POLICY_HIDDEN: CVCPolicyType = HIDDEN;\n\nexport const DATE_POLICY_REQUIRED: DatePolicyType = REQUIRED;\nexport const DATE_POLICY_OPTIONAL: DatePolicyType = OPTIONAL;\nexport const DATE_POLICY_HIDDEN: DatePolicyType = HIDDEN;\n\nexport const DATA_ENCRYPTED_FIELD_ATTR = 'data-cse';\nexport const DATA_INFO = 'data-info';\nexport const DATA_UID = 'data-uid';\n\nexport const BRAND_ICON_UI_EXCLUSION_LIST = ['accel', 'pulse', 'star', 'nyce'];\n\nexport const BRAND_READABLE_NAME_MAP = {\n visa: 'VISA',\n mc: 'MasterCard',\n amex: 'American Express',\n discover: 'Discover',\n cup: 'China Union Pay',\n jcb: 'JCB',\n diners: 'Diners Club',\n maestro: 'Maestro',\n bcmc: 'Bancontact card',\n bijcard: 'de Bijenkorf Card'\n};\n\nexport const SF_FIELDS_MAP = {\n [ENCRYPTED_CARD_NUMBER]: 'cardNumber', // ph\n [ENCRYPTED_EXPIRY_DATE]: 'expiryDate', // ph\n [ENCRYPTED_SECURITY_CODE]: 'securityCode',\n [ENCRYPTED_EXPIRY_MONTH]: 'expiryMonth', // ph\n [ENCRYPTED_EXPIRY_YEAR]: 'expiryYear', // ph\n //\n [ENCRYPTED_PWD_FIELD]: 'password',\n //\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: 'securityCodeThreeDigits', // ph\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: 'securityCodeFourDigits' // ph\n};\n\n/** time within which we expect to receive a \"configured\" message from a securedField iframe, once it has registered as having loaded */\nexport const SF_CONFIG_TIMEOUT = 6000;\n"],"names":["ENCRYPTED","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_SECURITY_CODE_3_DIGITS","ENCRYPTED_SECURITY_CODE_4_DIGITS","GIFT_CARD","SF_VERSION","DEFAULT_CARD_GROUP_TYPES","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","CREDIT_CARD_SF_FIELDS","ALL_SECURED_FIELDS","DEDICATED_CARD_COMPONENTS","REQUIRED","OPTIONAL","HIDDEN","CVC_POLICY_REQUIRED","CVC_POLICY_OPTIONAL","CVC_POLICY_HIDDEN","DATE_POLICY_REQUIRED","DATE_POLICY_OPTIONAL","DATE_POLICY_HIDDEN","DATA_ENCRYPTED_FIELD_ATTR","DATA_INFO","DATA_UID","BRAND_ICON_UI_EXCLUSION_LIST","BRAND_READABLE_NAME_MAP","visa","mc","amex","discover","cup","jcb","diners","maestro","bcmc","bijcard","SF_FIELDS_MAP","SF_CONFIG_TIMEOUT"],"mappings":"AAEO,MAAMA,EAAY,YAEZC,EAAwB,sBACxBC,EAAwB,sBACxBC,EAAyB,uBACzBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAsB,oBAGtBC,EAAmC,+BACnCC,EAAmC,+BAEnCC,EAAY,WAEZC,EAAa,QAEbC,EAA2B,CAAC,OAAQ,KAAM,QAE1CC,EAAsC,CAACH,GAGvCI,EAAwB,CACjCZ,EACAC,EACAC,EACAC,EACAC,EACAC,GAKSQ,EAAqBD,EAIrBE,EAA4B,CAAC,QAE7BC,EAAW,WACXC,EAAW,WACXC,EAAS,SAETC,EAAqCH,EACrCI,EAAqCH,EACrCI,EAAmCH,EAEnCI,EAAuCN,EACvCO,EAAuCN,EACvCO,EAAqCN,EAErCO,EAA4B,WAC5BC,EAAY,YACZC,EAAW,WAEXC,EAA+B,CAAC,QAAS,QAAS,OAAQ,QAE1DC,EAA0B,CACnCC,KAAM,OACNC,GAAI,aACJC,KAAM,mBACNC,SAAU,WACVC,IAAK,kBACLC,IAAK,MACLC,OAAQ,cACRC,QAAS,UACTC,KAAM,kBACNC,QAAS,qBAGAC,EAAgB,CACzBvC,CAACA,GAAwB,aACzBC,CAACA,GAAwB,aACzBG,CAACA,GAA0B,eAC3BF,CAACA,GAAyB,cAC1BC,CAACA,GAAwB,aAEzBE,CAACA,GAAsB,WAEvBC,CAACA,GAAmC,0BACpCC,CAACA,GAAmC,0BAI3BiC,EAAoB"}
@@ -1,2 +1,2 @@
1
- import{SF_FIELDS_MAP as t,ENCRYPTED_SECURITY_CODE as e,ENCRYPTED_SECURITY_CODE_3_DIGITS as r,ENCRYPTED_SECURITY_CODE_4_DIGITS as s,GIFT_CARD as i}from"../../constants.js";function c(c,o,u){switch(c){case"ach":return{[o]:u[t[o]]??""};case i:return{[o]:u[t[o]]??""};default:return o===e?{[r]:u.securityCodeThreeDigits??"",[s]:u.securityCodeFourDigits??""}:{[o]:u[t[o]]??""}}}export{c as processPlaceholders};
1
+ import{SF_FIELDS_MAP as t,ENCRYPTED_SECURITY_CODE as r,ENCRYPTED_SECURITY_CODE_4_DIGITS as e,ENCRYPTED_SECURITY_CODE_3_DIGITS as i,GIFT_CARD as o}from"../../constants.js";function s(s,n,u){return s===o?{[n]:u[t[n]]??""}:n===r?{[i]:u.securityCodeThreeDigits??"",[e]:u.securityCodeFourDigits??""}:{[n]:u[t[n]]??""}}export{s as processPlaceholders};
2
2
  //# sourceMappingURL=processPlaceholders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"processPlaceholders.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.ts"],"sourcesContent":["import { SFPlaceholdersObject } from '../../types';\nimport { Placeholders } from '../../../SFP/types';\nimport {\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_SECURITY_CODE_3_DIGITS,\n ENCRYPTED_SECURITY_CODE_4_DIGITS,\n GIFT_CARD,\n SF_FIELDS_MAP\n} from '../../constants';\nimport { Placeholders as AchPlaceholders } from '../../../../../Ach/components/AchInput/types';\nimport { Placeholders as GiftcardPlaceholders } from '../../../../../Giftcard/components/types';\nimport { Placeholders as CardPlaceholders } from '../../../../../Card/components/CardInput/types';\n\n/**\n * Create placeholders with a value from merchant's configuration\n *\n * Based on txVariant & fieldType, maps the entries in the passed placeholders object to create a field specific placeholder object\n */\nexport function processPlaceholders(txVariant: string, fieldType: string, placeholders: Placeholders): SFPlaceholdersObject {\n switch (txVariant) {\n case 'ach':\n return { [fieldType]: (placeholders as AchPlaceholders)[SF_FIELDS_MAP[fieldType]] ?? '' };\n\n case GIFT_CARD:\n return { [fieldType]: (placeholders as GiftcardPlaceholders)[SF_FIELDS_MAP[fieldType]] ?? '' };\n\n default:\n switch (fieldType) {\n case ENCRYPTED_SECURITY_CODE:\n return {\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: (placeholders as CardPlaceholders).securityCodeThreeDigits ?? '',\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: (placeholders as CardPlaceholders).securityCodeFourDigits ?? ''\n };\n\n default:\n return { [fieldType]: (placeholders as CardPlaceholders)[SF_FIELDS_MAP[fieldType]] ?? '' };\n }\n }\n}\n"],"names":["processPlaceholders","txVariant","fieldType","placeholders","SF_FIELDS_MAP","GIFT_CARD","ENCRYPTED_SECURITY_CODE","ENCRYPTED_SECURITY_CODE_3_DIGITS","securityCodeThreeDigits","ENCRYPTED_SECURITY_CODE_4_DIGITS","securityCodeFourDigits"],"mappings":"2KAkBO,SAASA,EAAoBC,EAAmBC,EAAmBC,GACtE,OAAQF,GACJ,IAAK,MACD,MAAO,CAAEC,CAACA,GAAYC,EAAkCC,EAAcF,KAAe,IAEzF,KAAKG,EACD,MAAO,CAAEH,CAACA,GAAYC,EAAuCC,EAAcF,KAAe,IAE9F,QACI,OAAQA,IACCI,EACM,CACHC,CAACA,GAAmCJ,EAAmCK,yBAA2B,GAClGC,CAACA,GAAmCN,EAAmCO,wBAA0B,IAI9F,CAAER,CAACA,GAAYC,EAAmCC,EAAcF,KAAe,IAG1G"}
1
+ {"version":3,"file":"processPlaceholders.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.ts"],"sourcesContent":["import { SFPlaceholdersObject } from '../../types';\nimport { Placeholders } from '../../../SFP/types';\nimport {\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_SECURITY_CODE_3_DIGITS,\n ENCRYPTED_SECURITY_CODE_4_DIGITS,\n GIFT_CARD,\n SF_FIELDS_MAP\n} from '../../constants';\nimport { Placeholders as GiftcardPlaceholders } from '../../../../../Giftcard/components/types';\nimport { Placeholders as CardPlaceholders } from '../../../../../Card/components/CardInput/types';\n\n/**\n * Create placeholders with a value from merchant's configuration\n *\n * Based on txVariant & fieldType, maps the entries in the passed placeholders object to create a field specific placeholder object\n */\nexport function processPlaceholders(txVariant: string, fieldType: string, placeholders: Placeholders): SFPlaceholdersObject {\n switch (txVariant) {\n case GIFT_CARD:\n return { [fieldType]: (placeholders as GiftcardPlaceholders)[SF_FIELDS_MAP[fieldType]] ?? '' };\n\n default:\n switch (fieldType) {\n case ENCRYPTED_SECURITY_CODE:\n return {\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: (placeholders as CardPlaceholders).securityCodeThreeDigits ?? '',\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: (placeholders as CardPlaceholders).securityCodeFourDigits ?? ''\n };\n\n default:\n return { [fieldType]: (placeholders as CardPlaceholders)[SF_FIELDS_MAP[fieldType]] ?? '' };\n }\n }\n}\n"],"names":["processPlaceholders","txVariant","fieldType","placeholders","GIFT_CARD","SF_FIELDS_MAP","ENCRYPTED_SECURITY_CODE","ENCRYPTED_SECURITY_CODE_3_DIGITS","securityCodeThreeDigits","ENCRYPTED_SECURITY_CODE_4_DIGITS","securityCodeFourDigits"],"mappings":"2KAiBO,SAASA,EAAoBC,EAAmBC,EAAmBC,GACtE,OAAQF,IACCG,EACM,CAAEF,CAACA,GAAYC,EAAuCE,EAAcH,KAAe,IAGlFA,IACCI,EACM,CACHC,CAACA,GAAmCJ,EAAmCK,yBAA2B,GAClGC,CAACA,GAAmCN,EAAmCO,wBAA0B,IAI9F,CAAER,CAACA,GAAYC,EAAmCE,EAAcH,KAAe,GAG1G"}
@@ -1,2 +1,2 @@
1
- import{ENCRYPTED_SECURITY_CODE as t,GIFT_CARD as e,SF_FIELDS_MAP as c,ENCRYPTED_SECURITY_CODE_3_DIGITS as a,ENCRYPTED_SECURITY_CODE_4_DIGITS as s}from"../constants.js";var r=(r,d,i,o)=>{const n={...r},u={};switch(i){case"ach":case e:break;default:if(o===t)u[a]=d.get("creditCard.securityCode.contextualText.3digits"),u[s]=d.get("creditCard.securityCode.contextualText.4digits");else{const t=`creditCard.${c[o]}.contextualText`,e=d.get(t);e!==t&&(u[o]=e)}}return Object.keys(u).length&&(n.contextualTexts=u),n};export{r as default};
1
+ import{SF_FIELDS_MAP as t,ENCRYPTED_SECURITY_CODE as e,GIFT_CARD as c,ENCRYPTED_SECURITY_CODE_3_DIGITS as a,ENCRYPTED_SECURITY_CODE_4_DIGITS as s}from"../constants.js";var r=(r,d,i,o)=>{const n={...r},u={};switch(i){case"ach":case c:break;default:if(o===e)u[a]=d.get("creditCard.securityCode.contextualText.3digits"),u[s]=d.get("creditCard.securityCode.contextualText.4digits");else{const e=`creditCard.${t[o]}.contextualText`,c=d.get(e);c!==e&&(u[o]=c)}}return Object.keys(u).length&&(n.contextualTexts=u),n};export{r as default};
2
2
  //# sourceMappingURL=addContextTranslations.js.map
@@ -1,2 +1,2 @@
1
- import{useState as e,useEffect as t}from"../../../external/preact/hooks/dist/hooks.js";import{createElement as o}from"../../../external/preact/dist/preact.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";import s from"../FormFields/Checkbox/Checkbox.js";function a({storeDetails:a=!1,...c}){const{i18n:i}=r(),[n,l]=e(a);return t((()=>{c.onChange(n)}),[n]),o("div",{className:"adyen-checkout__store-details"},o(s,{onChange:e=>{l(e.target.checked)},label:i.get("storeDetails"),name:"storeDetails"}))}export{a as default};
1
+ import{useState as e,useEffect as t}from"../../../external/preact/hooks/dist/hooks.js";import{createElement as o}from"../../../external/preact/dist/preact.js";import{useCoreContext as s}from"../../../core/Context/CoreProvider.js";import r from"../FormFields/Checkbox/Checkbox.js";function a({storeDetails:a=!1,disabled:i=!1,...c}){const{i18n:n}=s(),[l,d]=e(a);return t((()=>{c.onChange(l)}),[l]),o("div",{className:"adyen-checkout__store-details"},o(r,{onChange:e=>{d(e.target.checked)},disabled:i,label:n.get("storeDetails"),name:"storeDetails"}))}export{a as default};
2
2
  //# sourceMappingURL=StoreDetails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StoreDetails.js","sources":["../../../../../src/components/internal/StoreDetails/StoreDetails.tsx"],"sourcesContent":["import { useState, useEffect } from 'preact/hooks';\nimport { h } from 'preact';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Checkbox from '../FormFields/Checkbox';\n\n/**\n * \"Store details\" generic checkbox\n */\nfunction StoreDetails({ storeDetails = false, ...props }) {\n const { i18n } = useCoreContext();\n const [value, setValue] = useState(storeDetails);\n\n const onChange = e => {\n setValue(e.target.checked);\n };\n\n useEffect(() => {\n props.onChange(value);\n }, [value]);\n\n return (\n <div className=\"adyen-checkout__store-details\">\n <Checkbox onChange={onChange} label={i18n.get('storeDetails')} name={'storeDetails'} />\n </div>\n );\n}\n\nexport default StoreDetails;\n"],"names":["StoreDetails","storeDetails","props","i18n","useCoreContext","value","setValue","useState","useEffect","onChange","h","div","className","Checkbox","e","target","checked","label","get","name"],"mappings":"wRAQA,SAASA,GAAaC,aAAEA,GAAe,KAAUC,IAC7C,MAAMC,KAAEA,GAASC,KACVC,EAAOC,GAAYC,EAASN,GAUnC,OAJAO,GAAU,KACNN,EAAMO,SAASJ,EAAAA,GAChB,CAACA,IAGAK,EAACC,MAAAA,CAAIC,UAAU,iCACXF,EAACG,EAAAA,CAASJ,SAVDK,IACbR,EAASQ,EAAEC,OAAOC,QAAO,EASSC,MAAOd,EAAKe,IAAI,gBAAiBC,KAAM,iBAGjF"}
1
+ {"version":3,"file":"StoreDetails.js","sources":["../../../../../src/components/internal/StoreDetails/StoreDetails.tsx"],"sourcesContent":["import { useState, useEffect } from 'preact/hooks';\nimport { h } from 'preact';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Checkbox from '../FormFields/Checkbox';\n\nimport './StoreDetails.scss';\n\ninterface StoreDetailsProps {\n storeDetails?: boolean;\n onChange: (value: boolean) => void;\n disabled?: boolean;\n}\n\n/**\n * \"Store details\" generic checkbox\n */\nfunction StoreDetails({ storeDetails = false, disabled = false, ...props }: StoreDetailsProps) {\n const { i18n } = useCoreContext();\n const [value, setValue] = useState(storeDetails);\n\n const onChange = e => {\n setValue(e.target.checked);\n };\n\n useEffect(() => {\n props.onChange(value);\n }, [value]);\n\n return (\n <div className=\"adyen-checkout__store-details\">\n <Checkbox onChange={onChange} disabled={disabled} label={i18n.get('storeDetails')} name={'storeDetails'} />\n </div>\n );\n}\n\nexport default StoreDetails;\n"],"names":["StoreDetails","storeDetails","disabled","props","i18n","useCoreContext","value","setValue","useState","useEffect","onChange","h","div","className","Checkbox","e","target","checked","label","get","name"],"mappings":"wRAgBA,SAASA,GAAaC,aAAEA,GAAe,EAAKC,SAAEA,GAAW,KAAUC,IAC/D,MAAMC,KAAEA,GAASC,KACVC,EAAOC,GAAYC,EAASP,GAUnC,OAJAQ,GAAU,KACNN,EAAMO,SAASJ,EAAAA,GAChB,CAACA,IAGAK,EAACC,MAAAA,CAAIC,UAAU,iCACXF,EAACG,EAAAA,CAASJ,SAVDK,IACbR,EAASQ,EAAEC,OAAOC,QAAO,EASSf,SAAUA,EAAUgB,MAAOd,EAAKe,IAAI,gBAAiBC,KAAM,iBAGrG"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../../external/preact/dist/preact.js";import e from"../BaseElement/BaseElement.js";import s from"../PayButton/PayButton.js";import{assertIsDropin as i,getRegulatoryDefaults as n,sanitizeResponse as o,verifyPaymentDidNotFail as r,cleanupFinalResult as a}from"./utils.js";import h,{NETWORK_ERROR as l}from"../../../core/Errors/AdyenCheckoutError.js";import{hasOwnProperty as d}from"../../../utils/hasOwnProperty.js";import{ANALYTICS_SUBMIT_STR as p,ANALYTICS_EVENT as c,ANALYTICS_ERROR_TYPE as m}from"../../../core/Analytics/constants.js";import u from"../../../core/Errors/CancelError.js";function y(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class f extends e{buildElementProps(t){const e={showPayButton:!0,...this.core.getCorePropsForComponent(),...!!t?.isStoredPaymentMethod?{}:this.core.paymentMethodsResponse.find(t?.type||this.constructor.type),...t},s=i(this);this.props=this.formatProps({...this.constructor.defaultProps,...n(this.core.options.countryCode,s),...e})}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}setElementStatus(t,e){return this.elementRef?.setStatus(t,e),this}setStatus(t,e){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,e),this}onChange(){this.props.onChange?.({data:this.data,isValid:this.isValid,errors:this.state.errors,valid:this.state.valid},this.elementRef)}setUpAnalytics(t){const e=this.props.session?.id;return this.props.modules.analytics.setUp({...t,...e&&{sessionId:e}})}submitAnalytics(t,e){try{this.props.modules.analytics.sendAnalytics(this.getComponent(t),t,e)}catch(t){console.warn("Failed to submit the analytics event. Error:",t)}}getComponent({component:t}){return t||(this.constructor.analyticsType?this.constructor.analyticsType:"scheme"===this.constructor.type||"bcmc"===this.constructor.type?this.constructor.type:this.type)}submit(){this.isValid?this.makePaymentsCall().then(o).then(r).then(this.handleResponse).catch((t=>{t instanceof u?this.setElementStatus("ready"):this.handleFailedResult(t)})):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session){return(this.props.beforeSubmit?new Promise(((t,e)=>this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:()=>e(new u("beforeSubmitRejected"))}))):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow)}this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){return new Promise(((t,e)=>{this.submitAnalytics({type:p}),this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:t,reject:e})}))}async submitUsingSessionsFlow(t){this.submitAnalytics({type:p});try{return await this.core.session.submitPayment(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /payments call",{cause:t})),Promise.reject(t)}}onComplete(t){this.props.onComplete&&this.props.onComplete(t,this.elementRef)}handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.props.onAdditionalDetails?new Promise(((e,s)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:e,reject:s})})):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /details call",{cause:t})),Promise.reject(t)}}handleAction(t,e={}){if(!t||!t.type){if(d(t,"action")&&d(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}const s=this.core.createFromAction(t,{...this.elementRef.props,...e,onAdditionalDetails:this.handleAdditionalDetails});return s?(this.unmount(),s.mount(this._node)):null}onActionHandled(t){this.props?.onActionHandled?.({originalAction:this.props.originalAction,...t})}handleResponse(t){t.action?this.elementRef.handleAction(t.action):t.order?.remainingAmount?.value>0?this.handleOrder(t):this.handleSuccessResult(t)}handleKeyPress(t){"Enter"!==t.key&&"Enter"!==t.code||(t.preventDefault(),this.onEnterKeyPressed(document?.activeElement,this))}onEnterKeyPressed(t,e){this.props.onEnterKeyPressed?this.props.onEnterKeyPressed(t,e):(t.blur(),this.submit())}updateParent(t={}){return this.elementRef.core.update(t)}get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find((t=>t.type===this.type));return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}async handleAdvanceFlowPaymentMethodsUpdate(t,e){return new Promise(((e,s)=>{if(!this.props.onPaymentMethodsRequest)return e();this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:e,reject:s})})).catch((t=>{this.handleError(new h("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:t}))})).then((s=>this.core.update({...s&&{paymentMethodsResponse:s},order:t,amount:t?t.remainingAmount:e})))}constructor(e,n){super(e,n),y(this,"componentRef",void 0),y(this,"resources",void 0),y(this,"elementRef",void 0),y(this,"handleError",(t=>{this.setElementStatus("ready"),t.name===l&&t.options.code&&this.submitAnalytics({type:c.error,errorType:m.apiError,code:t.options.code}),this.props.onError&&this.props.onError(t,this.elementRef)})),y(this,"handleOrder",(t=>{const{order:e}=t;(this.core.session?this.core.update({order:e}):this.handleAdvanceFlowPaymentMethodsUpdate(e)).then((()=>{this.props.onOrderUpdated?.({order:e})}))})),y(this,"handleFailedResult",(t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),a(t),this.props.onPaymentFailed?.(t,this.elementRef)})),y(this,"handleSuccessResult",(t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),a(t),this.props.onPaymentCompleted?.(t,this.elementRef)})),y(this,"setComponentRef",(t=>{this.componentRef=t})),y(this,"payButton",(e=>t(s,{...e,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,onClick:this.submit}))),this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.elementRef=n&&n.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props),this.onEnterKeyPressed=this.onEnterKeyPressed.bind(this),this.onActionHandled=this.onActionHandled.bind(this)}}y(f,"type",void 0),y(f,"txVariants",[]);export{f as UIElement,f as default};
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import e from"../BaseElement/BaseElement.js";import s from"../PayButton/PayButton.js";import{assertIsDropin as i,getRegulatoryDefaults as n,sanitizeResponse as o,verifyPaymentDidNotFail as r,cleanupFinalResult as a}from"./utils.js";import h,{NETWORK_ERROR as l}from"../../../core/Errors/AdyenCheckoutError.js";import{hasOwnProperty as d}from"../../../utils/hasOwnProperty.js";import{ANALYTICS_SUBMIT_STR as p,ANALYTICS_ERROR_TYPE as m,ANALYTICS_EVENT as c}from"../../../core/Analytics/constants.js";import u from"../../../core/Errors/CancelError.js";function y(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class R extends e{buildElementProps(t){const e={showPayButton:!0,...this.core.getCorePropsForComponent(),...!!t?.isStoredPaymentMethod?{}:this.getPaymentMethodFromPaymentMethodsResponse(t?.type),...t},s=i(this);this.props=this.formatProps({...this.constructor.defaultProps,...n(this.core.options.countryCode,s),...e})}getPaymentMethodFromPaymentMethodsResponse(t){return this.core.paymentMethodsResponse.find(t||this.constructor.type)}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}setElementStatus(t,e){return this.elementRef?.setStatus(t,e),this}setStatus(t,e){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,e),this}onChange(){this.props.onChange?.({data:this.data,isValid:this.isValid,errors:this.state.errors,valid:this.state.valid},this.elementRef)}setUpAnalytics(t){const e=this.props.session?.id;return this.props.modules.analytics.setUp({...t,...e&&{sessionId:e}})}submitAnalytics(t,e){try{this.props.modules.analytics.sendAnalytics(this.getComponent(t),t,e)}catch(t){console.warn("Failed to submit the analytics event. Error:",t)}}getComponent({component:t}){return t||(this.constructor.analyticsType?this.constructor.analyticsType:"scheme"===this.constructor.type||"bcmc"===this.constructor.type?this.constructor.type:this.type)}submit(){this.isValid?this.makePaymentsCall().then(o).then(r).then(this.handleResponse).catch((t=>{t instanceof u?this.setElementStatus("ready"):this.handleFailedResult(t)})):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session){return(this.props.beforeSubmit?new Promise(((t,e)=>this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:()=>e(new u("beforeSubmitRejected"))}))):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow)}this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){return new Promise(((t,e)=>{this.submitAnalytics({type:p}),this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:t,reject:e})}))}async submitUsingSessionsFlow(t){this.submitAnalytics({type:p});try{return await this.core.session.submitPayment(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /payments call",{cause:t})),Promise.reject(t)}}onComplete(t){this.props.onComplete&&this.props.onComplete(t,this.elementRef)}handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.props.onAdditionalDetails?new Promise(((e,s)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:e,reject:s})})):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /details call",{cause:t})),Promise.reject(t)}}handleAction(t,e={}){if(!t||!t.type){if(d(t,"action")&&d(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}const s=this.core.createFromAction(t,{...this.elementRef.props,...e,onAdditionalDetails:this.handleAdditionalDetails});return s?(this.unmount(),s.mount(this._node)):null}onActionHandled(t){this.props?.onActionHandled?.({originalAction:this.props.originalAction,...t})}handleResponse(t){t.action?this.elementRef.handleAction(t.action):t.order?.remainingAmount?.value>0?this.handleOrder(t):this.handleSuccessResult(t)}handleKeyPress(t){"Enter"!==t.key&&"Enter"!==t.code||(t.preventDefault(),this.onEnterKeyPressed(document?.activeElement,this))}onEnterKeyPressed(t,e){this.props.onEnterKeyPressed?this.props.onEnterKeyPressed(t,e):(t.blur(),this.submit())}updateParent(t={}){return this.elementRef.core.update(t)}get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find((t=>t.type===this.type));return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}async handleAdvanceFlowPaymentMethodsUpdate(t,e){return new Promise(((e,s)=>{if(!this.props.onPaymentMethodsRequest)return e();this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:e,reject:s})})).catch((t=>{this.handleError(new h("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:t}))})).then((s=>this.core.update({...s&&{paymentMethodsResponse:s},order:t,amount:t?t.remainingAmount:e})))}constructor(e,n){super(e,n),y(this,"componentRef",void 0),y(this,"resources",void 0),y(this,"elementRef",void 0),y(this,"handleError",(t=>{this.setElementStatus("ready"),t.name===l&&t.options.code&&this.submitAnalytics({type:c.error,errorType:m.apiError,code:t.options.code}),this.props.onError&&this.props.onError(t,this.elementRef)})),y(this,"handleOrder",(t=>{const{order:e}=t;(this.core.session?this.core.update({order:e}):this.handleAdvanceFlowPaymentMethodsUpdate(e)).then((()=>{this.props.onOrderUpdated?.({order:e})}))})),y(this,"handleFailedResult",(t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),a(t),this.props.onPaymentFailed?.(t,this.elementRef)})),y(this,"handleSuccessResult",(t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),a(t),this.props.onPaymentCompleted?.(t,this.elementRef)})),y(this,"setComponentRef",(t=>{this.componentRef=t})),y(this,"payButton",(e=>t(s,{...e,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,onClick:this.submit}))),this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.elementRef=n&&n.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props),this.onEnterKeyPressed=this.onEnterKeyPressed.bind(this),this.onActionHandled=this.onActionHandled.bind(this)}}y(R,"type",void 0),y(R,"txVariants",[]);export{R as UIElement,R as default};
2
2
  //# sourceMappingURL=UIElement.js.map