@solvimon/solvimon-web 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +3 -0
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DJCMa2Lz.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B70SyWOB.mjs} +6 -6
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js} +1 -1
- package/dist/Alert.vue.es-RyK53a2P.js +1 -0
- package/dist/Alert.vue.es-lIiAWf2S.mjs +146 -0
- package/dist/{Avatar.vue.es-ChcLSNaN.mjs → Avatar.vue.es-2E3laNRb.mjs} +1 -1
- package/dist/{Avatar.vue.es-CJw5z7Uu.js → Avatar.vue.es-DdJreyr_.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CTQ5RMtx.js → BillingInformation.vue_vue_type_script_setup_true_lang-ConpyC8n.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DApMAncl.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D5EoBLhj.mjs} +4 -4
- package/dist/{Button.vue.es-VQCd3V3C.mjs → Button.vue.es-BJEy-e9C.mjs} +1 -1
- package/dist/{Button.vue.es-BWl37nzm.js → Button.vue.es-CJNxYacb.js} +1 -1
- package/dist/Checkout.entry.ce-BfLlnQyb.js +1 -0
- package/dist/{Checkout.entry.ce-DRHqEFd7.mjs → Checkout.entry.ce-CQkrWscC.mjs} +1397 -1302
- package/dist/{Chip.vue.es-CXG8o1Qf.mjs → Chip.vue.es-DGbc4L_D.mjs} +2 -2
- package/dist/{Chip.vue.es-DUgjuRWm.js → Chip.vue.es-DLQ4QEPo.js} +1 -1
- package/dist/{ContextMenu.vue.es-BllxeDTt.js → ContextMenu.vue.es-Bd2kmeVq.js} +1 -1
- package/dist/{ContextMenu.vue.es-C6TKlSXs.mjs → ContextMenu.vue.es-DL1M7pcr.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-CKQH_ds0.mjs → CustomerBillingInformation.vue.es-CE94ASC3.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-CMCZ-lIM.js → CustomerBillingInformation.vue.es-hiFzB43w.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BxwllXwU.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bhih7rPR.mjs} +5 -5
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CtaoLbrM.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C5zc9n64.mjs} +486 -502
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js +1 -0
- package/dist/{DividerText.vue.es-Bomiy4if.mjs → DividerText.vue.es-CFZUQ62L.mjs} +1 -1
- package/dist/{DividerText.vue.es-BBdydUy_.js → DividerText.vue.es-CvCgHHXN.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C9elbdbF.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js} +1 -1
- package/dist/{ErrorNotification.vue.es-C6ngWAVU.mjs → ErrorNotification.vue.es-B3mvv79S.mjs} +2 -2
- package/dist/ErrorNotification.vue.es-DI2B7WiR.js +1 -0
- package/dist/IconButton.vue.es-Dp8h4YOx.js +1 -0
- package/dist/IconButton.vue.es-GLcGhoHC.mjs +56 -0
- package/dist/{IconTitle.vue.es-Bbusc4wK.mjs → IconTitle.vue.es-CzuPQtOX.mjs} +3 -3
- package/dist/{IconTitle.vue.es-D-q6w2E-.js → IconTitle.vue.es-DN9r6nfK.js} +1 -1
- package/dist/{Input.vue.es-AY1c0Rui.mjs → Input.vue.es-5Cq8a7oH.mjs} +2 -2
- package/dist/{Input.vue.es-BN95nPBw.js → Input.vue.es-DM81HeVv.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-1WjSbPEP.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D75LSIL8.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-qiBCPY8l.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-w8w52LcV.js} +1 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-DB5h39LA.js +1 -0
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-D99nuBRE.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-dRLsZPNh.mjs} +3 -3
- package/dist/{InvoiceSummary.vue.es-Bs5c2Ovx.mjs → InvoiceSummary.vue.es-DbtqsTuP.mjs} +692 -705
- package/dist/InvoiceSummary.vue.es-Qy99kLZs.js +1 -0
- package/dist/{Modal.vue.es-Chi6_MH_.js → Modal.vue.es-DgLl6XBV.js} +1 -1
- package/dist/{Modal.vue.es-DSkC4eMv.mjs → Modal.vue.es-Z2DWAN2u.mjs} +5 -5
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBm51C7c.js +1 -0
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DYuFPIqs.mjs +294 -0
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DVif_ME8.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-budeR7ep.mjs → PaymentHistoryBlock-CjP_514k.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-DGJ_PiVq.js → PaymentHistoryBlock-DS1j-8m-.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dv-3suBX.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CSTfMB8U.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C28ofG7N.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dr2jtJhK.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-DqqGcEP1.js → PaymentIntegrationForm-80b19Lkq.js} +1 -1
- package/dist/{PaymentIntegrationForm-Crrhar96.mjs → PaymentIntegrationForm-CpOZUf-W.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C4bk0m8g.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BgztoQH5.mjs} +3 -3
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DKXhthkA.js} +1 -1
- package/dist/{PaymentIntegrationFormAdyen-DM-xMcm0.mjs → PaymentIntegrationFormAdyen-BQcgDcik.mjs} +281 -204
- package/dist/PaymentIntegrationFormAdyen-DElXsJ96.js +98 -0
- package/dist/PaymentIntegrationFormStripe-CMwLqOe6.js +102 -0
- package/dist/{PaymentIntegrationFormStripe-yBm4KnpV.mjs → PaymentIntegrationFormStripe-Dx1H3fZ2.mjs} +249 -178
- package/dist/{PaymentMethod.vue.es-BdMcKq8_.mjs → PaymentMethod.vue.es-EhRCfeax.mjs} +3 -3
- package/dist/{PaymentMethod.vue.es-Ctw9Es1g.js → PaymentMethod.vue.es-pLCCzVxN.js} +1 -1
- package/dist/{PaymentMethodForm-BQ5TVHlS.js → PaymentMethodForm-Bw2e1tXo.js} +1 -1
- package/dist/{PaymentMethodForm-C1bIGX10.mjs → PaymentMethodForm-D3OY8zK5.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-V88bCeDt.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-DHXw6qD0.js} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-5KKkuVt5.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-vGprVPpn.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-B_207kq5.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CdT1YyeU.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CnmZ9dvP.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-D7b0HhDc.mjs} +6 -6
- package/dist/PlanCustomizationEditor-BQqkgmzL.mjs +877 -0
- package/dist/PlanCustomizationEditor-RC8kj2rC.js +1 -0
- package/dist/{PricingGroupRangeInput.vue.es-D82XvoC_.js → PricingGroupRangeInput.vue.es-ClkE98ML.js} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-Bnb-ARie.mjs → PricingGroupRangeInput.vue.es-DNsiUZyT.mjs} +4 -4
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CxMkCmti.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-skQMgHEL.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CURXAgMT.mjs} +5 -5
- package/dist/RadioGroupExtended.vue.es-Dk9xdj76.js +1 -0
- package/dist/{RadioGroupExtended.vue.es-WDbo_yj1.mjs → RadioGroupExtended.vue.es-vUqn2ZUP.mjs} +3 -3
- package/dist/{Section.vue.es-By1JltGi.mjs → Section.vue.es-C2_topx4.mjs} +1 -1
- package/dist/{Section.vue.es-DuK52y67.js → Section.vue.es-Cybk1Nb8.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CS3KIkPL.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-C9q_qwjt.mjs} +6 -6
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js} +1 -1
- package/dist/{SubscriptionSchedules-DDCjVEbG.mjs → SubscriptionSchedules-BlCU_xc5.mjs} +1 -1
- package/dist/{SubscriptionSchedules-DEjIERyF.js → SubscriptionSchedules-CNTg_oRy.js} +1 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-6LbR_Vni.js +1 -0
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-JAedXFzq.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cf3Dy8Yn.mjs} +1655 -1620
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DVMS4gJQ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-CjzjchsS.mjs} +3 -3
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BckZJtOc.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-CxdrAanb.mjs} +7 -7
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DiXmEjUD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Dz4s3CH_.js} +1 -1
- package/dist/{TooltipParagraph.vue.es-DYu2ReL7.mjs → TooltipParagraph.vue.es-Fu9Od3Vr.mjs} +1 -1
- package/dist/{TooltipParagraph.vue.es-sTgWAgcd.js → TooltipParagraph.vue.es-OX6bAWP9.js} +1 -1
- package/dist/{TrialChip.vue.es-Cl-9_pdr.js → TrialChip.vue.es-CbjdkR4i.js} +1 -1
- package/dist/{TrialChip.vue.es-DX53r0ku.mjs → TrialChip.vue.es-c7tZOIW3.mjs} +2 -2
- package/dist/{cn.es-DjnGlmqV.mjs → cn.es-C8Ogac5T.mjs} +2 -2
- package/dist/{cn.es-CNvIP217.js → cn.es-lC4_Xd0R.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +5 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +7 -7
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +5 -5
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +10 -10
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +8 -8
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +4 -4
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +9 -9
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +5 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +6 -6
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +4 -4
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +26 -23
- package/dist/{customElements-Bt8PbjIn.js → customElements-BYIdPSzQ.js} +43 -19
- package/dist/{customElements-Com2NiGU.mjs → customElements-Df6dGrN-.mjs} +603 -572
- package/dist/{customer-CKgMJEgv.mjs → customer-DmsKYpVi.mjs} +1 -1
- package/dist/{customer-Q4JGfVfq.js → customer-DoLHZuMG.js} +1 -1
- package/dist/{de-DE-DqLD4IX2.js → de-DE-BSlbAnPE.js} +1 -1
- package/dist/{de-DE-CVCmzlNH.mjs → de-DE-Bgm9bnmp.mjs} +21 -0
- package/dist/{de-DE-Ds_yJLS3.js → de-DE-CAL9Mji2.js} +1 -1
- package/dist/{de-DE-DBO5f-Eu.mjs → de-DE-DXsG-vXA.mjs} +13 -8
- package/dist/{en-US-CvFmmI_O.js → en-US-9xdcz3T5.js} +1 -1
- package/dist/{en-US-3UmnS23B.mjs → en-US-C939IZ5i.mjs} +13 -8
- package/dist/{en-US-DVR9O7b_.mjs → en-US-E86eRIxh.mjs} +21 -0
- package/dist/{en-US-C51ILrVv.js → en-US-_xe5H4TQ.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{invoices-CV9iAUHf.mjs → invoices-CrO6p4Ms.mjs} +8 -5
- package/dist/invoices-mw87cNTS.js +1 -0
- package/dist/{it-IT-CxBRisRm.mjs → it-IT-BxpwB3oJ.mjs} +8 -3
- package/dist/it-IT-DT3rfjOY.js +1 -0
- package/dist/{it-IT-Dxw59eR_.js → it-IT-QFQ1Ajbb.js} +1 -1
- package/dist/{it-IT-CDMnnFKZ.mjs → it-IT-co1BfV5s.mjs} +23 -2
- package/dist/{nl-NL-Btbfd9p2.js → nl-NL-CJXJC1bx.js} +1 -1
- package/dist/nl-NL-DfkhOJKc.js +1 -0
- package/dist/{nl-NL-o3UvtSNg.mjs → nl-NL-Drv2E66B.mjs} +21 -0
- package/dist/{nl-NL-BWGkVweu.mjs → nl-NL-na2I4aiP.mjs} +8 -3
- package/dist/paymentFailure-Bh60UhxA.mjs +47 -0
- package/dist/paymentFailure-Cki8c5BX.js +1 -0
- package/dist/{paymentMethods-BuwoJ1y9.mjs → paymentMethods-BNQbW_f1.mjs} +1 -1
- package/dist/{paymentMethods-ChWAwDSF.js → paymentMethods-CQdhZwq4.js} +1 -1
- package/dist/{payments-DGckugN0.js → payments-KTjVHqOa.js} +1 -1
- package/dist/{payments-C_cMXQzE.mjs → payments-VS_N2xpJ.mjs} +1 -1
- package/dist/pricingItemConfigs.es-D4aYkYcf.js +1 -0
- package/dist/{pricingItemConfigs.es-DMf1e6y7.mjs → pricingItemConfigs.es-ORxsk_YS.mjs} +23 -22
- package/dist/pricingPlanSchedule-BM8vsKkV.js +1 -0
- package/dist/pricingPlanSchedule-BPrS2WRd.mjs +132 -0
- package/dist/screens/Checkout/Checkout.cjs +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +21 -21
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +14 -14
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +10 -10
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +21 -21
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +20 -20
- package/dist/sessionReference-3h-6FdrC.mjs +43 -0
- package/dist/sessionReference-m_6Rp4X1.js +1 -0
- package/dist/{subscription-CvfAEJeP.mjs → subscription-CrVOr5MF.mjs} +1 -1
- package/dist/{subscription-9GORG-Gt.js → subscription-ZA62t4E9.js} +1 -1
- package/dist/subscriptions-Dugd-oZ1.js +1 -0
- package/dist/{subscriptions-B5VqRayX.mjs → subscriptions-U4xg2CO1.mjs} +2 -2
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +1 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.lib.d.ts +2 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +10 -1
- package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +1 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +6 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +6 -0
- package/dist/types/composables/useInvoicePreview.types.d.ts +1 -0
- package/dist/types/public/components/Invoice/Invoice.types.d.ts +1 -1
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +1 -1
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +1 -1
- package/dist/types/types/errors.d.ts +5 -0
- package/dist/{useActionDispatchProvider-B54GYEY7.js → useActionDispatchProvider-CTyDGRX8.js} +1 -1
- package/dist/{useActionDispatchProvider-e2lQXTid.mjs → useActionDispatchProvider-DyQbRCxR.mjs} +1 -1
- package/dist/{useCustomer-BJwJ9BkJ.js → useCustomer-BXI5Vmit.js} +1 -1
- package/dist/{useCustomer-CC9zxV6c.mjs → useCustomer-dcmU1539.mjs} +1 -1
- package/dist/useCustomerFormLabels-BC1WfqWo.mjs +968 -0
- package/dist/useCustomerFormLabels-Ct6vD_b8.js +1 -0
- package/dist/{useExperimentalFeature-B0IFn3Uw.mjs → useExperimentalFeature-4Y-ppDr7.mjs} +1 -1
- package/dist/{useExperimentalFeature-8Mzpj5wc.js → useExperimentalFeature-9-p9_nP6.js} +1 -1
- package/dist/{useInvoiceData-6mHUZC9a.mjs → useInvoiceData-B2Z9aD2w.mjs} +2 -2
- package/dist/{useInvoiceData-Bblwdl0f.js → useInvoiceData-CGvtl7Ai.js} +1 -1
- package/dist/{useInvoicesList-_U1-tn9_.js → useInvoicesList-Ba0GO8p-.js} +1 -1
- package/dist/{useInvoicesList-B5H5JfvY.mjs → useInvoicesList-DJPznhig.mjs} +7 -7
- package/dist/{useLoadInitialData-CezlvhBV.js → useLoadInitialData-BO9ZsSsF.js} +1 -1
- package/dist/{useLoadInitialData-ux_wpNiR.mjs → useLoadInitialData-CWyI3_RR.mjs} +1 -1
- package/dist/{usePaymentMethodAvailability-CkR4TwoV.mjs → usePaymentMethodAvailability-DqIvkjLF.mjs} +4 -4
- package/dist/{usePaymentMethodAvailability-DRwrBdto.js → usePaymentMethodAvailability-bkmDrPXY.js} +1 -1
- package/dist/{usePaymentMethodOptions-B6GIM9q4.js → usePaymentMethodOptions-BPBVGNDg.js} +1 -1
- package/dist/{usePaymentMethodOptions-BfnLBZOo.mjs → usePaymentMethodOptions-MSEp39xQ.mjs} +1 -1
- package/dist/{usePaymentMethods-GFmQRp0X.js → usePaymentMethods-BAOtOJZD.js} +1 -1
- package/dist/{usePaymentMethods-C3QfLSrP.mjs → usePaymentMethods-U7gnZ0F5.mjs} +1 -1
- package/dist/{usePayments-BkwGyZT0.mjs → usePayments-Dq2V6bTV.mjs} +6 -6
- package/dist/{usePayments-SQF_V7oL.js → usePayments-G-HpKpK8.js} +1 -1
- package/dist/{usePortal-BdM7hDge.js → usePortal-BplmMkBG.js} +1 -1
- package/dist/{usePortal-DDG9b6FI.mjs → usePortal-CMHV-ShD.mjs} +1 -1
- package/dist/{useSubscription-Q4C2DPhw.js → useSubscription-CvB8ROBt.js} +1 -1
- package/dist/{useSubscription-BJJYHYgr.mjs → useSubscription-V53WsZwQ.mjs} +1 -1
- package/dist/{useTimePeriod.es-pepm2TpV.js → useTimePeriod.es-CtCTu9cz.js} +1 -1
- package/dist/{useTimePeriod.es-9tZvAhyb.mjs → useTimePeriod.es-D31Zl1MJ.mjs} +1 -1
- package/dist/wallets.es-CNIMW5ay.js +1 -0
- package/dist/wallets.es-eH2C2ygn.mjs +102 -0
- package/package.json +2 -1
- package/dist/Checkout.entry.ce-BTVuGyNq.js +0 -1
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js +0 -1
- package/dist/ErrorNotification.vue.es-0ZC_DozN.js +0 -1
- package/dist/IconButton.vue.es-DAR7e8NA.mjs +0 -198
- package/dist/IconButton.vue.es-DGLIdHkR.js +0 -1
- package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-BXTInmf9.js +0 -1
- package/dist/InvoiceSummary.vue.es-B0MPR0oI.js +0 -1
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-Draz_8Ts.js +0 -1
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-vD88j_U7.mjs +0 -144
- package/dist/PaymentIntegrationFormAdyen-DronjwO3.js +0 -98
- package/dist/PaymentIntegrationFormStripe-ybM6wirp.js +0 -102
- package/dist/PlanCustomizationEditor-CCOTD6Qu.mjs +0 -769
- package/dist/PlanCustomizationEditor-CiZnVCM6.js +0 -1
- package/dist/RadioGroupExtended.vue.es-B1YtLNKG.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BlX0W6lw.js +0 -1
- package/dist/component-5wqcK7yz.mjs +0 -8
- package/dist/component-B7ZDyqBp.js +0 -1
- package/dist/invoices-CvpL4rv5.js +0 -1
- package/dist/it-IT-CFEfSpPH.js +0 -1
- package/dist/nl-NL-jtVgF3jx.js +0 -1
- package/dist/pricingItemConfigs.es-DlybwIh1.js +0 -1
- package/dist/pricingPlanSchedule-COfmWv_o.js +0 -1
- package/dist/pricingPlanSchedule-J1nb9pCu.mjs +0 -129
- package/dist/subscriptions-X0Ciw8z3.js +0 -1
- package/dist/useCustomerFormLabels-72Pxw8X5.js +0 -1
- package/dist/useCustomerFormLabels-V2YuYMLU.mjs +0 -930
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),Je=require("./api.es-duCDtZD9.js"),M=require("./customElements-BYIdPSzQ.js"),Ze=require("./sessionReference-m_6Rp4X1.js"),et=require("./useService-H7BjLg8P.js"),Me=require("./ErrorNotification.vue.es-DI2B7WiR.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),ue=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-CJNxYacb.js"),j=require("./TooltipParagraph.vue.es-OX6bAWP9.js"),Z=require("./Section.vue.es-Cybk1Nb8.js"),Se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),xe=require("./RadioGroupExtended.vue.es-Dk9xdj76.js"),I=require("./index-DwueOtPi.js"),le=require("./formatting.es-C72Nsrmh.js"),tt=require("./Divider.vue.es-UwnWvUTl.js"),Be=require("./Expand.vue.es-BtM0EZEr.js"),Ue=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js"),ot=require("./cn.es-lC4_Xd0R.js"),Pe=require("./invoices-mw87cNTS.js"),nt=require("./useWatchDebounced-CAU1WI1P.js"),at=require("./Input.vue.es-DM81HeVv.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js"),it=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js"),st=require("./customer.es-BButyYo0.js"),ut=require("./usePaymentMethodOptions-BPBVGNDg.js"),Ae=require("./Modal.vue.es-DgLl6XBV.js"),lt=3e4,ne=60,ae=12,rt=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:s}=M.useIntl(),l=e.ref(Date.now());let u;e.onMounted(()=>{u=setInterval(()=>{l.value=Date.now()},lt)}),e.onBeforeUnmount(()=>{clearInterval(u)});const d=(f,v)=>{const p=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?p-1:p},g=e.computed(()=>{const f=Math.max(0,(l.value-a.date.getTime())/1e3);if(f<ne)return i({defaultMessage:"{count, plural, one {# second} other {# seconds}} ago",id:"dateTimeAgo.seconds",description:"Relative time in whole seconds"},{count:Math.trunc(f)});if(f<o)return i({defaultMessage:"{count, plural, one {# minute} other {# minutes}} ago",id:"dateTimeAgo.minutes",description:"Relative time in whole minutes"},{count:Math.trunc(f/ne)});if(f<n)return i({defaultMessage:"{count, plural, one {# hour} other {# hours}} ago",id:"dateTimeAgo.hours",description:"Relative time in whole hours"},{count:Math.trunc(f/o)});const v=d(a.date,new Date(l.value));if(v<1){const p=Math.trunc(f/n);return p===1?i({defaultMessage:"yesterday",id:"dateTimeAgo.yesterday",description:'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'}):i({defaultMessage:"{count, plural, one {# day} other {# days}} ago",id:"dateTimeAgo.days",description:"Relative time in whole days"},{count:p})}return v<ae?i({defaultMessage:"{count, plural, one {# month} other {# months}} ago",id:"dateTimeAgo.months",description:"Relative time in whole months"},{count:v}):i({defaultMessage:"{count, plural, one {# year} other {# years}} ago",id:"dateTimeAgo.years",description:"Relative time in whole years"},{count:Math.trunc(v/ae)})}),y=e.computed(()=>a.actionVerb?`${a.actionVerb} ${g.value}`:g.value),S=e.computed(()=>s({date:a.date,format:"dateTime",offsetType:"local"}));return(f,v)=>(e.openBlock(),e.createBlock(j._sfc_main,null,{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.value),1)]),_:1}))}}),ct=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=h=>ue.formatWalletBalanceValue(o,n,h),i=e.computed(()=>{var h,T;return((T=(h=t.walletBalance.wallet)==null?void 0:h.wallet_type)==null?void 0:T.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),s=h=>{var T;return(((T=h.pricing_item)==null?void 0:T.configs)??[]).filter(m=>!!m.on_demand)},l=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(h=>s(h).some(T=>J.isFixedPricing(T)||J.isFlexiblePricing(T)))),u=e.computed(()=>l.value.find(h=>s(h).some(T=>J.isFlexiblePricing(T)))),d=e.computed(()=>!!t.showManualTopUp&&l.value.length>0),g=e.computed(()=>!!t.showAutoTopUp&&!!u.value),y=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet)==null?void 0:h.auto_top_up_configs)==null?void 0:T.find(m=>m.status==="ACTIVE")}),S=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet_balance.open_balance)==null?void 0:h.credits)==null?void 0:T.credit_type}),f=(h,T)=>a({credits:{quantity:h,credit_type_id:T,credit_type:S.value}}),v=h=>h.amount?a({amount:h.amount}):h.credits?f(h.credits.quantity,h.credits.credit_type_id):"",p=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.pricing_item_id;if(!m)return;const C=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===m).flatMap(A=>s(A)).flatMap(A=>A.wallet_grants??[]),B=(T=t.walletBalance.wallet)==null?void 0:T.wallet_type_id;return C.find(A=>A.wallet_type_id===B)??C[0]}),w=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.topup_amount,C=(T=p.value)==null?void 0:T.credits_grant;if(!m||!C)return"";if(C.credits)return f(C.credits.quantity,C.credits.credit_type_id);if(C.conversion){const B=Number(m.quantity)*Number(C.conversion.rate);return f(String(B),C.conversion.credit_type_id)}return""}),P=e.computed(()=>y.value?o({defaultMessage:"Auto top-up enabled",id:"wallet_balance.auto_top_up_enabled_label",description:"Label shown when a wallet tops itself up automatically"}):o({defaultMessage:"No auto top-up enabled",id:"wallet_balance.auto_top_up_disabled_label",description:"Label shown when a wallet has no automatic top-up configured"})),D=e.computed(()=>{const h=y.value;if(!h)return o({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.",id:"wallet_balance.auto_top_up_setup_explanation",description:"Tooltip explaining what automatic top-ups do, shown when none is configured yet"});const T=h.topup_amount?a({amount:h.topup_amount}):"",m=v(h.threshold);return!T||!m?o({defaultMessage:"Your balance is topped up automatically once it runs low.",id:"wallet_balance.auto_top_up_generic_explanation",description:"Tooltip shown for an active automatic top-up whose amount or threshold is unknown"}):w.value?o({defaultMessage:"Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",id:"wallet_balance.auto_top_up_credits_explanation",description:"Tooltip explaining an automatic top-up that grants credits for a paid amount"},{topUpCredits:w.value,topUpAmount:T,threshold:m}):o({defaultMessage:"Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",id:"wallet_balance.auto_top_up_explanation",description:"Tooltip explaining how the automatic top-up of a wallet balance works"},{topUpAmount:T,threshold:m})});return{walletName:i,formatBalance:a,manualTopUpItems:l,flexibleManualTopUpItem:u,showManualTopUp:d,showAutoTopUp:g,activeTopUpConfig:y,autoTopUpLabel:P,autoTopUpExplanation:D}},dt={class:"flex flex-col gap-3 py-3"},pt={class:"flex flex-col gap-1 px-4"},mt={class:"flex w-full justify-between gap-3"},ft={class:"flex w-full items-center gap-4"},vt={key:0},ht={key:1,class:"flex w-full justify-between gap-3 px-4"},gt={class:"flex min-w-0 items-center gap-1"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"shrink-0"},bt=e.defineComponent({__name:"WalletBalancesItem",props:{walletBalance:{},showAutoTopUp:{type:Boolean},showManualTopUp:{type:Boolean}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){const o=t,{$t:n}=M.useIntl(),{walletName:a,formatBalance:i,manualTopUpItems:s,flexibleManualTopUpItem:l,showManualTopUp:u,showAutoTopUp:d,activeTopUpConfig:g,autoTopUpLabel:y,autoTopUpExplanation:S}=ct(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>{var p,w;return[(p=t.walletBalance.wallet_balance)!=null&&p.balance_at?(e.openBlock(),e.createBlock(rt,{key:0,date:new Date((w=t.walletBalance.wallet_balance)==null?void 0:w.balance_at),"action-verb":e.unref(n)({defaultMessage:"updated",id:"wallet_balance.updated_action_verb",description:"Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"})},null,8,["date","action-verb"])):e.createCommentVNode("",!0)]}),_:1})]),e.createElementVNode("div",ft,[e.createVNode(M._sfc_main,{variant:"body-lg",weight:"semibold","no-spacing":"",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(o.walletBalance.wallet_balance.open_balance)),1)]),_:1}),e.unref(u)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=p=>f.$emit("top-up",e.unref(s)[0]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Top up",id:"v1V8kA",description:"Button to top up a wallet balance"})),1)]),_:1})):e.createCommentVNode("",!0)])]),f.$slots.graph?(e.openBlock(),e.createElementBlock("div",vt,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",gt,[e.createVNode(j._sfc_main,{class:"min-w-0"},{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_t,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",yt,[e.unref(g)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=p=>f.$emit("cancel-auto-top-up",e.unref(g)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Disable",id:"wallet_balance.auto_top_up_disable_button",description:"Button to turn off a wallet's automatic top-up"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:1,size:"xs",intent:"secondary",onClick:v[2]||(v[2]=p=>f.$emit("auto-top-up",e.unref(l)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Enable",id:"wallet_balance.auto_top_up_enable_button",description:"Button to set up a wallet's automatic top-up"})),1)]),_:1}))])])):e.createCommentVNode("",!0)]))}}),wt={class:"flex flex-col gap-2"},Tt=e.defineComponent({__name:"WalletBalances",props:{customerWalletBalances:{},title:{default:void 0},showAutoTopUp:{type:Boolean,default:!1},showManualTopUp:{type:Boolean,default:!1}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(Z._sfc_main,{"no-spacing":"","no-border":"",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.customerWalletBalances,a=>(e.openBlock(),e.createBlock(Z._sfc_main,{key:a.wallet_id,"no-spacing":""},{default:e.withCtx(()=>[e.createVNode(bt,{"wallet-balance":a,"show-auto-top-up":t.showAutoTopUp,"show-manual-top-up":t.showManualTopUp,onTopUp:n[0]||(n[0]=i=>o.$emit("top-up",i)),onAutoTopUp:n[1]||(n[1]=i=>o.$emit("auto-top-up",i)),onCancelAutoTopUp:n[2]||(n[2]=i=>o.$emit("cancel-auto-top-up",i))},null,8,["wallet-balance","show-auto-top-up","show-manual-top-up"])]),_:2},1024))),128))])]),_:2},[o.$slots["heading-right"]?{name:"right",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"heading-right")]),key:"0"}:void 0]),1032,["title"]))}});function Ct(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Je.withExpand({expandParams:Ze.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function Mt({customerId:t}){const{getCustomerWalletBalances:o}=Ct(),{data:n,execute:a,apiStatus:i,error:s,isPending:l}=et.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:s,fetch:a,isPending:l}}const ve=(t=[],o)=>{if(o!=null&&o.pricing_item_id)return t.find(n=>(n.charge_on_demand_pricing_items??[]).some(({pricing_item_id:a})=>a===o.pricing_item_id))},St=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,xt=t=>[...new Set(((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>ce(o)&&o.pricing_plan_schedule_id?[o.pricing_plan_schedule_id]:[]))],Bt=(t,o)=>{const n=new Set(xt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:s})=>n.has(s));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:s})=>s),enabledPricingIds:i.flatMap(s=>{var l;return(((l=s.pricing_plan_schedule)==null?void 0:l.enabled_pricings)??[]).flatMap(({pricing_id:u})=>u?[u]:[])})}]})},Ut=(t,o)=>{if(!t||o.length===0)return t;const n=new Set(o);return{...t,charge_on_demand_pricing_items:(t.charge_on_demand_pricing_items??[]).filter(a=>ce(a)&&!!a.pricing_plan_schedule_id&&n.has(a.pricing_plan_schedule_id))}},Ne=t=>((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>{var a,i;if(!ce(o))return[];const n=o.pricing_item_id??((a=o.pricing_item)==null?void 0:a.id);return n?(((i=o.pricing_item)==null?void 0:i.configs)??[]).map(s=>{const l=kt(s,t),u=Pt(s,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:s,...l&&{flexiblePricing:l},...u&&{fixedPricing:u}}}):[]});function Pt(t,o){var s,l,u;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(u=(l=(s=t.details)==null?void 0:s.bands)==null?void 0:l[0])==null?void 0:u.fixed_amount;if(!n)return;const a=ke(o),i=a?Nt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const ke=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Ee=(t,o)=>{var a;const n=(a=o==null?void 0:o.wallet)==null?void 0:a.wallet_type_id;return(t.wallet_grants??[]).filter(({wallet_type_id:i})=>!n||i===n)},At=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},Nt=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.credits))==null?void 0:n.credits_grant)==null?void 0:a.credits},de=(t,o)=>({credits:{...o,quantity:t}}),Ve=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function kt(t,o){var d,g,y,S,f,v,p;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(g=(d=t.details)==null?void 0:d.bands)==null?void 0:g[0],a=((y=n==null?void 0:n.minimum_amount)==null?void 0:y.currency)??((S=n==null?void 0:n.maximum_amount)==null?void 0:S.currency)??((v=(f=o==null?void 0:o.wallet_balance.balance)==null?void 0:f.amount)==null?void 0:v.currency);if(!a)return;const i=ke(o),s=i?At(t,o):void 0,l=(p=i==null?void 0:i.credit_type)==null?void 0:p.unit_name,u=w=>{if(!w)return;const P=i&&s?Ve(w.quantity,s.rate):void 0;return P!==void 0&&i?de(P,i):{amount:w}};return{config:{...(n==null?void 0:n.minimum_amount)&&{minimum_amount:n.minimum_amount},...(n==null?void 0:n.maximum_amount)&&{maximum_amount:n.maximum_amount}},currency:a,...s&&{creditsConfiguration:{conversionRate:s.rate,...(l==null?void 0:l.singular)&&{unitNameSingle:l.singular},...(l==null?void 0:l.plural)&&{unitNamePlural:l.plural}}},bounds:{...u(n==null?void 0:n.minimum_amount)&&{minimum:u(n==null?void 0:n.minimum_amount)},...u(n==null?void 0:n.maximum_amount)&&{maximum:u(n==null?void 0:n.maximum_amount)}}}}const Et=t=>{var o,n,a,i,s;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((s=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&s.credits)},Vt=t=>{var o;for(const{fixedPricing:n,flexiblePricing:a}of t){const i=(n==null?void 0:n.value.credits)??((o=(a==null?void 0:a.bounds.minimum)??(a==null?void 0:a.bounds.maximum))==null?void 0:o.credits);if(i!=null&&i.credit_type_id)return i.credit_type_id}},$t=(t=[])=>{for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return a}},$e=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:s}of t){const l=(i==null?void 0:i.value.credits)??((o=(s==null?void 0:s.bounds.minimum)??(s==null?void 0:s.bounds.maximum))==null?void 0:o.credits);if((a=(n=l==null?void 0:l.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return l.credit_type.unit_name.plural}},Ot=(t=[])=>{var o;for(const{flexiblePricing:n}of t){const a=(o=n==null?void 0:n.creditsConfiguration)==null?void 0:o.conversionRate;if(a)return a}},It=(t=[])=>{for(const{flexiblePricing:o}of t){const{minimum_amount:n,maximum_amount:a}=(o==null?void 0:o.config)??{};if(n||a)return{...n&&{minimum:n},...a&&{maximum:a}}}return{}},Dt=(t=[])=>{if(t.some(Et)){const o=Vt(t);return o?{creditTypeId:o}:void 0}for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return{currency:a}}},qt=(t,o)=>{var l;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(l=n.minimum??n.maximum)==null?void 0:l.credits,s=a?Ve(o.quantity,a.conversionRate):void 0;return i&&s!==void 0?de(s,i):{amount:o}},Oe=(t=[])=>{const o=Dt(t);if(o)return{denomination:o,chargeCurrency:$t(t)??"",creditUnitName:$e(t),conversionRate:Ot(t),topUpBounds:It(t)}},Rt=400;function Ft({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=Pe.createInvoicesService(),a=M.useLogger(),i=e.ref(),s=e.ref(!1),l=M.createLatestGuard(),u=async()=>{const d=t.value,g=l();if(!d||!o.value){o.value&&!d&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the top-up invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,s.value=!1;return}s.value=!0;try{const y=await n({pricingPlanScheduleId:d,pricingItems:o.value});g()&&(i.value=y)}catch(y){g()&&(i.value=void 0),a.error("INVOICE_PREVIEW_FAILED","Failed to load top-up invoice preview",{},y)}finally{g()&&(s.value=!1)}};return nt.useWatchDebounced(o,()=>void u(),{debounce:Rt,deep:!0}),u(),{invoicePreview:i,isPreviewPending:s,loadPreview:u}}const Lt={key:0},Ie=e.defineComponent({__name:"TopUpInvoicePreview",props:{pricingPlanScheduleId:{type:String},pricingItems:{type:Array}},setup(t){const o=t,{$t:n}=M.useIntl(),a=e.computed(()=>o.pricingPlanScheduleId),i=e.computed(()=>o.pricingItems),{invoicePreview:s}=Ft({pricingPlanScheduleId:a,pricingItems:i});return(l,u)=>(e.openBlock(),e.createBlock(Se._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(ot._sfc_main),{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"You will pay",description:"Label above the preview of what topping up will be invoiced for",id:"topup_modal.invoice_preview.label"})),1)]),_:1}),e.createVNode(e.unref(Z._sfc_main),{"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ue._sfc_main$1),{invoice:e.unref(s),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),De=(t,o)=>t.currency??o??t.creditTypeId??"",he=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var s,l,u,d,g;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:he(((l=(s=t==null?void 0:t.threshold)==null?void 0:s.amount)==null?void 0:l.quantity)??((d=(u=t==null?void 0:t.threshold)==null?void 0:u.credits)==null?void 0:d.quantity),De(o,a)),topUpAmount:he(((g=t==null?void 0:t.topup_amount)==null?void 0:g.quantity)??i,n)}},Yt=(t,o)=>{var a;const n=(a=t.threshold)==null?void 0:a.quantity;return n?o.creditTypeId?{credits:{quantity:n,credit_type_id:o.creditTypeId}}:{amount:{quantity:n,currency:o.currency??""}}:{}},ge=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},qe=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...ge(t,n)&&{topup_amount:ge(t,n)}}),_e=(t,o)=>qe(ie(t,o),o),ye=(t,o)=>JSON.stringify(t)===JSON.stringify(o),be=t=>{const o=Number(t==null?void 0:t.quantity);return t!=null&&t.quantity&&Number.isFinite(o)?o:void 0},Wt=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t>=n},Ht=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t<=n},ee=t=>{const o=Number(t);return t!=null&&t!==""&&Number.isFinite(o)?o:void 0},pe=(t,o,n)=>{const a=ee(t),i=ee(n);if(!(a===void 0||i===void 0||i<=0))return o==="CREDITS"?a/i:a*i},we=(t,o,n,a)=>o===n?ee(t):pe(t,o,a),zt=(t,o,n)=>o==="CREDITS"?pe(t,"AMOUNT",n):ee(t),me=t=>t.toFixed(2),Te=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),Re=(t,o,n,a)=>{const i=zt(t==null?void 0:t.quantity,o,n);if(i!==void 0)return o==="CREDITS"?a(i):me(i)},jt=["data-testid"],se=e.defineComponent({__name:"ConvertedAmountInput",props:e.mergeModels({unit:{type:String},modelBase:{type:String},entryBase:{type:String},conversionRate:{type:String},showConversionHint:{type:Boolean},currency:{type:String},creditUnitName:{type:String},bounds:{type:Object},label:{type:String},name:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>o.entryBase??o.modelBase),l=e.computed(()=>s.value!==o.modelBase&&ee(o.conversionRate)!==void 0),u=e.ref("");e.watch(()=>[n.value,s.value,o.modelBase,o.conversionRate],([m])=>{if(!l.value){u.value=m??"";return}if(m===g(u.value))return;const C=we(m,o.modelBase,s.value,o.conversionRate);u.value=C===void 0?"":Te(C,s.value)},{immediate:!0});function d(m){return typeof m=="string"?m:typeof m=="number"?String(m):""}function g(m){const C=we(m,s.value,o.modelBase,o.conversionRate);return C===void 0?"":Te(C,o.modelBase)}const y=e.computed({get:()=>u.value,set:m=>{u.value=d(m),n.value=l.value?g(u.value):u.value}}),S=e.computed(()=>pe(u.value,s.value,o.conversionRate)),f=e.computed(()=>o.creditUnitName?o.creditUnitName:s.value==="CREDITS"?o.unit:a({defaultMessage:"credits",description:"Generic name for a wallet credit, where its credit type does not name one",id:"converted_amount_input.credits"})),v=(m,C)=>le.formatAmount({quantity:me(m),currency:C}),p=m=>`${i(m)} ${f.value}`,w=e.computed(()=>{const m=o.error;return Array.isArray(m)?m.length>0:!!(e.isRef(m)?m.value:m)}),P=e.computed(()=>{const m=S.value;if(!(w.value||!o.showConversionHint||m===void 0))return s.value==="CREDITS"?o.currency?a({defaultMessage:"Will cost {amount} excluding taxes",description:"Helper text under a credits field, naming what those credits cost in money",id:"converted_amount_input.cost"},{amount:v(m,o.currency)}):void 0:a({defaultMessage:"Buys about {credits}",description:"Helper text under a money field, naming the credits that amount converts into",id:"converted_amount_input.buys"},{credits:p(m)})}),D=m=>Re(m,s.value,o.conversionRate,i),h=e.computed(()=>{var m,C,B,A;return s.value==="CREDITS"?f.value:((C=(m=o.bounds)==null?void 0:m.minimum)==null?void 0:C.currency)??((A=(B=o.bounds)==null?void 0:B.maximum)==null?void 0:A.currency)??o.unit}),T=e.computed(()=>{var A,_;const m=D((A=o.bounds)==null?void 0:A.minimum),C=D((_=o.bounds)==null?void 0:_.maximum),B=h.value;if(m&&C)return a({defaultMessage:"Between {minimum} and {maximum} {unit}",description:"Range of what a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.range"},{minimum:m,maximum:C,unit:B});if(m)return a({defaultMessage:"At least {minimum} {unit}",description:"Smallest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.minimum"},{minimum:m,unit:B});if(C)return a({defaultMessage:"Up to {maximum} {unit}",description:"Largest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.maximum"},{maximum:C,unit:B})});return(m,C)=>(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{modelValue:y.value,"onUpdate:modelValue":C[0]||(C[0]=B=>y.value=B),class:"sv-converted-amount-input",type:"number","as-text-type":"",name:t.name,label:t.label,required:t.required,disabled:t.disabled,error:t.error},e.createSlots({suffix:e.withCtx(()=>[e.createElementVNode("span",{"data-testid":`${t.name}-unit`},e.toDisplayString(t.unit),9,jt)]),_:2},[T.value?{name:"label-suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-bounds`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,P.value?{name:"helper",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-conversion`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.value),1)]),_:1},8,["data-testid"])]),key:"1"}:void 0]),1032,["modelValue","name","label","required","disabled","error"]))}}),Qt=e.defineComponent({__name:"Section",props:{emphasized:{type:Boolean,default:!1},contentClasses:{type:String},contentBackground:{type:String},title:{type:String},noSpacing:{type:Boolean},hasError:{type:Boolean},noBorder:{type:Boolean}},setup(t){const o=t,n=["sv-section__accent relative","before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5","before:rounded-full before:bg-primary-600"].join(" "),a=e.computed(()=>[o.emphasized?n:void 0,o.contentClasses].filter(Boolean).join(" ")),i=e.computed(()=>{const{emphasized:s,...l}=o;return l});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{class:"sv-section","content-classes":a.value}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[s.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},Fe=e.defineComponent({__name:"AutoTopUpConfig",props:{config:{type:Object},denomination:{type:Object},creditUnitName:{type:String},chargeCurrency:{type:String},conversionRate:{type:String},topUpBounds:{type:Object},showThresholdConversion:{type:Boolean,default:!0},contained:{type:Boolean},alwaysEnabled:{type:Boolean},disabled:{type:Boolean}},emits:["save"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s,formatNumber:l}=M.useIntl(),u=e.computed(()=>{var _,x;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(x=(_=a.topUpBounds)==null?void 0:_.minimum)==null?void 0:x.quantity}}),d=e.ref(ie(a.config,u.value)),g=e.computed(()=>De(a.denomination,a.creditUnitName)),y=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),S=e.computed(()=>y.value==="CREDITS"?g.value:a.chargeCurrency),f=e.computed({get:()=>{var _;return((_=d.value.threshold)==null?void 0:_.quantity)??""},set:_=>{d.value.threshold={quantity:_||null,currency:g.value}}}),v=e.computed({get:()=>{var _;return((_=d.value.topUpAmount)==null?void 0:_.quantity)??""},set:_=>{d.value.topUpAmount={quantity:_||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,u.value],([_,x])=>{ye(_e(_,x),P())||(d.value=ie(_,x))});const p=e.computed({get:()=>a.alwaysEnabled||d.value.enabled,set:_=>{d.value.enabled=_}}),w=e.computed(()=>qe({...d.value,enabled:p.value},u.value)),P=()=>w.value,D=e.reactive({threshold:e.computed(()=>be(d.value.threshold)??null),topUpAmount:e.computed(()=>be(d.value.topUpAmount)??null)}),h=_=>{if(!_)return"";const x=Re(_,y.value,a.conversionRate,l);return x===void 0?le.formatAmount(_):`${x} ${S.value}`},T=I.requiredIf(()=>p.value),m=I.useValidation({threshold:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the balance to top up at.",description:"Error shown under the auto top-up threshold when it is left empty",id:"auto_topup_config.threshold.required"}),T),notNegative:I.common.withMessage(()=>s({defaultMessage:"The balance to top up at cannot be negative.",description:"Error shown under the auto top-up threshold when it is below zero",id:"auto_topup_config.threshold.not_negative"}),_=>_===null||_>=0)},topUpAmount:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the amount to top up with.",description:"Error shown under the auto top-up amount when it is left empty",id:"auto_topup_config.amount.required"}),T),positive:I.common.withMessage(()=>s({defaultMessage:"Top up with more than zero.",description:"Error shown under the auto top-up amount when it is zero or negative",id:"auto_topup_config.amount.positive"}),_=>_===null||_>0),atLeastMinimum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at least {minimum}.",description:"Error shown under the auto top-up amount when it is below what the pricing allows",id:"auto_topup_config.amount.at_least_minimum"},{minimum:h((_=a.topUpBounds)==null?void 0:_.minimum)})},_=>{var x;return Wt(_,(x=a.topUpBounds)==null?void 0:x.minimum)}),withinMaximum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at most {maximum}.",description:"Error shown under the auto top-up amount when it is above what the pricing allows",id:"auto_topup_config.amount.within_maximum"},{maximum:h((_=a.topUpBounds)==null?void 0:_.maximum)})},_=>{var x;return Ht(_,(x=a.topUpBounds)==null?void 0:x.maximum)})}},D),C=e.computed(()=>!ye(P(),_e(a.config,u.value)));function B(){return m.value.$touch(),m.value.$invalid?void 0:P()}function A(){const _=B();_&&i("save",_)}return o({submit:A,validate:B,rule:w,hasChanges:C,isInvalid:e.computed(()=>m.value.$invalid)}),(_,x)=>(e.openBlock(),e.createBlock(Qt,{class:"sv-auto-topup-config","content-background":t.contained?"gray":"none","no-spacing":!t.contained,"no-border":!t.contained},{default:e.withCtx(()=>[t.alwaysEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(I._sfc_main),{key:0,modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=q=>p.value=q),"no-spacing":"","label-position":"before",class:"!flex",disabled:t.disabled},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",Gt,[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Auto top-up",description:"Title of the automatic wallet top-up settings",id:"auto_topup_config.title"})),1)]),_:1}),e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Automatically top up your balance when it runs low.",description:"Subtitle of the automatic wallet top-up settings",id:"auto_topup_config.subtitle"})),1)]),_:1})])]),_:1},8,["modelValue","disabled"])),e.createVNode(e.unref(Be._sfc_main),{"is-open":p.value},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(se,{modelValue:f.value,"onUpdate:modelValue":x[1]||(x[1]=q=>f.value=q),name:"auto-top-up-threshold",unit:g.value,"model-base":y.value,"entry-base":y.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(m).threshold.$errors,label:e.unref(s)({defaultMessage:"When your balance falls below",description:"Label of the balance at which an automatic top-up is charged",id:"auto_topup_config.threshold.label"})},null,8,["modelValue","unit","model-base","entry-base","currency","conversion-rate","show-conversion-hint","disabled","error","label"]),e.createVNode(se,{modelValue:v.value,"onUpdate:modelValue":x[2]||(x[2]=q=>v.value=q),name:"auto-top-up-amount",unit:S.value,"model-base":"AMOUNT","entry-base":y.value,currency:t.chargeCurrency,"credit-unit-name":t.creditUnitName,"conversion-rate":t.conversionRate,bounds:t.topUpBounds,"show-conversion-hint":"",required:"",disabled:t.disabled,error:e.unref(m).topUpAmount.$errors,label:e.unref(s)({defaultMessage:"Top-up with",description:"Label of the amount every automatic top-up adds",id:"auto_topup_config.amount.label"})},null,8,["modelValue","unit","entry-base","currency","credit-unit-name","conversion-rate","bounds","disabled","error","label"])],2)):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["content-background","no-spacing","no-border"]))}}),Ce=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function Le({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,s)=>Ce(s.created_at)-Ce(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,s,l],u)=>{var S;const d=u==null?void 0:u[0],g=i==null?void 0:i.find(({id:f})=>!(d!=null&&d.some(v=>v.id===f)));if(g&&(d!=null&&d.length)){o.value=g.id;return}const y=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));y(l)||(o.value=y(s)?s:(S=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:S.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>ue.formatWalletBalanceValue(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Kt={class:"sv-top-up-form"},Xt={class:"grid grid-cols-1 gap-4"},Jt={class:"grid grid-cols-1 gap-1"},Zt={class:"sv-top-up-form__option-details"},eo={key:0},to=e.defineComponent({__name:"TopUpModalForm",props:{topUpPricingItems:{type:null},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},autoTopUpConfig:{type:Object}},emits:["add-payment-method","success","save-auto-top-up","failure"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s}=M.useIntl(),{formatValue:l}=te(),u=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),d=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(c=>c.flexiblePricing||c.fixedPricing);return[...r.filter(({flexiblePricing:c})=>c),...r.filter(({flexiblePricing:c})=>!c)]}),g=r=>d.value.find(c=>c.pricingItemId===r),y=e.computed(()=>{var r,c;return(c=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:c.pricingPlanScheduleId});e.watch(y,r=>{u.value.pricing_plan_schedule_id=r??""},{immediate:!0});const S=r=>{const{config:c,currency:b}=r.flexiblePricing??{},N=c==null?void 0:c.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const c=g(typeof r=="string"?r:void 0);if(!c){u.value.pricing_items=[];return}const b=S(c);u.value.pricing_items=[{pricing_item_id:c.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(d,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=u.value.pricing_items[0])==null?void 0:V.pricing_item_id)}))return;const b=r.find(({flexiblePricing:N})=>N)??r[0];f.value=b==null?void 0:b.pricingItemId},{immediate:!0});const v=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const c=(b=u.value.pricing_items[0])==null?void 0:b.pricing_item_id;c&&(u.value.pricing_items=[{pricing_item_id:c,...r&&{flexible_amount:r}}])}}),p=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.fixedPricing;return c!=null&&c.value.credits?le.formatAmount(c.amount):void 0},w=e.computed(()=>{var r;return(r=g(String(f.value)))==null?void 0:r.flexiblePricing}),P=e.computed({get:()=>{var r;return((r=v.value)==null?void 0:r.quantity)??""},set:r=>{var b;const c=(b=w.value)==null?void 0:b.currency;v.value=r&&c?{quantity:r,currency:c}:void 0}}),D=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",h=e.computed(()=>$e(a.topUpPricingItems)),T=r=>r.creditsConfiguration?h.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,m=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.flexiblePricing;return c?[c]:[]},C=r=>{var c;return!!((c=g(String(r)))!=null&&c.flexiblePricing)},B=e.computed(()=>d.value.map(r=>{var c;return{value:r.pricingItemId,label:r.fixedPricing?l(r.fixedPricing.value):s({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((c=r.flexiblePricing)==null?void 0:c.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:s({defaultMessage:"Between {minimum} and {maximum}",description:"Bounds of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.bounds"},{minimum:l(r.flexiblePricing.bounds.minimum),maximum:l(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=u.value.pricing_items.filter(c=>{var b;return!((b=g(c.pricing_item_id))!=null&&b.flexiblePricing)||!!c.flexible_amount});return r.length>0?r:void 0}),_=e.computed(()=>!a.autoTopUpConfig&&d.value.some(({flexiblePricing:c})=>c)?Oe(a.topUpPricingItems):void 0),x=e.ref(),{chargeOnDemandPricingItems:q}=Pe.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!u.value.pricing_plan_schedule_id&&!!A.value&&!!u.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>u.value.payment_method_id??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>s({defaultMessage:"Select a payment method to pay for this top-up.",description:"Error shown under the payment methods in the top-up modal when none is selected on submit",id:"topup_modal.payment_method_required"}),I.required)}},G),Y=e.computed(()=>{const[r]=u.value.pricing_items,c=g(r==null?void 0:r.pricing_item_id);return c?qt(c,r==null?void 0:r.flexible_amount):void 0});async function K(){var c,b,N;W.value.$touch();const r=(c=x.value)==null?void 0:c.validate();if(!(W.value.$invalid||(b=x.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await q({pricing_plan_schedule_id:u.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:u.value.payment_method_id,preview:!1});r&&((N=x.value)!=null&&N.hasChanges)&&u.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:u.value.payment_method_id}),i("success",V)}catch(V){Q.error("TOP_UP_FAILED","Failed to charge the wallet top-up",{},V),i("failure",V)}finally{R.value=!1}}}o({submit:K,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>u.value.payment_method_id??void 0,set:r=>{u.value.payment_method_id=r}}),{sortedPaymentMethods:X}=Le({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,c)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[B.value.length>0?(e.openBlock(),e.createBlock(e.unref(xe._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":c[3]||(c[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:B.value,"show-radio":!1,label:e.unref(s)({defaultMessage:"Top up amount",description:"Label above the list of ways to top up the wallet in the top-up modal",id:"topup_modal.pricing_items.label"})},{label:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("span",null,e.toDisplayString(b.label),1),p(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",weight:"normal","no-spacing":"",class:"sv-top-up-form__option-cost"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!C(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),m(N).length>0?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(N),V=>{var k;return e.openBlock(),e.createElementBlock("div",{key:V.currency,class:"sv-top-up-form__amount grid grid-cols-1 gap-3",onClick:c[1]||(c[1]=e.withModifiers(()=>{},["stop"])),onKeydown:c[2]||(c[2]=e.withModifiers(()=>{},["stop"]))},[b.description?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(se,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=O=>P.value=O),name:"top-up-amount","model-base":"AMOUNT",unit:T(V),"entry-base":D(V),currency:V.currency,"conversion-rate":(k=V.creditsConfiguration)==null?void 0:k.conversionRate,required:"",disabled:R.value},null,8,["modelValue","unit","entry-base","currency","conversion-rate","disabled"])],32)}),128))]),_:2},1032,["is-open"])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","disabled","options","label"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(Ie,{"pricing-plan-schedule-id":y.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),_.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(Fe,e.mergeProps({ref_key:"autoTopUpFormRef",ref:x,class:"sv-top-up-form__auto-top-up"},_.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(tt._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":c[4]||(c[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(X),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(s)({defaultMessage:"Payment method",description:"Label above the payment method that pays for the top-up, in the top-up modal",id:"topup_modal.payment_method_selector.label"}),onAddPaymentMethod:c[5]||(c[5]=b=>i("add-payment-method"))},null,8,["modelValue","payment-methods","error","payment-method-options","disabled","label"])])])])]))}}),oo={class:"sv-top-up-success grid grid-cols-1 gap-4"},no=e.defineComponent({__name:"TopUpModalSuccess",props:{addedValue:{type:Object},invoice:{type:Object}},setup(t){const{$t:o}=M.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",oo,[t.invoice?(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),{key:0,"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold",class:"mb-2 block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Receipt",description:"Heading above the invoice a completed top-up produced",id:"topup_modal.success.receipt.heading"})),1)]),_:1}),e.createVNode(e.unref(Ue._sfc_main$1),{invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})):e.createCommentVNode("",!0)]))}});function ao({step:t,currentBalance:o,topUpValue:n}){const{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add payment method",description:"Title of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.title"}):t.value==="SUCCESS"?a({defaultMessage:"Top-up complete",description:"Title of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_title"}):a({defaultMessage:"Top up balance",description:"Title of the wallet top-up modal",id:"topup_modal.title"})),l=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add a new payment method for topping up your balance.",description:"Subtitle of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.subtitle"}):t.value==="SUCCESS"?a({defaultMessage:"Your payment went through.",description:"Subtitle of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_subtitle"}):a({defaultMessage:"Your current balance is {balance}.",description:"Subtitle of the top-up modal showing the current wallet balance",id:"topup_modal.subtitle"},{balance:o.value})),u=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Back",description:"Label of the button that leaves the add payment method step in the top-up modal",id:"topup_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Label of the button that closes the top-up modal",id:"topup_modal.cancel_button.label"})),d=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Save payment method",description:"Label of the confirm button in the top-up modal while adding a payment method",id:"topup_modal.save_payment_method.label"}):t.value==="SUCCESS"?a({defaultMessage:"Done",description:"Label of the button that dismisses the top-up modal once the top-up has been charged",id:"topup_modal.done_button.label"}):n.value?a({defaultMessage:"Top up balance with {value}",description:"Label of the confirm button in the top-up modal once an amount is entered",id:"topup_modal.confirm_button.label"},{value:ue.formatWalletBalanceValue(a,i,n.value)}):a({defaultMessage:"Top up balance",description:"Label of the confirm button in the top-up modal while no amount is entered",id:"topup_modal.confirm_button.empty.label"}));return{title:s,subTitle:l,cancelButtonText:u,confirmButtonText:d}}function Ye({isOpen:t,customer:o}){const{paymentMethodOptions:n,get:a,isPending:i}=ut.usePaymentMethodOptions();e.watch(()=>[t.value,o.value],([l,u])=>{!l||!u||a({customerId:u.id,country:st.getCustomerCountry(u)})},{immediate:!0});const s=e.computed(()=>i.value?void 0:n.value);return{paymentMethodOptions:n,settledOptions:s,isPending:i}}function io(t){const o=e.ref(0),n=i=>{o.value=(i==null?void 0:i.offsetHeight)??0},a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i=>{var l;const s=(l=i[0])==null?void 0:l.target;n(s instanceof HTMLElement?s:void 0)});return e.watch(t,(i,s)=>{s&&(a==null||a.unobserve(s)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const so=["inert"],uo=300,lo="1rem",ro=e.defineComponent({__name:"SlidingPanes",props:{panes:{type:Array},current:{type:String}},setup(t){const o=t,n=e.ref(!1);let a;e.watch(()=>o.current,()=>{n.value=!0,clearTimeout(a),a=setTimeout(()=>{n.value=!1},uo)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),s={},l=y=>s[y]??(s[y]=S=>{i.value[y]=S instanceof HTMLElement?S:void 0}),u=e.computed(()=>i.value[o.current]),d=io(u),g=e.computed(()=>{const y=o.panes.indexOf(o.current);return y>0?`translateX(calc(${-y} * (100% + ${lo})))`:"translateX(0px)"});return(y,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",n.value?"transition-[height] duration-300 ease-in-out motion-reduce:transition-none":""]),style:e.normalizeStyle(e.unref(d)?{height:`${e.unref(d)}px`}:void 0)},[e.createElementVNode("div",{class:"sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",style:e.normalizeStyle({transform:g.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.panes,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"sv-sliding-panes__pane w-full shrink-0",inert:f!==t.current||void 0},[e.createElementVNode("div",{ref_for:!0,ref:l(f)},[e.renderSlot(y.$slots,f)],512)],8,so))),128))],4)],6))}}),co={class:"grid grid-cols-1 gap-4 pb-4"},We=e.defineComponent({__name:"WalletModalShell",props:{showModal:{type:Boolean},title:{type:String},subTitle:{type:String},cancelButtonText:{type:String},confirmButtonText:{type:String},isPending:{type:Boolean},panes:{type:Array},step:{type:String},addPaymentMethodPane:{type:String},customer:{type:Object},paymentMethodOptions:{type:Array},isPaymentMethodOptionsPending:{type:Boolean},isAddingPaymentMethod:{type:Boolean}},emits:["confirm","cancel","payment-success","payment-failed"],setup(t,{expose:o}){const n=t,a=e.ref(),i=e.computed(()=>n.panes.filter(s=>s!==n.addPaymentMethodPane));return o({submit:()=>{var s;return(s=a.value)==null?void 0:s.submit()},isSaving:e.computed(()=>{var s;return!!((s=a.value)!=null&&s.isSaving)})}),(s,l)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{"no-click-away":"","show-modal":t.showModal,size:"lg",title:t.title,"sub-title":t.subTitle,"cancel-button-text":t.cancelButtonText,"confirm-button-text":t.confirmButtonText,"is-loading":t.isPending,onConfirm:l[2]||(l[2]=u=>s.$emit("confirm")),onClose:l[3]||(l[3]=u=>s.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(re._sfc_main$1,{ref_key:"paneRef",ref:a,customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isPaymentMethodOptionsPending,"is-active":t.isAddingPaymentMethod,onSuccess:l[0]||(l[0]=u=>s.$emit("payment-success")),onFailure:l[1]||(l[1]=u=>s.$emit("payment-failed",u))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,u=>({name:u,fn:e.withCtx(()=>[e.renderSlot(s.$slots,u)])}))]),1032,["panes","current"])])]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),He=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},ze=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,je=(t,o=[])=>{if(t!=null&&t.pricing_item_id&&t.pricing_plan_schedule_id)return{pricingItemId:t.pricing_item_id,pricingPlanScheduleId:t.pricing_plan_schedule_id};const n=o.find(({flexiblePricing:a,pricingPlanScheduleId:i})=>a&&i);return n!=null&&n.pricingPlanScheduleId?{pricingItemId:n.pricingItemId,pricingPlanScheduleId:n.pricingPlanScheduleId}:void 0},Qe=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var s,l;const i=!!(((s=t==null?void 0:t.threshold)==null?void 0:s.amount)??((l=t==null?void 0:t.threshold)==null?void 0:l.credits));if(!(!t||!i||!(o!=null&&o.wallet_id)||!n||!a))return{wallet_id:o.wallet_id,status:t.status,threshold:t.threshold,pricing_plan_schedule_id:n.pricingPlanScheduleId,pricing_item_id:n.pricingItemId,payment_method_id:a,...t.topup_amount&&{topup_amount:t.topup_amount}}};function Ge({step:t,name:o,returnTo:n}){const a=e.ref();return{paneRef:a,isActive:e.computed(()=>t.value===o),isSaving:e.computed(()=>{var i;return!!((i=a.value)!=null&&i.isSaving)}),open:()=>{t.value=o},leave:()=>{t.value=n},submit:()=>{var i;return(i=a.value)==null?void 0:i.submit()}}}function Ke(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(u){return t({url:`${o.apiUrls.config}${n}`,query:{...u},isCollection:!0})}function i(u){return t({url:`${o.apiUrls.config}${n}/${u}`})}function s(u){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:u})}function l(u){return t({url:`${o.apiUrls.config}${n}/${u}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:s,deactivateAutoTopUpConfig:l}}function Xe(){const{createAutoTopUpConfig:t}=Ke(),o=M.useLogger(),n=e.ref(!1);return{save:async i=>{if(!i||n.value)return{saved:!1};n.value=!0;try{return await t(i),{saved:!0}}catch(s){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},s),{saved:!1,error:s}}finally{n.value=!1}},isSaving:n}}const po={key:0,class:"mb-4"},mo={class:"sr-only"},fo={class:"flex flex-col gap-2"},vo=e.defineComponent({__name:"TopUpModal",props:{showModal:{type:Boolean},selectedBalanceItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object},subscriptions:{type:Array}},emits:["confirm","close","auto-top-up-saved","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.computed(()=>ze(He(n.selectedBalanceItem))),u=e.computed(()=>s(n.selectedBalanceItem)),d=e.computed(()=>Bt(n.selectedBalanceItem,n.subscriptions??[])),g=e.ref();e.watch(d,U=>{var E;U.some(({id:oe})=>oe===g.value)||(g.value=(E=U[0])==null?void 0:E.id)},{immediate:!0});const y=e.computed(()=>d.value.length>1),S=e.computed(()=>d.value.map(({id:U,name:$})=>({value:U,label:$}))),f=e.computed(()=>Object.fromEntries(d.value.flatMap(({id:U,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===U);return E?[[U,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const U=d.value.find(({id:E})=>E===g.value);return U?Ut(n.selectedBalanceItem,U.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),p=e.computed(()=>Ne(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:D}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),h=e.ref("TOP_UP"),T=e.computed(()=>(n.paymentMethods??[]).length>0),m=e.computed(()=>!D.value&&(w.value??[]).length===0),C=e.computed(()=>h.value==="TOP_UP"&&!T.value&&m.value),B=e.ref(),A=e.ref(),_=()=>{L(),a("payment-success")},{paneRef:x,isActive:q,isSaving:Q,open:R,leave:L,submit:G}=Ge({step:h,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Xe(),Y=e.ref(),K=e.computed(()=>{var U;return(U=Y.value)==null?void 0:U.chargedValue}),H=e.computed(()=>{var U;return Q.value||!!((U=Y.value)!=null&&U.isCharging)}),{title:X,subTitle:r,cancelButtonText:c,confirmButtonText:b}=ao({step:h,currentBalance:u,topUpValue:K}),N=()=>{var U;if(q.value){G();return}(U=Y.value)==null||U.submit()},V=async({rule:U,paymentMethodId:$})=>{const{saved:E}=await W(Qe({rule:U,walletBalanceItem:n.selectedBalanceItem,chargeTarget:je(void 0,p.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=U=>{var $;B.value=U,A.value=($=Y.value)==null?void 0:$.chargedValue,h.value="SUCCESS"},O=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(q.value){L();return}if(h.value==="SUCCESS"){O();return}a("close")}},fe=e.ref(0);return e.watch(()=>n.showModal,U=>{U&&(h.value="TOP_UP",B.value=void 0,A.value=void 0,fe.value+=1)}),(U,$)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(c),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(St),step:h.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(D),"is-adding-payment-method":e.unref(q),onConfirm:N,onCancel:F,onPaymentSuccess:_,onPaymentFailed:$[1]||($[1]=E=>U.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(xe._sfc_main),{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=E=>g.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:S.value,"show-radio":!1,label:e.unref(i)({defaultMessage:"Subscription to top up",description:"Label above the list of subscriptions a top-up can be charged against, in the top-up modal",id:"topup_modal.subscriptions.label"})},{prefix:e.withCtx(({optionValue:E})=>[f.value[String(E)]?(e.openBlock(),e.createBlock(it._sfc_main,{key:0,class:"sv-topup-modal__subscription-option grow","no-spacing":"",subscription:f.value[String(E)].subscription,"enabled-pricing-ids":f.value[String(E)].enabledPricingIds},null,8,["subscription","enabled-pricing-ids"])):e.createCommentVNode("",!0)]),label:e.withCtx(({option:E})=>[e.createElementVNode("span",mo,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:fe.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":p.value,"payment-methods":t.paymentMethods,"auto-top-up-config":l.value,"payment-method-options":e.unref(P),onAddPaymentMethod:e.unref(R),onSuccess:k,onSaveAutoTopUp:V},null,8,["top-up-pricing-items","payment-methods","auto-top-up-config","payment-method-options","onAddPaymentMethod"]))]),SUCCESS:e.withCtx(()=>[B.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:B.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[h.value==="SUCCESS"||C.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",fo,[h.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:O},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(z._sfc_main),{size:"lg",disabled:"","data-testid":"confirm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1}),e.createVNode(e.unref(z._sfc_main),{size:"lg",intent:"subtle","data-testid":"cancel",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]),_:1})],64))])]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),ho=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],go={class:"grid grid-cols-1 gap-4"},_o=e.defineComponent({__name:"AutoTopUpModal",props:{showModal:{type:Boolean},walletBalanceItem:{type:Object},topUpItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object}},emits:["saved","close","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.ref("AUTO_TOP_UP"),u=e.computed(()=>s(n.walletBalanceItem)),d=e.computed(()=>Ne(n.walletBalanceItem)),g=e.computed(()=>Oe(d.value)),y=e.computed(()=>He(n.walletBalanceItem)),S=e.computed(()=>ze(y.value)),f=e.computed(()=>je(n.topUpItem,d.value)),v=e.ref(),p=e.computed(()=>{var O,F;const k=(F=(O=v.value)==null?void 0:O.rule)==null?void 0:F.topup_amount;return k!=null&&k.quantity&&f.value?[{pricing_item_id:f.value.pricingItemId,flexible_amount:k}]:void 0}),w=e.computed(()=>{var k;return(k=f.value)==null?void 0:k.pricingPlanScheduleId}),P=e.ref(),{sortedPaymentMethods:D}=Le({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=y.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:h,settledOptions:T,isPending:m}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:C,isActive:B,isSaving:A,open:_,leave:x,submit:q}=Ge({step:l,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Xe(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>i({defaultMessage:"Select a payment method to pay for automatic top-ups.",description:"Error shown in the auto top-up modal when no payment method is selected",id:"auto_topup_modal.payment_method.required"}),I.required)}},G),Y=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Title of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.title"}):i({defaultMessage:"Automatic top-up",description:"Title of the automatic wallet top-up modal",id:"auto_topup_modal.title"})),K=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"This method pays for every automatic top-up.",description:"Subtitle of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.subtitle"}):i({defaultMessage:"Your current balance is {balance}. Enable auto top so you can stay productive",description:"Subtitle of the automatic wallet top-up modal, naming the balance",id:"auto_topup_modal.subtitle"},{balance:u.value})),H=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Back",description:"Button returning from adding a payment method to the auto top-up rule",id:"auto_topup_modal.add_payment_method.cancel"}):i({defaultMessage:"Cancel",description:"Button dismissing the auto top-up modal",id:"auto_topup_modal.cancel"})),X=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Button storing the payment method being added in the auto top-up modal",id:"auto_topup_modal.add_payment_method.confirm"}):i({defaultMessage:"Save",description:"Button saving the automatic top-up rule",id:"auto_topup_modal.confirm"}));async function r(){var F;if(W.value.$touch(),L.value)return;const{saved:k,error:O}=await Q(Qe({rule:(F=v.value)==null?void 0:F.validate(),walletBalanceItem:n.walletBalanceItem,chargeTarget:f.value,paymentMethodId:P.value}));if(k){a("saved"),a("close");return}O&&a("payment-failed",O)}const c=()=>{if(B.value){q();return}r()},b=()=>{x(),a("payment-success")},N=()=>{if(!L.value){if(B.value){x();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(l.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,O)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:C,"show-modal":t.showModal,title:Y.value,"sub-title":K.value,"cancel-button-text":H.value,"confirm-button-text":X.value,"is-pending":L.value,panes:e.unref(ho),step:l.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(h),"is-payment-method-options-pending":e.unref(m),"is-adding-payment-method":e.unref(B),onConfirm:c,onCancel:N,onPaymentSuccess:b,onPaymentFailed:O[1]||(O[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",go,[g.value?(e.openBlock(),e.createBlock(Fe,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},g.value,{config:S.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ie,{"pricing-plan-schedule-id":w.value,"pricing-items":p.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":O[0]||(O[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(D),"payment-method-options":e.unref(T),disabled:L.value,error:e.unref(W).paymentMethodId.$errors,label:e.unref(i)({defaultMessage:"Pay automatic top-ups with",description:"Label above the payment method an automatic top-up is charged to",id:"auto_topup_modal.payment_method.label"}),onAddPaymentMethod:e.unref(_)},null,8,["modelValue","payment-methods","payment-method-options","disabled","error","label","onAddPaymentMethod"])])]),_:1},8,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),yo={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},bo=e.defineComponent({__name:"AutoTopUpCancellationModal",props:{showModal:{type:Boolean},config:{type:Object}},emits:["confirmed","close"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=M.useLogger(),{formatValue:l}=te(),{deactivateAutoTopUpConfig:u}=Ke(),d=e.ref(!1),g=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(g.value=!1)});const y=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,p=(P=n.config)==null?void 0:P.topup_amount;return!(v!=null&&v.amount)&&!(v!=null&&v.credits)?i({defaultMessage:"Your balance will no longer be topped up automatically. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.explanation"}):p?i({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.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",id:"auto_topup_cancellation_modal.explanation_with_amount"},{amount:l({amount:p}),threshold:l(v)}):i({defaultMessage:"Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",id:"auto_topup_cancellation_modal.explanation_with_threshold"},{threshold:l(v)})}),S=async()=>{var p;const v=(p=n.config)==null?void 0:p.id;if(!(!v||d.value)){d.value=!0,g.value=!1;try{await u(v),a("confirmed"),a("close")}catch(w){s.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),g.value=!0}finally{d.value=!1}}},f=()=>{d.value||a("close")};return(v,p)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{size:"sm","show-modal":t.showModal,"is-loading":d.value,"no-click-away":d.value,"no-backdrop-close":d.value,title:e.unref(i)({defaultMessage:"Turn off automatic top-up",description:"Title of the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.title"}),"confirm-button-text":e.unref(i)({defaultMessage:"Yes, turn it off",description:"Button confirming that a wallet automatic top-up is turned off",id:"auto_topup_cancellation_modal.confirm"}),"cancel-button-text":e.unref(i)({defaultMessage:"Cancel",description:"Button dismissing the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.cancel"}),onConfirm:S,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",yo,[e.createVNode(e.unref(M._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-auto-topup-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1}),g.value?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),{key:0,class:"sv-auto-topup-cancellation-modal__error sv-error",title:e.unref(i)({defaultMessage:"Could not turn off the automatic top-up. Please try again later.",description:"Error shown when turning a wallet automatic top-up off failed",id:"auto_topup_cancellation_modal.failed"})},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","is-loading","no-click-away","no-backdrop-close","title","confirm-button-text","cancel-button-text"]))}}),wo=e.defineComponent({inheritAttrs:!1,__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array},showTopUpButton:{type:Boolean},customer:{type:Object},paymentMethods:{type:Array},subscriptions:{type:Array}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=e.ref(),l=e.computed(()=>ve(n.walletBalances,s.value)),u=e.computed(()=>!!l.value),d=e.ref(),g=e.computed(()=>!!d.value),y=e.computed(()=>ve(n.walletBalances,d.value)),S=e.ref(),f=e.computed(()=>!!S.value);return(v,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Se._sfc_main,e.mergeProps({key:0,variant:"section"},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"}),null,16)):t.hasError?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),e.mergeProps({key:1},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-error",title:e.unref(i)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})}),null,16,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(e.unref(Tt),e.mergeProps({key:2},v.$attrs,{class:"sv-wallet-balances sv-root sv-component","customer-wallet-balances":t.walletBalances,"show-auto-top-up":"","show-manual-top-up":"",title:e.unref(i)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)}),onTopUp:p[0]||(p[0]=w=>s.value=w),onAutoTopUp:p[1]||(p[1]=w=>d.value=w),onCancelAutoTopUp:p[2]||(p[2]=w=>S.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(vo,{key:3,"show-modal":u.value,"selected-balance-item":l.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:p[3]||(p[3]=w=>s.value=void 0),onConfirm:p[4]||(p[4]=w=>a("top-up-charged")),onPaymentSuccess:p[5]||(p[5]=w=>a("payment-method-stored")),onPaymentFailed:p[6]||(p[6]=w=>a("payment-failed",w))},null,8,["show-modal","selected-balance-item","payment-methods","customer","subscriptions"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(_o,{key:4,"show-modal":g.value,"wallet-balance-item":y.value,"top-up-item":d.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:p[7]||(p[7]=w=>d.value=void 0),onSaved:p[8]||(p[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:p[9]||(p[9]=w=>a("payment-method-stored")),onPaymentFailed:p[10]||(p[10]=w=>a("payment-failed",w))},null,8,["show-modal","wallet-balance-item","top-up-item","payment-methods","customer"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(bo,{key:5,"show-modal":f.value,config:S.value,onClose:p[11]||(p[11]=w=>S.value=void 0),onConfirmed:p[12]||(p[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=wo;exports.useCustomerWalletBalances=Mt;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as o, defineComponent as f, openBlock as a, createElementBlock as n, normalizeClass as l, unref as r, createCommentVNode as c, renderSlot as g, createVNode as m, withCtx as x, createTextVNode as v, toDisplayString as h } from "vue";
|
|
2
|
-
import { _ as D } from "./customElements-
|
|
2
|
+
import { _ as D } from "./customElements-Df6dGrN-.mjs";
|
|
3
3
|
const d = "relative translate-y-1/2 top-1/2 border-t border-gray-100", y = (e) => {
|
|
4
4
|
const i = o(() => {
|
|
5
5
|
let t = `${d}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),r=require("./customElements-
|
|
1
|
+
const e=require("vue"),r=require("./customElements-BYIdPSzQ.js"),a="relative translate-y-1/2 top-1/2 border-t border-gray-100",c=t=>{const i=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="left"?s+=" w-2":s+=" grow",s}),n=e.computed(()=>{let s=`${a}`;return t.hasOuterDivider&&t.textPosition==="right"?s+=" w-2":s+=" grow",s});return{leftDividerClasses:i,rightDividerClasses:n}},o=e.defineComponent({__name:"DividerText",props:{spacing:{default:"none"},textPosition:{default:"left"},hasOuterDivider:{type:Boolean,default:!1},text:{}},setup(t){const i=t,{leftDividerClasses:n,rightDividerClasses:s}=c(i);return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex gap-2",{"my-2":t.spacing==="xs","my-4":t.spacing==="sm","my-6":t.spacing==="md","my-8":t.spacing==="lg","my-10":t.spacing==="xl"}])},[t.textPosition==="left"&&t.hasOuterDivider||["center","right"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n))},null,2)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(e.unref(r._sfc_main),{tag:"span","no-spacing":"",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),_:1})]),t.textPosition==="right"&&t.hasOuterDivider||["center","left"].includes(t.textPosition)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s))},null,2)):e.createCommentVNode("",!0)],2))}});exports._sfc_main=o;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as h, openBlock as t, createElementBlock as u, normalizeClass as k, createVNode as l, withCtx as a, renderSlot as w, createBlock as r, createTextVNode as m, toDisplayString as f, unref as d, Fragment as _, renderList as C, resolveDynamicComponent as M, ref as E, computed as $, createElementVNode as I, createCommentVNode as b } from "vue";
|
|
2
|
-
import { _ as x, u as N } from "./customElements-
|
|
3
|
-
import { _ as V, T as A, a as j } from "./TooltipParagraph.vue.es-
|
|
2
|
+
import { _ as x, u as N } from "./customElements-Df6dGrN-.mjs";
|
|
3
|
+
import { _ as V, T as A, a as j } from "./TooltipParagraph.vue.es-Fu9Od3Vr.mjs";
|
|
4
4
|
import { i as D } from "./useService-Bh47bllz.mjs";
|
|
5
5
|
import { g as F } from "./getComposedString.es-C__uhJpd.mjs";
|
|
6
6
|
import { _ as p } from "./Amount.vue.es-DPqHB8Xd.mjs";
|
|
7
7
|
import { _ as S } from "./Divider.vue.es-DnP_HqLz.mjs";
|
|
8
8
|
import { _ as q } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
9
|
-
import { a as W } from "./Button.vue.es-
|
|
10
|
-
import { _ as L } from "./Section.vue.es-
|
|
9
|
+
import { a as W } from "./Button.vue.es-BJEy-e9C.mjs";
|
|
10
|
+
import { _ as L } from "./Section.vue.es-C2_topx4.mjs";
|
|
11
11
|
const y = /* @__PURE__ */ h({
|
|
12
12
|
__name: "invoicePreviewRow",
|
|
13
13
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),r=require("./customElements-
|
|
1
|
+
const e=require("vue"),r=require("./customElements-BYIdPSzQ.js"),v=require("./TooltipParagraph.vue.es-OX6bAWP9.js"),y=require("./useService-H7BjLg8P.js"),k=require("./getComposedString.es-haS4bAj7.js"),d=require("./Amount.vue.es-DExaYBqm.js"),h=require("./Divider.vue.es-UwnWvUTl.js"),C=require("./Expand.vue.es-BtM0EZEr.js"),p=require("./Button.vue.es-CJNxYacb.js"),B=require("./Section.vue.es-Cybk1Nb8.js"),u=e.defineComponent({__name:"invoicePreviewRow",props:{weight:{default:"normal"},variant:{default:"body-xs"},noSpacing:{type:Boolean,default:!1}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row gap-2",{"py-1.5":!t.noSpacing}])},[e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,class:"grow",weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"label")]),_:3},8,["variant","weight"]),e.createVNode(r._sfc_main,{tag:"span",variant:t.variant,weight:t.weight},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"value")]),_:3},8,["variant","weight"])],2))}}),g=e.defineComponent({__name:"Skeleton",props:{widthClass:{default:"w-10"},heightClass:{default:"h-3"},shade:{default:"default"}},setup(t){return(a,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",[t.widthClass,t.heightClass,{"bg-gray-50/50":t.shade==="default","bg-gray-100/50":t.shade==="dark","bg-gray-200/50":t.shade==="darker","bg-gray-400/50":t.shade==="darkest"}]])},null,2))}}),_=e.defineComponent({__name:"InvoicePreviewNoTaxesSkeleton",props:{widthClass:{default:"w-12"},heightClass:{default:"h-5"}},setup(t){const{$t:a}=r.useIntl();return(l,i)=>(e.openBlock(),e.createBlock(v._sfc_main,{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(v.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(v._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(g,{"width-class":t.widthClass,"height-class":t.heightClass,shade:"darker"},null,8,["width-class","height-class"])]),_:1}))}}),x=e.defineComponent({__name:"InvoicePreviewGroups",props:{invoice:{},wrapperComponent:{}},setup(t){const a=i=>i.groups.reduce((o,n)=>n.type in o?{...o,[n.type]:[...o[n.type],n]}:{...o,[n.type]:[n]},{}),l=i=>{var o,n,s;return(o=i.pricing)!=null&&o.name&&!y.isEmpty((n=i.pricing)==null?void 0:n.name)?i.pricing.name:k.getComposedString(((s=i.products)==null?void 0:s.map(c=>c.name))??[])};return(i,o)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(a(n)),([c,f])=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(m,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.wrapperComponent??"div"),{key:w},{default:e.withCtx(()=>[e.createVNode(u,{"no-spacing":t.wrapperComponent!==void 0},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(m)),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:m.amount_excluding_tax},null,8,["value"])]),_:2},1032,["no-spacing"])]),_:2},1024))),128))],64))),128))],64))),128))}}),b={class:"flex flex-col"},N=e.defineComponent({__name:"InvoicePreview",props:{invoice:{},trialInvoice:{},isCustomerFacing:{type:Boolean,default:!1},variant:{default:"default"},isPaid:{type:Boolean,default:!1},collapsible:{default:void 0},isPreviewWithoutTaxes:{type:Boolean}},setup(t){const a=t,{$t:l}=r.useIntl(),i=e.ref(a.collapsible!==void 0?a.collapsible!=="expanded":!1),o=e.computed(()=>a.collapsible!==void 0),n=e.computed(()=>!!a.trialInvoice),s=e.computed(()=>a.trialInvoice?a.trialInvoice.tax_summary.total_amount:a.invoice.tax_summary.total_amount),c=()=>{o.value&&(i.value=!i.value)};return(f,m)=>(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(C._sfc_main,{"is-open":!i.value,lazy:""},{default:e.withCtx(()=>[e.createElementVNode("div",null,[n.value?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.after_trial_heading",defaultMessage:"After trial",description:"After trial heading for the invoice preview"})),1)]),_:1})):e.createCommentVNode("",!0),t.variant!=="without-products"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(x,{invoice:t.invoice},null,8,["invoice"]),e.createVNode(h._sfc_main,{spacing:"xxs"})],64)):e.createCommentVNode("",!0),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_excluding_taxes_heading",defaultMessage:"Total excluding taxes",description:"Total excluding taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[e.createVNode(d._sfc_main,{value:t.invoice.tax_summary.base_amount},null,8,["value"])]),_:1}),e.createVNode(u,null,{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.taxes_heading",defaultMessage:"Taxes",description:"Taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.tax_amount},null,8,["value"]))]),_:1}),n.value?(e.openBlock(),e.createBlock(u,{key:2},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({id:"invoice_preview.total_including_taxes_heading",defaultMessage:"Total including taxes",description:"Total including taxes heading for the invoice preview"})),1)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes?(e.openBlock(),e.createBlock(_,{key:0,"width-class":"w-10","height-class":"h-4"})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:t.invoice.tax_summary.total_amount},null,8,["value"]))]),_:1})):e.createCommentVNode("",!0),e.createVNode(h._sfc_main,{spacing:"xxs"})])]),_:1},8,["is-open"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?"button":"div"),{class:e.normalizeClass({"text-left hover:cursor-pointer":o.value}),onClick:c},{default:e.withCtx(()=>[e.createVNode(u,{weight:"semibold",variant:"body-sm"},{label:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isPaid?e.unref(l)({id:"invoice_preview.total_paid_heading",defaultMessage:"Total paid",description:"Total paid heading for the invoice preview"}):e.unref(l)({id:"invoice_preview.total_due_today_heading",defaultMessage:"Total due today",description:"Total due today heading for the invoice preview"}))+" ",1),o.value?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:0,size:"xs",icon:"keyboard_arrow_down",class:e.normalizeClass(["text-gray-400 transition ease-in-out",{"rotate-0":i.value,"rotate-180":!i.value}])},null,8,["class"])):e.createCommentVNode("",!0)]),value:e.withCtx(()=>[t.isPreviewWithoutTaxes&&(!n.value||n.value&&s.value.quantity!=="0.00")?(e.openBlock(),e.createBlock(_,{key:0})):(e.openBlock(),e.createBlock(d._sfc_main,{key:1,value:s.value},null,8,["value"]))]),_:1})]),_:1},8,["class"]))]))}}),V={class:"sv-empty-state__body flex flex-col items-center justify-center py-2"},T={class:"sv-empty-state__action mt-3 empty:hidden"},S=e.defineComponent({__name:"EmptyStatePlaceholder",props:{icon:{type:null}},setup(t){return(a,l)=>(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{class:"sv-empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(p._sfc_main$1),{icon:t.icon,size:"md",class:"sv-empty-state__icon text-gray-500"},null,8,["icon"]),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",weight:"semibold",color:"subtle",class:"sv-empty-state__title mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"title")]),_:3}),e.createVNode(e.unref(r._sfc_main),{center:"",tag:"span",variant:"body-xs",color:"subtle",class:"sv-empty-state__message mt-1"},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"message")]),_:3}),e.createElementVNode("div",T,[e.renderSlot(a.$slots,"action")])])]),_:3}))}});exports._sfc_main=S;exports._sfc_main$1=N;exports._sfc_main$2=g;exports._sfc_main$3=x;
|
package/dist/{ErrorNotification.vue.es-C6ngWAVU.mjs → ErrorNotification.vue.es-B3mvv79S.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, computed as m, openBlock as t, createBlock as d, mergeProps as p, withCtx as l, createElementVNode as o, toDisplayString as s, createElementBlock as _, createCommentVNode as f } from "vue";
|
|
2
|
-
import { _ as u } from "./
|
|
3
|
-
import { u as g } from "./customElements-
|
|
2
|
+
import { _ as u } from "./Alert.vue.es-lIiAWf2S.mjs";
|
|
3
|
+
import { u as g } from "./customElements-Df6dGrN-.mjs";
|
|
4
4
|
const h = { class: "grid gap-1" }, k = { class: "font-medium" }, y = { key: 0 }, N = /* @__PURE__ */ c({
|
|
5
5
|
__name: "ErrorNotification",
|
|
6
6
|
props: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),i=require("./Alert.vue.es-RyK53a2P.js"),c=require("./customElements-BYIdPSzQ.js"),a={class:"grid gap-1"},l={class:"font-medium"},d={key:0},m=e.defineComponent({__name:"ErrorNotification",props:{title:{},description:{}},setup(t){const{formatMessage:o}=c.useIntl(),s=t,n=e.computed(()=>s.title??o({defaultMessage:"Something went wrong",id:"error_notification.default_error_message",description:"The default message to display"}));return(r,u)=>(e.openBlock(),e.createBlock(i._sfc_main,e.mergeProps({type:"danger"},r.$attrs),{default:e.withCtx(()=>[e.createElementVNode("div",a,[e.createElementVNode("span",l,e.toDisplayString(n.value),1),t.description?(e.openBlock(),e.createElementBlock("span",d,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])]),_:1},16))}});exports._sfc_main=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),a=require("./object.es-CdriXMPs.js"),o=require("./TooltipParagraph.vue.es-OX6bAWP9.js"),i=require("./Button.vue.es-CJNxYacb.js"),r={inheritAttrs:!1},s=e.defineComponent({...r,__name:"IconButton",props:{tooltip:{},icon:{},type:{},intent:{},size:{},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{},iconSuffix:{},tag:{},preventDoubleClick:{type:Boolean}},setup(t){const c=t,l=e.useAttrs(),n=e.computed(()=>a.omit({...c,...l},"icon","tooltip"));return(u,p)=>t.tooltip?(e.openBlock(),e.createBlock(o._sfc_main,{key:0},{tooltip:e.withCtx(()=>[e.createVNode(o.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tooltip),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(i._sfc_main,e.mergeProps(n.value,{"icon-prefix":t.icon,square:""}),null,16,["icon-prefix"])]),_:1})):(e.openBlock(),e.createBlock(i._sfc_main,e.mergeProps({key:1},n.value,{square:"","icon-prefix":t.icon}),null,16,["icon-prefix"]))}});exports._sfc_main=s;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent as p, useAttrs as u, computed as f, openBlock as i, createBlock as a, withCtx as t, createVNode as e, mergeProps as l, createTextVNode as m, toDisplayString as _ } from "vue";
|
|
2
|
+
import { o as d } from "./object.es-8aLDIncs.mjs";
|
|
3
|
+
import { _ as x, T as y, a as B } from "./TooltipParagraph.vue.es-Fu9Od3Vr.mjs";
|
|
4
|
+
import { _ as r } from "./Button.vue.es-BJEy-e9C.mjs";
|
|
5
|
+
const k = {
|
|
6
|
+
inheritAttrs: !1
|
|
7
|
+
}, P = /* @__PURE__ */ p({
|
|
8
|
+
...k,
|
|
9
|
+
__name: "IconButton",
|
|
10
|
+
props: {
|
|
11
|
+
tooltip: {},
|
|
12
|
+
icon: {},
|
|
13
|
+
type: {},
|
|
14
|
+
intent: {},
|
|
15
|
+
size: {},
|
|
16
|
+
pill: { type: Boolean },
|
|
17
|
+
square: { type: Boolean },
|
|
18
|
+
loading: { type: Boolean },
|
|
19
|
+
disabled: { type: Boolean },
|
|
20
|
+
iconPrefix: {},
|
|
21
|
+
iconSuffix: {},
|
|
22
|
+
tag: {},
|
|
23
|
+
preventDoubleClick: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
setup(o) {
|
|
26
|
+
const c = o, s = u(), n = f(() => d({ ...c, ...s }, "icon", "tooltip"));
|
|
27
|
+
return (g, C) => o.tooltip ? (i(), a(x, { key: 0 }, {
|
|
28
|
+
tooltip: t(() => [
|
|
29
|
+
e(y, null, {
|
|
30
|
+
default: t(() => [
|
|
31
|
+
e(B, null, {
|
|
32
|
+
default: t(() => [
|
|
33
|
+
m(_(o.tooltip), 1)
|
|
34
|
+
]),
|
|
35
|
+
_: 1
|
|
36
|
+
})
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
})
|
|
40
|
+
]),
|
|
41
|
+
default: t(() => [
|
|
42
|
+
e(r, l(n.value, {
|
|
43
|
+
"icon-prefix": o.icon,
|
|
44
|
+
square: ""
|
|
45
|
+
}), null, 16, ["icon-prefix"])
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
})) : (i(), a(r, l({ key: 1 }, n.value, {
|
|
49
|
+
square: "",
|
|
50
|
+
"icon-prefix": o.icon
|
|
51
|
+
}), null, 16, ["icon-prefix"]));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
P as _
|
|
56
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as f, computed as x, openBlock as s, createElementBlock as n, normalizeClass as r, createBlock as u, unref as a, createCommentVNode as i, createElementVNode as z, renderSlot as l, createTextVNode as c, toDisplayString as d, withCtx as b } from "vue";
|
|
2
2
|
import { i as g } from "./slots.es-BA4MyEAa.mjs";
|
|
3
|
-
import { a as h } from "./Button.vue.es-
|
|
4
|
-
import { _ as y } from "./Avatar.vue.es-
|
|
5
|
-
import { _ as k } from "./customElements-
|
|
3
|
+
import { a as h } from "./Button.vue.es-BJEy-e9C.mjs";
|
|
4
|
+
import { _ as y } from "./Avatar.vue.es-2E3laNRb.mjs";
|
|
5
|
+
import { _ as k } from "./customElements-Df6dGrN-.mjs";
|
|
6
6
|
const v = { class: "min-w-0 grow" }, E = /* @__PURE__ */ f({
|
|
7
7
|
__name: "IconTitle",
|
|
8
8
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),n=require("./slots.es-T9ZJRGtG.js"),i=require("./Button.vue.es-
|
|
1
|
+
const e=require("vue"),n=require("./slots.es-T9ZJRGtG.js"),i=require("./Button.vue.es-CJNxYacb.js"),r=require("./Avatar.vue.es-DdJreyr_.js"),c=require("./customElements-BYIdPSzQ.js"),o={class:"min-w-0 grow"},u=e.defineComponent({__name:"IconTitle",props:{title:{},subTitle:{},icon:{},variant:{default:"default"},suffix:{},size:{default:"md"},avatar:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!0},resourceId:{},iconClass:{},titleClass:{}},setup(t){const l=t,a=e.computed(()=>{switch(l.variant){case"transparent":return"";case"warning":return"bg-gradient-to-br backdrop-blur-sm from-orange-600/20 to-yellow-200/20";case"neutral":return"bg-neutral-100";default:case"default":return"bg-gradient-to-br backdrop-blur-sm from-peach-100/20 to-mint-100/20"}});return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex min-w-0 items-center",{"gap-4":["md","lg"].includes(t.size),"gap-3":t.size==="sm","gap-2":t.size==="xs"&&t.variant!=="transparent","gap-1":t.size==="xs"&&t.variant==="transparent"}])},[t.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([[t.iconClass,{[a.value]:!0,"h-9 w-9":["md","lg"].includes(t.size),"h-8 w-8":t.size==="sm","h-6 w-6":t.size==="xs"}],"flex shrink-0 items-center justify-center rounded-md"])},[t.icon?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,size:["sm","xs"].includes(t.size)?"xs":"md",icon:t.icon},null,8,["size","icon"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),t.avatar&&t.title?(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{key:1,initials:t.title.slice(0,1),"color-hash":t.title,size:["sm","xs"].includes(t.size)?"lg":"xl"},null,8,["initials","color-hash","size"])):e.createCommentVNode("",!0),e.createElementVNode("div",o,[t.title||s.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([[t.titleClass,{"text-3xl":t.size==="lg","text-2xl":t.size==="md","text-base":t.size==="sm","text-xs text-subtle":t.size==="xs","text-default":t.size!=="xs",uppercase:t.size==="xs"&&t.uppercase,"font-general-sans":["md","lg"].includes(t.size)}],"flex flex-wrap items-center break-words font-semibold"])},[e.renderSlot(s.$slots,"prefix"),e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),e.renderSlot(s.$slots,"suffix",{},()=>[e.createTextVNode(e.toDisplayString(t.suffix),1)])],2)):e.createCommentVNode("",!0),t.subTitle||s.$slots.subTitle&&!e.unref(n.isVnodeEmpty)(s.$slots.subTitle({}))?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:1,variant:"body-sm",color:"secondary"},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])]),_:3})):e.createCommentVNode("",!0)])],2))}});exports._sfc_main=u;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as t, defineComponent as G, useModel as J, toRefs as L, ref as O, openBlock as d, createElementBlock as S, unref as s, normalizeClass as C, createBlock as T, createSlots as Q, withCtx as x, createTextVNode as X, toDisplayString as Y, createCommentVNode as g, renderSlot as c, createElementVNode as q, mergeProps as B, withDirectives as Z, vModelDynamic as H, mergeModels as M } from "vue";
|
|
2
|
-
import { c as E, u as R, g as _, _ as ee } from "./cn.es-
|
|
2
|
+
import { c as E, u as R, g as _, _ as ee } from "./cn.es-C8Ogac5T.mjs";
|
|
3
3
|
import { _ as le } from "./FormMessage.vue.es-jG3fQZms.mjs";
|
|
4
4
|
import { i as D } from "./useService-Bh47bllz.mjs";
|
|
5
|
-
import { _ as N } from "./customElements-
|
|
5
|
+
import { _ as N } from "./customElements-Df6dGrN-.mjs";
|
|
6
6
|
const te = {
|
|
7
7
|
/**
|
|
8
8
|
* 22px, not 24px: this height lands on the inner input, which is `border-0`, while the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),d=require("./cn.es-
|
|
1
|
+
const e=require("vue"),d=require("./cn.es-lC4_Xd0R.js"),M=require("./FormMessage.vue.es-dqATjC2N.js"),g=require("./useService-H7BjLg8P.js"),w=require("./customElements-BYIdPSzQ.js"),T={xs:"h-[22px]",sm:"h-7",md:"h-10",lg:"h-12",xl:"h-16"};function R({size:l,disabled:s,labelScreenReaderOnly:u,hasError:f,ring:i,hasShadow:v,hasFocusStyles:m,type:p,prefixHasBorder:a,wrapperClass:y,inputClass:b,prefixClass:h,suffixClass:C,isMultiline:k}){const n=e.computed(()=>(s==null?void 0:s.value)??!1),c=e.computed(()=>(p==null?void 0:p.value)==="checkbox"),x=e.computed(()=>(m==null?void 0:m.value)!==!1),t=e.computed(()=>((f==null?void 0:f.value)??!1)&&!n.value),o=e.computed(()=>l.value==="xs"||l.value==="sm"),r=e.computed(()=>({"block text-sm font-medium text-default":!0,"sr-only":u==null?void 0:u.value})),B=e.computed(()=>({"rounded border border-gray-300 overflow-hidden":!0,"cursor-not-allowed bg-gray-50 border-transparent":n.value,"bg-white":!n.value,"focus-within:border-primary-500 focus-within:outline-1 focus-within:outline focus-within:outline-primary-500":x.value,"focus-within:ring-primary-500":i==null?void 0:i.value,"shadow-sm focus-within:shadow-sm":v==null?void 0:v.value,"border-red-500 focus-within:border-red-500 focus-within:outline-red-500 focus-within:ring-red-500":t.value})),$=e.computed(()=>({"text-default placeholder:text-placeholder disabled:text-disabled disabled:placeholder:text-disabled block w-full border-0 focus:border-transparent focus:outline-0 focus:ring-0 bg-transparent":!0,"text-xs":o.value,"text-sm":!o.value,"p-2":c.value,"px-1":!c.value&&l.value==="xs","px-2":!c.value&&l.value==="sm","px-4":!c.value&&!o.value,[T[l.value]]:!c.value&&!(k!=null&&k.value),"cursor-default":n.value})),S=e.computed(()=>({"z-10 flex shrink-0 items-center":!0,"px-3":a==null?void 0:a.value,"pl-3":!(a!=null&&a.value),"border-r":a==null?void 0:a.value,"border-none":!(a!=null&&a.value),"border-red-500":(a==null?void 0:a.value)&&t.value,"border-gray-300":(a==null?void 0:a.value)&&!t.value})),V=e.computed(()=>({"align-end z-10 flex shrink-0 items-center gap-2 border-l px-2":!0,"border-red-500":t.value,"border-gray-300":!t.value,"px-1":o.value,"px-2":l.value==="md","px-3":l.value==="lg"})),E=e.computed(()=>d.cn(B.value,y==null?void 0:y.value)),q=e.computed(()=>d.cn($.value,b==null?void 0:b.value)),N=e.computed(()=>d.cn(S.value,h==null?void 0:h.value)),I=e.computed(()=>d.cn(V.value,C==null?void 0:C.value));return{wrapperClasses:E,inputClasses:q,prefixClasses:N,suffixClasses:I,labelClasses:r}}const z=["data-testid"],D={class:"relative"},F={class:"relative grow"},P=["id","disabled","type","value","name","form","placeholder","autocomplete"],U=["id","value","disabled","type","name","form","placeholder","autocomplete"],W={key:1,class:"mt-2 text-sm text-secondary"},K=e.defineComponent({__name:"Input",props:e.mergeModels({label:{default:""},labelScreenReaderOnly:{type:Boolean},disabled:{type:Boolean,default:!1},type:{default:"text"},asTextType:{type:Boolean,default:!1},size:{default:"md"},prefixClass:{},suffixClass:{},wrapperClass:{default:""},inputClass:{},rootClass:{default:""},required:{type:Boolean,default:!1},id:{},checked:{type:Boolean},value:{},hasShadow:{type:Boolean,default:!1},hasFocusStyles:{type:Boolean,default:!0},form:{},ring:{type:Boolean,default:!0},error:{},invalid:{type:Boolean},name:{},prefixHasBorder:{type:Boolean,default:!0},placeholder:{},autocomplete:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["blur"],["update:modelValue"]),setup(l){const s=l,u=e.useModel(l,"modelValue"),f=s.type==="number"&&s.asTextType,i=s.name??d.uniqueId("name"),v=t=>{f&&(u.value=t.target.value)},m=s.id??d.uniqueId(`${i}-`),p=t=>{s.type==="number"&&t.target.blur()},a=e.computed(()=>!g.isEmpty(s.error)||!!s.invalid),{wrapperClasses:y,inputClasses:b,labelClasses:h,prefixClasses:C,suffixClasses:k}=R({...e.toRefs(s),hasError:a}),n=e.ref(),c=t=>{var o;const r=t.target;r!=null&&r.closest("button, a, input, select, textarea")||(o=n.value)==null||o.focus()},x=e.computed(()=>s.size==="xs"?"body-xs":"body-sm");return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.rootClass),"data-testid":e.unref(d.getRootTestId)(e.unref(i))},[l.label?(e.openBlock(),e.createBlock(d._sfc_main,{key:0,class:e.normalizeClass(e.unref(h)),for:e.unref(m),required:l.required},e.createSlots({suffix:e.withCtx(()=>[e.unref(g.isEmpty)(l.error)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M._sfc_main,{key:0,message:l.error},null,8,["message"])),e.renderSlot(t.$slots,"label-suffix")]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label)+" ",1)]),_:2},[t.$slots.tooltip?{name:"tooltip",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"tooltip")]),key:"0"}:void 0]),1032,["class","for","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["flex",e.unref(y)])},[t.$slots.prefix?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,tag:"div",variant:x.value,class:e.normalizeClass(e.unref(C))},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"prefix")]),_:3},8,["variant","class"])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[e.unref(f)?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0},t.$attrs,{id:e.unref(m),ref_key:"inputElRef",ref:n,disabled:l.disabled,type:l.type,class:e.unref(b),value:u.value,name:e.unref(i),form:l.form,placeholder:l.placeholder,autocomplete:l.autocomplete??"off",onKeyup:v,onChange:v,onBlur:o[0]||(o[0]=r=>t.$emit("blur")),onWheel:p}),null,16,P)):e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1},t.$attrs,{id:e.unref(m),ref_key:"inputElRef",ref:n,"onUpdate:modelValue":o[1]||(o[1]=r=>u.value=r),value:l.type==="checkbox"?l.value:u.value,disabled:l.disabled,type:l.type,name:e.unref(i),form:l.form,class:e.unref(b),placeholder:l.placeholder,autocomplete:l.autocomplete??"off",onBlur:o[2]||(o[2]=r=>t.$emit("blur")),onWheel:p}),null,16,U)),[[e.vModelDynamic,u.value]]),e.renderSlot(t.$slots,"input")]),t.$slots.suffix?(e.openBlock(),e.createBlock(w._sfc_main,{key:1,tag:"div",variant:x.value,class:e.normalizeClass(e.unref(k)),onClick:c},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"suffix")]),_:3},8,["variant","class"])):e.createCommentVNode("",!0)],2),e.renderSlot(t.$slots,"adornment-end")]),t.$slots.helper?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"helper")])):e.createCommentVNode("",!0)],10,z))}});exports._sfc_main=K;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, openBlock as o, createBlock as d, unref as e, withCtx as t, createElementBlock as u, createElementVNode as _, createVNode as r, createTextVNode as a, toDisplayString as c, createCommentVNode as l } from "vue";
|
|
2
|
-
import { _ as m } from "./Section.vue.es-
|
|
3
|
-
import { u as k, _ as s } from "./customElements-
|
|
2
|
+
import { _ as m } from "./Section.vue.es-C2_topx4.mjs";
|
|
3
|
+
import { u as k, _ as s } from "./customElements-Df6dGrN-.mjs";
|
|
4
4
|
const h = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "sv-invoice-details__body flex flex-col gap-2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("vue"),c=require("./Section.vue.es-
|
|
1
|
+
const e=require("vue"),c=require("./Section.vue.es-Cybk1Nb8.js"),i=require("./customElements-BYIdPSzQ.js"),n={key:0,class:"sv-invoice-details__body flex flex-col gap-2"},s={class:"sv-invoice-details__row"},d={class:"sv-invoice-details__row"},l=e.defineComponent({__name:"InvoiceDetailsBlock",props:{invoice:{type:Object}},setup(t){const{$t:o,formatDate:a}=i.useIntl();return(v,r)=>(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{class:"sv-invoice-details",title:e.unref(o)({defaultMessage:"Invoice details",description:"Title for the invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.title"})},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",s,[e.createVNode(e.unref(i._sfc_main),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Invoice date",description:"Title for the invoice date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.invoice_date"})),1)]),_:1}),t.invoice.invoice_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:t.invoice.invoice_date,format:"date",timezone:t.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",d,[e.createVNode(e.unref(i._sfc_main),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Due date",description:"Title for the due date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.due_date"})),1)]),_:1}),t.invoice.due_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({date:t.invoice.due_date,format:"date",timezone:t.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}});exports._sfc_main=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("vue"),t=require("./usePayments-G-HpKpK8.js"),r=require("./useLoadInitialData-BO9ZsSsF.js"),v=e.defineComponent({__name:"InvoiceHeader",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(n){return(i,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-invoice-header sv-root sv-component","payment-attempts":n.payments??[],invoice:n.invoice,"download-service":()=>n.invoiceDownloadService(n.invoice),"show-download-button":n.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]))}}),d=e.defineComponent({__name:"InvoiceEntryView",props:{invoiceId:{type:String}},setup(n){const i=n,o=t.useInvoice({invoiceId:i.invoiceId}),c=t.usePayments(),{isLoading:a}=r.useLoadInitialData(o.get(),c.get(i.invoiceId));return(s,u)=>e.renderSlot(s.$slots,"default",{invoice:e.unref(o).invoice.value,invoiceDownloadService:e.unref(o).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(a)})}});exports._sfc_main=d;exports._sfc_main$1=v;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as a, openBlock as r, createBlock as v, unref as n, renderSlot as d } from "vue";
|
|
2
|
-
import { _ as l, u as m, a as p } from "./usePayments-
|
|
3
|
-
import { u } from "./useLoadInitialData-
|
|
2
|
+
import { _ as l, u as m, a as p } from "./usePayments-Dq2V6bTV.mjs";
|
|
3
|
+
import { u } from "./useLoadInitialData-CWyI3_RR.mjs";
|
|
4
4
|
const g = /* @__PURE__ */ a({
|
|
5
5
|
__name: "InvoiceHeader",
|
|
6
6
|
props: {
|
|
@@ -15,7 +15,7 @@ const g = /* @__PURE__ */ a({
|
|
|
15
15
|
class: "sv-invoice-header sv-root sv-component",
|
|
16
16
|
"payment-attempts": e.payments ?? [],
|
|
17
17
|
invoice: e.invoice,
|
|
18
|
-
"download-service": () => e.invoiceDownloadService(e.invoice
|
|
18
|
+
"download-service": () => e.invoiceDownloadService(e.invoice),
|
|
19
19
|
"show-download-button": e.configuration.enableDownloadButton,
|
|
20
20
|
variant: "external"
|
|
21
21
|
}, null, 8, ["payment-attempts", "invoice", "download-service", "show-download-button"]));
|