@solvimon/solvimon-web 0.1.0-alpha.28 → 0.1.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/{Alert.vue.es-lIiAWf2S.mjs → Alert.vue.es-CNrEaLvh.mjs} +58 -46
- package/dist/AuthProvider.handle-DKfNs8rr.mjs +50 -0
- package/dist/{Avatar.vue.es-Beg7umjO.mjs → Avatar.vue.es-r0NbcIib.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DBGe1PvD.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-Cp4yGqaw.mjs} +8 -8
- package/dist/{Button.vue.es-rh6mITmN.mjs → Button.vue.es-Zw--kuaU.mjs} +4 -4
- package/dist/{ChargeOnDemandModal-CPjPa_uq.mjs → ChargeOnDemandModal-B8FDkS9U.mjs} +35 -34
- package/dist/Checkout.entry.ce-DsGl-5aR.mjs +4202 -0
- package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs +828 -0
- package/dist/{Chip.vue.es-Cn2R_0mE.mjs → Chip.vue.es-D3UDSyXC.mjs} +3 -3
- package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +32 -0
- package/dist/{ContextMenu.vue.es-DRxsa7bZ.mjs → ContextMenu.vue.es-B9mFpUQK.mjs} +87 -88
- package/dist/{CustomerBillingInformation.vue.es-DQfL5RMR.mjs → CustomerBillingInformation.vue.es-B8NiQaJs.mjs} +3 -3
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Ct-eYaEN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DBivC5Eb.mjs} +21 -20
- package/dist/CustomerShippingAddresses-Bj8Y17O8.mjs +397 -0
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BzTSwo4i.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BmPKfIjT.mjs} +798 -792
- package/dist/{DividerText.vue.es-M0XqSz55.mjs → DividerText.vue.es-CNbgif-3.mjs} +1 -1
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs +55 -0
- package/dist/{ErrorNotification.vue.es-CKlt4hr2.mjs → ErrorNotification.vue.es-DNd65mQq.mjs} +2 -2
- package/dist/FormMessage.vue.es-Cjv358Ab.mjs +39 -0
- package/dist/{IconButton.vue.es-oe4MVBK1.mjs → IconButton.vue.es-C8lYFx5_.mjs} +2 -2
- package/dist/{IconTitle.vue.es-BO6KBS4v.mjs → IconTitle.vue.es-O2kcqgKm.mjs} +3 -3
- package/dist/{Input.vue.es-DAlPmtE_.mjs → Input.vue.es-D8Oj8MWv.mjs} +23 -22
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CCTl5GWa.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-rhqYVdfV.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DMGqj_Uk.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-06R-M8Q3.mjs} +4 -4
- package/dist/InvoicePreview.vue.es-4Q2hzaFS.mjs +286 -0
- package/dist/InvoicePricingClauseChip.vue.es-DKU0xu0t.mjs +124 -0
- package/dist/Label.vue.es-DtpLM1KH.mjs +113 -0
- package/dist/{Modal.vue.es-CTNACAst.mjs → Modal.vue.es-C8ZcO117.mjs} +109 -103
- package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs +441 -0
- package/dist/PaymentCompletedCard.vue_vue_type_script_setup_true_lang-DfTb9psX.mjs +48 -0
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DLfAfB_m.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BoGTtg5G.mjs} +46 -88
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CKm-XYuF.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-BmA8jbMb.mjs → PaymentHistoryBlock-BvY2nXGV.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BDMse2lO.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-bQKhUonq.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-D1Xw-xIt.mjs → PaymentIntegrationForm-CcfQSzKM.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCxw0PCv.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvzcLJVq.mjs} +68 -69
- package/dist/{PaymentIntegrationFormAdyen-CfT5aD4L.mjs → PaymentIntegrationFormAdyen-DqgDfO6K.mjs} +126 -117
- package/dist/{PaymentIntegrationFormStripe-DKXJ-mjd.mjs → PaymentIntegrationFormStripe-BYdAkvLt.mjs} +193 -179
- package/dist/{PaymentMethod.vue.es-Cauxx4Xr.mjs → PaymentMethod.vue.es-b0p3a0L-.mjs} +7 -7
- package/dist/{PaymentMethodForm-CypZOYUZ.mjs → PaymentMethodForm-BsTrTwCg.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-De8FgdYD.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-sUOmLORl.mjs} +7 -7
- package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Dw28tfpD.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs} +36 -35
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-OtjVO7lR.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CSW4LfmH.mjs} +7 -7
- package/dist/{PlanCustomizationEditor-Xtww2r9K.mjs → PlanCustomizationEditor-D29N4HUM.mjs} +9 -9
- package/dist/PortalLinkUnverified-B_EE2wTJ.mjs +52 -0
- package/dist/{PortalNotAvailable-B_59GUwN.mjs → PortalNotAvailable-DPE9y37H.mjs} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-C9LJW3b8.mjs → PricingGroupRangeInput.vue.es-tIMXIhpZ.mjs} +14 -13
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DdWxoB8q.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DqxWxSQe.mjs} +32 -32
- package/dist/RadioGroupExtended.vue.es-3nDXqIGi.mjs +176 -0
- package/dist/{Section.vue.es-iS8hVGWA.mjs → Section.vue.es-CvX9tg2f.mjs} +1 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs +60 -0
- package/dist/ShippingAddressesModal-C4p1IXXk.mjs +418 -0
- package/dist/{StepInput.vue.es-Dpan1RQd.mjs → StepInput.vue.es-DweyzpkL.mjs} +4 -4
- package/dist/{SubscriptionDetails.entry.ce-DufQX3uI.mjs → SubscriptionDetails.entry.ce-D5SwM0YS.mjs} +230 -225
- package/dist/{SubscriptionSchedules-DAahcNoI.mjs → SubscriptionSchedules-BZqlpAtk.mjs} +1 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BH7DdOWK.mjs +5185 -0
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-Wmjqy7RZ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs} +3 -3
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BeRLuEyR.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BbjdBHSQ.mjs} +23 -22
- package/dist/TooltipParagraph.vue.es-Dw0ndjle.mjs +132 -0
- package/dist/TranslationOverride.vue_vue_type_script_setup_true_lang-BhjZVMSx.mjs +31 -0
- package/dist/{TrialChip.vue.es-B-XBSHWE.mjs → TrialChip.vue.es-DOopmaXA.mjs} +2 -2
- package/dist/{api.es-QaC926Xu.mjs → api.es-qgvzNMU-.mjs} +2 -2
- package/dist/{cn.es-2bVdkiFV.mjs → cn.es-B8acFrov.mjs} +380 -476
- package/dist/components/BillingInformation/BillingInformation.mjs +9 -7
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +57 -54
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +20 -18
- package/dist/components/Invoice/Invoice.mjs +2660 -193
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +6 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +18 -17
- package/dist/components/InvoicesList/InvoicesList.mjs +13 -11
- package/dist/components/PaymentHistory/PaymentHistory.mjs +8 -6
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +19 -17
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +19 -17
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +20 -18
- package/dist/components/WalletBalances/WalletBalances.mjs +17 -15
- package/dist/customElements-BTj4ii4f.mjs +5072 -0
- package/dist/{customer-CqddTiOr.mjs → customer-BIjC0CWJ.mjs} +1 -1
- package/dist/customer.es-DQKl6wFt.mjs +24 -0
- package/dist/{de-DE-BW8dMvhW.mjs → de-DE-DBbERiFr.mjs} +38 -0
- package/dist/{de-DE-BNMj3boy.mjs → de-DE-UJ6X6jXu.mjs} +1 -1
- package/dist/floating-ui.vue.es-BvAf8-si.mjs +1003 -0
- package/dist/{formControl-CsITfsBk.mjs → formControl-BZQLHnOO.mjs} +5 -5
- package/dist/fr-FR-Cvvbkwlj.mjs +307 -0
- package/dist/fr-FR-IWJE-urI.mjs +431 -0
- package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +4 -0
- package/dist/{index.es-CXkP_k3u.mjs → index.es-C7J3WGGo.mjs} +4 -4
- package/dist/index.es-CpmQmvOg.mjs +633 -0
- package/dist/index.mjs +2 -2
- package/dist/{invoices-Cf1qDAv4.mjs → invoices-e1sKLgxg.mjs} +3 -3
- package/dist/{it-IT-Byg06KWc.mjs → it-IT-B7ui2oxO.mjs} +38 -0
- package/dist/{it-IT-DRvuxM1F.mjs → it-IT-DnJP5URH.mjs} +1 -1
- package/dist/{nl-NL-x3zQqzZ7.mjs → nl-NL-Bafh2xoT.mjs} +38 -0
- package/dist/{nl-NL-DLUwWbMG.mjs → nl-NL-q9xfTZF0.mjs} +1 -1
- package/dist/{paymentMethods-BUuOmDq9.mjs → paymentMethods-B_82JGk_.mjs} +2 -2
- package/dist/paymentMethods-Nfv9HdkS.mjs +61 -0
- package/dist/{paymentOutcome-D17VD4MV.mjs → paymentOutcome-BXEU5-84.mjs} +5 -5
- package/dist/payments-BnxbzQUC.mjs +68 -0
- package/dist/pricing-BOhvWWMj.mjs +29 -0
- package/dist/{pricingPlanScheduleOverrides-COr9F8DO.mjs → pricingPlanScheduleOverrides-Dxv5FOBd.mjs} +2 -2
- package/dist/{pricingPlanSchedules-BK_o9p6h.mjs → pricingPlanSchedules-Dv7ZCgNp.mjs} +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +128 -83
- package/dist/screens/PayInvoice/PayInvoice.mjs +572 -218
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +21 -19
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +261 -266
- package/dist/{sorting.es-qtEN8J8T.mjs → sorting.es-CVyKw23D.mjs} +1 -1
- package/dist/subscriptions-BWXZGK0E.mjs +66 -0
- package/dist/taxId.es-DkD3Ltr8.mjs +243 -0
- package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -0
- package/dist/types/components/customer/ShippingAddressForm/ShippingAddressForm.types.d.ts +9 -0
- package/dist/types/components/customer/ShippingAddresses/ShippingAddressCard.types.d.ts +11 -0
- package/dist/types/components/customer/ShippingAddresses/ShippingAddressList.types.d.ts +9 -0
- package/dist/types/components/customer/ShippingAddresses/ShippingAddressesModal.types.d.ts +26 -0
- package/dist/types/components/invoices/InvoiceOrderSummary/InvoiceOrderSummary.types.d.ts +5 -0
- package/dist/types/components/payments/PayButton/PayButton.types.d.ts +2 -0
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +11 -0
- package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +4 -1
- package/dist/types/components/providers/AuthProvider/AuthProvider.handle.d.ts +17 -0
- package/dist/types/components/providers/AuthProvider/AuthProvider.lib.d.ts +23 -1
- package/dist/types/components/providers/AuthProvider/AuthProvider.types.d.ts +12 -0
- package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +3 -1
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
- package/dist/types/components/providers/Provider/Provider.types.d.ts +1 -1
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -1
- package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +16 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +2 -0
- package/dist/types/public/components/CustomerShippingAddresses/CustomerShippingAddresses.types.d.ts +12 -0
- package/dist/types/public/core/types.d.ts +5 -0
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +3 -1
- package/dist/types/translations/supported.d.ts +1 -1
- package/dist/types/types/portalAuthentication.d.ts +2 -0
- package/dist/types/types/portalToken.d.ts +9 -0
- package/dist/types/types/shippingAddress.d.ts +9 -0
- package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalRequests.d.ts +27 -6
- package/dist/types/vendor/@solvimon/solvimon-types/types/ConfigMeterProperties.d.ts +3 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Entitlement.d.ts +6 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Integrations.d.ts +9 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +16 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/JWT.d.ts +10 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/MeterPropertyVariable.d.ts +16 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +6 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +12 -3
- package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +71 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +14 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +1 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteVersions.d.ts +35 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Quotes.d.ts +16 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ShippingAddress.d.ts +54 -0
- package/dist/{useActionDispatchProvider-DC_fUykI.mjs → useActionDispatchProvider-3W2vEyIg.mjs} +1 -1
- package/dist/{useCustomer-C3kTh7wn.mjs → useCustomer-cObBvDOu.mjs} +2 -2
- package/dist/useCustomerFormLabels-DJWf2O17.mjs +1173 -0
- package/dist/{useIncrementalLoading-C_sHmW7d.mjs → useIncrementalLoading-CATuO36d.mjs} +2 -2
- package/dist/{useInvoiceData-BIh8-h8b.mjs → useInvoiceData-DD44HTl7.mjs} +2 -2
- package/dist/{useInvoicesList-Y6p0Pqpy.mjs → useInvoicesList-CpB-41MQ.mjs} +10 -10
- package/dist/useLazyFloating.es-CycqRyeb.mjs +68 -0
- package/dist/useLoadInitialData-qzdnBoui.mjs +15 -0
- package/dist/{usePaymentFormHold-FfNc578l.mjs → usePaymentFormHold-ByUZi3A-.mjs} +28 -36
- package/dist/{usePaymentMethodAvailability-CnYTvG15.mjs → usePaymentMethodAvailability-DUdrs0Ji.mjs} +4 -4
- package/dist/usePaymentMethods-ByaKF7mf.mjs +21 -0
- package/dist/{usePayments-CykCZPG2.mjs → usePayments-BXABv-lF.mjs} +9 -9
- package/dist/{usePortal-CxzKGhbK.mjs → usePortal-CwR_FxTb.mjs} +1 -1
- package/dist/{useService-B0OQJmif.mjs → useService-BZcbUZHI.mjs} +3 -3
- package/dist/{useTimePeriod.es-JkXdHNWr.mjs → useTimePeriod.es-BpdiVwg8.mjs} +1 -1
- package/package.json +7 -7
- package/dist/Checkbox.vue.es-DsyiJ-VY.mjs +0 -50
- package/dist/Checkout.entry.ce-BZ1rYQvt.mjs +0 -5279
- package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +0 -38
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-Bk4zwyWa.mjs +0 -362
- package/dist/FormMessage.vue.es-jG3fQZms.mjs +0 -29
- package/dist/InvoiceSummary.vue.es-DbNoGfYN.mjs +0 -2596
- package/dist/RadioGroupExtended.vue.es-UtKsdmiv.mjs +0 -163
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Djc1SkEU.mjs +0 -688
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DNr1CqVj.mjs +0 -5221
- package/dist/TooltipParagraph.vue.es-BjCn2BF6.mjs +0 -129
- package/dist/customElements-Di3zwlEU.mjs +0 -6447
- package/dist/customer.es-B5ppZf0j.mjs +0 -20
- package/dist/floating-ui.vue.es-CYt0fSY7.mjs +0 -1108
- package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +0 -4
- package/dist/payments-Ci8bF4C6.mjs +0 -45
- package/dist/subscriptions-CwogJODR.mjs +0 -54
- package/dist/useCustomerFormLabels-CK7K50nB.mjs +0 -1369
- package/dist/useLoadInitialData-4k_Cyqef.mjs +0 -15
- package/dist/usePaymentMethodOptions-1QBcmgUf.mjs +0 -40
- package/dist/usePaymentMethods-gvr-rmwE.mjs +0 -15
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { u as Xt } from "./useService-
|
|
5
|
-
import { _ as me } from "./ErrorNotification.vue.es-
|
|
1
|
+
import { defineComponent as H, ref as O, onMounted as Lt, onBeforeUnmount as Oe, computed as l, openBlock as b, createBlock as E, withCtx as _, createElementVNode as R, toDisplayString as k, createVNode as C, createTextVNode as V, createElementBlock as L, unref as r, createCommentVNode as N, renderSlot as ue, createSlots as re, Fragment as we, renderList as Me, toRaw as We, watch as Q, normalizeClass as $e, useModel as Yt, isRef as Ht, mergeProps as ae, mergeModels as Wt, reactive as Ie, withModifiers as ze, defineAsyncComponent as zt, normalizeStyle as je } from "vue";
|
|
2
|
+
import { a as jt } from "./api.es-qgvzNMU-.mjs";
|
|
3
|
+
import { a as G, d as ee, c as ot, u as nt, b as ye, E as Qt, e as Ae, o as Gt, f as Kt } from "./customElements-BTj4ii4f.mjs";
|
|
4
|
+
import { u as Xt } from "./useService-BZcbUZHI.mjs";
|
|
5
|
+
import { _ as me } from "./ErrorNotification.vue.es-DNd65mQq.mjs";
|
|
6
6
|
import { i as Jt, a as Ce, h as Zt } from "./pricingItemConfigs.es-D3pX_9AJ.mjs";
|
|
7
7
|
import { b as Be } from "./wallets.es-eH2C2ygn.mjs";
|
|
8
|
-
import { _ as ie, a as eo } from "./Button.vue.es-
|
|
9
|
-
import { _ as at, T as it, a as st } from "./TooltipParagraph.vue.es-
|
|
10
|
-
import { _ as be } from "./Section.vue.es-
|
|
8
|
+
import { _ as ie, a as eo } from "./Button.vue.es-Zw--kuaU.mjs";
|
|
9
|
+
import { _ as at, T as it, a as st } from "./TooltipParagraph.vue.es-Dw0ndjle.mjs";
|
|
10
|
+
import { _ as be } from "./Section.vue.es-CvX9tg2f.mjs";
|
|
11
11
|
import { _ as lt } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
|
|
12
|
-
import { _ as ut } from "./RadioGroupExtended.vue.es-
|
|
12
|
+
import { _ as ut } from "./RadioGroupExtended.vue.es-3nDXqIGi.mjs";
|
|
13
13
|
import { g as to } from "./subscription-BhxoqwcT.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { d as oo, u as De, c as J, r as rt, b as dt } from "./formControl-BZQLHnOO.mjs";
|
|
15
15
|
import { f as Ne } from "./formatting.es-RclXHhKo.mjs";
|
|
16
16
|
import { _ as no } from "./Divider.vue.es-DnP_HqLz.mjs";
|
|
17
17
|
import { _ as ct } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import { _ as ao } from "./
|
|
20
|
-
import { c as mt } from "./invoices-
|
|
21
|
-
import { u as io, _ as so, a as lo } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { _ as uo } from "./Input.vue.es-
|
|
18
|
+
import { _ as pt } from "./InvoicePreview.vue.es-4Q2hzaFS.mjs";
|
|
19
|
+
import { _ as ao } from "./Label.vue.es-DtpLM1KH.mjs";
|
|
20
|
+
import { c as mt } from "./invoices-e1sKLgxg.mjs";
|
|
21
|
+
import { u as io, _ as so, a as lo } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs";
|
|
22
|
+
import { _ as uo } from "./Input.vue.es-D8Oj8MWv.mjs";
|
|
23
23
|
import { g as ro } from "./amount-CondixVt.mjs";
|
|
24
|
-
import { _ as vt } from "./PaymentMethodSelector.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { g as co } from "./customer.es-
|
|
26
|
-
import { u as po } from "./
|
|
27
|
-
import { M as ft } from "./Modal.vue.es-
|
|
28
|
-
import { _ as
|
|
29
|
-
const
|
|
24
|
+
import { _ as vt } from "./PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs";
|
|
25
|
+
import { g as co } from "./customer.es-DQKl6wFt.mjs";
|
|
26
|
+
import { u as po, a as mo } from "./paymentMethods-Nfv9HdkS.mjs";
|
|
27
|
+
import { M as ft } from "./Modal.vue.es-C8ZcO117.mjs";
|
|
28
|
+
import { _ as vo } from "./Alert.vue.es-CNrEaLvh.mjs";
|
|
29
|
+
const fo = 3e4, Se = 60, Pe = 12, ho = /* @__PURE__ */ H({
|
|
30
30
|
__name: "DateTimeAgo",
|
|
31
31
|
props: {
|
|
32
32
|
date: {},
|
|
33
33
|
actionVerb: {}
|
|
34
34
|
},
|
|
35
35
|
setup(e) {
|
|
36
|
-
const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } =
|
|
36
|
+
const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } = G(), u = O(Date.now());
|
|
37
37
|
let s;
|
|
38
38
|
Lt(() => {
|
|
39
39
|
s = setInterval(() => {
|
|
40
|
-
|
|
41
|
-
},
|
|
40
|
+
u.value = Date.now();
|
|
41
|
+
}, fo);
|
|
42
42
|
}), Oe(() => {
|
|
43
43
|
clearInterval(s);
|
|
44
44
|
});
|
|
45
|
-
const m = (c,
|
|
46
|
-
const P = (
|
|
47
|
-
return
|
|
48
|
-
}, h =
|
|
49
|
-
const c = Math.max(0, (
|
|
45
|
+
const m = (c, y) => {
|
|
46
|
+
const P = (y.getFullYear() - c.getFullYear()) * Pe + (y.getMonth() - c.getMonth());
|
|
47
|
+
return y.getDate() < c.getDate() ? P - 1 : P;
|
|
48
|
+
}, h = l(() => {
|
|
49
|
+
const c = Math.max(0, (u.value - n.date.getTime()) / 1e3);
|
|
50
50
|
if (c < Se)
|
|
51
51
|
return a(
|
|
52
52
|
{
|
|
@@ -74,8 +74,8 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
74
74
|
},
|
|
75
75
|
{ count: Math.trunc(c / t) }
|
|
76
76
|
);
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
77
|
+
const y = m(n.date, new Date(u.value));
|
|
78
|
+
if (y < 1) {
|
|
79
79
|
const P = Math.trunc(c / o);
|
|
80
80
|
return P === 1 ? a({
|
|
81
81
|
defaultMessage: "yesterday",
|
|
@@ -90,33 +90,33 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
90
90
|
{ count: P }
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return y < Pe ? a(
|
|
94
94
|
{
|
|
95
95
|
defaultMessage: "{count, plural, one {# month} other {# months}} ago",
|
|
96
96
|
id: "dateTimeAgo.months",
|
|
97
97
|
description: "Relative time in whole months"
|
|
98
98
|
},
|
|
99
|
-
{ count:
|
|
99
|
+
{ count: y }
|
|
100
100
|
) : a(
|
|
101
101
|
{
|
|
102
102
|
defaultMessage: "{count, plural, one {# year} other {# years}} ago",
|
|
103
103
|
id: "dateTimeAgo.years",
|
|
104
104
|
description: "Relative time in whole years"
|
|
105
105
|
},
|
|
106
|
-
{ count: Math.trunc(
|
|
106
|
+
{ count: Math.trunc(y / Pe) }
|
|
107
107
|
);
|
|
108
|
-
}),
|
|
108
|
+
}), T = l(
|
|
109
109
|
() => n.actionVerb ? `${n.actionVerb} ${h.value}` : h.value
|
|
110
|
-
), A =
|
|
110
|
+
), A = l(
|
|
111
111
|
() => i({ date: n.date, format: "dateTime", offsetType: "local" })
|
|
112
112
|
);
|
|
113
|
-
return (c,
|
|
114
|
-
tooltip:
|
|
115
|
-
|
|
116
|
-
default:
|
|
117
|
-
|
|
118
|
-
default:
|
|
119
|
-
|
|
113
|
+
return (c, y) => (b(), E(at, null, {
|
|
114
|
+
tooltip: _(() => [
|
|
115
|
+
C(it, null, {
|
|
116
|
+
default: _(() => [
|
|
117
|
+
C(st, null, {
|
|
118
|
+
default: _(() => [
|
|
119
|
+
V(k(A.value), 1)
|
|
120
120
|
]),
|
|
121
121
|
_: 1
|
|
122
122
|
})
|
|
@@ -124,79 +124,79 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
124
124
|
_: 1
|
|
125
125
|
})
|
|
126
126
|
]),
|
|
127
|
-
default:
|
|
128
|
-
|
|
127
|
+
default: _(() => [
|
|
128
|
+
R("span", null, k(T.value), 1)
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
131
|
}));
|
|
132
132
|
}
|
|
133
|
-
}),
|
|
134
|
-
const { $t: t, formatNumber: o } =
|
|
133
|
+
}), go = (e) => {
|
|
134
|
+
const { $t: t, formatNumber: o } = G(), n = (g) => Be(t, o, g), a = l(
|
|
135
135
|
() => {
|
|
136
|
-
var
|
|
137
|
-
return ((p = (
|
|
136
|
+
var g, p;
|
|
137
|
+
return ((p = (g = e.walletBalance.wallet) == null ? void 0 : g.wallet_type) == null ? void 0 : p.name) || t({
|
|
138
138
|
defaultMessage: "Balance",
|
|
139
139
|
id: "wallet_balance.balance_label",
|
|
140
140
|
description: "Label shown above a wallet's balance amount"
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
), i = (
|
|
143
|
+
), i = (g) => {
|
|
144
144
|
var p;
|
|
145
|
-
return (((p =
|
|
146
|
-
},
|
|
145
|
+
return (((p = g.pricing_item) == null ? void 0 : p.configs) ?? []).filter((S) => !!S.on_demand);
|
|
146
|
+
}, u = l(
|
|
147
147
|
() => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
|
|
148
|
-
(
|
|
148
|
+
(g) => i(g).some(
|
|
149
149
|
(p) => Jt(p) || Ce(p)
|
|
150
150
|
)
|
|
151
151
|
)
|
|
152
|
-
), s =
|
|
153
|
-
() =>
|
|
154
|
-
(
|
|
152
|
+
), s = l(
|
|
153
|
+
() => u.value.find(
|
|
154
|
+
(g) => i(g).some((p) => Ce(p))
|
|
155
155
|
)
|
|
156
|
-
), m =
|
|
157
|
-
() => !!e.showManualTopUp &&
|
|
158
|
-
), h =
|
|
156
|
+
), m = l(
|
|
157
|
+
() => !!e.showManualTopUp && u.value.length > 0
|
|
158
|
+
), h = l(() => !!e.showAutoTopUp && !!s.value), T = l(
|
|
159
159
|
() => {
|
|
160
|
-
var
|
|
161
|
-
return (p = (
|
|
160
|
+
var g, p;
|
|
161
|
+
return (p = (g = e.walletBalance.wallet) == null ? void 0 : g.auto_top_up_configs) == null ? void 0 : p.find(
|
|
162
162
|
(S) => S.status === "ACTIVE"
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
|
-
), A =
|
|
165
|
+
), A = l(
|
|
166
166
|
() => {
|
|
167
|
-
var
|
|
168
|
-
return (p = (
|
|
167
|
+
var g, p;
|
|
168
|
+
return (p = (g = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : g.credits) == null ? void 0 : p.credit_type;
|
|
169
169
|
}
|
|
170
|
-
), c = (
|
|
170
|
+
), c = (g, p) => n({
|
|
171
171
|
credits: {
|
|
172
|
-
quantity:
|
|
172
|
+
quantity: g,
|
|
173
173
|
credit_type_id: p,
|
|
174
174
|
credit_type: A.value
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
177
|
-
var
|
|
178
|
-
const S = (
|
|
176
|
+
}), y = (g) => g.amount ? n({ amount: g.amount }) : g.credits ? c(g.credits.quantity, g.credits.credit_type_id) : "", P = l(() => {
|
|
177
|
+
var g, p;
|
|
178
|
+
const S = (g = T.value) == null ? void 0 : g.pricing_item_id;
|
|
179
179
|
if (!S)
|
|
180
180
|
return;
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
}),
|
|
184
|
-
var
|
|
185
|
-
const S = (
|
|
186
|
-
if (!S || !
|
|
181
|
+
const B = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((U) => U.pricing_item_id === S).flatMap((U) => i(U)).flatMap((U) => U.wallet_grants ?? []), f = (p = e.walletBalance.wallet) == null ? void 0 : p.wallet_type_id;
|
|
182
|
+
return B.find((U) => U.wallet_type_id === f) ?? B[0];
|
|
183
|
+
}), x = l(() => {
|
|
184
|
+
var g, p;
|
|
185
|
+
const S = (g = T.value) == null ? void 0 : g.topup_amount, B = (p = P.value) == null ? void 0 : p.credits_grant;
|
|
186
|
+
if (!S || !B)
|
|
187
187
|
return "";
|
|
188
|
-
if (
|
|
188
|
+
if (B.credits)
|
|
189
189
|
return c(
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
B.credits.quantity,
|
|
191
|
+
B.credits.credit_type_id
|
|
192
192
|
);
|
|
193
|
-
if (
|
|
194
|
-
const f = Number(S.quantity) * Number(
|
|
195
|
-
return c(String(f),
|
|
193
|
+
if (B.conversion) {
|
|
194
|
+
const f = Number(S.quantity) * Number(B.conversion.rate);
|
|
195
|
+
return c(String(f), B.conversion.credit_type_id);
|
|
196
196
|
}
|
|
197
197
|
return "";
|
|
198
|
-
}),
|
|
199
|
-
() =>
|
|
198
|
+
}), M = l(
|
|
199
|
+
() => T.value ? t({
|
|
200
200
|
defaultMessage: "Auto top-up enabled",
|
|
201
201
|
id: "wallet_balance.auto_top_up_enabled_label",
|
|
202
202
|
description: "Label shown when a wallet tops itself up automatically"
|
|
@@ -205,26 +205,26 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
205
205
|
id: "wallet_balance.auto_top_up_disabled_label",
|
|
206
206
|
description: "Label shown when a wallet has no automatic top-up configured"
|
|
207
207
|
})
|
|
208
|
-
),
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
208
|
+
), $ = l(() => {
|
|
209
|
+
const g = T.value;
|
|
210
|
+
if (!g)
|
|
211
211
|
return t({
|
|
212
212
|
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.",
|
|
213
213
|
id: "wallet_balance.auto_top_up_setup_explanation",
|
|
214
214
|
description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
|
|
215
215
|
});
|
|
216
|
-
const p =
|
|
216
|
+
const p = g.topup_amount ? n({ amount: g.topup_amount }) : "", S = y(g.threshold);
|
|
217
217
|
return !p || !S ? t({
|
|
218
218
|
defaultMessage: "Your balance is topped up automatically once it runs low.",
|
|
219
219
|
id: "wallet_balance.auto_top_up_generic_explanation",
|
|
220
220
|
description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
|
|
221
|
-
}) :
|
|
221
|
+
}) : x.value ? t(
|
|
222
222
|
{
|
|
223
223
|
defaultMessage: "Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",
|
|
224
224
|
id: "wallet_balance.auto_top_up_credits_explanation",
|
|
225
225
|
description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
|
|
226
226
|
},
|
|
227
|
-
{ topUpCredits:
|
|
227
|
+
{ topUpCredits: x.value, topUpAmount: p, threshold: S }
|
|
228
228
|
) : t(
|
|
229
229
|
{
|
|
230
230
|
defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
|
|
@@ -237,18 +237,18 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
237
237
|
return {
|
|
238
238
|
walletName: a,
|
|
239
239
|
formatBalance: n,
|
|
240
|
-
manualTopUpItems:
|
|
240
|
+
manualTopUpItems: u,
|
|
241
241
|
flexibleManualTopUpItem: s,
|
|
242
242
|
showManualTopUp: m,
|
|
243
243
|
showAutoTopUp: h,
|
|
244
|
-
activeTopUpConfig:
|
|
245
|
-
autoTopUpLabel:
|
|
246
|
-
autoTopUpExplanation:
|
|
244
|
+
activeTopUpConfig: T,
|
|
245
|
+
autoTopUpLabel: M,
|
|
246
|
+
autoTopUpExplanation: $
|
|
247
247
|
};
|
|
248
|
-
},
|
|
248
|
+
}, _o = { class: "flex flex-col gap-3 py-3" }, yo = { class: "flex flex-col gap-1 px-4" }, bo = { class: "flex w-full justify-between gap-3" }, wo = { class: "flex w-full items-center gap-4" }, To = { key: 0 }, Mo = {
|
|
249
249
|
key: 1,
|
|
250
250
|
class: "flex w-full justify-between gap-3 px-4"
|
|
251
|
-
},
|
|
251
|
+
}, Ao = { class: "flex min-w-0 items-center gap-1" }, Uo = { class: "flex min-w-0 items-center gap-1" }, So = { class: "shrink-0" }, Po = /* @__PURE__ */ H({
|
|
252
252
|
__name: "WalletBalancesItem",
|
|
253
253
|
props: {
|
|
254
254
|
walletBalance: {},
|
|
@@ -257,92 +257,92 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
257
257
|
},
|
|
258
258
|
emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
|
|
259
259
|
setup(e) {
|
|
260
|
-
const t = e, { $t: o } =
|
|
260
|
+
const t = e, { $t: o } = G(), {
|
|
261
261
|
walletName: n,
|
|
262
262
|
formatBalance: a,
|
|
263
263
|
manualTopUpItems: i,
|
|
264
|
-
flexibleManualTopUpItem:
|
|
264
|
+
flexibleManualTopUpItem: u,
|
|
265
265
|
showManualTopUp: s,
|
|
266
266
|
showAutoTopUp: m,
|
|
267
267
|
activeTopUpConfig: h,
|
|
268
|
-
autoTopUpLabel:
|
|
268
|
+
autoTopUpLabel: T,
|
|
269
269
|
autoTopUpExplanation: A
|
|
270
|
-
} =
|
|
271
|
-
return (c,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
} = go(t);
|
|
271
|
+
return (c, y) => (b(), L("div", _o, [
|
|
272
|
+
R("div", yo, [
|
|
273
|
+
R("div", bo, [
|
|
274
|
+
C(ee, {
|
|
275
275
|
variant: "body-xs",
|
|
276
276
|
color: "subtle",
|
|
277
277
|
"no-spacing": ""
|
|
278
278
|
}, {
|
|
279
|
-
default:
|
|
280
|
-
|
|
279
|
+
default: _(() => [
|
|
280
|
+
V(k(r(n)), 1)
|
|
281
281
|
]),
|
|
282
282
|
_: 1
|
|
283
283
|
}),
|
|
284
|
-
|
|
284
|
+
C(ee, {
|
|
285
285
|
variant: "body-xs",
|
|
286
286
|
color: "subtle",
|
|
287
287
|
"no-spacing": ""
|
|
288
288
|
}, {
|
|
289
|
-
default:
|
|
290
|
-
var P,
|
|
289
|
+
default: _(() => {
|
|
290
|
+
var P, x;
|
|
291
291
|
return [
|
|
292
|
-
(P = e.walletBalance.wallet_balance) != null && P.balance_at ? (b(),
|
|
292
|
+
(P = e.walletBalance.wallet_balance) != null && P.balance_at ? (b(), E(ho, {
|
|
293
293
|
key: 0,
|
|
294
|
-
date: new Date((
|
|
294
|
+
date: new Date((x = e.walletBalance.wallet_balance) == null ? void 0 : x.balance_at),
|
|
295
295
|
"action-verb": r(o)({
|
|
296
296
|
defaultMessage: "updated",
|
|
297
297
|
id: "wallet_balance.updated_action_verb",
|
|
298
298
|
description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
|
|
299
299
|
})
|
|
300
|
-
}, null, 8, ["date", "action-verb"])) :
|
|
300
|
+
}, null, 8, ["date", "action-verb"])) : N("", !0)
|
|
301
301
|
];
|
|
302
302
|
}),
|
|
303
303
|
_: 1
|
|
304
304
|
})
|
|
305
305
|
]),
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
R("div", wo, [
|
|
307
|
+
C(ee, {
|
|
308
308
|
variant: "body-lg",
|
|
309
309
|
weight: "semibold",
|
|
310
310
|
"no-spacing": "",
|
|
311
311
|
class: "grow"
|
|
312
312
|
}, {
|
|
313
|
-
default:
|
|
314
|
-
|
|
313
|
+
default: _(() => [
|
|
314
|
+
V(k(r(a)(t.walletBalance.wallet_balance.open_balance)), 1)
|
|
315
315
|
]),
|
|
316
316
|
_: 1
|
|
317
317
|
}),
|
|
318
|
-
r(s) ? (b(),
|
|
318
|
+
r(s) ? (b(), E(r(ie), {
|
|
319
319
|
key: 0,
|
|
320
320
|
size: "xs",
|
|
321
|
-
onClick:
|
|
321
|
+
onClick: y[0] || (y[0] = (P) => c.$emit("top-up", r(i)[0]))
|
|
322
322
|
}, {
|
|
323
|
-
default:
|
|
324
|
-
|
|
323
|
+
default: _(() => [
|
|
324
|
+
V(k(r(o)({
|
|
325
325
|
defaultMessage: "Top up",
|
|
326
326
|
id: "v1V8kA",
|
|
327
327
|
description: "Button to top up a wallet balance"
|
|
328
328
|
})), 1)
|
|
329
329
|
]),
|
|
330
330
|
_: 1
|
|
331
|
-
})) :
|
|
331
|
+
})) : N("", !0)
|
|
332
332
|
])
|
|
333
333
|
]),
|
|
334
|
-
c.$slots.graph ? (b(),
|
|
334
|
+
c.$slots.graph ? (b(), L("div", To, [
|
|
335
335
|
ue(c.$slots, "graph")
|
|
336
|
-
])) :
|
|
337
|
-
r(m) ? (b(),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
tooltip:
|
|
341
|
-
|
|
342
|
-
default:
|
|
343
|
-
|
|
344
|
-
default:
|
|
345
|
-
|
|
336
|
+
])) : N("", !0),
|
|
337
|
+
r(m) ? (b(), L("div", Mo, [
|
|
338
|
+
R("div", Ao, [
|
|
339
|
+
C(at, { class: "min-w-0" }, {
|
|
340
|
+
tooltip: _(() => [
|
|
341
|
+
C(it, null, {
|
|
342
|
+
default: _(() => [
|
|
343
|
+
C(st, null, {
|
|
344
|
+
default: _(() => [
|
|
345
|
+
V(k(r(A)), 1)
|
|
346
346
|
]),
|
|
347
347
|
_: 1
|
|
348
348
|
})
|
|
@@ -350,20 +350,20 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
350
350
|
_: 1
|
|
351
351
|
})
|
|
352
352
|
]),
|
|
353
|
-
default:
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
default: _(() => [
|
|
354
|
+
R("div", Uo, [
|
|
355
|
+
C(ee, {
|
|
356
356
|
variant: "body-sm",
|
|
357
357
|
color: "secondary",
|
|
358
358
|
"no-spacing": "",
|
|
359
359
|
class: "truncate"
|
|
360
360
|
}, {
|
|
361
|
-
default:
|
|
362
|
-
|
|
361
|
+
default: _(() => [
|
|
362
|
+
V(k(r(T)), 1)
|
|
363
363
|
]),
|
|
364
364
|
_: 1
|
|
365
365
|
}),
|
|
366
|
-
|
|
366
|
+
C(eo, {
|
|
367
367
|
icon: "info",
|
|
368
368
|
size: "2xs",
|
|
369
369
|
class: "shrink-0 cursor-help text-gray-400"
|
|
@@ -373,29 +373,29 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
373
373
|
_: 1
|
|
374
374
|
})
|
|
375
375
|
]),
|
|
376
|
-
|
|
377
|
-
r(h) ? (b(),
|
|
376
|
+
R("div", So, [
|
|
377
|
+
r(h) ? (b(), E(r(ie), {
|
|
378
378
|
key: 0,
|
|
379
379
|
size: "xs",
|
|
380
380
|
intent: "secondary",
|
|
381
|
-
onClick:
|
|
381
|
+
onClick: y[1] || (y[1] = (P) => c.$emit("cancel-auto-top-up", r(h)))
|
|
382
382
|
}, {
|
|
383
|
-
default:
|
|
384
|
-
|
|
383
|
+
default: _(() => [
|
|
384
|
+
V(k(r(o)({
|
|
385
385
|
defaultMessage: "Disable",
|
|
386
386
|
id: "wallet_balance.auto_top_up_disable_button",
|
|
387
387
|
description: "Button to turn off a wallet's automatic top-up"
|
|
388
388
|
})), 1)
|
|
389
389
|
]),
|
|
390
390
|
_: 1
|
|
391
|
-
})) : (b(),
|
|
391
|
+
})) : (b(), E(r(ie), {
|
|
392
392
|
key: 1,
|
|
393
393
|
size: "xs",
|
|
394
394
|
intent: "secondary",
|
|
395
|
-
onClick:
|
|
395
|
+
onClick: y[2] || (y[2] = (P) => c.$emit("auto-top-up", r(u)))
|
|
396
396
|
}, {
|
|
397
|
-
default:
|
|
398
|
-
|
|
397
|
+
default: _(() => [
|
|
398
|
+
V(k(r(o)({
|
|
399
399
|
defaultMessage: "Enable",
|
|
400
400
|
id: "wallet_balance.auto_top_up_enable_button",
|
|
401
401
|
description: "Button to set up a wallet's automatic top-up"
|
|
@@ -404,10 +404,10 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
404
404
|
_: 1
|
|
405
405
|
}))
|
|
406
406
|
])
|
|
407
|
-
])) :
|
|
407
|
+
])) : N("", !0)
|
|
408
408
|
]));
|
|
409
409
|
}
|
|
410
|
-
}),
|
|
410
|
+
}), Co = { class: "flex flex-col gap-2" }, Eo = /* @__PURE__ */ H({
|
|
411
411
|
__name: "WalletBalances",
|
|
412
412
|
props: {
|
|
413
413
|
customerWalletBalances: {},
|
|
@@ -417,19 +417,19 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
417
417
|
},
|
|
418
418
|
emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
|
|
419
419
|
setup(e) {
|
|
420
|
-
return (t, o) => (b(),
|
|
420
|
+
return (t, o) => (b(), E(be, {
|
|
421
421
|
"no-spacing": "",
|
|
422
422
|
"no-border": "",
|
|
423
423
|
title: e.title
|
|
424
424
|
}, re({
|
|
425
|
-
default:
|
|
426
|
-
|
|
427
|
-
(b(!0),
|
|
425
|
+
default: _(() => [
|
|
426
|
+
R("div", Co, [
|
|
427
|
+
(b(!0), L(we, null, Me(e.customerWalletBalances, (n) => (b(), E(be, {
|
|
428
428
|
key: n.wallet_id,
|
|
429
429
|
"no-spacing": ""
|
|
430
430
|
}, {
|
|
431
|
-
default:
|
|
432
|
-
|
|
431
|
+
default: _(() => [
|
|
432
|
+
C(Po, {
|
|
433
433
|
"wallet-balance": n,
|
|
434
434
|
"show-auto-top-up": e.showAutoTopUp,
|
|
435
435
|
"show-manual-top-up": e.showManualTopUp,
|
|
@@ -446,7 +446,7 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
446
446
|
}, [
|
|
447
447
|
t.$slots["heading-right"] ? {
|
|
448
448
|
name: "right",
|
|
449
|
-
fn:
|
|
449
|
+
fn: _(() => [
|
|
450
450
|
ue(t.$slots, "heading-right")
|
|
451
451
|
]),
|
|
452
452
|
key: "0"
|
|
@@ -454,7 +454,7 @@ const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ Y({
|
|
|
454
454
|
]), 1032, ["title"]));
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
|
-
function
|
|
457
|
+
function xo() {
|
|
458
458
|
const e = ot(), t = nt();
|
|
459
459
|
async function o(n) {
|
|
460
460
|
return e({
|
|
@@ -475,13 +475,13 @@ function Eo() {
|
|
|
475
475
|
getCustomerWalletBalances: o
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
const { getCustomerWalletBalances: t } =
|
|
478
|
+
function ta({ customerId: e }) {
|
|
479
|
+
const { getCustomerWalletBalances: t } = xo(), { data: o, execute: n, apiStatus: a, error: i, isPending: u } = Xt({
|
|
480
480
|
service: () => t(e)
|
|
481
481
|
});
|
|
482
|
-
return { walletBalances:
|
|
482
|
+
return { walletBalances: l(
|
|
483
483
|
() => o.value ?? null
|
|
484
|
-
), apiStatus: a, error: i, fetch: n, isPending:
|
|
484
|
+
), apiStatus: a, error: i, fetch: n, isPending: u };
|
|
485
485
|
}
|
|
486
486
|
const Qe = (e = [], t) => {
|
|
487
487
|
if (!(t != null && t.pricing_item_id))
|
|
@@ -494,7 +494,7 @@ const Qe = (e = [], t) => {
|
|
|
494
494
|
({ pricing_item_id: i }) => i === t.pricing_item_id
|
|
495
495
|
)
|
|
496
496
|
);
|
|
497
|
-
},
|
|
497
|
+
}, Oo = (e, t) => {
|
|
498
498
|
const o = new Set(
|
|
499
499
|
(t ?? []).flatMap(
|
|
500
500
|
({ pricing_plan_schedule_infos: n }) => (n ?? []).map(({ id: a }) => a)
|
|
@@ -506,28 +506,28 @@ const Qe = (e = [], t) => {
|
|
|
506
506
|
({ pricing_plan_schedule_id: a }) => !!a && o.has(a)
|
|
507
507
|
)
|
|
508
508
|
}));
|
|
509
|
-
},
|
|
509
|
+
}, $o = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], Re = (e) => typeof e == "object" && e !== null && "pricing_item" in e, Io = (e) => [
|
|
510
510
|
...new Set(
|
|
511
511
|
((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
|
|
512
512
|
(t) => Re(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
|
|
513
513
|
)
|
|
514
514
|
)
|
|
515
|
-
],
|
|
516
|
-
const o = new Set(
|
|
515
|
+
], Bo = (e, t) => {
|
|
516
|
+
const o = new Set(Io(e));
|
|
517
517
|
return t.flatMap((n) => {
|
|
518
518
|
var i;
|
|
519
519
|
const a = (n.pricing_plan_schedule_infos ?? []).filter(
|
|
520
|
-
({ id:
|
|
520
|
+
({ id: u }) => o.has(u)
|
|
521
521
|
);
|
|
522
522
|
return a.length === 0 ? [] : [
|
|
523
523
|
{
|
|
524
524
|
id: n.id,
|
|
525
525
|
name: n.name || n.reference || ((i = to(n)) == null ? void 0 : i.name) || void 0,
|
|
526
|
-
scheduleIds: a.map(({ id:
|
|
526
|
+
scheduleIds: a.map(({ id: u }) => u),
|
|
527
527
|
enabledPricingIds: a.flatMap(
|
|
528
|
-
(
|
|
528
|
+
(u) => {
|
|
529
529
|
var s;
|
|
530
|
-
return (((s =
|
|
530
|
+
return (((s = u.pricing_plan_schedule) == null ? void 0 : s.enabled_pricings) ?? []).flatMap(
|
|
531
531
|
({ pricing_id: m }) => m ? [m] : []
|
|
532
532
|
);
|
|
533
533
|
}
|
|
@@ -535,7 +535,7 @@ const Qe = (e = [], t) => {
|
|
|
535
535
|
}
|
|
536
536
|
];
|
|
537
537
|
});
|
|
538
|
-
},
|
|
538
|
+
}, Do = (e, t) => {
|
|
539
539
|
if (!e || t.length === 0)
|
|
540
540
|
return e;
|
|
541
541
|
const o = new Set(t);
|
|
@@ -551,26 +551,26 @@ const Qe = (e = [], t) => {
|
|
|
551
551
|
return [];
|
|
552
552
|
const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
|
|
553
553
|
return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
|
|
554
|
-
const
|
|
554
|
+
const u = Fo(i, e), s = No(i, e);
|
|
555
555
|
return {
|
|
556
556
|
pricingItemId: o,
|
|
557
557
|
...t.pricing_plan_schedule_id && {
|
|
558
558
|
pricingPlanScheduleId: t.pricing_plan_schedule_id
|
|
559
559
|
},
|
|
560
560
|
config: i,
|
|
561
|
-
...
|
|
561
|
+
...u && { flexiblePricing: u },
|
|
562
562
|
...s && { fixedPricing: s }
|
|
563
563
|
};
|
|
564
564
|
}) : [];
|
|
565
565
|
});
|
|
566
|
-
function
|
|
567
|
-
var i,
|
|
566
|
+
function No(e, t) {
|
|
567
|
+
var i, u, s;
|
|
568
568
|
if (!e.on_demand || !Zt(e, ["FIXED"]))
|
|
569
569
|
return;
|
|
570
|
-
const o = (s = (
|
|
570
|
+
const o = (s = (u = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : u[0]) == null ? void 0 : s.fixed_amount;
|
|
571
571
|
if (!o)
|
|
572
572
|
return;
|
|
573
|
-
const n = gt(t), a = n ?
|
|
573
|
+
const n = gt(t), a = n ? ko(e, t) : void 0;
|
|
574
574
|
return {
|
|
575
575
|
amount: o,
|
|
576
576
|
value: a && n ? ke(a.quantity, n) : { amount: o }
|
|
@@ -585,30 +585,30 @@ const gt = (e) => {
|
|
|
585
585
|
return (e.wallet_grants ?? []).filter(
|
|
586
586
|
({ wallet_type_id: a }) => !o || a === o
|
|
587
587
|
);
|
|
588
|
-
},
|
|
588
|
+
}, Ro = (e, t) => {
|
|
589
589
|
var o, n;
|
|
590
590
|
return (n = (o = _t(e, t).find(
|
|
591
591
|
({ credits_grant: a }) => a == null ? void 0 : a.conversion
|
|
592
592
|
)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
|
|
593
|
-
},
|
|
593
|
+
}, ko = (e, t) => {
|
|
594
594
|
var o, n;
|
|
595
595
|
return (n = (o = _t(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
|
|
596
596
|
}, ke = (e, t) => ({ credits: { ...t, quantity: e } }), yt = (e, t) => {
|
|
597
597
|
const o = Number(e), n = Number(t);
|
|
598
598
|
return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
|
|
599
599
|
};
|
|
600
|
-
function
|
|
601
|
-
var m, h,
|
|
600
|
+
function Fo(e, t) {
|
|
601
|
+
var m, h, T, A, c, y, P;
|
|
602
602
|
if (!e.on_demand || !Ce(e))
|
|
603
603
|
return;
|
|
604
|
-
const o = (h = (m = e.details) == null ? void 0 : m.bands) == null ? void 0 : h[0], n = ((
|
|
604
|
+
const o = (h = (m = e.details) == null ? void 0 : m.bands) == null ? void 0 : h[0], n = ((T = o == null ? void 0 : o.minimum_amount) == null ? void 0 : T.currency) ?? ((A = o == null ? void 0 : o.maximum_amount) == null ? void 0 : A.currency) ?? ((y = (c = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : c.amount) == null ? void 0 : y.currency);
|
|
605
605
|
if (!n)
|
|
606
606
|
return;
|
|
607
|
-
const a = gt(t), i = a ?
|
|
608
|
-
if (!
|
|
607
|
+
const a = gt(t), i = a ? Ro(e, t) : void 0, u = (P = a == null ? void 0 : a.credit_type) == null ? void 0 : P.unit_name, s = (x) => {
|
|
608
|
+
if (!x)
|
|
609
609
|
return;
|
|
610
|
-
const
|
|
611
|
-
return
|
|
610
|
+
const M = a && i ? yt(x.quantity, i.rate) : void 0;
|
|
611
|
+
return M !== void 0 && a ? ke(M, a) : { amount: x };
|
|
612
612
|
};
|
|
613
613
|
return {
|
|
614
614
|
config: {
|
|
@@ -619,8 +619,8 @@ function ko(e, t) {
|
|
|
619
619
|
...i && {
|
|
620
620
|
creditsConfiguration: {
|
|
621
621
|
conversionRate: i.rate,
|
|
622
|
-
...(
|
|
623
|
-
...(
|
|
622
|
+
...(u == null ? void 0 : u.singular) && { unitNameSingle: u.singular },
|
|
623
|
+
...(u == null ? void 0 : u.plural) && { unitNamePlural: u.plural }
|
|
624
624
|
}
|
|
625
625
|
},
|
|
626
626
|
bounds: {
|
|
@@ -632,10 +632,10 @@ function ko(e, t) {
|
|
|
632
632
|
const Fe = ({ fixedPricing: e, flexiblePricing: t }) => {
|
|
633
633
|
var o;
|
|
634
634
|
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);
|
|
635
|
-
},
|
|
635
|
+
}, qo = (e) => {
|
|
636
636
|
var t;
|
|
637
637
|
return !!Fe(e) || !!((t = e.flexiblePricing) != null && t.creditsConfiguration);
|
|
638
|
-
},
|
|
638
|
+
}, Vo = (e) => {
|
|
639
639
|
var t;
|
|
640
640
|
return (t = e.map(Fe).find((o) => o == null ? void 0 : o.credit_type_id)) == null ? void 0 : t.credit_type_id;
|
|
641
641
|
}, bt = (e = []) => {
|
|
@@ -647,56 +647,56 @@ const Fe = ({ fixedPricing: e, flexiblePricing: t }) => {
|
|
|
647
647
|
}, wt = (e = []) => {
|
|
648
648
|
var t, o, n;
|
|
649
649
|
return (n = (o = (t = e.map(Fe).find((a) => {
|
|
650
|
-
var i,
|
|
651
|
-
return (
|
|
650
|
+
var i, u;
|
|
651
|
+
return (u = (i = a == null ? void 0 : a.credit_type) == null ? void 0 : i.unit_name) == null ? void 0 : u.plural;
|
|
652
652
|
})) == null ? void 0 : t.credit_type) == null ? void 0 : o.unit_name) == null ? void 0 : n.plural;
|
|
653
|
-
},
|
|
653
|
+
}, Lo = (e = []) => {
|
|
654
654
|
var t;
|
|
655
655
|
for (const { flexiblePricing: o } of e) {
|
|
656
656
|
const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
|
|
657
657
|
if (n)
|
|
658
658
|
return n;
|
|
659
659
|
}
|
|
660
|
-
},
|
|
660
|
+
}, Yo = (e = []) => {
|
|
661
661
|
for (const { flexiblePricing: t } of e) {
|
|
662
662
|
const { minimum_amount: o, maximum_amount: n } = (t == null ? void 0 : t.config) ?? {};
|
|
663
663
|
if (o || n)
|
|
664
664
|
return { ...o && { minimum: o }, ...n && { maximum: n } };
|
|
665
665
|
}
|
|
666
666
|
return {};
|
|
667
|
-
},
|
|
668
|
-
if (e.some(
|
|
669
|
-
const o =
|
|
667
|
+
}, Ho = (e = []) => {
|
|
668
|
+
if (e.some(qo)) {
|
|
669
|
+
const o = Vo(e);
|
|
670
670
|
return o ? { creditTypeId: o } : void 0;
|
|
671
671
|
}
|
|
672
672
|
const t = bt(e);
|
|
673
673
|
return t ? { currency: t } : void 0;
|
|
674
|
-
},
|
|
675
|
-
var
|
|
674
|
+
}, Wo = (e, t) => {
|
|
675
|
+
var u;
|
|
676
676
|
if (e.fixedPricing)
|
|
677
677
|
return e.fixedPricing.value;
|
|
678
678
|
if (!e.flexiblePricing || !t)
|
|
679
679
|
return;
|
|
680
|
-
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (
|
|
680
|
+
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (u = o.minimum ?? o.maximum) == null ? void 0 : u.credits, i = n ? yt(t.quantity, n.conversionRate) : void 0;
|
|
681
681
|
return a && i !== void 0 ? ke(i, a) : { amount: t };
|
|
682
682
|
}, Tt = (e = []) => {
|
|
683
|
-
const t =
|
|
683
|
+
const t = Ho(e);
|
|
684
684
|
if (t)
|
|
685
685
|
return {
|
|
686
686
|
denomination: t,
|
|
687
687
|
chargeCurrency: bt(e) ?? "",
|
|
688
688
|
creditUnitName: wt(e),
|
|
689
|
-
conversionRate:
|
|
690
|
-
topUpBounds:
|
|
689
|
+
conversionRate: Lo(e),
|
|
690
|
+
topUpBounds: Yo(e)
|
|
691
691
|
};
|
|
692
|
-
},
|
|
693
|
-
function
|
|
692
|
+
}, zo = 400;
|
|
693
|
+
function jo({
|
|
694
694
|
pricingPlanScheduleId: e,
|
|
695
695
|
pricingItems: t
|
|
696
696
|
}) {
|
|
697
|
-
const { previewChargeOnDemandPricingItems: o } = mt(), n = Ae(), a = O(), i = O(!1),
|
|
697
|
+
const { previewChargeOnDemandPricingItems: o } = mt(), n = Ae(), a = O(), i = O(!1), u = O(!1), s = l(() => i.value || u.value), m = O(!1), h = Gt(), T = async () => {
|
|
698
698
|
const A = e.value, c = h();
|
|
699
|
-
if (
|
|
699
|
+
if (u.value = !1, !A || !t.value) {
|
|
700
700
|
t.value && !A && n.warn(
|
|
701
701
|
"INVOICE_PREVIEW_SKIPPED",
|
|
702
702
|
"Skipped the on-demand charge invoice preview: no schedule to charge it on",
|
|
@@ -706,67 +706,67 @@ function zo({
|
|
|
706
706
|
}
|
|
707
707
|
i.value = !0, m.value = !1;
|
|
708
708
|
try {
|
|
709
|
-
const
|
|
709
|
+
const y = await o({
|
|
710
710
|
pricingPlanScheduleId: A,
|
|
711
711
|
pricingItems: t.value
|
|
712
712
|
});
|
|
713
|
-
c() && (a.value =
|
|
714
|
-
} catch (
|
|
713
|
+
c() && (a.value = y);
|
|
714
|
+
} catch (y) {
|
|
715
715
|
c() && (a.value = void 0, m.value = !0), n.error(
|
|
716
716
|
"INVOICE_PREVIEW_FAILED",
|
|
717
717
|
"Failed to load the invoice preview",
|
|
718
718
|
{ preview: "ON_DEMAND_CHARGE" },
|
|
719
|
-
|
|
719
|
+
y
|
|
720
720
|
);
|
|
721
721
|
} finally {
|
|
722
722
|
c() && (i.value = !1);
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
|
-
return io(t, () => void
|
|
726
|
-
debounce: () => a.value || i.value || m.value ?
|
|
725
|
+
return io(t, () => void T(), {
|
|
726
|
+
debounce: () => a.value || i.value || m.value ? zo : 0,
|
|
727
727
|
deep: !0
|
|
728
|
-
}),
|
|
728
|
+
}), Q(
|
|
729
729
|
t,
|
|
730
730
|
(A) => {
|
|
731
|
-
|
|
731
|
+
u.value = !!A, A || (h(), a.value = void 0, m.value = !1, i.value = !1);
|
|
732
732
|
},
|
|
733
733
|
{ deep: !0, flush: "sync" }
|
|
734
|
-
),
|
|
734
|
+
), T(), { invoicePreview: a, isPreviewPending: s, hasPreviewFailed: m, loadPreview: T };
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const Qo = ["aria-busy"], Mt = /* @__PURE__ */ H({
|
|
737
737
|
__name: "TopUpInvoicePreview",
|
|
738
738
|
props: {
|
|
739
739
|
pricingPlanScheduleId: { type: String },
|
|
740
740
|
pricingItems: { type: Array }
|
|
741
741
|
},
|
|
742
742
|
setup(e) {
|
|
743
|
-
const t = e, { $t: o } =
|
|
743
|
+
const t = e, { $t: o } = G(), n = l(() => t.pricingPlanScheduleId), a = l(() => t.pricingItems), { invoicePreview: i, isPreviewPending: u, hasPreviewFailed: s } = jo({
|
|
744
744
|
pricingPlanScheduleId: n,
|
|
745
745
|
pricingItems: a
|
|
746
|
-
}), m =
|
|
747
|
-
() => s.value && !
|
|
746
|
+
}), m = l(
|
|
747
|
+
() => s.value && !u.value ? o({
|
|
748
748
|
defaultMessage: "Unable to calculate the total. Please try again.",
|
|
749
749
|
description: "Shown in place of the top-up total when it failed to load",
|
|
750
750
|
id: "topup_modal.invoice_preview.error"
|
|
751
751
|
}) : void 0
|
|
752
752
|
);
|
|
753
|
-
return (h,
|
|
753
|
+
return (h, T) => m.value ? (b(), E(r(me), {
|
|
754
754
|
key: 0,
|
|
755
755
|
class: "sv-top-up-invoice-preview sv-top-up-invoice-preview--error sv-error",
|
|
756
756
|
title: m.value
|
|
757
|
-
}, null, 8, ["title"])) : (b(),
|
|
757
|
+
}, null, 8, ["title"])) : (b(), E(lt, {
|
|
758
758
|
key: 1,
|
|
759
759
|
class: "sv-top-up-invoice-preview h-[152px]"
|
|
760
760
|
}, {
|
|
761
|
-
default:
|
|
762
|
-
r(i) ? (b(),
|
|
761
|
+
default: _(() => [
|
|
762
|
+
r(i) ? (b(), L("div", {
|
|
763
763
|
key: 0,
|
|
764
|
-
class: $e({ "opacity-60": r(
|
|
765
|
-
"aria-busy": r(
|
|
764
|
+
class: $e({ "opacity-60": r(u) }),
|
|
765
|
+
"aria-busy": r(u)
|
|
766
766
|
}, [
|
|
767
|
-
|
|
768
|
-
default:
|
|
769
|
-
|
|
767
|
+
C(r(ao), { required: "" }, {
|
|
768
|
+
default: _(() => [
|
|
769
|
+
V(k(r(o)({
|
|
770
770
|
defaultMessage: "You will pay",
|
|
771
771
|
description: "Label above the preview of what topping up will be invoiced for",
|
|
772
772
|
id: "topup_modal.invoice_preview.label"
|
|
@@ -774,16 +774,16 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
774
774
|
]),
|
|
775
775
|
_: 1
|
|
776
776
|
}),
|
|
777
|
-
|
|
778
|
-
default:
|
|
779
|
-
|
|
777
|
+
C(r(be), { "content-background": "none" }, {
|
|
778
|
+
default: _(() => [
|
|
779
|
+
C(r(pt), {
|
|
780
780
|
invoice: r(i),
|
|
781
781
|
"is-customer-facing": ""
|
|
782
782
|
}, null, 8, ["invoice"])
|
|
783
783
|
]),
|
|
784
784
|
_: 1
|
|
785
785
|
})
|
|
786
|
-
], 10,
|
|
786
|
+
], 10, Qo)) : N("", !0)
|
|
787
787
|
]),
|
|
788
788
|
_: 1
|
|
789
789
|
}));
|
|
@@ -792,16 +792,16 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
792
792
|
quantity: e ?? null,
|
|
793
793
|
currency: t
|
|
794
794
|
}), Ee = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
|
|
795
|
-
var i,
|
|
795
|
+
var i, u, s, m, h;
|
|
796
796
|
return {
|
|
797
797
|
enabled: (e == null ? void 0 : e.status) === "ACTIVE",
|
|
798
798
|
threshold: Ge(
|
|
799
|
-
((
|
|
799
|
+
((u = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : u.quantity) ?? ((m = (s = e == null ? void 0 : e.threshold) == null ? void 0 : s.credits) == null ? void 0 : m.quantity),
|
|
800
800
|
At(t, n)
|
|
801
801
|
),
|
|
802
802
|
topUpAmount: Ge(((h = e == null ? void 0 : e.topup_amount) == null ? void 0 : h.quantity) ?? a, o)
|
|
803
803
|
};
|
|
804
|
-
},
|
|
804
|
+
}, Go = (e, t) => {
|
|
805
805
|
var n;
|
|
806
806
|
const o = (n = e.threshold) == null ? void 0 : n.quantity;
|
|
807
807
|
return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
|
|
@@ -813,7 +813,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
813
813
|
} : void 0;
|
|
814
814
|
}, Ut = (e, { denomination: t, chargeCurrency: o }) => ({
|
|
815
815
|
status: e.enabled ? "ACTIVE" : "INACTIVE",
|
|
816
|
-
threshold:
|
|
816
|
+
threshold: Go(e, t),
|
|
817
817
|
...Ke(e, o) && {
|
|
818
818
|
topup_amount: Ke(e, o)
|
|
819
819
|
}
|
|
@@ -830,11 +830,11 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
830
830
|
const n = se(e), a = se(o);
|
|
831
831
|
if (!(n === void 0 || a === void 0 || a <= 0))
|
|
832
832
|
return t === "CREDITS" ? n / a : n * a;
|
|
833
|
-
}, Ze = (e, t, o, n) => t === o ? se(e) : qe(e, t, n),
|
|
834
|
-
const a =
|
|
833
|
+
}, Ze = (e, t, o, n) => t === o ? se(e) : qe(e, t, n), Ko = (e, t, o) => t === "CREDITS" ? qe(e, "AMOUNT", o) : se(e), Ve = (e, t) => e.toFixed(ro(t)), et = (e, t, o) => t === "AMOUNT" ? Ve(e, o) : String(Number(e.toFixed(6))), Ct = (e, t, o, n) => {
|
|
834
|
+
const a = Ko(e == null ? void 0 : e.quantity, t, o);
|
|
835
835
|
if (a !== void 0)
|
|
836
836
|
return t === "CREDITS" ? n(a) : Ve(a, e == null ? void 0 : e.currency);
|
|
837
|
-
}, xe = /* @__PURE__ */
|
|
837
|
+
}, xe = /* @__PURE__ */ H({
|
|
838
838
|
__name: "ConvertedAmountInput",
|
|
839
839
|
props: /* @__PURE__ */ Wt({
|
|
840
840
|
unit: { type: String },
|
|
@@ -856,13 +856,13 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
856
856
|
}),
|
|
857
857
|
emits: ["update:modelValue"],
|
|
858
858
|
setup(e) {
|
|
859
|
-
const t = e, o = Yt(e, "modelValue"), { $t: n, formatNumber: a } =
|
|
859
|
+
const t = e, o = Yt(e, "modelValue"), { $t: n, formatNumber: a } = G(), i = l(() => t.entryBase ?? t.modelBase), u = l(
|
|
860
860
|
() => i.value !== t.modelBase && se(t.conversionRate) !== void 0
|
|
861
861
|
), s = O("");
|
|
862
|
-
|
|
862
|
+
Q(
|
|
863
863
|
() => [o.value, i.value, t.modelBase, t.conversionRate],
|
|
864
864
|
([p]) => {
|
|
865
|
-
if (!
|
|
865
|
+
if (!u.value) {
|
|
866
866
|
s.value = p ?? "";
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
@@ -882,22 +882,22 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
882
882
|
const S = Ze(p, i.value, t.modelBase, t.conversionRate);
|
|
883
883
|
return S === void 0 ? "" : et(S, t.modelBase, t.currency);
|
|
884
884
|
}
|
|
885
|
-
const h =
|
|
885
|
+
const h = l({
|
|
886
886
|
get: () => s.value,
|
|
887
887
|
set: (p) => {
|
|
888
|
-
s.value = oo(p), o.value =
|
|
888
|
+
s.value = oo(p), o.value = u.value ? m(s.value) : s.value;
|
|
889
889
|
}
|
|
890
|
-
}),
|
|
890
|
+
}), T = l(
|
|
891
891
|
() => qe(s.value, i.value, t.conversionRate)
|
|
892
|
-
), A =
|
|
892
|
+
), A = l(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
|
|
893
893
|
defaultMessage: "credits",
|
|
894
894
|
description: "Generic name for a wallet credit, where its credit type does not name one",
|
|
895
895
|
id: "converted_amount_input.credits"
|
|
896
|
-
})), c = (p, S) => Ne({ quantity: Ve(p, S), currency: S }),
|
|
896
|
+
})), c = (p, S) => Ne({ quantity: Ve(p, S), currency: S }), y = (p) => `${a(p)} ${A.value}`, P = l(() => {
|
|
897
897
|
const p = t.error;
|
|
898
898
|
return Array.isArray(p) ? p.length > 0 : !!(Ht(p) ? p.value : p);
|
|
899
|
-
}),
|
|
900
|
-
const p =
|
|
899
|
+
}), x = l(() => {
|
|
900
|
+
const p = T.value;
|
|
901
901
|
if (!(P.value || !t.showConversionHint || p === void 0))
|
|
902
902
|
return i.value === "CREDITS" ? t.currency ? n(
|
|
903
903
|
{
|
|
@@ -912,16 +912,16 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
912
912
|
description: "Helper text under a money field, naming the credits that amount converts into",
|
|
913
913
|
id: "converted_amount_input.buys"
|
|
914
914
|
},
|
|
915
|
-
{ credits:
|
|
915
|
+
{ credits: y(p) }
|
|
916
916
|
);
|
|
917
|
-
}),
|
|
917
|
+
}), M = (p) => Ct(p, i.value, t.conversionRate, a), $ = l(
|
|
918
918
|
() => {
|
|
919
|
-
var p, S,
|
|
920
|
-
return i.value === "CREDITS" ? A.value : ((S = (p = t.bounds) == null ? void 0 : p.minimum) == null ? void 0 : S.currency) ?? ((f = (
|
|
919
|
+
var p, S, B, f;
|
|
920
|
+
return i.value === "CREDITS" ? A.value : ((S = (p = t.bounds) == null ? void 0 : p.minimum) == null ? void 0 : S.currency) ?? ((f = (B = t.bounds) == null ? void 0 : B.maximum) == null ? void 0 : f.currency) ?? t.unit;
|
|
921
921
|
}
|
|
922
|
-
),
|
|
922
|
+
), g = l(() => {
|
|
923
923
|
var f, U;
|
|
924
|
-
const p =
|
|
924
|
+
const p = M((f = t.bounds) == null ? void 0 : f.minimum), S = M((U = t.bounds) == null ? void 0 : U.maximum), B = $.value;
|
|
925
925
|
if (p && S)
|
|
926
926
|
return n(
|
|
927
927
|
{
|
|
@@ -929,7 +929,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
929
929
|
description: "Range of what a flexible top-up may be charged for, beside its label",
|
|
930
930
|
id: "converted_amount_input.bounds.range"
|
|
931
931
|
},
|
|
932
|
-
{ minimum: p, maximum: S, unit:
|
|
932
|
+
{ minimum: p, maximum: S, unit: B }
|
|
933
933
|
);
|
|
934
934
|
if (p)
|
|
935
935
|
return n(
|
|
@@ -938,7 +938,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
938
938
|
description: "Smallest amount a flexible top-up may be charged for, beside its label",
|
|
939
939
|
id: "converted_amount_input.bounds.minimum"
|
|
940
940
|
},
|
|
941
|
-
{ minimum: p, unit:
|
|
941
|
+
{ minimum: p, unit: B }
|
|
942
942
|
);
|
|
943
943
|
if (S)
|
|
944
944
|
return n(
|
|
@@ -947,12 +947,12 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
947
947
|
description: "Largest amount a flexible top-up may be charged for, beside its label",
|
|
948
948
|
id: "converted_amount_input.bounds.maximum"
|
|
949
949
|
},
|
|
950
|
-
{ maximum: S, unit:
|
|
950
|
+
{ maximum: S, unit: B }
|
|
951
951
|
);
|
|
952
952
|
});
|
|
953
|
-
return (p, S) => (b(),
|
|
953
|
+
return (p, S) => (b(), E(r(uo), ae({
|
|
954
954
|
modelValue: h.value,
|
|
955
|
-
"onUpdate:modelValue": S[0] || (S[0] = (
|
|
955
|
+
"onUpdate:modelValue": S[0] || (S[0] = (B) => h.value = B),
|
|
956
956
|
class: "sv-converted-amount-input",
|
|
957
957
|
type: "number",
|
|
958
958
|
"as-text-type": "",
|
|
@@ -962,39 +962,39 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
962
962
|
disabled: e.disabled,
|
|
963
963
|
error: e.error
|
|
964
964
|
}, P.value ? { "aria-invalid": "true" } : {}), re({
|
|
965
|
-
suffix:
|
|
966
|
-
|
|
965
|
+
suffix: _(() => [
|
|
966
|
+
R("span", null, k(e.unit), 1)
|
|
967
967
|
]),
|
|
968
968
|
_: 2
|
|
969
969
|
}, [
|
|
970
|
-
|
|
970
|
+
g.value ? {
|
|
971
971
|
name: "label-suffix",
|
|
972
|
-
fn:
|
|
973
|
-
|
|
972
|
+
fn: _(() => [
|
|
973
|
+
C(r(ee), {
|
|
974
974
|
tag: "span",
|
|
975
975
|
variant: "body-xs",
|
|
976
976
|
color: "subtle",
|
|
977
977
|
"no-spacing": ""
|
|
978
978
|
}, {
|
|
979
|
-
default:
|
|
980
|
-
|
|
979
|
+
default: _(() => [
|
|
980
|
+
V(k(g.value), 1)
|
|
981
981
|
]),
|
|
982
982
|
_: 1
|
|
983
983
|
})
|
|
984
984
|
]),
|
|
985
985
|
key: "0"
|
|
986
986
|
} : void 0,
|
|
987
|
-
|
|
987
|
+
x.value ? {
|
|
988
988
|
name: "helper",
|
|
989
|
-
fn:
|
|
990
|
-
|
|
989
|
+
fn: _(() => [
|
|
990
|
+
C(r(ee), {
|
|
991
991
|
tag: "span",
|
|
992
992
|
variant: "body-xs",
|
|
993
993
|
color: "subtle",
|
|
994
994
|
"no-spacing": ""
|
|
995
995
|
}, {
|
|
996
|
-
default:
|
|
997
|
-
|
|
996
|
+
default: _(() => [
|
|
997
|
+
V(k(x.value), 1)
|
|
998
998
|
]),
|
|
999
999
|
_: 1
|
|
1000
1000
|
})
|
|
@@ -1003,7 +1003,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1003
1003
|
} : void 0
|
|
1004
1004
|
]), 1040, ["modelValue", "name", "label", "required", "disabled", "error"]));
|
|
1005
1005
|
}
|
|
1006
|
-
}),
|
|
1006
|
+
}), Xo = /* @__PURE__ */ H({
|
|
1007
1007
|
__name: "Section",
|
|
1008
1008
|
props: {
|
|
1009
1009
|
emphasized: { type: Boolean, default: !1 },
|
|
@@ -1019,31 +1019,31 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1019
1019
|
"sv-section__accent relative",
|
|
1020
1020
|
"before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5",
|
|
1021
1021
|
"before:rounded-full before:bg-primary-600"
|
|
1022
|
-
].join(" "), n =
|
|
1022
|
+
].join(" "), n = l(
|
|
1023
1023
|
() => [t.emphasized ? o : void 0, t.contentClasses].filter(Boolean).join(" ")
|
|
1024
|
-
), a =
|
|
1025
|
-
const { emphasized: i, ...
|
|
1026
|
-
return
|
|
1024
|
+
), a = l(() => {
|
|
1025
|
+
const { emphasized: i, ...u } = t;
|
|
1026
|
+
return u;
|
|
1027
1027
|
});
|
|
1028
|
-
return (i,
|
|
1028
|
+
return (i, u) => (b(), E(r(be), ae(a.value, {
|
|
1029
1029
|
class: "sv-section",
|
|
1030
1030
|
"content-classes": n.value
|
|
1031
1031
|
}), re({
|
|
1032
|
-
default:
|
|
1032
|
+
default: _(() => [
|
|
1033
1033
|
ue(i.$slots, "default")
|
|
1034
1034
|
]),
|
|
1035
1035
|
_: 2
|
|
1036
1036
|
}, [
|
|
1037
1037
|
i.$slots.right ? {
|
|
1038
1038
|
name: "right",
|
|
1039
|
-
fn:
|
|
1039
|
+
fn: _(() => [
|
|
1040
1040
|
ue(i.$slots, "right")
|
|
1041
1041
|
]),
|
|
1042
1042
|
key: "0"
|
|
1043
1043
|
} : void 0
|
|
1044
1044
|
]), 1040, ["content-classes"]));
|
|
1045
1045
|
}
|
|
1046
|
-
}),
|
|
1046
|
+
}), Jo = { class: "flex grow flex-col" }, Et = /* @__PURE__ */ H({
|
|
1047
1047
|
__name: "AutoTopUpConfig",
|
|
1048
1048
|
props: {
|
|
1049
1049
|
config: { type: Object },
|
|
@@ -1058,7 +1058,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1058
1058
|
disabled: { type: Boolean }
|
|
1059
1059
|
},
|
|
1060
1060
|
setup(e, { expose: t }) {
|
|
1061
|
-
const o = e, { $t: n, formatNumber: a } =
|
|
1061
|
+
const o = e, { $t: n, formatNumber: a } = G(), i = l(() => {
|
|
1062
1062
|
var f, U;
|
|
1063
1063
|
return {
|
|
1064
1064
|
denomination: o.denomination,
|
|
@@ -1066,55 +1066,55 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1066
1066
|
creditUnitName: o.creditUnitName,
|
|
1067
1067
|
minimumTopUp: (U = (f = o.topUpBounds) == null ? void 0 : f.minimum) == null ? void 0 : U.quantity
|
|
1068
1068
|
};
|
|
1069
|
-
}),
|
|
1069
|
+
}), u = O(Ee(o.config, i.value)), s = l(() => At(o.denomination, o.creditUnitName)), m = l(
|
|
1070
1070
|
() => o.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
|
|
1071
|
-
), h =
|
|
1071
|
+
), h = l(
|
|
1072
1072
|
() => m.value === "CREDITS" ? s.value : o.chargeCurrency
|
|
1073
|
-
),
|
|
1073
|
+
), T = l({
|
|
1074
1074
|
get: () => {
|
|
1075
1075
|
var f;
|
|
1076
|
-
return ((f =
|
|
1076
|
+
return ((f = u.value.threshold) == null ? void 0 : f.quantity) ?? "";
|
|
1077
1077
|
},
|
|
1078
1078
|
set: (f) => {
|
|
1079
|
-
|
|
1079
|
+
u.value.threshold = { quantity: f || null, currency: s.value };
|
|
1080
1080
|
}
|
|
1081
|
-
}), A =
|
|
1081
|
+
}), A = l({
|
|
1082
1082
|
get: () => {
|
|
1083
1083
|
var f;
|
|
1084
|
-
return ((f =
|
|
1084
|
+
return ((f = u.value.topUpAmount) == null ? void 0 : f.quantity) ?? "";
|
|
1085
1085
|
},
|
|
1086
1086
|
set: (f) => {
|
|
1087
|
-
|
|
1087
|
+
u.value.topUpAmount = { quantity: f || null, currency: o.chargeCurrency };
|
|
1088
1088
|
}
|
|
1089
1089
|
});
|
|
1090
|
-
|
|
1090
|
+
Q(
|
|
1091
1091
|
() => [o.config, i.value],
|
|
1092
1092
|
([f, U]) => {
|
|
1093
|
-
Je(Xe(f, U), P()) || (
|
|
1093
|
+
Je(Xe(f, U), P()) || (u.value = Ee(f, U));
|
|
1094
1094
|
}
|
|
1095
1095
|
);
|
|
1096
|
-
const c =
|
|
1097
|
-
get: () => o.alwaysEnabled ||
|
|
1096
|
+
const c = l({
|
|
1097
|
+
get: () => o.alwaysEnabled || u.value.enabled,
|
|
1098
1098
|
set: (f) => {
|
|
1099
|
-
|
|
1099
|
+
u.value.enabled = f;
|
|
1100
1100
|
}
|
|
1101
|
-
}),
|
|
1102
|
-
() => Ut({ ...
|
|
1103
|
-
), P = () =>
|
|
1104
|
-
threshold:
|
|
1101
|
+
}), y = l(
|
|
1102
|
+
() => Ut({ ...u.value, enabled: c.value }, i.value)
|
|
1103
|
+
), P = () => y.value, x = Ie({
|
|
1104
|
+
threshold: l(() => {
|
|
1105
1105
|
var f;
|
|
1106
|
-
return se((f =
|
|
1106
|
+
return se((f = u.value.threshold) == null ? void 0 : f.quantity) ?? null;
|
|
1107
1107
|
}),
|
|
1108
|
-
topUpAmount:
|
|
1108
|
+
topUpAmount: l(() => {
|
|
1109
1109
|
var f;
|
|
1110
|
-
return se((f =
|
|
1110
|
+
return se((f = u.value.topUpAmount) == null ? void 0 : f.quantity) ?? null;
|
|
1111
1111
|
})
|
|
1112
|
-
}),
|
|
1112
|
+
}), M = (f) => {
|
|
1113
1113
|
if (!f)
|
|
1114
1114
|
return "";
|
|
1115
1115
|
const U = Ct(f, m.value, o.conversionRate, a);
|
|
1116
1116
|
return U === void 0 ? Ne(f) : `${U} ${h.value}`;
|
|
1117
|
-
},
|
|
1117
|
+
}, $ = rt(() => c.value), g = (f) => (U) => !c.value || f(U), p = De(
|
|
1118
1118
|
{
|
|
1119
1119
|
threshold: {
|
|
1120
1120
|
required: J.withMessage(
|
|
@@ -1123,7 +1123,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1123
1123
|
description: "Error shown under the auto top-up threshold when it is left empty",
|
|
1124
1124
|
id: "auto_topup_config.threshold.required"
|
|
1125
1125
|
}),
|
|
1126
|
-
|
|
1126
|
+
$
|
|
1127
1127
|
),
|
|
1128
1128
|
notNegative: J.withMessage(
|
|
1129
1129
|
() => n({
|
|
@@ -1131,7 +1131,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1131
1131
|
description: "Error shown under the auto top-up threshold when it is below zero",
|
|
1132
1132
|
id: "auto_topup_config.threshold.not_negative"
|
|
1133
1133
|
}),
|
|
1134
|
-
|
|
1134
|
+
g((f) => f === null || f >= 0)
|
|
1135
1135
|
)
|
|
1136
1136
|
},
|
|
1137
1137
|
topUpAmount: {
|
|
@@ -1141,7 +1141,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1141
1141
|
description: "Error shown under the auto top-up amount when it is left empty",
|
|
1142
1142
|
id: "auto_topup_config.amount.required"
|
|
1143
1143
|
}),
|
|
1144
|
-
|
|
1144
|
+
$
|
|
1145
1145
|
),
|
|
1146
1146
|
positive: J.withMessage(
|
|
1147
1147
|
() => n({
|
|
@@ -1149,7 +1149,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1149
1149
|
description: "Error shown under the auto top-up amount when it is zero or negative",
|
|
1150
1150
|
id: "auto_topup_config.amount.positive"
|
|
1151
1151
|
}),
|
|
1152
|
-
|
|
1152
|
+
g((f) => f === null || f > 0)
|
|
1153
1153
|
),
|
|
1154
1154
|
atLeastMinimum: J.withMessage(
|
|
1155
1155
|
() => {
|
|
@@ -1160,10 +1160,10 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1160
1160
|
description: "Error shown under the auto top-up amount when it is below what the pricing allows",
|
|
1161
1161
|
id: "auto_topup_config.amount.at_least_minimum"
|
|
1162
1162
|
},
|
|
1163
|
-
{ minimum:
|
|
1163
|
+
{ minimum: M((f = o.topUpBounds) == null ? void 0 : f.minimum) }
|
|
1164
1164
|
);
|
|
1165
1165
|
},
|
|
1166
|
-
|
|
1166
|
+
g((f) => {
|
|
1167
1167
|
var U;
|
|
1168
1168
|
return St(f, (U = o.topUpBounds) == null ? void 0 : U.minimum);
|
|
1169
1169
|
})
|
|
@@ -1177,39 +1177,39 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1177
1177
|
description: "Error shown under the auto top-up amount when it is above what the pricing allows",
|
|
1178
1178
|
id: "auto_topup_config.amount.within_maximum"
|
|
1179
1179
|
},
|
|
1180
|
-
{ maximum:
|
|
1180
|
+
{ maximum: M((f = o.topUpBounds) == null ? void 0 : f.maximum) }
|
|
1181
1181
|
);
|
|
1182
1182
|
},
|
|
1183
|
-
|
|
1183
|
+
g((f) => {
|
|
1184
1184
|
var U;
|
|
1185
1185
|
return Pt(f, (U = o.topUpBounds) == null ? void 0 : U.maximum);
|
|
1186
1186
|
})
|
|
1187
1187
|
)
|
|
1188
1188
|
}
|
|
1189
1189
|
},
|
|
1190
|
-
|
|
1191
|
-
), S =
|
|
1190
|
+
x
|
|
1191
|
+
), S = l(
|
|
1192
1192
|
() => !Je(
|
|
1193
1193
|
P(),
|
|
1194
1194
|
Xe(o.config, i.value)
|
|
1195
1195
|
)
|
|
1196
1196
|
);
|
|
1197
|
-
function
|
|
1197
|
+
function B() {
|
|
1198
1198
|
return p.value.$touch(), p.value.$invalid ? void 0 : P();
|
|
1199
1199
|
}
|
|
1200
1200
|
return t({
|
|
1201
|
-
validate:
|
|
1202
|
-
rule:
|
|
1201
|
+
validate: B,
|
|
1202
|
+
rule: y,
|
|
1203
1203
|
hasChanges: S,
|
|
1204
|
-
isInvalid:
|
|
1205
|
-
}), (f, U) => (b(),
|
|
1204
|
+
isInvalid: l(() => p.value.$invalid)
|
|
1205
|
+
}), (f, U) => (b(), E(Xo, {
|
|
1206
1206
|
class: "sv-auto-topup-config",
|
|
1207
1207
|
"content-background": e.contained ? "gray" : "none",
|
|
1208
1208
|
"no-spacing": !e.contained,
|
|
1209
1209
|
"no-border": !e.contained
|
|
1210
1210
|
}, {
|
|
1211
|
-
default:
|
|
1212
|
-
e.alwaysEnabled ?
|
|
1211
|
+
default: _(() => [
|
|
1212
|
+
e.alwaysEnabled ? N("", !0) : (b(), E(r(so), {
|
|
1213
1213
|
key: 0,
|
|
1214
1214
|
modelValue: c.value,
|
|
1215
1215
|
"onUpdate:modelValue": U[0] || (U[0] = (K) => c.value = K),
|
|
@@ -1218,14 +1218,14 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1218
1218
|
class: "!flex",
|
|
1219
1219
|
disabled: e.disabled
|
|
1220
1220
|
}, {
|
|
1221
|
-
"inline-label":
|
|
1222
|
-
|
|
1223
|
-
|
|
1221
|
+
"inline-label": _(() => [
|
|
1222
|
+
R("div", Jo, [
|
|
1223
|
+
C(r(ee), {
|
|
1224
1224
|
tag: "span",
|
|
1225
1225
|
variant: "body-sm"
|
|
1226
1226
|
}, {
|
|
1227
|
-
default:
|
|
1228
|
-
|
|
1227
|
+
default: _(() => [
|
|
1228
|
+
V(k(r(n)({
|
|
1229
1229
|
defaultMessage: "Auto top-up",
|
|
1230
1230
|
description: "Title of the automatic wallet top-up settings",
|
|
1231
1231
|
id: "auto_topup_config.title"
|
|
@@ -1233,13 +1233,13 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1233
1233
|
]),
|
|
1234
1234
|
_: 1
|
|
1235
1235
|
}),
|
|
1236
|
-
|
|
1236
|
+
C(r(ee), {
|
|
1237
1237
|
tag: "span",
|
|
1238
1238
|
variant: "body-xs",
|
|
1239
1239
|
color: "subtle"
|
|
1240
1240
|
}, {
|
|
1241
|
-
default:
|
|
1242
|
-
|
|
1241
|
+
default: _(() => [
|
|
1242
|
+
V(k(r(n)({
|
|
1243
1243
|
defaultMessage: "Automatically top up your balance when it runs low.",
|
|
1244
1244
|
description: "Subtitle of the automatic wallet top-up settings",
|
|
1245
1245
|
id: "auto_topup_config.subtitle"
|
|
@@ -1251,15 +1251,15 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1251
1251
|
]),
|
|
1252
1252
|
_: 1
|
|
1253
1253
|
}, 8, ["modelValue", "disabled"])),
|
|
1254
|
-
|
|
1255
|
-
default:
|
|
1256
|
-
c.value ? (b(),
|
|
1254
|
+
C(r(ct), { "is-open": c.value }, {
|
|
1255
|
+
default: _(() => [
|
|
1256
|
+
c.value ? (b(), L("div", {
|
|
1257
1257
|
key: 0,
|
|
1258
1258
|
class: $e(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
|
|
1259
1259
|
}, [
|
|
1260
|
-
|
|
1261
|
-
modelValue:
|
|
1262
|
-
"onUpdate:modelValue": U[1] || (U[1] = (K) =>
|
|
1260
|
+
C(xe, {
|
|
1261
|
+
modelValue: T.value,
|
|
1262
|
+
"onUpdate:modelValue": U[1] || (U[1] = (K) => T.value = K),
|
|
1263
1263
|
name: "auto-top-up-threshold",
|
|
1264
1264
|
unit: s.value,
|
|
1265
1265
|
"model-base": m.value,
|
|
@@ -1276,7 +1276,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1276
1276
|
id: "auto_topup_config.threshold.label"
|
|
1277
1277
|
})
|
|
1278
1278
|
}, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
|
|
1279
|
-
|
|
1279
|
+
C(xe, {
|
|
1280
1280
|
modelValue: A.value,
|
|
1281
1281
|
"onUpdate:modelValue": U[2] || (U[2] = (K) => A.value = K),
|
|
1282
1282
|
name: "auto-top-up-amount",
|
|
@@ -1297,7 +1297,7 @@ const jo = ["aria-busy"], Mt = /* @__PURE__ */ Y({
|
|
|
1297
1297
|
id: "auto_topup_config.amount.label"
|
|
1298
1298
|
})
|
|
1299
1299
|
}, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
|
|
1300
|
-
], 2)) :
|
|
1300
|
+
], 2)) : N("", !0)
|
|
1301
1301
|
]),
|
|
1302
1302
|
_: 1
|
|
1303
1303
|
}, 8, ["is-open"])
|
|
@@ -1314,37 +1314,37 @@ function xt({
|
|
|
1314
1314
|
selectedPaymentMethodId: t,
|
|
1315
1315
|
preferredPaymentMethodId: o
|
|
1316
1316
|
}) {
|
|
1317
|
-
const n =
|
|
1317
|
+
const n = l(
|
|
1318
1318
|
() => [...e.value ?? []].sort(
|
|
1319
1319
|
(a, i) => tt(i.created_at) - tt(a.created_at)
|
|
1320
1320
|
)
|
|
1321
1321
|
);
|
|
1322
|
-
return
|
|
1322
|
+
return Q(
|
|
1323
1323
|
() => [
|
|
1324
1324
|
e.value,
|
|
1325
1325
|
o == null ? void 0 : o.value,
|
|
1326
1326
|
t.value
|
|
1327
1327
|
],
|
|
1328
|
-
([a, i,
|
|
1328
|
+
([a, i, u], s) => {
|
|
1329
1329
|
var A;
|
|
1330
1330
|
const m = s == null ? void 0 : s[0], h = a == null ? void 0 : a.find(
|
|
1331
|
-
({ id: c }) => !(m != null && m.some((
|
|
1331
|
+
({ id: c }) => !(m != null && m.some((y) => y.id === c))
|
|
1332
1332
|
);
|
|
1333
1333
|
if (h && (m != null && m.length)) {
|
|
1334
1334
|
t.value = h.id;
|
|
1335
1335
|
return;
|
|
1336
1336
|
}
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1337
|
+
const T = (c) => !!c && !!(a != null && a.some((y) => y.id === c));
|
|
1338
|
+
T(u) || (t.value = T(i) ? i : (A = (a == null ? void 0 : a.find(({ is_default: c }) => c)) ?? n.value[0]) == null ? void 0 : A.id);
|
|
1339
1339
|
},
|
|
1340
1340
|
{ immediate: !0 }
|
|
1341
1341
|
), { sortedPaymentMethods: n };
|
|
1342
1342
|
}
|
|
1343
1343
|
function Ue() {
|
|
1344
|
-
const { $t: e, formatNumber: t } =
|
|
1344
|
+
const { $t: e, formatNumber: t } = G(), o = (a) => Be(e, t, a);
|
|
1345
1345
|
return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
|
|
1346
1346
|
}
|
|
1347
|
-
const
|
|
1347
|
+
const Zo = { class: "sv-top-up-form" }, en = { class: "grid grid-cols-1 gap-4" }, tn = { class: "grid grid-cols-1 gap-1" }, on = { class: "sv-top-up-form__option-details" }, nn = { key: 0 }, an = /* @__PURE__ */ H({
|
|
1348
1348
|
__name: "TopUpModalForm",
|
|
1349
1349
|
props: {
|
|
1350
1350
|
topUpPricingItems: { type: null },
|
|
@@ -1354,14 +1354,14 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1354
1354
|
},
|
|
1355
1355
|
emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
|
|
1356
1356
|
setup(e, { expose: t, emit: o }) {
|
|
1357
|
-
const n = e, a = o, { $t: i } =
|
|
1357
|
+
const n = e, a = o, { $t: i } = G(), { formatValue: u } = Ue(), s = O({
|
|
1358
1358
|
pricing_plan_schedule_id: "",
|
|
1359
1359
|
pricing_items: [],
|
|
1360
1360
|
start_at: "",
|
|
1361
1361
|
finalize_immediately: !1,
|
|
1362
1362
|
payment_method_id: void 0,
|
|
1363
1363
|
preview: !0
|
|
1364
|
-
}), m =
|
|
1364
|
+
}), m = l(() => {
|
|
1365
1365
|
const d = (n.topUpPricingItems ?? []).filter(
|
|
1366
1366
|
(v) => v.flexiblePricing || v.fixedPricing
|
|
1367
1367
|
);
|
|
@@ -1369,10 +1369,10 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1369
1369
|
...d.filter(({ flexiblePricing: v }) => v),
|
|
1370
1370
|
...d.filter(({ flexiblePricing: v }) => !v)
|
|
1371
1371
|
];
|
|
1372
|
-
}), h = (d) => m.value.find((v) => v.pricingItemId === d),
|
|
1373
|
-
const { config: v, currency:
|
|
1374
|
-
return
|
|
1375
|
-
}, A =
|
|
1372
|
+
}), h = (d) => m.value.find((v) => v.pricingItemId === d), T = (d) => {
|
|
1373
|
+
const { config: v, currency: w } = d.flexiblePricing ?? {}, D = v == null ? void 0 : v.minimum_amount;
|
|
1374
|
+
return D && w ? { quantity: D.quantity, currency: w } : void 0;
|
|
1375
|
+
}, A = l({
|
|
1376
1376
|
get: () => {
|
|
1377
1377
|
var d;
|
|
1378
1378
|
return (d = s.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
|
|
@@ -1383,111 +1383,111 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1383
1383
|
s.value.pricing_items = [];
|
|
1384
1384
|
return;
|
|
1385
1385
|
}
|
|
1386
|
-
const
|
|
1386
|
+
const w = T(v);
|
|
1387
1387
|
s.value.pricing_items = [
|
|
1388
1388
|
{
|
|
1389
1389
|
pricing_item_id: v.pricingItemId,
|
|
1390
|
-
...
|
|
1390
|
+
...w && { flexible_amount: w }
|
|
1391
1391
|
}
|
|
1392
1392
|
];
|
|
1393
1393
|
}
|
|
1394
1394
|
});
|
|
1395
|
-
|
|
1395
|
+
Q(
|
|
1396
1396
|
m,
|
|
1397
1397
|
(d) => {
|
|
1398
1398
|
if (d.some(
|
|
1399
|
-
({ pricingItemId:
|
|
1400
|
-
var
|
|
1401
|
-
return
|
|
1399
|
+
({ pricingItemId: D }) => {
|
|
1400
|
+
var Y;
|
|
1401
|
+
return D === ((Y = s.value.pricing_items[0]) == null ? void 0 : Y.pricing_item_id);
|
|
1402
1402
|
}
|
|
1403
1403
|
))
|
|
1404
1404
|
return;
|
|
1405
|
-
const
|
|
1406
|
-
A.value =
|
|
1405
|
+
const w = d.find(({ flexiblePricing: D }) => D) ?? d[0];
|
|
1406
|
+
A.value = w == null ? void 0 : w.pricingItemId;
|
|
1407
1407
|
},
|
|
1408
1408
|
{ immediate: !0 }
|
|
1409
1409
|
);
|
|
1410
|
-
const c =
|
|
1410
|
+
const c = l(
|
|
1411
1411
|
() => {
|
|
1412
1412
|
var d, v;
|
|
1413
1413
|
return (v = h((d = s.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id)) == null ? void 0 : v.pricingPlanScheduleId;
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
|
-
|
|
1416
|
+
Q(
|
|
1417
1417
|
c,
|
|
1418
1418
|
(d) => {
|
|
1419
1419
|
s.value.pricing_plan_schedule_id = d ?? "";
|
|
1420
1420
|
},
|
|
1421
1421
|
{ immediate: !0 }
|
|
1422
1422
|
);
|
|
1423
|
-
const
|
|
1423
|
+
const y = l({
|
|
1424
1424
|
get: () => {
|
|
1425
1425
|
var d;
|
|
1426
1426
|
return (d = s.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
|
|
1427
1427
|
},
|
|
1428
1428
|
set: (d) => {
|
|
1429
|
-
var
|
|
1430
|
-
const v = (
|
|
1429
|
+
var w;
|
|
1430
|
+
const v = (w = s.value.pricing_items[0]) == null ? void 0 : w.pricing_item_id;
|
|
1431
1431
|
v && (s.value.pricing_items = [
|
|
1432
1432
|
{ pricing_item_id: v, ...d && { flexible_amount: d } }
|
|
1433
1433
|
]);
|
|
1434
1434
|
}
|
|
1435
1435
|
}), P = (d) => {
|
|
1436
|
-
var
|
|
1437
|
-
const v = (
|
|
1436
|
+
var w;
|
|
1437
|
+
const v = (w = h(String(d))) == null ? void 0 : w.fixedPricing;
|
|
1438
1438
|
return v != null && v.value.credits ? Ne(v.amount) : void 0;
|
|
1439
|
-
},
|
|
1439
|
+
}, x = l(
|
|
1440
1440
|
() => {
|
|
1441
1441
|
var d;
|
|
1442
1442
|
return (d = h(String(A.value))) == null ? void 0 : d.flexiblePricing;
|
|
1443
1443
|
}
|
|
1444
|
-
),
|
|
1444
|
+
), M = l({
|
|
1445
1445
|
get: () => {
|
|
1446
1446
|
var d;
|
|
1447
|
-
return ((d =
|
|
1447
|
+
return ((d = y.value) == null ? void 0 : d.quantity) ?? "";
|
|
1448
1448
|
},
|
|
1449
1449
|
set: (d) => {
|
|
1450
|
-
var
|
|
1451
|
-
const v = (
|
|
1452
|
-
|
|
1450
|
+
var w;
|
|
1451
|
+
const v = (w = x.value) == null ? void 0 : w.currency;
|
|
1452
|
+
y.value = d && v ? { quantity: d, currency: v } : void 0;
|
|
1453
1453
|
}
|
|
1454
|
-
}),
|
|
1454
|
+
}), $ = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", g = l(() => wt(n.topUpPricingItems)), p = (d) => d.creditsConfiguration ? g.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, S = ({ config: d }) => ({
|
|
1455
1455
|
...(d == null ? void 0 : d.minimum_amount) && { minimum: d.minimum_amount },
|
|
1456
1456
|
...(d == null ? void 0 : d.maximum_amount) && { maximum: d.maximum_amount }
|
|
1457
|
-
}),
|
|
1458
|
-
var
|
|
1459
|
-
const v = (
|
|
1457
|
+
}), B = (d) => {
|
|
1458
|
+
var w;
|
|
1459
|
+
const v = (w = h(String(d))) == null ? void 0 : w.flexiblePricing;
|
|
1460
1460
|
return v ? [v] : [];
|
|
1461
|
-
}, f =
|
|
1461
|
+
}, f = l(
|
|
1462
1462
|
() => m.value.map((d) => ({
|
|
1463
1463
|
value: d.pricingItemId,
|
|
1464
|
-
label: d.fixedPricing ?
|
|
1464
|
+
label: d.fixedPricing ? u(d.fixedPricing.value) : i({
|
|
1465
1465
|
defaultMessage: "Choose your own amount",
|
|
1466
1466
|
description: "Label of the choose-your-amount option in the top-up modal",
|
|
1467
1467
|
id: "topup_modal.flexible_option.label"
|
|
1468
1468
|
})
|
|
1469
1469
|
}))
|
|
1470
|
-
), U =
|
|
1470
|
+
), U = l(() => {
|
|
1471
1471
|
const d = s.value.pricing_items.filter(
|
|
1472
1472
|
(v) => {
|
|
1473
|
-
var
|
|
1474
|
-
return !((
|
|
1473
|
+
var w;
|
|
1474
|
+
return !((w = h(v.pricing_item_id)) != null && w.flexiblePricing) || !!v.flexible_amount;
|
|
1475
1475
|
}
|
|
1476
1476
|
);
|
|
1477
1477
|
return d.length > 0 ? d : void 0;
|
|
1478
|
-
}), K =
|
|
1478
|
+
}), K = l(() => !n.autoTopUpConfig && m.value.some(({ flexiblePricing: v }) => v) ? Tt(n.topUpPricingItems) : void 0), te = O(), { chargeOnDemandPricingItems: ve } = mt(), fe = Ae(), W = O(!1), de = l(
|
|
1479
1479
|
() => !!s.value.pricing_plan_schedule_id && !!U.value && !!s.value.payment_method_id
|
|
1480
1480
|
), he = Ie({
|
|
1481
|
-
paymentMethodId:
|
|
1482
|
-
flexibleAmount:
|
|
1481
|
+
paymentMethodId: l(() => s.value.payment_method_id ?? null),
|
|
1482
|
+
flexibleAmount: l(() => {
|
|
1483
1483
|
var d;
|
|
1484
|
-
return se((d =
|
|
1484
|
+
return se((d = y.value) == null ? void 0 : d.quantity) ?? null;
|
|
1485
1485
|
})
|
|
1486
1486
|
}), ce = (d) => {
|
|
1487
|
-
var
|
|
1488
|
-
const v = (
|
|
1489
|
-
return v ?
|
|
1490
|
-
},
|
|
1487
|
+
var w;
|
|
1488
|
+
const v = (w = x.value) == null ? void 0 : w.bounds[d];
|
|
1489
|
+
return v ? u(v) : "";
|
|
1490
|
+
}, z = De(
|
|
1491
1491
|
{
|
|
1492
1492
|
flexibleAmount: {
|
|
1493
1493
|
required: J.withMessage(
|
|
@@ -1496,7 +1496,7 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1496
1496
|
description: "Error shown under the choose-your-amount input in the top-up modal when it is left empty",
|
|
1497
1497
|
id: "topup_modal.amount.required"
|
|
1498
1498
|
}),
|
|
1499
|
-
rt(() => !!
|
|
1499
|
+
rt(() => !!x.value)
|
|
1500
1500
|
),
|
|
1501
1501
|
positive: J.withMessage(
|
|
1502
1502
|
() => i({
|
|
@@ -1516,8 +1516,8 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1516
1516
|
{ minimum: ce("minimum") }
|
|
1517
1517
|
),
|
|
1518
1518
|
(d) => {
|
|
1519
|
-
var v,
|
|
1520
|
-
return St(d, (
|
|
1519
|
+
var v, w;
|
|
1520
|
+
return St(d, (w = (v = x.value) == null ? void 0 : v.config) == null ? void 0 : w.minimum_amount);
|
|
1521
1521
|
}
|
|
1522
1522
|
),
|
|
1523
1523
|
withinMaximum: J.withMessage(
|
|
@@ -1530,8 +1530,8 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1530
1530
|
{ maximum: ce("maximum") }
|
|
1531
1531
|
),
|
|
1532
1532
|
(d) => {
|
|
1533
|
-
var v,
|
|
1534
|
-
return Pt(d, (
|
|
1533
|
+
var v, w;
|
|
1534
|
+
return Pt(d, (w = (v = x.value) == null ? void 0 : v.config) == null ? void 0 : w.maximum_amount);
|
|
1535
1535
|
}
|
|
1536
1536
|
)
|
|
1537
1537
|
},
|
|
@@ -1547,57 +1547,57 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1547
1547
|
}
|
|
1548
1548
|
},
|
|
1549
1549
|
he
|
|
1550
|
-
), ne =
|
|
1550
|
+
), ne = l(() => {
|
|
1551
1551
|
const [d] = s.value.pricing_items, v = h(d == null ? void 0 : d.pricing_item_id);
|
|
1552
|
-
return v ?
|
|
1552
|
+
return v ? Wo(v, d == null ? void 0 : d.flexible_amount) : void 0;
|
|
1553
1553
|
});
|
|
1554
1554
|
async function pe() {
|
|
1555
|
-
var v,
|
|
1556
|
-
|
|
1555
|
+
var v, w, D;
|
|
1556
|
+
z.value.$touch();
|
|
1557
1557
|
const d = (v = te.value) == null ? void 0 : v.validate();
|
|
1558
|
-
if (!(
|
|
1559
|
-
|
|
1558
|
+
if (!(z.value.$invalid || (w = te.value) != null && w.isInvalid || !de.value || W.value)) {
|
|
1559
|
+
W.value = !0;
|
|
1560
1560
|
try {
|
|
1561
|
-
const
|
|
1561
|
+
const Y = await ve({
|
|
1562
1562
|
pricing_plan_schedule_id: s.value.pricing_plan_schedule_id,
|
|
1563
1563
|
pricing_items: U.value ?? [],
|
|
1564
1564
|
payment_method_id: s.value.payment_method_id,
|
|
1565
1565
|
preview: !1
|
|
1566
1566
|
});
|
|
1567
|
-
(d == null ? void 0 : d.status) === "ACTIVE" && ((
|
|
1567
|
+
(d == null ? void 0 : d.status) === "ACTIVE" && ((D = te.value) != null && D.hasChanges) && s.value.payment_method_id && a("save-auto-top-up", {
|
|
1568
1568
|
rule: d,
|
|
1569
1569
|
paymentMethodId: s.value.payment_method_id,
|
|
1570
1570
|
pricingPlanScheduleId: s.value.pricing_plan_schedule_id
|
|
1571
|
-
}), a("success",
|
|
1572
|
-
} catch (
|
|
1573
|
-
fe.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {},
|
|
1571
|
+
}), a("success", Y);
|
|
1572
|
+
} catch (Y) {
|
|
1573
|
+
fe.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, Y), a("failure", Y);
|
|
1574
1574
|
} finally {
|
|
1575
|
-
|
|
1575
|
+
W.value = !1;
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
t({ submit: pe, isCharging:
|
|
1580
|
-
const oe =
|
|
1579
|
+
t({ submit: pe, isCharging: W, canSubmit: de, chargedValue: ne });
|
|
1580
|
+
const oe = l({
|
|
1581
1581
|
get: () => s.value.payment_method_id ?? void 0,
|
|
1582
1582
|
set: (d) => {
|
|
1583
1583
|
s.value.payment_method_id = d;
|
|
1584
1584
|
}
|
|
1585
1585
|
}), { sortedPaymentMethods: ge } = xt({
|
|
1586
|
-
paymentMethods:
|
|
1586
|
+
paymentMethods: l(() => n.paymentMethods),
|
|
1587
1587
|
selectedPaymentMethodId: oe
|
|
1588
1588
|
});
|
|
1589
|
-
return (d, v) => (b(),
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
f.value.length > 0 ? (b(),
|
|
1589
|
+
return (d, v) => (b(), L("form", Zo, [
|
|
1590
|
+
R("div", en, [
|
|
1591
|
+
R("div", tn, [
|
|
1592
|
+
f.value.length > 0 ? (b(), E(r(ut), {
|
|
1593
1593
|
key: 0,
|
|
1594
1594
|
modelValue: A.value,
|
|
1595
|
-
"onUpdate:modelValue": v[3] || (v[3] = (
|
|
1595
|
+
"onUpdate:modelValue": v[3] || (v[3] = (w) => A.value = w),
|
|
1596
1596
|
class: "sv-top-up-form__options",
|
|
1597
1597
|
name: "top-up-pricing-item",
|
|
1598
1598
|
direction: "column",
|
|
1599
1599
|
required: "",
|
|
1600
|
-
disabled:
|
|
1600
|
+
disabled: W.value,
|
|
1601
1601
|
options: f.value,
|
|
1602
1602
|
"show-radio": !1,
|
|
1603
1603
|
label: r(i)({
|
|
@@ -1606,9 +1606,9 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1606
1606
|
id: "topup_modal.pricing_items.label"
|
|
1607
1607
|
})
|
|
1608
1608
|
}, {
|
|
1609
|
-
label:
|
|
1610
|
-
|
|
1611
|
-
P(
|
|
1609
|
+
label: _(({ option: w, optionValue: D }) => [
|
|
1610
|
+
R("span", null, k(w.label), 1),
|
|
1611
|
+
P(D) ? (b(), E(r(ee), {
|
|
1612
1612
|
key: 0,
|
|
1613
1613
|
tag: "span",
|
|
1614
1614
|
variant: "body-sm",
|
|
@@ -1617,121 +1617,121 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1617
1617
|
"no-spacing": "",
|
|
1618
1618
|
class: "sv-top-up-form__option-cost"
|
|
1619
1619
|
}, {
|
|
1620
|
-
default:
|
|
1621
|
-
|
|
1620
|
+
default: _(() => [
|
|
1621
|
+
V(k(P(D)), 1)
|
|
1622
1622
|
]),
|
|
1623
1623
|
_: 2
|
|
1624
|
-
}, 1024)) :
|
|
1624
|
+
}, 1024)) : N("", !0)
|
|
1625
1625
|
]),
|
|
1626
|
-
description:
|
|
1627
|
-
|
|
1628
|
-
|
|
1626
|
+
description: _(({ optionValue: w }) => [
|
|
1627
|
+
R("div", on, [
|
|
1628
|
+
B(w).length > 0 ? (b(), E(r(ct), {
|
|
1629
1629
|
key: 0,
|
|
1630
|
-
"is-open": String(
|
|
1630
|
+
"is-open": String(w) === A.value,
|
|
1631
1631
|
lazy: ""
|
|
1632
1632
|
}, {
|
|
1633
|
-
default:
|
|
1634
|
-
(b(!0),
|
|
1635
|
-
var
|
|
1636
|
-
return b(),
|
|
1637
|
-
key:
|
|
1633
|
+
default: _(() => [
|
|
1634
|
+
(b(!0), L(we, null, Me(B(w), (D) => {
|
|
1635
|
+
var Y;
|
|
1636
|
+
return b(), L("div", {
|
|
1637
|
+
key: D.currency,
|
|
1638
1638
|
class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
|
|
1639
1639
|
onClick: v[1] || (v[1] = ze(() => {
|
|
1640
1640
|
}, ["stop"])),
|
|
1641
1641
|
onKeydown: v[2] || (v[2] = ze(() => {
|
|
1642
1642
|
}, ["stop"]))
|
|
1643
1643
|
}, [
|
|
1644
|
-
|
|
1645
|
-
modelValue:
|
|
1646
|
-
"onUpdate:modelValue": v[0] || (v[0] = (le) =>
|
|
1644
|
+
C(xe, {
|
|
1645
|
+
modelValue: M.value,
|
|
1646
|
+
"onUpdate:modelValue": v[0] || (v[0] = (le) => M.value = le),
|
|
1647
1647
|
name: "top-up-amount",
|
|
1648
1648
|
label: r(i)({
|
|
1649
1649
|
defaultMessage: "Amount",
|
|
1650
1650
|
description: "Label of the amount input of the choose-your-amount top-up",
|
|
1651
1651
|
id: "topup_modal.amount.label"
|
|
1652
1652
|
}),
|
|
1653
|
-
bounds: S(
|
|
1653
|
+
bounds: S(D),
|
|
1654
1654
|
"model-base": "AMOUNT",
|
|
1655
|
-
unit: p(
|
|
1656
|
-
"entry-base":
|
|
1657
|
-
currency:
|
|
1658
|
-
"conversion-rate": (
|
|
1655
|
+
unit: p(D),
|
|
1656
|
+
"entry-base": $(D),
|
|
1657
|
+
currency: D.currency,
|
|
1658
|
+
"conversion-rate": (Y = D.creditsConfiguration) == null ? void 0 : Y.conversionRate,
|
|
1659
1659
|
required: "",
|
|
1660
|
-
disabled:
|
|
1661
|
-
error: r(
|
|
1660
|
+
disabled: W.value,
|
|
1661
|
+
error: r(z).flexibleAmount.$errors
|
|
1662
1662
|
}, null, 8, ["modelValue", "label", "bounds", "unit", "entry-base", "currency", "conversion-rate", "disabled", "error"])
|
|
1663
1663
|
], 32);
|
|
1664
1664
|
}), 128))
|
|
1665
1665
|
]),
|
|
1666
1666
|
_: 2
|
|
1667
|
-
}, 1032, ["is-open"])) :
|
|
1667
|
+
}, 1032, ["is-open"])) : N("", !0)
|
|
1668
1668
|
])
|
|
1669
1669
|
]),
|
|
1670
1670
|
_: 1
|
|
1671
|
-
}, 8, ["modelValue", "disabled", "options", "label"])) :
|
|
1671
|
+
}, 8, ["modelValue", "disabled", "options", "label"])) : N("", !0)
|
|
1672
1672
|
]),
|
|
1673
|
-
|
|
1674
|
-
|
|
1673
|
+
R("div", null, [
|
|
1674
|
+
C(Mt, {
|
|
1675
1675
|
"pricing-plan-schedule-id": c.value,
|
|
1676
1676
|
"pricing-items": U.value
|
|
1677
1677
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
|
|
1678
1678
|
]),
|
|
1679
|
-
K.value ? (b(),
|
|
1680
|
-
|
|
1679
|
+
K.value ? (b(), L("div", nn, [
|
|
1680
|
+
C(Et, ae({
|
|
1681
1681
|
ref_key: "autoTopUpFormRef",
|
|
1682
1682
|
ref: te,
|
|
1683
1683
|
class: "sv-top-up-form__auto-top-up"
|
|
1684
1684
|
}, K.value, {
|
|
1685
1685
|
contained: "",
|
|
1686
1686
|
"show-threshold-conversion": !1,
|
|
1687
|
-
disabled:
|
|
1687
|
+
disabled: W.value
|
|
1688
1688
|
}), null, 16, ["disabled"])
|
|
1689
|
-
])) :
|
|
1690
|
-
|
|
1691
|
-
|
|
1689
|
+
])) : N("", !0),
|
|
1690
|
+
R("div", null, [
|
|
1691
|
+
C(r(no), { spacing: "xs" })
|
|
1692
1692
|
]),
|
|
1693
|
-
|
|
1694
|
-
|
|
1693
|
+
R("div", null, [
|
|
1694
|
+
C(vt, {
|
|
1695
1695
|
modelValue: oe.value,
|
|
1696
|
-
"onUpdate:modelValue": v[4] || (v[4] = (
|
|
1696
|
+
"onUpdate:modelValue": v[4] || (v[4] = (w) => oe.value = w),
|
|
1697
1697
|
class: "sv-top-up-form__payment-methods",
|
|
1698
1698
|
"payment-methods": r(ge),
|
|
1699
1699
|
required: "",
|
|
1700
|
-
error: r(
|
|
1700
|
+
error: r(z).paymentMethodId.$errors,
|
|
1701
1701
|
"payment-method-options": e.paymentMethodOptions,
|
|
1702
|
-
disabled:
|
|
1702
|
+
disabled: W.value,
|
|
1703
1703
|
label: r(i)({
|
|
1704
1704
|
defaultMessage: "Payment method",
|
|
1705
1705
|
description: "Label above the payment method that pays for the top-up, in the top-up modal",
|
|
1706
1706
|
id: "topup_modal.payment_method_selector.label"
|
|
1707
1707
|
}),
|
|
1708
|
-
onAddPaymentMethod: v[5] || (v[5] = (
|
|
1708
|
+
onAddPaymentMethod: v[5] || (v[5] = (w) => a("add-payment-method"))
|
|
1709
1709
|
}, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
|
|
1710
1710
|
])
|
|
1711
1711
|
])
|
|
1712
1712
|
]));
|
|
1713
1713
|
}
|
|
1714
|
-
}),
|
|
1714
|
+
}), sn = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, ln = /* @__PURE__ */ H({
|
|
1715
1715
|
__name: "TopUpModalSuccess",
|
|
1716
1716
|
props: {
|
|
1717
1717
|
invoice: { type: Object }
|
|
1718
1718
|
},
|
|
1719
1719
|
setup(e) {
|
|
1720
|
-
const { $t: t } =
|
|
1721
|
-
return (o, n) => (b(),
|
|
1722
|
-
e.invoice ? (b(),
|
|
1720
|
+
const { $t: t } = G();
|
|
1721
|
+
return (o, n) => (b(), L("div", sn, [
|
|
1722
|
+
e.invoice ? (b(), E(r(be), {
|
|
1723
1723
|
key: 0,
|
|
1724
1724
|
"content-background": "none"
|
|
1725
1725
|
}, {
|
|
1726
|
-
default:
|
|
1727
|
-
|
|
1726
|
+
default: _(() => [
|
|
1727
|
+
C(r(ee), {
|
|
1728
1728
|
tag: "span",
|
|
1729
1729
|
variant: "body-sm",
|
|
1730
1730
|
weight: "semibold",
|
|
1731
1731
|
class: "mb-2 block"
|
|
1732
1732
|
}, {
|
|
1733
|
-
default:
|
|
1734
|
-
|
|
1733
|
+
default: _(() => [
|
|
1734
|
+
V(k(r(t)({
|
|
1735
1735
|
defaultMessage: "Receipt",
|
|
1736
1736
|
description: "Heading above the invoice a completed top-up produced",
|
|
1737
1737
|
id: "topup_modal.success.receipt.heading"
|
|
@@ -1739,22 +1739,22 @@ const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }
|
|
|
1739
1739
|
]),
|
|
1740
1740
|
_: 1
|
|
1741
1741
|
}),
|
|
1742
|
-
|
|
1742
|
+
C(r(pt), {
|
|
1743
1743
|
invoice: e.invoice,
|
|
1744
1744
|
"is-customer-facing": ""
|
|
1745
1745
|
}, null, 8, ["invoice"])
|
|
1746
1746
|
]),
|
|
1747
1747
|
_: 1
|
|
1748
|
-
})) :
|
|
1748
|
+
})) : N("", !0)
|
|
1749
1749
|
]));
|
|
1750
1750
|
}
|
|
1751
1751
|
});
|
|
1752
|
-
function
|
|
1752
|
+
function un({
|
|
1753
1753
|
step: e,
|
|
1754
1754
|
currentBalance: t,
|
|
1755
1755
|
topUpValue: o
|
|
1756
1756
|
}) {
|
|
1757
|
-
const { $t: n, formatNumber: a } =
|
|
1757
|
+
const { $t: n, formatNumber: a } = G(), i = l(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1758
1758
|
defaultMessage: "Add payment method",
|
|
1759
1759
|
description: "Title of the top-up modal while the customer is adding a payment method",
|
|
1760
1760
|
id: "topup_modal.add_payment_method.title"
|
|
@@ -1766,7 +1766,7 @@ function ln({
|
|
|
1766
1766
|
defaultMessage: "Top up balance",
|
|
1767
1767
|
description: "Title of the wallet top-up modal",
|
|
1768
1768
|
id: "topup_modal.title"
|
|
1769
|
-
})),
|
|
1769
|
+
})), u = l(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1770
1770
|
defaultMessage: "Add a new payment method for topping up your balance.",
|
|
1771
1771
|
description: "Subtitle of the top-up modal while the customer is adding a payment method",
|
|
1772
1772
|
id: "topup_modal.add_payment_method.subtitle"
|
|
@@ -1781,7 +1781,7 @@ function ln({
|
|
|
1781
1781
|
id: "topup_modal.subtitle"
|
|
1782
1782
|
},
|
|
1783
1783
|
{ balance: t.value }
|
|
1784
|
-
)), s =
|
|
1784
|
+
)), s = l(
|
|
1785
1785
|
() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1786
1786
|
defaultMessage: "Back",
|
|
1787
1787
|
description: "Label of the button that leaves the add payment method step in the top-up modal",
|
|
@@ -1791,7 +1791,7 @@ function ln({
|
|
|
1791
1791
|
description: "Label of the button that closes the top-up modal",
|
|
1792
1792
|
id: "topup_modal.cancel_button.label"
|
|
1793
1793
|
})
|
|
1794
|
-
), m =
|
|
1794
|
+
), m = l(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1795
1795
|
defaultMessage: "Save payment method",
|
|
1796
1796
|
description: "Label of the confirm button in the top-up modal while adding a payment method",
|
|
1797
1797
|
id: "topup_modal.save_payment_method.label"
|
|
@@ -1811,7 +1811,7 @@ function ln({
|
|
|
1811
1811
|
description: "Label of the confirm button in the top-up modal while no amount is entered",
|
|
1812
1812
|
id: "topup_modal.confirm_button.empty.label"
|
|
1813
1813
|
}));
|
|
1814
|
-
return { title: i, subTitle:
|
|
1814
|
+
return { title: i, subTitle: u, cancelButtonText: s, confirmButtonText: m };
|
|
1815
1815
|
}
|
|
1816
1816
|
function Ot({
|
|
1817
1817
|
isOpen: e,
|
|
@@ -1819,7 +1819,7 @@ function Ot({
|
|
|
1819
1819
|
subscriptionId: o,
|
|
1820
1820
|
onError: n
|
|
1821
1821
|
}) {
|
|
1822
|
-
const { paymentMethodOptions: a, get: i, isPending:
|
|
1822
|
+
const { paymentMethodOptions: a, get: i, isPending: u } = po(), s = async () => {
|
|
1823
1823
|
const h = t.value;
|
|
1824
1824
|
if (!(!e.value || !h))
|
|
1825
1825
|
try {
|
|
@@ -1828,21 +1828,21 @@ function Ot({
|
|
|
1828
1828
|
...o != null && o.value ? { subscriptionId: o.value } : {},
|
|
1829
1829
|
country: co(h)
|
|
1830
1830
|
});
|
|
1831
|
-
} catch (
|
|
1832
|
-
n == null || n(
|
|
1831
|
+
} catch (T) {
|
|
1832
|
+
n == null || n(T);
|
|
1833
1833
|
}
|
|
1834
1834
|
};
|
|
1835
|
-
|
|
1835
|
+
Q(
|
|
1836
1836
|
() => [e.value, t.value, o == null ? void 0 : o.value],
|
|
1837
1837
|
() => void s(),
|
|
1838
1838
|
{ immediate: !0 }
|
|
1839
1839
|
);
|
|
1840
|
-
const m =
|
|
1841
|
-
() =>
|
|
1840
|
+
const m = l(
|
|
1841
|
+
() => u.value ? void 0 : a.value
|
|
1842
1842
|
);
|
|
1843
|
-
return { paymentMethodOptions: a, settledOptions: m, isPending:
|
|
1843
|
+
return { paymentMethodOptions: a, settledOptions: m, isPending: u, load: s };
|
|
1844
1844
|
}
|
|
1845
|
-
const
|
|
1845
|
+
const rn = /* @__PURE__ */ H({
|
|
1846
1846
|
__name: "AddPaymentMethodPane",
|
|
1847
1847
|
props: {
|
|
1848
1848
|
customer: { type: Object },
|
|
@@ -1853,36 +1853,36 @@ const un = /* @__PURE__ */ Y({
|
|
|
1853
1853
|
emits: ["success", "failure"],
|
|
1854
1854
|
setup(e, { expose: t }) {
|
|
1855
1855
|
const o = zt(
|
|
1856
|
-
() => import("./PaymentMethodForm-
|
|
1857
|
-
), n = e, a =
|
|
1856
|
+
() => import("./PaymentMethodForm-BsTrTwCg.mjs").then((s) => s.default)
|
|
1857
|
+
), n = e, a = l(() => ({
|
|
1858
1858
|
variant: "TOKENIZE"
|
|
1859
1859
|
})), i = O(!1);
|
|
1860
|
-
|
|
1860
|
+
Q(
|
|
1861
1861
|
() => n.isActive,
|
|
1862
1862
|
(s) => {
|
|
1863
1863
|
i.value = i.value || !!s;
|
|
1864
1864
|
},
|
|
1865
1865
|
{ immediate: !0 }
|
|
1866
1866
|
);
|
|
1867
|
-
const
|
|
1867
|
+
const u = O();
|
|
1868
1868
|
return t({
|
|
1869
1869
|
/** Submits the form, for a host whose own chrome owns the button — a modal footer, say. */
|
|
1870
1870
|
submit: () => {
|
|
1871
1871
|
var s;
|
|
1872
|
-
return (s =
|
|
1872
|
+
return (s = u.value) == null ? void 0 : s.submit();
|
|
1873
1873
|
},
|
|
1874
1874
|
/**
|
|
1875
1875
|
* Whether the gateway is working on it, so the host can show it and hold everything else. Read
|
|
1876
1876
|
* through the pane being on screen: a form left behind on another pane is not what is pending.
|
|
1877
1877
|
*/
|
|
1878
|
-
isSaving:
|
|
1878
|
+
isSaving: l(() => {
|
|
1879
1879
|
var s;
|
|
1880
|
-
return !!n.isActive && !!((s =
|
|
1880
|
+
return !!n.isActive && !!((s = u.value) != null && s.isPaymentPending);
|
|
1881
1881
|
})
|
|
1882
|
-
}), (s, m) => e.customer && i.value ? (b(),
|
|
1882
|
+
}), (s, m) => e.customer && i.value ? (b(), E(r(o), {
|
|
1883
1883
|
key: 0,
|
|
1884
1884
|
ref_key: "formRef",
|
|
1885
|
-
ref:
|
|
1885
|
+
ref: u,
|
|
1886
1886
|
class: "sv-add-payment-method-pane",
|
|
1887
1887
|
"hide-submit-button": "",
|
|
1888
1888
|
customer: e.customer,
|
|
@@ -1891,18 +1891,18 @@ const un = /* @__PURE__ */ Y({
|
|
|
1891
1891
|
configuration: a.value,
|
|
1892
1892
|
onSuccess: m[0] || (m[0] = (h) => s.$emit("success")),
|
|
1893
1893
|
onFailure: m[1] || (m[1] = (h) => s.$emit("failure", h))
|
|
1894
|
-
}, null, 8, ["customer", "payment-method-options", "is-loading", "configuration"])) :
|
|
1894
|
+
}, null, 8, ["customer", "payment-method-options", "is-loading", "configuration"])) : N("", !0);
|
|
1895
1895
|
}
|
|
1896
1896
|
});
|
|
1897
|
-
function
|
|
1897
|
+
function dn(e) {
|
|
1898
1898
|
const t = O(0), o = (a) => {
|
|
1899
1899
|
t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1900
1900
|
}, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
|
|
1901
|
-
var
|
|
1902
|
-
const i = (
|
|
1901
|
+
var u;
|
|
1902
|
+
const i = (u = a[0]) == null ? void 0 : u.target;
|
|
1903
1903
|
o(i instanceof HTMLElement ? i : void 0);
|
|
1904
1904
|
});
|
|
1905
|
-
return
|
|
1905
|
+
return Q(
|
|
1906
1906
|
e,
|
|
1907
1907
|
(a, i) => {
|
|
1908
1908
|
i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
|
|
@@ -1913,7 +1913,7 @@ function rn(e) {
|
|
|
1913
1913
|
n == null || n.disconnect();
|
|
1914
1914
|
}), t;
|
|
1915
1915
|
}
|
|
1916
|
-
const
|
|
1916
|
+
const cn = ["inert"], pn = 300, mn = "1rem", vn = /* @__PURE__ */ H({
|
|
1917
1917
|
__name: "SlidingPanes",
|
|
1918
1918
|
props: {
|
|
1919
1919
|
panes: { type: Array },
|
|
@@ -1922,49 +1922,49 @@ const dn = ["inert"], cn = 300, pn = "1rem", mn = /* @__PURE__ */ Y({
|
|
|
1922
1922
|
setup(e) {
|
|
1923
1923
|
const t = e, o = O(!1);
|
|
1924
1924
|
let n;
|
|
1925
|
-
|
|
1925
|
+
Q(
|
|
1926
1926
|
() => t.current,
|
|
1927
1927
|
() => {
|
|
1928
1928
|
o.value = !0, clearTimeout(n), n = setTimeout(() => {
|
|
1929
1929
|
o.value = !1;
|
|
1930
|
-
},
|
|
1930
|
+
}, pn);
|
|
1931
1931
|
}
|
|
1932
1932
|
), Oe(() => {
|
|
1933
1933
|
clearTimeout(n);
|
|
1934
1934
|
});
|
|
1935
|
-
const a = O({}), i = {},
|
|
1936
|
-
a.value[
|
|
1937
|
-
}), s =
|
|
1938
|
-
const
|
|
1939
|
-
return
|
|
1935
|
+
const a = O({}), i = {}, u = (T) => i[T] ?? (i[T] = (A) => {
|
|
1936
|
+
a.value[T] = A instanceof HTMLElement ? A : void 0;
|
|
1937
|
+
}), s = l(() => a.value[t.current]), m = dn(s), h = l(() => {
|
|
1938
|
+
const T = t.panes.indexOf(t.current);
|
|
1939
|
+
return T > 0 ? `translateX(calc(${-T} * (100% + ${mn})))` : "translateX(0px)";
|
|
1940
1940
|
});
|
|
1941
|
-
return (
|
|
1941
|
+
return (T, A) => (b(), L("div", {
|
|
1942
1942
|
class: $e([
|
|
1943
1943
|
"sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
|
|
1944
1944
|
o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
|
|
1945
1945
|
]),
|
|
1946
1946
|
style: je(r(m) ? { height: `${r(m)}px` } : void 0)
|
|
1947
1947
|
}, [
|
|
1948
|
-
|
|
1948
|
+
R("div", {
|
|
1949
1949
|
class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
|
|
1950
1950
|
style: je({ transform: h.value })
|
|
1951
1951
|
}, [
|
|
1952
|
-
(b(!0),
|
|
1952
|
+
(b(!0), L(we, null, Me(e.panes, (c) => (b(), L("div", {
|
|
1953
1953
|
key: c,
|
|
1954
1954
|
class: "sv-sliding-panes__pane w-full shrink-0",
|
|
1955
1955
|
inert: c !== e.current || void 0
|
|
1956
1956
|
}, [
|
|
1957
|
-
|
|
1957
|
+
R("div", {
|
|
1958
1958
|
ref_for: !0,
|
|
1959
|
-
ref:
|
|
1959
|
+
ref: u(c)
|
|
1960
1960
|
}, [
|
|
1961
|
-
ue(
|
|
1961
|
+
ue(T.$slots, c)
|
|
1962
1962
|
], 512)
|
|
1963
|
-
], 8,
|
|
1963
|
+
], 8, cn))), 128))
|
|
1964
1964
|
], 4)
|
|
1965
1965
|
], 6));
|
|
1966
1966
|
}
|
|
1967
|
-
}), $t = /* @__PURE__ */
|
|
1967
|
+
}), $t = /* @__PURE__ */ H({
|
|
1968
1968
|
inheritAttrs: !1,
|
|
1969
1969
|
__name: "OnDemandPaymentModalShell",
|
|
1970
1970
|
props: {
|
|
@@ -1983,17 +1983,17 @@ const dn = ["inert"], cn = 300, pn = "1rem", mn = /* @__PURE__ */ Y({
|
|
|
1983
1983
|
},
|
|
1984
1984
|
emits: ["confirm", "cancel", "payment-success", "payment-failed"],
|
|
1985
1985
|
setup(e, { expose: t }) {
|
|
1986
|
-
const o = e, n = O(), a =
|
|
1986
|
+
const o = e, n = O(), a = l(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
|
|
1987
1987
|
return t({
|
|
1988
1988
|
submit: () => {
|
|
1989
1989
|
var i;
|
|
1990
1990
|
return (i = n.value) == null ? void 0 : i.submit();
|
|
1991
1991
|
},
|
|
1992
|
-
isSaving:
|
|
1992
|
+
isSaving: l(() => {
|
|
1993
1993
|
var i;
|
|
1994
1994
|
return !!((i = n.value) != null && i.isSaving);
|
|
1995
1995
|
})
|
|
1996
|
-
}), (i,
|
|
1996
|
+
}), (i, u) => (b(), E(r(ft), {
|
|
1997
1997
|
"no-click-away": "",
|
|
1998
1998
|
"show-modal": e.showModal,
|
|
1999
1999
|
size: "lg",
|
|
@@ -2002,32 +2002,32 @@ const dn = ["inert"], cn = 300, pn = "1rem", mn = /* @__PURE__ */ Y({
|
|
|
2002
2002
|
"cancel-button-text": e.cancelButtonText,
|
|
2003
2003
|
"confirm-button-text": e.confirmButtonText,
|
|
2004
2004
|
"is-loading": e.isPending,
|
|
2005
|
-
onConfirm:
|
|
2006
|
-
onClose:
|
|
2005
|
+
onConfirm: u[2] || (u[2] = (s) => i.$emit("confirm")),
|
|
2006
|
+
onClose: u[3] || (u[3] = (s) => i.$emit("cancel"))
|
|
2007
2007
|
}, re({
|
|
2008
|
-
body:
|
|
2009
|
-
|
|
2010
|
-
|
|
2008
|
+
body: _(() => [
|
|
2009
|
+
R("div", ae({ class: "grid grid-cols-1 gap-4 pb-4" }, i.$attrs), [
|
|
2010
|
+
C(vn, {
|
|
2011
2011
|
panes: e.panes,
|
|
2012
2012
|
current: e.step
|
|
2013
2013
|
}, re({
|
|
2014
|
-
[e.addPaymentMethodPane]:
|
|
2015
|
-
|
|
2014
|
+
[e.addPaymentMethodPane]: _(() => [
|
|
2015
|
+
C(rn, {
|
|
2016
2016
|
ref_key: "paneRef",
|
|
2017
2017
|
ref: n,
|
|
2018
2018
|
customer: e.customer,
|
|
2019
2019
|
"payment-method-options": e.paymentMethodOptions,
|
|
2020
2020
|
"is-loading": e.isPaymentMethodOptionsPending,
|
|
2021
2021
|
"is-active": e.step === e.addPaymentMethodPane,
|
|
2022
|
-
onSuccess:
|
|
2023
|
-
onFailure:
|
|
2022
|
+
onSuccess: u[0] || (u[0] = (s) => i.$emit("payment-success")),
|
|
2023
|
+
onFailure: u[1] || (u[1] = (s) => i.$emit("payment-failed", s))
|
|
2024
2024
|
}, null, 8, ["customer", "payment-method-options", "is-loading", "is-active"])
|
|
2025
2025
|
]),
|
|
2026
2026
|
_: 2
|
|
2027
2027
|
}, [
|
|
2028
2028
|
Me(a.value, (s) => ({
|
|
2029
2029
|
name: s,
|
|
2030
|
-
fn:
|
|
2030
|
+
fn: _(() => [
|
|
2031
2031
|
ue(i.$slots, s)
|
|
2032
2032
|
])
|
|
2033
2033
|
}))
|
|
@@ -2038,7 +2038,7 @@ const dn = ["inert"], cn = 300, pn = "1rem", mn = /* @__PURE__ */ Y({
|
|
|
2038
2038
|
}, [
|
|
2039
2039
|
i.$slots.footer ? {
|
|
2040
2040
|
name: "footer",
|
|
2041
|
-
fn:
|
|
2041
|
+
fn: _(() => [
|
|
2042
2042
|
ue(i.$slots, "footer")
|
|
2043
2043
|
]),
|
|
2044
2044
|
key: "0"
|
|
@@ -2073,8 +2073,8 @@ const dn = ["inert"], cn = 300, pn = "1rem", mn = /* @__PURE__ */ Y({
|
|
|
2073
2073
|
chargeTarget: o,
|
|
2074
2074
|
paymentMethodId: n
|
|
2075
2075
|
}) => {
|
|
2076
|
-
var i,
|
|
2077
|
-
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((
|
|
2076
|
+
var i, u;
|
|
2077
|
+
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((u = e == null ? void 0 : e.threshold) == null ? void 0 : u.credits));
|
|
2078
2078
|
if (!(!e || !a || !(t != null && t.wallet_id) || !o || !n))
|
|
2079
2079
|
return {
|
|
2080
2080
|
wallet_id: t.wallet_id,
|
|
@@ -2094,8 +2094,8 @@ function Rt({
|
|
|
2094
2094
|
const n = O();
|
|
2095
2095
|
return {
|
|
2096
2096
|
paneRef: n,
|
|
2097
|
-
isActive:
|
|
2098
|
-
isSaving:
|
|
2097
|
+
isActive: l(() => e.value === t),
|
|
2098
|
+
isSaving: l(() => {
|
|
2099
2099
|
var a;
|
|
2100
2100
|
return !!((a = n.value) != null && a.isSaving);
|
|
2101
2101
|
}),
|
|
@@ -2132,7 +2132,7 @@ function kt() {
|
|
|
2132
2132
|
data: s
|
|
2133
2133
|
});
|
|
2134
2134
|
}
|
|
2135
|
-
async function
|
|
2135
|
+
async function u(s) {
|
|
2136
2136
|
return e({
|
|
2137
2137
|
url: ye(t.apiUrls.config, ...o, s, "deactivate"),
|
|
2138
2138
|
options: { method: "POST" }
|
|
@@ -2142,7 +2142,7 @@ function kt() {
|
|
|
2142
2142
|
getAutoTopUpConfigs: n,
|
|
2143
2143
|
getAutoTopUpConfig: a,
|
|
2144
2144
|
createAutoTopUpConfig: i,
|
|
2145
|
-
deactivateAutoTopUpConfig:
|
|
2145
|
+
deactivateAutoTopUpConfig: u
|
|
2146
2146
|
};
|
|
2147
2147
|
}
|
|
2148
2148
|
function Ft() {
|
|
@@ -2165,17 +2165,17 @@ function Ft() {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
}, isSaving: o };
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function fn(e) {
|
|
2169
2169
|
var t;
|
|
2170
2170
|
return Kt(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";
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2172
|
+
function oa(e) {
|
|
2173
2173
|
return e === "PAYMENT_METHOD" || e === "PRICING_ITEMS" || e === "SUBSCRIPTION_INACTIVE";
|
|
2174
2174
|
}
|
|
2175
|
-
const
|
|
2175
|
+
const hn = {
|
|
2176
2176
|
key: 0,
|
|
2177
2177
|
class: "mb-4"
|
|
2178
|
-
},
|
|
2178
|
+
}, gn = { class: "sr-only" }, _n = { class: "flex flex-col gap-2" }, yn = /* @__PURE__ */ H({
|
|
2179
2179
|
__name: "TopUpModal",
|
|
2180
2180
|
props: {
|
|
2181
2181
|
showModal: { type: Boolean },
|
|
@@ -2186,95 +2186,95 @@ const fn = {
|
|
|
2186
2186
|
},
|
|
2187
2187
|
emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
|
|
2188
2188
|
setup(e, { emit: t }) {
|
|
2189
|
-
const o = e, n = t, { $t: a } =
|
|
2189
|
+
const o = e, n = t, { $t: a } = G(), { formatOpenBalance: i } = Ue(), u = l(
|
|
2190
2190
|
() => Bt(It(o.selectedBalanceItem))
|
|
2191
|
-
), s =
|
|
2192
|
-
() =>
|
|
2191
|
+
), s = l(() => i(o.selectedBalanceItem)), m = l(
|
|
2192
|
+
() => Bo(o.selectedBalanceItem, o.subscriptions ?? [])
|
|
2193
2193
|
), h = O();
|
|
2194
|
-
|
|
2194
|
+
Q(
|
|
2195
2195
|
m,
|
|
2196
|
-
(
|
|
2197
|
-
var
|
|
2198
|
-
|
|
2196
|
+
(I) => {
|
|
2197
|
+
var q;
|
|
2198
|
+
I.some(
|
|
2199
2199
|
({ id: _e }) => _e === h.value
|
|
2200
|
-
) || (h.value = (
|
|
2200
|
+
) || (h.value = (q = I[0]) == null ? void 0 : q.id);
|
|
2201
2201
|
},
|
|
2202
2202
|
{ immediate: !0 }
|
|
2203
2203
|
);
|
|
2204
|
-
const
|
|
2205
|
-
() => m.value.map(({ id:
|
|
2206
|
-
value:
|
|
2207
|
-
label:
|
|
2204
|
+
const T = l(() => m.value.length > 1), A = l(
|
|
2205
|
+
() => m.value.map(({ id: I, name: j }, q) => ({
|
|
2206
|
+
value: I,
|
|
2207
|
+
label: j ?? a(
|
|
2208
2208
|
{
|
|
2209
2209
|
defaultMessage: "Subscription {number}",
|
|
2210
2210
|
description: "Accessible name of a subscription in the top-up modal when it has no name, numbered by its place in the list",
|
|
2211
2211
|
id: "topup_modal.subscriptions.unnamed"
|
|
2212
2212
|
},
|
|
2213
|
-
{ number: String(
|
|
2213
|
+
{ number: String(q + 1) }
|
|
2214
2214
|
)
|
|
2215
2215
|
}))
|
|
2216
|
-
), c =
|
|
2216
|
+
), c = l(
|
|
2217
2217
|
() => Object.fromEntries(
|
|
2218
|
-
m.value.flatMap(({ id:
|
|
2219
|
-
const
|
|
2220
|
-
return
|
|
2218
|
+
m.value.flatMap(({ id: I, enabledPricingIds: j }) => {
|
|
2219
|
+
const q = (o.subscriptions ?? []).find(({ id: _e }) => _e === I);
|
|
2220
|
+
return q ? [[I, { subscription: q, enabledPricingIds: j }]] : [];
|
|
2221
2221
|
})
|
|
2222
2222
|
)
|
|
2223
|
-
),
|
|
2224
|
-
var
|
|
2225
|
-
if (!o.selectedBalanceItem || !((
|
|
2223
|
+
), y = l(() => {
|
|
2224
|
+
var j;
|
|
2225
|
+
if (!o.selectedBalanceItem || !((j = o.subscriptions) != null && j.length))
|
|
2226
2226
|
return o.selectedBalanceItem;
|
|
2227
|
-
const
|
|
2228
|
-
return
|
|
2229
|
-
}), P =
|
|
2230
|
-
paymentMethodOptions:
|
|
2231
|
-
settledOptions:
|
|
2232
|
-
isPending:
|
|
2227
|
+
const I = m.value.find(({ id: q }) => q === h.value);
|
|
2228
|
+
return I ? Do(o.selectedBalanceItem, I.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
|
|
2229
|
+
}), P = l(() => ht(y.value)), {
|
|
2230
|
+
paymentMethodOptions: x,
|
|
2231
|
+
settledOptions: M,
|
|
2232
|
+
isPending: $
|
|
2233
2233
|
} = Ot({
|
|
2234
|
-
isOpen:
|
|
2235
|
-
customer:
|
|
2236
|
-
}),
|
|
2237
|
-
() =>
|
|
2238
|
-
),
|
|
2239
|
-
() =>
|
|
2234
|
+
isOpen: l(() => o.showModal),
|
|
2235
|
+
customer: l(() => o.customer)
|
|
2236
|
+
}), g = O("TOP_UP"), p = l(() => (o.paymentMethods ?? []).length > 0), S = l(
|
|
2237
|
+
() => !$.value && (x.value ?? []).length === 0
|
|
2238
|
+
), B = l(
|
|
2239
|
+
() => g.value === "TOP_UP" && !p.value && S.value
|
|
2240
2240
|
), f = O(), U = () => {
|
|
2241
|
-
|
|
2241
|
+
W(), n("payment-success");
|
|
2242
2242
|
}, {
|
|
2243
2243
|
paneRef: K,
|
|
2244
2244
|
isActive: te,
|
|
2245
2245
|
isSaving: ve,
|
|
2246
2246
|
open: fe,
|
|
2247
|
-
leave:
|
|
2247
|
+
leave: W,
|
|
2248
2248
|
submit: de
|
|
2249
|
-
} = Rt({ step:
|
|
2250
|
-
let
|
|
2251
|
-
const ne = O(), pe =
|
|
2252
|
-
var
|
|
2253
|
-
return (
|
|
2254
|
-
}), oe =
|
|
2249
|
+
} = Rt({ step: g, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: he, isSaving: ce } = Ft();
|
|
2250
|
+
let z = 0;
|
|
2251
|
+
const ne = O(), pe = l(() => {
|
|
2252
|
+
var I;
|
|
2253
|
+
return (I = ne.value) == null ? void 0 : I.chargedValue;
|
|
2254
|
+
}), oe = l(
|
|
2255
2255
|
() => {
|
|
2256
|
-
var
|
|
2257
|
-
return ve.value || ce.value || !!((
|
|
2256
|
+
var I;
|
|
2257
|
+
return ve.value || ce.value || !!((I = ne.value) != null && I.isCharging);
|
|
2258
2258
|
}
|
|
2259
|
-
), { title: ge, subTitle: d, cancelButtonText: v, confirmButtonText:
|
|
2260
|
-
step:
|
|
2259
|
+
), { title: ge, subTitle: d, cancelButtonText: v, confirmButtonText: w } = un({
|
|
2260
|
+
step: g,
|
|
2261
2261
|
currentBalance: s,
|
|
2262
2262
|
topUpValue: pe
|
|
2263
|
-
}),
|
|
2264
|
-
() =>
|
|
2263
|
+
}), D = O(), Y = O(!1), le = l(
|
|
2264
|
+
() => Y.value ? a({
|
|
2265
2265
|
defaultMessage: "Your wallet was topped up, but we couldn't save your automatic top-up. You can set it up from your wallet.",
|
|
2266
2266
|
description: "Error shown on the top-up receipt when the automatic top-up rule set alongside it failed to save",
|
|
2267
2267
|
id: "topup_modal.success.auto_top_up_failed"
|
|
2268
2268
|
}) : void 0
|
|
2269
2269
|
), Te = () => {
|
|
2270
|
-
var
|
|
2270
|
+
var I;
|
|
2271
2271
|
if (te.value) {
|
|
2272
2272
|
de();
|
|
2273
2273
|
return;
|
|
2274
2274
|
}
|
|
2275
|
-
|
|
2276
|
-
},
|
|
2277
|
-
|
|
2275
|
+
D.value = void 0, (I = ne.value) == null || I.submit();
|
|
2276
|
+
}, F = (I) => {
|
|
2277
|
+
D.value = fn(I) === "PAYMENT_FAILED" ? a({
|
|
2278
2278
|
defaultMessage: "Your payment was declined. Try another payment method.",
|
|
2279
2279
|
description: "Error shown in the top-up modal when the payment was declined",
|
|
2280
2280
|
id: "topup_modal.error.payment_declined"
|
|
@@ -2282,77 +2282,77 @@ const fn = {
|
|
|
2282
2282
|
defaultMessage: "We couldn't top up your wallet. Please try again.",
|
|
2283
2283
|
description: "Error shown in the top-up modal when charging the top-up failed",
|
|
2284
2284
|
id: "topup_modal.error.charge_failed"
|
|
2285
|
-
}), n("payment-failed",
|
|
2285
|
+
}), n("payment-failed", I);
|
|
2286
2286
|
}, X = async ({
|
|
2287
|
-
rule:
|
|
2288
|
-
paymentMethodId:
|
|
2289
|
-
pricingPlanScheduleId:
|
|
2287
|
+
rule: I,
|
|
2288
|
+
paymentMethodId: j,
|
|
2289
|
+
pricingPlanScheduleId: q
|
|
2290
2290
|
}) => {
|
|
2291
|
-
const _e =
|
|
2291
|
+
const _e = z, { saved: qt } = await he(
|
|
2292
2292
|
Nt({
|
|
2293
|
-
rule:
|
|
2293
|
+
rule: I,
|
|
2294
2294
|
walletBalanceItem: o.selectedBalanceItem,
|
|
2295
2295
|
chargeTarget: Dt(
|
|
2296
2296
|
void 0,
|
|
2297
2297
|
P.value.filter(
|
|
2298
|
-
(Vt) => Vt.pricingPlanScheduleId ===
|
|
2298
|
+
(Vt) => Vt.pricingPlanScheduleId === q
|
|
2299
2299
|
)
|
|
2300
2300
|
),
|
|
2301
|
-
paymentMethodId:
|
|
2301
|
+
paymentMethodId: j
|
|
2302
2302
|
})
|
|
2303
2303
|
);
|
|
2304
2304
|
if (qt) {
|
|
2305
2305
|
n("auto-top-up-saved");
|
|
2306
2306
|
return;
|
|
2307
2307
|
}
|
|
2308
|
-
_e ===
|
|
2309
|
-
}, Z = (
|
|
2310
|
-
f.value =
|
|
2308
|
+
_e === z && (Y.value = !0);
|
|
2309
|
+
}, Z = (I) => {
|
|
2310
|
+
f.value = I, g.value = "SUCCESS";
|
|
2311
2311
|
}, Le = () => {
|
|
2312
2312
|
oe.value || (n("confirm"), n("close"));
|
|
2313
2313
|
}, Ye = () => {
|
|
2314
2314
|
if (!oe.value) {
|
|
2315
2315
|
if (te.value) {
|
|
2316
|
-
|
|
2316
|
+
W();
|
|
2317
2317
|
return;
|
|
2318
2318
|
}
|
|
2319
|
-
if (
|
|
2319
|
+
if (g.value === "SUCCESS") {
|
|
2320
2320
|
Le();
|
|
2321
2321
|
return;
|
|
2322
2322
|
}
|
|
2323
2323
|
n("close");
|
|
2324
2324
|
}
|
|
2325
2325
|
}, He = O(0);
|
|
2326
|
-
return
|
|
2326
|
+
return Q(
|
|
2327
2327
|
() => o.showModal,
|
|
2328
|
-
(
|
|
2329
|
-
|
|
2328
|
+
(I) => {
|
|
2329
|
+
I && (z += 1, g.value = "TOP_UP", f.value = void 0, D.value = void 0, Y.value = !1, He.value += 1);
|
|
2330
2330
|
}
|
|
2331
|
-
), (
|
|
2331
|
+
), (I, j) => (b(), E($t, {
|
|
2332
2332
|
ref_key: "addPaymentMethodRef",
|
|
2333
2333
|
ref: K,
|
|
2334
2334
|
"show-modal": e.showModal,
|
|
2335
2335
|
title: r(ge),
|
|
2336
2336
|
"sub-title": r(d),
|
|
2337
2337
|
"cancel-button-text": r(v),
|
|
2338
|
-
"confirm-button-text": r(
|
|
2338
|
+
"confirm-button-text": r(w),
|
|
2339
2339
|
"is-pending": oe.value,
|
|
2340
|
-
panes: r(
|
|
2341
|
-
step:
|
|
2340
|
+
panes: r($o),
|
|
2341
|
+
step: g.value,
|
|
2342
2342
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2343
2343
|
customer: e.customer,
|
|
2344
|
-
"payment-method-options": r(
|
|
2345
|
-
"is-payment-method-options-pending": r(
|
|
2344
|
+
"payment-method-options": r(x),
|
|
2345
|
+
"is-payment-method-options-pending": r($),
|
|
2346
2346
|
onConfirm: Te,
|
|
2347
2347
|
onCancel: Ye,
|
|
2348
2348
|
onPaymentSuccess: U,
|
|
2349
|
-
onPaymentFailed:
|
|
2349
|
+
onPaymentFailed: j[1] || (j[1] = (q) => I.$emit("payment-failed", q))
|
|
2350
2350
|
}, re({
|
|
2351
|
-
TOP_UP:
|
|
2352
|
-
|
|
2353
|
-
|
|
2351
|
+
TOP_UP: _(() => [
|
|
2352
|
+
T.value ? (b(), L("div", hn, [
|
|
2353
|
+
C(r(ut), {
|
|
2354
2354
|
modelValue: h.value,
|
|
2355
|
-
"onUpdate:modelValue":
|
|
2355
|
+
"onUpdate:modelValue": j[0] || (j[0] = (q) => h.value = q),
|
|
2356
2356
|
class: "sv-topup-modal__subscription",
|
|
2357
2357
|
name: "top-up-subscription",
|
|
2358
2358
|
direction: "column",
|
|
@@ -2365,84 +2365,84 @@ const fn = {
|
|
|
2365
2365
|
id: "topup_modal.subscriptions.label"
|
|
2366
2366
|
})
|
|
2367
2367
|
}, {
|
|
2368
|
-
prefix:
|
|
2369
|
-
c.value[String(
|
|
2368
|
+
prefix: _(({ optionValue: q }) => [
|
|
2369
|
+
c.value[String(q)] ? (b(), E(lo, {
|
|
2370
2370
|
key: 0,
|
|
2371
2371
|
class: "sv-topup-modal__subscription-option grow",
|
|
2372
2372
|
"no-spacing": "",
|
|
2373
|
-
subscription: c.value[String(
|
|
2374
|
-
"enabled-pricing-ids": c.value[String(
|
|
2375
|
-
}, null, 8, ["subscription", "enabled-pricing-ids"])) :
|
|
2373
|
+
subscription: c.value[String(q)].subscription,
|
|
2374
|
+
"enabled-pricing-ids": c.value[String(q)].enabledPricingIds
|
|
2375
|
+
}, null, 8, ["subscription", "enabled-pricing-ids"])) : N("", !0)
|
|
2376
2376
|
]),
|
|
2377
|
-
label:
|
|
2378
|
-
|
|
2377
|
+
label: _(({ option: q }) => [
|
|
2378
|
+
R("span", gn, k(q.label), 1)
|
|
2379
2379
|
]),
|
|
2380
2380
|
_: 1
|
|
2381
2381
|
}, 8, ["modelValue", "options", "label"])
|
|
2382
|
-
])) :
|
|
2383
|
-
(b(),
|
|
2382
|
+
])) : N("", !0),
|
|
2383
|
+
(b(), E(an, {
|
|
2384
2384
|
key: He.value,
|
|
2385
2385
|
ref_key: "topUpFormRef",
|
|
2386
2386
|
ref: ne,
|
|
2387
2387
|
"top-up-pricing-items": P.value,
|
|
2388
2388
|
"payment-methods": e.paymentMethods,
|
|
2389
|
-
"auto-top-up-config":
|
|
2390
|
-
"payment-method-options": r(
|
|
2389
|
+
"auto-top-up-config": u.value,
|
|
2390
|
+
"payment-method-options": r(M),
|
|
2391
2391
|
onAddPaymentMethod: r(fe),
|
|
2392
2392
|
onSuccess: Z,
|
|
2393
|
-
onFailure:
|
|
2393
|
+
onFailure: F,
|
|
2394
2394
|
onSaveAutoTopUp: X
|
|
2395
2395
|
}, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"])),
|
|
2396
|
-
|
|
2396
|
+
D.value ? (b(), E(r(me), {
|
|
2397
2397
|
key: 1,
|
|
2398
2398
|
class: "sv-topup-modal__error sv-error mt-4",
|
|
2399
|
-
title:
|
|
2400
|
-
}, null, 8, ["title"])) :
|
|
2399
|
+
title: D.value
|
|
2400
|
+
}, null, 8, ["title"])) : N("", !0)
|
|
2401
2401
|
]),
|
|
2402
|
-
SUCCESS:
|
|
2403
|
-
le.value ? (b(),
|
|
2402
|
+
SUCCESS: _(() => [
|
|
2403
|
+
le.value ? (b(), E(r(me), {
|
|
2404
2404
|
key: 0,
|
|
2405
2405
|
class: "sv-topup-modal__auto-top-up-error sv-error mb-4",
|
|
2406
2406
|
title: le.value
|
|
2407
|
-
}, null, 8, ["title"])) :
|
|
2408
|
-
f.value ? (b(),
|
|
2407
|
+
}, null, 8, ["title"])) : N("", !0),
|
|
2408
|
+
f.value ? (b(), E(ln, {
|
|
2409
2409
|
key: 1,
|
|
2410
2410
|
invoice: f.value
|
|
2411
|
-
}, null, 8, ["invoice"])) :
|
|
2411
|
+
}, null, 8, ["invoice"])) : N("", !0)
|
|
2412
2412
|
]),
|
|
2413
2413
|
_: 2
|
|
2414
2414
|
}, [
|
|
2415
|
-
|
|
2415
|
+
g.value === "SUCCESS" || B.value ? {
|
|
2416
2416
|
name: "footer",
|
|
2417
|
-
fn:
|
|
2418
|
-
|
|
2419
|
-
|
|
2417
|
+
fn: _(() => [
|
|
2418
|
+
R("div", _n, [
|
|
2419
|
+
g.value === "SUCCESS" ? (b(), E(r(ie), {
|
|
2420
2420
|
key: 0,
|
|
2421
2421
|
size: "lg",
|
|
2422
2422
|
loading: oe.value,
|
|
2423
2423
|
onClick: Le
|
|
2424
2424
|
}, {
|
|
2425
|
-
default:
|
|
2426
|
-
|
|
2425
|
+
default: _(() => [
|
|
2426
|
+
V(k(r(w)), 1)
|
|
2427
2427
|
]),
|
|
2428
2428
|
_: 1
|
|
2429
|
-
}, 8, ["loading"])) : (b(),
|
|
2430
|
-
|
|
2429
|
+
}, 8, ["loading"])) : (b(), L(we, { key: 1 }, [
|
|
2430
|
+
C(r(ie), {
|
|
2431
2431
|
size: "lg",
|
|
2432
2432
|
disabled: ""
|
|
2433
2433
|
}, {
|
|
2434
|
-
default:
|
|
2435
|
-
|
|
2434
|
+
default: _(() => [
|
|
2435
|
+
V(k(r(w)), 1)
|
|
2436
2436
|
]),
|
|
2437
2437
|
_: 1
|
|
2438
2438
|
}),
|
|
2439
|
-
|
|
2439
|
+
C(r(ie), {
|
|
2440
2440
|
size: "lg",
|
|
2441
2441
|
intent: "subtle",
|
|
2442
2442
|
onClick: Ye
|
|
2443
2443
|
}, {
|
|
2444
|
-
default:
|
|
2445
|
-
|
|
2444
|
+
default: _(() => [
|
|
2445
|
+
V(k(r(v)), 1)
|
|
2446
2446
|
]),
|
|
2447
2447
|
_: 1
|
|
2448
2448
|
})
|
|
@@ -2453,7 +2453,7 @@ const fn = {
|
|
|
2453
2453
|
} : void 0
|
|
2454
2454
|
]), 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"]));
|
|
2455
2455
|
}
|
|
2456
|
-
}),
|
|
2456
|
+
}), bn = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], wn = { class: "grid grid-cols-1 gap-4" }, Tn = { class: "flex flex-col gap-2" }, Mn = /* @__PURE__ */ H({
|
|
2457
2457
|
__name: "AutoTopUpModal",
|
|
2458
2458
|
props: {
|
|
2459
2459
|
showModal: { type: Boolean },
|
|
@@ -2464,43 +2464,43 @@ const fn = {
|
|
|
2464
2464
|
},
|
|
2465
2465
|
emits: ["saved", "close", "payment-success", "payment-failed"],
|
|
2466
2466
|
setup(e, { emit: t }) {
|
|
2467
|
-
const o = e, n = t, { $t: a } =
|
|
2467
|
+
const o = e, n = t, { $t: a } = G(), { formatOpenBalance: i } = Ue(), u = O("AUTO_TOP_UP"), s = l(() => i(o.walletBalanceItem)), m = l(() => ht(o.walletBalanceItem)), h = l(() => Tt(m.value)), T = l(() => It(o.walletBalanceItem)), A = l(() => Bt(T.value)), c = l(
|
|
2468
2468
|
() => Dt(o.topUpItem, m.value)
|
|
2469
|
-
),
|
|
2469
|
+
), y = O(), P = l(
|
|
2470
2470
|
() => {
|
|
2471
|
-
var
|
|
2472
|
-
return !!h.value && !!c.value && !!((
|
|
2471
|
+
var F;
|
|
2472
|
+
return !!h.value && !!c.value && !!((F = o.walletBalanceItem) != null && F.wallet_id);
|
|
2473
2473
|
}
|
|
2474
|
-
),
|
|
2474
|
+
), x = l(() => u.value === "AUTO_TOP_UP" && !P.value), M = O(), $ = l(() => {
|
|
2475
2475
|
var X, Z;
|
|
2476
|
-
const
|
|
2477
|
-
return
|
|
2478
|
-
}),
|
|
2479
|
-
var
|
|
2480
|
-
return (
|
|
2476
|
+
const F = (Z = (X = y.value) == null ? void 0 : X.rule) == null ? void 0 : Z.topup_amount;
|
|
2477
|
+
return F != null && F.quantity && c.value ? [{ pricing_item_id: c.value.pricingItemId, flexible_amount: F }] : void 0;
|
|
2478
|
+
}), g = l(() => {
|
|
2479
|
+
var F;
|
|
2480
|
+
return (F = c.value) == null ? void 0 : F.pricingPlanScheduleId;
|
|
2481
2481
|
}), p = O(), { sortedPaymentMethods: S } = xt({
|
|
2482
|
-
paymentMethods:
|
|
2482
|
+
paymentMethods: l(() => o.paymentMethods),
|
|
2483
2483
|
selectedPaymentMethodId: p,
|
|
2484
|
-
preferredPaymentMethodId:
|
|
2485
|
-
var
|
|
2486
|
-
return (
|
|
2484
|
+
preferredPaymentMethodId: l(() => {
|
|
2485
|
+
var F;
|
|
2486
|
+
return (F = T.value) == null ? void 0 : F.payment_method_id;
|
|
2487
2487
|
})
|
|
2488
2488
|
}), {
|
|
2489
|
-
paymentMethodOptions:
|
|
2489
|
+
paymentMethodOptions: B,
|
|
2490
2490
|
settledOptions: f,
|
|
2491
2491
|
isPending: U
|
|
2492
2492
|
} = Ot({
|
|
2493
|
-
isOpen:
|
|
2494
|
-
customer:
|
|
2493
|
+
isOpen: l(() => o.showModal),
|
|
2494
|
+
customer: l(() => o.customer)
|
|
2495
2495
|
}), {
|
|
2496
2496
|
paneRef: K,
|
|
2497
2497
|
isActive: te,
|
|
2498
2498
|
isSaving: ve,
|
|
2499
2499
|
open: fe,
|
|
2500
|
-
leave:
|
|
2500
|
+
leave: W,
|
|
2501
2501
|
submit: de
|
|
2502
|
-
} = Rt({ step:
|
|
2503
|
-
paymentMethodId:
|
|
2502
|
+
} = Rt({ step: u, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: he, isSaving: ce } = Ft(), z = l(() => ve.value || ce.value), ne = Ie({
|
|
2503
|
+
paymentMethodId: l(() => p.value ?? null)
|
|
2504
2504
|
}), pe = De(
|
|
2505
2505
|
{
|
|
2506
2506
|
paymentMethodId: {
|
|
@@ -2515,8 +2515,8 @@ const fn = {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
},
|
|
2517
2517
|
ne
|
|
2518
|
-
), oe =
|
|
2519
|
-
() =>
|
|
2518
|
+
), oe = l(
|
|
2519
|
+
() => u.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2520
2520
|
defaultMessage: "Add payment method",
|
|
2521
2521
|
description: "Title of the auto top-up modal while the customer is adding a payment method",
|
|
2522
2522
|
id: "auto_topup_modal.add_payment_method.title"
|
|
@@ -2525,8 +2525,8 @@ const fn = {
|
|
|
2525
2525
|
description: "Title of the automatic wallet top-up modal",
|
|
2526
2526
|
id: "auto_topup_modal.title"
|
|
2527
2527
|
})
|
|
2528
|
-
), ge =
|
|
2529
|
-
() =>
|
|
2528
|
+
), ge = l(
|
|
2529
|
+
() => u.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2530
2530
|
defaultMessage: "This method pays for every automatic top-up.",
|
|
2531
2531
|
description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
|
|
2532
2532
|
id: "auto_topup_modal.add_payment_method.subtitle"
|
|
@@ -2538,8 +2538,8 @@ const fn = {
|
|
|
2538
2538
|
},
|
|
2539
2539
|
{ balance: s.value }
|
|
2540
2540
|
)
|
|
2541
|
-
), d =
|
|
2542
|
-
() =>
|
|
2541
|
+
), d = l(
|
|
2542
|
+
() => u.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2543
2543
|
defaultMessage: "Back",
|
|
2544
2544
|
description: "Button returning from adding a payment method to the auto top-up rule",
|
|
2545
2545
|
id: "auto_topup_modal.add_payment_method.cancel"
|
|
@@ -2548,8 +2548,8 @@ const fn = {
|
|
|
2548
2548
|
description: "Button dismissing the auto top-up modal",
|
|
2549
2549
|
id: "auto_topup_modal.cancel"
|
|
2550
2550
|
})
|
|
2551
|
-
), v =
|
|
2552
|
-
() =>
|
|
2551
|
+
), v = l(
|
|
2552
|
+
() => u.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2553
2553
|
defaultMessage: "Add payment method",
|
|
2554
2554
|
description: "Button storing the payment method being added in the auto top-up modal",
|
|
2555
2555
|
id: "auto_topup_modal.add_payment_method.confirm"
|
|
@@ -2559,52 +2559,52 @@ const fn = {
|
|
|
2559
2559
|
id: "auto_topup_modal.confirm"
|
|
2560
2560
|
})
|
|
2561
2561
|
);
|
|
2562
|
-
async function
|
|
2562
|
+
async function w() {
|
|
2563
2563
|
var Z;
|
|
2564
|
-
if (pe.value.$touch(),
|
|
2564
|
+
if (pe.value.$touch(), z.value || !P.value)
|
|
2565
2565
|
return;
|
|
2566
|
-
|
|
2567
|
-
const { saved:
|
|
2566
|
+
M.value = void 0;
|
|
2567
|
+
const { saved: F, error: X } = await he(
|
|
2568
2568
|
Nt({
|
|
2569
|
-
rule: (Z =
|
|
2569
|
+
rule: (Z = y.value) == null ? void 0 : Z.validate(),
|
|
2570
2570
|
walletBalanceItem: o.walletBalanceItem,
|
|
2571
2571
|
chargeTarget: c.value,
|
|
2572
2572
|
paymentMethodId: p.value
|
|
2573
2573
|
})
|
|
2574
2574
|
);
|
|
2575
|
-
if (
|
|
2575
|
+
if (F) {
|
|
2576
2576
|
n("saved"), n("close");
|
|
2577
2577
|
return;
|
|
2578
2578
|
}
|
|
2579
|
-
X && (
|
|
2579
|
+
X && (M.value = a({
|
|
2580
2580
|
defaultMessage: "We couldn't save your automatic top-up. Please try again.",
|
|
2581
2581
|
description: "Error shown in the auto top-up modal when saving the rule failed",
|
|
2582
2582
|
id: "auto_topup_modal.save_failed"
|
|
2583
2583
|
}), n("payment-failed", X));
|
|
2584
2584
|
}
|
|
2585
|
-
const
|
|
2585
|
+
const D = () => {
|
|
2586
2586
|
if (te.value) {
|
|
2587
2587
|
de();
|
|
2588
2588
|
return;
|
|
2589
2589
|
}
|
|
2590
|
-
|
|
2591
|
-
},
|
|
2592
|
-
|
|
2590
|
+
w();
|
|
2591
|
+
}, Y = () => {
|
|
2592
|
+
W(), n("payment-success");
|
|
2593
2593
|
}, le = () => {
|
|
2594
|
-
if (!
|
|
2594
|
+
if (!z.value) {
|
|
2595
2595
|
if (te.value) {
|
|
2596
|
-
|
|
2596
|
+
W();
|
|
2597
2597
|
return;
|
|
2598
2598
|
}
|
|
2599
2599
|
n("close");
|
|
2600
2600
|
}
|
|
2601
2601
|
}, Te = O(0);
|
|
2602
|
-
return
|
|
2602
|
+
return Q(
|
|
2603
2603
|
() => o.showModal,
|
|
2604
|
-
(
|
|
2605
|
-
|
|
2604
|
+
(F) => {
|
|
2605
|
+
F && (u.value = "AUTO_TOP_UP", p.value = void 0, M.value = void 0, Te.value += 1);
|
|
2606
2606
|
}
|
|
2607
|
-
), (
|
|
2607
|
+
), (F, X) => (b(), E($t, {
|
|
2608
2608
|
ref_key: "addPaymentMethodRef",
|
|
2609
2609
|
ref: K,
|
|
2610
2610
|
"show-modal": e.showModal,
|
|
@@ -2612,21 +2612,21 @@ const fn = {
|
|
|
2612
2612
|
"sub-title": ge.value,
|
|
2613
2613
|
"cancel-button-text": d.value,
|
|
2614
2614
|
"confirm-button-text": v.value,
|
|
2615
|
-
"is-pending":
|
|
2616
|
-
panes: r(
|
|
2617
|
-
step:
|
|
2615
|
+
"is-pending": z.value,
|
|
2616
|
+
panes: r(bn),
|
|
2617
|
+
step: u.value,
|
|
2618
2618
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2619
2619
|
customer: e.customer,
|
|
2620
|
-
"payment-method-options": r(
|
|
2620
|
+
"payment-method-options": r(B),
|
|
2621
2621
|
"is-payment-method-options-pending": r(U),
|
|
2622
|
-
onConfirm:
|
|
2622
|
+
onConfirm: D,
|
|
2623
2623
|
onCancel: le,
|
|
2624
|
-
onPaymentSuccess:
|
|
2625
|
-
onPaymentFailed: X[1] || (X[1] = (Z) =>
|
|
2624
|
+
onPaymentSuccess: Y,
|
|
2625
|
+
onPaymentFailed: X[1] || (X[1] = (Z) => F.$emit("payment-failed", Z))
|
|
2626
2626
|
}, re({
|
|
2627
|
-
AUTO_TOP_UP:
|
|
2628
|
-
|
|
2629
|
-
P.value ?
|
|
2627
|
+
AUTO_TOP_UP: _(() => [
|
|
2628
|
+
R("div", wn, [
|
|
2629
|
+
P.value ? N("", !0) : (b(), E(r(vo), {
|
|
2630
2630
|
key: 0,
|
|
2631
2631
|
type: "warning",
|
|
2632
2632
|
class: "sv-auto-topup-modal__unavailable",
|
|
@@ -2636,27 +2636,27 @@ const fn = {
|
|
|
2636
2636
|
id: "auto_topup_modal.unavailable"
|
|
2637
2637
|
})
|
|
2638
2638
|
}, null, 8, ["title"])),
|
|
2639
|
-
h.value ? (b(),
|
|
2639
|
+
h.value ? (b(), E(Et, ae({
|
|
2640
2640
|
key: Te.value,
|
|
2641
2641
|
ref_key: "autoTopUpFormRef",
|
|
2642
|
-
ref:
|
|
2642
|
+
ref: y,
|
|
2643
2643
|
class: "sv-auto-topup-modal__rule"
|
|
2644
2644
|
}, h.value, {
|
|
2645
2645
|
config: A.value,
|
|
2646
2646
|
"always-enabled": "",
|
|
2647
|
-
disabled:
|
|
2648
|
-
}), null, 16, ["config", "disabled"])) :
|
|
2649
|
-
|
|
2650
|
-
"pricing-plan-schedule-id":
|
|
2651
|
-
"pricing-items":
|
|
2647
|
+
disabled: z.value
|
|
2648
|
+
}), null, 16, ["config", "disabled"])) : N("", !0),
|
|
2649
|
+
C(Mt, {
|
|
2650
|
+
"pricing-plan-schedule-id": g.value,
|
|
2651
|
+
"pricing-items": $.value
|
|
2652
2652
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
|
|
2653
|
-
|
|
2653
|
+
C(vt, {
|
|
2654
2654
|
modelValue: p.value,
|
|
2655
2655
|
"onUpdate:modelValue": X[0] || (X[0] = (Z) => p.value = Z),
|
|
2656
2656
|
class: "sv-auto-topup-modal__payment-method",
|
|
2657
2657
|
"payment-methods": r(S),
|
|
2658
2658
|
"payment-method-options": r(f),
|
|
2659
|
-
disabled:
|
|
2659
|
+
disabled: z.value,
|
|
2660
2660
|
error: r(pe).paymentMethodId.$errors,
|
|
2661
2661
|
label: r(a)({
|
|
2662
2662
|
defaultMessage: "Pay automatic top-ups with",
|
|
@@ -2665,35 +2665,35 @@ const fn = {
|
|
|
2665
2665
|
}),
|
|
2666
2666
|
onAddPaymentMethod: r(fe)
|
|
2667
2667
|
}, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"]),
|
|
2668
|
-
|
|
2668
|
+
M.value ? (b(), E(r(me), {
|
|
2669
2669
|
key: 2,
|
|
2670
2670
|
class: "sv-auto-topup-modal__error sv-error",
|
|
2671
|
-
title:
|
|
2672
|
-
}, null, 8, ["title"])) :
|
|
2671
|
+
title: M.value
|
|
2672
|
+
}, null, 8, ["title"])) : N("", !0)
|
|
2673
2673
|
])
|
|
2674
2674
|
]),
|
|
2675
2675
|
_: 2
|
|
2676
2676
|
}, [
|
|
2677
|
-
|
|
2677
|
+
x.value ? {
|
|
2678
2678
|
name: "footer",
|
|
2679
|
-
fn:
|
|
2680
|
-
|
|
2681
|
-
|
|
2679
|
+
fn: _(() => [
|
|
2680
|
+
R("div", Tn, [
|
|
2681
|
+
C(r(ie), {
|
|
2682
2682
|
size: "lg",
|
|
2683
2683
|
disabled: ""
|
|
2684
2684
|
}, {
|
|
2685
|
-
default:
|
|
2686
|
-
|
|
2685
|
+
default: _(() => [
|
|
2686
|
+
V(k(v.value), 1)
|
|
2687
2687
|
]),
|
|
2688
2688
|
_: 1
|
|
2689
2689
|
}),
|
|
2690
|
-
|
|
2690
|
+
C(r(ie), {
|
|
2691
2691
|
size: "lg",
|
|
2692
2692
|
intent: "subtle",
|
|
2693
2693
|
onClick: le
|
|
2694
2694
|
}, {
|
|
2695
|
-
default:
|
|
2696
|
-
|
|
2695
|
+
default: _(() => [
|
|
2696
|
+
V(k(d.value), 1)
|
|
2697
2697
|
]),
|
|
2698
2698
|
_: 1
|
|
2699
2699
|
})
|
|
@@ -2704,7 +2704,7 @@ const fn = {
|
|
|
2704
2704
|
]), 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"]));
|
|
2705
2705
|
}
|
|
2706
2706
|
});
|
|
2707
|
-
function
|
|
2707
|
+
function An() {
|
|
2708
2708
|
const { deactivateAutoTopUpConfig: e } = kt(), t = Ae(), o = O(!1);
|
|
2709
2709
|
return { deactivate: async (a) => {
|
|
2710
2710
|
if (!a || o.value)
|
|
@@ -2724,7 +2724,7 @@ function Mn() {
|
|
|
2724
2724
|
}
|
|
2725
2725
|
}, isDeactivating: o };
|
|
2726
2726
|
}
|
|
2727
|
-
const
|
|
2727
|
+
const Un = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, Sn = /* @__PURE__ */ H({
|
|
2728
2728
|
__name: "AutoTopUpCancellationModal",
|
|
2729
2729
|
props: {
|
|
2730
2730
|
showModal: { type: Boolean },
|
|
@@ -2732,27 +2732,27 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2732
2732
|
},
|
|
2733
2733
|
emits: ["confirmed", "close"],
|
|
2734
2734
|
setup(e, { emit: t }) {
|
|
2735
|
-
const o = e, n = t, { $t: a } =
|
|
2736
|
-
|
|
2735
|
+
const o = e, n = t, { $t: a } = G(), { formatValue: i } = Ue(), { deactivate: u, isDeactivating: s } = An(), m = O(!1);
|
|
2736
|
+
Q(
|
|
2737
2737
|
() => o.showModal,
|
|
2738
2738
|
(c) => {
|
|
2739
2739
|
c && (m.value = !1);
|
|
2740
2740
|
}
|
|
2741
2741
|
);
|
|
2742
|
-
const h =
|
|
2743
|
-
var P,
|
|
2744
|
-
const c = (P = o.config) == null ? void 0 : P.threshold,
|
|
2742
|
+
const h = l(() => {
|
|
2743
|
+
var P, x;
|
|
2744
|
+
const c = (P = o.config) == null ? void 0 : P.threshold, y = (x = o.config) == null ? void 0 : x.topup_amount;
|
|
2745
2745
|
return !(c != null && c.amount) && !(c != null && c.credits) ? a({
|
|
2746
2746
|
defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
|
|
2747
2747
|
description: "Explanation in the modal that turns a wallet automatic top-up off",
|
|
2748
2748
|
id: "auto_topup_cancellation_modal.explanation"
|
|
2749
|
-
}) :
|
|
2749
|
+
}) : y ? a(
|
|
2750
2750
|
{
|
|
2751
2751
|
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.",
|
|
2752
2752
|
description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
|
|
2753
2753
|
id: "auto_topup_cancellation_modal.explanation_with_amount"
|
|
2754
2754
|
},
|
|
2755
|
-
{ amount: i({ amount:
|
|
2755
|
+
{ amount: i({ amount: y }), threshold: i(c) }
|
|
2756
2756
|
) : a(
|
|
2757
2757
|
{
|
|
2758
2758
|
defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
|
|
@@ -2761,11 +2761,11 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2761
2761
|
},
|
|
2762
2762
|
{ threshold: i(c) }
|
|
2763
2763
|
);
|
|
2764
|
-
}),
|
|
2765
|
-
var
|
|
2766
|
-
const c = (
|
|
2764
|
+
}), T = async () => {
|
|
2765
|
+
var y;
|
|
2766
|
+
const c = (y = o.config) == null ? void 0 : y.id;
|
|
2767
2767
|
if (!(!c || s.value)) {
|
|
2768
|
-
if (m.value = !1, !await
|
|
2768
|
+
if (m.value = !1, !await u(c)) {
|
|
2769
2769
|
m.value = !0;
|
|
2770
2770
|
return;
|
|
2771
2771
|
}
|
|
@@ -2774,7 +2774,7 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2774
2774
|
}, A = () => {
|
|
2775
2775
|
s.value || n("close");
|
|
2776
2776
|
};
|
|
2777
|
-
return (c,
|
|
2777
|
+
return (c, y) => (b(), E(r(ft), {
|
|
2778
2778
|
size: "sm",
|
|
2779
2779
|
"show-modal": e.showModal,
|
|
2780
2780
|
"is-loading": r(s),
|
|
@@ -2795,23 +2795,23 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2795
2795
|
description: "Button dismissing the modal that turns a wallet automatic top-up off",
|
|
2796
2796
|
id: "auto_topup_cancellation_modal.cancel"
|
|
2797
2797
|
}),
|
|
2798
|
-
onConfirm:
|
|
2798
|
+
onConfirm: T,
|
|
2799
2799
|
onClose: A
|
|
2800
2800
|
}, {
|
|
2801
|
-
body:
|
|
2802
|
-
|
|
2803
|
-
|
|
2801
|
+
body: _(() => [
|
|
2802
|
+
R("div", Un, [
|
|
2803
|
+
C(r(ee), {
|
|
2804
2804
|
variant: "body-sm",
|
|
2805
2805
|
color: "subtle",
|
|
2806
2806
|
tag: "p",
|
|
2807
2807
|
class: "sv-auto-topup-cancellation-modal__explanation"
|
|
2808
2808
|
}, {
|
|
2809
|
-
default:
|
|
2810
|
-
|
|
2809
|
+
default: _(() => [
|
|
2810
|
+
V(k(h.value), 1)
|
|
2811
2811
|
]),
|
|
2812
2812
|
_: 1
|
|
2813
2813
|
}),
|
|
2814
|
-
m.value ? (b(),
|
|
2814
|
+
m.value ? (b(), E(r(me), {
|
|
2815
2815
|
key: 0,
|
|
2816
2816
|
class: "sv-auto-topup-cancellation-modal__error sv-error",
|
|
2817
2817
|
title: r(a)({
|
|
@@ -2819,13 +2819,13 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2819
2819
|
description: "Error shown when turning a wallet automatic top-up off failed",
|
|
2820
2820
|
id: "auto_topup_cancellation_modal.failed"
|
|
2821
2821
|
})
|
|
2822
|
-
}, null, 8, ["title"])) :
|
|
2822
|
+
}, null, 8, ["title"])) : N("", !0)
|
|
2823
2823
|
])
|
|
2824
2824
|
]),
|
|
2825
2825
|
_: 1
|
|
2826
2826
|
}, 8, ["show-modal", "is-loading", "no-click-away", "no-backdrop-close", "title", "confirm-button-text", "cancel-button-text"]));
|
|
2827
2827
|
}
|
|
2828
|
-
}),
|
|
2828
|
+
}), na = /* @__PURE__ */ H({
|
|
2829
2829
|
inheritAttrs: !1,
|
|
2830
2830
|
__name: "CustomerWalletBalances",
|
|
2831
2831
|
props: {
|
|
@@ -2839,25 +2839,30 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2839
2839
|
},
|
|
2840
2840
|
emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
|
|
2841
2841
|
setup(e, { emit: t }) {
|
|
2842
|
-
const o = e, n = t, { $t: a } =
|
|
2843
|
-
() =>
|
|
2844
|
-
),
|
|
2845
|
-
() =>
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2842
|
+
const o = e, n = t, { $t: a } = G(), i = l(
|
|
2843
|
+
() => Oo(o.walletBalances, o.subscriptions)
|
|
2844
|
+
), u = l(
|
|
2845
|
+
() => {
|
|
2846
|
+
var x;
|
|
2847
|
+
return (x = o.paymentMethods) == null ? void 0 : x.filter((M) => mo(M));
|
|
2848
|
+
}
|
|
2849
|
+
), s = O(), m = l(
|
|
2850
|
+
() => Qe(i.value, s.value)
|
|
2851
|
+
), h = l(() => !!m.value), T = O(), A = l(() => !!T.value), c = l(
|
|
2852
|
+
() => Qe(i.value, T.value)
|
|
2853
|
+
), y = O(), P = l(() => !!y.value);
|
|
2854
|
+
return (x, M) => (b(), L(we, null, [
|
|
2855
|
+
e.isLoading ? (b(), E(lt, ae({
|
|
2851
2856
|
key: 0,
|
|
2852
2857
|
variant: "section"
|
|
2853
|
-
},
|
|
2858
|
+
}, x.$attrs, { class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48" }), null, 16)) : e.hasError ? (b(), E(r(me), ae({ key: 1 }, x.$attrs, {
|
|
2854
2859
|
class: "sv-wallet-balances sv-root sv-component sv-error",
|
|
2855
2860
|
title: r(a)({
|
|
2856
2861
|
defaultMessage: "Could not load wallet balances",
|
|
2857
2862
|
description: "Error shown when wallet balances fail to load",
|
|
2858
2863
|
id: "wallet_balance.load_failed"
|
|
2859
2864
|
})
|
|
2860
|
-
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (b(),
|
|
2865
|
+
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (b(), E(r(Eo), ae({ key: 2 }, x.$attrs, {
|
|
2861
2866
|
class: "sv-wallet-balances sv-root sv-component",
|
|
2862
2867
|
"customer-wallet-balances": i.value,
|
|
2863
2868
|
"show-auto-top-up": e.showTopUpButton,
|
|
@@ -2870,52 +2875,53 @@ const An = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2870
2875
|
},
|
|
2871
2876
|
{ count: String(e.walletBalances.length) }
|
|
2872
2877
|
),
|
|
2873
|
-
onTopUp:
|
|
2874
|
-
onAutoTopUp:
|
|
2875
|
-
onCancelAutoTopUp:
|
|
2876
|
-
}), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) :
|
|
2877
|
-
e.showTopUpButton ? (b(),
|
|
2878
|
+
onTopUp: M[0] || (M[0] = ($) => s.value = $),
|
|
2879
|
+
onAutoTopUp: M[1] || (M[1] = ($) => T.value = $),
|
|
2880
|
+
onCancelAutoTopUp: M[2] || (M[2] = ($) => y.value = $)
|
|
2881
|
+
}), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) : N("", !0),
|
|
2882
|
+
e.showTopUpButton ? (b(), E(yn, {
|
|
2878
2883
|
key: 3,
|
|
2879
|
-
"show-modal":
|
|
2880
|
-
"selected-balance-item":
|
|
2881
|
-
"payment-methods":
|
|
2884
|
+
"show-modal": h.value,
|
|
2885
|
+
"selected-balance-item": m.value,
|
|
2886
|
+
"payment-methods": u.value,
|
|
2882
2887
|
customer: e.customer,
|
|
2883
2888
|
subscriptions: e.subscriptions,
|
|
2884
|
-
onClose:
|
|
2885
|
-
onConfirm:
|
|
2886
|
-
onAutoTopUpSaved:
|
|
2887
|
-
onPaymentSuccess:
|
|
2888
|
-
onPaymentFailed:
|
|
2889
|
-
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) :
|
|
2890
|
-
e.showTopUpButton ? (b(),
|
|
2889
|
+
onClose: M[3] || (M[3] = ($) => s.value = void 0),
|
|
2890
|
+
onConfirm: M[4] || (M[4] = ($) => n("top-up-charged")),
|
|
2891
|
+
onAutoTopUpSaved: M[5] || (M[5] = ($) => n("auto-top-up-saved")),
|
|
2892
|
+
onPaymentSuccess: M[6] || (M[6] = ($) => n("payment-method-stored")),
|
|
2893
|
+
onPaymentFailed: M[7] || (M[7] = ($) => n("payment-failed", $))
|
|
2894
|
+
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : N("", !0),
|
|
2895
|
+
e.showTopUpButton ? (b(), E(Mn, {
|
|
2891
2896
|
key: 4,
|
|
2892
|
-
"show-modal":
|
|
2893
|
-
"wallet-balance-item":
|
|
2894
|
-
"top-up-item":
|
|
2895
|
-
"payment-methods":
|
|
2897
|
+
"show-modal": A.value,
|
|
2898
|
+
"wallet-balance-item": c.value,
|
|
2899
|
+
"top-up-item": T.value,
|
|
2900
|
+
"payment-methods": u.value,
|
|
2896
2901
|
customer: e.customer,
|
|
2897
|
-
onClose:
|
|
2898
|
-
onSaved:
|
|
2899
|
-
onPaymentSuccess:
|
|
2900
|
-
onPaymentFailed:
|
|
2901
|
-
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) :
|
|
2902
|
-
e.showTopUpButton ? (b(),
|
|
2902
|
+
onClose: M[8] || (M[8] = ($) => T.value = void 0),
|
|
2903
|
+
onSaved: M[9] || (M[9] = ($) => n("auto-top-up-saved")),
|
|
2904
|
+
onPaymentSuccess: M[10] || (M[10] = ($) => n("payment-method-stored")),
|
|
2905
|
+
onPaymentFailed: M[11] || (M[11] = ($) => n("payment-failed", $))
|
|
2906
|
+
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : N("", !0),
|
|
2907
|
+
e.showTopUpButton ? (b(), E(Sn, {
|
|
2903
2908
|
key: 5,
|
|
2904
|
-
"show-modal":
|
|
2905
|
-
config:
|
|
2906
|
-
onClose:
|
|
2907
|
-
onConfirmed:
|
|
2908
|
-
}, null, 8, ["show-modal", "config"])) :
|
|
2909
|
+
"show-modal": P.value,
|
|
2910
|
+
config: y.value,
|
|
2911
|
+
onClose: M[12] || (M[12] = ($) => y.value = void 0),
|
|
2912
|
+
onConfirmed: M[13] || (M[13] = ($) => n("auto-top-up-cancelled"))
|
|
2913
|
+
}, null, 8, ["show-modal", "config"])) : N("", !0)
|
|
2909
2914
|
], 64));
|
|
2910
2915
|
}
|
|
2911
2916
|
});
|
|
2912
2917
|
export {
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2918
|
+
vn as _,
|
|
2919
|
+
na as a,
|
|
2920
|
+
Rt as b,
|
|
2921
|
+
Ot as c,
|
|
2922
|
+
jo as d,
|
|
2923
|
+
$t as e,
|
|
2924
|
+
fn as g,
|
|
2925
|
+
oa as i,
|
|
2926
|
+
ta as u
|
|
2921
2927
|
};
|