@justifi/webcomponents 6.7.3 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/dist/cjs/{Business-uoeKyW_a.js → Business-CB8EVrhD.js} +1 -0
  2. package/dist/cjs/{GooglePay-CbKCUEfb.js → Plaid-DxPvVu0H.js} +53 -0
  3. package/dist/cjs/{bank-account-document-form-inputs_8.cjs.entry.js → bank-account-document-form-inputs_9.cjs.entry.js} +330 -8
  4. package/dist/cjs/{business-additional-questions-schema-BtOuMq_U.js → business-additional-questions-schema-Cnh6AXQU.js} +3 -3
  5. package/dist/cjs/{business-form-options-D1r-wJpo.js → business-form-options-B3CbEmdc.js} +1 -1
  6. package/dist/cjs/{business-identity-schema-CMvq6f8m.js → business-identity-schema-0jg2Thn9.js} +2 -2
  7. package/dist/cjs/{business.service-DR4Ce5XV.js → business.service-zGEitIbP.js} +2 -2
  8. package/dist/cjs/{check-pkg-version-Bs_9oZb4.js → check-pkg-version-DKH70uPq.js} +11 -10
  9. package/dist/cjs/{checkout.service-CQqd4X4y.js → checkout.service-DT13pWxH.js} +2 -2
  10. package/dist/cjs/checkouts-list-core.cjs.entry.js +2 -2
  11. package/dist/cjs/{country-config-DGi9t3Ma.js → country-config-ETD-7Wb7.js} +1 -1
  12. package/dist/cjs/custom-popper_2.cjs.entry.js +48 -17
  13. package/dist/cjs/{dispute.service-aok1_zRv.js → dispute.service-GDUl1Wjs.js} +2 -2
  14. package/dist/cjs/form-alert_5.cjs.entry.js +3 -3
  15. package/dist/cjs/form-control-number-masked_3.cjs.entry.js +2 -2
  16. package/dist/cjs/form-control-number_3.cjs.entry.js +6 -6
  17. package/dist/cjs/{get-business-CtsxSYA6.js → get-business-CP0ALW9n.js} +1 -1
  18. package/dist/cjs/{get-payment-details-tCICJHBb.js → get-payment-details-IA5Toi7Z.js} +3 -3
  19. package/dist/cjs/{get-subaccounts-BcsCQAVN.js → get-subaccounts-DNMZjAyT.js} +3 -3
  20. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  21. package/dist/cjs/{input-handlers-DaRKFvGI.js → input-handlers-gV1LyFy3.js} +1 -1
  22. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +15 -15
  23. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +31 -18
  24. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +220 -290
  25. package/dist/cjs/justifi-bank-account-billing-form-simple_3.cjs.entry.js +4 -4
  26. package/dist/cjs/justifi-business-details.cjs.entry.js +6 -6
  27. package/dist/cjs/justifi-business-form.cjs.entry.js +10 -10
  28. package/dist/cjs/justifi-checkout.cjs.entry.js +12 -12
  29. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +9 -9
  30. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +7 -7
  31. package/dist/cjs/justifi-dispute-management.cjs.entry.js +5 -5
  32. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +5 -5
  33. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -4
  34. package/dist/cjs/justifi-order-terminals.cjs.entry.js +10 -10
  35. package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -6
  36. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -5
  38. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +6 -6
  39. package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -6
  40. package/dist/cjs/justifi-payout-details.cjs.entry.js +6 -6
  41. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +6 -6
  42. package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -7
  43. package/dist/cjs/justifi-refund-payment.cjs.entry.js +10 -10
  44. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +7 -7
  45. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +10 -10
  46. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
  47. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +7 -7
  48. package/dist/cjs/justifi-terminals-list.cjs.entry.js +7 -7
  49. package/dist/cjs/loader.cjs.js +1 -1
  50. package/dist/cjs/{package-DcGEg97O.js → package-B4vs5j7c.js} +1 -1
  51. package/dist/cjs/payment-details-core.cjs.entry.js +3 -3
  52. package/dist/cjs/{payment.service-B4ACB8Q3.js → payment.service-QODfB293.js} +2 -2
  53. package/dist/cjs/payments-list-core.cjs.entry.js +2 -2
  54. package/dist/cjs/{payout.service-qVbNnemO.js → payout.service-k7GBuYzk.js} +2 -2
  55. package/dist/cjs/payouts-list-core.cjs.entry.js +2 -2
  56. package/dist/cjs/plaid-icon-DTpONc_Q.js +46 -0
  57. package/dist/cjs/{schema-validations-DYYDrVol.js → schema-validations-BakyfJpE.js} +3 -3
  58. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +3 -3
  59. package/dist/cjs/{terminal-orders-table-C2jG4WQa.js → terminal-orders-table-C6j6Mx_r.js} +4 -4
  60. package/dist/cjs/{terminal.service-D1ohedi-.js → terminal.service-A90K3XNq.js} +2 -2
  61. package/dist/cjs/terminals-list-core.cjs.entry.js +2 -2
  62. package/dist/cjs/webcomponents.cjs.js +1 -1
  63. package/dist/collection/api/Analytics.js +8 -7
  64. package/dist/collection/api/Business.js +1 -0
  65. package/dist/collection/api/Plaid.js +50 -0
  66. package/dist/collection/api/index.js +1 -0
  67. package/dist/collection/api/services/plaid.service.js +13 -0
  68. package/dist/collection/collection-manifest.json +1 -0
  69. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +20 -5
  70. package/dist/collection/components/business-forms/payment-provisioning/plaid-verification/plaid-verification.js +433 -0
  71. package/dist/collection/components/modular-checkout/sub-components/plaid-payment-method.js +4 -51
  72. package/dist/collection/ui-components/custom-popper/custom-popper.js +52 -18
  73. package/dist/docs.json +145 -4
  74. package/dist/esm/{Business-CHJTjG_5.js → Business-GgW1g7FQ.js} +1 -0
  75. package/dist/esm/{GooglePay-5EiPffHy.js → Plaid-CBrksnBN.js} +52 -1
  76. package/dist/esm/{bank-account-document-form-inputs_8.entry.js → bank-account-document-form-inputs_9.entry.js} +329 -8
  77. package/dist/esm/{business-additional-questions-schema-DQb10ehS.js → business-additional-questions-schema-CQ8CuEfQ.js} +3 -3
  78. package/dist/esm/{business-form-options-Bm89rMmk.js → business-form-options-DamBLV7N.js} +1 -1
  79. package/dist/esm/{business-identity-schema-CaMnpPqx.js → business-identity-schema-BTyJz7M9.js} +2 -2
  80. package/dist/esm/{business.service-C7smiL6_.js → business.service-BWm7Kqs4.js} +2 -2
  81. package/dist/esm/{check-pkg-version-DIZ2yD72.js → check-pkg-version-CioeuqLV.js} +11 -10
  82. package/dist/esm/{checkout.service-CYq6KXZv.js → checkout.service-D4Mljqjr.js} +2 -2
  83. package/dist/esm/checkouts-list-core.entry.js +2 -2
  84. package/dist/esm/{country-config-CQxaTFuP.js → country-config-D-9YmU94.js} +1 -1
  85. package/dist/esm/custom-popper_2.entry.js +48 -17
  86. package/dist/esm/{dispute.service-D7Dv8LTn.js → dispute.service-ZpqfPDC0.js} +2 -2
  87. package/dist/esm/form-alert_5.entry.js +3 -3
  88. package/dist/esm/form-control-number-masked_3.entry.js +2 -2
  89. package/dist/esm/form-control-number_3.entry.js +6 -6
  90. package/dist/esm/{get-business-BAmwId14.js → get-business-BMB2IxN_.js} +1 -1
  91. package/dist/esm/{get-payment-details-CPJZp31y.js → get-payment-details-B71Qi6mF.js} +2 -2
  92. package/dist/esm/{get-subaccounts-CqMFocN0.js → get-subaccounts-DXJdRbWg.js} +2 -2
  93. package/dist/esm/hidden-input_2.entry.js +1 -1
  94. package/dist/esm/{input-handlers-AgwQ-yKX.js → input-handlers-CzWCJ849.js} +1 -1
  95. package/dist/esm/internal-tokenize-payment-method_7.entry.js +4 -4
  96. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +25 -12
  97. package/dist/esm/justifi-apple-pay_8.entry.js +6 -76
  98. package/dist/esm/justifi-bank-account-billing-form-simple_3.entry.js +4 -4
  99. package/dist/esm/justifi-business-details.entry.js +6 -6
  100. package/dist/esm/justifi-business-form.entry.js +10 -10
  101. package/dist/esm/justifi-checkout.entry.js +4 -4
  102. package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
  103. package/dist/esm/justifi-checkouts-list.entry.js +6 -6
  104. package/dist/esm/justifi-dispute-management.entry.js +5 -5
  105. package/dist/esm/justifi-dispute-notification_3.entry.js +5 -5
  106. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
  107. package/dist/esm/justifi-order-terminals.entry.js +7 -7
  108. package/dist/esm/justifi-payment-details.entry.js +6 -6
  109. package/dist/esm/justifi-payment-provisioning-core.entry.js +1 -1
  110. package/dist/esm/justifi-payment-provisioning.entry.js +5 -5
  111. package/dist/esm/justifi-payment-transactions-list.entry.js +5 -5
  112. package/dist/esm/justifi-payments-list.entry.js +5 -5
  113. package/dist/esm/justifi-payout-details.entry.js +5 -5
  114. package/dist/esm/justifi-payout-transactions-list.entry.js +5 -5
  115. package/dist/esm/justifi-payouts-list.entry.js +6 -6
  116. package/dist/esm/justifi-refund-payment.entry.js +6 -6
  117. package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -4
  118. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +2 -2
  119. package/dist/esm/justifi-terminal-orders-list.entry.js +5 -5
  120. package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
  121. package/dist/esm/justifi-terminals-list.entry.js +6 -6
  122. package/dist/esm/loader.js +1 -1
  123. package/dist/esm/{package-ZkBwsSuI.js → package-CekpA_KC.js} +1 -1
  124. package/dist/esm/payment-details-core.entry.js +2 -2
  125. package/dist/esm/{payment.service-BGf8F56_.js → payment.service-C2lFq1yV.js} +2 -2
  126. package/dist/esm/payments-list-core.entry.js +2 -2
  127. package/dist/esm/{payout.service-Co3xg-7j.js → payout.service-ChupMPKT.js} +2 -2
  128. package/dist/esm/payouts-list-core.entry.js +2 -2
  129. package/dist/esm/plaid-icon-wJLd-2NX.js +43 -0
  130. package/dist/esm/{schema-validations-jBrJ0mYI.js → schema-validations-CfHWzMvr.js} +3 -3
  131. package/dist/esm/terminal-orders-list-core.entry.js +3 -3
  132. package/dist/esm/{terminal-orders-table-uNYLd8i5.js → terminal-orders-table-B4_RAxxx.js} +2 -2
  133. package/dist/esm/{terminal.service-Cxs-IO0Z.js → terminal.service-DqibXFHt.js} +2 -2
  134. package/dist/esm/terminals-list-core.entry.js +2 -2
  135. package/dist/esm/webcomponents.js +1 -1
  136. package/dist/module/Analytics.js +9 -8
  137. package/dist/module/Business.js +1 -0
  138. package/dist/module/{Refund.js → Plaid.js} +51 -1
  139. package/dist/module/bank-account-document-inputs.js +1 -1
  140. package/dist/module/business-additional-questions-form-step.js +1 -1
  141. package/dist/module/business-bank-account-form-step.js +46 -25
  142. package/dist/module/business-core-info-form-step.js +1 -1
  143. package/dist/module/business-owners-form-step.js +1 -1
  144. package/dist/module/business-representative-form-step.js +1 -1
  145. package/dist/module/business-terms-conditions-form-step.js +1 -1
  146. package/dist/module/business.service.js +1 -1
  147. package/dist/module/checkout.service.js +1 -1
  148. package/dist/module/checkout.store.js +1 -1
  149. package/dist/module/checkouts-list-core2.js +1 -1
  150. package/dist/module/custom-popper2.js +50 -17
  151. package/dist/module/dispute-management-core.js +1 -1
  152. package/dist/module/dispute-response-actions.js +1 -1
  153. package/dist/module/dispute-response.js +1 -1
  154. package/dist/module/get-business.js +1 -1
  155. package/dist/module/get-payment-details.js +1 -1
  156. package/dist/module/get-payout-csv.js +1 -1
  157. package/dist/module/get-subaccounts.js +1 -1
  158. package/dist/module/google-pay.js +1 -1
  159. package/dist/module/internal-tokenize-payment-method2.js +1 -1
  160. package/dist/module/justifi-business-details.js +1 -1
  161. package/dist/module/justifi-business-form.js +1 -1
  162. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  163. package/dist/module/justifi-checkouts-list.js +1 -1
  164. package/dist/module/justifi-dispute-management.js +1 -1
  165. package/dist/module/justifi-gross-payment-chart.js +1 -1
  166. package/dist/module/justifi-order-terminals.js +1 -1
  167. package/dist/module/justifi-payment-details.js +1 -1
  168. package/dist/module/justifi-payment-provisioning.js +69 -63
  169. package/dist/module/justifi-payment-transactions-list.js +1 -1
  170. package/dist/module/justifi-payments-list.js +1 -1
  171. package/dist/module/justifi-payout-details.js +1 -1
  172. package/dist/module/justifi-payout-transactions-list.js +1 -1
  173. package/dist/module/justifi-payouts-list.js +1 -1
  174. package/dist/module/justifi-refund-payment.js +1 -1
  175. package/dist/module/justifi-season-interruption-insurance.js +1 -1
  176. package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
  177. package/dist/module/justifi-terminal-orders-list.js +1 -1
  178. package/dist/module/justifi-terminals-list-filters.js +1 -1
  179. package/dist/module/justifi-terminals-list.js +1 -1
  180. package/dist/module/legal-address-form-step.js +1 -1
  181. package/dist/module/modular-checkout.js +2 -2
  182. package/dist/module/package.js +1 -1
  183. package/dist/module/payment-details-core2.js +1 -1
  184. package/dist/module/payment-provisioning-actions.js +1 -1
  185. package/dist/module/payment-provisioning-core.js +67 -61
  186. package/dist/module/payment-provisioning-form-steps.js +62 -56
  187. package/dist/module/payment.service.js +1 -1
  188. package/dist/module/payments-list-core2.js +1 -1
  189. package/dist/module/payout.service.js +1 -1
  190. package/dist/module/payouts-list-core2.js +1 -1
  191. package/dist/module/plaid-icon.js +3 -0
  192. package/dist/module/plaid-payment-method.js +3 -53
  193. package/dist/module/plaid-verification.d.ts +11 -0
  194. package/dist/module/plaid-verification.js +6 -0
  195. package/dist/module/plaid-verification2.js +358 -0
  196. package/dist/module/plaid.service.js +14 -1
  197. package/dist/module/terminal-orders-list-core2.js +1 -1
  198. package/dist/module/terminal.service.js +1 -1
  199. package/dist/module/terminals-list-core2.js +1 -1
  200. package/dist/module/utils4.js +1 -1
  201. package/dist/types/api/Analytics.d.ts +1 -0
  202. package/dist/types/api/BankAccount.d.ts +1 -0
  203. package/dist/types/api/Business.d.ts +2 -0
  204. package/dist/types/api/Plaid.d.ts +54 -0
  205. package/dist/types/api/index.d.ts +1 -0
  206. package/dist/types/api/services/plaid.service.d.ts +8 -0
  207. package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +2 -0
  208. package/dist/types/components/business-forms/payment-provisioning/plaid-verification/plaid-verification.d.ts +36 -0
  209. package/dist/types/components/modular-checkout/sub-components/plaid-payment-method.d.ts +1 -25
  210. package/dist/types/components.d.ts +40 -1
  211. package/dist/types/ui-components/custom-popper/custom-popper.d.ts +4 -0
  212. package/dist/webcomponents/{p-BXdZKjdB.js → p--cI8fPJx.js} +1 -1
  213. package/dist/webcomponents/{p-66e8b443.entry.js → p-02f360c5.entry.js} +1 -1
  214. package/dist/webcomponents/{p-d0d6d1cc.entry.js → p-073ca03f.entry.js} +1 -1
  215. package/dist/webcomponents/{p-e9daf75f.entry.js → p-0eb97b54.entry.js} +1 -1
  216. package/dist/webcomponents/p-0fcb7ebb.entry.js +1 -0
  217. package/dist/webcomponents/{p-b2371f43.entry.js → p-110bec2e.entry.js} +1 -1
  218. package/dist/webcomponents/{p-931ea171.entry.js → p-1ec3d1e7.entry.js} +1 -1
  219. package/dist/webcomponents/{p-86db9040.entry.js → p-20cab5fe.entry.js} +1 -1
  220. package/dist/webcomponents/{p-a9b493c1.entry.js → p-238ba771.entry.js} +1 -1
  221. package/dist/webcomponents/{p-e11c7df0.entry.js → p-2454c140.entry.js} +1 -1
  222. package/dist/webcomponents/{p-5af4bb01.entry.js → p-25666afe.entry.js} +1 -1
  223. package/dist/webcomponents/{p-f5f46f2d.entry.js → p-26430bfe.entry.js} +1 -1
  224. package/dist/webcomponents/p-33ab9174.entry.js +1 -0
  225. package/dist/webcomponents/{p-f13c4a88.entry.js → p-3a254390.entry.js} +1 -1
  226. package/dist/webcomponents/p-4a802f82.entry.js +1 -0
  227. package/dist/webcomponents/p-4b928d2e.entry.js +1 -0
  228. package/dist/webcomponents/{p-252bd81d.entry.js → p-4d3e4e56.entry.js} +1 -1
  229. package/dist/webcomponents/{p-7184c2f8.entry.js → p-5ae3401d.entry.js} +1 -1
  230. package/dist/webcomponents/{p-4165281d.entry.js → p-7068c2ad.entry.js} +1 -1
  231. package/dist/webcomponents/{p-4786d1ea.entry.js → p-785e8ef7.entry.js} +1 -1
  232. package/dist/webcomponents/{p-50f16cca.entry.js → p-81bbd944.entry.js} +1 -1
  233. package/dist/webcomponents/{p-3d2495df.entry.js → p-8ac883e4.entry.js} +1 -1
  234. package/dist/webcomponents/{p-6ed0be7f.entry.js → p-8e6f2dc8.entry.js} +1 -1
  235. package/dist/webcomponents/{p-53be30e9.entry.js → p-8ed4f485.entry.js} +1 -1
  236. package/dist/webcomponents/p-922ddfb4.entry.js +1 -0
  237. package/dist/webcomponents/p-9643fe36.entry.js +1 -0
  238. package/dist/webcomponents/{p-Ce785aMx.js → p-B1AMrMly.js} +1 -1
  239. package/dist/webcomponents/{p-DDjKoqh6.js → p-BRPbLfCN.js} +1 -1
  240. package/dist/webcomponents/{p-BAu40WfT.js → p-BZbvHgMz.js} +1 -1
  241. package/dist/webcomponents/{p-APob2Eta.js → p-Bj9n56jK.js} +1 -1
  242. package/dist/webcomponents/p-By-Mu1IX.js +1 -0
  243. package/dist/webcomponents/p-C0dMwnDO.js +1 -0
  244. package/dist/webcomponents/p-C3RQHKL5.js +1 -0
  245. package/dist/webcomponents/{p-DBOsYeYk.js → p-CWyW004b.js} +1 -1
  246. package/dist/webcomponents/p-CekpA_KC.js +1 -0
  247. package/dist/webcomponents/p-CkYB1zGe.js +1 -0
  248. package/dist/webcomponents/p-D-07jgNC.js +1 -0
  249. package/dist/webcomponents/{p-C-LV3hNf.js → p-DCwnBXF7.js} +1 -1
  250. package/dist/webcomponents/p-DKemQxaE.js +1 -0
  251. package/dist/webcomponents/{p-CHJTjG_5.js → p-GgW1g7FQ.js} +1 -1
  252. package/dist/webcomponents/{p-NO0z-S2W.js → p-MVBgKFOv.js} +1 -1
  253. package/dist/webcomponents/{p-mhEMV8M-.js → p-Y-EhaLdV.js} +1 -1
  254. package/dist/webcomponents/{p-e5651bb1.entry.js → p-aa02e3d7.entry.js} +1 -1
  255. package/dist/webcomponents/p-adbe280f.entry.js +1 -0
  256. package/dist/webcomponents/{p-ea0cd47d.entry.js → p-af11ac6a.entry.js} +1 -1
  257. package/dist/webcomponents/{p-73b9cc29.entry.js → p-bbffb17f.entry.js} +1 -1
  258. package/dist/webcomponents/{p-782ccafb.entry.js → p-c0829d61.entry.js} +1 -1
  259. package/dist/webcomponents/{p-001ce9f8.entry.js → p-c2db5db6.entry.js} +1 -1
  260. package/dist/webcomponents/{p-79d1d6b3.entry.js → p-d4535236.entry.js} +1 -1
  261. package/dist/webcomponents/{p-e1a8785d.entry.js → p-d5827cb2.entry.js} +1 -1
  262. package/dist/webcomponents/{p-1eefdd41.entry.js → p-ed9db5b2.entry.js} +1 -1
  263. package/dist/webcomponents/{p-c11512e7.entry.js → p-f1e012f6.entry.js} +1 -1
  264. package/dist/webcomponents/{p-1dbf3473.entry.js → p-f1f0f100.entry.js} +1 -1
  265. package/dist/webcomponents/{p-7c4fa66f.entry.js → p-f5b7c322.entry.js} +1 -1
  266. package/dist/webcomponents/{p-bc56446a.entry.js → p-f9475bb0.entry.js} +1 -1
  267. package/dist/webcomponents/{p-4d7a2565.entry.js → p-ff1cff1d.entry.js} +1 -1
  268. package/dist/webcomponents/{p-D81X4BBI.js → p-g0kDRH6Z.js} +1 -1
  269. package/dist/webcomponents/{p-Bz97Ujvk.js → p-m_Ly-YPk.js} +1 -1
  270. package/dist/webcomponents/p-wSi5d4-j.js +1 -0
  271. package/dist/webcomponents/{p-BhvkOTYA.js → p-ygekUw3Q.js} +1 -1
  272. package/dist/webcomponents/webcomponents.esm.js +1 -1
  273. package/package.json +2 -1
  274. package/dist/webcomponents/p-0fb3fd77.entry.js +0 -1
  275. package/dist/webcomponents/p-198d2941.entry.js +0 -1
  276. package/dist/webcomponents/p-52203b01.entry.js +0 -1
  277. package/dist/webcomponents/p-639e5ce9.entry.js +0 -1
  278. package/dist/webcomponents/p-7ec771bc.entry.js +0 -1
  279. package/dist/webcomponents/p-D0PhRMmy.js +0 -1
  280. package/dist/webcomponents/p-DLLFAj4z.js +0 -1
  281. package/dist/webcomponents/p-DpkIbI5R.js +0 -1
  282. package/dist/webcomponents/p-MBH9QO2m.js +0 -1
  283. package/dist/webcomponents/p-ZkBwsSuI.js +0 -1
  284. package/dist/webcomponents/p-_LSWCi-4.js +0 -1
  285. package/dist/webcomponents/p-c5afb831.entry.js +0 -1
  286. package/dist/webcomponents/p-d55c348b.entry.js +0 -1
  287. package/dist/webcomponents/p-y-FoILTI.js +0 -1
@@ -0,0 +1,433 @@
1
+ import { h } from "@stencil/core";
2
+ import { Button, StyledHost } from "../../../../ui-components";
3
+ import { PlaidService } from "../../../../api/services/plaid.service";
4
+ import { ComponentErrorSeverity } from "../../../../api/ComponentError";
5
+ import { PlaidErrorCodes, PLAID_ERROR_MESSAGES, PLAID_ERROR_SEVERITY, } from "../../../../api/Plaid";
6
+ import plaidLogoSvg from "../../../../assets/plaid-icon.svg";
7
+ import { buttonSecondary } from "../../../../styles/parts";
8
+ export class PlaidVerification {
9
+ constructor() {
10
+ this.linkToken = null;
11
+ this.linkTokenId = null;
12
+ this.plaidLink = null;
13
+ this.isAuthenticating = false;
14
+ this.isSuccess = false;
15
+ this.error = null;
16
+ this.isLoading = false;
17
+ this.plaidService = new PlaidService();
18
+ this.abortController = null;
19
+ this.timeoutId = null;
20
+ this.initializePlaidLink = async () => {
21
+ try {
22
+ // Check if Plaid is available globally
23
+ if (typeof window.Plaid === 'undefined') {
24
+ this.handleError({
25
+ code: PlaidErrorCodes.PLAID_SDK_LOAD_FAILED,
26
+ message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
27
+ severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
28
+ retryable: true,
29
+ userAction: 'Refresh the page and try again',
30
+ });
31
+ return;
32
+ }
33
+ // Get link token from backend
34
+ await this.getLinkToken();
35
+ if (!this.linkToken) {
36
+ this.handleError({
37
+ code: PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED,
38
+ message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED],
39
+ severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED],
40
+ retryable: true,
41
+ userAction: 'Click to try again',
42
+ });
43
+ return;
44
+ }
45
+ // Initialize Plaid Link
46
+ const Plaid = window.Plaid;
47
+ this.plaidLink = Plaid.create({
48
+ token: this.linkToken,
49
+ onSuccess: this.handlePlaidSuccess,
50
+ onExit: this.handlePlaidExit,
51
+ onEvent: this.handlePlaidEvent,
52
+ onLoad: this.handlePlaidLoad,
53
+ });
54
+ }
55
+ catch (error) {
56
+ this.handleError({
57
+ code: PlaidErrorCodes.PLAID_LINK_INIT_FAILED,
58
+ message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_LINK_INIT_FAILED],
59
+ severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_LINK_INIT_FAILED],
60
+ originalError: error,
61
+ retryable: true,
62
+ userAction: 'Click to try again',
63
+ });
64
+ }
65
+ };
66
+ this.getLinkToken = async () => {
67
+ var _a, _b, _c, _d;
68
+ try {
69
+ if (!this.authToken || !this.accountId) {
70
+ this.handleError({
71
+ code: PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED,
72
+ message: 'Missing authentication. Please provide authToken and accountId.',
73
+ severity: ComponentErrorSeverity.ERROR,
74
+ retryable: false,
75
+ userAction: 'Provide required props',
76
+ });
77
+ return;
78
+ }
79
+ // Create abort controller for timeout handling
80
+ this.abortController = new AbortController();
81
+ // Set timeout for the request
82
+ this.timeoutId = setTimeout(() => {
83
+ var _a;
84
+ (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
85
+ }, 30000); // 30 second timeout
86
+ const response = await this.plaidService.getLinkTokenForVerification(this.authToken, this.businessId, this.abortController.signal);
87
+ // Clear timeout
88
+ if (this.timeoutId) {
89
+ clearTimeout(this.timeoutId);
90
+ this.timeoutId = null;
91
+ }
92
+ if (response.error) {
93
+ const errorMessage = typeof response.error === 'string'
94
+ ? response.error
95
+ : response.error.message || 'Failed to get link token';
96
+ throw new Error(errorMessage);
97
+ }
98
+ this.linkToken = response.data.link_token;
99
+ this.linkTokenId = response.data.id;
100
+ }
101
+ catch (error) {
102
+ // Clear timeout
103
+ if (this.timeoutId) {
104
+ clearTimeout(this.timeoutId);
105
+ this.timeoutId = null;
106
+ }
107
+ let errorCode = PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED;
108
+ let message = PLAID_ERROR_MESSAGES[errorCode];
109
+ let retryable = true;
110
+ // Handle specific error types
111
+ if (error.name === 'AbortError') {
112
+ errorCode = PlaidErrorCodes.PLAID_TIMEOUT;
113
+ message = PLAID_ERROR_MESSAGES[errorCode];
114
+ retryable = true;
115
+ }
116
+ else if (((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('network')) || ((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('fetch'))) {
117
+ errorCode = PlaidErrorCodes.PLAID_NETWORK_ERROR;
118
+ message = PLAID_ERROR_MESSAGES[errorCode];
119
+ retryable = true;
120
+ }
121
+ else if (((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('401')) || ((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unauthorized'))) {
122
+ errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
123
+ message = 'Authentication failed. Please check your credentials.';
124
+ retryable = false;
125
+ }
126
+ this.handleError({
127
+ code: errorCode,
128
+ message: message,
129
+ severity: PLAID_ERROR_SEVERITY[errorCode],
130
+ originalError: error,
131
+ retryable,
132
+ userAction: retryable ? 'Click to try again' : 'Check your credentials',
133
+ });
134
+ }
135
+ };
136
+ this.openPlaidLink = () => {
137
+ if (this.plaidLink && this.linkToken) {
138
+ this.isAuthenticating = true;
139
+ this.clearError();
140
+ this.plaidLink.open();
141
+ }
142
+ };
143
+ this.handlePlaidSuccess = async (publicToken, _metadata) => {
144
+ var _a;
145
+ this.isAuthenticating = false;
146
+ this.isLoading = true;
147
+ this.clearError();
148
+ try {
149
+ // Send publicToken to backend
150
+ const response = await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken, this.businessId, { public_token: publicToken, link_token_id: this.linkTokenId }, (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.signal);
151
+ if (response.error) {
152
+ const errorMessage = typeof response.error === 'string'
153
+ ? response.error
154
+ : response.error.message || 'Failed to verify bank account';
155
+ throw new Error(errorMessage);
156
+ }
157
+ // Success - display success message
158
+ this.isSuccess = true;
159
+ this.isLoading = false;
160
+ // Emit success event
161
+ this.plaidVerificationSuccess.emit({ publicToken, bankAccount: response.data });
162
+ }
163
+ catch (error) {
164
+ this.isLoading = false;
165
+ this.handleError({
166
+ code: PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED,
167
+ message: (error === null || error === void 0 ? void 0 : error.message) || 'Failed to verify bank account',
168
+ severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED],
169
+ originalError: error,
170
+ retryable: true,
171
+ userAction: 'Click to try again',
172
+ });
173
+ }
174
+ };
175
+ this.handlePlaidExit = (err, _metadata) => {
176
+ this.isAuthenticating = false;
177
+ if (err) {
178
+ this.handlePlaidError(err);
179
+ }
180
+ };
181
+ this.handlePlaidEvent = (eventName, metadata) => {
182
+ // Handle specific events if needed
183
+ switch (eventName) {
184
+ case 'OPEN':
185
+ this.isAuthenticating = true;
186
+ break;
187
+ case 'CLOSE':
188
+ this.isAuthenticating = false;
189
+ break;
190
+ case 'ERROR':
191
+ this.handlePlaidError(metadata);
192
+ break;
193
+ }
194
+ };
195
+ this.handlePlaidLoad = () => {
196
+ // Plaid Link loaded successfully
197
+ };
198
+ this.handlePlaidError = (error) => {
199
+ let errorCode = PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED;
200
+ let message = PLAID_ERROR_MESSAGES[errorCode];
201
+ let retryable = true;
202
+ let userAction = 'Click to try again';
203
+ // Map Plaid error codes to our error codes
204
+ if (error.error_code) {
205
+ switch (error.error_code) {
206
+ case 'INVALID_CREDENTIALS':
207
+ errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
208
+ message = PLAID_ERROR_MESSAGES[errorCode];
209
+ retryable = true;
210
+ break;
211
+ case 'ITEM_LOGIN_REQUIRED':
212
+ errorCode = PlaidErrorCodes.PLAID_INVALID_CREDENTIALS;
213
+ message = 'Your bank requires re-authentication. Please try again.';
214
+ retryable = true;
215
+ break;
216
+ case 'ITEM_LOCKED':
217
+ errorCode = PlaidErrorCodes.PLAID_ACCOUNT_LOCKED;
218
+ message = PLAID_ERROR_MESSAGES[errorCode];
219
+ retryable = false;
220
+ userAction = 'Contact your bank';
221
+ break;
222
+ case 'INSTITUTION_NOT_RESPONDING':
223
+ errorCode = PlaidErrorCodes.PLAID_MAINTENANCE;
224
+ message = PLAID_ERROR_MESSAGES[errorCode];
225
+ retryable = true;
226
+ break;
227
+ case 'RATE_LIMIT_EXCEEDED':
228
+ errorCode = PlaidErrorCodes.PLAID_RATE_LIMITED;
229
+ message = PLAID_ERROR_MESSAGES[errorCode];
230
+ retryable = true;
231
+ break;
232
+ default:
233
+ if (error.error_message) {
234
+ message = error.error_message;
235
+ }
236
+ break;
237
+ }
238
+ }
239
+ this.handleError({
240
+ code: errorCode,
241
+ message,
242
+ severity: PLAID_ERROR_SEVERITY[errorCode],
243
+ originalError: error,
244
+ retryable,
245
+ userAction,
246
+ });
247
+ this.isAuthenticating = false;
248
+ };
249
+ this.handleError = (plaidError) => {
250
+ this.error = plaidError;
251
+ this.isLoading = false;
252
+ // Emit error event for parent components
253
+ this.plaidVerificationError.emit(plaidError);
254
+ console.error('Plaid verification error:', plaidError);
255
+ };
256
+ this.clearError = () => {
257
+ if (this.error) {
258
+ this.error = null;
259
+ }
260
+ };
261
+ }
262
+ componentDidRender() {
263
+ if (!this.scriptRef)
264
+ return;
265
+ this.scriptRef.onload = () => {
266
+ this.initializePlaidLink();
267
+ };
268
+ this.scriptRef.onerror = () => {
269
+ this.handleError({
270
+ code: PlaidErrorCodes.PLAID_SDK_LOAD_FAILED,
271
+ message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
272
+ severity: PLAID_ERROR_SEVERITY[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
273
+ retryable: true,
274
+ userAction: 'Refresh the page and try again',
275
+ });
276
+ };
277
+ }
278
+ disconnectedCallback() {
279
+ // Clean up timeouts and abort controllers
280
+ if (this.timeoutId) {
281
+ clearTimeout(this.timeoutId);
282
+ }
283
+ if (this.abortController) {
284
+ this.abortController.abort();
285
+ }
286
+ }
287
+ render() {
288
+ const renderErrorState = () => {
289
+ if (!this.error)
290
+ return null;
291
+ const errorClass = this.error.severity === ComponentErrorSeverity.ERROR
292
+ ? 'text-danger'
293
+ : this.error.severity === ComponentErrorSeverity.WARNING
294
+ ? 'text-warning'
295
+ : 'text-info';
296
+ return (h("div", { class: `${errorClass} mt-2` }, h("small", null, this.error.message), h("br", null), this.error.userAction && (h("small", { class: "text-muted" }, this.error.userAction))));
297
+ };
298
+ const renderStatusState = () => {
299
+ if (this.error)
300
+ return null;
301
+ if (this.isLoading) {
302
+ return (h("div", { class: "text-info mt-2" }, h("small", null, "Verifying bank account...")));
303
+ }
304
+ if (this.isSuccess) {
305
+ return (h("div", { class: "text-success mt-2" }, h("small", null, "\u2713 Bank account verified successfully")));
306
+ }
307
+ if (this.isAuthenticating) {
308
+ return (h("div", { class: "text-info mt-2" }, h("small", null, "Connecting to your bank...")));
309
+ }
310
+ return null;
311
+ };
312
+ const plaidLogo = (h("img", { class: "plaid-logo-img", src: plaidLogoSvg, alt: "Plaid", title: "Plaid", style: {
313
+ display: 'inline',
314
+ width: '20px',
315
+ height: '20px',
316
+ marginLeft: '5px',
317
+ marginTop: '-2px',
318
+ } }));
319
+ return (h(StyledHost, null, h("script", { src: "https://cdn.plaid.com/link/v2/stable/link-initialize.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", null, h("div", { class: "mb-3" }, h(Button, { variant: "secondary", type: "button", onClick: (event) => { event.preventDefault(); this.openPlaidLink(); }, disabled: this.isLoading, part: buttonSecondary }, "Link Bank Account with ", plaidLogo)), renderErrorState(), renderStatusState())));
320
+ }
321
+ static get is() { return "plaid-verification"; }
322
+ static get properties() {
323
+ return {
324
+ "authToken": {
325
+ "type": "string",
326
+ "mutable": false,
327
+ "complexType": {
328
+ "original": "string",
329
+ "resolved": "string",
330
+ "references": {}
331
+ },
332
+ "required": false,
333
+ "optional": false,
334
+ "docs": {
335
+ "tags": [],
336
+ "text": ""
337
+ },
338
+ "getter": false,
339
+ "setter": false,
340
+ "reflect": false,
341
+ "attribute": "auth-token"
342
+ },
343
+ "accountId": {
344
+ "type": "string",
345
+ "mutable": false,
346
+ "complexType": {
347
+ "original": "string",
348
+ "resolved": "string",
349
+ "references": {}
350
+ },
351
+ "required": false,
352
+ "optional": false,
353
+ "docs": {
354
+ "tags": [],
355
+ "text": ""
356
+ },
357
+ "getter": false,
358
+ "setter": false,
359
+ "reflect": false,
360
+ "attribute": "account-id"
361
+ },
362
+ "businessId": {
363
+ "type": "string",
364
+ "mutable": false,
365
+ "complexType": {
366
+ "original": "string",
367
+ "resolved": "string",
368
+ "references": {}
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": ""
375
+ },
376
+ "getter": false,
377
+ "setter": false,
378
+ "reflect": false,
379
+ "attribute": "business-id"
380
+ }
381
+ };
382
+ }
383
+ static get states() {
384
+ return {
385
+ "linkToken": {},
386
+ "linkTokenId": {},
387
+ "plaidLink": {},
388
+ "isAuthenticating": {},
389
+ "isSuccess": {},
390
+ "error": {},
391
+ "isLoading": {}
392
+ };
393
+ }
394
+ static get events() {
395
+ return [{
396
+ "method": "plaidVerificationSuccess",
397
+ "name": "plaidVerificationSuccess",
398
+ "bubbles": true,
399
+ "cancelable": true,
400
+ "composed": true,
401
+ "docs": {
402
+ "tags": [],
403
+ "text": ""
404
+ },
405
+ "complexType": {
406
+ "original": "{ publicToken: string, bankAccount: any }",
407
+ "resolved": "{ publicToken: string; bankAccount: any; }",
408
+ "references": {}
409
+ }
410
+ }, {
411
+ "method": "plaidVerificationError",
412
+ "name": "plaidVerificationError",
413
+ "bubbles": true,
414
+ "cancelable": true,
415
+ "composed": true,
416
+ "docs": {
417
+ "tags": [],
418
+ "text": ""
419
+ },
420
+ "complexType": {
421
+ "original": "PlaidError",
422
+ "resolved": "PlaidError",
423
+ "references": {
424
+ "PlaidError": {
425
+ "location": "import",
426
+ "path": "../../../../api/Plaid",
427
+ "id": "src/api/Plaid.ts::PlaidError"
428
+ }
429
+ }
430
+ }
431
+ }];
432
+ }
433
+ }
@@ -5,55 +5,7 @@ import plaidLogoSvg from "../../../assets/plaid-icon.svg";
5
5
  import { PlaidService } from "../../../api/services/plaid.service";
6
6
  import { ComponentErrorSeverity } from "../../../api/ComponentError";
7
7
  import { PAYMENT_METHODS } from "../ModularCheckout";
8
- // Plaid-specific error codes
9
- export var PlaidErrorCodes;
10
- (function (PlaidErrorCodes) {
11
- PlaidErrorCodes["PLAID_SDK_LOAD_FAILED"] = "plaid-sdk-load-failed";
12
- PlaidErrorCodes["PLAID_LINK_INIT_FAILED"] = "plaid-link-init-failed";
13
- PlaidErrorCodes["PLAID_LINK_TOKEN_FAILED"] = "plaid-link-token-failed";
14
- PlaidErrorCodes["PLAID_AUTHENTICATION_FAILED"] = "plaid-authentication-failed";
15
- PlaidErrorCodes["PLAID_BANK_NOT_SUPPORTED"] = "plaid-bank-not-supported";
16
- PlaidErrorCodes["PLAID_TOKEN_EXPIRED"] = "plaid-token-expired";
17
- PlaidErrorCodes["PLAID_NETWORK_ERROR"] = "plaid-network-error";
18
- PlaidErrorCodes["PLAID_USER_CANCELLED"] = "plaid-user-cancelled";
19
- PlaidErrorCodes["PLAID_TIMEOUT"] = "plaid-timeout";
20
- PlaidErrorCodes["PLAID_INVALID_CREDENTIALS"] = "plaid-invalid-credentials";
21
- PlaidErrorCodes["PLAID_ACCOUNT_LOCKED"] = "plaid-account-locked";
22
- PlaidErrorCodes["PLAID_MAINTENANCE"] = "plaid-maintenance";
23
- PlaidErrorCodes["PLAID_RATE_LIMITED"] = "plaid-rate-limited";
24
- })(PlaidErrorCodes || (PlaidErrorCodes = {}));
25
- // Plaid error message mapping
26
- const PLAID_ERROR_MESSAGES = {
27
- [PlaidErrorCodes.PLAID_SDK_LOAD_FAILED]: 'Unable to load Plaid. Please refresh the page and try again.',
28
- [PlaidErrorCodes.PLAID_LINK_INIT_FAILED]: 'Unable to initialize bank connection. Please try again.',
29
- [PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED]: 'Unable to connect to bank service. Please try again.',
30
- [PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED]: 'Bank authentication failed. Please try again.',
31
- [PlaidErrorCodes.PLAID_BANK_NOT_SUPPORTED]: 'Your bank is not currently supported. Please try a different payment method.',
32
- [PlaidErrorCodes.PLAID_TOKEN_EXPIRED]: 'Your bank session has expired. Please reconnect your account.',
33
- [PlaidErrorCodes.PLAID_NETWORK_ERROR]: 'Network connection issue. Please check your internet connection and try again.',
34
- [PlaidErrorCodes.PLAID_USER_CANCELLED]: 'Bank connection was cancelled. Click to try again.',
35
- [PlaidErrorCodes.PLAID_TIMEOUT]: 'Bank connection timed out. Please try again.',
36
- [PlaidErrorCodes.PLAID_INVALID_CREDENTIALS]: 'Invalid bank credentials. Please check your username and password.',
37
- [PlaidErrorCodes.PLAID_ACCOUNT_LOCKED]: 'Your bank account is temporarily locked. Please contact your bank.',
38
- [PlaidErrorCodes.PLAID_MAINTENANCE]: 'Bank service is temporarily unavailable. Please try again later.',
39
- [PlaidErrorCodes.PLAID_RATE_LIMITED]: 'Too many connection attempts. Please wait a moment and try again.',
40
- };
41
- // Plaid error severity mapping
42
- const PLAID_ERROR_SEVERITY = {
43
- [PlaidErrorCodes.PLAID_SDK_LOAD_FAILED]: ComponentErrorSeverity.ERROR,
44
- [PlaidErrorCodes.PLAID_LINK_INIT_FAILED]: ComponentErrorSeverity.ERROR,
45
- [PlaidErrorCodes.PLAID_LINK_TOKEN_FAILED]: ComponentErrorSeverity.ERROR,
46
- [PlaidErrorCodes.PLAID_AUTHENTICATION_FAILED]: ComponentErrorSeverity.ERROR,
47
- [PlaidErrorCodes.PLAID_BANK_NOT_SUPPORTED]: ComponentErrorSeverity.WARNING,
48
- [PlaidErrorCodes.PLAID_TOKEN_EXPIRED]: ComponentErrorSeverity.WARNING,
49
- [PlaidErrorCodes.PLAID_NETWORK_ERROR]: ComponentErrorSeverity.WARNING,
50
- [PlaidErrorCodes.PLAID_USER_CANCELLED]: ComponentErrorSeverity.INFO,
51
- [PlaidErrorCodes.PLAID_TIMEOUT]: ComponentErrorSeverity.WARNING,
52
- [PlaidErrorCodes.PLAID_INVALID_CREDENTIALS]: ComponentErrorSeverity.ERROR,
53
- [PlaidErrorCodes.PLAID_ACCOUNT_LOCKED]: ComponentErrorSeverity.ERROR,
54
- [PlaidErrorCodes.PLAID_MAINTENANCE]: ComponentErrorSeverity.WARNING,
55
- [PlaidErrorCodes.PLAID_RATE_LIMITED]: ComponentErrorSeverity.WARNING,
56
- };
8
+ import { PlaidErrorCodes, PLAID_ERROR_MESSAGES, PLAID_ERROR_SEVERITY, } from "../../../api/Plaid";
57
9
  export class PlaidPaymentMethod {
58
10
  constructor() {
59
11
  this.isAuthenticating = false;
@@ -834,8 +786,9 @@ export class PlaidPaymentMethod {
834
786
  "id": "global::Promise"
835
787
  },
836
788
  "PlaidError": {
837
- "location": "global",
838
- "id": "global::PlaidError"
789
+ "location": "import",
790
+ "path": "../../../api/Plaid",
791
+ "id": "src/api/Plaid.ts::PlaidError"
839
792
  }
840
793
  },
841
794
  "return": "Promise<PlaidError>"
@@ -5,38 +5,66 @@ export class CustomPopper {
5
5
  this.placement = 'bottom';
6
6
  this.offset = [0, 10];
7
7
  this.strategy = 'absolute';
8
- this.trigger = 'click'; // 'click', 'hover', 'focus'
8
+ this.trigger = 'click';
9
9
  this.isOpen = false;
10
+ this.initialized = false;
11
+ this.boundHandlers = {
12
+ show: null,
13
+ hide: null,
14
+ handleClick: null,
15
+ };
16
+ }
17
+ onAnchorRefChange(newValue) {
18
+ if (newValue && this.popperContentRef && !this.initialized) {
19
+ this.initPopper();
20
+ }
10
21
  }
11
22
  componentDidLoad() {
23
+ if (this.anchorRef && this.popperContentRef) {
24
+ this.initPopper();
25
+ }
26
+ }
27
+ initPopper() {
28
+ if (this.initialized)
29
+ return;
30
+ this.initialized = true;
31
+ // Store bound references
32
+ this.boundHandlers.show = this.show.bind(this);
33
+ this.boundHandlers.hide = this.hide.bind(this);
34
+ this.boundHandlers.handleClick = this.handleClick.bind(this);
12
35
  this.popperInstance = createPopper(this.anchorRef, this.popperContentRef, this.popperOptions);
13
36
  if (this.trigger === 'click') {
14
- window.addEventListener('click', this.handleClick.bind(this));
37
+ window.addEventListener('click', this.boundHandlers.handleClick);
15
38
  }
16
39
  else if (this.trigger === 'hover') {
17
- this.anchorRef.addEventListener('mouseenter', this.show.bind(this));
18
- this.anchorRef.addEventListener('mouseleave', this.hide.bind(this));
19
- this.popperContentRef.addEventListener('mouseenter', this.show.bind(this));
20
- this.popperContentRef.addEventListener('mouseleave', this.hide.bind(this));
40
+ this.anchorRef.addEventListener('mouseenter', this.boundHandlers.show);
41
+ this.anchorRef.addEventListener('mouseleave', this.boundHandlers.hide);
42
+ this.popperContentRef.addEventListener('mouseenter', this.boundHandlers.show);
43
+ this.popperContentRef.addEventListener('mouseleave', this.boundHandlers.hide);
21
44
  }
22
45
  else if (this.trigger === 'focus') {
23
- this.anchorRef.addEventListener('focus', this.show.bind(this));
24
- this.anchorRef.addEventListener('blur', this.hide.bind(this));
46
+ this.anchorRef.addEventListener('focus', this.boundHandlers.show);
47
+ this.anchorRef.addEventListener('blur', this.boundHandlers.hide);
25
48
  }
26
49
  }
27
50
  disconnectedCallback() {
51
+ var _a, _b, _c, _d, _e, _f, _g;
52
+ if (!this.initialized)
53
+ return;
54
+ // Clean up popper instance
55
+ (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
28
56
  if (this.trigger === 'click') {
29
- window.removeEventListener('click', this.handleClick.bind(this));
57
+ window.removeEventListener('click', this.boundHandlers.handleClick);
30
58
  }
31
59
  else if (this.trigger === 'hover') {
32
- this.anchorRef.removeEventListener('mouseenter', this.show.bind(this));
33
- this.anchorRef.removeEventListener('mouseleave', this.hide.bind(this));
34
- this.popperContentRef.removeEventListener('mouseenter', this.show.bind(this));
35
- this.popperContentRef.removeEventListener('mouseleave', this.hide.bind(this));
60
+ (_b = this.anchorRef) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseenter', this.boundHandlers.show);
61
+ (_c = this.anchorRef) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', this.boundHandlers.hide);
62
+ (_d = this.popperContentRef) === null || _d === void 0 ? void 0 : _d.removeEventListener('mouseenter', this.boundHandlers.show);
63
+ (_e = this.popperContentRef) === null || _e === void 0 ? void 0 : _e.removeEventListener('mouseleave', this.boundHandlers.hide);
36
64
  }
37
65
  else if (this.trigger === 'focus') {
38
- this.anchorRef.removeEventListener('focus', this.show.bind(this));
39
- this.anchorRef.removeEventListener('blur', this.hide.bind(this));
66
+ (_f = this.anchorRef) === null || _f === void 0 ? void 0 : _f.removeEventListener('focus', this.boundHandlers.show);
67
+ (_g = this.anchorRef) === null || _g === void 0 ? void 0 : _g.removeEventListener('blur', this.boundHandlers.hide);
40
68
  }
41
69
  }
42
70
  handleClick(event) {
@@ -80,7 +108,7 @@ export class CustomPopper {
80
108
  this.hideEvent.emit();
81
109
  }
82
110
  render() {
83
- return (h("div", { key: 'd9ed696150f2def459af17d43a2a06e0fb24b2d1' }, h("style", { key: 'eb3f2a09ace3aa7d0d6225947a0d511cf73b107b' }, `
111
+ return (h("div", { key: '2d57f47cc668826c2a72d70d3a0404837398a646' }, h("style", { key: '6d02bdb47dd36a529d2e8ae3f2b4adad6c8cdf88' }, `
84
112
  .popper-content {
85
113
  display: none;
86
114
  }
@@ -88,7 +116,7 @@ export class CustomPopper {
88
116
  display: block;
89
117
  z-index: 1030;
90
118
  }
91
- `), h("div", { key: '3221d4cc026a4b9ef06aaaa38a5ad4bc5f190f81', class: "popper-content", ref: (el) => this.popperContentRef = el }, h("slot", { key: '6481dcba1041571349cb8c91c350c497453fe054' }))));
119
+ `), h("div", { key: 'fdcb769c70b92532427e09fdaa5bbdffc59c8ac3', class: "popper-content", ref: (el) => this.popperContentRef = el }, h("slot", { key: '1cdd517d323181dee0f2a345406d07432889ee21' }))));
92
120
  }
93
121
  static get is() { return "custom-popper"; }
94
122
  static get properties() {
@@ -200,7 +228,7 @@ export class CustomPopper {
200
228
  }
201
229
  }
202
230
  },
203
- "required": true,
231
+ "required": false,
204
232
  "optional": false,
205
233
  "docs": {
206
234
  "tags": [],
@@ -249,4 +277,10 @@ export class CustomPopper {
249
277
  }
250
278
  }];
251
279
  }
280
+ static get watchers() {
281
+ return [{
282
+ "propName": "anchorRef",
283
+ "methodName": "onAnchorRefChange"
284
+ }];
285
+ }
252
286
  }