@solvimon/solvimon-web 0.1.0-alpha.31 → 0.1.0-alpha.32

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 (145) hide show
  1. package/dist/{AddPaymentMethodModal-Bs_aOOCX.mjs → AddPaymentMethodModal-Cx203VXo.mjs} +4 -4
  2. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DF4PIR-A.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BMHhLZnu.mjs} +2 -2
  3. package/dist/{Alert.vue.es-xhsk_7Gn.mjs → Alert.vue.es-DHJpiSdR.mjs} +1 -1
  4. package/dist/{Amount.vue.es-DPqHB8Xd.mjs → Amount.vue.es-CofcgmXt.mjs} +1 -1
  5. package/dist/{AuthProvider.handle-CUO6Qj-5.mjs → AuthProvider.handle-BpFblzFx.mjs} +1 -1
  6. package/dist/{Avatar.vue.es-DrbtUiLO.mjs → Avatar.vue.es-CJdXXOiG.mjs} +1 -1
  7. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-C3JYNZuR.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BD84aBiU.mjs} +4 -4
  8. package/dist/{BillingInformationForm.vue_vue_type_script_setup_true_lang-BUdcXy0H.mjs → BillingInformationForm.vue_vue_type_script_setup_true_lang-F5OVG0kO.mjs} +7 -7
  9. package/dist/{BillingInformationModal-crgTNGf4.mjs → BillingInformationModal-Do3Fuu8A.mjs} +3 -3
  10. package/dist/{Button.vue.es-BHbanjR0.mjs → Button.vue.es-CW7XfMBF.mjs} +1 -1
  11. package/dist/{ChargeOnDemandModal-DYiFtw1n.mjs → ChargeOnDemandModal-B4ShPKLS.mjs} +17 -17
  12. package/dist/{Chip.vue.es-Dc6-PjEn.mjs → Chip.vue.es-CYwWHyAT.mjs} +2 -2
  13. package/dist/{taxId.es-Zu2Ff1gL.mjs → CompanyPurchaseToggle.vue_vue_type_script_setup_true_lang-CVXHCSPb.mjs} +226 -226
  14. package/dist/{Comparators.vue.es-DQBI3f7m.mjs → Comparators.vue.es-DYrKlE8t.mjs} +1 -1
  15. package/dist/{ContextMenu.vue.es-CvX6O2IM.mjs → ContextMenu.vue.es-EXTx0NEt.mjs} +4 -4
  16. package/dist/{CustomerBillingInformation.vue.es-DQWt9osz.mjs → CustomerBillingInformation.vue.es-CSKG6V3T.mjs} +2 -2
  17. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-hNVtamwL.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZZuAHIE.mjs} +5 -5
  18. package/dist/{CustomerShippingAddresses-C0c-4D2W.mjs → CustomerShippingAddresses-Bdy4XWjE.mjs} +9 -9
  19. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C50vGUvw.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BEKwWob_.mjs} +1361 -1065
  20. package/dist/{DividerText.vue.es-ChN6fnrH.mjs → DividerText.vue.es-Dq0JzI8C.mjs} +1 -1
  21. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DCUml1W4.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs} +3 -3
  22. package/dist/{ErrorNotification.vue.es-CWIVt5q9.mjs → ErrorNotification.vue.es-Cw7fqCg1.mjs} +2 -2
  23. package/dist/{FormMessage.vue.es-CQ64C8dt.mjs → FormMessage.vue.es-MrzQoSae.mjs} +1 -1
  24. package/dist/{IconButton.vue.es-BXzwMvVk.mjs → IconButton.vue.es-CpQbFw0x.mjs} +2 -2
  25. package/dist/{IconTitle.vue.es-GyanM-JQ.mjs → IconTitle.vue.es-CcOIFjbE.mjs} +3 -3
  26. package/dist/{Input.vue.es-CxiwRZYs.mjs → Input.vue.es-Cd55vQri.mjs} +4 -4
  27. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Ca0qflBR.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CqkGCbvg.mjs} +2 -2
  28. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-Dw73a5Yt.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-BUu5M_gx.mjs} +4 -4
  29. package/dist/{InvoicePreview.vue.es-BvnikfEH.mjs → InvoicePreview.vue.es-DHh5wruk.mjs} +5 -5
  30. package/dist/{InvoicePricingClauseChip.vue.es-DxcyTRGr.mjs → InvoicePricingClauseChip.vue.es-ZSOBp1se.mjs} +4 -4
  31. package/dist/{Label.vue.es-3ACRco55.mjs → Label.vue.es-CB6G8Krh.mjs} +3 -3
  32. package/dist/{LoadFailedNotice.vue_vue_type_script_setup_true_lang-1qpRh-0S.mjs → LoadFailedNotice.vue_vue_type_script_setup_true_lang-BZCtO2Er.mjs} +2 -2
  33. package/dist/{Modal.vue.es-CDjfZDDx.mjs → Modal.vue.es-CJFTVFSZ.mjs} +5 -5
  34. package/dist/{OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-CnZwxJ5b.mjs → OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs} +8 -8
  35. package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-PICpXmC3.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-D08Qpgb0.mjs} +2 -2
  36. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DpZtYBfM.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-dl52PYcq.mjs} +4 -4
  37. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Co5qBQa8.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs} +3 -3
  38. package/dist/{PaymentHistoryBlock-HUazLER6.mjs → PaymentHistoryBlock-BSXlneqM.mjs} +1 -1
  39. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DdmUoiet.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CXy0XGpn.mjs} +5 -5
  40. package/dist/{PaymentIntegrationForm-ZnIjTyda.mjs → PaymentIntegrationForm-Diua0GGJ.mjs} +1 -1
  41. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DU5wu66t.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CLlm_Q2j.mjs} +3 -3
  42. package/dist/{PaymentIntegrationFormAdyen-sbw3AoKS.mjs → PaymentIntegrationFormAdyen-D4FP0Vj5.mjs} +9 -9
  43. package/dist/{PaymentIntegrationFormStripe-4JmKEwbS.mjs → PaymentIntegrationFormStripe-vFzF_sCJ.mjs} +8 -8
  44. package/dist/{PaymentMethod.vue.es-DAabE41t.mjs → PaymentMethod.vue.es-vs6SaZOh.mjs} +197 -149
  45. package/dist/{PaymentMethodForm-MmCUSJLE.mjs → PaymentMethodForm-Buhe0aRQ.mjs} +1 -1
  46. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-DyiXLYRj.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-RPPdBw_e.mjs} +6 -6
  47. package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Bv34aiZ6.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs} +7 -7
  48. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DZ2Z-RMv.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BXbevI3r.mjs} +7 -7
  49. package/dist/{PaymentMethodsModal-CjpNw4kX.mjs → PaymentMethodsModal-CnJP9UKp.mjs} +6 -6
  50. package/dist/{PlanCustomizationEditor-BDWm_z2w.mjs → PlanCustomizationEditor-KHLSEUbb.mjs} +12 -12
  51. package/dist/{PortalLinkUnverified-B7YYhv97.mjs → PortalLinkUnverified-DlZAkE93.mjs} +3 -3
  52. package/dist/{PortalNotAvailable-DIyeKrAp.mjs → PortalNotAvailable-CKIomNrm.mjs} +2 -2
  53. package/dist/{PricingGroupRangeInput.vue.es-C6J8C7JS.mjs → PricingGroupRangeInput.vue.es-oHD-IT12.mjs} +8 -8
  54. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CiQ-C9Hh.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-wCW8YZHM.mjs} +9 -9
  55. package/dist/{RadioGroupExtended.vue.es-hDmUAKIA.mjs → RadioGroupExtended.vue.es-DsShmkKZ.mjs} +4 -4
  56. package/dist/Section.vue.es-DYmEtgBj.mjs +88 -0
  57. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Gn1aE60E.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs} +2 -2
  58. package/dist/{ShippingAddressForm.vue_vue_type_script_setup_true_lang-y7yOKwR3.mjs → ShippingAddressForm.vue_vue_type_script_setup_true_lang-CJp6ddhZ.mjs} +4 -4
  59. package/dist/{ShippingAddressesModal-CNXxkxnJ.mjs → ShippingAddressesModal-Gxv2KxaW.mjs} +9 -9
  60. package/dist/{StepInput.vue.es-GkrOtOVa.mjs → StepInput.vue.es-sqA-VSsn.mjs} +4 -4
  61. package/dist/{SubscriptionCancellationModal-C_xFPx1I.mjs → SubscriptionCancellationModal-DfAZ_uW6.mjs} +1 -1
  62. package/dist/{SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-DdTC33Qh.mjs → SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-BlbiDNIu.mjs} +7 -7
  63. package/dist/{SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-CQ-ZOzVI.mjs → SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-C1ko2xvR.mjs} +2 -2
  64. package/dist/{SubscriptionDetails.entry.ce-DuP8TtKu.mjs → SubscriptionDetails.entry.ce-CdWV-8WN.mjs} +23 -23
  65. package/dist/{SubscriptionSchedules-DosBeXD7.mjs → SubscriptionSchedules-BfdVn1XA.mjs} +1 -1
  66. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C8q8Q6h5.mjs +5413 -0
  67. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-C26HShPu.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs} +3 -3
  68. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BUDuQk2e.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DYWjTzPV.mjs} +9 -9
  69. package/dist/{TooltipParagraph.vue.es-4HaXi8RP.mjs → TooltipParagraph.vue.es-Bt-7LHr3.mjs} +1 -1
  70. package/dist/{TranslationOverride.vue_vue_type_script_setup_true_lang-C5Y6Kg-_.mjs → TranslationOverride.vue_vue_type_script_setup_true_lang-Cp_sFa52.mjs} +1 -1
  71. package/dist/{TrialChip.vue.es-CUfJ4SK3.mjs → TrialChip.vue.es-VZwQX079.mjs} +3 -3
  72. package/dist/{addonQuantity-BvoYTajN.mjs → addonQuantity-D3bGVqjL.mjs} +2 -2
  73. package/dist/{adyen-D4em6EgU.mjs → adyen-CHgq2l6n.mjs} +1 -1
  74. package/dist/components/BillingInformation/BillingInformation.mjs +5 -5
  75. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +4 -4
  76. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
  77. package/dist/components/Invoice/Invoice.mjs +1084 -1016
  78. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
  79. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
  80. package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
  81. package/dist/components/PaymentHistory/PaymentHistory.mjs +4 -4
  82. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
  83. package/dist/components/ShippingAddressForm/ShippingAddressForm.mjs +9 -9
  84. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +5 -5
  85. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
  86. package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
  87. package/dist/{customElements-d7Bhfqi_.mjs → customElements-B8c354Nu.mjs} +376 -369
  88. package/dist/{customer-CNCSN_G5.mjs → customer-CP-Wz7JO.mjs} +1 -1
  89. package/dist/{de-DE-wZp39RC-.mjs → de-DE-C9HrzHpE.mjs} +3 -0
  90. package/dist/{de-DE-D-sV3avS.mjs → de-DE-DAQmgEy5.mjs} +75 -15
  91. package/dist/{formControl-BZQLHnOO.mjs → formControl-C18sw44K.mjs} +275 -275
  92. package/dist/{formatting.es-RclXHhKo.mjs → formatting.es-DlJEzreG.mjs} +16 -13
  93. package/dist/{fr-FR-BrNXJ7gR.mjs → fr-FR-CHR3VWvd.mjs} +3 -0
  94. package/dist/{fr-FR-BYHycSxz.mjs → fr-FR-fz51-Ubw.mjs} +76 -16
  95. package/dist/icon-sprite.svg.es-2S3rv8NW.mjs +4 -0
  96. package/dist/{index.es-BEZ2mumY.mjs → index.es-Bv55VtdE.mjs} +8 -8
  97. package/dist/index.mjs +1 -1
  98. package/dist/{invoices-CXvL8KQx.mjs → invoices-I7PghcPV.mjs} +1 -1
  99. package/dist/{it-IT-zpPyT9PH.mjs → it-IT-BpCkTMZL.mjs} +68 -8
  100. package/dist/{it-IT-Bd1qsMVU.mjs → it-IT-Dzc7DmmL.mjs} +3 -0
  101. package/dist/{nl-NL-BOr4MR7L.mjs → nl-NL-22C8OcIM.mjs} +72 -12
  102. package/dist/{nl-NL-C6Y6fqaW.mjs → nl-NL-Dut_QwsY.mjs} +3 -0
  103. package/dist/{paymentIntegrationFormLoaders-wi1vMgf_.mjs → paymentIntegrationFormLoaders-BFMAMpcA.mjs} +3 -3
  104. package/dist/{paymentMethods-CG1fcG2v.mjs → paymentMethods-aGKIi7DS.mjs} +1 -1
  105. package/dist/{paymentOutcome-D59QkGfm.mjs → paymentOutcome-Cv7hTFVu.mjs} +1 -1
  106. package/dist/{payments-Dy81gmkC.mjs → payments-BKoKpoLN.mjs} +1 -1
  107. package/dist/{preloadPaymentIntegrationForms-C_9p7Jbi.mjs → preloadPaymentIntegrationForms-Buwal_JR.mjs} +1 -1
  108. package/dist/{pricing-CBJT8C6L.mjs → pricing-Y-7ELzN-.mjs} +1 -1
  109. package/dist/{pricingItem.es-AYq_hYeD.mjs → pricingItem.es-BafitMMY.mjs} +1 -1
  110. package/dist/{pricingPlanScheduleOverrides-GON_34ep.mjs → pricingPlanScheduleOverrides-CGm_-jJq.mjs} +1 -1
  111. package/dist/screens/Checkout/Checkout.mjs +12 -12
  112. package/dist/screens/CheckoutSession/CheckoutSession.mjs +650 -644
  113. package/dist/screens/CustomerOverview/CustomerOverview.mjs +17 -17
  114. package/dist/screens/PayInvoice/PayInvoice.mjs +22 -22
  115. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +10 -10
  116. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  117. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +29 -29
  118. package/dist/{subscriptions-Bm1eu9wc.mjs → subscriptions-B7dNqi1C.mjs} +1 -1
  119. package/dist/types/components/wallets/AutoTopUpModal/AutoTopUpModal.types.d.ts +3 -1
  120. package/dist/types/types/checkoutSession.d.ts +11 -1
  121. package/dist/{useActionDispatchProvider-BWna0S6N.mjs → useActionDispatchProvider-BCtk-FGU.mjs} +1 -1
  122. package/dist/{useAddressFormats-Dw7IEdxg.mjs → useAddressFormats-CtE4QaVU.mjs} +51 -50
  123. package/dist/{useCheckoutForm-BaV2j_ob.mjs → useCheckoutForm-BhXcmnUi.mjs} +1467 -1422
  124. package/dist/{useCustomer-RUtEzDOY.mjs → useCustomer-mQysxUwp.mjs} +2 -2
  125. package/dist/{useExperimentalFeature-DAKAF_a2.mjs → useExperimentalFeature-Bw6bBtay.mjs} +1 -1
  126. package/dist/{useHostEvent-pjoWJ7ZH.mjs → useHostEvent-MtRG6W2B.mjs} +1 -1
  127. package/dist/{useIncrementalLoading-B3gp58X-.mjs → useIncrementalLoading-CJSj1945.mjs} +1 -1
  128. package/dist/{useInvoiceData-Dya4mmvf.mjs → useInvoiceData-BEZIvw32.mjs} +2 -2
  129. package/dist/{useInvoicesList-Dp3c_cb3.mjs → useInvoicesList-CrXjsmei.mjs} +140 -138
  130. package/dist/{sorting.es-kM0f1VX0.mjs → useIsMounted.es-BNPhTTHE.mjs} +11 -10
  131. package/dist/{useLoadInitialData-CwySdYZM.mjs → useLoadInitialData-Bomj_1mo.mjs} +1 -1
  132. package/dist/{usePaymentMethodAvailability-B7NV0ZtX.mjs → usePaymentMethodAvailability-DR_neLeZ.mjs} +4 -4
  133. package/dist/{usePaymentMethodOptions-DDRjVvDJ.mjs → usePaymentMethodOptions-CuHoQx3K.mjs} +2 -2
  134. package/dist/{usePaymentMethods-DBGyQA_I.mjs → usePaymentMethods-BDdetXts.mjs} +2 -2
  135. package/dist/{usePayments-ChGtK_As.mjs → usePayments-B5Z9Kfbv.mjs} +19 -17
  136. package/dist/{usePortal--Uzbpbgr.mjs → usePortal-DuLR5Mid.mjs} +1 -1
  137. package/dist/{useService-DayNZhPh.mjs → useService-2aOFBTxU.mjs} +1 -1
  138. package/dist/{useShippingAddresses-TXVeGFPm.mjs → useShippingAddresses-BvThNpez.mjs} +1 -1
  139. package/dist/{useSubscription-lIGMFLG1.mjs → useSubscription-Dzo-kBpQ.mjs} +2 -2
  140. package/dist/{useSubscriptionActions-BSlJVB4p.mjs → useSubscriptionActions-CWaNRoZ7.mjs} +1 -1
  141. package/dist/{wallets.es-eH2C2ygn.mjs → wallets.es-DRlUVd2R.mjs} +1 -1
  142. package/package.json +31 -8
  143. package/dist/Section.vue.es-CwKTCeZ1.mjs +0 -72
  144. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-5tyDFxEh.mjs +0 -5183
  145. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +0 -4
@@ -1,87 +1,87 @@
1
- import { defineComponent as W, ref as I, onMounted as Lt, onBeforeUnmount as Ie, computed as s, openBlock as _, createBlock as E, withCtx as g, createElementVNode as N, toDisplayString as k, createVNode as C, createTextVNode as V, createElementBlock as Y, unref as u, createCommentVNode as R, renderSlot as ue, createSlots as re, Fragment as Te, renderList as Me, toRaw as He, watch as ee, normalizeClass as $e, useModel as Yt, isRef as Wt, mergeProps as ie, mergeModels as Ht, reactive as Oe, withModifiers as ze, normalizeStyle as je } from "vue";
2
- import { w as zt } from "./api.es-QaC926Xu.mjs";
3
- import { a as Q, d as Z, c as tt, u as ot, E as jt, b as be, e as Ue, p as Qt, f as Gt } from "./customElements-d7Bhfqi_.mjs";
4
- import { u as Kt } from "./useService-DayNZhPh.mjs";
5
- import { _ as me } from "./ErrorNotification.vue.es-CWIVt5q9.mjs";
6
- import { i as Xt, a as Ce, h as Jt } from "./pricingItemConfigs.es-D3pX_9AJ.mjs";
7
- import { b as Be } from "./wallets.es-eH2C2ygn.mjs";
8
- import { _ as se, a as Zt } from "./Button.vue.es-BHbanjR0.mjs";
9
- import { _ as nt, T as at, a as it } from "./TooltipParagraph.vue.es-4HaXi8RP.mjs";
10
- import { _ as we } from "./Section.vue.es-CwKTCeZ1.mjs";
11
- import { _ as st } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
12
- import { _ as lt } from "./RadioGroupExtended.vue.es-hDmUAKIA.mjs";
13
- import { b as eo } from "./subscription-DQ5mRp_e.mjs";
14
- import { d as to, u as De, c as X, r as ut, b as rt } from "./formControl-BZQLHnOO.mjs";
15
- import { f as Ne } from "./formatting.es-RclXHhKo.mjs";
16
- import { _ as oo } from "./Divider.vue.es-DnP_HqLz.mjs";
17
- import { _ as dt } from "./Expand.vue.es-BleuAfDz.mjs";
18
- import { _ as ct } from "./InvoicePreview.vue.es-BvnikfEH.mjs";
19
- import { _ as no } from "./Label.vue.es-3ACRco55.mjs";
20
- import { c as pt } from "./invoices-CXvL8KQx.mjs";
21
- import { u as ao } from "./useWatchDebounced-DkXgKe0E.mjs";
22
- import { _ as io } from "./Toggle.vue.es-S2g8WGY_.mjs";
23
- import { _ as so } from "./Input.vue.es-CxiwRZYs.mjs";
24
- import { g as lo } from "./amount-CondixVt.mjs";
25
- import { _ as mt } from "./PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Bv34aiZ6.mjs";
26
- import { u as vt } from "./useDefaultPaymentMethod-Dliq6_Yw.mjs";
27
- import { _ as uo } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-C26HShPu.mjs";
28
- import { _ as ro, u as ft } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DF4PIR-A.mjs";
29
- import { M as ht } from "./Modal.vue.es-CDjfZDDx.mjs";
30
- import { i as co } from "./paymentOutcome-D59QkGfm.mjs";
31
- import { _ as po } from "./Alert.vue.es-xhsk_7Gn.mjs";
32
- import { i as mo } from "./usePaymentMethodOptions-DDRjVvDJ.mjs";
33
- const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
1
+ import { defineComponent as G, ref as $, onMounted as st, onBeforeUnmount as Be, computed as s, openBlock as f, createBlock as U, withCtx as v, createElementVNode as D, toDisplayString as F, createVNode as P, createTextVNode as V, createElementBlock as z, normalizeClass as le, renderSlot as X, mergeProps as ae, Fragment as he, renderList as Ae, createSlots as me, resolveDynamicComponent as Ge, createCommentVNode as q, unref as u, toRaw as Qe, watch as ue, useModel as Wt, isRef as Ht, mergeModels as jt, reactive as Oe, withModifiers as Ke, normalizeStyle as Xe } from "vue";
2
+ import { w as Gt } from "./api.es-QaC926Xu.mjs";
3
+ import { a as te, d as J, c as lt, u as ut, E as Qt, b as Te, e as Ue, p as Kt, f as Xt } from "./customElements-B8c354Nu.mjs";
4
+ import { u as Jt } from "./useService-2aOFBTxU.mjs";
5
+ import { _ as ye } from "./ErrorNotification.vue.es-Cw7fqCg1.mjs";
6
+ import { i as Zt, a as Ee, h as eo } from "./pricingItemConfigs.es-D3pX_9AJ.mjs";
7
+ import { b as Ie } from "./wallets.es-DRlUVd2R.mjs";
8
+ import { _ as pe, a as to } from "./Button.vue.es-CW7XfMBF.mjs";
9
+ import { _ as ke, T as De, a as Ne } from "./TooltipParagraph.vue.es-Bt-7LHr3.mjs";
10
+ import { _ as Me } from "./Section.vue.es-DYmEtgBj.mjs";
11
+ import { _ as rt } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
12
+ import { _ as dt } from "./RadioGroupExtended.vue.es-DsShmkKZ.mjs";
13
+ import { b as oo } from "./subscription-DQ5mRp_e.mjs";
14
+ import { d as no, u as Re, c as ne, r as ct, b as pt } from "./formControl-C18sw44K.mjs";
15
+ import { f as Fe } from "./formatting.es-DlJEzreG.mjs";
16
+ import { _ as ao } from "./Divider.vue.es-DnP_HqLz.mjs";
17
+ import { _ as mt } from "./Expand.vue.es-BleuAfDz.mjs";
18
+ import { _ as vt } from "./InvoicePreview.vue.es-DHh5wruk.mjs";
19
+ import { _ as io } from "./Label.vue.es-CB6G8Krh.mjs";
20
+ import { c as ft } from "./invoices-I7PghcPV.mjs";
21
+ import { u as so } from "./useWatchDebounced-DkXgKe0E.mjs";
22
+ import { _ as lo } from "./Toggle.vue.es-S2g8WGY_.mjs";
23
+ import { _ as uo } from "./Input.vue.es-Cd55vQri.mjs";
24
+ import { g as ro } from "./amount-CondixVt.mjs";
25
+ import { _ as ht } from "./PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs";
26
+ import { u as gt } from "./useDefaultPaymentMethod-Dliq6_Yw.mjs";
27
+ import { _ as co } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs";
28
+ import { _ as po, u as yt } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BMHhLZnu.mjs";
29
+ import { M as _t } from "./Modal.vue.es-CJFTVFSZ.mjs";
30
+ import { i as mo } from "./paymentOutcome-Cv7hTFVu.mjs";
31
+ import { _ as vo } from "./Alert.vue.es-DHJpiSdR.mjs";
32
+ import { i as fo } from "./usePaymentMethodOptions-CuHoQx3K.mjs";
33
+ const ho = 3e4, Se = 60, Ce = 12, go = /* @__PURE__ */ G({
34
34
  __name: "DateTimeAgo",
35
35
  props: {
36
36
  date: {},
37
37
  actionVerb: {}
38
38
  },
39
39
  setup(e) {
40
- const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(), l = I(Date.now());
40
+ const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } = te(), l = $(Date.now());
41
41
  let r;
42
- Lt(() => {
42
+ st(() => {
43
43
  r = setInterval(() => {
44
44
  l.value = Date.now();
45
- }, vo);
46
- }), Ie(() => {
45
+ }, ho);
46
+ }), Be(() => {
47
47
  clearInterval(r);
48
48
  });
49
- const f = (p, b) => {
50
- const P = (b.getFullYear() - p.getFullYear()) * Pe + (b.getMonth() - p.getMonth());
51
- return b.getDate() < p.getDate() ? P - 1 : P;
52
- }, T = s(() => {
53
- const p = Math.max(0, (l.value - n.date.getTime()) / 1e3);
54
- if (p < Se)
49
+ const h = (c, T) => {
50
+ const S = (T.getFullYear() - c.getFullYear()) * Ce + (T.getMonth() - c.getMonth());
51
+ return T.getDate() < c.getDate() ? S - 1 : S;
52
+ }, w = s(() => {
53
+ const c = Math.max(0, (l.value - n.date.getTime()) / 1e3);
54
+ if (c < Se)
55
55
  return a(
56
56
  {
57
57
  defaultMessage: "{count, plural, one {# second} other {# seconds}} ago",
58
58
  id: "dateTimeAgo.seconds",
59
59
  description: "Relative time in whole seconds"
60
60
  },
61
- { count: Math.trunc(p) }
61
+ { count: Math.trunc(c) }
62
62
  );
63
- if (p < t)
63
+ if (c < t)
64
64
  return a(
65
65
  {
66
66
  defaultMessage: "{count, plural, one {# minute} other {# minutes}} ago",
67
67
  id: "dateTimeAgo.minutes",
68
68
  description: "Relative time in whole minutes"
69
69
  },
70
- { count: Math.trunc(p / Se) }
70
+ { count: Math.trunc(c / Se) }
71
71
  );
72
- if (p < o)
72
+ if (c < o)
73
73
  return a(
74
74
  {
75
75
  defaultMessage: "{count, plural, one {# hour} other {# hours}} ago",
76
76
  id: "dateTimeAgo.hours",
77
77
  description: "Relative time in whole hours"
78
78
  },
79
- { count: Math.trunc(p / t) }
79
+ { count: Math.trunc(c / t) }
80
80
  );
81
- const b = f(n.date, new Date(l.value));
82
- if (b < 1) {
83
- const P = Math.trunc(p / o);
84
- return P === 1 ? a({
81
+ const T = h(n.date, new Date(l.value));
82
+ if (T < 1) {
83
+ const S = Math.trunc(c / o);
84
+ return S === 1 ? a({
85
85
  defaultMessage: "yesterday",
86
86
  id: "dateTimeAgo.yesterday",
87
87
  description: 'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'
@@ -91,36 +91,36 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
91
91
  id: "dateTimeAgo.days",
92
92
  description: "Relative time in whole days"
93
93
  },
94
- { count: P }
94
+ { count: S }
95
95
  );
96
96
  }
97
- return b < Pe ? a(
97
+ return T < Ce ? a(
98
98
  {
99
99
  defaultMessage: "{count, plural, one {# month} other {# months}} ago",
100
100
  id: "dateTimeAgo.months",
101
101
  description: "Relative time in whole months"
102
102
  },
103
- { count: b }
103
+ { count: T }
104
104
  ) : a(
105
105
  {
106
106
  defaultMessage: "{count, plural, one {# year} other {# years}} ago",
107
107
  id: "dateTimeAgo.years",
108
108
  description: "Relative time in whole years"
109
109
  },
110
- { count: Math.trunc(b / Pe) }
110
+ { count: Math.trunc(T / Ce) }
111
111
  );
112
- }), M = s(
113
- () => n.actionVerb ? `${n.actionVerb} ${T.value}` : T.value
114
- ), S = s(
112
+ }), A = s(
113
+ () => n.actionVerb ? `${n.actionVerb} ${w.value}` : w.value
114
+ ), C = s(
115
115
  () => i({ date: n.date, format: "dateTime", offsetType: "local" })
116
116
  );
117
- return (p, b) => (_(), E(nt, null, {
118
- tooltip: g(() => [
119
- C(at, null, {
120
- default: g(() => [
121
- C(it, null, {
122
- default: g(() => [
123
- V(k(S.value), 1)
117
+ return (c, T) => (f(), U(ke, null, {
118
+ tooltip: v(() => [
119
+ P(De, null, {
120
+ default: v(() => [
121
+ P(Ne, null, {
122
+ default: v(() => [
123
+ V(F(C.value), 1)
124
124
  ]),
125
125
  _: 1
126
126
  })
@@ -128,79 +128,343 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
128
128
  _: 1
129
129
  })
130
130
  ]),
131
- default: g(() => [
132
- N("span", null, k(M.value), 1)
131
+ default: v(() => [
132
+ D("span", null, F(A.value), 1)
133
133
  ]),
134
134
  _: 1
135
135
  }));
136
136
  }
137
- }), ho = (e) => {
138
- const { $t: t, formatNumber: o } = Q(), n = (h) => Be(t, o, h), a = s(
137
+ }), yo = {
138
+ yes: "Yes",
139
+ no: "No",
140
+ paymentTerm: "Payment term",
141
+ paymentAcceptors: "Payment acceptors",
142
+ billingTime: "Billing time",
143
+ billingPeriod: "Billing period",
144
+ billingCurrency: "Billing currency",
145
+ billingEntity: "Billing entity",
146
+ customer: "Customer",
147
+ combineSubscriptions: "Allow combining subscriptions",
148
+ purchaseOrderNumber: "Purchase order number",
149
+ salesTaxPercentage: "Sales tax percentage",
150
+ owner: "Owner",
151
+ billingCycle: "Billing cycle",
152
+ initialTerm: "Initial term",
153
+ renewalTerm: "Renewal term",
154
+ autoRenewal: "Auto renewal"
155
+ }, _o = /* @__PURE__ */ G({
156
+ __name: "SummaryGrid",
157
+ props: {
158
+ cappedWidth: { type: Boolean, default: !1 },
159
+ cols: { default: 2 }
160
+ },
161
+ setup(e) {
162
+ return (t, o) => (f(), z("div", {
163
+ class: le(["grid gap-4", { "max-w-[920px]": e.cappedWidth, ["grid-cols-" + e.cols]: e.cols > 1 }])
164
+ }, [
165
+ X(t.$slots, "default")
166
+ ], 2));
167
+ }
168
+ }), bo = { class: "flex items-center gap-2" }, wo = { class: "truncate" }, To = /* @__PURE__ */ G({
169
+ __name: "SummaryGridItem",
170
+ props: {
171
+ orientation: { default: "horizontal" },
172
+ hasNarrowLabel: { type: Boolean },
173
+ hasTooltip: { type: Boolean, default: !0 },
174
+ wrap: { type: Boolean }
175
+ },
176
+ setup(e) {
177
+ const t = e, o = $(), n = $(!1), a = s(() => ({
178
+ variant: t.orientation === "horizontal" ? "body-xs" : void 0,
179
+ weight: t.orientation === "horizontal" ? void 0 : "bold",
180
+ class: t.orientation === "horizontal" ? "font-medium" : void 0
181
+ }));
182
+ return st(() => {
183
+ o.value && (n.value = o.value.clientWidth < o.value.scrollWidth);
184
+ }), (i, l) => (f(), z("div", {
185
+ class: le(["grid", {
186
+ "grid-cols-1": e.orientation === "vertical",
187
+ "grid-cols-2 items-start gap-2": e.orientation === "horizontal" && !e.hasNarrowLabel,
188
+ "grid-cols-3 items-start gap-2": e.orientation === "horizontal" && e.hasNarrowLabel
189
+ }])
190
+ }, [
191
+ D("div", bo, [
192
+ P(J, {
193
+ variant: e.orientation === "horizontal" ? "body-xs" : "caps-heading",
194
+ weight: e.orientation === "horizontal" ? "medium" : void 0,
195
+ color: "secondary",
196
+ class: le(e.orientation === "horizontal" ? "truncate whitespace-nowrap" : "truncate")
197
+ }, {
198
+ default: v(() => [
199
+ X(i.$slots, "label")
200
+ ]),
201
+ _: 3
202
+ }, 8, ["variant", "weight", "class"]),
203
+ X(i.$slots, "label-status")
204
+ ]),
205
+ D("div", {
206
+ class: le({
207
+ "col-span-2": e.hasNarrowLabel,
208
+ "min-w-0 text-right": e.orientation === "horizontal"
209
+ })
210
+ }, [
211
+ e.wrap || !n.value || !e.hasTooltip ? (f(), U(J, ae({
212
+ key: 0,
213
+ tag: "span"
214
+ }, a.value), {
215
+ default: v(() => [
216
+ i.$slots.content ? (f(), z("div", {
217
+ key: 0,
218
+ ref_key: "content",
219
+ ref: o,
220
+ class: le(e.wrap ? void 0 : "truncate")
221
+ }, [
222
+ X(i.$slots, "content")
223
+ ], 2)) : (f(), z(he, { key: 1 }, [
224
+ V("-")
225
+ ], 64))
226
+ ]),
227
+ _: 3
228
+ }, 16)) : (f(), U(ke, {
229
+ key: 1,
230
+ class: "leading-normal"
231
+ }, {
232
+ default: v(() => [
233
+ P(J, ae({ tag: "span" }, a.value), {
234
+ default: v(() => [
235
+ D("div", wo, [
236
+ X(i.$slots, "content")
237
+ ])
238
+ ]),
239
+ _: 3
240
+ }, 16)
241
+ ]),
242
+ tooltip: v(() => [
243
+ P(De, null, {
244
+ default: v(() => [
245
+ P(Ne, null, {
246
+ default: v(() => [
247
+ X(i.$slots, "content")
248
+ ]),
249
+ _: 3
250
+ })
251
+ ]),
252
+ _: 3
253
+ })
254
+ ]),
255
+ _: 3
256
+ }))
257
+ ], 2)
258
+ ], 2));
259
+ }
260
+ }), Mo = /* @__PURE__ */ G({
261
+ __name: "Details",
262
+ props: {
263
+ details: {},
264
+ translate: { type: Boolean, default: !1 },
265
+ cols: { default: 2 },
266
+ i18n: { default: () => yo },
267
+ orientation: { default: "horizontal" }
268
+ },
269
+ setup(e) {
270
+ const t = e, o = (n) => t.orientation !== "horizontal" ? "overflow-hidden text-ellipsis" : n.wrap ? "" : "truncate";
271
+ return (n, a) => (f(), U(_o, { cols: e.cols }, {
272
+ default: v(() => [
273
+ (f(!0), z(he, null, Ae(e.details, (i) => (f(), U(To, {
274
+ key: i.key,
275
+ orientation: e.orientation,
276
+ "has-tooltip": !i.isLink,
277
+ wrap: i.wrap
278
+ }, me({
279
+ label: v(() => [
280
+ V(F(e.translate ? e.i18n[i.key] : i.key), 1)
281
+ ]),
282
+ "label-status": v(() => [
283
+ i.keyComponent ? (f(), U(Ge(i.keyComponent.component), ae({
284
+ key: 0,
285
+ ref_for: !0
286
+ }, i.keyComponent.props), null, 16)) : q("", !0)
287
+ ]),
288
+ _: 2
289
+ }, [
290
+ i.value !== void 0 || i.value !== null || n.$slots[i.key] ? {
291
+ name: "content",
292
+ fn: v(() => [
293
+ X(n.$slots, i.key, {}, () => {
294
+ var l;
295
+ return [
296
+ i.valueComponent ? (f(), U(Ge((l = i.valueComponent) == null ? void 0 : l.component), ae({
297
+ key: 0,
298
+ ref_for: !0
299
+ }, i.valueComponent.props, {
300
+ class: i.valueComponent.class
301
+ }), {
302
+ default: v(() => [
303
+ X(n.$slots, "default", {}, () => [
304
+ V(F(i.valueComponent.props.slotValue ?? ""), 1)
305
+ ])
306
+ ]),
307
+ _: 2
308
+ }, 1040, ["class"])) : (f(), z("div", {
309
+ key: 1,
310
+ class: le(e.orientation === "horizontal" ? "w-full" : "max-w-80")
311
+ }, [
312
+ D("div", {
313
+ class: le(o(i))
314
+ }, [
315
+ P(J, {
316
+ tag: "span",
317
+ variant: e.orientation === "horizontal" ? "body-xs" : "body-sm",
318
+ weight: e.orientation === "horizontal" ? void 0 : "bold",
319
+ class: le(e.orientation === "horizontal" ? "font-medium" : "text-wrap")
320
+ }, {
321
+ default: v(() => [
322
+ V(F(i.value), 1)
323
+ ]),
324
+ _: 2
325
+ }, 1032, ["variant", "weight", "class"])
326
+ ], 2)
327
+ ], 2))
328
+ ];
329
+ })
330
+ ]),
331
+ key: "0"
332
+ } : void 0
333
+ ]), 1032, ["orientation", "has-tooltip", "wrap"]))), 128))
334
+ ]),
335
+ _: 3
336
+ }, 8, ["cols"]));
337
+ }
338
+ }), Ao = (e) => {
339
+ const { $t: t, formatNumber: o } = te(), n = (m) => Ie(t, o, m), a = s(
139
340
  () => {
140
- var h, c;
141
- return ((c = (h = e.walletBalance.wallet) == null ? void 0 : h.wallet_type) == null ? void 0 : c.name) || t({
341
+ var m, M;
342
+ return ((M = (m = e.walletBalance.wallet) == null ? void 0 : m.wallet_type) == null ? void 0 : M.name) || t({
142
343
  defaultMessage: "Balance",
143
344
  id: "wallet_balance.balance_label",
144
345
  description: "Label shown above a wallet's balance amount"
145
346
  });
146
347
  }
147
- ), i = (h) => {
148
- var c;
149
- return (((c = h.pricing_item) == null ? void 0 : c.configs) ?? []).filter((A) => !!A.on_demand);
150
- }, l = s(
348
+ ), i = s(() => {
349
+ var m, M;
350
+ const { balance: I, open_balance: N } = e.walletBalance.wallet_balance;
351
+ return ((m = I == null ? void 0 : I.amount) == null ? void 0 : m.currency) ?? ((M = N == null ? void 0 : N.amount) == null ? void 0 : M.currency);
352
+ }), l = (m) => (m ?? []).flatMap(({ configs: M }) => M ?? []), r = ({ pricing_item: m }, M = i.value) => [
353
+ ...(m == null ? void 0 : m.configs) ?? [],
354
+ ...l(m == null ? void 0 : m.billing_period_configs),
355
+ ...((m == null ? void 0 : m.pricing_currency_configs) ?? []).filter((I) => !M || I.currency === M).flatMap((I) => [
356
+ ...I.configs ?? [],
357
+ ...l(I.billing_period_configs)
358
+ ])
359
+ ].filter((I) => !!I.on_demand), h = s(
151
360
  () => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
152
- (h) => i(h).some(
153
- (c) => Xt(c) || Ce(c)
361
+ (m) => r(m).some(
362
+ (M) => Zt(M) || Ee(M)
154
363
  )
155
364
  )
156
- ), r = s(
157
- () => l.value.find(
158
- (h) => i(h).some((c) => Ce(c))
365
+ ), w = s(
366
+ () => h.value.find(
367
+ (m) => r(m).some((M) => Ee(M))
159
368
  )
160
- ), f = s(
161
- () => !!e.showManualTopUp && l.value.length > 0
162
- ), T = s(() => !!e.showAutoTopUp && !!r.value), M = s(
369
+ ), A = s(
370
+ () => !!e.showManualTopUp && h.value.length > 0
371
+ ), C = s(() => !!e.showAutoTopUp && !!w.value), c = s(
163
372
  () => {
164
- var h, c;
165
- return (c = (h = e.walletBalance.wallet) == null ? void 0 : h.auto_top_up_configs) == null ? void 0 : c.find(
166
- (A) => A.status === "ACTIVE"
373
+ var m, M;
374
+ return (M = (m = e.walletBalance.wallet) == null ? void 0 : m.auto_top_up_configs) == null ? void 0 : M.find(
375
+ (I) => I.status === "ACTIVE"
167
376
  );
168
377
  }
169
- ), S = s(
378
+ ), T = s(
170
379
  () => {
171
- var h, c;
172
- return (c = (h = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : h.credits) == null ? void 0 : c.credit_type;
380
+ var m, M;
381
+ return (M = (m = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : m.credits) == null ? void 0 : M.credit_type;
173
382
  }
174
- ), p = (h, c) => n({
383
+ ), S = (m, M) => n({
175
384
  credits: {
176
- quantity: h,
177
- credit_type_id: c,
178
- credit_type: S.value
385
+ quantity: m,
386
+ credit_type_id: M,
387
+ credit_type: T.value
179
388
  }
180
- }), b = (h) => h.amount ? n({ amount: h.amount }) : h.credits ? p(h.credits.quantity, h.credits.credit_type_id) : "", P = s(() => {
181
- var h, c;
182
- const A = (h = M.value) == null ? void 0 : h.pricing_item_id;
183
- if (!A)
389
+ }), E = (m) => m.amount ? n({ amount: m.amount }) : m.credits ? S(m.credits.quantity, m.credits.credit_type_id) : "", y = s(() => {
390
+ var m, M, I, N;
391
+ const ie = (m = c.value) == null ? void 0 : m.pricing_item_id;
392
+ if (!ie)
184
393
  return;
185
- const B = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((U) => U.pricing_item_id === A).flatMap((U) => i(U)).flatMap((U) => U.wallet_grants ?? []), v = (c = e.walletBalance.wallet) == null ? void 0 : c.wallet_type_id;
186
- return B.find((U) => U.wallet_type_id === v) ?? B[0];
187
- }), x = s(() => {
188
- var h, c;
189
- const A = (h = M.value) == null ? void 0 : h.topup_amount, B = (c = P.value) == null ? void 0 : c.credits_grant;
190
- if (!A || !B)
394
+ const fe = ((I = (M = c.value) == null ? void 0 : M.topup_amount) == null ? void 0 : I.currency) ?? i.value, de = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((K) => K.pricing_item_id === ie).flatMap((K) => r(K, fe)).flatMap((K) => K.wallet_grants ?? []), Q = (N = e.walletBalance.wallet) == null ? void 0 : N.wallet_type_id;
395
+ return de.find((K) => K.wallet_type_id === Q) ?? de[0];
396
+ }), B = s(() => {
397
+ var m, M;
398
+ const I = (m = c.value) == null ? void 0 : m.topup_amount, N = (M = y.value) == null ? void 0 : M.credits_grant;
399
+ if (!I || !N)
191
400
  return "";
192
- if (B.credits)
193
- return p(
194
- B.credits.quantity,
195
- B.credits.credit_type_id
401
+ if (N.credits)
402
+ return S(
403
+ N.credits.quantity,
404
+ N.credits.credit_type_id
196
405
  );
197
- if (B.conversion) {
198
- const v = Number(A.quantity) * Number(B.conversion.rate);
199
- return p(String(v), B.conversion.credit_type_id);
406
+ if (N.conversion) {
407
+ const ie = Number(I.quantity) * Number(N.conversion.rate);
408
+ return S(String(ie), N.conversion.credit_type_id);
200
409
  }
201
410
  return "";
202
- }), w = s(
203
- () => M.value ? t({
411
+ }), L = s(
412
+ () => {
413
+ var m, M;
414
+ return ((M = (m = e.walletBalance.wallet) == null ? void 0 : m.wallet_type) == null ? void 0 : M.type) === "BALANCE";
415
+ }
416
+ ), b = s(() => {
417
+ if (!L.value)
418
+ return [];
419
+ const { balance: m, reserved_balance: M } = e.walletBalance.wallet_balance, I = [];
420
+ return m && I.push({
421
+ key: t({
422
+ defaultMessage: "Balance",
423
+ id: "wallet_balance.breakdown_balance_label",
424
+ description: "Label for the booked balance of a prepaid wallet, before reservations by open invoices"
425
+ }),
426
+ value: n(m)
427
+ }), M && I.push({
428
+ key: t({
429
+ defaultMessage: "Reserved",
430
+ id: "wallet_balance.breakdown_reserved_label",
431
+ description: "Label for the part of a prepaid wallet balance reserved by open invoices"
432
+ }),
433
+ value: n(M)
434
+ }), I;
435
+ }), O = s(() => {
436
+ const m = e.walletBalance.wallet_balance.pending_balance;
437
+ if (m)
438
+ return {
439
+ key: t({
440
+ defaultMessage: "Pending top-ups",
441
+ id: "wallet_balance.pending_top_ups_label",
442
+ description: "Label for wallet top-ups that are not added to the balance yet because their invoice is unpaid"
443
+ }),
444
+ value: n(m)
445
+ };
446
+ }), Y = s(() => {
447
+ const m = e.walletBalance.wallet_balance.upcoming_balance;
448
+ if (!m)
449
+ return;
450
+ const M = m.credits ? S(
451
+ m.credits.quantity,
452
+ m.credits.credit_type_id
453
+ ) : n(m);
454
+ return {
455
+ key: t({
456
+ defaultMessage: "Upcoming",
457
+ id: "wallet_balance.upcoming_label",
458
+ description: "Label for wallet grants that start at a later date"
459
+ }),
460
+ value: M
461
+ };
462
+ }), g = s(() => [
463
+ ...b.value,
464
+ ...O.value ? [O.value] : [],
465
+ ...Y.value ? [Y.value] : []
466
+ ]), x = s(
467
+ () => c.value ? t({
204
468
  defaultMessage: "Auto top-up enabled",
205
469
  id: "wallet_balance.auto_top_up_enabled_label",
206
470
  description: "Label shown when a wallet tops itself up automatically"
@@ -209,50 +473,55 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
209
473
  id: "wallet_balance.auto_top_up_disabled_label",
210
474
  description: "Label shown when a wallet has no automatic top-up configured"
211
475
  })
212
- ), $ = s(() => {
213
- const h = M.value;
214
- if (!h)
476
+ ), Z = s(() => {
477
+ const m = c.value;
478
+ if (!m)
215
479
  return t({
216
480
  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.",
217
481
  id: "wallet_balance.auto_top_up_setup_explanation",
218
482
  description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
219
483
  });
220
- const c = h.topup_amount ? n({ amount: h.topup_amount }) : "", A = b(h.threshold);
221
- return !c || !A ? t({
484
+ const M = m.topup_amount ? n({ amount: m.topup_amount }) : "", I = E(m.threshold);
485
+ return !M || !I ? t({
222
486
  defaultMessage: "Your balance is topped up automatically once it runs low.",
223
487
  id: "wallet_balance.auto_top_up_generic_explanation",
224
488
  description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
225
- }) : x.value ? t(
489
+ }) : B.value ? t(
226
490
  {
227
491
  defaultMessage: "Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",
228
492
  id: "wallet_balance.auto_top_up_credits_explanation",
229
493
  description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
230
494
  },
231
- { topUpCredits: x.value, topUpAmount: c, threshold: A }
495
+ { topUpCredits: B.value, topUpAmount: M, threshold: I }
232
496
  ) : t(
233
497
  {
234
498
  defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
235
499
  id: "wallet_balance.auto_top_up_explanation",
236
500
  description: "Tooltip explaining how the automatic top-up of a wallet balance works"
237
501
  },
238
- { topUpAmount: c, threshold: A }
502
+ { topUpAmount: M, threshold: I }
239
503
  );
240
504
  });
241
505
  return {
242
506
  walletName: a,
243
507
  formatBalance: n,
244
- manualTopUpItems: l,
245
- flexibleManualTopUpItem: r,
246
- showManualTopUp: f,
247
- showAutoTopUp: T,
248
- activeTopUpConfig: M,
249
- autoTopUpLabel: w,
250
- autoTopUpExplanation: $
508
+ manualTopUpItems: h,
509
+ flexibleManualTopUpItem: w,
510
+ showManualTopUp: A,
511
+ showAutoTopUp: C,
512
+ activeTopUpConfig: c,
513
+ autoTopUpLabel: x,
514
+ autoTopUpExplanation: Z,
515
+ isBalanceWallet: L,
516
+ balanceBreakdown: b,
517
+ pendingTopUps: O,
518
+ upcoming: Y,
519
+ balanceDetails: g
251
520
  };
252
- }, go = { class: "flex flex-col gap-3 py-3" }, _o = { class: "flex flex-col gap-1 px-4" }, yo = { class: "flex w-full justify-between gap-3" }, bo = { class: "flex w-full items-center gap-4" }, wo = { key: 0 }, To = {
521
+ }, Uo = { class: "flex flex-col gap-3 py-3" }, Po = { class: "flex flex-col gap-1 px-4" }, So = { class: "flex w-full justify-between gap-3" }, Co = { class: "flex w-full items-center gap-4" }, Eo = { key: 0 }, xo = {
253
522
  key: 1,
254
523
  class: "flex w-full justify-between gap-3 px-4"
255
- }, Mo = { class: "flex min-w-0 items-center gap-1" }, Uo = { class: "flex min-w-0 items-center gap-1" }, Ao = { class: "shrink-0" }, So = /* @__PURE__ */ W({
524
+ }, $o = { class: "flex min-w-0 items-center gap-1" }, Bo = { class: "flex min-w-0 items-center gap-1" }, Oo = { class: "shrink-0" }, Io = /* @__PURE__ */ G({
256
525
  __name: "WalletBalancesItem",
257
526
  props: {
258
527
  walletBalance: {},
@@ -261,92 +530,98 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
261
530
  },
262
531
  emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
263
532
  setup(e) {
264
- const t = e, { $t: o } = Q(), {
533
+ const t = e, { $t: o } = te(), {
265
534
  walletName: n,
266
535
  formatBalance: a,
267
536
  manualTopUpItems: i,
268
537
  flexibleManualTopUpItem: l,
269
538
  showManualTopUp: r,
270
- showAutoTopUp: f,
271
- activeTopUpConfig: T,
272
- autoTopUpLabel: M,
273
- autoTopUpExplanation: S
274
- } = ho(t);
275
- return (p, b) => (_(), Y("div", go, [
276
- N("div", _o, [
277
- N("div", yo, [
278
- C(Z, {
539
+ showAutoTopUp: h,
540
+ activeTopUpConfig: w,
541
+ autoTopUpLabel: A,
542
+ autoTopUpExplanation: C,
543
+ balanceDetails: c
544
+ } = Ao(t);
545
+ return (T, S) => (f(), z("div", Uo, [
546
+ D("div", Po, [
547
+ D("div", So, [
548
+ P(J, {
279
549
  variant: "body-xs",
280
550
  color: "subtle",
281
551
  "no-spacing": ""
282
552
  }, {
283
- default: g(() => [
284
- V(k(u(n)), 1)
553
+ default: v(() => [
554
+ V(F(u(n)), 1)
285
555
  ]),
286
556
  _: 1
287
557
  }),
288
- C(Z, {
558
+ P(J, {
289
559
  variant: "body-xs",
290
560
  color: "subtle",
291
561
  "no-spacing": ""
292
562
  }, {
293
- default: g(() => {
294
- var P, x;
563
+ default: v(() => {
564
+ var E, y;
295
565
  return [
296
- (P = e.walletBalance.wallet_balance) != null && P.balance_at ? (_(), E(fo, {
566
+ (E = e.walletBalance.wallet_balance) != null && E.balance_at ? (f(), U(go, {
297
567
  key: 0,
298
- date: new Date((x = e.walletBalance.wallet_balance) == null ? void 0 : x.balance_at),
568
+ date: new Date((y = e.walletBalance.wallet_balance) == null ? void 0 : y.balance_at),
299
569
  "action-verb": u(o)({
300
570
  defaultMessage: "updated",
301
571
  id: "wallet_balance.updated_action_verb",
302
572
  description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
303
573
  })
304
- }, null, 8, ["date", "action-verb"])) : R("", !0)
574
+ }, null, 8, ["date", "action-verb"])) : q("", !0)
305
575
  ];
306
576
  }),
307
577
  _: 1
308
578
  })
309
579
  ]),
310
- N("div", bo, [
311
- C(Z, {
580
+ D("div", Co, [
581
+ P(J, {
312
582
  variant: "body-lg",
313
583
  weight: "semibold",
314
584
  "no-spacing": "",
315
585
  class: "grow"
316
586
  }, {
317
- default: g(() => [
318
- V(k(u(a)(t.walletBalance.wallet_balance.open_balance)), 1)
587
+ default: v(() => [
588
+ V(F(u(a)(t.walletBalance.wallet_balance.open_balance)), 1)
319
589
  ]),
320
590
  _: 1
321
591
  }),
322
- u(r) ? (_(), E(u(se), {
592
+ u(r) ? (f(), U(u(pe), {
323
593
  key: 0,
324
594
  size: "xs",
325
- onClick: b[0] || (b[0] = (P) => p.$emit("top-up", u(i)[0]))
595
+ onClick: S[0] || (S[0] = (E) => T.$emit("top-up", u(i)[0]))
326
596
  }, {
327
- default: g(() => [
328
- V(k(u(o)({
597
+ default: v(() => [
598
+ V(F(u(o)({
329
599
  defaultMessage: "Top up",
330
600
  id: "v1V8kA",
331
601
  description: "Button to top up a wallet balance"
332
602
  })), 1)
333
603
  ]),
334
604
  _: 1
335
- })) : R("", !0)
336
- ])
605
+ })) : q("", !0)
606
+ ]),
607
+ u(c).length ? (f(), U(Mo, {
608
+ key: 0,
609
+ details: u(c),
610
+ cols: 1
611
+ }, null, 8, ["details"])) : q("", !0)
337
612
  ]),
338
- p.$slots.graph ? (_(), Y("div", wo, [
339
- ue(p.$slots, "graph")
340
- ])) : R("", !0),
341
- u(f) ? (_(), Y("div", To, [
342
- N("div", Mo, [
343
- C(nt, { class: "min-w-0" }, {
344
- tooltip: g(() => [
345
- C(at, null, {
346
- default: g(() => [
347
- C(it, null, {
348
- default: g(() => [
349
- V(k(u(S)), 1)
613
+ T.$slots.graph ? (f(), z("div", Eo, [
614
+ X(T.$slots, "graph")
615
+ ])) : q("", !0),
616
+ u(h) ? (f(), z("div", xo, [
617
+ D("div", $o, [
618
+ P(ke, { class: "min-w-0" }, {
619
+ tooltip: v(() => [
620
+ P(De, null, {
621
+ default: v(() => [
622
+ P(Ne, null, {
623
+ default: v(() => [
624
+ V(F(u(C)), 1)
350
625
  ]),
351
626
  _: 1
352
627
  })
@@ -354,20 +629,20 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
354
629
  _: 1
355
630
  })
356
631
  ]),
357
- default: g(() => [
358
- N("div", Uo, [
359
- C(Z, {
632
+ default: v(() => [
633
+ D("div", Bo, [
634
+ P(J, {
360
635
  variant: "body-sm",
361
636
  color: "secondary",
362
637
  "no-spacing": "",
363
638
  class: "truncate"
364
639
  }, {
365
- default: g(() => [
366
- V(k(u(M)), 1)
640
+ default: v(() => [
641
+ V(F(u(A)), 1)
367
642
  ]),
368
643
  _: 1
369
644
  }),
370
- C(Zt, {
645
+ P(to, {
371
646
  icon: "info",
372
647
  size: "2xs",
373
648
  class: "shrink-0 cursor-help text-gray-400"
@@ -377,29 +652,29 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
377
652
  _: 1
378
653
  })
379
654
  ]),
380
- N("div", Ao, [
381
- u(T) ? (_(), E(u(se), {
655
+ D("div", Oo, [
656
+ u(w) ? (f(), U(u(pe), {
382
657
  key: 0,
383
658
  size: "xs",
384
659
  intent: "secondary",
385
- onClick: b[1] || (b[1] = (P) => p.$emit("cancel-auto-top-up", u(T)))
660
+ onClick: S[1] || (S[1] = (E) => T.$emit("cancel-auto-top-up", u(w)))
386
661
  }, {
387
- default: g(() => [
388
- V(k(u(o)({
662
+ default: v(() => [
663
+ V(F(u(o)({
389
664
  defaultMessage: "Disable",
390
665
  id: "wallet_balance.auto_top_up_disable_button",
391
666
  description: "Button to turn off a wallet's automatic top-up"
392
667
  })), 1)
393
668
  ]),
394
669
  _: 1
395
- })) : (_(), E(u(se), {
670
+ })) : (f(), U(u(pe), {
396
671
  key: 1,
397
672
  size: "xs",
398
673
  intent: "secondary",
399
- onClick: b[2] || (b[2] = (P) => p.$emit("auto-top-up", u(l)))
674
+ onClick: S[2] || (S[2] = (E) => T.$emit("auto-top-up", u(l)))
400
675
  }, {
401
- default: g(() => [
402
- V(k(u(o)({
676
+ default: v(() => [
677
+ V(F(u(o)({
403
678
  defaultMessage: "Enable",
404
679
  id: "wallet_balance.auto_top_up_enable_button",
405
680
  description: "Button to set up a wallet's automatic top-up"
@@ -408,10 +683,10 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
408
683
  _: 1
409
684
  }))
410
685
  ])
411
- ])) : R("", !0)
686
+ ])) : q("", !0)
412
687
  ]));
413
688
  }
414
- }), Po = { class: "flex flex-col gap-2" }, Co = /* @__PURE__ */ W({
689
+ }), ko = { class: "flex flex-col gap-2" }, Do = /* @__PURE__ */ G({
415
690
  __name: "WalletBalances",
416
691
  props: {
417
692
  customerWalletBalances: {},
@@ -421,19 +696,19 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
421
696
  },
422
697
  emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
423
698
  setup(e) {
424
- return (t, o) => (_(), E(we, {
699
+ return (t, o) => (f(), U(Me, {
425
700
  "no-spacing": "",
426
701
  "no-border": "",
427
702
  title: e.title
428
- }, re({
429
- default: g(() => [
430
- N("div", Po, [
431
- (_(!0), Y(Te, null, Me(e.customerWalletBalances, (n) => (_(), E(we, {
703
+ }, me({
704
+ default: v(() => [
705
+ D("div", ko, [
706
+ (f(!0), z(he, null, Ae(e.customerWalletBalances, (n) => (f(), U(Me, {
432
707
  key: n.wallet_id,
433
708
  "no-spacing": ""
434
709
  }, {
435
- default: g(() => [
436
- C(So, {
710
+ default: v(() => [
711
+ P(Io, {
437
712
  "wallet-balance": n,
438
713
  "show-auto-top-up": e.showAutoTopUp,
439
714
  "show-manual-top-up": e.showManualTopUp,
@@ -450,19 +725,19 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
450
725
  }, [
451
726
  t.$slots["heading-right"] ? {
452
727
  name: "right",
453
- fn: g(() => [
454
- ue(t.$slots, "heading-right")
728
+ fn: v(() => [
729
+ X(t.$slots, "heading-right")
455
730
  ]),
456
731
  key: "0"
457
732
  } : void 0
458
733
  ]), 1032, ["title"]));
459
734
  }
460
735
  });
461
- function Eo() {
462
- const e = tt(), t = ot();
736
+ function No() {
737
+ const e = lt(), t = ut();
463
738
  async function o(n) {
464
739
  return e({
465
- url: be(
740
+ url: Te(
466
741
  t.apiUrls.config,
467
742
  "portal",
468
743
  "customers",
@@ -470,7 +745,7 @@ function Eo() {
470
745
  "wallets",
471
746
  "balance"
472
747
  ),
473
- query: zt({ expandParams: jt }),
748
+ query: Gt({ expandParams: Qt }),
474
749
  options: { method: "POST" },
475
750
  data: {}
476
751
  });
@@ -479,26 +754,26 @@ function Eo() {
479
754
  getCustomerWalletBalances: o
480
755
  };
481
756
  }
482
- function na({ customerId: e }) {
483
- const { getCustomerWalletBalances: t } = Eo(), { data: o, execute: n, apiStatus: a, error: i, isPending: l } = Kt({
757
+ function ma({ customerId: e }) {
758
+ const { getCustomerWalletBalances: t } = No(), { data: o, execute: n, apiStatus: a, error: i, isPending: l } = Jt({
484
759
  service: () => t(e)
485
760
  });
486
761
  return { walletBalances: s(
487
762
  () => o.value ?? null
488
763
  ), apiStatus: a, error: i, fetch: n, isPending: l };
489
764
  }
490
- const Qe = (e = [], t) => {
765
+ const Je = (e = [], t) => {
491
766
  if (!(t != null && t.pricing_item_id))
492
767
  return;
493
- const o = (a) => a.charge_on_demand_pricing_items ?? [], n = He(t);
768
+ const o = (a) => a.charge_on_demand_pricing_items ?? [], n = Qe(t);
494
769
  return e.find(
495
- (a) => o(a).some((i) => He(i) === n)
770
+ (a) => o(a).some((i) => Qe(i) === n)
496
771
  ) ?? e.find(
497
772
  (a) => o(a).some(
498
773
  ({ pricing_item_id: i }) => i === t.pricing_item_id
499
774
  )
500
775
  );
501
- }, xo = (e, t) => {
776
+ }, Ro = (e, t) => {
502
777
  const o = new Set(
503
778
  (t ?? []).flatMap(
504
779
  ({ pricing_plan_schedule_infos: n }) => (n ?? []).map(({ id: a }) => a)
@@ -510,14 +785,21 @@ const Qe = (e = [], t) => {
510
785
  ({ pricing_plan_schedule_id: a }) => !!a && o.has(a)
511
786
  )
512
787
  }));
513
- }, Io = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], ke = (e) => typeof e == "object" && e !== null && "pricing_item" in e, $o = (e) => [
788
+ }, Fo = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], Ze = (e) => (e ?? []).flatMap(({ configs: t }) => t ?? []), qo = (e, t) => [
789
+ ...(e == null ? void 0 : e.configs) ?? [],
790
+ ...Ze(e == null ? void 0 : e.billing_period_configs),
791
+ ...((e == null ? void 0 : e.pricing_currency_configs) ?? []).filter((o) => !t || o.currency === t).flatMap((o) => [
792
+ ...o.configs ?? [],
793
+ ...Ze(o.billing_period_configs)
794
+ ])
795
+ ], qe = (e) => typeof e == "object" && e !== null && "pricing_item" in e, Lo = (e) => [
514
796
  ...new Set(
515
797
  ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
516
- (t) => ke(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
798
+ (t) => qe(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
517
799
  )
518
800
  )
519
- ], Oo = (e, t) => {
520
- const o = new Set($o(e));
801
+ ], Vo = (e, t) => {
802
+ const o = new Set(Lo(e));
521
803
  return t.flatMap((n) => {
522
804
  var i;
523
805
  const a = (n.pricing_plan_schedule_infos ?? []).filter(
@@ -526,93 +808,101 @@ const Qe = (e = [], t) => {
526
808
  return a.length === 0 ? [] : [
527
809
  {
528
810
  id: n.id,
529
- name: n.name || n.reference || ((i = eo(n)) == null ? void 0 : i.name) || void 0,
811
+ name: n.name || n.reference || ((i = oo(n)) == null ? void 0 : i.name) || void 0,
530
812
  scheduleIds: a.map(({ id: l }) => l),
531
813
  enabledPricingIds: a.flatMap(
532
814
  (l) => {
533
815
  var r;
534
816
  return (((r = l.pricing_plan_schedule) == null ? void 0 : r.enabled_pricings) ?? []).flatMap(
535
- ({ pricing_id: f }) => f ? [f] : []
817
+ ({ pricing_id: h }) => h ? [h] : []
536
818
  );
537
819
  }
538
820
  )
539
821
  }
540
822
  ];
541
823
  });
542
- }, Bo = (e, t) => {
824
+ }, zo = (e, t) => {
543
825
  if (!e || t.length === 0)
544
826
  return e;
545
827
  const o = new Set(t);
546
828
  return {
547
829
  ...e,
548
830
  charge_on_demand_pricing_items: (e.charge_on_demand_pricing_items ?? []).filter(
549
- (n) => ke(n) && !!n.pricing_plan_schedule_id && o.has(n.pricing_plan_schedule_id)
831
+ (n) => qe(n) && !!n.pricing_plan_schedule_id && o.has(n.pricing_plan_schedule_id)
550
832
  )
551
833
  };
552
- }, gt = (e) => ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap((t) => {
553
- var n, a;
554
- if (!ke(t))
834
+ }, Yo = (e, t) => {
835
+ var o;
836
+ return t ? (o = e.find(
837
+ ({ pricing_plan_schedule_infos: n }) => n == null ? void 0 : n.some(({ id: a }) => a === t)
838
+ )) == null ? void 0 : o.billing_currency : void 0;
839
+ }, bt = (e, t = []) => ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap((o) => {
840
+ var i, l, r;
841
+ if (!qe(o))
555
842
  return [];
556
- const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
557
- return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
558
- const l = Ro(i, e), r = Do(i, e);
843
+ const n = o.pricing_item_id ?? ((i = o.pricing_item) == null ? void 0 : i.id);
844
+ if (!n)
845
+ return [];
846
+ const a = ((r = (l = e == null ? void 0 : e.wallet_balance.balance) == null ? void 0 : l.amount) == null ? void 0 : r.currency) ?? Yo(t, o.pricing_plan_schedule_id);
847
+ return qo(o.pricing_item, a).map((h) => {
848
+ const w = Go(h, e), A = Wo(h, e);
559
849
  return {
560
- pricingItemId: o,
561
- ...t.pricing_plan_schedule_id && {
562
- pricingPlanScheduleId: t.pricing_plan_schedule_id
850
+ pricingItemId: n,
851
+ ...o.pricing_plan_schedule_id && {
852
+ pricingPlanScheduleId: o.pricing_plan_schedule_id
563
853
  },
564
- config: i,
565
- ...l && { flexiblePricing: l },
566
- ...r && { fixedPricing: r }
854
+ config: h,
855
+ ...w && { flexiblePricing: w },
856
+ ...A && { fixedPricing: A }
567
857
  };
568
- }) : [];
858
+ });
569
859
  });
570
- function Do(e, t) {
860
+ function Wo(e, t) {
571
861
  var i, l, r;
572
- if (!e.on_demand || !Jt(e, ["FIXED"]))
862
+ if (!e.on_demand || !eo(e, ["FIXED"]))
573
863
  return;
574
864
  const o = (r = (l = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : l[0]) == null ? void 0 : r.fixed_amount;
575
865
  if (!o)
576
866
  return;
577
- const n = _t(t), a = n ? ko(e, t) : void 0;
867
+ const n = wt(t), a = n ? jo(e, t) : void 0;
578
868
  return {
579
869
  amount: o,
580
- value: a && n ? Re(a.quantity, n) : { amount: o }
870
+ value: a && n ? Le(a.quantity, n) : { amount: o }
581
871
  };
582
872
  }
583
- const _t = (e) => {
873
+ const wt = (e) => {
584
874
  var t;
585
875
  return (t = e == null ? void 0 : e.wallet_balance.balance) == null ? void 0 : t.credits;
586
- }, yt = (e, t) => {
876
+ }, Tt = (e, t) => {
587
877
  var n;
588
878
  const o = (n = t == null ? void 0 : t.wallet) == null ? void 0 : n.wallet_type_id;
589
879
  return (e.wallet_grants ?? []).filter(
590
880
  ({ wallet_type_id: a }) => !o || a === o
591
881
  );
592
- }, No = (e, t) => {
882
+ }, Ho = (e, t) => {
593
883
  var o, n;
594
- return (n = (o = yt(e, t).find(
884
+ return (n = (o = Tt(e, t).find(
595
885
  ({ credits_grant: a }) => a == null ? void 0 : a.conversion
596
886
  )) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
597
- }, ko = (e, t) => {
887
+ }, jo = (e, t) => {
598
888
  var o, n;
599
- return (n = (o = yt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
600
- }, Re = (e, t) => ({ credits: { ...t, quantity: e } }), bt = (e, t) => {
889
+ return (n = (o = Tt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
890
+ }, Le = (e, t) => ({ credits: { ...t, quantity: e } }), Mt = (e, t) => {
601
891
  const o = Number(e), n = Number(t);
602
892
  return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
603
893
  };
604
- function Ro(e, t) {
605
- var f, T, M, S, p, b, P;
606
- if (!e.on_demand || !Ce(e))
894
+ function Go(e, t) {
895
+ var h, w, A, C, c, T, S;
896
+ if (!e.on_demand || !Ee(e))
607
897
  return;
608
- const o = (T = (f = e.details) == null ? void 0 : f.bands) == null ? void 0 : T[0], n = ((M = o == null ? void 0 : o.minimum_amount) == null ? void 0 : M.currency) ?? ((S = o == null ? void 0 : o.maximum_amount) == null ? void 0 : S.currency) ?? ((b = (p = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : p.amount) == null ? void 0 : b.currency);
898
+ const o = (w = (h = e.details) == null ? void 0 : h.bands) == null ? void 0 : w[0], n = ((A = o == null ? void 0 : o.minimum_amount) == null ? void 0 : A.currency) ?? ((C = o == null ? void 0 : o.maximum_amount) == null ? void 0 : C.currency) ?? ((T = (c = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : c.amount) == null ? void 0 : T.currency);
609
899
  if (!n)
610
900
  return;
611
- const a = _t(t), i = a ? No(e, t) : void 0, l = (P = a == null ? void 0 : a.credit_type) == null ? void 0 : P.unit_name, r = (x) => {
612
- if (!x)
901
+ const a = wt(t), i = a ? Ho(e, t) : void 0, l = (S = a == null ? void 0 : a.credit_type) == null ? void 0 : S.unit_name, r = (E) => {
902
+ if (!E)
613
903
  return;
614
- const w = a && i ? bt(x.quantity, i.rate) : void 0;
615
- return w !== void 0 && a ? Re(w, a) : { amount: x };
904
+ const y = a && i ? Mt(E.quantity, i.rate) : void 0;
905
+ return y !== void 0 && a ? Le(y, a) : { amount: E };
616
906
  };
617
907
  return {
618
908
  config: {
@@ -633,144 +923,144 @@ function Ro(e, t) {
633
923
  }
634
924
  };
635
925
  }
636
- const Fe = ({ fixedPricing: e, flexiblePricing: t }) => {
926
+ const Ve = ({ fixedPricing: e, flexiblePricing: t }) => {
637
927
  var o;
638
928
  return (e == null ? void 0 : e.value.credits) ?? ((o = (t == null ? void 0 : t.bounds.minimum) ?? (t == null ? void 0 : t.bounds.maximum)) == null ? void 0 : o.credits);
639
- }, Fo = (e) => {
929
+ }, Qo = (e) => {
640
930
  var t;
641
- return !!Fe(e) || !!((t = e.flexiblePricing) != null && t.creditsConfiguration);
642
- }, qo = (e) => {
931
+ return !!Ve(e) || !!((t = e.flexiblePricing) != null && t.creditsConfiguration);
932
+ }, Ko = (e) => {
643
933
  var t;
644
- return (t = e.map(Fe).find((o) => o == null ? void 0 : o.credit_type_id)) == null ? void 0 : t.credit_type_id;
645
- }, wt = (e = []) => {
934
+ return (t = e.map(Ve).find((o) => o == null ? void 0 : o.credit_type_id)) == null ? void 0 : t.credit_type_id;
935
+ }, At = (e = []) => {
646
936
  for (const { flexiblePricing: t, fixedPricing: o } of e) {
647
937
  const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
648
938
  if (n)
649
939
  return n;
650
940
  }
651
- }, Tt = (e = []) => {
941
+ }, Ut = (e = []) => {
652
942
  var t, o, n;
653
- return (n = (o = (t = e.map(Fe).find((a) => {
943
+ return (n = (o = (t = e.map(Ve).find((a) => {
654
944
  var i, l;
655
945
  return (l = (i = a == null ? void 0 : a.credit_type) == null ? void 0 : i.unit_name) == null ? void 0 : l.plural;
656
946
  })) == null ? void 0 : t.credit_type) == null ? void 0 : o.unit_name) == null ? void 0 : n.plural;
657
- }, Vo = (e = []) => {
947
+ }, Xo = (e = []) => {
658
948
  var t;
659
949
  for (const { flexiblePricing: o } of e) {
660
950
  const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
661
951
  if (n)
662
952
  return n;
663
953
  }
664
- }, Lo = (e = []) => {
954
+ }, Jo = (e = []) => {
665
955
  for (const { flexiblePricing: t } of e) {
666
956
  const { minimum_amount: o, maximum_amount: n } = (t == null ? void 0 : t.config) ?? {};
667
957
  if (o || n)
668
958
  return { ...o && { minimum: o }, ...n && { maximum: n } };
669
959
  }
670
960
  return {};
671
- }, Yo = (e = []) => {
672
- if (e.some(Fo)) {
673
- const o = qo(e);
961
+ }, Zo = (e = []) => {
962
+ if (e.some(Qo)) {
963
+ const o = Ko(e);
674
964
  return o ? { creditTypeId: o } : void 0;
675
965
  }
676
- const t = wt(e);
966
+ const t = At(e);
677
967
  return t ? { currency: t } : void 0;
678
- }, Wo = (e, t) => {
968
+ }, en = (e, t) => {
679
969
  var l;
680
970
  if (e.fixedPricing)
681
971
  return e.fixedPricing.value;
682
972
  if (!e.flexiblePricing || !t)
683
973
  return;
684
- const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (l = o.minimum ?? o.maximum) == null ? void 0 : l.credits, i = n ? bt(t.quantity, n.conversionRate) : void 0;
685
- return a && i !== void 0 ? Re(i, a) : { amount: t };
686
- }, Mt = (e = []) => {
687
- const t = Yo(e);
974
+ const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (l = o.minimum ?? o.maximum) == null ? void 0 : l.credits, i = n ? Mt(t.quantity, n.conversionRate) : void 0;
975
+ return a && i !== void 0 ? Le(i, a) : { amount: t };
976
+ }, Pt = (e = []) => {
977
+ const t = Zo(e);
688
978
  if (t)
689
979
  return {
690
980
  denomination: t,
691
- chargeCurrency: wt(e) ?? "",
692
- creditUnitName: Tt(e),
693
- conversionRate: Vo(e),
694
- topUpBounds: Lo(e)
981
+ chargeCurrency: At(e) ?? "",
982
+ creditUnitName: Ut(e),
983
+ conversionRate: Xo(e),
984
+ topUpBounds: Jo(e)
695
985
  };
696
- }, Ho = 400;
697
- function zo({
986
+ }, tn = 400;
987
+ function on({
698
988
  pricingPlanScheduleId: e,
699
989
  pricingItems: t
700
990
  }) {
701
- const { previewChargeOnDemandPricingItems: o } = pt(), n = Ue(), a = I(), i = I(!1), l = I(!1), r = s(() => i.value || l.value), f = I(!1), T = Qt(), M = async () => {
702
- const S = e.value, p = T();
703
- if (l.value = !1, !S || !t.value) {
704
- t.value && !S && n.warn(
991
+ const { previewChargeOnDemandPricingItems: o } = ft(), n = Ue(), a = $(), i = $(!1), l = $(!1), r = s(() => i.value || l.value), h = $(!1), w = Kt(), A = async () => {
992
+ const C = e.value, c = w();
993
+ if (l.value = !1, !C || !t.value) {
994
+ t.value && !C && n.warn(
705
995
  "INVOICE_PREVIEW_SKIPPED",
706
996
  "Skipped the on-demand charge invoice preview: no schedule to charge it on",
707
997
  { missing: ["pricingPlanScheduleId"] }
708
- ), a.value = void 0, i.value = !1, f.value = !1;
998
+ ), a.value = void 0, i.value = !1, h.value = !1;
709
999
  return;
710
1000
  }
711
- i.value = !0, f.value = !1;
1001
+ i.value = !0, h.value = !1;
712
1002
  try {
713
- const b = await o({
714
- pricingPlanScheduleId: S,
1003
+ const T = await o({
1004
+ pricingPlanScheduleId: C,
715
1005
  pricingItems: t.value
716
1006
  });
717
- p() && (a.value = b);
718
- } catch (b) {
719
- p() && (a.value = void 0, f.value = !0), n.error(
1007
+ c() && (a.value = T);
1008
+ } catch (T) {
1009
+ c() && (a.value = void 0, h.value = !0), n.error(
720
1010
  "INVOICE_PREVIEW_FAILED",
721
1011
  "Failed to load the invoice preview",
722
1012
  { preview: "ON_DEMAND_CHARGE" },
723
- b
1013
+ T
724
1014
  );
725
1015
  } finally {
726
- p() && (i.value = !1);
1016
+ c() && (i.value = !1);
727
1017
  }
728
1018
  };
729
- return ao(t, () => void M(), {
730
- debounce: () => a.value || i.value || f.value ? Ho : 0,
1019
+ return so(t, () => void A(), {
1020
+ debounce: () => a.value || i.value || h.value ? tn : 0,
731
1021
  deep: !0
732
- }), ee(
1022
+ }), ue(
733
1023
  t,
734
- (S) => {
735
- l.value = !!S, S || (T(), a.value = void 0, f.value = !1, i.value = !1);
1024
+ (C) => {
1025
+ l.value = !!C, C || (w(), a.value = void 0, h.value = !1, i.value = !1);
736
1026
  },
737
1027
  { deep: !0, flush: "sync" }
738
- ), M(), { invoicePreview: a, isPreviewPending: r, hasPreviewFailed: f, loadPreview: M };
1028
+ ), A(), { invoicePreview: a, isPreviewPending: r, hasPreviewFailed: h, loadPreview: A };
739
1029
  }
740
- const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1030
+ const nn = ["aria-busy"], St = /* @__PURE__ */ G({
741
1031
  __name: "TopUpInvoicePreview",
742
1032
  props: {
743
1033
  pricingPlanScheduleId: { type: String },
744
1034
  pricingItems: { type: Array }
745
1035
  },
746
1036
  setup(e) {
747
- const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i, isPreviewPending: l, hasPreviewFailed: r } = zo({
1037
+ const t = e, { $t: o } = te(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i, isPreviewPending: l, hasPreviewFailed: r } = on({
748
1038
  pricingPlanScheduleId: n,
749
1039
  pricingItems: a
750
- }), f = s(
1040
+ }), h = s(
751
1041
  () => r.value && !l.value ? o({
752
1042
  defaultMessage: "Unable to calculate the total. Please try again.",
753
1043
  description: "Shown in place of the top-up total when it failed to load",
754
1044
  id: "topup_modal.invoice_preview.error"
755
1045
  }) : void 0
756
1046
  );
757
- return (T, M) => f.value ? (_(), E(u(me), {
1047
+ return (w, A) => h.value ? (f(), U(u(ye), {
758
1048
  key: 0,
759
1049
  class: "sv-top-up-invoice-preview sv-top-up-invoice-preview--error sv-error",
760
- title: f.value
761
- }, null, 8, ["title"])) : (_(), E(st, {
1050
+ title: h.value
1051
+ }, null, 8, ["title"])) : (f(), U(rt, {
762
1052
  key: 1,
763
1053
  class: "sv-top-up-invoice-preview h-[152px]"
764
1054
  }, {
765
- default: g(() => [
766
- u(i) ? (_(), Y("div", {
1055
+ default: v(() => [
1056
+ u(i) ? (f(), z("div", {
767
1057
  key: 0,
768
- class: $e({ "opacity-60": u(l) }),
1058
+ class: le({ "opacity-60": u(l) }),
769
1059
  "aria-busy": u(l)
770
1060
  }, [
771
- C(u(no), { required: "" }, {
772
- default: g(() => [
773
- V(k(u(o)({
1061
+ P(u(io), { required: "" }, {
1062
+ default: v(() => [
1063
+ V(F(u(o)({
774
1064
  defaultMessage: "You will pay",
775
1065
  description: "Label above the preview of what topping up will be invoiced for",
776
1066
  id: "topup_modal.invoice_preview.label"
@@ -778,69 +1068,69 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
778
1068
  ]),
779
1069
  _: 1
780
1070
  }),
781
- C(u(we), { "content-background": "none" }, {
782
- default: g(() => [
783
- C(u(ct), {
1071
+ P(u(Me), { "content-background": "none" }, {
1072
+ default: v(() => [
1073
+ P(u(vt), {
784
1074
  invoice: u(i),
785
1075
  "is-customer-facing": ""
786
1076
  }, null, 8, ["invoice"])
787
1077
  ]),
788
1078
  _: 1
789
1079
  })
790
- ], 10, jo)) : R("", !0)
1080
+ ], 10, nn)) : q("", !0)
791
1081
  ]),
792
1082
  _: 1
793
1083
  }));
794
1084
  }
795
- }), At = (e, t) => e.currency ?? t ?? e.creditTypeId ?? "", Ge = (e, t) => ({
1085
+ }), Ct = (e, t) => e.currency ?? t ?? e.creditTypeId ?? "", et = (e, t) => ({
796
1086
  quantity: e ?? null,
797
1087
  currency: t
798
- }), Ee = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
799
- var i, l, r, f, T;
1088
+ }), xe = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
1089
+ var i, l, r, h, w;
800
1090
  return {
801
1091
  enabled: (e == null ? void 0 : e.status) === "ACTIVE",
802
- threshold: Ge(
803
- ((l = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : l.quantity) ?? ((f = (r = e == null ? void 0 : e.threshold) == null ? void 0 : r.credits) == null ? void 0 : f.quantity),
804
- At(t, n)
1092
+ threshold: et(
1093
+ ((l = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : l.quantity) ?? ((h = (r = e == null ? void 0 : e.threshold) == null ? void 0 : r.credits) == null ? void 0 : h.quantity),
1094
+ Ct(t, n)
805
1095
  ),
806
- topUpAmount: Ge(((T = e == null ? void 0 : e.topup_amount) == null ? void 0 : T.quantity) ?? a, o)
1096
+ topUpAmount: et(((w = e == null ? void 0 : e.topup_amount) == null ? void 0 : w.quantity) ?? a, o)
807
1097
  };
808
- }, Qo = (e, t) => {
1098
+ }, an = (e, t) => {
809
1099
  var n;
810
1100
  const o = (n = e.threshold) == null ? void 0 : n.quantity;
811
1101
  return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
812
- }, Ke = (e, t) => {
1102
+ }, tt = (e, t) => {
813
1103
  var o;
814
1104
  return (o = e.topUpAmount) != null && o.quantity ? {
815
1105
  quantity: e.topUpAmount.quantity,
816
1106
  currency: e.topUpAmount.currency ?? t
817
1107
  } : void 0;
818
- }, St = (e, { denomination: t, chargeCurrency: o }) => ({
1108
+ }, Et = (e, { denomination: t, chargeCurrency: o }) => ({
819
1109
  status: e.enabled ? "ACTIVE" : "INACTIVE",
820
- threshold: Qo(e, t),
821
- ...Ke(e, o) && {
822
- topup_amount: Ke(e, o)
1110
+ threshold: an(e, t),
1111
+ ...tt(e, o) && {
1112
+ topup_amount: tt(e, o)
823
1113
  }
824
- }), Xe = (e, t) => St(Ee(e, t), t), Je = (e, t) => JSON.stringify(e) === JSON.stringify(t), Pt = (e, t) => {
1114
+ }), ot = (e, t) => Et(xe(e, t), t), nt = (e, t) => JSON.stringify(e) === JSON.stringify(t), xt = (e, t) => {
825
1115
  const o = Number(t == null ? void 0 : t.quantity);
826
1116
  return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e >= o;
827
- }, Ct = (e, t) => {
1117
+ }, $t = (e, t) => {
828
1118
  const o = Number(t == null ? void 0 : t.quantity);
829
1119
  return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e <= o;
830
- }, le = (e) => {
1120
+ }, ve = (e) => {
831
1121
  const t = Number(e);
832
1122
  return e != null && e !== "" && Number.isFinite(t) ? t : void 0;
833
- }, qe = (e, t, o) => {
834
- const n = le(e), a = le(o);
1123
+ }, ze = (e, t, o) => {
1124
+ const n = ve(e), a = ve(o);
835
1125
  if (!(n === void 0 || a === void 0 || a <= 0))
836
1126
  return t === "CREDITS" ? n / a : n * a;
837
- }, Ze = (e, t, o, n) => t === o ? le(e) : qe(e, t, n), Go = (e, t, o) => t === "CREDITS" ? qe(e, "AMOUNT", o) : le(e), Ve = (e, t) => e.toFixed(lo(t)), et = (e, t, o) => t === "AMOUNT" ? Ve(e, o) : String(Number(e.toFixed(6))), Et = (e, t, o, n) => {
838
- const a = Go(e == null ? void 0 : e.quantity, t, o);
1127
+ }, at = (e, t, o, n) => t === o ? ve(e) : ze(e, t, n), sn = (e, t, o) => t === "CREDITS" ? ze(e, "AMOUNT", o) : ve(e), Ye = (e, t) => e.toFixed(ro(t)), it = (e, t, o) => t === "AMOUNT" ? Ye(e, o) : String(Number(e.toFixed(6))), Bt = (e, t, o, n) => {
1128
+ const a = sn(e == null ? void 0 : e.quantity, t, o);
839
1129
  if (a !== void 0)
840
- return t === "CREDITS" ? n(a) : Ve(a, e == null ? void 0 : e.currency);
841
- }, xe = /* @__PURE__ */ W({
1130
+ return t === "CREDITS" ? n(a) : Ye(a, e == null ? void 0 : e.currency);
1131
+ }, $e = /* @__PURE__ */ G({
842
1132
  __name: "ConvertedAmountInput",
843
- props: /* @__PURE__ */ Ht({
1133
+ props: /* @__PURE__ */ jt({
844
1134
  unit: { type: String },
845
1135
  modelBase: { type: String },
846
1136
  entryBase: { type: String },
@@ -860,103 +1150,103 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
860
1150
  }),
861
1151
  emits: ["update:modelValue"],
862
1152
  setup(e) {
863
- const t = e, o = Yt(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase), l = s(
864
- () => i.value !== t.modelBase && le(t.conversionRate) !== void 0
865
- ), r = I("");
866
- ee(
1153
+ const t = e, o = Wt(e, "modelValue"), { $t: n, formatNumber: a } = te(), i = s(() => t.entryBase ?? t.modelBase), l = s(
1154
+ () => i.value !== t.modelBase && ve(t.conversionRate) !== void 0
1155
+ ), r = $("");
1156
+ ue(
867
1157
  () => [o.value, i.value, t.modelBase, t.conversionRate],
868
- ([c]) => {
1158
+ ([b]) => {
869
1159
  if (!l.value) {
870
- r.value = c ?? "";
1160
+ r.value = b ?? "";
871
1161
  return;
872
1162
  }
873
- if (c === f(r.value))
1163
+ if (b === h(r.value))
874
1164
  return;
875
- const A = Ze(
876
- c,
1165
+ const O = at(
1166
+ b,
877
1167
  t.modelBase,
878
1168
  i.value,
879
1169
  t.conversionRate
880
1170
  );
881
- r.value = A === void 0 ? "" : et(A, i.value, t.currency);
1171
+ r.value = O === void 0 ? "" : it(O, i.value, t.currency);
882
1172
  },
883
1173
  { immediate: !0 }
884
1174
  );
885
- function f(c) {
886
- const A = Ze(c, i.value, t.modelBase, t.conversionRate);
887
- return A === void 0 ? "" : et(A, t.modelBase, t.currency);
1175
+ function h(b) {
1176
+ const O = at(b, i.value, t.modelBase, t.conversionRate);
1177
+ return O === void 0 ? "" : it(O, t.modelBase, t.currency);
888
1178
  }
889
- const T = s({
1179
+ const w = s({
890
1180
  get: () => r.value,
891
- set: (c) => {
892
- r.value = to(c), o.value = l.value ? f(r.value) : r.value;
1181
+ set: (b) => {
1182
+ r.value = no(b), o.value = l.value ? h(r.value) : r.value;
893
1183
  }
894
- }), M = s(
895
- () => qe(r.value, i.value, t.conversionRate)
896
- ), S = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
1184
+ }), A = s(
1185
+ () => ze(r.value, i.value, t.conversionRate)
1186
+ ), C = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
897
1187
  defaultMessage: "credits",
898
1188
  description: "Generic name for a wallet credit, where its credit type does not name one",
899
1189
  id: "converted_amount_input.credits"
900
- })), p = (c, A) => Ne({ quantity: Ve(c, A), currency: A }), b = (c) => `${a(c)} ${S.value}`, P = s(() => {
901
- const c = t.error;
902
- return Array.isArray(c) ? c.length > 0 : !!(Wt(c) ? c.value : c);
903
- }), x = s(() => {
904
- const c = M.value;
905
- if (!(P.value || !t.showConversionHint || c === void 0))
1190
+ })), c = (b, O) => Fe({ quantity: Ye(b, O), currency: O }), T = (b) => `${a(b)} ${C.value}`, S = s(() => {
1191
+ const b = t.error;
1192
+ return Array.isArray(b) ? b.length > 0 : !!(Ht(b) ? b.value : b);
1193
+ }), E = s(() => {
1194
+ const b = A.value;
1195
+ if (!(S.value || !t.showConversionHint || b === void 0))
906
1196
  return i.value === "CREDITS" ? t.currency ? n(
907
1197
  {
908
1198
  defaultMessage: "Will cost {amount} excluding taxes",
909
1199
  description: "Helper text under a credits field, naming what those credits cost in money",
910
1200
  id: "converted_amount_input.cost"
911
1201
  },
912
- { amount: p(c, t.currency) }
1202
+ { amount: c(b, t.currency) }
913
1203
  ) : void 0 : n(
914
1204
  {
915
1205
  defaultMessage: "Buys about {credits}",
916
1206
  description: "Helper text under a money field, naming the credits that amount converts into",
917
1207
  id: "converted_amount_input.buys"
918
1208
  },
919
- { credits: b(c) }
1209
+ { credits: T(b) }
920
1210
  );
921
- }), w = (c) => Et(c, i.value, t.conversionRate, a), $ = s(
1211
+ }), y = (b) => Bt(b, i.value, t.conversionRate, a), B = s(
922
1212
  () => {
923
- var c, A, B, v;
924
- return i.value === "CREDITS" ? S.value : ((A = (c = t.bounds) == null ? void 0 : c.minimum) == null ? void 0 : A.currency) ?? ((v = (B = t.bounds) == null ? void 0 : B.maximum) == null ? void 0 : v.currency) ?? t.unit;
1213
+ var b, O, Y, g;
1214
+ return i.value === "CREDITS" ? C.value : ((O = (b = t.bounds) == null ? void 0 : b.minimum) == null ? void 0 : O.currency) ?? ((g = (Y = t.bounds) == null ? void 0 : Y.maximum) == null ? void 0 : g.currency) ?? t.unit;
925
1215
  }
926
- ), h = s(() => {
927
- var v, U;
928
- const c = w((v = t.bounds) == null ? void 0 : v.minimum), A = w((U = t.bounds) == null ? void 0 : U.maximum), B = $.value;
929
- if (c && A)
1216
+ ), L = s(() => {
1217
+ var g, x;
1218
+ const b = y((g = t.bounds) == null ? void 0 : g.minimum), O = y((x = t.bounds) == null ? void 0 : x.maximum), Y = B.value;
1219
+ if (b && O)
930
1220
  return n(
931
1221
  {
932
1222
  defaultMessage: "Between {minimum} and {maximum} {unit}",
933
1223
  description: "Range of what a flexible top-up may be charged for, beside its label",
934
1224
  id: "converted_amount_input.bounds.range"
935
1225
  },
936
- { minimum: c, maximum: A, unit: B }
1226
+ { minimum: b, maximum: O, unit: Y }
937
1227
  );
938
- if (c)
1228
+ if (b)
939
1229
  return n(
940
1230
  {
941
1231
  defaultMessage: "At least {minimum} {unit}",
942
1232
  description: "Smallest amount a flexible top-up may be charged for, beside its label",
943
1233
  id: "converted_amount_input.bounds.minimum"
944
1234
  },
945
- { minimum: c, unit: B }
1235
+ { minimum: b, unit: Y }
946
1236
  );
947
- if (A)
1237
+ if (O)
948
1238
  return n(
949
1239
  {
950
1240
  defaultMessage: "Up to {maximum} {unit}",
951
1241
  description: "Largest amount a flexible top-up may be charged for, beside its label",
952
1242
  id: "converted_amount_input.bounds.maximum"
953
1243
  },
954
- { maximum: A, unit: B }
1244
+ { maximum: O, unit: Y }
955
1245
  );
956
1246
  });
957
- return (c, A) => (_(), E(u(so), ie({
958
- modelValue: T.value,
959
- "onUpdate:modelValue": A[0] || (A[0] = (B) => T.value = B),
1247
+ return (b, O) => (f(), U(u(uo), ae({
1248
+ modelValue: w.value,
1249
+ "onUpdate:modelValue": O[0] || (O[0] = (Y) => w.value = Y),
960
1250
  class: "sv-converted-amount-input",
961
1251
  type: "number",
962
1252
  "as-text-type": "",
@@ -965,40 +1255,40 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
965
1255
  required: e.required,
966
1256
  disabled: e.disabled,
967
1257
  error: e.error
968
- }, P.value ? { "aria-invalid": "true" } : {}), re({
969
- suffix: g(() => [
970
- N("span", null, k(e.unit), 1)
1258
+ }, S.value ? { "aria-invalid": "true" } : {}), me({
1259
+ suffix: v(() => [
1260
+ D("span", null, F(e.unit), 1)
971
1261
  ]),
972
1262
  _: 2
973
1263
  }, [
974
- h.value ? {
1264
+ L.value ? {
975
1265
  name: "label-suffix",
976
- fn: g(() => [
977
- C(u(Z), {
1266
+ fn: v(() => [
1267
+ P(u(J), {
978
1268
  tag: "span",
979
1269
  variant: "body-xs",
980
1270
  color: "subtle",
981
1271
  "no-spacing": ""
982
1272
  }, {
983
- default: g(() => [
984
- V(k(h.value), 1)
1273
+ default: v(() => [
1274
+ V(F(L.value), 1)
985
1275
  ]),
986
1276
  _: 1
987
1277
  })
988
1278
  ]),
989
1279
  key: "0"
990
1280
  } : void 0,
991
- x.value ? {
1281
+ E.value ? {
992
1282
  name: "helper",
993
- fn: g(() => [
994
- C(u(Z), {
1283
+ fn: v(() => [
1284
+ P(u(J), {
995
1285
  tag: "span",
996
1286
  variant: "body-xs",
997
1287
  color: "subtle",
998
1288
  "no-spacing": ""
999
1289
  }, {
1000
- default: g(() => [
1001
- V(k(x.value), 1)
1290
+ default: v(() => [
1291
+ V(F(E.value), 1)
1002
1292
  ]),
1003
1293
  _: 1
1004
1294
  })
@@ -1007,7 +1297,7 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1007
1297
  } : void 0
1008
1298
  ]), 1040, ["modelValue", "name", "label", "required", "disabled", "error"]));
1009
1299
  }
1010
- }), Ko = /* @__PURE__ */ W({
1300
+ }), ln = /* @__PURE__ */ G({
1011
1301
  __name: "Section",
1012
1302
  props: {
1013
1303
  emphasized: { type: Boolean, default: !1 },
@@ -1029,25 +1319,25 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1029
1319
  const { emphasized: i, ...l } = t;
1030
1320
  return l;
1031
1321
  });
1032
- return (i, l) => (_(), E(u(we), ie(a.value, {
1322
+ return (i, l) => (f(), U(u(Me), ae(a.value, {
1033
1323
  class: "sv-section",
1034
1324
  "content-classes": n.value
1035
- }), re({
1036
- default: g(() => [
1037
- ue(i.$slots, "default")
1325
+ }), me({
1326
+ default: v(() => [
1327
+ X(i.$slots, "default")
1038
1328
  ]),
1039
1329
  _: 2
1040
1330
  }, [
1041
1331
  i.$slots.right ? {
1042
1332
  name: "right",
1043
- fn: g(() => [
1044
- ue(i.$slots, "right")
1333
+ fn: v(() => [
1334
+ X(i.$slots, "right")
1045
1335
  ]),
1046
1336
  key: "0"
1047
1337
  } : void 0
1048
1338
  ]), 1040, ["content-classes"]));
1049
1339
  }
1050
- }), Xo = { class: "flex grow flex-col" }, xt = /* @__PURE__ */ W({
1340
+ }), un = { class: "flex grow flex-col" }, Ot = /* @__PURE__ */ G({
1051
1341
  __name: "AutoTopUpConfig",
1052
1342
  props: {
1053
1343
  config: { type: Object },
@@ -1062,174 +1352,174 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1062
1352
  disabled: { type: Boolean }
1063
1353
  },
1064
1354
  setup(e, { expose: t }) {
1065
- const o = e, { $t: n, formatNumber: a } = Q(), i = s(() => {
1066
- var v, U;
1355
+ const o = e, { $t: n, formatNumber: a } = te(), i = s(() => {
1356
+ var g, x;
1067
1357
  return {
1068
1358
  denomination: o.denomination,
1069
1359
  chargeCurrency: o.chargeCurrency,
1070
1360
  creditUnitName: o.creditUnitName,
1071
- minimumTopUp: (U = (v = o.topUpBounds) == null ? void 0 : v.minimum) == null ? void 0 : U.quantity
1361
+ minimumTopUp: (x = (g = o.topUpBounds) == null ? void 0 : g.minimum) == null ? void 0 : x.quantity
1072
1362
  };
1073
- }), l = I(Ee(o.config, i.value)), r = s(() => At(o.denomination, o.creditUnitName)), f = s(
1363
+ }), l = $(xe(o.config, i.value)), r = s(() => Ct(o.denomination, o.creditUnitName)), h = s(
1074
1364
  () => o.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
1075
- ), T = s(
1076
- () => f.value === "CREDITS" ? r.value : o.chargeCurrency
1077
- ), M = s({
1365
+ ), w = s(
1366
+ () => h.value === "CREDITS" ? r.value : o.chargeCurrency
1367
+ ), A = s({
1078
1368
  get: () => {
1079
- var v;
1080
- return ((v = l.value.threshold) == null ? void 0 : v.quantity) ?? "";
1369
+ var g;
1370
+ return ((g = l.value.threshold) == null ? void 0 : g.quantity) ?? "";
1081
1371
  },
1082
- set: (v) => {
1083
- l.value.threshold = { quantity: v || null, currency: r.value };
1372
+ set: (g) => {
1373
+ l.value.threshold = { quantity: g || null, currency: r.value };
1084
1374
  }
1085
- }), S = s({
1375
+ }), C = s({
1086
1376
  get: () => {
1087
- var v;
1088
- return ((v = l.value.topUpAmount) == null ? void 0 : v.quantity) ?? "";
1377
+ var g;
1378
+ return ((g = l.value.topUpAmount) == null ? void 0 : g.quantity) ?? "";
1089
1379
  },
1090
- set: (v) => {
1091
- l.value.topUpAmount = { quantity: v || null, currency: o.chargeCurrency };
1380
+ set: (g) => {
1381
+ l.value.topUpAmount = { quantity: g || null, currency: o.chargeCurrency };
1092
1382
  }
1093
1383
  });
1094
- ee(
1384
+ ue(
1095
1385
  () => [o.config, i.value],
1096
- ([v, U]) => {
1097
- Je(Xe(v, U), P()) || (l.value = Ee(v, U));
1386
+ ([g, x]) => {
1387
+ nt(ot(g, x), S()) || (l.value = xe(g, x));
1098
1388
  }
1099
1389
  );
1100
- const p = s({
1390
+ const c = s({
1101
1391
  get: () => o.alwaysEnabled || l.value.enabled,
1102
- set: (v) => {
1103
- l.value.enabled = v;
1392
+ set: (g) => {
1393
+ l.value.enabled = g;
1104
1394
  }
1105
- }), b = s(
1106
- () => St({ ...l.value, enabled: p.value }, i.value)
1107
- ), P = () => b.value, x = Oe({
1395
+ }), T = s(
1396
+ () => Et({ ...l.value, enabled: c.value }, i.value)
1397
+ ), S = () => T.value, E = Oe({
1108
1398
  threshold: s(() => {
1109
- var v;
1110
- return le((v = l.value.threshold) == null ? void 0 : v.quantity) ?? null;
1399
+ var g;
1400
+ return ve((g = l.value.threshold) == null ? void 0 : g.quantity) ?? null;
1111
1401
  }),
1112
1402
  topUpAmount: s(() => {
1113
- var v;
1114
- return le((v = l.value.topUpAmount) == null ? void 0 : v.quantity) ?? null;
1403
+ var g;
1404
+ return ve((g = l.value.topUpAmount) == null ? void 0 : g.quantity) ?? null;
1115
1405
  })
1116
- }), w = (v) => {
1117
- if (!v)
1406
+ }), y = (g) => {
1407
+ if (!g)
1118
1408
  return "";
1119
- const U = Et(v, f.value, o.conversionRate, a);
1120
- return U === void 0 ? Ne(v) : `${U} ${T.value}`;
1121
- }, $ = ut(() => p.value), h = (v) => (U) => !p.value || v(U), c = De(
1409
+ const x = Bt(g, h.value, o.conversionRate, a);
1410
+ return x === void 0 ? Fe(g) : `${x} ${w.value}`;
1411
+ }, B = ct(() => c.value), L = (g) => (x) => !c.value || g(x), b = Re(
1122
1412
  {
1123
1413
  threshold: {
1124
- required: X.withMessage(
1414
+ required: ne.withMessage(
1125
1415
  () => n({
1126
1416
  defaultMessage: "Enter the balance to top up at.",
1127
1417
  description: "Error shown under the auto top-up threshold when it is left empty",
1128
1418
  id: "auto_topup_config.threshold.required"
1129
1419
  }),
1130
- $
1420
+ B
1131
1421
  ),
1132
- notNegative: X.withMessage(
1422
+ notNegative: ne.withMessage(
1133
1423
  () => n({
1134
1424
  defaultMessage: "The balance to top up at cannot be negative.",
1135
1425
  description: "Error shown under the auto top-up threshold when it is below zero",
1136
1426
  id: "auto_topup_config.threshold.not_negative"
1137
1427
  }),
1138
- h((v) => v === null || v >= 0)
1428
+ L((g) => g === null || g >= 0)
1139
1429
  )
1140
1430
  },
1141
1431
  topUpAmount: {
1142
- required: X.withMessage(
1432
+ required: ne.withMessage(
1143
1433
  () => n({
1144
1434
  defaultMessage: "Enter the amount to top up with.",
1145
1435
  description: "Error shown under the auto top-up amount when it is left empty",
1146
1436
  id: "auto_topup_config.amount.required"
1147
1437
  }),
1148
- $
1438
+ B
1149
1439
  ),
1150
- positive: X.withMessage(
1440
+ positive: ne.withMessage(
1151
1441
  () => n({
1152
1442
  defaultMessage: "Top up with more than zero.",
1153
1443
  description: "Error shown under the auto top-up amount when it is zero or negative",
1154
1444
  id: "auto_topup_config.amount.positive"
1155
1445
  }),
1156
- h((v) => v === null || v > 0)
1446
+ L((g) => g === null || g > 0)
1157
1447
  ),
1158
- atLeastMinimum: X.withMessage(
1448
+ atLeastMinimum: ne.withMessage(
1159
1449
  () => {
1160
- var v;
1450
+ var g;
1161
1451
  return n(
1162
1452
  {
1163
1453
  defaultMessage: "Top up with at least {minimum}.",
1164
1454
  description: "Error shown under the auto top-up amount when it is below what the pricing allows",
1165
1455
  id: "auto_topup_config.amount.at_least_minimum"
1166
1456
  },
1167
- { minimum: w((v = o.topUpBounds) == null ? void 0 : v.minimum) }
1457
+ { minimum: y((g = o.topUpBounds) == null ? void 0 : g.minimum) }
1168
1458
  );
1169
1459
  },
1170
- h((v) => {
1171
- var U;
1172
- return Pt(v, (U = o.topUpBounds) == null ? void 0 : U.minimum);
1460
+ L((g) => {
1461
+ var x;
1462
+ return xt(g, (x = o.topUpBounds) == null ? void 0 : x.minimum);
1173
1463
  })
1174
1464
  ),
1175
- withinMaximum: X.withMessage(
1465
+ withinMaximum: ne.withMessage(
1176
1466
  () => {
1177
- var v;
1467
+ var g;
1178
1468
  return n(
1179
1469
  {
1180
1470
  defaultMessage: "Top up with at most {maximum}.",
1181
1471
  description: "Error shown under the auto top-up amount when it is above what the pricing allows",
1182
1472
  id: "auto_topup_config.amount.within_maximum"
1183
1473
  },
1184
- { maximum: w((v = o.topUpBounds) == null ? void 0 : v.maximum) }
1474
+ { maximum: y((g = o.topUpBounds) == null ? void 0 : g.maximum) }
1185
1475
  );
1186
1476
  },
1187
- h((v) => {
1188
- var U;
1189
- return Ct(v, (U = o.topUpBounds) == null ? void 0 : U.maximum);
1477
+ L((g) => {
1478
+ var x;
1479
+ return $t(g, (x = o.topUpBounds) == null ? void 0 : x.maximum);
1190
1480
  })
1191
1481
  )
1192
1482
  }
1193
1483
  },
1194
- x
1195
- ), A = s(
1196
- () => !Je(
1197
- P(),
1198
- Xe(o.config, i.value)
1484
+ E
1485
+ ), O = s(
1486
+ () => !nt(
1487
+ S(),
1488
+ ot(o.config, i.value)
1199
1489
  )
1200
1490
  );
1201
- function B() {
1202
- return c.value.$touch(), c.value.$invalid ? void 0 : P();
1491
+ function Y() {
1492
+ return b.value.$touch(), b.value.$invalid ? void 0 : S();
1203
1493
  }
1204
1494
  return t({
1205
- validate: B,
1206
- rule: b,
1207
- hasChanges: A,
1208
- isInvalid: s(() => c.value.$invalid)
1209
- }), (v, U) => (_(), E(Ko, {
1495
+ validate: Y,
1496
+ rule: T,
1497
+ hasChanges: O,
1498
+ isInvalid: s(() => b.value.$invalid)
1499
+ }), (g, x) => (f(), U(ln, {
1210
1500
  class: "sv-auto-topup-config",
1211
1501
  "content-background": e.contained ? "gray" : "none",
1212
1502
  "no-spacing": !e.contained,
1213
1503
  "no-border": !e.contained
1214
1504
  }, {
1215
- default: g(() => [
1216
- e.alwaysEnabled ? R("", !0) : (_(), E(u(io), {
1505
+ default: v(() => [
1506
+ e.alwaysEnabled ? q("", !0) : (f(), U(u(lo), {
1217
1507
  key: 0,
1218
- modelValue: p.value,
1219
- "onUpdate:modelValue": U[0] || (U[0] = (G) => p.value = G),
1508
+ modelValue: c.value,
1509
+ "onUpdate:modelValue": x[0] || (x[0] = (Z) => c.value = Z),
1220
1510
  "no-spacing": "",
1221
1511
  "label-position": "before",
1222
1512
  class: "!flex",
1223
1513
  disabled: e.disabled
1224
1514
  }, {
1225
- "inline-label": g(() => [
1226
- N("div", Xo, [
1227
- C(u(Z), {
1515
+ "inline-label": v(() => [
1516
+ D("div", un, [
1517
+ P(u(J), {
1228
1518
  tag: "span",
1229
1519
  variant: "body-sm"
1230
1520
  }, {
1231
- default: g(() => [
1232
- V(k(u(n)({
1521
+ default: v(() => [
1522
+ V(F(u(n)({
1233
1523
  defaultMessage: "Auto top-up",
1234
1524
  description: "Title of the automatic wallet top-up settings",
1235
1525
  id: "auto_topup_config.title"
@@ -1237,13 +1527,13 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1237
1527
  ]),
1238
1528
  _: 1
1239
1529
  }),
1240
- C(u(Z), {
1530
+ P(u(J), {
1241
1531
  tag: "span",
1242
1532
  variant: "body-xs",
1243
1533
  color: "subtle"
1244
1534
  }, {
1245
- default: g(() => [
1246
- V(k(u(n)({
1535
+ default: v(() => [
1536
+ V(F(u(n)({
1247
1537
  defaultMessage: "Automatically top up your balance when it runs low.",
1248
1538
  description: "Subtitle of the automatic wallet top-up settings",
1249
1539
  id: "auto_topup_config.subtitle"
@@ -1255,38 +1545,38 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1255
1545
  ]),
1256
1546
  _: 1
1257
1547
  }, 8, ["modelValue", "disabled"])),
1258
- C(u(dt), { "is-open": p.value }, {
1259
- default: g(() => [
1260
- p.value ? (_(), Y("div", {
1548
+ P(u(mt), { "is-open": c.value }, {
1549
+ default: v(() => [
1550
+ c.value ? (f(), z("div", {
1261
1551
  key: 0,
1262
- class: $e(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
1552
+ class: le(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
1263
1553
  }, [
1264
- C(xe, {
1265
- modelValue: M.value,
1266
- "onUpdate:modelValue": U[1] || (U[1] = (G) => M.value = G),
1554
+ P($e, {
1555
+ modelValue: A.value,
1556
+ "onUpdate:modelValue": x[1] || (x[1] = (Z) => A.value = Z),
1267
1557
  name: "auto-top-up-threshold",
1268
1558
  unit: r.value,
1269
- "model-base": f.value,
1270
- "entry-base": f.value,
1559
+ "model-base": h.value,
1560
+ "entry-base": h.value,
1271
1561
  currency: e.chargeCurrency,
1272
1562
  "conversion-rate": e.conversionRate,
1273
1563
  "show-conversion-hint": e.showThresholdConversion,
1274
1564
  required: "",
1275
1565
  disabled: e.disabled,
1276
- error: u(c).threshold.$errors,
1566
+ error: u(b).threshold.$errors,
1277
1567
  label: u(n)({
1278
1568
  defaultMessage: "When your balance falls below",
1279
1569
  description: "Label of the balance at which an automatic top-up is charged",
1280
1570
  id: "auto_topup_config.threshold.label"
1281
1571
  })
1282
1572
  }, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
1283
- C(xe, {
1284
- modelValue: S.value,
1285
- "onUpdate:modelValue": U[2] || (U[2] = (G) => S.value = G),
1573
+ P($e, {
1574
+ modelValue: C.value,
1575
+ "onUpdate:modelValue": x[2] || (x[2] = (Z) => C.value = Z),
1286
1576
  name: "auto-top-up-amount",
1287
- unit: T.value,
1577
+ unit: w.value,
1288
1578
  "model-base": "AMOUNT",
1289
- "entry-base": f.value,
1579
+ "entry-base": h.value,
1290
1580
  currency: e.chargeCurrency,
1291
1581
  "credit-unit-name": e.creditUnitName,
1292
1582
  "conversion-rate": e.conversionRate,
@@ -1294,14 +1584,14 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1294
1584
  "show-conversion-hint": "",
1295
1585
  required: "",
1296
1586
  disabled: e.disabled,
1297
- error: u(c).topUpAmount.$errors,
1587
+ error: u(b).topUpAmount.$errors,
1298
1588
  label: u(n)({
1299
1589
  defaultMessage: "Top-up with",
1300
1590
  description: "Label of the amount every automatic top-up adds",
1301
1591
  id: "auto_topup_config.amount.label"
1302
1592
  })
1303
1593
  }, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
1304
- ], 2)) : R("", !0)
1594
+ ], 2)) : q("", !0)
1305
1595
  ]),
1306
1596
  _: 1
1307
1597
  }, 8, ["is-open"])
@@ -1310,11 +1600,11 @@ const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
1310
1600
  }, 8, ["content-background", "no-spacing", "no-border"]));
1311
1601
  }
1312
1602
  });
1313
- function Ae() {
1314
- const { $t: e, formatNumber: t } = Q(), o = (a) => Be(e, t, a);
1603
+ function Pe() {
1604
+ const { $t: e, formatNumber: t } = te(), o = (a) => Ie(e, t, a);
1315
1605
  return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
1316
1606
  }
1317
- const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }, en = { class: "grid grid-cols-1 gap-1" }, tn = { class: "sv-top-up-form__option-details" }, on = { key: 0 }, nn = /* @__PURE__ */ W({
1607
+ const rn = { class: "sv-top-up-form" }, dn = { class: "grid grid-cols-1 gap-4" }, cn = { class: "grid grid-cols-1 gap-1" }, pn = { class: "sv-top-up-form__option-details" }, mn = { key: 0 }, vn = /* @__PURE__ */ G({
1318
1608
  __name: "TopUpModalForm",
1319
1609
  props: {
1320
1610
  topUpPricingItems: { type: null },
@@ -1324,112 +1614,112 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1324
1614
  },
1325
1615
  emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
1326
1616
  setup(e, { expose: t, emit: o }) {
1327
- const n = e, a = o, { $t: i } = Q(), { formatValue: l } = Ae(), r = I({
1617
+ const n = e, a = o, { $t: i } = te(), { formatValue: l } = Pe(), r = $({
1328
1618
  pricing_plan_schedule_id: "",
1329
1619
  pricing_items: [],
1330
1620
  start_at: "",
1331
1621
  finalize_immediately: !1,
1332
1622
  payment_method_id: void 0,
1333
1623
  preview: !0
1334
- }), f = s(() => {
1624
+ }), h = s(() => {
1335
1625
  const d = (n.topUpPricingItems ?? []).filter(
1336
- (m) => m.flexiblePricing || m.fixedPricing
1626
+ (p) => p.flexiblePricing || p.fixedPricing
1337
1627
  );
1338
1628
  return [
1339
- ...d.filter(({ flexiblePricing: m }) => m),
1340
- ...d.filter(({ flexiblePricing: m }) => !m)
1629
+ ...d.filter(({ flexiblePricing: p }) => p),
1630
+ ...d.filter(({ flexiblePricing: p }) => !p)
1341
1631
  ];
1342
- }), T = (d) => f.value.find((m) => m.pricingItemId === d), M = (d) => {
1343
- const { config: m, currency: y } = d.flexiblePricing ?? {}, D = m == null ? void 0 : m.minimum_amount;
1344
- return D && y ? { quantity: D.quantity, currency: y } : void 0;
1345
- }, S = s({
1632
+ }), w = (d) => h.value.find((p) => p.pricingItemId === d), A = (d) => {
1633
+ const { config: p, currency: _ } = d.flexiblePricing ?? {}, R = p == null ? void 0 : p.minimum_amount;
1634
+ return R && _ ? { quantity: R.quantity, currency: _ } : void 0;
1635
+ }, C = s({
1346
1636
  get: () => {
1347
1637
  var d;
1348
1638
  return (d = r.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
1349
1639
  },
1350
1640
  set: (d) => {
1351
- const m = T(typeof d == "string" ? d : void 0);
1352
- if (!m) {
1641
+ const p = w(typeof d == "string" ? d : void 0);
1642
+ if (!p) {
1353
1643
  r.value.pricing_items = [];
1354
1644
  return;
1355
1645
  }
1356
- const y = M(m);
1646
+ const _ = A(p);
1357
1647
  r.value.pricing_items = [
1358
1648
  {
1359
- pricing_item_id: m.pricingItemId,
1360
- ...y && { flexible_amount: y }
1649
+ pricing_item_id: p.pricingItemId,
1650
+ ..._ && { flexible_amount: _ }
1361
1651
  }
1362
1652
  ];
1363
1653
  }
1364
1654
  });
1365
- ee(
1366
- f,
1655
+ ue(
1656
+ h,
1367
1657
  (d) => {
1368
1658
  if (d.some(
1369
- ({ pricingItemId: D }) => {
1370
- var L;
1371
- return D === ((L = r.value.pricing_items[0]) == null ? void 0 : L.pricing_item_id);
1659
+ ({ pricingItemId: R }) => {
1660
+ var j;
1661
+ return R === ((j = r.value.pricing_items[0]) == null ? void 0 : j.pricing_item_id);
1372
1662
  }
1373
1663
  ))
1374
1664
  return;
1375
- const y = d.find(({ flexiblePricing: D }) => D) ?? d[0];
1376
- S.value = y == null ? void 0 : y.pricingItemId;
1665
+ const _ = d.find(({ flexiblePricing: R }) => R) ?? d[0];
1666
+ C.value = _ == null ? void 0 : _.pricingItemId;
1377
1667
  },
1378
1668
  { immediate: !0 }
1379
1669
  );
1380
- const p = s(
1670
+ const c = s(
1381
1671
  () => {
1382
- var d, m;
1383
- return (m = T((d = r.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id)) == null ? void 0 : m.pricingPlanScheduleId;
1672
+ var d, p;
1673
+ return (p = w((d = r.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id)) == null ? void 0 : p.pricingPlanScheduleId;
1384
1674
  }
1385
1675
  );
1386
- ee(
1387
- p,
1676
+ ue(
1677
+ c,
1388
1678
  (d) => {
1389
1679
  r.value.pricing_plan_schedule_id = d ?? "";
1390
1680
  },
1391
1681
  { immediate: !0 }
1392
1682
  );
1393
- const b = s({
1683
+ const T = s({
1394
1684
  get: () => {
1395
1685
  var d;
1396
1686
  return (d = r.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
1397
1687
  },
1398
1688
  set: (d) => {
1399
- var y;
1400
- const m = (y = r.value.pricing_items[0]) == null ? void 0 : y.pricing_item_id;
1401
- m && (r.value.pricing_items = [
1402
- { pricing_item_id: m, ...d && { flexible_amount: d } }
1689
+ var _;
1690
+ const p = (_ = r.value.pricing_items[0]) == null ? void 0 : _.pricing_item_id;
1691
+ p && (r.value.pricing_items = [
1692
+ { pricing_item_id: p, ...d && { flexible_amount: d } }
1403
1693
  ]);
1404
1694
  }
1405
- }), P = (d) => {
1406
- var y;
1407
- const m = (y = T(String(d))) == null ? void 0 : y.fixedPricing;
1408
- return m != null && m.value.credits ? Ne(m.amount) : void 0;
1409
- }, x = s(
1695
+ }), S = (d) => {
1696
+ var _;
1697
+ const p = (_ = w(String(d))) == null ? void 0 : _.fixedPricing;
1698
+ return p != null && p.value.credits ? Fe(p.amount) : void 0;
1699
+ }, E = s(
1410
1700
  () => {
1411
1701
  var d;
1412
- return (d = T(String(S.value))) == null ? void 0 : d.flexiblePricing;
1702
+ return (d = w(String(C.value))) == null ? void 0 : d.flexiblePricing;
1413
1703
  }
1414
- ), w = s({
1704
+ ), y = s({
1415
1705
  get: () => {
1416
1706
  var d;
1417
- return ((d = b.value) == null ? void 0 : d.quantity) ?? "";
1707
+ return ((d = T.value) == null ? void 0 : d.quantity) ?? "";
1418
1708
  },
1419
1709
  set: (d) => {
1420
- var y;
1421
- const m = (y = x.value) == null ? void 0 : y.currency;
1422
- b.value = d && m ? { quantity: d, currency: m } : void 0;
1710
+ var _;
1711
+ const p = (_ = E.value) == null ? void 0 : _.currency;
1712
+ T.value = d && p ? { quantity: d, currency: p } : void 0;
1423
1713
  }
1424
- }), $ = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", h = s(() => Tt(n.topUpPricingItems)), c = (d) => d.creditsConfiguration ? h.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, A = ({ config: d }) => ({
1714
+ }), B = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", L = s(() => Ut(n.topUpPricingItems)), b = (d) => d.creditsConfiguration ? L.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, O = ({ config: d }) => ({
1425
1715
  ...(d == null ? void 0 : d.minimum_amount) && { minimum: d.minimum_amount },
1426
1716
  ...(d == null ? void 0 : d.maximum_amount) && { maximum: d.maximum_amount }
1427
- }), B = (d) => {
1428
- var y;
1429
- const m = (y = T(String(d))) == null ? void 0 : y.flexiblePricing;
1430
- return m ? [m] : [];
1431
- }, v = s(
1432
- () => f.value.map((d) => ({
1717
+ }), Y = (d) => {
1718
+ var _;
1719
+ const p = (_ = w(String(d))) == null ? void 0 : _.flexiblePricing;
1720
+ return p ? [p] : [];
1721
+ }, g = s(
1722
+ () => h.value.map((d) => ({
1433
1723
  value: d.pricingItemId,
1434
1724
  label: d.fixedPricing ? l(d.fixedPricing.value) : i({
1435
1725
  defaultMessage: "Choose your own amount",
@@ -1437,38 +1727,38 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1437
1727
  id: "topup_modal.flexible_option.label"
1438
1728
  })
1439
1729
  }))
1440
- ), U = s(() => {
1730
+ ), x = s(() => {
1441
1731
  const d = r.value.pricing_items.filter(
1442
- (m) => {
1443
- var y;
1444
- return !((y = T(m.pricing_item_id)) != null && y.flexiblePricing) || !!m.flexible_amount;
1732
+ (p) => {
1733
+ var _;
1734
+ return !((_ = w(p.pricing_item_id)) != null && _.flexiblePricing) || !!p.flexible_amount;
1445
1735
  }
1446
1736
  );
1447
1737
  return d.length > 0 ? d : void 0;
1448
- }), G = s(() => !n.autoTopUpConfig && f.value.some(({ flexiblePricing: m }) => m) ? Mt(n.topUpPricingItems) : void 0), te = I(), { chargeOnDemandPricingItems: ve } = pt(), fe = Ue(), H = I(!1), de = s(
1449
- () => !!r.value.pricing_plan_schedule_id && !!U.value && !!r.value.payment_method_id
1450
- ), he = Oe({
1738
+ }), Z = s(() => !n.autoTopUpConfig && h.value.some(({ flexiblePricing: p }) => p) ? Pt(n.topUpPricingItems) : void 0), m = $(), { chargeOnDemandPricingItems: M } = ft(), I = Ue(), N = $(!1), ie = s(
1739
+ () => !!r.value.pricing_plan_schedule_id && !!x.value && !!r.value.payment_method_id
1740
+ ), fe = Oe({
1451
1741
  paymentMethodId: s(() => r.value.payment_method_id ?? null),
1452
1742
  flexibleAmount: s(() => {
1453
1743
  var d;
1454
- return le((d = b.value) == null ? void 0 : d.quantity) ?? null;
1744
+ return ve((d = T.value) == null ? void 0 : d.quantity) ?? null;
1455
1745
  })
1456
- }), ce = (d) => {
1457
- var y;
1458
- const m = (y = x.value) == null ? void 0 : y.bounds[d];
1459
- return m ? l(m) : "";
1460
- }, z = De(
1746
+ }), de = (d) => {
1747
+ var _;
1748
+ const p = (_ = E.value) == null ? void 0 : _.bounds[d];
1749
+ return p ? l(p) : "";
1750
+ }, Q = Re(
1461
1751
  {
1462
1752
  flexibleAmount: {
1463
- required: X.withMessage(
1753
+ required: ne.withMessage(
1464
1754
  () => i({
1465
1755
  defaultMessage: "Enter the amount to top up with.",
1466
1756
  description: "Error shown under the choose-your-amount input in the top-up modal when it is left empty",
1467
1757
  id: "topup_modal.amount.required"
1468
1758
  }),
1469
- ut(() => !!x.value)
1759
+ ct(() => !!E.value)
1470
1760
  ),
1471
- positive: X.withMessage(
1761
+ positive: ne.withMessage(
1472
1762
  () => i({
1473
1763
  defaultMessage: "Top up with more than zero.",
1474
1764
  description: "Error shown under the choose-your-amount input in the top-up modal when it is zero or negative",
@@ -1476,99 +1766,99 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1476
1766
  }),
1477
1767
  (d) => d === null || d > 0
1478
1768
  ),
1479
- atLeastMinimum: X.withMessage(
1769
+ atLeastMinimum: ne.withMessage(
1480
1770
  () => i(
1481
1771
  {
1482
1772
  defaultMessage: "Top up with at least {minimum}.",
1483
1773
  description: "Error shown under the choose-your-amount input in the top-up modal when it is below what the pricing allows",
1484
1774
  id: "topup_modal.amount.at_least_minimum"
1485
1775
  },
1486
- { minimum: ce("minimum") }
1776
+ { minimum: de("minimum") }
1487
1777
  ),
1488
1778
  (d) => {
1489
- var m, y;
1490
- return Pt(d, (y = (m = x.value) == null ? void 0 : m.config) == null ? void 0 : y.minimum_amount);
1779
+ var p, _;
1780
+ return xt(d, (_ = (p = E.value) == null ? void 0 : p.config) == null ? void 0 : _.minimum_amount);
1491
1781
  }
1492
1782
  ),
1493
- withinMaximum: X.withMessage(
1783
+ withinMaximum: ne.withMessage(
1494
1784
  () => i(
1495
1785
  {
1496
1786
  defaultMessage: "Top up with at most {maximum}.",
1497
1787
  description: "Error shown under the choose-your-amount input in the top-up modal when it is above what the pricing allows",
1498
1788
  id: "topup_modal.amount.within_maximum"
1499
1789
  },
1500
- { maximum: ce("maximum") }
1790
+ { maximum: de("maximum") }
1501
1791
  ),
1502
1792
  (d) => {
1503
- var m, y;
1504
- return Ct(d, (y = (m = x.value) == null ? void 0 : m.config) == null ? void 0 : y.maximum_amount);
1793
+ var p, _;
1794
+ return $t(d, (_ = (p = E.value) == null ? void 0 : p.config) == null ? void 0 : _.maximum_amount);
1505
1795
  }
1506
1796
  )
1507
1797
  },
1508
1798
  paymentMethodId: {
1509
- required: X.withMessage(
1799
+ required: ne.withMessage(
1510
1800
  () => i({
1511
1801
  defaultMessage: "Select a payment method to pay for this top-up.",
1512
1802
  description: "Error shown under the payment methods in the top-up modal when none is selected on submit",
1513
1803
  id: "topup_modal.payment_method_required"
1514
1804
  }),
1515
- rt
1805
+ pt
1516
1806
  )
1517
1807
  }
1518
1808
  },
1519
- he
1520
- ), ne = s(() => {
1521
- const [d] = r.value.pricing_items, m = T(d == null ? void 0 : d.pricing_item_id);
1522
- return m ? Wo(m, d == null ? void 0 : d.flexible_amount) : void 0;
1809
+ fe
1810
+ ), K = s(() => {
1811
+ const [d] = r.value.pricing_items, p = w(d == null ? void 0 : d.pricing_item_id);
1812
+ return p ? en(p, d == null ? void 0 : d.flexible_amount) : void 0;
1523
1813
  });
1524
- async function pe() {
1525
- var m, y, D;
1526
- z.value.$touch();
1527
- const d = (m = te.value) == null ? void 0 : m.validate();
1528
- if (!(z.value.$invalid || (y = te.value) != null && y.isInvalid || !de.value || H.value)) {
1529
- H.value = !0;
1814
+ async function ge() {
1815
+ var p, _, R;
1816
+ Q.value.$touch();
1817
+ const d = (p = m.value) == null ? void 0 : p.validate();
1818
+ if (!(Q.value.$invalid || (_ = m.value) != null && _.isInvalid || !ie.value || N.value)) {
1819
+ N.value = !0;
1530
1820
  try {
1531
- const L = await ve({
1821
+ const j = await M({
1532
1822
  pricing_plan_schedule_id: r.value.pricing_plan_schedule_id,
1533
- pricing_items: U.value ?? [],
1823
+ pricing_items: x.value ?? [],
1534
1824
  payment_method_id: r.value.payment_method_id,
1535
1825
  preview: !1
1536
1826
  });
1537
- (d == null ? void 0 : d.status) === "ACTIVE" && ((D = te.value) != null && D.hasChanges) && r.value.payment_method_id && a("save-auto-top-up", {
1827
+ (d == null ? void 0 : d.status) === "ACTIVE" && ((R = m.value) != null && R.hasChanges) && r.value.payment_method_id && a("save-auto-top-up", {
1538
1828
  rule: d,
1539
1829
  paymentMethodId: r.value.payment_method_id,
1540
1830
  pricingPlanScheduleId: r.value.pricing_plan_schedule_id
1541
- }), a("success", L);
1542
- } catch (L) {
1543
- fe.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, L), a("failure", L);
1831
+ }), a("success", j);
1832
+ } catch (j) {
1833
+ I.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, j), a("failure", j);
1544
1834
  } finally {
1545
- H.value = !1;
1835
+ N.value = !1;
1546
1836
  }
1547
1837
  }
1548
1838
  }
1549
- t({ submit: pe, isCharging: H, canSubmit: de, chargedValue: ne });
1550
- const oe = s({
1839
+ t({ submit: ge, isCharging: N, canSubmit: ie, chargedValue: K });
1840
+ const re = s({
1551
1841
  get: () => r.value.payment_method_id ?? void 0,
1552
1842
  set: (d) => {
1553
1843
  r.value.payment_method_id = d;
1554
1844
  }
1555
- }), { sortedPaymentMethods: ge } = vt({
1845
+ }), { sortedPaymentMethods: _e } = gt({
1556
1846
  paymentMethods: s(() => n.paymentMethods),
1557
- selectedPaymentMethodId: oe
1847
+ selectedPaymentMethodId: re
1558
1848
  });
1559
- return (d, m) => (_(), Y("form", Jo, [
1560
- N("div", Zo, [
1561
- N("div", en, [
1562
- v.value.length > 0 ? (_(), E(u(lt), {
1849
+ return (d, p) => (f(), z("form", rn, [
1850
+ D("div", dn, [
1851
+ D("div", cn, [
1852
+ g.value.length > 0 ? (f(), U(u(dt), {
1563
1853
  key: 0,
1564
- modelValue: S.value,
1565
- "onUpdate:modelValue": m[3] || (m[3] = (y) => S.value = y),
1854
+ modelValue: C.value,
1855
+ "onUpdate:modelValue": p[3] || (p[3] = (_) => C.value = _),
1566
1856
  class: "sv-top-up-form__options",
1567
1857
  name: "top-up-pricing-item",
1568
1858
  direction: "column",
1569
1859
  required: "",
1570
- disabled: H.value,
1571
- options: v.value,
1860
+ disabled: N.value,
1861
+ options: g.value,
1572
1862
  "show-radio": !1,
1573
1863
  label: u(i)({
1574
1864
  defaultMessage: "Top up amount",
@@ -1576,9 +1866,9 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1576
1866
  id: "topup_modal.pricing_items.label"
1577
1867
  })
1578
1868
  }, {
1579
- label: g(({ option: y, optionValue: D }) => [
1580
- N("span", null, k(y.label), 1),
1581
- P(D) ? (_(), E(u(Z), {
1869
+ label: v(({ option: _, optionValue: R }) => [
1870
+ D("span", null, F(_.label), 1),
1871
+ S(R) ? (f(), U(u(J), {
1582
1872
  key: 0,
1583
1873
  tag: "span",
1584
1874
  variant: "body-sm",
@@ -1587,121 +1877,121 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1587
1877
  "no-spacing": "",
1588
1878
  class: "sv-top-up-form__option-cost"
1589
1879
  }, {
1590
- default: g(() => [
1591
- V(k(P(D)), 1)
1880
+ default: v(() => [
1881
+ V(F(S(R)), 1)
1592
1882
  ]),
1593
1883
  _: 2
1594
- }, 1024)) : R("", !0)
1884
+ }, 1024)) : q("", !0)
1595
1885
  ]),
1596
- description: g(({ optionValue: y }) => [
1597
- N("div", tn, [
1598
- B(y).length > 0 ? (_(), E(u(dt), {
1886
+ description: v(({ optionValue: _ }) => [
1887
+ D("div", pn, [
1888
+ Y(_).length > 0 ? (f(), U(u(mt), {
1599
1889
  key: 0,
1600
- "is-open": String(y) === S.value,
1890
+ "is-open": String(_) === C.value,
1601
1891
  lazy: ""
1602
1892
  }, {
1603
- default: g(() => [
1604
- (_(!0), Y(Te, null, Me(B(y), (D) => {
1605
- var L;
1606
- return _(), Y("div", {
1607
- key: D.currency,
1893
+ default: v(() => [
1894
+ (f(!0), z(he, null, Ae(Y(_), (R) => {
1895
+ var j;
1896
+ return f(), z("div", {
1897
+ key: R.currency,
1608
1898
  class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
1609
- onClick: m[1] || (m[1] = ze(() => {
1899
+ onClick: p[1] || (p[1] = Ke(() => {
1610
1900
  }, ["stop"])),
1611
- onKeydown: m[2] || (m[2] = ze(() => {
1901
+ onKeydown: p[2] || (p[2] = Ke(() => {
1612
1902
  }, ["stop"]))
1613
1903
  }, [
1614
- C(xe, {
1615
- modelValue: w.value,
1616
- "onUpdate:modelValue": m[0] || (m[0] = (ae) => w.value = ae),
1904
+ P($e, {
1905
+ modelValue: y.value,
1906
+ "onUpdate:modelValue": p[0] || (p[0] = (ce) => y.value = ce),
1617
1907
  name: "top-up-amount",
1618
1908
  label: u(i)({
1619
1909
  defaultMessage: "Amount",
1620
1910
  description: "Label of the amount input of the choose-your-amount top-up",
1621
1911
  id: "topup_modal.amount.label"
1622
1912
  }),
1623
- bounds: A(D),
1913
+ bounds: O(R),
1624
1914
  "model-base": "AMOUNT",
1625
- unit: c(D),
1626
- "entry-base": $(D),
1627
- currency: D.currency,
1628
- "conversion-rate": (L = D.creditsConfiguration) == null ? void 0 : L.conversionRate,
1915
+ unit: b(R),
1916
+ "entry-base": B(R),
1917
+ currency: R.currency,
1918
+ "conversion-rate": (j = R.creditsConfiguration) == null ? void 0 : j.conversionRate,
1629
1919
  required: "",
1630
- disabled: H.value,
1631
- error: u(z).flexibleAmount.$errors
1920
+ disabled: N.value,
1921
+ error: u(Q).flexibleAmount.$errors
1632
1922
  }, null, 8, ["modelValue", "label", "bounds", "unit", "entry-base", "currency", "conversion-rate", "disabled", "error"])
1633
1923
  ], 32);
1634
1924
  }), 128))
1635
1925
  ]),
1636
1926
  _: 2
1637
- }, 1032, ["is-open"])) : R("", !0)
1927
+ }, 1032, ["is-open"])) : q("", !0)
1638
1928
  ])
1639
1929
  ]),
1640
1930
  _: 1
1641
- }, 8, ["modelValue", "disabled", "options", "label"])) : R("", !0)
1931
+ }, 8, ["modelValue", "disabled", "options", "label"])) : q("", !0)
1642
1932
  ]),
1643
- N("div", null, [
1644
- C(Ut, {
1645
- "pricing-plan-schedule-id": p.value,
1646
- "pricing-items": U.value
1933
+ D("div", null, [
1934
+ P(St, {
1935
+ "pricing-plan-schedule-id": c.value,
1936
+ "pricing-items": x.value
1647
1937
  }, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
1648
1938
  ]),
1649
- G.value ? (_(), Y("div", on, [
1650
- C(xt, ie({
1939
+ Z.value ? (f(), z("div", mn, [
1940
+ P(Ot, ae({
1651
1941
  ref_key: "autoTopUpFormRef",
1652
- ref: te,
1942
+ ref: m,
1653
1943
  class: "sv-top-up-form__auto-top-up"
1654
- }, G.value, {
1944
+ }, Z.value, {
1655
1945
  contained: "",
1656
1946
  "show-threshold-conversion": !1,
1657
- disabled: H.value
1947
+ disabled: N.value
1658
1948
  }), null, 16, ["disabled"])
1659
- ])) : R("", !0),
1660
- N("div", null, [
1661
- C(u(oo), { spacing: "xs" })
1949
+ ])) : q("", !0),
1950
+ D("div", null, [
1951
+ P(u(ao), { spacing: "xs" })
1662
1952
  ]),
1663
- N("div", null, [
1664
- C(mt, {
1665
- modelValue: oe.value,
1666
- "onUpdate:modelValue": m[4] || (m[4] = (y) => oe.value = y),
1953
+ D("div", null, [
1954
+ P(ht, {
1955
+ modelValue: re.value,
1956
+ "onUpdate:modelValue": p[4] || (p[4] = (_) => re.value = _),
1667
1957
  class: "sv-top-up-form__payment-methods",
1668
- "payment-methods": u(ge),
1958
+ "payment-methods": u(_e),
1669
1959
  required: "",
1670
- error: u(z).paymentMethodId.$errors,
1960
+ error: u(Q).paymentMethodId.$errors,
1671
1961
  "payment-method-options": e.paymentMethodOptions,
1672
- disabled: H.value,
1962
+ disabled: N.value,
1673
1963
  label: u(i)({
1674
1964
  defaultMessage: "Payment method",
1675
1965
  description: "Label above the payment method that pays for the top-up, in the top-up modal",
1676
1966
  id: "topup_modal.payment_method_selector.label"
1677
1967
  }),
1678
- onAddPaymentMethod: m[5] || (m[5] = (y) => a("add-payment-method"))
1968
+ onAddPaymentMethod: p[5] || (p[5] = (_) => a("add-payment-method"))
1679
1969
  }, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
1680
1970
  ])
1681
1971
  ])
1682
1972
  ]));
1683
1973
  }
1684
- }), an = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, sn = /* @__PURE__ */ W({
1974
+ }), fn = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, hn = /* @__PURE__ */ G({
1685
1975
  __name: "TopUpModalSuccess",
1686
1976
  props: {
1687
1977
  invoice: { type: Object }
1688
1978
  },
1689
1979
  setup(e) {
1690
- const { $t: t } = Q();
1691
- return (o, n) => (_(), Y("div", an, [
1692
- e.invoice ? (_(), E(u(we), {
1980
+ const { $t: t } = te();
1981
+ return (o, n) => (f(), z("div", fn, [
1982
+ e.invoice ? (f(), U(u(Me), {
1693
1983
  key: 0,
1694
1984
  "content-background": "none"
1695
1985
  }, {
1696
- default: g(() => [
1697
- C(u(Z), {
1986
+ default: v(() => [
1987
+ P(u(J), {
1698
1988
  tag: "span",
1699
1989
  variant: "body-sm",
1700
1990
  weight: "semibold",
1701
1991
  class: "mb-2 block"
1702
1992
  }, {
1703
- default: g(() => [
1704
- V(k(u(t)({
1993
+ default: v(() => [
1994
+ V(F(u(t)({
1705
1995
  defaultMessage: "Receipt",
1706
1996
  description: "Heading above the invoice a completed top-up produced",
1707
1997
  id: "topup_modal.success.receipt.heading"
@@ -1709,22 +1999,22 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
1709
1999
  ]),
1710
2000
  _: 1
1711
2001
  }),
1712
- C(u(ct), {
2002
+ P(u(vt), {
1713
2003
  invoice: e.invoice,
1714
2004
  "is-customer-facing": ""
1715
2005
  }, null, 8, ["invoice"])
1716
2006
  ]),
1717
2007
  _: 1
1718
- })) : R("", !0)
2008
+ })) : q("", !0)
1719
2009
  ]));
1720
2010
  }
1721
2011
  });
1722
- function ln({
2012
+ function gn({
1723
2013
  step: e,
1724
2014
  currentBalance: t,
1725
2015
  topUpValue: o
1726
2016
  }) {
1727
- const { $t: n, formatNumber: a } = Q(), i = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
2017
+ const { $t: n, formatNumber: a } = te(), i = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1728
2018
  defaultMessage: "Add payment method",
1729
2019
  description: "Title of the top-up modal while the customer is adding a payment method",
1730
2020
  id: "topup_modal.add_payment_method.title"
@@ -1761,7 +2051,7 @@ function ln({
1761
2051
  description: "Label of the button that closes the top-up modal",
1762
2052
  id: "topup_modal.cancel_button.label"
1763
2053
  })
1764
- ), f = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
2054
+ ), h = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
1765
2055
  defaultMessage: "Save payment method",
1766
2056
  description: "Label of the confirm button in the top-up modal while adding a payment method",
1767
2057
  id: "topup_modal.save_payment_method.label"
@@ -1775,85 +2065,85 @@ function ln({
1775
2065
  description: "Label of the confirm button in the top-up modal once an amount is entered",
1776
2066
  id: "topup_modal.confirm_button.label"
1777
2067
  },
1778
- { value: Be(n, a, o.value) }
2068
+ { value: Ie(n, a, o.value) }
1779
2069
  ) : n({
1780
2070
  defaultMessage: "Top up balance",
1781
2071
  description: "Label of the confirm button in the top-up modal while no amount is entered",
1782
2072
  id: "topup_modal.confirm_button.empty.label"
1783
2073
  }));
1784
- return { title: i, subTitle: l, cancelButtonText: r, confirmButtonText: f };
2074
+ return { title: i, subTitle: l, cancelButtonText: r, confirmButtonText: h };
1785
2075
  }
1786
- function un(e) {
1787
- const t = I(0), o = (a) => {
2076
+ function yn(e) {
2077
+ const t = $(0), o = (a) => {
1788
2078
  t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
1789
2079
  }, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
1790
2080
  var l;
1791
2081
  const i = (l = a[0]) == null ? void 0 : l.target;
1792
2082
  o(i instanceof HTMLElement ? i : void 0);
1793
2083
  });
1794
- return ee(
2084
+ return ue(
1795
2085
  e,
1796
2086
  (a, i) => {
1797
2087
  i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
1798
2088
  },
1799
2089
  // `post` so the callback runs after the render that assigns the template ref, not before.
1800
2090
  { immediate: !0, flush: "post" }
1801
- ), Ie(() => {
2091
+ ), Be(() => {
1802
2092
  n == null || n.disconnect();
1803
2093
  }), t;
1804
2094
  }
1805
- const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
2095
+ const _n = ["inert"], bn = 300, wn = "1rem", Tn = /* @__PURE__ */ G({
1806
2096
  __name: "SlidingPanes",
1807
2097
  props: {
1808
2098
  panes: { type: Array },
1809
2099
  current: { type: String }
1810
2100
  },
1811
2101
  setup(e) {
1812
- const t = e, o = I(!1);
2102
+ const t = e, o = $(!1);
1813
2103
  let n;
1814
- ee(
2104
+ ue(
1815
2105
  () => t.current,
1816
2106
  () => {
1817
2107
  o.value = !0, clearTimeout(n), n = setTimeout(() => {
1818
2108
  o.value = !1;
1819
- }, dn);
2109
+ }, bn);
1820
2110
  }
1821
- ), Ie(() => {
2111
+ ), Be(() => {
1822
2112
  clearTimeout(n);
1823
2113
  });
1824
- const a = I({}), i = {}, l = (M) => i[M] ?? (i[M] = (S) => {
1825
- a.value[M] = S instanceof HTMLElement ? S : void 0;
1826
- }), r = s(() => a.value[t.current]), f = un(r), T = s(() => {
1827
- const M = t.panes.indexOf(t.current);
1828
- return M > 0 ? `translateX(calc(${-M} * (100% + ${cn})))` : "translateX(0px)";
2114
+ const a = $({}), i = {}, l = (A) => i[A] ?? (i[A] = (C) => {
2115
+ a.value[A] = C instanceof HTMLElement ? C : void 0;
2116
+ }), r = s(() => a.value[t.current]), h = yn(r), w = s(() => {
2117
+ const A = t.panes.indexOf(t.current);
2118
+ return A > 0 ? `translateX(calc(${-A} * (100% + ${wn})))` : "translateX(0px)";
1829
2119
  });
1830
- return (M, S) => (_(), Y("div", {
1831
- class: $e([
2120
+ return (A, C) => (f(), z("div", {
2121
+ class: le([
1832
2122
  "sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
1833
2123
  o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
1834
2124
  ]),
1835
- style: je(u(f) ? { height: `${u(f)}px` } : void 0)
2125
+ style: Xe(u(h) ? { height: `${u(h)}px` } : void 0)
1836
2126
  }, [
1837
- N("div", {
2127
+ D("div", {
1838
2128
  class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
1839
- style: je({ transform: T.value })
2129
+ style: Xe({ transform: w.value })
1840
2130
  }, [
1841
- (_(!0), Y(Te, null, Me(e.panes, (p) => (_(), Y("div", {
1842
- key: p,
2131
+ (f(!0), z(he, null, Ae(e.panes, (c) => (f(), z("div", {
2132
+ key: c,
1843
2133
  class: "sv-sliding-panes__pane w-full shrink-0",
1844
- inert: p !== e.current || void 0
2134
+ inert: c !== e.current || void 0
1845
2135
  }, [
1846
- N("div", {
2136
+ D("div", {
1847
2137
  ref_for: !0,
1848
- ref: l(p)
2138
+ ref: l(c)
1849
2139
  }, [
1850
- ue(M.$slots, p)
2140
+ X(A.$slots, c)
1851
2141
  ], 512)
1852
- ], 8, rn))), 128))
2142
+ ], 8, _n))), 128))
1853
2143
  ], 4)
1854
2144
  ], 6));
1855
2145
  }
1856
- }), It = /* @__PURE__ */ W({
2146
+ }), It = /* @__PURE__ */ G({
1857
2147
  inheritAttrs: !1,
1858
2148
  __name: "OnDemandPaymentModalShell",
1859
2149
  props: {
@@ -1873,7 +2163,7 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1873
2163
  },
1874
2164
  emits: ["confirm", "cancel", "payment-success", "payment-failed"],
1875
2165
  setup(e, { expose: t }) {
1876
- const o = e, n = I(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
2166
+ const o = e, n = $(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
1877
2167
  return t({
1878
2168
  submit: () => {
1879
2169
  var i;
@@ -1883,7 +2173,7 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1883
2173
  var i;
1884
2174
  return !!((i = n.value) != null && i.isSaving);
1885
2175
  })
1886
- }), (i, l) => (_(), E(u(ht), {
2176
+ }), (i, l) => (f(), U(u(_t), {
1887
2177
  "no-click-away": "",
1888
2178
  "full-screen-on-mobile": "",
1889
2179
  "show-modal": e.showModal,
@@ -1895,17 +2185,17 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1895
2185
  "is-loading": e.isPending,
1896
2186
  onConfirm: l[2] || (l[2] = (r) => i.$emit("confirm")),
1897
2187
  onClose: l[3] || (l[3] = (r) => i.$emit("cancel"))
1898
- }, re({
1899
- body: g(() => [
1900
- N("div", ie({
2188
+ }, me({
2189
+ body: v(() => [
2190
+ D("div", ae({
1901
2191
  class: ["grid grid-cols-1 gap-4", { "pb-4": !e.noBottomSpacing }]
1902
2192
  }, i.$attrs), [
1903
- C(pn, {
2193
+ P(Tn, {
1904
2194
  panes: e.panes,
1905
2195
  current: e.step
1906
- }, re({
1907
- [e.addPaymentMethodPane]: g(() => [
1908
- C(ro, {
2196
+ }, me({
2197
+ [e.addPaymentMethodPane]: v(() => [
2198
+ P(po, {
1909
2199
  ref_key: "paneRef",
1910
2200
  ref: n,
1911
2201
  customer: e.customer,
@@ -1918,10 +2208,10 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1918
2208
  ]),
1919
2209
  _: 2
1920
2210
  }, [
1921
- Me(a.value, (r) => ({
2211
+ Ae(a.value, (r) => ({
1922
2212
  name: r,
1923
- fn: g(() => [
1924
- ue(i.$slots, r)
2213
+ fn: v(() => [
2214
+ X(i.$slots, r)
1925
2215
  ])
1926
2216
  }))
1927
2217
  ]), 1032, ["panes", "current"])
@@ -1931,23 +2221,23 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1931
2221
  }, [
1932
2222
  i.$slots.footer ? {
1933
2223
  name: "footer",
1934
- fn: g(() => [
1935
- ue(i.$slots, "footer")
2224
+ fn: v(() => [
2225
+ X(i.$slots, "footer")
1936
2226
  ]),
1937
2227
  key: "0"
1938
2228
  } : void 0
1939
2229
  ]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-loading"]));
1940
2230
  }
1941
- }), $t = (e) => {
2231
+ }), kt = (e) => {
1942
2232
  var t;
1943
2233
  return (((t = e == null ? void 0 : e.wallet) == null ? void 0 : t.auto_top_up_configs) ?? []).find(
1944
2234
  ({ status: o }) => o === "ACTIVE"
1945
2235
  );
1946
- }, Ot = (e) => e ? {
2236
+ }, Dt = (e) => e ? {
1947
2237
  status: e.status,
1948
2238
  threshold: e.threshold,
1949
2239
  ...e.topup_amount && { topup_amount: e.topup_amount }
1950
- } : void 0, Bt = (e, t = []) => {
2240
+ } : void 0, Nt = (e, t = []) => {
1951
2241
  if (e != null && e.pricing_item_id && e.pricing_plan_schedule_id)
1952
2242
  return {
1953
2243
  pricingItemId: e.pricing_item_id,
@@ -1960,7 +2250,7 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1960
2250
  pricingItemId: o.pricingItemId,
1961
2251
  pricingPlanScheduleId: o.pricingPlanScheduleId
1962
2252
  } : void 0;
1963
- }, Dt = ({
2253
+ }, Rt = ({
1964
2254
  rule: e,
1965
2255
  walletBalanceItem: t,
1966
2256
  chargeTarget: o,
@@ -1979,12 +2269,12 @@ const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
1979
2269
  ...e.topup_amount && { topup_amount: e.topup_amount }
1980
2270
  };
1981
2271
  };
1982
- function Nt({
2272
+ function Ft({
1983
2273
  step: e,
1984
2274
  name: t,
1985
2275
  returnTo: o
1986
2276
  }) {
1987
- const n = I();
2277
+ const n = $();
1988
2278
  return {
1989
2279
  paneRef: n,
1990
2280
  isActive: s(() => e.value === t),
@@ -2004,30 +2294,30 @@ function Nt({
2004
2294
  }
2005
2295
  };
2006
2296
  }
2007
- function kt() {
2008
- const e = tt(), t = ot(), o = ["portal", "auto-top-up-configs"];
2297
+ function qt() {
2298
+ const e = lt(), t = ut(), o = ["portal", "auto-top-up-configs"];
2009
2299
  function n(r) {
2010
2300
  return e({
2011
- url: be(t.apiUrls.config, ...o),
2301
+ url: Te(t.apiUrls.config, ...o),
2012
2302
  query: { ...r },
2013
2303
  isCollection: !0
2014
2304
  });
2015
2305
  }
2016
2306
  async function a(r) {
2017
2307
  return e({
2018
- url: be(t.apiUrls.config, ...o, r)
2308
+ url: Te(t.apiUrls.config, ...o, r)
2019
2309
  });
2020
2310
  }
2021
2311
  function i(r) {
2022
2312
  return e({
2023
- url: be(t.apiUrls.config, ...o),
2313
+ url: Te(t.apiUrls.config, ...o),
2024
2314
  options: { method: "POST" },
2025
2315
  data: r
2026
2316
  });
2027
2317
  }
2028
2318
  async function l(r) {
2029
2319
  return e({
2030
- url: be(t.apiUrls.config, ...o, r, "deactivate"),
2320
+ url: Te(t.apiUrls.config, ...o, r, "deactivate"),
2031
2321
  options: { method: "POST" }
2032
2322
  });
2033
2323
  }
@@ -2038,8 +2328,8 @@ function kt() {
2038
2328
  deactivateAutoTopUpConfig: l
2039
2329
  };
2040
2330
  }
2041
- function Rt() {
2042
- const { createAutoTopUpConfig: e } = kt(), t = Ue(), o = I(!1);
2331
+ function Lt() {
2332
+ const { createAutoTopUpConfig: e } = qt(), t = Ue(), o = $(!1);
2043
2333
  return { save: async (a) => {
2044
2334
  if (!a || o.value)
2045
2335
  return { saved: !1 };
@@ -2058,17 +2348,17 @@ function Rt() {
2058
2348
  }
2059
2349
  }, isSaving: o };
2060
2350
  }
2061
- function mn(e) {
2351
+ function Mn(e) {
2062
2352
  var t;
2063
- return Gt(e) ? e.statusCode === 422 ? e.resourceType === "PAYMENT" ? "PAYMENT_FAILED" : "FAILED" : e.statusCode !== 400 ? "FAILED" : e.field === "payment_method_id" ? "PAYMENT_METHOD" : e.field === "pricing_plan_subscription_id" ? "SUBSCRIPTION_INACTIVE" : e.field === "pricing_items" || (t = e.field) != null && t.startsWith("pricing_items.") ? "PRICING_ITEMS" : "FAILED" : "FAILED";
2353
+ return Xt(e) ? e.statusCode === 422 ? e.resourceType === "PAYMENT" ? "PAYMENT_FAILED" : "FAILED" : e.statusCode !== 400 ? "FAILED" : e.field === "payment_method_id" ? "PAYMENT_METHOD" : e.field === "pricing_plan_subscription_id" ? "SUBSCRIPTION_INACTIVE" : e.field === "pricing_items" || (t = e.field) != null && t.startsWith("pricing_items.") ? "PRICING_ITEMS" : "FAILED" : "FAILED";
2064
2354
  }
2065
- function aa(e) {
2355
+ function va(e) {
2066
2356
  return e === "PAYMENT_METHOD" || e === "PRICING_ITEMS" || e === "SUBSCRIPTION_INACTIVE";
2067
2357
  }
2068
- const vn = {
2358
+ const An = {
2069
2359
  key: 0,
2070
2360
  class: "mb-4"
2071
- }, fn = { class: "sr-only" }, hn = { class: "flex flex-col gap-2" }, gn = /* @__PURE__ */ W({
2361
+ }, Un = { class: "sr-only" }, Pn = { class: "flex flex-col gap-2" }, Sn = /* @__PURE__ */ G({
2072
2362
  __name: "TopUpModal",
2073
2363
  props: {
2074
2364
  showModal: { type: Boolean },
@@ -2079,103 +2369,105 @@ const vn = {
2079
2369
  },
2080
2370
  emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
2081
2371
  setup(e, { emit: t }) {
2082
- const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = Ae(), l = s(
2083
- () => Ot($t(o.selectedBalanceItem))
2084
- ), r = s(() => i(o.selectedBalanceItem)), f = s(
2085
- () => Oo(o.selectedBalanceItem, o.subscriptions ?? [])
2086
- ), T = I();
2087
- ee(
2088
- f,
2089
- (O) => {
2090
- var q;
2091
- O.some(
2092
- ({ id: ye }) => ye === T.value
2093
- ) || (T.value = (q = O[0]) == null ? void 0 : q.id);
2372
+ const o = e, n = t, { $t: a } = te(), { formatOpenBalance: i } = Pe(), l = s(
2373
+ () => Dt(kt(o.selectedBalanceItem))
2374
+ ), r = s(() => i(o.selectedBalanceItem)), h = s(
2375
+ () => Vo(o.selectedBalanceItem, o.subscriptions ?? [])
2376
+ ), w = $();
2377
+ ue(
2378
+ h,
2379
+ (k) => {
2380
+ var H;
2381
+ k.some(
2382
+ ({ id: we }) => we === w.value
2383
+ ) || (w.value = (H = k[0]) == null ? void 0 : H.id);
2094
2384
  },
2095
2385
  { immediate: !0 }
2096
2386
  );
2097
- const M = s(() => f.value.length > 1), S = s(
2098
- () => f.value.map(({ id: O, name: j }, q) => ({
2099
- value: O,
2100
- label: j ?? a(
2387
+ const A = s(() => h.value.length > 1), C = s(
2388
+ () => h.value.map(({ id: k, name: ee }, H) => ({
2389
+ value: k,
2390
+ label: ee ?? a(
2101
2391
  {
2102
2392
  defaultMessage: "Subscription {number}",
2103
2393
  description: "Accessible name of a subscription in the top-up modal when it has no name, numbered by its place in the list",
2104
2394
  id: "topup_modal.subscriptions.unnamed"
2105
2395
  },
2106
- { number: String(q + 1) }
2396
+ { number: String(H + 1) }
2107
2397
  )
2108
2398
  }))
2109
- ), p = s(
2399
+ ), c = s(
2110
2400
  () => Object.fromEntries(
2111
- f.value.flatMap(({ id: O, enabledPricingIds: j }) => {
2112
- const q = (o.subscriptions ?? []).find(({ id: ye }) => ye === O);
2113
- return q ? [[O, { subscription: q, enabledPricingIds: j }]] : [];
2401
+ h.value.flatMap(({ id: k, enabledPricingIds: ee }) => {
2402
+ const H = (o.subscriptions ?? []).find(({ id: we }) => we === k);
2403
+ return H ? [[k, { subscription: H, enabledPricingIds: ee }]] : [];
2114
2404
  })
2115
2405
  )
2116
- ), b = s(() => {
2117
- var j;
2118
- if (!o.selectedBalanceItem || !((j = o.subscriptions) != null && j.length))
2406
+ ), T = s(() => {
2407
+ var ee;
2408
+ if (!o.selectedBalanceItem || !((ee = o.subscriptions) != null && ee.length))
2119
2409
  return o.selectedBalanceItem;
2120
- const O = f.value.find(({ id: q }) => q === T.value);
2121
- return O ? Bo(o.selectedBalanceItem, O.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
2122
- }), P = s(() => gt(b.value)), {
2123
- paymentMethodOptions: x,
2124
- settledOptions: w,
2125
- isPending: $
2126
- } = ft({
2410
+ const k = h.value.find(({ id: H }) => H === w.value);
2411
+ return k ? zo(o.selectedBalanceItem, k.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
2412
+ }), S = s(
2413
+ () => bt(T.value, o.subscriptions)
2414
+ ), {
2415
+ paymentMethodOptions: E,
2416
+ settledOptions: y,
2417
+ isPending: B
2418
+ } = yt({
2127
2419
  isOpen: s(() => o.showModal),
2128
2420
  customer: s(() => o.customer)
2129
- }), h = I("TOP_UP"), c = s(() => (o.paymentMethods ?? []).length > 0), A = s(
2130
- () => !$.value && (x.value ?? []).length === 0
2131
- ), B = s(
2132
- () => h.value === "TOP_UP" && !c.value && A.value
2133
- ), v = I(), U = () => {
2134
- H(), n("payment-success");
2421
+ }), L = $("TOP_UP"), b = s(() => (o.paymentMethods ?? []).length > 0), O = s(
2422
+ () => !B.value && (E.value ?? []).length === 0
2423
+ ), Y = s(
2424
+ () => L.value === "TOP_UP" && !b.value && O.value
2425
+ ), g = $(), x = () => {
2426
+ N(), n("payment-success");
2135
2427
  }, {
2136
- paneRef: G,
2137
- isActive: te,
2138
- isSaving: ve,
2139
- open: fe,
2140
- leave: H,
2141
- submit: de
2142
- } = Nt({ step: h, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: he, isSaving: ce } = Rt();
2143
- let z = 0;
2144
- const ne = I(), pe = s(() => {
2145
- var O;
2146
- return (O = ne.value) == null ? void 0 : O.chargedValue;
2147
- }), oe = s(
2428
+ paneRef: Z,
2429
+ isActive: m,
2430
+ isSaving: M,
2431
+ open: I,
2432
+ leave: N,
2433
+ submit: ie
2434
+ } = Ft({ step: L, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: fe, isSaving: de } = Lt();
2435
+ let Q = 0;
2436
+ const K = $(), ge = s(() => {
2437
+ var k;
2438
+ return (k = K.value) == null ? void 0 : k.chargedValue;
2439
+ }), re = s(
2148
2440
  () => {
2149
- var O;
2150
- return ve.value || ce.value || !!((O = ne.value) != null && O.isCharging);
2441
+ var k;
2442
+ return M.value || de.value || !!((k = K.value) != null && k.isCharging);
2151
2443
  }
2152
- ), { title: ge, subTitle: d, cancelButtonText: m, confirmButtonText: y } = ln({
2153
- step: h,
2444
+ ), { title: _e, subTitle: d, cancelButtonText: p, confirmButtonText: _ } = gn({
2445
+ step: L,
2154
2446
  currentBalance: r,
2155
- topUpValue: pe
2156
- }), D = I(), L = I(!1), ae = I(!1), _e = s(
2157
- () => ae.value ? a({
2447
+ topUpValue: ge
2448
+ }), R = $(), j = $(!1), ce = $(!1), be = s(
2449
+ () => ce.value ? a({
2158
2450
  defaultMessage: "Your wallet was topped up, but we couldn't save your automatic top-up. You can set it up from your wallet.",
2159
2451
  description: "Error shown on the top-up receipt when the automatic top-up rule set alongside it failed to save",
2160
2452
  id: "topup_modal.success.auto_top_up_failed"
2161
2453
  }) : void 0
2162
- ), F = () => {
2163
- var O;
2164
- if (te.value) {
2165
- de();
2454
+ ), W = () => {
2455
+ var k;
2456
+ if (m.value) {
2457
+ ie();
2166
2458
  return;
2167
2459
  }
2168
- L.value || (D.value = void 0, (O = ne.value) == null || O.submit());
2169
- }, K = (O) => {
2170
- if (n("payment-failed", O), co(O)) {
2171
- L.value = !0, D.value = a({
2460
+ j.value || (R.value = void 0, (k = K.value) == null || k.submit());
2461
+ }, oe = (k) => {
2462
+ if (n("payment-failed", k), mo(k)) {
2463
+ j.value = !0, R.value = a({
2172
2464
  defaultMessage: "We couldn't confirm your top-up. It may still go through, so check your wallet balance before topping up again.",
2173
2465
  description: "Error shown in the top-up modal when charging the top-up got no clear answer, so the wallet may still have been topped up",
2174
2466
  id: "topup_modal.error.charge_unconfirmed"
2175
2467
  });
2176
2468
  return;
2177
2469
  }
2178
- D.value = mn(O) === "PAYMENT_FAILED" ? a({
2470
+ R.value = Mn(k) === "PAYMENT_FAILED" ? a({
2179
2471
  defaultMessage: "Your payment was declined. Try another payment method.",
2180
2472
  description: "Error shown in the top-up modal when the payment was declined",
2181
2473
  id: "topup_modal.error.payment_declined"
@@ -2184,81 +2476,81 @@ const vn = {
2184
2476
  description: "Error shown in the top-up modal when charging the top-up failed",
2185
2477
  id: "topup_modal.error.charge_failed"
2186
2478
  });
2187
- }, J = async ({
2188
- rule: O,
2189
- paymentMethodId: j,
2190
- pricingPlanScheduleId: q
2479
+ }, se = async ({
2480
+ rule: k,
2481
+ paymentMethodId: ee,
2482
+ pricingPlanScheduleId: H
2191
2483
  }) => {
2192
- const ye = z, { saved: qt } = await he(
2193
- Dt({
2194
- rule: O,
2484
+ const we = Q, { saved: zt } = await fe(
2485
+ Rt({
2486
+ rule: k,
2195
2487
  walletBalanceItem: o.selectedBalanceItem,
2196
- chargeTarget: Bt(
2488
+ chargeTarget: Nt(
2197
2489
  void 0,
2198
- P.value.filter(
2199
- (Vt) => Vt.pricingPlanScheduleId === q
2490
+ S.value.filter(
2491
+ (Yt) => Yt.pricingPlanScheduleId === H
2200
2492
  )
2201
2493
  ),
2202
- paymentMethodId: j
2494
+ paymentMethodId: ee
2203
2495
  })
2204
2496
  );
2205
- if (qt) {
2497
+ if (zt) {
2206
2498
  n("auto-top-up-saved");
2207
2499
  return;
2208
2500
  }
2209
- ye === z && (ae.value = !0);
2210
- }, Ft = (O) => {
2211
- v.value = O, h.value = "SUCCESS";
2212
- }, Le = () => {
2213
- oe.value || (n("confirm"), n("close"));
2214
- }, Ye = () => {
2215
- if (!oe.value) {
2216
- if (te.value) {
2217
- H();
2501
+ we === Q && (ce.value = !0);
2502
+ }, Vt = (k) => {
2503
+ g.value = k, L.value = "SUCCESS";
2504
+ }, We = () => {
2505
+ re.value || (n("confirm"), n("close"));
2506
+ }, He = () => {
2507
+ if (!re.value) {
2508
+ if (m.value) {
2509
+ N();
2218
2510
  return;
2219
2511
  }
2220
- if (h.value === "SUCCESS" || L.value) {
2221
- Le();
2512
+ if (L.value === "SUCCESS" || j.value) {
2513
+ We();
2222
2514
  return;
2223
2515
  }
2224
2516
  n("close");
2225
2517
  }
2226
- }, We = I(0);
2227
- return ee(
2518
+ }, je = $(0);
2519
+ return ue(
2228
2520
  () => o.showModal,
2229
- (O) => {
2230
- O && (z += 1, h.value = "TOP_UP", v.value = void 0, D.value = void 0, L.value = !1, ae.value = !1, We.value += 1);
2521
+ (k) => {
2522
+ k && (Q += 1, L.value = "TOP_UP", g.value = void 0, R.value = void 0, j.value = !1, ce.value = !1, je.value += 1);
2231
2523
  }
2232
- ), (O, j) => (_(), E(It, {
2524
+ ), (k, ee) => (f(), U(It, {
2233
2525
  ref_key: "addPaymentMethodRef",
2234
- ref: G,
2526
+ ref: Z,
2235
2527
  "show-modal": e.showModal,
2236
- title: u(ge),
2528
+ title: u(_e),
2237
2529
  "sub-title": u(d),
2238
- "cancel-button-text": u(m),
2239
- "confirm-button-text": u(y),
2240
- "is-pending": oe.value,
2241
- panes: u(Io),
2242
- step: h.value,
2530
+ "cancel-button-text": u(p),
2531
+ "confirm-button-text": u(_),
2532
+ "is-pending": re.value,
2533
+ panes: u(Fo),
2534
+ step: L.value,
2243
2535
  "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2244
2536
  customer: e.customer,
2245
- "payment-method-options": u(x),
2246
- "is-payment-method-options-pending": u($),
2247
- onConfirm: F,
2248
- onCancel: Ye,
2249
- onPaymentSuccess: U,
2250
- onPaymentFailed: j[1] || (j[1] = (q) => O.$emit("payment-failed", q))
2251
- }, re({
2252
- TOP_UP: g(() => [
2253
- M.value ? (_(), Y("div", vn, [
2254
- C(u(lt), {
2255
- modelValue: T.value,
2256
- "onUpdate:modelValue": j[0] || (j[0] = (q) => T.value = q),
2537
+ "payment-method-options": u(E),
2538
+ "is-payment-method-options-pending": u(B),
2539
+ onConfirm: W,
2540
+ onCancel: He,
2541
+ onPaymentSuccess: x,
2542
+ onPaymentFailed: ee[1] || (ee[1] = (H) => k.$emit("payment-failed", H))
2543
+ }, me({
2544
+ TOP_UP: v(() => [
2545
+ A.value ? (f(), z("div", An, [
2546
+ P(u(dt), {
2547
+ modelValue: w.value,
2548
+ "onUpdate:modelValue": ee[0] || (ee[0] = (H) => w.value = H),
2257
2549
  class: "sv-top-up-modal__subscription",
2258
2550
  name: "top-up-subscription",
2259
2551
  direction: "column",
2260
2552
  required: "",
2261
- options: S.value,
2553
+ options: C.value,
2262
2554
  "show-radio": !1,
2263
2555
  label: u(a)({
2264
2556
  defaultMessage: "Subscription to top up",
@@ -2266,84 +2558,84 @@ const vn = {
2266
2558
  id: "topup_modal.subscriptions.label"
2267
2559
  })
2268
2560
  }, {
2269
- prefix: g(({ optionValue: q }) => [
2270
- p.value[String(q)] ? (_(), E(uo, {
2561
+ prefix: v(({ optionValue: H }) => [
2562
+ c.value[String(H)] ? (f(), U(co, {
2271
2563
  key: 0,
2272
2564
  class: "sv-top-up-modal__subscription-option grow",
2273
2565
  "no-spacing": "",
2274
- subscription: p.value[String(q)].subscription,
2275
- "enabled-pricing-ids": p.value[String(q)].enabledPricingIds
2276
- }, null, 8, ["subscription", "enabled-pricing-ids"])) : R("", !0)
2566
+ subscription: c.value[String(H)].subscription,
2567
+ "enabled-pricing-ids": c.value[String(H)].enabledPricingIds
2568
+ }, null, 8, ["subscription", "enabled-pricing-ids"])) : q("", !0)
2277
2569
  ]),
2278
- label: g(({ option: q }) => [
2279
- N("span", fn, k(q.label), 1)
2570
+ label: v(({ option: H }) => [
2571
+ D("span", Un, F(H.label), 1)
2280
2572
  ]),
2281
2573
  _: 1
2282
2574
  }, 8, ["modelValue", "options", "label"])
2283
- ])) : R("", !0),
2284
- (_(), E(nn, {
2285
- key: We.value,
2575
+ ])) : q("", !0),
2576
+ (f(), U(vn, {
2577
+ key: je.value,
2286
2578
  ref_key: "topUpFormRef",
2287
- ref: ne,
2288
- "top-up-pricing-items": P.value,
2579
+ ref: K,
2580
+ "top-up-pricing-items": S.value,
2289
2581
  "payment-methods": e.paymentMethods,
2290
2582
  "auto-top-up-config": l.value,
2291
- "payment-method-options": u(w),
2292
- onAddPaymentMethod: u(fe),
2293
- onSuccess: Ft,
2294
- onFailure: K,
2295
- onSaveAutoTopUp: J
2583
+ "payment-method-options": u(y),
2584
+ onAddPaymentMethod: u(I),
2585
+ onSuccess: Vt,
2586
+ onFailure: oe,
2587
+ onSaveAutoTopUp: se
2296
2588
  }, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"])),
2297
- D.value ? (_(), E(u(me), {
2589
+ R.value ? (f(), U(u(ye), {
2298
2590
  key: 1,
2299
2591
  class: "sv-top-up-modal__error sv-error mt-4",
2300
- title: D.value
2301
- }, null, 8, ["title"])) : R("", !0)
2592
+ title: R.value
2593
+ }, null, 8, ["title"])) : q("", !0)
2302
2594
  ]),
2303
- SUCCESS: g(() => [
2304
- _e.value ? (_(), E(u(me), {
2595
+ SUCCESS: v(() => [
2596
+ be.value ? (f(), U(u(ye), {
2305
2597
  key: 0,
2306
2598
  class: "sv-top-up-modal__auto-top-up-error sv-error mb-4",
2307
- title: _e.value
2308
- }, null, 8, ["title"])) : R("", !0),
2309
- v.value ? (_(), E(sn, {
2599
+ title: be.value
2600
+ }, null, 8, ["title"])) : q("", !0),
2601
+ g.value ? (f(), U(hn, {
2310
2602
  key: 1,
2311
- invoice: v.value
2312
- }, null, 8, ["invoice"])) : R("", !0)
2603
+ invoice: g.value
2604
+ }, null, 8, ["invoice"])) : q("", !0)
2313
2605
  ]),
2314
2606
  _: 2
2315
2607
  }, [
2316
- h.value === "SUCCESS" || B.value || h.value === "TOP_UP" && L.value ? {
2608
+ L.value === "SUCCESS" || Y.value || L.value === "TOP_UP" && j.value ? {
2317
2609
  name: "footer",
2318
- fn: g(() => [
2319
- N("div", hn, [
2320
- h.value === "SUCCESS" ? (_(), E(u(se), {
2610
+ fn: v(() => [
2611
+ D("div", Pn, [
2612
+ L.value === "SUCCESS" ? (f(), U(u(pe), {
2321
2613
  key: 0,
2322
2614
  size: "lg",
2323
- loading: oe.value,
2324
- onClick: Le
2615
+ loading: re.value,
2616
+ onClick: We
2325
2617
  }, {
2326
- default: g(() => [
2327
- V(k(u(y)), 1)
2618
+ default: v(() => [
2619
+ V(F(u(_)), 1)
2328
2620
  ]),
2329
2621
  _: 1
2330
- }, 8, ["loading"])) : (_(), Y(Te, { key: 1 }, [
2331
- C(u(se), {
2622
+ }, 8, ["loading"])) : (f(), z(he, { key: 1 }, [
2623
+ P(u(pe), {
2332
2624
  size: "lg",
2333
2625
  disabled: ""
2334
2626
  }, {
2335
- default: g(() => [
2336
- V(k(u(y)), 1)
2627
+ default: v(() => [
2628
+ V(F(u(_)), 1)
2337
2629
  ]),
2338
2630
  _: 1
2339
2631
  }),
2340
- C(u(se), {
2632
+ P(u(pe), {
2341
2633
  size: "lg",
2342
2634
  intent: "subtle",
2343
- onClick: Ye
2635
+ onClick: He
2344
2636
  }, {
2345
- default: g(() => [
2346
- V(k(u(m)), 1)
2637
+ default: v(() => [
2638
+ V(F(u(p)), 1)
2347
2639
  ]),
2348
2640
  _: 1
2349
2641
  })
@@ -2354,69 +2646,72 @@ const vn = {
2354
2646
  } : void 0
2355
2647
  ]), 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"]));
2356
2648
  }
2357
- }), _n = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], yn = { class: "grid grid-cols-1 gap-4" }, bn = { class: "flex flex-col gap-2" }, wn = /* @__PURE__ */ W({
2649
+ }), Cn = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], En = { class: "grid grid-cols-1 gap-4" }, xn = { class: "flex flex-col gap-2" }, $n = /* @__PURE__ */ G({
2358
2650
  __name: "AutoTopUpModal",
2359
2651
  props: {
2360
2652
  showModal: { type: Boolean },
2361
2653
  walletBalanceItem: { type: Object },
2362
2654
  topUpItem: { type: Object },
2363
2655
  paymentMethods: { type: Array },
2364
- customer: { type: Object }
2656
+ customer: { type: Object },
2657
+ subscriptions: { type: Array }
2365
2658
  },
2366
2659
  emits: ["saved", "close", "payment-success", "payment-failed"],
2367
2660
  setup(e, { emit: t }) {
2368
- const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = Ae(), l = I("AUTO_TOP_UP"), r = s(() => i(o.walletBalanceItem)), f = s(() => gt(o.walletBalanceItem)), T = s(() => Mt(f.value)), M = s(() => $t(o.walletBalanceItem)), S = s(() => Ot(M.value)), p = s(
2369
- () => Bt(o.topUpItem, f.value)
2370
- ), b = I(), P = s(
2661
+ const o = e, n = t, { $t: a } = te(), { formatOpenBalance: i } = Pe(), l = $("AUTO_TOP_UP"), r = s(() => i(o.walletBalanceItem)), h = s(
2662
+ () => bt(o.walletBalanceItem, o.subscriptions)
2663
+ ), w = s(() => Pt(h.value)), A = s(() => kt(o.walletBalanceItem)), C = s(() => Dt(A.value)), c = s(
2664
+ () => Nt(o.topUpItem, h.value)
2665
+ ), T = $(), S = s(
2371
2666
  () => {
2372
- var F;
2373
- return !!T.value && !!p.value && !!((F = o.walletBalanceItem) != null && F.wallet_id);
2667
+ var W;
2668
+ return !!w.value && !!c.value && !!((W = o.walletBalanceItem) != null && W.wallet_id);
2374
2669
  }
2375
- ), x = s(() => l.value === "AUTO_TOP_UP" && !P.value), w = I(), $ = s(() => {
2376
- var K, J;
2377
- const F = (J = (K = b.value) == null ? void 0 : K.rule) == null ? void 0 : J.topup_amount;
2378
- return F != null && F.quantity && p.value ? [{ pricing_item_id: p.value.pricingItemId, flexible_amount: F }] : void 0;
2379
- }), h = s(() => {
2380
- var F;
2381
- return (F = p.value) == null ? void 0 : F.pricingPlanScheduleId;
2382
- }), c = I(), { sortedPaymentMethods: A } = vt({
2670
+ ), E = s(() => l.value === "AUTO_TOP_UP" && !S.value), y = $(), B = s(() => {
2671
+ var oe, se;
2672
+ const W = (se = (oe = T.value) == null ? void 0 : oe.rule) == null ? void 0 : se.topup_amount;
2673
+ return W != null && W.quantity && c.value ? [{ pricing_item_id: c.value.pricingItemId, flexible_amount: W }] : void 0;
2674
+ }), L = s(() => {
2675
+ var W;
2676
+ return (W = c.value) == null ? void 0 : W.pricingPlanScheduleId;
2677
+ }), b = $(), { sortedPaymentMethods: O } = gt({
2383
2678
  paymentMethods: s(() => o.paymentMethods),
2384
- selectedPaymentMethodId: c,
2679
+ selectedPaymentMethodId: b,
2385
2680
  preferredPaymentMethodId: s(() => {
2386
- var F;
2387
- return (F = M.value) == null ? void 0 : F.payment_method_id;
2681
+ var W;
2682
+ return (W = A.value) == null ? void 0 : W.payment_method_id;
2388
2683
  })
2389
2684
  }), {
2390
- paymentMethodOptions: B,
2391
- settledOptions: v,
2392
- isPending: U
2393
- } = ft({
2685
+ paymentMethodOptions: Y,
2686
+ settledOptions: g,
2687
+ isPending: x
2688
+ } = yt({
2394
2689
  isOpen: s(() => o.showModal),
2395
2690
  customer: s(() => o.customer)
2396
2691
  }), {
2397
- paneRef: G,
2398
- isActive: te,
2399
- isSaving: ve,
2400
- open: fe,
2401
- leave: H,
2402
- submit: de
2403
- } = Nt({ step: l, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: he, isSaving: ce } = Rt(), z = s(() => ve.value || ce.value), ne = Oe({
2404
- paymentMethodId: s(() => c.value ?? null)
2405
- }), pe = De(
2692
+ paneRef: Z,
2693
+ isActive: m,
2694
+ isSaving: M,
2695
+ open: I,
2696
+ leave: N,
2697
+ submit: ie
2698
+ } = Ft({ step: l, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: fe, isSaving: de } = Lt(), Q = s(() => M.value || de.value), K = Oe({
2699
+ paymentMethodId: s(() => b.value ?? null)
2700
+ }), ge = Re(
2406
2701
  {
2407
2702
  paymentMethodId: {
2408
- required: X.withMessage(
2703
+ required: ne.withMessage(
2409
2704
  () => a({
2410
2705
  defaultMessage: "Select a payment method to pay for automatic top-ups.",
2411
2706
  description: "Error shown in the auto top-up modal when no payment method is selected",
2412
2707
  id: "auto_topup_modal.payment_method.required"
2413
2708
  }),
2414
- rt
2709
+ pt
2415
2710
  )
2416
2711
  }
2417
2712
  },
2418
- ne
2419
- ), oe = s(
2713
+ K
2714
+ ), re = s(
2420
2715
  () => l.value === "ADD_PAYMENT_METHOD" ? a({
2421
2716
  defaultMessage: "Add payment method",
2422
2717
  description: "Title of the auto top-up modal while the customer is adding a payment method",
@@ -2426,7 +2721,7 @@ const vn = {
2426
2721
  description: "Title of the automatic wallet top-up modal",
2427
2722
  id: "auto_topup_modal.title"
2428
2723
  })
2429
- ), ge = s(
2724
+ ), _e = s(
2430
2725
  () => l.value === "ADD_PAYMENT_METHOD" ? a({
2431
2726
  defaultMessage: "This method pays for every automatic top-up.",
2432
2727
  description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
@@ -2449,7 +2744,7 @@ const vn = {
2449
2744
  description: "Button dismissing the auto top-up modal",
2450
2745
  id: "auto_topup_modal.cancel"
2451
2746
  })
2452
- ), m = s(
2747
+ ), p = s(
2453
2748
  () => l.value === "ADD_PAYMENT_METHOD" ? a({
2454
2749
  defaultMessage: "Add payment method",
2455
2750
  description: "Button storing the payment method being added in the auto top-up modal",
@@ -2460,74 +2755,74 @@ const vn = {
2460
2755
  id: "auto_topup_modal.confirm"
2461
2756
  })
2462
2757
  );
2463
- async function y() {
2464
- var J;
2465
- if (pe.value.$touch(), z.value || !P.value)
2758
+ async function _() {
2759
+ var se;
2760
+ if (ge.value.$touch(), Q.value || !S.value)
2466
2761
  return;
2467
- w.value = void 0;
2468
- const { saved: F, error: K } = await he(
2469
- Dt({
2470
- rule: (J = b.value) == null ? void 0 : J.validate(),
2762
+ y.value = void 0;
2763
+ const { saved: W, error: oe } = await fe(
2764
+ Rt({
2765
+ rule: (se = T.value) == null ? void 0 : se.validate(),
2471
2766
  walletBalanceItem: o.walletBalanceItem,
2472
- chargeTarget: p.value,
2473
- paymentMethodId: c.value
2767
+ chargeTarget: c.value,
2768
+ paymentMethodId: b.value
2474
2769
  })
2475
2770
  );
2476
- if (F) {
2771
+ if (W) {
2477
2772
  n("saved"), n("close");
2478
2773
  return;
2479
2774
  }
2480
- K && (w.value = a({
2775
+ oe && (y.value = a({
2481
2776
  defaultMessage: "We couldn't save your automatic top-up. Please try again.",
2482
2777
  description: "Error shown in the auto top-up modal when saving the rule failed",
2483
2778
  id: "auto_topup_modal.save_failed"
2484
- }), n("payment-failed", K));
2779
+ }), n("payment-failed", oe));
2485
2780
  }
2486
- const D = () => {
2487
- if (te.value) {
2488
- de();
2781
+ const R = () => {
2782
+ if (m.value) {
2783
+ ie();
2489
2784
  return;
2490
2785
  }
2491
- y();
2492
- }, L = () => {
2493
- H(), n("payment-success");
2494
- }, ae = () => {
2495
- if (!z.value) {
2496
- if (te.value) {
2497
- H();
2786
+ _();
2787
+ }, j = () => {
2788
+ N(), n("payment-success");
2789
+ }, ce = () => {
2790
+ if (!Q.value) {
2791
+ if (m.value) {
2792
+ N();
2498
2793
  return;
2499
2794
  }
2500
2795
  n("close");
2501
2796
  }
2502
- }, _e = I(0);
2503
- return ee(
2797
+ }, be = $(0);
2798
+ return ue(
2504
2799
  () => o.showModal,
2505
- (F) => {
2506
- F && (l.value = "AUTO_TOP_UP", c.value = void 0, w.value = void 0, _e.value += 1);
2800
+ (W) => {
2801
+ W && (l.value = "AUTO_TOP_UP", b.value = void 0, y.value = void 0, be.value += 1);
2507
2802
  }
2508
- ), (F, K) => (_(), E(It, {
2803
+ ), (W, oe) => (f(), U(It, {
2509
2804
  ref_key: "addPaymentMethodRef",
2510
- ref: G,
2805
+ ref: Z,
2511
2806
  "show-modal": e.showModal,
2512
- title: oe.value,
2513
- "sub-title": ge.value,
2807
+ title: re.value,
2808
+ "sub-title": _e.value,
2514
2809
  "cancel-button-text": d.value,
2515
- "confirm-button-text": m.value,
2516
- "is-pending": z.value,
2517
- panes: u(_n),
2810
+ "confirm-button-text": p.value,
2811
+ "is-pending": Q.value,
2812
+ panes: u(Cn),
2518
2813
  step: l.value,
2519
2814
  "add-payment-method-pane": "ADD_PAYMENT_METHOD",
2520
2815
  customer: e.customer,
2521
- "payment-method-options": u(B),
2522
- "is-payment-method-options-pending": u(U),
2523
- onConfirm: D,
2524
- onCancel: ae,
2525
- onPaymentSuccess: L,
2526
- onPaymentFailed: K[1] || (K[1] = (J) => F.$emit("payment-failed", J))
2527
- }, re({
2528
- AUTO_TOP_UP: g(() => [
2529
- N("div", yn, [
2530
- P.value ? R("", !0) : (_(), E(u(po), {
2816
+ "payment-method-options": u(Y),
2817
+ "is-payment-method-options-pending": u(x),
2818
+ onConfirm: R,
2819
+ onCancel: ce,
2820
+ onPaymentSuccess: j,
2821
+ onPaymentFailed: oe[1] || (oe[1] = (se) => W.$emit("payment-failed", se))
2822
+ }, me({
2823
+ AUTO_TOP_UP: v(() => [
2824
+ D("div", En, [
2825
+ S.value ? q("", !0) : (f(), U(u(vo), {
2531
2826
  key: 0,
2532
2827
  type: "warning",
2533
2828
  class: "sv-auto-topup-modal__unavailable",
@@ -2537,64 +2832,64 @@ const vn = {
2537
2832
  id: "auto_topup_modal.unavailable"
2538
2833
  })
2539
2834
  }, null, 8, ["title"])),
2540
- T.value ? (_(), E(xt, ie({
2541
- key: _e.value,
2835
+ w.value ? (f(), U(Ot, ae({
2836
+ key: be.value,
2542
2837
  ref_key: "autoTopUpFormRef",
2543
- ref: b,
2838
+ ref: T,
2544
2839
  class: "sv-auto-topup-modal__rule"
2545
- }, T.value, {
2546
- config: S.value,
2840
+ }, w.value, {
2841
+ config: C.value,
2547
2842
  "always-enabled": "",
2548
- disabled: z.value
2549
- }), null, 16, ["config", "disabled"])) : R("", !0),
2550
- C(Ut, {
2551
- "pricing-plan-schedule-id": h.value,
2552
- "pricing-items": $.value
2843
+ disabled: Q.value
2844
+ }), null, 16, ["config", "disabled"])) : q("", !0),
2845
+ P(St, {
2846
+ "pricing-plan-schedule-id": L.value,
2847
+ "pricing-items": B.value
2553
2848
  }, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
2554
- C(mt, {
2555
- modelValue: c.value,
2556
- "onUpdate:modelValue": K[0] || (K[0] = (J) => c.value = J),
2849
+ P(ht, {
2850
+ modelValue: b.value,
2851
+ "onUpdate:modelValue": oe[0] || (oe[0] = (se) => b.value = se),
2557
2852
  class: "sv-auto-topup-modal__payment-method",
2558
- "payment-methods": u(A),
2559
- "payment-method-options": u(v),
2560
- disabled: z.value,
2561
- error: u(pe).paymentMethodId.$errors,
2853
+ "payment-methods": u(O),
2854
+ "payment-method-options": u(g),
2855
+ disabled: Q.value,
2856
+ error: u(ge).paymentMethodId.$errors,
2562
2857
  label: u(a)({
2563
2858
  defaultMessage: "Pay automatic top-ups with",
2564
2859
  description: "Label above the payment method an automatic top-up is charged to",
2565
2860
  id: "auto_topup_modal.payment_method.label"
2566
2861
  }),
2567
- onAddPaymentMethod: u(fe)
2862
+ onAddPaymentMethod: u(I)
2568
2863
  }, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"]),
2569
- w.value ? (_(), E(u(me), {
2864
+ y.value ? (f(), U(u(ye), {
2570
2865
  key: 2,
2571
2866
  class: "sv-auto-topup-modal__error sv-error",
2572
- title: w.value
2573
- }, null, 8, ["title"])) : R("", !0)
2867
+ title: y.value
2868
+ }, null, 8, ["title"])) : q("", !0)
2574
2869
  ])
2575
2870
  ]),
2576
2871
  _: 2
2577
2872
  }, [
2578
- x.value ? {
2873
+ E.value ? {
2579
2874
  name: "footer",
2580
- fn: g(() => [
2581
- N("div", bn, [
2582
- C(u(se), {
2875
+ fn: v(() => [
2876
+ D("div", xn, [
2877
+ P(u(pe), {
2583
2878
  size: "lg",
2584
2879
  disabled: ""
2585
2880
  }, {
2586
- default: g(() => [
2587
- V(k(m.value), 1)
2881
+ default: v(() => [
2882
+ V(F(p.value), 1)
2588
2883
  ]),
2589
2884
  _: 1
2590
2885
  }),
2591
- C(u(se), {
2886
+ P(u(pe), {
2592
2887
  size: "lg",
2593
2888
  intent: "subtle",
2594
- onClick: ae
2889
+ onClick: ce
2595
2890
  }, {
2596
- default: g(() => [
2597
- V(k(d.value), 1)
2891
+ default: v(() => [
2892
+ V(F(d.value), 1)
2598
2893
  ]),
2599
2894
  _: 1
2600
2895
  })
@@ -2605,8 +2900,8 @@ const vn = {
2605
2900
  ]), 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"]));
2606
2901
  }
2607
2902
  });
2608
- function Tn() {
2609
- const { deactivateAutoTopUpConfig: e } = kt(), t = Ue(), o = I(!1);
2903
+ function Bn() {
2904
+ const { deactivateAutoTopUpConfig: e } = qt(), t = Ue(), o = $(!1);
2610
2905
  return { deactivate: async (a) => {
2611
2906
  if (!a || o.value)
2612
2907
  return !1;
@@ -2625,7 +2920,7 @@ function Tn() {
2625
2920
  }
2626
2921
  }, isDeactivating: o };
2627
2922
  }
2628
- const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, Un = /* @__PURE__ */ W({
2923
+ const On = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, In = /* @__PURE__ */ G({
2629
2924
  __name: "AutoTopUpCancellationModal",
2630
2925
  props: {
2631
2926
  showModal: { type: Boolean },
@@ -2633,49 +2928,49 @@ const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
2633
2928
  },
2634
2929
  emits: ["confirmed", "close"],
2635
2930
  setup(e, { emit: t }) {
2636
- const o = e, n = t, { $t: a } = Q(), { formatValue: i } = Ae(), { deactivate: l, isDeactivating: r } = Tn(), f = I(!1);
2637
- ee(
2931
+ const o = e, n = t, { $t: a } = te(), { formatValue: i } = Pe(), { deactivate: l, isDeactivating: r } = Bn(), h = $(!1);
2932
+ ue(
2638
2933
  () => o.showModal,
2639
- (p) => {
2640
- p && (f.value = !1);
2934
+ (c) => {
2935
+ c && (h.value = !1);
2641
2936
  }
2642
2937
  );
2643
- const T = s(() => {
2644
- var P, x;
2645
- const p = (P = o.config) == null ? void 0 : P.threshold, b = (x = o.config) == null ? void 0 : x.topup_amount;
2646
- return !(p != null && p.amount) && !(p != null && p.credits) ? a({
2938
+ const w = s(() => {
2939
+ var S, E;
2940
+ const c = (S = o.config) == null ? void 0 : S.threshold, T = (E = o.config) == null ? void 0 : E.topup_amount;
2941
+ return !(c != null && c.amount) && !(c != null && c.credits) ? a({
2647
2942
  defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
2648
2943
  description: "Explanation in the modal that turns a wallet automatic top-up off",
2649
2944
  id: "auto_topup_cancellation_modal.explanation"
2650
- }) : b ? a(
2945
+ }) : T ? a(
2651
2946
  {
2652
2947
  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.",
2653
2948
  description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
2654
2949
  id: "auto_topup_cancellation_modal.explanation_with_amount"
2655
2950
  },
2656
- { amount: i({ amount: b }), threshold: i(p) }
2951
+ { amount: i({ amount: T }), threshold: i(c) }
2657
2952
  ) : a(
2658
2953
  {
2659
2954
  defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
2660
2955
  description: "Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",
2661
2956
  id: "auto_topup_cancellation_modal.explanation_with_threshold"
2662
2957
  },
2663
- { threshold: i(p) }
2958
+ { threshold: i(c) }
2664
2959
  );
2665
- }), M = async () => {
2666
- var b;
2667
- const p = (b = o.config) == null ? void 0 : b.id;
2668
- if (!(!p || r.value)) {
2669
- if (f.value = !1, !await l(p)) {
2670
- f.value = !0;
2960
+ }), A = async () => {
2961
+ var T;
2962
+ const c = (T = o.config) == null ? void 0 : T.id;
2963
+ if (!(!c || r.value)) {
2964
+ if (h.value = !1, !await l(c)) {
2965
+ h.value = !0;
2671
2966
  return;
2672
2967
  }
2673
2968
  n("confirmed"), n("close");
2674
2969
  }
2675
- }, S = () => {
2970
+ }, C = () => {
2676
2971
  r.value || n("close");
2677
2972
  };
2678
- return (p, b) => (_(), E(u(ht), {
2973
+ return (c, T) => (f(), U(u(_t), {
2679
2974
  "full-screen-on-mobile": "",
2680
2975
  size: "sm",
2681
2976
  "show-modal": e.showModal,
@@ -2697,23 +2992,23 @@ const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
2697
2992
  description: "Button dismissing the modal that turns a wallet automatic top-up off",
2698
2993
  id: "auto_topup_cancellation_modal.cancel"
2699
2994
  }),
2700
- onConfirm: M,
2701
- onClose: S
2995
+ onConfirm: A,
2996
+ onClose: C
2702
2997
  }, {
2703
- body: g(() => [
2704
- N("div", Mn, [
2705
- C(u(Z), {
2998
+ body: v(() => [
2999
+ D("div", On, [
3000
+ P(u(J), {
2706
3001
  variant: "body-sm",
2707
3002
  color: "subtle",
2708
3003
  tag: "p",
2709
3004
  class: "sv-auto-topup-cancellation-modal__explanation"
2710
3005
  }, {
2711
- default: g(() => [
2712
- V(k(T.value), 1)
3006
+ default: v(() => [
3007
+ V(F(w.value), 1)
2713
3008
  ]),
2714
3009
  _: 1
2715
3010
  }),
2716
- f.value ? (_(), E(u(me), {
3011
+ h.value ? (f(), U(u(ye), {
2717
3012
  key: 0,
2718
3013
  class: "sv-auto-topup-cancellation-modal__error sv-error",
2719
3014
  title: u(a)({
@@ -2721,13 +3016,13 @@ const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
2721
3016
  description: "Error shown when turning a wallet automatic top-up off failed",
2722
3017
  id: "auto_topup_cancellation_modal.failed"
2723
3018
  })
2724
- }, null, 8, ["title"])) : R("", !0)
3019
+ }, null, 8, ["title"])) : q("", !0)
2725
3020
  ])
2726
3021
  ]),
2727
3022
  _: 1
2728
3023
  }, 8, ["show-modal", "is-loading", "no-click-away", "no-backdrop-close", "title", "confirm-button-text", "cancel-button-text"]));
2729
3024
  }
2730
- }), ia = /* @__PURE__ */ W({
3025
+ }), fa = /* @__PURE__ */ G({
2731
3026
  inheritAttrs: !1,
2732
3027
  __name: "CustomerWalletBalances",
2733
3028
  props: {
@@ -2741,30 +3036,30 @@ const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
2741
3036
  },
2742
3037
  emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
2743
3038
  setup(e, { emit: t }) {
2744
- const o = e, n = t, { $t: a } = Q(), i = s(
2745
- () => xo(o.walletBalances, o.subscriptions)
3039
+ const o = e, n = t, { $t: a } = te(), i = s(
3040
+ () => Ro(o.walletBalances, o.subscriptions)
2746
3041
  ), l = s(
2747
3042
  () => {
2748
- var x;
2749
- return (x = o.paymentMethods) == null ? void 0 : x.filter((w) => mo(w));
3043
+ var E;
3044
+ return (E = o.paymentMethods) == null ? void 0 : E.filter((y) => fo(y));
2750
3045
  }
2751
- ), r = I(), f = s(
2752
- () => Qe(i.value, r.value)
2753
- ), T = s(() => !!f.value), M = I(), S = s(() => !!M.value), p = s(
2754
- () => Qe(i.value, M.value)
2755
- ), b = I(), P = s(() => !!b.value);
2756
- return (x, w) => (_(), Y(Te, null, [
2757
- e.isLoading ? (_(), E(st, ie({
3046
+ ), r = $(), h = s(
3047
+ () => Je(i.value, r.value)
3048
+ ), w = s(() => !!h.value), A = $(), C = s(() => !!A.value), c = s(
3049
+ () => Je(i.value, A.value)
3050
+ ), T = $(), S = s(() => !!T.value);
3051
+ return (E, y) => (f(), z(he, null, [
3052
+ e.isLoading ? (f(), U(rt, ae({
2758
3053
  key: 0,
2759
3054
  variant: "section"
2760
- }, x.$attrs, { class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48" }), null, 16)) : e.hasError ? (_(), E(u(me), ie({ key: 1 }, x.$attrs, {
3055
+ }, E.$attrs, { class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48" }), null, 16)) : e.hasError ? (f(), U(u(ye), ae({ key: 1 }, E.$attrs, {
2761
3056
  class: "sv-wallet-balances sv-root sv-component sv-error",
2762
3057
  title: u(a)({
2763
3058
  defaultMessage: "Could not load wallet balances",
2764
3059
  description: "Error shown when wallet balances fail to load",
2765
3060
  id: "wallet_balance.load_failed"
2766
3061
  })
2767
- }), null, 16, ["title"])) : e.walletBalances.length > 0 ? (_(), E(u(Co), ie({ key: 2 }, x.$attrs, {
3062
+ }), null, 16, ["title"])) : e.walletBalances.length > 0 ? (f(), U(u(Do), ae({ key: 2 }, E.$attrs, {
2768
3063
  class: "sv-wallet-balances sv-root sv-component",
2769
3064
  "customer-wallet-balances": i.value,
2770
3065
  "show-auto-top-up": e.showTopUpButton,
@@ -2777,52 +3072,53 @@ const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
2777
3072
  },
2778
3073
  { count: String(e.walletBalances.length) }
2779
3074
  ),
2780
- onTopUp: w[0] || (w[0] = ($) => r.value = $),
2781
- onAutoTopUp: w[1] || (w[1] = ($) => M.value = $),
2782
- onCancelAutoTopUp: w[2] || (w[2] = ($) => b.value = $)
2783
- }), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) : R("", !0),
2784
- e.showTopUpButton ? (_(), E(gn, {
3075
+ onTopUp: y[0] || (y[0] = (B) => r.value = B),
3076
+ onAutoTopUp: y[1] || (y[1] = (B) => A.value = B),
3077
+ onCancelAutoTopUp: y[2] || (y[2] = (B) => T.value = B)
3078
+ }), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) : q("", !0),
3079
+ e.showTopUpButton ? (f(), U(Sn, {
2785
3080
  key: 3,
2786
- "show-modal": T.value,
2787
- "selected-balance-item": f.value,
3081
+ "show-modal": w.value,
3082
+ "selected-balance-item": h.value,
2788
3083
  "payment-methods": l.value,
2789
3084
  customer: e.customer,
2790
3085
  subscriptions: e.subscriptions,
2791
- onClose: w[3] || (w[3] = ($) => r.value = void 0),
2792
- onConfirm: w[4] || (w[4] = ($) => n("top-up-charged")),
2793
- onAutoTopUpSaved: w[5] || (w[5] = ($) => n("auto-top-up-saved")),
2794
- onPaymentSuccess: w[6] || (w[6] = ($) => n("payment-method-stored")),
2795
- onPaymentFailed: w[7] || (w[7] = ($) => n("payment-failed", $))
2796
- }, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : R("", !0),
2797
- e.showTopUpButton ? (_(), E(wn, {
3086
+ onClose: y[3] || (y[3] = (B) => r.value = void 0),
3087
+ onConfirm: y[4] || (y[4] = (B) => n("top-up-charged")),
3088
+ onAutoTopUpSaved: y[5] || (y[5] = (B) => n("auto-top-up-saved")),
3089
+ onPaymentSuccess: y[6] || (y[6] = (B) => n("payment-method-stored")),
3090
+ onPaymentFailed: y[7] || (y[7] = (B) => n("payment-failed", B))
3091
+ }, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : q("", !0),
3092
+ e.showTopUpButton ? (f(), U($n, {
2798
3093
  key: 4,
2799
- "show-modal": S.value,
2800
- "wallet-balance-item": p.value,
2801
- "top-up-item": M.value,
3094
+ "show-modal": C.value,
3095
+ "wallet-balance-item": c.value,
3096
+ "top-up-item": A.value,
2802
3097
  "payment-methods": l.value,
2803
3098
  customer: e.customer,
2804
- onClose: w[8] || (w[8] = ($) => M.value = void 0),
2805
- onSaved: w[9] || (w[9] = ($) => n("auto-top-up-saved")),
2806
- onPaymentSuccess: w[10] || (w[10] = ($) => n("payment-method-stored")),
2807
- onPaymentFailed: w[11] || (w[11] = ($) => n("payment-failed", $))
2808
- }, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : R("", !0),
2809
- e.showTopUpButton ? (_(), E(Un, {
3099
+ subscriptions: e.subscriptions,
3100
+ onClose: y[8] || (y[8] = (B) => A.value = void 0),
3101
+ onSaved: y[9] || (y[9] = (B) => n("auto-top-up-saved")),
3102
+ onPaymentSuccess: y[10] || (y[10] = (B) => n("payment-method-stored")),
3103
+ onPaymentFailed: y[11] || (y[11] = (B) => n("payment-failed", B))
3104
+ }, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer", "subscriptions"])) : q("", !0),
3105
+ e.showTopUpButton ? (f(), U(In, {
2810
3106
  key: 5,
2811
- "show-modal": P.value,
2812
- config: b.value,
2813
- onClose: w[12] || (w[12] = ($) => b.value = void 0),
2814
- onConfirmed: w[13] || (w[13] = ($) => n("auto-top-up-cancelled"))
2815
- }, null, 8, ["show-modal", "config"])) : R("", !0)
3107
+ "show-modal": S.value,
3108
+ config: T.value,
3109
+ onClose: y[12] || (y[12] = (B) => T.value = void 0),
3110
+ onConfirmed: y[13] || (y[13] = (B) => n("auto-top-up-cancelled"))
3111
+ }, null, 8, ["show-modal", "config"])) : q("", !0)
2816
3112
  ], 64));
2817
3113
  }
2818
3114
  });
2819
3115
  export {
2820
- pn as _,
3116
+ Tn as _,
2821
3117
  It as a,
2822
- ia as b,
2823
- na as c,
2824
- zo as d,
2825
- mn as g,
2826
- aa as i,
2827
- Nt as u
3118
+ fa as b,
3119
+ ma as c,
3120
+ on as d,
3121
+ Mn as g,
3122
+ va as i,
3123
+ Ft as u
2828
3124
  };