@adyen/adyen-web 6.46.0 → 6.47.0-alpha.41c41fe

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 (273) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.d.cts +63 -46
  4. package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
  5. package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
  6. package/dist/es/components/AmazonPay/components/AmazonPayButton.js +1 -1
  7. package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  8. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  9. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  10. package/dist/es/components/AmazonPay/components/OrderButton.js +1 -1
  11. package/dist/es/components/AmazonPay/components/OrderButton.js.map +1 -1
  12. package/dist/es/components/AmazonPay/components/SignOutButton.js +1 -1
  13. package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
  14. package/dist/es/components/AmazonPay/utils.js +1 -1
  15. package/dist/es/components/AmazonPay/utils.js.map +1 -1
  16. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  18. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  19. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  20. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  21. package/dist/es/components/CashAppPay/components/CashAppComponent.js +1 -1
  22. package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  23. package/dist/es/components/CashAppPay/services/CashAppService.js +1 -1
  24. package/dist/es/components/CashAppPay/services/CashAppService.js.map +1 -1
  25. package/dist/es/components/CashAppPay/services/types.js.map +1 -1
  26. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  27. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  28. package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js +1 -1
  29. package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
  30. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  31. package/dist/es/components/PayByBankPix/PayByBankPix.js +1 -1
  32. package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -1
  33. package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +1 -1
  34. package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -1
  35. package/dist/es/components/PayByBankUS/PayByBankUS.js +1 -1
  36. package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
  37. package/dist/es/components/PayPal/Paypal.js +1 -1
  38. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  39. package/dist/es/components/PayPal/utils/get-paypal-locale.js.map +1 -1
  40. package/dist/es/components/PayPal/utils/get-paypal-settings.js +1 -1
  41. package/dist/es/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  42. package/dist/es/components/PayPalFastlane/Fastlane.js +1 -1
  43. package/dist/es/components/PayPalFastlane/Fastlane.js.map +1 -1
  44. package/dist/es/components/PayPalFastlane/FastlaneSDK.js +1 -1
  45. package/dist/es/components/PayPalFastlane/FastlaneSDK.js.map +1 -1
  46. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  47. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  48. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  49. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  50. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  51. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  52. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  53. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  54. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  55. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
  56. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  57. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  58. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  59. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  60. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  61. package/dist/es/components/internal/Address/Address.js +1 -1
  62. package/dist/es/components/internal/Address/Address.js.map +1 -1
  63. package/dist/es/components/internal/Address/Specifications.js +1 -1
  64. package/dist/es/components/internal/Address/Specifications.js.map +1 -1
  65. package/dist/es/components/internal/Address/components/AddressSearch.js +1 -1
  66. package/dist/es/components/internal/Address/components/AddressSearch.js.map +1 -1
  67. package/dist/es/components/internal/Address/components/FieldContainer.js +1 -1
  68. package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
  69. package/dist/es/components/internal/Address/constants.js.map +1 -1
  70. package/dist/es/components/internal/Address/utils.js.map +1 -1
  71. package/dist/es/components/internal/Address/validate.formats.js +1 -1
  72. package/dist/es/components/internal/Address/validate.formats.js.map +1 -1
  73. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  74. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  75. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  76. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  77. package/dist/es/components/internal/CompanyDetails/validate.js +1 -1
  78. package/dist/es/components/internal/CompanyDetails/validate.js.map +1 -1
  79. package/dist/es/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
  80. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  81. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  82. package/dist/es/components/internal/FormFields/InputBase.js +1 -1
  83. package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
  84. package/dist/es/components/internal/FormFields/InputDate/InputDate.js +1 -1
  85. package/dist/es/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  86. package/dist/es/components/internal/FormFields/InputDate/utils.js.map +1 -1
  87. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  88. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  89. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  90. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  91. package/dist/es/components/internal/IbanInput/IbanInput.js +1 -1
  92. package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
  93. package/dist/es/components/internal/IbanInput/specifications.js.map +1 -1
  94. package/dist/es/components/internal/IbanInput/utils.js +1 -1
  95. package/dist/es/components/internal/IbanInput/utils.js.map +1 -1
  96. package/dist/es/components/internal/PayButton/utils.js.map +1 -1
  97. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  98. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  99. package/dist/es/components/internal/PersonalDetails/validate.js +1 -1
  100. package/dist/es/components/internal/PersonalDetails/validate.js.map +1 -1
  101. package/dist/es/components/internal/PhoneInput/PhoneInputFields.js +1 -1
  102. package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  103. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  104. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  105. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  106. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  107. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  108. package/dist/es/components/internal/UIElement/utils.js.map +1 -1
  109. package/dist/es/core/config.js +1 -1
  110. package/dist/es/core/config.js.map +1 -1
  111. package/dist/es/core/core.js +1 -1
  112. package/dist/es/core/core.js.map +1 -1
  113. package/dist/es/core/utils.js +1 -1
  114. package/dist/es/core/utils.js.map +1 -1
  115. package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
  116. package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
  117. package/dist/es/index.d.ts +63 -46
  118. package/dist/es/utils/Script.js.map +1 -1
  119. package/dist/es/utils/Validator/ValidationRuleResult.js.map +1 -1
  120. package/dist/es/utils/Validator/Validator.js +1 -1
  121. package/dist/es/utils/Validator/Validator.js.map +1 -1
  122. package/dist/es/utils/Validator/defaultRules.js +1 -1
  123. package/dist/es/utils/Validator/defaultRules.js.map +1 -1
  124. package/dist/es/utils/browserInfo.js.map +1 -1
  125. package/dist/es/utils/createSdkData.js.map +1 -1
  126. package/dist/es/utils/get-issuer-image.js +1 -1
  127. package/dist/es/utils/get-issuer-image.js.map +1 -1
  128. package/dist/es/utils/get-process-message-handler.js.map +1 -1
  129. package/dist/es/utils/getConsentUrl.js +1 -1
  130. package/dist/es/utils/getConsentUrl.js.map +1 -1
  131. package/dist/es/utils/getErrorMessage.js.map +1 -1
  132. package/dist/es/utils/getOrigin.js.map +1 -1
  133. package/dist/es/utils/isValidURL.js +1 -1
  134. package/dist/es/utils/isValidURL.js.map +1 -1
  135. package/dist/es/utils/promiseTimeout.js.map +1 -1
  136. package/dist/es/utils/useAutoFocus.js.map +1 -1
  137. package/dist/es/utils/validator-utils.js +1 -1
  138. package/dist/es/utils/validator-utils.js.map +1 -1
  139. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  140. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  141. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  142. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  143. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  144. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  145. package/dist/es-legacy/components/AmazonPay/components/OrderButton.js +1 -1
  146. package/dist/es-legacy/components/AmazonPay/components/OrderButton.js.map +1 -1
  147. package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js +1 -1
  148. package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js.map +1 -1
  149. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  150. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  151. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  152. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  153. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  154. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  155. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  156. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js +1 -1
  157. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  158. package/dist/es-legacy/components/CashAppPay/services/CashAppService.js +1 -1
  159. package/dist/es-legacy/components/CashAppPay/services/CashAppService.js.map +1 -1
  160. package/dist/es-legacy/components/CashAppPay/services/types.js.map +1 -1
  161. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  162. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  163. package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js +1 -1
  164. package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
  165. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  166. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  167. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  168. package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +1 -1
  169. package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -1
  170. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js +1 -1
  171. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
  172. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  173. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  174. package/dist/es-legacy/components/PayPal/utils/get-paypal-locale.js.map +1 -1
  175. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  176. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  177. package/dist/es-legacy/components/PayPalFastlane/Fastlane.js +1 -1
  178. package/dist/es-legacy/components/PayPalFastlane/Fastlane.js.map +1 -1
  179. package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.js +1 -1
  180. package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.js.map +1 -1
  181. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  182. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  183. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  184. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  185. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  186. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  187. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  188. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  189. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  190. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
  191. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  192. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  193. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  194. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  195. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  196. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  197. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  198. package/dist/es-legacy/components/internal/Address/Specifications.js +1 -1
  199. package/dist/es-legacy/components/internal/Address/Specifications.js.map +1 -1
  200. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js +1 -1
  201. package/dist/es-legacy/components/internal/Address/components/AddressSearch.js.map +1 -1
  202. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js +1 -1
  203. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
  204. package/dist/es-legacy/components/internal/Address/constants.js.map +1 -1
  205. package/dist/es-legacy/components/internal/Address/utils.js.map +1 -1
  206. package/dist/es-legacy/components/internal/Address/validate.formats.js +1 -1
  207. package/dist/es-legacy/components/internal/Address/validate.formats.js.map +1 -1
  208. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  209. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  210. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  211. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  212. package/dist/es-legacy/components/internal/CompanyDetails/validate.js +1 -1
  213. package/dist/es-legacy/components/internal/CompanyDetails/validate.js.map +1 -1
  214. package/dist/es-legacy/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.js.map +1 -1
  215. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  216. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  217. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  218. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  219. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  220. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  221. package/dist/es-legacy/components/internal/FormFields/InputDate/utils.js.map +1 -1
  222. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  223. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  224. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  225. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  226. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  227. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  228. package/dist/es-legacy/components/internal/IbanInput/specifications.js.map +1 -1
  229. package/dist/es-legacy/components/internal/IbanInput/utils.js +1 -1
  230. package/dist/es-legacy/components/internal/IbanInput/utils.js.map +1 -1
  231. package/dist/es-legacy/components/internal/PayButton/utils.js.map +1 -1
  232. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  233. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  234. package/dist/es-legacy/components/internal/PersonalDetails/validate.js +1 -1
  235. package/dist/es-legacy/components/internal/PersonalDetails/validate.js.map +1 -1
  236. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +1 -1
  237. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  238. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  239. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  240. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  241. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  242. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  243. package/dist/es-legacy/components/internal/UIElement/utils.js.map +1 -1
  244. package/dist/es-legacy/core/config.js +1 -1
  245. package/dist/es-legacy/core/config.js.map +1 -1
  246. package/dist/es-legacy/core/core.js +1 -1
  247. package/dist/es-legacy/core/core.js.map +1 -1
  248. package/dist/es-legacy/core/utils.js +1 -1
  249. package/dist/es-legacy/core/utils.js.map +1 -1
  250. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
  251. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
  252. package/dist/es-legacy/utils/Script.js.map +1 -1
  253. package/dist/es-legacy/utils/Validator/ValidationRuleResult.js.map +1 -1
  254. package/dist/es-legacy/utils/Validator/Validator.js +1 -1
  255. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  256. package/dist/es-legacy/utils/Validator/defaultRules.js +1 -1
  257. package/dist/es-legacy/utils/Validator/defaultRules.js.map +1 -1
  258. package/dist/es-legacy/utils/browserInfo.js.map +1 -1
  259. package/dist/es-legacy/utils/createSdkData.js.map +1 -1
  260. package/dist/es-legacy/utils/get-issuer-image.js +1 -1
  261. package/dist/es-legacy/utils/get-issuer-image.js.map +1 -1
  262. package/dist/es-legacy/utils/get-process-message-handler.js.map +1 -1
  263. package/dist/es-legacy/utils/getConsentUrl.js +1 -1
  264. package/dist/es-legacy/utils/getConsentUrl.js.map +1 -1
  265. package/dist/es-legacy/utils/getErrorMessage.js.map +1 -1
  266. package/dist/es-legacy/utils/getOrigin.js.map +1 -1
  267. package/dist/es-legacy/utils/isValidURL.js +1 -1
  268. package/dist/es-legacy/utils/isValidURL.js.map +1 -1
  269. package/dist/es-legacy/utils/promiseTimeout.js.map +1 -1
  270. package/dist/es-legacy/utils/useAutoFocus.js.map +1 -1
  271. package/dist/es-legacy/utils/validator-utils.js +1 -1
  272. package/dist/es-legacy/utils/validator-utils.js.map +1 -1
  273. package/package.json +3 -2
@@ -81,10 +81,10 @@ declare class Language {
81
81
  */
82
82
  declare class ValidationRuleResult {
83
83
  private readonly shouldValidate;
84
- isValid: boolean;
84
+ isValid: boolean | null;
85
85
  errorMessage: string | ErrorMessageObject | undefined;
86
86
  errorI18n: string;
87
- constructor(rule: ValidatorRule, value: string, mode: ValidatorMode, context: FieldContext, i18n: Language);
87
+ constructor(rule: ValidatorRule, value: string, mode: ValidatorMode, context: FieldContext | undefined, i18n: Language);
88
88
  /**
89
89
  * Whether the validation is considered an error.
90
90
  * A field is only considered to be an error if the validation rule applies to the current mode i.e. 'blur' or 'input'.
@@ -101,7 +101,7 @@ type ErrorMessageObject = {
101
101
  values: Record<string, string | null>;
102
102
  };
103
103
  };
104
- type ValidateFunction = (value: string, context: any) => boolean;
104
+ type ValidateFunction = (value: string, context: any) => boolean | null;
105
105
  interface ValidatorRule {
106
106
  validate: ValidateFunction;
107
107
  errorMessage?: string | ErrorMessageObject;
@@ -138,11 +138,11 @@ interface AddressProps {
138
138
  countryCode?: string;
139
139
  data?: AddressData | null;
140
140
  label?: string;
141
- onChange: (newState: any) => void;
141
+ onChange?: (newState: any) => void;
142
142
  onAddressLookup?: OnAddressLookupType;
143
143
  onAddressSelected?: OnAddressSelectedType;
144
144
  addressSearchDebounceMs?: number;
145
- requiredFields?: string[];
145
+ requiredFields?: readonly string[];
146
146
  specifications?: AddressSpecifications;
147
147
  validationRules?: ValidatorRules;
148
148
  visibility?: string;
@@ -256,7 +256,7 @@ declare class AdyenCheckoutError extends Error {
256
256
 
257
257
  type InstallmentPlan = 'revolving' | 'bonus' | 'regular';
258
258
  interface InstallmentOption {
259
- values: number[];
259
+ values?: number[];
260
260
  plans?: InstallmentPlan[];
261
261
  preselectedValue?: number;
262
262
  }
@@ -1446,7 +1446,7 @@ interface AmazonPayConfiguration extends UIElementProps {
1446
1446
  isExpress?: boolean;
1447
1447
  }
1448
1448
  type AmazonPayComponentRef = ComponentMethodsRef & {
1449
- getSubmitFunction?: () => () => void;
1449
+ getSubmitFunction?: () => (() => void) | null;
1450
1450
  };
1451
1451
  interface AmazonPayComponentProps extends AmazonPayConfiguration {
1452
1452
  showSignOutButton?: boolean;
@@ -1467,7 +1467,7 @@ interface AmazonPayButtonProps {
1467
1467
  design?: string;
1468
1468
  environment?: string;
1469
1469
  locale?: string;
1470
- onClick: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1470
+ onClick?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1471
1471
  onError?: (error: AdyenCheckoutError, component: UIElement) => void;
1472
1472
  placement?: Placement;
1473
1473
  productType?: ProductType;
@@ -1476,11 +1476,11 @@ interface AmazonPayButtonProps {
1476
1476
  initCheckout(): void;
1477
1477
  }>;
1478
1478
  returnUrl?: string;
1479
- showPayButton: boolean;
1479
+ showPayButton?: boolean;
1480
1480
  }
1481
1481
  interface SignOutButtonProps {
1482
1482
  amazonRef: AmazonWindowObject;
1483
- onSignOut: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1483
+ onSignOut?: (resolve: (value?: unknown) => void, reject: () => void) => Promise<void>;
1484
1484
  }
1485
1485
  interface ChangePaymentDetailsButtonProps {
1486
1486
  amazonCheckoutSessionId: string;
@@ -1492,31 +1492,31 @@ interface ChangeActionOptions {
1492
1492
  }
1493
1493
  interface OrderButtonProps {
1494
1494
  amazonCheckoutSessionId: string;
1495
- clientKey: string;
1495
+ clientKey?: string;
1496
1496
  chargePermissionType?: ChargePermissionType;
1497
- onError: (error: AdyenCheckoutError, component: UIElement) => void;
1498
- recurringMetadata: RecurringMetadata;
1497
+ onError?: (error: AdyenCheckoutError, component: UIElement) => void;
1498
+ recurringMetadata?: RecurringMetadata;
1499
1499
  ref: RefObject<{
1500
1500
  createOrder(): void;
1501
1501
  }>;
1502
- region: Region;
1503
- returnUrl: string;
1504
- publicKeyId: string;
1502
+ region?: Region;
1503
+ returnUrl?: string;
1504
+ publicKeyId?: string;
1505
1505
  }
1506
1506
  interface AmazonPayElementData {
1507
1507
  paymentMethod: {
1508
1508
  type: string;
1509
1509
  checkoutSessionId?: string;
1510
1510
  };
1511
- browserInfo: BrowserInfo;
1511
+ browserInfo: BrowserInfo | undefined;
1512
1512
  }
1513
1513
  interface AmazonPayButtonSettings {
1514
1514
  buttonColor?: ButtonColor;
1515
- design?: string;
1515
+ design?: string | null;
1516
1516
  /**
1517
1517
  * Amazon Pay merchant account identifier
1518
1518
  */
1519
- merchantId: string;
1519
+ merchantId?: string;
1520
1520
  /**
1521
1521
  * Sets button to Sandbox environment
1522
1522
  */
@@ -1524,11 +1524,11 @@ interface AmazonPayButtonSettings {
1524
1524
  /**
1525
1525
  * Product type selected for checkout
1526
1526
  */
1527
- productType: ProductType;
1527
+ productType?: ProductType;
1528
1528
  /**
1529
1529
  * Placement of the Amazon Pay button on your website
1530
1530
  */
1531
- placement: Placement;
1531
+ placement?: Placement;
1532
1532
  /**
1533
1533
  * Language used to render the button and text on Amazon Pay hosted pages. Please note that supported language(s) is dependent on the region that your Amazon Pay account was registered for
1534
1534
  */
@@ -1591,19 +1591,19 @@ interface CheckoutDetailsRequest {
1591
1591
  region?: Region;
1592
1592
  }
1593
1593
  interface UpdateAmazonCheckoutSessionRequest {
1594
- amount: PaymentAmount;
1594
+ amount?: PaymentAmount;
1595
1595
  chargePermissionType?: ChargePermissionType;
1596
1596
  checkoutCancelUrl?: string;
1597
- checkoutResultReturnUrl: string;
1597
+ checkoutResultReturnUrl?: string;
1598
1598
  checkoutSessionId: string;
1599
- publicKeyId: string;
1599
+ publicKeyId?: string;
1600
1600
  recurringMetadata?: RecurringMetadata;
1601
- region: Region;
1601
+ region?: Region;
1602
1602
  }
1603
1603
  interface CheckoutSessionConfig {
1604
1604
  payloadJSON: string;
1605
- signature: string;
1606
- publicKeyId: string;
1605
+ signature: string | null;
1606
+ publicKeyId?: string;
1607
1607
  }
1608
1608
  interface DeliverySpecifications {
1609
1609
  specialRestrictions?: string[];
@@ -2187,7 +2187,7 @@ type ClickToPayPaymentData = {
2187
2187
  type: string;
2188
2188
  };
2189
2189
  origin: string;
2190
- browserInfo: BrowserInfo;
2190
+ browserInfo: BrowserInfo | undefined;
2191
2191
  };
2192
2192
 
2193
2193
  declare enum ErrorEventCode {
@@ -2303,7 +2303,7 @@ interface ChallengeData {
2303
2303
  acsURL: string;
2304
2304
  cReqData: CReqData;
2305
2305
  iframeSizeArr: string[];
2306
- postMessageDomain: string;
2306
+ postMessageDomain: string | null;
2307
2307
  }
2308
2308
  interface ResultObject {
2309
2309
  threeDSCompInd?: ResultValue;
@@ -2336,7 +2336,7 @@ interface FingerPrintData {
2336
2336
  threeDSServerTransID: string;
2337
2337
  threeDSMethodURL: string;
2338
2338
  threeDSMethodNotificationURL: string;
2339
- postMessageDomain: string;
2339
+ postMessageDomain: string | null;
2340
2340
  }
2341
2341
  type ThreeDS2FingerprintResponse = {
2342
2342
  type: 'action' | 'completed';
@@ -3104,7 +3104,7 @@ declare class CashAppPay extends UIElement<CashAppPayConfiguration> {
3104
3104
  get isValid(): boolean;
3105
3105
  private readonly handleOnChangeStoreDetails;
3106
3106
  private readonly handleAuthorize;
3107
- protected componentToRender(): h.JSX.Element;
3107
+ protected componentToRender(): h.JSX.Element | null;
3108
3108
  }
3109
3109
 
3110
3110
  declare class ClickToPayElement extends UIElement<ClickToPayConfiguration> {
@@ -3671,7 +3671,7 @@ declare class GooglePay extends UIElement<GooglePayConfiguration> {
3671
3671
  * Use this method to prefetch a PaymentDataRequest configuration to improve loadPaymentData execution time on later user interaction. No value is returned.
3672
3672
  */
3673
3673
  prefetch: () => void;
3674
- get browserInfo(): BrowserInfo;
3674
+ get browserInfo(): BrowserInfo | undefined;
3675
3675
  get icon(): string;
3676
3676
  protected componentToRender(): h.JSX.Element;
3677
3677
  }
@@ -4095,10 +4095,12 @@ declare class CustomCard extends UIElement<CustomCardConfiguration> {
4095
4095
  protected componentToRender(): h.JSX.Element;
4096
4096
  }
4097
4097
 
4098
- interface IbanData {
4099
- ownerName?: string;
4100
- ibanNumber?: string;
4101
- countryCode?: string;
4098
+ type IbanData = Partial<IbanInputData>;
4099
+ /** Unlike `IbanData` (the external, optional prop shape), the component's own state always normalizes these to strings in the constructor. */
4100
+ interface IbanInputData {
4101
+ ownerName: string;
4102
+ ibanNumber: string;
4103
+ countryCode: string;
4102
4104
  }
4103
4105
 
4104
4106
  interface SepaElementData {
@@ -7158,6 +7160,10 @@ interface CoreConfiguration {
7158
7160
  risk?: RiskModuleOptions;
7159
7161
  donation?: DonationOptions;
7160
7162
  order?: Order;
7163
+ /**
7164
+ * Suppress warnings about configuration issues. ATM this just relates to warnings about multiple instances of checkout on the same page.
7165
+ */
7166
+ suppressConfigWarnings?: boolean;
7161
7167
  /**
7162
7168
  * Add @adyen/web metadata to the window object.
7163
7169
  * It helps to identify version number and bundle type in the merchant environment
@@ -7327,7 +7333,7 @@ declare abstract class BaseElement<P extends BaseElementProps, S extends BaseEle
7327
7333
  props: P;
7328
7334
  state: S;
7329
7335
  _component: ComponentChild | undefined;
7330
- protected _node: HTMLElement;
7336
+ protected _node: HTMLElement | null;
7331
7337
  protected static readonly defaultProps: {};
7332
7338
  constructor(checkout: ICore, props?: P);
7333
7339
  protected buildElementProps(componentProps?: P): void;
@@ -7341,8 +7347,13 @@ declare abstract class BaseElement<P extends BaseElementProps, S extends BaseEle
7341
7347
  * Returns the component data necessary for the /payments request
7342
7348
  */
7343
7349
  protected formatData(): PaymentData;
7344
- protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent): any;
7345
- protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>): any;
7350
+ protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent): void;
7351
+ protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>): void;
7352
+ /**
7353
+ * The node the element is currently mounted into.
7354
+ * Throws the same error as `mount()` when the element has not been mounted yet.
7355
+ */
7356
+ protected get mountedNode(): HTMLElement;
7346
7357
  protected setState(newState: S): void;
7347
7358
  /**
7348
7359
  * Returns the component payment data ready to submit to the Checkout API
@@ -7389,6 +7400,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7389
7400
  */
7390
7401
  protected componentRef: ComponentMethodsRef | undefined;
7391
7402
  protected resources: Resources;
7403
+ protected i18n: Language;
7392
7404
  /**
7393
7405
  * elementRef is a ref to the subclass that extends UIElement e.g. Card.tsx or Dropin.tsx
7394
7406
  */
@@ -7415,7 +7427,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7415
7427
  protected reportIntegrationFlavor(): void;
7416
7428
  get analytics(): IAnalytics;
7417
7429
  get srPanel(): SRPanel;
7418
- protected getPaymentMethodConfigFromResponse(componentProps: P): RawPaymentMethod;
7430
+ protected getPaymentMethodConfigFromResponse(componentProps?: P): RawPaymentMethod;
7419
7431
  protected buildElementProps(componentProps?: P): void;
7420
7432
  protected getStoredPaymentMethodDetails(storedPaymentMethodId: string): StoredPaymentMethod;
7421
7433
  /**
@@ -7452,7 +7464,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7452
7464
  protected submitAnalytics(event: AbstractAnalyticsEvent): void;
7453
7465
  submit(): void;
7454
7466
  executePaymentsCall(): void;
7455
- protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse>;
7467
+ protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse> | undefined;
7456
7468
  private submitUsingAdvancedFlow;
7457
7469
  private submitUsingSessionsFlow;
7458
7470
  protected onComplete(state: AdditionalDetailsData): void;
@@ -7462,7 +7474,9 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7462
7474
  private submitAdditionalDetailsUsingSessionsFlow;
7463
7475
  handleAction(action: PaymentAction, props?: {}): UIElement | null;
7464
7476
  protected onActionHandled(actionHandledObj: ActionHandledReturnObject): void;
7465
- protected handleOrder: (response: PaymentResponseData) => void;
7477
+ protected handleOrder: (response: PaymentResponseData & {
7478
+ order: Order;
7479
+ }) => void;
7466
7480
  protected setupSessionsDonation(): void;
7467
7481
  /**
7468
7482
  * Handles when the payment fails. The payment fails when:
@@ -7516,7 +7530,7 @@ declare abstract class UIElement<P extends UIElementProps = UIElementProps> exte
7516
7530
  /**
7517
7531
  * Used to display the second line of a payment method item
7518
7532
  */
7519
- get additionalInfo(): string;
7533
+ get additionalInfo(): string | null;
7520
7534
  /**
7521
7535
  * Return the type of an element
7522
7536
  */
@@ -8366,7 +8380,7 @@ declare class ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeConfiguration
8366
8380
  * (as defined in the 3DS2InMDFlow and passed in as a config prop).
8367
8381
  */
8368
8382
  onComplete(state: ChallengeResolveData): void;
8369
- protected componentToRender(): h.JSX.Element;
8383
+ protected componentToRender(): h.JSX.Element | null;
8370
8384
  }
8371
8385
 
8372
8386
  declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerprintConfiguration> {
@@ -8382,7 +8396,7 @@ declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerpr
8382
8396
  * Can be called directly from PrepareFingerprint (MDFlow) or after the call to /submitThreeDS2Fingerprint endpoint (native flow)
8383
8397
  */
8384
8398
  onComplete(state: FingerprintResolveData): void;
8385
- protected componentToRender(): h.JSX.Element;
8399
+ protected componentToRender(): h.JSX.Element | null;
8386
8400
  }
8387
8401
 
8388
8402
  declare class OnlineBankingFI extends IssuerListContainer {
@@ -8790,7 +8804,8 @@ declare class FastlaneSDK {
8790
8804
  /**
8791
8805
  * Creates the configuration for the Fastlane component
8792
8806
  *
8793
- * @param authResult
8807
+ * @param card - card from the authenticated shopper's Fastlane profile
8808
+ * @param email - email of the authenticated shopper
8794
8809
  * @private
8795
8810
  */
8796
8811
  private createFastlaneComponentConfiguration;
@@ -8825,6 +8840,7 @@ declare class Core implements ICore {
8825
8840
  static readonly metadata: {
8826
8841
  version: string;
8827
8842
  bundleType: string;
8843
+ numberOfInitialisedCheckouts: number;
8828
8844
  };
8829
8845
  static readonly registry: {
8830
8846
  componentsMap: Record<string, NewableComponent>;
@@ -8834,6 +8850,7 @@ declare class Core implements ICore {
8834
8850
  createComponentsMap(components: NewableComponent[]): {};
8835
8851
  };
8836
8852
  static setBundleType(type: string): void;
8853
+ static increaseInitialisationCount(): void;
8837
8854
  static register(...items: NewableComponent[]): void;
8838
8855
  /**
8839
8856
  * Used internally by the PaymentMethod components to auto-register themselves
@@ -1 +1 @@
1
- {"version":3,"file":"Script.js","sources":["../../../src/utils/Script.ts"],"sourcesContent":["import AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';\nimport { AnalyticsInfoEvent, InfoEventType } from '../core/Analytics/events/AnalyticsInfoEvent';\nimport type { IAnalytics } from '../core/Analytics/Analytics';\n\ninterface IScript {\n load(): Promise<void>;\n remove(): void;\n}\n\ninterface IScriptProps {\n src: string;\n component: string;\n analytics: IAnalytics;\n node?: string;\n attributes?: Partial<HTMLScriptElement>;\n dataAttributes?: Record<string, string | undefined>;\n}\n\n// Returns Base URL of the resource without any query parameters (e.g. merchant ID, token, etc). Used for Analytics\nfunction getBaseURL(src: string): string {\n const url = new URL(src);\n return url.origin + url.pathname;\n}\n\nclass Script implements IScript {\n private readonly src: string;\n private readonly component: string;\n private readonly node: string;\n private readonly attributes: Partial<HTMLScriptElement>;\n private readonly dataAttributes: Record<string, string | undefined>;\n private readonly analytics: IAnalytics;\n private readonly baseUrl: string;\n\n private script: HTMLScriptElement;\n private loadPromise: Promise<void> | null = null;\n private rejectLoadPromise: (reason?: unknown) => void | null = null;\n private resolveLoadScript: (() => void) | null = null;\n private rejectLoadScript: ((reason?: unknown) => void) | null = null;\n\n private readonly handleOnLoad = () => {\n this.script?.setAttribute('data-script-loaded', 'true');\n this.cleanupListeners();\n this.resolveLoadScript?.();\n };\n\n private readonly handleOnError = (errorEvent: ErrorEvent) => {\n this.cleanupListeners();\n const error = new AdyenCheckoutError(\n 'SCRIPT_ERROR',\n `Unable to load script ${this.src}.${errorEvent?.message && `Message: ${errorEvent.message}`}`,\n {\n cause: errorEvent?.error || errorEvent\n }\n );\n this.rejectLoadScript?.(error);\n };\n\n public static readonly RETRY_DELAY = 1000;\n public static readonly MAX_NUMBER_OF_RETRIES = 3;\n\n constructor({ src, component, node = 'body', attributes, dataAttributes, analytics }: IScriptProps) {\n this.src = src;\n this.component = component;\n this.node = node;\n this.attributes = attributes;\n this.dataAttributes = dataAttributes;\n this.analytics = analytics;\n this.baseUrl = getBaseURL(this.src);\n }\n\n public load = (): Promise<void> => {\n if (this.loadPromise !== null) {\n if (process.env.NODE_ENV === 'development') console.warn(`[Warning] script.load called more than once for ${this.src}`);\n return this.loadPromise;\n }\n\n this.loadPromise = new Promise((resolve, reject) => {\n this.rejectLoadPromise = reject;\n let attempts = 0;\n\n this.trackEvent(InfoEventType.sdkDownloadInitiated);\n\n const loadScriptWithRetry = async (): Promise<void> => {\n try {\n attempts++;\n await this.loadScript();\n this.trackEvent(InfoEventType.sdkDownloadCompleted);\n resolve();\n } catch (error: unknown) {\n if (this.loadPromise === null) {\n return;\n }\n\n this.trackEvent(InfoEventType.sdkDownloadFailed);\n\n this.removeScript();\n\n if (attempts < Script.MAX_NUMBER_OF_RETRIES) {\n setTimeout(() => void loadScriptWithRetry(), Script.RETRY_DELAY);\n } else {\n this.trackEvent(InfoEventType.sdkDownloadAborted);\n this.loadPromise = null;\n this.rejectLoadPromise = null;\n reject(error);\n }\n }\n };\n\n void loadScriptWithRetry();\n });\n\n return this.loadPromise;\n };\n\n public remove = () => {\n this.rejectLoadPromise?.(new AdyenCheckoutError('CANCEL', 'Script loading cancelled.'));\n this.removeScript();\n this.loadPromise = null;\n };\n\n private removeScript() {\n this.cleanupListeners();\n this.script?.parentNode?.removeChild(this.script);\n this.script = null;\n }\n\n private cleanupListeners() {\n if (!this.script) return;\n this.script.removeEventListener('load', this.handleOnLoad);\n this.script.removeEventListener('error', this.handleOnError);\n }\n\n private attachListeners() {\n if (!this.script) return;\n this.cleanupListeners();\n this.script.addEventListener('load', this.handleOnLoad);\n this.script.addEventListener('error', this.handleOnError);\n }\n\n private loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n const scriptContainer = document.querySelector(this.node);\n\n if (!scriptContainer) {\n reject(new AdyenCheckoutError('SCRIPT_ERROR', `Unable to find script container node: ${this.node}`));\n return;\n }\n\n this.resolveLoadScript = resolve;\n this.rejectLoadScript = reject;\n\n this.script = scriptContainer.querySelector(`script[src=\"${this.src}\"]`);\n\n // Script element exists in the browser and is already loaded\n if (this.script?.getAttribute('data-script-loaded')) {\n this.resolveLoadScript();\n return;\n }\n\n // Script element exists in the browser, but it is not loaded yet\n // Use-case: Multiple PayPal standalone components being loaded in different parts of the screen.\n if (this.script) {\n this.attachListeners();\n return;\n }\n\n // Script element doesn't exist in the browser, so we create it and append to the DOM tree\n this.script = document.createElement('script');\n\n Object.assign(this.script, this.attributes);\n Object.assign(this.script.dataset, this.dataAttributes);\n\n this.script.src = this.src;\n this.script.async = true;\n\n this.attachListeners();\n\n scriptContainer.appendChild(this.script);\n });\n }\n\n private trackEvent(eventType: InfoEventType) {\n const event = new AnalyticsInfoEvent({\n type: eventType,\n component: this.component,\n cdnUrl: this.baseUrl\n });\n this.analytics?.sendAnalytics(event);\n }\n}\n\nexport default Script;\n"],"names":["Script","removeScript","this","cleanupListeners","script","parentNode","removeChild","removeEventListener","handleOnLoad","handleOnError","attachListeners","addEventListener","loadScript","Promise","resolve","reject","scriptContainer","document","querySelector","node","resolveLoadScript","rejectLoadScript","src","getAttribute","createElement","Object","assign","attributes","dataset","dataAttributes","async","appendChild","AdyenCheckoutError","trackEvent","eventType","event","AnalyticsInfoEvent","type","component","cdnUrl","baseUrl","analytics","sendAnalytics","constructor","_define_property","loadPromise","rejectLoadPromise","setAttribute","errorEvent","error","message","cause","load","attempts","InfoEventType","sdkDownloadInitiated","loadScriptWithRetry","sdkDownloadCompleted","sdkDownloadFailed","MAX_NUMBER_OF_RETRIES","setTimeout","RETRY_DELAY","sdkDownloadAborted","remove","url","URL","origin","pathname","getBaseURL"],"mappings":"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"}
1
+ {"version":3,"file":"Script.js","sources":["../../../src/utils/Script.ts"],"sourcesContent":["import AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';\nimport { AnalyticsInfoEvent, InfoEventType } from '../core/Analytics/events/AnalyticsInfoEvent';\nimport type { IAnalytics } from '../core/Analytics/Analytics';\n\ninterface IScript {\n load(): Promise<void>;\n remove(): void;\n}\n\ninterface IScriptProps {\n src: string;\n component: string;\n analytics: IAnalytics;\n node?: string;\n attributes?: Partial<HTMLScriptElement>;\n dataAttributes?: Record<string, string | undefined>;\n}\n\n// Returns Base URL of the resource without any query parameters (e.g. merchant ID, token, etc). Used for Analytics\nfunction getBaseURL(src: string): string {\n const url = new URL(src);\n return url.origin + url.pathname;\n}\n\nclass Script implements IScript {\n private readonly src: string;\n private readonly component: string;\n private readonly node: string;\n private readonly attributes: Partial<HTMLScriptElement> | undefined;\n private readonly dataAttributes: Record<string, string | undefined> | undefined;\n private readonly analytics: IAnalytics;\n private readonly baseUrl: string;\n\n private script: HTMLScriptElement | null;\n private loadPromise: Promise<void> | null = null;\n private rejectLoadPromise: ((reason?: unknown) => void) | null = null;\n private resolveLoadScript: (() => void) | null = null;\n private rejectLoadScript: ((reason?: unknown) => void) | null = null;\n\n private readonly handleOnLoad = () => {\n this.script?.setAttribute('data-script-loaded', 'true');\n this.cleanupListeners();\n this.resolveLoadScript?.();\n };\n\n private readonly handleOnError = (errorEvent: ErrorEvent) => {\n this.cleanupListeners();\n const error = new AdyenCheckoutError(\n 'SCRIPT_ERROR',\n `Unable to load script ${this.src}.${errorEvent?.message && `Message: ${errorEvent.message}`}`,\n {\n cause: errorEvent?.error || errorEvent\n }\n );\n this.rejectLoadScript?.(error);\n };\n\n public static readonly RETRY_DELAY = 1000;\n public static readonly MAX_NUMBER_OF_RETRIES = 3;\n\n constructor({ src, component, node = 'body', attributes, dataAttributes, analytics }: IScriptProps) {\n this.src = src;\n this.component = component;\n this.node = node;\n this.attributes = attributes;\n this.dataAttributes = dataAttributes;\n this.analytics = analytics;\n this.baseUrl = getBaseURL(this.src);\n }\n\n public load = (): Promise<void> => {\n if (this.loadPromise !== null) {\n if (process.env.NODE_ENV === 'development') console.warn(`[Warning] script.load called more than once for ${this.src}`);\n return this.loadPromise;\n }\n\n this.loadPromise = new Promise((resolve, reject) => {\n this.rejectLoadPromise = reject;\n let attempts = 0;\n\n this.trackEvent(InfoEventType.sdkDownloadInitiated);\n\n const loadScriptWithRetry = async (): Promise<void> => {\n try {\n attempts++;\n await this.loadScript();\n this.trackEvent(InfoEventType.sdkDownloadCompleted);\n resolve();\n } catch (error: unknown) {\n if (this.loadPromise === null) {\n return;\n }\n\n this.trackEvent(InfoEventType.sdkDownloadFailed);\n\n this.removeScript();\n\n if (attempts < Script.MAX_NUMBER_OF_RETRIES) {\n setTimeout(() => void loadScriptWithRetry(), Script.RETRY_DELAY);\n } else {\n this.trackEvent(InfoEventType.sdkDownloadAborted);\n this.loadPromise = null;\n this.rejectLoadPromise = null;\n reject(error);\n }\n }\n };\n\n void loadScriptWithRetry();\n });\n\n return this.loadPromise;\n };\n\n public remove = () => {\n this.rejectLoadPromise?.(new AdyenCheckoutError('CANCEL', 'Script loading cancelled.'));\n this.removeScript();\n this.loadPromise = null;\n };\n\n private removeScript() {\n this.cleanupListeners();\n this.script?.parentNode?.removeChild(this.script);\n this.script = null;\n }\n\n private cleanupListeners() {\n if (!this.script) return;\n this.script.removeEventListener('load', this.handleOnLoad);\n this.script.removeEventListener('error', this.handleOnError);\n }\n\n private attachListeners() {\n if (!this.script) return;\n this.cleanupListeners();\n this.script.addEventListener('load', this.handleOnLoad);\n this.script.addEventListener('error', this.handleOnError);\n }\n\n private loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n const scriptContainer = document.querySelector(this.node);\n\n if (!scriptContainer) {\n reject(new AdyenCheckoutError('SCRIPT_ERROR', `Unable to find script container node: ${this.node}`));\n return;\n }\n\n this.resolveLoadScript = resolve;\n this.rejectLoadScript = reject;\n\n this.script = scriptContainer.querySelector(`script[src=\"${this.src}\"]`);\n\n // Script element exists in the browser and is already loaded\n if (this.script?.getAttribute('data-script-loaded')) {\n this.resolveLoadScript();\n return;\n }\n\n // Script element exists in the browser, but it is not loaded yet\n // Use-case: Multiple PayPal standalone components being loaded in different parts of the screen.\n if (this.script) {\n this.attachListeners();\n return;\n }\n\n // Script element doesn't exist in the browser, so we create it and append to the DOM tree\n this.script = document.createElement('script');\n\n Object.assign(this.script, this.attributes);\n Object.assign(this.script.dataset, this.dataAttributes);\n\n this.script.src = this.src;\n this.script.async = true;\n\n this.attachListeners();\n\n scriptContainer.appendChild(this.script);\n });\n }\n\n private trackEvent(eventType: InfoEventType) {\n const event = new AnalyticsInfoEvent({\n type: eventType,\n component: this.component,\n cdnUrl: this.baseUrl\n });\n this.analytics?.sendAnalytics(event);\n }\n}\n\nexport default Script;\n"],"names":["Script","removeScript","this","cleanupListeners","script","parentNode","removeChild","removeEventListener","handleOnLoad","handleOnError","attachListeners","addEventListener","loadScript","Promise","resolve","reject","scriptContainer","document","querySelector","node","resolveLoadScript","rejectLoadScript","src","getAttribute","createElement","Object","assign","attributes","dataset","dataAttributes","async","appendChild","AdyenCheckoutError","trackEvent","eventType","event","AnalyticsInfoEvent","type","component","cdnUrl","baseUrl","analytics","sendAnalytics","constructor","_define_property","loadPromise","rejectLoadPromise","setAttribute","errorEvent","error","message","cause","load","attempts","InfoEventType","sdkDownloadInitiated","loadScriptWithRetry","sdkDownloadCompleted","sdkDownloadFailed","MAX_NUMBER_OF_RETRIES","setTimeout","RETRY_DELAY","sdkDownloadAborted","remove","url","URL","origin","pathname","getBaseURL"],"mappings":"mRAwBA,MAAMA,EAgGMC,YAAAA,GACJC,KAAKC,mBACLD,KAAKE,QAAQC,YAAYC,YAAYJ,KAAKE,QAC1CF,KAAKE,OAAS,IAClB,CAEQD,gBAAAA,GACCD,KAAKE,SACVF,KAAKE,OAAOG,oBAAoB,OAAQL,KAAKM,cAC7CN,KAAKE,OAAOG,oBAAoB,QAASL,KAAKO,eAClD,CAEQC,eAAAA,GACCR,KAAKE,SACVF,KAAKC,mBACLD,KAAKE,OAAOO,iBAAiB,OAAQT,KAAKM,cAC1CN,KAAKE,OAAOO,iBAAiB,QAAST,KAAKO,eAC/C,CAEQG,UAAAA,GACJ,OAAO,IAAIC,QAAQ,CAACC,EAASC,KACzB,MAAMC,EAAkBC,SAASC,cAAchB,KAAKiB,MAE/CH,GAKLd,KAAKkB,kBAAoBN,EACzBZ,KAAKmB,iBAAmBN,EAExBb,KAAKE,OAASY,EAAgBE,cAAc,eAAehB,KAAKoB,SAG5DpB,KAAKE,QAAQmB,aAAa,sBAC1BrB,KAAKkB,oBAMLlB,KAAKE,OACLF,KAAKQ,mBAKTR,KAAKE,OAASa,SAASO,cAAc,UAErCC,OAAOC,OAAOxB,KAAKE,OAAQF,KAAKyB,YAChCF,OAAOC,OAAOxB,KAAKE,OAAOwB,QAAS1B,KAAK2B,gBAExC3B,KAAKE,OAAOkB,IAAMpB,KAAKoB,IACvBpB,KAAKE,OAAO0B,OAAQ,EAEpB5B,KAAKQ,kBAELM,EAAgBe,YAAY7B,KAAKE,UAjC7BW,EAAO,IAAIiB,EAAmB,eAAgB,yCAAyC9B,KAAKiB,UAmCxG,CAEQc,UAAAA,CAAWC,GACf,MAAMC,EAAQ,IAAIC,EAAmB,CACjCC,KAAMH,EACNI,UAAWpC,KAAKoC,UAChBC,OAAQrC,KAAKsC,UAEjBtC,KAAKuC,WAAWC,cAAcP,EAClC,CAhIA,WAAAQ,EAAYrB,IAAEA,EAAGgB,UAAEA,EAASnB,KAAEA,EAAO,OAAMQ,WAAEA,EAAUE,eAAEA,EAAcY,UAAEA,IAnCzEG,EAAA1C,KAAiBoB,cACjBsB,EAAA1C,KAAiBoC,oBACjBM,EAAA1C,KAAiBiB,eACjByB,EAAA1C,KAAiByB,qBACjBiB,EAAA1C,KAAiB2B,yBACjBe,EAAA1C,KAAiBuC,oBACjBG,EAAA1C,KAAiBsC,kBAEjBI,EAAA1C,KAAQE,iBACRwC,EAAA1C,KAAQ2C,cAAoC,MAC5CD,EAAA1C,KAAQ4C,oBAAyD,MACjEF,EAAA1C,KAAQkB,oBAAyC,MACjDwB,EAAA1C,KAAQmB,mBAAwD,MAEhEuB,EAAA1C,KAAiBM,eAAe,KAC5BN,KAAKE,QAAQ2C,aAAa,qBAAsB,QAChD7C,KAAKC,mBACLD,KAAKkB,wBAGTwB,EAAA1C,KAAiBO,gBAAiBuC,IAC9B9C,KAAKC,mBACL,MAAM8C,EAAQ,IAAIjB,EACd,eACA,yBAAyB9B,KAAKoB,OAAO0B,GAAYE,SAAW,YAAYF,EAAWE,YACnF,CACIC,MAAOH,GAAYC,OAASD,IAGpC9C,KAAKmB,mBAAmB4B,KAgB5BL,EAAA1C,KAAOkD,OAAO,KACe,OAArBlD,KAAK2C,cAKT3C,KAAK2C,YAAc,IAAIhC,QAAQ,CAACC,EAASC,KACrCb,KAAK4C,kBAAoB/B,EACzB,IAAIsC,EAAW,EAEfnD,KAAK+B,WAAWqB,EAAcC,sBAE9B,MAAMC,EAAsB1B,UACxB,IACIuB,UACMnD,KAAKU,aACXV,KAAK+B,WAAWqB,EAAcG,sBAC9B3C,GACJ,CAAE,MAAOmC,GACL,GAAyB,OAArB/C,KAAK2C,YACL,OAGJ3C,KAAK+B,WAAWqB,EAAcI,mBAE9BxD,KAAKD,eAEDoD,EAAWrD,EAAO2D,sBAClBC,WAAW,KAAWJ,KAAuBxD,EAAO6D,cAEpD3D,KAAK+B,WAAWqB,EAAcQ,oBAC9B5D,KAAK2C,YAAc,KACnB3C,KAAK4C,kBAAoB,KACzB/B,EAAOkC,GAEf,GAGCO,OAnCEtD,KAAK2C,cAyCpBD,EAAA1C,KAAO6D,SAAS,KACZ7D,KAAK4C,oBAAoB,IAAId,EAAmB,SAAU,8BAC1D9B,KAAKD,eACLC,KAAK2C,YAAc,OAxDnB3C,KAAKoB,IAAMA,EACXpB,KAAKoC,UAAYA,EACjBpC,KAAKiB,KAAOA,EACZjB,KAAKyB,WAAaA,EAClBzB,KAAK2B,eAAiBA,EACtB3B,KAAKuC,UAAYA,EACjBvC,KAAKsC,QAhDb,SAAoBlB,GAChB,MAAM0C,EAAM,IAAIC,IAAI3C,GACpB,OAAO0C,EAAIE,OAASF,EAAIG,QAC5B,CA6CuBC,CAAWlE,KAAKoB,IACnC,EAXAsB,EAjCE5C,EAiCqB6D,cAAc,KACrCjB,EAlCE5C,EAkCqB2D,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationRuleResult.js","sources":["../../../../src/utils/Validator/ValidationRuleResult.ts"],"sourcesContent":["import { ErrorMessageObject, ValidatorRule, ValidatorMode, FieldContext } from './types';\nimport Language from '../../language';\n\n/**\n * Holds the result of a validation\n */\nexport class ValidationRuleResult {\n private readonly shouldValidate: boolean;\n public isValid: boolean;\n public errorMessage: string | ErrorMessageObject | undefined;\n public errorI18n: string;\n\n constructor(rule: ValidatorRule, value: string, mode: ValidatorMode, context: FieldContext, i18n: Language) {\n this.shouldValidate = rule.modes.includes(mode);\n this.isValid = rule.validate(value, context);\n this.errorMessage = rule.errorMessage;\n\n if (typeof rule.errorMessage === 'string') {\n this.errorI18n = i18n.get(rule.errorMessage);\n } else if (rule.errorMessage) {\n this.errorI18n = i18n.get(rule.errorMessage.translationKey, rule.errorMessage.translationObject);\n }\n }\n\n /**\n * Whether the validation is considered an error.\n * A field is only considered to be an error if the validation rule applies to the current mode i.e. 'blur' or 'input'.\n * Also, if a validation function returns a null value e.g. when the field is empty, then the field will not be considered to be in error\n * unless the whole form is being validated\n */\n hasError(isValidatingForm = false): boolean {\n return isValidatingForm ? !this.isValid && this.shouldValidate : this.isValid != null && !this.isValid && this.shouldValidate;\n }\n}\n"],"names":["ValidationRuleResult","hasError","isValidatingForm","this","isValid","shouldValidate","constructor","rule","value","mode","context","i18n","_define_property","errorMessage","errorI18n","modes","includes","validate","get","translationKey","translationObject"],"mappings":"wHAMO,MAAMA,EAwBTC,QAAAA,CAASC,GAAmB,GACxB,OAAOA,GAAoBC,KAAKC,SAAWD,KAAKE,eAAiC,MAAhBF,KAAKC,UAAoBD,KAAKC,SAAWD,KAAKE,cACnH,CApBA,WAAAC,CAAYC,EAAqBC,EAAeC,EAAqBC,EAAuBC,GAL5FC,EAAAT,KAAiBE,yBACjBO,EAAAT,KAAOC,kBACPQ,EAAAT,KAAOU,uBACPD,EAAAT,KAAOW,oBAGHX,KAAKE,eAAiBE,EAAKQ,MAAMC,SAASP,GAC1CN,KAAKC,QAAUG,EAAKU,SAAST,EAAOE,GACpCP,KAAKU,aAAeN,EAAKM,aAEQ,iBAAtBN,EAAKM,aACZV,KAAKW,UAAYH,EAAKO,IAAIX,EAAKM,cACxBN,EAAKM,eACZV,KAAKW,UAAYH,EAAKO,IAAIX,EAAKM,aAAaM,eAAgBZ,EAAKM,aAAaO,mBAEtF"}
1
+ {"version":3,"file":"ValidationRuleResult.js","sources":["../../../../src/utils/Validator/ValidationRuleResult.ts"],"sourcesContent":["import { ErrorMessageObject, ValidatorRule, ValidatorMode, FieldContext } from './types';\nimport Language from '../../language';\n\n/**\n * Holds the result of a validation\n */\nexport class ValidationRuleResult {\n private readonly shouldValidate: boolean;\n public isValid: boolean | null;\n public errorMessage: string | ErrorMessageObject | undefined;\n public errorI18n: string;\n\n constructor(rule: ValidatorRule, value: string, mode: ValidatorMode, context: FieldContext | undefined, i18n: Language) {\n this.shouldValidate = rule.modes.includes(mode);\n this.isValid = rule.validate(value, context);\n this.errorMessage = rule.errorMessage;\n\n if (typeof rule.errorMessage === 'string') {\n this.errorI18n = i18n.get(rule.errorMessage);\n } else if (rule.errorMessage) {\n this.errorI18n = i18n.get(rule.errorMessage.translationKey, rule.errorMessage.translationObject);\n }\n }\n\n /**\n * Whether the validation is considered an error.\n * A field is only considered to be an error if the validation rule applies to the current mode i.e. 'blur' or 'input'.\n * Also, if a validation function returns a null value e.g. when the field is empty, then the field will not be considered to be in error\n * unless the whole form is being validated\n */\n hasError(isValidatingForm = false): boolean {\n return isValidatingForm ? !this.isValid && this.shouldValidate : this.isValid != null && !this.isValid && this.shouldValidate;\n }\n}\n"],"names":["ValidationRuleResult","hasError","isValidatingForm","this","isValid","shouldValidate","constructor","rule","value","mode","context","i18n","_define_property","errorMessage","errorI18n","modes","includes","validate","get","translationKey","translationObject"],"mappings":"wHAMO,MAAMA,EAwBTC,QAAAA,CAASC,GAAmB,GACxB,OAAOA,GAAoBC,KAAKC,SAAWD,KAAKE,eAAiC,MAAhBF,KAAKC,UAAoBD,KAAKC,SAAWD,KAAKE,cACnH,CApBA,WAAAC,CAAYC,EAAqBC,EAAeC,EAAqBC,EAAmCC,GALxGC,EAAAT,KAAiBE,yBACjBO,EAAAT,KAAOC,kBACPQ,EAAAT,KAAOU,uBACPD,EAAAT,KAAOW,oBAGHX,KAAKE,eAAiBE,EAAKQ,MAAMC,SAASP,GAC1CN,KAAKC,QAAUG,EAAKU,SAAST,EAAOE,GACpCP,KAAKU,aAAeN,EAAKM,aAEQ,iBAAtBN,EAAKM,aACZV,KAAKW,UAAYH,EAAKO,IAAIX,EAAKM,cACxBN,EAAKM,eACZV,KAAKW,UAAYH,EAAKO,IAAIX,EAAKM,aAAaM,eAAgBZ,EAAKM,aAAaO,mBAEtF"}
@@ -1,2 +1,2 @@
1
- import{ValidationRuleResult as t}from"./ValidationRuleResult.js";function r(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}class e{get isValid(){return this.validationResults.reduce((t,r)=>t&&r.isValid,!0)}hasError(t=!1){return Boolean(this.getError(t))}getError(t=!1){return this.validationResults.find(r=>r.hasError(t))??null}getAllErrors(){return this.validationResults.filter(t=>t.hasError())}constructor(t){r(this,"validationResults",void 0),this.validationResults=t}}class s{setRules(t){this.rules={...this.rules,...t}}getRulesFor(t){let r=this.rules[t]??this.rules.default;return Array.isArray(r)||(r=[r]),r}validate({key:r,value:s,mode:i="blur"},l){const u=this.getRulesFor(r).map(r=>new t(r,s,i,l,this.i18n));return new e(u)}constructor(t,e){r(this,"rules",{default:{validate:()=>!0,modes:["blur","input"]}}),r(this,"i18n",void 0),this.setRules(t),this.i18n=e}}export{e as ValidationResult,s as default};
1
+ import{ValidationRuleResult as t}from"./ValidationRuleResult.js";function r(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}class e{get isValid(){return this.validationResults.every(t=>!!t.isValid)}hasError(t=!1){return Boolean(this.getError(t))}getError(t=!1){return this.validationResults.find(r=>r.hasError(t))??null}getAllErrors(){return this.validationResults.filter(t=>t.hasError())}constructor(t){r(this,"validationResults",void 0),this.validationResults=t}}class s{setRules(t){this.rules={...this.rules,...t}}getRulesFor(t){let r=this.rules[t]??this.rules.default;return Array.isArray(r)||(r=[r]),r}validate({key:r,value:s,mode:i="blur"},l){const u=this.getRulesFor(r).map(r=>new t(r,s,i,l,this.i18n));return new e(u)}constructor(t,e){r(this,"rules",{default:{validate:()=>!0,modes:["blur","input"]}}),r(this,"i18n",void 0),this.setRules(t),this.i18n=e}}export{e as ValidationResult,s as default};
2
2
  //# sourceMappingURL=Validator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Validator.js","sources":["../../../../src/utils/Validator/Validator.ts"],"sourcesContent":["import { ValidatorRules, ValidatorRule, FieldContext, FieldData } from './types';\nimport { ValidationRuleResult } from './ValidationRuleResult';\nimport type Language from '../../language';\n\nexport class ValidationResult {\n private readonly validationResults: ValidationRuleResult[];\n\n constructor(results: ValidationRuleResult[]) {\n this.validationResults = results;\n }\n\n /** Checks if all validation rules have passed */\n get isValid(): boolean {\n return this.validationResults.reduce((acc, result) => acc && result.isValid, true);\n }\n\n /** Checks if any validation rule returned an error */\n hasError(isValidatingForm = false): boolean {\n return Boolean(this.getError(isValidatingForm));\n }\n\n /** Returns the first validation result that returned an error */\n getError(isValidatingForm = false): ValidationRuleResult | null {\n return this.validationResults.find(result => result.hasError(isValidatingForm)) ?? null;\n }\n\n /** Returns all validation results that returned an error */\n getAllErrors() {\n return this.validationResults.filter(result => result.hasError());\n }\n}\n\nclass Validator {\n public rules: ValidatorRules = {\n default: {\n validate: () => true,\n modes: ['blur', 'input']\n }\n };\n\n private readonly i18n: Language;\n\n constructor(rules: ValidatorRules, i18n: Language) {\n this.setRules(rules);\n this.i18n = i18n;\n }\n\n setRules(newRules: ValidatorRules) {\n this.rules = {\n ...this.rules,\n ...newRules\n };\n }\n\n /**\n * Get all validation rules for a field\n */\n private getRulesFor(field: string): ValidatorRule[] {\n let fieldRules: ValidatorRule | ValidatorRule[] = this.rules[field] ?? this.rules['default'];\n\n if (!Array.isArray(fieldRules)) {\n fieldRules = [fieldRules];\n }\n\n return fieldRules;\n }\n\n /**\n * Validates a field\n */\n validate({ key, value, mode = 'blur' }: FieldData, context?: FieldContext) {\n const fieldRules = this.getRulesFor(key);\n // create an ValidationRuleResult, we run the actual validation inside of it\n // validate is called in the constructor of ValidationRuleResult\n // line rule.validate(value, context);\n //\n const validationRulesResult = fieldRules.map(rule => new ValidationRuleResult(rule, value, mode, context, this.i18n));\n\n return new ValidationResult(validationRulesResult);\n }\n}\n\nexport default Validator;\n"],"names":["ValidationResult","isValid","this","validationResults","reduce","acc","result","hasError","isValidatingForm","Boolean","getError","find","getAllErrors","filter","constructor","results","_define_property","Validator","setRules","newRules","rules","getRulesFor","field","fieldRules","Array","isArray","validate","key","value","mode","context","validationRulesResult","map","rule","ValidationRuleResult","i18n","default","modes"],"mappings":"yLAIO,MAAMA,EAQT,WAAIC,GACA,OAAOC,KAAKC,kBAAkBC,OAAO,CAACC,EAAKC,IAAWD,GAAOC,EAAOL,SAAS,EACjF,CAGAM,QAAAA,CAASC,GAAmB,GACxB,OAAOC,QAAQP,KAAKQ,SAASF,GACjC,CAGAE,QAAAA,CAASF,GAAmB,GACxB,OAAON,KAAKC,kBAAkBQ,KAAKL,GAAUA,EAAOC,SAASC,KAAsB,IACvF,CAGAI,YAAAA,GACI,OAAOV,KAAKC,kBAAkBU,OAAOP,GAAUA,EAAOC,WAC1D,CAtBA,WAAAO,CAAYC,GAFZC,EAAAd,KAAiBC,4BAGbD,KAAKC,kBAAoBY,CAC7B,EAuBJ,MAAME,EAeFC,QAAAA,CAASC,GACLjB,KAAKkB,MAAQ,IACNlB,KAAKkB,SACLD,EAEX,CAKQE,WAAAA,CAAYC,GAChB,IAAIC,EAA8CrB,KAAKkB,MAAME,IAAUpB,KAAKkB,MAAM,QAMlF,OAJKI,MAAMC,QAAQF,KACfA,EAAa,CAACA,IAGXA,CACX,CAKAG,QAAAA,EAASC,IAAEA,EAAGC,MAAEA,EAAKC,KAAEA,EAAO,QAAqBC,GAC/C,MAKMC,EALa7B,KAAKmB,YAAYM,GAKKK,IAAIC,GAAQ,IAAIC,EAAqBD,EAAML,EAAOC,EAAMC,EAAS5B,KAAKiC,OAE/G,OAAO,IAAInC,EAAiB+B,EAChC,CArCA,WAAAjB,CAAYM,EAAuBe,GATnCnB,EAAAd,KAAOkB,QAAwB,CAC3BgB,QAAS,CACLV,SAAU,KAAM,EAChBW,MAAO,CAAC,OAAQ,YAIxBrB,EAAAd,KAAiBiC,eAGbjC,KAAKgB,SAASE,GACdlB,KAAKiC,KAAOA,CAChB"}
1
+ {"version":3,"file":"Validator.js","sources":["../../../../src/utils/Validator/Validator.ts"],"sourcesContent":["import { ValidatorRules, ValidatorRule, FieldContext, FieldData } from './types';\nimport { ValidationRuleResult } from './ValidationRuleResult';\nimport type Language from '../../language';\n\nexport class ValidationResult {\n private readonly validationResults: ValidationRuleResult[];\n\n constructor(results: ValidationRuleResult[]) {\n this.validationResults = results;\n }\n\n /** Checks if all validation rules have passed */\n get isValid(): boolean {\n return this.validationResults.every(result => !!result.isValid);\n }\n\n /** Checks if any validation rule returned an error */\n hasError(isValidatingForm = false): boolean {\n return Boolean(this.getError(isValidatingForm));\n }\n\n /** Returns the first validation result that returned an error */\n getError(isValidatingForm = false): ValidationRuleResult | null {\n return this.validationResults.find(result => result.hasError(isValidatingForm)) ?? null;\n }\n\n /** Returns all validation results that returned an error */\n getAllErrors() {\n return this.validationResults.filter(result => result.hasError());\n }\n}\n\nclass Validator {\n public rules: ValidatorRules = {\n default: {\n validate: () => true,\n modes: ['blur', 'input']\n }\n };\n\n private readonly i18n: Language;\n\n constructor(rules: ValidatorRules, i18n: Language) {\n this.setRules(rules);\n this.i18n = i18n;\n }\n\n setRules(newRules: ValidatorRules) {\n this.rules = {\n ...this.rules,\n ...newRules\n };\n }\n\n /**\n * Get all validation rules for a field\n */\n private getRulesFor(field: string): ValidatorRule[] {\n let fieldRules: ValidatorRule | ValidatorRule[] = this.rules[field] ?? this.rules['default'];\n\n if (!Array.isArray(fieldRules)) {\n fieldRules = [fieldRules];\n }\n\n return fieldRules;\n }\n\n /**\n * Validates a field\n */\n validate({ key, value, mode = 'blur' }: FieldData, context?: FieldContext) {\n const fieldRules = this.getRulesFor(key);\n // create an ValidationRuleResult, we run the actual validation inside of it\n // validate is called in the constructor of ValidationRuleResult\n // line rule.validate(value, context);\n //\n const validationRulesResult = fieldRules.map(rule => new ValidationRuleResult(rule, value, mode, context, this.i18n));\n\n return new ValidationResult(validationRulesResult);\n }\n}\n\nexport default Validator;\n"],"names":["ValidationResult","isValid","this","validationResults","every","result","hasError","isValidatingForm","Boolean","getError","find","getAllErrors","filter","constructor","results","_define_property","Validator","setRules","newRules","rules","getRulesFor","field","fieldRules","Array","isArray","validate","key","value","mode","context","validationRulesResult","map","rule","ValidationRuleResult","i18n","default","modes"],"mappings":"yLAIO,MAAMA,EAQT,WAAIC,GACA,OAAOC,KAAKC,kBAAkBC,MAAMC,KAAYA,EAAOJ,QAC3D,CAGAK,QAAAA,CAASC,GAAmB,GACxB,OAAOC,QAAQN,KAAKO,SAASF,GACjC,CAGAE,QAAAA,CAASF,GAAmB,GACxB,OAAOL,KAAKC,kBAAkBO,KAAKL,GAAUA,EAAOC,SAASC,KAAsB,IACvF,CAGAI,YAAAA,GACI,OAAOT,KAAKC,kBAAkBS,OAAOP,GAAUA,EAAOC,WAC1D,CAtBA,WAAAO,CAAYC,GAFZC,EAAAb,KAAiBC,4BAGbD,KAAKC,kBAAoBW,CAC7B,EAuBJ,MAAME,EAeFC,QAAAA,CAASC,GACLhB,KAAKiB,MAAQ,IACNjB,KAAKiB,SACLD,EAEX,CAKQE,WAAAA,CAAYC,GAChB,IAAIC,EAA8CpB,KAAKiB,MAAME,IAAUnB,KAAKiB,MAAM,QAMlF,OAJKI,MAAMC,QAAQF,KACfA,EAAa,CAACA,IAGXA,CACX,CAKAG,QAAAA,EAASC,IAAEA,EAAGC,MAAEA,EAAKC,KAAEA,EAAO,QAAqBC,GAC/C,MAKMC,EALa5B,KAAKkB,YAAYM,GAKKK,IAAIC,GAAQ,IAAIC,EAAqBD,EAAML,EAAOC,EAAMC,EAAS3B,KAAKgC,OAE/G,OAAO,IAAIlC,EAAiB8B,EAChC,CArCA,WAAAjB,CAAYM,EAAuBe,GATnCnB,EAAAb,KAAOiB,QAAwB,CAC3BgB,QAAS,CACLV,SAAU,KAAM,EAChBW,MAAO,CAAC,OAAQ,YAIxBrB,EAAAb,KAAiBgC,eAGbhC,KAAKe,SAASE,GACdjB,KAAKgC,KAAOA,CAChB"}
@@ -1,2 +1,2 @@
1
- import{isEmpty as e}from"../validator-utils.js";import{ERROR_FIELD_REQUIRED as r,ERROR_FIELD_INVALID as t}from"../../core/Errors/constants.js";import{email as s,telephoneNumber as o}from"../regex.js";import{unformatDate as a}from"../../components/internal/FormFields/InputDate/utils.js";const l={validate:s=>((s,a)=>e(s)?(a.errorMessage=r,null):(a.errorMessage=t,o.test(s)))(s,l),modes:["blur"]},n={validate:o=>((o,a)=>e(o)?(a.errorMessage=r,null):(a.errorMessage=t,o.length>=6&&o.length<=320&&s.test(o)))(o,n),modes:["blur"]},i={validate:e=>((e,t)=>{if(!e)return t.errorMessage=r,!1;t.errorMessage="dateOfBirth.invalid";const s=a(e),o=Date.now()-Date.parse(s);return new Date(o).getFullYear()-1970>=18})(e,i),modes:["blur"]},m={phoneNumberRule:l,emailRule:n,dateOfBirthRule:i};export{m as validationRules};
1
+ import{isEmpty as e}from"../validator-utils.js";import{ERROR_FIELD_REQUIRED as r,ERROR_FIELD_INVALID as t}from"../../core/Errors/constants.js";import{email as s,telephoneNumber as o}from"../regex.js";import{unformatDate as a}from"../../components/internal/FormFields/InputDate/utils.js";const l={validate:s=>((s,a)=>e(s)?(a.errorMessage=r,null):(a.errorMessage=t,o.test(s)))(s,l),modes:["blur"]},n={validate:o=>((o,a)=>e(o)?(a.errorMessage=r,null):(a.errorMessage=t,o.length>=6&&o.length<=320&&s.test(o)))(o,n),modes:["blur"]},i={validate:e=>((e,t)=>{if(!e)return t.errorMessage=r,!1;t.errorMessage="dateOfBirth.invalid";const s=a(e);if(!s)return!1;const o=Date.now()-Date.parse(s);return new Date(o).getFullYear()-1970>=18})(e,i),modes:["blur"]},u={phoneNumberRule:l,emailRule:n,dateOfBirthRule:i};export{u as validationRules};
2
2
  //# sourceMappingURL=defaultRules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultRules.js","sources":["../../../../src/utils/Validator/defaultRules.ts"],"sourcesContent":["import { ValidatorRule } from './types';\nimport { isEmpty } from '../validator-utils';\nimport { ERROR_FIELD_INVALID, ERROR_FIELD_REQUIRED } from '../../core/Errors/constants';\nimport { email, telephoneNumber } from '../regex';\nimport { unformatDate } from '../../components/internal/FormFields/InputDate/utils';\n\nconst isPhoneValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (isEmpty(value)) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return null;\n }\n validationRule.errorMessage = ERROR_FIELD_INVALID;\n return telephoneNumber.test(value);\n};\n\nconst isEmailValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (isEmpty(value)) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return null;\n }\n validationRule.errorMessage = ERROR_FIELD_INVALID;\n return value.length >= 6 && value.length <= 320 && email.test(value);\n};\n\nconst isDateOfBirthValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (!value) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return false;\n }\n validationRule.errorMessage = 'dateOfBirth.invalid';\n const rawValue = unformatDate(value);\n const ageDiff = Date.now() - Date.parse(rawValue);\n const age = new Date(ageDiff).getFullYear() - 1970;\n return age >= 18;\n};\n\nconst phoneNumberRule: ValidatorRule = {\n validate: value => isPhoneValid(value, phoneNumberRule),\n modes: ['blur']\n};\n\nconst emailRule: ValidatorRule = {\n validate: value => isEmailValid(value, emailRule),\n modes: ['blur']\n};\n\nconst dateOfBirthRule: ValidatorRule = {\n validate: value => isDateOfBirthValid(value, dateOfBirthRule),\n modes: ['blur']\n};\n\nexport const validationRules = { phoneNumberRule, emailRule, dateOfBirthRule };\n"],"names":["phoneNumberRule","validate","value","validationRule","isEmpty","errorMessage","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","telephoneNumber","test","isPhoneValid","modes","emailRule","length","email","isEmailValid","dateOfBirthRule","rawValue","unformatDate","ageDiff","Date","now","parse","getFullYear","isDateOfBirthValid","validationRules"],"mappings":"+RAMA,MA8BMA,EAAiC,CACnCC,SAAUC,GA/BO,EAACA,EAAeC,IAC7BC,EAAQF,IACRC,EAAeE,aAAeC,EACvB,OAEXH,EAAeE,aAAeE,EACvBC,EAAgBC,KAAKP,IAyBTQ,CAAaR,EAAOF,GACvCW,MAAO,CAAC,SAGNC,EAA2B,CAC7BX,SAAUC,GA3BO,EAACA,EAAeC,IAC7BC,EAAQF,IACRC,EAAeE,aAAeC,EACvB,OAEXH,EAAeE,aAAeE,EACvBL,EAAMW,QAAU,GAAKX,EAAMW,QAAU,KAAOC,EAAML,KAAKP,IAqB3Ca,CAAab,EAAOU,GACvCD,MAAO,CAAC,SAGNK,EAAiC,CACnCf,SAAUC,GAvBa,EAACA,EAAeC,KACvC,IAAKD,EAED,OADAC,EAAeE,aAAeC,GACvB,EAEXH,EAAeE,aAAe,sBAC9B,MAAMY,EAAWC,EAAahB,GACxBiB,EAAUC,KAAKC,MAAQD,KAAKE,MAAML,GAExC,OADY,IAAIG,KAAKD,GAASI,cAAgB,MAChC,IAcKC,CAAmBtB,EAAOc,GAC7CL,MAAO,CAAC,SAGCc,EAAkB,CAAEzB,kBAAiBY,YAAWI"}
1
+ {"version":3,"file":"defaultRules.js","sources":["../../../../src/utils/Validator/defaultRules.ts"],"sourcesContent":["import { ValidatorRule } from './types';\nimport { isEmpty } from '../validator-utils';\nimport { ERROR_FIELD_INVALID, ERROR_FIELD_REQUIRED } from '../../core/Errors/constants';\nimport { email, telephoneNumber } from '../regex';\nimport { unformatDate } from '../../components/internal/FormFields/InputDate/utils';\n\nconst isPhoneValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (isEmpty(value)) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return null;\n }\n validationRule.errorMessage = ERROR_FIELD_INVALID;\n return telephoneNumber.test(value);\n};\n\nconst isEmailValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (isEmpty(value)) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return null;\n }\n validationRule.errorMessage = ERROR_FIELD_INVALID;\n return value.length >= 6 && value.length <= 320 && email.test(value);\n};\n\nconst isDateOfBirthValid = (value: string, validationRule: ValidatorRule): boolean | null => {\n if (!value) {\n validationRule.errorMessage = ERROR_FIELD_REQUIRED;\n return false;\n }\n validationRule.errorMessage = 'dateOfBirth.invalid';\n const rawValue = unformatDate(value);\n if (!rawValue) return false;\n const ageDiff = Date.now() - Date.parse(rawValue);\n const age = new Date(ageDiff).getFullYear() - 1970;\n return age >= 18;\n};\n\nconst phoneNumberRule: ValidatorRule = {\n validate: value => isPhoneValid(value, phoneNumberRule),\n modes: ['blur']\n};\n\nconst emailRule: ValidatorRule = {\n validate: value => isEmailValid(value, emailRule),\n modes: ['blur']\n};\n\nconst dateOfBirthRule: ValidatorRule = {\n validate: value => isDateOfBirthValid(value, dateOfBirthRule),\n modes: ['blur']\n};\n\nexport const validationRules = { phoneNumberRule, emailRule, dateOfBirthRule };\n"],"names":["phoneNumberRule","validate","value","validationRule","isEmpty","errorMessage","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","telephoneNumber","test","isPhoneValid","modes","emailRule","length","email","isEmailValid","dateOfBirthRule","rawValue","unformatDate","ageDiff","Date","now","parse","getFullYear","isDateOfBirthValid","validationRules"],"mappings":"+RAMA,MA+BMA,EAAiC,CACnCC,SAAUC,GAhCO,EAACA,EAAeC,IAC7BC,EAAQF,IACRC,EAAeE,aAAeC,EACvB,OAEXH,EAAeE,aAAeE,EACvBC,EAAgBC,KAAKP,IA0BTQ,CAAaR,EAAOF,GACvCW,MAAO,CAAC,SAGNC,EAA2B,CAC7BX,SAAUC,GA5BO,EAACA,EAAeC,IAC7BC,EAAQF,IACRC,EAAeE,aAAeC,EACvB,OAEXH,EAAeE,aAAeE,EACvBL,EAAMW,QAAU,GAAKX,EAAMW,QAAU,KAAOC,EAAML,KAAKP,IAsB3Ca,CAAab,EAAOU,GACvCD,MAAO,CAAC,SAGNK,EAAiC,CACnCf,SAAUC,GAxBa,EAACA,EAAeC,KACvC,IAAKD,EAED,OADAC,EAAeE,aAAeC,GACvB,EAEXH,EAAeE,aAAe,sBAC9B,MAAMY,EAAWC,EAAahB,GAC9B,IAAKe,EAAU,OAAO,EACtB,MAAME,EAAUC,KAAKC,MAAQD,KAAKE,MAAML,GAExC,OADY,IAAIG,KAAKD,GAASI,cAAgB,MAChC,IAcKC,CAAmBtB,EAAOc,GAC7CL,MAAO,CAAC,SAGCc,EAAkB,CAAEzB,kBAAiBY,YAAWI"}
@@ -1 +1 @@
1
- {"version":3,"file":"browserInfo.js","sources":["../../../src/utils/browserInfo.ts"],"sourcesContent":["import type { BrowserInfo } from '../types/global-types';\n\n/**\n * Collects available frontend browser info and store it in the properties dictated by the EMVCo spec\n * (3DS_Spec_protocolAndCoreFny_v2-1_Oct2017.pdf)\n *\n * @example\n * ```js\n * const browserInfo = collectBrowserInfo();\n * ```\n *\n * @returns An object containing the retrieved browser properties\n */\nexport default function collectBrowserInfo(): BrowserInfo {\n if (typeof window === 'undefined') {\n return;\n }\n const colorDepth = window.screen.colorDepth;\n const screenHeight = window.screen.height;\n const screenWidth = window.screen.width;\n const userAgent = window.navigator.userAgent;\n\n const language = window.navigator.language || 'en';\n const timeZoneOffset = new Date().getTimezoneOffset();\n\n return {\n acceptHeader: '*/*',\n javaEnabled: false,\n colorDepth,\n language,\n screenHeight,\n screenWidth,\n userAgent,\n timeZoneOffset\n };\n}\n"],"names":["collectBrowserInfo","window","colorDepth","screen","screenHeight","height","screenWidth","width","userAgent","navigator","acceptHeader","javaEnabled","language","timeZoneOffset","Date","getTimezoneOffset"],"mappings":"AAae,SAASA,IACpB,GAAsB,oBAAXC,OACP,OAEJ,MAAMC,EAAaD,OAAOE,OAAOD,WAC3BE,EAAeH,OAAOE,OAAOE,OAC7BC,EAAcL,OAAOE,OAAOI,MAC5BC,EAAYP,OAAOQ,UAAUD,UAKnC,MAAO,CACHE,aAAc,MACdC,aAAa,EACbT,aACAU,SAPaX,OAAOQ,UAAUG,UAAY,KAQ1CR,eACAE,cACAE,YACAK,gBAVmB,IAAIC,MAAOC,oBAYtC"}
1
+ {"version":3,"file":"browserInfo.js","sources":["../../../src/utils/browserInfo.ts"],"sourcesContent":["import type { BrowserInfo } from '../types/global-types';\n\n/**\n * Collects available frontend browser info and store it in the properties dictated by the EMVCo spec\n * (3DS_Spec_protocolAndCoreFny_v2-1_Oct2017.pdf)\n *\n * @example\n * ```js\n * const browserInfo = collectBrowserInfo();\n * ```\n *\n * @returns An object containing the retrieved browser properties\n */\nexport default function collectBrowserInfo(): BrowserInfo | undefined {\n if (typeof window === 'undefined') {\n return;\n }\n const colorDepth = window.screen.colorDepth;\n const screenHeight = window.screen.height;\n const screenWidth = window.screen.width;\n const userAgent = window.navigator.userAgent;\n\n const language = window.navigator.language || 'en';\n const timeZoneOffset = new Date().getTimezoneOffset();\n\n return {\n acceptHeader: '*/*',\n javaEnabled: false,\n colorDepth,\n language,\n screenHeight,\n screenWidth,\n userAgent,\n timeZoneOffset\n };\n}\n"],"names":["collectBrowserInfo","window","colorDepth","screen","screenHeight","height","screenWidth","width","userAgent","navigator","acceptHeader","javaEnabled","language","timeZoneOffset","Date","getTimezoneOffset"],"mappings":"AAae,SAASA,IACpB,GAAsB,oBAAXC,OACP,OAEJ,MAAMC,EAAaD,OAAOE,OAAOD,WAC3BE,EAAeH,OAAOE,OAAOE,OAC7BC,EAAcL,OAAOE,OAAOI,MAC5BC,EAAYP,OAAOQ,UAAUD,UAKnC,MAAO,CACHE,aAAc,MACdC,aAAa,EACbT,aACAU,SAPaX,OAAOQ,UAAUG,UAAY,KAQ1CR,eACAE,cACAE,YACAK,gBAVmB,IAAIC,MAAOC,oBAYtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createSdkData.js","sources":["../../../src/utils/createSdkData.ts"],"sourcesContent":["import base64 from './base64';\nimport { LIBRARY_VERSION, CHANNEL, PLATFORM, PAYMENT_METHOD_BEHAVIOR } from '../core/config';\nexport interface SdkDataObject {\n schemaVersion: number;\n createdAt: number;\n channel: CHANNEL;\n platform: string;\n sdkVersion: string;\n paymentMethodBehavior: PAYMENT_METHOD_BEHAVIOR;\n analytics: {\n checkoutAttemptId: string;\n };\n riskData: {\n clientData: string;\n };\n}\n\n/**\n * Creates the sdkData object with analytics and risk information\n * @param checkoutAttemptId - The checkout attempt ID from analytics\n * @param clientData - The client data from risk module\n * @returns Base64 encoded JSON string of the SDK data object\n */\nexport function createSdkData(checkoutAttemptId: string, clientData: string | null, paymentMethodBehavior: PAYMENT_METHOD_BEHAVIOR): string {\n const sdkDataObject: SdkDataObject = {\n schemaVersion: 1,\n createdAt: Date.now(),\n channel: CHANNEL.WEB,\n platform: PLATFORM,\n sdkVersion: LIBRARY_VERSION,\n paymentMethodBehavior,\n analytics: {\n checkoutAttemptId\n },\n ...(clientData && { riskData: { clientData } })\n };\n\n return base64.encode(JSON.stringify(sdkDataObject));\n}\n"],"names":["createSdkData","checkoutAttemptId","clientData","paymentMethodBehavior","sdkDataObject","schemaVersion","createdAt","Date","now","channel","CHANNEL","WEB","platform","PLATFORM","sdkVersion","LIBRARY_VERSION","analytics","riskData","base64","encode","JSON","stringify"],"mappings":"0GAuBO,SAASA,EAAcC,EAA2BC,EAA2BC,GAChF,MAAMC,EAA+B,CACjCC,cAAe,EACfC,UAAWC,KAAKC,MAChBC,QAASC,EAAQC,IACjBC,SAAUC,EACVC,WAAYC,EACZZ,wBACAa,UAAW,CACPf,wBAEAC,GAAc,CAAEe,SAAU,CAAEf,gBAGpC,OAAOgB,EAAOC,OAAOC,KAAKC,UAAUjB,GACxC"}
1
+ {"version":3,"file":"createSdkData.js","sources":["../../../src/utils/createSdkData.ts"],"sourcesContent":["import base64 from './base64';\nimport { LIBRARY_VERSION, CHANNEL, PLATFORM, PAYMENT_METHOD_BEHAVIOR } from '../core/config';\nexport interface SdkDataObject {\n schemaVersion: number;\n createdAt: number;\n channel: CHANNEL;\n platform: string;\n sdkVersion: string;\n paymentMethodBehavior: PAYMENT_METHOD_BEHAVIOR;\n analytics: {\n checkoutAttemptId: string;\n };\n riskData?: {\n clientData: string;\n };\n}\n\n/**\n * Creates the sdkData object with analytics and risk information\n * @param checkoutAttemptId - The checkout attempt ID from analytics\n * @param clientData - The client data from risk module\n * @returns Base64 encoded JSON string of the SDK data object\n */\nexport function createSdkData(checkoutAttemptId: string, clientData: string | null, paymentMethodBehavior: PAYMENT_METHOD_BEHAVIOR): string {\n const sdkDataObject: SdkDataObject = {\n schemaVersion: 1,\n createdAt: Date.now(),\n channel: CHANNEL.WEB,\n platform: PLATFORM,\n sdkVersion: LIBRARY_VERSION,\n paymentMethodBehavior,\n analytics: {\n checkoutAttemptId\n },\n ...(clientData && { riskData: { clientData } })\n };\n\n return base64.encode(JSON.stringify(sdkDataObject));\n}\n"],"names":["createSdkData","checkoutAttemptId","clientData","paymentMethodBehavior","sdkDataObject","schemaVersion","createdAt","Date","now","channel","CHANNEL","WEB","platform","PLATFORM","sdkVersion","LIBRARY_VERSION","analytics","riskData","base64","encode","JSON","stringify"],"mappings":"0GAuBO,SAASA,EAAcC,EAA2BC,EAA2BC,GAChF,MAAMC,EAA+B,CACjCC,cAAe,EACfC,UAAWC,KAAKC,MAChBC,QAASC,EAAQC,IACjBC,SAAUC,EACVC,WAAYC,EACZZ,wBACAa,UAAW,CACPf,wBAEAC,GAAc,CAAEe,SAAU,CAAEf,gBAGpC,OAAOgB,EAAOC,OAAOC,KAAKC,UAAUjB,GACxC"}
@@ -1,2 +1,2 @@
1
- const t=(t,e,r)=>n=>{if(!n)return null;const l={parentFolder:n?`${e}/`:"",type:n||e,...t};return r(l)(n)};export{t as default};
1
+ const t=(t,e,r)=>n=>{if(!n)return;const o={parentFolder:`${e}/`,type:n,...t};return r(o)(n)};export{t as default};
2
2
  //# sourceMappingURL=get-issuer-image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-issuer-image.js","sources":["../../../src/utils/get-issuer-image.ts"],"sourcesContent":["import { ImageOptions } from '../core/Context/Resources';\nimport { UseImageHookType } from '../core/Context/useImage';\n\nconst getIssuerImageUrl =\n (options: object, type: string, getImage: UseImageHookType) =>\n (issuer: string): string => {\n if (!issuer) return null;\n\n const imageOptions: ImageOptions = {\n parentFolder: issuer ? `${type}/` : '',\n type: issuer || type,\n ...options\n };\n\n return getImage(imageOptions)(issuer);\n };\n\nexport default getIssuerImageUrl;\n"],"names":["getIssuerImageUrl","options","type","getImage","issuer","imageOptions","parentFolder"],"mappings":"AAGA,MAAMA,EACF,CAACC,EAAiBC,EAAcC,IAC/BC,IACG,IAAKA,EAAQ,OAAO,KAEpB,MAAMC,EAA6B,CAC/BC,aAAcF,EAAS,GAAGF,KAAU,GACpCA,KAAME,GAAUF,KACbD,GAGP,OAAOE,EAASE,EAATF,CAAuBC"}
1
+ {"version":3,"file":"get-issuer-image.js","sources":["../../../src/utils/get-issuer-image.ts"],"sourcesContent":["import type { ImageOptions } from '../core/Context/Resources';\nimport type { UseImageHookType } from '../core/Context/useImage';\n\n/**\n * USAGE:\n * Use getIssuerImageUrl() when rendering a list of issuer logos under logos/{txVariant}/{issuer}.svg\n * For anything else, like when you just need a single, named, asset - use Resources.getImage()\n */\n\nconst getIssuerImageUrl =\n (options: ImageOptions, type: string, getImage: UseImageHookType) =>\n (issuer: string | undefined): string | undefined => {\n if (!issuer) return undefined;\n\n const imageOptions: ImageOptions = {\n parentFolder: `${type}/`,\n type: issuer,\n ...options\n };\n\n return getImage(imageOptions)(issuer);\n };\n\nexport default getIssuerImageUrl;\n"],"names":["getIssuerImageUrl","options","type","getImage","issuer","imageOptions","parentFolder"],"mappings":"MASMA,EACF,CAACC,EAAuBC,EAAcC,IACrCC,IACG,IAAKA,EAAQ,OAEb,MAAMC,EAA6B,CAC/BC,aAAc,GAAGJ,KACjBA,KAAME,KACHH,GAGP,OAAOE,EAASE,EAATF,CAAuBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-process-message-handler.js","sources":["../../../src/utils/get-process-message-handler.ts"],"sourcesContent":["/**\n * Centralised window.postMessage processing function used in 3DS2 components and *also* by the RiskModule's device fingerprinting process\n * NOTE: this latter use case means that while the deviceFingerprinting is still completing this component is also listening to\n * securedFields related postMessaging\n *\n * @param domain - expected domain for the postMesssage to have originated from\n * @param resolve - the resolve function from the Promise that called this function\n * @param reject - the reject function from the Promise that called this function\n * @param parseErrorObj - an error object to log in the case of unparseable data (albeit from a valid origin)\n * @param expectedType - string to check that the message event's data has the expected type\n */\nimport { hasOwnProperty } from './hasOwnProperty';\nimport { PostMsgParseErrorObject } from '../components/ThreeDS2/types';\n\nconst getProcessMessageHandler =\n (\n domain: string,\n resolve: (value: unknown) => void,\n reject: (reason?: unknown) => void,\n expectedType: string\n ): ((event: Pick<MessageEvent, 'origin' | 'data'>) => string | boolean) =>\n (event: Pick<MessageEvent, 'origin' | 'data'>): string | boolean => {\n const parseErrorObj: PostMsgParseErrorObject = {};\n const origin = event.origin;\n\n if (origin !== domain) {\n // FAIL SILENTLY: if it's not from the expected domain then it's not our traffic\n return 'Message was not sent from the expected domain';\n }\n\n /**\n * At this point we know the message is from the expected domain\n * - so is presumably \"our\" traffic and not random messages from the merchant's site, the build process, or from the browser (or extensions)\n * // TODO - Do more here in terms of logging to help debug issues with 3DS2\n */\n\n if (typeof event.data !== 'string') {\n // If it's from our domain but not a string - log this somewhere?\n return 'Event data from expected domain but not in expected form';\n }\n\n if (!event.data.length) {\n // If it's from our domain, is a string, but is empty - log this somewhere?\n return 'Event data from expected domain, in expected form, but empty';\n }\n\n // Try to parse the data\n try {\n const feedbackObj = JSON.parse(event.data) as Record<string, unknown>;\n if (feedbackObj && typeof feedbackObj === 'object' && hasOwnProperty(feedbackObj, 'type')) {\n if (feedbackObj.type === expectedType) {\n // Happy flow\n resolve(feedbackObj);\n return true;\n } else {\n // feedbackObj.type != expectedType - log this somewhere?\n return 'Event data has \"type\" but the object is not in the expected form';\n }\n } else {\n // FAIL SILENTLY: event.data had no 'type' property\n // example: applies when RiskModule device fingerprinting is ongoing and this handler is picking up securedFields traffic\n // - But, *if* we know we're in 3DS2 scenario - log this somewhere?\n return 'Event data had no type';\n }\n } catch (e) {\n parseErrorObj.type = `${expectedType}-JSON-parse-error`;\n parseErrorObj.comment = 'failed to JSON parse event.data';\n parseErrorObj.extraInfo = `event.data = ${event.data}`;\n parseErrorObj.eventDataRaw = event.data;\n\n // TODO - decide whether to console.log/debug/error &/or call the merchant defined onError callback\n console.debug('get-process-message-handler::CATCH::Un-parseable JSON:: parseErrorObj=', parseErrorObj);\n\n return false;\n }\n };\n\nexport default getProcessMessageHandler;\n"],"names":["getProcessMessageHandler","domain","resolve","reject","expectedType","event","parseErrorObj","origin","data","length","feedbackObj","JSON","parse","hasOwnProperty","type","e","comment","extraInfo","eventDataRaw","console","debug"],"mappings":"qDAcA,MAAMA,EACF,CACIC,EACAC,EACAC,EACAC,IAEHC,IACG,MAAMC,EAAyC,CAAA,EAG/C,GAFeD,EAAME,SAENN,EAEX,MAAO,gDASX,GAA0B,iBAAfI,EAAMG,KAEb,MAAO,2DAGX,IAAKH,EAAMG,KAAKC,OAEZ,MAAO,+DAIX,IACI,MAAMC,EAAcC,KAAKC,MAAMP,EAAMG,MACrC,OAAIE,GAAsC,iBAAhBA,GAA4BG,EAAeH,EAAa,QAC1EA,EAAYI,OAASV,GAErBF,EAAQQ,IACD,GAGA,mEAMJ,wBAEf,CAAE,MAAOK,GASL,OARAT,EAAcQ,KAAO,GAAGV,qBACxBE,EAAcU,QAAU,kCACxBV,EAAcW,UAAY,gBAAgBZ,EAAMG,OAChDF,EAAcY,aAAeb,EAAMG,KAGnCW,QAAQC,MAAM,yEAA0Ed,IAEjF,CACX"}
1
+ {"version":3,"file":"get-process-message-handler.js","sources":["../../../src/utils/get-process-message-handler.ts"],"sourcesContent":["/**\n * Centralised window.postMessage processing function used in 3DS2 components and *also* by the RiskModule's device fingerprinting process\n * NOTE: this latter use case means that while the deviceFingerprinting is still completing this component is also listening to\n * securedFields related postMessaging\n *\n * @param domain - expected domain for the postMesssage to have originated from\n * @param resolve - the resolve function from the Promise that called this function\n * @param reject - the reject function from the Promise that called this function\n * @param parseErrorObj - an error object to log in the case of unparseable data (albeit from a valid origin)\n * @param expectedType - string to check that the message event's data has the expected type\n */\nimport { hasOwnProperty } from './hasOwnProperty';\nimport { PostMsgParseErrorObject } from '../components/ThreeDS2/types';\n\nconst getProcessMessageHandler =\n (\n domain: string | null,\n resolve: (value: unknown) => void,\n reject: (reason?: unknown) => void,\n expectedType: string\n ): ((event: Pick<MessageEvent, 'origin' | 'data'>) => string | boolean) =>\n (event: Pick<MessageEvent, 'origin' | 'data'>): string | boolean => {\n const parseErrorObj: PostMsgParseErrorObject = {};\n const origin = event.origin;\n\n if (origin !== domain) {\n // FAIL SILENTLY: if it's not from the expected domain then it's not our traffic\n return 'Message was not sent from the expected domain';\n }\n\n /**\n * At this point we know the message is from the expected domain\n * - so is presumably \"our\" traffic and not random messages from the merchant's site, the build process, or from the browser (or extensions)\n * // TODO - Do more here in terms of logging to help debug issues with 3DS2\n */\n\n if (typeof event.data !== 'string') {\n // If it's from our domain but not a string - log this somewhere?\n return 'Event data from expected domain but not in expected form';\n }\n\n if (!event.data.length) {\n // If it's from our domain, is a string, but is empty - log this somewhere?\n return 'Event data from expected domain, in expected form, but empty';\n }\n\n // Try to parse the data\n try {\n const feedbackObj = JSON.parse(event.data) as Record<string, unknown>;\n if (feedbackObj && typeof feedbackObj === 'object' && hasOwnProperty(feedbackObj, 'type')) {\n if (feedbackObj.type === expectedType) {\n // Happy flow\n resolve(feedbackObj);\n return true;\n } else {\n // feedbackObj.type != expectedType - log this somewhere?\n return 'Event data has \"type\" but the object is not in the expected form';\n }\n } else {\n // FAIL SILENTLY: event.data had no 'type' property\n // example: applies when RiskModule device fingerprinting is ongoing and this handler is picking up securedFields traffic\n // - But, *if* we know we're in 3DS2 scenario - log this somewhere?\n return 'Event data had no type';\n }\n } catch (e) {\n parseErrorObj.type = `${expectedType}-JSON-parse-error`;\n parseErrorObj.comment = 'failed to JSON parse event.data';\n parseErrorObj.extraInfo = `event.data = ${event.data}`;\n parseErrorObj.eventDataRaw = event.data;\n\n // TODO - decide whether to console.log/debug/error &/or call the merchant defined onError callback\n console.debug('get-process-message-handler::CATCH::Un-parseable JSON:: parseErrorObj=', parseErrorObj);\n\n return false;\n }\n };\n\nexport default getProcessMessageHandler;\n"],"names":["getProcessMessageHandler","domain","resolve","reject","expectedType","event","parseErrorObj","origin","data","length","feedbackObj","JSON","parse","hasOwnProperty","type","e","comment","extraInfo","eventDataRaw","console","debug"],"mappings":"qDAcA,MAAMA,EACF,CACIC,EACAC,EACAC,EACAC,IAEHC,IACG,MAAMC,EAAyC,CAAA,EAG/C,GAFeD,EAAME,SAENN,EAEX,MAAO,gDASX,GAA0B,iBAAfI,EAAMG,KAEb,MAAO,2DAGX,IAAKH,EAAMG,KAAKC,OAEZ,MAAO,+DAIX,IACI,MAAMC,EAAcC,KAAKC,MAAMP,EAAMG,MACrC,OAAIE,GAAsC,iBAAhBA,GAA4BG,EAAeH,EAAa,QAC1EA,EAAYI,OAASV,GAErBF,EAAQQ,IACD,GAGA,mEAMJ,wBAEf,CAAE,MAAOK,GASL,OARAT,EAAcQ,KAAO,GAAGV,qBACxBE,EAAcU,QAAU,kCACxBV,EAAcW,UAAY,gBAAgBZ,EAAMG,OAChDF,EAAcY,aAAeb,EAAMG,KAGnCW,QAAQC,MAAM,yEAA0Ed,IAEjF,CACX"}
@@ -1,2 +1,2 @@
1
- function o(o,e,n){const r=e?.toLowerCase().slice(0,2),t=n[o?.toLowerCase()]?.[r];if(t)return t;console.warn(`Cannot find a consent url for the provided countryCode: ${o} and locale: ${e}`)}export{o as getConsentUrl};
1
+ function o(o,e,n){const r=o?n[o.toLowerCase()]:void 0,t=e?r?.[e.toLowerCase().slice(0,2)]:void 0;return t||(console.warn(`Cannot find a consent url for the provided countryCode: ${o} and locale: ${e}`),r?.en)}export{o as getConsentUrl};
2
2
  //# sourceMappingURL=getConsentUrl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getConsentUrl.js","sources":["../../../src/utils/getConsentUrl.ts"],"sourcesContent":["type UrlMap = {\n [countryCode: string]: {\n [language: string]: string;\n };\n};\n\nfunction getConsentUrl(countryCode: string, locale: string, urlMap: UrlMap): string {\n const languageCode = locale?.toLowerCase().slice(0, 2);\n const consentLink = urlMap[countryCode?.toLowerCase()]?.[languageCode];\n if (!consentLink) {\n console.warn(`Cannot find a consent url for the provided countryCode: ${countryCode} and locale: ${locale}`);\n return;\n }\n return consentLink;\n}\n\nexport { getConsentUrl };\n"],"names":["getConsentUrl","countryCode","locale","urlMap","languageCode","toLowerCase","slice","consentLink","console","warn"],"mappings":"AAMA,SAASA,EAAcC,EAAqBC,EAAgBC,GACxD,MAAMC,EAAeF,GAAQG,cAAcC,MAAM,EAAG,GAC9CC,EAAcJ,EAAOF,GAAaI,iBAAiBD,GACzD,GAAKG,EAIL,OAAOA,EAHHC,QAAQC,KAAK,2DAA2DR,iBAA2BC,IAI3G"}
1
+ {"version":3,"file":"getConsentUrl.js","sources":["../../../src/utils/getConsentUrl.ts"],"sourcesContent":["type UrlMap = {\n [countryCode: string]: {\n [language: string]: string;\n };\n};\n\nconst FALLBACK_CONSENT_LANGUAGE = 'en';\n\nfunction getConsentUrl(countryCode: string | undefined, locale: string | undefined, urlMap: UrlMap): string | undefined {\n const countryUrls = countryCode ? urlMap[countryCode.toLowerCase()] : undefined;\n const consentUrl = locale ? countryUrls?.[locale.toLowerCase().slice(0, 2)] : undefined;\n if (consentUrl) {\n return consentUrl;\n }\n\n console.warn(`Cannot find a consent url for the provided countryCode: ${countryCode} and locale: ${locale}`);\n return countryUrls?.[FALLBACK_CONSENT_LANGUAGE];\n}\n\nexport { getConsentUrl };\n"],"names":["getConsentUrl","countryCode","locale","urlMap","countryUrls","toLowerCase","undefined","consentUrl","slice","console","warn","FALLBACK_CONSENT_LANGUAGE"],"mappings":"AAQA,SAASA,EAAcC,EAAiCC,EAA4BC,GAChF,MAAMC,EAAcH,EAAcE,EAAOF,EAAYI,oBAAiBC,EAChEC,EAAaL,EAASE,IAAcF,EAAOG,cAAcG,MAAM,EAAG,SAAMF,EAC9E,OAAIC,IAIJE,QAAQC,KAAK,2DAA2DT,iBAA2BC,KAC5FE,GAAcO,GACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getErrorMessage.js","sources":["../../../src/utils/getErrorMessage.ts"],"sourcesContent":["import { ERROR_FIELD_INVALID, ERROR_FIELD_REQUIRED } from '../core/Errors/constants';\nimport Language from '../language';\nimport { ValidationRuleResult } from './Validator/ValidationRuleResult';\n\nexport const getErrorMessage = (i18n: Language, error?: ValidationRuleResult, label?: string, lowerCaseLabel: boolean = true): string | boolean => {\n if (error?.errorMessage && typeof error.errorMessage === 'string') {\n const errorKey = error.errorMessage;\n const shouldBuildErrorMessage = [ERROR_FIELD_REQUIRED, ERROR_FIELD_INVALID].includes(errorKey);\n // Build the error msg: Enter the [label name] or Enter a valid [label name]\n const options = { values: { label: lowerCaseLabel ? label?.toLowerCase() : label } };\n return shouldBuildErrorMessage ? i18n.get(errorKey, options) : i18n.get(errorKey);\n }\n\n return !!error;\n};\n"],"names":["getErrorMessage","i18n","error","label","lowerCaseLabel","errorMessage","errorKey","shouldBuildErrorMessage","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","includes","options","values","toLowerCase","get"],"mappings":"kGAIaA,EAAkB,CAACC,EAAgBC,EAA8BC,EAAgBC,GAA0B,KACpH,GAAIF,GAAOG,cAA8C,iBAAvBH,EAAMG,aAA2B,CAC/D,MAAMC,EAAWJ,EAAMG,aACjBE,EAA0B,CAACC,EAAsBC,GAAqBC,SAASJ,GAE/EK,EAAU,CAAEC,OAAQ,CAAET,MAAOC,EAAiBD,GAAOU,cAAgBV,IAC3E,OAAOI,EAA0BN,EAAKa,IAAIR,EAAUK,GAAWV,EAAKa,IAAIR,EAC5E,CAEA,QAASJ"}
1
+ {"version":3,"file":"getErrorMessage.js","sources":["../../../src/utils/getErrorMessage.ts"],"sourcesContent":["import { ERROR_FIELD_INVALID, ERROR_FIELD_REQUIRED } from '../core/Errors/constants';\nimport Language from '../language';\nimport { ValidationRuleResult } from './Validator/ValidationRuleResult';\n\nexport const getErrorMessage = (\n i18n: Language,\n error?: ValidationRuleResult | null,\n label?: string,\n lowerCaseLabel: boolean = true\n): string | boolean => {\n if (error?.errorMessage && typeof error.errorMessage === 'string') {\n const errorKey = error.errorMessage;\n const shouldBuildErrorMessage = [ERROR_FIELD_REQUIRED, ERROR_FIELD_INVALID].includes(errorKey);\n // Build the error msg: Enter the [label name] or Enter a valid [label name]\n const options = { values: { label: lowerCaseLabel ? label?.toLowerCase() : label } };\n return shouldBuildErrorMessage ? i18n.get(errorKey, options) : i18n.get(errorKey);\n }\n\n return !!error;\n};\n"],"names":["getErrorMessage","i18n","error","label","lowerCaseLabel","errorMessage","errorKey","shouldBuildErrorMessage","ERROR_FIELD_REQUIRED","ERROR_FIELD_INVALID","includes","options","values","toLowerCase","get"],"mappings":"kGAIaA,EAAkB,CAC3BC,EACAC,EACAC,EACAC,GAA0B,KAE1B,GAAIF,GAAOG,cAA8C,iBAAvBH,EAAMG,aAA2B,CAC/D,MAAMC,EAAWJ,EAAMG,aACjBE,EAA0B,CAACC,EAAsBC,GAAqBC,SAASJ,GAE/EK,EAAU,CAAEC,OAAQ,CAAET,MAAOC,EAAiBD,GAAOU,cAAgBV,IAC3E,OAAOI,EAA0BN,EAAKa,IAAIR,EAAUK,GAAWV,EAAKa,IAAIR,EAC5E,CAEA,QAASJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"getOrigin.js","sources":["../../../src/utils/getOrigin.ts"],"sourcesContent":["/**\n * Used to retrieve the origin from a url\n *\n * @remarks\n * Uses a regex to get origin (can't handle localhost origins)\n *\n * @param url - URL\n * @returns The origin of the url\n */\nexport const getOrigin = (url: string): string => {\n const originRegex = /^(?:([A-Za-z]+):)?(\\/{0,3})([0-9.\\-A-Za-z]+)(?::(\\d+))?(?:\\/([^?#]*))?(?:\\?([^#]*))?(?:#(.*))?$/;\n const matches = originRegex.exec(url);\n\n if (!matches) return null;\n\n const [, protocol, separator, host, port] = matches;\n\n if (!protocol || !separator || !host) return null;\n\n return `${protocol}:${separator}${host}${port ? `:${port}` : ''}`;\n};\n\nexport default getOrigin;\n"],"names":["getOrigin","url","matches","exec","protocol","separator","host","port"],"mappings":"AASO,MAAMA,EAAaC,IACtB,MACMC,EADc,kGACQC,KAAKF,GAEjC,IAAKC,EAAS,OAAO,KAErB,MAAM,CAAGE,EAAUC,EAAWC,EAAMC,GAAQL,EAE5C,OAAKE,GAAaC,GAAcC,EAEzB,GAAGF,KAAYC,IAAYC,IAAOC,EAAO,IAAIA,IAAS,KAFhB"}
1
+ {"version":3,"file":"getOrigin.js","sources":["../../../src/utils/getOrigin.ts"],"sourcesContent":["/**\n * Used to retrieve the origin from a url\n *\n * @remarks\n * Uses a regex to get origin (can't handle localhost origins)\n *\n * @param url - URL\n * @returns The origin of the url\n */\nexport const getOrigin = (url: string): string | null => {\n const originRegex = /^(?:([A-Za-z]+):)?(\\/{0,3})([0-9.\\-A-Za-z]+)(?::(\\d+))?(?:\\/([^?#]*))?(?:\\?([^#]*))?(?:#(.*))?$/;\n const matches = originRegex.exec(url);\n\n if (!matches) return null;\n\n const [, protocol, separator, host, port] = matches;\n\n if (!protocol || !separator || !host) return null;\n\n return `${protocol}:${separator}${host}${port ? `:${port}` : ''}`;\n};\n\nexport default getOrigin;\n"],"names":["getOrigin","url","matches","exec","protocol","separator","host","port"],"mappings":"AASO,MAAMA,EAAaC,IACtB,MACMC,EADc,kGACQC,KAAKF,GAEjC,IAAKC,EAAS,OAAO,KAErB,MAAM,CAAGE,EAAUC,EAAWC,EAAMC,GAAQL,EAE5C,OAAKE,GAAaC,GAAcC,EAEzB,GAAGF,KAAYC,IAAYC,IAAOC,EAAO,IAAIA,IAAS,KAFhB"}
@@ -1,2 +1,2 @@
1
- const t=(t,o=!1)=>{let r;try{r=new URL(t)}catch(t){return!1}return o&&"http:"===r.protocol||"https:"===r.protocol};export{t as isValidHttpUrl};
1
+ const t=(t,r=!1)=>{if(!t)return!1;let o;try{o=new URL(t)}catch(t){return!1}return r&&"http:"===o.protocol||"https:"===o.protocol};export{t as isValidHttpUrl};
2
2
  //# sourceMappingURL=isValidURL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidURL.js","sources":["../../../src/utils/isValidURL.ts"],"sourcesContent":["export const isValidHttpUrl = (httpUrl: string, allowHttp = false) => {\n let url: URL;\n try {\n url = new URL(httpUrl);\n } catch (_) {\n return false;\n }\n return allowHttp ? url.protocol === 'http:' || url.protocol === 'https:' : url.protocol === 'https:';\n};\n"],"names":["isValidHttpUrl","httpUrl","allowHttp","url","URL","_","protocol"],"mappings":"AAAO,MAAMA,EAAiB,CAACC,EAAiBC,GAAY,KACxD,IAAIC,EACJ,IACIA,EAAM,IAAIC,IAAIH,EAClB,CAAE,MAAOI,GACL,OAAO,CACX,CACA,OAAOH,GAA6B,UAAjBC,EAAIG,UAAqE,WAAjBH,EAAIG"}
1
+ {"version":3,"file":"isValidURL.js","sources":["../../../src/utils/isValidURL.ts"],"sourcesContent":["export const isValidHttpUrl = (httpUrl: string | null | undefined, allowHttp = false) => {\n if (!httpUrl) return false;\n\n let url: URL;\n try {\n url = new URL(httpUrl);\n } catch (_) {\n return false;\n }\n return allowHttp ? url.protocol === 'http:' || url.protocol === 'https:' : url.protocol === 'https:';\n};\n"],"names":["isValidHttpUrl","httpUrl","allowHttp","url","URL","_","protocol"],"mappings":"AAAO,MAAMA,EAAiB,CAACC,EAAoCC,GAAY,KAC3E,IAAKD,EAAS,OAAO,EAErB,IAAIE,EACJ,IACIA,EAAM,IAAIC,IAAIH,EAClB,CAAE,MAAOI,GACL,OAAO,CACX,CACA,OAAOH,GAA6B,UAAjBC,EAAIG,UAAqE,WAAjBH,EAAIG"}
@@ -1 +1 @@
1
- {"version":3,"file":"promiseTimeout.js","sources":["../../../src/utils/promiseTimeout.ts"],"sourcesContent":["/**\n * Tests if a passed promise settles before a certain amount of time has elapsed\n *\n * @param ms - number of milliseconds the passed promise has to settle\n * @param promise - the passed promise\n * @param timeOutObject - the object that the promiseTimeout will reject with if the passed promise doesn't settle in time\n */\nconst promiseTimeout = <T>(ms: number, promise: Promise<T>, timeOutObject: object): { promise: Promise<T>; cancel: () => void } => {\n let timer: NodeJS.Timeout | null;\n\n const promiseTimer: Promise<T> = new Promise((resolve, reject): void => {\n // Create a timeout to reject promise if not resolved\n timer = setTimeout((): void => {\n reject(timeOutObject);\n }, ms);\n\n promise\n .then((res): void => {\n clearTimeout(timer);\n resolve(res);\n })\n .catch((err): void => {\n clearTimeout(timer);\n reject(err);\n });\n });\n\n const cancelTimer = (): void => {\n clearTimeout(timer);\n };\n\n return {\n promise: promiseTimer,\n cancel: cancelTimer\n };\n};\n\nexport default promiseTimeout;\n"],"names":["promiseTimeout","ms","promise","timeOutObject","timer","Promise","resolve","reject","setTimeout","then","res","clearTimeout","catch","err","cancel"],"mappings":"AAOA,MAAMA,EAAiB,CAAIC,EAAYC,EAAqBC,KACxD,IAAIC,EAuBJ,MAAO,CACHF,QAtB6B,IAAIG,QAAQ,CAACC,EAASC,KAEnDH,EAAQI,WAAW,KACfD,EAAOJ,IACRF,GAEHC,EACKO,KAAMC,IACHC,aAAaP,GACbE,EAAQI,KAEXE,MAAOC,IACJF,aAAaP,GACbG,EAAOM,OAUfC,OANgB,KAChBH,aAAaP"}
1
+ {"version":3,"file":"promiseTimeout.js","sources":["../../../src/utils/promiseTimeout.ts"],"sourcesContent":["/**\n * Tests if a passed promise settles before a certain amount of time has elapsed\n *\n * @param ms - number of milliseconds the passed promise has to settle\n * @param promise - the passed promise\n * @param timeOutObject - the object that the promiseTimeout will reject with if the passed promise doesn't settle in time\n */\nconst promiseTimeout = <T>(ms: number, promise: Promise<T>, timeOutObject: object): { promise: Promise<T>; cancel: () => void } => {\n let timer: NodeJS.Timeout;\n\n const promiseTimer: Promise<T> = new Promise((resolve, reject): void => {\n // Create a timeout to reject promise if not resolved\n timer = setTimeout((): void => {\n reject(timeOutObject);\n }, ms);\n\n promise\n .then((res): void => {\n clearTimeout(timer);\n resolve(res);\n })\n .catch((err): void => {\n clearTimeout(timer);\n reject(err);\n });\n });\n\n const cancelTimer = (): void => {\n clearTimeout(timer);\n };\n\n return {\n promise: promiseTimer,\n cancel: cancelTimer\n };\n};\n\nexport default promiseTimeout;\n"],"names":["promiseTimeout","ms","promise","timeOutObject","timer","Promise","resolve","reject","setTimeout","then","res","clearTimeout","catch","err","cancel"],"mappings":"AAOA,MAAMA,EAAiB,CAAIC,EAAYC,EAAqBC,KACxD,IAAIC,EAuBJ,MAAO,CACHF,QAtB6B,IAAIG,QAAQ,CAACC,EAASC,KAEnDH,EAAQI,WAAW,KACfD,EAAOJ,IACRF,GAEHC,EACKO,KAAMC,IACHC,aAAaP,GACbE,EAAQI,KAEXE,MAAOC,IACJF,aAAaP,GACbG,EAAOM,OAUfC,OANgB,KAChBH,aAAaP"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAutoFocus.js","sources":["../../../src/utils/useAutoFocus.ts"],"sourcesContent":["import { useRef, useEffect } from 'preact/hooks';\n\nconst useAutoFocus = () => {\n const ref = useRef(null);\n\n useEffect(() => {\n ref.current?.focus();\n }, []);\n\n return ref;\n};\n\nexport default useAutoFocus;\n"],"names":["useAutoFocus","ref","useRef","useEffect","current","focus"],"mappings":"+EAEA,MAAMA,EAAe,KACjB,MAAMC,EAAMC,EAAO,MAMnB,OAJAC,EAAU,KACNF,EAAIG,SAASC,SACd,IAEIJ"}
1
+ {"version":3,"file":"useAutoFocus.js","sources":["../../../src/utils/useAutoFocus.ts"],"sourcesContent":["import { useRef, useEffect } from 'preact/hooks';\n\nconst useAutoFocus = <T extends HTMLElement = HTMLElement>() => {\n const ref = useRef<T | null>(null);\n\n useEffect(() => {\n ref.current?.focus();\n }, []);\n\n return ref;\n};\n\nexport default useAutoFocus;\n"],"names":["useAutoFocus","ref","useRef","useEffect","current","focus"],"mappings":"+EAEA,MAAMA,EAAe,KACjB,MAAMC,EAAMC,EAAiB,MAM7B,OAJAC,EAAU,KACNF,EAAIG,SAASC,SACd,IAEIJ"}