@solvimon/solvimon-web 0.1.0-alpha.25 → 0.1.0-alpha.26
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 +14 -11
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Dh_a0NRB.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs} +6 -6
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BM1_31Tl.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js} +1 -1
- package/dist/{Avatar.vue.es-CvxRdCes.js → Avatar.vue.es-Bm6MCMAL.js} +1 -1
- package/dist/{Avatar.vue.es-C9Jkfuvp.mjs → Avatar.vue.es-BqQHvLGA.mjs} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-7wQAw6Lv.js → BillingInformation.vue_vue_type_script_setup_true_lang-0JHnqIpC.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BRSUpMPU.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BFza7Nf9.mjs} +8 -8
- package/dist/{Button.vue.es-BbSN0uOk.mjs → Button.vue.es-C32_baQN.mjs} +1 -1
- package/dist/{Button.vue.es-CeUTAc2n.js → Button.vue.es-qGvnOKnK.js} +1 -1
- package/dist/ChargeOnDemandModal-CIiI74ls.mjs +983 -0
- package/dist/ChargeOnDemandModal-DIQaGnRs.js +1 -0
- package/dist/Checkout.entry.ce-8EcavNgT.js +2 -0
- package/dist/{Checkout.entry.ce-BMzK8nQg.mjs → Checkout.entry.ce-BA5ljKj8.mjs} +1562 -1538
- package/dist/{Chip.vue.es-T22Q7AF9.mjs → Chip.vue.es-CKCOY5T6.mjs} +2 -2
- package/dist/{Chip.vue.es-BN83K3Tk.js → Chip.vue.es-D60gTbfe.js} +1 -1
- package/dist/{ContextMenu.vue.es-DXKR7WFg.js → ContextMenu.vue.es-C7KI8Gz6.js} +1 -1
- package/dist/{ContextMenu.vue.es-0PRmCAzL.mjs → ContextMenu.vue.es-Da-lAmTl.mjs} +10 -10
- package/dist/{CustomerBillingInformation.vue.es-C2j40TYP.mjs → CustomerBillingInformation.vue.es-BxBQt4Q0.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-yrLGc7oL.js → CustomerBillingInformation.vue.es-bFUx81Ig.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BZwGWhaL.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BcTZgshS.mjs} +6 -6
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C8diNL5x.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C0lJ_ESU.js} +1 -1
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-xqMsbuU6.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DkbQ2MiR.mjs} +908 -891
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js +1 -0
- package/dist/{DividerText.vue.es-DsYRZzuE.js → DividerText.vue.es-BF3gnr4e.js} +1 -1
- package/dist/{DividerText.vue.es-CV1XK_Vz.mjs → DividerText.vue.es-DKl3FnDJ.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-kpjrC-4q.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-srXOpUb0.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js} +1 -1
- package/dist/{ErrorNotification.vue.es-QfRoDhkn.js → ErrorNotification.vue.es-BX9dHEc-.js} +1 -1
- package/dist/{ErrorNotification.vue.es-CiUJva6S.mjs → ErrorNotification.vue.es-rRKgmkzV.mjs} +1 -1
- package/dist/{IconButton.vue.es-CytBZUkZ.js → IconButton.vue.es-Bwdfu-jm.js} +1 -1
- package/dist/{IconButton.vue.es-ChvsCZQG.mjs → IconButton.vue.es-UlqwNPAX.mjs} +2 -2
- package/dist/{IconTitle.vue.es-DPruIJ6l.mjs → IconTitle.vue.es-CK9k69tV.mjs} +3 -3
- package/dist/{IconTitle.vue.es-DtnpBObk.js → IconTitle.vue.es-Cei98MBw.js} +1 -1
- package/dist/{Input.vue.es-BkzQDkrz.js → Input.vue.es-B47l_feL.js} +1 -1
- package/dist/{Input.vue.es-DJQqJrsb.mjs → Input.vue.es-D9IjIWc-.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Do0dDtkA.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DKlPrxQS.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BC-zyUqe.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DUfJl07Y.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-CFhhhwId.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-D9Rtgapa.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DQFS7SfE.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DlJ6lELc.js} +1 -1
- package/dist/InvoiceSummary.vue.es-DBnR9Hs7.js +1 -0
- package/dist/{InvoiceSummary.vue.es-6qpbyymg.mjs → InvoiceSummary.vue.es-DQ4KvTaw.mjs} +576 -565
- package/dist/{Modal.vue.es-JpE0eh_Q.js → Modal.vue.es-8LN4gBh0.js} +1 -1
- package/dist/{Modal.vue.es-BuRlbyZw.mjs → Modal.vue.es-B9xMiyn3.mjs} +5 -5
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-nAuhIopc.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js} +1 -1
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-UmKgVvdj.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BVzL2PGe.mjs} +4 -4
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-YpcWHm24.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DggCusgC.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-nLTPnH4j.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-DnmParhQ.mjs → PaymentHistoryBlock-DYa99P1M.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-uWuWjr8I.js → PaymentHistoryBlock-Ds93gNvh.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BS8N4yt9.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CBZhXQfC.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BziIf86i.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D0KnSy0y.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-DTXm56QQ.js → PaymentIntegrationForm-B_Db4DG1.js} +1 -1
- package/dist/{PaymentIntegrationForm-DL55i0HD.mjs → PaymentIntegrationForm-UWoyZgsR.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C0J37ZVe.js +1 -0
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-J15IDbMc.mjs +154 -0
- package/dist/{PaymentIntegrationFormAdyen-Cqsy82To.mjs → PaymentIntegrationFormAdyen-D4qfNtZ_.mjs} +197 -183
- package/dist/PaymentIntegrationFormAdyen-HeA9XIj-.js +98 -0
- package/dist/{PaymentIntegrationFormStripe-DIU1rnwH.mjs → PaymentIntegrationFormStripe-BIiMCWlV.mjs} +247 -220
- package/dist/PaymentIntegrationFormStripe-DUCJTIAq.js +102 -0
- package/dist/PaymentMethod.vue.es-CJcSZ9lN.js +1 -0
- package/dist/{PaymentMethod.vue.es-m1NasGqw.mjs → PaymentMethod.vue.es-CKu5nApX.mjs} +168 -148
- package/dist/{PaymentMethodForm-BEVdWCrH.js → PaymentMethodForm-1d0YIGOu.js} +1 -1
- package/dist/{PaymentMethodForm-BYzt1PVP.mjs → PaymentMethodForm-B05sHWcW.mjs} +1 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BDm8l_6N.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-fdRTp7sc.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-D1yIYsb_.mjs} +45 -41
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-FhMBZqtI.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BE4S26JX.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-FChyZp2v.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DGpXRtp4.mjs} +6 -6
- package/dist/PlanCustomizationEditor-CEMP_Dhz.js +1 -0
- package/dist/PlanCustomizationEditor-CpZeilm5.mjs +694 -0
- package/dist/{PricingGroupRangeInput.vue.es-B4ZbKxUw.mjs → PricingGroupRangeInput.vue.es-CJpvUP3-.mjs} +4 -4
- package/dist/{PricingGroupRangeInput.vue.es-Ba3v0J_R.js → PricingGroupRangeInput.vue.es-DZSJ5Mz0.js} +1 -1
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DJ81eUJX.mjs +141 -0
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js +1 -0
- package/dist/{RadioGroupExtended.vue.es-CkhBp9kI.mjs → RadioGroupExtended.vue.es-BalV7gwp.mjs} +2 -2
- package/dist/{RadioGroupExtended.vue.es-CHrcqSRq.js → RadioGroupExtended.vue.es-Dt6LH9Yh.js} +1 -1
- package/dist/{Section.vue.es-D5svcVS_.mjs → Section.vue.es-D7eiXUbk.mjs} +1 -1
- package/dist/{Section.vue.es-CSrVPlUK.js → Section.vue.es-zVXBHAL6.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BqOSBdFQ.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BM9Y4Cy3.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DudMRVka.mjs} +6 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs → Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs} +5 -5
- package/dist/StepInput.vue.es-C3Zm6Wc9.mjs +199 -0
- package/dist/StepInput.vue.es-mAnuCuDQ.js +1 -0
- package/dist/SubscriptionDetails.entry.ce-D4CsSoR9.js +1 -0
- package/dist/SubscriptionDetails.entry.ce-WEimiOex.mjs +1057 -0
- package/dist/{SubscriptionSchedules-CMVoB2bw.js → SubscriptionSchedules-Cm5Dt-1H.js} +1 -1
- package/dist/{SubscriptionSchedules-yDcsD1hd.mjs → SubscriptionSchedules-DrrEAPlx.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DZHsQImd.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DHp_KtbF.mjs} +2284 -2341
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-t2Awijf5.js +1 -0
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-BmNl5u8R.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs} +3 -3
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-BgXZMihr.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DOJ0t_fo.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bu-_clEa.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BUzdZHah.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DFU0IULg.mjs} +8 -8
- package/dist/{TooltipParagraph.vue.es-CxdL8-B7.mjs → TooltipParagraph.vue.es-BXbOJmjr.mjs} +3 -3
- package/dist/TooltipParagraph.vue.es-Cph6zT31.js +1 -0
- package/dist/{TrialChip.vue.es-BCc8q5j0.js → TrialChip.vue.es-C_wgHGuN.js} +1 -1
- package/dist/{TrialChip.vue.es-BK7m7e7q.mjs → TrialChip.vue.es-C_yRujip.mjs} +2 -2
- package/dist/{cn.es-ZXNzpauQ.mjs → cn.es-CGa6b2Lt.mjs} +2 -2
- package/dist/{cn.es-71nFUose.js → cn.es-D9YMDvG2.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +246 -230
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +201 -212
- 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 +2 -2
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +4 -4
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/{customElements-hH6pju3X.js → customElements-C963-LtW.js} +36 -32
- package/dist/{customElements-q_i9y0Ph.mjs → customElements-D5DAoHRI.mjs} +231 -196
- package/dist/{customer-BDoOIAFr.mjs → customer-DKa1B2vp.mjs} +4 -4
- package/dist/{customer-C9q6ti8s.js → customer-TE1FnGT0.js} +1 -1
- package/dist/{de-DE-BSlbAnPE.js → de-DE-B4TUdnUf.js} +1 -1
- package/dist/{de-DE-B_ik9VNt.mjs → de-DE-CLfzTbbX.mjs} +38 -6
- package/dist/de-DE-DaBBl-Ak.js +1 -0
- package/dist/{de-DE-DXsG-vXA.mjs → de-DE-jkW2dJrX.mjs} +28 -14
- package/dist/en-US-BNevqm0M.js +1 -0
- package/dist/{en-US-DkCltadt.mjs → en-US-D6SGRAch.mjs} +38 -6
- package/dist/en-US-J85TQRI8.js +1 -0
- package/dist/{en-US-C939IZ5i.mjs → en-US-SDhjlY_v.mjs} +20 -5
- package/dist/formControl-ODrpUvcA.js +1 -0
- package/dist/{index-BPU8tIml.mjs → formControl-dX7l8o3c.mjs} +160 -143
- package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +4 -0
- package/dist/icon-sprite.svg.es-Ds6lDf5p.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{invoices-CHp75zZI.js → invoices-ClqTWYF9.js} +1 -1
- package/dist/{invoices-DIzkXntV.mjs → invoices-DJTwftJv.mjs} +1 -1
- package/dist/it-IT-BkPbTueL.js +1 -0
- package/dist/{it-IT-DT3rfjOY.js → it-IT-CSYvGmpT.js} +1 -1
- package/dist/{it-IT-BxpwB3oJ.mjs → it-IT-CaaFToGB.mjs} +20 -6
- package/dist/{it-IT-CHj2McbF.mjs → it-IT-Cym1UvvK.mjs} +38 -6
- package/dist/{nl-NL-DfkhOJKc.js → nl-NL-CpE4IgwO.js} +1 -1
- package/dist/{nl-NL-na2I4aiP.mjs → nl-NL-D0MQKaql.mjs} +34 -20
- package/dist/{nl-NL-Cdvd_XMN.mjs → nl-NL-D0c4x5C0.mjs} +38 -6
- package/dist/nl-NL-jIfAVGv0.js +1 -0
- package/dist/paymentMethods-AL2U_byg.js +1 -0
- package/dist/{paymentMethods-DEKp_4QM.mjs → paymentMethods-CWzJhcWK.mjs} +16 -14
- package/dist/{payments-DBvregE8.js → payments-BmiHMlQt.js} +1 -1
- package/dist/{payments-C0-Hq2a4.mjs → payments-aXyfylwk.mjs} +6 -6
- package/dist/pricing.es-C07bgEZx.js +1 -0
- package/dist/pricing.es-QYWrKMUJ.mjs +30 -0
- package/dist/pricingPlanSchedules-BD4GIP_F.mjs +32 -0
- package/dist/pricingPlanSchedules-BfsMSvN0.js +1 -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 +10 -10
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +57 -55
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +3 -769
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +243 -270
- package/dist/{subscription-CrVOr5MF.mjs → subscription-D1yHKUNc.mjs} +2 -2
- package/dist/{subscriptions-BArXBCFr.js → subscriptions-Cm83ckfl.js} +1 -1
- package/dist/{subscriptions--9MaTXMb.mjs → subscriptions-cnR5fnf7.mjs} +1 -1
- package/dist/types/components/{wallets/WalletModalShell.types.d.ts → payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts} +3 -3
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +5 -0
- package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +5 -9
- package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/ConfigProvider/ConfigProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/CssOverridesProvider/CssOverridesProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +7 -11
- package/dist/types/components/providers/ExperimentalFeatureProvider/ExperimentalFeatureProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/HostElementProvider/HostElementProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +7 -11
- package/dist/types/components/providers/TeleportProvider/TeleportProvider.vue.d.ts +7 -11
- package/dist/types/components/providers/TranslationProvider/TranslationOverride.vue.d.ts +7 -11
- package/dist/types/components/providers/TranslationProvider/TranslationProvider.vue.d.ts +7 -11
- package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +21 -0
- package/dist/types/components/subscriptions/OnDemandItemsCard/OnDemandItemsCard.types.d.ts +7 -0
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +27 -0
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.entry.types.d.ts +1 -1
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +6 -5
- package/dist/types/services/paymentMethods.types.d.ts +4 -2
- package/dist/types/services/requests.types.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/AgentContext.d.ts +3 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +6 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/ChargeOnDemandPricingItems.d.ts +23 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/CustomFields.d.ts +16 -4
- package/dist/types/vendor/@solvimon/solvimon-types/types/Embeddable.d.ts +8 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +21 -6
- package/dist/types/vendor/@solvimon/solvimon-types/types/OAuth.d.ts +28 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +2 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +6 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingItemConfig.d.ts +5 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanGroups.d.ts +31 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSchedule.d.ts +9 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanScheduleInfo.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +3 -3
- package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlans.d.ts +3 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Product.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ProductItem.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +2 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/ResourceStatus.d.ts +1 -1
- package/dist/types/vendor/@solvimon/solvimon-types/types/SeatAssignment.d.ts +22 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Wallet.d.ts +6 -0
- package/dist/types/vendor/@solvimon/solvimon-types/types/Workflows.d.ts +128 -1
- package/dist/{useActionDispatchProvider-CKzeqXzY.js → useActionDispatchProvider-CHkVQMaE.js} +1 -1
- package/dist/{useActionDispatchProvider-BdciAX8T.mjs → useActionDispatchProvider-DDYqIh3r.mjs} +1 -1
- package/dist/{useCustomer-DSYr0F58.js → useCustomer-DGYtowRy.js} +1 -1
- package/dist/{useCustomer-D8ixhuuj.mjs → useCustomer-XZKWsolE.mjs} +1 -1
- package/dist/{useCustomerFormLabels-htMZ0xqB.mjs → useCustomerFormLabels-CcnkJLcB.mjs} +6 -6
- package/dist/useCustomerFormLabels-DAZziqYt.js +1 -0
- package/dist/{useExperimentalFeature-D29-TO3R.js → useExperimentalFeature-COOU6IZd.js} +1 -1
- package/dist/{useExperimentalFeature-JK_kAUQQ.mjs → useExperimentalFeature-ierhOt9Q.mjs} +1 -1
- package/dist/{useInvoiceData-Bpbog3zW.mjs → useInvoiceData-BEK-7msA.mjs} +3 -3
- package/dist/{useInvoiceData-DhrItfv7.js → useInvoiceData-CQRn8l9C.js} +1 -1
- package/dist/{useInvoicesList-duu_b5GW.js → useInvoicesList-BQkKyyXa.js} +1 -1
- package/dist/{useInvoicesList-BGwcJn4I.mjs → useInvoicesList-C4I118KM.mjs} +7 -7
- package/dist/{useLoadInitialData-BDmmpcfb.mjs → useLoadInitialData-CR0kbYw8.mjs} +1 -1
- package/dist/{useLoadInitialData-U2WvBmXT.js → useLoadInitialData-CrKnBZs_.js} +1 -1
- package/dist/{usePaymentMethodAvailability-DwtT5Czz.js → usePaymentMethodAvailability-Ci6LeYKt.js} +1 -1
- package/dist/{usePaymentMethodAvailability-adqRujTA.mjs → usePaymentMethodAvailability-ZH-m3B-A.mjs} +12 -12
- package/dist/{usePaymentMethodOptions-DlZtTQNQ.mjs → usePaymentMethodOptions-Ciifjo6c.mjs} +15 -13
- package/dist/usePaymentMethodOptions-Cqe92ZBn.js +1 -0
- package/dist/{usePaymentMethods-BnmSo_rr.mjs → usePaymentMethods-B-OKRyKd.mjs} +1 -1
- package/dist/{usePaymentMethods-DZ1a0mnr.js → usePaymentMethods-BKwrl82-.js} +1 -1
- package/dist/usePayments-Bauj16B-.js +1 -0
- package/dist/{usePayments-s-Z1di8d.mjs → usePayments-CV85OV8V.mjs} +46 -41
- package/dist/{usePortal-Hm7wvtgQ.js → usePortal-DSLImEfr.js} +1 -1
- package/dist/{usePortal-C4rR5Rhu.mjs → usePortal-H8Tv2TnZ.mjs} +1 -1
- package/dist/{useSubscription-DMAEJves.js → useSubscription-BiYNJT2e.js} +1 -1
- package/dist/{useSubscription-DSsXVO0h.mjs → useSubscription-DqnxWNKg.mjs} +1 -1
- package/dist/{useTimePeriod.es-CW8ycmpT.mjs → useTimePeriod.es-B22-fno3.mjs} +1 -1
- package/dist/{useTimePeriod.es-anHB63am.js → useTimePeriod.es-D2aiyfd-.js} +1 -1
- package/dist/useWatchDebounced-B8iX7ykx.js +1 -0
- package/dist/useWatchDebounced-BHlBPcXB.mjs +20 -0
- package/package.json +11 -8
- package/dist/Checkout.entry.ce-DgA0ckyl.js +0 -2
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DzbPUvHN.js +0 -1
- package/dist/InvoiceSummary.vue.es-v1TkOUhA.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-4RmdLbzY.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvpFnl9V.mjs +0 -141
- package/dist/PaymentIntegrationFormAdyen-C9KoiqMh.js +0 -98
- package/dist/PaymentIntegrationFormStripe-DTLgGutU.js +0 -102
- package/dist/PaymentMethod.vue.es-ZWda5GqF.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-CzUwtVEI.js +0 -1
- package/dist/PlanCustomizationEditor-CunwwXTw.js +0 -1
- package/dist/PlanCustomizationEditor-NLVkEYFF.mjs +0 -877
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-Dvuj-fos.mjs +0 -131
- package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-iE4dLawA.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DH7IZrNT.js +0 -1
- package/dist/TooltipParagraph.vue.es-DS_69pl1.js +0 -1
- package/dist/de-DE-npBTLtKL.js +0 -1
- package/dist/en-US-9xdcz3T5.js +0 -1
- package/dist/en-US-kGduGoka.js +0 -1
- package/dist/icon-sprite.svg.es-Bt21fMEt.mjs +0 -4
- package/dist/icon-sprite.svg.es-Dauis9LS.js +0 -1
- package/dist/index-DwueOtPi.js +0 -1
- package/dist/it-IT-BayNIAy7.js +0 -1
- package/dist/nl-NL-0rV4nFLw.js +0 -1
- package/dist/paymentMethods-CZGP6_4W.js +0 -1
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagement.types.d.ts +0 -47
- package/dist/useCustomerFormLabels-CRumh405.js +0 -1
- package/dist/usePaymentMethodOptions-CXdFKFqZ.js +0 -1
- package/dist/usePayments-DL4agK2i.js +0 -1
- package/dist/useWatchDebounced-CAU1WI1P.js +0 -1
- package/dist/useWatchDebounced-DT5IicPp.mjs +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Q=require("./formControl-ODrpUvcA.js"),Ae=require("./formatting.es-C72Nsrmh.js"),y=require("./Button.vue.es-qGvnOKnK.js"),q=require("./SubscriptionDetails.entry.ce-D4CsSoR9.js"),ee=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js"),Te=require("./PaymentMethod.vue.es-CJcSZ9lN.js"),p=require("./customElements-C963-LtW.js"),Pe=require("./ErrorNotification.vue.es-BX9dHEc-.js"),pe=require("./FormMessage.vue.es-dqATjC2N.js"),Be=require("./RadioGroupExtended.vue.es-Dt6LH9Yh.js"),xe=require("./StepInput.vue.es-mAnuCuDQ.js"),Se=require("./IconButton.vue.es-Bwdfu-jm.js"),Ve=require("./floating-ui.vue.es-Bly3DGWm.js"),Oe=require("./Section.vue.es-zVXBHAL6.js"),Le=require("./invoices-ClqTWYF9.js"),F=require("./CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js"),P=t=>t.replaceAll("_"," ").toLowerCase().replace(/^./,m=>m.toUpperCase()),Re=t=>{var m,o,h,a,_,i;const c=[];switch(t.type){case"CARD":c.push(t.card.brand&&P(t.card.brand),t.card.last_four_digits);break;case"ONLINE_BANKING":c.push(((m=t.online_banking)==null?void 0:m.variant)&&P(t.online_banking.variant),(o=t.online_banking)==null?void 0:o.owner_name);break;case"DIRECT_DEBIT":c.push(((h=t.direct_debit)==null?void 0:h.variant)&&P(t.direct_debit.variant),(a=t.direct_debit)==null?void 0:a.owner_name);break;case"BUY_NOW_PAY_LATER":c.push(((_=t.buy_now_pay_later)==null?void 0:_.variant)&&P(t.buy_now_pay_later.variant));break;case"DIGITAL_WALLET":c.push(((i=t.digital_wallet)==null?void 0:i.variant)&&P(t.digital_wallet.variant));break}return c.filter(Boolean).join(" ")||P(t.type)},Fe=e.defineComponent({__name:"Placeholder",props:{loading:{type:Boolean},shade:{default:"default"}},setup(t){return(m,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded",{"bg-gray-300":t.shade==="default","bg-gray-200":t.shade==="light"}])},[t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute inset-0",{"animated-gradient":t.loading}])},null,2)):e.createCommentVNode("",!0)],2))}}),Z=Ve._export_sfc(Fe,[["__scopeId","data-v-11677ac2"]]),qe={class:"flex flex-col gap-6"},$e={class:"flex flex-col gap-3","aria-labelledby":"charge-on-demand-items-heading"},Ye={class:"flex flex-col gap-2"},Ue={class:"flex min-w-0 grow flex-col"},ze={key:0,class:"flex shrink-0 items-center gap-1"},He={class:"w-32"},Ge={class:"flex flex-col gap-3","aria-labelledby":"charge-on-demand-preview-heading"},We={key:1,class:"flex flex-col gap-3","aria-busy":"true","data-testid":"charge-on-demand-preview-loading"},je={class:"flex flex-col gap-3","aria-labelledby":"charge-on-demand-payment-heading"},Ke={key:1,"data-testid":"charge-on-demand-no-payment-methods"},Xe=e.defineComponent({__name:"ChargeOnDemandEditor",props:e.mergeModels({items:{},preview:{default:void 0},isPreviewLoading:{type:Boolean,default:!1},paymentMethods:{},canAddPaymentMethod:{type:Boolean,default:!1},errors:{default:void 0},disabled:{type:Boolean,default:!1}},{selection:{required:!0},selectionModifiers:{},paymentMethodId:{},paymentMethodIdModifiers:{}}),emits:e.mergeModels(["add-payment-method"],["update:selection","update:paymentMethodId"]),setup(t){const m=t,o=e.useModel(t,"selection"),h=e.useModel(t,"paymentMethodId"),{$t:a}=p.useIntl(),_=n=>{o.value=[...o.value,n.priceType==="FLAT"?{pricingItemId:n.pricingItemId,units:n.defaultUnits}:{pricingItemId:n.pricingItemId}]},i=n=>{o.value=o.value.filter(({pricingItemId:u})=>u!==n.pricingItemId)},c=(n,u)=>{!Number.isInteger(u)||u<1||(o.value=o.value.map(g=>g.pricingItemId===n.pricingItemId?{...g,units:u}:g))},{getPriceLabel:v}=q.useChargeOnDemandPriceLabel(),I=e.computed(()=>new Map(o.value.map(n=>[n.pricingItemId,n]))),k=e.computed(()=>m.items.map(n=>{var u,g;return{item:n,selected:I.value.get(n.pricingItemId),error:(g=(u=m.errors)==null?void 0:u.items)==null?void 0:g[n.pricingItemId],priceLabel:v(n)}})),l=e.computed(()=>new Map(m.paymentMethods.map(n=>[n.id,n]))),w=e.computed(()=>m.paymentMethods.map(n=>({label:Re(n),value:n.id})));return(n,u)=>{var g,M,S;return e.openBlock(),e.createElementBlock("div",qe,[(g=t.errors)!=null&&g.form?(e.openBlock(),e.createBlock(Pe._sfc_main,{key:0,description:t.errors.form},null,8,["description"])):e.createCommentVNode("",!0),e.createElementVNode("section",$e,[e.createVNode(p._sfc_main,{id:"charge-on-demand-items-heading",tag:"h3",variant:"label","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Items",description:"Heading of the list of on-demand items that can be ordered",id:"charge_on_demand.items.heading"})),1)]),_:1}),e.createElementVNode("ul",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,({item:s,selected:b,error:C,priceLabel:V})=>(e.openBlock(),e.createElementBlock("li",{key:s.pricingItemId,class:"flex flex-col gap-1","data-testid":"charge-on-demand-item"},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-4 rounded-lg border px-4 py-3",{"border-red-600":C,"border-primary-600":!C&&b,"border-gray-300":!C&&!b}])},[e.createElementVNode("div",Ue,[e.createVNode(p._sfc_main,{tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.name),1)]),_:2},1024),V?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,tag:"span",variant:"body-sm",color:"secondary","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V),1)]),_:2},1024)):e.createCommentVNode("",!0)]),s.priceType==="FLAT"&&b?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",He,[e.createVNode(xe._sfc_main,{"model-value":b.units??s.defaultUnits,"initial-value":s.defaultUnits,min:1,name:`charge-on-demand-units-${s.pricingItemId}`,disabled:t.disabled,size:"sm","onUpdate:modelValue":N=>c(s,N)},null,8,["model-value","initial-value","name","disabled","onUpdate:modelValue"])]),e.createVNode(Se._sfc_main,{type:"button",icon:"close",intent:"subtle",size:"sm",disabled:t.disabled,tooltip:e.unref(a)({defaultMessage:"Remove",description:"Removes an on-demand item from the order",id:"charge_on_demand.item.remove"}),onClick:N=>i(s)},null,8,["disabled","tooltip","onClick"])])):b?(e.openBlock(),e.createBlock(y._sfc_main,{key:1,type:"button",intent:"secondary",size:"sm","icon-prefix":"check","aria-pressed":!0,disabled:t.disabled,onClick:N=>i(s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Added",description:"Label of an on-demand item that is in the order; clicking it removes the item",id:"charge_on_demand.item.added"})),1)]),_:1},8,["disabled","onClick"])):(e.openBlock(),e.createBlock(y._sfc_main,{key:2,type:"button",intent:"secondary",size:"sm","icon-prefix":"add","aria-pressed":s.priceType==="FIXED"?!1:void 0,disabled:t.disabled,onClick:N=>_(s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add",description:"Adds an on-demand item to the order",id:"charge_on_demand.item.add"})),1)]),_:1},8,["aria-pressed","disabled","onClick"]))],2),C?(e.openBlock(),e.createBlock(pe._sfc_main,{key:0,message:C},null,8,["message"])):e.createCommentVNode("",!0)]))),128))])]),e.createElementVNode("section",Ge,[e.createVNode(p._sfc_main,{id:"charge-on-demand-preview-heading",tag:"h3",variant:"label","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"You will pay",description:"Heading of the invoice preview of the on-demand order",id:"charge_on_demand.preview.heading"})),1)]),_:1}),o.value.length===0?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,variant:"body-sm",tag:"p",color:"subtle","no-spacing":"","data-testid":"charge-on-demand-preview-empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add an item to see what you'll pay.",description:"Shown instead of the invoice preview while no item is added",id:"charge_on_demand.preview.empty"})),1)]),_:1})):t.isPreviewLoading&&!t.preview?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(Z,{loading:"",class:"relative h-4 w-2/3 overflow-hidden"}),e.createVNode(Z,{loading:"",class:"relative h-4 w-1/2 overflow-hidden"}),e.createVNode(Z,{loading:"",class:"relative h-5 w-1/3 overflow-hidden"})])):t.preview?(e.openBlock(),e.createBlock(ee._sfc_main$1,{key:2,invoice:t.preview,"is-customer-facing":""},null,8,["invoice"])):e.createCommentVNode("",!0)]),e.createElementVNode("section",je,[e.createVNode(p._sfc_main,{id:"charge-on-demand-payment-heading",tag:"h3",variant:"label","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Payment method",description:"Heading of the payment method picker of the on-demand order",id:"charge_on_demand.payment_method.heading"})),1)]),_:1}),t.paymentMethods.length>0?(e.openBlock(),e.createBlock(Be._sfc_main,{key:0,modelValue:h.value,"onUpdate:modelValue":u[0]||(u[0]=s=>h.value=s),name:"charge-on-demand-payment-method",options:w.value,"show-radio":!1,error:(M=t.errors)==null?void 0:M.paymentMethod,disabled:t.disabled,direction:"column"},{label:e.withCtx(({optionValue:s})=>[l.value.get(s)?(e.openBlock(),e.createBlock(Te._sfc_main,{key:0,"payment-method":l.value.get(s)},null,8,["payment-method"])):e.createCommentVNode("",!0)]),description:e.withCtx(()=>[...u[2]||(u[2]=[])]),_:1},8,["modelValue","options","error","disabled"])):(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(n.$slots,"payment-methods-empty",{},()=>[e.createVNode(p._sfc_main,{tag:"p",color:"subtle",variant:"body-sm","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"There is no saved payment method that can pay for this order.",description:"Shown when no saved payment method can pay the on-demand order",id:"charge_on_demand.payment_method.empty"})),1)]),_:1})]),(S=t.errors)!=null&&S.paymentMethod?(e.openBlock(),e.createBlock(pe._sfc_main,{key:0,message:t.errors.paymentMethod},null,8,["message"])):e.createCommentVNode("",!0)])),t.canAddPaymentMethod?(e.openBlock(),e.createBlock(y._sfc_main,{key:2,type:"button",intent:"secondary","icon-prefix":"add",disabled:t.disabled,"data-testid":"charge-on-demand-add-payment-method",onClick:u[1]||(u[1]=s=>n.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Add payment method",description:"Opens the form to add a payment method for the on-demand order",id:"charge_on_demand.payment_method.add"})),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0)])])}}}),Je=["ORDER","ADD_PAYMENT_METHOD","PLACED","PAYMENT_FAILED","FAILED"];function Qe(t){return t.payment_status==="PAID"||t.payment_status==="OVERPAID"}function Ze(t){var m;return p.isApiError(t)?t.statusCode===422?t.resourceType==="PAYMENT"?"PAYMENT_FAILED":"FAILED":t.statusCode!==400?"FAILED":t.field==="payment_method_id"?"PAYMENT_METHOD":t.field==="pricing_plan_subscription_id"?"SUBSCRIPTION_INACTIVE":t.field==="pricing_items"||(m=t.field)!=null&&m.startsWith("pricing_items.")?"PRICING_ITEMS":"FAILED":"FAILED"}function et(t){return t==="PAYMENT_METHOD"||t==="PRICING_ITEMS"||t==="SUBSCRIPTION_INACTIVE"}function tt({pricingPlanScheduleId:t}){const{chargeOnDemandPricingItems:m}=Le.createInvoicesService(),o=p.useLogger(),h=e.ref(!1),a=e.ref(),_=e.ref(),i=e.ref();return{isCharging:h,chargedInvoice:a,chargeError:_,unpaidInvoiceId:i,charge:async({pricingItems:I,paymentMethodId:k})=>{h.value=!0,_.value=void 0,i.value=void 0;try{const l=await m({pricing_plan_schedule_id:t.value,pricing_items:I,payment_method_id:k,finalize_immediately:!0});return a.value=l,{invoice:l}}catch(l){const w=Ze(l);_.value=w,i.value=w==="PAYMENT_FAILED"&&p.isApiError(l)?l.resourceId:void 0;const n={scheduleId:t.value,outcome:w,...p.isApiError(l)?{statusCode:l.statusCode,field:l.field,requestId:l.requestId}:{}};return w==="FAILED"?o.error("ON_DEMAND_CHARGE_FAILED","Failed to charge the on-demand order",n,l):o.warn("ON_DEMAND_CHARGE_REFUSED","The on-demand order was refused or its payment did not go through",n,l),{error:w,unpaidInvoiceId:i.value}}finally{h.value=!1}},reset:()=>{a.value=void 0,_.value=void 0,i.value=void 0}}}const at={key:0,class:"flex flex-col gap-2"},nt={key:1,class:"flex flex-col gap-2"},ot={key:2,class:"flex flex-col gap-2"},dt=e.defineComponent({__name:"ChargeOnDemandModal",props:{showModal:{type:Boolean},subscription:{type:Object},scheduleId:{type:String},items:{type:Array},customer:{type:Object},paymentMethods:{type:Array},canViewCreatedInvoice:{type:Boolean}},emits:["close","invoice-created","view-invoice","payment-method-stored","payment-failed"],setup(t,{emit:m}){const o=t,h=m,{$t:a}=p.useIntl(),_=p.useLogger(),i=e.ref("ORDER"),c=e.ref([]),v=e.ref(),I=e.computed(()=>(o.subscription.payment_acceptor_ids??[]).length>0),k=e.computed(()=>q.getPayablePaymentMethods(o.paymentMethods??[],o.subscription)),l=e.ref();e.watch(k,d=>{var A;const r=l.value;l.value=void 0;const f=r?d.find(({id:T})=>!r.has(T)):void 0;if(f){v.value=f.id;return}d.some(({id:T})=>T===v.value)||(v.value=(A=d[0])==null?void 0:A.id)},{immediate:!0});const{paneRef:w,isActive:n,isSaving:u,open:g,leave:M,submit:S}=F.useAddPaymentMethodStep({step:i,name:"ADD_PAYMENT_METHOD",returnTo:"ORDER"}),s=e.ref(!1),b=e.ref(),C=d=>{s.value=!0,_.error("PAYMENT_METHOD_OPTIONS_LOAD_FAILED","Failed to load the payment methods that can be offered",{flow:"ON_DEMAND_ORDER",subscriptionId:o.subscription.id},d),n.value&&(M(),b.value=a({defaultMessage:"We couldn't load the ways to add a payment method. Please try again.",description:"Shown on the on-demand order when the payment methods that can be added failed to load",id:"charge_on_demand_modal.payment_method_options_error"}))},{settledOptions:V,isPending:N,load:ve}=F.useCustomerPaymentMethodOptions({isOpen:e.computed(()=>o.showModal&&I.value),customer:e.computed(()=>o.customer),subscriptionId:e.computed(()=>o.subscription.id),onError:C}),fe=e.computed(()=>{var d;return(d=V.value)==null?void 0:d.filter(({payment_acceptor:r})=>(o.subscription.payment_acceptor_ids??[]).includes(r.id))}),_e=()=>{b.value=void 0,s.value&&(s.value=!1,ve()),g()},ge=()=>{l.value=new Set(k.value.map(({id:d})=>d)),M(),h("payment-method-stored")},te=e.reactive({lines:e.computed(()=>c.value.map(({pricingItemId:d,units:r})=>{var f;return{pricingItemId:d,priceType:(f=o.items.find(A=>A.pricingItemId===d))==null?void 0:f.priceType,units:r}}))}),ae=Q.useValidation({lines:{$each:Q.common.forEach({units:{orderable:Q.common.withMessage(()=>a({defaultMessage:"Enter a whole number of 1 or more.",description:"Shown under the quantity of an on-demand order item that is not a whole number of 1 or more",id:"charge_on_demand_modal.units_error"}),(d,r)=>r.priceType!=="FLAT"||q.isOrderableUnits(d))}})}},te),$=e.computed(()=>ae.value.lines.$invalid),ne=e.computed(()=>{const{$errors:d=[]}=ae.value.lines.$each.$response??{},r=te.lines.flatMap(({pricingItemId:f},A)=>{var ue,me,he;const T=(he=(me=(ue=d[A])==null?void 0:ue.units)==null?void 0:me[0])==null?void 0:he.$message;return T?[[f,String(T)]]:[]});return r.length>0?Object.fromEntries(r):void 0}),oe=e.computed(()=>c.value.length>0&&!$.value?q.toChargePricingItems(c.value,o.items):void 0),{invoicePreview:de,isPreviewPending:O,hasPreviewFailed:ie,loadPreview:ye}=F.useChargeOnDemandInvoicePreview({pricingPlanScheduleId:e.computed(()=>o.scheduleId),pricingItems:oe}),Y=e.computed(()=>{var d;return(d=de.value)==null?void 0:d.invoice_amount_including_tax}),{isCharging:E,chargedInvoice:B,chargeError:D,unpaidInvoiceId:U,charge:be,reset:we}=tt({pricingPlanScheduleId:e.computed(()=>o.scheduleId)}),Ie=e.computed(()=>{switch(D.value){case"PAYMENT_METHOD":return a({defaultMessage:"This payment method can't pay for this order. Choose another one.",description:"Shown on the on-demand order when the chosen payment method cannot pay for it",id:"charge_on_demand_modal.charge_error.payment_method"});case"PRICING_ITEMS":return a({defaultMessage:"Some items in your order can't be ordered as entered. Check your order and try again.",description:"Shown on the on-demand order when an item, its quantity or its amount was not accepted",id:"charge_on_demand_modal.charge_error.pricing_items"});case"SUBSCRIPTION_INACTIVE":return a({defaultMessage:"This subscription can't take orders right now.",description:"Shown on the on-demand order when the subscription is not active, so nothing can be ordered on it",id:"charge_on_demand_modal.charge_error.subscription_inactive"});default:return}}),ke=e.computed(()=>D.value==="SUBSCRIPTION_INACTIVE");e.watch(v,()=>{D.value==="PAYMENT_METHOD"&&(D.value=void 0)}),e.watch(c,()=>{D.value==="PRICING_ITEMS"&&(D.value=void 0)},{deep:!0});const Ce=e.computed(()=>ie.value?a({defaultMessage:"We couldn't calculate the total. Please try again.",description:"Shown on the on-demand order when its total failed to load",id:"charge_on_demand_modal.preview_error"}):void 0),z=e.computed(()=>ie.value&&!O.value&&!E.value),re=e.computed(()=>Ie.value??Ce.value??b.value),Ee=e.computed(()=>re.value||ne.value?{form:re.value,items:ne.value}:void 0),L=e.computed(()=>i.value==="PLACED"),R=e.computed(()=>!!B.value&&Qe(B.value)),se=e.computed(()=>i.value==="PAYMENT_FAILED"||i.value==="FAILED"),le=e.computed(()=>!E.value&&I.value&&!ke.value&&c.value.length>0&&!$.value&&!!v.value&&!!Y.value&&!O.value),Me=e.computed(()=>i.value==="PLACED"?a({defaultMessage:"Order placed",description:"Title of the on-demand order modal once the order is placed, paid or not",id:"charge_on_demand_modal.placed.title"}):i.value==="PAYMENT_FAILED"?a({defaultMessage:"Payment not completed",description:"Title of the on-demand order modal when the payment for the order could not be made",id:"charge_on_demand_modal.payment_failed.title"}):i.value==="FAILED"?a({defaultMessage:"Something went wrong",description:"Title of the on-demand order modal when the order failed and it is unknown whether it went through",id:"charge_on_demand_modal.failed.title"}):n.value?a({defaultMessage:"Add payment method",description:"Title of the on-demand order modal while the customer is adding a payment method",id:"charge_on_demand_modal.add_payment_method.title"}):a({defaultMessage:"Order on-demand items",description:"Title of the modal for ordering the on-demand items of a subscription",id:"charge_on_demand_modal.title"})),Ne=e.computed(()=>i.value==="PLACED"?R.value?a({defaultMessage:"Your order is paid. The invoice is in your invoice list.",description:"Subtitle of the on-demand order modal once the order has been paid",id:"charge_on_demand_modal.success.subtitle"}):a({defaultMessage:"Your invoice was created, but it isn't paid yet. You'll find it in your invoice list.",description:"Subtitle of the on-demand order modal when the order was placed but its invoice is not paid",id:"charge_on_demand_modal.placed.unpaid.subtitle"}):i.value==="PAYMENT_FAILED"&&U.value?a({defaultMessage:"We couldn't take the payment for this order. Its invoice is in your invoice list, waiting to be paid.",description:"Subtitle of the on-demand order modal when the order was placed but the payment for its invoice was refused",id:"charge_on_demand_modal.payment_failed.unpaid_invoice.subtitle"}):i.value==="PAYMENT_FAILED"?a({defaultMessage:"We couldn't take the payment for this order. If an invoice was created, you'll find it in your invoice list.",description:"Subtitle of the on-demand order modal when the payment for the order could not be made",id:"charge_on_demand_modal.payment_failed.subtitle"}):i.value==="FAILED"?a({defaultMessage:"We couldn't complete your order. Check your invoice list before trying again.",description:"Subtitle of the on-demand order modal when the order failed and it is unknown whether it went through",id:"charge_on_demand_modal.failed.subtitle"}):n.value?a({defaultMessage:"Add a payment method to pay for this order.",description:"Subtitle of the on-demand order modal while the customer is adding a payment method",id:"charge_on_demand_modal.add_payment_method.subtitle"}):void 0),ce=e.computed(()=>n.value?a({defaultMessage:"Back",description:"Leaves the add payment method step of the on-demand order modal for the order",id:"charge_on_demand_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Closes the modal for ordering on-demand items",id:"charge_on_demand_modal.cancel_button.label"})),x=e.computed(()=>L.value?a({defaultMessage:"Done",description:"Closes the on-demand order modal once the order is placed",id:"charge_on_demand_modal.done_button.label"}):se.value?a({defaultMessage:"Close",description:"Closes the on-demand order modal when the order did not go through",id:"charge_on_demand_modal.close_button.label"}):n.value?a({defaultMessage:"Save payment method",description:"Confirm button of the on-demand order modal while the customer is adding a payment method",id:"charge_on_demand_modal.save_payment_method.label"}):c.value.length===0?a({defaultMessage:"Add an item to continue",description:"Disabled pay button of the on-demand order while no item is added",id:"charge_on_demand_modal.confirm_button.no_items"}):$.value?a({defaultMessage:"Check the quantities to continue",description:"Disabled pay button of the on-demand order while an item has a quantity that cannot be ordered",id:"charge_on_demand_modal.confirm_button.invalid_units"}):z.value?a({defaultMessage:"Calculate total again",description:"Pay button of the on-demand order when its total failed to load",id:"charge_on_demand_modal.confirm_button.retry_preview"}):!Y.value||O.value?a({defaultMessage:"Updating total…",description:"Disabled pay button of the on-demand order while its total is calculated",id:"charge_on_demand_modal.confirm_button.updating"}):a({defaultMessage:"Pay {total}",description:"Pay button of the on-demand order, with the total it charges",id:"charge_on_demand_modal.confirm_button.pay"},{total:Ae.formatAmount(Y.value)})),De=async()=>{const d=oe.value;if(!le.value||!d||!v.value)return;const r=await be({pricingItems:d,paymentMethodId:v.value});"invoice"in r?(h("invoice-created",r.invoice),i.value="PLACED"):et(r.error)||(i.value=r.error)},H=()=>{if(n.value){S();return}if(z.value){ye();return}De()},G=()=>{h("close")},W=e.computed(()=>L.value&&!R.value&&o.canViewCreatedInvoice),j=e.computed(()=>i.value==="PAYMENT_FAILED"&&!!U.value&&o.canViewCreatedInvoice),K=e.computed(()=>a({defaultMessage:"Go to invoice",description:"Opens the invoice of the on-demand order the customer just placed",id:"charge_on_demand_modal.view_invoice_button.label"})),X=()=>{var r;const d=((r=B.value)==null?void 0:r.id)??U.value;G(),d&&h("view-invoice",d)},J=()=>{if(!(u.value||E.value)){if(L.value){G();return}if(n.value){M();return}h("close")}};return e.watch(()=>o.showModal,d=>{d&&(i.value="ORDER",c.value=[],l.value=void 0,we(),b.value=void 0)}),(d,r)=>(e.openBlock(),e.createBlock(F._sfc_main$1,{ref_key:"addPaymentMethodRef",ref:w,class:"sv-charge-on-demand-modal","show-modal":t.showModal,title:Me.value,"sub-title":Ne.value,"cancel-button-text":ce.value,"confirm-button-text":x.value,"is-pending":e.unref(u)||e.unref(E),panes:e.unref(Je),step:i.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":fe.value,"is-payment-method-options-pending":e.unref(N),"is-adding-payment-method":e.unref(n),onConfirm:H,onCancel:J,onPaymentSuccess:ge,onPaymentFailed:r[2]||(r[2]=f=>d.$emit("payment-failed",f))},{ORDER:e.withCtx(()=>[I.value?(e.openBlock(),e.createBlock(e.unref(Xe),{key:0,selection:c.value,"onUpdate:selection":r[0]||(r[0]=f=>c.value=f),"payment-method-id":v.value,"onUpdate:paymentMethodId":r[1]||(r[1]=f=>v.value=f),class:"sv-charge-on-demand-modal__form",items:t.items,preview:e.unref(de),"is-preview-loading":e.unref(O),"payment-methods":k.value,errors:Ee.value,disabled:e.unref(E),"can-add-payment-method":"",onAddPaymentMethod:_e},null,8,["selection","payment-method-id","items","preview","is-preview-loading","payment-methods","errors","disabled"])):(e.openBlock(),e.createBlock(ee._sfc_main,{key:1,class:"sv-charge-on-demand-modal__unavailable",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Ordering isn't available",description:"Title shown instead of the on-demand order form when the subscription cannot take payments",id:"charge_on_demand_modal.unavailable.title"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"This subscription can't take payments here. Contact us to order these items.",description:"Message shown instead of the on-demand order form when the subscription cannot take payments",id:"charge_on_demand_modal.unavailable.message"})),1)]),_:1}))]),PLACED:e.withCtx(()=>[e.unref(B)?(e.openBlock(),e.createBlock(e.unref(Oe._sfc_main),{key:0,class:"sv-charge-on-demand-modal__receipt","content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee._sfc_main$1),{invoice:e.unref(B),"is-customer-facing":"","is-paid":R.value},null,8,["invoice","is-paid"])]),_:1})):e.createCommentVNode("",!0)]),footer:e.withCtx(()=>[L.value?(e.openBlock(),e.createElementBlock("div",at,[W.value?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary","data-testid":"charge-on-demand-view-invoice",onClick:X},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(y._sfc_main),{size:"lg",intent:W.value?"subtle":"primary",class:e.normalizeClass(["sv-action",W.value?"sv-action--secondary":"sv-action--primary"]),"data-testid":"charge-on-demand-done",onClick:G},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["intent","class"]),R.value&&t.canViewCreatedInvoice?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:1,size:"lg",intent:"subtle",class:"sv-action sv-action--secondary","data-testid":"charge-on-demand-view-invoice",onClick:X},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value),1)]),_:1})):e.createCommentVNode("",!0)])):se.value?(e.openBlock(),e.createElementBlock("div",nt,[j.value?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary","data-testid":"charge-on-demand-view-invoice",onClick:X},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(y._sfc_main),{size:"lg",intent:j.value?"subtle":"primary",class:e.normalizeClass(["sv-action",j.value?"sv-action--secondary":"sv-action--primary"]),"data-testid":"charge-on-demand-close",onClick:J},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["intent","class"])])):(e.openBlock(),e.createElementBlock("div",ot,[e.unref(n)?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary","data-testid":"charge-on-demand-save-payment-method",loading:e.unref(u),onClick:H},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["loading"])):I.value?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:1,size:"lg",class:"sv-action sv-action--primary","data-testid":"charge-on-demand-confirm",disabled:!le.value&&!z.value,loading:e.unref(E),onClick:H},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["disabled","loading"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y._sfc_main),{size:"lg",intent:"subtle",class:"sv-action sv-action--secondary","data-testid":"charge-on-demand-cancel",disabled:e.unref(E),onClick:J},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ce.value),1)]),_:1},8,["disabled"])]))]),_: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"]))}});exports.default=dt;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("vue"),S=require("./customElements-C963-LtW.js"),ut=require("./useTimePeriod.es-D2aiyfd-.js"),ne=require("./formatting.es-C72Nsrmh.js"),oe=require("./Button.vue.es-qGvnOKnK.js"),Vt=require("./ErrorNotification.vue.es-BX9dHEc-.js"),zt=require("./countryData.es-C4jHBzfo.js"),Rt=require("./subscriptions-Cm83ckfl.js"),me=require("./error-CmduqgVq.js"),dt=require("./TrialChip.vue.es-C_wgHGuN.js"),jt=require("./useService-H7BjLg8P.js"),Ut=require("./invoices-ClqTWYF9.js"),se=require("./pricingPlanSchedule-BM8vsKkV.js"),z=require("./formControl-ODrpUvcA.js"),Ie=require("./useCustomerFormLabels-DAZziqYt.js"),$t=require("./useWatchDebounced-B8iX7ykx.js"),Ft=require("./usePaymentMethodOptions-Cqe92ZBn.js"),Me=require("./subscription-ZA62t4E9.js"),Be=require("./pricing-BVAld27Y.js"),de=require("./url-vloPOiXd.js"),he=require("./adyen-Druit6gz.js"),Gt=require("./usePortal-DSLImEfr.js"),Yt=require("./getCountryNameByCode.es-Xxc0nZsH.js"),tt=require("./Expand.vue.es-BtM0EZEr.js"),le=require("./Input.vue.es-B47l_feL.js"),ie=require("./Section.vue.es-zVXBHAL6.js"),Kt=require("./Alert.vue.es-RyK53a2P.js"),qt=require("./customer-TE1FnGT0.js"),ge=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js"),Se=require("./TooltipParagraph.vue.es-Cph6zT31.js"),Qt=require("./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js"),nt=require("./Chip.vue.es-D60gTbfe.js"),pt=require("./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js"),Ht=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js"),mt=require("./useViewport-hPRVDWCm.js"),ce=require("./Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js"),Zt=require("./DividerText.vue.es-BF3gnr4e.js"),Ae=require("./adyenSdk-BP2XXzeJ.js"),Xt=require("./payments-BmiHMlQt.js"),Wt=require("./paymentFailure-Cki8c5BX.js"),Jt=require("./ContentWithAsideLayout-RSdKXqAf.js"),en=require("./cn.es-D9YMDvG2.js"),tn=require("./sessionReference-m_6Rp4X1.js"),nn={AT:"Austria",BE:"Belgium",BG:"Bulgaria",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GR:"Greece",HR:"Croatia",HU:"Hungary",IE:"Ireland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SE:"Sweden",SI:"Slovenia",SK:"Slovakia"};function gt(t){return Object.keys(nn).includes(t)}function ot(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);n&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,a)}return o}function be(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?ot(Object(o),!0).forEach(function(a){on(t,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ot(Object(o)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(o,a))})}return t}function on(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function Ee(t){return typeof t=="function"}function Le(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Pe(t){return Ee(t.$validator)?be({},t):{$validator:t}}function ft(t){return typeof t=="object"?t.$valid:t}function yt(t){return t.$validator||t}function an(t,n){if(!Le(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!Le(n)&&!Ee(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Pe(n);return o.$params=be(be({},o.$params||{}),t),o}function rn(t,n){if(!Ee(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!Le(n)&&!Ee(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Pe(n);return o.$message=t,o}function ln(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=Pe(t);return be(be({},o),{},{$async:!0,$watchTargets:n})}function sn(t){return{$validator(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.unref(n).reduce((r,u,s)=>{const d=Object.entries(u).reduce((_,m)=>{let[v,C]=m;const y=t[v]||{},A=Object.entries(y).reduce((E,f)=>{let[V,k]=f;const I=yt(k).call(this,C,u,s,...a),p=ft(I);if(E.$data[V]=I,E.$data.$invalid=!p||!!E.$data.$invalid,E.$data.$error=E.$data.$invalid,!p){let L=k.$message||"";const x=k.$params||{};typeof L=="function"&&(L=L({$pending:!1,$invalid:!p,$params:x,$model:C,$response:I})),E.$errors.push({$property:v,$message:L,$params:x,$response:I,$model:C,$pending:!1,$validator:V})}return{$valid:E.$valid&&p,$data:E.$data,$errors:E.$errors}},{$valid:!0,$data:{},$errors:[]});return _.$data[v]=A.$data,_.$errors[v]=A.$errors,{$valid:_.$valid&&A.$valid,$data:_.$data,$errors:_.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:r.$valid&&d.$valid,$data:r.$data.concat(d.$data),$errors:r.$errors.concat(d.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:o}=n;return o?o.$errors.map(a=>Object.values(a).map(i=>i.map(r=>r.$message)).reduce((i,r)=>i.concat(r),[])):[]}}}const vt=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let n in t)return!0;return!1}return!!String(t).length},cn=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function ue(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return a=>(a=e.unref(a),!vt(a)||n.every(i=>(i.lastIndex=0,i.test(a))))}var un=Object.freeze({__proto__:null,forEach:sn,len:cn,normalizeValidatorObject:Pe,regex:ue,req:vt,unwrap:e.unref,unwrapNormalizedValidator:yt,unwrapValidatorResponse:ft,withAsync:ln,withMessage:rn,withParams:an});ue(/^[a-zA-Z]*$/);ue(/^[a-zA-Z0-9]*$/);ue(/^\d*(\.\d+)?$/);const dn=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;ue(dn);const pn=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;ue(pn);ue(/(^[0-9]*$)|(^-[0-9]+$)/);ue(/^[-]?\d*(\.\d+)?$/);function xe(t){return!!zt.countryData.find(n=>n.key===t)}const _t={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},mn=t=>!t||typeof t!="string"||t.trim()===""?!0:Object.values(_t).some(n=>n.regex.test(t)),gn=({$model:t})=>{if(!t||typeof t!="string"||t.trim()==="")return"";const n=e.inject(S.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,a=Object.values(_t).find(i=>t.toUpperCase().startsWith(i.prefix.toUpperCase()));return a?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:a.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},Oe=un.withMessage(gn,mn),fn="preview",yn="NL",ht=t=>{var n,o;if("organization"in t)return(n=t.organization)==null?void 0:n.registered_address;if("individual"in t)return(o=t.individual)==null?void 0:o.residential_address},vn=t=>{const n=ht(t);return{...(n==null?void 0:n.line1)&&{line1:n.line1},...(n==null?void 0:n.line2)&&{line2:n.line2},...(n==null?void 0:n.city)&&{city:n.city},...(n==null?void 0:n.state)&&{state:n.state},country:(n==null?void 0:n.country)||yn,...(n==null?void 0:n.postal_code)&&{postal_code:n.postal_code}}},_n=t=>{var a,i;const n=vn(t),o=t.type??"INDIVIDUAL";if(o==="ORGANIZATION"){const r="organization"in t?t.organization:void 0,u=(i=(a=r==null?void 0:r.tax_ids)==null?void 0:a[0])==null?void 0:i.id;return{type:o,organization:{legal_name:(r==null?void 0:r.legal_name)||fn,registered_address:n,...u&&{tax_id:Oe.$validator(u,{},{})?u:void 0}}}}return{type:o,individual:{residential_address:n}}},hn={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},Mn=t=>{if(t)return hn[t]},Mt=({country:t,pricingCurrencySettings:n,fallbackCurrency:o})=>{const a=Mn(t),i=(n==null?void 0:n.pricing_currencies)??[];return a&&i.includes(a)?a:(n==null?void 0:n.default_pricing_currency)??o??a},bn=()=>{const{getInvoicePreview:t}=Ut.createInvoicesService(),n=S.useLogger(),o=e.ref(),a=e.ref(),i=e.ref(),r=e.ref({}),u=e.ref(me.ApiStatus.Initial),s=e.ref({}),d=e.ref(),_=v=>`${v.type}:${v.value}`;return{loadInvoicePreview:async({subscription:v,subscriptionStartAt:C,customer:y={},seatsValues:A,unitsValues:E,enabledPricingIds:f,promotionCode:V})=>{var c,g,b,P,T,R;const k=_n(y);u.value=me.ApiStatus.Loading;const h=se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,type:"DEFAULT"}),I=(c=h==null?void 0:h.pricing_plan_version)==null?void 0:c.pricing_currency_settings,p=(((g=I==null?void 0:I.pricing_currencies)==null?void 0:g.length)??0)>1,L=((P=(b=h==null?void 0:h.pricing_plan_version)==null?void 0:b.billing_period_settings)==null?void 0:P.billing_periods)??[],x=L.length>1,U=L.length>0?L.map(({period:B})=>B):v.billing_period?[v.billing_period]:[],ee=Mt({country:(T=ht(y))==null?void 0:T.country,pricingCurrencySettings:I,fallbackCurrency:v.billing_currency});if(!U.length){n.warn("INVOICE_PREVIEW_SKIPPED","No billing period to preview an invoice for",{subscriptionId:v.id}),u.value=me.ApiStatus.Done;return}const l=v.billing_period?_(v.billing_period):_(U[0]),M=U.map(async B=>{var O;const Q=_(B),Y=se.getScheduleCustomizations({enabledPricings:f==null?void 0:f.map(F=>({pricing_id:F})),seatsValues:A,unitsValues:E,pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,pricingCurrency:p?ee:void 0,billingPeriod:x?B:void 0})??[];if(V){const F=(O=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:G})=>G.type==="DEFAULT"))==null?void 0:O.id;if(F){const G=Y.find(({pricing_plan_schedule_id:Z})=>Z===F);G?G.promotion_codes=[V]:Y.push({pricing_plan_schedule_id:F,promotion_codes:[V]})}}const K={pricingPlanSubscriptionId:v.id,startAt:C,customizations:Y,customer:k},q=s.value[Q];if(q&&jt.isEqual(K,q))return{periodKey:Q,response:void 0};s.value={...s.value,[Q]:K};const H=await t(K);return{periodKey:Q,response:H}});try{const B={...r.value},Q=await Promise.all(M),Y=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:q})=>q.type==="TRIAL"),K=(R=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:q})=>q.type==="DEFAULT"))==null?void 0:R.id;Q.forEach(({periodKey:q,response:H})=>{var G;if(!H)return;d.value=(G=H.invoice_infos.at(-1))==null?void 0:G.pricing_plan_schedule_id,Y&&(a.value=H.first_invoice,Y.start_at&&Y.end_at&&(o.value=dt.convertDateRangeToTimePeriod(new Date(Y.start_at),new Date(Y.end_at))));const O=H.invoice_infos.find(({pricing_plan_schedule_id:Z})=>Z===K),F=O==null?void 0:O.invoices[0];F&&(B[q]=F)}),r.value=B,i.value=B[l]}catch(B){throw u.value=me.ApiStatus.Failed,n.error("INVOICE_PREVIEW_FAILED","Failed to load the invoice preview",{preview:"CHECKOUT"},B),B}finally{u.value=me.ApiStatus.Done}},invoicePreview:i,invoicePreviewByBillingPeriod:r,trialInvoicePreview:a,trialPeriod:o,lastPreviewScheduleId:d,isPending:e.computed(()=>u.value===me.ApiStatus.Loading)}},it=["email","country"],bt="GENERIC_TAX_ID",at={US:["addressLine1","postalCode"],CA:["state"]},Nn=t=>!t||!at[t]?it:[...at[t],...it],rt=t=>{const n={...t.addressLine1&&{line1:t.addressLine1},...t.addressLine2&&{line2:t.addressLine2},...t.city&&{city:t.city},...t.state&&{state:t.state},...t.postalCode&&{postal_code:t.postalCode},country:t.country??""};return t.type==="ORGANIZATION"?{type:"ORGANIZATION",organization:{legal_name:t.companyLegalName??"",registered_address:n,...t.companyVatNumber&&{tax_ids:[{id:t.companyVatNumber,type:bt}]}}}:{type:"INDIVIDUAL",individual:{residential_address:n}}};function In(){return{getGeoLocation(){return fetch("https://api.country.is/").then(t=>t.json())}}}function Cn({initialState:t,onRequiredFieldChange:n}){const o=e.ref(Ce(t)),a=e.ref(Ce(t)),i=m=>{const v=Ce({...e.toRaw(o.value),...m});o.value=v,a.value=structuredClone(v)},r=e.computed(()=>Nn(o.value.country)),u=m=>r.value.includes(m),s=z.useValidation({email:{required:z.required,email:z.email},country:{required:z.required},state:{required:z.requiredIf(()=>u("state"))},addressLine1:{required:z.requiredIf(()=>u("addressLine1"))},postalCode:{required:z.requiredIf(()=>u("postalCode"))},companyLegalName:z.requiredIf(o.value.type==="ORGANIZATION"),companyVatNumber:{taxId:Oe}},o),d=m=>{m||In().getGeoLocation().then(({country:v})=>{o.value.country=v})},_=(m,v)=>{const C=Ie.objectDiff({from:v,to:m}),y=Object.keys(C).find(En);if(y){if(["type","companyVatNumber"].includes(y)){n(m);return}if(y==="seatsValues"){n(m);return}if(y==="unitsValues"){n(m);return}if(y==="enabledPricingIds"){n(m);return}if(y!=="email"&&u(y)){n(m);return}}};return e.onMounted(async()=>{await d(t==null?void 0:t.country)}),$t.useWatchDebounced(()=>JSON.parse(JSON.stringify(o.value)),_,{debounce:200}),{form:o,validation:s,getIsFieldRequired:u,updateInitialState:i,initialState:a}}const Ce=(t={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,unitsValues:void 0,enabledPricingIds:void 0,...t});function En(t){return t in Ce()}function An(t,n=void 0){const o=n??[],a=Me.getPricingGroupsFromExtendedPricingPlanSubscription(t);for(const i of a)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(i.selection_constraint)){const r=i.pricings.map(u=>u.id);if(n!=null&&n.some(u=>r.includes(u)))continue;o.push(i.pricings[0].id)}return o}function Pn(t){return Me.getPricingGroupsFromExtendedPricingPlanSubscription(t).some(o=>o.selection_constraint==="EXACTLY_ONE"||o.selection_constraint==="AT_LEAST_ONE")}function xn(t){const n=Be.getAllPricingsFromScheduleInfos(t.pricing_plan_schedule_infos),o=Me.getPricingGroupsFromExtendedPricingPlanSubscription(t);return n.some(a=>a.product_type==="ADDON")||o.some(a=>a.object_type==="ADDON")}const lt=t=>(t??[]).flatMap(n=>n.configs??[]),Nt=t=>[...t.configs??[],...lt(t.billing_period_configs),...(t.pricing_currency_configs??[]).flatMap(n=>[...n.configs??[],...lt(n.billing_period_configs)])];function Dn({pricings:t,pricingItemConfigId:n}){var r,u;const o=t.flatMap(s=>s.items??[]).find(s=>{var d;return(d=s.configs)==null?void 0:d.some(_=>_.id===n)}),a=(r=o==null?void 0:o.configs)==null?void 0:r.find(s=>s.id===n),i=(u=o==null?void 0:o.product_items)==null?void 0:u[0];return{config:a,productItem:i}}const It="1";function kn(t){const n=Be.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(Nt);return new Map(n.flatMap(o=>{var a;return(a=o.default_seats_value)!=null&&a.number?[[o.id,o.default_seats_value.number]]:[]}))}function wn(t){var a;const n=(a=t==null?void 0:t.pricing_plan_schedule)==null?void 0:a.seats_values;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?kn(t):new Map;return n.map(({pricing_item_config_id:i,number:r})=>({pricing_item_config_id:i,number:r||o.get(i)||It}))}const Ct="1";function Sn(t){const n=Be.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(Nt);return new Map(n.flatMap(o=>{var a;return(a=o.default_units)!=null&&a.number?[[o.id,o.default_units.number]]:[]}))}function Tn(t){var a;const n=(a=t==null?void 0:t.pricing_plan_schedule)==null?void 0:a.units;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?Sn(t):new Map;return n.map(({pricing_item_config_id:i,number:r})=>({pricing_item_config_id:i,number:r||o.get(i)||Ct}))}const Te="solvimon_checkout_redirect_state";function Ln({initialCountry:t,initialEmail:n,subscriptionId:o,enabledPricingIds:a}){const i=S.useLogger(),r=(()=>{if(t){if(xe(t))return t;i.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${t}"`)}})(),u=(()=>{if(n){if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return n;i.error("INVALID_EMAIL",`invalid email provided: "${n}"`)}})(),s=e.ref(!1),d=e.ref(),{getSubscription:_}=Rt.createSubscriptionsService(),m=bn(),v=e.computed(()=>d.value&&p.form.value.country&&U.value),{paymentMethodOptions:C,get:y,isPending:A,error:E}=Ft.usePaymentMethodOptions(),f=async(l,M)=>{try{await y({subscriptionId:d.value.id,country:l,amount:M})}catch{i.error("PAYMENT_METHOD_OPTIONS_LOAD_FAILED","Failed to load the payment methods that can be offered",{flow:"CHECKOUT"},E.value)}},V=e.computed(()=>E.value!==null),k=()=>{const{country:l}=p.form.value;!d.value||!l||!U.value||f(l,U.value)},h=()=>{const l=p.form.value;return m.loadInvoicePreview({subscription:d.value,customer:rt(l),seatsValues:l.seatsValues,unitsValues:l.unitsValues,enabledPricingIds:l.enabledPricingIds??a,promotionCode:l.promotionCode})},I=async l=>{const M=l.promotionCode??p.form.value.promotionCode,c=l.enabledPricingIds??p.form.value.enabledPricingIds,g={...p.form.value,...l};return await m.loadInvoicePreview({subscription:d.value,customer:rt(g),seatsValues:g.seatsValues,unitsValues:g.unitsValues,enabledPricingIds:c,promotionCode:M}),{trialInvoicePreview:m.trialInvoicePreview.value,invoicePreview:m.invoicePreview.value}},p=Cn({initialState:{country:r,email:u},onRequiredFieldChange:()=>{d.value&&h().catch(()=>{})}}),L=async()=>{var P,T,R,B;const l=await _({id:o,expanded:!0}),M=se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:l.pricing_plan_schedule_infos,type:"DEFAULT"}),c=(B=(R=(T=(P=M==null?void 0:M.pricing_plan_version)==null?void 0:P.billing_period_settings)==null?void 0:T.billing_periods)==null?void 0:R[0])==null?void 0:B.period;d.value={...l,billing_period:c??l.billing_period};const g=wn(M),b=Tn(M);p.updateInitialState({...p.form.value,enabledPricingIds:An(l,a),...g?{seatsValues:g}:{},...b?{unitsValues:b}:{}})},x=e.computed(()=>{var Y,K,q,H,O,F,G,Z,W;const l=p.form.value.firstName||p.form.value.infix||p.form.value.lastName?{...p.form.value.firstName?{first_name:p.form.value.firstName}:{},...p.form.value.infix?{infix:p.form.value.infix}:{},...p.form.value.lastName?{last_name:p.form.value.lastName}:{}}:{},M={...p.form.value.addressLine1&&{line1:p.form.value.addressLine1},...p.form.value.addressLine2&&{line2:p.form.value.addressLine2},...p.form.value.city&&{city:p.form.value.city},...p.form.value.postalCode&&{postal_code:p.form.value.postalCode},...p.form.value.state&&{state:p.form.value.state},country:p.form.value.country??""},c=se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((Y=d.value)==null?void 0:Y.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),g=(K=c==null?void 0:c.pricing_plan_version)==null?void 0:K.pricing_currency_settings,b=(((q=g==null?void 0:g.pricing_currencies)==null?void 0:q.length)??0)>1,T=(((O=(H=c==null?void 0:c.pricing_plan_version)==null?void 0:H.billing_period_settings)==null?void 0:O.billing_periods)??[]).length>1,R=se.getScheduleCustomizations({enabledPricings:(F=p.form.value.enabledPricingIds)==null?void 0:F.map(J=>({pricing_id:J})),seatsValues:p.form.value.seatsValues,unitsValues:p.form.value.unitsValues,pricingPlanScheduleInfos:((G=d.value)==null?void 0:G.pricing_plan_schedule_infos)??[],pricingCurrency:b?(Z=d.value)==null?void 0:Z.billing_currency:void 0,billingPeriod:T?(W=d.value)==null?void 0:W.billing_period:void 0}),B=p.form.value.promotionCode,Q=B&&d.value?(()=>{var fe,ye,Ne;const J=R?[...R]:[],ae=((fe=J[0])==null?void 0:fe.pricing_plan_schedule_id)??((Ne=se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((ye=d.value)==null?void 0:ye.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))==null?void 0:Ne.id);if(!ae)return R;const re=J.find(({pricing_plan_schedule_id:X})=>X===ae);if(re)re.promotion_codes=[B];else{const X=R==null?void 0:R[0];J.push({pricing_plan_schedule_id:ae,...(X==null?void 0:X.enabled_pricings)&&{enabled_pricings:X.enabled_pricings},...(X==null?void 0:X.seats_values)&&{seats_values:X.seats_values},...(X==null?void 0:X.units)&&{units:X.units},promotion_codes:[B]})}return J})():R;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:o,...Q&&{pricing_plan_schedule_customizations:Q},customer_details:{email:p.form.value.email??"",type:p.form.value.type,...p.form.value.type==="INDIVIDUAL"?{individual:{residential_address:M,...l?{name:l}:{}}}:{organization:{registered_address:M,legal_name:p.form.value.companyLegalName??"",...p.form.value.companyVatNumber&&Oe.$validator(p.form.value.companyVatNumber,{},{})?{tax_ids:[{id:p.form.value.companyVatNumber,type:bt}]}:{}}}}}}}),U=e.computed(()=>{var l,M;return((l=m.trialInvoicePreview.value)==null?void 0:l.invoice_amount_including_tax)??((M=m.invoicePreview.value)==null?void 0:M.invoice_amount_including_tax)});e.watch([()=>p.form.value.country,U],([l,M])=>{!d.value||!l||!M||f(l,M)});function ee(){sessionStorage.setItem(Te,JSON.stringify(p.form.value))}return e.onMounted(async()=>{const l=de.getQueryParam("redirect_status"),M=!!de.getQueryParam(he.PAYMENT_ACCEPTOR_ID_QUERY_STRING),c=!!de.getQueryParam("payment_intent_client_secret")||!!de.getQueryParam("setup_intent_client_secret");l==="succeeded"&&M&&c&&(s.value=!0);const b=sessionStorage.getItem(Te);let P=null;if(b)try{P=JSON.parse(b)}catch{}P&&p.updateInitialState(P);try{await L()}catch(T){throw i.error("SUBSCRIPTION_LOAD_FAILED","Failed to load the subscription the checkout prices",{},T),T}try{await h()}catch{}P&&(p.updateInitialState(P),sessionStorage.removeItem(Te))}),e.watch(v,l=>{l&&k()},{once:!0}),{validatedEmail:u,validatedCountry:r,invoicePreview:m.invoicePreview,invoicePreviewByBillingPeriod:m.invoicePreviewByBillingPeriod,trialInvoicePreview:m.trialInvoicePreview,trialPeriod:m.trialPeriod,loadInvoicePreview:h,updateInvoicePreviewOnBillingInformationChange:I,lastPreviewScheduleId:m.lastPreviewScheduleId,paymentMethodOptions:C,hasPaymentMethodOptionsError:V,retryPaymentMethodOptions:k,isPaymentMethodsPending:A,isInvoicePreviewPending:m.isPending,subscription:d,checkoutForm:p,authorizationContext:x,isPaid:s,amount:U,saveFormStateForRedirect:ee}}function Bn({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:n,formatErrorMessage:o,onInvalidPromotionCode:a,onApplyError:i}){const r=S.useLogger(),u=e.ref(!1),s=e.ref(null),d=(C,y)=>{s.value=o?o({action:C,error:y}):C==="apply"?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},_=C=>On(C)&&C.field==="promotion_codes",m=async C=>{const y=C==null?void 0:C.trim();if(y){s.value=null,t.form.value.promotionCode=y,u.value=!0;try{await n({promotionCode:y})}catch(A){r.capture(A,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),d("apply",A),i==null||i(),_(A)&&(a==null||a()),await v({suppressError:!0,preserveErrorMessage:!0})}finally{u.value=!1}}},v=async({suppressError:C=!1,preserveErrorMessage:y=!1}={})=>{y||(s.value=null),delete t.form.value.promotionCode,u.value=!0;try{await n({})}catch(A){r.capture(A,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),C||d("remove",A)}finally{u.value=!1}};return{applyPromotionCode:m,removePromotionCode:v,isPromotionCodePending:u,promotionCodeErrorMessage:s}}function On(t){return typeof t=="object"&&t!==null&&"field"in t}function Vn({subscription:t,promotionCode:n,appliedPromotionCode:o,applyPromotionCode:a}){e.watch(t,i=>{i&&n&&(o.value=n,a(n))},{once:!0})}const zn={class:"flex items-center gap-2"},Rn=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(t){const n=t,{formatMessage:o}=S.useIntl(),a=e.computed(()=>n.taxIdValidationResult.valid==="VALID"),i=e.computed(()=>a.value?o({defaultMessage:"VAT number is valid.",id:"tax_check.valid_vat_number",description:"The message shown when the VAT number is valid"}):o({defaultMessage:"VAT number is invalid.",id:"tax_check.invalid_vat_number",description:"The message shown when the VAT number is invalid"}));return(r,u)=>(e.openBlock(),e.createBlock(e.unref(Kt._sfc_main),{type:a.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",zn,[e.createVNode(e.unref(S._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1})])]),_:1},8,["type"]))}});function jn(t){const{checkTaxID:n}=qt.createCustomerService(),o=e.ref(void 0),a=e.computed(()=>{var v;return((v=t.value.companyVatNumber)==null?void 0:v.trim())??""}),i=e.computed(()=>t.value.companyLegalName??""),r=e.computed(()=>t.value.country),u=e.ref(!1),s=e.computed(()=>gt(r.value??"")),d=e.computed(()=>!!(a.value&&i.value&&r.value)),_=e.computed(()=>s.value&&a.value);async function m(){var v;if(!(!d.value||!s.value||!r.value)){u.value=!0;try{const C=await n({type:"ORGANIZATION",organization:{legal_name:i.value,tax_ids:[{id:a.value,type:"GENERIC_TAX_ID"}],registered_address:{country:r.value}}});(v=C==null?void 0:C.data)!=null&&v.length?o.value=C.data[0]:o.value=void 0}finally{u.value=!1}}}return{runTaxIDCheck:m,taxIdValidationData:o,isTaxIDCheckPending:u,isTaxIDCheckEnabled:d,showViesCheckNotice:_,isSelectedCountryEU:s}}const Un={class:"grid grid-cols-1 gap-1"},$n={class:"grid grid-cols-1 gap-2"},Fn={key:0},Gn={class:"mt-2 flex flex-col gap-3"},Yn={class:"grid grid-cols-3 gap-2"},Kn={key:0},qn={class:"mt-4 grid grid-cols-1 gap-3"},Qn="checkout-form",Hn=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(t){const n=k=>xe(k),o=t,a=e.ref(!1),i=e.useModel(t,"modelValue"),r=e.computed({get:()=>i.value.type==="ORGANIZATION",set:k=>{i.value.type=k?"ORGANIZATION":"INDIVIDUAL"}}),u=e.computed(()=>i.value.type==="ORGANIZATION"),s=e.reactive({email:z.formControlModel(i,"email",z.asOptionalText),addressLine1:z.formControlModel(i,"addressLine1",z.asOptionalText),addressLine2:z.formControlModel(i,"addressLine2",z.asOptionalText),postalCode:z.formControlModel(i,"postalCode",z.asOptionalText),city:z.formControlModel(i,"city",z.asOptionalText),state:z.formControlModel(i,"state",z.asOptionalText),companyLegalName:z.formControlModel(i,"companyLegalName",z.asOptionalText),companyVatNumber:z.formControlModel(i,"companyVatNumber",z.asOptionalText)}),d=e.computed({get:()=>i.value.country,set:k=>{const h=z.asOptionalText(k);i.value.country=h!==void 0&&n(h)?h:void 0}}),_=e.computed(()=>i.value.country!=="US"),{isTaxIDCheckEnabled:m,isTaxIDCheckPending:v,taxIdValidationData:C,runTaxIDCheck:y}=jn(i),{$t:A}=S.useIntl(),E=Ie.useCustomerFormLabels(),f=k=>o.getIsFieldRequired(k)?"":" "+A({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),V=e.computed(()=>i.value.country?Yt.getCountryNameByCode(i.value.country):void 0);return(k,h)=>(e.openBlock(),e.createElementBlock("form",{id:Qn,onSubmit:h[12]||(h[12]=e.withModifiers(I=>k.$emit("submit",i.value),["prevent"]))},[e.createElementVNode("div",Un,[e.createVNode(e.unref(ie._sfc_main),{title:e.unref(E).contactInformationTitle},{default:e.withCtx(()=>[e.createElementVNode("div",$n,[t.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(S._sfc_main),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.email),1)]),_:1}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",tag:"span",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(le._sfc_main),{modelValue:s.email,"onUpdate:modelValue":h[0]||(h[0]=I=>s.email=I),required:"",type:"email",name:"email",disabled:!!t.readOnlyEmail,label:e.unref(E).emailLabel,placeholder:e.unref(E).emailPlaceholder+f("email"),error:t.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(Ie._sfc_main),{"single-model-value":d.value,"onUpdate:singleModelValue":h[3]||(h[3]=I=>d.value=I),required:"",name:"country",label:e.unref(E).countryLabel+f("country"),error:t.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[!a.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:0,size:"xs",intent:"subtle","icon-prefix":"add",class:"py-0.5",onClick:h[1]||(h[1]=I=>a.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})):e.createCommentVNode("",!0),a.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:1,size:"sm",intent:"subtle","icon-prefix":"close",class:"py-0.5",onClick:h[2]||(h[2]=I=>a.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(tt._sfc_main),{"is-open":a.value||!!t.isBillingInformationMandatory},{default:e.withCtx(()=>[a.value||t.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("div",Gn,[e.createVNode(e.unref(le._sfc_main),{modelValue:s.addressLine1,"onUpdate:modelValue":h[4]||(h[4]=I=>s.addressLine1=I),name:"address_line_1",label:e.unref(A)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(A)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+f("addressLine1"),required:"",error:t.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(le._sfc_main),{modelValue:s.addressLine2,"onUpdate:modelValue":h[5]||(h[5]=I=>s.addressLine2=I),name:"address_line_2",placeholder:e.unref(A)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+f("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Yn,[e.createVNode(e.unref(le._sfc_main),{modelValue:s.postalCode,"onUpdate:modelValue":h[6]||(h[6]=I=>s.postalCode=I),name:"postal_code",placeholder:e.unref(E).postalCodePlaceholder+f("postalCode"),error:t.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(le._sfc_main),{modelValue:s.city,"onUpdate:modelValue":h[7]||(h[7]=I=>s.city=I),name:"city",placeholder:e.unref(E).cityPlaceholder+f("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(le._sfc_main),{modelValue:s.state,"onUpdate:modelValue":h[8]||(h[8]=I=>s.state=I),name:"state",placeholder:e.unref(E).statePlaceholder+f("state"),error:t.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["title"]),t.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:0},{default:e.withCtx(()=>[e.createVNode(Ie._sfc_main$1,{modelValue:r.value,"onUpdate:modelValue":h[9]||(h[9]=I=>r.value=I),"no-spacing":"",class:"!flex"},null,8,["modelValue"]),e.createVNode(e.unref(tt._sfc_main),{"is-open":u.value},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",qn,[e.createVNode(e.unref(le._sfc_main),{modelValue:s.companyLegalName,"onUpdate:modelValue":h[10]||(h[10]=I=>s.companyLegalName=I),required:"",name:"legal_name",label:e.unref(E).legalNameLabel,placeholder:e.unref(E).legalNamePlaceholder},null,8,["modelValue","label","placeholder"]),_.value?(e.openBlock(),e.createBlock(e.unref(le._sfc_main),{key:0,modelValue:s.companyVatNumber,"onUpdate:modelValue":h[11]||(h[11]=I=>s.companyVatNumber=I),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(E).vatNumberLabel,placeholder:e.unref(E).vatNumberPlaceholder,error:t.validation.value.companyVatNumber.$errors,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(gt)(i.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main),{type:"button",size:"sm",intent:"secondary",disabled:!e.unref(m)||e.unref(v)||t.validation.value.companyVatNumber.$invalid,onClick:e.unref(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(v)})},[e.createVNode(Rn,{"tax-id-validation-result":e.unref(C)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1}))])],32))}}),Zn={key:0,class:"flex items-center"},Xn=["innerHTML"],Wn=["innerHTML"],Jn=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(t){const{$t:n}=S.useIntl();return(o,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.trialStartDate?t.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),t.trialPeriod?(e.openBlock(),e.createBlock(e.unref(dt._sfc_main),{key:0,"trial-period":t.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[t.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(ne.formatAmount)(t.amount),startDate:t.subscriptionStartDate,period_name:e.unref(ne.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:i=>`<strong>${i}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(ne.formatAmount)(t.amount),period_name:e.unref(ne.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:i=>`<strong>${i}</strong>`})},null,8,Wn)):(e.openBlock(),e.createElementBlock("span",Zn,[e.createVNode(e.unref(Se._sfc_main),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(Se.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se._sfc_main$1),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({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(e.unref(ge._sfc_main$2),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"mr-1.5 inline-block"})]),_:1}),e.createElementVNode("span",{innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description_without_price",description:"The description of the trial period, while the price is still being determined"},{startDate:t.subscriptionStartDate,period_name:e.unref(ne.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description_without_price",description:"The description of the subscription, while the price is still being determined"},{period_name:e.unref(ne.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,Xn)]))]),_:1})]))}}),eo=t=>{var n;return((n=t.periods)==null?void 0:n.some(o=>o.groups.some(a=>{var i;return(i=a.lines)==null?void 0:i.some(r=>r.product_items.some(u=>u.model_type==="USAGE_BASED"))})))??!1},to={class:"flex min-h-96 w-full items-center justify-center"},no={class:"max-w-sm"},oo=e.defineComponent({__name:"CheckoutNotAvailable",setup(t){const{$t:n}=S.useIntl(),o=()=>{window.location.reload()};return(a,i)=>(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",no,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),io=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",emits:["continue-to-merchant"],setup(t){const{$t:n}=S.useIntl();return(o,a)=>(e.openBlock(),e.createBlock(Qt._sfc_main,{status:"success",title:e.unref(n)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(S._sfc_main),{variant:"body-xs",color:"subtle",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1})]),_:1},8,["title"]))}}),ao={class:"flex items-start"},ro={class:"flex grow flex-col"},lo={class:"flex items-center gap-1"},so={class:"ml-4 flex items-center self-center"},Et=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("div",ro,[e.createElementVNode("div",lo,[e.createVNode(e.unref(S._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name),1)]),_:1}),e.renderSlot(n.$slots,"badge")]),e.createVNode(e.unref(S._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})]),e.createElementVNode("div",so,[e.renderSlot(n.$slots,"default")])]))}}),co={class:"sv-order-summary__body grid grid-cols-1 gap-1"},uo={class:"px-3 py-2"},po={class:"sv-order-summary__billing-period flex flex-col gap-3"},mo={class:"px-3 py-2"},go={key:3,class:"sv-order-summary__items"},st=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(t,{emit:n}){const o=t,a=n,{$t:i}=S.useIntl(),{map:r,formatTimePeriod:u}=ut.useTimePeriod(),{isMobileViewport:s}=mt.useViewport(),d=e.computed(()=>s.value?"sm":"xs"),_=c=>`${c.type}:${c.value}`,m=["DAY","WEEK","MONTH","YEAR"],v=c=>m.includes(c),C=c=>{if(!c)return;const[g,b]=c.split(":"),P=Number(b);if(!(!P||!v(g)))return{type:g,value:P}},y=e.computed({get:()=>{const c=o.subscription.billing_period;return c?`${c.type}:${c.value}`:void 0},set:c=>{if(!c)return;const[g,b]=c.split(":"),P=Number(b);P&&v(g)&&a("billing-period-change",{type:g,value:P})}}),A=e.computed({get:()=>y.value,set:c=>{y.value=z.asOptionalText(c)}}),E=c=>{var P,T,R,B;const g=(B=(R=(T=(P=o.invoicePreviewByBillingPeriod)==null?void 0:P[_(c)])==null?void 0:T.periods)==null?void 0:R[0])==null?void 0:B.amount_including_tax;if(!g)return;const b=c.type==="MONTH"&&c.value===3?i({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):i({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:u(c,{prefix:!1,hideValueForExactPeriods:!0})});return i({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:ne.formatAmount(g),period:b})},f=c=>{var g,b,P,T;return(T=(P=(b=(g=o.invoicePreviewByBillingPeriod)==null?void 0:g[_(c)])==null?void 0:b.periods)==null?void 0:P[0])==null?void 0:T.amount_including_tax},V=c=>Number(c.quantity),k=(c,g)=>{if(!g)return;const P={DAY:365,WEEK:52,MONTH:12,YEAR:1}[c.type]/Math.max(c.value??1,1),T=V(g)*P;if(Number.isFinite(T))return{quantity:T.toFixed(2),currency:g.currency}},h=(c,g)=>{if(!c||!g)return;const b=V(c)-V(g);if(!(!Number.isFinite(b)||b<=0))return{quantity:b.toFixed(2),currency:c.currency}},I=c=>{if(!c)return;const g=i({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:ne.formatAmount(c)}),b=i({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"});return`${g}${b}`},p=e.computed(()=>{var K,q,H;const c=se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),g=((q=(K=c==null?void 0:c.pricing_plan_version)==null?void 0:K.billing_period_settings)==null?void 0:q.billing_periods)??[],b=new Map,P=O=>{O&&b.set(_(O),O)},T=O=>{var F;(F=O==null?void 0:O.items)==null||F.forEach(G=>{var Z,W;(Z=G.billing_period_configs)==null||Z.forEach(J=>P(J.billing_period)),(W=G.pricing_currency_configs)==null||W.forEach(J=>{var ae;(ae=J.billing_period_configs)==null||ae.forEach(re=>P(re.billing_period))})})};if((((H=c==null?void 0:c.pricing_plan_version)==null?void 0:H.pricing_categories)??[]).forEach(O=>{var F,G;(F=O.pricings)==null||F.forEach(Z=>T(Z)),(G=O.pricing_groups)==null||G.forEach(Z=>{var W;return(W=Z.pricings)==null?void 0:W.forEach(J=>T(J))})}),!b.size)return[];const B=g.map(O=>b.get(_(O.period))).filter(O=>!!O),Q=new Set(B.map(_)),Y=[...b.values()].filter(O=>!Q.has(_(O)));return[...B,...Y]}),L=e.computed(()=>{const c=p.value[p.value.length-1],g=c?k(c,f(c)):void 0;return p.value.map(P=>{const T=P.type==="MONTH"&&P.value===3?i({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):i({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:r.value[P.type].full}),R=f(P),B=k(P,R),Q=c&&P.type===c.type&&P.value===c.value?void 0:h(B,g),Y=I(Q);return{label:T,subLabel:E(P),labelSuffixComponent:Y?{component:nt._sfc_main,props:{color:"primary",content:Y,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:y.value===`${P.type}:${P.value}`,value:`${P.type}:${P.value}`}})}),x=e.computed(()=>{const c=L.value,g=c[0],b=c[c.length-1];return{smallestPeriod:g==null?void 0:g.value,biggestPeriod:b==null?void 0:b.value}}),U=e.computed(()=>L.value.find(c=>c.value===x.value.biggestPeriod)),ee=e.computed(()=>L.value.find(c=>c.value===y.value)),l=e.computed(()=>{var K,q,H,O,F,G,Z,W;const c=L.value,g=c[c.length-1],b=y.value;if(!g||!b||b===g.value)return"";const P=C(g.value);if(!P)return"";const T=(O=(H=(q=(K=o.invoicePreviewByBillingPeriod)==null?void 0:K[g.value])==null?void 0:q.periods)==null?void 0:H[0])==null?void 0:O.amount_including_tax,R=C(b),B=(W=(Z=(G=(F=o.invoicePreviewByBillingPeriod)==null?void 0:F[b])==null?void 0:G.periods)==null?void 0:Z[0])==null?void 0:W.amount_including_tax;if(!R||!B)return"";const Q=k(R,B),Y=k(P,T);return I(h(Q,Y))??""}),M=c=>{const{smallestPeriod:g,biggestPeriod:b}=x.value;y.value=c?b:g};return(c,g)=>(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{class:"sv-order-summary","no-border":"","no-spacing":"","content-background":"none",title:t.noTitle?void 0:e.unref(i)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(e.unref(ie._sfc_main),{"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[t.subscription?(e.openBlock(),e.createBlock(Ht._sfc_main,{key:0,avatar:t.avatar,invoice:t.invoice,subscription:t.subscription,"enabled-pricing-ids":t.enabledPricingIds,loading:t.isPreviewAndPaymentMethodsPending,"trial-period":t.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),L.value.length===2?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:0,"no-spacing":"","content-classes":y.value===x.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var b;return[e.createElementVNode("div",uo,[e.createElementVNode("div",po,[U.value?(e.openBlock(),e.createBlock(Et,{key:0,name:U.value.label,description:((b=ee.value)==null?void 0:b.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(z._sfc_main),{"model-value":y.value===x.value.biggestPeriod,"onUpdate:modelValue":M},null,8,["model-value"])]),_:2},[l.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(nt._sfc_main),{intent:"brand",content:l.value,size:d.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):L.value.length>2?(e.openBlock(),e.createBlock(e.unref(pt._sfc_main),{key:1,"single-model-value":A.value,"onUpdate:singleModelValue":g[0]||(g[0]=b=>A.value=b),class:"sv-order-summary__billing-period",options:L.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),t.isUsageBased?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:2,"no-spacing":"",class:"sv-order-summary__usage"},{default:e.withCtx(()=>[e.createElementVNode("div",mo,[e.createVNode(e.unref(S._sfc_main),{"no-spacing":"",variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),t.invoice&&t.variant!=="products-inline"?(e.openBlock(),e.createElementBlock("div",go,[e.createVNode(e.unref(ge._sfc_main$3),{invoice:t.invoice,"wrapper-component":e.unref(ie._sfc_main)},null,8,["invoice","wrapper-component"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(ie._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(ge._sfc_main$1),{key:0,class:"sv-order-summary__invoice-preview",variant:t.variant==="products-inline"?"default":"without-products",invoice:t.invoice,"trial-invoice":t.trialInvoice,"is-paid":t.isPaid,collapsible:t.collapsible,"is-preview-without-taxes":!t.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:1,variant:"body-sm",color:"subtle",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}}),fo={key:1},yo={key:2},vo={key:3},_o={key:4},ho=["href"],Mo=e.defineComponent({__name:"MarkdownInline",props:{nodes:{type:Array}},setup(t){return(n,o)=>{const a=e.resolveComponent("MarkdownInline",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(i,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[i.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(i.value),1)],64)):i.type==="break"?(e.openBlock(),e.createElementBlock("br",fo)):i.type==="bold"?(e.openBlock(),e.createElementBlock("strong",yo,[e.createVNode(a,{nodes:i.children},null,8,["nodes"])])):i.type==="italic"?(e.openBlock(),e.createElementBlock("em",vo,[e.createVNode(a,{nodes:i.children},null,8,["nodes"])])):i.type==="underline"?(e.openBlock(),e.createElementBlock("u",_o,[e.createVNode(a,{nodes:i.children},null,8,["nodes"])])):i.type==="link"?(e.openBlock(),e.createElementBlock("a",{key:5,href:i.href,target:"_blank",rel:"noopener noreferrer",class:"underline"},[e.createVNode(a,{nodes:i.children},null,8,["nodes"])],8,ho)):e.createCommentVNode("",!0)],64))),128)}}}),bo=/^<u>([\s\S]*?)<\/u>/i,No=/^\*\*([\s\S]+?)\*\*/,Io=/^\*([\s\S]+?)\*/,Co=/^_([\s\S]+?)_/,Eo=/^\[([^\]]*)\]\(\s*([^)\s]*)\s*\)/,Ao=/^<([a-z][a-z0-9+.-]*:[^>\s]+)>/i,Po=/\n[ \t]*\n/;function _e(t){const n=[];let o="";const a=()=>{o&&(n.push({type:"text",value:o}),o="")};let i=0;for(;i<t.length;){const r=t.slice(i),u=No.exec(r);if(u){a(),n.push({type:"bold",children:_e(u[1])}),i+=u[0].length;continue}const s=Io.exec(r)??Co.exec(r);if(s){a(),n.push({type:"italic",children:_e(s[1])}),i+=s[0].length;continue}const d=bo.exec(r);if(d){a(),n.push({type:"underline",children:_e(d[1])}),i+=d[0].length;continue}const _=Eo.exec(r);if(_){a(),n.push(ct(_[2],_e(_[1]))),i+=_[0].length;continue}const m=Ao.exec(r);if(m){a(),n.push(ct(m[1],[{type:"text",value:m[1]}])),i+=m[0].length;continue}if(t[i]===`
|
|
2
|
+
`){a(),n.push({type:"break"}),i+=1;continue}o+=t[i],i+=1}return a(),n}function ct(t,n){const o=de.sanitizeUrl(t);return o?{type:"link",href:o,children:n}:{type:"text",value:At(n)}}function At(t){return t.map(n=>n.type==="text"?n.value:n.type==="break"?" ":At(n.children)).join("")}function xo(t){return t!=null&&t.trim()?t.split(Po).map(n=>n.trim()).filter(Boolean).map(n=>({type:"paragraph",children:_e(n)})):[]}const Do={key:0},ko=e.defineComponent({__name:"MarkdownText",props:{source:{type:[String,null]}},setup(t){const n=t,o=e.computed(()=>xo(n.source));return(a,i)=>o.value.length?(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(r,u)=>(e.openBlock(),e.createElementBlock("p",{key:u,class:e.normalizeClass({"mt-2":u>0})},[e.createVNode(Mo,{nodes:r.children},null,8,["nodes"])],2))),128))])):e.createCommentVNode("",!0)}});async function Pt(t,n){const{AdyenCheckout:o}=await Ae.loadAdyenSdk();return o(he.getAdyenExpressCheckoutConfiguration({locale:t.locale,amount:t.amount,countryCode:t.countryCode,paymentMethodOptionResponse:t.paymentMethodOptionsResponse,logger:n}))}function xt({props:t,create:n,onMissingButton:o,onMountFailed:a,afterMount:i}){const r=e.ref(),u=S.useLogger(),s=async()=>{const d=await Pt(t,u),_=await n(d);if(!r.value){o();return}try{await _.isAvailable(),_.mount(r.value),i==null||i()}catch(m){a(m)}};return e.onMounted(()=>{s()}),{buttonRef:r}}const wo={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},So={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Ve=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(t,{emit:n}){const o=t,a=n,i=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),r=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function u(){a("click")}return(s,d)=>(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{size:"lg","aria-label":i.value,class:e.normalizeClass([r.value,"!block h-11 w-full bg-center bg-no-repeat"]),onClick:u},{default:e.withCtx(()=>[o.type==="applepay"?(e.openBlock(),e.createElementBlock("svg",wo,[...d[0]||(d[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):o.type==="paypal"?(e.openBlock(),e.createElementBlock("img",So)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),To={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Lo="ADYEN",Bo=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,a=n,i=e.ref(),r=S.useLogger(),{authorizePayment:u}=Xt.createPaymentsService(),s=o.paymentMethodOptionsResponse.payment_acceptor.id;function d(f){return Wt.createPaymentFailureContext({gateway:"ADYEN",paymentAcceptorId:s,paymentMethodType:"applepay",...f})}const _=async()=>{const{ApplePay:f}=await Ae.loadAdyenSdk(),V=await Pt(o,r),k=new f(V,{isExpress:!0,recurringPaymentRequest:{paymentDescription:o.billingInformation.description,billingAgreement:o.billingInformation.agreement,managementURL:"https://www.google.com",...o.billingInformation.trial&&{trialBilling:{label:o.billingInformation.trial.label,amount:o.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.trial.startDate,recurringPaymentEndDate:o.billingInformation.trial.endDate}},...o.billingInformation.regular&&{regularBilling:{label:o.billingInformation.regular.label,amount:o.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.regular.startDate,...m(o.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(h,I,p)=>{var ee,l,M,c,g,b,P;const{invoicePreview:L,trialInvoicePreview:x}=await o.onBillingInformationChange({...((ee=p.paymentMethod.billingContact)==null?void 0:ee.postalCode)&&{postal_code:p.paymentMethod.billingContact.postalCode},...((l=p.paymentMethod.billingContact)==null?void 0:l.locality)&&{city:p.paymentMethod.billingContact.locality},...y((M=p.paymentMethod.billingContact)==null?void 0:M.countryCode)&&{country:y((c=p.paymentMethod.billingContact)==null?void 0:c.countryCode)}}),U=x?x.invoice_amount_including_tax.quantity.toString():L.invoice_amount_including_tax.quantity.toString();a("update-billing-information",{postal_code:(g=p.paymentMethod.billingContact)==null?void 0:g.postalCode,city:(b=p.paymentMethod.billingContact)==null?void 0:b.locality,country:(P=p.paymentMethod.billingContact)==null?void 0:P.countryCode}),h({newTotal:{label:o.billingInformation.regular.label,amount:U,type:"final"}})},onError:h=>{r.error("APPLE_PAY_ERROR","Apple Pay error",d({reason:"APPLE_PAY_ERROR",cause:h}),h)},onAuthorized:async(h,I)=>{var p;try{const L=h.authorizedEvent;r.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{paymentAcceptorId:s,hasPaymentMethod:!!L.payment.token.paymentMethod,hasPaymentData:!!L.payment.token.paymentData,hasBillingContact:!!L.payment.billingContact});const x=L.payment.billingContact,U=h.billingAddress;x?a("update-billing-information",v(x)):U&&a("update-billing-information",C(U));const ee={payment_method:he.transformObjectToAdyenObject(L.payment.token.paymentMethod),browser_info:he.transformObjectToAdyenObject(L.payment.token.paymentData)},l=he.createReturnUrl({paymentAcceptorId:s,redirectUrl:window.location.href}),M=await u({payment_acceptor_id:s,payment_gateway_variant:Lo,adyen:{...ee,store_payment_method:!0},amount:o.amount,return_url:l});if(r.info("APPLE_PAY_API_RESPONSE","Payment API response received",{paymentAcceptorId:s,status:M.status}),M.status==="FAILURE"){r.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",d({reason:"APPLE_PAY_AUTHORIZATION_REJECTED",extra:{paymentStatus:M.status}})),I.reject();return}if(M.status==="ACTION_REQUIRED"){r.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",d({reason:"APPLE_PAY_ACTION_REQUIRED",extra:{actionType:(p=M.action)==null?void 0:p.method}})),I.reject();return}r.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),I.resolve()}catch(L){r.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",d({reason:"APPLE_PAY_AUTHORIZATION_FAILED",cause:L}),L),I.reject()}}});if(!i.value){r.error("APPLE_PAY_ERROR","Apple Pay button ref not found");return}try{await k.isAvailable(),k.mount(i.value),a("ready")}catch(h){r.error("APPLE_PAY_ERROR","Apple Pay not available on this device",{},h)}},m=f=>{if(!f.value)return;let V=f.value??1,k=f.type.toLowerCase();if(f.type==="WEEK"&&(k="day",V=f.value*7),k==="day"||k==="month"||k==="year"||k==="hour"||k==="minute")return{recurringPaymentIntervalUnit:k,recurringPaymentIntervalCount:V}},v=f=>({postal_code:f.postalCode,city:f.locality,country:f.countryCode}),C=f=>({postal_code:f.postalCode,city:f.city,country:f.country}),y=f=>f&&A(f)?f:void 0,A=f=>xe(f),E=()=>{var V;const f=(V=i.value)==null?void 0:V.querySelector("apple-pay-button");if(f){const k=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});f.dispatchEvent(k)}};return e.onMounted(()=>{_()}),(f,V)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"applepay",onClick:E})):e.createCommentVNode("",!0),e.createElementVNode("div",To,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:i},null,512)])],64))}}),Oo={class:"relative overflow-hidden"},Vo=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,a=n,i=S.useLogger(),{buttonRef:r}=xt({props:o,onMissingButton:()=>i.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted"),onMountFailed:u=>i.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:u}),create:async u=>{const{PayPal:s}=await Ae.loadAdyenSdk();return new s(u,{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{a("ready")}})}});return(u,s)=>(e.openBlock(),e.createElementBlock("div",Oo,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:r,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),zo={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Ro=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,a=n,i=S.useLogger(),{buttonRef:r}=xt({props:o,onMissingButton:()=>i.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted"),onMountFailed:s=>i.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{},s),create:async s=>{const{GooglePay:d}=await Ae.loadAdyenSdk();return new d(s,{isExpress:!0})},afterMount:()=>a("ready")}),u=()=>{var d;const s=(d=r.value)==null?void 0:d.querySelector("#gpay-button-online-api-id");if(s){const _=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});s.dispatchEvent(_)}};return(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"googlepay",onClick:u})):e.createCommentVNode("",!0),e.createElementVNode("div",zo,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:r},null,512)])],64))}}),jo={key:0,class:"mt-4n"},Uo={class:"mb-2"},$o={class:"grid grid-cols-6 gap-1 md:gap-2"},Fo={class:"mt-4 h-4"},Go=2,Yo=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(t){const n=["applepay"],o=t,{$t:a}=S.useIntl(),i=e.ref(!1),r=e.ref(!1),u=e.ref(!1),s=e.computed(()=>{var y;if(n.includes("applepay"))return(y=o.paymentMethodsOptionsResponse)==null?void 0:y.find(A=>{var E;return(E=A.options)==null?void 0:E.some(f=>f.name.toLowerCase()==="apple pay"&&f.payment_gateway_variant==="ADYEN")})}),d=e.computed(()=>{var y;if(n.includes("paypal"))return(y=o.paymentMethodsOptionsResponse)==null?void 0:y.find(A=>{var E;return(E=A.options)==null?void 0:E.some(f=>f.name.toLowerCase()==="paypal"&&f.payment_gateway_variant==="ADYEN")})}),_=e.computed(()=>{var y;if(n.includes("googlepay"))return(y=o.paymentMethodsOptionsResponse)==null?void 0:y.find(A=>{var E;return(E=A.options)==null?void 0:E.some(f=>f.name.toLowerCase()==="google pay"&&f.payment_gateway_variant==="ADYEN")})}),m=e.computed(()=>!!(s.value||_.value||d.value)),v=e.computed(()=>{var f;if(((f=o.paymentMethodsOptionsResponse)==null?void 0:f.length)===0)return!1;const y=!s.value||i.value,A=!_.value||r.value,E=!d.value||u.value;return y&&A&&E}),C=e.computed(()=>v.value?(s.value?1:0)+(_.value?1:0)+(d.value?1:0):Go);return(y,A)=>m.value?(e.openBlock(),e.createElementBlock("div",jo,[e.createElementVNode("div",Uo,[v.value?(e.openBlock(),e.createBlock(e.unref(S._sfc_main),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(ce._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",$o,[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(ce._sfc_main,{class:"col-span-3 h-11"}),e.createVNode(ce._sfc_main,{class:"col-span-3 h-11"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!s.value,"!col-span-6":C.value===1,"md:!col-span-3":C.value===2,"!col-span-6 md:!col-span-2":C.value===3}])},[s.value?(e.openBlock(),e.createBlock(Bo,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":s.value,"on-billing-information-change":t.onBillingInformationChange,onReady:A[0]||(A[0]=E=>i.value=!0),onUpdateBillingInformation:A[1]||(A[1]=E=>y.$emit("update-billing-information",E))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!_.value,"col-span-6 md:col-span-6":C.value===1,"md:!col-span-3":C.value===2}])},[_.value?(e.openBlock(),e.createBlock(Ro,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":_.value,onReady:A[2]||(A[2]=E=>r.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!d.value,"col-span-6 md:col-span-6":C.value===1,"md:!col-span-3":C.value===2}])},[d.value?(e.openBlock(),e.createBlock(Vo,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":d.value,onReady:A[3]||(A[3]=E=>u.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Fo,[v.value?(e.openBlock(),e.createBlock(e.unref(Zt._sfc_main),{key:1,text:e.unref(a)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(ce._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),Ko=["aria-expanded","aria-label"],qo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Qo={class:"flex flex-row items-center gap-2"},Ho=["onKeydown"],Zo=["aria-label"],Xo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Wo={class:"flex flex-row items-center gap-2"},Jo={class:"sr-only","aria-live":"polite"},ei=e.defineComponent({inheritAttrs:!1,__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(t,{emit:n}){const{$t:o}=S.useIntl(),a=t,i=n,r=e.ref(!1),u=e.ref(""),s=e.ref(""),d=e.ref(null),_=e.ref(null),m=en.uniqueId("promotion-code-"),v=`${m}-label`,C=`${m}-panel`,y=e.computed({get:()=>u.value,set:l=>u.value=z.asText(l)}),A=e.computed(()=>a.promotionCode!==null&&a.promotionCode!==""),E=e.computed(()=>u.value.trim().length>0),f=e.computed(()=>a.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),V=e.computed(()=>r.value?o({defaultMessage:"Collapse promotion code input",id:"checkout.promotion_code.collapse_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is open"}):o({defaultMessage:"Expand promotion code input",id:"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is closed"})),k=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),h=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),I=()=>{u.value=""},p=()=>{var M;const l=(M=_.value)==null?void 0:M.querySelector("input");l instanceof HTMLInputElement&&l.focus()},L=()=>{r.value&&(r.value=!1)},x=()=>{A.value||(r.value=!r.value)},U=()=>{if(!E.value)return;const l=u.value.trim();i("update:appliedCode",l),i("apply",l),s.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),r.value=!1},ee=()=>{i("update:appliedCode",null),i("remove"),s.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),I(),e.nextTick(()=>{var l;(l=d.value)==null||l.focus()})};return e.watch(r,l=>{if(!l){I(),e.nextTick(()=>{var M;(M=d.value)==null||M.focus()});return}e.nextTick(()=>{p()})}),e.watch(()=>a.promotionCode,l=>{l||I()}),(l,M)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[A.value?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),e.mergeProps({key:1},l.$attrs,{"no-border":"","no-spacing":"","content-background":"none",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full rounded border border-primary-900 bg-white","aria-label":h.value,onClick:ee},[e.createElementVNode("div",Xo,[e.createElementVNode("div",Wo,[e.createVNode(e.unref(oe._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(S._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1})]),e.createVNode(e.unref(oe._sfc_main$1),{icon:"close"})])],8,Zo)]),_:1},16)):(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),e.mergeProps({key:0},l.$attrs,{"no-spacing":"",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":r.value,"aria-controls":C,"aria-label":V.value,onClick:x},[e.createElementVNode("div",qo,[e.createElementVNode("div",Qo,[e.createVNode(e.unref(oe._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(S._sfc_main),{id:v,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(oe._sfc_main$1),{icon:r.value?"remove":"add"},null,8,["icon"])])],8,Ko),e.withDirectives(e.createElementVNode("div",{id:C,ref_key:"panelRef",ref:_,role:"region","aria-labelledby":v,class:"flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",onKeydown:e.withKeys(e.withModifiers(L,["prevent"]),["esc"])},[e.createVNode(e.unref(le._sfc_main),{modelValue:y.value,"onUpdate:modelValue":M[0]||(M[0]=c=>y.value=c),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(U,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(oe._sfc_main),{type:"button",disabled:!E.value,"aria-label":k.value,"aria-disabled":!E.value,onClick:U},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,Ho),[[e.vShow,r.value]])]),_:1},16)),e.createElementVNode("span",Jo,e.toDisplayString(s.value),1)],64))}}),ti={class:"sv-checkout__header"},ni={class:"sv-checkout__payment-methods"},oi={key:0,class:"sv-checkout__payment-methods-body"},ii={key:3,class:"sv-checkout__payment-form"},ai={class:"sv-checkout__order-summary"},ri={class:"flex flex-col gap-2"},li=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var $e,Fe,Ge,Ye,Ke,qe,Qe,He,Ze,Xe,We,Je;const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationForm-B_Db4DG1.js"))),a=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PlanCustomizationEditor-CEMP_Dhz.js"))),i=t,r=n,u=e.computed(()=>i.configuration),s=e.ref(),d=e.ref(),_=S.useLogger(),{$t:m,locale:v}=S.useIntl(),{formatTimePeriod:C}=ut.useTimePeriod(),y=Gt.usePortal(),{isMobileViewport:A}=mt.useViewport();if(_.info("COMPONENT_INITIALIZED","Checkout component initialized"),(($e=y.value)==null?void 0:$e.type)!=="INIT_PRICING_PLAN_SUBSCRIPTION")throw _.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");y.value.status==="REVOKED"&&(s.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${y.value.id}" is revoked`},_.error("RESOURCE_REVOKED",`Portal url with resource id "${y.value.id}" is revoked`));const E=(Ge=(Fe=y.value)==null?void 0:Fe.init_pricing_plan_subscription)==null?void 0:Ge.pricing_plan_subscription_id,f=(Ke=(Ye=y.value)==null?void 0:Ye.init_pricing_plan_subscription)==null?void 0:Ke.success_url,V=((He=(Qe=(qe=y.value)==null?void 0:qe.init_pricing_plan_subscription)==null?void 0:Qe.note)==null?void 0:He.trim())||void 0,{validatedEmail:k,validatedCountry:h,paymentMethodOptions:I,hasPaymentMethodOptionsError:p,retryPaymentMethodOptions:L,subscription:x,isPaymentMethodsPending:U,isInvoicePreviewPending:ee,checkoutForm:l,invoicePreview:M,invoicePreviewByBillingPeriod:c,trialInvoicePreview:g,trialPeriod:b,authorizationContext:P,isPaid:T,amount:R,loadInvoicePreview:B,updateInvoicePreviewOnBillingInformationChange:Q,saveFormStateForRedirect:Y}=Ln({initialCountry:(Ze=i.configuration)==null?void 0:Ze.countryCode,initialEmail:(Xe=i.configuration)==null?void 0:Xe.email,subscriptionId:E,enabledPricingIds:(We=i.configuration)==null?void 0:We.enabledPricingIds}),K=e.ref(!1),q=async()=>{var N;await l.validation.value.$validate(),!l.validation.value.$invalid&&(K.value=!0,Y(),(N=d.value)==null||N.submit())},H=()=>{K.value=!1},O=async()=>(await l.validation.value.$validate(),!l.validation.value.$invalid),F=e.computed(()=>!!g.value),G=e.computed(()=>M.value?eo(M.value):!1),Z=e.computed(()=>l.form.value.country&&["US","CA"].includes(l.form.value.country)||!1),W=e.computed({get:()=>l.form.value.enabledPricingIds??[],set:N=>{l.form.value.enabledPricingIds=N}}),J=e.computed(()=>x.value?se.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:x.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),ae=e.computed(()=>{var D,w;if(!x.value)return;const N=(w=(D=J.value)==null?void 0:D.pricing_plan_version)==null?void 0:w.pricing_currency_settings;return Mt({country:l.form.value.country,pricingCurrencySettings:N,fallbackCurrency:x.value.billing_currency})}),re=e.computed(()=>{if(!J.value||!x.value)return new Set;const N=se.getPricingItemConfigMetaById({pricingPlanScheduleInfo:J.value}),D=ae.value,w=x.value.billing_period,$=new Set;return N.forEach((j,te)=>{D&&j.currency!==D||w&&j.billingPeriod&&(j.billingPeriod.type!==w.type||j.billingPeriod.value!==w.value)||$.add(te)}),$}),fe=e.computed({get:()=>{const N=l.form.value.seatsValues??[],D=re.value;return D.size?N.filter(({pricing_item_config_id:w})=>D.has(w)):N},set:N=>{const D=l.form.value.seatsValues??[],w=re.value;if(!w.size){l.form.value.seatsValues=N;return}const $=D.filter(({pricing_item_config_id:j})=>!w.has(j));l.form.value.seatsValues=$.concat(N)}}),ye=e.computed({get:()=>{const N=l.form.value.unitsValues??[],D=re.value;return D.size?N.filter(({pricing_item_config_id:w})=>D.has(w)):N},set:N=>{const D=l.form.value.unitsValues??[],w=re.value;if(!w.size){l.form.value.unitsValues=N;return}const $=D.filter(({pricing_item_config_id:j})=>!w.has(j));l.form.value.unitsValues=$.concat(N)}}),Ne=e.computed(()=>{var N,D,w,$,j;return g.value?m({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:g.value.tax_summary.total_amount.quantity==="0.00"?m({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):ne.formatAmount(g.value.tax_summary.total_amount),trial_period:C(b.value,{short:!0}),subscription_amount:ne.formatAmount(((N=M.value)==null?void 0:N.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:C(((D=M.value)==null?void 0:D.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(pe.value)}):m({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(w=M.value)!=null&&w.tax_summary.total_amount?ne.formatAmount(($=M.value)==null?void 0:$.tax_summary.total_amount):"",billing_period:C(((j=M.value)==null?void 0:j.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(pe.value)})}),X=e.computed(()=>{var D;if(!M.value)return;const N=Me.getSubscriptionName({subscription:x.value,fallback:m({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})});return{description:N,managementURL:"https://www.solvimon.com/account/billing",agreement:Ne.value,...g.value&&b.value&&{trial:{label:m({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:g.value.tax_summary.total_amount,startDate:De.value?new Date(De.value):void 0,endDate:ze.value?new Date(ze.value):void 0}},regular:{label:N,amount:M.value.tax_summary.total_amount,startDate:pe.value?new Date(pe.value):void 0,interval:((D=x.value)==null?void 0:D.billing_period)??{type:"MONTH",value:1}}}}),Dt=N=>xe(N),kt=N=>{const{country:D,...w}=N;l.updateInitialState({...w,...D&&Dt(D)?{country:D}:{}})},wt=e.computed(()=>!(k&&h)),De=e.computed(()=>{var w,$,j;const N=($=(w=g.value)==null?void 0:w.periods)==null?void 0:$[0],D=(j=ke.value)==null?void 0:j.trialStartDate;return N!=null&&N.start_at?new Date(N.start_at):D}),ke=e.computed(()=>Me.getFallbackTrialAndSubscriptionStartAndEndDates(x.value)),ze=e.computed(()=>{var w,$,j;const N=($=(w=g.value)==null?void 0:w.periods)==null?void 0:$[0],D=(j=ke.value)==null?void 0:j.trialEndDate;return N!=null&&N.end_at?new Date(N.end_at):D}),pe=e.computed(()=>{var w,$,j;const N=($=(w=M.value)==null?void 0:w.periods)==null?void 0:$[0],D=(j=ke.value)==null?void 0:j.subscriptionStartDate;return N!=null&&N.start_at?new Date(N.start_at):D}),St=e.computed(()=>!!(l.form.value.seatsValues&&l.form.value.seatsValues.length>0||l.form.value.unitsValues&&l.form.value.unitsValues.length>0||x.value&&Pn(x.value)||x.value&&xn(x.value))),ve=e.ref(null),{applyPromotionCode:Re,removePromotionCode:Tt,isPromotionCodePending:Lt,promotionCodeErrorMessage:we}=Bn({checkoutForm:l,updateInvoicePreviewOnBillingInformationChange:Q,formatErrorMessage:({action:N})=>m(N==="apply"?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{ve.value=null},onApplyError:()=>{ve.value=null}});Vn({subscription:x,promotionCode:(Je=i.configuration)==null?void 0:Je.couponCode,appliedPromotionCode:ve,applyPromotionCode:Re});const je=()=>{f&&de.safeUrlRedirect(f)},Bt=e.computed(()=>{var N;return!((N=i.configuration)!=null&&N.onPaymentSuccess)&&!!f}),Ot=()=>{var N;if(T.value=!0,we.value=null,(N=i.configuration)!=null&&N.onPaymentSuccess){i.configuration.onPaymentSuccess();return}if(f){je();return}},Ue=N=>{x.value&&(x.value={...x.value,billing_period:N},B())};return e.onMounted(()=>{r("ready")}),(N,D)=>s.value?(e.openBlock(),e.createBlock(oo,{key:0,class:"sv-checkout sv-root sv-screen sv-checkout--error"})):(e.openBlock(),e.createBlock(e.unref(Jt.ContentWithAsideLayout),{key:1,class:e.normalizeClass(["sv-checkout sv-root sv-screen",{"sv-checkout--paid":e.unref(T)}])},e.createSlots({header:e.withCtx(()=>[e.createElementVNode("div",ti,[e.createVNode(ce._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var w,$,j;return[e.unref(M)&&e.unref(x)&&pe.value?(e.openBlock(),e.createBlock(Jn,{key:0,class:"sv-checkout__title","trial-start-date":De.value,"trial-period":e.unref(b),"subscription-start-date":pe.value,"subscription-name":((w=e.unref(x))==null?void 0:w.name)??"",amount:($=e.unref(M))==null?void 0:$.invoice_amount_including_tax,"billing-period":(j=e.unref(x))==null?void 0:j.billing_period,"country-code":e.unref(l).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})])]),content:e.withCtx(()=>{var w,$,j;return[e.unref(T)?(e.openBlock(),e.createBlock(io,{key:0,class:"sv-checkout__completed-payment",onContinueToMerchant:je})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(x)&&e.unref(A)?(e.openBlock(),e.createBlock(st,{key:0,class:"sv-checkout__mobile-order-summary",subscription:e.unref(x),invoice:e.unref(M),"invoice-preview-by-billing-period":e.unref(c),"trial-invoice":e.unref(g),"enabled-pricing-ids":W.value,"trial-period":e.unref(b),avatar:(w=u.value)==null?void 0:w.avatar,"is-paid":e.unref(T),"is-usage-based":G.value,"is-preview-and-payment-methods-pending":e.unref(U)||e.unref(ee),"country-code":e.unref(l).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:Ue},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),St.value&&e.unref(x)?(e.openBlock(),e.createBlock(e.unref(a),{key:1,"seats-values":fe.value,"onUpdate:seatsValues":D[0]||(D[0]=te=>fe.value=te),"units-values":ye.value,"onUpdate:unitsValues":D[1]||(D[1]=te=>ye.value=te),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":D[2]||(D[2]=te=>W.value=te),class:"sv-checkout__plan-customization",subscription:e.unref(x),"initial-seats-values":($=e.unref(l).initialState)==null?void 0:$.value.seatsValues,"initial-units-values":(j=e.unref(l).initialState)==null?void 0:j.value.unitsValues,"billing-period":e.unref(x).billing_period,currency:ae.value},null,8,["seats-values","units-values","enabled-pricing-ids","subscription","initial-seats-values","initial-units-values","billing-period","currency"])):e.createCommentVNode("",!0),e.unref(l).form.value.country&&e.unref(R)&&X.value?(e.openBlock(),e.createBlock(Yo,{key:2,class:"sv-checkout__express-payment-methods",amount:e.unref(R),"country-code":e.unref(l).form.value.country,locale:e.unref(v),"payment-methods-options-response":e.unref(I)??[],"billing-information":X.value,"on-billing-information-change":e.unref(Q),onUpdateBillingInformation:kt},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.createVNode(Hn,{modelValue:e.unref(l).form.value,"onUpdate:modelValue":D[3]||(D[3]=te=>e.unref(l).form.value=te),class:"sv-checkout__customer-form",validation:e.unref(l).validation,"read-only-email":e.unref(k),"show-customer-info-on-top":wt.value||e.unref(T),"is-billing-information-mandatory":Z.value,"get-is-field-required":e.unref(l).getIsFieldRequired,"read-only":e.unref(T)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"]),e.createElementVNode("div",ni,[e.createVNode(ce._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>{var te,et;return[!e.unref(U)||e.unref(U)&&e.unref(I).length>0?(e.openBlock(),e.createElementBlock("div",oi,[e.createVNode(e.unref(S._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-checkout__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(l).form.value.country?e.unref(p)?(e.openBlock(),e.createBlock(ge._sfc_main,{key:1,class:"sv-checkout__payment-methods-error",icon:"error"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Could not load payment methods",id:"checkout.payment_method_block.load_failed_title",description:"The title shown when the payment methods failed to load"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Check your connection and try again.",id:"checkout.payment_method_block.load_failed_message",description:"The message shown when the payment methods failed to load"})),1)]),action:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main),{type:"button",intent:"secondary",size:"sm",class:"sv-action sv-action--secondary sv-checkout__payment-methods-retry",onClick:e.unref(L)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Try again",id:"checkout.payment_method_block.load_failed_retry_button.label",description:"The label of the button that loads the payment methods again"})),1)]),_:1},8,["onClick"])]),_:1})):e.unref(I).length===0?(e.openBlock(),e.createBlock(ge._sfc_main,{key:2,class:"sv-checkout__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),_:1})):e.unref(R)&&e.unref(l).form.value.country?(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":K.value})},[e.createVNode(e.unref(o),{ref_key:"paymentIntegrationFormRef",ref:d,"country-code":e.unref(l).form.value.country,context:e.unref(P),amount:e.unref(R),email:e.unref(l).form.value.email,variant:"AUTHORIZE","payment-method-options":e.unref(I)??[],"validate-on-submit":O,"redirects-on-success":Bt.value,"force-store-payment-method":"","billing-entity-name":(et=(te=e.unref(x))==null?void 0:te.billing_entity)==null?void 0:et.legal_name,onPaymentSuccess:Ot,onPaymentFailed:H,onInvalid:H,onReady:D[4]||(D[4]=ui=>r("ready"))},null,8,["country-code","context","amount","email","payment-method-options","redirects-on-success","billing-entity-name"])],2)])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ge._sfc_main,{key:0,class:"sv-checkout__payment-methods-empty",icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]}),_:1})])],64))]}),aside:e.withCtx(()=>[e.createElementVNode("div",ai,[e.createVNode(ce._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var w;return[e.unref(x)&&e.unref(M)?(e.openBlock(),e.createBlock(st,{key:0,subscription:e.unref(x),invoice:e.unref(M),"invoice-preview-by-billing-period":e.unref(c),"trial-invoice":e.unref(g),"enabled-pricing-ids":W.value,"trial-period":e.unref(b),"country-code":e.unref(l).form.value.country,avatar:(w=u.value)==null?void 0:w.avatar,"is-paid":e.unref(T),"is-usage-based":G.value,"is-preview-and-payment-methods-pending":e.unref(U)||e.unref(ee),onBillingPeriodChange:Ue},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1})]),e.unref(T)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(ei,{class:"sv-checkout__promotion-code","promotion-code":ve.value,"onUpdate:appliedCode":D[5]||(D[5]=w=>ve.value=w),onRemove:e.unref(Tt),onApply:e.unref(Re)},null,8,["promotion-code","onRemove","onApply"]),e.unref(we)?(e.openBlock(),e.createBlock(e.unref(Vt._sfc_main),{key:0,class:"sv-checkout__promotion-error mt-2",title:e.unref(we)},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",ri,[e.createVNode(ce._sfc_main,{class:"sv-checkout__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.unref(M)?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:0,type:"button",size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",disabled:e.unref(Lt)||e.unref(I).length===0||K.value,loading:K.value,onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F.value?e.unref(m)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(m)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled","loading"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(pt._sfc_main$1,{"payment-method-options":e.unref(I)},null,8,["payment-method-options"])])],64))]),_:2},[e.unref(V)&&!e.unref(T)?{name:"footer",fn:e.withCtx(()=>[e.createVNode(e.unref(S._sfc_main),{tag:"div",variant:"body-xs",color:"subtle",class:"sv-checkout__terms","data-testid":"checkout-terms"},{default:e.withCtx(()=>[e.createVNode(ko,{source:e.unref(V)},null,8,["source"])]),_:1})]),key:"0"}:void 0]),1032,["class"]))}}),si=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var u;const o=tn.getComponentName("checkout"),a=t,i=n,r=((u=a.configuration)==null?void 0:u.couponCode)??de.getQueryParam("coupon_code")??void 0;return(s,d)=>(e.openBlock(),e.createBlock(e.unref(S._sfc_main$1),{entry:s.$props,"component-name":e.unref(o),"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],onError:d[1]||(d[1]=_=>s.$emit("error",_))},{default:e.withCtx(()=>{var _,m,v,C,y;return[e.createVNode(li,{configuration:{avatar:(m=(_=t.branding)==null?void 0:_.emblem)==null?void 0:m.public_url,email:(v=t.configuration)==null?void 0:v.email,countryCode:(C=t.configuration)==null?void 0:C.countryCode,enabledPricingIds:(y=t.configuration)==null?void 0:y.enabledPricingIds,couponCode:e.unref(r)},onReady:d[0]||(d[0]=A=>i("ready"))},e.createSlots({_:2},[s.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["configuration"])]}),_:3},8,["entry","component-name"]))}}),{define:ci}=S.createSolvimonElement(si,"checkout");exports.FALLBACK_SEATS_NUMBER=It;exports.FALLBACK_UNITS_NUMBER=Ct;exports._sfc_main=Et;exports.defineSolvimonCheckout=ci;exports.getPricingItemByPricingConfigId=Dn;
|