react-native-unit-components 1.8.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +9 -12
  2. package/android/src/main/java/com/unitreactnativecomponents/appInfo/UNAppInfoModule.kt +59 -0
  3. package/android/src/main/java/com/unitreactnativecomponents/extensions/ContextExtensions.kt +35 -0
  4. package/ios/Extensions/Bundle+Extensions.swift +23 -0
  5. package/ios/UNAppInfo/IOSAppInfo.swift +47 -0
  6. package/ios/UNAppInfo/UNAppInfoExportModule.m +5 -2
  7. package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +34 -0
  8. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -4
  9. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  10. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
  11. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  12. package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
  13. package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
  14. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -4
  15. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  16. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
  17. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  18. package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
  19. package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
  20. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +21 -15
  21. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  22. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
  23. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  24. package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
  25. package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
  26. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +17 -11
  27. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  28. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
  29. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  30. package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
  31. package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
  32. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
  33. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  34. package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
  35. package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
  36. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
  37. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  38. package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
  39. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
  40. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
  41. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
  42. package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
  43. package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
  44. package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
  45. package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
  46. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +34 -10
  47. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  48. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
  49. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  50. package/lib/commonjs/components/UNCardComponent/index.js +27 -0
  51. package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
  52. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
  53. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  54. package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
  55. package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
  56. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +86 -0
  57. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
  58. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +41 -0
  59. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
  60. package/lib/commonjs/components/UNMultipleCardsComponent/index.js +21 -0
  61. package/lib/commonjs/components/UNMultipleCardsComponent/index.js.map +1 -0
  62. package/lib/commonjs/components/index.js +19 -8
  63. package/lib/commonjs/components/index.js.map +1 -1
  64. package/lib/commonjs/flows/card/UNCardFlows.js +8 -4
  65. package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -1
  66. package/lib/commonjs/helpers/pushProvisioningService/helpers.js +34 -0
  67. package/lib/commonjs/helpers/pushProvisioningService/helpers.js.map +1 -0
  68. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +49 -3
  69. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
  70. package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
  71. package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
  72. package/lib/commonjs/helpers/pushProvisioningService/types.js +41 -0
  73. package/lib/commonjs/helpers/pushProvisioningService/types.js.map +1 -0
  74. package/lib/commonjs/helpers/store/helpers.js +29 -0
  75. package/lib/commonjs/helpers/store/helpers.js.map +1 -0
  76. package/lib/commonjs/hooks/useListenerToEvent.js +26 -0
  77. package/lib/commonjs/hooks/useListenerToEvent.js.map +1 -0
  78. package/lib/commonjs/messages/webMessages/index.js.map +1 -1
  79. package/lib/commonjs/messages/webMessages/multipleCardsMessage.js +12 -0
  80. package/lib/commonjs/messages/webMessages/multipleCardsMessage.js.map +1 -0
  81. package/lib/commonjs/messages/webMessages/onLoadMessage.js +2 -1
  82. package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
  83. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +30 -6
  84. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  85. package/lib/commonjs/scripts/html/bodyScript.js +13 -1
  86. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  87. package/lib/commonjs/slices/ConfigurationSlice.js +36 -0
  88. package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -0
  89. package/lib/commonjs/slices/SharedEventsSlice.js +28 -0
  90. package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -0
  91. package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
  92. package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
  93. package/lib/commonjs/store/index.js +17 -0
  94. package/lib/commonjs/store/index.js.map +1 -0
  95. package/lib/commonjs/store/store.js +20 -0
  96. package/lib/commonjs/store/store.js.map +1 -0
  97. package/lib/commonjs/types/internal/errorHelpers.js +20 -0
  98. package/lib/commonjs/types/internal/errorHelpers.js.map +1 -0
  99. package/lib/commonjs/types/internal/webComponent.types.js +1 -0
  100. package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
  101. package/lib/commonjs/types/shared/activity.types.js +7 -0
  102. package/lib/commonjs/types/shared/activity.types.js.map +1 -1
  103. package/lib/commonjs/types/shared/error.types.js +29 -0
  104. package/lib/commonjs/types/shared/error.types.js.map +1 -0
  105. package/lib/commonjs/types/shared/index.js +33 -0
  106. package/lib/commonjs/types/shared/index.js.map +1 -1
  107. package/lib/commonjs/types/shared/multipleCards.types.js +13 -0
  108. package/lib/commonjs/types/shared/multipleCards.types.js.map +1 -0
  109. package/lib/commonjs/types/shared/onLoadResponse.types.js +4 -0
  110. package/lib/commonjs/types/shared/onLoadResponse.types.js.map +1 -1
  111. package/lib/commonjs/types/shared/versioning.types.js +14 -0
  112. package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
  113. package/lib/commonjs/unitSdkManager/UnitSdk.api.js +9 -14
  114. package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
  115. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
  116. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
  117. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +21 -22
  118. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  119. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
  120. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
  121. package/lib/commonjs/utils/AppInfo.js +49 -0
  122. package/lib/commonjs/utils/AppInfo.js.map +1 -0
  123. package/lib/commonjs/utils/SDKInfo.js +13 -0
  124. package/lib/commonjs/utils/SDKInfo.js.map +1 -0
  125. package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
  126. package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
  127. package/lib/commonjs/webComponent/WebComponent.js +30 -32
  128. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  129. package/lib/commonjs/webComponent/WebComponent.utils.js +19 -1
  130. package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
  131. package/lib/commonjs/webComponent/html.js +4 -0
  132. package/lib/commonjs/webComponent/html.js.map +1 -1
  133. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +5 -3
  134. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  135. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
  136. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  137. package/lib/module/components/UNACHCreditComponent/index.js +2 -0
  138. package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
  139. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -3
  140. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  141. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
  142. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  143. package/lib/module/components/UNACHDebitComponent/index.js +2 -0
  144. package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
  145. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +19 -12
  146. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  147. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
  148. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  149. package/lib/module/components/UNAccountComponent/index.js +2 -0
  150. package/lib/module/components/UNAccountComponent/index.js.map +1 -0
  151. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +16 -9
  152. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  153. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
  154. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  155. package/lib/module/components/UNActivityComponent/index.js +2 -0
  156. package/lib/module/components/UNActivityComponent/index.js.map +1 -0
  157. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
  158. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  159. package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
  160. package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
  161. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
  162. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  163. package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
  164. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
  165. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
  166. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
  167. package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
  168. package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
  169. package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
  170. package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
  171. package/lib/module/components/UNCardComponent/UNCardComponent.js +34 -9
  172. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  173. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
  174. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  175. package/lib/module/components/UNCardComponent/index.js +2 -0
  176. package/lib/module/components/UNCardComponent/index.js.map +1 -0
  177. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
  178. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  179. package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
  180. package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
  181. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +77 -0
  182. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
  183. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +33 -0
  184. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
  185. package/lib/module/components/UNMultipleCardsComponent/index.js +2 -0
  186. package/lib/module/components/UNMultipleCardsComponent/index.js.map +1 -0
  187. package/lib/module/components/index.js +9 -8
  188. package/lib/module/components/index.js.map +1 -1
  189. package/lib/module/flows/card/UNCardFlows.js +8 -3
  190. package/lib/module/flows/card/UNCardFlows.js.map +1 -1
  191. package/lib/module/helpers/pushProvisioningService/helpers.js +24 -0
  192. package/lib/module/helpers/pushProvisioningService/helpers.js.map +1 -0
  193. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +50 -4
  194. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
  195. package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
  196. package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
  197. package/lib/module/helpers/pushProvisioningService/types.js +34 -0
  198. package/lib/module/helpers/pushProvisioningService/types.js.map +1 -0
  199. package/lib/module/helpers/store/helpers.js +20 -0
  200. package/lib/module/helpers/store/helpers.js.map +1 -0
  201. package/lib/module/hooks/useListenerToEvent.js +19 -0
  202. package/lib/module/hooks/useListenerToEvent.js.map +1 -0
  203. package/lib/module/messages/webMessages/index.js.map +1 -1
  204. package/lib/module/messages/webMessages/multipleCardsMessage.js +5 -0
  205. package/lib/module/messages/webMessages/multipleCardsMessage.js.map +1 -0
  206. package/lib/module/messages/webMessages/onLoadMessage.js +2 -1
  207. package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
  208. package/lib/module/networking/requests/UNWalletPayloadRequest.js +29 -6
  209. package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  210. package/lib/module/scripts/html/bodyScript.js +10 -0
  211. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  212. package/lib/module/slices/ConfigurationSlice.js +25 -0
  213. package/lib/module/slices/ConfigurationSlice.js.map +1 -0
  214. package/lib/module/slices/SharedEventsSlice.js +19 -0
  215. package/lib/module/slices/SharedEventsSlice.js.map +1 -0
  216. package/lib/module/slices/pushProvisioningSlice.js +19 -0
  217. package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
  218. package/lib/module/store/index.js +2 -0
  219. package/lib/module/store/index.js.map +1 -0
  220. package/lib/module/store/store.js +12 -0
  221. package/lib/module/store/store.js.map +1 -0
  222. package/lib/module/types/internal/errorHelpers.js +12 -0
  223. package/lib/module/types/internal/errorHelpers.js.map +1 -0
  224. package/lib/module/types/internal/webComponent.types.js +1 -0
  225. package/lib/module/types/internal/webComponent.types.js.map +1 -1
  226. package/lib/module/types/shared/activity.types.js +5 -1
  227. package/lib/module/types/shared/activity.types.js.map +1 -1
  228. package/lib/module/types/shared/error.types.js +22 -0
  229. package/lib/module/types/shared/error.types.js.map +1 -0
  230. package/lib/module/types/shared/index.js +3 -0
  231. package/lib/module/types/shared/index.js.map +1 -1
  232. package/lib/module/types/shared/multipleCards.types.js +6 -0
  233. package/lib/module/types/shared/multipleCards.types.js.map +1 -0
  234. package/lib/module/types/shared/onLoadResponse.types.js +1 -1
  235. package/lib/module/types/shared/onLoadResponse.types.js.map +1 -1
  236. package/lib/module/types/shared/versioning.types.js +7 -0
  237. package/lib/module/types/shared/versioning.types.js.map +1 -0
  238. package/lib/module/unitSdkManager/UnitSdk.api.js +9 -12
  239. package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
  240. package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
  241. package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
  242. package/lib/module/unitSdkManager/UnitSdkManager.js +20 -19
  243. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  244. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
  245. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
  246. package/lib/module/utils/AppInfo.js +39 -0
  247. package/lib/module/utils/AppInfo.js.map +1 -0
  248. package/lib/module/utils/SDKInfo.js +5 -0
  249. package/lib/module/utils/SDKInfo.js.map +1 -0
  250. package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
  251. package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
  252. package/lib/module/webComponent/WebComponent.js +33 -34
  253. package/lib/module/webComponent/WebComponent.js.map +1 -1
  254. package/lib/module/webComponent/WebComponent.utils.js +15 -0
  255. package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
  256. package/lib/module/webComponent/html.js +5 -1
  257. package/lib/module/webComponent/html.js.map +1 -1
  258. package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
  259. package/lib/typescript/src/components/UNACHCreditComponent/index.d.ts +1 -0
  260. package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
  261. package/lib/typescript/src/components/UNACHDebitComponent/index.d.ts +1 -0
  262. package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts +3 -2
  263. package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
  264. package/lib/typescript/src/components/UNAccountComponent/index.d.ts +1 -0
  265. package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts +5 -1
  266. package/lib/typescript/src/components/UNActivityComponent/index.d.ts +1 -0
  267. package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
  268. package/lib/typescript/src/components/UNBookPaymentComponent/index.d.ts +1 -0
  269. package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
  270. package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.d.ts +2 -2
  271. package/lib/typescript/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
  272. package/lib/typescript/src/components/UNBottomSheetComponent/components/index.d.ts +1 -0
  273. package/lib/typescript/src/components/UNBottomSheetComponent/index.d.ts +1 -0
  274. package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.d.ts +4 -1
  275. package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
  276. package/lib/typescript/src/components/UNCardComponent/index.d.ts +1 -0
  277. package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
  278. package/lib/typescript/src/components/UNCheckDepositComponent/index.d.ts +1 -0
  279. package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +15 -0
  280. package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +3 -0
  281. package/lib/typescript/src/components/UNMultipleCardsComponent/index.d.ts +1 -0
  282. package/lib/typescript/src/components/index.d.ts +9 -0
  283. package/lib/typescript/src/helpers/pushProvisioningService/helpers.d.ts +4 -0
  284. package/lib/typescript/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
  285. package/lib/typescript/src/helpers/pushProvisioningService/types.d.ts +49 -0
  286. package/lib/typescript/src/helpers/store/helpers.d.ts +3 -0
  287. package/lib/typescript/src/hooks/useListenerToEvent.d.ts +9 -0
  288. package/lib/typescript/{messages → src/messages}/webMessages/index.d.ts +3 -2
  289. package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts +6 -0
  290. package/lib/typescript/{messages → src/messages}/webMessages/onLoadMessage.d.ts +7 -3
  291. package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts +2 -0
  292. package/lib/typescript/{scripts → src/scripts}/html/bodyScript.d.ts +2 -0
  293. package/lib/typescript/src/slices/ConfigurationSlice.d.ts +10 -0
  294. package/lib/typescript/src/slices/SharedEventsSlice.d.ts +56 -0
  295. package/lib/typescript/src/slices/pushProvisioningSlice.d.ts +8 -0
  296. package/lib/typescript/src/store/index.d.ts +1 -0
  297. package/lib/typescript/src/store/store.d.ts +76 -0
  298. package/lib/typescript/src/types/internal/errorHelpers.d.ts +4 -0
  299. package/lib/typescript/{types → src/types}/internal/webComponent.types.d.ts +1 -0
  300. package/lib/typescript/{types → src/types}/shared/activity.types.d.ts +5 -1
  301. package/lib/typescript/src/types/shared/error.types.d.ts +36 -0
  302. package/lib/typescript/{types → src/types}/shared/index.d.ts +3 -0
  303. package/lib/typescript/src/types/shared/multipleCards.types.d.ts +6 -0
  304. package/lib/typescript/src/types/shared/onLoadResponse.types.d.ts +5 -0
  305. package/lib/typescript/src/types/shared/versioning.types.d.ts +22 -0
  306. package/lib/typescript/src/unitSdkManager/UnitSdk.api.d.ts +1 -0
  307. package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts +8 -0
  308. package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.d.ts +11 -10
  309. package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
  310. package/lib/typescript/src/utils/AppInfo.d.ts +4 -0
  311. package/lib/typescript/src/utils/SDKInfo.d.ts +1 -0
  312. package/lib/typescript/src/utils/webVersioningStrategy.utils.d.ts +5 -0
  313. package/lib/typescript/{webComponent → src/webComponent}/WebComponent.utils.d.ts +3 -0
  314. package/package.json +8 -6
  315. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +7 -3
  316. package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
  317. package/src/components/UNACHCreditComponent/index.ts +1 -0
  318. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -3
  319. package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
  320. package/src/components/UNACHDebitComponent/index.ts +1 -0
  321. package/src/components/UNAccountComponent/UNAccountComponent.tsx +30 -14
  322. package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
  323. package/src/components/UNAccountComponent/index.ts +1 -0
  324. package/src/components/UNActivityComponent/UNActivityComponent.tsx +37 -17
  325. package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -1
  326. package/src/components/UNActivityComponent/index.ts +1 -0
  327. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
  328. package/src/components/UNBookPaymentComponent/index.ts +1 -0
  329. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +59 -32
  330. package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +18 -13
  331. package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
  332. package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
  333. package/src/components/UNBottomSheetComponent/index.ts +1 -0
  334. package/src/components/UNCardComponent/UNCardComponent.tsx +51 -14
  335. package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
  336. package/src/components/UNCardComponent/index.ts +1 -0
  337. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
  338. package/src/components/UNCheckDepositComponent/index.ts +1 -0
  339. package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +119 -0
  340. package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +36 -0
  341. package/src/components/UNMultipleCardsComponent/index.ts +3 -0
  342. package/src/components/index.ts +9 -8
  343. package/src/flows/card/UNCardFlows.ts +10 -4
  344. package/src/helpers/pushProvisioningService/helpers.ts +31 -0
  345. package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +46 -7
  346. package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
  347. package/src/helpers/pushProvisioningService/types.ts +52 -0
  348. package/src/helpers/store/helpers.tsx +22 -0
  349. package/src/hooks/useListenerToEvent.ts +32 -0
  350. package/src/messages/webMessages/index.ts +3 -0
  351. package/src/messages/webMessages/multipleCardsMessage.ts +9 -0
  352. package/src/messages/webMessages/onLoadMessage.ts +14 -3
  353. package/src/networking/requests/UNWalletPayloadRequest.ts +30 -7
  354. package/src/scripts/html/bodyScript.ts +13 -1
  355. package/src/slices/ConfigurationSlice.ts +31 -0
  356. package/src/slices/SharedEventsSlice.ts +93 -0
  357. package/src/slices/pushProvisioningSlice.ts +24 -0
  358. package/src/store/index.ts +1 -0
  359. package/src/store/store.ts +14 -0
  360. package/src/types/internal/errorHelpers.ts +22 -0
  361. package/src/types/internal/webComponent.types.ts +1 -1
  362. package/src/types/shared/activity.types.ts +6 -1
  363. package/src/types/shared/error.types.ts +38 -0
  364. package/src/types/shared/index.ts +3 -0
  365. package/src/types/shared/multipleCards.types.ts +8 -0
  366. package/src/types/shared/onLoadResponse.types.ts +2 -12
  367. package/src/types/shared/versioning.types.ts +28 -0
  368. package/src/unitSdkManager/UnitSdk.api.ts +10 -10
  369. package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
  370. package/src/unitSdkManager/UnitSdkManager.ts +21 -24
  371. package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
  372. package/src/utils/AppInfo.ts +40 -0
  373. package/src/utils/SDKInfo.ts +5 -0
  374. package/src/utils/webVersioningStrategy.utils.ts +52 -0
  375. package/src/webComponent/WebComponent.tsx +37 -34
  376. package/src/webComponent/WebComponent.utils.ts +17 -0
  377. package/src/webComponent/html.ts +16 -2
  378. package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +0 -35
  379. package/ios/UNAppInfo/UNAppInfo.swift +0 -23
  380. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
  381. package/lib/commonjs/components/utils/nativeModulesInfo.js +0 -20
  382. package/lib/commonjs/components/utils/nativeModulesInfo.js.map +0 -1
  383. package/lib/commonjs/helpers/EventBus.js +0 -58
  384. package/lib/commonjs/helpers/EventBus.js.map +0 -1
  385. package/lib/commonjs/hooks/listenerToBus.js +0 -34
  386. package/lib/commonjs/hooks/listenerToBus.js.map +0 -1
  387. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
  388. package/lib/module/components/utils/nativeModulesInfo.js +0 -13
  389. package/lib/module/components/utils/nativeModulesInfo.js.map +0 -1
  390. package/lib/module/helpers/EventBus.js +0 -51
  391. package/lib/module/helpers/EventBus.js.map +0 -1
  392. package/lib/module/hooks/listenerToBus.js +0 -25
  393. package/lib/module/hooks/listenerToBus.js.map +0 -1
  394. package/lib/typescript/components/index.d.ts +0 -8
  395. package/lib/typescript/components/utils/nativeModulesInfo.d.ts +0 -1
  396. package/lib/typescript/helpers/EventBus.d.ts +0 -13
  397. package/lib/typescript/hooks/listenerToBus.d.ts +0 -7
  398. package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +0 -2
  399. package/lib/typescript/types/shared/onLoadResponse.types.d.ts +0 -14
  400. package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +0 -3
  401. package/src/components/utils/nativeModulesInfo.ts +0 -11
  402. package/src/helpers/EventBus.ts +0 -58
  403. package/src/hooks/listenerToBus.ts +0 -31
  404. /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
  405. /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
  406. /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
  407. /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
  408. /package/lib/typescript/{assets → src/assets}/images/index.d.ts +0 -0
  409. /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +0 -0
  410. /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -0
  411. /package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.utils.d.ts +0 -0
  412. /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +0 -0
  413. /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +0 -0
  414. /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +0 -0
  415. /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +0 -0
  416. /package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.styles.d.ts +0 -0
  417. /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +0 -0
  418. /package/lib/typescript/{flows → src/flows}/UNFlows.d.ts +0 -0
  419. /package/lib/typescript/{flows → src/flows}/card/UNCardFlows.d.ts +0 -0
  420. /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.d.ts +0 -0
  421. /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.styles.d.ts +0 -0
  422. /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/hooks/useCardWallet.d.ts +0 -0
  423. /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/startProvisioning.d.ts +0 -0
  424. /package/lib/typescript/{hooks → src/hooks}/useAppStateListener.d.ts +0 -0
  425. /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
  426. /package/lib/typescript/{messages → src/messages}/nativeMessages/bottomSheetMessage.d.ts +0 -0
  427. /package/lib/typescript/{messages → src/messages}/nativeMessages/cardMessage.d.ts +0 -0
  428. /package/lib/typescript/{messages → src/messages}/nativeMessages/index.d.ts +0 -0
  429. /package/lib/typescript/{messages → src/messages}/nativeMessages/sdkMessage.d.ts +0 -0
  430. /package/lib/typescript/{messages → src/messages}/webMessages/accountMessage.d.ts +0 -0
  431. /package/lib/typescript/{messages → src/messages}/webMessages/achCreditMessage.d.ts +0 -0
  432. /package/lib/typescript/{messages → src/messages}/webMessages/activityMessage.d.ts +0 -0
  433. /package/lib/typescript/{messages → src/messages}/webMessages/bookPaymentMessage.d.ts +0 -0
  434. /package/lib/typescript/{messages → src/messages}/webMessages/cardMessage.d.ts +0 -0
  435. /package/lib/typescript/{messages → src/messages}/webMessages/checkMessage.d.ts +0 -0
  436. /package/lib/typescript/{messages → src/messages}/webMessages/pageMessage.d.ts +0 -0
  437. /package/lib/typescript/{messages → src/messages}/webMessages/paymentsMessage.d.ts +0 -0
  438. /package/lib/typescript/{messages → src/messages}/webMessages/unitMessages.d.ts +0 -0
  439. /package/lib/typescript/{nativeComponent → src/nativeComponent}/UnitAddToWalletButton.d.ts +0 -0
  440. /package/lib/typescript/{networking → src/networking}/common/UNNetworkConstants.d.ts +0 -0
  441. /package/lib/typescript/{scripts → src/scripts}/html/bodyHtml.d.ts +0 -0
  442. /package/lib/typescript/{scripts → src/scripts}/html/fontFaces.d.ts +0 -0
  443. /package/lib/typescript/{styles → src/styles}/fonts.d.ts +0 -0
  444. /package/lib/typescript/{styles → src/styles}/variables.d.ts +0 -0
  445. /package/lib/typescript/{types → src/types}/internal/bottomSheet.types.d.ts +0 -0
  446. /package/lib/typescript/{types → src/types}/shared/account.types.d.ts +0 -0
  447. /package/lib/typescript/{types → src/types}/shared/achCredit.types.d.ts +0 -0
  448. /package/lib/typescript/{types → src/types}/shared/authorization.types.d.ts +0 -0
  449. /package/lib/typescript/{types → src/types}/shared/bookPayment.types.d.ts +0 -0
  450. /package/lib/typescript/{types → src/types}/shared/card.types.d.ts +0 -0
  451. /package/lib/typescript/{types → src/types}/shared/checkDeposit.types.d.ts +0 -0
  452. /package/lib/typescript/{types → src/types}/shared/fonts.types.d.ts +0 -0
  453. /package/lib/typescript/{types → src/types}/shared/payments.types.d.ts +0 -0
  454. /package/lib/typescript/{types → src/types}/shared/transactions.types.d.ts +0 -0
  455. /package/lib/typescript/{types → src/types}/shared/types.d.ts +0 -0
  456. /package/lib/typescript/{types → src/types}/shared/wallet.types.d.ts +0 -0
  457. /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/unitUiManager/unitUiManager.d.ts +0 -0
  458. /package/lib/typescript/{webComponent → src/webComponent}/WebComponent.d.ts +0 -0
  459. /package/lib/typescript/{webComponent → src/webComponent}/html.d.ts +0 -0
  460. /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_bodyScript","require","_webComponent","getCardParams","props","cardId","customerToken","pushProvisioningModule","hideActionsMenuButton","hideCardTitle","hideSensitiveDataButton","learnMoreUrl","exports","getCardScript","DISPATCH_REQUEST_REFRESH","injectOpenActionsMenuScript","currentWeb","injectJavaScript","WebComponentType","card","injectRequestCardActionScript","action","injectRefreshEventIfNeeded","requestRefreshEvent","dependencies","includes","valueOf","resourceId","JSON","stringify"],"sources":["UNCardComponent.utils.ts"],"sourcesContent":["import { DISPATCH_REQUEST_REFRESH } from './../../scripts/html/bodyScript';\nimport type WebView from 'react-native-webview';\nimport type { UNCardComponentProps } from './UNCardComponent';\nimport type { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';\nimport type { UNCardMenuAction } from '../../types/shared';\nimport { WebComponentType } from '../../types/internal/webComponent.types';\n\nexport const getCardParams = (props: UNCardComponentProps) => {\n return `\n card-id=\"${props.cardId}\"\n customer-token=\"${props.customerToken}\"\n enable-mobile-wallet=\"${!!props.pushProvisioningModule}\"\n hide-actions-menu-button=\"${props.hideActionsMenuButton || false}\"\n hide-card-title=\"${props.hideCardTitle || false}\"\n hide-sensitive-data-button=\"${props.hideSensitiveDataButton || false}\"\n learn-more-url=\"${props.learnMoreUrl || ''}\"\n `;\n};\n\nexport const getCardScript = () => {\n return DISPATCH_REQUEST_REFRESH;\n};\n\nexport const injectOpenActionsMenuScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchOpenActionsMenu('${WebComponentType.card}')`);\n};\n\nexport const injectRequestCardActionScript = (currentWeb: WebView | null, action: UNCardMenuAction) => {\n currentWeb?.injectJavaScript(`dispatchRequestCardAction('${action}')`);\n};\n\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAIC,KAA2B,IAAK;EAC5D,OAAQ;AACV,eAAeA,KAAK,CAACC,MAAO;AAC5B,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,4BAA4B,CAAC,CAACF,KAAK,CAACG,sBAAuB;AAC3D,gCAAgCH,KAAK,CAACI,qBAAqB,IAAI,KAAM;AACrE,uBAAuBJ,KAAK,CAACK,aAAa,IAAI,KAAM;AACpD,kCAAkCL,KAAK,CAACM,uBAAuB,IAAI,KAAM;AACzE,sBAAsBN,KAAK,CAACO,YAAY,IAAI,EAAG;AAC/C,GAAG;AACH,CAAC;AAACC,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAEK,MAAMU,aAAa,GAAGA,CAAA,KAAM;EACjC,OAAOC,oCAAwB;AACjC,CAAC;AAACF,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAEK,MAAME,2BAA2B,GAAIC,UAA0B,IAAK;EACzEA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,4BAA2BC,8BAAgB,CAACC,IAAK,IAAG,CAAC;AACrF,CAAC;AAACP,OAAA,CAAAG,2BAAA,GAAAA,2BAAA;AAEK,MAAMK,6BAA6B,GAAGA,CAACJ,UAA0B,EAAEK,MAAwB,KAAK;EACrGL,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,8BAA6BI,MAAO,IAAG,CAAC;AACxE,CAAC;AAACT,OAAA,CAAAQ,6BAAA,GAAAA,6BAAA;AAEK,MAAME,0BAA0B,GAAGA,CAACN,UAA0B,EAAEO,mBAA+C,EAAElB,MAAc,KAAK;EACzI,IAAIkB,mBAAmB,IAAIA,mBAAmB,CAACC,YAAY,CAACC,QAAQ,CAACP,8BAAgB,CAACC,IAAI,CAACO,OAAO,EAAE,CAAC,IAAIH,mBAAmB,CAACI,UAAU,IAAItB,MAAM,EAAE;IACjJW,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,yBAAwBW,IAAI,CAACC,SAAS,CAACN,mBAAmB,CAAE,IAAG,CAAC;EAChG;AACF,CAAC;AAACX,OAAA,CAAAU,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["_bodyScript","require","_webComponent","getCardParams","props","cardId","customerToken","pushProvisioningModule","hideActionsMenuButton","hideCardTitle","hideSensitiveDataButton","learnMoreUrl","exports","getCardScript","DISPATCH_REQUEST_REFRESH","injectOpenActionsMenuScript","currentWeb","injectJavaScript","WebComponentType","card","injectRequestCardActionScript","action","injectRequestHideSensitiveDataScript","injectRequestShowSensitiveDataScript","injectRefreshEventIfNeeded","requestRefreshEvent","dependencies","includes","valueOf","resourceId","JSON","stringify"],"sources":["UNCardComponent.utils.ts"],"sourcesContent":["import { DISPATCH_REQUEST_REFRESH } from './../../scripts/html/bodyScript';\nimport type WebView from 'react-native-webview';\nimport type { UNCardComponentProps } from './UNCardComponent';\nimport type { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';\nimport type { UNCardMenuAction } from '../../types/shared';\nimport { WebComponentType } from '../../types/internal/webComponent.types';\n\nexport const getCardParams = (props: UNCardComponentProps) => {\n return `\n card-id=\"${props.cardId}\"\n customer-token=\"${props.customerToken}\"\n enable-mobile-wallet=\"${!!props.pushProvisioningModule}\"\n hide-actions-menu-button=\"${props.hideActionsMenuButton || false}\"\n hide-card-title=\"${props.hideCardTitle || false}\"\n hide-sensitive-data-button=\"${props.hideSensitiveDataButton || false}\"\n learn-more-url=\"${props.learnMoreUrl || ''}\"\n `;\n};\n\nexport const getCardScript = () => {\n return DISPATCH_REQUEST_REFRESH;\n};\n\nexport const injectOpenActionsMenuScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchOpenActionsMenu('${WebComponentType.card}')`);\n};\n\nexport const injectRequestCardActionScript = (currentWeb: WebView | null, action: UNCardMenuAction) => {\n currentWeb?.injectJavaScript(`dispatchRequestCardAction('${action}')`);\n};\n\nexport const injectRequestHideSensitiveDataScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchRequestHideSensitiveData('${WebComponentType.card}')`);\n};\n\nexport const injectRequestShowSensitiveDataScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchRequestShowSensitiveData('${WebComponentType.card}')`);\n};\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAIC,KAA2B,IAAK;EAC5D,OAAQ;AACV,eA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AC;AAACP,OAAA,CAAAW,oCAAA,GAAAA,oCAAA;AACK,MAAMC,0BAA0B,GAAGA,CAACR,UAA0B,EAAES,mBAA+C,EAAEpB,MAAc,KAAK;EACzI,IAAIoB,mBAAmB,IAAIA,mBAAmB,CAACC,YAAY,CAACC,QAAQ,CAACT,8BAAgB,CAACC,IAAI,CAACS,OAAO,EAAE,CAAC,IAAIH,mBAAmB,CAACI,UAAU,IAAIxB,MAAM,EAAE;IACjJW,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,yBAAwBa,IAAI,CAACC,SAAS,CAACN,mBAAmB,CAAE,IAAG,CAAC;EAChG;AACF,CAAC;AAACb,OAAA,CAAAY,0BAAA,GAAAA,0BAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "CardRef", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _UNCardComponent.CardRef;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "UNCardComponent", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _UNCardComponent.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "UNCardComponentProps", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _UNCardComponent.UNCardComponentProps;
22
+ }
23
+ });
24
+ var _UNCardComponent = _interopRequireWildcard(require("./UNCardComponent"));
25
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_UNCardComponent","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["index.ts"],"sourcesContent":["export { default as UNCardComponent, UNCardComponentProps, CardRef } from './UNCardComponent';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8F,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UNCheckDepositComponent = void 0;
6
+ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _WebComponent = require("../../webComponent/WebComponent");
@@ -13,6 +13,7 @@ var _UNCheckDepositComponent = require("./UNCheckDepositComponent.utils");
13
13
  var _checkMessage = require("../../messages/webMessages/checkMessage");
14
14
  var _onLoadMessage = require("../../messages/webMessages/onLoadMessage");
15
15
  var _webComponent = require("../../types/internal/webComponent.types");
16
+ var _helpers = require("../../helpers/store/helpers");
16
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
19
  const {
@@ -94,5 +95,6 @@ const UNCheckDepositComponent = props => {
94
95
  }
95
96
  }, renderBookPaymentWebView());
96
97
  };
97
- exports.UNCheckDepositComponent = UNCheckDepositComponent;
98
+ var _default = (0, _helpers.withReduxStore)(UNCheckDepositComponent);
99
+ exports.default = _default;
98
100
  //# sourceMappingURL=UNCheckDepositComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_WebComponent","_pageMessage","_unitMessages","_UNCheckDepositComponent","_checkMessage","_onLoadMessage","_webComponent","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Camera","NativeModules","UNCheckDepositComponent","props","height","setHeight","useState","presentationMode","setPresentationMode","PresentationMode","Inherit","useEffect","requestCameraAccess","requestAccess","error","console","Platform","OS","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","account","handleWebViewMessage","message","details","type","CheckMessage","CHECK_DEPOSIT_CREATED","onDepositCreated","CHECK_DEPOSIT_RESTART_REQUEST","onRestartRequest","UnitMessage","UNIT_ON_LOAD","PageMessage","PAGE_HEIGHT","currentHeight","Default","renderBookPaymentWebView","createElement","WebComponent","WebComponentType","checkDeposit","params","getCheckDepositParams","script","getCheckDepositScript","onMessage","theme","language","isScrollable","View","style","exports"],"sources":["UNCheckDepositComponent.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { View, NativeModules, Platform } from 'react-native';\nimport { WebComponent } from '../../webComponent/WebComponent';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { getCheckDepositParams, getCheckDepositScript } from './UNCheckDepositComponent.utils';\nimport { CheckMessage } from '../../messages/webMessages/checkMessage';\nimport type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';\nimport type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';\nimport { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\nimport { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\n\nconst { Camera } = NativeModules;\n\nexport interface UNCheckDepositComponentProps {\n accountId: string;\n fee: number;\n customerToken: string;\n theme?: string;\n language?: string;\n onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;\n onDepositCreated?: (checkData: UNCheckDepositData) => void\n onRestartRequest?: (checkData: UNCheckDepositData) => void\n}\n\nexport const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {\n const [height, setHeight] = useState<number>(0);\n const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);\n\n useEffect(() => {\n const requestCameraAccess = async () => {\n try {\n await Camera.requestAccess();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n console.error(error);\n }\n };\n\n if (Platform.OS == 'ios') {\n requestCameraAccess();\n }\n }, []);\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.account in response) {\n // AccountOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.account] as UNOnLoadResponseData<UNAccountData>);\n return;\n }\n\n console.error('On Load Error: unexpected response type');\n return;\n };\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (!message || !message.details) return;\n\n switch (message.type) {\n case CheckMessage.CHECK_DEPOSIT_CREATED:\n props.onDepositCreated && props.onDepositCreated(message.details as UNCheckDepositData);\n break;\n case CheckMessage.CHECK_DEPOSIT_RESTART_REQUEST:\n props.onRestartRequest && props.onRestartRequest(message.details as UNCheckDepositData);\n break;\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case PageMessage.PAGE_HEIGHT: {\n const currentHeight = (message.details as HeightEvent).height;\n setHeight(currentHeight);\n if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {\n setPresentationMode(PresentationMode.Default);\n }\n break;\n }\n }\n };\n\n const renderBookPaymentWebView = () => {\n return (\n <WebComponent\n type={WebComponentType.checkDeposit}\n presentationMode={presentationMode}\n params={getCheckDepositParams(props)}\n script={getCheckDepositScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n theme={props.theme}\n language={props.language}\n isScrollable={true}\n />\n );\n };\n\n if (presentationMode === PresentationMode.Inherit) {\n return renderBookPaymentWebView();\n }\n\n return (\n <View style={{ height: height }}>\n {renderBookPaymentWebView()}\n </View>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAGA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAA6F,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,C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OAAO,CAACC,OAAO,CAA4B;QAC5D;MACF,KAAKS,wBAAW,CAACC,WAAW;QAAE;UAC5B,MAAMC,aAAa,GAAIZ,OAAO,CAACC,OAAO,CAAiBtB,MAAM;UAC7DC,SAAS,CAACgC,aAAa,CAAC;UACxB,IAAI9B,gBAAgB,KAAKE,8BAAgB,CAACC,OAAO,IAAI2B,aAAa,KAAK,CAAC,EAAE;YACxE7B,mBAAmB,CAACC,8BAAgB,CAAC6B,OAAO,CAAC;UAC/C;UACA;QACF;IAAC;EAEL,CAAC;EAED,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;IACrC,oBACExE,MAAA,CAAAkB,OAAA,CAAAuD,aAAA,CAACrE,aAAA,CAAAsE,YAAY;MACXd,IAAI,EAAEe,8BAAgB,CAACC,YAAa;MACpCpC,gBAAgB,EAAEA,gBAAiB;MACnCqC,MAAM,EAAE,IAAAC,8CAAqB,EAAC1C,KAAK,CAAE;MACrC2C,MAAM,EAAE,IAAAC,8CAAqB,GAAG;MAChCC,SAAS,EAAGvB,OAAuB,IAAKD,oBAAoB,CAACC,OAAO,CAAE;MACtEwB,KAAK,EAAE9C,KAAK,CAAC8C,KAAM;MACnBC,QAAQ,EAAE/C,KAAK,CAAC+C,QAAS;MACzBC,YAAY,EAAE;IAAK,EACnB;EAEN,CAAC;EAED,IAAI5C,gBAAgB,KAAKE,8BAAgB,CAACC,OAAO,EAAE;IACjD,OAAO6B,wBAAwB,EAAE;EACnC;EAEA,oBACExE,MAAA,CAAAkB,OAAA,CAAAuD,aAAA,CAACtE,YAAA,CAAAkF,IAAI;IAACC,KAAK,EAAE;MAAEjD,MAAM,EAAEA;IAAO;EAAE,GAC7BmC,wBAAwB,EAAE,CACtB;AAEX,CAAC;AAACe,OAAA,CAAApD,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_WebComponent","_pageMessage","_unitMessages","_UNCheckDepositComponent","_checkMessage","_onLoadMessage","_webComponent","_helpers","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Camera","NativeModules","UNCheckDepositComponent","props","height","setHeight","useState","presentationMode","setPresentationMode","PresentationMode","Inherit","useEffect","requestCameraAccess","requestAccess","error","console","Platform","OS","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","account","handleWebViewMessage","message","details","type","CheckMessage","CHECK_DEPOSIT_CREATED","onDepositCreated","CHECK_DEPOSIT_RESTART_REQUEST","onRestartRequest","UnitMessage","UNIT_ON_LOAD","PageMessage","PAGE_HEIGHT","currentHeight","Default","renderBookPaymentWebView","createElement","WebComponent","WebComponentType","checkDeposit","params","getCheckDepositParams","script","getCheckDepositScript","onMessage","theme","language","isScrollable","View","style","_default","withReduxStore","exports"],"sources":["UNCheckDepositComponent.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { View, NativeModules, Platform } from 'react-native';\nimport { WebComponent } from '../../webComponent/WebComponent';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { getCheckDepositParams, getCheckDepositScript } from './UNCheckDepositComponent.utils';\nimport { CheckMessage } from '../../messages/webMessages/checkMessage';\nimport type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';\nimport type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';\nimport { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\nimport { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport { withReduxStore } from '../../helpers/store/helpers';\n\nconst { Camera } = NativeModules;\n\nexport interface UNCheckDepositComponentProps {\n accountId: string;\n fee: number;\n customerToken: string;\n theme?: string;\n language?: string;\n onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;\n onDepositCreated?: (checkData: UNCheckDepositData) => void\n onRestartRequest?: (checkData: UNCheckDepositData) => void\n}\n\nconst UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {\n const [height, setHeight] = useState<number>(0);\n const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);\n\n useEffect(() => {\n const requestCameraAccess = async () => {\n try {\n await Camera.requestAccess();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n console.error(error);\n }\n };\n\n if (Platform.OS == 'ios') {\n requestCameraAccess();\n }\n }, []);\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.account in response) {\n // AccountOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.account] as UNOnLoadResponseData<UNAccountData>);\n return;\n }\n\n console.error('On Load Error: unexpected response type');\n return;\n };\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (!message || !message.details) return;\n\n switch (message.type) {\n case CheckMessage.CHECK_DEPOSIT_CREATED:\n props.onDepositCreated && props.onDepositCreated(message.details as UNCheckDepositData);\n break;\n case CheckMessage.CHECK_DEPOSIT_RESTART_REQUEST:\n props.onRestartRequest && props.onRestartRequest(message.details as UNCheckDepositData);\n break;\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case PageMessage.PAGE_HEIGHT: {\n const currentHeight = (message.details as HeightEvent).height;\n setHeight(currentHeight);\n if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {\n setPresentationMode(PresentationMode.Default);\n }\n break;\n }\n }\n };\n\n const renderBookPaymentWebView = () => {\n return (\n <WebComponent\n type={WebComponentType.checkDeposit}\n presentationMode={presentationMode}\n params={getCheckDepositParams(props)}\n script={getCheckDepositScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n theme={props.theme}\n language={props.language}\n isScrollable={true}\n />\n );\n };\n\n if (presentationMode === PresentationMode.Inherit) {\n return renderBookPaymentWebView();\n }\n\n return (\n <View style={{ height: height }}>\n {renderBookPaymentWebView()}\n </View>\n );\n};\n\nexport default withReduxStore<UNCheckDepositComponentProps>(UNCheckDepositComponent);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAGA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAA6D,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAgB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA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qC,MAAM,EAAE,IAAAC,8CAAqB,EAAC1C,KAAK,CAAE;MACrC2C,MAAM,EAAE,IAAAC,8CAAqB,GAAG;MAChCC,SAAS,EAAGvB,OAAuB,IAAKD,oBAAoB,CAACC,OAAO,CAAE;MACtEwB,KAAK,EAAE9C,KAAK,CAAC8C,KAAM;MACnBC,QAAQ,EAAE/C,KAAK,CAAC+C,QAAS;MACzBC,YAAY,EAAE;IAAK,EACnB;EAEN,CAAC;EAED,IAAI5C,gBAAgB,KAAKE,8BAAgB,CAACC,OAAO,EAAE;IACjD,OAAO6B,wBAAwB,EAAE;EACnC;EAEA,oBACEzE,MAAA,CAAAmB,OAAA,CAAAuD,aAAA,CAACvE,YAAA,CAAAmF,IAAI;IAACC,KAAK,EAAE;MAAEjD,MAAM,EAAEA;IAAO;EAAE,GAC7BmC,wBAAwB,EAAE,CACtB;AAEX,CAAC;AAAC,IAAAe,QAAA,GAEa,IAAAC,uBAAc,EAA+BrD,uBAAuB,CAAC;AAAAsD,OAAA,CAAAvE,OAAA,GAAAqE,QAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "UNCheckDepositComponent", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _UNCheckDepositComponent.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "UNCheckDepositComponentProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _UNCheckDepositComponent.UNCheckDepositComponentProps;
16
+ }
17
+ });
18
+ var _UNCheckDepositComponent = _interopRequireWildcard(require("./UNCheckDepositComponent"));
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_UNCheckDepositComponent","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["index.ts"],"sourcesContent":["export { default as UNCheckDepositComponent, UNCheckDepositComponentProps } from './UNCheckDepositComponent';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA6G,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _pageMessage = require("../../messages/webMessages/pageMessage");
10
+ var _WebComponent = require("../../webComponent/WebComponent");
11
+ var _webComponent = require("../../types/internal/webComponent.types");
12
+ var _helpers = require("../../helpers/store/helpers");
13
+ var _UNMultipleCardsComponent = require("./UNMultipleCardsComponent.utils");
14
+ var _unitMessages = require("../../messages/webMessages/unitMessages");
15
+ var _onLoadMessage = require("../../messages/webMessages/onLoadMessage");
16
+ var _multipleCardsMessage = require("../../messages/webMessages/multipleCardsMessage");
17
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+ const DEFAULT_HEIGHT = _reactNative.Dimensions.get('window').height * 0.5;
20
+ const UNMultipleCardsComponent = props => {
21
+ const webRef = (0, _react.useRef)(null);
22
+ const [defaultHeight, setDefaultHeight] = (0, _react.useState)();
23
+ const cardClicked = card => {
24
+ if (props.onCardClicked) {
25
+ props.onCardClicked(card);
26
+ }
27
+ };
28
+ const handleUnitOnLoad = response => {
29
+ if (!props.onLoad) {
30
+ return;
31
+ }
32
+ if (_onLoadMessage.RESPONSE_KEYS.errors in response) {
33
+ props.onLoad(response);
34
+ return;
35
+ }
36
+ if (_onLoadMessage.RESPONSE_KEYS.cards in response) {
37
+ // MultipleCardsOnLoadResponse;
38
+ props.onLoad(response[_onLoadMessage.RESPONSE_KEYS.cards]);
39
+ return;
40
+ }
41
+ console.error('On Load Error: unexpected response type');
42
+ return;
43
+ };
44
+ const handleWebViewMessage = message => {
45
+ if (!message || !message.details) return;
46
+ switch (message.type) {
47
+ case _unitMessages.UnitMessage.UNIT_ON_LOAD:
48
+ handleUnitOnLoad(message.details);
49
+ break;
50
+ case _pageMessage.PageMessage.PAGE_HEIGHT:
51
+ {
52
+ const currentHeight = message.details.height;
53
+ currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);
54
+ break;
55
+ }
56
+ case _multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED:
57
+ {
58
+ cardClicked(message.details);
59
+ }
60
+ }
61
+ };
62
+ const renderMultipleCardsWebView = () => {
63
+ return /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
64
+ ref: webRef,
65
+ type: _webComponent.WebComponentType.multipleCards,
66
+ presentationMode: _webComponent.PresentationMode.Inherit,
67
+ params: (0, _UNMultipleCardsComponent.getMultipleCardsParams)(props),
68
+ script: (0, _UNMultipleCardsComponent.getMultipleCardsScript)(),
69
+ onMessage: message => handleWebViewMessage(message),
70
+ nestedScrollEnabled: true,
71
+ theme: props.theme,
72
+ language: props.language
73
+ });
74
+ };
75
+ if (!defaultHeight) {
76
+ return renderMultipleCardsWebView();
77
+ }
78
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
79
+ style: {
80
+ height: defaultHeight
81
+ }
82
+ }, renderMultipleCardsWebView());
83
+ };
84
+ var _default = (0, _helpers.withReduxStore)(UNMultipleCardsComponent);
85
+ exports.default = _default;
86
+ //# sourceMappingURL=UNMultipleCardsComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_pageMessage","_WebComponent","_webComponent","_helpers","_UNMultipleCardsComponent","_unitMessages","_onLoadMessage","_multipleCardsMessage","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_HEIGHT","Dimensions","height","UNMultipleCardsComponent","props","webRef","useRef","defaultHeight","setDefaultHeight","useState","cardClicked","card","onCardClicked","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","cards","console","error","handleWebViewMessage","message","details","type","UnitMessage","UNIT_ON_LOAD","PageMessage","PAGE_HEIGHT","currentHeight","MultipleCardsMessage","UNIT_MULTIPLE_CARDS_CARD_CLICKED","renderMultipleCardsWebView","createElement","WebComponent","ref","WebComponentType","multipleCards","presentationMode","PresentationMode","Inherit","params","getMultipleCardsParams","script","getMultipleCardsScript","onMessage","nestedScrollEnabled","theme","language","View","style","_default","withReduxStore","exports"],"sources":["UNMultipleCardsComponent.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { WebComponent } from '../../webComponent/WebComponent';\n\nimport type WebView from 'react-native-webview';\n\nimport { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport { withReduxStore } from '../../helpers/store/helpers';\nimport { getMultipleCardsParams, getMultipleCardsScript } from './UNMultipleCardsComponent.utils';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport type { UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\nimport { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type {\n UNCardData,\n UNError,\n UNMultipleCardsComponentPaginationType,\n UNMultipleCardsOnLoadData,\n UNOnLoadResponse,\n UNOnLoadResponseData,\n} from '../../types/shared';\nimport { MultipleCardsCardClickedEvent, MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';\n\nconst DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;\n\nexport interface UNMultipleCardsComponentProps {\n // inputs\n customerToken: string;\n\n // ui\n paginationType?: UNMultipleCardsComponentPaginationType;\n cardsPerPage?: number;\n disableCardClick?: boolean;\n theme?: string;\n language?: string;\n queryFilter?: string;\n hideTitle?: boolean;\n\n // events\n onLoad?: (response: UNOnLoadResponse<UNMultipleCardsOnLoadData>) => void;\n onCardClicked?: (card: UNCardData) => void;\n}\n\nconst UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {\n const webRef = useRef<WebView>(null);\n const [defaultHeight, setDefaultHeight] = useState<number>();\n\n const cardClicked = (card: UNCardData) => {\n if (props.onCardClicked) {\n props.onCardClicked(card);\n }\n };\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.cards in response) {\n // MultipleCardsOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.cards] as UNOnLoadResponseData<UNMultipleCardsOnLoadData>);\n return;\n }\n\n console.error('On Load Error: unexpected response type');\n return;\n };\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (!message || !message.details) return;\n switch (message.type) {\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case PageMessage.PAGE_HEIGHT: {\n const currentHeight = (message.details as HeightEvent).height;\n currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);\n break;\n }\n case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED: {\n cardClicked(message.details as MultipleCardsCardClickedEvent);\n }\n }\n };\n\n const renderMultipleCardsWebView = () => {\n return (\n <WebComponent\n ref={webRef}\n type={WebComponentType.multipleCards}\n presentationMode={PresentationMode.Inherit}\n params={getMultipleCardsParams(props)}\n script={getMultipleCardsScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n nestedScrollEnabled={true}\n theme={props.theme}\n language={props.language}\n />\n );\n };\n\n if (!defaultHeight) {\n return renderMultipleCardsWebView();\n }\n\n return (\n <View style={{ height: defaultHeight }}>\n {renderMultipleCardsWebView()}\n </View>\n );\n};\n\nexport default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IA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Aa,KAAK,CAAC,IAAIrB,gBAAgB,CAACR,cAAc,CAAC;UACvD;QACF;MACA,KAAK8B,0CAAoB,CAACC,gCAAgC;QAAE;UAC1DrB,WAAW,CAACY,OAAO,CAACC,OAAO,CAAkC;QAC/D;IAAC;EAEL,CAAC;EAED,MAAMS,0BAA0B,GAAGA,CAAA,KAAM;IACvC,oBACElE,MAAA,CAAAmB,OAAA,CAAAgD,aAAA,CAAC9D,aAAA,CAAA+D,YAAY;MACXC,GAAG,EAAE9B,MAAO;MACZmB,IAAI,EAAEY,8BAAgB,CAACC,aAAc;MACrCC,gBAAgB,EAAEC,8BAAgB,CAACC,OAAQ;MAC3CC,MAAM,EAAE,IAAAC,gDAAsB,EAACtC,KAAK,CAAE;MACtCuC,MAAM,EAAE,IAAAC,gDAAsB,GAAG;MACjCC,SAAS,EAAGvB,OAAuB,IAAKD,oBAAoB,CAACC,OAAO,CAAE;MACtEwB,mBAAmB,EAAE,IAAK;MAC1BC,KAAK,EAAE3C,KAAK,CAAC2C,KAAM;MACnBC,QAAQ,EAAE5C,KAAK,CAAC4C;IAAS,EACzB;EAEN,CAAC;EAED,IAAI,CAACzC,aAAa,EAAE;IAClB,OAAOyB,0BAA0B,EAAE;EACrC;EAEA,oBACElE,MAAA,CAAAmB,OAAA,CAAAgD,aAAA,CAAChE,YAAA,CAAAgF,IAAI;IAACC,KAAK,EAAE;MAAEhD,MAAM,EAAEK;IAAc;EAAE,GACpCyB,0BAA0B,EAAE,CACxB;AAEX,CAAC;AAAC,IAAAmB,QAAA,GAEa,IAAAC,uBAAc,EAAgCjD,wBAAwB,CAAC;AAAAkD,OAAA,CAAApE,OAAA,GAAAkE,QAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getMultipleCardsScript = exports.getMultipleCardsParams = void 0;
7
+ var _multipleCardsMessage = require("../../messages/webMessages/multipleCardsMessage");
8
+ const getMultipleCardsParams = props => {
9
+ const paginationType = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
10
+ const cardsPerPage = props.cardsPerPage ? `cards-per-page="${props.cardsPerPage}"` : '';
11
+ const queryFilter = props.queryFilter ? `query-filter="${props.queryFilter}"` : '';
12
+ return `
13
+ customer-token="${props.customerToken}"
14
+ ${paginationType}
15
+ ${cardsPerPage}
16
+ disable-card-click="${props.disableCardClick || false}"
17
+ ${queryFilter}
18
+ hide-title="${props.hideTitle || false}"
19
+ style="height: 100%"
20
+ `;
21
+ };
22
+ exports.getMultipleCardsParams = getMultipleCardsParams;
23
+ const MULTIPLE_CARDS_LISTENERS = {
24
+ cardClicked: `
25
+ window.addEventListener("${_multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", (e) => {
26
+ const response = e.detail
27
+ response.then((data) => {
28
+ postMessageToSDK({ type: "${_multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", details: data.data })
29
+ }).catch((e) => {
30
+ console.log(e)
31
+ })
32
+ });
33
+ `
34
+ };
35
+ const getMultipleCardsScript = () => {
36
+ return `
37
+ ${MULTIPLE_CARDS_LISTENERS.cardClicked}
38
+ `;
39
+ };
40
+ exports.getMultipleCardsScript = getMultipleCardsScript;
41
+ //# sourceMappingURL=UNMultipleCardsComponent.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_multipleCardsMessage","require","getMultipleCardsParams","props","paginationType","cardsPerPage","queryFilter","customerToken","disableCardClick","hideTitle","exports","MULTIPLE_CARDS_LISTENERS","cardClicked","MultipleCardsMessage","UNIT_MULTIPLE_CARDS_CARD_CLICKED","getMultipleCardsScript"],"sources":["UNMultipleCardsComponent.utils.ts"],"sourcesContent":["import type { UNMultipleCardsComponentProps } from './UNMultipleCardsComponent';\nimport { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';\n\nexport const getMultipleCardsParams = (props: UNMultipleCardsComponentProps) => {\n const paginationType = props.paginationType ? `pagination-type=\"${props.paginationType}\"` : '';\n const cardsPerPage = props.cardsPerPage ? `cards-per-page=\"${props.cardsPerPage}\"` : '';\n const queryFilter = props.queryFilter ? `query-filter=\"${props.queryFilter}\"` : '';\n return `\n customer-token=\"${props.customerToken}\"\n ${paginationType}\n ${cardsPerPage}\n disable-card-click=\"${props.disableCardClick || false}\"\n ${queryFilter}\n hide-title=\"${props.hideTitle || false}\"\n style=\"height: 100%\"\n `;\n};\n\nconst MULTIPLE_CARDS_LISTENERS = {\n cardClicked: `\n window.addEventListener(\"${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}\", details: data.data })\n }).catch((e) => {\n console.log(e)\n })\n });\n `,\n};\n\nexport const getMultipleCardsScript = () => {\n return `\n ${MULTIPLE_CARDS_LISTENERS.cardClicked}\n `;\n};\n"],"mappings":";;;;;;AACA,IAAAA,qBAAA,GAAAC,OAAA;AAEO,MAAMC,sBAAsB,GAAIC,KAAoC,IAAK;EAC9E,MAAMC,cAAc,GAAGD,KAAK,CAACC,cAAc,GAAI,oBAAmBD,KAAK,CAACC,cAAe,GAAE,GAAG,EAAE;EAC9F,MAAMC,YAAY,GAAGF,KAAK,CAACE,YAAY,GAAI,mBAAkBF,KAAK,CAACE,YAAa,GAAE,GAAG,EAAE;EACvF,MAAMC,WAAW,GAAGH,KAAK,CAACG,WAAW,GAAI,iBAAgBH,KAAK,CAACG,WAAY,GAAE,GAAG,EAAE;EAClF,OAAQ;AACV,oBAAoBH,KAAK,CAACI,aAAc;AACxC,IAAIH,cAAe;AACnB,IAAIC,YAAa;AACjB,wBAAwBF,KAAK,CAACK,gBAAgB,IAAI,KAAM;AACxD,IAAIF,WAAY;AAChB,gBAAgBH,KAAK,CAACM,SAAS,IAAI,KAAM;AACzC;AACA,GAAG;AACH,CAAC;AAACC,OAAA,CAAAR,sBAAA,GAAAA,sBAAA;AAEF,MAAMS,wBAAwB,GAAG;EAC/BC,WAAW,EAAG;AAChB,+BAA+BC,0CAAoB,CAACC,gCAAiC;AACrF;AACA;AACA,oCAAoCD,0CAAoB,CAACC,gCAAiC;AAC1F;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,OAAQ;AACV,OAAOJ,wBAAwB,CAACC,WAAY;AAC5C,GAAG;AACH,CAAC;AAACF,OAAA,CAAAK,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "UNMultipleCardsComponent", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _UNMultipleCardsComponent.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "UNMultipleCardsComponentProps", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _UNMultipleCardsComponent.UNMultipleCardsComponentProps;
16
+ }
17
+ });
18
+ var _UNMultipleCardsComponent = _interopRequireWildcard(require("./UNMultipleCardsComponent"));
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_UNMultipleCardsComponent","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["index.ts"],"sourcesContent":["export {\n default as UNMultipleCardsComponent, UNMultipleCardsComponentProps,\n} from './UNMultipleCardsComponent';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEoC,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _UNCardComponent = require("./UNCardComponent/UNCardComponent");
6
+ var _UNCardComponent = require("./UNCardComponent");
7
7
  Object.keys(_UNCardComponent).forEach(function (key) {
8
8
  if (key === "default" || key === "__esModule") return;
9
9
  if (key in exports && exports[key] === _UNCardComponent[key]) return;
@@ -14,7 +14,18 @@ Object.keys(_UNCardComponent).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
- var _UNBottomSheetComponent = require("./UNBottomSheetComponent/UNBottomSheetComponent");
17
+ var _UNMultipleCardsComponent = require("./UNMultipleCardsComponent");
18
+ Object.keys(_UNMultipleCardsComponent).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _UNMultipleCardsComponent[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _UNMultipleCardsComponent[key];
25
+ }
26
+ });
27
+ });
28
+ var _UNBottomSheetComponent = require("./UNBottomSheetComponent");
18
29
  Object.keys(_UNBottomSheetComponent).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;
20
31
  if (key in exports && exports[key] === _UNBottomSheetComponent[key]) return;
@@ -25,7 +36,7 @@ Object.keys(_UNBottomSheetComponent).forEach(function (key) {
25
36
  }
26
37
  });
27
38
  });
28
- var _UNBookPaymentComponent = require("./UNBookPaymentComponent/UNBookPaymentComponent");
39
+ var _UNBookPaymentComponent = require("./UNBookPaymentComponent");
29
40
  Object.keys(_UNBookPaymentComponent).forEach(function (key) {
30
41
  if (key === "default" || key === "__esModule") return;
31
42
  if (key in exports && exports[key] === _UNBookPaymentComponent[key]) return;
@@ -36,7 +47,7 @@ Object.keys(_UNBookPaymentComponent).forEach(function (key) {
36
47
  }
37
48
  });
38
49
  });
39
- var _UNActivityComponent = require("./UNActivityComponent/UNActivityComponent");
50
+ var _UNActivityComponent = require("./UNActivityComponent");
40
51
  Object.keys(_UNActivityComponent).forEach(function (key) {
41
52
  if (key === "default" || key === "__esModule") return;
42
53
  if (key in exports && exports[key] === _UNActivityComponent[key]) return;
@@ -47,7 +58,7 @@ Object.keys(_UNActivityComponent).forEach(function (key) {
47
58
  }
48
59
  });
49
60
  });
50
- var _UNAccountComponent = require("./UNAccountComponent/UNAccountComponent");
61
+ var _UNAccountComponent = require("./UNAccountComponent");
51
62
  Object.keys(_UNAccountComponent).forEach(function (key) {
52
63
  if (key === "default" || key === "__esModule") return;
53
64
  if (key in exports && exports[key] === _UNAccountComponent[key]) return;
@@ -58,7 +69,7 @@ Object.keys(_UNAccountComponent).forEach(function (key) {
58
69
  }
59
70
  });
60
71
  });
61
- var _UNCheckDepositComponent = require("./UNCheckDepositComponent/UNCheckDepositComponent");
72
+ var _UNCheckDepositComponent = require("./UNCheckDepositComponent");
62
73
  Object.keys(_UNCheckDepositComponent).forEach(function (key) {
63
74
  if (key === "default" || key === "__esModule") return;
64
75
  if (key in exports && exports[key] === _UNCheckDepositComponent[key]) return;
@@ -69,7 +80,7 @@ Object.keys(_UNCheckDepositComponent).forEach(function (key) {
69
80
  }
70
81
  });
71
82
  });
72
- var _UNACHDebitComponent = require("./UNACHDebitComponent/UNACHDebitComponent");
83
+ var _UNACHDebitComponent = require("./UNACHDebitComponent");
73
84
  Object.keys(_UNACHDebitComponent).forEach(function (key) {
74
85
  if (key === "default" || key === "__esModule") return;
75
86
  if (key in exports && exports[key] === _UNACHDebitComponent[key]) return;
@@ -80,7 +91,7 @@ Object.keys(_UNACHDebitComponent).forEach(function (key) {
80
91
  }
81
92
  });
82
93
  });
83
- var _UNACHCreditComponent = require("./UNACHCreditComponent/UNACHCreditComponent");
94
+ var _UNACHCreditComponent = require("./UNACHCreditComponent");
84
95
  Object.keys(_UNACHCreditComponent).forEach(function (key) {
85
96
  if (key === "default" || key === "__esModule") return;
86
97
  if (key in exports && exports[key] === _UNACHCreditComponent[key]) return;
@@ -1 +1 @@
1
- {"version":3,"names":["_UNCardComponent","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_UNBottomSheetComponent","_UNBookPaymentComponent","_UNActivityComponent","_UNAccountComponent","_UNCheckDepositComponent","_UNACHDebitComponent","_UNACHCreditComponent"],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent/UNCardComponent';\nexport * from './UNBottomSheetComponent/UNBottomSheetComponent';\nexport * from './UNBookPaymentComponent/UNBookPaymentComponent';\nexport * from './UNActivityComponent/UNActivityComponent';\nexport * from './UNAccountComponent/UNAccountComponent';\nexport * from './UNCheckDepositComponent/UNCheckDepositComponent';\nexport * from './UNACHDebitComponent/UNACHDebitComponent';\nexport * from './UNACHCreditComponent/UNACHCreditComponent';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,uBAAA,GAAAT,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A,WAAAA,CAAA;MAAA,OAAAO,qBAAA,CAAAX,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_UNCardComponent","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_UNMultipleCardsComponent","_UNBottomSheetComponent","_UNBookPaymentComponent","_UNActivityComponent","_UNAccountComponent","_UNCheckDepositComponent","_UNACHDebitComponent","_UNACHCreditComponent"],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent';\nexport * from './UNMultipleCardsComponent';\nexport * from './UNBottomSheetComponent';\nexport * from './UNBookPaymentComponent';\nexport * from './UNActivityComponent';\nexport * from './UNAccountComponent';\nexport * from './UNCheckDepositComponent';\nexport * from './UNACHDebitComponent';\nexport * from './UNACHCreditComponent';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,yBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,yBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,yBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,yBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,uBAAA,G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AAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,qBAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA"}
@@ -4,28 +4,32 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UNCardFlows = void 0;
7
- var _EventBus = _interopRequireDefault(require("../../helpers/EventBus"));
8
7
  var _webComponent = require("../../types/internal/webComponent.types");
9
8
  var _bottomSheet = require("../../types/internal/bottomSheet.types");
10
9
  var _bottomSheetMessage = require("../../messages/nativeMessages/bottomSheetMessage");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var _reactRedux = require("react-redux");
11
+ var _SharedEventsSlice = require("../../slices/SharedEventsSlice");
12
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
14
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
15
  class UNCardFlows {}
16
16
  exports.UNCardFlows = UNCardFlows;
17
17
  _defineProperty(UNCardFlows, "startPushProvisioning", async (cardId, customerToken) => {
18
+ const dispatch = (0, _reactRedux.useDispatch)(); //todo: can we use hook here?
18
19
  try {
19
20
  const addToWalletComponentData = {
20
21
  type: _webComponent.WebComponentType.cardAction,
21
22
  presentationMode: _webComponent.PresentationMode.CoverInjectedHeight,
22
23
  params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`
23
24
  };
24
- const event = {
25
+ const data = {
25
26
  type: _bottomSheet.BottomSheetRenderingType.WebComponent,
26
27
  data: addToWalletComponentData
27
28
  };
28
- _EventBus.default.Instance.event(_bottomSheetMessage.BottomSheetNativeMessage.START_FLOW, event);
29
+ dispatch((0, _SharedEventsSlice.setEvent)({
30
+ key: _bottomSheetMessage.BottomSheetNativeMessage.START_FLOW,
31
+ data
32
+ }));
29
33
  } catch (error) {
30
34
  console.error(error);
31
35
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_EventBus","_interopRequireDefault","require","_webComponent","_bottomSheet","_bottomSheetMessage","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","UNCardFlows","exports","cardId","customerToken","addToWalletComponentData","type","WebComponentType","cardAction","presentationMode","PresentationMode","CoverInjectedHeight","params","event","BottomSheetRenderingType","WebComponent","data","EventBus","Instance","BottomSheetNativeMessage","START_FLOW","error","console"],"sources":["UNCardFlows.ts"],"sourcesContent":["import EventBus from '../../helpers/EventBus';\nimport { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport { BottomSheetRenderingType, type WebComponentData, type WebComponentRendering } from '../../types/internal/bottomSheet.types';\nimport { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';\n\nexport class UNCardFlows {\n public static startPushProvisioning = async (cardId: string, customerToken: string) => {\n try {\n const addToWalletComponentData: WebComponentData = {\n type: WebComponentType.cardAction,\n presentationMode: PresentationMode.CoverInjectedHeight,\n params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,\n };\n\n const event: WebComponentRendering = {\n type: BottomSheetRenderingType.WebComponent,\n data: addToWalletComponentData,\n };\n\n EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);\n } catch (error) {\n console.error(error);\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAA4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YAAY;MAC3CC,IAAI,EAAEX;IACR,CAAC;IAEDY,iBAAQ,CAACC,QAAQ,CAACL,KAAK,CAACM,4CAAwB,CAACC,UAAU,EAAEP,KAAK,CAAC;EACrE,CAAC,CAAC,OAAOQ,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC"}
1
+ {"version":3,"names":["_webComponent","require","_bottomSheet","_bottomSheetMessage","_reactRedux","_SharedEventsSlice","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","UNCardFlows","exports","cardId","customerToken","dispatch","useDispatch","addToWalletComponentData","type","WebComponentType","cardAction","presentationMode","PresentationMode","CoverInjectedHeight","params","data","BottomSheetRenderingType","WebComponent","setEvent","BottomSheetNativeMessage","START_FLOW","error","console"],"sources":["UNCardFlows.ts"],"sourcesContent":["import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport {\n BottomSheetRenderingType,\n type WebComponentData,\n type WebComponentRendering,\n} from '../../types/internal/bottomSheet.types';\nimport { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';\nimport { useDispatch } from 'react-redux';\nimport { setEvent } from '../../slices/SharedEventsSlice';\n\nexport class UNCardFlows {\n public static startPushProvisioning = async (cardId: string, customerToken: string) => {\n const dispatch = useDispatch(); //todo: can we use hook here?\n try {\n const addToWalletComponentData: WebComponentData = {\n type: WebComponentType.cardAction,\n presentationMode: PresentationMode.CoverInjectedHeight,\n params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,\n };\n\n const data: WebComponentRendering = {\n type: BottomSheetRenderingType.WebComponent,\n data: addToWalletComponentData,\n };\n\n dispatch(setEvent({ key: BottomSheetNativeMessage.START_FLOW, data }));\n } catch (error) {\n console.error(error);\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IA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Ac;IAC5D,CAAC;IAED,MAAMW,IAA2B,GAAG;MAClCP,IAAI,EAAEQ,qCAAwB,CAACC,YAAY;MAC3CF,IAAI,EAAER;IACR,CAAC;IAEDF,QAAQ,CAAC,IAAAa,2BAAQ,EAAC;MAAEtC,GAAG,EAAEuC,4CAAwB,CAACC,UAAU;MAAEL;IAAK,CAAC,CAAC,CAAC;EACxE,CAAC,CAAC,OAAOM,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.promiseRejectToUNVPErrorType = exports.isUNVPError = exports.isUNNativePromiseReject = void 0;
7
+ var _types = require("./types");
8
+ /* eslint-disable @typescript-eslint/no-explicit-any */
9
+
10
+ const isUNVPError = error => {
11
+ return 'code' in error && 'description' in error && 'type' in error && isUNVPErrorType(error.type) && 'correlationId' in error;
12
+ };
13
+ exports.isUNVPError = isUNVPError;
14
+ const isUNVPErrorType = type => {
15
+ return Object.values(_types.UNVPErrorType).includes(type);
16
+ };
17
+ const isUNNativePromiseReject = error => {
18
+ return 'code' in error && 'message' in error;
19
+ };
20
+ exports.isUNNativePromiseReject = isUNNativePromiseReject;
21
+ const promiseRejectToUNVPErrorType = error => {
22
+ // validate the shape of a promise reject we get from iOS/Android native
23
+ if (!isUNNativePromiseReject(error)) {
24
+ return null;
25
+ }
26
+ const parsedError = JSON.parse(error.message);
27
+ // validate the shape of an error we get from VDE SDK
28
+ if (!isUNVPError(parsedError)) {
29
+ return null;
30
+ }
31
+ return parsedError.type;
32
+ };
33
+ exports.promiseRejectToUNVPErrorType = promiseRejectToUNVPErrorType;
34
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","isUNVPError","error","isUNVPErrorType","type","exports","Object","values","UNVPErrorType","includes","isUNNativePromiseReject","promiseRejectToUNVPErrorType","parsedError","JSON","parse","message"],"sources":["helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { UNNativePromiseReject, UNVPError, UNVPErrorType } from './types';\n\nexport const isUNVPError = (error: any): error is UNVPError => {\n return 'code' in error &&\n 'description' in error &&\n 'type' in error &&\n isUNVPErrorType(error.type) &&\n 'correlationId' in error;\n};\n\nconst isUNVPErrorType = (type: any): type is UNVPErrorType => {\n return Object.values(UNVPErrorType).includes(type);\n};\n\nexport const isUNNativePromiseReject = (error: any): error is UNNativePromiseReject => {\n return 'code' in error && 'message' in error;\n};\n\nexport const promiseRejectToUNVPErrorType = (error: any): UNVPErrorType | null => {\n // validate the shape of a promise reject we get from iOS/Android native\n if (!isUNNativePromiseReject(error)) {\n return null;\n }\n const parsedError = JSON.parse(error.message);\n // validate the shape of an error we get from VDE SDK\n if (!isUNVPError(parsedError)) {\n return null;\n }\n return parsedError.type;\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AADA;;AAGO,MAAMC,WAAW,GAAIC,KAAU,IAAyB;EAC7D,OAAO,MAAM,IAAIA,KAAK,IACpB,aAAa,IAAIA,KAAK,IACtB,MAAM,IAAIA,KAAK,IACfC,eAAe,CAACD,KAAK,CAACE,IAAI,CAAC,IAC3B,eAAe,IAAIF,KAAK;AAC5B,CAAC;AAACG,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AAEF,MAAME,eAAe,GAAIC,IAAS,IAA4B;EAC5D,OAAOE,MAAM,CAACC,MAAM,CAACC,oBAAa,CAAC,CAACC,QAAQ,CAACL,IAAI,CAAC;AACpD,CAAC;AAEM,MAAMM,uBAAuB,GAAIR,KAAU,IAAqC;EACrF,OAAO,MAAM,IAAIA,KAAK,IAAI,SAAS,IAAIA,KAAK;AAC9C,CAAC;AAACG,OAAA,CAAAK,uBAAA,GAAAA,uBAAA;AAEK,MAAMC,4BAA4B,GAAIT,KAAU,IAA2B;EAChF;EACA,IAAI,CAACQ,uBAAuB,CAACR,KAAK,CAAC,EAAE;IACnC,OAAO,IAAI;EACb;EACA,MAAMU,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACZ,KAAK,CAACa,OAAO,CAAC;EAC7C;EACA,IAAI,CAACd,WAAW,CAACW,WAAW,CAAC,EAAE;IAC7B,OAAO,IAAI;EACb;EACA,OAAOA,WAAW,CAACR,IAAI;AACzB,CAAC;AAACC,OAAA,CAAAM,4BAAA,GAAAA,4BAAA"}