@justifi/webcomponents 5.7.6-rc-02 → 5.7.6-rc-03

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 (623) hide show
  1. package/dist/cjs/{Api-c8NBCwu4.js → Api-eP0XeJLd.js} +1 -1
  2. package/dist/cjs/{Refund-Dt1CMUjx.js → Refund-08OcZkXX.js} +148 -1
  3. package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -1
  4. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +7 -7
  5. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  6. package/dist/cjs/{business.service-W2PRAU9J.js → business.service-CZrK48lv.js} +2 -3
  7. package/dist/cjs/card-form.cjs.entry.js +2 -2
  8. package/dist/cjs/{check-pkg-version-DmONJMn1.js → check-pkg-version-DBocF2eE.js} +3 -4
  9. package/dist/cjs/{checkout.service-XwOh98gt.js → checkout.service-CllLA9W6.js} +2 -3
  10. package/dist/cjs/checkouts-list-core.cjs.entry.js +5 -5
  11. package/dist/cjs/{checkouts-table-CrpOOe_e.js → checkouts-table-Cp7rNkNd.js} +1 -1
  12. package/dist/cjs/custom-popper.cjs.entry.js +2 -2
  13. package/dist/cjs/dinero-J-SRFKIR.js +1673 -0
  14. package/dist/cjs/{dispute.service-Dh82Wru1.js → dispute.service-Chptj-DX.js} +2 -3
  15. package/dist/cjs/form-alert_5.cjs.entry.js +4 -4
  16. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  17. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  18. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  19. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +2 -2
  20. package/dist/cjs/form-control-monetary.cjs.entry.js +4 -3
  21. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +3 -3
  22. package/dist/cjs/form-control-number.cjs.entry.js +2 -2
  23. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  24. package/dist/cjs/form-control-select_3.cjs.entry.js +4 -4
  25. package/dist/cjs/{get-payment-details-W4PgTPkL.js → get-payment-details-C3qBZVdv.js} +3 -4
  26. package/dist/cjs/{get-subaccounts-D4woaGSs.js → get-subaccounts-DKyvT-ZF.js} +3 -4
  27. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +3 -2
  28. package/dist/cjs/header-2-BXQLJn1q.js +10 -0
  29. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  30. package/dist/cjs/{insurance-state-BsGy_svD.js → insurance-state-kH0kuTD8.js} +3 -10
  31. package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
  32. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +14 -14
  33. package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +8 -8
  34. package/dist/cjs/{justifi-bank-account-form_5.cjs.entry.js → justifi-bank-account-form_7.cjs.entry.js} +59 -17
  35. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +49 -0
  36. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
  37. package/dist/cjs/justifi-business-form.cjs.entry.js +7 -7
  38. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
  39. package/dist/cjs/{justifi-button_5.cjs.entry.js → justifi-checkout-summary_5.cjs.entry.js} +126 -45
  40. package/dist/cjs/justifi-checkout.cjs.entry.js +12 -12
  41. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +4 -4
  42. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +10 -10
  43. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
  44. package/dist/cjs/justifi-dispute-management.cjs.entry.js +8 -8
  45. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +11 -11
  46. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
  47. package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -9
  48. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +9 -9
  49. package/dist/cjs/justifi-payment-details.cjs.entry.js +9 -9
  50. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +1 -1
  51. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +8 -8
  52. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +8 -8
  53. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +4 -3
  54. package/dist/cjs/justifi-payments-list.cjs.entry.js +10 -10
  55. package/dist/cjs/justifi-payout-details.cjs.entry.js +7 -7
  56. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +8 -8
  57. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +4 -3
  58. package/dist/cjs/justifi-payouts-list.cjs.entry.js +10 -10
  59. package/dist/cjs/justifi-refund-payment.cjs.entry.js +8 -8
  60. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +3 -3
  61. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +5 -3
  62. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +7 -7
  63. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  64. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +5 -5
  65. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +8 -8
  66. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +4 -4
  67. package/dist/cjs/justifi-terminals-list.cjs.entry.js +10 -10
  68. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +188 -32
  69. package/dist/cjs/loader.cjs.js +1 -1
  70. package/dist/cjs/{package-oywezDpy.js → package-BM2FCIB8.js} +1 -1
  71. package/dist/cjs/payment-details-core.cjs.entry.js +10 -9
  72. package/dist/cjs/{payment-method-option-utils-imuSE7KV.js → payment-method-option-utils-QODgEWhU.js} +1 -11
  73. package/dist/cjs/{payment.service-BrvtS3F7.js → payment.service-C6kdaQYS.js} +2 -3
  74. package/dist/cjs/payments-list-core.cjs.entry.js +5 -5
  75. package/dist/cjs/{payments-table-BqxFc71K.js → payments-table-DaW6SvdL.js} +1 -1
  76. package/dist/cjs/payout-details-core.cjs.entry.js +5 -4
  77. package/dist/cjs/{payout.service-DNH6gRrP.js → payout.service-CLnAr59x.js} +2 -3
  78. package/dist/cjs/payouts-list-core.cjs.entry.js +5 -5
  79. package/dist/cjs/{payouts-table-iT2IauEa.js → payouts-table-D5hMHcaY.js} +1 -1
  80. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  81. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +5 -5
  82. package/dist/cjs/{terminal-orders-table-xi_a-EnM.js → terminal-orders-table-DTZUpjkG.js} +2 -3
  83. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  84. package/dist/cjs/{terminal.service-CdzmTRQE.js → terminal.service-CcBCXxNm.js} +2 -3
  85. package/dist/cjs/terminals-list-core.cjs.entry.js +5 -5
  86. package/dist/cjs/{terminals-table-sf-s5v6D.js → terminals-table-DOqVeHM1.js} +1 -1
  87. package/dist/cjs/{utils-qOon0GWm.js → utils-DqlrBltg.js} +2 -1676
  88. package/dist/cjs/webcomponents.cjs.js +1 -1
  89. package/dist/collection/collection-manifest.json +1 -2
  90. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +1 -1
  91. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
  92. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -1
  93. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +1 -1
  94. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
  95. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +1 -1
  96. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +1 -1
  97. package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -1
  98. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
  99. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +1 -1
  100. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +1 -1
  101. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +1 -1
  102. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  103. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
  104. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +1 -1
  105. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
  106. package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +2 -2
  107. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
  108. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +1 -1
  109. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +1 -1
  110. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +1 -1
  111. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
  112. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +1 -1
  113. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  114. package/dist/collection/components/checkout/billing-form/billing-form.js +10 -37
  115. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  116. package/dist/collection/components/checkout/checkout.js +1 -1
  117. package/dist/collection/components/checkout/payment-method-option-utils.js +0 -1
  118. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  119. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  120. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  121. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  122. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  123. package/dist/collection/components/dispute-management/dispute-management-core.js +1 -1
  124. package/dist/collection/components/dispute-management/dispute-management.js +1 -1
  125. package/dist/collection/components/dispute-management/dispute-notification.js +1 -1
  126. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  127. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  128. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  129. package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +1 -1
  130. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  131. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  132. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  133. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  134. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  135. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  136. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  137. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
  138. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +1 -1
  139. package/dist/collection/components/modular-checkout/modular-checkout.js +8 -1
  140. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
  141. package/dist/collection/components/modular-checkout/sub-components/billing-information-form.js +36 -5
  142. package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
  143. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  144. package/dist/collection/components/modular-checkout/sub-components/postal-code-form.js +5 -4
  145. package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
  146. package/dist/collection/components/order-terminals/order-terminals.js +1 -1
  147. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  148. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  149. package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
  150. package/dist/collection/components/payments-list/payments-list-core.js +1 -1
  151. package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
  152. package/dist/collection/components/payments-list/payments-list.js +1 -1
  153. package/dist/collection/components/payout-details/payout-details-core.js +3 -3
  154. package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
  155. package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
  156. package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
  157. package/dist/collection/components/payouts-list/payouts-list.js +1 -1
  158. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
  159. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
  160. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
  161. package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
  162. package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
  163. package/dist/collection/components/terminals-list/terminals-list.js +1 -1
  164. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +273 -89
  165. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  166. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  167. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  168. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  169. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  170. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  171. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  172. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  173. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  174. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  175. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  176. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  177. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  178. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  179. package/dist/collection/ui-components/index.js +1 -0
  180. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  181. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  182. package/dist/collection/ui-components/shadow-dom-components/justifi-radio-list-item.js +155 -0
  183. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  184. package/dist/docs.json +729 -1328
  185. package/dist/esm/{Api-C3T8XYbb.js → Api-BCeKXDaf.js} +1 -1
  186. package/dist/esm/{Dispute-7MWRbTXI.js → Dispute-BH0Xfn-F.js} +1 -1
  187. package/dist/esm/{Refund-0aZtuMmz.js → Refund-DBHZkemk.js} +148 -2
  188. package/dist/esm/additional-questions-details_5.entry.js +4 -3
  189. package/dist/esm/{badge-Dr7gkD2I.js → badge-BrapPg3R.js} +1 -1
  190. package/dist/esm/bank-account-document-form-inputs_4.entry.js +11 -11
  191. package/dist/esm/bank-account-form.entry.js +4 -4
  192. package/dist/esm/business-details-core.entry.js +3 -3
  193. package/dist/esm/{business.service-C5vrjgZf.js → business.service-BPBxsb8B.js} +3 -4
  194. package/dist/esm/{button-xfPDSpPt.js → button-BB-N4vit.js} +1 -1
  195. package/dist/esm/card-form.entry.js +4 -4
  196. package/dist/esm/{check-pkg-version-DqhSXPRt.js → check-pkg-version-Cic-MeLf.js} +4 -5
  197. package/dist/esm/{checkout.service-CW2_CEte.js → checkout.service-C1WAmUiU.js} +3 -4
  198. package/dist/esm/checkouts-list-core.entry.js +10 -10
  199. package/dist/esm/{checkouts-table-BHhaS5bv.js → checkouts-table-COpCngi0.js} +3 -3
  200. package/dist/esm/custom-popper.entry.js +2 -2
  201. package/dist/esm/dinero-DizZAUMY.js +1671 -0
  202. package/dist/esm/{dispute.service-C3bmfjsZ.js → dispute.service-bQh-LG0z.js} +3 -4
  203. package/dist/esm/form-alert_5.entry.js +5 -5
  204. package/dist/esm/form-control-checkbox.entry.js +5 -5
  205. package/dist/esm/form-control-date.entry.js +4 -4
  206. package/dist/esm/{form-control-error-text-Cn0aPzHx.js → form-control-error-text-Bk3yfpFX.js} +1 -1
  207. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  208. package/dist/esm/{form-control-help-text-C91TeHXs.js → form-control-help-text-mOLCXs00.js} +1 -1
  209. package/dist/esm/form-control-monetary-provisioning.entry.js +5 -5
  210. package/dist/esm/form-control-monetary.entry.js +7 -6
  211. package/dist/esm/form-control-number-masked_2.entry.js +5 -5
  212. package/dist/esm/form-control-number.entry.js +5 -5
  213. package/dist/esm/form-control-radio.entry.js +3 -3
  214. package/dist/esm/form-control-select_3.entry.js +6 -6
  215. package/dist/esm/{get-payment-details-BdPvFl1W.js → get-payment-details-B193kh7P.js} +3 -4
  216. package/dist/esm/{get-subaccounts-BqqR44dV.js → get-subaccounts-DcgISPei.js} +4 -5
  217. package/dist/esm/gross-payment-chart-core.entry.js +6 -5
  218. package/dist/esm/{header-1-noRVFQY9.js → header-1-DYuf6mkF.js} +1 -1
  219. package/dist/esm/header-2-C4ZCdZwi.js +8 -0
  220. package/dist/esm/hidden-input_2.entry.js +7 -7
  221. package/dist/esm/{insurance-state-pL8MRpxn.js → insurance-state-DeyYNyas.js} +1 -7
  222. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +7 -7
  223. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +17 -17
  224. package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
  225. package/dist/esm/{justifi-bank-account-form_5.entry.js → justifi-bank-account-form_7.entry.js} +60 -20
  226. package/dist/esm/justifi-billing-form_2.entry.js +46 -0
  227. package/dist/esm/justifi-business-details.entry.js +10 -10
  228. package/dist/esm/justifi-business-form.entry.js +12 -12
  229. package/dist/esm/justifi-business-representative-form-inputs.entry.js +2 -2
  230. package/dist/esm/{justifi-button_5.entry.js → justifi-checkout-summary_5.entry.js} +127 -46
  231. package/dist/esm/justifi-checkout.entry.js +9 -9
  232. package/dist/esm/justifi-checkouts-list-filters.entry.js +6 -6
  233. package/dist/esm/justifi-checkouts-list.entry.js +13 -13
  234. package/dist/esm/justifi-details.entry.js +2 -2
  235. package/dist/esm/justifi-dispute-management-core.entry.js +2 -2
  236. package/dist/esm/justifi-dispute-management.entry.js +9 -9
  237. package/dist/esm/justifi-dispute-notification_3.entry.js +14 -14
  238. package/dist/esm/justifi-gross-payment-chart.entry.js +9 -9
  239. package/dist/esm/justifi-order-terminals.entry.js +12 -12
  240. package/dist/esm/justifi-owner-form_3.entry.js +11 -11
  241. package/dist/esm/justifi-payment-details.entry.js +11 -11
  242. package/dist/esm/justifi-payment-provisioning-core.entry.js +3 -3
  243. package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
  244. package/dist/esm/justifi-payment-transactions-list.entry.js +12 -12
  245. package/dist/esm/justifi-payments-list-filters.entry.js +5 -4
  246. package/dist/esm/justifi-payments-list.entry.js +13 -13
  247. package/dist/esm/justifi-payout-details.entry.js +10 -10
  248. package/dist/esm/justifi-payout-transactions-list.entry.js +12 -12
  249. package/dist/esm/justifi-payouts-list-filters.entry.js +5 -4
  250. package/dist/esm/justifi-payouts-list.entry.js +14 -14
  251. package/dist/esm/justifi-refund-payment.entry.js +12 -12
  252. package/dist/esm/justifi-saved-payment-method.entry.js +4 -4
  253. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +6 -4
  254. package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -8
  255. package/dist/esm/justifi-skeleton.entry.js +3 -3
  256. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +7 -7
  257. package/dist/esm/justifi-terminal-orders-list.entry.js +11 -11
  258. package/dist/esm/justifi-terminals-list-filters.entry.js +6 -6
  259. package/dist/esm/justifi-terminals-list.entry.js +13 -13
  260. package/dist/esm/justifi-tokenize-payment-method.entry.js +190 -34
  261. package/dist/esm/loader.js +1 -1
  262. package/dist/esm/{package-DR0dQ8Fv.js → package-BRJ4FIJH.js} +1 -1
  263. package/dist/esm/pagination-menu.entry.js +1 -1
  264. package/dist/esm/{parts-D3G5aVLy.js → parts-CKg_luIy.js} +1 -1
  265. package/dist/esm/payment-details-core.entry.js +15 -14
  266. package/dist/esm/{payment-method-option-utils-8n_ALxec.js → payment-method-option-utils-zFDtQrgQ.js} +2 -10
  267. package/dist/esm/{payment.service-CnQdP32J.js → payment.service-BTVtIbcY.js} +3 -4
  268. package/dist/esm/payments-list-core.entry.js +11 -11
  269. package/dist/esm/{payments-status-DUM0WZkk.js → payments-status-CawBLR48.js} +1 -1
  270. package/dist/esm/{payments-table-DVQzx7MJ.js → payments-table-WQAD1CSz.js} +3 -3
  271. package/dist/esm/payout-details-core.entry.js +11 -10
  272. package/dist/esm/{payout.service-EJuPNpfs.js → payout.service-j8w34GsW.js} +3 -4
  273. package/dist/esm/payouts-list-core.entry.js +11 -11
  274. package/dist/esm/{payouts-status-7saoFNoA.js → payouts-status-DB_PJap6.js} +1 -1
  275. package/dist/esm/{payouts-table-dca-F2iQ.js → payouts-table-DRISll8u.js} +3 -3
  276. package/dist/esm/{skeleton-C1-JoGFC.js → skeleton-D1Z4a8af.js} +1 -1
  277. package/dist/esm/{spinner-Ca9uu5Nd.js → spinner-BlffecO5.js} +1 -1
  278. package/dist/esm/{table-fsCYq8m9.js → table-BqxKVRry.js} +2 -2
  279. package/dist/esm/table-filters-menu.entry.js +3 -3
  280. package/dist/esm/terminal-orders-list-core.entry.js +10 -10
  281. package/dist/esm/{terminal-orders-table-BNasCnjz.js → terminal-orders-table-BWf9quiN.js} +5 -6
  282. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  283. package/dist/esm/{terminal.service-Cfacmeto.js → terminal.service-BDRGcUj-.js} +3 -4
  284. package/dist/esm/terminals-list-core.entry.js +10 -10
  285. package/dist/esm/{terminals-table-DBk-eg_3.js → terminals-table-BBPQRWja.js} +3 -3
  286. package/dist/esm/{utils-BjLkBMLe.js → utils-Cu5hITuT.js} +2 -1675
  287. package/dist/esm/{utils-CNwvOLkk.js → utils-sZ_6zOKQ.js} +1 -1
  288. package/dist/esm/webcomponents.js +1 -1
  289. package/dist/module/Analytics.js +0 -1
  290. package/dist/module/Refund.js +202 -1
  291. package/dist/module/additional-questions.js +1 -1
  292. package/dist/module/additional-statement.js +1 -1
  293. package/dist/module/badge.js +1 -1
  294. package/dist/module/bank-account-document-inputs.js +2 -3
  295. package/dist/module/bank-account-form-inputs2.js +1 -1
  296. package/dist/module/bank-account-form.js +2 -2
  297. package/dist/module/bank-account.js +3 -2
  298. package/dist/module/billing-form.js +20 -57
  299. package/dist/module/billing-information-form.js +10 -3
  300. package/dist/module/business-additional-questions-form-step.js +1 -1
  301. package/dist/module/business-bank-account-form-step-core.js +2 -3
  302. package/dist/module/business-bank-account-form-step.js +2 -3
  303. package/dist/module/business-core-info-form-step.js +1 -1
  304. package/dist/module/business-core-info.js +1 -1
  305. package/dist/module/business-details-core2.js +1 -0
  306. package/dist/module/business-documents-on-file2.js +2 -1
  307. package/dist/module/business-owners-form-step-core.js +1 -0
  308. package/dist/module/business-owners-form-step.js +1 -1
  309. package/dist/module/business-representative-form-inputs.js +1 -1
  310. package/dist/module/business-representative-form-step.js +1 -1
  311. package/dist/module/business-representative.js +1 -1
  312. package/dist/module/business-terms-conditions-form-step.js +1 -2
  313. package/dist/module/business.service.js +0 -1
  314. package/dist/module/cancellation-policy.js +1 -1
  315. package/dist/module/card-form.js +2 -2
  316. package/dist/module/card-form2.js +3 -2
  317. package/dist/module/checkout.service.js +0 -1
  318. package/dist/module/checkouts-list-core2.js +5 -4
  319. package/dist/module/custom-popper2.js +2 -2
  320. package/dist/module/customer-details.js +1 -1
  321. package/dist/module/dinero.js +1671 -0
  322. package/dist/module/dispute-management-core.js +2 -2
  323. package/dist/module/dispute-notification.js +2 -1
  324. package/dist/module/dispute-response-actions.js +0 -1
  325. package/dist/module/dispute-response-core.js +1 -1
  326. package/dist/module/dispute-response.js +2 -1
  327. package/dist/module/duplicate-charge.js +1 -1
  328. package/dist/module/electronic-evidence.js +1 -1
  329. package/dist/module/form-alert2.js +1 -1
  330. package/dist/module/form-control-checkbox2.js +4 -3
  331. package/dist/module/form-control-date2.js +3 -2
  332. package/dist/module/form-control-file-v22.js +1 -1
  333. package/dist/module/form-control-file2.js +3 -2
  334. package/dist/module/form-control-monetary-provisioning2.js +4 -3
  335. package/dist/module/form-control-monetary2.js +4 -3
  336. package/dist/module/form-control-number-masked2.js +3 -2
  337. package/dist/module/form-control-number.js +4 -3
  338. package/dist/module/form-control-radio2.js +3 -3
  339. package/dist/module/form-control-select2.js +3 -2
  340. package/dist/module/form-control-text2.js +3 -2
  341. package/dist/module/form-control-textarea2.js +3 -3
  342. package/dist/module/get-payment-details.js +2 -3
  343. package/dist/module/get-subaccounts.js +1 -2
  344. package/dist/module/gross-payment-chart-core2.js +2 -2
  345. package/dist/module/hidden-input2.js +2 -2
  346. package/dist/module/identity-address-form.js +1 -1
  347. package/dist/module/iframe-input2.js +4 -4
  348. package/dist/module/justifi-business-form.js +2 -2
  349. package/dist/module/justifi-button2.js +1 -1
  350. package/dist/module/justifi-checkout.js +3 -2
  351. package/dist/module/justifi-checkouts-list-filters.js +4 -4
  352. package/dist/module/justifi-checkouts-list.js +4 -4
  353. package/dist/module/justifi-dispute-management.js +2 -3
  354. package/dist/module/justifi-gross-payment-chart.js +0 -1
  355. package/dist/module/justifi-header2.js +7 -3
  356. package/dist/module/justifi-order-terminals.js +5 -4
  357. package/dist/module/justifi-payment-provisioning.js +1 -2
  358. package/dist/module/justifi-payment-transactions-list.js +6 -5
  359. package/dist/module/justifi-payments-list-filters.js +4 -3
  360. package/dist/module/justifi-payments-list.js +4 -4
  361. package/dist/module/justifi-payout-details.js +2 -3
  362. package/dist/module/justifi-payout-transactions-list.js +6 -5
  363. package/dist/module/justifi-payouts-list-filters.js +4 -3
  364. package/dist/module/justifi-payouts-list.js +4 -4
  365. package/dist/module/justifi-radio-list-item.d.ts +11 -0
  366. package/dist/module/justifi-radio-list-item.js +6 -0
  367. package/dist/module/justifi-radio-list-item2.js +55 -0
  368. package/dist/module/justifi-refund-payment.js +2 -2
  369. package/dist/module/justifi-saved-payment-method.js +2 -2
  370. package/dist/module/justifi-season-interruption-insurance.js +1 -2
  371. package/dist/module/justifi-skeleton.js +1 -1
  372. package/dist/module/justifi-terminal-orders-list-filters.js +5 -5
  373. package/dist/module/justifi-terminal-orders-list.js +4 -4
  374. package/dist/module/justifi-terminals-list-filters.js +4 -4
  375. package/dist/module/justifi-terminals-list.js +4 -4
  376. package/dist/module/justifi-tokenize-payment-method.js +285 -47
  377. package/dist/module/legal-address-form-step.js +1 -1
  378. package/dist/module/legal-address-form.js +1 -1
  379. package/dist/module/modular-checkout.js +9 -3
  380. package/dist/module/owner-form-core2.js +3 -2
  381. package/dist/module/owner-form-inputs2.js +1 -1
  382. package/dist/module/owner-form.js +1 -1
  383. package/dist/module/package.js +1 -1
  384. package/dist/module/pagination-menu2.js +1 -1
  385. package/dist/module/parts.js +1 -1
  386. package/dist/module/payment-details-core2.js +10 -9
  387. package/dist/module/payment-method-option-utils.js +2 -10
  388. package/dist/module/payment-method-option2.js +3 -2
  389. package/dist/module/payment-provisioning-core.js +2 -1
  390. package/dist/module/payment-provisioning-form-buttons.js +2 -1
  391. package/dist/module/payment-provisioning-form-steps.js +1 -1
  392. package/dist/module/payment-provisioning-loading.js +1 -0
  393. package/dist/module/payment.service.js +0 -1
  394. package/dist/module/payments-list-core2.js +5 -4
  395. package/dist/module/payout-details-core2.js +5 -4
  396. package/dist/module/payout.service.js +0 -1
  397. package/dist/module/payouts-list-core2.js +5 -4
  398. package/dist/module/postal-code-form.js +4 -2
  399. package/dist/module/product-or-service.js +1 -1
  400. package/dist/module/refund-policy.js +1 -1
  401. package/dist/module/save-new-payment-method.js +2 -1
  402. package/dist/module/saved-payment-methods.js +2 -1
  403. package/dist/module/season-interruption-insurance-core.js +2 -1
  404. package/dist/module/sezzle-payment-method.js +2 -1
  405. package/dist/module/shipping-details.js +1 -1
  406. package/dist/module/spinner.js +1 -1
  407. package/dist/module/summary.js +2 -1
  408. package/dist/module/table-filters-menu2.js +1 -1
  409. package/dist/module/table.js +1 -1
  410. package/dist/module/terminal-orders-list-core2.js +6 -5
  411. package/dist/module/terminal-quantity-selector2.js +2 -2
  412. package/dist/module/terminal.service.js +0 -1
  413. package/dist/module/terminals-list-core2.js +5 -4
  414. package/dist/module/utils2.js +2 -1675
  415. package/dist/types/components/checkout/billing-form/billing-form.d.ts +3 -9
  416. package/dist/types/components/checkout/checkout.d.ts +1 -1
  417. package/dist/types/components/modular-checkout/modular-checkout.d.ts +1 -0
  418. package/dist/types/components/modular-checkout/sub-components/billing-information-form.d.ts +2 -0
  419. package/dist/types/components/modular-checkout/sub-components/postal-code-form.d.ts +1 -0
  420. package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +37 -14
  421. package/dist/types/components.d.ts +68 -112
  422. package/dist/types/ui-components/index.d.ts +1 -0
  423. package/dist/types/ui-components/shadow-dom-components/justifi-radio-list-item.d.ts +12 -0
  424. package/dist/webcomponents/p-072d93c9.entry.js +1 -0
  425. package/dist/webcomponents/{p-ae00a6f3.entry.js → p-0dcc215b.entry.js} +1 -1
  426. package/dist/webcomponents/p-0e6797c4.entry.js +1 -0
  427. package/dist/webcomponents/p-0fc026aa.entry.js +1 -0
  428. package/dist/webcomponents/p-18aa8190.entry.js +1 -0
  429. package/dist/webcomponents/{p-7c63d61d.entry.js → p-19c07145.entry.js} +1 -1
  430. package/dist/webcomponents/p-1Or21UzV.js +1 -0
  431. package/dist/webcomponents/{p-50bfec55.entry.js → p-1b7b7210.entry.js} +1 -1
  432. package/dist/webcomponents/p-1f76ae29.entry.js +1 -0
  433. package/dist/webcomponents/p-20eb7015.entry.js +1 -0
  434. package/dist/webcomponents/{p-0e4e662b.entry.js → p-2437703b.entry.js} +1 -1
  435. package/dist/webcomponents/{p-a95741ee.entry.js → p-24f30623.entry.js} +1 -1
  436. package/dist/webcomponents/p-2a5ac7c9.entry.js +1 -0
  437. package/dist/webcomponents/p-2abae807.entry.js +1 -0
  438. package/dist/webcomponents/{p-2f482f5b.entry.js → p-351ffd2a.entry.js} +1 -1
  439. package/dist/webcomponents/p-35411771.entry.js +1 -0
  440. package/dist/webcomponents/{p-05c604d2.entry.js → p-366dba79.entry.js} +1 -1
  441. package/dist/webcomponents/p-3add112c.entry.js +1 -0
  442. package/dist/webcomponents/p-48e406f1.entry.js +1 -0
  443. package/dist/webcomponents/p-4d0373a7.entry.js +1 -0
  444. package/dist/webcomponents/p-55iuf7iW.js +1 -0
  445. package/dist/webcomponents/p-5cb87816.entry.js +1 -0
  446. package/dist/webcomponents/p-628cf20a.entry.js +1 -0
  447. package/dist/webcomponents/p-66422cbd.entry.js +1 -0
  448. package/dist/webcomponents/p-6f397c80.entry.js +1 -0
  449. package/dist/webcomponents/p-7929bdae.entry.js +1 -0
  450. package/dist/webcomponents/{p-30d3d0cd.entry.js → p-7a52bdb5.entry.js} +1 -1
  451. package/dist/webcomponents/p-7e24a1f7.entry.js +1 -0
  452. package/dist/webcomponents/p-8027e13f.entry.js +1 -0
  453. package/dist/webcomponents/p-86b166eb.entry.js +1 -0
  454. package/dist/webcomponents/p-889e8be8.entry.js +1 -0
  455. package/dist/webcomponents/p-8a1171de.entry.js +1 -0
  456. package/dist/webcomponents/{p-0890869b.entry.js → p-8aefc49f.entry.js} +4 -4
  457. package/dist/webcomponents/p-8b2f81b4.entry.js +1 -0
  458. package/dist/webcomponents/p-97429fb4.entry.js +1 -0
  459. package/dist/webcomponents/{p-a27405fb.entry.js → p-98b6943a.entry.js} +1 -1
  460. package/dist/webcomponents/{p-5d145701.entry.js → p-9bf095d2.entry.js} +1 -1
  461. package/dist/webcomponents/p-9c1e3fb8.entry.js +1 -0
  462. package/dist/webcomponents/{p-Dh6FEdp8.js → p-AbSg_vYv.js} +1 -1
  463. package/dist/webcomponents/p-B2uBb14Y.js +1 -0
  464. package/dist/webcomponents/p-BF51n3KG.js +1 -0
  465. package/dist/webcomponents/{p-7MWRbTXI.js → p-BH0Xfn-F.js} +1 -1
  466. package/dist/webcomponents/p-BJuv5Y2i.js +1 -0
  467. package/dist/webcomponents/p-BQLEjYfZ.js +1 -0
  468. package/dist/webcomponents/p-BRJ4FIJH.js +1 -0
  469. package/dist/webcomponents/p-BeNhCG1Q.js +1 -0
  470. package/dist/webcomponents/{p-BqK0rIZQ.js → p-BfEOvp9h.js} +1 -1
  471. package/dist/webcomponents/p-ButA5T4e.js +1 -0
  472. package/dist/webcomponents/p-C3e-DgwK.js +1 -0
  473. package/dist/webcomponents/{p-DAVX1-sW.js → p-CDIPkflV.js} +1 -1
  474. package/dist/webcomponents/{p-D3G5aVLy.js → p-CKg_luIy.js} +1 -1
  475. package/dist/webcomponents/{p-DDpc1huF.js → p-Ce8QXyUM.js} +1 -1
  476. package/dist/webcomponents/p-ChzWF0s3.js +1 -0
  477. package/dist/webcomponents/p-CjAMuB2J.js +1 -0
  478. package/dist/webcomponents/p-ClSZshaa.js +1 -0
  479. package/dist/webcomponents/{p-DAoffYFW.js → p-D0I-tRSs.js} +1 -1
  480. package/dist/webcomponents/p-D0Ko1H7J.js +1 -0
  481. package/dist/webcomponents/p-DC63XVwu.js +1 -0
  482. package/dist/webcomponents/p-DPfZxsq9.js +1 -0
  483. package/dist/webcomponents/{p-DHvfrLVU.js → p-DPnS0F0Y.js} +1 -1
  484. package/dist/webcomponents/p-DR0bMp9p.js +1 -0
  485. package/dist/webcomponents/p-DZR542ci.js +1 -0
  486. package/dist/webcomponents/p-Dn0KGDtq.js +1 -0
  487. package/dist/webcomponents/p-DniBAXrh.js +1 -0
  488. package/dist/webcomponents/{p-1adN6FVa.js → p-DpUqxsf5.js} +1 -1
  489. package/dist/webcomponents/p-DxEnw2tJ.js +1 -0
  490. package/dist/webcomponents/{p-fUv1jFAw.js → p-EAEmpCru.js} +1 -1
  491. package/dist/webcomponents/p-Ph6Ebeu2.js +1 -0
  492. package/dist/webcomponents/p-RXUoM7A2.js +1 -0
  493. package/dist/webcomponents/{p-683630d0.entry.js → p-a1c7c873.entry.js} +1 -1
  494. package/dist/webcomponents/{p-64a46b8a.entry.js → p-a95db9a6.entry.js} +1 -1
  495. package/dist/webcomponents/{p-ac538ffd.entry.js → p-a9ed792e.entry.js} +1 -1
  496. package/dist/webcomponents/p-acf4c099.entry.js +1 -0
  497. package/dist/webcomponents/p-b47000f7.entry.js +1 -0
  498. package/dist/webcomponents/{p-cb7c712f.entry.js → p-b860ec37.entry.js} +1 -1
  499. package/dist/webcomponents/p-b893d5fa.entry.js +1 -0
  500. package/dist/webcomponents/p-b9d1d9dd.entry.js +1 -0
  501. package/dist/webcomponents/p-baa04544.entry.js +1 -0
  502. package/dist/webcomponents/{p-1bddf354.entry.js → p-bbd0aa4e.entry.js} +1 -1
  503. package/dist/webcomponents/p-bf2ba40d.entry.js +1 -0
  504. package/dist/webcomponents/p-c06bd8ea.entry.js +1 -0
  505. package/dist/webcomponents/p-c0955693.entry.js +1 -0
  506. package/dist/webcomponents/{p-7d2de2d4.entry.js → p-c0bd6405.entry.js} +1 -1
  507. package/dist/webcomponents/p-c6473b9b.entry.js +1 -0
  508. package/dist/webcomponents/p-c70dc6bd.entry.js +1 -0
  509. package/dist/webcomponents/p-ca6d05f9.entry.js +1 -0
  510. package/dist/webcomponents/p-d1c1c642.entry.js +1 -0
  511. package/dist/webcomponents/p-d3c966f4.entry.js +1 -0
  512. package/dist/webcomponents/{p-f5d12ae3.entry.js → p-d49b80b1.entry.js} +1 -1
  513. package/dist/webcomponents/p-d69d09e6.entry.js +1 -0
  514. package/dist/webcomponents/p-dd3749ed.entry.js +1 -0
  515. package/dist/webcomponents/p-dfaf5b14.entry.js +1 -0
  516. package/dist/webcomponents/{p-e48a2d25.entry.js → p-e2ee826e.entry.js} +1 -1
  517. package/dist/webcomponents/p-eccb77fa.entry.js +1 -0
  518. package/dist/webcomponents/p-ede5eb9d.entry.js +1 -0
  519. package/dist/webcomponents/p-eefe4d71.entry.js +1 -0
  520. package/dist/webcomponents/p-f4f3bca9.entry.js +1 -0
  521. package/dist/webcomponents/{p-d7f62287.entry.js → p-f67133f0.entry.js} +1 -1
  522. package/dist/webcomponents/{p-70774a5a.entry.js → p-f6ad1d58.entry.js} +1 -1
  523. package/dist/webcomponents/{p-a02ce003.entry.js → p-f9bddc04.entry.js} +1 -1
  524. package/dist/webcomponents/p-rPeW3G6n.js +1 -0
  525. package/dist/webcomponents/p-xIyLUOJ6.js +1 -0
  526. package/dist/webcomponents/webcomponents.esm.js +1 -1
  527. package/package.json +1 -1
  528. package/dist/cjs/Payment-D5UynU2f.js +0 -151
  529. package/dist/cjs/header-3-BnKbOjvz.js +0 -10
  530. package/dist/cjs/justifi-billing-form.cjs.entry.js +0 -76
  531. package/dist/cjs/justifi-new-payment-method.cjs.entry.js +0 -99
  532. package/dist/cjs/justifi-payment-method-options.cjs.entry.js +0 -76
  533. package/dist/cjs/justifi-saved-payment-methods_2.cjs.entry.js +0 -117
  534. package/dist/collection/components/checkout/new-payment-method.js +0 -378
  535. package/dist/collection/components/checkout/payment-method-options.js +0 -421
  536. package/dist/esm/Payment-00TwhwCx.js +0 -149
  537. package/dist/esm/header-3-Bsi4loU1.js +0 -8
  538. package/dist/esm/justifi-billing-form.entry.js +0 -74
  539. package/dist/esm/justifi-new-payment-method.entry.js +0 -97
  540. package/dist/esm/justifi-payment-method-options.entry.js +0 -74
  541. package/dist/esm/justifi-saved-payment-methods_2.entry.js +0 -114
  542. package/dist/module/Payment.js +0 -204
  543. package/dist/module/header-3.js +0 -8
  544. package/dist/module/justifi-new-payment-method.d.ts +0 -11
  545. package/dist/module/justifi-new-payment-method.js +0 -219
  546. package/dist/module/justifi-payment-method-options.d.ts +0 -11
  547. package/dist/module/justifi-payment-method-options.js +0 -6
  548. package/dist/module/payment-method-options.js +0 -129
  549. package/dist/types/components/checkout/new-payment-method.d.ts +0 -31
  550. package/dist/types/components/checkout/payment-method-options.d.ts +0 -32
  551. package/dist/webcomponents/p-00d7c2e6.entry.js +0 -1
  552. package/dist/webcomponents/p-03e9a98c.entry.js +0 -1
  553. package/dist/webcomponents/p-05fc864a.entry.js +0 -1
  554. package/dist/webcomponents/p-09c24135.entry.js +0 -1
  555. package/dist/webcomponents/p-0f511cc1.entry.js +0 -1
  556. package/dist/webcomponents/p-100008fa.entry.js +0 -1
  557. package/dist/webcomponents/p-17825dfb.entry.js +0 -1
  558. package/dist/webcomponents/p-18b941d3.entry.js +0 -1
  559. package/dist/webcomponents/p-19308a1b.entry.js +0 -1
  560. package/dist/webcomponents/p-1a7942f7.entry.js +0 -1
  561. package/dist/webcomponents/p-1d1d956b.entry.js +0 -1
  562. package/dist/webcomponents/p-26bf2fda.entry.js +0 -1
  563. package/dist/webcomponents/p-2d3949f7.entry.js +0 -1
  564. package/dist/webcomponents/p-326f4860.entry.js +0 -1
  565. package/dist/webcomponents/p-359b8f54.entry.js +0 -1
  566. package/dist/webcomponents/p-37aeeeee.entry.js +0 -1
  567. package/dist/webcomponents/p-4887bcb3.entry.js +0 -1
  568. package/dist/webcomponents/p-54406229.entry.js +0 -1
  569. package/dist/webcomponents/p-56af4fd0.entry.js +0 -1
  570. package/dist/webcomponents/p-59656e08.entry.js +0 -1
  571. package/dist/webcomponents/p-5e813b93.entry.js +0 -1
  572. package/dist/webcomponents/p-66861ea5.entry.js +0 -1
  573. package/dist/webcomponents/p-6bd83369.entry.js +0 -1
  574. package/dist/webcomponents/p-6ee2b118.entry.js +0 -1
  575. package/dist/webcomponents/p-73afde1b.entry.js +0 -1
  576. package/dist/webcomponents/p-73bbd71c.entry.js +0 -1
  577. package/dist/webcomponents/p-74f78a4e.entry.js +0 -1
  578. package/dist/webcomponents/p-755a8d9b.entry.js +0 -1
  579. package/dist/webcomponents/p-7c456c10.entry.js +0 -1
  580. package/dist/webcomponents/p-7c6d7283.entry.js +0 -1
  581. package/dist/webcomponents/p-7e9832b3.entry.js +0 -1
  582. package/dist/webcomponents/p-810cad17.entry.js +0 -1
  583. package/dist/webcomponents/p-81478598.entry.js +0 -1
  584. package/dist/webcomponents/p-91a2707a.entry.js +0 -1
  585. package/dist/webcomponents/p-9348a7c8.entry.js +0 -1
  586. package/dist/webcomponents/p-967c3374.entry.js +0 -1
  587. package/dist/webcomponents/p-9REosSLu.js +0 -1
  588. package/dist/webcomponents/p-9c27f87f.entry.js +0 -1
  589. package/dist/webcomponents/p-B9ROmZzw.js +0 -1
  590. package/dist/webcomponents/p-BCPBc18Y.js +0 -1
  591. package/dist/webcomponents/p-BQ5bL1Y5.js +0 -1
  592. package/dist/webcomponents/p-BSW9VS7r.js +0 -1
  593. package/dist/webcomponents/p-BSexQ2qc.js +0 -1
  594. package/dist/webcomponents/p-Bc5u1WjM.js +0 -1
  595. package/dist/webcomponents/p-BjQrbohd.js +0 -1
  596. package/dist/webcomponents/p-BxWsrx5h.js +0 -1
  597. package/dist/webcomponents/p-By9Lz2e0.js +0 -1
  598. package/dist/webcomponents/p-CEp46FZK.js +0 -1
  599. package/dist/webcomponents/p-CMNxLEJP.js +0 -1
  600. package/dist/webcomponents/p-CZItg0Yo.js +0 -1
  601. package/dist/webcomponents/p-D7WGjeDy.js +0 -1
  602. package/dist/webcomponents/p-DIDbcp63.js +0 -1
  603. package/dist/webcomponents/p-DR0dQ8Fv.js +0 -1
  604. package/dist/webcomponents/p-DUqRxn4Y.js +0 -1
  605. package/dist/webcomponents/p-DbcOhajT.js +0 -1
  606. package/dist/webcomponents/p-DhAmsAOH.js +0 -1
  607. package/dist/webcomponents/p-DoEkFs2i.js +0 -1
  608. package/dist/webcomponents/p-DvXSA0b0.js +0 -1
  609. package/dist/webcomponents/p-a05062d8.entry.js +0 -1
  610. package/dist/webcomponents/p-a2f0d61c.entry.js +0 -1
  611. package/dist/webcomponents/p-b193bf46.entry.js +0 -1
  612. package/dist/webcomponents/p-b398856f.entry.js +0 -1
  613. package/dist/webcomponents/p-d33baab9.entry.js +0 -1
  614. package/dist/webcomponents/p-d3f438ca.entry.js +0 -1
  615. package/dist/webcomponents/p-d5b3c65c.entry.js +0 -1
  616. package/dist/webcomponents/p-d62e6c16.entry.js +0 -1
  617. package/dist/webcomponents/p-eba620cd.entry.js +0 -1
  618. package/dist/webcomponents/p-ecdda6e6.entry.js +0 -1
  619. package/dist/webcomponents/p-f24e201f.entry.js +0 -1
  620. package/dist/webcomponents/p-m2jmX-Hz.js +0 -1
  621. package/dist/webcomponents/p-sT4o5vru.js +0 -1
  622. package/dist/webcomponents/p-ys9CWfNG.js +0 -1
  623. package/dist/webcomponents/p-zucQG3cz.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var _commonjsHelpers = require('./_commonjsHelpers-BJu3ubxk.js');
3
+ var dinero = require('./dinero-J-SRFKIR.js');
4
4
 
5
5
  var dateFns = {};
6
6
 
@@ -22142,1681 +22142,13 @@ function requireDateFns () {
22142
22142
 
22143
22143
  var dateFnsExports = /*@__PURE__*/ requireDateFns();
22144
22144
 
22145
- var dinero_1;
22146
- var hasRequiredDinero;
22147
-
22148
- function requireDinero () {
22149
- if (hasRequiredDinero) return dinero_1;
22150
- hasRequiredDinero = 1;
22151
-
22152
- /**
22153
- * Default values for all Dinero objects.
22154
- *
22155
- * You can override default values for all subsequent Dinero objects by changing them directly on the global `Dinero` object.
22156
- * Existing instances won't be affected.
22157
- *
22158
- * @property {Number} defaultAmount - The default amount for new Dinero objects (see {@link module:Dinero Dinero} for format).
22159
- * @property {String} defaultCurrency - The default currency for new Dinero objects (see {@link module:Dinero Dinero} for format).
22160
- * @property {Number} defaultPrecision - The default precision for new Dinero objects (see {@link module:Dinero Dinero} for format).
22161
- *
22162
- * @example
22163
- * // Will set currency to 'EUR' for all Dinero objects.
22164
- * Dinero.defaultCurrency = 'EUR'
22165
- *
22166
- * @type {Object}
22167
- */
22168
- var Defaults = {
22169
- defaultAmount: 0,
22170
- defaultCurrency: 'USD',
22171
- defaultPrecision: 2
22172
- };
22173
- /**
22174
- * Global settings for all Dinero objects.
22175
- *
22176
- * You can override global values for all subsequent Dinero objects by changing them directly on the global `Dinero` object.
22177
- * Existing instances won't be affected.
22178
- *
22179
- * @property {String} globalLocale - The global locale for new Dinero objects (see {@link module:Dinero~setLocale setLocale} for format).
22180
- * @property {String} globalFormat - The global format for new Dinero objects (see {@link module:Dinero~toFormat toFormat} for format).
22181
- * @property {String} globalRoundingMode - The global rounding mode for new Dinero objects (see {@link module:Dinero~multiply multiply} or {@link module:Dinero~divide divide} for format).
22182
- * @property {String} globalFormatRoundingMode - The global rounding mode to format new Dinero objects (see {@link module:Dinero~toFormat toFormat} or {@link module:Dinero~toRoundedUnit toRoundedUnit} for format).
22183
- * @property {(String|Promise)} globalExchangeRatesApi.endpoint - The global exchange rate API endpoint for new Dinero objects, or the global promise that resolves to the exchanges rates (see {@link module:Dinero~convert convert} for format).
22184
- * @property {String} globalExchangeRatesApi.propertyPath - The global exchange rate API property path for new Dinero objects (see {@link module:Dinero~convert convert} for format).
22185
- * @property {Object} globalExchangeRatesApi.headers - The global exchange rate API headers for new Dinero objects (see {@link module:Dinero~convert convert} for format).
22186
- *
22187
- * @example
22188
- * // Will set locale to 'fr-FR' for all Dinero objects.
22189
- * Dinero.globalLocale = 'fr-FR'
22190
- * @example
22191
- * // Will set global exchange rate API parameters for all Dinero objects.
22192
- * Dinero.globalExchangeRatesApi = {
22193
- * endpoint: 'https://yourexchangerates.api/latest?base={{from}}',
22194
- * propertyPath: 'data.rates.{{to}}',
22195
- * headers: {
22196
- * 'user-key': 'xxxxxxxxx'
22197
- * }
22198
- * }
22199
- *
22200
- * @type {Object}
22201
- */
22202
-
22203
- var Globals = {
22204
- globalLocale: 'en-US',
22205
- globalFormat: '$0,0.00',
22206
- globalRoundingMode: 'HALF_EVEN',
22207
- globalFormatRoundingMode: 'HALF_AWAY_FROM_ZERO',
22208
- globalExchangeRatesApi: {
22209
- endpoint: undefined,
22210
- headers: undefined,
22211
- propertyPath: undefined
22212
- }
22213
- };
22214
-
22215
- function _typeof(obj) {
22216
- "@babel/helpers - typeof";
22217
-
22218
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
22219
- _typeof = function (obj) {
22220
- return typeof obj;
22221
- };
22222
- } else {
22223
- _typeof = function (obj) {
22224
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22225
- };
22226
- }
22227
-
22228
- return _typeof(obj);
22229
- }
22230
-
22231
- function _toArray(arr) {
22232
- return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
22233
- }
22234
-
22235
- function _arrayWithHoles(arr) {
22236
- if (Array.isArray(arr)) return arr;
22237
- }
22238
-
22239
- function _iterableToArray(iter) {
22240
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
22241
- }
22242
-
22243
- function _unsupportedIterableToArray(o, minLen) {
22244
- if (!o) return;
22245
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
22246
- var n = Object.prototype.toString.call(o).slice(8, -1);
22247
- if (n === "Object" && o.constructor) n = o.constructor.name;
22248
- if (n === "Map" || n === "Set") return Array.from(o);
22249
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
22250
- }
22251
-
22252
- function _arrayLikeToArray(arr, len) {
22253
- if (len == null || len > arr.length) len = arr.length;
22254
-
22255
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
22256
-
22257
- return arr2;
22258
- }
22259
-
22260
- function _nonIterableRest() {
22261
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22262
- }
22263
-
22264
- /**
22265
- * Static methods for Dinero.
22266
- * @ignore
22267
- *
22268
- * @type {Object}
22269
- */
22270
- var Static = {
22271
- /**
22272
- * Returns an array of Dinero objects, normalized to the same precision (the highest).
22273
- *
22274
- * @memberof module:Dinero
22275
- * @method
22276
- *
22277
- * @param {Dinero[]} objects - An array of Dinero objects
22278
- *
22279
- * @example
22280
- * // returns an array of Dinero objects
22281
- * // both with a precision of 3
22282
- * // and an amount of 1000
22283
- * Dinero.normalizePrecision([
22284
- * Dinero({ amount: 100, precision: 2 }),
22285
- * Dinero({ amount: 1000, precision: 3 })
22286
- * ])
22287
- *
22288
- * @return {Dinero[]}
22289
- */
22290
- normalizePrecision: function normalizePrecision(objects) {
22291
- var highestPrecision = objects.reduce(function (a, b) {
22292
- return Math.max(a.getPrecision(), b.getPrecision());
22293
- });
22294
- return objects.map(function (object) {
22295
- return object.getPrecision() !== highestPrecision ? object.convertPrecision(highestPrecision) : object;
22296
- });
22297
- },
22298
-
22299
- /**
22300
- * Returns the smallest Dinero object from an array of Dinero objects
22301
- *
22302
- * @memberof module:Dinero
22303
- * @method
22304
- *
22305
- * @param {Dinero[]} objects - An array of Dinero objects
22306
- *
22307
- * @example
22308
- * // returns the smallest Dinero object with amount of 500 from an array of Dinero objects with different precisions
22309
- * Dinero.minimum([
22310
- * Dinero({ amount: 500, precision: 3 }),
22311
- * Dinero({ amount: 100, precision: 2 })
22312
- * ])
22313
- * @example
22314
- * // returns the smallest Dinero object with amount of 50 from an array of Dinero objects
22315
- * Dinero.minimum([
22316
- * Dinero({ amount: 50 }),
22317
- * Dinero({ amount: 100 })
22318
- * ])
22319
- *
22320
- * @return {Dinero[]}
22321
- */
22322
- minimum: function minimum(objects) {
22323
- var _objects = _toArray(objects),
22324
- firstObject = _objects[0],
22325
- tailObjects = _objects.slice(1);
22326
-
22327
- var currentMinimum = firstObject;
22328
- tailObjects.forEach(function (obj) {
22329
- currentMinimum = currentMinimum.lessThan(obj) ? currentMinimum : obj;
22330
- });
22331
- return currentMinimum;
22332
- },
22333
-
22334
- /**
22335
- * Returns the biggest Dinero object from an array of Dinero objects
22336
- *
22337
- * @memberof module:Dinero
22338
- * @method
22339
- *
22340
- * @param {Dinero[]} objects - An array of Dinero objects
22341
- *
22342
- * @example
22343
- * // returns the biggest Dinero object with amount of 20, from an array of Dinero objects with different precisions
22344
- * Dinero.maximum([
22345
- * Dinero({ amount: 20, precision: 2 }),
22346
- * Dinero({ amount: 150, precision: 3 })
22347
- * ])
22348
- * @example
22349
- * // returns the biggest Dinero object with amount of 100, from an array of Dinero objects
22350
- * Dinero.maximum([
22351
- * Dinero({ amount: 100 }),
22352
- * Dinero({ amount: 50 })
22353
- * ])
22354
- *
22355
- * @return {Dinero[]}
22356
- */
22357
- maximum: function maximum(objects) {
22358
- var _objects2 = _toArray(objects),
22359
- firstObject = _objects2[0],
22360
- tailObjects = _objects2.slice(1);
22361
-
22362
- var currentMaximum = firstObject;
22363
- tailObjects.forEach(function (obj) {
22364
- currentMaximum = currentMaximum.greaterThan(obj) ? currentMaximum : obj;
22365
- });
22366
- return currentMaximum;
22367
- }
22368
- };
22369
-
22370
- /**
22371
- * Returns whether a value is numeric.
22372
- * @ignore
22373
- *
22374
- * @param {} value - The value to test.
22375
- *
22376
- * @return {Boolean}
22377
- */
22378
- function isNumeric(value) {
22379
- return !isNaN(parseInt(value)) && isFinite(value);
22380
- }
22381
- /**
22382
- * Returns whether a value is a percentage.
22383
- * @ignore
22384
- *
22385
- * @param {} percentage - The percentage to test.
22386
- *
22387
- * @return {Boolean}
22388
- */
22389
-
22390
- function isPercentage(percentage) {
22391
- return isNumeric(percentage) && percentage <= 100 && percentage >= 0;
22392
- }
22393
- /**
22394
- * Returns whether an array of ratios is valid.
22395
- * @ignore
22396
- *
22397
- * @param {} ratios - The ratios to test.
22398
- *
22399
- * @return {Boolean}
22400
- */
22401
-
22402
- function areValidRatios(ratios) {
22403
- return ratios.length > 0 && ratios.every(function (ratio) {
22404
- return ratio >= 0;
22405
- }) && ratios.some(function (ratio) {
22406
- return ratio > 0;
22407
- });
22408
- }
22409
- /**
22410
- * Returns whether a value is even.
22411
- * @ignore
22412
- *
22413
- * @param {Number} value - The value to test.
22414
- *
22415
- * @return {Boolean}
22416
- */
22417
-
22418
- function isEven(value) {
22419
- return value % 2 === 0;
22420
- }
22421
- /**
22422
- * Returns whether a value is a float.
22423
- * @ignore
22424
- *
22425
- * @param {} value - The value to test.
22426
- *
22427
- * @return {Boolean}
22428
- */
22429
-
22430
- function isFloat(value) {
22431
- return isNumeric(value) && !Number.isInteger(value);
22432
- }
22433
- /**
22434
- * Returns how many fraction digits a number has.
22435
- * @ignore
22436
- *
22437
- * @param {Number} [number=0] - The number to test.
22438
- *
22439
- * @return {Number}
22440
- */
22441
-
22442
- function countFractionDigits() {
22443
- var number = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
22444
- var stringRepresentation = number.toString();
22445
-
22446
- if (stringRepresentation.indexOf('e-') > 0) {
22447
- // It's too small for a normal string representation, e.g. 1e-7 instead of 0.00000001
22448
- return parseInt(stringRepresentation.split('e-')[1]);
22449
- } else {
22450
- var fractionDigits = stringRepresentation.split('.')[1];
22451
- return fractionDigits ? fractionDigits.length : 0;
22452
- }
22453
- }
22454
- /**
22455
- * Returns whether a number is half.
22456
- * @ignore
22457
- *
22458
- * @param {Number} number - The number to test.
22459
- *
22460
- * @return {Number}
22461
- */
22462
-
22463
- function isHalf(number) {
22464
- return Math.abs(number) % 1 === 0.5;
22465
- }
22466
- /**
22467
- * Fetches a JSON resource.
22468
- * @ignore
22469
- *
22470
- * @param {String} url - The resource to fetch.
22471
- * @param {Object} [options.headers] - The headers to pass.
22472
- *
22473
- * @throws {Error} If `request.status` is lesser than 200 or greater or equal to 400.
22474
- * @throws {Error} If network fails.
22475
- *
22476
- * @return {JSON}
22477
- */
22478
-
22479
- function getJSON(url) {
22480
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22481
- return new Promise(function (resolve, reject) {
22482
- var request = Object.assign(new XMLHttpRequest(), {
22483
- onreadystatechange: function onreadystatechange() {
22484
- if (request.readyState === 4) {
22485
- if (request.status >= 200 && request.status < 400) resolve(JSON.parse(request.responseText));else reject(new Error(request.statusText));
22486
- }
22487
- },
22488
- onerror: function onerror() {
22489
- reject(new Error('Network error'));
22490
- }
22491
- });
22492
- request.open('GET', url, true);
22493
- setXHRHeaders(request, options.headers);
22494
- request.send();
22495
- });
22496
- }
22497
- /**
22498
- * Returns an XHR object with attached headers.
22499
- * @ignore
22500
- *
22501
- * @param {XMLHttpRequest} xhr - The XHR request to set headers to.
22502
- * @param {Object} headers - The headers to set.
22503
- *
22504
- * @return {XMLHttpRequest}
22505
- */
22506
-
22507
- function setXHRHeaders(xhr) {
22508
- var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22509
-
22510
- for (var header in headers) {
22511
- xhr.setRequestHeader(header, headers[header]);
22512
- }
22513
-
22514
- return xhr;
22515
- }
22516
- /**
22517
- * Returns whether a value is undefined.
22518
- * @ignore
22519
- *
22520
- * @param {} value - The value to test.
22521
- *
22522
- * @return {Boolean}
22523
- */
22524
-
22525
- function isUndefined(value) {
22526
- return typeof value === 'undefined';
22527
- }
22528
- /**
22529
- * Returns an object flattened to one level deep.
22530
- * @ignore
22531
- *
22532
- * @param {Object} object - The object to flatten.
22533
- * @param {String} separator - The separator to use between flattened nodes.
22534
- *
22535
- * @return {Object}
22536
- */
22537
-
22538
- function flattenObject(object) {
22539
- var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
22540
- var finalObject = {};
22541
- Object.entries(object).forEach(function (item) {
22542
- if (_typeof(item[1]) === 'object') {
22543
- var flatObject = flattenObject(item[1]);
22544
- Object.entries(flatObject).forEach(function (node) {
22545
- finalObject[item[0] + separator + node[0]] = node[1];
22546
- });
22547
- } else {
22548
- finalObject[item[0]] = item[1];
22549
- }
22550
- });
22551
- return finalObject;
22552
- }
22553
- /**
22554
- * Returns whether a value is thenable.
22555
- * @ignore
22556
- *
22557
- * @param {} value - The value to test.
22558
- *
22559
- * @return {Boolean}
22560
- */
22561
-
22562
- function isThenable(value) {
22563
- return Boolean(value) && (_typeof(value) === 'object' || typeof value === 'function') && typeof value.then === 'function';
22564
- }
22565
-
22566
- function Calculator() {
22567
- var floatMultiply = function floatMultiply(a, b) {
22568
- var getFactor = function getFactor(number) {
22569
- return Math.pow(10, countFractionDigits(number));
22570
- };
22571
-
22572
- var factor = Math.max(getFactor(a), getFactor(b));
22573
- return Math.round(a * factor) * Math.round(b * factor) / (factor * factor);
22574
- };
22575
-
22576
- var roundingModes = {
22577
- HALF_ODD: function HALF_ODD(number) {
22578
- var rounded = Math.round(number);
22579
- return isHalf(number) ? isEven(rounded) ? rounded - 1 : rounded : rounded;
22580
- },
22581
- HALF_EVEN: function HALF_EVEN(number) {
22582
- var rounded = Math.round(number);
22583
- return isHalf(number) ? isEven(rounded) ? rounded : rounded - 1 : rounded;
22584
- },
22585
- HALF_UP: function HALF_UP(number) {
22586
- return Math.round(number);
22587
- },
22588
- HALF_DOWN: function HALF_DOWN(number) {
22589
- return isHalf(number) ? Math.floor(number) : Math.round(number);
22590
- },
22591
- HALF_TOWARDS_ZERO: function HALF_TOWARDS_ZERO(number) {
22592
- return isHalf(number) ? Math.sign(number) * Math.floor(Math.abs(number)) : Math.round(number);
22593
- },
22594
- HALF_AWAY_FROM_ZERO: function HALF_AWAY_FROM_ZERO(number) {
22595
- return isHalf(number) ? Math.sign(number) * Math.ceil(Math.abs(number)) : Math.round(number);
22596
- },
22597
- DOWN: function DOWN(number) {
22598
- return Math.floor(number);
22599
- }
22600
- };
22601
- return {
22602
- /**
22603
- * Returns the sum of two numbers.
22604
- * @ignore
22605
- *
22606
- * @param {Number} a - The first number to add.
22607
- * @param {Number} b - The second number to add.
22608
- *
22609
- * @return {Number}
22610
- */
22611
- add: function add(a, b) {
22612
- return a + b;
22613
- },
22614
-
22615
- /**
22616
- * Returns the difference of two numbers.
22617
- * @ignore
22618
- *
22619
- * @param {Number} a - The first number to subtract.
22620
- * @param {Number} b - The second number to subtract.
22621
- *
22622
- * @return {Number}
22623
- */
22624
- subtract: function subtract(a, b) {
22625
- return a - b;
22626
- },
22627
-
22628
- /**
22629
- * Returns the product of two numbers.
22630
- * @ignore
22631
- *
22632
- * @param {Number} a - The first number to multiply.
22633
- * @param {Number} b - The second number to multiply.
22634
- *
22635
- * @return {Number}
22636
- */
22637
- multiply: function multiply(a, b) {
22638
- return isFloat(a) || isFloat(b) ? floatMultiply(a, b) : a * b;
22639
- },
22640
-
22641
- /**
22642
- * Returns the quotient of two numbers.
22643
- * @ignore
22644
- *
22645
- * @param {Number} a - The first number to divide.
22646
- * @param {Number} b - The second number to divide.
22647
- *
22648
- * @return {Number}
22649
- */
22650
- divide: function divide(a, b) {
22651
- return a / b;
22652
- },
22653
-
22654
- /**
22655
- * Returns the remainder of two numbers.
22656
- * @ignore
22657
- *
22658
- * @param {Number} a - The first number to divide.
22659
- * @param {Number} b - The second number to divide.
22660
- *
22661
- * @return {Number}
22662
- */
22663
- modulo: function modulo(a, b) {
22664
- return a % b;
22665
- },
22666
-
22667
- /**
22668
- * Returns a rounded number based off a specific rounding mode.
22669
- * @ignore
22670
- *
22671
- * @param {Number} number - The number to round.
22672
- * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use.
22673
- *
22674
- * @returns {Number}
22675
- */
22676
- round: function round(number) {
22677
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'HALF_EVEN';
22678
- return roundingModes[roundingMode](number);
22679
- }
22680
- };
22681
- }
22682
-
22683
- var calculator = Calculator();
22684
- function Format(format) {
22685
- var matches = /^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(format);
22686
- return {
22687
- /**
22688
- * Returns the matches.
22689
- * @ignore
22690
- *
22691
- * @return {Array}
22692
- */
22693
- getMatches: function getMatches() {
22694
- return matches !== null ? matches.slice(1).filter(function (match) {
22695
- return !isUndefined(match);
22696
- }) : [];
22697
- },
22698
-
22699
- /**
22700
- * Returns the amount of fraction digits to display.
22701
- * @ignore
22702
- *
22703
- * @return {Number}
22704
- */
22705
- getMinimumFractionDigits: function getMinimumFractionDigits() {
22706
- var decimalPosition = function decimalPosition(match) {
22707
- return match === '.';
22708
- };
22709
-
22710
- return !isUndefined(this.getMatches().find(decimalPosition)) ? this.getMatches()[calculator.add(this.getMatches().findIndex(decimalPosition), 1)].split('').length : 0;
22711
- },
22712
-
22713
- /**
22714
- * Returns the currency display mode.
22715
- * @ignore
22716
- *
22717
- * @return {String}
22718
- */
22719
- getCurrencyDisplay: function getCurrencyDisplay() {
22720
- var modes = {
22721
- USD: 'code',
22722
- dollar: 'name',
22723
- $: 'symbol'
22724
- };
22725
- return modes[this.getMatches().find(function (match) {
22726
- return match === 'USD' || match === 'dollar' || match === '$';
22727
- })];
22728
- },
22729
-
22730
- /**
22731
- * Returns the formatting style.
22732
- * @ignore
22733
- *
22734
- * @return {String}
22735
- */
22736
- getStyle: function getStyle() {
22737
- return !isUndefined(this.getCurrencyDisplay(this.getMatches())) ? 'currency' : 'decimal';
22738
- },
22739
-
22740
- /**
22741
- * Returns whether grouping should be used or not.
22742
- * @ignore
22743
- *
22744
- * @return {Boolean}
22745
- */
22746
- getUseGrouping: function getUseGrouping() {
22747
- return !isUndefined(this.getMatches().find(function (match) {
22748
- return match === ',';
22749
- }));
22750
- }
22751
- };
22752
- }
22753
-
22754
- function CurrencyConverter(options) {
22755
- /* istanbul ignore next */
22756
- var mergeTags = function mergeTags() {
22757
- var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
22758
- var tags = arguments.length > 1 ? arguments[1] : undefined;
22759
-
22760
- for (var tag in tags) {
22761
- string = string.replace("{{".concat(tag, "}}"), tags[tag]);
22762
- }
22763
-
22764
- return string;
22765
- };
22766
- /* istanbul ignore next */
22767
-
22768
-
22769
- var getRatesFromRestApi = function getRatesFromRestApi(from, to) {
22770
- return getJSON(mergeTags(options.endpoint, {
22771
- from: from,
22772
- to: to
22773
- }), {
22774
- headers: options.headers
22775
- });
22776
- };
22777
-
22778
- return {
22779
- /**
22780
- * Returns the exchange rate.
22781
- * @ignore
22782
- *
22783
- * @param {String} from - The base currency.
22784
- * @param {String} to - The destination currency.
22785
- *
22786
- * @return {Promise}
22787
- */
22788
- getExchangeRate: function getExchangeRate(from, to) {
22789
- return (isThenable(options.endpoint) ? options.endpoint : getRatesFromRestApi(from, to)).then(function (data) {
22790
- return flattenObject(data)[mergeTags(options.propertyPath, {
22791
- from: from,
22792
- to: to
22793
- })];
22794
- });
22795
- }
22796
- };
22797
- }
22798
-
22799
- /**
22800
- * Performs an assertion.
22801
- * @ignore
22802
- *
22803
- * @param {Boolean} condition - The expression to assert.
22804
- * @param {String} errorMessage - The message to throw if the assertion fails
22805
- * @param {ErrorConstructor} [ErrorType=Error] - The error to throw if the assertion fails.
22806
- *
22807
- * @throws {Error} If `condition` returns `false`.
22808
- */
22809
-
22810
- function assert(condition, errorMessage) {
22811
- var ErrorType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Error;
22812
- if (!condition) throw new ErrorType(errorMessage);
22813
- }
22814
- /**
22815
- * Asserts a value is a percentage.
22816
- * @ignore
22817
- *
22818
- * @param {} percentage - The percentage to test.
22819
- *
22820
- * @throws {RangeError} If `percentage` is out of range.
22821
- */
22822
-
22823
- function assertPercentage(percentage) {
22824
- assert(isPercentage(percentage), 'You must provide a numeric value between 0 and 100.', RangeError);
22825
- }
22826
- /**
22827
- * Asserts an array of ratios is valid.
22828
- * @ignore
22829
- *
22830
- * @param {} ratios - The ratios to test.
22831
- *
22832
- * @throws {TypeError} If `ratios` are invalid.
22833
- */
22834
-
22835
- function assertValidRatios(ratios) {
22836
- assert(areValidRatios(ratios), 'You must provide a non-empty array of numeric values greater than 0.', TypeError);
22837
- }
22838
- /**
22839
- * Asserts a value is an integer.
22840
- * @ignore
22841
- *
22842
- * @param {} number - The value to test.
22843
- *
22844
- * @throws {TypeError}
22845
- */
22846
-
22847
- function assertInteger(number) {
22848
- assert(Number.isInteger(number), 'You must provide an integer.', TypeError);
22849
- }
22850
-
22851
- var calculator$1 = Calculator();
22852
- /**
22853
- * A Dinero object is an immutable data structure representing a specific monetary value.
22854
- * It comes with methods for creating, parsing, manipulating, testing, transforming and formatting them.
22855
- *
22856
- * A Dinero object has:
22857
- *
22858
- * * An `amount`, expressed in minor currency units, as an integer.
22859
- * * A `currency`, expressed as an {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes ISO 4217 currency code}.
22860
- * * A `precision`, expressed as an integer, to represent the number of decimal places in the `amount`.
22861
- * This is helpful when you want to represent fractional minor currency units (e.g.: $10.4545).
22862
- * You can also use it to represent a currency with a different [exponent](https://en.wikipedia.org/wiki/ISO_4217#Treatment_of_minor_currency_units_.28the_.22exponent.22.29) than `2` (e.g.: Iraqi dinar with 1000 fils in 1 dinar (exponent of `3`), Japanese yen with no sub-units (exponent of `0`)).
22863
- * * An optional `locale` property that affects how output strings are formatted.
22864
- *
22865
- * Here's an overview of the public API:
22866
- *
22867
- * * **Access:** {@link module:Dinero~getAmount getAmount}, {@link module:Dinero~getCurrency getCurrency}, {@link module:Dinero~getLocale getLocale} and {@link module:Dinero~getPrecision getPrecision}.
22868
- * * **Manipulation:** {@link module:Dinero~add add}, {@link module:Dinero~subtract subtract}, {@link module:Dinero~multiply multiply}, {@link module:Dinero~divide divide}, {@link module:Dinero~percentage percentage}, {@link module:Dinero~allocate allocate} and {@link module:Dinero~convert convert}.
22869
- * * **Testing:** {@link module:Dinero~equalsTo equalsTo}, {@link module:Dinero~lessThan lessThan}, {@link module:Dinero~lessThanOrEqual lessThanOrEqual}, {@link module:Dinero~greaterThan greaterThan}, {@link module:Dinero~greaterThanOrEqual greaterThanOrEqual}, {@link module:Dinero~isZero isZero}, {@link module:Dinero~isPositive isPositive}, {@link module:Dinero~isNegative isNegative}, {@link module:Dinero~hasSubUnits hasSubUnits}, {@link module:Dinero~hasSameCurrency hasSameCurrency} and {@link module:Dinero~hasSameAmount hasSameAmount}.
22870
- * * **Configuration:** {@link module:Dinero~setLocale setLocale}.
22871
- * * **Conversion & formatting:** {@link module:Dinero~toFormat toFormat}, {@link module:Dinero~toUnit toUnit}, {@link module:Dinero~toRoundedUnit toRoundedUnit}, {@link module:Dinero~toObject toObject}, {@link module:Dinero~toJSON toJSON}, {@link module:Dinero~convertPrecision convertPrecision} and {@link module:Dinero.normalizePrecision normalizePrecision}.
22872
- *
22873
- * Dinero.js uses `number`s under the hood, so it's constrained by the [double-precision floating-point format](https://en.wikipedia.org/wiki/Double-precision_floating-point_format). Using values over [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number/MAX_SAFE_INTEGER) or below [`Number.MIN_SAFE_INTEGER`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number/MIN_SAFE_INTEGER) will yield unpredictable results.
22874
- * Same goes with performing calculations: once the internal `amount` value exceeds those limits, precision is no longer guaranteed.
22875
- *
22876
- * @module Dinero
22877
- * @param {Number} [options.amount=0] - The amount in minor currency units (as an integer).
22878
- * @param {String} [options.currency='USD'] - An ISO 4217 currency code.
22879
- * @param {String} [options.precision=2] - The number of decimal places to represent.
22880
- *
22881
- * @throws {TypeError} If `amount` or `precision` is invalid. Integers over [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number/MAX_SAFE_INTEGER) or below [`Number.MIN_SAFE_INTEGER`](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Number/MIN_SAFE_INTEGER) are considered valid, even though they can lead to imprecise amounts.
22882
- *
22883
- * @return {Object}
22884
- */
22885
-
22886
- var Dinero = function Dinero(options) {
22887
- var _Object$assign = Object.assign({}, {
22888
- amount: Dinero.defaultAmount,
22889
- currency: Dinero.defaultCurrency,
22890
- precision: Dinero.defaultPrecision
22891
- }, options),
22892
- amount = _Object$assign.amount,
22893
- currency = _Object$assign.currency,
22894
- precision = _Object$assign.precision;
22895
-
22896
- assertInteger(amount);
22897
- assertInteger(precision);
22898
- var globalLocale = Dinero.globalLocale,
22899
- globalFormat = Dinero.globalFormat,
22900
- globalRoundingMode = Dinero.globalRoundingMode,
22901
- globalFormatRoundingMode = Dinero.globalFormatRoundingMode;
22902
- var globalExchangeRatesApi = Object.assign({}, Dinero.globalExchangeRatesApi);
22903
- /**
22904
- * Uses ES5 function notation so `this` can be passed through call, apply and bind
22905
- * @ignore
22906
- */
22907
-
22908
- var create = function create(options) {
22909
- var obj = Object.assign({}, Object.assign({}, {
22910
- amount: amount,
22911
- currency: currency,
22912
- precision: precision
22913
- }, options), Object.assign({}, {
22914
- locale: this.locale
22915
- }, options));
22916
- return Object.assign(Dinero({
22917
- amount: obj.amount,
22918
- currency: obj.currency,
22919
- precision: obj.precision
22920
- }), {
22921
- locale: obj.locale
22922
- });
22923
- };
22924
- /**
22925
- * Uses ES5 function notation so `this` can be passed through call, apply and bind
22926
- * @ignore
22927
- */
22928
-
22929
-
22930
- var assertSameCurrency = function assertSameCurrency(comparator) {
22931
- assert(this.hasSameCurrency(comparator), 'You must provide a Dinero instance with the same currency.', TypeError);
22932
- };
22933
-
22934
- return {
22935
- /**
22936
- * Returns the amount.
22937
- *
22938
- * @example
22939
- * // returns 500
22940
- * Dinero({ amount: 500 }).getAmount()
22941
- *
22942
- * @return {Number}
22943
- */
22944
- getAmount: function getAmount() {
22945
- return amount;
22946
- },
22947
-
22948
- /**
22949
- * Returns the currency.
22950
- *
22951
- * @example
22952
- * // returns 'EUR'
22953
- * Dinero({ currency: 'EUR' }).getCurrency()
22954
- *
22955
- * @return {String}
22956
- */
22957
- getCurrency: function getCurrency() {
22958
- return currency;
22959
- },
22960
-
22961
- /**
22962
- * Returns the locale.
22963
- *
22964
- * @example
22965
- * // returns 'fr-FR'
22966
- * Dinero().setLocale('fr-FR').getLocale()
22967
- *
22968
- * @return {String}
22969
- */
22970
- getLocale: function getLocale() {
22971
- return this.locale || globalLocale;
22972
- },
22973
-
22974
- /**
22975
- * Returns a new Dinero object with an embedded locale.
22976
- *
22977
- * @param {String} newLocale - The new locale as an {@link http://tools.ietf.org/html/rfc5646 BCP 47 language tag}.
22978
- *
22979
- * @example
22980
- * // Returns a Dinero object with locale 'ja-JP'
22981
- * Dinero().setLocale('ja-JP')
22982
- *
22983
- * @return {Dinero}
22984
- */
22985
- setLocale: function setLocale(newLocale) {
22986
- return create.call(this, {
22987
- locale: newLocale
22988
- });
22989
- },
22990
-
22991
- /**
22992
- * Returns the precision.
22993
- *
22994
- * @example
22995
- * // returns 3
22996
- * Dinero({ precision: 3 }).getPrecision()
22997
- *
22998
- * @return {Number}
22999
- */
23000
- getPrecision: function getPrecision() {
23001
- return precision;
23002
- },
23003
-
23004
- /**
23005
- * Returns a new Dinero object with a new precision and a converted amount.
23006
- *
23007
- * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
23008
- * This can be necessary when you need to convert objects to a smaller precision.
23009
- *
23010
- * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent conversions for safer results.
23011
- * You can also specify a different `roundingMode` to better fit your needs.
23012
- *
23013
- * @param {Number} newPrecision - The new precision.
23014
- * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23015
- *
23016
- * @example
23017
- * // Returns a Dinero object with precision 3 and amount 1000
23018
- * Dinero({ amount: 100, precision: 2 }).convertPrecision(3)
23019
- *
23020
- * @throws {TypeError} If `newPrecision` is invalid.
23021
- *
23022
- * @return {Dinero}
23023
- */
23024
- convertPrecision: function convertPrecision(newPrecision) {
23025
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalFormatRoundingMode;
23026
- assertInteger(newPrecision);
23027
- var precision = this.getPrecision();
23028
- var isNewPrecisionLarger = newPrecision > precision;
23029
- var operation = isNewPrecisionLarger ? calculator$1.multiply : calculator$1.divide;
23030
- var terms = isNewPrecisionLarger ? [newPrecision, precision] : [precision, newPrecision];
23031
- var factor = Math.pow(10, calculator$1.subtract.apply(calculator$1, terms));
23032
- return create.call(this, {
23033
- amount: calculator$1.round(operation(this.getAmount(), factor), roundingMode),
23034
- precision: newPrecision
23035
- });
23036
- },
23037
-
23038
- /**
23039
- * Returns a new Dinero object that represents the sum of this and an other Dinero object.
23040
- *
23041
- * If Dinero objects have a different `precision`, they will be first converted to the highest.
23042
- *
23043
- * @param {Dinero} addend - The Dinero object to add.
23044
- *
23045
- * @example
23046
- * // returns a Dinero object with amount 600
23047
- * Dinero({ amount: 400 }).add(Dinero({ amount: 200 }))
23048
- * @example
23049
- * // returns a Dinero object with amount 144545 and precision 4
23050
- * Dinero({ amount: 400 }).add(Dinero({ amount: 104545, precision: 4 }))
23051
- *
23052
- * @throws {TypeError} If `addend` has a different currency.
23053
- *
23054
- * @return {Dinero}
23055
- */
23056
- add: function add(addend) {
23057
- assertSameCurrency.call(this, addend);
23058
- var addends = Dinero.normalizePrecision([this, addend]);
23059
- return create.call(this, {
23060
- amount: calculator$1.add(addends[0].getAmount(), addends[1].getAmount()),
23061
- precision: addends[0].getPrecision()
23062
- });
23063
- },
23064
-
23065
- /**
23066
- * Returns a new Dinero object that represents the difference of this and an other Dinero object.
23067
- *
23068
- * If Dinero objects have a different `precision`, they will be first converted to the highest.
23069
- *
23070
- * @param {Dinero} subtrahend - The Dinero object to subtract.
23071
- *
23072
- * @example
23073
- * // returns a Dinero object with amount 200
23074
- * Dinero({ amount: 400 }).subtract(Dinero({ amount: 200 }))
23075
- * @example
23076
- * // returns a Dinero object with amount 64545 and precision 4
23077
- * Dinero({ amount: 104545, precision: 4 }).subtract(Dinero({ amount: 400 }))
23078
- *
23079
- * @throws {TypeError} If `subtrahend` has a different currency.
23080
- *
23081
- * @return {Dinero}
23082
- */
23083
- subtract: function subtract(subtrahend) {
23084
- assertSameCurrency.call(this, subtrahend);
23085
- var subtrahends = Dinero.normalizePrecision([this, subtrahend]);
23086
- return create.call(this, {
23087
- amount: calculator$1.subtract(subtrahends[0].getAmount(), subtrahends[1].getAmount()),
23088
- precision: subtrahends[0].getPrecision()
23089
- });
23090
- },
23091
-
23092
- /**
23093
- * Returns a new Dinero object that represents the multiplied value by the given factor.
23094
- *
23095
- * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
23096
- *
23097
- * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent calculations for safer results.
23098
- * You can also specify a different `roundingMode` to better fit your needs.
23099
- *
23100
- * @param {Number} multiplier - The factor to multiply by.
23101
- * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23102
- *
23103
- * @example
23104
- * // returns a Dinero object with amount 1600
23105
- * Dinero({ amount: 400 }).multiply(4)
23106
- * @example
23107
- * // returns a Dinero object with amount 800
23108
- * Dinero({ amount: 400 }).multiply(2.001)
23109
- * @example
23110
- * // returns a Dinero object with amount 801
23111
- * Dinero({ amount: 400 }).multiply(2.00125, 'HALF_UP')
23112
- *
23113
- * @return {Dinero}
23114
- */
23115
- multiply: function multiply(multiplier) {
23116
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalRoundingMode;
23117
- return create.call(this, {
23118
- amount: calculator$1.round(calculator$1.multiply(this.getAmount(), multiplier), roundingMode)
23119
- });
23120
- },
23121
-
23122
- /**
23123
- * Returns a new Dinero object that represents the divided value by the given factor.
23124
- *
23125
- * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
23126
- *
23127
- * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent calculations for safer results.
23128
- * You can also specify a different `roundingMode` to better fit your needs.
23129
- *
23130
- * As rounding is applied, precision may be lost in the process. If you want to accurately split a Dinero object, use {@link module:Dinero~allocate allocate} instead.
23131
- *
23132
- * @param {Number} divisor - The factor to divide by.
23133
- * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23134
- *
23135
- * @example
23136
- * // returns a Dinero object with amount 100
23137
- * Dinero({ amount: 400 }).divide(4)
23138
- * @example
23139
- * // returns a Dinero object with amount 52
23140
- * Dinero({ amount: 105 }).divide(2)
23141
- * @example
23142
- * // returns a Dinero object with amount 53
23143
- * Dinero({ amount: 105 }).divide(2, 'HALF_UP')
23144
- *
23145
- * @return {Dinero}
23146
- */
23147
- divide: function divide(divisor) {
23148
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalRoundingMode;
23149
- return create.call(this, {
23150
- amount: calculator$1.round(calculator$1.divide(this.getAmount(), divisor), roundingMode)
23151
- });
23152
- },
23153
-
23154
- /**
23155
- * Returns a new Dinero object that represents a percentage of this.
23156
- *
23157
- * As rounding is applied, precision may be lost in the process. If you want to accurately split a Dinero object, use {@link module:Dinero~allocate allocate} instead.
23158
- *
23159
- * @param {Number} percentage - The percentage to extract (between 0 and 100).
23160
- * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23161
- *
23162
- * @example
23163
- * // returns a Dinero object with amount 5000
23164
- * Dinero({ amount: 10000 }).percentage(50)
23165
- * @example
23166
- * // returns a Dinero object with amount 29
23167
- * Dinero({ amount: 57 }).percentage(50, "HALF_ODD")
23168
- *
23169
- * @throws {RangeError} If `percentage` is out of range.
23170
- *
23171
- * @return {Dinero}
23172
- */
23173
- percentage: function percentage(_percentage) {
23174
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalRoundingMode;
23175
- assertPercentage(_percentage);
23176
- return this.multiply(calculator$1.divide(_percentage, 100), roundingMode);
23177
- },
23178
-
23179
- /**
23180
- * Allocates the amount of a Dinero object according to a list of ratios.
23181
- *
23182
- * Sometimes you need to split monetary values but percentages can't cut it without adding or losing pennies.
23183
- * A good example is invoicing: let's say you need to bill $1,000.03 and you want a 50% downpayment.
23184
- * If you use {@link module:Dinero~percentage percentage}, you'll get an accurate Dinero object but the amount won't be billable: you can't split a penny.
23185
- * If you round it, you'll bill a penny extra.
23186
- * With {@link module:Dinero~allocate allocate}, you can split a monetary amount then distribute the remainder as evenly as possible.
23187
- *
23188
- * You can use percentage style or ratio style for `ratios`: `[25, 75]` and `[1, 3]` will do the same thing.
23189
- *
23190
- * Since v1.8.0, you can use zero ratios (such as [0, 50, 50]). If there's a remainder to distribute, zero ratios are skipped and return a Dinero object with amount zero.
23191
- *
23192
- * @param {Number[]} ratios - The ratios to allocate the money to.
23193
- *
23194
- * @example
23195
- * // returns an array of two Dinero objects
23196
- * // the first one with an amount of 502
23197
- * // the second one with an amount of 501
23198
- * Dinero({ amount: 1003 }).allocate([50, 50])
23199
- * @example
23200
- * // returns an array of two Dinero objects
23201
- * // the first one with an amount of 25
23202
- * // the second one with an amount of 75
23203
- * Dinero({ amount: 100 }).allocate([1, 3])
23204
- * @example
23205
- * // since version 1.8.0
23206
- * // returns an array of three Dinero objects
23207
- * // the first one with an amount of 0
23208
- * // the second one with an amount of 502
23209
- * // the third one with an amount of 501
23210
- * Dinero({ amount: 1003 }).allocate([0, 50, 50])
23211
- *
23212
- * @throws {TypeError} If ratios are invalid.
23213
- *
23214
- * @return {Dinero[]}
23215
- */
23216
- allocate: function allocate(ratios) {
23217
- var _this = this;
23218
-
23219
- assertValidRatios(ratios);
23220
- var total = ratios.reduce(function (a, b) {
23221
- return calculator$1.add(a, b);
23222
- });
23223
- var remainder = this.getAmount();
23224
- var shares = ratios.map(function (ratio) {
23225
- var share = Math.floor(calculator$1.divide(calculator$1.multiply(_this.getAmount(), ratio), total));
23226
- remainder = calculator$1.subtract(remainder, share);
23227
- return create.call(_this, {
23228
- amount: share
23229
- });
23230
- });
23231
- var i = 0;
23232
-
23233
- while (remainder > 0) {
23234
- if (ratios[i] > 0) {
23235
- shares[i] = shares[i].add(create.call(this, {
23236
- amount: 1
23237
- }));
23238
- remainder = calculator$1.subtract(remainder, 1);
23239
- }
23240
-
23241
- i += 1;
23242
- }
23243
-
23244
- return shares;
23245
- },
23246
-
23247
- /**
23248
- * Returns a Promise containing a new Dinero object converted to another currency.
23249
- *
23250
- * You have two options to provide the exchange rates:
23251
- *
23252
- * 1. **Use an exchange rate REST API, and let Dinero handle the fetching and conversion.**
23253
- * This is a simple option if you have access to an exchange rate REST API and want Dinero to do the rest.
23254
- * 2. **Fetch the exchange rates on your own and provide them directly.**
23255
- * This is useful if you're fetching your rates from somewhere else (a file, a database), use a different protocol or query language than REST (SOAP, GraphQL) or want to fetch rates once and cache them instead of making new requests every time.
23256
- *
23257
- * **If you want to use a REST API**, you must provide a third-party endpoint yourself. Dinero doesn't come bundled with an exchange rates endpoint.
23258
- *
23259
- * Here are some exchange rate APIs you can use:
23260
- *
23261
- * * [Fixer](https://fixer.io)
23262
- * * [Open Exchange Rates](https://openexchangerates.org)
23263
- * * [Coinbase](https://api.coinbase.com/v2/exchange-rates)
23264
- * * More [foreign](https://github.com/toddmotto/public-apis#currency-exchange) and [crypto](https://github.com/toddmotto/public-apis#cryptocurrency) exchange rate APIs.
23265
- *
23266
- * **If you want to fetch your own rates and provide them directly**, you need to pass a promise that resolves to the exchanges rates.
23267
- *
23268
- * In both cases, you need to specify at least:
23269
- *
23270
- * * a **destination currency**: the currency in which you want to convert your Dinero object. You can specify it with `currency`.
23271
- * * an **endpoint**: the API URL to query exchange rates, with parameters, or a promise that resolves to the exchange rates. You can specify it with `options.endpoint`.
23272
- * * a **property path**: the path to access the wanted rate in your API's JSON response (or the custom promise's payload). For example, with a response of:
23273
- * ```json
23274
- * {
23275
- * "data": {
23276
- * "base": "USD",
23277
- * "destination": "EUR",
23278
- * "rate": "0.827728919"
23279
- * }
23280
- * }
23281
- * ```
23282
- * Then the property path is `'data.rate'`. You can specify it with `options.propertyPath`.
23283
- *
23284
- * The base currency (the one of your Dinero object) and the destination currency can be used as "merge tags" with the mustache syntax, respectively `{{from}}` and `{{to}}`.
23285
- * You can use these tags to refer to these values in `options.endpoint` and `options.propertyPath`.
23286
- *
23287
- * For example, if you need to specify the base currency as a query parameter, you can do the following:
23288
- *
23289
- * ```js
23290
- * {
23291
- * endpoint: 'https://yourexchangerates.api/latest?base={{from}}'
23292
- * }
23293
- * ```
23294
- *
23295
- * @param {String} currency - The destination currency, expressed as an {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes ISO 4217 currency code}.
23296
- * @param {(String|Promise)} options.endpoint - The API endpoint to retrieve exchange rates. You can substitute this with a promise that resolves to the exchanges rates if you already have them.
23297
- * @param {String} [options.propertyPath='rates.{{to}}'] - The property path to the rate.
23298
- * @param {Object} [options.headers] - The HTTP headers to provide, if needed.
23299
- * @param {String} [options.roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23300
- *
23301
- * @example
23302
- * // your global API parameters
23303
- * Dinero.globalExchangeRatesApi = { ... }
23304
- *
23305
- * // returns a Promise containing a Dinero object with the destination currency
23306
- * // and the initial amount converted to the new currency.
23307
- * Dinero({ amount: 500 }).convert('EUR')
23308
- * @example
23309
- * // returns a Promise containing a Dinero object,
23310
- * // with specific API parameters and rounding mode for this specific instance.
23311
- * Dinero({ amount: 500 })
23312
- * .convert('XBT', {
23313
- * endpoint: 'https://yourexchangerates.api/latest?base={{from}}',
23314
- * propertyPath: 'data.rates.{{to}}',
23315
- * headers: {
23316
- * 'user-key': 'xxxxxxxxx'
23317
- * },
23318
- * roundingMode: 'HALF_UP'
23319
- * })
23320
- * @example
23321
- * // usage with exchange rates provided as a custom promise
23322
- * // using the default `propertyPath` format (so it doesn't have to be specified)
23323
- * const rates = {
23324
- * rates: {
23325
- * EUR: 0.81162
23326
- * }
23327
- * }
23328
- *
23329
- * Dinero({ amount: 500 })
23330
- * .convert('EUR', {
23331
- * endpoint: new Promise(resolve => resolve(rates))
23332
- * })
23333
- * @example
23334
- * // usage with Promise.prototype.then and Promise.prototype.catch
23335
- * Dinero({ amount: 500 })
23336
- * .convert('EUR')
23337
- * .then(dinero => {
23338
- * dinero.getCurrency() // returns 'EUR'
23339
- * })
23340
- * .catch(err => {
23341
- * // handle errors
23342
- * })
23343
- * @example
23344
- * // usage with async/await
23345
- * (async () => {
23346
- * const price = await Dinero({ amount: 500 }).convert('EUR')
23347
- * price.getCurrency() // returns 'EUR'
23348
- * })()
23349
- *
23350
- * @return {Promise}
23351
- */
23352
- convert: function convert(currency) {
23353
- var _this2 = this;
23354
-
23355
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
23356
- _ref$endpoint = _ref.endpoint,
23357
- endpoint = _ref$endpoint === void 0 ? globalExchangeRatesApi.endpoint : _ref$endpoint,
23358
- _ref$propertyPath = _ref.propertyPath,
23359
- propertyPath = _ref$propertyPath === void 0 ? globalExchangeRatesApi.propertyPath || 'rates.{{to}}' : _ref$propertyPath,
23360
- _ref$headers = _ref.headers,
23361
- headers = _ref$headers === void 0 ? globalExchangeRatesApi.headers : _ref$headers,
23362
- _ref$roundingMode = _ref.roundingMode,
23363
- roundingMode = _ref$roundingMode === void 0 ? globalRoundingMode : _ref$roundingMode;
23364
-
23365
- var options = Object.assign({}, {
23366
- endpoint: endpoint,
23367
- propertyPath: propertyPath,
23368
- headers: headers,
23369
- roundingMode: roundingMode
23370
- });
23371
- return CurrencyConverter(options).getExchangeRate(this.getCurrency(), currency).then(function (rate) {
23372
- assert(!isUndefined(rate), "No rate was found for the destination currency \"".concat(currency, "\"."), TypeError);
23373
- return create.call(_this2, {
23374
- amount: calculator$1.round(calculator$1.multiply(_this2.getAmount(), parseFloat(rate)), options.roundingMode),
23375
- currency: currency
23376
- });
23377
- });
23378
- },
23379
-
23380
- /**
23381
- * Checks whether the value represented by this object equals to the other.
23382
- *
23383
- * @param {Dinero} comparator - The Dinero object to compare to.
23384
- *
23385
- * @example
23386
- * // returns true
23387
- * Dinero({ amount: 500, currency: 'EUR' }).equalsTo(Dinero({ amount: 500, currency: 'EUR' }))
23388
- * @example
23389
- * // returns false
23390
- * Dinero({ amount: 500, currency: 'EUR' }).equalsTo(Dinero({ amount: 800, currency: 'EUR' }))
23391
- * @example
23392
- * // returns false
23393
- * Dinero({ amount: 500, currency: 'USD' }).equalsTo(Dinero({ amount: 500, currency: 'EUR' }))
23394
- * @example
23395
- * // returns false
23396
- * Dinero({ amount: 500, currency: 'USD' }).equalsTo(Dinero({ amount: 800, currency: 'EUR' }))
23397
- * @example
23398
- * // returns true
23399
- * Dinero({ amount: 1000, currency: 'EUR', precision: 2 }).equalsTo(Dinero({ amount: 10000, currency: 'EUR', precision: 3 }))
23400
- * @example
23401
- * // returns false
23402
- * Dinero({ amount: 10000, currency: 'EUR', precision: 2 }).equalsTo(Dinero({ amount: 10000, currency: 'EUR', precision: 3 }))
23403
- *
23404
- * @return {Boolean}
23405
- */
23406
- equalsTo: function equalsTo(comparator) {
23407
- return this.hasSameAmount(comparator) && this.hasSameCurrency(comparator);
23408
- },
23409
-
23410
- /**
23411
- * Checks whether the value represented by this object is less than the other.
23412
- *
23413
- * @param {Dinero} comparator - The Dinero object to compare to.
23414
- *
23415
- * @example
23416
- * // returns true
23417
- * Dinero({ amount: 500 }).lessThan(Dinero({ amount: 800 }))
23418
- * @example
23419
- * // returns false
23420
- * Dinero({ amount: 800 }).lessThan(Dinero({ amount: 500 }))
23421
- * @example
23422
- * // returns true
23423
- * Dinero({ amount: 5000, precision: 3 }).lessThan(Dinero({ amount: 800 }))
23424
- * @example
23425
- * // returns false
23426
- * Dinero({ amount: 800 }).lessThan(Dinero({ amount: 5000, precision: 3 }))
23427
- *
23428
- * @throws {TypeError} If `comparator` has a different currency.
23429
- *
23430
- * @return {Boolean}
23431
- */
23432
- lessThan: function lessThan(comparator) {
23433
- assertSameCurrency.call(this, comparator);
23434
- var comparators = Dinero.normalizePrecision([this, comparator]);
23435
- return comparators[0].getAmount() < comparators[1].getAmount();
23436
- },
23437
-
23438
- /**
23439
- * Checks whether the value represented by this object is less than or equal to the other.
23440
- *
23441
- * @param {Dinero} comparator - The Dinero object to compare to.
23442
- *
23443
- * @example
23444
- * // returns true
23445
- * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 800 }))
23446
- * @example
23447
- * // returns true
23448
- * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 500 }))
23449
- * @example
23450
- * // returns false
23451
- * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 300 }))
23452
- * @example
23453
- * // returns true
23454
- * Dinero({ amount: 5000, precision: 3 }).lessThanOrEqual(Dinero({ amount: 800 }))
23455
- * @example
23456
- * // returns true
23457
- * Dinero({ amount: 5000, precision: 3 }).lessThanOrEqual(Dinero({ amount: 500 }))
23458
- * @example
23459
- * // returns false
23460
- * Dinero({ amount: 800 }).lessThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
23461
- *
23462
- * @throws {TypeError} If `comparator` has a different currency.
23463
- *
23464
- * @return {Boolean}
23465
- */
23466
- lessThanOrEqual: function lessThanOrEqual(comparator) {
23467
- assertSameCurrency.call(this, comparator);
23468
- var comparators = Dinero.normalizePrecision([this, comparator]);
23469
- return comparators[0].getAmount() <= comparators[1].getAmount();
23470
- },
23471
-
23472
- /**
23473
- * Checks whether the value represented by this object is greater than the other.
23474
- *
23475
- * @param {Dinero} comparator - The Dinero object to compare to.
23476
- *
23477
- * @example
23478
- * // returns false
23479
- * Dinero({ amount: 500 }).greaterThan(Dinero({ amount: 800 }))
23480
- * @example
23481
- * // returns true
23482
- * Dinero({ amount: 800 }).greaterThan(Dinero({ amount: 500 }))
23483
- * @example
23484
- * // returns true
23485
- * Dinero({ amount: 800 }).greaterThan(Dinero({ amount: 5000, precision: 3 }))
23486
- * @example
23487
- * // returns false
23488
- * Dinero({ amount: 5000, precision: 3 }).greaterThan(Dinero({ amount: 800 }))
23489
- *
23490
- * @throws {TypeError} If `comparator` has a different currency.
23491
- *
23492
- * @return {Boolean}
23493
- */
23494
- greaterThan: function greaterThan(comparator) {
23495
- assertSameCurrency.call(this, comparator);
23496
- var comparators = Dinero.normalizePrecision([this, comparator]);
23497
- return comparators[0].getAmount() > comparators[1].getAmount();
23498
- },
23499
-
23500
- /**
23501
- * Checks whether the value represented by this object is greater than or equal to the other.
23502
- *
23503
- * @param {Dinero} comparator - The Dinero object to compare to.
23504
- *
23505
- * @example
23506
- * // returns true
23507
- * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 300 }))
23508
- * @example
23509
- * // returns true
23510
- * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 500 }))
23511
- * @example
23512
- * // returns false
23513
- * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 800 }))
23514
- * @example
23515
- * // returns true
23516
- * Dinero({ amount: 800 }).greaterThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
23517
- * @example
23518
- * // returns true
23519
- * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
23520
- * @example
23521
- * // returns false
23522
- * Dinero({ amount: 5000, precision: 3 }).greaterThanOrEqual(Dinero({ amount: 800 }))
23523
- *
23524
- * @throws {TypeError} If `comparator` has a different currency.
23525
- *
23526
- * @return {Boolean}
23527
- */
23528
- greaterThanOrEqual: function greaterThanOrEqual(comparator) {
23529
- assertSameCurrency.call(this, comparator);
23530
- var comparators = Dinero.normalizePrecision([this, comparator]);
23531
- return comparators[0].getAmount() >= comparators[1].getAmount();
23532
- },
23533
-
23534
- /**
23535
- * Checks if the value represented by this object is zero.
23536
- *
23537
- * @example
23538
- * // returns true
23539
- * Dinero({ amount: 0 }).isZero()
23540
- * @example
23541
- * // returns false
23542
- * Dinero({ amount: 100 }).isZero()
23543
- *
23544
- * @return {Boolean}
23545
- */
23546
- isZero: function isZero() {
23547
- return this.getAmount() === 0;
23548
- },
23549
-
23550
- /**
23551
- * Checks if the value represented by this object is positive.
23552
- *
23553
- * @example
23554
- * // returns false
23555
- * Dinero({ amount: -10 }).isPositive()
23556
- * @example
23557
- * // returns true
23558
- * Dinero({ amount: 10 }).isPositive()
23559
- * @example
23560
- * // returns true
23561
- * Dinero({ amount: 0 }).isPositive()
23562
- *
23563
- * @return {Boolean}
23564
- */
23565
- isPositive: function isPositive() {
23566
- return this.getAmount() >= 0;
23567
- },
23568
-
23569
- /**
23570
- * Checks if the value represented by this object is negative.
23571
- *
23572
- * @example
23573
- * // returns true
23574
- * Dinero({ amount: -10 }).isNegative()
23575
- * @example
23576
- * // returns false
23577
- * Dinero({ amount: 10 }).isNegative()
23578
- * @example
23579
- * // returns false
23580
- * Dinero({ amount: 0 }).isNegative()
23581
- *
23582
- * @return {Boolean}
23583
- */
23584
- isNegative: function isNegative() {
23585
- return this.getAmount() < 0;
23586
- },
23587
-
23588
- /**
23589
- * Checks if this has minor currency units.
23590
- * Deprecates {@link module:Dinero~hasCents hasCents}.
23591
- *
23592
- * @example
23593
- * // returns false
23594
- * Dinero({ amount: 1100 }).hasSubUnits()
23595
- * @example
23596
- * // returns true
23597
- * Dinero({ amount: 1150 }).hasSubUnits()
23598
- *
23599
- * @return {Boolean}
23600
- */
23601
- hasSubUnits: function hasSubUnits() {
23602
- return calculator$1.modulo(this.getAmount(), Math.pow(10, precision)) !== 0;
23603
- },
23604
-
23605
- /**
23606
- * Checks if this has minor currency units.
23607
- *
23608
- * @deprecated since version 1.4.0, will be removed in 2.0.0
23609
- * Use {@link module:Dinero~hasSubUnits hasSubUnits} instead.
23610
- *
23611
- * @example
23612
- * // returns false
23613
- * Dinero({ amount: 1100 }).hasCents()
23614
- * @example
23615
- * // returns true
23616
- * Dinero({ amount: 1150 }).hasCents()
23617
- *
23618
- * @return {Boolean}
23619
- */
23620
- hasCents: function hasCents() {
23621
- return calculator$1.modulo(this.getAmount(), Math.pow(10, precision)) !== 0;
23622
- },
23623
-
23624
- /**
23625
- * Checks whether the currency represented by this object equals to the other.
23626
- *
23627
- * @param {Dinero} comparator - The Dinero object to compare to.
23628
- *
23629
- * @example
23630
- * // returns true
23631
- * Dinero({ amount: 2000, currency: 'EUR' }).hasSameCurrency(Dinero({ amount: 1000, currency: 'EUR' }))
23632
- * @example
23633
- * // returns false
23634
- * Dinero({ amount: 1000, currency: 'EUR' }).hasSameCurrency(Dinero({ amount: 1000, currency: 'USD' }))
23635
- *
23636
- * @return {Boolean}
23637
- */
23638
- hasSameCurrency: function hasSameCurrency(comparator) {
23639
- return this.getCurrency() === comparator.getCurrency();
23640
- },
23641
-
23642
- /**
23643
- * Checks whether the amount represented by this object equals to the other.
23644
- *
23645
- * @param {Dinero} comparator - The Dinero object to compare to.
23646
- *
23647
- * @example
23648
- * // returns true
23649
- * Dinero({ amount: 1000, currency: 'EUR' }).hasSameAmount(Dinero({ amount: 1000 }))
23650
- * @example
23651
- * // returns false
23652
- * Dinero({ amount: 2000, currency: 'EUR' }).hasSameAmount(Dinero({ amount: 1000, currency: 'EUR' }))
23653
- * @example
23654
- * // returns true
23655
- * Dinero({ amount: 1000, currency: 'EUR', precision: 2 }).hasSameAmount(Dinero({ amount: 10000, precision: 3 }))
23656
- * @example
23657
- * // returns false
23658
- * Dinero({ amount: 10000, currency: 'EUR', precision: 2 }).hasSameAmount(Dinero({ amount: 10000, precision: 3 }))
23659
- *
23660
- * @return {Boolean}
23661
- */
23662
- hasSameAmount: function hasSameAmount(comparator) {
23663
- var comparators = Dinero.normalizePrecision([this, comparator]);
23664
- return comparators[0].getAmount() === comparators[1].getAmount();
23665
- },
23666
-
23667
- /**
23668
- * Returns this object formatted as a string.
23669
- *
23670
- * The format is a mask which defines how the output string will be formatted.
23671
- * It defines whether to display a currency, in what format, how many fraction digits to display and whether to use grouping separators.
23672
- * The output is formatted according to the applying locale.
23673
- *
23674
- * Object | Format | String
23675
- * :--------------------------- | :---------------- | :---
23676
- * `Dinero({ amount: 500050 })` | `'$0,0.00'` | $5,000.50
23677
- * `Dinero({ amount: 500050 })` | `'$0,0'` | $5,001
23678
- * `Dinero({ amount: 500050 })` | `'$0'` | $5001
23679
- * `Dinero({ amount: 500050 })` | `'$0.0'` | $5000.5
23680
- * `Dinero({ amount: 500050 })` | `'USD0,0.0'` | USD5,000.5
23681
- * `Dinero({ amount: 500050 })` | `'0,0.0 dollar'` | 5,000.5 dollars
23682
- *
23683
- * Don't try to substitute the `$` sign or the `USD` code with your target currency, nor adapt the format string to the exact format you want.
23684
- * The format is a mask which defines a pattern and returns a valid, localized currency string.
23685
- * If you want to display the object in a custom way, either use {@link module:Dinero~getAmount getAmount}, {@link module:Dinero~toUnit toUnit} or {@link module:Dinero~toRoundedUnit toRoundedUnit} and manipulate the output string as you wish.
23686
- *
23687
- * {@link module:Dinero~toFormat toFormat} wraps around `Number.prototype.toLocaleString`. For that reason, **format will vary depending on how it's implemented in the end user's environment**.
23688
- *
23689
- * You can also use `toLocaleString` directly:
23690
- * `Dinero().toRoundedUnit(digits, roundingMode).toLocaleString(locale, options)`.
23691
- *
23692
- * By default, amounts are rounded using the **half away from zero** rule ([commercial rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero)).
23693
- * You can also specify a different `roundingMode` to better fit your needs.
23694
- *
23695
- * @param {String} [format='$0,0.00'] - The format mask to format to.
23696
- * @param {String} [roundingMode='HALF_AWAY_FROM_ZERO'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23697
- *
23698
- * @example
23699
- * // returns $2,000
23700
- * Dinero({ amount: 200000 }).toFormat('$0,0')
23701
- * @example
23702
- * // returns €50.5
23703
- * Dinero({ amount: 5050, currency: 'EUR' }).toFormat('$0,0.0')
23704
- * @example
23705
- * // returns 100 euros
23706
- * Dinero({ amount: 10000, currency: 'EUR' }).setLocale('fr-FR').toFormat('0,0 dollar')
23707
- * @example
23708
- * // returns 2000
23709
- * Dinero({ amount: 200000, currency: 'EUR' }).toFormat()
23710
- * @example
23711
- * // returns $10
23712
- * Dinero({ amount: 1050 }).toFormat('$0', 'HALF_EVEN')
23713
- *
23714
- * @return {String}
23715
- */
23716
- toFormat: function toFormat() {
23717
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globalFormat;
23718
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalFormatRoundingMode;
23719
- var formatter = Format(format);
23720
- return this.toRoundedUnit(formatter.getMinimumFractionDigits(), roundingMode).toLocaleString(this.getLocale(), {
23721
- currencyDisplay: formatter.getCurrencyDisplay(),
23722
- useGrouping: formatter.getUseGrouping(),
23723
- minimumFractionDigits: formatter.getMinimumFractionDigits(),
23724
- style: formatter.getStyle(),
23725
- currency: this.getCurrency()
23726
- });
23727
- },
23728
-
23729
- /**
23730
- * Returns the amount represented by this object in units.
23731
- *
23732
- * @example
23733
- * // returns 10.5
23734
- * Dinero({ amount: 1050 }).toUnit()
23735
- * @example
23736
- * // returns 10.545
23737
- * Dinero({ amount: 10545, precision: 3 }).toUnit()
23738
- *
23739
- * @return {Number}
23740
- */
23741
- toUnit: function toUnit() {
23742
- return calculator$1.divide(this.getAmount(), Math.pow(10, precision));
23743
- },
23744
-
23745
- /**
23746
- * Returns the amount represented by this object in rounded units.
23747
- *
23748
- * By default, the method uses the **half away from zero** rule ([commercial rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero)).
23749
- * You can also specify a different `roundingMode` to better fit your needs.
23750
- *
23751
- * @example
23752
- * // returns 10.6
23753
- * Dinero({ amount: 1055 }).toRoundedUnit(1)
23754
- * @example
23755
- * // returns 10
23756
- * Dinero({ amount: 1050 }).toRoundedUnit(0, 'HALF_EVEN')
23757
- *
23758
- * @param {Number} digits - The number of fraction digits to round to.
23759
- * @param {String} [roundingMode='HALF_AWAY_FROM_ZERO'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
23760
- *
23761
- * @return {Number}
23762
- */
23763
- toRoundedUnit: function toRoundedUnit(digits) {
23764
- var roundingMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalFormatRoundingMode;
23765
- var factor = Math.pow(10, digits);
23766
- return calculator$1.divide(calculator$1.round(calculator$1.multiply(this.toUnit(), factor), roundingMode), factor);
23767
- },
23768
-
23769
- /**
23770
- * Returns the object's data as an object literal.
23771
- *
23772
- * @example
23773
- * // returns { amount: 500, currency: 'EUR', precision: 2 }
23774
- * Dinero({ amount: 500, currency: 'EUR', precision: 2 }).toObject()
23775
- *
23776
- * @return {Object}
23777
- */
23778
- toObject: function toObject() {
23779
- return {
23780
- amount: amount,
23781
- currency: currency,
23782
- precision: precision
23783
- };
23784
- },
23785
-
23786
- /**
23787
- * Returns the object's data as an object literal.
23788
- *
23789
- * Alias of {@link module:Dinero~toObject toObject}.
23790
- * It is defined so that calling `JSON.stringify` on a Dinero object will automatically extract the relevant data.
23791
- *
23792
- * @example
23793
- * // returns '{"amount":500,"currency":"EUR","precision":2}'
23794
- * JSON.stringify(Dinero({ amount: 500, currency: 'EUR', precision: 2 }))
23795
- *
23796
- * @return {Object}
23797
- */
23798
- toJSON: function toJSON() {
23799
- return this.toObject();
23800
- }
23801
- };
23802
- };
23803
-
23804
- var dinero = Object.assign(Dinero, Defaults, Globals, Static);
23805
-
23806
- dinero_1 = dinero;
23807
- return dinero_1;
23808
- }
23809
-
23810
- var dineroExports = requireDinero();
23811
- var Dinero = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(dineroExports);
23812
-
23813
22145
  // Currency Formatting
23814
22146
  const formatCurrency = (amount, currency, omitSymbols = false) => {
23815
22147
  if (!amount)
23816
22148
  amount = 0;
23817
22149
  const formattedString = omitSymbols ? '0,0.00' : '$0,0.00';
23818
22150
  const formattedCurrency = currency === null || currency === void 0 ? void 0 : currency.toUpperCase();
23819
- const formattedAmount = Dinero({ amount: amount }).toFormat(formattedString);
22151
+ const formattedAmount = dinero.Dinero({ amount: amount }).toFormat(formattedString);
23820
22152
  return currency ? `${formattedAmount} ${formattedCurrency}` : formattedAmount;
23821
22153
  };
23822
22154
  // Date Formatting and Conversion
@@ -23914,11 +22246,6 @@ function snakeCaseToHumanReadable(snakeCaseStr) {
23914
22246
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
23915
22247
  .join(' ');
23916
22248
  }
23917
- function snakeToCamel(str) {
23918
- if (!str)
23919
- return '';
23920
- return str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace('-', '').replace('_', ''));
23921
- }
23922
22249
  // Object Utilities
23923
22250
  function isEmptyObject(obj) {
23924
22251
  if (obj === null) {
@@ -23987,4 +22314,3 @@ exports.isEmptyObject = isEmptyObject;
23987
22314
  exports.processHTML = processHTML;
23988
22315
  exports.removeAttribute = removeAttribute;
23989
22316
  exports.snakeCaseToHumanReadable = snakeCaseToHumanReadable;
23990
- exports.snakeToCamel = snakeToCamel;