@justifi/webcomponents 4.8.3 → 4.10.0-rc.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 (490) hide show
  1. package/dist/cjs/{Business-42d0c522.js → Business-79361c8a.js} +7 -7
  2. package/dist/cjs/Identity-b6364aee.js +27 -0
  3. package/dist/cjs/{Payout-44b49b2d.js → Payment-89a8bc21.js} +0 -43
  4. package/dist/cjs/Payout-a2dd7b01.js +45 -0
  5. package/dist/cjs/{SubAccount-2a803b22.js → SubAccount-b3902202.js} +1 -1
  6. package/dist/cjs/additional-questions-details_5.cjs.entry.js +24 -10
  7. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
  8. package/dist/cjs/business-details-core.cjs.entry.js +55 -0
  9. package/dist/cjs/business-form-select-options-7ccd8dca.js +85 -0
  10. package/dist/cjs/business-form-types-3cdd5447.js +19 -0
  11. package/dist/cjs/form-control-datepart_3.cjs.entry.js +32 -46
  12. package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
  13. package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +44 -1
  14. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +11036 -0
  15. package/dist/cjs/{index-55950669.js → index-69b9386b.js} +57 -3
  16. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +505 -0
  17. package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +12 -42
  18. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  19. package/dist/cjs/{select-input_2.cjs.entry.js → justifi-billing-form_4.cjs.entry.js} +1810 -1
  20. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
  21. package/dist/cjs/justifi-business-details.cjs.entry.js +43 -57
  22. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +36 -89
  23. package/dist/cjs/justifi-business-form.cjs.entry.js +18 -16
  24. package/dist/cjs/justifi-business-list.cjs.entry.js +5 -4
  25. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  26. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-checkout-core.cjs.entry.js +95 -0
  28. package/dist/cjs/justifi-checkout.cjs.entry.js +99 -0
  29. package/dist/cjs/justifi-details.cjs.entry.js +2 -2
  30. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +39 -11008
  31. package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +168 -0
  32. package/dist/cjs/justifi-owner-form.cjs.entry.js +160 -0
  33. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +5 -4
  34. package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -5
  35. package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -4
  36. package/dist/cjs/{justifi-billing-form_2.cjs.entry.js → justifi-payment-method-selector.cjs.entry.js} +4 -79
  37. package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -5
  38. package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -4
  39. package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -4
  40. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +4 -3
  41. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
  42. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +6 -5
  43. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +5 -4
  44. package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
  45. package/dist/cjs/loader.cjs.js +2 -2
  46. package/dist/cjs/payload-parsers-25ed3936.js +98 -0
  47. package/dist/cjs/payment-details-core.cjs.entry.js +10 -4
  48. package/dist/cjs/{payment.service-605896dc.js → payment.service-0b0086dc.js} +2 -1
  49. package/dist/cjs/payments-list-core.cjs.entry.js +4 -3
  50. package/dist/cjs/payout-details-core.cjs.entry.js +4 -4
  51. package/dist/cjs/{payout.service-b39f2739.js → payout.service-5cc3b4e9.js} +2 -1
  52. package/dist/cjs/payouts-list-core.cjs.entry.js +4 -3
  53. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +7 -7
  54. package/dist/cjs/subaccount-bank-details.cjs.entry.js +3 -3
  55. package/dist/cjs/subaccount-terms-details.cjs.entry.js +3 -3
  56. package/dist/cjs/{utils-d126d17c.js → utils-23e70ef2.js} +5 -5
  57. package/dist/cjs/{utils-29a8a91d.js → utils-6f62f7a1.js} +29 -2
  58. package/dist/cjs/utils-df5167a8.js +13 -0
  59. package/dist/cjs/webcomponents.cjs.js +2 -2
  60. package/dist/collection/api/Business.js +6 -7
  61. package/dist/collection/api/Checkout.js +1 -0
  62. package/dist/collection/api/Identity.js +43 -0
  63. package/dist/collection/api/index.js +1 -0
  64. package/dist/collection/api/services/business.service.js +8 -0
  65. package/dist/collection/api/services/checkout.service.js +12 -0
  66. package/dist/collection/api/services/reports.service.js +9 -0
  67. package/dist/collection/collection-manifest.json +22 -8
  68. package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
  69. package/dist/collection/components/billing-form/billing-form.js +1 -2
  70. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +5 -2
  71. package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +16 -0
  72. package/dist/collection/components/business-details/business-details-core.js +86 -0
  73. package/dist/collection/components/business-details/business-details.js +20 -65
  74. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -2
  75. package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +16 -0
  76. package/dist/collection/components/business-details/get-business.js +17 -0
  77. package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +5 -2
  78. package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +16 -0
  79. package/dist/collection/components/business-details/owner-details/owner-details.js +12 -14
  80. package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +16 -0
  81. package/dist/collection/components/business-details/representative-details/representative-details.js +7 -5
  82. package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +16 -0
  83. package/dist/collection/components/business-details/test/busines-details-core.spec.js +53 -0
  84. package/dist/collection/components/business-details/test/business-details.spec.js +40 -0
  85. package/dist/collection/components/business-details/test/get-business.spec.js +60 -0
  86. package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
  87. package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +2536 -0
  88. package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.js +4 -4
  89. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.css +2493 -0
  90. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +77 -0
  91. package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
  92. package/dist/collection/components/business-forms/business-form/business-owners/business-owners.css +7779 -0
  93. package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
  94. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.css +2493 -0
  95. package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
  96. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.css +2493 -0
  97. package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.js +1 -1
  98. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.js +218 -0
  99. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
  100. package/dist/collection/components/business-forms/business-form-stepped/business-address/business-address-form-step.js +97 -0
  101. package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +97 -0
  102. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.js +239 -0
  103. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/test/business-core-info-form-step.spec.js +97 -0
  104. package/dist/collection/components/{business-form → business-forms/business-form-stepped}/business-form-stepped.css +105 -0
  105. package/dist/collection/components/business-forms/business-form-stepped/business-form-stepped.js +199 -0
  106. package/dist/collection/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.js +284 -0
  107. package/dist/collection/components/business-forms/business-form-stepped/business-owners/test/business-owners-form-step.spec.js +97 -0
  108. package/dist/collection/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.js +230 -0
  109. package/dist/collection/components/business-forms/business-form-stepped/business-representative/test/business-representative-form-step.spec.js +97 -0
  110. package/dist/collection/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.js +232 -0
  111. package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +61 -0
  112. package/dist/collection/components/business-forms/owner-form/owner-form.css +7779 -0
  113. package/dist/collection/components/business-forms/owner-form/owner-form.js +367 -0
  114. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +7 -0
  115. package/dist/collection/components/business-forms/schemas/business-address-schema.js +15 -0
  116. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +13 -0
  117. package/dist/collection/components/business-forms/schemas/business-form-schema.js +6 -0
  118. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +35 -0
  119. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +16 -0
  120. package/dist/collection/components/business-forms/utils/business-form-select-options.js +80 -0
  121. package/dist/collection/components/business-forms/utils/business-form-types.js +17 -0
  122. package/dist/collection/components/business-forms/utils/payload-parsers.js +37 -0
  123. package/dist/collection/components/checkout/checkout-actions.js +33 -0
  124. package/dist/collection/components/checkout/checkout-core.css +2604 -0
  125. package/dist/collection/components/checkout/checkout-core.js +248 -0
  126. package/dist/collection/components/checkout/checkout.js +112 -0
  127. package/dist/collection/components/checkout/new-payment-method.js +188 -0
  128. package/dist/collection/components/checkout/payment-method-option-utils.js +19 -0
  129. package/dist/collection/components/checkout/payment-method-options.css +7073 -0
  130. package/dist/collection/components/checkout/payment-method-options.js +248 -0
  131. package/dist/collection/components/checkout/saved-payment-method.js +123 -0
  132. package/dist/collection/components/checkout/test/checkout.js +22 -0
  133. package/dist/collection/components/checkout/test/checkout.spec.js +166 -0
  134. package/dist/collection/components/checkout/test/mockCheckout.js +19 -0
  135. package/dist/collection/components/details/utils.js +4 -1
  136. package/dist/collection/components/form/utils.js +1 -0
  137. package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +14 -0
  138. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +119 -0
  139. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +25 -73
  140. package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +69 -0
  141. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +64 -0
  142. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +23 -8
  143. package/dist/collection/components/payment-details/payment-details-core.js +8 -2
  144. package/dist/collection/components/payment-details/payment-details.js +0 -1
  145. package/dist/collection/components/payment-form/payment-form.js +1 -1
  146. package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
  147. package/dist/collection/components/payout-details/payout-details-core.js +2 -2
  148. package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +2 -2
  149. package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +2 -2
  150. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +2 -2
  151. package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +2 -2
  152. package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +2 -2
  153. package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +2 -2
  154. package/dist/collection/utils/utils.js +25 -3
  155. package/dist/docs.json +2945 -590
  156. package/dist/esm/{Business-e9340f6b.js → Business-1df362e0.js} +7 -8
  157. package/dist/esm/Identity-774788c0.js +25 -0
  158. package/dist/esm/{Payout-dc5f009c.js → Payment-55886c86.js} +1 -43
  159. package/dist/esm/Payout-dfe15b00.js +43 -0
  160. package/dist/esm/{SubAccount-46b4c2b1.js → SubAccount-f4ae9809.js} +1 -1
  161. package/dist/esm/additional-questions-details_5.entry.js +24 -10
  162. package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
  163. package/dist/esm/business-details-core.entry.js +51 -0
  164. package/dist/esm/business-form-select-options-6b9293fe.js +82 -0
  165. package/dist/esm/business-form-types-de9f38cd.js +19 -0
  166. package/dist/esm/form-control-datepart_3.entry.js +32 -46
  167. package/dist/esm/form-control-monetary.entry.js +1 -1
  168. package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +44 -2
  169. package/dist/esm/gross-payment-chart-core.entry.js +11032 -0
  170. package/dist/esm/{index-62b8aa8a.js → index-df86d9a2.js} +57 -3
  171. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +497 -0
  172. package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +12 -41
  173. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  174. package/dist/esm/{select-input_2.entry.js → justifi-billing-form_4.entry.js} +1809 -2
  175. package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
  176. package/dist/esm/justifi-business-details.entry.js +42 -56
  177. package/dist/esm/justifi-business-form-stepped.entry.js +36 -89
  178. package/dist/esm/justifi-business-form.entry.js +17 -15
  179. package/dist/esm/justifi-business-list.entry.js +5 -4
  180. package/dist/esm/justifi-business-owners.entry.js +1 -1
  181. package/dist/esm/justifi-card-form.entry.js +1 -1
  182. package/dist/esm/justifi-checkout-core.entry.js +91 -0
  183. package/dist/esm/justifi-checkout.entry.js +95 -0
  184. package/dist/esm/justifi-details.entry.js +2 -2
  185. package/dist/esm/justifi-gross-payment-chart.entry.js +39 -11008
  186. package/dist/esm/justifi-new-payment-method_3.entry.js +162 -0
  187. package/dist/esm/justifi-owner-form.entry.js +156 -0
  188. package/dist/esm/justifi-payment-balance-transactions.entry.js +4 -3
  189. package/dist/esm/justifi-payment-details.entry.js +5 -4
  190. package/dist/esm/justifi-payment-form.entry.js +4 -3
  191. package/dist/esm/{justifi-billing-form_2.entry.js → justifi-payment-method-selector.entry.js} +4 -78
  192. package/dist/esm/justifi-payments-list.entry.js +5 -4
  193. package/dist/esm/justifi-payout-details.entry.js +5 -4
  194. package/dist/esm/justifi-payouts-list.entry.js +5 -4
  195. package/dist/esm/justifi-proceeds-list.entry.js +4 -3
  196. package/dist/esm/justifi-refund-form.entry.js +3 -2
  197. package/dist/esm/justifi-subaccount-details.entry.js +6 -5
  198. package/dist/esm/justifi-subaccounts-list.entry.js +5 -4
  199. package/dist/esm/justifi-table_2.entry.js +1 -1
  200. package/dist/esm/loader.js +3 -3
  201. package/dist/esm/payload-parsers-1dd7474f.js +90 -0
  202. package/dist/esm/payment-details-core.entry.js +10 -4
  203. package/dist/esm/{payment.service-bea02ccf.js → payment.service-f274ef98.js} +2 -1
  204. package/dist/esm/payments-list-core.entry.js +4 -3
  205. package/dist/esm/payout-details-core.entry.js +4 -4
  206. package/dist/esm/{payout.service-92e56814.js → payout.service-af293f61.js} +2 -1
  207. package/dist/esm/payouts-list-core.entry.js +4 -3
  208. package/dist/esm/subaccount-account-details_4.entry.js +7 -7
  209. package/dist/esm/subaccount-bank-details.entry.js +3 -3
  210. package/dist/esm/subaccount-terms-details.entry.js +3 -3
  211. package/dist/esm/{utils-76a93600.js → utils-243abdb4.js} +26 -3
  212. package/dist/esm/utils-2828201a.js +10 -0
  213. package/dist/esm/{utils-576874df.js → utils-d01c5f3a.js} +5 -5
  214. package/dist/esm/webcomponents.js +3 -3
  215. package/dist/module/Business.js +7 -8
  216. package/dist/module/Payment.js +138 -0
  217. package/dist/module/Payout.js +1 -138
  218. package/dist/module/SubAccount.js +1 -1
  219. package/dist/module/additional-questions-details2.js +5 -2
  220. package/dist/module/billing-form.js +2 -3
  221. package/dist/module/business-additional-questions-form-step.js +120 -0
  222. package/dist/module/business-additional-questions-schema.js +10 -0
  223. package/dist/module/business-address-form.js +3 -3
  224. package/dist/module/business-address-schema.js +18 -0
  225. package/dist/module/business-core-info-form-step.js +141 -0
  226. package/dist/module/business-core-info-schema.js +16 -0
  227. package/dist/module/business-core-info.js +69 -0
  228. package/dist/module/business-details-core.d.ts +11 -0
  229. package/dist/module/business-details-core.js +6 -0
  230. package/dist/module/business-details-core2.js +101 -0
  231. package/dist/module/business-form-select-options.js +82 -0
  232. package/dist/module/business-form-types.js +19 -0
  233. package/dist/module/business-identity-schema.js +38 -0
  234. package/dist/module/business-owners-form-step.js +213 -0
  235. package/dist/module/business-representative-form-step.js +157 -0
  236. package/dist/module/business-representative.js +1 -1
  237. package/dist/module/checkout-core.js +163 -0
  238. package/dist/module/generic-info-details2.js +4 -2
  239. package/dist/module/gross-payment-chart-core.d.ts +11 -0
  240. package/dist/module/gross-payment-chart-core.js +6 -0
  241. package/dist/module/gross-payment-chart-core2.js +11055 -0
  242. package/dist/module/justifi-additional-questions-form-step.d.ts +11 -0
  243. package/dist/module/justifi-additional-questions-form-step.js +6 -0
  244. package/dist/module/justifi-business-address-form-step.d.ts +11 -0
  245. package/dist/module/justifi-business-address-form-step.js +75 -0
  246. package/dist/module/justifi-business-core-info-form-step.d.ts +11 -0
  247. package/dist/module/justifi-business-core-info-form-step.js +6 -0
  248. package/dist/module/justifi-business-core-info.d.ts +11 -0
  249. package/dist/module/justifi-business-core-info.js +6 -0
  250. package/dist/module/justifi-business-details.js +51 -60
  251. package/dist/module/justifi-business-form-stepped.js +72 -112
  252. package/dist/module/justifi-business-form.js +20 -14
  253. package/dist/module/justifi-business-list.js +2 -1
  254. package/dist/module/justifi-business-owners-form-step.d.ts +11 -0
  255. package/dist/module/justifi-business-owners-form-step.js +6 -0
  256. package/dist/module/justifi-business-representative-form-step.d.ts +11 -0
  257. package/dist/module/justifi-business-representative-form-step.js +6 -0
  258. package/dist/module/justifi-checkout-core.d.ts +11 -0
  259. package/dist/module/justifi-checkout-core.js +6 -0
  260. package/dist/module/justifi-checkout.d.ts +11 -0
  261. package/dist/module/justifi-checkout.js +172 -0
  262. package/dist/module/justifi-gross-payment-chart.js +49 -11016
  263. package/dist/module/justifi-legal-address-form-step.d.ts +11 -0
  264. package/dist/module/justifi-legal-address-form-step.js +6 -0
  265. package/dist/module/justifi-new-payment-method.d.ts +11 -0
  266. package/dist/module/justifi-new-payment-method.js +6 -0
  267. package/dist/module/justifi-owner-form.d.ts +11 -0
  268. package/dist/module/justifi-owner-form.js +6 -0
  269. package/dist/module/justifi-payment-balance-transactions.js +3 -2
  270. package/dist/module/justifi-payment-details.js +2 -1
  271. package/dist/module/justifi-payment-form.js +2 -1
  272. package/dist/module/justifi-payment-method-options.d.ts +11 -0
  273. package/dist/module/justifi-payment-method-options.js +6 -0
  274. package/dist/module/justifi-payments-list.js +2 -1
  275. package/dist/module/justifi-payout-details.js +2 -1
  276. package/dist/module/justifi-payouts-list.js +2 -1
  277. package/dist/module/justifi-proceeds-list.js +2 -1
  278. package/dist/module/justifi-refund-form.js +1 -0
  279. package/dist/module/justifi-saved-payment-method.d.ts +11 -0
  280. package/dist/module/justifi-saved-payment-method.js +6 -0
  281. package/dist/module/justifi-subaccount-details.js +2 -1
  282. package/dist/module/justifi-subaccounts-list.js +2 -1
  283. package/dist/module/legal-address-details2.js +5 -2
  284. package/dist/module/legal-address-form-step.js +136 -0
  285. package/dist/module/new-payment-method.js +105 -0
  286. package/dist/module/owner-details2.js +10 -4
  287. package/dist/module/owner-form.js +244 -0
  288. package/dist/module/payload-parsers.js +39 -0
  289. package/dist/module/payment-details-core2.js +9 -3
  290. package/dist/module/payment-method-form.js +4 -10
  291. package/dist/module/payment-method-options.js +128 -0
  292. package/dist/module/payment-method-selector.js +2 -1
  293. package/dist/module/payment.service.js +1 -0
  294. package/dist/module/payments-list-core2.js +2 -1
  295. package/dist/module/payout-details-core2.js +3 -3
  296. package/dist/module/payout.service.js +1 -0
  297. package/dist/module/payouts-list-core2.js +3 -2
  298. package/dist/module/representative-details2.js +5 -3
  299. package/dist/module/saved-payment-method.js +66 -0
  300. package/dist/module/subaccount-account-details2.js +2 -2
  301. package/dist/module/subaccount-bank-details.js +2 -2
  302. package/dist/module/subaccount-merchant-details2.js +3 -3
  303. package/dist/module/subaccount-owners-details2.js +2 -2
  304. package/dist/module/subaccount-representative-details2.js +2 -2
  305. package/dist/module/subaccount-terms-details.js +2 -2
  306. package/dist/module/utils.js +4 -4
  307. package/dist/module/utils2.js +26 -3
  308. package/dist/module/utils4.js +10 -0
  309. package/dist/types/api/Api.d.ts +1 -1
  310. package/dist/types/api/Business.d.ts +1 -18
  311. package/dist/types/api/Checkout.d.ts +14 -0
  312. package/dist/types/api/Identity.d.ts +60 -0
  313. package/dist/types/api/index.d.ts +1 -0
  314. package/dist/types/api/services/business.service.d.ts +8 -0
  315. package/dist/types/api/services/checkout.service.d.ts +9 -0
  316. package/dist/types/api/services/reports.service.d.ts +5 -0
  317. package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
  318. package/dist/types/components/billing-form/billing-form.d.ts +0 -1
  319. package/dist/types/components/business-details/business-details-core.d.ts +16 -0
  320. package/dist/types/components/business-details/business-details.d.ts +3 -13
  321. package/dist/types/components/business-details/get-business.d.ts +8 -0
  322. package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -9
  323. package/dist/types/components/business-details/representative-details/representative-details.d.ts +1 -1
  324. package/dist/types/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.d.ts +1 -1
  325. package/dist/types/components/{business-form → business-forms/business-form}/business-address/business-address-form.d.ts +1 -1
  326. package/dist/types/components/{business-form/business-generic-info/business-generic-info.d.ts → business-forms/business-form/business-core-info/business-core-info.d.ts} +5 -5
  327. package/dist/types/components/{business-form → business-forms/business-form}/business-form.d.ts +5 -10
  328. package/dist/types/components/{business-form → business-forms/business-form}/business-owners/business-owners.d.ts +1 -1
  329. package/dist/types/components/{business-form → business-forms/business-form}/business-representative/business-representative.d.ts +1 -1
  330. package/dist/types/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.d.ts +2 -2
  331. package/dist/types/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.d.ts +30 -0
  332. package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +9 -0
  333. package/dist/types/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.d.ts +36 -0
  334. package/dist/types/components/business-forms/business-form-stepped/business-form-stepped.d.ts +45 -0
  335. package/dist/types/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.d.ts +36 -0
  336. package/dist/types/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.d.ts +26 -0
  337. package/dist/types/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.d.ts +31 -0
  338. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +36 -0
  339. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +11 -0
  340. package/dist/types/components/{business-form/business-address/business-address-form-schema.d.ts → business-forms/schemas/business-address-schema.d.ts} +11 -8
  341. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +19 -0
  342. package/dist/types/components/{business-form → business-forms/schemas}/business-form-schema.d.ts +2 -26
  343. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +59 -0
  344. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +33 -0
  345. package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +11 -0
  346. package/dist/types/components/business-forms/utils/business-form-types.d.ts +39 -0
  347. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +4 -0
  348. package/dist/types/components/checkout/checkout-actions.d.ts +17 -0
  349. package/dist/types/components/checkout/checkout-core.d.ts +28 -0
  350. package/dist/types/components/checkout/checkout.d.ts +12 -0
  351. package/dist/types/components/checkout/new-payment-method.d.ts +17 -0
  352. package/dist/types/components/checkout/payment-method-option-utils.d.ts +16 -0
  353. package/dist/types/components/checkout/payment-method-options.d.ts +18 -0
  354. package/dist/types/components/checkout/saved-payment-method.d.ts +11 -0
  355. package/dist/types/components/checkout/test/checkout.d.ts +1 -0
  356. package/dist/types/components/checkout/test/mockCheckout.d.ts +19 -0
  357. package/dist/types/components/details/utils.d.ts +1 -1
  358. package/dist/types/components/form/form.d.ts +1 -1
  359. package/dist/types/components/form/utils.d.ts +1 -0
  360. package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +11 -0
  361. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +18 -0
  362. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -14
  363. package/dist/types/components/payment-details/payment-details.d.ts +0 -1
  364. package/dist/types/components/payment-method-form/payment-method-responses.d.ts +3 -9
  365. package/dist/types/components.d.ts +626 -91
  366. package/dist/types/utils/utils.d.ts +3 -0
  367. package/dist/webcomponents/p-0399f02b.entry.js +1 -0
  368. package/dist/webcomponents/{p-6478f3ca.js → p-04a98c63.js} +1 -1
  369. package/dist/webcomponents/p-06888c2e.entry.js +1 -0
  370. package/dist/webcomponents/{p-234bc840.entry.js → p-07b326d0.entry.js} +1 -1
  371. package/dist/webcomponents/p-0811bc77.entry.js +1 -0
  372. package/dist/webcomponents/p-0923e39c.js +1 -0
  373. package/dist/webcomponents/p-17d72f4a.js +1 -0
  374. package/dist/webcomponents/p-17f64853.entry.js +1 -0
  375. package/dist/webcomponents/p-1bfadb9f.entry.js +1 -0
  376. package/dist/webcomponents/p-22085999.entry.js +1 -0
  377. package/dist/webcomponents/p-252835df.entry.js +1 -0
  378. package/dist/webcomponents/{p-22c1acd6.js → p-28b38699.js} +1 -1
  379. package/dist/webcomponents/p-34352d04.js +1 -0
  380. package/dist/webcomponents/p-374c44e6.entry.js +1 -0
  381. package/dist/webcomponents/{p-0a0cf2e6.entry.js → p-4697ccfa.entry.js} +1 -1
  382. package/dist/webcomponents/p-4781cd06.js +1 -0
  383. package/dist/webcomponents/{p-4c01df65.entry.js → p-4d50d08a.entry.js} +1 -1
  384. package/dist/webcomponents/p-4d806131.entry.js +1 -0
  385. package/dist/webcomponents/{p-7a1a06c0.entry.js → p-4df6174c.entry.js} +1 -1
  386. package/dist/webcomponents/p-4e0b3206.entry.js +1 -0
  387. package/dist/webcomponents/{p-4ee44c76.entry.js → p-583dd5a2.entry.js} +1 -1
  388. package/dist/webcomponents/p-5be4e217.entry.js +1 -0
  389. package/dist/webcomponents/p-5da4fbe7.entry.js +1 -0
  390. package/dist/webcomponents/{p-40349ffc.entry.js → p-6103c20d.entry.js} +1 -1
  391. package/dist/webcomponents/p-63296409.js +1 -0
  392. package/dist/webcomponents/{p-5c0310ee.js → p-65510838.js} +1 -1
  393. package/dist/webcomponents/p-688bb5da.js +2 -0
  394. package/dist/webcomponents/p-6b51cf97.entry.js +1 -0
  395. package/dist/webcomponents/p-7654c70d.entry.js +1 -0
  396. package/dist/webcomponents/p-7b2cddc7.js +1 -0
  397. package/dist/webcomponents/p-847441ce.entry.js +1 -0
  398. package/dist/webcomponents/p-861ba3fc.entry.js +1 -0
  399. package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
  400. package/dist/webcomponents/p-975ab96e.js +1 -0
  401. package/dist/webcomponents/p-9ce8d98c.entry.js +1 -0
  402. package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
  403. package/dist/webcomponents/p-a141c531.js +1 -0
  404. package/dist/webcomponents/p-a2dbe90f.entry.js +1 -0
  405. package/dist/webcomponents/{p-4fa27a28.entry.js → p-a46174e0.entry.js} +1 -1
  406. package/dist/webcomponents/p-a98eea84.entry.js +1 -0
  407. package/dist/webcomponents/p-b1bc23af.entry.js +1 -0
  408. package/dist/webcomponents/p-b27c9b0d.entry.js +1 -0
  409. package/dist/webcomponents/{p-7c0f91fa.entry.js → p-b68f1dd9.entry.js} +1 -1
  410. package/dist/webcomponents/p-b8f22856.js +1 -0
  411. package/dist/webcomponents/p-c8d62072.entry.js +1 -0
  412. package/dist/webcomponents/{p-08833966.entry.js → p-da34bba7.entry.js} +1 -1
  413. package/dist/webcomponents/p-e3748ea4.entry.js +1 -0
  414. package/dist/webcomponents/p-e3fab0e2.js +1 -0
  415. package/dist/webcomponents/p-e924f2e1.entry.js +1 -0
  416. package/dist/webcomponents/p-ebf7c70f.entry.js +1 -0
  417. package/dist/webcomponents/p-eef5ed19.entry.js +1 -0
  418. package/dist/webcomponents/p-efc7025c.entry.js +1 -0
  419. package/dist/webcomponents/p-f3453ca2.js +1 -0
  420. package/dist/webcomponents/p-f3ca6fda.entry.js +1 -0
  421. package/dist/webcomponents/p-fb49ef28.entry.js +1 -0
  422. package/dist/webcomponents/p-fe2af0cf.entry.js +19 -0
  423. package/dist/webcomponents/p-fe8a94c1.entry.js +1 -0
  424. package/dist/webcomponents/webcomponents.esm.js +1 -1
  425. package/package.json +3 -2
  426. package/dist/cjs/BusinessFormEventTypes-863f48e9.js +0 -42
  427. package/dist/cjs/business-form-schema-37e5381d.js +0 -148
  428. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +0 -1747
  429. package/dist/collection/components/business-form/BusinessFormEventTypes.js +0 -6
  430. package/dist/collection/components/business-form/business-address/business-address-form-schema.js +0 -13
  431. package/dist/collection/components/business-form/business-form-schema.js +0 -159
  432. package/dist/collection/components/business-form/business-form-stepped.js +0 -260
  433. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +0 -77
  434. package/dist/collection/components/business-form/business-representative/business-representative-schema.js +0 -1
  435. package/dist/collection/components/business-form/helpers.js +0 -23
  436. package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +0 -10
  437. package/dist/esm/BusinessFormEventTypes-989960ba.js +0 -39
  438. package/dist/esm/business-form-schema-f8f554d1.js +0 -144
  439. package/dist/esm/justifi-payment-method-form.entry.js +0 -1743
  440. package/dist/module/BusinessFormEventTypes.js +0 -39
  441. package/dist/module/business-generic-info.js +0 -210
  442. package/dist/module/justifi-business-generic-info.d.ts +0 -11
  443. package/dist/module/justifi-business-generic-info.js +0 -6
  444. package/dist/types/components/business-form/BusinessFormEventTypes.d.ts +0 -5
  445. package/dist/types/components/business-form/business-form-stepped.d.ts +0 -48
  446. package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +0 -17
  447. package/dist/types/components/business-form/helpers.d.ts +0 -1
  448. package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +0 -17
  449. package/dist/webcomponents/p-081cf5f6.entry.js +0 -1
  450. package/dist/webcomponents/p-0bc8b02e.entry.js +0 -1
  451. package/dist/webcomponents/p-112acd3c.entry.js +0 -1
  452. package/dist/webcomponents/p-1555e6b1.js +0 -1
  453. package/dist/webcomponents/p-16f41fd0.entry.js +0 -1
  454. package/dist/webcomponents/p-17715325.js +0 -1
  455. package/dist/webcomponents/p-3a4d4869.entry.js +0 -1
  456. package/dist/webcomponents/p-3cb0b96d.js +0 -1
  457. package/dist/webcomponents/p-4ba2c711.entry.js +0 -1
  458. package/dist/webcomponents/p-4f14df36.js +0 -2
  459. package/dist/webcomponents/p-5422a24b.entry.js +0 -1
  460. package/dist/webcomponents/p-578e0a05.entry.js +0 -1
  461. package/dist/webcomponents/p-640d90dc.entry.js +0 -1
  462. package/dist/webcomponents/p-663bfe87.js +0 -1
  463. package/dist/webcomponents/p-696396c7.entry.js +0 -1
  464. package/dist/webcomponents/p-6ab67031.entry.js +0 -1
  465. package/dist/webcomponents/p-6d0725ef.entry.js +0 -1
  466. package/dist/webcomponents/p-810b72b5.js +0 -1
  467. package/dist/webcomponents/p-8516d602.entry.js +0 -1
  468. package/dist/webcomponents/p-894a7475.entry.js +0 -19
  469. package/dist/webcomponents/p-94ebfafb.entry.js +0 -1
  470. package/dist/webcomponents/p-9cb3ff78.entry.js +0 -1
  471. package/dist/webcomponents/p-9e81808f.entry.js +0 -1
  472. package/dist/webcomponents/p-a432110c.entry.js +0 -1
  473. package/dist/webcomponents/p-b1881723.entry.js +0 -1
  474. package/dist/webcomponents/p-b5aba473.entry.js +0 -1
  475. package/dist/webcomponents/p-b8a8b551.js +0 -1
  476. package/dist/webcomponents/p-bd099662.entry.js +0 -1
  477. package/dist/webcomponents/p-bfd917b8.entry.js +0 -1
  478. package/dist/webcomponents/p-c90fa055.entry.js +0 -1
  479. package/dist/webcomponents/p-ebb91944.entry.js +0 -1
  480. package/dist/webcomponents/p-ec4f27e7.entry.js +0 -1
  481. package/dist/webcomponents/p-fa495a43.entry.js +0 -1
  482. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.e2e.js +0 -0
  483. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.spec.js +0 -0
  484. /package/dist/collection/components/{business-form → business-forms/business-form}/business-form.css +0 -0
  485. /package/dist/collection/components/{business-form → business-forms/business-form}/test/business-form.spec.js +0 -0
  486. /package/dist/collection/components/{business-form/business-address/business-address-form.css → business-forms/business-form-stepped/business-address/business-address-form-step.css} +0 -0
  487. /package/dist/collection/components/{business-form/business-generic-info/business-generic-info.css → business-forms/business-form-stepped/business-core-info/business-core-info-form-step.css} +0 -0
  488. /package/dist/collection/components/{business-form/business-owners/business-owners.css → business-forms/business-form-stepped/business-owners/business-owners-form-step.css} +0 -0
  489. /package/dist/collection/components/{business-form/business-representative/business-representative.css → business-forms/business-form-stepped/business-representative/business-representative-form-step.css} +0 -0
  490. /package/dist/collection/components/{business-form/legal-address-form/legal-address-form.css → business-forms/business-form-stepped/legal-address-form/legal-address-form-step.css} +0 -0
@@ -1,1743 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-62b8aa8a.js';
2
- import { j as composeQueryParams } from './utils-76a93600.js';
3
-
4
- function createCommonjsModule(fn, basedir, module) {
5
- return module = {
6
- path: basedir,
7
- exports: {},
8
- require: function (path, base) {
9
- return commonjsRequire();
10
- }
11
- }, fn(module, module.exports), module.exports;
12
- }
13
-
14
- function commonjsRequire () {
15
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
16
- }
17
-
18
- var iframeResizer = createCommonjsModule(function (module) {
19
- (function (undefined$1) {
20
- if (typeof window === 'undefined') return // don't run for server side render
21
-
22
- var count = 0,
23
- logEnabled = false,
24
- hiddenCheckEnabled = false,
25
- msgHeader = 'message',
26
- msgHeaderLen = msgHeader.length,
27
- msgId = '[iFrameSizer]', // Must match iframe msg ID
28
- msgIdLen = msgId.length,
29
- pagePosition = null,
30
- requestAnimationFrame = window.requestAnimationFrame,
31
- resetRequiredMethods = Object.freeze({
32
- max: 1,
33
- scroll: 1,
34
- bodyScroll: 1,
35
- documentElementScroll: 1
36
- }),
37
- settings = {},
38
- timer = null,
39
- defaults = Object.freeze({
40
- autoResize: true,
41
- bodyBackground: null,
42
- bodyMargin: null,
43
- bodyMarginV1: 8,
44
- bodyPadding: null,
45
- checkOrigin: true,
46
- inPageLinks: false,
47
- enablePublicMethods: true,
48
- heightCalculationMethod: 'bodyOffset',
49
- id: 'iFrameResizer',
50
- interval: 32,
51
- log: false,
52
- maxHeight: Infinity,
53
- maxWidth: Infinity,
54
- minHeight: 0,
55
- minWidth: 0,
56
- mouseEvents: true,
57
- resizeFrom: 'parent',
58
- scrolling: false,
59
- sizeHeight: true,
60
- sizeWidth: false,
61
- warningTimeout: 5000,
62
- tolerance: 0,
63
- widthCalculationMethod: 'scroll',
64
- onClose: function () {
65
- return true
66
- },
67
- onClosed: function () {},
68
- onInit: function () {},
69
- onMessage: function () {
70
- warn('onMessage function not defined');
71
- },
72
- onMouseEnter: function () {},
73
- onMouseLeave: function () {},
74
- onResized: function () {},
75
- onScroll: function () {
76
- return true
77
- }
78
- });
79
-
80
- function getMutationObserver() {
81
- return (
82
- window.MutationObserver ||
83
- window.WebKitMutationObserver ||
84
- window.MozMutationObserver
85
- )
86
- }
87
-
88
- function addEventListener(el, evt, func) {
89
- el.addEventListener(evt, func, false);
90
- }
91
-
92
- function removeEventListener(el, evt, func) {
93
- el.removeEventListener(evt, func, false);
94
- }
95
-
96
- function setupRequestAnimationFrame() {
97
- var vendors = ['moz', 'webkit', 'o', 'ms'];
98
- var x;
99
-
100
- // Remove vendor prefixing if prefixed and break early if not
101
- for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
102
- requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
103
- }
104
-
105
- if (requestAnimationFrame) {
106
- // Firefox extension content-scripts have a globalThis object that is not the same as window.
107
- // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
108
- // being thrown when run in that context, and should be a no-op in every other context.
109
- requestAnimationFrame = requestAnimationFrame.bind(window);
110
- } else {
111
- log('setup', 'RequestAnimationFrame not supported');
112
- }
113
- }
114
-
115
- function getMyID(iframeId) {
116
- var retStr = 'Host page: ' + iframeId;
117
-
118
- if (window.top !== window.self) {
119
- retStr =
120
- window.parentIFrame && window.parentIFrame.getId
121
- ? window.parentIFrame.getId() + ': ' + iframeId
122
- : 'Nested host page: ' + iframeId;
123
- }
124
-
125
- return retStr
126
- }
127
-
128
- function formatLogHeader(iframeId) {
129
- return msgId + '[' + getMyID(iframeId) + ']'
130
- }
131
-
132
- function isLogEnabled(iframeId) {
133
- return settings[iframeId] ? settings[iframeId].log : logEnabled
134
- }
135
-
136
- function log(iframeId, msg) {
137
- output('log', iframeId, msg, isLogEnabled(iframeId));
138
- }
139
-
140
- function info(iframeId, msg) {
141
- output('info', iframeId, msg, isLogEnabled(iframeId));
142
- }
143
-
144
- function warn(iframeId, msg) {
145
- output('warn', iframeId, msg, true);
146
- }
147
-
148
- function output(type, iframeId, msg, enabled) {
149
- if (true === enabled && 'object' === typeof window.console) {
150
- // eslint-disable-next-line no-console
151
- console[type](formatLogHeader(iframeId), msg);
152
- }
153
- }
154
-
155
- function iFrameListener(event) {
156
- function resizeIFrame() {
157
- function resize() {
158
- setSize(messageData);
159
- setPagePosition(iframeId);
160
- on('onResized', messageData);
161
- }
162
-
163
- ensureInRange('Height');
164
- ensureInRange('Width');
165
-
166
- syncResize(resize, messageData, 'init');
167
- }
168
-
169
- function processMsg() {
170
- var data = msg.slice(msgIdLen).split(':');
171
- var height = data[1] ? parseInt(data[1], 10) : 0;
172
- var iframe = settings[data[0]] && settings[data[0]].iframe;
173
- var compStyle = getComputedStyle(iframe);
174
-
175
- return {
176
- iframe: iframe,
177
- id: data[0],
178
- height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
179
- width: data[2],
180
- type: data[3]
181
- }
182
- }
183
-
184
- function getPaddingEnds(compStyle) {
185
- if (compStyle.boxSizing !== 'border-box') {
186
- return 0
187
- }
188
- var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
189
- var bot = compStyle.paddingBottom
190
- ? parseInt(compStyle.paddingBottom, 10)
191
- : 0;
192
- return top + bot
193
- }
194
-
195
- function getBorderEnds(compStyle) {
196
- if (compStyle.boxSizing !== 'border-box') {
197
- return 0
198
- }
199
- var top = compStyle.borderTopWidth
200
- ? parseInt(compStyle.borderTopWidth, 10)
201
- : 0;
202
- var bot = compStyle.borderBottomWidth
203
- ? parseInt(compStyle.borderBottomWidth, 10)
204
- : 0;
205
- return top + bot
206
- }
207
-
208
- function ensureInRange(Dimension) {
209
- var max = Number(settings[iframeId]['max' + Dimension]),
210
- min = Number(settings[iframeId]['min' + Dimension]),
211
- dimension = Dimension.toLowerCase(),
212
- size = Number(messageData[dimension]);
213
-
214
- log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
215
-
216
- if (size < min) {
217
- size = min;
218
- log(iframeId, 'Set ' + dimension + ' to min value');
219
- }
220
-
221
- if (size > max) {
222
- size = max;
223
- log(iframeId, 'Set ' + dimension + ' to max value');
224
- }
225
-
226
- messageData[dimension] = '' + size;
227
- }
228
-
229
- function isMessageFromIFrame() {
230
- function checkAllowedOrigin() {
231
- function checkList() {
232
- var i = 0,
233
- retCode = false;
234
-
235
- log(
236
- iframeId,
237
- 'Checking connection is from allowed list of origins: ' +
238
- checkOrigin
239
- );
240
-
241
- for (; i < checkOrigin.length; i++) {
242
- if (checkOrigin[i] === origin) {
243
- retCode = true;
244
- break
245
- }
246
- }
247
- return retCode
248
- }
249
-
250
- function checkSingle() {
251
- var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
252
- log(iframeId, 'Checking connection is from: ' + remoteHost);
253
- return origin === remoteHost
254
- }
255
-
256
- return checkOrigin.constructor === Array ? checkList() : checkSingle()
257
- }
258
-
259
- var origin = event.origin,
260
- checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
261
-
262
- if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
263
- throw new Error(
264
- 'Unexpected message received from: ' +
265
- origin +
266
- ' for ' +
267
- messageData.iframe.id +
268
- '. Message was: ' +
269
- event.data +
270
- '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
271
- )
272
- }
273
-
274
- return true
275
- }
276
-
277
- function isMessageForUs() {
278
- return (
279
- msgId === ('' + msg).slice(0, msgIdLen) &&
280
- msg.slice(msgIdLen).split(':')[0] in settings
281
- ) // ''+Protects against non-string msg
282
- }
283
-
284
- function isMessageFromMetaParent() {
285
- // Test if this message is from a parent above us. This is an ugly test, however, updating
286
- // the message format would break backwards compatibility.
287
- var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
288
-
289
- if (retCode) {
290
- log(iframeId, 'Ignoring init message from meta parent page');
291
- }
292
-
293
- return retCode
294
- }
295
-
296
- function getMsgBody(offset) {
297
- return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
298
- }
299
-
300
- function forwardMsgFromIFrame(msgBody) {
301
- log(
302
- iframeId,
303
- 'onMessage passed: {iframe: ' +
304
- messageData.iframe.id +
305
- ', message: ' +
306
- msgBody +
307
- '}'
308
- );
309
-
310
- on('onMessage', {
311
- iframe: messageData.iframe,
312
- message: JSON.parse(msgBody)
313
- });
314
-
315
- log(iframeId, '--');
316
- }
317
-
318
- function getPageInfo() {
319
- var bodyPosition = document.body.getBoundingClientRect(),
320
- iFramePosition = messageData.iframe.getBoundingClientRect();
321
-
322
- return JSON.stringify({
323
- iframeHeight: iFramePosition.height,
324
- iframeWidth: iFramePosition.width,
325
- clientHeight: Math.max(
326
- document.documentElement.clientHeight,
327
- window.innerHeight || 0
328
- ),
329
- clientWidth: Math.max(
330
- document.documentElement.clientWidth,
331
- window.innerWidth || 0
332
- ),
333
- offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
334
- offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
335
- scrollTop: window.pageYOffset,
336
- scrollLeft: window.pageXOffset,
337
- documentHeight: document.documentElement.clientHeight,
338
- documentWidth: document.documentElement.clientWidth,
339
- windowHeight: window.innerHeight,
340
- windowWidth: window.innerWidth
341
- })
342
- }
343
-
344
- function sendPageInfoToIframe(iframe, iframeId) {
345
- function debouncedTrigger() {
346
- trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
347
- }
348
- debounceFrameEvents(debouncedTrigger, 32, iframeId);
349
- }
350
-
351
- function startPageInfoMonitor() {
352
- function setListener(type, func) {
353
- function sendPageInfo() {
354
- if (settings[id]) {
355
- sendPageInfoToIframe(settings[id].iframe, id);
356
- } else {
357
- stop();
358
- }
359
- }
360
- ['scroll', 'resize'].forEach(function (evt) {
361
- log(id, type + evt + ' listener for sendPageInfo');
362
- func(window, evt, sendPageInfo);
363
- });
364
- }
365
-
366
- function stop() {
367
- setListener('Remove ', removeEventListener);
368
- }
369
-
370
- function start() {
371
- setListener('Add ', addEventListener);
372
- }
373
-
374
- var id = iframeId; // Create locally scoped copy of iFrame ID
375
-
376
- start();
377
-
378
- if (settings[id]) {
379
- settings[id].stopPageInfo = stop;
380
- }
381
- }
382
-
383
- function stopPageInfoMonitor() {
384
- if (settings[iframeId] && settings[iframeId].stopPageInfo) {
385
- settings[iframeId].stopPageInfo();
386
- delete settings[iframeId].stopPageInfo;
387
- }
388
- }
389
-
390
- function checkIFrameExists() {
391
- var retBool = true;
392
-
393
- if (null === messageData.iframe) {
394
- warn(iframeId, 'IFrame (' + messageData.id + ') not found');
395
- retBool = false;
396
- }
397
- return retBool
398
- }
399
-
400
- function getElementPosition(target) {
401
- var iFramePosition = target.getBoundingClientRect();
402
-
403
- getPagePosition(iframeId);
404
-
405
- return {
406
- x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
407
- y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
408
- }
409
- }
410
-
411
- function scrollRequestFromChild(addOffset) {
412
- /* istanbul ignore next */ // Not testable in Karma
413
- function reposition() {
414
- pagePosition = newPosition;
415
- scrollTo();
416
- log(iframeId, '--');
417
- }
418
-
419
- function calcOffset() {
420
- return {
421
- x: Number(messageData.width) + offset.x,
422
- y: Number(messageData.height) + offset.y
423
- }
424
- }
425
-
426
- function scrollParent() {
427
- if (window.parentIFrame) {
428
- window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
429
- newPosition.x,
430
- newPosition.y
431
- );
432
- } else {
433
- warn(
434
- iframeId,
435
- 'Unable to scroll to requested position, window.parentIFrame not found'
436
- );
437
- }
438
- }
439
-
440
- var offset = addOffset
441
- ? getElementPosition(messageData.iframe)
442
- : { x: 0, y: 0 },
443
- newPosition = calcOffset();
444
-
445
- log(
446
- iframeId,
447
- 'Reposition requested from iFrame (offset x:' +
448
- offset.x +
449
- ' y:' +
450
- offset.y +
451
- ')'
452
- );
453
-
454
- if (window.top === window.self) {
455
- reposition();
456
- } else {
457
- scrollParent();
458
- }
459
- }
460
-
461
- function scrollTo() {
462
- if (false === on('onScroll', pagePosition)) {
463
- unsetPagePosition();
464
- } else {
465
- setPagePosition(iframeId);
466
- }
467
- }
468
-
469
- function findTarget(location) {
470
- function jumpToTarget() {
471
- var jumpPosition = getElementPosition(target);
472
-
473
- log(
474
- iframeId,
475
- 'Moving to in page link (#' +
476
- hash +
477
- ') at x: ' +
478
- jumpPosition.x +
479
- ' y: ' +
480
- jumpPosition.y
481
- );
482
- pagePosition = {
483
- x: jumpPosition.x,
484
- y: jumpPosition.y
485
- };
486
-
487
- scrollTo();
488
- log(iframeId, '--');
489
- }
490
-
491
- function jumpToParent() {
492
- if (window.parentIFrame) {
493
- window.parentIFrame.moveToAnchor(hash);
494
- } else {
495
- log(
496
- iframeId,
497
- 'In page link #' +
498
- hash +
499
- ' not found and window.parentIFrame not found'
500
- );
501
- }
502
- }
503
-
504
- var hash = location.split('#')[1] || '',
505
- hashData = decodeURIComponent(hash),
506
- target =
507
- document.getElementById(hashData) ||
508
- document.getElementsByName(hashData)[0];
509
-
510
- if (target) {
511
- jumpToTarget();
512
- } else if (window.top === window.self) {
513
- log(iframeId, 'In page link #' + hash + ' not found');
514
- } else {
515
- jumpToParent();
516
- }
517
- }
518
-
519
- function onMouse(event) {
520
- var mousePos = {};
521
-
522
- if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
523
- var data = getMsgBody(9).split(':');
524
- mousePos = {
525
- x: data[1],
526
- y: data[0]
527
- };
528
- } else {
529
- mousePos = {
530
- x: messageData.width,
531
- y: messageData.height
532
- };
533
- }
534
-
535
- on(event, {
536
- iframe: messageData.iframe,
537
- screenX: Number(mousePos.x),
538
- screenY: Number(mousePos.y),
539
- type: messageData.type
540
- });
541
- }
542
-
543
- function on(funcName, val) {
544
- return chkEvent(iframeId, funcName, val)
545
- }
546
-
547
- function actionMsg() {
548
- if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
549
-
550
- switch (messageData.type) {
551
- case 'close': {
552
- closeIFrame(messageData.iframe);
553
- break
554
- }
555
-
556
- case 'message': {
557
- forwardMsgFromIFrame(getMsgBody(6));
558
- break
559
- }
560
-
561
- case 'mouseenter': {
562
- onMouse('onMouseEnter');
563
- break
564
- }
565
-
566
- case 'mouseleave': {
567
- onMouse('onMouseLeave');
568
- break
569
- }
570
-
571
- case 'autoResize': {
572
- settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
573
- break
574
- }
575
-
576
- case 'scrollTo': {
577
- scrollRequestFromChild(false);
578
- break
579
- }
580
-
581
- case 'scrollToOffset': {
582
- scrollRequestFromChild(true);
583
- break
584
- }
585
-
586
- case 'pageInfo': {
587
- sendPageInfoToIframe(
588
- settings[iframeId] && settings[iframeId].iframe,
589
- iframeId
590
- );
591
- startPageInfoMonitor();
592
- break
593
- }
594
-
595
- case 'pageInfoStop': {
596
- stopPageInfoMonitor();
597
- break
598
- }
599
-
600
- case 'inPageLink': {
601
- findTarget(getMsgBody(9));
602
- break
603
- }
604
-
605
- case 'reset': {
606
- resetIFrame(messageData);
607
- break
608
- }
609
-
610
- case 'init': {
611
- resizeIFrame();
612
- on('onInit', messageData.iframe);
613
- break
614
- }
615
-
616
- default: {
617
- if (
618
- Number(messageData.width) === 0 &&
619
- Number(messageData.height) === 0
620
- ) {
621
- warn(
622
- 'Unsupported message received (' +
623
- messageData.type +
624
- '), this is likely due to the iframe containing a later ' +
625
- 'version of iframe-resizer than the parent page'
626
- );
627
- } else {
628
- resizeIFrame();
629
- }
630
- }
631
- }
632
- }
633
-
634
- function hasSettings(iframeId) {
635
- var retBool = true;
636
-
637
- if (!settings[iframeId]) {
638
- retBool = false;
639
- warn(
640
- messageData.type +
641
- ' No settings for ' +
642
- iframeId +
643
- '. Message was: ' +
644
- msg
645
- );
646
- }
647
-
648
- return retBool
649
- }
650
-
651
- function iFrameReadyMsgReceived() {
652
- // eslint-disable-next-line no-restricted-syntax, guard-for-in
653
- for (var iframeId in settings) {
654
- trigger(
655
- 'iFrame requested init',
656
- createOutgoingMsg(iframeId),
657
- settings[iframeId].iframe,
658
- iframeId
659
- );
660
- }
661
- }
662
-
663
- function firstRun() {
664
- if (settings[iframeId]) {
665
- settings[iframeId].firstRun = false;
666
- }
667
- }
668
-
669
- var msg = event.data,
670
- messageData = {},
671
- iframeId = null;
672
-
673
- if ('[iFrameResizerChild]Ready' === msg) {
674
- iFrameReadyMsgReceived();
675
- } else if (isMessageForUs()) {
676
- messageData = processMsg();
677
- iframeId = messageData.id;
678
- if (settings[iframeId]) {
679
- settings[iframeId].loaded = true;
680
- }
681
-
682
- if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
683
- log(iframeId, 'Received: ' + msg);
684
-
685
- if (checkIFrameExists() && isMessageFromIFrame()) {
686
- actionMsg();
687
- }
688
- }
689
- } else {
690
- info(iframeId, 'Ignored: ' + msg);
691
- }
692
- }
693
-
694
- function chkEvent(iframeId, funcName, val) {
695
- var func = null,
696
- retVal = null;
697
-
698
- if (settings[iframeId]) {
699
- func = settings[iframeId][funcName];
700
-
701
- if ('function' === typeof func) {
702
- retVal = func(val);
703
- } else {
704
- throw new TypeError(
705
- funcName + ' on iFrame[' + iframeId + '] is not a function'
706
- )
707
- }
708
- }
709
-
710
- return retVal
711
- }
712
-
713
- function removeIframeListeners(iframe) {
714
- var iframeId = iframe.id;
715
- delete settings[iframeId];
716
- }
717
-
718
- function closeIFrame(iframe) {
719
- var iframeId = iframe.id;
720
- if (chkEvent(iframeId, 'onClose', iframeId) === false) {
721
- log(iframeId, 'Close iframe cancelled by onClose event');
722
- return
723
- }
724
- log(iframeId, 'Removing iFrame: ' + iframeId);
725
-
726
- try {
727
- // Catch race condition error with React
728
- if (iframe.parentNode) {
729
- iframe.parentNode.removeChild(iframe);
730
- }
731
- } catch (error) {
732
- warn(error);
733
- }
734
-
735
- chkEvent(iframeId, 'onClosed', iframeId);
736
- log(iframeId, '--');
737
- removeIframeListeners(iframe);
738
- }
739
-
740
- function getPagePosition(iframeId) {
741
- if (null === pagePosition) {
742
- pagePosition = {
743
- x:
744
- window.pageXOffset === undefined$1
745
- ? document.documentElement.scrollLeft
746
- : window.pageXOffset,
747
- y:
748
- window.pageYOffset === undefined$1
749
- ? document.documentElement.scrollTop
750
- : window.pageYOffset
751
- };
752
- log(
753
- iframeId,
754
- 'Get page position: ' + pagePosition.x + ',' + pagePosition.y
755
- );
756
- }
757
- }
758
-
759
- function setPagePosition(iframeId) {
760
- if (null !== pagePosition) {
761
- window.scrollTo(pagePosition.x, pagePosition.y);
762
- log(
763
- iframeId,
764
- 'Set page position: ' + pagePosition.x + ',' + pagePosition.y
765
- );
766
- unsetPagePosition();
767
- }
768
- }
769
-
770
- function unsetPagePosition() {
771
- pagePosition = null;
772
- }
773
-
774
- function resetIFrame(messageData) {
775
- function reset() {
776
- setSize(messageData);
777
- trigger('reset', 'reset', messageData.iframe, messageData.id);
778
- }
779
-
780
- log(
781
- messageData.id,
782
- 'Size reset requested by ' +
783
- ('init' === messageData.type ? 'host page' : 'iFrame')
784
- );
785
- getPagePosition(messageData.id);
786
- syncResize(reset, messageData, 'reset');
787
- }
788
-
789
- function setSize(messageData) {
790
- function setDimension(dimension) {
791
- if (!messageData.id) {
792
- log('undefined', 'messageData id not set');
793
- return
794
- }
795
- messageData.iframe.style[dimension] = messageData[dimension] + 'px';
796
- log(
797
- messageData.id,
798
- 'IFrame (' +
799
- iframeId +
800
- ') ' +
801
- dimension +
802
- ' set to ' +
803
- messageData[dimension] +
804
- 'px'
805
- );
806
- }
807
-
808
- function chkZero(dimension) {
809
- // FireFox sets dimension of hidden iFrames to zero.
810
- // So if we detect that set up an event to check for
811
- // when iFrame becomes visible.
812
-
813
- /* istanbul ignore next */ // Not testable in PhantomJS
814
- if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
815
- hiddenCheckEnabled = true;
816
- log(iframeId, 'Hidden iFrame detected, creating visibility listener');
817
- fixHiddenIFrames();
818
- }
819
- }
820
-
821
- function processDimension(dimension) {
822
- setDimension(dimension);
823
- chkZero(dimension);
824
- }
825
-
826
- var iframeId = messageData.iframe.id;
827
-
828
- if (settings[iframeId]) {
829
- if (settings[iframeId].sizeHeight) {
830
- processDimension('height');
831
- }
832
- if (settings[iframeId].sizeWidth) {
833
- processDimension('width');
834
- }
835
- }
836
- }
837
-
838
- function syncResize(func, messageData, doNotSync) {
839
- /* istanbul ignore if */ // Not testable in PhantomJS
840
- if (
841
- doNotSync !== messageData.type &&
842
- requestAnimationFrame &&
843
- // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
844
- !window.jasmine
845
- ) {
846
- log(messageData.id, 'Requesting animation frame');
847
- requestAnimationFrame(func);
848
- } else {
849
- func();
850
- }
851
- }
852
-
853
- function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
854
- function postMessageToIFrame() {
855
- var target = settings[id] && settings[id].targetOrigin;
856
- log(
857
- id,
858
- '[' +
859
- calleeMsg +
860
- '] Sending msg to iframe[' +
861
- id +
862
- '] (' +
863
- msg +
864
- ') targetOrigin: ' +
865
- target
866
- );
867
- iframe.contentWindow.postMessage(msgId + msg, target);
868
- }
869
-
870
- function iFrameNotFound() {
871
- warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
872
- }
873
-
874
- function chkAndSend() {
875
- if (
876
- iframe &&
877
- 'contentWindow' in iframe &&
878
- null !== iframe.contentWindow
879
- ) {
880
- // Null test for PhantomJS
881
- postMessageToIFrame();
882
- } else {
883
- iFrameNotFound();
884
- }
885
- }
886
-
887
- function warnOnNoResponse() {
888
- function warning() {
889
- if (settings[id] && !settings[id].loaded && !errorShown) {
890
- errorShown = true;
891
- warn(
892
- id,
893
- 'IFrame has not responded within ' +
894
- settings[id].warningTimeout / 1000 +
895
- ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
896
- );
897
- }
898
- }
899
-
900
- if (
901
- !!noResponseWarning &&
902
- settings[id] &&
903
- !!settings[id].warningTimeout
904
- ) {
905
- settings[id].msgTimeout = setTimeout(
906
- warning,
907
- settings[id].warningTimeout
908
- );
909
- }
910
- }
911
-
912
- var errorShown = false;
913
-
914
- id = id || iframe.id;
915
-
916
- if (settings[id]) {
917
- chkAndSend();
918
- warnOnNoResponse();
919
- }
920
- }
921
-
922
- function createOutgoingMsg(iframeId) {
923
- return (
924
- iframeId +
925
- ':' +
926
- settings[iframeId].bodyMarginV1 +
927
- ':' +
928
- settings[iframeId].sizeWidth +
929
- ':' +
930
- settings[iframeId].log +
931
- ':' +
932
- settings[iframeId].interval +
933
- ':' +
934
- settings[iframeId].enablePublicMethods +
935
- ':' +
936
- settings[iframeId].autoResize +
937
- ':' +
938
- settings[iframeId].bodyMargin +
939
- ':' +
940
- settings[iframeId].heightCalculationMethod +
941
- ':' +
942
- settings[iframeId].bodyBackground +
943
- ':' +
944
- settings[iframeId].bodyPadding +
945
- ':' +
946
- settings[iframeId].tolerance +
947
- ':' +
948
- settings[iframeId].inPageLinks +
949
- ':' +
950
- settings[iframeId].resizeFrom +
951
- ':' +
952
- settings[iframeId].widthCalculationMethod +
953
- ':' +
954
- settings[iframeId].mouseEvents
955
- )
956
- }
957
-
958
- function isNumber(value) {
959
- return typeof value === 'number'
960
- }
961
-
962
- function setupIFrame(iframe, options) {
963
- function setLimits() {
964
- function addStyle(style) {
965
- var styleValue = settings[iframeId][style];
966
- if (Infinity !== styleValue && 0 !== styleValue) {
967
- iframe.style[style] = isNumber(styleValue)
968
- ? styleValue + 'px'
969
- : styleValue;
970
- log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
971
- }
972
- }
973
-
974
- function chkMinMax(dimension) {
975
- if (
976
- settings[iframeId]['min' + dimension] >
977
- settings[iframeId]['max' + dimension]
978
- ) {
979
- throw new Error(
980
- 'Value for min' +
981
- dimension +
982
- ' can not be greater than max' +
983
- dimension
984
- )
985
- }
986
- }
987
-
988
- chkMinMax('Height');
989
- chkMinMax('Width');
990
-
991
- addStyle('maxHeight');
992
- addStyle('minHeight');
993
- addStyle('maxWidth');
994
- addStyle('minWidth');
995
- }
996
-
997
- function newId() {
998
- var id = (options && options.id) || defaults.id + count++;
999
- if (null !== document.getElementById(id)) {
1000
- id += count++;
1001
- }
1002
- return id
1003
- }
1004
-
1005
- function ensureHasId(iframeId) {
1006
- if (typeof iframeId !== 'string') {
1007
- throw new TypeError('Invaild id for iFrame. Expected String')
1008
- }
1009
-
1010
- if ('' === iframeId) {
1011
- // eslint-disable-next-line no-multi-assign
1012
- iframe.id = iframeId = newId();
1013
- logEnabled = (options || {}).log;
1014
- log(
1015
- iframeId,
1016
- 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
1017
- );
1018
- }
1019
-
1020
- return iframeId
1021
- }
1022
-
1023
- function setScrolling() {
1024
- log(
1025
- iframeId,
1026
- 'IFrame scrolling ' +
1027
- (settings[iframeId] && settings[iframeId].scrolling
1028
- ? 'enabled'
1029
- : 'disabled') +
1030
- ' for ' +
1031
- iframeId
1032
- );
1033
- iframe.style.overflow =
1034
- false === (settings[iframeId] && settings[iframeId].scrolling)
1035
- ? 'hidden'
1036
- : 'auto';
1037
- switch (settings[iframeId] && settings[iframeId].scrolling) {
1038
- case 'omit': {
1039
- break
1040
- }
1041
-
1042
- case true: {
1043
- iframe.scrolling = 'yes';
1044
- break
1045
- }
1046
-
1047
- case false: {
1048
- iframe.scrolling = 'no';
1049
- break
1050
- }
1051
-
1052
- default: {
1053
- iframe.scrolling = settings[iframeId]
1054
- ? settings[iframeId].scrolling
1055
- : 'no';
1056
- }
1057
- }
1058
- }
1059
-
1060
- // The V1 iFrame script expects an int, where as in V2 expects a CSS
1061
- // string value such as '1px 3em', so if we have an int for V2, set V1=V2
1062
- // and then convert V2 to a string PX value.
1063
- function setupBodyMarginValues() {
1064
- if (
1065
- 'number' ===
1066
- typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
1067
- '0' === (settings[iframeId] && settings[iframeId].bodyMargin)
1068
- ) {
1069
- settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
1070
- settings[iframeId].bodyMargin =
1071
- '' + settings[iframeId].bodyMargin + 'px';
1072
- }
1073
- }
1074
-
1075
- function checkReset() {
1076
- // Reduce scope of firstRun to function, because IE8's JS execution
1077
- // context stack is borked and this value gets externally
1078
- // changed midway through running this function!!!
1079
- var firstRun = settings[iframeId] && settings[iframeId].firstRun,
1080
- resetRequertMethod =
1081
- settings[iframeId] &&
1082
- settings[iframeId].heightCalculationMethod in resetRequiredMethods;
1083
-
1084
- if (!firstRun && resetRequertMethod) {
1085
- resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
1086
- }
1087
- }
1088
-
1089
- function setupIFrameObject() {
1090
- if (settings[iframeId]) {
1091
- settings[iframeId].iframe.iFrameResizer = {
1092
- close: closeIFrame.bind(null, settings[iframeId].iframe),
1093
-
1094
- removeListeners: removeIframeListeners.bind(
1095
- null,
1096
- settings[iframeId].iframe
1097
- ),
1098
-
1099
- resize: trigger.bind(
1100
- null,
1101
- 'Window resize',
1102
- 'resize',
1103
- settings[iframeId].iframe
1104
- ),
1105
-
1106
- moveToAnchor: function (anchor) {
1107
- trigger(
1108
- 'Move to anchor',
1109
- 'moveToAnchor:' + anchor,
1110
- settings[iframeId].iframe,
1111
- iframeId
1112
- );
1113
- },
1114
-
1115
- sendMessage: function (message) {
1116
- message = JSON.stringify(message);
1117
- trigger(
1118
- 'Send Message',
1119
- 'message:' + message,
1120
- settings[iframeId].iframe,
1121
- iframeId
1122
- );
1123
- }
1124
- };
1125
- }
1126
- }
1127
-
1128
- // We have to call trigger twice, as we can not be sure if all
1129
- // iframes have completed loading when this code runs. The
1130
- // event listener also catches the page changing in the iFrame.
1131
- function init(msg) {
1132
- function iFrameLoaded() {
1133
- trigger('iFrame.onload', msg, iframe, undefined$1, true);
1134
- checkReset();
1135
- }
1136
-
1137
- function createDestroyObserver(MutationObserver) {
1138
- if (!iframe.parentNode) {
1139
- return
1140
- }
1141
-
1142
- var destroyObserver = new MutationObserver(function (mutations) {
1143
- mutations.forEach(function (mutation) {
1144
- var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
1145
- removedNodes.forEach(function (removedNode) {
1146
- if (removedNode === iframe) {
1147
- closeIFrame(iframe);
1148
- }
1149
- });
1150
- });
1151
- });
1152
- destroyObserver.observe(iframe.parentNode, {
1153
- childList: true
1154
- });
1155
- }
1156
-
1157
- var MutationObserver = getMutationObserver();
1158
- if (MutationObserver) {
1159
- createDestroyObserver(MutationObserver);
1160
- }
1161
-
1162
- addEventListener(iframe, 'load', iFrameLoaded);
1163
- trigger('init', msg, iframe, undefined$1, true);
1164
- }
1165
-
1166
- function checkOptions(options) {
1167
- if ('object' !== typeof options) {
1168
- throw new TypeError('Options is not an object')
1169
- }
1170
- }
1171
-
1172
- function copyOptions(options) {
1173
- // eslint-disable-next-line no-restricted-syntax
1174
- for (var option in defaults) {
1175
- if (Object.prototype.hasOwnProperty.call(defaults, option)) {
1176
- settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
1177
- options,
1178
- option
1179
- )
1180
- ? options[option]
1181
- : defaults[option];
1182
- }
1183
- }
1184
- }
1185
-
1186
- function getTargetOrigin(remoteHost) {
1187
- return '' === remoteHost ||
1188
- null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
1189
- ? '*'
1190
- : remoteHost
1191
- }
1192
-
1193
- function depricate(key) {
1194
- var splitName = key.split('Callback');
1195
-
1196
- if (splitName.length === 2) {
1197
- var name =
1198
- 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
1199
- this[name] = this[key];
1200
- delete this[key];
1201
- warn(
1202
- iframeId,
1203
- "Deprecated: '" +
1204
- key +
1205
- "' has been renamed '" +
1206
- name +
1207
- "'. The old method will be removed in the next major version."
1208
- );
1209
- }
1210
- }
1211
-
1212
- function processOptions(options) {
1213
- options = options || {};
1214
-
1215
- settings[iframeId] = Object.create(null); // Protect against prototype attacks
1216
- settings[iframeId].iframe = iframe;
1217
- settings[iframeId].firstRun = true;
1218
- settings[iframeId].remoteHost =
1219
- iframe.src && iframe.src.split('/').slice(0, 3).join('/');
1220
-
1221
- checkOptions(options);
1222
- Object.keys(options).forEach(depricate, options);
1223
- copyOptions(options);
1224
-
1225
- if (settings[iframeId]) {
1226
- settings[iframeId].targetOrigin =
1227
- true === settings[iframeId].checkOrigin
1228
- ? getTargetOrigin(settings[iframeId].remoteHost)
1229
- : '*';
1230
- }
1231
- }
1232
-
1233
- function beenHere() {
1234
- return iframeId in settings && 'iFrameResizer' in iframe
1235
- }
1236
-
1237
- var iframeId = ensureHasId(iframe.id);
1238
-
1239
- if (beenHere()) {
1240
- warn(iframeId, 'Ignored iFrame, already setup.');
1241
- } else {
1242
- processOptions(options);
1243
- setScrolling();
1244
- setLimits();
1245
- setupBodyMarginValues();
1246
- init(createOutgoingMsg(iframeId));
1247
- setupIFrameObject();
1248
- }
1249
- }
1250
-
1251
- function debouce(fn, time) {
1252
- if (null === timer) {
1253
- timer = setTimeout(function () {
1254
- timer = null;
1255
- fn();
1256
- }, time);
1257
- }
1258
- }
1259
-
1260
- var frameTimer = {};
1261
- function debounceFrameEvents(fn, time, frameId) {
1262
- if (!frameTimer[frameId]) {
1263
- frameTimer[frameId] = setTimeout(function () {
1264
- frameTimer[frameId] = null;
1265
- fn();
1266
- }, time);
1267
- }
1268
- }
1269
-
1270
- // Not testable in PhantomJS
1271
- /* istanbul ignore next */
1272
-
1273
- function fixHiddenIFrames() {
1274
- function checkIFrames() {
1275
- function checkIFrame(settingId) {
1276
- function chkDimension(dimension) {
1277
- return (
1278
- '0px' ===
1279
- (settings[settingId] && settings[settingId].iframe.style[dimension])
1280
- )
1281
- }
1282
-
1283
- function isVisible(el) {
1284
- return null !== el.offsetParent
1285
- }
1286
-
1287
- if (
1288
- settings[settingId] &&
1289
- isVisible(settings[settingId].iframe) &&
1290
- (chkDimension('height') || chkDimension('width'))
1291
- ) {
1292
- trigger(
1293
- 'Visibility change',
1294
- 'resize',
1295
- settings[settingId].iframe,
1296
- settingId
1297
- );
1298
- }
1299
- }
1300
-
1301
- Object.keys(settings).forEach(function (key) {
1302
- checkIFrame(key);
1303
- });
1304
- }
1305
-
1306
- function mutationObserved(mutations) {
1307
- log(
1308
- 'window',
1309
- 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
1310
- );
1311
- debouce(checkIFrames, 16);
1312
- }
1313
-
1314
- function createMutationObserver() {
1315
- var target = document.querySelector('body'),
1316
- config = {
1317
- attributes: true,
1318
- attributeOldValue: false,
1319
- characterData: true,
1320
- characterDataOldValue: false,
1321
- childList: true,
1322
- subtree: true
1323
- },
1324
- observer = new MutationObserver(mutationObserved);
1325
-
1326
- observer.observe(target, config);
1327
- }
1328
-
1329
- var MutationObserver = getMutationObserver();
1330
- if (MutationObserver) {
1331
- createMutationObserver();
1332
- }
1333
- }
1334
-
1335
- function resizeIFrames(event) {
1336
- function resize() {
1337
- sendTriggerMsg('Window ' + event, 'resize');
1338
- }
1339
-
1340
- log('window', 'Trigger event: ' + event);
1341
- debouce(resize, 16);
1342
- }
1343
-
1344
- // Not testable in PhantomJS
1345
- /* istanbul ignore next */
1346
- function tabVisible() {
1347
- function resize() {
1348
- sendTriggerMsg('Tab Visible', 'resize');
1349
- }
1350
-
1351
- if ('hidden' !== document.visibilityState) {
1352
- log('document', 'Trigger event: Visibility change');
1353
- debouce(resize, 16);
1354
- }
1355
- }
1356
-
1357
- function sendTriggerMsg(eventName, event) {
1358
- function isIFrameResizeEnabled(iframeId) {
1359
- return (
1360
- settings[iframeId] &&
1361
- 'parent' === settings[iframeId].resizeFrom &&
1362
- settings[iframeId].autoResize &&
1363
- !settings[iframeId].firstRun
1364
- )
1365
- }
1366
-
1367
- Object.keys(settings).forEach(function (iframeId) {
1368
- if (isIFrameResizeEnabled(iframeId)) {
1369
- trigger(eventName, event, settings[iframeId].iframe, iframeId);
1370
- }
1371
- });
1372
- }
1373
-
1374
- function setupEventListeners() {
1375
- addEventListener(window, 'message', iFrameListener);
1376
-
1377
- addEventListener(window, 'resize', function () {
1378
- resizeIFrames('resize');
1379
- });
1380
-
1381
- addEventListener(document, 'visibilitychange', tabVisible);
1382
-
1383
- addEventListener(document, '-webkit-visibilitychange', tabVisible);
1384
- }
1385
-
1386
- function factory() {
1387
- function init(options, element) {
1388
- function chkType() {
1389
- if (!element.tagName) {
1390
- throw new TypeError('Object is not a valid DOM element')
1391
- } else if ('IFRAME' !== element.tagName.toUpperCase()) {
1392
- throw new TypeError(
1393
- 'Expected <IFRAME> tag, found <' + element.tagName + '>'
1394
- )
1395
- }
1396
- }
1397
-
1398
- if (element) {
1399
- chkType();
1400
- setupIFrame(element, options);
1401
- iFrames.push(element);
1402
- }
1403
- }
1404
-
1405
- function warnDeprecatedOptions(options) {
1406
- if (options && options.enablePublicMethods) {
1407
- warn(
1408
- 'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
1409
- );
1410
- }
1411
- }
1412
-
1413
- var iFrames;
1414
-
1415
- setupRequestAnimationFrame();
1416
- setupEventListeners();
1417
-
1418
- return function iFrameResizeF(options, target) {
1419
- iFrames = []; // Only return iFrames past in on this call
1420
-
1421
- warnDeprecatedOptions(options);
1422
-
1423
- switch (typeof target) {
1424
- case 'undefined':
1425
- case 'string': {
1426
- Array.prototype.forEach.call(
1427
- document.querySelectorAll(target || 'iframe'),
1428
- init.bind(undefined$1, options)
1429
- );
1430
- break
1431
- }
1432
-
1433
- case 'object': {
1434
- init(options, target);
1435
- break
1436
- }
1437
-
1438
- default: {
1439
- throw new TypeError('Unexpected data type (' + typeof target + ')')
1440
- }
1441
- }
1442
-
1443
- return iFrames
1444
- }
1445
- }
1446
-
1447
- function createJQueryPublicMethod($) {
1448
- if (!$.fn) {
1449
- info('', 'Unable to bind to jQuery, it is not fully loaded.');
1450
- } else if (!$.fn.iFrameResize) {
1451
- $.fn.iFrameResize = function $iFrameResizeF(options) {
1452
- function init(index, element) {
1453
- setupIFrame(element, options);
1454
- }
1455
-
1456
- return this.filter('iframe').each(init).end()
1457
- };
1458
- }
1459
- }
1460
-
1461
- if (window.jQuery !== undefined$1) {
1462
- createJQueryPublicMethod(window.jQuery);
1463
- }
1464
-
1465
- if (typeof undefined$1 === 'function' && undefined$1.amd) {
1466
- undefined$1([], factory);
1467
- } else {
1468
- // Node for browserfy
1469
- module.exports = factory();
1470
- }
1471
- window.iFrameResize = window.iFrameResize || factory();
1472
- })();
1473
- });
1474
-
1475
- const MessageEventType = {
1476
- card: {
1477
- ready: 'justifi.card.ready',
1478
- tokenize: 'justifi.card.tokenize',
1479
- validate: 'justifi.card.validate',
1480
- resize: 'justifi.card.resize',
1481
- styleOverrides: 'justifi.card.styleOverrides',
1482
- },
1483
- bankAccount: {
1484
- ready: 'justifi.bankAccount.ready',
1485
- tokenize: 'justifi.bankAccount.tokenize',
1486
- validate: 'justifi.bankAccount.validate',
1487
- resize: 'justifi.bankAccount.resize',
1488
- styleOverrides: 'justifi.bankAccount.styleOverrides',
1489
- },
1490
- };
1491
-
1492
- const name = "@justifi/webcomponents";
1493
- const version = "4.8.3";
1494
- const description = "JustiFi Web Components";
1495
- const main = "dist/module/index.js";
1496
- const module = "dist/module/index.js";
1497
- const types = "./dist/types/index.d.ts";
1498
- const repository = {
1499
- type: "git",
1500
- url: "git+https://github.com/justifi-tech/web-component-library.git"
1501
- };
1502
- const homepage = "https://storybook.justifi.ai/?path=/docs/introduction--docs";
1503
- const publishConfig = {
1504
- registry: "https://registry.npmjs.org"
1505
- };
1506
- const files = [
1507
- "dist/"
1508
- ];
1509
- const scripts = {
1510
- build: "stencil build --docs",
1511
- dev: "stencil build --watch",
1512
- lint: "eslint . --max-warnings 0",
1513
- clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
1514
- generate: "stencil generate",
1515
- test: "TZ=utc stencil test --spec",
1516
- "test:watch": "TZ=utc stencil test --spec --watchAll",
1517
- "test:e2e": "stencil test --e2e"
1518
- };
1519
- const dependencies = {
1520
- "@stencil/core": "^4.0.5",
1521
- bootstrap: "^5.2.3",
1522
- "chart.js": "^4.4.1",
1523
- "date-fns": "^2.29.3",
1524
- "dinero.js": "^1.9.1",
1525
- "iframe-resizer": "^4.3.7",
1526
- imask: "^7.1.3",
1527
- rxjs: "^7.8.1",
1528
- "ts-dedent": "^2.2.0",
1529
- uuid: "^9.0.0",
1530
- yup: "^1.0.0"
1531
- };
1532
- const devDependencies = {
1533
- "@babel/preset-env": "^7.21.5",
1534
- "@babel/preset-react": "^7.18.6",
1535
- "@babel/preset-typescript": "^7.21.5",
1536
- "@stencil/sass": "^3.0.1",
1537
- "@stencil/store": "^2.0.8",
1538
- "@types/jest": "27.0.3",
1539
- "@types/node": "^20.1.4",
1540
- "@types/react": "^18.0.37",
1541
- "@types/react-dom": "^18.0.11",
1542
- dotenv: "^16.3.1",
1543
- jest: "^29.7.0",
1544
- "jest-cli": "^29.7.0",
1545
- "jest-environment-node": "^29.7.0",
1546
- puppeteer: "^21.0.0",
1547
- "ts-jest": "^29.1.2"
1548
- };
1549
- const license = "MIT";
1550
- const gitHead = "507bac1d941eae6e1f56e185ecd9bc9d22637783";
1551
- const pnpm = {
1552
- overrides: {
1553
- "ip@<1.1.9": ">=1.1.9",
1554
- "ip@=2.0.0": ">=2.0.1"
1555
- }
1556
- };
1557
- const packageJson = {
1558
- name: name,
1559
- version: version,
1560
- description: description,
1561
- main: main,
1562
- module: module,
1563
- types: types,
1564
- repository: repository,
1565
- homepage: homepage,
1566
- publishConfig: publishConfig,
1567
- files: files,
1568
- scripts: scripts,
1569
- dependencies: dependencies,
1570
- devDependencies: devDependencies,
1571
- license: license,
1572
- gitHead: gitHead,
1573
- pnpm: pnpm
1574
- };
1575
-
1576
- const getComputedTheme = () => {
1577
- const computedStyles = getComputedStyle(document.body);
1578
- const computedTheme = {
1579
- loadGoogleFont: computedStyles.getPropertyValue('--jfi-load-google-font'),
1580
- layout: {
1581
- fontFamily: computedStyles.getPropertyValue('--jfi-layout-font-family'),
1582
- padding: computedStyles.getPropertyValue('--jfi-layout-padding'),
1583
- formControlSpacingHorizontal: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-x'),
1584
- formControlSpacingVertical: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-y'),
1585
- },
1586
- formControl: {
1587
- backgroundColor: computedStyles.getPropertyValue('--jfi-form-control-background-color'),
1588
- borderColor: computedStyles.getPropertyValue('--jfi-form-control-border-color'),
1589
- borderColorFocus: computedStyles.getPropertyValue('--jfi-form-control-border-color-focus'),
1590
- borderColorError: computedStyles.getPropertyValue('--jfi-form-control-border-color-error'),
1591
- borderWidth: computedStyles.getPropertyValue('--jfi-form-control-border-width'),
1592
- borderBottomWidth: computedStyles.getPropertyValue('--jfi-form-control-border-bottom-width'),
1593
- borderLeftWidth: computedStyles.getPropertyValue('--jfi-form-control-border-left-width'),
1594
- borderRightWidth: computedStyles.getPropertyValue('--jfi-form-control-border-right-width'),
1595
- borderTopWidth: computedStyles.getPropertyValue('--jfi-form-control-border-top-width'),
1596
- borderRadius: computedStyles.getPropertyValue('--jfi-form-control-border-radius'),
1597
- borderStyle: computedStyles.getPropertyValue('--jfi-form-control-border-style'),
1598
- boxShadow: computedStyles.getPropertyValue('--jfi-form-control-box-shadow'),
1599
- boxShadowError: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error'),
1600
- boxShadowErrorFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error-focus'),
1601
- boxShadowFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-focus'),
1602
- color: computedStyles.getPropertyValue('--jfi-form-control-color'),
1603
- colorFocus: computedStyles.getPropertyValue('--jfi-form-control-color-focus'),
1604
- fontSize: computedStyles.getPropertyValue('--jfi-form-control-font-size'),
1605
- fontWeight: computedStyles.getPropertyValue('--jfi-form-control-font-weight'),
1606
- lineHeight: computedStyles.getPropertyValue('--jfi-form-control-line-height'),
1607
- margin: computedStyles.getPropertyValue('--jfi-form-control-margin'),
1608
- padding: computedStyles.getPropertyValue('--jfi-form-control-padding'),
1609
- },
1610
- formLabel: {
1611
- color: computedStyles.getPropertyValue('--jfi-form-label-color'),
1612
- fontFamily: computedStyles.getPropertyValue('--jfi-form-label-font-family'),
1613
- fontSize: computedStyles.getPropertyValue('--jfi-form-label-font-size'),
1614
- fontWeight: computedStyles.getPropertyValue('--jfi-form-label-font-weight'),
1615
- margin: computedStyles.getPropertyValue('--jfi-form-label-margin'),
1616
- },
1617
- errorMessage: {
1618
- color: computedStyles.getPropertyValue('--jfi-error-message-color'),
1619
- margin: computedStyles.getPropertyValue('--jfi-error-message-margin'),
1620
- fontSize: computedStyles.getPropertyValue('--jfi-error-message-font-size'),
1621
- },
1622
- };
1623
- return computedTheme;
1624
- };
1625
-
1626
- /**
1627
- * This approach decouples the communication logic from PaymentMethodForm component,
1628
- * making it cleaner, more maintainable, and easier to test
1629
- */
1630
- class FrameCommunicationService {
1631
- constructor(iframe, iframeOrigin) {
1632
- this.iframe = iframe;
1633
- this.iframeOrigin = iframeOrigin;
1634
- }
1635
- postMessage(eventType, payload) {
1636
- const message = Object.assign({ eventType }, payload);
1637
- this.iframe.contentWindow.postMessage(message, this.iframeOrigin);
1638
- }
1639
- addMessageListener(callback) {
1640
- window.addEventListener('message', callback);
1641
- }
1642
- removeMessageListener(callback) {
1643
- window.removeEventListener('message', callback);
1644
- }
1645
- postMessageWithResponseListener(eventType, payload) {
1646
- return new Promise((resolve) => {
1647
- const responseListener = (event) => {
1648
- if (event.data.eventType !== eventType)
1649
- return;
1650
- window.removeEventListener('message', responseListener);
1651
- resolve(event.data.data);
1652
- };
1653
- window.addEventListener('message', responseListener);
1654
- this.postMessage(eventType, payload);
1655
- });
1656
- }
1657
- }
1658
-
1659
- const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";
1660
-
1661
- const PaymentMethodForm = class {
1662
- constructor(hostRef) {
1663
- registerInstance(this, hostRef);
1664
- this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
1665
- this.paymentMethodFormValidated = createEvent(this, "paymentMethodFormValidated", 7);
1666
- this.paymentMethodFormTokenized = createEvent(this, "paymentMethodFormTokenized", 7);
1667
- this.computedTheme = getComputedTheme();
1668
- this.dispatchMessageEvent = (messageEvent) => {
1669
- const { eventType, data } = messageEvent.data;
1670
- const eventTypeMessage = MessageEventType[this.paymentMethodFormType];
1671
- if (eventType === eventTypeMessage.ready) {
1672
- this.paymentMethodFormReady.emit(data);
1673
- }
1674
- else if (eventType === eventTypeMessage.tokenize) {
1675
- this.paymentMethodFormTokenized.emit(data);
1676
- }
1677
- else if (eventType === eventTypeMessage.validate) {
1678
- this.paymentMethodFormValidated.emit(data);
1679
- }
1680
- };
1681
- this.postMessage = (eventType, payload) => {
1682
- this.frameService.postMessage(eventType, payload);
1683
- };
1684
- this.paymentMethodFormType = undefined;
1685
- this.paymentMethodFormValidationMode = undefined;
1686
- this.iframeOrigin = undefined;
1687
- this.singleLine = undefined;
1688
- }
1689
- disconnectedCallback() {
1690
- this.frameService.removeMessageListener(this.dispatchMessageEvent);
1691
- }
1692
- async resize() {
1693
- this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
1694
- }
1695
- async tokenize(clientId, paymentMethodMetadata, account) {
1696
- const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
1697
- return this.frameService.postMessageWithResponseListener(eventType, {
1698
- clientId,
1699
- paymentMethodMetadata,
1700
- account,
1701
- componentVersion: packageJson.version,
1702
- });
1703
- }
1704
- async validate() {
1705
- const eventType = MessageEventType[this.paymentMethodFormType].validate;
1706
- return this.frameService.postMessageWithResponseListener(eventType);
1707
- }
1708
- sendStyleOverrides() {
1709
- if (this.computedTheme) {
1710
- this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
1711
- }
1712
- }
1713
- getIframeSrc() {
1714
- let paramsList = [];
1715
- if (this.paymentMethodFormValidationMode) {
1716
- paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);
1717
- }
1718
- if (this.singleLine) {
1719
- paramsList.push(`singleLine=${this.singleLine}`);
1720
- }
1721
- let iframeSrc = `${this.iframeOrigin}/${this.paymentMethodFormType}${composeQueryParams(paramsList)}`;
1722
- return iframeSrc;
1723
- }
1724
- initializeFrameCommunicationService() {
1725
- var _a;
1726
- this.frameService = new FrameCommunicationService(this.iframeElement, this.iframeOrigin);
1727
- (_a = this.frameService) === null || _a === void 0 ? void 0 : _a.addMessageListener(this.dispatchMessageEvent);
1728
- }
1729
- render() {
1730
- return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
1731
- this.iframeElement = el;
1732
- }, onLoad: () => {
1733
- iframeResizer({
1734
- scrollbars: false,
1735
- }, this.iframeElement);
1736
- this.initializeFrameCommunicationService();
1737
- this.sendStyleOverrides();
1738
- } })));
1739
- }
1740
- };
1741
- PaymentMethodForm.style = paymentMethodFormCss;
1742
-
1743
- export { PaymentMethodForm as justifi_payment_method_form };