@solvimon/solvimon-web 0.1.0-alpha.30 → 0.1.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -91
- package/dist/AddPaymentMethodModal-Cx203VXo.mjs +97 -0
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BMHhLZnu.mjs +89 -0
- package/dist/{Alert.vue.es-ZPG49yR_.mjs → Alert.vue.es-DHJpiSdR.mjs} +1 -1
- package/dist/{Amount.vue.es-DPqHB8Xd.mjs → Amount.vue.es-CofcgmXt.mjs} +1 -1
- package/dist/AuthProvider.handle-BpFblzFx.mjs +46 -0
- package/dist/{Avatar.vue.es-geDQsZwu.mjs → Avatar.vue.es-CJdXXOiG.mjs} +1 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BD84aBiU.mjs +64 -0
- package/dist/BillingInformationForm.lib-ad8B2Y1O.mjs +32 -0
- package/dist/BillingInformationForm.vue_vue_type_script_setup_true_lang-F5OVG0kO.mjs +340 -0
- package/dist/BillingInformationModal-Do3Fuu8A.mjs +85 -0
- package/dist/{Button.vue.es-j7iYlqtJ.mjs → Button.vue.es-CW7XfMBF.mjs} +1 -1
- package/dist/{ChargeOnDemandModal-CR01PkP_.mjs → ChargeOnDemandModal-B4ShPKLS.mjs} +46 -45
- package/dist/{Chip.vue.es-Dxx_0dte.mjs → Chip.vue.es-CYwWHyAT.mjs} +2 -2
- package/dist/CompanyPurchaseToggle.vue_vue_type_script_setup_true_lang-CVXHCSPb.mjs +510 -0
- package/dist/{Comparators.vue.es-DQBI3f7m.mjs → Comparators.vue.es-DYrKlE8t.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-Bnbsq8_5.mjs → ContentWithAsideLayout-C2kFcft1.mjs} +1 -1
- package/dist/{ContextMenu.vue.es-BJO4U47Q.mjs → ContextMenu.vue.es-EXTx0NEt.mjs} +10 -10
- package/dist/{CustomerBillingInformation.vue.es-CmNpqcBw.mjs → CustomerBillingInformation.vue.es-CSKG6V3T.mjs} +3 -3
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZZuAHIE.mjs +217 -0
- package/dist/CustomerShippingAddresses-Bdy4XWjE.mjs +282 -0
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BEKwWob_.mjs +3124 -0
- package/dist/{DividerText.vue.es-BusbyeAI.mjs → DividerText.vue.es-Dq0JzI8C.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs} +3 -3
- package/dist/{ErrorNotification.vue.es-F068p7PY.mjs → ErrorNotification.vue.es-Cw7fqCg1.mjs} +2 -2
- package/dist/{FormMessage.vue.es-CwMQpIAW.mjs → FormMessage.vue.es-MrzQoSae.mjs} +1 -1
- package/dist/{IconButton.vue.es-D8DtBW9i.mjs → IconButton.vue.es-CpQbFw0x.mjs} +2 -2
- package/dist/{IconTitle.vue.es-6VJtjJX2.mjs → IconTitle.vue.es-CcOIFjbE.mjs} +3 -3
- package/dist/{Input.vue.es-BLyHcmu4.mjs → Input.vue.es-Cd55vQri.mjs} +4 -4
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dl1vTzQD.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CqkGCbvg.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DYskT3r7.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-BUu5M_gx.mjs} +7 -7
- package/dist/{InvoicePreview.vue.es-Cpf66_xV.mjs → InvoicePreview.vue.es-DHh5wruk.mjs} +7 -7
- package/dist/{InvoicePricingClauseChip.vue.es-CDrAE901.mjs → InvoicePricingClauseChip.vue.es-ZSOBp1se.mjs} +4 -4
- package/dist/{Label.vue.es-es7ZUBSP.mjs → Label.vue.es-CB6G8Krh.mjs} +3 -3
- package/dist/LoadFailedNotice.vue_vue_type_script_setup_true_lang-BZCtO2Er.mjs +20 -0
- package/dist/{Modal.vue.es-eeR9FmvQ.mjs → Modal.vue.es-CJFTVFSZ.mjs} +138 -127
- package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs +789 -0
- package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-CrjVPks0.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-D08Qpgb0.mjs} +2 -2
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DyjzaTK1.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-dl52PYcq.mjs} +4 -4
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-CN42ewCn.mjs → PaymentHistoryBlock-BSXlneqM.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3Y5fHvA.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CXy0XGpn.mjs} +5 -5
- package/dist/{PaymentIntegrationForm-D3Ye7LZ5.mjs → PaymentIntegrationForm-Diua0GGJ.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CLlm_Q2j.mjs +161 -0
- package/dist/{PaymentIntegrationFormAdyen-Fm-diCCO.mjs → PaymentIntegrationFormAdyen-D4FP0Vj5.mjs} +302 -282
- package/dist/{PaymentIntegrationFormStripe-BANBL6za.mjs → PaymentIntegrationFormStripe-vFzF_sCJ.mjs} +126 -117
- package/dist/{PaymentMethod.vue.es-t3-VyoE8.mjs → PaymentMethod.vue.es-vs6SaZOh.mjs} +200 -150
- package/dist/{PaymentMethodForm-CqP3GoNj.mjs → PaymentMethodForm-Buhe0aRQ.mjs} +1 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-RPPdBw_e.mjs +165 -0
- package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs} +7 -7
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DhkkiJaQ.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BXbevI3r.mjs} +28 -26
- package/dist/PaymentMethodsModal-CnJP9UKp.mjs +192 -0
- package/dist/PlanCustomizationEditor-KHLSEUbb.mjs +864 -0
- package/dist/{PortalLinkUnverified-Cp60_kRJ.mjs → PortalLinkUnverified-DlZAkE93.mjs} +3 -3
- package/dist/{PortalNotAvailable-DzSQnfzw.mjs → PortalNotAvailable-CKIomNrm.mjs} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-Srq_3cga.mjs → PricingGroupRangeInput.vue.es-oHD-IT12.mjs} +8 -8
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-wCW8YZHM.mjs} +16 -15
- package/dist/{RadioGroupExtended.vue.es-BbBMDf6l.mjs → RadioGroupExtended.vue.es-DsShmkKZ.mjs} +5 -5
- package/dist/Section.vue.es-DYmEtgBj.mjs +88 -0
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs} +2 -2
- package/dist/ShippingAddressForm.vue_vue_type_script_setup_true_lang-CJp6ddhZ.mjs +144 -0
- package/dist/ShippingAddressesModal-Gxv2KxaW.mjs +283 -0
- package/dist/{StepInput.vue.es-ieh4EuJ7.mjs → StepInput.vue.es-sqA-VSsn.mjs} +4 -4
- package/dist/SubscriptionCancellationModal-DfAZ_uW6.mjs +4 -0
- package/dist/SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-BlbiDNIu.mjs +240 -0
- package/dist/SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-C1ko2xvR.mjs +64 -0
- package/dist/SubscriptionDetails.entry.ce-CdWV-8WN.mjs +764 -0
- package/dist/{SubscriptionSchedules-DMxX3GpK.mjs → SubscriptionSchedules-BfdVn1XA.mjs} +1 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C8q8Q6h5.mjs +5413 -0
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs +90 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CHlXP_2x.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DYWjTzPV.mjs} +133 -108
- package/dist/Toggle.vue.es-S2g8WGY_.mjs +99 -0
- package/dist/{TooltipParagraph.vue.es-BES3zsYN.mjs → TooltipParagraph.vue.es-Bt-7LHr3.mjs} +18 -18
- package/dist/{TranslationOverride.vue_vue_type_script_setup_true_lang-BJmlNrXT.mjs → TranslationOverride.vue_vue_type_script_setup_true_lang-Cp_sFa52.mjs} +1 -1
- package/dist/TrialChip.vue.es-VZwQX079.mjs +47 -0
- package/dist/addonQuantity-D3bGVqjL.mjs +128 -0
- package/dist/adyen-CHgq2l6n.mjs +99 -0
- package/dist/adyenSdk-DUTO7xkT.mjs +63 -0
- package/dist/{api.es-qgvzNMU-.mjs → api.es-QaC926Xu.mjs} +2 -2
- package/dist/components/BillingInformation/BillingInformation.mjs +37 -41
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +45 -462
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +33 -42
- package/dist/components/Invoice/Invoice.mjs +1087 -1019
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +38 -47
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +29 -34
- package/dist/components/InvoicesList/InvoicesList.mjs +33 -42
- package/dist/components/PaymentHistory/PaymentHistory.mjs +39 -48
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +56 -64
- package/dist/components/ShippingAddressForm/ShippingAddressForm.ce.d.ts +1 -0
- package/dist/components/ShippingAddressForm/ShippingAddressForm.mjs +212 -0
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +34 -42
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +41 -50
- package/dist/components/WalletBalances/WalletBalances.mjs +46 -55
- package/dist/core/events.types.d.ts +1 -0
- package/dist/core/index.mjs +51 -34
- package/dist/{customElements-DK4GKNJG.mjs → customElements-B8c354Nu.mjs} +802 -768
- package/dist/{customer-lf6S5DBR.mjs → customer-CP-Wz7JO.mjs} +1 -1
- package/dist/{de-DE-Cyj_NtiI.mjs → de-DE-C9HrzHpE.mjs} +71 -5
- package/dist/{de-DE-UJ6X6jXu.mjs → de-DE-DAQmgEy5.mjs} +82 -19
- package/dist/{formControl-BZQLHnOO.mjs → formControl-C18sw44K.mjs} +275 -275
- package/dist/{formatting.es-RclXHhKo.mjs → formatting.es-DlJEzreG.mjs} +16 -13
- package/dist/{fr-FR-CRFoWQ7J.mjs → fr-FR-CHR3VWvd.mjs} +71 -5
- package/dist/{fr-FR-Cvvbkwlj.mjs → fr-FR-fz51-Ubw.mjs} +79 -16
- package/dist/{countryData.es-BegoD-cZ.mjs → getCountryNameByCode.es-OGxn_zT0.mjs} +7 -2
- package/dist/icon-sprite.svg.es-2S3rv8NW.mjs +4 -0
- package/dist/index.es-Bv55VtdE.mjs +633 -0
- package/dist/{index.es-BrVTOW5D.mjs → index.es-C7J3WGGo.mjs} +4 -4
- package/dist/index.mjs +37 -33
- package/dist/invoices-I7PghcPV.mjs +143 -0
- package/dist/{it-IT-DnJP5URH.mjs → it-IT-BpCkTMZL.mjs} +73 -10
- package/dist/{it-IT-DObZEc-U.mjs → it-IT-Dzc7DmmL.mjs} +71 -5
- package/dist/{nl-NL-q9xfTZF0.mjs → nl-NL-22C8OcIM.mjs} +79 -16
- package/dist/{nl-NL-C02xHilF.mjs → nl-NL-Dut_QwsY.mjs} +71 -5
- package/dist/paymentIntegrationFormLoaders-BFMAMpcA.mjs +31 -0
- package/dist/{paymentMethods-8w-ccfY_.mjs → paymentMethods-aGKIi7DS.mjs} +22 -21
- package/dist/{paymentOutcome-B6sW1eCV.mjs → paymentOutcome-Cv7hTFVu.mjs} +1 -1
- package/dist/paymentRedirect-DaS8Kccc.mjs +66 -0
- package/dist/payments-BKoKpoLN.mjs +71 -0
- package/dist/preloadPaymentIntegrationForms-Buwal_JR.mjs +9 -0
- package/dist/pricing-Y-7ELzN-.mjs +42 -0
- package/dist/{pricingItem.es-bCPArbTa.mjs → pricingItem.es-BafitMMY.mjs} +1 -1
- package/dist/pricingPlanScheduleOverrides-CGm_-jJq.mjs +291 -0
- package/dist/randomUuid-BE_IQ-aq.mjs +10 -0
- package/dist/screens/Checkout/Checkout.mjs +1098 -3
- package/dist/screens/CheckoutSession/CheckoutSession.ce.d.ts +1 -0
- package/dist/screens/CheckoutSession/CheckoutSession.mjs +1322 -0
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +209 -133
- package/dist/screens/PayInvoice/PayInvoice.mjs +283 -275
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +92 -97
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +915 -404
- package/dist/{subscription-BwzkagDI.mjs → subscription-DQ5mRp_e.mjs} +10 -10
- package/dist/subscriptions-B7dNqi1C.mjs +99 -0
- package/dist/timePeriod.es-R9U0wLlB.mjs +13 -0
- package/dist/types/components/customer/BillingInformationForm/BillingInformationForm.types.d.ts +11 -14
- package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -9
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +10 -0
- package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +6 -0
- package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +17 -0
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -2
- package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +3 -2
- package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +2 -0
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +12 -1
- package/dist/types/components/payments/PaymentMethodsList/PaymentMethodsList.types.d.ts +2 -0
- package/dist/types/components/payments/PaymentMethodsModal/PaymentMethodsModal.types.d.ts +22 -0
- package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.lib.types.d.ts +1 -1
- package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -1
- package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -2
- package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -11
- package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +1 -5
- package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +11 -0
- package/dist/types/components/providers/HostElementProvider/composables/useHostEvent.d.ts +12 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +5 -4
- package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +3 -3
- package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +3 -3
- package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +6 -1
- package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +1 -0
- package/dist/types/components/providers/Provider/Provider.types.d.ts +10 -3
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -14
- package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -1
- package/dist/types/components/subscriptions/OrderSummary.types.d.ts +14 -0
- package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +14 -1
- package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +9 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditor.types.d.ts +4 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditorItem.types.d.ts +2 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +4 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +2 -0
- package/dist/types/components/subscriptions/SubscriptionCancellationSuccess/SubscriptionCancellationSuccess.types.d.ts +4 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +10 -9
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSuccess.types.d.ts +5 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSummary.types.d.ts +3 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanChangeSummary.types.d.ts +4 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanSelector.types.d.ts +7 -0
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +1 -0
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -0
- package/dist/types/components/wallets/AutoTopUpModal/AutoTopUpModal.types.d.ts +3 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +5 -0
- package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.types.d.ts +1 -2
- package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +6 -2
- package/dist/types/public/components/Invoice/Invoice.types.d.ts +7 -7
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +2 -2
- package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +6 -7
- package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.types.d.ts +1 -1
- package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.types.d.ts +19 -14
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.ce.d.ts +1 -0
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.types.d.ts +6 -0
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.types.d.ts +5 -0
- package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +10 -1
- package/dist/types/public/core/action-request.types.d.ts +18 -24
- package/dist/types/public/core/events.types.d.ts +99 -0
- package/dist/types/public/core/index.d.ts +3 -1
- package/dist/types/public/core/types.d.ts +11 -2
- package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +1 -7
- package/dist/types/public/screens/Checkout/Checkout.source.types.d.ts +151 -0
- package/dist/types/public/screens/Checkout/Checkout.types.d.ts +7 -30
- package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.ce.d.ts +1 -0
- package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.types.d.ts +3 -0
- package/dist/types/public/screens/CustomerOverview/CustomerOverview.types.d.ts +8 -2
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +0 -6
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +2 -19
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +2 -3
- package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.types.d.ts +2 -1
- package/dist/types/services/paymentMethods.types.d.ts +12 -1
- package/dist/types/types/EntryBaseProps.d.ts +10 -6
- package/dist/types/types/branding.d.ts +15 -0
- package/dist/types/types/checkoutSession.d.ts +199 -0
- package/dist/types/types/errors.d.ts +2 -0
- package/dist/types/types/pricingPlanGroup.d.ts +25 -0
- package/dist/{useActionDispatchProvider-ChAHdwR8.mjs → useActionDispatchProvider-BCtk-FGU.mjs} +1 -1
- package/dist/useAddressFormats-CtE4QaVU.mjs +1998 -0
- package/dist/useCheckoutForm-BhXcmnUi.mjs +3355 -0
- package/dist/{useCustomer-CTMhg1nd.mjs → useCustomer-mQysxUwp.mjs} +2 -2
- package/dist/useDefaultPaymentMethod-Dliq6_Yw.mjs +39 -0
- package/dist/useExperimentalFeature-Bw6bBtay.mjs +6 -0
- package/dist/useHostEvent-MtRG6W2B.mjs +12 -0
- package/dist/{useIncrementalLoading-CBVutPH8.mjs → useIncrementalLoading-CJSj1945.mjs} +2 -2
- package/dist/{useInvoiceData-qUGbBAQK.mjs → useInvoiceData-BEZIvw32.mjs} +2 -2
- package/dist/{useInvoicesList-wJvZAJpW.mjs → useInvoicesList-CrXjsmei.mjs} +140 -138
- package/dist/{sorting.es-C0pdMgX0.mjs → useIsMounted.es-BNPhTTHE.mjs} +11 -10
- package/dist/{useLoadInitialData-UvfYXgbi.mjs → useLoadInitialData-Bomj_1mo.mjs} +1 -1
- package/dist/usePaymentFormHold-CYZ4BdOw.mjs +19 -0
- package/dist/{usePaymentMethodAvailability-35l4pWdH.mjs → usePaymentMethodAvailability-DR_neLeZ.mjs} +4 -4
- package/dist/usePaymentMethodOptions-CuHoQx3K.mjs +67 -0
- package/dist/{usePaymentMethods-De7hlLHo.mjs → usePaymentMethods-BDdetXts.mjs} +2 -2
- package/dist/{usePayments-hWS7fnOx.mjs → usePayments-B5Z9Kfbv.mjs} +20 -18
- package/dist/usePortal-DuLR5Mid.mjs +14 -0
- package/dist/{useService-BwzIBIRp.mjs → useService-2aOFBTxU.mjs} +1 -1
- package/dist/useShippingAddresses-BvThNpez.mjs +122 -0
- package/dist/useSubscription-Dzo-kBpQ.mjs +35 -0
- package/dist/useSubscriptionActions-CWaNRoZ7.mjs +44 -0
- package/dist/useWatchDebounced-DkXgKe0E.mjs +20 -0
- package/dist/{wallets.es-eH2C2ygn.mjs → wallets.es-DRlUVd2R.mjs} +1 -1
- package/package.json +41 -11
- package/dist/AuthProvider.handle-SRR_04XS.mjs +0 -50
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-nqKbgY7G.mjs +0 -58
- package/dist/Checkout.entry.ce-CopWuLJC.mjs +0 -4169
- package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-CEnM1uxK.mjs +0 -828
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Jyb5ZN3s.mjs +0 -136
- package/dist/CustomerShippingAddresses-BRPukhRI.mjs +0 -397
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DJnr5D56.mjs +0 -2936
- package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-B_FpibLA.mjs +0 -441
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D07SEP8a.mjs +0 -181
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-CMRMbL3d.mjs +0 -161
- package/dist/PlanCustomizationEditor-B76UNEMm.mjs +0 -791
- package/dist/Section.vue.es-Oqn1wGPZ.mjs +0 -72
- package/dist/ShippingAddressesModal-c7nqf4Ny.mjs +0 -418
- package/dist/SubscriptionDetails.entry.ce-uYv45FGH.mjs +0 -1044
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DXro_64f.mjs +0 -5200
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs +0 -203
- package/dist/TrialChip.vue.es-C51z1ZiA.mjs +0 -35
- package/dist/addonQuantity-CCVaA3e-.mjs +0 -758
- package/dist/adyenSdk-B01MB9Ia.mjs +0 -58
- package/dist/getCountryNameByCode.es-BDHua7VM.mjs +0 -8
- package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +0 -4
- package/dist/invoices-DdREPDXV.mjs +0 -123
- package/dist/paymentMethods-Goa25rTs.mjs +0 -61
- package/dist/payments-CKpU1K3t.mjs +0 -68
- package/dist/pricing-CEaZGgKe.mjs +0 -29
- package/dist/pricingPlanScheduleOverrides-BBp-DmpV.mjs +0 -233
- package/dist/pricingPlanSchedules-DSMptcAh.mjs +0 -38
- package/dist/subscriptions-B5bH8hsI.mjs +0 -66
- package/dist/taxId.es-e6NEvprh.mjs +0 -243
- package/dist/types/components/payments/ExpressPaymentMethodButton/ExpressPaymentMethodButton.types.d.ts +0 -3
- package/dist/useCustomerFormLabels-D4oDnfxA.mjs +0 -1173
- package/dist/usePaymentFormHold-Cwdr-vyc.mjs +0 -181
- package/dist/usePortal-DUfD6hrA.mjs +0 -7
- package/dist/useTimePeriod.es-BUorDLVK.mjs +0 -93
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
import { shallowRef as q, ref as P, computed as p, effectScope as rs, reactive as lt, onScopeDispose as us, watch as ee, onMounted as ls, defineComponent as xe, openBlock as R, createElementBlock as ds, createElementVNode as ps, createVNode as bt, unref as w, withCtx as ce, createTextVNode as dt, toDisplayString as pt, createBlock as $, mergeProps as ms, createCommentVNode as _s } from "vue";
|
|
2
|
+
import { u as vs, c as fs, b as hs, E as gs, e as It, a as Nt, L as ys, f as A, d as mt, j as Es, k as Ss, l as Os } from "../../customElements-B8c354Nu.mjs";
|
|
3
|
+
import { D as ks, h as Cs, g as _t } from "../../useAddressFormats-CtE4QaVU.mjs";
|
|
4
|
+
import { u as bs } from "../../useHostEvent-MtRG6W2B.mjs";
|
|
5
|
+
import { u as Is, _ as Pt, a as Ns } from "../../useCheckoutForm-BhXcmnUi.mjs";
|
|
6
|
+
import { u as Ps } from "../../useWatchDebounced-DkXgKe0E.mjs";
|
|
7
|
+
import { u as ws } from "../../usePaymentMethodOptions-CuHoQx3K.mjs";
|
|
8
|
+
import { w as Ts } from "../../api.es-QaC926Xu.mjs";
|
|
9
|
+
import { j as xs, c as Ds } from "../../subscription-DQ5mRp_e.mjs";
|
|
10
|
+
import { s as Ms } from "../../OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs";
|
|
11
|
+
import { b as vt, s as Ls } from "../../paymentRedirect-DaS8Kccc.mjs";
|
|
12
|
+
const wt = ["line1", "line2", "city", "state", "postal_code", "country"], As = (s) => Cs(s);
|
|
13
|
+
function ae(s) {
|
|
14
|
+
var v, y, S, C, m, I;
|
|
15
|
+
if (!s) return {};
|
|
16
|
+
const n = s.type === "ORGANIZATION" ? (v = s.organization) == null ? void 0 : v.registered_address : (y = s.individual) == null ? void 0 : y.residential_address, a = (S = s.individual) == null ? void 0 : S.name, c = s.organization, u = (m = (C = c == null ? void 0 : c.tax_ids) == null ? void 0 : C[0]) == null ? void 0 : m.id, l = n == null ? void 0 : n.country;
|
|
17
|
+
return {
|
|
18
|
+
type: s.type,
|
|
19
|
+
...s.email && { email: s.email },
|
|
20
|
+
...((I = s.organization) == null ? void 0 : I.legal_name) && {
|
|
21
|
+
companyLegalName: s.organization.legal_name
|
|
22
|
+
},
|
|
23
|
+
...(a == null ? void 0 : a.first_name) && { firstName: a.first_name },
|
|
24
|
+
...(a == null ? void 0 : a.infix) && { infix: a.infix },
|
|
25
|
+
...(a == null ? void 0 : a.last_name) && { lastName: a.last_name },
|
|
26
|
+
...u && { companyVatNumber: u },
|
|
27
|
+
...(c == null ? void 0 : c.registration_number) && {
|
|
28
|
+
companyRegistrationNumber: c.registration_number
|
|
29
|
+
},
|
|
30
|
+
...typeof (c == null ? void 0 : c.tax_exempt) == "boolean" && {
|
|
31
|
+
taxExempt: c.tax_exempt
|
|
32
|
+
},
|
|
33
|
+
...(c == null ? void 0 : c.tax_exempt_note) && { taxExemptNote: c.tax_exempt_note },
|
|
34
|
+
...(n == null ? void 0 : n.line1) && { addressLine1: n.line1 },
|
|
35
|
+
...(n == null ? void 0 : n.line2) && { addressLine2: n.line2 },
|
|
36
|
+
...(n == null ? void 0 : n.postal_code) && { postalCode: n.postal_code },
|
|
37
|
+
...(n == null ? void 0 : n.city) && { city: n.city },
|
|
38
|
+
...(n == null ? void 0 : n.state) && { state: n.state },
|
|
39
|
+
...l && As(l) && { country: l }
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const Ne = {
|
|
43
|
+
line1: "addressLine1",
|
|
44
|
+
line2: "addressLine2",
|
|
45
|
+
city: "city",
|
|
46
|
+
postal_code: "postalCode",
|
|
47
|
+
state: "state",
|
|
48
|
+
country: "country"
|
|
49
|
+
}, Tt = ["first_name", "infix", "last_name"], Pe = {
|
|
50
|
+
first_name: "firstName",
|
|
51
|
+
infix: "infix",
|
|
52
|
+
last_name: "lastName"
|
|
53
|
+
}, Rs = {
|
|
54
|
+
email: ["email"],
|
|
55
|
+
"organization.legal_name": ["companyLegalName"],
|
|
56
|
+
"organization.registration_number": ["companyRegistrationNumber"],
|
|
57
|
+
"organization.tax_id": ["companyVatNumber"],
|
|
58
|
+
"organization.tax_ids": ["companyVatNumber"],
|
|
59
|
+
"individual.name": ["firstName", "lastName"],
|
|
60
|
+
...Object.fromEntries(
|
|
61
|
+
Tt.map((s) => [`individual.name.${s}`, [Pe[s]]])
|
|
62
|
+
),
|
|
63
|
+
...Object.fromEntries(
|
|
64
|
+
["organization.registered_address", "individual.residential_address"].flatMap(
|
|
65
|
+
(s) => wt.map((n) => [`${s}.${n}`, [Ne[n]]])
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
};
|
|
69
|
+
function Fs(s, n) {
|
|
70
|
+
var c;
|
|
71
|
+
const a = Array.from({ length: n }, () => []);
|
|
72
|
+
for (const u of s) {
|
|
73
|
+
const l = /^checkout_session\.customers\.(\d+)\.customer\.(.+)$/.exec(u), v = l && Rs[l[2]];
|
|
74
|
+
v && ((c = a[Number(l[1])]) == null || c.push(...v));
|
|
75
|
+
}
|
|
76
|
+
return a;
|
|
77
|
+
}
|
|
78
|
+
const re = (s) => (s == null ? void 0 : s.trim()) || void 0;
|
|
79
|
+
function Us(s, n, a, c = () => !1) {
|
|
80
|
+
const u = ae(n), l = [], v = (O, k) => a[O] === "EDITABLE" && !k.some(c), y = (O) => {
|
|
81
|
+
const k = re(s[O]);
|
|
82
|
+
if (!(!k || k === re(u[O])))
|
|
83
|
+
return l.push(O), k;
|
|
84
|
+
}, S = () => {
|
|
85
|
+
const O = {};
|
|
86
|
+
for (const k of wt) {
|
|
87
|
+
const T = y(Ne[k]);
|
|
88
|
+
T && (O[k] = T);
|
|
89
|
+
}
|
|
90
|
+
return Object.keys(O).length ? O : void 0;
|
|
91
|
+
}, C = () => {
|
|
92
|
+
const O = {};
|
|
93
|
+
for (const k of Tt) {
|
|
94
|
+
const T = y(Pe[k]);
|
|
95
|
+
T && (O[k] = T);
|
|
96
|
+
}
|
|
97
|
+
return Object.keys(O).length ? O : void 0;
|
|
98
|
+
}, m = {}, I = v("email", ["email"]) ? y("email") : void 0;
|
|
99
|
+
I && (m.email = I);
|
|
100
|
+
const M = v("address", Object.values(Ne)) ? S() : void 0;
|
|
101
|
+
if (n.type === "INDIVIDUAL") {
|
|
102
|
+
const O = v("customer_details", Object.values(Pe)) ? C() : void 0;
|
|
103
|
+
(O || M) && (m.individual = {
|
|
104
|
+
...O && { name: O },
|
|
105
|
+
...M && { residential_address: M }
|
|
106
|
+
});
|
|
107
|
+
} else {
|
|
108
|
+
const O = v("customer_details", ["companyLegalName"]) ? y("companyLegalName") : void 0, k = v("customer_details", ["companyRegistrationNumber"]) ? y("companyRegistrationNumber") : void 0, T = v("tax_ids", ["companyVatNumber"]) ? $s(s.companyVatNumber, n) : void 0;
|
|
109
|
+
T !== void 0 && l.push("companyVatNumber");
|
|
110
|
+
const z = v("tax_ids", []) && !!s.taxExempt != !!u.taxExempt ? !!s.taxExempt : void 0;
|
|
111
|
+
z !== void 0 && l.push("taxExempt");
|
|
112
|
+
const X = v("tax_ids", ["taxExemptNote"]) && s.taxExempt ? y("taxExemptNote") : void 0, N = {
|
|
113
|
+
...O && { legal_name: O },
|
|
114
|
+
...k && { registration_number: k },
|
|
115
|
+
...M && { registered_address: M },
|
|
116
|
+
...T !== void 0 && { tax_ids: T },
|
|
117
|
+
...z !== void 0 && { tax_exempt: z },
|
|
118
|
+
...X && { tax_exempt_note: X }
|
|
119
|
+
};
|
|
120
|
+
Object.keys(N).length && (m.organization = N);
|
|
121
|
+
}
|
|
122
|
+
return Object.keys(m).length ? { patch: m, fields: l } : void 0;
|
|
123
|
+
}
|
|
124
|
+
function $s(s, n) {
|
|
125
|
+
var y, S;
|
|
126
|
+
const a = ((y = n.organization) == null ? void 0 : y.tax_ids) ?? [], c = re(s);
|
|
127
|
+
if (c === re((S = a[0]) == null ? void 0 : S.id)) return;
|
|
128
|
+
const [u, ...l] = a.map(({ id: C, type: m }) => ({ id: C, type: m })), v = c ? [{ id: c, type: (u == null ? void 0 : u.type) ?? ks }, ...l] : l;
|
|
129
|
+
return v.length ? v : null;
|
|
130
|
+
}
|
|
131
|
+
function Vs(s, n) {
|
|
132
|
+
var a, c, u, l;
|
|
133
|
+
return ((c = (a = s.pricing_plan_schedule_customizations) == null ? void 0 : a[0]) == null ? void 0 : c.pricing_plan_schedule_id) ?? ((l = (u = s.starting_values) == null ? void 0 : u[0]) == null ? void 0 : l.pricing_plan_schedule_id) ?? n;
|
|
134
|
+
}
|
|
135
|
+
function ft(s, n, a) {
|
|
136
|
+
var v, y;
|
|
137
|
+
const c = (v = s.pricing_plan_schedule_customizations) == null ? void 0 : v.find(
|
|
138
|
+
(S) => S.pricing_plan_schedule_id === n
|
|
139
|
+
), u = (y = s.starting_values) == null ? void 0 : y.find(
|
|
140
|
+
(S) => S.pricing_plan_schedule_id === n
|
|
141
|
+
);
|
|
142
|
+
return [...new Map(
|
|
143
|
+
[...(u == null ? void 0 : u[a]) ?? [], ...(c == null ? void 0 : c[a]) ?? []].map(
|
|
144
|
+
({ pricing_item_config_id: S, number: C }) => [S, C]
|
|
145
|
+
)
|
|
146
|
+
)].map(([S, C]) => ({
|
|
147
|
+
pricing_item_config_id: S,
|
|
148
|
+
number: C
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
function ht(s, n) {
|
|
152
|
+
const a = (s ?? []).filter(
|
|
153
|
+
({ pricing_item_config_id: u }) => !n.some((l) => l.pricing_item_config_id === u)
|
|
154
|
+
), c = (u) => (s ?? []).map((l) => ({
|
|
155
|
+
pricing_item_config_id: l.pricing_item_config_id,
|
|
156
|
+
number: l[u].number
|
|
157
|
+
}));
|
|
158
|
+
return {
|
|
159
|
+
// Only what the buyer may change: a fixed quantity already shows in the order summary.
|
|
160
|
+
values: [
|
|
161
|
+
...n.filter(
|
|
162
|
+
({ pricing_item_config_id: u }) => (s ?? []).some(
|
|
163
|
+
(l) => l.pricing_item_config_id === u
|
|
164
|
+
)
|
|
165
|
+
),
|
|
166
|
+
...a.map(({ pricing_item_config_id: u, min: l }) => ({
|
|
167
|
+
pricing_item_config_id: u,
|
|
168
|
+
number: l.number
|
|
169
|
+
}))
|
|
170
|
+
],
|
|
171
|
+
minimums: c("min"),
|
|
172
|
+
maximums: c("max")
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const Hs = (s, n, a) => {
|
|
176
|
+
const c = Number(s);
|
|
177
|
+
return Number.isFinite(c) && (!a || Number.isInteger(c)) && c >= Number(n.min.number) && c <= Number(n.max.number);
|
|
178
|
+
};
|
|
179
|
+
function gt(s, n, a, { wholeOnly: c }) {
|
|
180
|
+
const u = (s ?? []).filter(({ pricing_item_config_id: l, number: v }) => {
|
|
181
|
+
const y = n == null ? void 0 : n.find(
|
|
182
|
+
(C) => C.pricing_item_config_id === l
|
|
183
|
+
), S = a.find(
|
|
184
|
+
(C) => C.pricing_item_config_id === l
|
|
185
|
+
);
|
|
186
|
+
return !!y && Hs(v, y, c) && Number(v) !== Number(S == null ? void 0 : S.number);
|
|
187
|
+
});
|
|
188
|
+
return u.length ? u : void 0;
|
|
189
|
+
}
|
|
190
|
+
function yt(s, n) {
|
|
191
|
+
var a, c;
|
|
192
|
+
return (c = (a = s.pricing_plan_schedule_customizations) == null ? void 0 : a.find(
|
|
193
|
+
(u) => u.pricing_plan_schedule_id === n
|
|
194
|
+
)) == null ? void 0 : c.promotion_codes;
|
|
195
|
+
}
|
|
196
|
+
const js = ["email", "custom_fields", "individual", "organization"], zs = ["name", "residential_address"], Ks = ["first_name", "last_name", "infix"], Bs = ["line1", "line2", "city", "postal_code", "state", "country"], Ys = [
|
|
197
|
+
"legal_name",
|
|
198
|
+
"tax_id",
|
|
199
|
+
"tax_ids",
|
|
200
|
+
"registration_number",
|
|
201
|
+
"tax_exempt",
|
|
202
|
+
"tax_exempt_note",
|
|
203
|
+
"registered_address",
|
|
204
|
+
"tax_registrations"
|
|
205
|
+
], Gs = [
|
|
206
|
+
"pricing_plan_schedule_id",
|
|
207
|
+
"seats_values",
|
|
208
|
+
"units",
|
|
209
|
+
"promotion_codes"
|
|
210
|
+
];
|
|
211
|
+
function Z(s, n, a = []) {
|
|
212
|
+
const c = {};
|
|
213
|
+
for (const u of n) {
|
|
214
|
+
const l = s[u];
|
|
215
|
+
l === void 0 || l === null && !a.includes(u) || (c[u] = l);
|
|
216
|
+
}
|
|
217
|
+
return c;
|
|
218
|
+
}
|
|
219
|
+
const Et = (s) => Z(s, Bs), Ws = (s) => {
|
|
220
|
+
const { individual: n, organization: a, ...c } = Z(s, js, [
|
|
221
|
+
"custom_fields"
|
|
222
|
+
]), u = n && Z(n, zs), l = a && Z(a, Ys, ["tax_ids", "tax_registrations"]);
|
|
223
|
+
return {
|
|
224
|
+
...c,
|
|
225
|
+
...u && {
|
|
226
|
+
individual: {
|
|
227
|
+
...u.name && { name: Z(u.name, Ks) },
|
|
228
|
+
...u.residential_address && {
|
|
229
|
+
residential_address: Et(u.residential_address)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
...l && {
|
|
234
|
+
organization: {
|
|
235
|
+
...l,
|
|
236
|
+
...l.registered_address && {
|
|
237
|
+
registered_address: Et(l.registered_address)
|
|
238
|
+
},
|
|
239
|
+
// A stored id carries read-only keys, such as its validation result.
|
|
240
|
+
...l.tax_ids && {
|
|
241
|
+
tax_ids: l.tax_ids.map(({ id: v, type: y }) => ({ id: v, type: y }))
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}, qs = (s) => ({
|
|
247
|
+
...Z(s, Gs, ["promotion_codes"]),
|
|
248
|
+
pricing_plan_schedule_id: s.pricing_plan_schedule_id
|
|
249
|
+
}), we = {}, St = (s, n) => {
|
|
250
|
+
const a = (s ?? []).map((c) => c ? n(c) : we);
|
|
251
|
+
for (; a.length && Object.keys(a[a.length - 1]).length === 0; ) a.pop();
|
|
252
|
+
return a.length ? a : void 0;
|
|
253
|
+
};
|
|
254
|
+
function Ie(s, n) {
|
|
255
|
+
const a = St(n.customers, (u) => {
|
|
256
|
+
const l = Ws(u);
|
|
257
|
+
return Object.keys(l).length ? { customer: l } : we;
|
|
258
|
+
}), c = St(
|
|
259
|
+
n.pricing_plan_subscriptions,
|
|
260
|
+
(u) => u.length ? { pricing_plan_schedule_customizations: u.map(qs) } : we
|
|
261
|
+
);
|
|
262
|
+
return {
|
|
263
|
+
checkout_session: {
|
|
264
|
+
expected_version: s,
|
|
265
|
+
...a && { customers: a },
|
|
266
|
+
...c && { pricing_plan_subscriptions: c }
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function Js(s) {
|
|
271
|
+
return !s.checkout_session.customers && !s.checkout_session.pricing_plan_subscriptions;
|
|
272
|
+
}
|
|
273
|
+
function Zs() {
|
|
274
|
+
const s = vs(), n = fs(), a = (c, ...u) => hs(s.apiUrls.transaction, "portal", "portal-urls", c, ...u);
|
|
275
|
+
return {
|
|
276
|
+
/** `expanded` adds each subscription's plan, which a session token can read only here. */
|
|
277
|
+
getCheckoutSession(c, { expanded: u = !1 } = {}) {
|
|
278
|
+
return n({
|
|
279
|
+
url: a(c),
|
|
280
|
+
...u && { query: Ts({ expandParams: gs, expand: !0 }) }
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
/** A stale `expected_version` or a refused promotion code is a 400 the caller handles. */
|
|
284
|
+
updateCheckoutSession(c, u) {
|
|
285
|
+
return n({
|
|
286
|
+
url: a(c),
|
|
287
|
+
data: u,
|
|
288
|
+
options: { method: "PATCH", expectedStatusCodes: [400] }
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
previewCheckoutSession(c) {
|
|
292
|
+
return n({
|
|
293
|
+
url: a(c, "preview"),
|
|
294
|
+
options: { method: "POST" }
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
const Xs = 400, Qs = 3, en = 250, Ot = [1e3, 2e3, 4e3, 8e3, 16e3], tn = "{CHECKOUT_SESSION_ID}", sn = 1e3, nn = 15e3, on = 6e4, an = [
|
|
300
|
+
"email",
|
|
301
|
+
"companyLegalName",
|
|
302
|
+
"companyRegistrationNumber",
|
|
303
|
+
"taxExempt",
|
|
304
|
+
"taxExemptNote",
|
|
305
|
+
"firstName",
|
|
306
|
+
"infix",
|
|
307
|
+
"lastName",
|
|
308
|
+
"companyVatNumber",
|
|
309
|
+
"addressLine1",
|
|
310
|
+
"addressLine2",
|
|
311
|
+
"postalCode",
|
|
312
|
+
"city",
|
|
313
|
+
"state",
|
|
314
|
+
"country"
|
|
315
|
+
], cn = (s, n, a) => {
|
|
316
|
+
s[a] = n[a];
|
|
317
|
+
}, rn = (s, n) => {
|
|
318
|
+
const a = {};
|
|
319
|
+
for (const c in s)
|
|
320
|
+
n(c, s[c]) && (a[c] = s[c]);
|
|
321
|
+
return a;
|
|
322
|
+
}, un = {
|
|
323
|
+
customer_details: "HIDDEN",
|
|
324
|
+
address: "HIDDEN",
|
|
325
|
+
tax_ids: "HIDDEN",
|
|
326
|
+
email: "HIDDEN",
|
|
327
|
+
custom_fields: "HIDDEN"
|
|
328
|
+
}, kt = (s, n) => {
|
|
329
|
+
const a = Reflect.get(s.validation.value, n);
|
|
330
|
+
return typeof a == "object" && a !== null ? a : void 0;
|
|
331
|
+
}, Ct = (s) => {
|
|
332
|
+
var a, c;
|
|
333
|
+
const n = (a = s.individual) == null ? void 0 : a.name;
|
|
334
|
+
return (s.type === "ORGANIZATION" ? (c = s.organization) == null ? void 0 : c.legal_name : [n == null ? void 0 : n.first_name, n == null ? void 0 : n.infix, n == null ? void 0 : n.last_name].filter(Boolean).join(" ")) || s.reference;
|
|
335
|
+
}, J = (s, n) => {
|
|
336
|
+
var a;
|
|
337
|
+
return A(s) && s.statusCode === 400 && !!((a = s.field) != null && a.endsWith(n));
|
|
338
|
+
}, ie = (s) => {
|
|
339
|
+
if (!J(s, "promotion_codes") || !A(s)) return;
|
|
340
|
+
const n = /pricing_plan_subscriptions\.(\d+)\./.exec(s.field ?? "");
|
|
341
|
+
return n ? Number(n[1]) : -1;
|
|
342
|
+
}, ln = (s) => {
|
|
343
|
+
const n = s.pricing_plan_schedule_infos;
|
|
344
|
+
if (!(!(n != null && n.length) || !n.every(({ pricing_plan_version: a }) => a)))
|
|
345
|
+
return {
|
|
346
|
+
id: s.template_pricing_plan_subscription_id,
|
|
347
|
+
// The name the platform gave the session wins; the read's own may be the template's.
|
|
348
|
+
name: s.pricing_plan_subscription.name ?? s.name,
|
|
349
|
+
billing_period: s.billing_period,
|
|
350
|
+
billing_currency: s.billing_currency,
|
|
351
|
+
billing_entity_id: s.billing_entity_id,
|
|
352
|
+
billing_entity: s.billing_entity,
|
|
353
|
+
pricing_plan_schedule_infos: n
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
function dn({ portalUrlId: s }) {
|
|
357
|
+
const n = It(), { $t: a } = Nt(), c = Zs(), u = q(), l = q(), v = q([]), y = P(!1), S = P(!1), C = P(!1), m = p(() => {
|
|
358
|
+
var e;
|
|
359
|
+
return (e = u.value) == null ? void 0 : e.checkout_session;
|
|
360
|
+
}), I = p(
|
|
361
|
+
() => {
|
|
362
|
+
var e, t;
|
|
363
|
+
return ((e = u.value) == null ? void 0 : e.status) === "PUBLISHED" && ((t = m.value) == null ? void 0 : t.status) === "OPEN";
|
|
364
|
+
}
|
|
365
|
+
), M = p(
|
|
366
|
+
() => {
|
|
367
|
+
var e;
|
|
368
|
+
return !!m.value && (((e = l.value) == null ? void 0 : e.checkout_session.version) ?? -1) < m.value.version;
|
|
369
|
+
}
|
|
370
|
+
), O = p(() => {
|
|
371
|
+
var e, t;
|
|
372
|
+
return [
|
|
373
|
+
.../* @__PURE__ */ new Set([
|
|
374
|
+
...((e = m.value) == null ? void 0 : e.missing_fields) ?? [],
|
|
375
|
+
...M.value ? [] : ((t = l.value) == null ? void 0 : t.checkout_session.missing_fields) ?? []
|
|
376
|
+
])
|
|
377
|
+
];
|
|
378
|
+
}), k = p(
|
|
379
|
+
() => {
|
|
380
|
+
var e;
|
|
381
|
+
return Fs(O.value, ((e = m.value) == null ? void 0 : e.customers.length) ?? 0);
|
|
382
|
+
}
|
|
383
|
+
), T = (e) => {
|
|
384
|
+
var o;
|
|
385
|
+
const t = (o = m.value) == null ? void 0 : o.customers[e];
|
|
386
|
+
if (t)
|
|
387
|
+
return t.customer ? t.effective_display : un;
|
|
388
|
+
}, z = (e) => Is({
|
|
389
|
+
initialState: {},
|
|
390
|
+
// Every change is saved to the session, not only those that move the price.
|
|
391
|
+
onRequiredFieldChange: () => {
|
|
392
|
+
},
|
|
393
|
+
display: () => T(e),
|
|
394
|
+
alsoRequired: () => k.value[e] ?? [],
|
|
395
|
+
// A guess would be saved into the merchant's session as the customer's country.
|
|
396
|
+
guessCountry: !1
|
|
397
|
+
}), X = z(0), N = q([X]), xt = rs(), Dt = (e) => {
|
|
398
|
+
const t = xt.run(
|
|
399
|
+
() => Array.from(
|
|
400
|
+
{ length: e - N.value.length },
|
|
401
|
+
(o, i) => z(N.value.length + i)
|
|
402
|
+
)
|
|
403
|
+
);
|
|
404
|
+
t != null && t.length && (N.value = [...N.value, ...t]);
|
|
405
|
+
}, te = (e) => {
|
|
406
|
+
var i, r;
|
|
407
|
+
const t = (i = m.value) == null ? void 0 : i.pricing_plan_subscriptions[e], o = v.value[e];
|
|
408
|
+
if (t)
|
|
409
|
+
return Vs(
|
|
410
|
+
t,
|
|
411
|
+
o && ((r = xs({
|
|
412
|
+
pricingPlanScheduleInfos: o.pricing_plan_schedule_infos,
|
|
413
|
+
type: "DEFAULT"
|
|
414
|
+
})) == null ? void 0 : r.id)
|
|
415
|
+
);
|
|
416
|
+
}, K = p(
|
|
417
|
+
() => {
|
|
418
|
+
var e;
|
|
419
|
+
return (((e = m.value) == null ? void 0 : e.pricing_plan_subscriptions) ?? []).flatMap(
|
|
420
|
+
(t, o) => {
|
|
421
|
+
var i;
|
|
422
|
+
return ((i = t.options) == null ? void 0 : i.allow_promotion_codes) === "SINGLE" ? [o] : [];
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
), F = lt(/* @__PURE__ */ new Map()), Q = q([]), De = (e, t, o, i) => {
|
|
427
|
+
var r;
|
|
428
|
+
return ht(
|
|
429
|
+
(r = e.options) == null ? void 0 : r[i],
|
|
430
|
+
ft(e, t, o)
|
|
431
|
+
).values;
|
|
432
|
+
}, Me = (e) => {
|
|
433
|
+
var i;
|
|
434
|
+
const t = (i = m.value) == null ? void 0 : i.customers[e], o = N.value[e];
|
|
435
|
+
return t != null && t.customer && o ? Us(
|
|
436
|
+
o.form.value,
|
|
437
|
+
t.customer,
|
|
438
|
+
t.effective_display,
|
|
439
|
+
(r) => Reflect.get(kt(o, r) ?? {}, "$invalid") === !0
|
|
440
|
+
) : void 0;
|
|
441
|
+
}, Le = lt(/* @__PURE__ */ new Map()), Ae = (e, t) => Le.get(e) === JSON.stringify(t), Mt = (e, t) => {
|
|
442
|
+
if (!e) return;
|
|
443
|
+
const o = `customers.${t}`, { individual: i, organization: r, ...d } = e, _ = (h, b) => {
|
|
444
|
+
if (!h) return;
|
|
445
|
+
const x = rn(h, (L, D) => !Ae(`${b}.${L}`, D));
|
|
446
|
+
return Object.keys(x).length ? x : void 0;
|
|
447
|
+
}, g = _(i, `${o}.individual`), E = _(r, `${o}.organization`), f = {
|
|
448
|
+
..._(d, o),
|
|
449
|
+
...g && { individual: g },
|
|
450
|
+
...E && { organization: E }
|
|
451
|
+
};
|
|
452
|
+
return Object.keys(f).length ? f : void 0;
|
|
453
|
+
}, Lt = (e) => [
|
|
454
|
+
...(e.customers ?? []).flatMap(
|
|
455
|
+
(t, o) => Object.entries(t ?? {}).flatMap(
|
|
456
|
+
([i, r]) => i === "individual" || i === "organization" ? Object.entries(r ?? {}).map(([d, _]) => [
|
|
457
|
+
`customers.${o}.${i}.${d}`,
|
|
458
|
+
_
|
|
459
|
+
]) : [[`customers.${o}.${i}`, r]]
|
|
460
|
+
)
|
|
461
|
+
),
|
|
462
|
+
...(e.pricing_plan_subscriptions ?? []).flatMap(
|
|
463
|
+
(t, o) => (t ?? []).flatMap(
|
|
464
|
+
(i) => ["seats_values", "units"].flatMap(
|
|
465
|
+
(r) => (i[r] ?? []).map(
|
|
466
|
+
({ pricing_item_config_id: d, number: _ }) => [
|
|
467
|
+
`subs.${o}.${r}.${d}`,
|
|
468
|
+
_
|
|
469
|
+
]
|
|
470
|
+
)
|
|
471
|
+
)
|
|
472
|
+
)
|
|
473
|
+
)
|
|
474
|
+
], At = (e, t) => {
|
|
475
|
+
const [o, i, ...r] = (t ?? "").replace(/^checkout_session\./, "").split("."), d = o === "customers" && /^\d+$/.test(i ?? "") ? [["customers", i, ...r.slice(1, 3)].join("."), `customers.${i}`] : o === "pricing_plan_subscriptions" && /^\d+$/.test(i ?? "") ? [["subs", i, ...r.slice(2, 3)].join("."), `subs.${i}`] : [], _ = Lt(e), g = (f, h) => f === h || f.startsWith(`${h}.`), E = d.find(
|
|
476
|
+
(f) => _.some(([h]) => g(h, f))
|
|
477
|
+
);
|
|
478
|
+
for (const [f, h] of _)
|
|
479
|
+
(E === void 0 || g(f, E)) && Le.set(f, JSON.stringify(h));
|
|
480
|
+
}, ue = () => {
|
|
481
|
+
const e = m.value;
|
|
482
|
+
if (!e) return {};
|
|
483
|
+
const t = e.pricing_plan_subscriptions.map((o, i) => {
|
|
484
|
+
var E, f;
|
|
485
|
+
const r = te(i);
|
|
486
|
+
if (!r) return;
|
|
487
|
+
const d = {
|
|
488
|
+
pricing_plan_schedule_id: r
|
|
489
|
+
}, _ = Q.value[i];
|
|
490
|
+
if (_) {
|
|
491
|
+
const h = gt(
|
|
492
|
+
_.seatsValues.value,
|
|
493
|
+
(E = o.options) == null ? void 0 : E.edit_seats,
|
|
494
|
+
De(o, r, "seats_values", "edit_seats"),
|
|
495
|
+
{ wholeOnly: !0 }
|
|
496
|
+
), b = gt(
|
|
497
|
+
_.unitsValues.value,
|
|
498
|
+
(f = o.options) == null ? void 0 : f.edit_units,
|
|
499
|
+
De(o, r, "units", "edit_units"),
|
|
500
|
+
{ wholeOnly: !1 }
|
|
501
|
+
), x = (Y, G) => G == null ? void 0 : G.filter(
|
|
502
|
+
({ pricing_item_config_id: W, number: j }) => !Ae(`subs.${i}.${Y}.${W}`, j)
|
|
503
|
+
), L = x("seats_values", h), D = x("units", b);
|
|
504
|
+
L != null && L.length && (d.seats_values = L), D != null && D.length && (d.units = D);
|
|
505
|
+
}
|
|
506
|
+
const g = F.get(i);
|
|
507
|
+
if (g !== void 0 && K.value.includes(i)) {
|
|
508
|
+
const h = g ? [g] : null, b = yt(o, r);
|
|
509
|
+
((h == null ? void 0 : h[0]) ?? null) !== ((b == null ? void 0 : b[0]) ?? null) && (d.promotion_codes = h);
|
|
510
|
+
}
|
|
511
|
+
return Object.keys(d).length > 1 ? [d] : void 0;
|
|
512
|
+
});
|
|
513
|
+
return {
|
|
514
|
+
customers: N.value.map(
|
|
515
|
+
(o, i) => {
|
|
516
|
+
var r;
|
|
517
|
+
return Mt((r = Me(i)) == null ? void 0 : r.patch, i);
|
|
518
|
+
}
|
|
519
|
+
),
|
|
520
|
+
pricing_plan_subscriptions: t
|
|
521
|
+
};
|
|
522
|
+
}, le = (e) => {
|
|
523
|
+
const t = Ie(0, e);
|
|
524
|
+
return Js(t) ? "" : JSON.stringify(t);
|
|
525
|
+
}, de = p(() => m.value && I.value ? le(ue()) : ""), pe = P(), Rt = p(
|
|
526
|
+
() => !!de.value && de.value !== pe.value
|
|
527
|
+
);
|
|
528
|
+
let Re = !1;
|
|
529
|
+
const me = /* @__PURE__ */ new Set();
|
|
530
|
+
us(() => {
|
|
531
|
+
Re = !0, me.forEach(clearTimeout);
|
|
532
|
+
});
|
|
533
|
+
const _e = (e) => new Promise((t) => {
|
|
534
|
+
const o = setTimeout(() => {
|
|
535
|
+
me.delete(o), t();
|
|
536
|
+
}, e);
|
|
537
|
+
me.add(o);
|
|
538
|
+
}), ve = P(0), Ft = p(() => ve.value > 0), fe = P(!1), Fe = (e) => n.error("INVOICE_PREVIEW_FAILED", "Failed to preview the checkout session", {}, e), V = async ({ onFailure: e = Fe } = {}) => {
|
|
539
|
+
var t;
|
|
540
|
+
ve.value++;
|
|
541
|
+
try {
|
|
542
|
+
for (let o = 0; o < Qs; o++) {
|
|
543
|
+
o > 0 && await _e(en * 2 ** (o - 1));
|
|
544
|
+
const i = await c.previewCheckoutSession(s);
|
|
545
|
+
if ((!l.value || i.checkout_session.version >= l.value.checkout_session.version) && (l.value = i), fe.value = !1, i.checkout_session.version >= (((t = m.value) == null ? void 0 : t.version) ?? 0)) return;
|
|
546
|
+
}
|
|
547
|
+
} catch (o) {
|
|
548
|
+
fe.value = !0, e(o);
|
|
549
|
+
} finally {
|
|
550
|
+
ve.value--;
|
|
551
|
+
}
|
|
552
|
+
}, Ut = (e, t, o, i) => {
|
|
553
|
+
var g, E;
|
|
554
|
+
const r = _t(ae(t)), d = _t(ae((E = (g = m.value) == null ? void 0 : g.customers[e]) == null ? void 0 : E.customer)), _ = N.value[e].form.value;
|
|
555
|
+
for (const f of an) {
|
|
556
|
+
const h = _[f] === o[f], b = i.includes(f) || o[f] === r[f];
|
|
557
|
+
h && b && _[f] !== d[f] && cn(_, d, f);
|
|
558
|
+
}
|
|
559
|
+
}, Ue = (e) => N.value.map((t, o) => {
|
|
560
|
+
var i, r, d;
|
|
561
|
+
return {
|
|
562
|
+
before: (r = (i = m.value) == null ? void 0 : i.customers[o]) == null ? void 0 : r.customer,
|
|
563
|
+
form: { ...t.form.value },
|
|
564
|
+
fields: e ? ((d = Me(o)) == null ? void 0 : d.fields) ?? [] : []
|
|
565
|
+
};
|
|
566
|
+
}), $e = (e) => e.forEach(
|
|
567
|
+
({ before: t, form: o, fields: i }, r) => Ut(r, t, o, i)
|
|
568
|
+
), $t = async () => {
|
|
569
|
+
if (!m.value || !I.value) return;
|
|
570
|
+
const e = ue(), t = le(e);
|
|
571
|
+
if (!t || t === pe.value) return;
|
|
572
|
+
const o = Ue(!0), i = new Map(F);
|
|
573
|
+
y.value = !0;
|
|
574
|
+
try {
|
|
575
|
+
try {
|
|
576
|
+
u.value = await c.updateCheckoutSession(
|
|
577
|
+
s,
|
|
578
|
+
Ie(m.value.version, e)
|
|
579
|
+
);
|
|
580
|
+
} catch (r) {
|
|
581
|
+
if (!J(r, "expected_version")) throw r;
|
|
582
|
+
if (u.value = await c.getCheckoutSession(s), !I.value) return;
|
|
583
|
+
u.value = await c.updateCheckoutSession(
|
|
584
|
+
s,
|
|
585
|
+
Ie(u.value.checkout_session.version, e)
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
$e(o);
|
|
589
|
+
for (const [r, d] of i)
|
|
590
|
+
F.get(r) === d && F.delete(r);
|
|
591
|
+
le(ue()) === t && (pe.value = t, n.warn(
|
|
592
|
+
"CHECKOUT_SESSION_EDIT_NOT_APPLIED",
|
|
593
|
+
"The checkout session was saved but kept a value the customer changed"
|
|
594
|
+
));
|
|
595
|
+
} catch (r) {
|
|
596
|
+
throw A(r) && r.statusCode === 400 && !J(r, "expected_version") && ie(r) === void 0 && At(e, r.field), Ht(r), r;
|
|
597
|
+
} finally {
|
|
598
|
+
y.value = !1;
|
|
599
|
+
}
|
|
600
|
+
await V();
|
|
601
|
+
};
|
|
602
|
+
let Ve = Promise.resolve();
|
|
603
|
+
const he = () => {
|
|
604
|
+
const e = Ve.then($t);
|
|
605
|
+
return Ve = e.catch(() => {
|
|
606
|
+
}), e;
|
|
607
|
+
}, He = (e) => A(e) && e.statusCode === 400;
|
|
608
|
+
let se = 0, ge = !1;
|
|
609
|
+
const Vt = (e) => {
|
|
610
|
+
!(!A(e) || e.statusCode >= 500) || ge || se >= Ot.length || (ge = !0, _e(Ot[se++]).then(() => (ge = !1, ye())));
|
|
611
|
+
}, ye = () => he().then(
|
|
612
|
+
() => {
|
|
613
|
+
se = 0;
|
|
614
|
+
},
|
|
615
|
+
(e) => {
|
|
616
|
+
if (Vt(e), He(e)) {
|
|
617
|
+
n.warn(
|
|
618
|
+
"CHECKOUT_SESSION_UPDATE_REFUSED",
|
|
619
|
+
"The API refused a change to the checkout session",
|
|
620
|
+
{ field: A(e) ? e.field : void 0 },
|
|
621
|
+
e
|
|
622
|
+
);
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
n.error(
|
|
626
|
+
"CHECKOUT_SESSION_UPDATE_FAILED",
|
|
627
|
+
"Failed to save the checkout session",
|
|
628
|
+
{},
|
|
629
|
+
e
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
Ps(
|
|
634
|
+
() => de.value,
|
|
635
|
+
() => {
|
|
636
|
+
se = 0, ye();
|
|
637
|
+
},
|
|
638
|
+
{ debounce: Xs }
|
|
639
|
+
);
|
|
640
|
+
const je = /* @__PURE__ */ new Map(), ne = (e) => {
|
|
641
|
+
let t = je.get(e);
|
|
642
|
+
return t || (t = { code: P(null), isPending: P(!1), errorMessage: P(null) }, je.set(e, t)), t;
|
|
643
|
+
}, ze = (e) => {
|
|
644
|
+
var o, i;
|
|
645
|
+
const t = (o = m.value) == null ? void 0 : o.pricing_plan_subscriptions[e];
|
|
646
|
+
return t ? ((i = yt(t, te(e))) == null ? void 0 : i[0]) ?? null : null;
|
|
647
|
+
};
|
|
648
|
+
ee(m, () => {
|
|
649
|
+
for (const e of K.value) {
|
|
650
|
+
const t = ne(e);
|
|
651
|
+
t.isPending.value || (t.code.value = ze(e));
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
const Ke = (e) => a(e === "apply" ? {
|
|
655
|
+
defaultMessage: "Promotion code could not be applied. Please try again.",
|
|
656
|
+
id: "checkout.promotion_code.apply_failed",
|
|
657
|
+
description: "Error message when applying a promotion code in checkout failed"
|
|
658
|
+
} : {
|
|
659
|
+
defaultMessage: "Promotion code could not be removed. Please try again.",
|
|
660
|
+
id: "checkout.promotion_code.remove_failed",
|
|
661
|
+
description: "Error message when removing a promotion code in checkout failed"
|
|
662
|
+
});
|
|
663
|
+
function Ht(e) {
|
|
664
|
+
const t = ie(e);
|
|
665
|
+
if (t !== void 0)
|
|
666
|
+
for (const [o, i] of [...F])
|
|
667
|
+
t !== -1 && t !== o || (F.delete(o), ne(o).errorMessage.value = i ? a({
|
|
668
|
+
defaultMessage: "This promotion code is not valid.",
|
|
669
|
+
id: "checkout_session.promotion_code.rejected",
|
|
670
|
+
description: "Error shown under the promotion code field when the code the customer entered was not accepted"
|
|
671
|
+
}) : Ke("remove"), n.warn(
|
|
672
|
+
"PROMOTION_CODE_REJECTED",
|
|
673
|
+
"The promotion code was not accepted",
|
|
674
|
+
{},
|
|
675
|
+
e
|
|
676
|
+
));
|
|
677
|
+
}
|
|
678
|
+
const Be = async (e, t, o) => {
|
|
679
|
+
const i = ne(e);
|
|
680
|
+
F.set(e, t), i.errorMessage.value = null, i.isPending.value = !0;
|
|
681
|
+
try {
|
|
682
|
+
for (let r = 0; ; r++)
|
|
683
|
+
try {
|
|
684
|
+
await he();
|
|
685
|
+
break;
|
|
686
|
+
} catch (d) {
|
|
687
|
+
const _ = ie(d);
|
|
688
|
+
if (!(_ !== void 0 && _ !== -1 && _ !== e) || r >= K.value.length)
|
|
689
|
+
throw d;
|
|
690
|
+
}
|
|
691
|
+
} catch (r) {
|
|
692
|
+
ie(r) === void 0 && (He(r) ? n.warn(
|
|
693
|
+
"CHECKOUT_SESSION_UPDATE_REFUSED",
|
|
694
|
+
"The API refused a change to the checkout session",
|
|
695
|
+
{ field: A(r) ? r.field : void 0 },
|
|
696
|
+
r
|
|
697
|
+
) : n.capture(r, {
|
|
698
|
+
code: o === "apply" ? "PROMOTION_CODE_APPLY_FAILED" : "PROMOTION_CODE_REMOVE_FAILED",
|
|
699
|
+
message: "Failed to change the promotion code of the checkout session"
|
|
700
|
+
}), i.errorMessage.value = Ke(o)), F.delete(e), ye();
|
|
701
|
+
} finally {
|
|
702
|
+
i.isPending.value = !1, i.code.value = ze(e);
|
|
703
|
+
}
|
|
704
|
+
}, Ye = (e) => {
|
|
705
|
+
const t = () => ne(e());
|
|
706
|
+
return {
|
|
707
|
+
isAllowed: p(() => I.value && e() !== -1),
|
|
708
|
+
code: p({
|
|
709
|
+
get: () => t().code.value,
|
|
710
|
+
set: (o) => t().code.value = o
|
|
711
|
+
}),
|
|
712
|
+
isPending: p(() => t().isPending.value),
|
|
713
|
+
errorMessage: p({
|
|
714
|
+
get: () => t().errorMessage.value,
|
|
715
|
+
set: (o) => t().errorMessage.value = o
|
|
716
|
+
}),
|
|
717
|
+
apply: (o) => {
|
|
718
|
+
const i = o == null ? void 0 : o.trim();
|
|
719
|
+
return i ? Be(e(), i, "apply") : void 0;
|
|
720
|
+
},
|
|
721
|
+
remove: () => Be(e(), null, "remove")
|
|
722
|
+
};
|
|
723
|
+
}, Ge = p(
|
|
724
|
+
() => K.value.length === 1 ? K.value[0] : -1
|
|
725
|
+
), jt = (e) => {
|
|
726
|
+
v.value = e.checkout_session.pricing_plan_subscriptions.map((t) => {
|
|
727
|
+
const o = ln(t);
|
|
728
|
+
return o || n.error(
|
|
729
|
+
"SUBSCRIPTION_LOAD_FAILED",
|
|
730
|
+
"A checkout session subscription came without its plan",
|
|
731
|
+
{}
|
|
732
|
+
), o;
|
|
733
|
+
});
|
|
734
|
+
}, zt = () => {
|
|
735
|
+
const e = m.value, t = (e == null ? void 0 : e.pricing_plan_subscriptions) ?? [];
|
|
736
|
+
Q.value = t.map((o, i) => {
|
|
737
|
+
const r = v.value[i], d = te(i);
|
|
738
|
+
if (!r) return;
|
|
739
|
+
const _ = (h, b) => {
|
|
740
|
+
var x;
|
|
741
|
+
return ht(
|
|
742
|
+
(x = o.options) == null ? void 0 : x[b],
|
|
743
|
+
d ? ft(o, d, h) : []
|
|
744
|
+
);
|
|
745
|
+
}, g = _("seats_values", "edit_seats"), E = _("units", "edit_units"), f = K.value.includes(i) && Ge.value === -1;
|
|
746
|
+
return {
|
|
747
|
+
key: `${i}`,
|
|
748
|
+
subscription: r,
|
|
749
|
+
...t.length > 1 && {
|
|
750
|
+
title: Ds({
|
|
751
|
+
subscription: r,
|
|
752
|
+
fallback: a({
|
|
753
|
+
defaultMessage: "Subscription",
|
|
754
|
+
description: "The fallback name for when no subscription name can be determined",
|
|
755
|
+
id: "customer_overview.subscriptions_block.fallback_subscription_name"
|
|
756
|
+
})
|
|
757
|
+
})
|
|
758
|
+
},
|
|
759
|
+
seatsValues: P(g.values),
|
|
760
|
+
unitsValues: P(E.values),
|
|
761
|
+
minimums: { seatsValues: g.minimums, unitsValues: E.minimums },
|
|
762
|
+
maximums: { seatsValues: g.maximums, unitsValues: E.maximums },
|
|
763
|
+
editableConfigIds: [...g.minimums, ...E.minimums].map(
|
|
764
|
+
({ pricing_item_config_id: h }) => h
|
|
765
|
+
),
|
|
766
|
+
...f && { promotionCode: Ye(() => i) }
|
|
767
|
+
};
|
|
768
|
+
}), N.value.forEach(
|
|
769
|
+
(o, i) => {
|
|
770
|
+
var r;
|
|
771
|
+
return o.updateInitialState(ae((r = e == null ? void 0 : e.customers[i]) == null ? void 0 : r.customer));
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
}, Kt = p(() => {
|
|
775
|
+
const e = /* @__PURE__ */ new Map();
|
|
776
|
+
return v.value.forEach((t, o) => {
|
|
777
|
+
if (!t) return;
|
|
778
|
+
const i = te(o), r = {
|
|
779
|
+
scheduleInfo: t.pricing_plan_schedule_infos.find(({ id: d }) => d === i),
|
|
780
|
+
billingPeriod: t.billing_period
|
|
781
|
+
};
|
|
782
|
+
e.set(JSON.stringify([r.scheduleInfo, t.billing_period]), r);
|
|
783
|
+
}), [...e.values()];
|
|
784
|
+
}), B = P(!1);
|
|
785
|
+
ee([B, k], () => {
|
|
786
|
+
B.value && N.value.forEach((e, t) => {
|
|
787
|
+
for (const o of k.value[t] ?? []) {
|
|
788
|
+
const i = Reflect.get(kt(e, o) ?? {}, "$touch");
|
|
789
|
+
typeof i == "function" && i();
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
});
|
|
793
|
+
const We = p(() => {
|
|
794
|
+
if (!u.value) return;
|
|
795
|
+
if (I.value) return C.value ? "PROCESSING" : void 0;
|
|
796
|
+
const { status: e } = u.value.checkout_session;
|
|
797
|
+
return e === "OPEN" ? "CLOSED" : e;
|
|
798
|
+
}), qe = (e) => e == null ? void 0 : e.replaceAll(tn, encodeURIComponent(s)), Je = p(() => {
|
|
799
|
+
var e;
|
|
800
|
+
return qe((e = m.value) == null ? void 0 : e.success_url);
|
|
801
|
+
}), Ze = P(!1), { dispatch: Bt, componentName: Yt } = bs(), Xe = P(!1);
|
|
802
|
+
let Qe = !1;
|
|
803
|
+
ee(
|
|
804
|
+
We,
|
|
805
|
+
(e) => {
|
|
806
|
+
const t = e === "COMPLETED" && !Xe.value ? vt(Je.value ?? "") : "";
|
|
807
|
+
Ze.value = !!t, t && Ls(t);
|
|
808
|
+
},
|
|
809
|
+
{ immediate: !0 }
|
|
810
|
+
);
|
|
811
|
+
const Gt = async () => {
|
|
812
|
+
var o;
|
|
813
|
+
let e;
|
|
814
|
+
const [t] = await Promise.all([
|
|
815
|
+
c.getCheckoutSession(s, { expanded: !0 }),
|
|
816
|
+
V({ onFailure: (i) => e = i })
|
|
817
|
+
]);
|
|
818
|
+
if (e !== void 0 && Fe(e), t.status !== "PUBLISHED" || t.checkout_session.status !== "OPEN") {
|
|
819
|
+
u.value = t, t.checkout_session.status === "PROCESSING" && Ce({ isPaid: !0, isRead: !0 });
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
jt(t), Dt(t.checkout_session.customers.length), u.value = t, zt(), B.value = !0, (((o = l.value) == null ? void 0 : o.checkout_session.version) ?? -1) < t.checkout_session.version && await V();
|
|
823
|
+
}, Ee = q();
|
|
824
|
+
ls(async () => {
|
|
825
|
+
try {
|
|
826
|
+
await Gt();
|
|
827
|
+
} catch (e) {
|
|
828
|
+
Ee.value = A(e) && e.statusCode === 410 ? {
|
|
829
|
+
reason: ys[e.errorCode ?? ""] ?? "expired",
|
|
830
|
+
status: e.checkoutSessionStatus
|
|
831
|
+
} : {}, n.error(
|
|
832
|
+
"CHECKOUT_SESSION_LOAD_FAILED",
|
|
833
|
+
"Failed to load the checkout session",
|
|
834
|
+
{},
|
|
835
|
+
e
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
const H = p(
|
|
840
|
+
() => {
|
|
841
|
+
var e, t, o;
|
|
842
|
+
return (o = (t = (e = l.value) == null ? void 0 : e.invoices) == null ? void 0 : t[0]) == null ? void 0 : o.invoice;
|
|
843
|
+
}
|
|
844
|
+
), Wt = p(() => {
|
|
845
|
+
var o, i, r, d, _, g, E, f, h, b, x, L;
|
|
846
|
+
const e = (r = (i = (o = l.value) == null ? void 0 : o.invoices) == null ? void 0 : i[0]) == null ? void 0 : r.pricing_plan_subscription_references;
|
|
847
|
+
if (!e || e.length < 2) return;
|
|
848
|
+
const t = /* @__PURE__ */ new Map();
|
|
849
|
+
for (const D of e) {
|
|
850
|
+
const Y = (g = (_ = (d = l.value) == null ? void 0 : d.per_subscription) == null ? void 0 : _.find((U) => U.pricing_plan_subscription_reference === D)) == null ? void 0 : g.invoice_infos.flatMap((U) => U.invoices.slice(0, 1)), G = ((E = m.value) == null ? void 0 : E.pricing_plan_subscriptions.findIndex(
|
|
851
|
+
(U) => U.pricing_plan_subscription.reference === D
|
|
852
|
+
)) ?? -1, W = (h = (f = m.value) == null ? void 0 : f.pricing_plan_subscriptions[G]) == null ? void 0 : h.pricing_plan_subscription;
|
|
853
|
+
if (!(Y != null && Y.length) || !W) return;
|
|
854
|
+
const j = W.customer_reference ?? W.customer_id ?? D, ct = (x = (b = m.value) == null ? void 0 : b.customers.find(
|
|
855
|
+
(U) => {
|
|
856
|
+
var ut;
|
|
857
|
+
return ((ut = U.customer) == null ? void 0 : ut.reference) === j || U.customer_id === j;
|
|
858
|
+
}
|
|
859
|
+
)) == null ? void 0 : x.customer, be = t.get(j) ?? {
|
|
860
|
+
key: j,
|
|
861
|
+
title: ct ? Ct(ct) : W.name ?? D,
|
|
862
|
+
invoices: [],
|
|
863
|
+
subscriptions: []
|
|
864
|
+
};
|
|
865
|
+
be.invoices.push(...Y);
|
|
866
|
+
const rt = (L = Q.value[G]) == null ? void 0 : L.subscription;
|
|
867
|
+
rt && be.subscriptions.push(rt), t.set(j, be);
|
|
868
|
+
}
|
|
869
|
+
return t.size > 1 ? [...t.values()] : void 0;
|
|
870
|
+
}), qt = ee(l, (e) => {
|
|
871
|
+
var t, o;
|
|
872
|
+
(((t = e == null ? void 0 : e.invoices) == null ? void 0 : t.length) ?? 0) <= 1 || (n.warn(
|
|
873
|
+
"CHECKOUT_SESSION_SEVERAL_INVOICES",
|
|
874
|
+
"The checkout session previewed several invoices; only the first is shown",
|
|
875
|
+
{ count: (o = e == null ? void 0 : e.invoices) == null ? void 0 : o.length }
|
|
876
|
+
), qt());
|
|
877
|
+
}), et = p(() => {
|
|
878
|
+
var t;
|
|
879
|
+
const e = (t = l.value) == null ? void 0 : t.total;
|
|
880
|
+
return e ? { quantity: e.amount_incl_tax, currency: e.currency } : void 0;
|
|
881
|
+
}), tt = p(
|
|
882
|
+
() => H.value ? Ms(H.value) : void 0
|
|
883
|
+
), Jt = p(() => {
|
|
884
|
+
var t;
|
|
885
|
+
const e = tt.value;
|
|
886
|
+
if (e)
|
|
887
|
+
return e.hasOneOff ? e.hasUnattributed ? void 0 : e.recurring.includingTax : (t = H.value) == null ? void 0 : t.invoice_amount_including_tax;
|
|
888
|
+
}), Se = p(() => Rt.value || M.value), Zt = p(
|
|
889
|
+
() => I.value && !!et.value && !Se.value && O.value.length === 0
|
|
890
|
+
), Xt = async () => {
|
|
891
|
+
try {
|
|
892
|
+
await he();
|
|
893
|
+
} catch {
|
|
894
|
+
return "FAILED";
|
|
895
|
+
}
|
|
896
|
+
return M.value && await V(), Se.value ? "CHANGED" : "SETTLED";
|
|
897
|
+
}, {
|
|
898
|
+
paymentMethodOptions: st,
|
|
899
|
+
get: Qt,
|
|
900
|
+
isPending: es,
|
|
901
|
+
error: ts
|
|
902
|
+
} = ws(), Oe = P(), nt = () => {
|
|
903
|
+
var e, t;
|
|
904
|
+
return JSON.stringify([oe.value, (t = (e = H.value) == null ? void 0 : e.billing_entity) == null ? void 0 : t.id]);
|
|
905
|
+
};
|
|
906
|
+
let ot = 0;
|
|
907
|
+
const ke = () => {
|
|
908
|
+
const e = nt(), t = ++ot;
|
|
909
|
+
return Qt({ portalUrlId: s }, { fresh: !0 }).then(
|
|
910
|
+
() => {
|
|
911
|
+
t === ot && (Oe.value = e);
|
|
912
|
+
},
|
|
913
|
+
(o) => {
|
|
914
|
+
n.error(
|
|
915
|
+
"PAYMENT_METHOD_OPTIONS_LOAD_FAILED",
|
|
916
|
+
"Failed to load the payment methods that can be offered",
|
|
917
|
+
{ flow: "CHECKOUT_SESSION" },
|
|
918
|
+
o
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}, ss = p(
|
|
923
|
+
() => ts.value !== null && !(st.value.length && Oe.value === nt())
|
|
924
|
+
), ns = async (e) => {
|
|
925
|
+
try {
|
|
926
|
+
const t = await c.getCheckoutSession(s);
|
|
927
|
+
e && t.checkout_session.status === "COMPLETED" && !Qe && (Qe = !0, Xe.value = !Bt("solvimon-payment-succeeded", {
|
|
928
|
+
componentName: Yt
|
|
929
|
+
})), (t.status !== "PUBLISHED" || t.checkout_session.status !== "OPEN") && (u.value = t);
|
|
930
|
+
const { status: o } = t.checkout_session;
|
|
931
|
+
return o === "COMPLETED" || o === "FAILED" || t.status !== "PUBLISHED";
|
|
932
|
+
} catch (t) {
|
|
933
|
+
return n.warn(
|
|
934
|
+
"CHECKOUT_SESSION_COMPLETION_CHECK_FAILED",
|
|
935
|
+
"Failed to read the checkout session while waiting for it to complete",
|
|
936
|
+
{},
|
|
937
|
+
t
|
|
938
|
+
), !1;
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
let it = 0;
|
|
942
|
+
const Ce = async ({
|
|
943
|
+
isPaid: e,
|
|
944
|
+
isRead: t = !1
|
|
945
|
+
}) => {
|
|
946
|
+
const o = ++it, i = () => !Re && o === it;
|
|
947
|
+
let r = 0;
|
|
948
|
+
for (let d = 0; i(); d++) {
|
|
949
|
+
if ((d > 0 || !t) && await ns(e)) return;
|
|
950
|
+
const _ = Math.min(
|
|
951
|
+
sn * 2 ** d,
|
|
952
|
+
nn
|
|
953
|
+
);
|
|
954
|
+
if (!i() || r + _ > on) break;
|
|
955
|
+
r += _, await _e(_);
|
|
956
|
+
}
|
|
957
|
+
e && i() && (C.value = !0);
|
|
958
|
+
}, os = async () => {
|
|
959
|
+
try {
|
|
960
|
+
const e = Ue(!1);
|
|
961
|
+
u.value = await c.getCheckoutSession(s), $e(e);
|
|
962
|
+
} catch (e) {
|
|
963
|
+
n.error(
|
|
964
|
+
"CHECKOUT_SESSION_LOAD_FAILED",
|
|
965
|
+
"Failed to load the checkout session",
|
|
966
|
+
{},
|
|
967
|
+
e
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
await V();
|
|
971
|
+
}, is = (e) => {
|
|
972
|
+
const t = [e == null ? void 0 : e.apiError, e == null ? void 0 : e.error].find(A);
|
|
973
|
+
if (t) {
|
|
974
|
+
if (J(t, "checkout_session.status")) {
|
|
975
|
+
Ce({ isPaid: !1 });
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
if (t.statusCode === 409) {
|
|
979
|
+
os();
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
if (J(t, "payment_acceptor_id")) {
|
|
983
|
+
Oe.value = void 0, ke();
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (J(t, "checkout_session.version"))
|
|
987
|
+
return V(), "PRICE_CHANGED";
|
|
988
|
+
}
|
|
989
|
+
}, at = p(() => {
|
|
990
|
+
var i, r, d, _, g, E, f;
|
|
991
|
+
const e = (r = (i = l.value) == null ? void 0 : i.invoices) == null ? void 0 : r[0], t = ((_ = (d = m.value) == null ? void 0 : d.payment) == null ? void 0 : _.customer_reference) ?? (e == null ? void 0 : e.customer_reference), o = ((E = (g = m.value) == null ? void 0 : g.payment) == null ? void 0 : E.customer_id) ?? (e == null ? void 0 : e.customer_id);
|
|
992
|
+
return (f = m.value) == null ? void 0 : f.customers.find(
|
|
993
|
+
(h) => {
|
|
994
|
+
var b;
|
|
995
|
+
return !!t && ((b = h.customer) == null ? void 0 : b.reference) === t || !!o && h.customer_id === o;
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
}), oe = p(() => {
|
|
999
|
+
var r, d, _, g, E;
|
|
1000
|
+
const e = at.value, t = e == null ? void 0 : e.customer;
|
|
1001
|
+
if (t) {
|
|
1002
|
+
const f = ((r = t.organization) == null ? void 0 : r.registered_address) ?? ((d = t.individual) == null ? void 0 : d.residential_address);
|
|
1003
|
+
return (f == null ? void 0 : f.country) || void 0;
|
|
1004
|
+
}
|
|
1005
|
+
if (!e) return;
|
|
1006
|
+
const o = (_ = H.value) == null ? void 0 : _.customer;
|
|
1007
|
+
if (!o) return;
|
|
1008
|
+
const i = "organization" in o ? (g = o.organization) == null ? void 0 : g.registered_address : (E = o.individual) == null ? void 0 : E.residential_address;
|
|
1009
|
+
return (i == null ? void 0 : i.country) || void 0;
|
|
1010
|
+
}), as = p(() => {
|
|
1011
|
+
var o;
|
|
1012
|
+
const e = at.value;
|
|
1013
|
+
if (e && !e.customer) return oe.value;
|
|
1014
|
+
const t = N.value[e ? ((o = m.value) == null ? void 0 : o.customers.indexOf(e)) ?? 0 : 0];
|
|
1015
|
+
return (t == null ? void 0 : t.form.value.country) || oe.value;
|
|
1016
|
+
});
|
|
1017
|
+
ee(
|
|
1018
|
+
[
|
|
1019
|
+
B,
|
|
1020
|
+
I,
|
|
1021
|
+
oe,
|
|
1022
|
+
() => {
|
|
1023
|
+
var e, t;
|
|
1024
|
+
return (t = (e = H.value) == null ? void 0 : e.billing_entity) == null ? void 0 : t.id;
|
|
1025
|
+
},
|
|
1026
|
+
() => {
|
|
1027
|
+
var e, t;
|
|
1028
|
+
return (t = (e = l.value) == null ? void 0 : e.total) == null ? void 0 : t.amount_incl_tax;
|
|
1029
|
+
},
|
|
1030
|
+
() => {
|
|
1031
|
+
var e, t;
|
|
1032
|
+
return (t = (e = l.value) == null ? void 0 : e.total) == null ? void 0 : t.currency;
|
|
1033
|
+
}
|
|
1034
|
+
],
|
|
1035
|
+
() => {
|
|
1036
|
+
B.value && I.value && ke();
|
|
1037
|
+
}
|
|
1038
|
+
);
|
|
1039
|
+
const cs = {
|
|
1040
|
+
paymentMethodOptions: st,
|
|
1041
|
+
isPaymentMethodsPending: es,
|
|
1042
|
+
hasPaymentMethodOptionsError: ss,
|
|
1043
|
+
retryPaymentMethodOptions: () => void ke(),
|
|
1044
|
+
countryCode: as,
|
|
1045
|
+
authorizationContext: p(
|
|
1046
|
+
() => l.value ? {
|
|
1047
|
+
type: "CHECKOUT_SESSION",
|
|
1048
|
+
checkout_session: {
|
|
1049
|
+
portal_url_id: s,
|
|
1050
|
+
version: l.value.checkout_session.version
|
|
1051
|
+
}
|
|
1052
|
+
} : void 0
|
|
1053
|
+
),
|
|
1054
|
+
awaitCompletion: () => void Ce({ isPaid: !0 }),
|
|
1055
|
+
recoverPaymentFailure: is
|
|
1056
|
+
};
|
|
1057
|
+
return {
|
|
1058
|
+
source: {
|
|
1059
|
+
// The first section's copy, under the name the session gives it.
|
|
1060
|
+
subscription: p(() => {
|
|
1061
|
+
var e;
|
|
1062
|
+
return ((e = Q.value[0]) == null ? void 0 : e.subscription) ?? v.value[0];
|
|
1063
|
+
}),
|
|
1064
|
+
// An order shown without one of its plans would ask payment for what it does not show.
|
|
1065
|
+
hasSubscriptionLoadFailed: p(
|
|
1066
|
+
() => !!Ee.value || B.value && v.value.some((e) => !e)
|
|
1067
|
+
),
|
|
1068
|
+
orderMeterValues: p(() => ({})),
|
|
1069
|
+
chargedSchedules: Kt,
|
|
1070
|
+
planCustomizations: p(
|
|
1071
|
+
() => Q.value.filter((e) => e !== void 0)
|
|
1072
|
+
),
|
|
1073
|
+
checkoutForm: X,
|
|
1074
|
+
customerForms: p(() => {
|
|
1075
|
+
var o;
|
|
1076
|
+
const e = ((o = m.value) == null ? void 0 : o.customers) ?? [], t = e.filter(
|
|
1077
|
+
({ effective_display: i }) => !Object.values(i).every((r) => r === "HIDDEN")
|
|
1078
|
+
);
|
|
1079
|
+
return e.flatMap((i, r) => {
|
|
1080
|
+
const d = N.value[r];
|
|
1081
|
+
return !i.customer || !d || !t.includes(i) ? [] : [
|
|
1082
|
+
{
|
|
1083
|
+
key: `${r}`,
|
|
1084
|
+
form: d,
|
|
1085
|
+
display: i.effective_display,
|
|
1086
|
+
isTypeLocked: !0,
|
|
1087
|
+
...t.length > 1 && { title: Ct(i.customer) }
|
|
1088
|
+
}
|
|
1089
|
+
];
|
|
1090
|
+
});
|
|
1091
|
+
}),
|
|
1092
|
+
isShippingAddressRequired: !1,
|
|
1093
|
+
invoicePreview: H,
|
|
1094
|
+
invoiceSections: Wt,
|
|
1095
|
+
invoicePreviewByBillingPeriod: p(() => ({})),
|
|
1096
|
+
trialInvoicePreview: p(() => {
|
|
1097
|
+
}),
|
|
1098
|
+
trialPeriod: p(() => {
|
|
1099
|
+
}),
|
|
1100
|
+
isInvoicePreviewPending: p(() => Ft.value || y.value),
|
|
1101
|
+
isInvoicePreviewStale: Se,
|
|
1102
|
+
isInvoicePreviewFailed: fe,
|
|
1103
|
+
loadInvoicePreview: () => V(),
|
|
1104
|
+
settleInvoicePreview: Xt,
|
|
1105
|
+
amount: et,
|
|
1106
|
+
recurringAmount: Jt,
|
|
1107
|
+
hasOneOffCharges: p(() => {
|
|
1108
|
+
var e;
|
|
1109
|
+
return ((e = tt.value) == null ? void 0 : e.hasOneOff) ?? !1;
|
|
1110
|
+
}),
|
|
1111
|
+
pricingCurrency: p(() => {
|
|
1112
|
+
var e, t;
|
|
1113
|
+
return (t = (e = l.value) == null ? void 0 : e.total) == null ? void 0 : t.currency;
|
|
1114
|
+
}),
|
|
1115
|
+
promotionCode: Ye(() => Ge.value),
|
|
1116
|
+
payment: cs,
|
|
1117
|
+
canPay: Zt,
|
|
1118
|
+
isPaid: S,
|
|
1119
|
+
successUrl: Je,
|
|
1120
|
+
cancelUrl: p(
|
|
1121
|
+
() => {
|
|
1122
|
+
var e;
|
|
1123
|
+
return vt(qe((e = m.value) == null ? void 0 : e.cancel_url) ?? "") || void 0;
|
|
1124
|
+
}
|
|
1125
|
+
),
|
|
1126
|
+
note: p(() => {
|
|
1127
|
+
var e;
|
|
1128
|
+
return (e = m.value) == null ? void 0 : e.note;
|
|
1129
|
+
})
|
|
1130
|
+
},
|
|
1131
|
+
/** What the screen that lists every customer and subscription reads. */
|
|
1132
|
+
portalUrl: u,
|
|
1133
|
+
session: m,
|
|
1134
|
+
preview: l,
|
|
1135
|
+
plans: v,
|
|
1136
|
+
isOpen: I,
|
|
1137
|
+
missingFields: O,
|
|
1138
|
+
endState: We,
|
|
1139
|
+
isRedirecting: Ze,
|
|
1140
|
+
loadFailure: Ee
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
const pn = { class: "sv-checkout-ended flex min-h-96 w-full items-center justify-center" }, mn = { class: "max-w-sm" }, Te = /* @__PURE__ */ xe({
|
|
1144
|
+
__name: "CheckoutSessionEnded",
|
|
1145
|
+
props: {
|
|
1146
|
+
reason: { type: String },
|
|
1147
|
+
status: { type: String },
|
|
1148
|
+
isRedirecting: { type: Boolean }
|
|
1149
|
+
},
|
|
1150
|
+
setup(s) {
|
|
1151
|
+
const n = s, { $t: a } = Nt(), c = () => a({
|
|
1152
|
+
defaultMessage: "Contact customer support if you think this is a mistake.",
|
|
1153
|
+
description: "Shown below the notice that an element is no longer available",
|
|
1154
|
+
id: "portal.not_available.description"
|
|
1155
|
+
}), u = p(() => n.status === "COMPLETED" ? {
|
|
1156
|
+
title: a({
|
|
1157
|
+
defaultMessage: "This checkout has been completed",
|
|
1158
|
+
id: "checkout_session.ended.completed_title",
|
|
1159
|
+
description: "Shown in place of a checkout that the customer already paid for"
|
|
1160
|
+
}),
|
|
1161
|
+
message: n.isRedirecting ? a({
|
|
1162
|
+
defaultMessage: "Taking you back…",
|
|
1163
|
+
id: "checkout_session.ended.redirecting_message",
|
|
1164
|
+
description: "Shown under the completed checkout notice while the page goes to the shop"
|
|
1165
|
+
}) : void 0
|
|
1166
|
+
} : n.status === "FAILED" ? {
|
|
1167
|
+
title: a({
|
|
1168
|
+
defaultMessage: "We received your payment",
|
|
1169
|
+
id: "checkout_session.ended.failed_title",
|
|
1170
|
+
description: "Shown in place of a checkout that was paid for but whose account could not be set up yet"
|
|
1171
|
+
}),
|
|
1172
|
+
message: a({
|
|
1173
|
+
defaultMessage: "We are finishing your account. There is nothing more you need to do.",
|
|
1174
|
+
id: "checkout_session.ended.failed_message",
|
|
1175
|
+
description: "Shown under the notice that the payment was received while the account is being set up"
|
|
1176
|
+
})
|
|
1177
|
+
} : n.status === "PROCESSING" ? {
|
|
1178
|
+
title: a({
|
|
1179
|
+
defaultMessage: "We are processing your payment",
|
|
1180
|
+
id: "checkout_session.ended.processing_title",
|
|
1181
|
+
description: "Shown in place of a checkout whose payment is still being processed"
|
|
1182
|
+
}),
|
|
1183
|
+
message: a({
|
|
1184
|
+
defaultMessage: "This can take a few minutes. You do not need to pay again.",
|
|
1185
|
+
id: "checkout_session.ended.processing_message",
|
|
1186
|
+
description: "Shown under the notice that the payment is still being processed"
|
|
1187
|
+
})
|
|
1188
|
+
} : n.reason === "expired" ? {
|
|
1189
|
+
title: a({
|
|
1190
|
+
defaultMessage: "This checkout link has expired",
|
|
1191
|
+
id: "checkout_session.ended.expired_title",
|
|
1192
|
+
description: "Shown in place of a checkout whose link has expired"
|
|
1193
|
+
}),
|
|
1194
|
+
message: c()
|
|
1195
|
+
} : n.reason === "revoked" ? {
|
|
1196
|
+
title: a({
|
|
1197
|
+
defaultMessage: "This checkout is no longer available",
|
|
1198
|
+
id: "checkout_session.ended.revoked_title",
|
|
1199
|
+
description: "Shown in place of a checkout whose link the merchant revoked"
|
|
1200
|
+
}),
|
|
1201
|
+
message: c()
|
|
1202
|
+
} : {
|
|
1203
|
+
title: a({
|
|
1204
|
+
defaultMessage: "This checkout is closed",
|
|
1205
|
+
id: "checkout_session.ended.closed_title",
|
|
1206
|
+
description: "Shown in place of a checkout that can no longer be used"
|
|
1207
|
+
}),
|
|
1208
|
+
message: c()
|
|
1209
|
+
});
|
|
1210
|
+
return (l, v) => (R(), ds("div", pn, [
|
|
1211
|
+
ps("div", mn, [
|
|
1212
|
+
bt(w(mt), {
|
|
1213
|
+
variant: "heading-1",
|
|
1214
|
+
class: "sv-checkout-ended__title"
|
|
1215
|
+
}, {
|
|
1216
|
+
default: ce(() => [
|
|
1217
|
+
dt(pt(u.value.title), 1)
|
|
1218
|
+
]),
|
|
1219
|
+
_: 1
|
|
1220
|
+
}),
|
|
1221
|
+
u.value.message ? (R(), $(w(mt), ms({
|
|
1222
|
+
key: 0,
|
|
1223
|
+
variant: "body-sm",
|
|
1224
|
+
color: "subtle",
|
|
1225
|
+
class: "sv-checkout-ended__message"
|
|
1226
|
+
}, s.isRedirecting && s.status === "COMPLETED" ? { role: "status" } : {}), {
|
|
1227
|
+
default: ce(() => [
|
|
1228
|
+
dt(pt(u.value.message), 1)
|
|
1229
|
+
]),
|
|
1230
|
+
_: 1
|
|
1231
|
+
}, 16)) : _s("", !0)
|
|
1232
|
+
])
|
|
1233
|
+
]));
|
|
1234
|
+
}
|
|
1235
|
+
}), _n = /* @__PURE__ */ xe({
|
|
1236
|
+
__name: "SessionCheckout",
|
|
1237
|
+
props: {
|
|
1238
|
+
configuration: { type: Object },
|
|
1239
|
+
portalUrlId: { type: String },
|
|
1240
|
+
avatar: { type: String }
|
|
1241
|
+
},
|
|
1242
|
+
setup(s) {
|
|
1243
|
+
const n = s;
|
|
1244
|
+
It().info("COMPONENT_INITIALIZED", "Checkout session component initialized");
|
|
1245
|
+
const { source: a, endState: c, isRedirecting: u, loadFailure: l } = dn({
|
|
1246
|
+
portalUrlId: n.portalUrlId
|
|
1247
|
+
});
|
|
1248
|
+
return (v, y) => {
|
|
1249
|
+
var S;
|
|
1250
|
+
return (S = w(l)) != null && S.reason ? (R(), $(Te, {
|
|
1251
|
+
key: 0,
|
|
1252
|
+
class: "sv-checkout sv-root sv-screen",
|
|
1253
|
+
reason: w(l).reason,
|
|
1254
|
+
status: w(l).status
|
|
1255
|
+
}, null, 8, ["reason", "status"])) : w(l) ? (R(), $(Pt, {
|
|
1256
|
+
key: 1,
|
|
1257
|
+
class: "sv-checkout sv-root sv-screen sv-checkout--error"
|
|
1258
|
+
})) : w(c) ? (R(), $(Te, {
|
|
1259
|
+
key: 2,
|
|
1260
|
+
class: "sv-checkout sv-root sv-screen",
|
|
1261
|
+
status: w(c),
|
|
1262
|
+
"is-redirecting": w(u)
|
|
1263
|
+
}, null, 8, ["status", "is-redirecting"])) : (R(), $(Ns, {
|
|
1264
|
+
key: 3,
|
|
1265
|
+
source: w(a),
|
|
1266
|
+
configuration: s.configuration,
|
|
1267
|
+
avatar: s.avatar
|
|
1268
|
+
}, null, 8, ["source", "configuration", "avatar"]));
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
}), vn = /* @__PURE__ */ xe({
|
|
1272
|
+
__name: "CheckoutSession.entry",
|
|
1273
|
+
props: {
|
|
1274
|
+
environment: { type: String },
|
|
1275
|
+
locale: { type: String },
|
|
1276
|
+
dateLocale: { type: String },
|
|
1277
|
+
messages: { type: Object },
|
|
1278
|
+
portalToken: { type: Object },
|
|
1279
|
+
experimentalFeatures: { type: Array },
|
|
1280
|
+
logLevel: { type: String },
|
|
1281
|
+
onLog: { type: Function },
|
|
1282
|
+
cssOverrides: { type: [String, Array] },
|
|
1283
|
+
branding: { type: Object },
|
|
1284
|
+
portalObject: { type: null }
|
|
1285
|
+
},
|
|
1286
|
+
setup(s) {
|
|
1287
|
+
const n = Ss("checkout-session");
|
|
1288
|
+
return (a, c) => (R(), $(w(Es), {
|
|
1289
|
+
entry: a.$props,
|
|
1290
|
+
"component-name": w(n),
|
|
1291
|
+
"allowed-portal-types": ["CHECKOUT_SESSION"]
|
|
1292
|
+
}, {
|
|
1293
|
+
"portal-unavailable": ce(({ ending: u }) => [
|
|
1294
|
+
u ? (R(), $(Te, {
|
|
1295
|
+
key: 0,
|
|
1296
|
+
class: "sv-checkout sv-root sv-screen",
|
|
1297
|
+
reason: u.reason,
|
|
1298
|
+
status: u.checkoutSessionStatus
|
|
1299
|
+
}, null, 8, ["reason", "status"])) : (R(), $(Pt, {
|
|
1300
|
+
key: 1,
|
|
1301
|
+
class: "sv-checkout sv-root sv-screen sv-checkout--error"
|
|
1302
|
+
}))
|
|
1303
|
+
]),
|
|
1304
|
+
default: ce(() => {
|
|
1305
|
+
var u, l;
|
|
1306
|
+
return [
|
|
1307
|
+
bt(_n, {
|
|
1308
|
+
"portal-url-id": s.portalObject.id,
|
|
1309
|
+
avatar: ((l = (u = s.branding) == null ? void 0 : u.emblem) == null ? void 0 : l.public_url) ?? void 0
|
|
1310
|
+
}, null, 8, ["portal-url-id", "avatar"])
|
|
1311
|
+
];
|
|
1312
|
+
}),
|
|
1313
|
+
_: 1
|
|
1314
|
+
}, 8, ["entry", "component-name"]));
|
|
1315
|
+
}
|
|
1316
|
+
}), { define: Pn } = Os(
|
|
1317
|
+
vn,
|
|
1318
|
+
"checkout-session"
|
|
1319
|
+
);
|
|
1320
|
+
export {
|
|
1321
|
+
Pn as defineSolvimonCheckoutSession
|
|
1322
|
+
};
|