@solvimon/solvimon-web 0.1.0-alpha.27 → 0.1.0-alpha.29

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 (500) hide show
  1. package/README.md +151 -17
  2. package/dist/{Alert.vue.es-lIiAWf2S.mjs → Alert.vue.es-CNrEaLvh.mjs} +58 -46
  3. package/dist/ApiStatus-CSFKl_ra.mjs +9 -0
  4. package/dist/AuthProvider.handle-DKfNs8rr.mjs +50 -0
  5. package/dist/{Avatar.vue.es-sfMZiX7A.mjs → Avatar.vue.es-r0NbcIib.mjs} +1 -1
  6. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DmY3a-Wi.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-Cp4yGqaw.mjs} +18 -19
  7. package/dist/{Button.vue.es-Cmjfm4jw.mjs → Button.vue.es-Zw--kuaU.mjs} +4 -4
  8. package/dist/{ChargeOnDemandModal-CB4mrvkU.mjs → ChargeOnDemandModal-B8FDkS9U.mjs} +240 -251
  9. package/dist/Checkout.entry.ce-DsGl-5aR.mjs +4202 -0
  10. package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs +828 -0
  11. package/dist/{Chip.vue.es-DksjbJO8.mjs → Chip.vue.es-D3UDSyXC.mjs} +35 -21
  12. package/dist/Comparators.vue.es-DQBI3f7m.mjs +103 -0
  13. package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +32 -0
  14. package/dist/{ContextMenu.vue.es-zRvoEJlV.mjs → ContextMenu.vue.es-B9mFpUQK.mjs} +87 -88
  15. package/dist/{CustomerBillingInformation.vue.es-DhFbpZPK.mjs → CustomerBillingInformation.vue.es-B8NiQaJs.mjs} +3 -3
  16. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-B41la-T7.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DBivC5Eb.mjs} +27 -30
  17. package/dist/CustomerShippingAddresses-Bj8Y17O8.mjs +397 -0
  18. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BmPKfIjT.mjs +2927 -0
  19. package/dist/{DividerText.vue.es-nAo1eRMV.mjs → DividerText.vue.es-CNbgif-3.mjs} +1 -1
  20. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs +55 -0
  21. package/dist/{ErrorNotification.vue.es-h-D37rfG.mjs → ErrorNotification.vue.es-DNd65mQq.mjs} +2 -2
  22. package/dist/FormMessage.vue.es-Cjv358Ab.mjs +39 -0
  23. package/dist/{IconButton.vue.es-DvfErUOq.mjs → IconButton.vue.es-C8lYFx5_.mjs} +2 -2
  24. package/dist/{IconTitle.vue.es-B_8bS0tn.mjs → IconTitle.vue.es-O2kcqgKm.mjs} +3 -3
  25. package/dist/Input.vue.es-D8Oj8MWv.mjs +250 -0
  26. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-gpMtYNzn.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-rhqYVdfV.mjs} +14 -13
  27. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-06R-M8Q3.mjs +56 -0
  28. package/dist/InvoicePreview.vue.es-4Q2hzaFS.mjs +286 -0
  29. package/dist/InvoicePricingClauseChip.vue.es-DKU0xu0t.mjs +124 -0
  30. package/dist/Label.vue.es-DtpLM1KH.mjs +113 -0
  31. package/dist/{Modal.vue.es-BeI5C9-9.mjs → Modal.vue.es-C8ZcO117.mjs} +109 -103
  32. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs +441 -0
  33. package/dist/PaymentCompletedCard.vue_vue_type_script_setup_true_lang-DfTb9psX.mjs +48 -0
  34. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DqHcOnZp.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BoGTtg5G.mjs} +70 -113
  35. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DlqoWKQq.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs} +3 -3
  36. package/dist/{PaymentHistoryBlock-mCqdFjnL.mjs → PaymentHistoryBlock-BvY2nXGV.mjs} +1 -1
  37. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DxaY3eFN.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-bQKhUonq.mjs} +24 -24
  38. package/dist/{PaymentIntegrationForm-DVx4DEtD.mjs → PaymentIntegrationForm-CcfQSzKM.mjs} +1 -1
  39. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvzcLJVq.mjs +181 -0
  40. package/dist/{PaymentIntegrationFormAdyen-Yr8p5Fly.mjs → PaymentIntegrationFormAdyen-DqgDfO6K.mjs} +422 -311
  41. package/dist/PaymentIntegrationFormStripe-BYdAkvLt.mjs +757 -0
  42. package/dist/{PaymentMethod.vue.es-4YRmQZHX.mjs → PaymentMethod.vue.es-b0p3a0L-.mjs} +7 -7
  43. package/dist/{PaymentMethodForm-Dnj_7mJU.mjs → PaymentMethodForm-BsTrTwCg.mjs} +1 -1
  44. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-DsD3UjkC.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-sUOmLORl.mjs} +57 -65
  45. package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs +169 -0
  46. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CjECKNi_.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CSW4LfmH.mjs} +13 -8
  47. package/dist/PlanCustomizationEditor-D29N4HUM.mjs +711 -0
  48. package/dist/PortalLinkUnverified-B_EE2wTJ.mjs +52 -0
  49. package/dist/PortalNotAvailable-DPE9y37H.mjs +25 -0
  50. package/dist/{PricingGroupRangeInput.vue.es-BhNcjD7z.mjs → PricingGroupRangeInput.vue.es-tIMXIhpZ.mjs} +14 -13
  51. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CmJITenR.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DqxWxSQe.mjs} +48 -48
  52. package/dist/RadioGroupExtended.vue.es-3nDXqIGi.mjs +176 -0
  53. package/dist/{Section.vue.es-DVEpre9O.mjs → Section.vue.es-CvX9tg2f.mjs} +1 -1
  54. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs +60 -0
  55. package/dist/ShippingAddressesModal-C4p1IXXk.mjs +418 -0
  56. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs +32 -0
  57. package/dist/{StepInput.vue.es-o-3Lg4Ai.mjs → StepInput.vue.es-DweyzpkL.mjs} +5 -4
  58. package/dist/{SubscriptionDetails.entry.ce-CGl6Z5ql.mjs → SubscriptionDetails.entry.ce-D5SwM0YS.mjs} +448 -460
  59. package/dist/{SubscriptionSchedules-DuWZmnD2.mjs → SubscriptionSchedules-BZqlpAtk.mjs} +1 -1
  60. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BH7DdOWK.mjs +5185 -0
  61. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs +203 -0
  62. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BsdevoeT.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BbjdBHSQ.mjs} +126 -90
  63. package/dist/TooltipParagraph.vue.es-Dw0ndjle.mjs +132 -0
  64. package/dist/TranslationOverride.vue_vue_type_script_setup_true_lang-BhjZVMSx.mjs +31 -0
  65. package/dist/{TrialChip.vue.es-Dmv3lPiQ.mjs → TrialChip.vue.es-DOopmaXA.mjs} +2 -2
  66. package/dist/addressFormats.data-dzBx49dw.mjs +278 -0
  67. package/dist/amount-CondixVt.mjs +36 -0
  68. package/dist/{api.es-QaC926Xu.mjs → api.es-qgvzNMU-.mjs} +2 -2
  69. package/dist/{cn.es-Cvt6TIwv.mjs → cn.es-B8acFrov.mjs} +385 -477
  70. package/dist/{comparators.es-D8WGL-c4.mjs → comparators.es-C8rHpb70.mjs} +17 -13
  71. package/dist/components/BillingInformation/BillingInformation.mjs +11 -10
  72. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +397 -350
  73. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +20 -19
  74. package/dist/components/Invoice/Invoice.mjs +2691 -227
  75. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +66 -62
  76. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +40 -40
  77. package/dist/components/InvoicesList/InvoicesList.mjs +20 -18
  78. package/dist/components/PaymentHistory/PaymentHistory.mjs +72 -64
  79. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +33 -31
  80. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +49 -45
  81. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +47 -31
  82. package/dist/components/WalletBalances/WalletBalances.mjs +22 -21
  83. package/dist/core/index.mjs +61 -95
  84. package/dist/customElements-BTj4ii4f.mjs +5072 -0
  85. package/dist/customer-BIjC0CWJ.mjs +31 -0
  86. package/dist/customer.es-DQKl6wFt.mjs +24 -0
  87. package/dist/{de-DE-DKp5LCu0.mjs → de-DE-DBbERiFr.mjs} +110 -18
  88. package/dist/{de-DE-jkW2dJrX.mjs → de-DE-UJ6X6jXu.mjs} +16 -10
  89. package/dist/floating-ui.vue.es-BvAf8-si.mjs +1003 -0
  90. package/dist/formControl-BZQLHnOO.mjs +749 -0
  91. package/dist/fr-FR-Cvvbkwlj.mjs +307 -0
  92. package/dist/fr-FR-IWJE-urI.mjs +431 -0
  93. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +4 -0
  94. package/dist/{index.es-CXkP_k3u.mjs → index.es-C7J3WGGo.mjs} +4 -4
  95. package/dist/index.es-CpmQmvOg.mjs +633 -0
  96. package/dist/index.mjs +2 -2
  97. package/dist/invoiceState-BJVHaKs7.mjs +14 -0
  98. package/dist/{invoices-3520M5AN.mjs → invoices-e1sKLgxg.mjs} +40 -35
  99. package/dist/{it-IT-BgFVsO5S.mjs → it-IT-B7ui2oxO.mjs} +110 -18
  100. package/dist/{it-IT-CaaFToGB.mjs → it-IT-DnJP5URH.mjs} +9 -3
  101. package/dist/{nl-NL-UiRWbO9S.mjs → nl-NL-Bafh2xoT.mjs} +116 -24
  102. package/dist/{nl-NL-D0MQKaql.mjs → nl-NL-q9xfTZF0.mjs} +12 -6
  103. package/dist/paymentMethods-B_82JGk_.mjs +77 -0
  104. package/dist/paymentMethods-Nfv9HdkS.mjs +61 -0
  105. package/dist/paymentOutcome-BXEU5-84.mjs +67 -0
  106. package/dist/payments-BnxbzQUC.mjs +68 -0
  107. package/dist/{pricing-BIMpDI_p.mjs → pricing-BOhvWWMj.mjs} +3 -3
  108. package/dist/pricingItemConfigs.es-D3pX_9AJ.mjs +78 -0
  109. package/dist/pricingPlanScheduleOverrides-Dxv5FOBd.mjs +233 -0
  110. package/dist/pricingPlanSchedules-Dv7ZCgNp.mjs +38 -0
  111. package/dist/sanitization.es-C6dbuxUJ.mjs +4 -0
  112. package/dist/screens/Checkout/Checkout.mjs +2 -2
  113. package/dist/screens/CustomerOverview/CustomerOverview.mjs +146 -94
  114. package/dist/screens/PayInvoice/PayInvoice.mjs +603 -278
  115. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +102 -88
  116. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  117. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +371 -347
  118. package/dist/sessionReference-B8Dbmx5t.mjs +38 -0
  119. package/dist/sorting.es-CVyKw23D.mjs +77 -0
  120. package/dist/subscription-BhxoqwcT.mjs +83 -0
  121. package/dist/subscriptions-BWXZGK0E.mjs +66 -0
  122. package/dist/taxId.es-DkD3Ltr8.mjs +243 -0
  123. package/dist/types/components/InvoiceTable/InvoiceTable.types.d.ts +2 -0
  124. package/dist/types/components/checkout/PromotionCodeSection.types.d.ts +2 -0
  125. package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +22 -0
  126. package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +15 -0
  127. package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +0 -2
  128. package/dist/types/components/customer/ShippingAddressForm/ShippingAddressForm.types.d.ts +9 -0
  129. package/dist/types/components/customer/ShippingAddresses/ShippingAddressCard.types.d.ts +11 -0
  130. package/dist/types/components/customer/ShippingAddresses/ShippingAddressList.types.d.ts +9 -0
  131. package/dist/types/components/customer/ShippingAddresses/ShippingAddressesModal.types.d.ts +26 -0
  132. package/dist/types/components/invoices/InvoiceOrderSummary/InvoiceOrderSummary.types.d.ts +5 -0
  133. package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +0 -1
  134. package/dist/types/components/payments/PayButton/PayButton.types.d.ts +2 -0
  135. package/dist/types/components/payments/PaymentCompletedCard/PaymentCompletedCard.types.d.ts +0 -2
  136. package/dist/types/components/payments/PaymentErrorCard/PaymentErrorCard.types.d.ts +9 -2
  137. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +47 -4
  138. package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +11 -1
  139. package/dist/types/components/payments/PaymentMethodSelector/PaymentMethodSelector.types.d.ts +0 -4
  140. package/dist/types/components/providers/AuthProvider/AuthProvider.handle.d.ts +17 -0
  141. package/dist/types/components/providers/AuthProvider/AuthProvider.lib.d.ts +30 -3
  142. package/dist/types/components/providers/AuthProvider/AuthProvider.types.d.ts +12 -0
  143. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +3 -1
  144. package/dist/types/components/providers/AuthProvider/composables/useAuth.d.ts +1 -3
  145. package/dist/types/components/providers/ConfigProvider/ConfigProvider.lib.d.ts +2 -4
  146. package/dist/types/components/providers/CssOverridesProvider/CssOverridesProvider.lib.d.ts +11 -0
  147. package/dist/types/components/providers/EntryProvider/EntryProvider.lib.d.ts +7 -0
  148. package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -0
  149. package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -1
  150. package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +5 -1
  151. package/dist/types/components/providers/ExperimentalFeatureProvider/ExperimentalFeatureProvider.lib.d.ts +2 -2
  152. package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +6 -1
  153. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
  154. package/dist/types/components/providers/LoggerProvider/LoggerProvider.vue.d.ts +5 -1
  155. package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +10 -7
  156. package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +1 -1
  157. package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +3 -1
  158. package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +2 -2
  159. package/dist/types/components/providers/Provider/Provider.types.d.ts +2 -2
  160. package/dist/types/components/providers/Provider/Provider.vue.d.ts +13 -4
  161. package/dist/types/components/providers/RequiredPropertiesGuard/RequiredPropertiesGuard.vue.d.ts +17 -0
  162. package/dist/types/components/providers/TranslationProvider/TranslationProvider.lib.d.ts +7 -2
  163. package/dist/types/components/providers/TranslationProvider/TranslationProvider.types.d.ts +1 -1
  164. package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -2
  165. package/dist/types/components/subscriptions/EnabledPricingsList/EnabledPricingsListItem.types.d.ts +2 -0
  166. package/dist/types/components/subscriptions/OrderSummary.types.d.ts +1 -10
  167. package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +16 -0
  168. package/dist/types/components/subscriptions/SubscriptionCancellationModal/SubscriptionCancellationModal.types.d.ts +5 -1
  169. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +10 -16
  170. package/dist/types/components/subscriptions/SubscriptionSummary.types.d.ts +1 -14
  171. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +4 -1
  172. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -2
  173. package/dist/types/components/wallets/AutoTopUpConfig/AutoTopUpConfig.types.d.ts +0 -3
  174. package/dist/types/components/wallets/TopUpModal/TopUpModalForm.types.d.ts +3 -1
  175. package/dist/types/components/wallets/TopUpModal/TopUpModalSuccess.types.d.ts +1 -7
  176. package/dist/types/public/components/BillingInformation/BillingInformation.entry.ce.d.ts +1 -1
  177. package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +0 -3
  178. package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.ce.d.ts +1 -1
  179. package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.entry.ce.d.ts +1 -1
  180. package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +0 -1
  181. package/dist/types/public/components/CustomerShippingAddresses/CustomerShippingAddresses.types.d.ts +12 -0
  182. package/dist/types/public/components/Invoice/Invoice.entry.ce.d.ts +1 -1
  183. package/dist/types/public/components/Invoice/Invoice.types.d.ts +0 -1
  184. package/dist/types/public/components/InvoiceDetails/InvoiceDetails.entry.ce.d.ts +1 -1
  185. package/dist/types/public/components/InvoiceDetails/InvoiceDetails.entry.types.d.ts +3 -2
  186. package/dist/types/public/components/InvoiceDetails/InvoiceDetails.types.d.ts +0 -2
  187. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.entry.ce.d.ts +1 -1
  188. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +0 -1
  189. package/dist/types/public/components/InvoicesList/InvoicesList.entry.ce.d.ts +1 -1
  190. package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +2 -0
  191. package/dist/types/public/components/PaymentHistory/PaymentHistory.entry.ce.d.ts +1 -1
  192. package/dist/types/public/components/PaymentHistory/PaymentHistory.entry.types.d.ts +3 -2
  193. package/dist/types/public/components/PaymentHistory/PaymentHistory.types.d.ts +0 -2
  194. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.ce.d.ts +1 -1
  195. package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.entry.ce.d.ts +1 -1
  196. package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.entry.types.d.ts +3 -2
  197. package/dist/types/public/components/SubscriptionSchedules/SubscriptionSchedules.types.d.ts +0 -2
  198. package/dist/types/public/components/SubscriptionsList/SubscriptionsList.entry.ce.d.ts +1 -1
  199. package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +3 -0
  200. package/dist/types/public/components/WalletBalances/WalletBalances.entry.ce.d.ts +1 -1
  201. package/dist/types/public/components/WalletBalances/WalletBalances.entry.types.d.ts +1 -3
  202. package/dist/types/public/core/action-request.types.d.ts +5 -0
  203. package/dist/types/public/core/registry.ce.d.ts +3 -3
  204. package/dist/types/public/core/registry.d.ts +0 -3
  205. package/dist/types/public/core/types.d.ts +5 -0
  206. package/dist/types/public/screens/Checkout/Checkout.entry.ce.d.ts +1 -1
  207. package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +0 -7
  208. package/dist/types/public/screens/Checkout/Checkout.types.d.ts +2 -2
  209. package/dist/types/public/screens/CustomerOverview/CustomerOverview.entry.ce.d.ts +1 -1
  210. package/dist/types/public/screens/PayInvoice/PayInvoice.entry.ce.d.ts +1 -1
  211. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +5 -1
  212. package/dist/types/public/screens/PaymentMethodsManagement/PaymentMethodsManagement.entry.ce.d.ts +1 -1
  213. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.entry.ce.d.ts +1 -1
  214. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +1 -2
  215. package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.entry.ce.d.ts +1 -1
  216. package/dist/types/services/paymentMethods.types.d.ts +2 -10
  217. package/dist/types/services/requests.types.d.ts +16 -6
  218. package/dist/types/translations/supported.d.ts +1 -1
  219. package/dist/types/types/errors.d.ts +3 -2
  220. package/dist/types/types/portalAuthentication.d.ts +2 -0
  221. package/dist/types/types/portalToken.d.ts +9 -0
  222. package/dist/types/types/shippingAddress.d.ts +9 -0
  223. package/dist/types/vendor/@adyen/adyen-web/index.d.ts +2 -0
  224. package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +2 -0
  225. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +1 -1
  226. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalRequests.d.ts +27 -6
  227. package/dist/types/vendor/@solvimon/solvimon-types/types/ConfigMeterProperties.d.ts +3 -0
  228. package/dist/types/vendor/@solvimon/solvimon-types/types/Entitlement.d.ts +6 -0
  229. package/dist/types/vendor/@solvimon/solvimon-types/types/Integrations.d.ts +9 -1
  230. package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +16 -1
  231. package/dist/types/vendor/@solvimon/solvimon-types/types/JWT.d.ts +10 -0
  232. package/dist/types/vendor/@solvimon/solvimon-types/types/MeterPropertyVariable.d.ts +16 -0
  233. package/dist/types/vendor/@solvimon/solvimon-types/types/Payment.d.ts +1 -1
  234. package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +6 -0
  235. package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
  236. package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +12 -3
  237. package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +71 -0
  238. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +14 -0
  239. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +1 -0
  240. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteVersions.d.ts +35 -0
  241. package/dist/types/vendor/@solvimon/solvimon-types/types/Quotes.d.ts +16 -0
  242. package/dist/types/vendor/@solvimon/solvimon-types/types/ShippingAddress.d.ts +54 -0
  243. package/dist/types/vendor/@solvimon/solvimon-types/utils.d.ts +1 -1
  244. package/dist/types/vendor/@solvimon/solvimon-ui/components/providers/BrandProvider/BrandProvider.types.d.ts +16 -0
  245. package/dist/types/vendor/@solvimon/solvimon-ui/components/providers/IntlProvider/IntlProvider.types.d.ts +66 -0
  246. package/dist/types/vendor/@solvimon/solvimon-ui/index.d.ts +2 -0
  247. package/dist/useActionDispatchProvider-3W2vEyIg.mjs +9 -0
  248. package/dist/{useCustomer-B-jyJIVy.mjs → useCustomer-cObBvDOu.mjs} +2 -2
  249. package/dist/useCustomerFormLabels-DJWf2O17.mjs +1173 -0
  250. package/dist/useIncrementalLoading-CATuO36d.mjs +60 -0
  251. package/dist/useInvoiceData-DD44HTl7.mjs +21 -0
  252. package/dist/useInvoicesList-CpB-41MQ.mjs +674 -0
  253. package/dist/useLazyFloating.es-CycqRyeb.mjs +68 -0
  254. package/dist/useLoadInitialData-qzdnBoui.mjs +15 -0
  255. package/dist/usePaymentFormHold-ByUZi3A-.mjs +181 -0
  256. package/dist/{usePaymentMethodAvailability-DAcsKGeh.mjs → usePaymentMethodAvailability-DUdrs0Ji.mjs} +8 -8
  257. package/dist/usePaymentMethods-ByaKF7mf.mjs +21 -0
  258. package/dist/{usePayments-Cr6NlGaW.mjs → usePayments-BXABv-lF.mjs} +9 -9
  259. package/dist/usePortal-CwR_FxTb.mjs +7 -0
  260. package/dist/useService-BZcbUZHI.mjs +56 -0
  261. package/dist/{useTimePeriod.es-DWLsLFqs.mjs → useTimePeriod.es-BpdiVwg8.mjs} +1 -1
  262. package/dist/useViewport-psZejz_H.mjs +19 -0
  263. package/package.json +33 -60
  264. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-081H9T3X.js +0 -1
  265. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DNepCMRp.mjs +0 -223
  266. package/dist/Alert.vue.es-RyK53a2P.js +0 -1
  267. package/dist/Amount.vue.es-DExaYBqm.js +0 -1
  268. package/dist/Avatar.vue.es-BJxSCU76.js +0 -1
  269. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BV5iEOxn.js +0 -1
  270. package/dist/Button.vue.es-BzkuglKw.js +0 -1
  271. package/dist/ChargeOnDemandModal-b17YswWA.js +0 -1
  272. package/dist/Checkout.entry.ce-HlUrJ1kh.js +0 -2
  273. package/dist/Checkout.entry.ce-X2zGo6hG.mjs +0 -4381
  274. package/dist/Chip.vue.es-B2jjzIOc.js +0 -1
  275. package/dist/Comparators.vue.es-CwhX3rbx.mjs +0 -93
  276. package/dist/Comparators.vue.es-DmkxV0gb.js +0 -1
  277. package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +0 -38
  278. package/dist/ContentWithAsideLayout-RSdKXqAf.js +0 -1
  279. package/dist/ContextMenu.vue.es-DUU43tCy.js +0 -1
  280. package/dist/CustomerBillingInformation.vue.es-BfPEB42w.js +0 -1
  281. package/dist/CustomerPaymentMethods.lib-BKgQTCtc.js +0 -1
  282. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BISD6n8X.js +0 -1
  283. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DssxYPSA.mjs +0 -2688
  284. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-XufY6bdV.js +0 -1
  285. package/dist/Divider.vue.es-UwnWvUTl.js +0 -1
  286. package/dist/DividerText.vue.es-CoyDk9eH.js +0 -1
  287. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CQ0KrXHJ.js +0 -1
  288. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-QW9NdxyZ.mjs +0 -335
  289. package/dist/ErrorNotification.vue.es-tS9vySUZ.js +0 -1
  290. package/dist/Expand.vue.es-BtM0EZEr.js +0 -1
  291. package/dist/FormMessage.vue.es-dqATjC2N.js +0 -1
  292. package/dist/FormMessage.vue.es-jG3fQZms.mjs +0 -29
  293. package/dist/IconButton.vue.es-DgQN18Am.js +0 -1
  294. package/dist/IconTitle.vue.es-Dn2xcPHj.js +0 -1
  295. package/dist/Input.vue.es-B60eK8Ds.js +0 -1
  296. package/dist/Input.vue.es-CU9u5yKH.mjs +0 -235
  297. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dqdezse7.js +0 -1
  298. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-Cl6HU243.js +0 -1
  299. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-DNqawlYV.mjs +0 -41
  300. package/dist/InvoiceSummary.vue.es-CAmA8g0t.js +0 -1
  301. package/dist/InvoiceSummary.vue.es-CRiFJ5x-.mjs +0 -2596
  302. package/dist/Modal.vue.es-DvLB3uCG.js +0 -1
  303. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-Dg4rn1cm.js +0 -1
  304. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-B9R5JRJv.js +0 -1
  305. package/dist/PaymentHistoryBlock-Uw8xeKUk.js +0 -1
  306. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-ALI5f0py.js +0 -1
  307. package/dist/PaymentIntegrationForm-Cx0zCf_C.js +0 -1
  308. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B-viSd_i.js +0 -1
  309. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCKCXXZX.mjs +0 -154
  310. package/dist/PaymentIntegrationFormAdyen-B-v-4nlj.js +0 -98
  311. package/dist/PaymentIntegrationFormStripe-CoLmAzas.js +0 -102
  312. package/dist/PaymentIntegrationFormStripe-Ds0BXt89.mjs +0 -587
  313. package/dist/PaymentMethod.vue.es-D0D9jW8s.js +0 -1
  314. package/dist/PaymentMethodForm-CMP5FLRO.js +0 -1
  315. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-nxnGyJmE.js +0 -1
  316. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIrrQUS6.js +0 -1
  317. package/dist/PlanCustomizationEditor-DS1r2vBO.js +0 -1
  318. package/dist/PlanCustomizationEditor-DlVSCKGN.mjs +0 -722
  319. package/dist/PricingGroupRangeInput.vue.es-VoOTnHjk.js +0 -185
  320. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-hS6A-KcP.js +0 -1
  321. package/dist/RadioGroupExtended.vue.es-9YzXzZF0.mjs +0 -163
  322. package/dist/RadioGroupExtended.vue.es-DlbURHQN.js +0 -1
  323. package/dist/Section.vue.es-Bbt0RITt.js +0 -1
  324. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Dl7MbMlk.js +0 -1
  325. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-xzjqB-v-.mjs +0 -687
  326. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CJWE7wVi.mjs +0 -41
  327. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-otI7Hz2w.js +0 -1
  328. package/dist/StepInput.vue.es-H-3R4jJq.js +0 -1
  329. package/dist/SubscriptionDetails.entry.ce-CQUO_uXH.js +0 -1
  330. package/dist/SubscriptionSchedules-Dy0fUgx5.js +0 -1
  331. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C1kTiW-H.mjs +0 -5234
  332. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Dd_Rr6qn.js +0 -1
  333. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-CYyP4ra9.js +0 -1
  334. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-CsekphtV.mjs +0 -91
  335. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-B4j8Clbj.js +0 -1
  336. package/dist/TooltipParagraph.vue.es-B9A17aG7.mjs +0 -129
  337. package/dist/TooltipParagraph.vue.es-DvC5Wjaz.js +0 -1
  338. package/dist/TrialChip.vue.es-CLQZ5F0n.js +0 -1
  339. package/dist/accel.svg.es-DFJXdioD.js +0 -1
  340. package/dist/ach.svg.es-BYP873jU.js +0 -1
  341. package/dist/adyen-BJfC7N6f.js +0 -1
  342. package/dist/adyenSdk-BP2XXzeJ.js +0 -1
  343. package/dist/amazon-pay.svg.es-CQWgtowB.js +0 -1
  344. package/dist/amex.svg.es-DKhW4Txt.js +0 -1
  345. package/dist/api.es-duCDtZD9.js +0 -1
  346. package/dist/apple-pay.svg.es-Dyojd0F-.js +0 -1
  347. package/dist/bacs.svg.es-GJpZs1sD.js +0 -1
  348. package/dist/bancontact.svg.es-BQh7nAup.js +0 -1
  349. package/dist/carnet.svg.es-DY04-F2L.js +0 -1
  350. package/dist/cartes-bancaires.svg.es-BleHMlkN.js +0 -1
  351. package/dist/cashapp.svg.es-MwXGYom6.js +0 -1
  352. package/dist/cn.es-C9Yqq4tg.js +0 -1
  353. package/dist/comparators.es-OGt19O9U.js +0 -1
  354. package/dist/components/BillingInformation/BillingInformation.cjs +0 -1
  355. package/dist/components/BillingInformationForm/BillingInformationForm.cjs +0 -1
  356. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +0 -1
  357. package/dist/components/Invoice/Invoice.cjs +0 -1
  358. package/dist/components/InvoiceDetails/InvoiceDetails.cjs +0 -1
  359. package/dist/components/InvoiceHeader/InvoiceHeader.cjs +0 -1
  360. package/dist/components/InvoicesList/InvoicesList.cjs +0 -1
  361. package/dist/components/PaymentHistory/PaymentHistory.cjs +0 -1
  362. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +0 -1
  363. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +0 -1
  364. package/dist/components/SubscriptionsList/SubscriptionsList.cjs +0 -1
  365. package/dist/components/WalletBalances/WalletBalances.cjs +0 -1
  366. package/dist/configuration-akTS7Wiw.js +0 -1
  367. package/dist/core/index.cjs +0 -1
  368. package/dist/countryData.es-C4jHBzfo.js +0 -1
  369. package/dist/customElements-B58FcXIN.mjs +0 -6633
  370. package/dist/customElements-DUMRMFQ5.js +0 -1215
  371. package/dist/customer-B3LPAhaD.mjs +0 -31
  372. package/dist/customer-CisTPaXj.js +0 -1
  373. package/dist/customer.es-B5ppZf0j.mjs +0 -20
  374. package/dist/customer.es-BButyYo0.js +0 -1
  375. package/dist/dana.svg.es-BDtZLpwd.js +0 -1
  376. package/dist/dankort.svg.es-CksaipXF.js +0 -1
  377. package/dist/de-DE-B4TUdnUf.js +0 -1
  378. package/dist/de-DE-DL74pMLb.js +0 -1
  379. package/dist/diners.svg.es-D6Mu1pqP.js +0 -1
  380. package/dist/discover.svg.es-DgqWCMUM.js +0 -1
  381. package/dist/eftpos.svg.es-Dk2DOT8W.js +0 -1
  382. package/dist/elo.svg.es-C-BzjuRP.js +0 -1
  383. package/dist/en-US-B2XFj-_p.js +0 -1
  384. package/dist/en-US-DQ5vlv9Z.mjs +0 -339
  385. package/dist/en-US-J85TQRI8.js +0 -1
  386. package/dist/en-US-SDhjlY_v.mjs +0 -301
  387. package/dist/eps.svg.es-B_85bP-W.js +0 -1
  388. package/dist/error-BHVZJGwD.mjs +0 -13
  389. package/dist/error-CmduqgVq.js +0 -1
  390. package/dist/floating-ui.vue.es-Bly3DGWm.js +0 -1
  391. package/dist/floating-ui.vue.es-CYt0fSY7.mjs +0 -1108
  392. package/dist/formControl-ODrpUvcA.js +0 -1
  393. package/dist/formControl-dX7l8o3c.mjs +0 -845
  394. package/dist/formatting.es-C72Nsrmh.js +0 -1
  395. package/dist/gcash.svg.es-BKAdhWzv.js +0 -1
  396. package/dist/getComposedString.es-haS4bAj7.js +0 -1
  397. package/dist/getCountryNameByCode.es-Xxc0nZsH.js +0 -1
  398. package/dist/girocard.svg.es-HSOEvDif.js +0 -1
  399. package/dist/go-pay.svg.es-DQjtunZ_.js +0 -1
  400. package/dist/google-pay.svg.es-hzc_EgiJ.js +0 -1
  401. package/dist/hipercard.svg.es-CbCsRY2q.js +0 -1
  402. package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +0 -4
  403. package/dist/icon-sprite.svg.es-Ds6lDf5p.js +0 -1
  404. package/dist/ideal.svg.es-Booz1IML.js +0 -1
  405. package/dist/index-BPZPnOQQ.js +0 -7
  406. package/dist/index.cjs +0 -1
  407. package/dist/index.es-BclokHQX.js +0 -1
  408. package/dist/invoices-CKQBLar2.js +0 -1
  409. package/dist/it-IT-CSYvGmpT.js +0 -1
  410. package/dist/it-IT-CqNK62qe.js +0 -1
  411. package/dist/jcb.svg.es-B3WPB8c2.js +0 -1
  412. package/dist/kakao-pay.svg.es-Cs-lCW74.js +0 -1
  413. package/dist/klarna.svg.es-Cs6XaHD7.js +0 -1
  414. package/dist/maestro.svg.es-BvK4oPg4.js +0 -1
  415. package/dist/mastercard.svg.es-lp4AXyyV.js +0 -1
  416. package/dist/momo.svg.es-C5aLYf_R.js +0 -1
  417. package/dist/nl-NL-CpE4IgwO.js +0 -1
  418. package/dist/nl-NL-Dx-TNXQ1.js +0 -1
  419. package/dist/nyce.svg.es-ArAivAZW.js +0 -1
  420. package/dist/object.es-CdriXMPs.js +0 -1
  421. package/dist/open-banking.svg.es-Q3rRkCvP.js +0 -1
  422. package/dist/paymentFailure-Bh60UhxA.mjs +0 -47
  423. package/dist/paymentFailure-Cki8c5BX.js +0 -1
  424. package/dist/paymentMethods-CWlvwK5V.mjs +0 -77
  425. package/dist/paymentMethods-Cw-i95mM.js +0 -1
  426. package/dist/payments-2qeQdpiW.mjs +0 -45
  427. package/dist/payments-CS7_YcOW.js +0 -1
  428. package/dist/paypal.svg.es-Cjp5sNI3.js +0 -1
  429. package/dist/pricing-BOqG21f9.js +0 -1
  430. package/dist/pricing.es-C07bgEZx.js +0 -1
  431. package/dist/pricingItemConfigs.es-D4aYkYcf.js +0 -1
  432. package/dist/pricingItemConfigs.es-ORxsk_YS.mjs +0 -77
  433. package/dist/pricingPlanSchedule-BM8vsKkV.js +0 -1
  434. package/dist/pricingPlanSchedules-B_sTAIgU.js +0 -1
  435. package/dist/pricingPlanSchedules-ChQCbMfe.mjs +0 -32
  436. package/dist/pulse.svg.es-Dit33E8S.js +0 -1
  437. package/dist/screens/Checkout/Checkout.cjs +0 -1
  438. package/dist/screens/CustomerOverview/CustomerOverview.cjs +0 -1
  439. package/dist/screens/PayInvoice/PayInvoice.cjs +0 -1
  440. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +0 -1
  441. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +0 -1
  442. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +0 -1
  443. package/dist/sepa.svg.es-0t4DKeA1.js +0 -1
  444. package/dist/sessionReference-3h-6FdrC.mjs +0 -43
  445. package/dist/sessionReference-m_6Rp4X1.js +0 -1
  446. package/dist/slots.es-T9ZJRGtG.js +0 -1
  447. package/dist/sorting.es-DCihKqD2.mjs +0 -77
  448. package/dist/sorting.es-DQsjKr8A.js +0 -1
  449. package/dist/star.svg.es-D2JncY7b.js +0 -1
  450. package/dist/subscription-D1yHKUNc.mjs +0 -69
  451. package/dist/subscription-ZA62t4E9.js +0 -1
  452. package/dist/subscriptions-DcfcBYAq.mjs +0 -55
  453. package/dist/subscriptions-DwVsf4Ev.js +0 -1
  454. package/dist/trustly.svg.es-GJByiFAs.js +0 -1
  455. package/dist/twint.svg.es-BJ2f48og.js +0 -1
  456. package/dist/typeGuards.es-DS3vZaJn.js +0 -1
  457. package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +0 -14
  458. package/dist/types/components/payments/SubscriptionPaymentCompletedCard/SubscriptionPaymentCompletedCard.types.d.ts +0 -3
  459. package/dist/types/components/subscriptions/PlanCustomizationForm/AddonSingleEditor.types.d.ts +0 -5
  460. package/dist/types/services/portals.types.d.ts +0 -70
  461. package/dist/types/types/subscription.d.ts +0 -4
  462. package/dist/unionpay.svg.es-DjFZ5EMQ.js +0 -1
  463. package/dist/url-TNRgVI8A.mjs +0 -21
  464. package/dist/url-vloPOiXd.js +0 -1
  465. package/dist/useActionDispatchProvider-B3AvkLL2.mjs +0 -11
  466. package/dist/useActionDispatchProvider-DFhppdve.js +0 -1
  467. package/dist/useCustomer-BwZKd9i5.js +0 -1
  468. package/dist/useCustomerFormLabels-BQk3d9PZ.mjs +0 -968
  469. package/dist/useCustomerFormLabels-DV9QiMYh.js +0 -1
  470. package/dist/useExperimentalFeature-BciA3Ok9.mjs +0 -135
  471. package/dist/useExperimentalFeature-CGIkgFR4.js +0 -1
  472. package/dist/useIncrementalLoading-CaWOE8Xl.js +0 -1
  473. package/dist/useIncrementalLoading-Cgxw2GD7.mjs +0 -48
  474. package/dist/useInvoiceData-BocKdeg7.mjs +0 -38
  475. package/dist/useInvoiceData-CNV_FMV8.js +0 -1
  476. package/dist/useInvoicesList-C8nsXMJ6.mjs +0 -500
  477. package/dist/useInvoicesList-S0IbQcrD.js +0 -1
  478. package/dist/useLoadInitialData-D9GkzY8t.mjs +0 -15
  479. package/dist/useLoadInitialData-D_R6Jy1s.js +0 -1
  480. package/dist/usePaymentMethodAvailability-BO_guwAw.js +0 -1
  481. package/dist/usePaymentMethodOptions-1vRAo6Ib.mjs +0 -39
  482. package/dist/usePaymentMethodOptions-CuzOoi2k.js +0 -1
  483. package/dist/usePaymentMethods-CbwnGONc.mjs +0 -15
  484. package/dist/usePaymentMethods-DDaTZQZp.js +0 -1
  485. package/dist/usePayments-DDSjo0rH.js +0 -1
  486. package/dist/usePortal-C27omjhz.js +0 -1
  487. package/dist/usePortal-C5AsegpS.mjs +0 -11
  488. package/dist/useService-Bh47bllz.mjs +0 -50
  489. package/dist/useService-H7BjLg8P.js +0 -1
  490. package/dist/useSubscription-BZJL0VOA.mjs +0 -210
  491. package/dist/useSubscription-D787IXY-.js +0 -1
  492. package/dist/useTimePeriod.es-rzxqUCTu.js +0 -1
  493. package/dist/useViewport-BgdA2PPt.mjs +0 -29
  494. package/dist/useViewport-hPRVDWCm.js +0 -1
  495. package/dist/useWatchDebounced-B8iX7ykx.js +0 -1
  496. package/dist/useWatchDebounced-BHlBPcXB.mjs +0 -20
  497. package/dist/visa.svg.es-NY3BHhda.js +0 -1
  498. package/dist/vpay.svg.es-VViQi42w.js +0 -1
  499. package/dist/wallets.es-CNIMW5ay.js +0 -1
  500. package/dist/zip.svg.es-C9S_F31W.js +0 -1
@@ -1,2688 +0,0 @@
1
- import { defineComponent as z, ref as $, onMounted as xt, onBeforeUnmount as Se, computed as s, openBlock as w, createBlock as C, withCtx as _, createElementVNode as N, toDisplayString as I, createVNode as A, createTextVNode as F, createElementBlock as W, unref as r, createCommentVNode as R, renderSlot as se, createSlots as re, Fragment as he, renderList as ge, watch as X, useModel as $t, isRef as Et, mergeModels as Ot, mergeProps as le, reactive as Ae, normalizeClass as ze, withModifiers as Ne, normalizeStyle as Re } from "vue";
2
- import { w as Bt } from "./api.es-QaC926Xu.mjs";
3
- import { a as Q, _ as K, c as Qe, u as Ge, b as _e, g as It } from "./customElements-B58FcXIN.mjs";
4
- import { E as Dt } from "./sessionReference-3h-6FdrC.mjs";
5
- import { u as Nt } from "./useService-Bh47bllz.mjs";
6
- import { _ as Ke } from "./ErrorNotification.vue.es-h-D37rfG.mjs";
7
- import { i as Rt, a as Me, h as kt } from "./pricingItemConfigs.es-ORxsk_YS.mjs";
8
- import { b as Ce } from "./wallets.es-eH2C2ygn.mjs";
9
- import { _ as ue, a as qt } from "./Button.vue.es-Cmjfm4jw.mjs";
10
- import { _ as Xe, T as Je, a as Ze } from "./TooltipParagraph.vue.es-B9A17aG7.mjs";
11
- import { _ as ve } from "./Section.vue.es-DVEpre9O.mjs";
12
- import { _ as et } from "./Skeleton.vue_vue_type_script_setup_true_lang-CJWE7wVi.mjs";
13
- import { _ as tt } from "./RadioGroupExtended.vue.es-9YzXzZF0.mjs";
14
- import { a as Vt, u as xe, c as ie, _ as Ft, d as Lt, r as ot } from "./formControl-dX7l8o3c.mjs";
15
- import { f as $e } from "./formatting.es-RclXHhKo.mjs";
16
- import { _ as Yt } from "./Divider.vue.es-DnP_HqLz.mjs";
17
- import { _ as nt } from "./Expand.vue.es-BleuAfDz.mjs";
18
- import { a as at } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-QW9NdxyZ.mjs";
19
- import { _ as Ht } from "./cn.es-Cvt6TIwv.mjs";
20
- import { c as it } from "./invoices-3520M5AN.mjs";
21
- import { u as Wt } from "./useWatchDebounced-BHlBPcXB.mjs";
22
- import { _ as jt } from "./Input.vue.es-CU9u5yKH.mjs";
23
- import { _ as st, a as zt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DNepCMRp.mjs";
24
- import { _ as Qt } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-CsekphtV.mjs";
25
- import { g as Gt } from "./customer.es-B5ppZf0j.mjs";
26
- import { u as Kt } from "./usePaymentMethodOptions-1vRAo6Ib.mjs";
27
- import { M as lt } from "./Modal.vue.es-BeI5C9-9.mjs";
28
- const Xt = 3e4, we = 60, Te = 12, Jt = /* @__PURE__ */ z({
29
- __name: "DateTimeAgo",
30
- props: {
31
- date: {},
32
- actionVerb: {}
33
- },
34
- setup(e) {
35
- const t = 60 * we, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(), l = $(Date.now());
36
- let u;
37
- xt(() => {
38
- u = setInterval(() => {
39
- l.value = Date.now();
40
- }, Xt);
41
- }), Se(() => {
42
- clearInterval(u);
43
- });
44
- const c = (f, h) => {
45
- const v = (h.getFullYear() - f.getFullYear()) * Te + (h.getMonth() - f.getMonth());
46
- return h.getDate() < f.getDate() ? v - 1 : v;
47
- }, g = s(() => {
48
- const f = Math.max(0, (l.value - n.date.getTime()) / 1e3);
49
- if (f < we)
50
- return a(
51
- {
52
- defaultMessage: "{count, plural, one {# second} other {# seconds}} ago",
53
- id: "dateTimeAgo.seconds",
54
- description: "Relative time in whole seconds"
55
- },
56
- { count: Math.trunc(f) }
57
- );
58
- if (f < t)
59
- return a(
60
- {
61
- defaultMessage: "{count, plural, one {# minute} other {# minutes}} ago",
62
- id: "dateTimeAgo.minutes",
63
- description: "Relative time in whole minutes"
64
- },
65
- { count: Math.trunc(f / we) }
66
- );
67
- if (f < o)
68
- return a(
69
- {
70
- defaultMessage: "{count, plural, one {# hour} other {# hours}} ago",
71
- id: "dateTimeAgo.hours",
72
- description: "Relative time in whole hours"
73
- },
74
- { count: Math.trunc(f / t) }
75
- );
76
- const h = c(n.date, new Date(l.value));
77
- if (h < 1) {
78
- const v = Math.trunc(f / o);
79
- return v === 1 ? a({
80
- defaultMessage: "yesterday",
81
- id: "dateTimeAgo.yesterday",
82
- description: 'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'
83
- }) : a(
84
- {
85
- defaultMessage: "{count, plural, one {# day} other {# days}} ago",
86
- id: "dateTimeAgo.days",
87
- description: "Relative time in whole days"
88
- },
89
- { count: v }
90
- );
91
- }
92
- return h < Te ? a(
93
- {
94
- defaultMessage: "{count, plural, one {# month} other {# months}} ago",
95
- id: "dateTimeAgo.months",
96
- description: "Relative time in whole months"
97
- },
98
- { count: h }
99
- ) : a(
100
- {
101
- defaultMessage: "{count, plural, one {# year} other {# years}} ago",
102
- id: "dateTimeAgo.years",
103
- description: "Relative time in whole years"
104
- },
105
- { count: Math.trunc(h / Te) }
106
- );
107
- }), b = s(
108
- () => n.actionVerb ? `${n.actionVerb} ${g.value}` : g.value
109
- ), S = s(
110
- () => i({ date: n.date, format: "dateTime", offsetType: "local" })
111
- );
112
- return (f, h) => (w(), C(Xe, null, {
113
- tooltip: _(() => [
114
- A(Je, null, {
115
- default: _(() => [
116
- A(Ze, null, {
117
- default: _(() => [
118
- F(I(S.value), 1)
119
- ]),
120
- _: 1
121
- })
122
- ]),
123
- _: 1
124
- })
125
- ]),
126
- default: _(() => [
127
- N("span", null, I(b.value), 1)
128
- ]),
129
- _: 1
130
- }));
131
- }
132
- }), Zt = (e) => {
133
- const { $t: t, formatNumber: o } = Q(), n = (y) => Ce(t, o, y), a = s(
134
- () => {
135
- var y, p;
136
- return ((p = (y = e.walletBalance.wallet) == null ? void 0 : y.wallet_type) == null ? void 0 : p.name) || t({
137
- defaultMessage: "Balance",
138
- id: "wallet_balance.balance_label",
139
- description: "Label shown above a wallet's balance amount"
140
- });
141
- }
142
- ), i = (y) => {
143
- var p;
144
- return (((p = y.pricing_item) == null ? void 0 : p.configs) ?? []).filter((P) => !!P.on_demand);
145
- }, l = s(
146
- () => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
147
- (y) => i(y).some(
148
- (p) => Rt(p) || Me(p)
149
- )
150
- )
151
- ), u = s(
152
- () => l.value.find(
153
- (y) => i(y).some((p) => Me(p))
154
- )
155
- ), c = s(
156
- () => !!e.showManualTopUp && l.value.length > 0
157
- ), g = s(() => !!e.showAutoTopUp && !!u.value), b = s(
158
- () => {
159
- var y, p;
160
- return (p = (y = e.walletBalance.wallet) == null ? void 0 : y.auto_top_up_configs) == null ? void 0 : p.find(
161
- (P) => P.status === "ACTIVE"
162
- );
163
- }
164
- ), S = s(
165
- () => {
166
- var y, p;
167
- return (p = (y = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : y.credits) == null ? void 0 : p.credit_type;
168
- }
169
- ), f = (y, p) => n({
170
- credits: {
171
- quantity: y,
172
- credit_type_id: p,
173
- credit_type: S.value
174
- }
175
- }), h = (y) => y.amount ? n({ amount: y.amount }) : y.credits ? f(y.credits.quantity, y.credits.credit_type_id) : "", v = s(() => {
176
- var y, p;
177
- const P = (y = b.value) == null ? void 0 : y.pricing_item_id;
178
- if (!P)
179
- return;
180
- const E = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((k) => k.pricing_item_id === P).flatMap((k) => i(k)).flatMap((k) => k.wallet_grants ?? []), D = (p = e.walletBalance.wallet) == null ? void 0 : p.wallet_type_id;
181
- return E.find((k) => k.wallet_type_id === D) ?? E[0];
182
- }), U = s(() => {
183
- var y, p;
184
- const P = (y = b.value) == null ? void 0 : y.topup_amount, E = (p = v.value) == null ? void 0 : p.credits_grant;
185
- if (!P || !E)
186
- return "";
187
- if (E.credits)
188
- return f(
189
- E.credits.quantity,
190
- E.credits.credit_type_id
191
- );
192
- if (E.conversion) {
193
- const D = Number(P.quantity) * Number(E.conversion.rate);
194
- return f(String(D), E.conversion.credit_type_id);
195
- }
196
- return "";
197
- }), B = s(
198
- () => b.value ? t({
199
- defaultMessage: "Auto top-up enabled",
200
- id: "wallet_balance.auto_top_up_enabled_label",
201
- description: "Label shown when a wallet tops itself up automatically"
202
- }) : t({
203
- defaultMessage: "No auto top-up enabled",
204
- id: "wallet_balance.auto_top_up_disabled_label",
205
- description: "Label shown when a wallet has no automatic top-up configured"
206
- })
207
- ), J = s(() => {
208
- const y = b.value;
209
- if (!y)
210
- return t({
211
- defaultMessage: "Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",
212
- id: "wallet_balance.auto_top_up_setup_explanation",
213
- description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
214
- });
215
- const p = y.topup_amount ? n({ amount: y.topup_amount }) : "", P = h(y.threshold);
216
- return !p || !P ? t({
217
- defaultMessage: "Your balance is topped up automatically once it runs low.",
218
- id: "wallet_balance.auto_top_up_generic_explanation",
219
- description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
220
- }) : U.value ? t(
221
- {
222
- defaultMessage: "Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",
223
- id: "wallet_balance.auto_top_up_credits_explanation",
224
- description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
225
- },
226
- { topUpCredits: U.value, topUpAmount: p, threshold: P }
227
- ) : t(
228
- {
229
- defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
230
- id: "wallet_balance.auto_top_up_explanation",
231
- description: "Tooltip explaining how the automatic top-up of a wallet balance works"
232
- },
233
- { topUpAmount: p, threshold: P }
234
- );
235
- });
236
- return {
237
- walletName: a,
238
- formatBalance: n,
239
- manualTopUpItems: l,
240
- flexibleManualTopUpItem: u,
241
- showManualTopUp: c,
242
- showAutoTopUp: g,
243
- activeTopUpConfig: b,
244
- autoTopUpLabel: B,
245
- autoTopUpExplanation: J
246
- };
247
- }, eo = { class: "flex flex-col gap-3 py-3" }, to = { class: "flex flex-col gap-1 px-4" }, oo = { class: "flex w-full justify-between gap-3" }, no = { class: "flex w-full items-center gap-4" }, ao = { key: 0 }, io = {
248
- key: 1,
249
- class: "flex w-full justify-between gap-3 px-4"
250
- }, so = { class: "flex min-w-0 items-center gap-1" }, lo = { class: "flex min-w-0 items-center gap-1" }, uo = { class: "shrink-0" }, ro = /* @__PURE__ */ z({
251
- __name: "WalletBalancesItem",
252
- props: {
253
- walletBalance: {},
254
- showAutoTopUp: { type: Boolean },
255
- showManualTopUp: { type: Boolean }
256
- },
257
- emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
258
- setup(e) {
259
- const t = e, { $t: o } = Q(), {
260
- walletName: n,
261
- formatBalance: a,
262
- manualTopUpItems: i,
263
- flexibleManualTopUpItem: l,
264
- showManualTopUp: u,
265
- showAutoTopUp: c,
266
- activeTopUpConfig: g,
267
- autoTopUpLabel: b,
268
- autoTopUpExplanation: S
269
- } = Zt(t);
270
- return (f, h) => (w(), W("div", eo, [
271
- N("div", to, [
272
- N("div", oo, [
273
- A(K, {
274
- variant: "body-xs",
275
- color: "subtle",
276
- "no-spacing": ""
277
- }, {
278
- default: _(() => [
279
- F(I(r(n)), 1)
280
- ]),
281
- _: 1
282
- }),
283
- A(K, {
284
- variant: "body-xs",
285
- color: "subtle",
286
- "no-spacing": ""
287
- }, {
288
- default: _(() => {
289
- var v, U;
290
- return [
291
- (v = e.walletBalance.wallet_balance) != null && v.balance_at ? (w(), C(Jt, {
292
- key: 0,
293
- date: new Date((U = e.walletBalance.wallet_balance) == null ? void 0 : U.balance_at),
294
- "action-verb": r(o)({
295
- defaultMessage: "updated",
296
- id: "wallet_balance.updated_action_verb",
297
- description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
298
- })
299
- }, null, 8, ["date", "action-verb"])) : R("", !0)
300
- ];
301
- }),
302
- _: 1
303
- })
304
- ]),
305
- N("div", no, [
306
- A(K, {
307
- variant: "body-lg",
308
- weight: "semibold",
309
- "no-spacing": "",
310
- class: "grow"
311
- }, {
312
- default: _(() => [
313
- F(I(r(a)(t.walletBalance.wallet_balance.open_balance)), 1)
314
- ]),
315
- _: 1
316
- }),
317
- r(u) ? (w(), C(r(ue), {
318
- key: 0,
319
- size: "xs",
320
- onClick: h[0] || (h[0] = (v) => f.$emit("top-up", r(i)[0]))
321
- }, {
322
- default: _(() => [
323
- F(I(r(o)({
324
- defaultMessage: "Top up",
325
- id: "v1V8kA",
326
- description: "Button to top up a wallet balance"
327
- })), 1)
328
- ]),
329
- _: 1
330
- })) : R("", !0)
331
- ])
332
- ]),
333
- f.$slots.graph ? (w(), W("div", ao, [
334
- se(f.$slots, "graph")
335
- ])) : R("", !0),
336
- r(c) ? (w(), W("div", io, [
337
- N("div", so, [
338
- A(Xe, { class: "min-w-0" }, {
339
- tooltip: _(() => [
340
- A(Je, null, {
341
- default: _(() => [
342
- A(Ze, null, {
343
- default: _(() => [
344
- F(I(r(S)), 1)
345
- ]),
346
- _: 1
347
- })
348
- ]),
349
- _: 1
350
- })
351
- ]),
352
- default: _(() => [
353
- N("div", lo, [
354
- A(K, {
355
- variant: "body-sm",
356
- color: "secondary",
357
- "no-spacing": "",
358
- class: "truncate"
359
- }, {
360
- default: _(() => [
361
- F(I(r(b)), 1)
362
- ]),
363
- _: 1
364
- }),
365
- A(qt, {
366
- icon: "info",
367
- size: "2xs",
368
- class: "shrink-0 cursor-help text-gray-400"
369
- })
370
- ])
371
- ]),
372
- _: 1
373
- })
374
- ]),
375
- N("div", uo, [
376
- r(g) ? (w(), C(r(ue), {
377
- key: 0,
378
- size: "xs",
379
- intent: "secondary",
380
- onClick: h[1] || (h[1] = (v) => f.$emit("cancel-auto-top-up", r(g)))
381
- }, {
382
- default: _(() => [
383
- F(I(r(o)({
384
- defaultMessage: "Disable",
385
- id: "wallet_balance.auto_top_up_disable_button",
386
- description: "Button to turn off a wallet's automatic top-up"
387
- })), 1)
388
- ]),
389
- _: 1
390
- })) : (w(), C(r(ue), {
391
- key: 1,
392
- size: "xs",
393
- intent: "secondary",
394
- onClick: h[2] || (h[2] = (v) => f.$emit("auto-top-up", r(l)))
395
- }, {
396
- default: _(() => [
397
- F(I(r(o)({
398
- defaultMessage: "Enable",
399
- id: "wallet_balance.auto_top_up_enable_button",
400
- description: "Button to set up a wallet's automatic top-up"
401
- })), 1)
402
- ]),
403
- _: 1
404
- }))
405
- ])
406
- ])) : R("", !0)
407
- ]));
408
- }
409
- }), co = { class: "flex flex-col gap-2" }, po = /* @__PURE__ */ z({
410
- __name: "WalletBalances",
411
- props: {
412
- customerWalletBalances: {},
413
- title: { default: void 0 },
414
- showAutoTopUp: { type: Boolean, default: !1 },
415
- showManualTopUp: { type: Boolean, default: !1 }
416
- },
417
- emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
418
- setup(e) {
419
- return (t, o) => (w(), C(ve, {
420
- "no-spacing": "",
421
- "no-border": "",
422
- title: e.title
423
- }, re({
424
- default: _(() => [
425
- N("div", co, [
426
- (w(!0), W(he, null, ge(e.customerWalletBalances, (n) => (w(), C(ve, {
427
- key: n.wallet_id,
428
- "no-spacing": ""
429
- }, {
430
- default: _(() => [
431
- A(ro, {
432
- "wallet-balance": n,
433
- "show-auto-top-up": e.showAutoTopUp,
434
- "show-manual-top-up": e.showManualTopUp,
435
- onTopUp: o[0] || (o[0] = (a) => t.$emit("top-up", a)),
436
- onAutoTopUp: o[1] || (o[1] = (a) => t.$emit("auto-top-up", a)),
437
- onCancelAutoTopUp: o[2] || (o[2] = (a) => t.$emit("cancel-auto-top-up", a))
438
- }, null, 8, ["wallet-balance", "show-auto-top-up", "show-manual-top-up"])
439
- ]),
440
- _: 2
441
- }, 1024))), 128))
442
- ])
443
- ]),
444
- _: 2
445
- }, [
446
- t.$slots["heading-right"] ? {
447
- name: "right",
448
- fn: _(() => [
449
- se(t.$slots, "heading-right")
450
- ]),
451
- key: "0"
452
- } : void 0
453
- ]), 1032, ["title"]));
454
- }
455
- });
456
- function mo() {
457
- const e = Qe(), t = Ge();
458
- function o(n) {
459
- return e({
460
- url: `${t.apiUrls.config}/portal/customers/${n}/wallets/balance`,
461
- query: Bt({ expandParams: Dt }),
462
- options: { method: "POST" },
463
- data: {}
464
- });
465
- }
466
- return {
467
- getCustomerWalletBalances: o
468
- };
469
- }
470
- function Dn({ customerId: e }) {
471
- const { getCustomerWalletBalances: t } = mo(), { data: o, execute: n, apiStatus: a, error: i, isPending: l } = Nt({
472
- service: () => t(e)
473
- });
474
- return { walletBalances: s(
475
- () => o.value ?? null
476
- ), apiStatus: a, error: i, fetch: n, isPending: l };
477
- }
478
- const ke = (e = [], t) => {
479
- if (t != null && t.pricing_item_id)
480
- return e.find(
481
- (o) => (o.charge_on_demand_pricing_items ?? []).some(
482
- ({ pricing_item_id: n }) => n === t.pricing_item_id
483
- )
484
- );
485
- }, vo = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], Ee = (e) => typeof e == "object" && e !== null && "pricing_item" in e, fo = (e) => [
486
- ...new Set(
487
- ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
488
- (t) => Ee(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
489
- )
490
- )
491
- ], ho = (e, t) => {
492
- const o = new Set(fo(e));
493
- return t.flatMap((n) => {
494
- const a = (n.pricing_plan_schedule_infos ?? []).filter(
495
- ({ id: i }) => o.has(i)
496
- );
497
- return a.length === 0 ? [] : [
498
- {
499
- id: n.id,
500
- name: n.name || n.reference || n.id,
501
- scheduleIds: a.map(({ id: i }) => i),
502
- enabledPricingIds: a.flatMap(
503
- (i) => {
504
- var l;
505
- return (((l = i.pricing_plan_schedule) == null ? void 0 : l.enabled_pricings) ?? []).flatMap(
506
- ({ pricing_id: u }) => u ? [u] : []
507
- );
508
- }
509
- )
510
- }
511
- ];
512
- });
513
- }, go = (e, t) => {
514
- if (!e || t.length === 0)
515
- return e;
516
- const o = new Set(t);
517
- return {
518
- ...e,
519
- charge_on_demand_pricing_items: (e.charge_on_demand_pricing_items ?? []).filter(
520
- (n) => Ee(n) && !!n.pricing_plan_schedule_id && o.has(n.pricing_plan_schedule_id)
521
- )
522
- };
523
- }, ut = (e) => ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap((t) => {
524
- var n, a;
525
- if (!Ee(t))
526
- return [];
527
- const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
528
- return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
529
- const l = wo(i, e), u = _o(i, e);
530
- return {
531
- pricingItemId: o,
532
- ...t.pricing_plan_schedule_id && {
533
- pricingPlanScheduleId: t.pricing_plan_schedule_id
534
- },
535
- config: i,
536
- ...l && { flexiblePricing: l },
537
- ...u && { fixedPricing: u }
538
- };
539
- }) : [];
540
- });
541
- function _o(e, t) {
542
- var i, l, u;
543
- if (!e.on_demand || !kt(e, ["FIXED"]))
544
- return;
545
- const o = (u = (l = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : l[0]) == null ? void 0 : u.fixed_amount;
546
- if (!o)
547
- return;
548
- const n = rt(t), a = n ? bo(e, t) : void 0;
549
- return {
550
- amount: o,
551
- value: a && n ? Oe(a.quantity, n) : { amount: o }
552
- };
553
- }
554
- const rt = (e) => {
555
- var t;
556
- return (t = e == null ? void 0 : e.wallet_balance.balance) == null ? void 0 : t.credits;
557
- }, dt = (e, t) => {
558
- var n;
559
- const o = (n = t == null ? void 0 : t.wallet) == null ? void 0 : n.wallet_type_id;
560
- return (e.wallet_grants ?? []).filter(
561
- ({ wallet_type_id: a }) => !o || a === o
562
- );
563
- }, yo = (e, t) => {
564
- var o, n;
565
- return (n = (o = dt(e, t).find(
566
- ({ credits_grant: a }) => a == null ? void 0 : a.conversion
567
- )) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
568
- }, bo = (e, t) => {
569
- var o, n;
570
- return (n = (o = dt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
571
- }, Oe = (e, t) => ({ credits: { ...t, quantity: e } }), ct = (e, t) => {
572
- const o = Number(e), n = Number(t);
573
- return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
574
- };
575
- function wo(e, t) {
576
- var c, g, b, S, f, h, v;
577
- if (!e.on_demand || !Me(e))
578
- return;
579
- const o = (g = (c = e.details) == null ? void 0 : c.bands) == null ? void 0 : g[0], n = ((b = o == null ? void 0 : o.minimum_amount) == null ? void 0 : b.currency) ?? ((S = o == null ? void 0 : o.maximum_amount) == null ? void 0 : S.currency) ?? ((h = (f = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : f.amount) == null ? void 0 : h.currency);
580
- if (!n)
581
- return;
582
- const a = rt(t), i = a ? yo(e, t) : void 0, l = (v = a == null ? void 0 : a.credit_type) == null ? void 0 : v.unit_name, u = (U) => {
583
- if (!U)
584
- return;
585
- const B = a && i ? ct(U.quantity, i.rate) : void 0;
586
- return B !== void 0 && a ? Oe(B, a) : { amount: U };
587
- };
588
- return {
589
- config: {
590
- ...(o == null ? void 0 : o.minimum_amount) && { minimum_amount: o.minimum_amount },
591
- ...(o == null ? void 0 : o.maximum_amount) && { maximum_amount: o.maximum_amount }
592
- },
593
- currency: n,
594
- ...i && {
595
- creditsConfiguration: {
596
- conversionRate: i.rate,
597
- ...(l == null ? void 0 : l.singular) && { unitNameSingle: l.singular },
598
- ...(l == null ? void 0 : l.plural) && { unitNamePlural: l.plural }
599
- }
600
- },
601
- bounds: {
602
- ...u(o == null ? void 0 : o.minimum_amount) && { minimum: u(o == null ? void 0 : o.minimum_amount) },
603
- ...u(o == null ? void 0 : o.maximum_amount) && { maximum: u(o == null ? void 0 : o.maximum_amount) }
604
- }
605
- };
606
- }
607
- const To = (e) => {
608
- var t, o, n, a, i;
609
- return !!((t = e.fixedPricing) != null && t.value.credits) || !!((o = e.flexiblePricing) != null && o.creditsConfiguration) || !!((i = ((n = e.flexiblePricing) == null ? void 0 : n.bounds.minimum) ?? ((a = e.flexiblePricing) == null ? void 0 : a.bounds.maximum)) != null && i.credits);
610
- }, Mo = (e) => {
611
- var t;
612
- for (const { fixedPricing: o, flexiblePricing: n } of e) {
613
- const a = (o == null ? void 0 : o.value.credits) ?? ((t = (n == null ? void 0 : n.bounds.minimum) ?? (n == null ? void 0 : n.bounds.maximum)) == null ? void 0 : t.credits);
614
- if (a != null && a.credit_type_id)
615
- return a.credit_type_id;
616
- }
617
- }, Uo = (e = []) => {
618
- for (const { flexiblePricing: t, fixedPricing: o } of e) {
619
- const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
620
- if (n)
621
- return n;
622
- }
623
- }, pt = (e = []) => {
624
- var t, o, n;
625
- for (const { fixedPricing: a, flexiblePricing: i } of e) {
626
- const l = (a == null ? void 0 : a.value.credits) ?? ((t = (i == null ? void 0 : i.bounds.minimum) ?? (i == null ? void 0 : i.bounds.maximum)) == null ? void 0 : t.credits);
627
- if ((n = (o = l == null ? void 0 : l.credit_type) == null ? void 0 : o.unit_name) != null && n.plural)
628
- return l.credit_type.unit_name.plural;
629
- }
630
- }, Po = (e = []) => {
631
- var t;
632
- for (const { flexiblePricing: o } of e) {
633
- const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
634
- if (n)
635
- return n;
636
- }
637
- }, So = (e = []) => {
638
- for (const { flexiblePricing: t } of e) {
639
- const { minimum_amount: o, maximum_amount: n } = (t == null ? void 0 : t.config) ?? {};
640
- if (o || n)
641
- return { ...o && { minimum: o }, ...n && { maximum: n } };
642
- }
643
- return {};
644
- }, Ao = (e = []) => {
645
- if (e.some(To)) {
646
- const t = Mo(e);
647
- return t ? { creditTypeId: t } : void 0;
648
- }
649
- for (const { flexiblePricing: t, fixedPricing: o } of e) {
650
- const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
651
- if (n)
652
- return { currency: n };
653
- }
654
- }, Co = (e, t) => {
655
- var l;
656
- if (e.fixedPricing)
657
- return e.fixedPricing.value;
658
- if (!e.flexiblePricing || !t)
659
- return;
660
- const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (l = o.minimum ?? o.maximum) == null ? void 0 : l.credits, i = n ? ct(t.quantity, n.conversionRate) : void 0;
661
- return a && i !== void 0 ? Oe(i, a) : { amount: t };
662
- }, mt = (e = []) => {
663
- const t = Ao(e);
664
- if (t)
665
- return {
666
- denomination: t,
667
- chargeCurrency: Uo(e) ?? "",
668
- creditUnitName: pt(e),
669
- conversionRate: Po(e),
670
- topUpBounds: So(e)
671
- };
672
- }, xo = 400;
673
- function $o({
674
- pricingPlanScheduleId: e,
675
- pricingItems: t
676
- }) {
677
- const { previewChargeOnDemandPricingItems: o } = it(), n = _e(), a = $(), i = $(!1), l = $(!1), u = s(() => i.value || l.value), c = $(!1), g = It(), b = async () => {
678
- const S = e.value, f = g();
679
- if (l.value = !1, !S || !t.value) {
680
- t.value && !S && n.warn(
681
- "INVOICE_PREVIEW_SKIPPED",
682
- "Skipped the on-demand charge invoice preview: no schedule to charge it on",
683
- { missing: ["pricingPlanScheduleId"] }
684
- ), a.value = void 0, i.value = !1, c.value = !1;
685
- return;
686
- }
687
- i.value = !0, c.value = !1;
688
- try {
689
- const h = await o({
690
- pricingPlanScheduleId: S,
691
- pricingItems: t.value
692
- });
693
- f() && (a.value = h);
694
- } catch (h) {
695
- f() && (a.value = void 0, c.value = !0), n.error(
696
- "INVOICE_PREVIEW_FAILED",
697
- "Failed to load the invoice preview",
698
- { preview: "ON_DEMAND_CHARGE" },
699
- h
700
- );
701
- } finally {
702
- f() && (i.value = !1);
703
- }
704
- };
705
- return Wt(t, () => void b(), {
706
- debounce: () => a.value || i.value || c.value ? xo : 0,
707
- deep: !0
708
- }), X(
709
- t,
710
- (S) => {
711
- l.value = !!S, S || (g(), a.value = void 0, c.value = !1, i.value = !1);
712
- },
713
- { deep: !0, flush: "sync" }
714
- ), b(), { invoicePreview: a, isPreviewPending: u, hasPreviewFailed: c, loadPreview: b };
715
- }
716
- const Eo = { key: 0 }, vt = /* @__PURE__ */ z({
717
- __name: "TopUpInvoicePreview",
718
- props: {
719
- pricingPlanScheduleId: { type: String },
720
- pricingItems: { type: Array }
721
- },
722
- setup(e) {
723
- const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i } = $o({ pricingPlanScheduleId: n, pricingItems: a });
724
- return (l, u) => (w(), C(et, { class: "sv-top-up-invoice-preview h-[152px]" }, {
725
- default: _(() => [
726
- r(i) ? (w(), W("div", Eo, [
727
- A(r(Ht), { required: "" }, {
728
- default: _(() => [
729
- F(I(r(o)({
730
- defaultMessage: "You will pay",
731
- description: "Label above the preview of what topping up will be invoiced for",
732
- id: "topup_modal.invoice_preview.label"
733
- })), 1)
734
- ]),
735
- _: 1
736
- }),
737
- A(r(ve), { "content-background": "none" }, {
738
- default: _(() => [
739
- A(r(at), {
740
- invoice: r(i),
741
- "is-customer-facing": ""
742
- }, null, 8, ["invoice"])
743
- ]),
744
- _: 1
745
- })
746
- ])) : R("", !0)
747
- ]),
748
- _: 1
749
- }));
750
- }
751
- }), ft = (e, t) => e.currency ?? t ?? e.creditTypeId ?? "", qe = (e, t) => ({
752
- quantity: e ?? null,
753
- currency: t
754
- }), Ue = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
755
- var i, l, u, c, g;
756
- return {
757
- enabled: (e == null ? void 0 : e.status) === "ACTIVE",
758
- threshold: qe(
759
- ((l = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : l.quantity) ?? ((c = (u = e == null ? void 0 : e.threshold) == null ? void 0 : u.credits) == null ? void 0 : c.quantity),
760
- ft(t, n)
761
- ),
762
- topUpAmount: qe(((g = e == null ? void 0 : e.topup_amount) == null ? void 0 : g.quantity) ?? a, o)
763
- };
764
- }, Oo = (e, t) => {
765
- var n;
766
- const o = (n = e.threshold) == null ? void 0 : n.quantity;
767
- return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
768
- }, Ve = (e, t) => {
769
- var o;
770
- return (o = e.topUpAmount) != null && o.quantity ? {
771
- quantity: e.topUpAmount.quantity,
772
- currency: e.topUpAmount.currency ?? t
773
- } : void 0;
774
- }, ht = (e, { denomination: t, chargeCurrency: o }) => ({
775
- status: e.enabled ? "ACTIVE" : "INACTIVE",
776
- threshold: Oo(e, t),
777
- ...Ve(e, o) && {
778
- topup_amount: Ve(e, o)
779
- }
780
- }), Fe = (e, t) => ht(Ue(e, t), t), Le = (e, t) => JSON.stringify(e) === JSON.stringify(t), Ye = (e) => {
781
- const t = Number(e == null ? void 0 : e.quantity);
782
- return e != null && e.quantity && Number.isFinite(t) ? t : void 0;
783
- }, Bo = (e, t) => {
784
- const o = Number(t == null ? void 0 : t.quantity);
785
- return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e >= o;
786
- }, Io = (e, t) => {
787
- const o = Number(t == null ? void 0 : t.quantity);
788
- return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e <= o;
789
- }, fe = (e) => {
790
- const t = Number(e);
791
- return e != null && e !== "" && Number.isFinite(t) ? t : void 0;
792
- }, Be = (e, t, o) => {
793
- const n = fe(e), a = fe(o);
794
- if (!(n === void 0 || a === void 0 || a <= 0))
795
- return t === "CREDITS" ? n / a : n * a;
796
- }, He = (e, t, o, n) => t === o ? fe(e) : Be(e, t, n), Do = (e, t, o) => t === "CREDITS" ? Be(e, "AMOUNT", o) : fe(e), Ie = (e) => e.toFixed(2), We = (e, t) => t === "AMOUNT" ? Ie(e) : String(Number(e.toFixed(6))), gt = (e, t, o, n) => {
797
- const a = Do(e == null ? void 0 : e.quantity, t, o);
798
- if (a !== void 0)
799
- return t === "CREDITS" ? n(a) : Ie(a);
800
- }, Pe = /* @__PURE__ */ z({
801
- __name: "ConvertedAmountInput",
802
- props: /* @__PURE__ */ Ot({
803
- unit: { type: String },
804
- modelBase: { type: String },
805
- entryBase: { type: String },
806
- conversionRate: { type: String },
807
- showConversionHint: { type: Boolean },
808
- currency: { type: String },
809
- creditUnitName: { type: String },
810
- bounds: { type: Object },
811
- label: { type: String },
812
- name: { type: String },
813
- required: { type: Boolean },
814
- disabled: { type: Boolean },
815
- error: { type: [String, Object, Array] }
816
- }, {
817
- modelValue: { default: "" },
818
- modelModifiers: {}
819
- }),
820
- emits: ["update:modelValue"],
821
- setup(e) {
822
- const t = e, o = $t(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase), l = s(
823
- () => i.value !== t.modelBase && fe(t.conversionRate) !== void 0
824
- ), u = $("");
825
- X(
826
- () => [o.value, i.value, t.modelBase, t.conversionRate],
827
- ([p]) => {
828
- if (!l.value) {
829
- u.value = p ?? "";
830
- return;
831
- }
832
- if (p === c(u.value))
833
- return;
834
- const P = He(
835
- p,
836
- t.modelBase,
837
- i.value,
838
- t.conversionRate
839
- );
840
- u.value = P === void 0 ? "" : We(P, i.value);
841
- },
842
- { immediate: !0 }
843
- );
844
- function c(p) {
845
- const P = He(p, i.value, t.modelBase, t.conversionRate);
846
- return P === void 0 ? "" : We(P, t.modelBase);
847
- }
848
- const g = s({
849
- get: () => u.value,
850
- set: (p) => {
851
- u.value = Vt(p), o.value = l.value ? c(u.value) : u.value;
852
- }
853
- }), b = s(
854
- () => Be(u.value, i.value, t.conversionRate)
855
- ), S = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
856
- defaultMessage: "credits",
857
- description: "Generic name for a wallet credit, where its credit type does not name one",
858
- id: "converted_amount_input.credits"
859
- })), f = (p, P) => $e({ quantity: Ie(p), currency: P }), h = (p) => `${a(p)} ${S.value}`, v = s(() => {
860
- const p = t.error;
861
- return Array.isArray(p) ? p.length > 0 : !!(Et(p) ? p.value : p);
862
- }), U = s(() => {
863
- const p = b.value;
864
- if (!(v.value || !t.showConversionHint || p === void 0))
865
- return i.value === "CREDITS" ? t.currency ? n(
866
- {
867
- defaultMessage: "Will cost {amount} excluding taxes",
868
- description: "Helper text under a credits field, naming what those credits cost in money",
869
- id: "converted_amount_input.cost"
870
- },
871
- { amount: f(p, t.currency) }
872
- ) : void 0 : n(
873
- {
874
- defaultMessage: "Buys about {credits}",
875
- description: "Helper text under a money field, naming the credits that amount converts into",
876
- id: "converted_amount_input.buys"
877
- },
878
- { credits: h(p) }
879
- );
880
- }), B = (p) => gt(p, i.value, t.conversionRate, a), J = s(
881
- () => {
882
- var p, P, E, D;
883
- return i.value === "CREDITS" ? S.value : ((P = (p = t.bounds) == null ? void 0 : p.minimum) == null ? void 0 : P.currency) ?? ((D = (E = t.bounds) == null ? void 0 : E.maximum) == null ? void 0 : D.currency) ?? t.unit;
884
- }
885
- ), y = s(() => {
886
- var D, k;
887
- const p = B((D = t.bounds) == null ? void 0 : D.minimum), P = B((k = t.bounds) == null ? void 0 : k.maximum), E = J.value;
888
- if (p && P)
889
- return n(
890
- {
891
- defaultMessage: "Between {minimum} and {maximum} {unit}",
892
- description: "Range of what a flexible top-up may be charged for, beside its label",
893
- id: "converted_amount_input.bounds.range"
894
- },
895
- { minimum: p, maximum: P, unit: E }
896
- );
897
- if (p)
898
- return n(
899
- {
900
- defaultMessage: "At least {minimum} {unit}",
901
- description: "Smallest amount a flexible top-up may be charged for, beside its label",
902
- id: "converted_amount_input.bounds.minimum"
903
- },
904
- { minimum: p, unit: E }
905
- );
906
- if (P)
907
- return n(
908
- {
909
- defaultMessage: "Up to {maximum} {unit}",
910
- description: "Largest amount a flexible top-up may be charged for, beside its label",
911
- id: "converted_amount_input.bounds.maximum"
912
- },
913
- { maximum: P, unit: E }
914
- );
915
- });
916
- return (p, P) => (w(), C(r(jt), {
917
- modelValue: g.value,
918
- "onUpdate:modelValue": P[0] || (P[0] = (E) => g.value = E),
919
- class: "sv-converted-amount-input",
920
- type: "number",
921
- "as-text-type": "",
922
- name: e.name,
923
- label: e.label,
924
- required: e.required,
925
- disabled: e.disabled,
926
- error: e.error
927
- }, re({
928
- suffix: _(() => [
929
- N("span", null, I(e.unit), 1)
930
- ]),
931
- _: 2
932
- }, [
933
- y.value ? {
934
- name: "label-suffix",
935
- fn: _(() => [
936
- A(r(K), {
937
- tag: "span",
938
- variant: "body-xs",
939
- color: "subtle",
940
- "no-spacing": ""
941
- }, {
942
- default: _(() => [
943
- F(I(y.value), 1)
944
- ]),
945
- _: 1
946
- })
947
- ]),
948
- key: "0"
949
- } : void 0,
950
- U.value ? {
951
- name: "helper",
952
- fn: _(() => [
953
- A(r(K), {
954
- tag: "span",
955
- variant: "body-xs",
956
- color: "subtle",
957
- "no-spacing": ""
958
- }, {
959
- default: _(() => [
960
- F(I(U.value), 1)
961
- ]),
962
- _: 1
963
- })
964
- ]),
965
- key: "1"
966
- } : void 0
967
- ]), 1032, ["modelValue", "name", "label", "required", "disabled", "error"]));
968
- }
969
- }), No = /* @__PURE__ */ z({
970
- __name: "Section",
971
- props: {
972
- emphasized: { type: Boolean, default: !1 },
973
- contentClasses: { type: String },
974
- contentBackground: { type: String },
975
- title: { type: String },
976
- noSpacing: { type: Boolean },
977
- hasError: { type: Boolean },
978
- noBorder: { type: Boolean }
979
- },
980
- setup(e) {
981
- const t = e, o = [
982
- "sv-section__accent relative",
983
- "before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5",
984
- "before:rounded-full before:bg-primary-600"
985
- ].join(" "), n = s(
986
- () => [t.emphasized ? o : void 0, t.contentClasses].filter(Boolean).join(" ")
987
- ), a = s(() => {
988
- const { emphasized: i, ...l } = t;
989
- return l;
990
- });
991
- return (i, l) => (w(), C(r(ve), le(a.value, {
992
- class: "sv-section",
993
- "content-classes": n.value
994
- }), re({
995
- default: _(() => [
996
- se(i.$slots, "default")
997
- ]),
998
- _: 2
999
- }, [
1000
- i.$slots.right ? {
1001
- name: "right",
1002
- fn: _(() => [
1003
- se(i.$slots, "right")
1004
- ]),
1005
- key: "0"
1006
- } : void 0
1007
- ]), 1040, ["content-classes"]));
1008
- }
1009
- }), Ro = { class: "flex grow flex-col" }, _t = /* @__PURE__ */ z({
1010
- __name: "AutoTopUpConfig",
1011
- props: {
1012
- config: { type: Object },
1013
- denomination: { type: Object },
1014
- creditUnitName: { type: String },
1015
- chargeCurrency: { type: String },
1016
- conversionRate: { type: String },
1017
- topUpBounds: { type: Object },
1018
- showThresholdConversion: { type: Boolean, default: !0 },
1019
- contained: { type: Boolean },
1020
- alwaysEnabled: { type: Boolean },
1021
- disabled: { type: Boolean }
1022
- },
1023
- emits: ["save"],
1024
- setup(e, { expose: t, emit: o }) {
1025
- const n = e, a = o, { $t: i, formatNumber: l } = Q(), u = s(() => {
1026
- var T, x;
1027
- return {
1028
- denomination: n.denomination,
1029
- chargeCurrency: n.chargeCurrency,
1030
- creditUnitName: n.creditUnitName,
1031
- minimumTopUp: (x = (T = n.topUpBounds) == null ? void 0 : T.minimum) == null ? void 0 : x.quantity
1032
- };
1033
- }), c = $(Ue(n.config, u.value)), g = s(() => ft(n.denomination, n.creditUnitName)), b = s(
1034
- () => n.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
1035
- ), S = s(
1036
- () => b.value === "CREDITS" ? g.value : n.chargeCurrency
1037
- ), f = s({
1038
- get: () => {
1039
- var T;
1040
- return ((T = c.value.threshold) == null ? void 0 : T.quantity) ?? "";
1041
- },
1042
- set: (T) => {
1043
- c.value.threshold = { quantity: T || null, currency: g.value };
1044
- }
1045
- }), h = s({
1046
- get: () => {
1047
- var T;
1048
- return ((T = c.value.topUpAmount) == null ? void 0 : T.quantity) ?? "";
1049
- },
1050
- set: (T) => {
1051
- c.value.topUpAmount = { quantity: T || null, currency: n.chargeCurrency };
1052
- }
1053
- });
1054
- X(
1055
- () => [n.config, u.value],
1056
- ([T, x]) => {
1057
- Le(Fe(T, x), B()) || (c.value = Ue(T, x));
1058
- }
1059
- );
1060
- const v = s({
1061
- get: () => n.alwaysEnabled || c.value.enabled,
1062
- set: (T) => {
1063
- c.value.enabled = T;
1064
- }
1065
- }), U = s(
1066
- () => ht({ ...c.value, enabled: v.value }, u.value)
1067
- ), B = () => U.value, J = Ae({
1068
- threshold: s(() => Ye(c.value.threshold) ?? null),
1069
- topUpAmount: s(() => Ye(c.value.topUpAmount) ?? null)
1070
- }), y = (T) => {
1071
- if (!T)
1072
- return "";
1073
- const x = gt(T, b.value, n.conversionRate, l);
1074
- return x === void 0 ? $e(T) : `${x} ${S.value}`;
1075
- }, p = Lt(() => v.value), P = xe(
1076
- {
1077
- threshold: {
1078
- required: ie.withMessage(
1079
- () => i({
1080
- defaultMessage: "Enter the balance to top up at.",
1081
- description: "Error shown under the auto top-up threshold when it is left empty",
1082
- id: "auto_topup_config.threshold.required"
1083
- }),
1084
- p
1085
- ),
1086
- notNegative: ie.withMessage(
1087
- () => i({
1088
- defaultMessage: "The balance to top up at cannot be negative.",
1089
- description: "Error shown under the auto top-up threshold when it is below zero",
1090
- id: "auto_topup_config.threshold.not_negative"
1091
- }),
1092
- (T) => T === null || T >= 0
1093
- )
1094
- },
1095
- topUpAmount: {
1096
- required: ie.withMessage(
1097
- () => i({
1098
- defaultMessage: "Enter the amount to top up with.",
1099
- description: "Error shown under the auto top-up amount when it is left empty",
1100
- id: "auto_topup_config.amount.required"
1101
- }),
1102
- p
1103
- ),
1104
- positive: ie.withMessage(
1105
- () => i({
1106
- defaultMessage: "Top up with more than zero.",
1107
- description: "Error shown under the auto top-up amount when it is zero or negative",
1108
- id: "auto_topup_config.amount.positive"
1109
- }),
1110
- (T) => T === null || T > 0
1111
- ),
1112
- atLeastMinimum: ie.withMessage(
1113
- () => {
1114
- var T;
1115
- return i(
1116
- {
1117
- defaultMessage: "Top up with at least {minimum}.",
1118
- description: "Error shown under the auto top-up amount when it is below what the pricing allows",
1119
- id: "auto_topup_config.amount.at_least_minimum"
1120
- },
1121
- { minimum: y((T = n.topUpBounds) == null ? void 0 : T.minimum) }
1122
- );
1123
- },
1124
- (T) => {
1125
- var x;
1126
- return Bo(T, (x = n.topUpBounds) == null ? void 0 : x.minimum);
1127
- }
1128
- ),
1129
- withinMaximum: ie.withMessage(
1130
- () => {
1131
- var T;
1132
- return i(
1133
- {
1134
- defaultMessage: "Top up with at most {maximum}.",
1135
- description: "Error shown under the auto top-up amount when it is above what the pricing allows",
1136
- id: "auto_topup_config.amount.within_maximum"
1137
- },
1138
- { maximum: y((T = n.topUpBounds) == null ? void 0 : T.maximum) }
1139
- );
1140
- },
1141
- (T) => {
1142
- var x;
1143
- return Io(T, (x = n.topUpBounds) == null ? void 0 : x.maximum);
1144
- }
1145
- )
1146
- }
1147
- },
1148
- J
1149
- ), E = s(
1150
- () => !Le(
1151
- B(),
1152
- Fe(n.config, u.value)
1153
- )
1154
- );
1155
- function D() {
1156
- return P.value.$touch(), P.value.$invalid ? void 0 : B();
1157
- }
1158
- function k() {
1159
- const T = D();
1160
- T && a("save", T);
1161
- }
1162
- return t({
1163
- submit: k,
1164
- validate: D,
1165
- rule: U,
1166
- hasChanges: E,
1167
- isInvalid: s(() => P.value.$invalid)
1168
- }), (T, x) => (w(), C(No, {
1169
- class: "sv-auto-topup-config",
1170
- "content-background": e.contained ? "gray" : "none",
1171
- "no-spacing": !e.contained,
1172
- "no-border": !e.contained
1173
- }, {
1174
- default: _(() => [
1175
- e.alwaysEnabled ? R("", !0) : (w(), C(r(Ft), {
1176
- key: 0,
1177
- modelValue: v.value,
1178
- "onUpdate:modelValue": x[0] || (x[0] = (G) => v.value = G),
1179
- "no-spacing": "",
1180
- "label-position": "before",
1181
- class: "!flex",
1182
- disabled: e.disabled
1183
- }, {
1184
- "inline-label": _(() => [
1185
- N("div", Ro, [
1186
- A(r(K), {
1187
- tag: "span",
1188
- variant: "body-sm"
1189
- }, {
1190
- default: _(() => [
1191
- F(I(r(i)({
1192
- defaultMessage: "Auto top-up",
1193
- description: "Title of the automatic wallet top-up settings",
1194
- id: "auto_topup_config.title"
1195
- })), 1)
1196
- ]),
1197
- _: 1
1198
- }),
1199
- A(r(K), {
1200
- tag: "span",
1201
- variant: "body-xs",
1202
- color: "subtle"
1203
- }, {
1204
- default: _(() => [
1205
- F(I(r(i)({
1206
- defaultMessage: "Automatically top up your balance when it runs low.",
1207
- description: "Subtitle of the automatic wallet top-up settings",
1208
- id: "auto_topup_config.subtitle"
1209
- })), 1)
1210
- ]),
1211
- _: 1
1212
- })
1213
- ])
1214
- ]),
1215
- _: 1
1216
- }, 8, ["modelValue", "disabled"])),
1217
- A(r(nt), { "is-open": v.value }, {
1218
- default: _(() => [
1219
- v.value ? (w(), W("div", {
1220
- key: 0,
1221
- class: ze(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
1222
- }, [
1223
- A(Pe, {
1224
- modelValue: f.value,
1225
- "onUpdate:modelValue": x[1] || (x[1] = (G) => f.value = G),
1226
- name: "auto-top-up-threshold",
1227
- unit: g.value,
1228
- "model-base": b.value,
1229
- "entry-base": b.value,
1230
- currency: e.chargeCurrency,
1231
- "conversion-rate": e.conversionRate,
1232
- "show-conversion-hint": e.showThresholdConversion,
1233
- required: "",
1234
- disabled: e.disabled,
1235
- error: r(P).threshold.$errors,
1236
- label: r(i)({
1237
- defaultMessage: "When your balance falls below",
1238
- description: "Label of the balance at which an automatic top-up is charged",
1239
- id: "auto_topup_config.threshold.label"
1240
- })
1241
- }, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
1242
- A(Pe, {
1243
- modelValue: h.value,
1244
- "onUpdate:modelValue": x[2] || (x[2] = (G) => h.value = G),
1245
- name: "auto-top-up-amount",
1246
- unit: S.value,
1247
- "model-base": "AMOUNT",
1248
- "entry-base": b.value,
1249
- currency: e.chargeCurrency,
1250
- "credit-unit-name": e.creditUnitName,
1251
- "conversion-rate": e.conversionRate,
1252
- bounds: e.topUpBounds,
1253
- "show-conversion-hint": "",
1254
- required: "",
1255
- disabled: e.disabled,
1256
- error: r(P).topUpAmount.$errors,
1257
- label: r(i)({
1258
- defaultMessage: "Top-up with",
1259
- description: "Label of the amount every automatic top-up adds",
1260
- id: "auto_topup_config.amount.label"
1261
- })
1262
- }, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
1263
- ], 2)) : R("", !0)
1264
- ]),
1265
- _: 1
1266
- }, 8, ["is-open"])
1267
- ]),
1268
- _: 1
1269
- }, 8, ["content-background", "no-spacing", "no-border"]));
1270
- }
1271
- }), je = (e) => {
1272
- const t = Date.parse(e ?? "");
1273
- return Number.isFinite(t) ? t : 0;
1274
- };
1275
- function yt({
1276
- paymentMethods: e,
1277
- selectedPaymentMethodId: t,
1278
- preferredPaymentMethodId: o
1279
- }) {
1280
- const n = s(
1281
- () => [...e.value ?? []].sort(
1282
- (a, i) => je(i.created_at) - je(a.created_at)
1283
- )
1284
- );
1285
- return X(
1286
- () => [
1287
- e.value,
1288
- o == null ? void 0 : o.value,
1289
- t.value
1290
- ],
1291
- ([a, i, l], u) => {
1292
- var S;
1293
- const c = u == null ? void 0 : u[0], g = a == null ? void 0 : a.find(
1294
- ({ id: f }) => !(c != null && c.some((h) => h.id === f))
1295
- );
1296
- if (g && (c != null && c.length)) {
1297
- t.value = g.id;
1298
- return;
1299
- }
1300
- const b = (f) => !!f && !!(a != null && a.some((h) => h.id === f));
1301
- b(l) || (t.value = b(i) ? i : (S = (a == null ? void 0 : a.find(({ is_default: f }) => f)) ?? n.value[0]) == null ? void 0 : S.id);
1302
- },
1303
- { immediate: !0 }
1304
- ), { sortedPaymentMethods: n };
1305
- }
1306
- function ye() {
1307
- const { $t: e, formatNumber: t } = Q(), o = (a) => Ce(e, t, a);
1308
- return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
1309
- }
1310
- const ko = { class: "sv-top-up-form" }, qo = { class: "grid grid-cols-1 gap-4" }, Vo = { class: "grid grid-cols-1 gap-1" }, Fo = { class: "sv-top-up-form__option-details" }, Lo = { key: 0 }, Yo = /* @__PURE__ */ z({
1311
- __name: "TopUpModalForm",
1312
- props: {
1313
- topUpPricingItems: { type: null },
1314
- paymentMethods: { type: Array },
1315
- paymentMethodOptions: { type: Array },
1316
- autoTopUpConfig: { type: Object }
1317
- },
1318
- emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
1319
- setup(e, { expose: t, emit: o }) {
1320
- const n = e, a = o, { $t: i } = Q(), { formatValue: l } = ye(), u = $({
1321
- pricing_plan_schedule_id: "",
1322
- pricing_items: [],
1323
- start_at: "",
1324
- finalize_immediately: !1,
1325
- payment_method_id: void 0,
1326
- preview: !0
1327
- }), c = s(() => {
1328
- const d = (n.topUpPricingItems ?? []).filter(
1329
- (m) => m.flexiblePricing || m.fixedPricing
1330
- );
1331
- return [
1332
- ...d.filter(({ flexiblePricing: m }) => m),
1333
- ...d.filter(({ flexiblePricing: m }) => !m)
1334
- ];
1335
- }), g = (d) => c.value.find((m) => m.pricingItemId === d), b = s(
1336
- () => {
1337
- var d, m;
1338
- return (m = (d = n.topUpPricingItems) == null ? void 0 : d.find((M) => M.pricingPlanScheduleId)) == null ? void 0 : m.pricingPlanScheduleId;
1339
- }
1340
- );
1341
- X(
1342
- b,
1343
- (d) => {
1344
- u.value.pricing_plan_schedule_id = d ?? "";
1345
- },
1346
- { immediate: !0 }
1347
- );
1348
- const S = (d) => {
1349
- const { config: m, currency: M } = d.flexiblePricing ?? {}, q = m == null ? void 0 : m.minimum_amount;
1350
- return q && M ? { quantity: q.quantity, currency: M } : void 0;
1351
- }, f = s({
1352
- get: () => {
1353
- var d;
1354
- return (d = u.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
1355
- },
1356
- set: (d) => {
1357
- const m = g(typeof d == "string" ? d : void 0);
1358
- if (!m) {
1359
- u.value.pricing_items = [];
1360
- return;
1361
- }
1362
- const M = S(m);
1363
- u.value.pricing_items = [
1364
- {
1365
- pricing_item_id: m.pricingItemId,
1366
- ...M && { flexible_amount: M }
1367
- }
1368
- ];
1369
- }
1370
- });
1371
- X(
1372
- c,
1373
- (d) => {
1374
- if (d.some(
1375
- ({ pricingItemId: q }) => {
1376
- var Y;
1377
- return q === ((Y = u.value.pricing_items[0]) == null ? void 0 : Y.pricing_item_id);
1378
- }
1379
- ))
1380
- return;
1381
- const M = d.find(({ flexiblePricing: q }) => q) ?? d[0];
1382
- f.value = M == null ? void 0 : M.pricingItemId;
1383
- },
1384
- { immediate: !0 }
1385
- );
1386
- const h = s({
1387
- get: () => {
1388
- var d;
1389
- return (d = u.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
1390
- },
1391
- set: (d) => {
1392
- var M;
1393
- const m = (M = u.value.pricing_items[0]) == null ? void 0 : M.pricing_item_id;
1394
- m && (u.value.pricing_items = [
1395
- { pricing_item_id: m, ...d && { flexible_amount: d } }
1396
- ]);
1397
- }
1398
- }), v = (d) => {
1399
- var M;
1400
- const m = (M = g(String(d))) == null ? void 0 : M.fixedPricing;
1401
- return m != null && m.value.credits ? $e(m.amount) : void 0;
1402
- }, U = s(
1403
- () => {
1404
- var d;
1405
- return (d = g(String(f.value))) == null ? void 0 : d.flexiblePricing;
1406
- }
1407
- ), B = s({
1408
- get: () => {
1409
- var d;
1410
- return ((d = h.value) == null ? void 0 : d.quantity) ?? "";
1411
- },
1412
- set: (d) => {
1413
- var M;
1414
- const m = (M = U.value) == null ? void 0 : M.currency;
1415
- h.value = d && m ? { quantity: d, currency: m } : void 0;
1416
- }
1417
- }), J = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", y = s(() => pt(n.topUpPricingItems)), p = (d) => d.creditsConfiguration ? y.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, P = (d) => {
1418
- var M;
1419
- const m = (M = g(String(d))) == null ? void 0 : M.flexiblePricing;
1420
- return m ? [m] : [];
1421
- }, E = (d) => {
1422
- var m;
1423
- return !!((m = g(String(d))) != null && m.flexiblePricing);
1424
- }, D = s(
1425
- () => c.value.map((d) => {
1426
- var m;
1427
- return {
1428
- value: d.pricingItemId,
1429
- label: d.fixedPricing ? l(d.fixedPricing.value) : i({
1430
- defaultMessage: "Choose your own amount",
1431
- description: "Label of the choose-your-amount option in the top-up modal",
1432
- id: "topup_modal.flexible_option.label"
1433
- }),
1434
- ...((m = d.flexiblePricing) == null ? void 0 : m.bounds.minimum) && d.flexiblePricing.bounds.maximum && {
1435
- description: i(
1436
- {
1437
- defaultMessage: "Between {minimum} and {maximum}",
1438
- description: "Bounds of the choose-your-amount option in the top-up modal",
1439
- id: "topup_modal.flexible_option.bounds"
1440
- },
1441
- {
1442
- minimum: l(d.flexiblePricing.bounds.minimum),
1443
- maximum: l(d.flexiblePricing.bounds.maximum)
1444
- }
1445
- )
1446
- }
1447
- };
1448
- })
1449
- ), k = s(() => {
1450
- const d = u.value.pricing_items.filter(
1451
- (m) => {
1452
- var M;
1453
- return !((M = g(m.pricing_item_id)) != null && M.flexiblePricing) || !!m.flexible_amount;
1454
- }
1455
- );
1456
- return d.length > 0 ? d : void 0;
1457
- }), T = s(() => !n.autoTopUpConfig && c.value.some(({ flexiblePricing: m }) => m) ? mt(n.topUpPricingItems) : void 0), x = $(), { chargeOnDemandPricingItems: G } = it(), de = _e(), Z = $(!1), te = s(
1458
- () => !!u.value.pricing_plan_schedule_id && !!k.value && !!u.value.payment_method_id
1459
- ), ce = Ae({
1460
- paymentMethodId: s(() => u.value.payment_method_id ?? null)
1461
- }), ne = xe(
1462
- {
1463
- paymentMethodId: {
1464
- required: ie.withMessage(
1465
- () => i({
1466
- defaultMessage: "Select a payment method to pay for this top-up.",
1467
- description: "Error shown under the payment methods in the top-up modal when none is selected on submit",
1468
- id: "topup_modal.payment_method_required"
1469
- }),
1470
- ot
1471
- )
1472
- }
1473
- },
1474
- ce
1475
- ), oe = s(() => {
1476
- const [d] = u.value.pricing_items, m = g(d == null ? void 0 : d.pricing_item_id);
1477
- return m ? Co(m, d == null ? void 0 : d.flexible_amount) : void 0;
1478
- });
1479
- async function pe() {
1480
- var m, M, q;
1481
- ne.value.$touch();
1482
- const d = (m = x.value) == null ? void 0 : m.validate();
1483
- if (!(ne.value.$invalid || (M = x.value) != null && M.isInvalid || !te.value || Z.value)) {
1484
- Z.value = !0;
1485
- try {
1486
- const Y = await G({
1487
- pricing_plan_schedule_id: u.value.pricing_plan_schedule_id,
1488
- pricing_items: k.value ?? [],
1489
- payment_method_id: u.value.payment_method_id,
1490
- preview: !1
1491
- });
1492
- d && ((q = x.value) != null && q.hasChanges) && u.value.payment_method_id && a("save-auto-top-up", {
1493
- rule: d,
1494
- paymentMethodId: u.value.payment_method_id
1495
- }), a("success", Y);
1496
- } catch (Y) {
1497
- de.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, Y), a("failure", Y);
1498
- } finally {
1499
- Z.value = !1;
1500
- }
1501
- }
1502
- }
1503
- t({ submit: pe, isCharging: Z, canSubmit: te, chargedValue: oe });
1504
- const ae = s({
1505
- get: () => u.value.payment_method_id ?? void 0,
1506
- set: (d) => {
1507
- u.value.payment_method_id = d;
1508
- }
1509
- }), { sortedPaymentMethods: me } = yt({
1510
- paymentMethods: s(() => n.paymentMethods),
1511
- selectedPaymentMethodId: ae
1512
- });
1513
- return (d, m) => (w(), W("form", ko, [
1514
- N("div", qo, [
1515
- N("div", Vo, [
1516
- D.value.length > 0 ? (w(), C(r(tt), {
1517
- key: 0,
1518
- modelValue: f.value,
1519
- "onUpdate:modelValue": m[3] || (m[3] = (M) => f.value = M),
1520
- class: "sv-top-up-form__options",
1521
- name: "top-up-pricing-item",
1522
- direction: "column",
1523
- required: "",
1524
- disabled: Z.value,
1525
- options: D.value,
1526
- "show-radio": !1,
1527
- label: r(i)({
1528
- defaultMessage: "Top up amount",
1529
- description: "Label above the list of ways to top up the wallet in the top-up modal",
1530
- id: "topup_modal.pricing_items.label"
1531
- })
1532
- }, {
1533
- label: _(({ option: M, optionValue: q }) => [
1534
- N("span", null, I(M.label), 1),
1535
- v(q) ? (w(), C(r(K), {
1536
- key: 0,
1537
- tag: "span",
1538
- variant: "body-sm",
1539
- color: "subtle",
1540
- weight: "normal",
1541
- "no-spacing": "",
1542
- class: "sv-top-up-form__option-cost"
1543
- }, {
1544
- default: _(() => [
1545
- F(I(v(q)), 1)
1546
- ]),
1547
- _: 2
1548
- }, 1024)) : R("", !0)
1549
- ]),
1550
- description: _(({ option: M, optionValue: q }) => [
1551
- N("div", Fo, [
1552
- M.description && !E(q) ? (w(), C(r(K), {
1553
- key: 0,
1554
- tag: "span",
1555
- variant: "body-xs",
1556
- color: "subtle",
1557
- "no-spacing": ""
1558
- }, {
1559
- default: _(() => [
1560
- F(I(M.description), 1)
1561
- ]),
1562
- _: 2
1563
- }, 1024)) : R("", !0),
1564
- P(q).length > 0 ? (w(), C(r(nt), {
1565
- key: 1,
1566
- "is-open": String(q) === f.value,
1567
- lazy: ""
1568
- }, {
1569
- default: _(() => [
1570
- (w(!0), W(he, null, ge(P(q), (Y) => {
1571
- var V;
1572
- return w(), W("div", {
1573
- key: Y.currency,
1574
- class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
1575
- onClick: m[1] || (m[1] = Ne(() => {
1576
- }, ["stop"])),
1577
- onKeydown: m[2] || (m[2] = Ne(() => {
1578
- }, ["stop"]))
1579
- }, [
1580
- M.description ? (w(), C(r(K), {
1581
- key: 0,
1582
- tag: "span",
1583
- variant: "body-xs",
1584
- color: "subtle",
1585
- "no-spacing": ""
1586
- }, {
1587
- default: _(() => [
1588
- F(I(M.description), 1)
1589
- ]),
1590
- _: 2
1591
- }, 1024)) : R("", !0),
1592
- A(Pe, {
1593
- modelValue: B.value,
1594
- "onUpdate:modelValue": m[0] || (m[0] = (j) => B.value = j),
1595
- name: "top-up-amount",
1596
- "model-base": "AMOUNT",
1597
- unit: p(Y),
1598
- "entry-base": J(Y),
1599
- currency: Y.currency,
1600
- "conversion-rate": (V = Y.creditsConfiguration) == null ? void 0 : V.conversionRate,
1601
- required: "",
1602
- disabled: Z.value
1603
- }, null, 8, ["modelValue", "unit", "entry-base", "currency", "conversion-rate", "disabled"])
1604
- ], 32);
1605
- }), 128))
1606
- ]),
1607
- _: 2
1608
- }, 1032, ["is-open"])) : R("", !0)
1609
- ])
1610
- ]),
1611
- _: 1
1612
- }, 8, ["modelValue", "disabled", "options", "label"])) : R("", !0)
1613
- ]),
1614
- N("div", null, [
1615
- A(vt, {
1616
- "pricing-plan-schedule-id": b.value,
1617
- "pricing-items": k.value
1618
- }, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
1619
- ]),
1620
- T.value ? (w(), W("div", Lo, [
1621
- A(_t, le({
1622
- ref_key: "autoTopUpFormRef",
1623
- ref: x,
1624
- class: "sv-top-up-form__auto-top-up"
1625
- }, T.value, {
1626
- contained: "",
1627
- "show-threshold-conversion": !1,
1628
- disabled: Z.value
1629
- }), null, 16, ["disabled"])
1630
- ])) : R("", !0),
1631
- N("div", null, [
1632
- A(r(Yt), { spacing: "xs" })
1633
- ]),
1634
- N("div", null, [
1635
- se(d.$slots, "payment-method", {}, () => [
1636
- A(st, {
1637
- modelValue: ae.value,
1638
- "onUpdate:modelValue": m[4] || (m[4] = (M) => ae.value = M),
1639
- class: "sv-top-up-form__payment-methods",
1640
- "payment-methods": r(me),
1641
- required: "",
1642
- error: r(ne).paymentMethodId.$errors,
1643
- "payment-method-options": e.paymentMethodOptions,
1644
- disabled: Z.value,
1645
- label: r(i)({
1646
- defaultMessage: "Payment method",
1647
- description: "Label above the payment method that pays for the top-up, in the top-up modal",
1648
- id: "topup_modal.payment_method_selector.label"
1649
- }),
1650
- onAddPaymentMethod: m[5] || (m[5] = (M) => a("add-payment-method"))
1651
- }, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
1652
- ])
1653
- ])
1654
- ])
1655
- ]));
1656
- }
1657
- }), Ho = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, Wo = /* @__PURE__ */ z({
1658
- __name: "TopUpModalSuccess",
1659
- props: {
1660
- addedValue: { type: Object },
1661
- invoice: { type: Object }
1662
- },
1663
- setup(e) {
1664
- const { $t: t } = Q();
1665
- return (o, n) => (w(), W("div", Ho, [
1666
- e.invoice ? (w(), C(r(ve), {
1667
- key: 0,
1668
- "content-background": "none"
1669
- }, {
1670
- default: _(() => [
1671
- A(r(K), {
1672
- tag: "span",
1673
- variant: "body-sm",
1674
- weight: "semibold",
1675
- class: "mb-2 block"
1676
- }, {
1677
- default: _(() => [
1678
- F(I(r(t)({
1679
- defaultMessage: "Receipt",
1680
- description: "Heading above the invoice a completed top-up produced",
1681
- id: "topup_modal.success.receipt.heading"
1682
- })), 1)
1683
- ]),
1684
- _: 1
1685
- }),
1686
- A(r(at), {
1687
- invoice: e.invoice,
1688
- "is-customer-facing": ""
1689
- }, null, 8, ["invoice"])
1690
- ]),
1691
- _: 1
1692
- })) : R("", !0)
1693
- ]));
1694
- }
1695
- });
1696
- function jo({
1697
- step: e,
1698
- currentBalance: t,
1699
- topUpValue: o
1700
- }) {
1701
- const { $t: n, formatNumber: a } = Q(), i = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1702
- defaultMessage: "Add payment method",
1703
- description: "Title of the top-up modal while the customer is adding a payment method",
1704
- id: "topup_modal.add_payment_method.title"
1705
- }) : e.value === "SUCCESS" ? n({
1706
- defaultMessage: "Top-up complete",
1707
- description: "Title of the top-up modal once the top-up has been charged",
1708
- id: "topup_modal.success.modal_title"
1709
- }) : n({
1710
- defaultMessage: "Top up balance",
1711
- description: "Title of the wallet top-up modal",
1712
- id: "topup_modal.title"
1713
- })), l = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1714
- defaultMessage: "Add a new payment method for topping up your balance.",
1715
- description: "Subtitle of the top-up modal while the customer is adding a payment method",
1716
- id: "topup_modal.add_payment_method.subtitle"
1717
- }) : e.value === "SUCCESS" ? n({
1718
- defaultMessage: "Your payment went through.",
1719
- description: "Subtitle of the top-up modal once the top-up has been charged",
1720
- id: "topup_modal.success.modal_subtitle"
1721
- }) : n(
1722
- {
1723
- defaultMessage: "Your current balance is {balance}.",
1724
- description: "Subtitle of the top-up modal showing the current wallet balance",
1725
- id: "topup_modal.subtitle"
1726
- },
1727
- { balance: t.value }
1728
- )), u = s(
1729
- () => e.value === "ADD_PAYMENT_METHOD" ? n({
1730
- defaultMessage: "Back",
1731
- description: "Label of the button that leaves the add payment method step in the top-up modal",
1732
- id: "topup_modal.back_button.label"
1733
- }) : n({
1734
- defaultMessage: "Cancel",
1735
- description: "Label of the button that closes the top-up modal",
1736
- id: "topup_modal.cancel_button.label"
1737
- })
1738
- ), c = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1739
- defaultMessage: "Save payment method",
1740
- description: "Label of the confirm button in the top-up modal while adding a payment method",
1741
- id: "topup_modal.save_payment_method.label"
1742
- }) : e.value === "SUCCESS" ? n({
1743
- defaultMessage: "Done",
1744
- description: "Label of the button that dismisses the top-up modal once the top-up has been charged",
1745
- id: "topup_modal.done_button.label"
1746
- }) : o.value ? n(
1747
- {
1748
- defaultMessage: "Top up balance with {value}",
1749
- description: "Label of the confirm button in the top-up modal once an amount is entered",
1750
- id: "topup_modal.confirm_button.label"
1751
- },
1752
- { value: Ce(n, a, o.value) }
1753
- ) : n({
1754
- defaultMessage: "Top up balance",
1755
- description: "Label of the confirm button in the top-up modal while no amount is entered",
1756
- id: "topup_modal.confirm_button.empty.label"
1757
- }));
1758
- return { title: i, subTitle: l, cancelButtonText: u, confirmButtonText: c };
1759
- }
1760
- function bt({
1761
- isOpen: e,
1762
- customer: t,
1763
- subscriptionId: o,
1764
- onError: n
1765
- }) {
1766
- const { paymentMethodOptions: a, get: i, isPending: l } = Kt(), u = async () => {
1767
- const g = t.value;
1768
- if (!(!e.value || !g))
1769
- try {
1770
- await i({
1771
- customerId: g.id,
1772
- ...o != null && o.value ? { subscriptionId: o.value } : {},
1773
- country: Gt(g)
1774
- });
1775
- } catch (b) {
1776
- n == null || n(b);
1777
- }
1778
- };
1779
- X(
1780
- () => [e.value, t.value, o == null ? void 0 : o.value],
1781
- () => void u(),
1782
- { immediate: !0 }
1783
- );
1784
- const c = s(
1785
- () => l.value ? void 0 : a.value
1786
- );
1787
- return { paymentMethodOptions: a, settledOptions: c, isPending: l, load: u };
1788
- }
1789
- function zo(e) {
1790
- const t = $(0), o = (a) => {
1791
- t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
1792
- }, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
1793
- var l;
1794
- const i = (l = a[0]) == null ? void 0 : l.target;
1795
- o(i instanceof HTMLElement ? i : void 0);
1796
- });
1797
- return X(
1798
- e,
1799
- (a, i) => {
1800
- i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
1801
- },
1802
- // `post` so the callback runs after the render that assigns the template ref, not before.
1803
- { immediate: !0, flush: "post" }
1804
- ), Se(() => {
1805
- n == null || n.disconnect();
1806
- }), t;
1807
- }
1808
- const Qo = ["inert"], Go = 300, Ko = "1rem", Xo = /* @__PURE__ */ z({
1809
- __name: "SlidingPanes",
1810
- props: {
1811
- panes: { type: Array },
1812
- current: { type: String }
1813
- },
1814
- setup(e) {
1815
- const t = e, o = $(!1);
1816
- let n;
1817
- X(
1818
- () => t.current,
1819
- () => {
1820
- o.value = !0, clearTimeout(n), n = setTimeout(() => {
1821
- o.value = !1;
1822
- }, Go);
1823
- }
1824
- ), Se(() => {
1825
- clearTimeout(n);
1826
- });
1827
- const a = $({}), i = {}, l = (b) => i[b] ?? (i[b] = (S) => {
1828
- a.value[b] = S instanceof HTMLElement ? S : void 0;
1829
- }), u = s(() => a.value[t.current]), c = zo(u), g = s(() => {
1830
- const b = t.panes.indexOf(t.current);
1831
- return b > 0 ? `translateX(calc(${-b} * (100% + ${Ko})))` : "translateX(0px)";
1832
- });
1833
- return (b, S) => (w(), W("div", {
1834
- class: ze([
1835
- "sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
1836
- o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
1837
- ]),
1838
- style: Re(r(c) ? { height: `${r(c)}px` } : void 0)
1839
- }, [
1840
- N("div", {
1841
- class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
1842
- style: Re({ transform: g.value })
1843
- }, [
1844
- (w(!0), W(he, null, ge(e.panes, (f) => (w(), W("div", {
1845
- key: f,
1846
- class: "sv-sliding-panes__pane w-full shrink-0",
1847
- inert: f !== e.current || void 0
1848
- }, [
1849
- N("div", {
1850
- ref_for: !0,
1851
- ref: l(f)
1852
- }, [
1853
- se(b.$slots, f)
1854
- ], 512)
1855
- ], 8, Qo))), 128))
1856
- ], 4)
1857
- ], 6));
1858
- }
1859
- }), wt = /* @__PURE__ */ z({
1860
- inheritAttrs: !1,
1861
- __name: "OnDemandPaymentModalShell",
1862
- props: {
1863
- showModal: { type: Boolean },
1864
- title: { type: String },
1865
- subTitle: { type: String },
1866
- cancelButtonText: { type: String },
1867
- confirmButtonText: { type: String },
1868
- isPending: { type: Boolean },
1869
- panes: { type: Array },
1870
- step: { type: String },
1871
- addPaymentMethodPane: { type: String },
1872
- customer: { type: Object },
1873
- paymentMethodOptions: { type: Array },
1874
- isPaymentMethodOptionsPending: { type: Boolean },
1875
- isAddingPaymentMethod: { type: Boolean }
1876
- },
1877
- emits: ["confirm", "cancel", "payment-success", "payment-failed"],
1878
- setup(e, { expose: t }) {
1879
- const o = e, n = $(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
1880
- return t({
1881
- submit: () => {
1882
- var i;
1883
- return (i = n.value) == null ? void 0 : i.submit();
1884
- },
1885
- isSaving: s(() => {
1886
- var i;
1887
- return !!((i = n.value) != null && i.isSaving);
1888
- })
1889
- }), (i, l) => (w(), C(r(lt), {
1890
- "no-click-away": "",
1891
- "show-modal": e.showModal,
1892
- size: "lg",
1893
- title: e.title,
1894
- "sub-title": e.subTitle,
1895
- "cancel-button-text": e.cancelButtonText,
1896
- "confirm-button-text": e.confirmButtonText,
1897
- "is-loading": e.isPending,
1898
- onConfirm: l[2] || (l[2] = (u) => i.$emit("confirm")),
1899
- onClose: l[3] || (l[3] = (u) => i.$emit("cancel"))
1900
- }, re({
1901
- body: _(() => [
1902
- N("div", le({ class: "grid grid-cols-1 gap-4 pb-4" }, i.$attrs), [
1903
- A(Xo, {
1904
- panes: e.panes,
1905
- current: e.step
1906
- }, re({
1907
- [e.addPaymentMethodPane]: _(() => [
1908
- A(zt, {
1909
- ref_key: "paneRef",
1910
- ref: n,
1911
- customer: e.customer,
1912
- "payment-method-options": e.paymentMethodOptions,
1913
- "is-loading": e.isPaymentMethodOptionsPending,
1914
- "is-active": e.isAddingPaymentMethod,
1915
- onSuccess: l[0] || (l[0] = (u) => i.$emit("payment-success")),
1916
- onFailure: l[1] || (l[1] = (u) => i.$emit("payment-failed", u))
1917
- }, null, 8, ["customer", "payment-method-options", "is-loading", "is-active"])
1918
- ]),
1919
- _: 2
1920
- }, [
1921
- ge(a.value, (u) => ({
1922
- name: u,
1923
- fn: _(() => [
1924
- se(i.$slots, u)
1925
- ])
1926
- }))
1927
- ]), 1032, ["panes", "current"])
1928
- ], 16)
1929
- ]),
1930
- _: 2
1931
- }, [
1932
- i.$slots.footer ? {
1933
- name: "footer",
1934
- fn: _(() => [
1935
- se(i.$slots, "footer")
1936
- ]),
1937
- key: "0"
1938
- } : void 0
1939
- ]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-loading"]));
1940
- }
1941
- }), Tt = (e) => {
1942
- var t;
1943
- return (((t = e == null ? void 0 : e.wallet) == null ? void 0 : t.auto_top_up_configs) ?? []).find(
1944
- ({ status: o }) => o === "ACTIVE"
1945
- );
1946
- }, Mt = (e) => e ? {
1947
- status: e.status,
1948
- threshold: e.threshold,
1949
- ...e.topup_amount && { topup_amount: e.topup_amount }
1950
- } : void 0, Ut = (e, t = []) => {
1951
- if (e != null && e.pricing_item_id && e.pricing_plan_schedule_id)
1952
- return {
1953
- pricingItemId: e.pricing_item_id,
1954
- pricingPlanScheduleId: e.pricing_plan_schedule_id
1955
- };
1956
- const o = t.find(
1957
- ({ flexiblePricing: n, pricingPlanScheduleId: a }) => n && a
1958
- );
1959
- return o != null && o.pricingPlanScheduleId ? {
1960
- pricingItemId: o.pricingItemId,
1961
- pricingPlanScheduleId: o.pricingPlanScheduleId
1962
- } : void 0;
1963
- }, Pt = ({
1964
- rule: e,
1965
- walletBalanceItem: t,
1966
- chargeTarget: o,
1967
- paymentMethodId: n
1968
- }) => {
1969
- var i, l;
1970
- const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((l = e == null ? void 0 : e.threshold) == null ? void 0 : l.credits));
1971
- if (!(!e || !a || !(t != null && t.wallet_id) || !o || !n))
1972
- return {
1973
- wallet_id: t.wallet_id,
1974
- status: e.status,
1975
- threshold: e.threshold,
1976
- pricing_plan_schedule_id: o.pricingPlanScheduleId,
1977
- pricing_item_id: o.pricingItemId,
1978
- payment_method_id: n,
1979
- ...e.topup_amount && { topup_amount: e.topup_amount }
1980
- };
1981
- };
1982
- function St({
1983
- step: e,
1984
- name: t,
1985
- returnTo: o
1986
- }) {
1987
- const n = $();
1988
- return {
1989
- paneRef: n,
1990
- isActive: s(() => e.value === t),
1991
- isSaving: s(() => {
1992
- var a;
1993
- return !!((a = n.value) != null && a.isSaving);
1994
- }),
1995
- open: () => {
1996
- e.value = t;
1997
- },
1998
- leave: () => {
1999
- e.value = o;
2000
- },
2001
- submit: () => {
2002
- var a;
2003
- return (a = n.value) == null ? void 0 : a.submit();
2004
- }
2005
- };
2006
- }
2007
- function At() {
2008
- const e = Qe(), t = Ge(), o = "/portal/auto-top-up-configs";
2009
- function n(u) {
2010
- return e({
2011
- url: `${t.apiUrls.config}${o}`,
2012
- query: { ...u },
2013
- isCollection: !0
2014
- });
2015
- }
2016
- function a(u) {
2017
- return e({
2018
- url: `${t.apiUrls.config}${o}/${u}`
2019
- });
2020
- }
2021
- function i(u) {
2022
- return e({
2023
- url: `${t.apiUrls.config}${o}`,
2024
- options: { method: "POST" },
2025
- data: u
2026
- });
2027
- }
2028
- function l(u) {
2029
- return e({
2030
- url: `${t.apiUrls.config}${o}/${u}/deactivate`,
2031
- options: { method: "POST" }
2032
- });
2033
- }
2034
- return {
2035
- getAutoTopUpConfigs: n,
2036
- getAutoTopUpConfig: a,
2037
- createAutoTopUpConfig: i,
2038
- deactivateAutoTopUpConfig: l
2039
- };
2040
- }
2041
- function Ct() {
2042
- const { createAutoTopUpConfig: e } = At(), t = _e(), o = $(!1);
2043
- return { save: async (a) => {
2044
- if (!a || o.value)
2045
- return { saved: !1 };
2046
- o.value = !0;
2047
- try {
2048
- return await e(a), { saved: !0 };
2049
- } catch (i) {
2050
- return t.error(
2051
- "AUTO_TOP_UP_SAVE_FAILED",
2052
- "Failed to save the automatic top-up rule",
2053
- {},
2054
- i
2055
- ), { saved: !1, error: i };
2056
- } finally {
2057
- o.value = !1;
2058
- }
2059
- }, isSaving: o };
2060
- }
2061
- const Jo = {
2062
- key: 0,
2063
- class: "mb-4"
2064
- }, Zo = { class: "sr-only" }, en = { class: "flex flex-col gap-2" }, tn = /* @__PURE__ */ z({
2065
- __name: "TopUpModal",
2066
- props: {
2067
- showModal: { type: Boolean },
2068
- selectedBalanceItem: { type: Object },
2069
- paymentMethods: { type: Array },
2070
- customer: { type: Object },
2071
- subscriptions: { type: Array }
2072
- },
2073
- emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
2074
- setup(e, { emit: t }) {
2075
- const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), l = s(
2076
- () => Mt(Tt(o.selectedBalanceItem))
2077
- ), u = s(() => i(o.selectedBalanceItem)), c = s(
2078
- () => ho(o.selectedBalanceItem, o.subscriptions ?? [])
2079
- ), g = $();
2080
- X(
2081
- c,
2082
- (O) => {
2083
- var L;
2084
- O.some(
2085
- ({ id: be }) => be === g.value
2086
- ) || (g.value = (L = O[0]) == null ? void 0 : L.id);
2087
- },
2088
- { immediate: !0 }
2089
- );
2090
- const b = s(() => c.value.length > 1), S = s(
2091
- () => c.value.map(({ id: O, name: H }) => ({ value: O, label: H }))
2092
- ), f = s(
2093
- () => Object.fromEntries(
2094
- c.value.flatMap(({ id: O, enabledPricingIds: H }) => {
2095
- const L = (o.subscriptions ?? []).find(({ id: be }) => be === O);
2096
- return L ? [[O, { subscription: L, enabledPricingIds: H }]] : [];
2097
- })
2098
- )
2099
- ), h = s(() => {
2100
- var H;
2101
- if (!o.selectedBalanceItem || !((H = o.subscriptions) != null && H.length))
2102
- return o.selectedBalanceItem;
2103
- const O = c.value.find(({ id: L }) => L === g.value);
2104
- return O ? go(o.selectedBalanceItem, O.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
2105
- }), v = s(() => ut(h.value)), {
2106
- paymentMethodOptions: U,
2107
- settledOptions: B,
2108
- isPending: J
2109
- } = bt({
2110
- isOpen: s(() => o.showModal),
2111
- customer: s(() => o.customer)
2112
- }), y = $("TOP_UP"), p = s(() => (o.paymentMethods ?? []).length > 0), P = s(
2113
- () => !J.value && (U.value ?? []).length === 0
2114
- ), E = s(
2115
- () => y.value === "TOP_UP" && !p.value && P.value
2116
- ), D = $(), k = $(), T = () => {
2117
- te(), n("payment-success");
2118
- }, {
2119
- paneRef: x,
2120
- isActive: G,
2121
- isSaving: de,
2122
- open: Z,
2123
- leave: te,
2124
- submit: ce
2125
- } = St({ step: y, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: ne } = Ct(), oe = $(), pe = s(() => {
2126
- var O;
2127
- return (O = oe.value) == null ? void 0 : O.chargedValue;
2128
- }), ae = s(() => {
2129
- var O;
2130
- return de.value || !!((O = oe.value) != null && O.isCharging);
2131
- }), { title: me, subTitle: d, cancelButtonText: m, confirmButtonText: M } = jo({
2132
- step: y,
2133
- currentBalance: u,
2134
- topUpValue: pe
2135
- }), q = () => {
2136
- var O;
2137
- if (G.value) {
2138
- ce();
2139
- return;
2140
- }
2141
- (O = oe.value) == null || O.submit();
2142
- }, Y = async ({
2143
- rule: O,
2144
- paymentMethodId: H
2145
- }) => {
2146
- const { saved: L } = await ne(
2147
- Pt({
2148
- rule: O,
2149
- walletBalanceItem: o.selectedBalanceItem,
2150
- chargeTarget: Ut(void 0, v.value),
2151
- paymentMethodId: H
2152
- })
2153
- );
2154
- L && n("auto-top-up-saved");
2155
- }, V = (O) => {
2156
- var H;
2157
- D.value = O, k.value = (H = oe.value) == null ? void 0 : H.chargedValue, y.value = "SUCCESS";
2158
- }, j = () => {
2159
- n("confirm"), n("close");
2160
- }, ee = () => {
2161
- if (!ae.value) {
2162
- if (G.value) {
2163
- te();
2164
- return;
2165
- }
2166
- if (y.value === "SUCCESS") {
2167
- j();
2168
- return;
2169
- }
2170
- n("close");
2171
- }
2172
- }, De = $(0);
2173
- return X(
2174
- () => o.showModal,
2175
- (O) => {
2176
- O && (y.value = "TOP_UP", D.value = void 0, k.value = void 0, De.value += 1);
2177
- }
2178
- ), (O, H) => (w(), C(wt, {
2179
- ref_key: "addPaymentMethodRef",
2180
- ref: x,
2181
- "show-modal": e.showModal,
2182
- title: r(me),
2183
- "sub-title": r(d),
2184
- "cancel-button-text": r(m),
2185
- "confirm-button-text": r(M),
2186
- "is-pending": ae.value,
2187
- panes: r(vo),
2188
- step: y.value,
2189
- "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2190
- customer: e.customer,
2191
- "payment-method-options": r(U),
2192
- "is-payment-method-options-pending": r(J),
2193
- "is-adding-payment-method": r(G),
2194
- onConfirm: q,
2195
- onCancel: ee,
2196
- onPaymentSuccess: T,
2197
- onPaymentFailed: H[1] || (H[1] = (L) => O.$emit("payment-failed", L))
2198
- }, re({
2199
- TOP_UP: _(() => [
2200
- b.value ? (w(), W("div", Jo, [
2201
- A(r(tt), {
2202
- modelValue: g.value,
2203
- "onUpdate:modelValue": H[0] || (H[0] = (L) => g.value = L),
2204
- class: "sv-topup-modal__subscription",
2205
- name: "top-up-subscription",
2206
- direction: "column",
2207
- required: "",
2208
- options: S.value,
2209
- "show-radio": !1,
2210
- label: r(a)({
2211
- defaultMessage: "Subscription to top up",
2212
- description: "Label above the list of subscriptions a top-up can be charged against, in the top-up modal",
2213
- id: "topup_modal.subscriptions.label"
2214
- })
2215
- }, {
2216
- prefix: _(({ optionValue: L }) => [
2217
- f.value[String(L)] ? (w(), C(Qt, {
2218
- key: 0,
2219
- class: "sv-topup-modal__subscription-option grow",
2220
- "no-spacing": "",
2221
- subscription: f.value[String(L)].subscription,
2222
- "enabled-pricing-ids": f.value[String(L)].enabledPricingIds
2223
- }, null, 8, ["subscription", "enabled-pricing-ids"])) : R("", !0)
2224
- ]),
2225
- label: _(({ option: L }) => [
2226
- N("span", Zo, I(L.label), 1)
2227
- ]),
2228
- _: 1
2229
- }, 8, ["modelValue", "options", "label"])
2230
- ])) : R("", !0),
2231
- (w(), C(Yo, {
2232
- key: De.value,
2233
- ref_key: "topUpFormRef",
2234
- ref: oe,
2235
- "top-up-pricing-items": v.value,
2236
- "payment-methods": e.paymentMethods,
2237
- "auto-top-up-config": l.value,
2238
- "payment-method-options": r(B),
2239
- onAddPaymentMethod: r(Z),
2240
- onSuccess: V,
2241
- onSaveAutoTopUp: Y
2242
- }, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"]))
2243
- ]),
2244
- SUCCESS: _(() => [
2245
- D.value ? (w(), C(Wo, {
2246
- key: 0,
2247
- "added-value": k.value,
2248
- invoice: D.value
2249
- }, null, 8, ["added-value", "invoice"])) : R("", !0)
2250
- ]),
2251
- _: 2
2252
- }, [
2253
- y.value === "SUCCESS" || E.value ? {
2254
- name: "footer",
2255
- fn: _(() => [
2256
- N("div", en, [
2257
- y.value === "SUCCESS" ? (w(), C(r(ue), {
2258
- key: 0,
2259
- size: "lg",
2260
- onClick: j
2261
- }, {
2262
- default: _(() => [
2263
- F(I(r(M)), 1)
2264
- ]),
2265
- _: 1
2266
- })) : (w(), W(he, { key: 1 }, [
2267
- A(r(ue), {
2268
- size: "lg",
2269
- disabled: ""
2270
- }, {
2271
- default: _(() => [
2272
- F(I(r(M)), 1)
2273
- ]),
2274
- _: 1
2275
- }),
2276
- A(r(ue), {
2277
- size: "lg",
2278
- intent: "subtle",
2279
- onClick: ee
2280
- }, {
2281
- default: _(() => [
2282
- F(I(r(m)), 1)
2283
- ]),
2284
- _: 1
2285
- })
2286
- ], 64))
2287
- ])
2288
- ]),
2289
- key: "0"
2290
- } : void 0
2291
- ]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending", "is-adding-payment-method"]));
2292
- }
2293
- }), on = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], nn = { class: "grid grid-cols-1 gap-4" }, an = /* @__PURE__ */ z({
2294
- __name: "AutoTopUpModal",
2295
- props: {
2296
- showModal: { type: Boolean },
2297
- walletBalanceItem: { type: Object },
2298
- topUpItem: { type: Object },
2299
- paymentMethods: { type: Array },
2300
- customer: { type: Object }
2301
- },
2302
- emits: ["saved", "close", "payment-success", "payment-failed"],
2303
- setup(e, { emit: t }) {
2304
- const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = ye(), l = $("AUTO_TOP_UP"), u = s(() => i(o.walletBalanceItem)), c = s(() => ut(o.walletBalanceItem)), g = s(() => mt(c.value)), b = s(() => Tt(o.walletBalanceItem)), S = s(() => Mt(b.value)), f = s(
2305
- () => Ut(o.topUpItem, c.value)
2306
- ), h = $(), v = s(() => {
2307
- var j, ee;
2308
- const V = (ee = (j = h.value) == null ? void 0 : j.rule) == null ? void 0 : ee.topup_amount;
2309
- return V != null && V.quantity && f.value ? [{ pricing_item_id: f.value.pricingItemId, flexible_amount: V }] : void 0;
2310
- }), U = s(() => {
2311
- var V;
2312
- return (V = f.value) == null ? void 0 : V.pricingPlanScheduleId;
2313
- }), B = $(), { sortedPaymentMethods: J } = yt({
2314
- paymentMethods: s(() => o.paymentMethods),
2315
- selectedPaymentMethodId: B,
2316
- preferredPaymentMethodId: s(() => {
2317
- var V;
2318
- return (V = b.value) == null ? void 0 : V.payment_method_id;
2319
- })
2320
- }), {
2321
- paymentMethodOptions: y,
2322
- settledOptions: p,
2323
- isPending: P
2324
- } = bt({
2325
- isOpen: s(() => o.showModal),
2326
- customer: s(() => o.customer)
2327
- }), {
2328
- paneRef: E,
2329
- isActive: D,
2330
- isSaving: k,
2331
- open: T,
2332
- leave: x,
2333
- submit: G
2334
- } = St({ step: l, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: de, isSaving: Z } = Ct(), te = s(() => k.value || Z.value), ce = Ae({
2335
- paymentMethodId: s(() => B.value ?? null)
2336
- }), ne = xe(
2337
- {
2338
- paymentMethodId: {
2339
- required: ie.withMessage(
2340
- () => a({
2341
- defaultMessage: "Select a payment method to pay for automatic top-ups.",
2342
- description: "Error shown in the auto top-up modal when no payment method is selected",
2343
- id: "auto_topup_modal.payment_method.required"
2344
- }),
2345
- ot
2346
- )
2347
- }
2348
- },
2349
- ce
2350
- ), oe = s(
2351
- () => l.value === "ADD_PAYMENT_METHOD" ? a({
2352
- defaultMessage: "Add payment method",
2353
- description: "Title of the auto top-up modal while the customer is adding a payment method",
2354
- id: "auto_topup_modal.add_payment_method.title"
2355
- }) : a({
2356
- defaultMessage: "Automatic top-up",
2357
- description: "Title of the automatic wallet top-up modal",
2358
- id: "auto_topup_modal.title"
2359
- })
2360
- ), pe = s(
2361
- () => l.value === "ADD_PAYMENT_METHOD" ? a({
2362
- defaultMessage: "This method pays for every automatic top-up.",
2363
- description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
2364
- id: "auto_topup_modal.add_payment_method.subtitle"
2365
- }) : a(
2366
- {
2367
- defaultMessage: "Your current balance is {balance}. Enable auto top so you can stay productive",
2368
- description: "Subtitle of the automatic wallet top-up modal, naming the balance",
2369
- id: "auto_topup_modal.subtitle"
2370
- },
2371
- { balance: u.value }
2372
- )
2373
- ), ae = s(
2374
- () => l.value === "ADD_PAYMENT_METHOD" ? a({
2375
- defaultMessage: "Back",
2376
- description: "Button returning from adding a payment method to the auto top-up rule",
2377
- id: "auto_topup_modal.add_payment_method.cancel"
2378
- }) : a({
2379
- defaultMessage: "Cancel",
2380
- description: "Button dismissing the auto top-up modal",
2381
- id: "auto_topup_modal.cancel"
2382
- })
2383
- ), me = s(
2384
- () => l.value === "ADD_PAYMENT_METHOD" ? a({
2385
- defaultMessage: "Add payment method",
2386
- description: "Button storing the payment method being added in the auto top-up modal",
2387
- id: "auto_topup_modal.add_payment_method.confirm"
2388
- }) : a({
2389
- defaultMessage: "Save",
2390
- description: "Button saving the automatic top-up rule",
2391
- id: "auto_topup_modal.confirm"
2392
- })
2393
- );
2394
- async function d() {
2395
- var ee;
2396
- if (ne.value.$touch(), te.value)
2397
- return;
2398
- const { saved: V, error: j } = await de(
2399
- Pt({
2400
- rule: (ee = h.value) == null ? void 0 : ee.validate(),
2401
- walletBalanceItem: o.walletBalanceItem,
2402
- chargeTarget: f.value,
2403
- paymentMethodId: B.value
2404
- })
2405
- );
2406
- if (V) {
2407
- n("saved"), n("close");
2408
- return;
2409
- }
2410
- j && n("payment-failed", j);
2411
- }
2412
- const m = () => {
2413
- if (D.value) {
2414
- G();
2415
- return;
2416
- }
2417
- d();
2418
- }, M = () => {
2419
- x(), n("payment-success");
2420
- }, q = () => {
2421
- if (!te.value) {
2422
- if (D.value) {
2423
- x();
2424
- return;
2425
- }
2426
- n("close");
2427
- }
2428
- }, Y = $(0);
2429
- return X(
2430
- () => o.showModal,
2431
- (V) => {
2432
- V && (l.value = "AUTO_TOP_UP", B.value = void 0, Y.value += 1);
2433
- }
2434
- ), (V, j) => (w(), C(wt, {
2435
- ref_key: "addPaymentMethodRef",
2436
- ref: E,
2437
- "show-modal": e.showModal,
2438
- title: oe.value,
2439
- "sub-title": pe.value,
2440
- "cancel-button-text": ae.value,
2441
- "confirm-button-text": me.value,
2442
- "is-pending": te.value,
2443
- panes: r(on),
2444
- step: l.value,
2445
- "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2446
- customer: e.customer,
2447
- "payment-method-options": r(y),
2448
- "is-payment-method-options-pending": r(P),
2449
- "is-adding-payment-method": r(D),
2450
- onConfirm: m,
2451
- onCancel: q,
2452
- onPaymentSuccess: M,
2453
- onPaymentFailed: j[1] || (j[1] = (ee) => V.$emit("payment-failed", ee))
2454
- }, {
2455
- AUTO_TOP_UP: _(() => [
2456
- N("div", nn, [
2457
- g.value ? (w(), C(_t, le({
2458
- key: Y.value,
2459
- ref_key: "autoTopUpFormRef",
2460
- ref: h,
2461
- class: "sv-auto-topup-modal__rule"
2462
- }, g.value, {
2463
- config: S.value,
2464
- "always-enabled": "",
2465
- disabled: te.value
2466
- }), null, 16, ["config", "disabled"])) : R("", !0),
2467
- A(vt, {
2468
- "pricing-plan-schedule-id": U.value,
2469
- "pricing-items": v.value
2470
- }, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
2471
- A(st, {
2472
- modelValue: B.value,
2473
- "onUpdate:modelValue": j[0] || (j[0] = (ee) => B.value = ee),
2474
- class: "sv-auto-topup-modal__payment-method",
2475
- "payment-methods": r(J),
2476
- "payment-method-options": r(p),
2477
- disabled: te.value,
2478
- error: r(ne).paymentMethodId.$errors,
2479
- label: r(a)({
2480
- defaultMessage: "Pay automatic top-ups with",
2481
- description: "Label above the payment method an automatic top-up is charged to",
2482
- id: "auto_topup_modal.payment_method.label"
2483
- }),
2484
- onAddPaymentMethod: r(T)
2485
- }, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"])
2486
- ])
2487
- ]),
2488
- _: 1
2489
- }, 8, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending", "is-adding-payment-method"]));
2490
- }
2491
- }), sn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, ln = /* @__PURE__ */ z({
2492
- __name: "AutoTopUpCancellationModal",
2493
- props: {
2494
- showModal: { type: Boolean },
2495
- config: { type: Object }
2496
- },
2497
- emits: ["confirmed", "close"],
2498
- setup(e, { emit: t }) {
2499
- const o = e, n = t, { $t: a } = Q(), i = _e(), { formatValue: l } = ye(), { deactivateAutoTopUpConfig: u } = At(), c = $(!1), g = $(!1);
2500
- X(
2501
- () => o.showModal,
2502
- (h) => {
2503
- h && (g.value = !1);
2504
- }
2505
- );
2506
- const b = s(() => {
2507
- var U, B;
2508
- const h = (U = o.config) == null ? void 0 : U.threshold, v = (B = o.config) == null ? void 0 : B.topup_amount;
2509
- return !(h != null && h.amount) && !(h != null && h.credits) ? a({
2510
- defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
2511
- description: "Explanation in the modal that turns a wallet automatic top-up off",
2512
- id: "auto_topup_cancellation_modal.explanation"
2513
- }) : v ? a(
2514
- {
2515
- defaultMessage: "Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",
2516
- description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
2517
- id: "auto_topup_cancellation_modal.explanation_with_amount"
2518
- },
2519
- { amount: l({ amount: v }), threshold: l(h) }
2520
- ) : a(
2521
- {
2522
- defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
2523
- description: "Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",
2524
- id: "auto_topup_cancellation_modal.explanation_with_threshold"
2525
- },
2526
- { threshold: l(h) }
2527
- );
2528
- }), S = async () => {
2529
- var v;
2530
- const h = (v = o.config) == null ? void 0 : v.id;
2531
- if (!(!h || c.value)) {
2532
- c.value = !0, g.value = !1;
2533
- try {
2534
- await u(h), n("confirmed"), n("close");
2535
- } catch (U) {
2536
- i.error(
2537
- "AUTO_TOP_UP_CANCELLATION_FAILED",
2538
- "Failed to turn off a wallet's automatic top-up",
2539
- {},
2540
- U
2541
- ), g.value = !0;
2542
- } finally {
2543
- c.value = !1;
2544
- }
2545
- }
2546
- }, f = () => {
2547
- c.value || n("close");
2548
- };
2549
- return (h, v) => (w(), C(r(lt), {
2550
- size: "sm",
2551
- "show-modal": e.showModal,
2552
- "is-loading": c.value,
2553
- "no-click-away": c.value,
2554
- "no-backdrop-close": c.value,
2555
- title: r(a)({
2556
- defaultMessage: "Turn off automatic top-up",
2557
- description: "Title of the modal that turns a wallet automatic top-up off",
2558
- id: "auto_topup_cancellation_modal.title"
2559
- }),
2560
- "confirm-button-text": r(a)({
2561
- defaultMessage: "Yes, turn it off",
2562
- description: "Button confirming that a wallet automatic top-up is turned off",
2563
- id: "auto_topup_cancellation_modal.confirm"
2564
- }),
2565
- "cancel-button-text": r(a)({
2566
- defaultMessage: "Cancel",
2567
- description: "Button dismissing the modal that turns a wallet automatic top-up off",
2568
- id: "auto_topup_cancellation_modal.cancel"
2569
- }),
2570
- onConfirm: S,
2571
- onClose: f
2572
- }, {
2573
- body: _(() => [
2574
- N("div", sn, [
2575
- A(r(K), {
2576
- variant: "body-sm",
2577
- color: "subtle",
2578
- tag: "p",
2579
- class: "sv-auto-topup-cancellation-modal__explanation"
2580
- }, {
2581
- default: _(() => [
2582
- F(I(b.value), 1)
2583
- ]),
2584
- _: 1
2585
- }),
2586
- g.value ? (w(), C(r(Ke), {
2587
- key: 0,
2588
- class: "sv-auto-topup-cancellation-modal__error sv-error",
2589
- title: r(a)({
2590
- defaultMessage: "Could not turn off the automatic top-up. Please try again later.",
2591
- description: "Error shown when turning a wallet automatic top-up off failed",
2592
- id: "auto_topup_cancellation_modal.failed"
2593
- })
2594
- }, null, 8, ["title"])) : R("", !0)
2595
- ])
2596
- ]),
2597
- _: 1
2598
- }, 8, ["show-modal", "is-loading", "no-click-away", "no-backdrop-close", "title", "confirm-button-text", "cancel-button-text"]));
2599
- }
2600
- }), Nn = /* @__PURE__ */ z({
2601
- inheritAttrs: !1,
2602
- __name: "CustomerWalletBalances",
2603
- props: {
2604
- hasError: { type: Boolean },
2605
- isLoading: { type: Boolean },
2606
- walletBalances: { type: Array },
2607
- showTopUpButton: { type: Boolean },
2608
- customer: { type: Object },
2609
- paymentMethods: { type: Array },
2610
- subscriptions: { type: Array }
2611
- },
2612
- emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
2613
- setup(e, { emit: t }) {
2614
- const o = e, n = t, { $t: a } = Q(), i = $(), l = s(
2615
- () => ke(o.walletBalances, i.value)
2616
- ), u = s(() => !!l.value), c = $(), g = s(() => !!c.value), b = s(
2617
- () => ke(o.walletBalances, c.value)
2618
- ), S = $(), f = s(() => !!S.value);
2619
- return (h, v) => (w(), W(he, null, [
2620
- e.isLoading ? (w(), C(et, le({
2621
- key: 0,
2622
- variant: "section"
2623
- }, h.$attrs, { class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48" }), null, 16)) : e.hasError ? (w(), C(r(Ke), le({ key: 1 }, h.$attrs, {
2624
- class: "sv-wallet-balances sv-root sv-component sv-error",
2625
- title: r(a)({
2626
- defaultMessage: "Could not load wallet balances",
2627
- description: "Error shown when wallet balances fail to load",
2628
- id: "wallet_balance.load_failed"
2629
- })
2630
- }), null, 16, ["title"])) : e.walletBalances.length > 0 ? (w(), C(r(po), le({ key: 2 }, h.$attrs, {
2631
- class: "sv-wallet-balances sv-root sv-component",
2632
- "customer-wallet-balances": e.walletBalances,
2633
- "show-auto-top-up": "",
2634
- "show-manual-top-up": "",
2635
- title: r(a)(
2636
- {
2637
- defaultMessage: "{count, plural, one {Wallet} other {Wallets}}",
2638
- description: "Title for the wallets block on the customer overview page",
2639
- id: "customer_overview.wallet_balances_block.title"
2640
- },
2641
- { count: String(e.walletBalances.length) }
2642
- ),
2643
- onTopUp: v[0] || (v[0] = (U) => i.value = U),
2644
- onAutoTopUp: v[1] || (v[1] = (U) => c.value = U),
2645
- onCancelAutoTopUp: v[2] || (v[2] = (U) => S.value = U)
2646
- }), null, 16, ["customer-wallet-balances", "title"])) : R("", !0),
2647
- e.showTopUpButton ? (w(), C(tn, {
2648
- key: 3,
2649
- "show-modal": u.value,
2650
- "selected-balance-item": l.value,
2651
- "payment-methods": e.paymentMethods,
2652
- customer: e.customer,
2653
- subscriptions: e.subscriptions,
2654
- onClose: v[3] || (v[3] = (U) => i.value = void 0),
2655
- onConfirm: v[4] || (v[4] = (U) => n("top-up-charged")),
2656
- onPaymentSuccess: v[5] || (v[5] = (U) => n("payment-method-stored")),
2657
- onPaymentFailed: v[6] || (v[6] = (U) => n("payment-failed", U))
2658
- }, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : R("", !0),
2659
- e.showTopUpButton ? (w(), C(an, {
2660
- key: 4,
2661
- "show-modal": g.value,
2662
- "wallet-balance-item": b.value,
2663
- "top-up-item": c.value,
2664
- "payment-methods": e.paymentMethods,
2665
- customer: e.customer,
2666
- onClose: v[7] || (v[7] = (U) => c.value = void 0),
2667
- onSaved: v[8] || (v[8] = (U) => n("auto-top-up-saved")),
2668
- onPaymentSuccess: v[9] || (v[9] = (U) => n("payment-method-stored")),
2669
- onPaymentFailed: v[10] || (v[10] = (U) => n("payment-failed", U))
2670
- }, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : R("", !0),
2671
- e.showTopUpButton ? (w(), C(ln, {
2672
- key: 5,
2673
- "show-modal": f.value,
2674
- config: S.value,
2675
- onClose: v[11] || (v[11] = (U) => S.value = void 0),
2676
- onConfirmed: v[12] || (v[12] = (U) => n("auto-top-up-cancelled"))
2677
- }, null, 8, ["show-modal", "config"])) : R("", !0)
2678
- ], 64));
2679
- }
2680
- });
2681
- export {
2682
- Nn as _,
2683
- St as a,
2684
- bt as b,
2685
- $o as c,
2686
- wt as d,
2687
- Dn as u
2688
- };