@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.
Files changed (268) hide show
  1. package/README.md +152 -91
  2. package/dist/AddPaymentMethodModal-Cx203VXo.mjs +97 -0
  3. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BMHhLZnu.mjs +89 -0
  4. package/dist/{Alert.vue.es-ZPG49yR_.mjs → Alert.vue.es-DHJpiSdR.mjs} +1 -1
  5. package/dist/{Amount.vue.es-DPqHB8Xd.mjs → Amount.vue.es-CofcgmXt.mjs} +1 -1
  6. package/dist/AuthProvider.handle-BpFblzFx.mjs +46 -0
  7. package/dist/{Avatar.vue.es-geDQsZwu.mjs → Avatar.vue.es-CJdXXOiG.mjs} +1 -1
  8. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BD84aBiU.mjs +64 -0
  9. package/dist/BillingInformationForm.lib-ad8B2Y1O.mjs +32 -0
  10. package/dist/BillingInformationForm.vue_vue_type_script_setup_true_lang-F5OVG0kO.mjs +340 -0
  11. package/dist/BillingInformationModal-Do3Fuu8A.mjs +85 -0
  12. package/dist/{Button.vue.es-j7iYlqtJ.mjs → Button.vue.es-CW7XfMBF.mjs} +1 -1
  13. package/dist/{ChargeOnDemandModal-CR01PkP_.mjs → ChargeOnDemandModal-B4ShPKLS.mjs} +46 -45
  14. package/dist/{Chip.vue.es-Dxx_0dte.mjs → Chip.vue.es-CYwWHyAT.mjs} +2 -2
  15. package/dist/CompanyPurchaseToggle.vue_vue_type_script_setup_true_lang-CVXHCSPb.mjs +510 -0
  16. package/dist/{Comparators.vue.es-DQBI3f7m.mjs → Comparators.vue.es-DYrKlE8t.mjs} +1 -1
  17. package/dist/{ContentWithAsideLayout-Bnbsq8_5.mjs → ContentWithAsideLayout-C2kFcft1.mjs} +1 -1
  18. package/dist/{ContextMenu.vue.es-BJO4U47Q.mjs → ContextMenu.vue.es-EXTx0NEt.mjs} +10 -10
  19. package/dist/{CustomerBillingInformation.vue.es-CmNpqcBw.mjs → CustomerBillingInformation.vue.es-CSKG6V3T.mjs} +3 -3
  20. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZZuAHIE.mjs +217 -0
  21. package/dist/CustomerShippingAddresses-Bdy4XWjE.mjs +282 -0
  22. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BEKwWob_.mjs +3124 -0
  23. package/dist/{DividerText.vue.es-BusbyeAI.mjs → DividerText.vue.es-Dq0JzI8C.mjs} +1 -1
  24. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs} +3 -3
  25. package/dist/{ErrorNotification.vue.es-F068p7PY.mjs → ErrorNotification.vue.es-Cw7fqCg1.mjs} +2 -2
  26. package/dist/{FormMessage.vue.es-CwMQpIAW.mjs → FormMessage.vue.es-MrzQoSae.mjs} +1 -1
  27. package/dist/{IconButton.vue.es-D8DtBW9i.mjs → IconButton.vue.es-CpQbFw0x.mjs} +2 -2
  28. package/dist/{IconTitle.vue.es-6VJtjJX2.mjs → IconTitle.vue.es-CcOIFjbE.mjs} +3 -3
  29. package/dist/{Input.vue.es-BLyHcmu4.mjs → Input.vue.es-Cd55vQri.mjs} +4 -4
  30. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dl1vTzQD.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CqkGCbvg.mjs} +2 -2
  31. 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
  32. package/dist/{InvoicePreview.vue.es-Cpf66_xV.mjs → InvoicePreview.vue.es-DHh5wruk.mjs} +7 -7
  33. package/dist/{InvoicePricingClauseChip.vue.es-CDrAE901.mjs → InvoicePricingClauseChip.vue.es-ZSOBp1se.mjs} +4 -4
  34. package/dist/{Label.vue.es-es7ZUBSP.mjs → Label.vue.es-CB6G8Krh.mjs} +3 -3
  35. package/dist/LoadFailedNotice.vue_vue_type_script_setup_true_lang-BZCtO2Er.mjs +20 -0
  36. package/dist/{Modal.vue.es-eeR9FmvQ.mjs → Modal.vue.es-CJFTVFSZ.mjs} +138 -127
  37. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs +789 -0
  38. package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-CrjVPks0.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-D08Qpgb0.mjs} +2 -2
  39. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DyjzaTK1.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-dl52PYcq.mjs} +4 -4
  40. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs} +3 -3
  41. package/dist/{PaymentHistoryBlock-CN42ewCn.mjs → PaymentHistoryBlock-BSXlneqM.mjs} +1 -1
  42. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3Y5fHvA.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CXy0XGpn.mjs} +5 -5
  43. package/dist/{PaymentIntegrationForm-D3Ye7LZ5.mjs → PaymentIntegrationForm-Diua0GGJ.mjs} +1 -1
  44. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CLlm_Q2j.mjs +161 -0
  45. package/dist/{PaymentIntegrationFormAdyen-Fm-diCCO.mjs → PaymentIntegrationFormAdyen-D4FP0Vj5.mjs} +302 -282
  46. package/dist/{PaymentIntegrationFormStripe-BANBL6za.mjs → PaymentIntegrationFormStripe-vFzF_sCJ.mjs} +126 -117
  47. package/dist/{PaymentMethod.vue.es-t3-VyoE8.mjs → PaymentMethod.vue.es-vs6SaZOh.mjs} +200 -150
  48. package/dist/{PaymentMethodForm-CqP3GoNj.mjs → PaymentMethodForm-Buhe0aRQ.mjs} +1 -1
  49. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-RPPdBw_e.mjs +165 -0
  50. package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs} +7 -7
  51. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DhkkiJaQ.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BXbevI3r.mjs} +28 -26
  52. package/dist/PaymentMethodsModal-CnJP9UKp.mjs +192 -0
  53. package/dist/PlanCustomizationEditor-KHLSEUbb.mjs +864 -0
  54. package/dist/{PortalLinkUnverified-Cp60_kRJ.mjs → PortalLinkUnverified-DlZAkE93.mjs} +3 -3
  55. package/dist/{PortalNotAvailable-DzSQnfzw.mjs → PortalNotAvailable-CKIomNrm.mjs} +2 -2
  56. package/dist/{PricingGroupRangeInput.vue.es-Srq_3cga.mjs → PricingGroupRangeInput.vue.es-oHD-IT12.mjs} +8 -8
  57. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-wCW8YZHM.mjs} +16 -15
  58. package/dist/{RadioGroupExtended.vue.es-BbBMDf6l.mjs → RadioGroupExtended.vue.es-DsShmkKZ.mjs} +5 -5
  59. package/dist/Section.vue.es-DYmEtgBj.mjs +88 -0
  60. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs} +2 -2
  61. package/dist/ShippingAddressForm.vue_vue_type_script_setup_true_lang-CJp6ddhZ.mjs +144 -0
  62. package/dist/ShippingAddressesModal-Gxv2KxaW.mjs +283 -0
  63. package/dist/{StepInput.vue.es-ieh4EuJ7.mjs → StepInput.vue.es-sqA-VSsn.mjs} +4 -4
  64. package/dist/SubscriptionCancellationModal-DfAZ_uW6.mjs +4 -0
  65. package/dist/SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-BlbiDNIu.mjs +240 -0
  66. package/dist/SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-C1ko2xvR.mjs +64 -0
  67. package/dist/SubscriptionDetails.entry.ce-CdWV-8WN.mjs +764 -0
  68. package/dist/{SubscriptionSchedules-DMxX3GpK.mjs → SubscriptionSchedules-BfdVn1XA.mjs} +1 -1
  69. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C8q8Q6h5.mjs +5413 -0
  70. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs +90 -0
  71. 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
  72. package/dist/Toggle.vue.es-S2g8WGY_.mjs +99 -0
  73. package/dist/{TooltipParagraph.vue.es-BES3zsYN.mjs → TooltipParagraph.vue.es-Bt-7LHr3.mjs} +18 -18
  74. 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
  75. package/dist/TrialChip.vue.es-VZwQX079.mjs +47 -0
  76. package/dist/addonQuantity-D3bGVqjL.mjs +128 -0
  77. package/dist/adyen-CHgq2l6n.mjs +99 -0
  78. package/dist/adyenSdk-DUTO7xkT.mjs +63 -0
  79. package/dist/{api.es-qgvzNMU-.mjs → api.es-QaC926Xu.mjs} +2 -2
  80. package/dist/components/BillingInformation/BillingInformation.mjs +37 -41
  81. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +45 -462
  82. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +33 -42
  83. package/dist/components/Invoice/Invoice.mjs +1087 -1019
  84. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +38 -47
  85. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +29 -34
  86. package/dist/components/InvoicesList/InvoicesList.mjs +33 -42
  87. package/dist/components/PaymentHistory/PaymentHistory.mjs +39 -48
  88. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +56 -64
  89. package/dist/components/ShippingAddressForm/ShippingAddressForm.ce.d.ts +1 -0
  90. package/dist/components/ShippingAddressForm/ShippingAddressForm.mjs +212 -0
  91. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +34 -42
  92. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +41 -50
  93. package/dist/components/WalletBalances/WalletBalances.mjs +46 -55
  94. package/dist/core/events.types.d.ts +1 -0
  95. package/dist/core/index.mjs +51 -34
  96. package/dist/{customElements-DK4GKNJG.mjs → customElements-B8c354Nu.mjs} +802 -768
  97. package/dist/{customer-lf6S5DBR.mjs → customer-CP-Wz7JO.mjs} +1 -1
  98. package/dist/{de-DE-Cyj_NtiI.mjs → de-DE-C9HrzHpE.mjs} +71 -5
  99. package/dist/{de-DE-UJ6X6jXu.mjs → de-DE-DAQmgEy5.mjs} +82 -19
  100. package/dist/{formControl-BZQLHnOO.mjs → formControl-C18sw44K.mjs} +275 -275
  101. package/dist/{formatting.es-RclXHhKo.mjs → formatting.es-DlJEzreG.mjs} +16 -13
  102. package/dist/{fr-FR-CRFoWQ7J.mjs → fr-FR-CHR3VWvd.mjs} +71 -5
  103. package/dist/{fr-FR-Cvvbkwlj.mjs → fr-FR-fz51-Ubw.mjs} +79 -16
  104. package/dist/{countryData.es-BegoD-cZ.mjs → getCountryNameByCode.es-OGxn_zT0.mjs} +7 -2
  105. package/dist/icon-sprite.svg.es-2S3rv8NW.mjs +4 -0
  106. package/dist/index.es-Bv55VtdE.mjs +633 -0
  107. package/dist/{index.es-BrVTOW5D.mjs → index.es-C7J3WGGo.mjs} +4 -4
  108. package/dist/index.mjs +37 -33
  109. package/dist/invoices-I7PghcPV.mjs +143 -0
  110. package/dist/{it-IT-DnJP5URH.mjs → it-IT-BpCkTMZL.mjs} +73 -10
  111. package/dist/{it-IT-DObZEc-U.mjs → it-IT-Dzc7DmmL.mjs} +71 -5
  112. package/dist/{nl-NL-q9xfTZF0.mjs → nl-NL-22C8OcIM.mjs} +79 -16
  113. package/dist/{nl-NL-C02xHilF.mjs → nl-NL-Dut_QwsY.mjs} +71 -5
  114. package/dist/paymentIntegrationFormLoaders-BFMAMpcA.mjs +31 -0
  115. package/dist/{paymentMethods-8w-ccfY_.mjs → paymentMethods-aGKIi7DS.mjs} +22 -21
  116. package/dist/{paymentOutcome-B6sW1eCV.mjs → paymentOutcome-Cv7hTFVu.mjs} +1 -1
  117. package/dist/paymentRedirect-DaS8Kccc.mjs +66 -0
  118. package/dist/payments-BKoKpoLN.mjs +71 -0
  119. package/dist/preloadPaymentIntegrationForms-Buwal_JR.mjs +9 -0
  120. package/dist/pricing-Y-7ELzN-.mjs +42 -0
  121. package/dist/{pricingItem.es-bCPArbTa.mjs → pricingItem.es-BafitMMY.mjs} +1 -1
  122. package/dist/pricingPlanScheduleOverrides-CGm_-jJq.mjs +291 -0
  123. package/dist/randomUuid-BE_IQ-aq.mjs +10 -0
  124. package/dist/screens/Checkout/Checkout.mjs +1098 -3
  125. package/dist/screens/CheckoutSession/CheckoutSession.ce.d.ts +1 -0
  126. package/dist/screens/CheckoutSession/CheckoutSession.mjs +1322 -0
  127. package/dist/screens/CustomerOverview/CustomerOverview.mjs +209 -133
  128. package/dist/screens/PayInvoice/PayInvoice.mjs +283 -275
  129. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +92 -97
  130. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  131. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +915 -404
  132. package/dist/{subscription-BwzkagDI.mjs → subscription-DQ5mRp_e.mjs} +10 -10
  133. package/dist/subscriptions-B7dNqi1C.mjs +99 -0
  134. package/dist/timePeriod.es-R9U0wLlB.mjs +13 -0
  135. package/dist/types/components/customer/BillingInformationForm/BillingInformationForm.types.d.ts +11 -14
  136. package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -9
  137. package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +10 -0
  138. package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +6 -0
  139. package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +17 -0
  140. package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -2
  141. package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +3 -2
  142. package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +2 -0
  143. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +12 -1
  144. package/dist/types/components/payments/PaymentMethodsList/PaymentMethodsList.types.d.ts +2 -0
  145. package/dist/types/components/payments/PaymentMethodsModal/PaymentMethodsModal.types.d.ts +22 -0
  146. package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.lib.types.d.ts +1 -1
  147. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -1
  148. package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -2
  149. package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -11
  150. package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +1 -5
  151. package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +11 -0
  152. package/dist/types/components/providers/HostElementProvider/composables/useHostEvent.d.ts +12 -0
  153. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +5 -4
  154. package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +3 -3
  155. package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +3 -3
  156. package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +6 -1
  157. package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +1 -0
  158. package/dist/types/components/providers/Provider/Provider.types.d.ts +10 -3
  159. package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -14
  160. package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -1
  161. package/dist/types/components/subscriptions/OrderSummary.types.d.ts +14 -0
  162. package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +14 -1
  163. package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +9 -0
  164. package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditor.types.d.ts +4 -0
  165. package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditorItem.types.d.ts +2 -0
  166. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +4 -0
  167. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +2 -0
  168. package/dist/types/components/subscriptions/SubscriptionCancellationSuccess/SubscriptionCancellationSuccess.types.d.ts +4 -0
  169. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +10 -9
  170. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSuccess.types.d.ts +5 -0
  171. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSummary.types.d.ts +3 -0
  172. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanChangeSummary.types.d.ts +4 -0
  173. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanSelector.types.d.ts +7 -0
  174. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +1 -0
  175. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -0
  176. package/dist/types/components/wallets/AutoTopUpModal/AutoTopUpModal.types.d.ts +3 -1
  177. package/dist/types/index.d.ts +5 -1
  178. package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +5 -0
  179. package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.types.d.ts +1 -2
  180. package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +6 -2
  181. package/dist/types/public/components/Invoice/Invoice.types.d.ts +7 -7
  182. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +2 -2
  183. package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +6 -7
  184. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.types.d.ts +1 -1
  185. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.types.d.ts +19 -14
  186. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.ce.d.ts +1 -0
  187. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.types.d.ts +6 -0
  188. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.types.d.ts +5 -0
  189. package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +10 -1
  190. package/dist/types/public/core/action-request.types.d.ts +18 -24
  191. package/dist/types/public/core/events.types.d.ts +99 -0
  192. package/dist/types/public/core/index.d.ts +3 -1
  193. package/dist/types/public/core/types.d.ts +11 -2
  194. package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +1 -7
  195. package/dist/types/public/screens/Checkout/Checkout.source.types.d.ts +151 -0
  196. package/dist/types/public/screens/Checkout/Checkout.types.d.ts +7 -30
  197. package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.ce.d.ts +1 -0
  198. package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.types.d.ts +3 -0
  199. package/dist/types/public/screens/CustomerOverview/CustomerOverview.types.d.ts +8 -2
  200. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +0 -6
  201. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +2 -19
  202. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +2 -3
  203. package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.types.d.ts +2 -1
  204. package/dist/types/services/paymentMethods.types.d.ts +12 -1
  205. package/dist/types/types/EntryBaseProps.d.ts +10 -6
  206. package/dist/types/types/branding.d.ts +15 -0
  207. package/dist/types/types/checkoutSession.d.ts +199 -0
  208. package/dist/types/types/errors.d.ts +2 -0
  209. package/dist/types/types/pricingPlanGroup.d.ts +25 -0
  210. package/dist/{useActionDispatchProvider-ChAHdwR8.mjs → useActionDispatchProvider-BCtk-FGU.mjs} +1 -1
  211. package/dist/useAddressFormats-CtE4QaVU.mjs +1998 -0
  212. package/dist/useCheckoutForm-BhXcmnUi.mjs +3355 -0
  213. package/dist/{useCustomer-CTMhg1nd.mjs → useCustomer-mQysxUwp.mjs} +2 -2
  214. package/dist/useDefaultPaymentMethod-Dliq6_Yw.mjs +39 -0
  215. package/dist/useExperimentalFeature-Bw6bBtay.mjs +6 -0
  216. package/dist/useHostEvent-MtRG6W2B.mjs +12 -0
  217. package/dist/{useIncrementalLoading-CBVutPH8.mjs → useIncrementalLoading-CJSj1945.mjs} +2 -2
  218. package/dist/{useInvoiceData-qUGbBAQK.mjs → useInvoiceData-BEZIvw32.mjs} +2 -2
  219. package/dist/{useInvoicesList-wJvZAJpW.mjs → useInvoicesList-CrXjsmei.mjs} +140 -138
  220. package/dist/{sorting.es-C0pdMgX0.mjs → useIsMounted.es-BNPhTTHE.mjs} +11 -10
  221. package/dist/{useLoadInitialData-UvfYXgbi.mjs → useLoadInitialData-Bomj_1mo.mjs} +1 -1
  222. package/dist/usePaymentFormHold-CYZ4BdOw.mjs +19 -0
  223. package/dist/{usePaymentMethodAvailability-35l4pWdH.mjs → usePaymentMethodAvailability-DR_neLeZ.mjs} +4 -4
  224. package/dist/usePaymentMethodOptions-CuHoQx3K.mjs +67 -0
  225. package/dist/{usePaymentMethods-De7hlLHo.mjs → usePaymentMethods-BDdetXts.mjs} +2 -2
  226. package/dist/{usePayments-hWS7fnOx.mjs → usePayments-B5Z9Kfbv.mjs} +20 -18
  227. package/dist/usePortal-DuLR5Mid.mjs +14 -0
  228. package/dist/{useService-BwzIBIRp.mjs → useService-2aOFBTxU.mjs} +1 -1
  229. package/dist/useShippingAddresses-BvThNpez.mjs +122 -0
  230. package/dist/useSubscription-Dzo-kBpQ.mjs +35 -0
  231. package/dist/useSubscriptionActions-CWaNRoZ7.mjs +44 -0
  232. package/dist/useWatchDebounced-DkXgKe0E.mjs +20 -0
  233. package/dist/{wallets.es-eH2C2ygn.mjs → wallets.es-DRlUVd2R.mjs} +1 -1
  234. package/package.json +41 -11
  235. package/dist/AuthProvider.handle-SRR_04XS.mjs +0 -50
  236. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-nqKbgY7G.mjs +0 -58
  237. package/dist/Checkout.entry.ce-CopWuLJC.mjs +0 -4169
  238. package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-CEnM1uxK.mjs +0 -828
  239. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Jyb5ZN3s.mjs +0 -136
  240. package/dist/CustomerShippingAddresses-BRPukhRI.mjs +0 -397
  241. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DJnr5D56.mjs +0 -2936
  242. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-B_FpibLA.mjs +0 -441
  243. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D07SEP8a.mjs +0 -181
  244. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-CMRMbL3d.mjs +0 -161
  245. package/dist/PlanCustomizationEditor-B76UNEMm.mjs +0 -791
  246. package/dist/Section.vue.es-Oqn1wGPZ.mjs +0 -72
  247. package/dist/ShippingAddressesModal-c7nqf4Ny.mjs +0 -418
  248. package/dist/SubscriptionDetails.entry.ce-uYv45FGH.mjs +0 -1044
  249. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DXro_64f.mjs +0 -5200
  250. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs +0 -203
  251. package/dist/TrialChip.vue.es-C51z1ZiA.mjs +0 -35
  252. package/dist/addonQuantity-CCVaA3e-.mjs +0 -758
  253. package/dist/adyenSdk-B01MB9Ia.mjs +0 -58
  254. package/dist/getCountryNameByCode.es-BDHua7VM.mjs +0 -8
  255. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +0 -4
  256. package/dist/invoices-DdREPDXV.mjs +0 -123
  257. package/dist/paymentMethods-Goa25rTs.mjs +0 -61
  258. package/dist/payments-CKpU1K3t.mjs +0 -68
  259. package/dist/pricing-CEaZGgKe.mjs +0 -29
  260. package/dist/pricingPlanScheduleOverrides-BBp-DmpV.mjs +0 -233
  261. package/dist/pricingPlanSchedules-DSMptcAh.mjs +0 -38
  262. package/dist/subscriptions-B5bH8hsI.mjs +0 -66
  263. package/dist/taxId.es-e6NEvprh.mjs +0 -243
  264. package/dist/types/components/payments/ExpressPaymentMethodButton/ExpressPaymentMethodButton.types.d.ts +0 -3
  265. package/dist/useCustomerFormLabels-D4oDnfxA.mjs +0 -1173
  266. package/dist/usePaymentFormHold-Cwdr-vyc.mjs +0 -181
  267. package/dist/usePortal-DUfD6hrA.mjs +0 -7
  268. package/dist/useTimePeriod.es-BUorDLVK.mjs +0 -93
@@ -1,513 +1,995 @@
1
- import { ref as y, defineComponent as U, useModel as ie, computed as m, watch as q, openBlock as s, createElementBlock as x, withModifiers as _e, createElementVNode as C, createVNode as T, unref as t, createBlock as c, withCtx as d, Fragment as H, createTextVNode as w, toDisplayString as _, mergeModels as ae, createCommentVNode as K, mergeProps as ye } from "vue";
2
- import { u as we, w as Pe, a as Ie, h as Se } from "../../pricingPlanScheduleOverrides-BBp-DmpV.mjs";
3
- import { _ as se } from "../../Button.vue.es-j7iYlqtJ.mjs";
4
- import { _ as Z } from "../../ErrorNotification.vue.es-F068p7PY.mjs";
5
- import { e as ce, o as Ee, a as L, d as J, g as Me, h as ke, j as $e } from "../../customElements-DK4GKNJG.mjs";
6
- import { C as Te } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
7
- import { u as Oe } from "../../useActionDispatchProvider-ChAHdwR8.mjs";
8
- import { u as Ce } from "../../usePortal-DUfD6hrA.mjs";
9
- import { u as Ae } from "../../usePaymentMethods-De7hlLHo.mjs";
10
- import { u as Ne, i as Be, a as xe } from "../../paymentMethods-Goa25rTs.mjs";
11
- import { u as Ue } from "../../useLoadInitialData-UvfYXgbi.mjs";
12
- import { c as De } from "../../invoices-DdREPDXV.mjs";
13
- import { c as Le, d as ze, e as je } from "../../subscription-BwzkagDI.mjs";
14
- import { c as Ge } from "../../pricingPlanSchedules-DSMptcAh.mjs";
15
- import { _ as Re } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs";
16
- import { _ as Ve } from "../../Divider.vue.es-DnP_HqLz.mjs";
17
- import { _ as Fe } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs";
18
- import { _ as Ye } from "../../PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs";
19
- import { _ as We } from "../../InvoicePreview.vue.es-Cpf66_xV.mjs";
20
- import { _ as qe } from "../../Section.vue.es-Oqn1wGPZ.mjs";
21
- import { _ as ue } from "../../Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
22
- import { _ as He } from "../../TranslationOverride.vue_vue_type_script_setup_true_lang-BJmlNrXT.mjs";
23
- import { _ as Ke } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs";
24
- import { _ as oe } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs";
25
- import { i as Ze } from "../../paymentOutcome-B6sW1eCV.mjs";
26
- function Je() {
27
- const { getInvoicePreview: a } = De(), l = ce(), u = y(), h = y(!1), p = y(), o = Ee();
28
- return { invoice: u, isPending: h, error: p, load: async ({
29
- subscription: O,
30
- scheduleInfo: I,
31
- enabledPricingIds: r
1
+ import { ref as _, defineComponent as j, useModel as ne, computed as p, openBlock as s, createElementBlock as V, createVNode as S, unref as t, createSlots as yn, withCtx as v, createBlock as g, createTextVNode as E, toDisplayString as M, createCommentVNode as P, createElementVNode as A, mergeModels as me, toRef as Pn, withModifiers as wn, Fragment as ge, renderSlot as In, defineAsyncComponent as Oe, watch as z, mergeProps as Mn } from "vue";
2
+ import { u as Sn, g as En } from "../../useSubscription-Dzo-kBpQ.mjs";
3
+ import { a as Cn, _ as ee } from "../../Button.vue.es-CW7XfMBF.mjs";
4
+ import { _ as ve } from "../../ErrorNotification.vue.es-Cw7fqCg1.mjs";
5
+ import { e as ae, p as he, f as kn, a as q, d as F, j as An, k as $n, l as xn } from "../../customElements-B8c354Nu.mjs";
6
+ import { C as On } from "../../ContentWithAsideLayout-C2kFcft1.mjs";
7
+ import { u as Nn } from "../../useActionDispatchProvider-BCtk-FGU.mjs";
8
+ import { u as Ln } from "../../usePortal-DuLR5Mid.mjs";
9
+ import { u as Tn } from "../../useSubscriptionActions-CWaNRoZ7.mjs";
10
+ import { u as Dn } from "../../useCustomer-mQysxUwp.mjs";
11
+ import { u as Gn } from "../../usePaymentMethods-BDdetXts.mjs";
12
+ import { u as Un, a as Bn, i as Rn } from "../../usePaymentMethodOptions-CuHoQx3K.mjs";
13
+ import { u as zn } from "../../useLoadInitialData-Bomj_1mo.mjs";
14
+ import { c as Ge } from "../../invoices-I7PghcPV.mjs";
15
+ import { k as Vn, d as Fn, l as jn } from "../../subscription-DQ5mRp_e.mjs";
16
+ import { c as Ue } from "../../subscriptions-B7dNqi1C.mjs";
17
+ import { c as Wn, _ as Yn } from "../../SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-C1ko2xvR.mjs";
18
+ import { _ as qn } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs";
19
+ import { _ as Ne } from "../../Divider.vue.es-DnP_HqLz.mjs";
20
+ import { _ as Be } from "../../Avatar.vue.es-CJdXXOiG.mjs";
21
+ import { _ as Hn } from "../../Chip.vue.es-CYwWHyAT.mjs";
22
+ import { _ as Kn } from "../../RadioGroupExtended.vue.es-DsShmkKZ.mjs";
23
+ import { _ as Xn } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-wCW8YZHM.mjs";
24
+ import { _ as Zn } from "../../PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs";
25
+ import { u as Jn } from "../../useDefaultPaymentMethod-Dliq6_Yw.mjs";
26
+ import { _ as Qn } from "../../InvoicePreview.vue.es-DHh5wruk.mjs";
27
+ import { _ as te } from "../../Section.vue.es-DYmEtgBj.mjs";
28
+ import { _ as Re } from "../../Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
29
+ import { _ as et } from "../../TranslationOverride.vue_vue_type_script_setup_true_lang-Cp_sFa52.mjs";
30
+ import { _ as nt } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs";
31
+ import { _ as Le } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs";
32
+ import { w as tt, h as at } from "../../pricingPlanScheduleOverrides-CGm_-jJq.mjs";
33
+ import { i as it } from "../../paymentOutcome-Cv7hTFVu.mjs";
34
+ function st() {
35
+ const { getInvoicePreview: n } = Ge(), o = ae(), i = _(), m = _(!1), u = _(), f = he();
36
+ return { invoice: i, isPending: m, error: u, load: async ({
37
+ subscription: C,
38
+ scheduleInfo: w,
39
+ enabledPricingIds: b
32
40
  }) => {
33
- const i = Le({
34
- enabledPricings: r.map((b) => ({ pricing_id: b })),
35
- pricingPlanScheduleInfos: I ? [I] : []
41
+ const r = Vn({
42
+ enabledPricings: b.map((y) => ({ pricing_id: y })),
43
+ pricingPlanScheduleInfos: w ? [w] : []
36
44
  });
37
- if (!i) {
38
- o(), u.value = void 0, p.value = void 0, h.value = !1;
45
+ if (!r) {
46
+ f(), i.value = void 0, u.value = void 0, m.value = !1;
39
47
  return;
40
48
  }
41
- const v = o();
42
- h.value = !0, p.value = void 0;
49
+ const c = f();
50
+ m.value = !0, u.value = void 0;
43
51
  try {
44
- const b = await a({
52
+ const y = await n({
45
53
  // The subscription is running already, so it is priced as itself rather than as the
46
54
  // template for a new one — and the customer it is invoiced to is known.
47
55
  forExistingSubscription: !0,
48
- pricingPlanSubscriptionId: O.id,
49
- customizations: i
56
+ pricingPlanSubscriptionId: C.id,
57
+ customizations: r
50
58
  });
51
- if (!v()) return;
52
- u.value = b.invoice;
53
- } catch (b) {
54
- if (!v()) return;
55
- l.error(
59
+ if (!c()) return;
60
+ i.value = y.invoice;
61
+ } catch (y) {
62
+ if (!c()) return;
63
+ o.error(
56
64
  "INVOICE_PREVIEW_FAILED",
57
65
  "Failed to load the invoice preview",
58
66
  { preview: "SUBSCRIPTION_UPGRADE" },
59
- b
60
- ), p.value = b, u.value = void 0;
67
+ y
68
+ ), u.value = y, i.value = void 0;
61
69
  } finally {
62
- v() && (h.value = !1);
70
+ c() && (m.value = !1);
63
71
  }
64
72
  } };
65
73
  }
66
- const Qe = ["id"], Xe = { class: "sv-subscription-management-form__body grid grid-cols-1 gap-4" }, et = /* @__PURE__ */ U({
74
+ function ot() {
75
+ const { getChangePlanInvoicePreview: n } = Ge(), o = ae(), i = _(), m = _(!1), u = _(), f = he();
76
+ return { invoice: i, isPending: m, error: u, load: async ({
77
+ subscriptionId: w,
78
+ pricingPlanId: b
79
+ }) => {
80
+ const r = f();
81
+ i.value = void 0, m.value = !0, u.value = void 0;
82
+ try {
83
+ const c = await n({
84
+ id: w,
85
+ pricingPlanId: b
86
+ });
87
+ if (!r()) return;
88
+ i.value = c;
89
+ } catch (c) {
90
+ if (!r()) return;
91
+ o.error(
92
+ "INVOICE_PREVIEW_FAILED",
93
+ "Failed to load the invoice preview",
94
+ { preview: "PLAN_CHANGE" },
95
+ c
96
+ ), u.value = c;
97
+ } finally {
98
+ r() && (m.value = !1);
99
+ }
100
+ }, reset: () => {
101
+ f(), i.value = void 0, u.value = void 0, m.value = !1;
102
+ } };
103
+ }
104
+ const rt = (n, o) => n.order - o.order, ct = (n) => kn(n) && n.statusCode === 404, lt = (n) => !!n && n !== "NOT_ALLOWED", ut = (n, o, i, m) => {
105
+ const u = {
106
+ pricingPlanId: o.id,
107
+ name: o.name,
108
+ ...o.description && { description: o.description }
109
+ };
110
+ if (n.pricing_plan_id === i.pricing_plan_id)
111
+ return { ...u, isCurrent: !0 };
112
+ if (n.order === i.order) return;
113
+ const f = n.order > i.order ? "UPGRADE" : "DOWNGRADE", d = f === "UPGRADE" ? m.upgrade_type : m.downgrade_type;
114
+ if (lt(d))
115
+ return { ...u, isCurrent: !1, direction: f, changeType: d };
116
+ };
117
+ function dt() {
118
+ const { getSubscriptionPricingPlanGroup: n } = Ue(), o = ae(), i = _([]), m = _(), u = _(!1), f = _(), d = he();
119
+ return { options: i, currentPricingPlanId: m, isPending: u, error: f, load: async ({
120
+ subscriptionId: w,
121
+ scheduleInfo: b
122
+ }) => {
123
+ var h;
124
+ const r = b == null ? void 0 : b.pricing_plan_version, c = (r == null ? void 0 : r.pricing_plan_id) ?? ((h = r == null ? void 0 : r.pricing_plan) == null ? void 0 : h.id), y = d();
125
+ if (m.value = c, f.value = void 0, !c) {
126
+ i.value = [], u.value = !1;
127
+ return;
128
+ }
129
+ u.value = !0;
130
+ try {
131
+ const $ = await n({ id: w });
132
+ if (!y()) return;
133
+ const Z = [...$.pricing_plans ?? []].sort(rt), T = Z.find(
134
+ ({ pricing_plan_id: O }) => O === c
135
+ );
136
+ if ($.status !== "ACTIVE" || !T) {
137
+ i.value = [];
138
+ return;
139
+ }
140
+ i.value = Z.flatMap((O) => {
141
+ const J = O.pricing_plan ?? (O === T ? r == null ? void 0 : r.pricing_plan : void 0), Q = J && ut(O, J, T, $);
142
+ return Q ? [Q] : [];
143
+ });
144
+ } catch ($) {
145
+ if (!y() || (i.value = [], ct($))) return;
146
+ o.error(
147
+ "PRICING_PLAN_GROUP_LOAD_FAILED",
148
+ "Failed to load the pricing plan group of the subscription",
149
+ {},
150
+ $
151
+ ), f.value = $;
152
+ } finally {
153
+ y() && (u.value = !1);
154
+ }
155
+ } };
156
+ }
157
+ const pt = { class: "sv-subscription-plan-selector" }, mt = { class: "flex flex-wrap items-center gap-2" }, gt = /* @__PURE__ */ j({
158
+ __name: "SubscriptionPlanSelector",
159
+ props: /* @__PURE__ */ me({
160
+ options: { type: Array },
161
+ disabled: { type: Boolean },
162
+ avatar: { type: String }
163
+ }, {
164
+ pricingPlanId: {},
165
+ pricingPlanIdModifiers: {}
166
+ }),
167
+ emits: ["update:pricingPlanId"],
168
+ setup(n) {
169
+ const o = n, i = ne(n, "pricingPlanId"), { $t: m } = q(), u = p(
170
+ () => m({
171
+ defaultMessage: "Current plan",
172
+ id: "subscription_management.plan_selector.current_plan",
173
+ description: "Marks the plan a subscription already runs on"
174
+ })
175
+ ), f = p(
176
+ () => o.options.map(({ pricingPlanId: b, name: r, description: c, isCurrent: y }) => ({
177
+ label: y ? `${r} (${u.value})` : r,
178
+ value: b,
179
+ ...c && { description: c }
180
+ }))
181
+ ), d = p(
182
+ () => new Map(o.options.map((b) => [b.pricingPlanId, b]))
183
+ ), C = (b) => typeof b == "string" ? d.value.get(b) : void 0, w = p({
184
+ get: () => i.value,
185
+ set: (b) => {
186
+ i.value = typeof b == "string" ? b : void 0;
187
+ }
188
+ });
189
+ return (b, r) => (s(), V("div", pt, [
190
+ S(t(Kn), {
191
+ modelValue: w.value,
192
+ "onUpdate:modelValue": r[0] || (r[0] = (c) => w.value = c),
193
+ label: t(m)({
194
+ defaultMessage: "Pick your plan",
195
+ id: "subscription_management.plan_selector.title",
196
+ description: "Heading above the plans a subscription can be moved between"
197
+ }),
198
+ options: f.value,
199
+ direction: "column",
200
+ disabled: n.disabled,
201
+ "show-radio": !1
202
+ }, yn({
203
+ label: v(({ optionValue: c }) => {
204
+ var y;
205
+ return [
206
+ A("span", mt, [
207
+ S(t(F), {
208
+ tag: "span",
209
+ variant: "body",
210
+ weight: "semibold",
211
+ "no-spacing": ""
212
+ }, {
213
+ default: v(() => {
214
+ var h;
215
+ return [
216
+ E(M((h = C(c)) == null ? void 0 : h.name), 1)
217
+ ];
218
+ }),
219
+ _: 2
220
+ }, 1024),
221
+ (y = C(c)) != null && y.isCurrent ? (s(), g(t(Hn), {
222
+ key: 0,
223
+ class: "sv-subscription-plan-selector__current",
224
+ intent: "brand",
225
+ size: "xs",
226
+ content: u.value
227
+ }, null, 8, ["content"])) : P("", !0)
228
+ ])
229
+ ];
230
+ }),
231
+ description: v(({ option: c }) => [
232
+ c.description ? (s(), g(t(F), {
233
+ key: 0,
234
+ tag: "span",
235
+ variant: "body-sm",
236
+ color: "secondary",
237
+ "no-spacing": ""
238
+ }, {
239
+ default: v(() => [
240
+ E(M(c.description), 1)
241
+ ]),
242
+ _: 2
243
+ }, 1024)) : P("", !0)
244
+ ]),
245
+ _: 2
246
+ }, [
247
+ n.avatar ? {
248
+ name: "prefix",
249
+ fn: v(() => [
250
+ S(t(Be), {
251
+ "image-src": n.avatar,
252
+ size: "md",
253
+ class: "shrink-0 self-center"
254
+ }, null, 8, ["image-src"])
255
+ ]),
256
+ key: "0"
257
+ } : void 0
258
+ ]), 1032, ["modelValue", "label", "options", "disabled"])
259
+ ]));
260
+ }
261
+ }), vt = ["id"], ht = { class: "sv-subscription-management-form__body grid grid-cols-1 gap-4" }, ft = { key: 2 }, bt = /* @__PURE__ */ j({
67
262
  __name: "SubscriptionManagementForm",
68
- props: /* @__PURE__ */ ae({
263
+ props: /* @__PURE__ */ me({
69
264
  id: { type: String },
70
265
  pricingGroup: { type: Object },
266
+ planOptions: { type: Array },
71
267
  paymentMethods: { type: Array },
72
268
  hasExpiredPaymentMethod: { type: Boolean },
73
269
  billingPeriod: { type: Object },
74
270
  currency: { type: String },
75
- disabled: { type: Boolean }
271
+ disabled: { type: Boolean },
272
+ avatar: { type: String },
273
+ canAddPaymentMethod: { type: Boolean, default: !0 }
76
274
  }, {
77
275
  enabledPricingIds: { required: !0 },
78
276
  enabledPricingIdsModifiers: {},
79
277
  paymentMethodId: {},
80
- paymentMethodIdModifiers: {}
278
+ paymentMethodIdModifiers: {},
279
+ pricingPlanId: {},
280
+ pricingPlanIdModifiers: {}
81
281
  }),
82
- emits: /* @__PURE__ */ ae(["submit"], ["update:enabledPricingIds", "update:paymentMethodId"]),
83
- setup(a, { emit: l }) {
84
- const u = a, h = l, p = ie(a, "enabledPricingIds"), o = ie(a, "paymentMethodId"), { $t: P } = L(), O = (r) => {
85
- const i = r ? Date.parse(r) : NaN;
86
- return Number.isFinite(i) ? i : 0;
87
- }, I = m(
88
- () => [...u.paymentMethods ?? []].sort((r, i) => O(i.created_at) - O(r.created_at))
89
- );
90
- return q(
91
- () => u.paymentMethods,
92
- (r, i) => {
93
- var b;
94
- const v = r == null ? void 0 : r.find(
95
- ({ id: S }) => !(i != null && i.some((z) => z.id === S))
96
- );
97
- if (v && (i != null && i.length)) {
98
- o.value = v.id;
99
- return;
100
- }
101
- r != null && r.some(({ id: S }) => S === o.value) || (o.value = (b = (r == null ? void 0 : r.find(({ is_default: S }) => S)) ?? I.value[0]) == null ? void 0 : b.id);
102
- },
103
- { immediate: !0 }
104
- ), (r, i) => (s(), x("form", {
105
- id: a.id,
282
+ emits: /* @__PURE__ */ me(["submit", "add-payment-method"], ["update:enabledPricingIds", "update:paymentMethodId", "update:pricingPlanId"]),
283
+ setup(n, { emit: o }) {
284
+ const i = n, m = o, u = ne(n, "enabledPricingIds"), f = ne(n, "paymentMethodId"), d = ne(n, "pricingPlanId"), { $t: C } = q(), { sortedPaymentMethods: w } = Jn({
285
+ paymentMethods: Pn(i, "paymentMethods"),
286
+ selectedPaymentMethodId: f
287
+ });
288
+ return (b, r) => (s(), V("form", {
289
+ id: n.id,
106
290
  class: "sv-subscription-management-form",
107
- onSubmit: i[2] || (i[2] = _e((v) => h("submit"), ["prevent"]))
291
+ onSubmit: r[4] || (r[4] = wn((c) => m("submit"), ["prevent"]))
108
292
  }, [
109
- C("div", Xe, [
110
- T(Fe, {
111
- modelValue: p.value,
112
- "onUpdate:modelValue": i[0] || (i[0] = (v) => p.value = v),
293
+ A("div", ht, [
294
+ n.planOptions && n.planOptions.length > 1 ? (s(), V(ge, { key: 0 }, [
295
+ S(gt, {
296
+ "pricing-plan-id": d.value,
297
+ "onUpdate:pricingPlanId": r[0] || (r[0] = (c) => d.value = c),
298
+ class: "sv-subscription-management-form__plan",
299
+ options: n.planOptions,
300
+ disabled: n.disabled,
301
+ avatar: n.avatar
302
+ }, null, 8, ["pricing-plan-id", "options", "disabled", "avatar"]),
303
+ A("div", null, [
304
+ S(t(Ne), { spacing: "xs" })
305
+ ])
306
+ ], 64)) : P("", !0),
307
+ n.pricingGroup ? (s(), g(Xn, {
308
+ key: 1,
309
+ modelValue: u.value,
310
+ "onUpdate:modelValue": r[1] || (r[1] = (c) => u.value = c),
113
311
  class: "sv-subscription-management-form__pricing-group",
114
- "group-name": a.pricingGroup.name,
115
- pricings: a.pricingGroup.pricings,
116
- "billing-period": a.billingPeriod,
117
- currency: a.currency
118
- }, null, 8, ["modelValue", "group-name", "pricings", "billing-period", "currency"]),
119
- C("div", null, [
120
- T(t(Ve), { spacing: "xs" })
121
- ]),
122
- I.value.length > 0 ? (s(), c(Ye, {
123
- key: 0,
124
- modelValue: o.value,
125
- "onUpdate:modelValue": i[1] || (i[1] = (v) => o.value = v),
312
+ "group-name": n.pricingGroup.name,
313
+ pricings: n.pricingGroup.pricings,
314
+ "billing-period": n.billingPeriod,
315
+ currency: n.currency
316
+ }, null, 8, ["modelValue", "group-name", "pricings", "billing-period", "currency"])) : P("", !0),
317
+ n.pricingGroup ? (s(), V("div", ft, [
318
+ S(t(Ne), { spacing: "xs" })
319
+ ])) : P("", !0),
320
+ S(Zn, {
321
+ modelValue: f.value,
322
+ "onUpdate:modelValue": r[2] || (r[2] = (c) => f.value = c),
126
323
  class: "sv-subscription-management-form__payment-methods",
127
- "payment-methods": I.value,
128
- "show-add-option": !1,
324
+ "payment-methods": t(w),
129
325
  required: "",
130
- disabled: a.disabled,
131
- label: t(P)({
132
- defaultMessage: "Payment method",
133
- id: "subscription_management.payment_method_selector.label",
326
+ "show-add-option": n.canAddPaymentMethod,
327
+ disabled: n.disabled,
328
+ label: t(C)({
329
+ defaultMessage: "Saved payment methods",
330
+ id: "subscription_management.payment_method_selector.saved_label",
134
331
  description: "Label above the payment method that pays for the subscription change"
135
- })
136
- }, null, 8, ["modelValue", "payment-methods", "disabled", "label"])) : (s(), c(t(J), {
137
- key: 1,
138
- id: a.id && `${a.id}__no-payment-method`,
332
+ }),
333
+ onAddPaymentMethod: r[3] || (r[3] = (c) => m("add-payment-method"))
334
+ }, null, 8, ["modelValue", "payment-methods", "show-add-option", "disabled", "label"]),
335
+ n.hasExpiredPaymentMethod ? (s(), g(t(F), {
336
+ key: 3,
337
+ id: n.id && `${n.id}__expired-payment-method`,
139
338
  variant: "body-sm",
140
339
  color: "subtle",
141
340
  tag: "p",
142
- class: "sv-subscription-management-form__no-payment-method"
341
+ class: "sv-subscription-management-form__expired-payment-method"
143
342
  }, {
144
- default: d(() => [
145
- a.hasExpiredPaymentMethod ? (s(), x(H, { key: 0 }, [
146
- w(_(t(P)({
147
- defaultMessage: "The card this subscription is paid with has expired. Replace it under your payment methods to make a change.",
148
- id: "subscription_management.expired_payment_method",
149
- description: "Shown in place of the payment method on the manage subscription screen when the card the subscription is paid with has expired"
150
- })), 1)
151
- ], 64)) : (s(), x(H, { key: 1 }, [
152
- w(_(t(P)({
153
- defaultMessage: "This subscription has no payment method to charge the change to. Please contact support to change it.",
154
- id: "subscription_management.no_payment_method",
155
- description: "Shown in place of the payment method on the manage subscription screen when the subscription has no usable payment method"
156
- })), 1)
157
- ], 64))
343
+ default: v(() => [
344
+ E(M(t(C)({
345
+ defaultMessage: "The card this subscription is paid with has expired. Pick another payment method or add a new one.",
346
+ id: "subscription_management.expired_payment_method_replace",
347
+ description: "Shown under the payment method choice on the manage subscription screen when the card the subscription is paid with has expired"
348
+ })), 1)
158
349
  ]),
159
350
  _: 1
160
- }, 8, ["id"]))
351
+ }, 8, ["id"])) : P("", !0)
161
352
  ])
162
- ], 40, Qe));
353
+ ], 40, vt));
163
354
  }
164
- }), tt = /* @__PURE__ */ U({
355
+ }), _t = { class: "sv-subscription-management-summary__body grid grid-cols-1 gap-1" }, yt = { class: "flex flex-row items-center gap-3 px-3 py-2" }, Pt = ["title"], wt = /* @__PURE__ */ j({
165
356
  __name: "SubscriptionManagementSummary",
166
357
  props: {
167
358
  invoice: { type: Object },
168
359
  isPending: { type: Boolean },
169
- hasError: { type: Boolean }
360
+ hasError: { type: Boolean },
361
+ planName: { type: String },
362
+ avatar: { type: String }
170
363
  },
171
- setup(a) {
172
- const { $t: l } = L(), u = m(() => ({
173
- "invoice_preview.total_due_today_heading": l({
364
+ setup(n) {
365
+ const { $t: o } = q(), i = p(() => ({
366
+ "invoice_preview.total_due_today_heading": o({
174
367
  defaultMessage: "Total due",
175
368
  id: "subscription_management.summary.total_due_heading",
176
369
  description: 'Heading above the total of the invoice previewing a subscription change, replacing the shared preview’s "Total due today"'
177
370
  })
178
371
  }));
179
- return (h, p) => (s(), c(t(qe), {
372
+ return (m, u) => (s(), g(t(te), {
180
373
  class: "sv-subscription-management-summary",
181
- title: t(l)({
374
+ "no-border": "",
375
+ "no-spacing": "",
376
+ "content-background": "none",
377
+ title: t(o)({
182
378
  defaultMessage: "Order summary",
183
379
  id: "subscription_management.summary.title",
184
380
  description: "Title of the block previewing what a subscription change is invoiced for"
185
381
  })
186
382
  }, {
187
- default: d(() => [
188
- a.hasError ? (s(), c(t(Z), {
189
- key: 0,
190
- class: "sv-subscription-management-summary__error sv-error",
191
- title: t(l)({
192
- defaultMessage: "Unable to calculate the total. Please try again.",
193
- id: "subscription_management.summary.error",
194
- description: "Error shown when the invoice preview for a subscription change cannot be loaded"
195
- })
196
- }, null, 8, ["title"])) : a.isPending || !a.invoice ? (s(), c(ue, {
197
- key: 1,
198
- variant: "section",
199
- class: "sv-subscription-management-summary__skeleton min-h-[120px]"
200
- }, {
201
- default: d(() => [
202
- a.isPending ? K("", !0) : (s(), c(t(J), {
203
- key: 0,
204
- variant: "body-sm",
205
- color: "subtle",
206
- tag: "div",
207
- class: "sv-subscription-management-summary__empty-state"
208
- }, {
209
- default: d(() => [
210
- w(_(t(l)({
211
- defaultMessage: "Select your plan to see what it costs.",
212
- id: "subscription_management.summary.empty_state",
213
- description: "Shown in the order summary before a plan has been picked to preview"
214
- })), 1)
215
- ]),
216
- _: 1
217
- }))
218
- ]),
219
- _: 1
220
- })) : (s(), c(He, {
221
- key: 2,
222
- messages: u.value
223
- }, {
224
- default: d(() => [
225
- T(t(We), {
226
- class: "sv-subscription-management-summary__invoice",
227
- invoice: a.invoice,
228
- "is-customer-facing": ""
229
- }, null, 8, ["invoice"])
230
- ]),
231
- _: 1
232
- }, 8, ["messages"]))
383
+ default: v(() => [
384
+ A("div", _t, [
385
+ n.planName ? (s(), g(t(te), {
386
+ key: 0,
387
+ "no-spacing": "",
388
+ class: "sv-subscription-management-summary__plan"
389
+ }, {
390
+ default: v(() => [
391
+ A("div", yt, [
392
+ n.avatar ? (s(), g(t(Be), {
393
+ key: 0,
394
+ "image-src": n.avatar,
395
+ size: "lg",
396
+ class: "my-1"
397
+ }, null, 8, ["image-src"])) : P("", !0),
398
+ A("div", {
399
+ class: "min-w-0 grow",
400
+ title: n.planName
401
+ }, [
402
+ S(t(F), {
403
+ variant: "body",
404
+ weight: "semibold",
405
+ "no-spacing": "",
406
+ class: "truncate"
407
+ }, {
408
+ default: v(() => [
409
+ E(M(n.planName), 1)
410
+ ]),
411
+ _: 1
412
+ })
413
+ ], 8, Pt)
414
+ ])
415
+ ]),
416
+ _: 1
417
+ })) : P("", !0),
418
+ In(m.$slots, "default"),
419
+ n.hasError ? (s(), g(t(ve), {
420
+ key: 1,
421
+ class: "sv-subscription-management-summary__error sv-error",
422
+ title: t(o)({
423
+ defaultMessage: "Unable to calculate the total. Please try again.",
424
+ id: "subscription_management.summary.error",
425
+ description: "Error shown when the invoice preview for a subscription change cannot be loaded"
426
+ })
427
+ }, null, 8, ["title"])) : n.isPending || !n.invoice ? (s(), g(Re, {
428
+ key: 2,
429
+ variant: "section",
430
+ class: "sv-subscription-management-summary__skeleton min-h-[120px]"
431
+ }, {
432
+ default: v(() => [
433
+ n.isPending ? P("", !0) : (s(), g(t(F), {
434
+ key: 0,
435
+ variant: "body-sm",
436
+ color: "subtle",
437
+ tag: "div",
438
+ class: "sv-subscription-management-summary__empty-state"
439
+ }, {
440
+ default: v(() => [
441
+ E(M(t(o)({
442
+ defaultMessage: "Select your plan to see what it costs.",
443
+ id: "subscription_management.summary.empty_state",
444
+ description: "Shown in the order summary before a plan has been picked to preview"
445
+ })), 1)
446
+ ]),
447
+ _: 1
448
+ }))
449
+ ]),
450
+ _: 1
451
+ })) : (s(), g(t(te), {
452
+ key: 3,
453
+ class: "sv-subscription-management-summary__totals"
454
+ }, {
455
+ default: v(() => [
456
+ S(et, { messages: i.value }, {
457
+ default: v(() => [
458
+ S(t(Qn), {
459
+ class: "sv-subscription-management-summary__invoice",
460
+ variant: "without-products",
461
+ invoice: n.invoice,
462
+ "is-customer-facing": ""
463
+ }, null, 8, ["invoice"])
464
+ ]),
465
+ _: 1
466
+ }, 8, ["messages"])
467
+ ]),
468
+ _: 1
469
+ }))
470
+ ])
233
471
  ]),
234
- _: 1
472
+ _: 3
235
473
  }, 8, ["title"]));
236
474
  }
237
- }), nt = { class: "sv-subscription-management-success grid grid-cols-1 gap-4" }, it = { class: "sv-subscription-management-success__message" }, at = /* @__PURE__ */ U({
475
+ }), It = { class: "sv-subscription-management-success grid grid-cols-1 gap-4" }, Mt = { class: "sv-subscription-management-success__message" }, St = /* @__PURE__ */ j({
238
476
  __name: "SubscriptionManagementSuccess",
239
477
  props: {
478
+ pricingPlanName: { type: String },
240
479
  pricingGroupName: { type: String }
241
480
  },
242
- setup(a) {
243
- const l = a, { $t: u } = L(), h = m(
244
- () => u({
481
+ setup(n) {
482
+ const o = n, { $t: i } = q(), m = p(
483
+ () => i({
245
484
  defaultMessage: "Subscription updated",
246
485
  description: "Title shown on the manage subscription screen once the change is committed",
247
486
  id: "subscription_management.success.title"
248
487
  })
249
- ), p = m(
250
- () => l.pricingGroupName ? u(
251
- {
252
- defaultMessage: "Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",
253
- description: "Confirmation of the pricing group a committed subscription change applied to",
254
- id: "subscription_management.success.message"
255
- },
256
- { subject: l.pricingGroupName }
257
- ) : u({
258
- defaultMessage: "Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",
259
- description: "Confirmation of a committed subscription change when the pricing group is not known",
260
- id: "subscription_management.success.message_generic"
261
- })
262
- );
263
- return (o, P) => (s(), x("div", nt, [
264
- T(Ke, {
488
+ ), u = p(() => o.pricingPlanName ? i(
489
+ {
490
+ defaultMessage: "Your subscription has been moved to {plan}. Please be aware that it can take some time to reflect this change in your subscription.",
491
+ description: "Confirmation of a committed move to another plan within the same pricing plan group",
492
+ id: "subscription_management.success.plan_message"
493
+ },
494
+ { plan: o.pricingPlanName }
495
+ ) : o.pricingGroupName ? i(
496
+ {
497
+ defaultMessage: "Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",
498
+ description: "Confirmation of the pricing group a committed subscription change applied to",
499
+ id: "subscription_management.success.message"
500
+ },
501
+ { subject: o.pricingGroupName }
502
+ ) : i({
503
+ defaultMessage: "Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",
504
+ description: "Confirmation of a committed subscription change when the pricing group is not known",
505
+ id: "subscription_management.success.message_generic"
506
+ }));
507
+ return (f, d) => (s(), V("div", It, [
508
+ S(nt, {
265
509
  status: "success",
266
- title: h.value
510
+ title: m.value
267
511
  }, {
268
- default: d(() => [
269
- C("span", it, _(p.value), 1)
512
+ default: v(() => [
513
+ A("span", Mt, M(u.value), 1)
270
514
  ]),
271
515
  _: 1
272
516
  }, 8, ["title"])
273
517
  ]));
274
518
  }
275
- }), st = { class: "sv-subscription-management__header" }, ot = { class: "flex flex-col gap-2" }, W = "sv-subscription-management-form", re = "sv-subscription-management__customized-pricing-message", rt = /* @__PURE__ */ U({
519
+ }), Et = { class: "flex flex-row gap-2 px-3 py-2" }, Ct = /* @__PURE__ */ j({
520
+ __name: "SubscriptionPlanChangeSummary",
521
+ props: {
522
+ changeType: { type: String }
523
+ },
524
+ setup(n) {
525
+ const o = n, { $t: i } = q(), m = p(
526
+ () => o.changeType === "NEXT_BILLING_PERIOD" ? i({
527
+ defaultMessage: "The change takes effect at the start of your next billing period. You keep your current plan until then, and the new price appears on the invoice from that period onwards.",
528
+ id: "subscription_management.plan_change_summary.next_billing_period",
529
+ description: "Explains a plan change that only takes effect at the next billing period"
530
+ }) : i({
531
+ defaultMessage: "The change takes effect right away. The new price appears on your next invoice.",
532
+ id: "subscription_management.plan_change_summary.immediate",
533
+ description: "Explains a plan change that takes effect immediately"
534
+ })
535
+ );
536
+ return (u, f) => (s(), g(t(te), {
537
+ "no-spacing": "",
538
+ class: "sv-subscription-plan-change-summary"
539
+ }, {
540
+ default: v(() => [
541
+ A("div", Et, [
542
+ S(t(Cn), {
543
+ icon: "info",
544
+ size: "xs",
545
+ class: "mt-0.5 shrink-0 text-secondary"
546
+ }),
547
+ S(t(F), {
548
+ variant: "body-xs",
549
+ color: "secondary",
550
+ tag: "div",
551
+ "no-spacing": "",
552
+ class: "sv-subscription-plan-change-summary__timing"
553
+ }, {
554
+ default: v(() => [
555
+ E(M(m.value), 1)
556
+ ]),
557
+ _: 1
558
+ })
559
+ ])
560
+ ]),
561
+ _: 1
562
+ }));
563
+ }
564
+ }), kt = { class: "sv-subscription-management__header flex flex-col gap-2 md:flex-row md:items-center" }, At = { class: "flex flex-col gap-2" }, Te = "sv-subscription-management-form", De = "sv-subscription-management__customized-pricing-message", $t = /* @__PURE__ */ j({
276
565
  __name: "SubscriptionManagement",
277
566
  props: {
278
- configuration: { type: Object }
567
+ configuration: { type: Object },
568
+ avatar: { type: String }
279
569
  },
280
- setup(a) {
281
- const l = a, u = `${W}__no-payment-method`, h = [
570
+ setup(n) {
571
+ const o = n, i = Oe(
572
+ () => import("../../AddPaymentMethodModal-Cx203VXo.mjs")
573
+ ), m = Oe(
574
+ () => import("../../SubscriptionCancellationModal-DfAZ_uW6.mjs")
575
+ ), u = [
282
576
  "BUY_NOW_PAY_LATER",
283
577
  "CARD",
284
578
  "DIGITAL_WALLET",
285
579
  "DIRECT_DEBIT",
286
580
  "ONLINE_BANKING"
287
- ], p = (e, n) => !!n && e.id === (n == null ? void 0 : n.payment_method_id) && xe(e) && e.customer_id === (n == null ? void 0 : n.customer_id) && h.includes(e.type), { $t: o } = L(), P = Ce(), O = ce(), { dispatchAction: I } = Oe(), { createPricingPlanSchedule: r } = Ge(), {
288
- subscription: i,
289
- get: v,
290
- error: b
291
- } = we({
292
- subscriptionId: l.configuration.subscriptionId
293
- }), { items: S, fetchAll: z } = Ae({
294
- customerId: P.value.customer_id
295
- }), { paymentMethodOptions: le, get: me } = Ne(), { isLoading: j } = Ue(
296
- v(),
297
- z(),
298
- me({ customerId: P.value.customer_id })
299
- ), Q = m(
300
- () => S.value.filter((e) => p(e, i.value))
301
- ), de = m(
302
- () => S.value.some(
581
+ ], f = (e, a) => !!a && Rn(e) && e.customer_id === (a == null ? void 0 : a.customer_id) && u.includes(e.type), { $t: d } = q(), C = Ln(), w = ae(), { dispatchAction: b } = Nn(), { createPricingPlanSchedule: r } = Wn(), { changeSubscriptionPlan: c, setSubscriptionPaymentMethod: y } = Ue(), {
582
+ subscription: h,
583
+ get: $,
584
+ error: Z
585
+ } = Sn({
586
+ subscriptionId: o.configuration.subscriptionId
587
+ }), { items: T, fetchAll: O } = Gn({
588
+ customerId: C.value.customer_id
589
+ }), { paymentMethodOptions: J, get: Q } = Un(), { isLoading: ie } = zn(
590
+ $(),
591
+ O(),
592
+ Q({ customerId: C.value.customer_id })
593
+ ), fe = () => $().catch((e) => {
594
+ w.error(
595
+ "SUBSCRIPTION_LOAD_FAILED",
596
+ "Failed to reload the subscription after it changed",
597
+ {},
598
+ e
599
+ );
600
+ }), se = p(
601
+ () => T.value.filter((e) => f(e, h.value))
602
+ ), ze = p(
603
+ () => T.value.some(
303
604
  (e) => {
304
- var n;
305
- return e.id === ((n = i.value) == null ? void 0 : n.payment_method_id) && Be(e);
605
+ var a;
606
+ return e.id === ((a = h.value) == null ? void 0 : a.payment_method_id) && Bn(e);
306
607
  }
307
608
  )
308
- ), A = m(
609
+ ), D = p(
309
610
  () => {
310
611
  var e;
311
- return ze(((e = i.value) == null ? void 0 : e.pricing_plan_schedule_infos) ?? []);
612
+ return Fn(((e = h.value) == null ? void 0 : e.pricing_plan_schedule_infos) ?? []);
312
613
  }
313
- ), pe = m(() => {
314
- const e = A.value;
614
+ ), Ve = p(() => {
615
+ const e = D.value;
315
616
  return e != null && e.pricing_plan_version ? {
316
617
  ...e,
317
- pricing_plan_version: Pe(e)
618
+ pricing_plan_version: tt(e)
318
619
  } : e;
319
- }), G = m(
620
+ }), oe = p(
320
621
  () => {
321
622
  var e;
322
- return Ie(((e = A.value) == null ? void 0 : e.pricing_plan_schedule) ?? {});
623
+ return En(((e = D.value) == null ? void 0 : e.pricing_plan_schedule) ?? {});
323
624
  }
324
- ), D = m(
625
+ ), H = p(
325
626
  () => {
326
627
  var e;
327
- return Se((e = A.value) == null ? void 0 : e.pricing_plan_schedule);
628
+ return at((e = D.value) == null ? void 0 : e.pricing_plan_schedule);
328
629
  }
329
- ), E = m(() => {
330
- const e = pe.value;
630
+ ), G = p(() => {
631
+ const e = Ve.value;
331
632
  if (!e)
332
633
  return;
333
- const { enabledPricingId: n } = l.configuration;
334
- return (n ? [n] : G.value).map(
335
- (f) => je({ pricingPlanScheduleInfo: e, pricingId: f })
336
- ).find((f) => !!f);
337
- }), ge = m(
338
- () => {
634
+ const { currentPricingId: a } = o.configuration;
635
+ return (a ? [a] : oe.value).map(
636
+ (I) => jn({ pricingPlanScheduleInfo: e, pricingId: I })
637
+ ).find((I) => !!I);
638
+ }), Fe = p(
639
+ () => d({
640
+ defaultMessage: "Manage subscription",
641
+ id: "subscription_management.title",
642
+ description: "Title for the manage subscription page"
643
+ })
644
+ ), U = _([]), x = _();
645
+ z(
646
+ [() => {
339
647
  var e;
340
- return o(
341
- {
342
- defaultMessage: "Manage {subject}",
343
- id: "subscription_management.title",
344
- description: "Title for the manage subscription page, naming the pricing group being changed"
345
- },
346
- {
347
- subject: ((e = E.value) == null ? void 0 : e.name) || o({
348
- defaultMessage: "subscription",
349
- id: "subscription_management.title.default_subject",
350
- description: 'Stands in for the pricing group name in the manage subscription title when no group is known, e.g. "Manage subscription"'
351
- })
352
- }
353
- );
354
- }
355
- ), M = y([]), R = y();
356
- q(
357
- [G, E],
358
- ([e, n]) => {
359
- const { enabledPricingId: g } = l.configuration, f = ((n == null ? void 0 : n.pricings) ?? []).map(({ id: $ }) => $);
360
- M.value = g && f.includes(g) ? [...e.filter(($) => !f.includes($)), g] : e;
648
+ return (e = h.value) == null ? void 0 : e.payment_method_id;
649
+ }, se],
650
+ ([e, a]) => {
651
+ !x.value && a.some(({ id: l }) => l === e) && (x.value = e);
652
+ },
653
+ { immediate: !0 }
654
+ );
655
+ const je = p(
656
+ () => se.value.some(({ id: e }) => e === x.value)
657
+ ), K = _(!1), We = p(() => {
658
+ var e, a;
659
+ return ((a = (e = h.value) == null ? void 0 : e.payment_acceptor_ids) == null ? void 0 : a.length) !== 0;
660
+ }), Ye = () => {
661
+ K.value = !1, O();
662
+ };
663
+ z(
664
+ [oe, G],
665
+ ([e, a]) => {
666
+ const { currentPricingId: l } = o.configuration, I = ((a == null ? void 0 : a.pricings) ?? []).map(({ id: L }) => L);
667
+ U.value = l && I.includes(l) ? [...e.filter((L) => !I.includes(L)), l] : e;
361
668
  },
362
669
  { immediate: !0 }
363
670
  );
364
- const he = m(() => {
365
- const e = new Set(M.value), n = new Set(G.value);
366
- return e.size !== n.size || [...e].some((g) => !n.has(g));
671
+ const be = p(() => {
672
+ const e = new Set(U.value), a = new Set(oe.value);
673
+ return e.size !== a.size || [...e].some((l) => !a.has(l));
367
674
  }), {
368
- invoice: X,
369
- isPending: ee,
370
- error: te,
371
- load: ve
372
- } = Je();
373
- q(
374
- [M, i, A, D],
375
- ([e, n, g, f]) => {
376
- !n || e.length === 0 || f || ve({
377
- subscription: n,
378
- scheduleInfo: g,
675
+ options: re,
676
+ currentPricingPlanId: qe,
677
+ isPending: _e,
678
+ error: He,
679
+ load: Ke
680
+ } = dt(), ye = _(!1);
681
+ z(_e, (e, a) => {
682
+ a && !e && (ye.value = !0);
683
+ }), z(
684
+ D,
685
+ (e) => {
686
+ Ke({
687
+ subscriptionId: o.configuration.subscriptionId,
688
+ scheduleInfo: e
689
+ });
690
+ },
691
+ { immediate: !0 }
692
+ );
693
+ const B = _();
694
+ z(
695
+ qe,
696
+ (e) => {
697
+ B.value = e;
698
+ },
699
+ { immediate: !0 }
700
+ );
701
+ const N = p(
702
+ () => re.value.find((e) => e.pricingPlanId === B.value)
703
+ ), k = p(
704
+ () => !!(N.value && !N.value.isCurrent)
705
+ ), {
706
+ invoice: Xe,
707
+ isPending: Ze,
708
+ error: Je,
709
+ load: Qe
710
+ } = st();
711
+ z(
712
+ [U, h, D, H, k],
713
+ ([e, a, l, I, L]) => {
714
+ !a || e.length === 0 || I || L || Qe({
715
+ subscription: a,
716
+ scheduleInfo: l,
379
717
  enabledPricingIds: e
380
718
  });
381
719
  },
382
720
  { immediate: !0 }
383
721
  );
384
- const N = y(!1), B = y(), V = y(!1), F = y(!1), ne = m(
385
- () => !j.value && !N.value && !V.value && !!i.value && !!E.value && !D.value && M.value.length > 0 && he.value && !!R.value && !ee.value && !te.value && !!X.value
386
- ), be = async () => {
387
- if (!(!ne.value || !i.value)) {
388
- N.value = !0, B.value = void 0;
722
+ const {
723
+ invoice: en,
724
+ isPending: nn,
725
+ error: tn,
726
+ load: an,
727
+ reset: sn
728
+ } = ot();
729
+ z(
730
+ [h, B, k, H],
731
+ ([e, a, l, I]) => {
732
+ if (!e || !a || !l || I) {
733
+ sn();
734
+ return;
735
+ }
736
+ an({
737
+ subscriptionId: e.id,
738
+ pricingPlanId: a
739
+ });
740
+ },
741
+ { immediate: !0 }
742
+ );
743
+ const Pe = p(
744
+ () => k.value ? en.value : Xe.value
745
+ ), we = p(
746
+ () => k.value ? nn.value : Ze.value
747
+ ), Ie = p(
748
+ () => k.value ? tn.value : Je.value
749
+ ), on = p(
750
+ () => {
751
+ var e, a, l, I;
752
+ return ((e = N.value) == null ? void 0 : e.name) ?? ((I = (l = (a = D.value) == null ? void 0 : a.pricing_plan_version) == null ? void 0 : l.pricing_plan) == null ? void 0 : I.name);
753
+ }
754
+ ), ce = p(() => re.value.length > 1), rn = p(() => {
755
+ var e, a;
756
+ return k.value && ((e = N.value) == null ? void 0 : e.direction) === "UPGRADE" ? d({
757
+ defaultMessage: "Upgrade plan",
758
+ id: "subscription_management.update_button.upgrade_label",
759
+ description: "Label of the button that moves the subscription to a higher plan in its group"
760
+ }) : k.value && ((a = N.value) == null ? void 0 : a.direction) === "DOWNGRADE" ? d({
761
+ defaultMessage: "Downgrade plan",
762
+ id: "subscription_management.update_button.downgrade_label",
763
+ description: "Label of the button that moves the subscription to a lower plan in its group"
764
+ }) : ce.value && !k.value && !be.value ? d({
765
+ defaultMessage: "Your current plan",
766
+ id: "subscription_management.update_button.current_plan_label",
767
+ description: "Label of the disabled button while the customer has their current plan selected and nothing changed"
768
+ }) : d({
769
+ defaultMessage: "Update subscription",
770
+ id: "subscription_management.update_button.label",
771
+ description: "Label of the button that commits the subscription change"
772
+ });
773
+ }), W = _(!1), Y = _(), le = _(!1), ue = _(), de = _(!1), Me = p(
774
+ () => !ie.value && !W.value && !le.value && !!h.value && !H.value && je.value && (k.value || !!G.value && U.value.length > 0 && be.value) && !we.value && !Ie.value && !!Pe.value
775
+ ), cn = async () => {
776
+ if (!Me.value || !h.value)
777
+ return;
778
+ W.value = !0, Y.value = void 0;
779
+ const e = () => d({
780
+ defaultMessage: "Something went wrong. Please try again.",
781
+ id: "subscription_management.update_error",
782
+ description: "Error shown when committing a subscription change fails"
783
+ }), a = !!(x.value && x.value !== h.value.payment_method_id);
784
+ if (x.value && a)
389
785
  try {
390
- await r({
391
- pricingPlanSubscriptionId: i.value.id,
392
- enabledPricings: M.value.map((e) => ({
393
- pricing_id: e
394
- }))
395
- }), F.value = !0;
396
- } catch (e) {
397
- if (O.error(
398
- "SUBSCRIPTION_UPDATE_FAILED",
399
- "Failed to start a new pricing plan schedule",
786
+ await y({
787
+ id: h.value.id,
788
+ paymentMethodId: x.value
789
+ });
790
+ } catch (l) {
791
+ w.error(
792
+ "SUBSCRIPTION_PAYMENT_METHOD_UPDATE_FAILED",
793
+ "Failed to link the payment method to the subscription",
400
794
  {},
401
- e
402
- ), Ze(e)) {
403
- V.value = !0, B.value = o({
404
- defaultMessage: "We couldn't confirm your change. It may still go through, so check your subscription before trying again.",
405
- id: "subscription_management.update_unconfirmed",
406
- description: "Error shown when committing a subscription change got no clear answer, so the change may still have been made"
407
- });
408
- return;
409
- }
410
- B.value = o({
411
- defaultMessage: "Something went wrong. Please try again.",
412
- id: "subscription_management.update_error",
413
- description: "Error shown when committing a subscription change fails"
795
+ l
796
+ ), Y.value = e(), W.value = !1;
797
+ return;
798
+ }
799
+ try {
800
+ k.value && B.value ? (await c({
801
+ id: h.value.id,
802
+ pricingPlanId: B.value
803
+ }), ue.value = N.value) : await r({
804
+ pricingPlanSubscriptionId: h.value.id,
805
+ enabledPricings: U.value.map((l) => ({
806
+ pricing_id: l
807
+ }))
808
+ }), de.value = !0;
809
+ } catch (l) {
810
+ if (k.value ? w.error(
811
+ "SUBSCRIPTION_PLAN_CHANGE_FAILED",
812
+ "Failed to move the subscription to another plan in its group",
813
+ {},
814
+ l
815
+ ) : w.error(
816
+ "SUBSCRIPTION_UPDATE_FAILED",
817
+ "Failed to start a new pricing plan schedule",
818
+ {},
819
+ l
820
+ ), a && fe(), it(l)) {
821
+ le.value = !0, Y.value = d({
822
+ defaultMessage: "We couldn't confirm your change. It may still go through, so check your subscription before trying again.",
823
+ id: "subscription_management.update_unconfirmed",
824
+ description: "Error shown when committing a subscription change got no clear answer, so the change may still have been made"
414
825
  });
415
- } finally {
416
- N.value = !1;
826
+ return;
417
827
  }
828
+ Y.value = e();
829
+ } finally {
830
+ W.value = !1;
418
831
  }
419
- }, Y = m(
832
+ }, pe = p(
420
833
  () => {
421
- var e, n, g;
422
- return ((n = (e = A.value) == null ? void 0 : e.pricing_plan_schedule) == null ? void 0 : n.billing_period) ?? ((g = i.value) == null ? void 0 : g.billing_period);
834
+ var e, a, l;
835
+ return ((a = (e = D.value) == null ? void 0 : e.pricing_plan_schedule) == null ? void 0 : a.billing_period) ?? ((l = h.value) == null ? void 0 : l.billing_period);
423
836
  }
424
- ), k = m(() => F.value ? "updated" : j.value ? "loading" : b.value ? "load-error" : E.value && D.value ? "customized" : E.value && Y.value ? "form" : "empty"), fe = m(() => {
425
- const e = k.value === "customized" ? re : k.value === "form" && Q.value.length === 0 ? u : void 0;
426
- return { form: W, ...e && { "aria-describedby": e } };
837
+ ), {
838
+ isCancellable: ln,
839
+ isRenewable: un,
840
+ pendingVariant: Se,
841
+ confirmedVariant: Ee,
842
+ confirm: dn,
843
+ cancel: pn,
844
+ renew: mn,
845
+ dismiss: gn
846
+ } = Tn({ subscription: h }), { customer: Ce, get: vn } = Dn({ customerId: C.value.customer_id });
847
+ let ke = !1;
848
+ const Ae = () => {
849
+ ke || (ke = !0, vn.execute());
850
+ }, hn = () => {
851
+ Ae(), K.value = !0;
852
+ }, $e = _(!1), xe = (e) => {
853
+ $e.value = !0, Ae(), e === "RENEW" ? mn() : pn();
854
+ }, fn = p(
855
+ () => T.value.find(({ id: e }) => {
856
+ var a;
857
+ return e === ((a = h.value) == null ? void 0 : a.payment_method_id);
858
+ })
859
+ ), bn = () => {
860
+ dn(), fe();
861
+ }, R = p(() => de.value ? "updated" : ie.value ? "loading" : !h.value && Z.value ? "load-error" : _e.value && !ye.value ? "loading" : !G.value && He.value ? "load-error" : (G.value || ce.value) && H.value ? "customized" : (G.value || ce.value) && pe.value ? "form" : "empty"), _n = p(() => {
862
+ const e = R.value === "customized" ? De : void 0;
863
+ return { form: Te, ...e && { "aria-describedby": e } };
427
864
  });
428
- return (e, n) => (s(), c(t(Te), { class: "sv-subscription-management sv-root sv-screen" }, {
429
- header: d(() => [
430
- C("div", st, [
431
- T(t(J), {
865
+ return (e, a) => (s(), g(t(On), { class: "sv-subscription-management sv-root sv-screen" }, {
866
+ header: v(() => [
867
+ A("div", kt, [
868
+ S(t(F), {
432
869
  variant: "heading-2",
433
870
  tag: "h1",
434
- class: "sv-subscription-management__title"
871
+ class: "sv-subscription-management__title grow"
435
872
  }, {
436
- default: d(() => [
437
- w(_(ge.value), 1)
873
+ default: v(() => [
874
+ E(M(Fe.value), 1)
438
875
  ]),
439
876
  _: 1
440
- })
877
+ }),
878
+ R.value !== "updated" ? (s(), V(ge, { key: 0 }, [
879
+ t(un) ? (s(), g(t(ee), {
880
+ key: 0,
881
+ intent: "secondary",
882
+ class: "sv-action sv-action--secondary sv-subscription-management__renew w-full md:w-auto",
883
+ type: "button",
884
+ onClick: a[0] || (a[0] = (l) => xe("RENEW"))
885
+ }, {
886
+ default: v(() => [
887
+ E(M(t(d)({
888
+ defaultMessage: "Renew subscription",
889
+ id: "subscription_details.renew_button.label",
890
+ description: "Label for the renew subscription button on the subscription details page"
891
+ })), 1)
892
+ ]),
893
+ _: 1
894
+ })) : t(ln) ? (s(), g(t(ee), {
895
+ key: 1,
896
+ intent: "secondary",
897
+ class: "sv-action sv-action--secondary sv-subscription-management__cancel w-full md:w-auto",
898
+ type: "button",
899
+ onClick: a[1] || (a[1] = (l) => xe("CANCEL"))
900
+ }, {
901
+ default: v(() => [
902
+ E(M(t(d)({
903
+ defaultMessage: "Cancel subscription",
904
+ id: "subscription_details.cancel_button.label",
905
+ description: "Label for the cancel subscription button on the subscription details page"
906
+ })), 1)
907
+ ]),
908
+ _: 1
909
+ })) : P("", !0)
910
+ ], 64)) : P("", !0)
441
911
  ])
442
912
  ]),
443
- content: d(() => {
444
- var g, f;
913
+ content: v(() => {
914
+ var l, I, L;
445
915
  return [
446
- k.value === "updated" ? (s(), c(at, {
916
+ t(Ee) ? (s(), g(Yn, {
447
917
  key: 0,
448
- class: "sv-subscription-management__success",
449
- "pricing-group-name": (g = E.value) == null ? void 0 : g.name
450
- }, null, 8, ["pricing-group-name"])) : k.value === "loading" ? (s(), c(ue, {
918
+ class: "sv-subscription-management__cancellation-success",
919
+ variant: t(Ee)
920
+ }, null, 8, ["variant"])) : P("", !0),
921
+ R.value === "updated" ? (s(), g(St, {
451
922
  key: 1,
923
+ class: "sv-subscription-management__success",
924
+ "pricing-group-name": ue.value || (l = G.value) == null ? void 0 : l.name,
925
+ "pricing-plan-name": (I = ue.value) == null ? void 0 : I.name
926
+ }, null, 8, ["pricing-group-name", "pricing-plan-name"])) : R.value === "loading" ? (s(), g(Re, {
927
+ key: 2,
452
928
  variant: "section",
453
929
  class: "min-h-[220px]"
454
- })) : k.value === "load-error" ? (s(), c(t(Z), {
455
- key: 2,
930
+ })) : R.value === "load-error" ? (s(), g(t(ve), {
931
+ key: 3,
456
932
  class: "sv-subscription-management__load-error sv-error",
457
- title: t(o)({
933
+ title: t(d)({
458
934
  defaultMessage: "Unable to load this subscription. Please try again later.",
459
935
  id: "subscription_management.load_error",
460
936
  description: "Error shown in place of the manage subscription form when the subscription cannot be loaded"
461
937
  })
462
- }, null, 8, ["title"])) : k.value === "customized" ? (s(), c(oe, {
463
- key: 3,
938
+ }, null, 8, ["title"])) : R.value === "customized" ? (s(), g(Le, {
939
+ key: 4,
464
940
  class: "sv-subscription-management__customized-pricing",
465
941
  icon: "info"
466
942
  }, {
467
- title: d(() => [
468
- w(_(t(o)({
943
+ title: v(() => [
944
+ E(M(t(d)({
469
945
  defaultMessage: "This subscription has custom pricing",
470
946
  id: "subscription_management.customized_pricing.title",
471
947
  description: "Title shown on the manage subscription screen in place of the form when the subscription has pricing customized for it, which cannot be changed here"
472
948
  })), 1)
473
949
  ]),
474
- message: d(() => [
475
- C("span", { id: re }, _(t(o)({
950
+ message: v(() => [
951
+ A("span", { id: De }, M(t(d)({
476
952
  defaultMessage: "Please contact support to change it.",
477
953
  id: "subscription_management.customized_pricing.message",
478
954
  description: "Message shown on the manage subscription screen when the subscription has pricing customized for it, which cannot be changed here"
479
955
  })), 1)
480
956
  ]),
481
957
  _: 1
482
- })) : k.value === "form" && E.value && Y.value ? (s(), c(et, {
483
- key: 4,
484
- id: W,
485
- "enabled-pricing-ids": M.value,
486
- "onUpdate:enabledPricingIds": n[0] || (n[0] = ($) => M.value = $),
487
- "payment-method-id": R.value,
488
- "onUpdate:paymentMethodId": n[1] || (n[1] = ($) => R.value = $),
489
- class: "sv-subscription-management__form",
490
- "pricing-group": E.value,
491
- "payment-methods": Q.value,
492
- "has-expired-payment-method": de.value,
493
- "billing-period": Y.value,
494
- currency: (f = t(i)) == null ? void 0 : f.billing_currency,
495
- disabled: N.value || V.value,
496
- onSubmit: be
497
- }, null, 8, ["enabled-pricing-ids", "payment-method-id", "pricing-group", "payment-methods", "has-expired-payment-method", "billing-period", "currency", "disabled"])) : (s(), c(oe, {
958
+ })) : R.value === "form" && pe.value ? (s(), g(bt, {
498
959
  key: 5,
960
+ id: Te,
961
+ "enabled-pricing-ids": U.value,
962
+ "onUpdate:enabledPricingIds": a[2] || (a[2] = (X) => U.value = X),
963
+ "payment-method-id": x.value,
964
+ "onUpdate:paymentMethodId": a[3] || (a[3] = (X) => x.value = X),
965
+ "pricing-plan-id": B.value,
966
+ "onUpdate:pricingPlanId": a[4] || (a[4] = (X) => B.value = X),
967
+ class: "sv-subscription-management__form",
968
+ "pricing-group": k.value ? void 0 : G.value,
969
+ "plan-options": t(re),
970
+ "payment-methods": se.value,
971
+ "has-expired-payment-method": ze.value,
972
+ "billing-period": pe.value,
973
+ currency: (L = t(h)) == null ? void 0 : L.billing_currency,
974
+ disabled: W.value || le.value,
975
+ avatar: n.avatar,
976
+ "can-add-payment-method": We.value,
977
+ onSubmit: cn,
978
+ onAddPaymentMethod: hn
979
+ }, null, 8, ["enabled-pricing-ids", "payment-method-id", "pricing-plan-id", "pricing-group", "plan-options", "payment-methods", "has-expired-payment-method", "billing-period", "currency", "disabled", "avatar", "can-add-payment-method"])) : (s(), g(Le, {
980
+ key: 6,
499
981
  class: "sv-subscription-management__empty-state",
500
982
  icon: "receipt_long"
501
983
  }, {
502
- title: d(() => [
503
- w(_(t(o)({
984
+ title: v(() => [
985
+ E(M(t(d)({
504
986
  defaultMessage: "Nothing to change",
505
987
  id: "subscription_management.empty_state.title",
506
988
  description: "Title shown on the manage subscription screen when the subscription has nothing the customer can change"
507
989
  })), 1)
508
990
  ]),
509
- message: d(() => [
510
- w(_(t(o)({
991
+ message: v(() => [
992
+ E(M(t(d)({
511
993
  defaultMessage: "This subscription has no options that can be changed right now.",
512
994
  id: "subscription_management.empty_state.message",
513
995
  description: "Message shown on the manage subscription screen when the subscription is not running or has no group of options to choose from"
@@ -517,108 +999,137 @@ const Qe = ["id"], Xe = { class: "sv-subscription-management-form__body grid gri
517
999
  }))
518
1000
  ];
519
1001
  }),
520
- aside: d(() => [
521
- F.value ? (s(), c(t(se), {
1002
+ aside: v(() => [
1003
+ de.value ? (s(), g(t(ee), {
522
1004
  key: 0,
523
1005
  size: "lg",
524
1006
  class: "sv-action sv-action--primary sv-action--full-width sv-subscription-management__done w-full",
525
1007
  type: "button",
526
- onClick: n[2] || (n[2] = (g) => t(I)({ action: "navigate-to-customer-overview" }))
1008
+ onClick: a[5] || (a[5] = (l) => t(b)({ action: "view-customer-overview" }))
527
1009
  }, {
528
- default: d(() => [
529
- w(_(t(o)({
1010
+ default: v(() => [
1011
+ E(M(t(d)({
530
1012
  defaultMessage: "Done",
531
1013
  id: "subscription_management.done_button.label",
532
1014
  description: "Label of the button that leaves the manage subscription screen once the change is committed"
533
1015
  })), 1)
534
1016
  ]),
535
1017
  _: 1
536
- })) : (s(), x(H, { key: 1 }, [
537
- D.value ? K("", !0) : (s(), c(tt, {
1018
+ })) : (s(), V(ge, { key: 1 }, [
1019
+ H.value ? P("", !0) : (s(), g(wt, {
538
1020
  key: 0,
539
1021
  class: "sv-subscription-management__summary",
540
- invoice: t(X),
541
- "is-pending": t(j) || t(ee),
542
- "has-error": !!t(te)
543
- }, null, 8, ["invoice", "is-pending", "has-error"])),
544
- B.value ? (s(), c(t(Z), {
1022
+ invoice: Pe.value,
1023
+ "is-pending": t(ie) || we.value,
1024
+ "has-error": !!Ie.value,
1025
+ "plan-name": on.value,
1026
+ avatar: n.avatar
1027
+ }, {
1028
+ default: v(() => [
1029
+ k.value && N.value ? (s(), g(Ct, {
1030
+ key: 0,
1031
+ class: "sv-subscription-management__plan-change-summary",
1032
+ "change-type": N.value.changeType
1033
+ }, null, 8, ["change-type"])) : P("", !0)
1034
+ ]),
1035
+ _: 1
1036
+ }, 8, ["invoice", "is-pending", "has-error", "plan-name", "avatar"])),
1037
+ Y.value ? (s(), g(t(ve), {
545
1038
  key: 1,
546
1039
  class: "sv-subscription-management__update-error sv-error",
547
- title: B.value
548
- }, null, 8, ["title"])) : K("", !0),
549
- C("div", ot, [
550
- T(t(se), ye({
1040
+ title: Y.value
1041
+ }, null, 8, ["title"])) : P("", !0),
1042
+ A("div", At, [
1043
+ S(t(ee), Mn({
551
1044
  size: "lg",
552
1045
  class: "sv-action sv-action--primary sv-action--full-width sv-subscription-management__update w-full",
553
1046
  type: "submit"
554
- }, fe.value, {
555
- disabled: !ne.value,
556
- loading: N.value
1047
+ }, _n.value, {
1048
+ disabled: !Me.value,
1049
+ loading: W.value
557
1050
  }), {
558
- default: d(() => [
559
- w(_(t(o)({
560
- defaultMessage: "Update subscription",
561
- id: "subscription_management.update_button.label",
562
- description: "Label of the button that commits the subscription change"
563
- })), 1)
1051
+ default: v(() => [
1052
+ E(M(rn.value), 1)
564
1053
  ]),
565
1054
  _: 1
566
1055
  }, 16, ["disabled", "loading"]),
567
- T(Re, {
1056
+ S(qn, {
568
1057
  class: "sv-subscription-management__kpi",
569
- "payment-method-options": t(le)
1058
+ "payment-method-options": t(J)
570
1059
  }, null, 8, ["payment-method-options"])
571
1060
  ])
572
- ], 64))
1061
+ ], 64)),
1062
+ K.value ? (s(), g(t(i), {
1063
+ key: 2,
1064
+ "show-modal": K.value,
1065
+ customer: t(Ce),
1066
+ subscription: t(h),
1067
+ "sub-title": t(d)({
1068
+ defaultMessage: "Add a payment method to pay for your subscription.",
1069
+ id: "subscription_management.add_payment_method.subtitle",
1070
+ description: "Shown under the title of the modal that stores a new payment method on the manage subscription screen"
1071
+ }),
1072
+ onStored: Ye,
1073
+ onClose: a[6] || (a[6] = (l) => K.value = !1)
1074
+ }, null, 8, ["show-modal", "customer", "subscription", "sub-title"])) : P("", !0),
1075
+ $e.value ? (s(), g(t(m), {
1076
+ key: 3,
1077
+ "show-modal": !!t(Se),
1078
+ variant: t(Se),
1079
+ subscription: t(h),
1080
+ customer: t(Ce),
1081
+ "payment-method": fn.value,
1082
+ onConfirmed: bn,
1083
+ onClose: t(gn)
1084
+ }, null, 8, ["show-modal", "variant", "subscription", "customer", "payment-method", "onClose"])) : P("", !0)
573
1085
  ]),
574
1086
  _: 1
575
1087
  }));
576
1088
  }
577
- }), ct = /* @__PURE__ */ U({
1089
+ }), xt = /* @__PURE__ */ j({
578
1090
  __name: "SubscriptionManagement.entry",
579
1091
  props: {
580
- portalToken: { type: Object },
581
1092
  environment: { type: String },
582
1093
  locale: { type: String },
583
1094
  dateLocale: { type: String },
584
1095
  messages: { type: Object },
585
- primaryColor: { type: String },
586
- secondaryColor: { type: String },
587
- isShadowRoot: { type: Boolean },
1096
+ portalToken: { type: Object },
588
1097
  experimentalFeatures: { type: Array },
589
1098
  logLevel: { type: String },
590
1099
  onLog: { type: Function },
591
- allowedPortalTypes: { type: Array },
592
- portalObject: { type: Object },
593
1100
  cssOverrides: { type: [String, Array] },
594
1101
  branding: { type: Object },
1102
+ portalObject: { type: null },
595
1103
  configuration: { type: Object }
596
1104
  },
597
- setup(a) {
598
- const l = ke("subscription-management");
599
- return (u, h) => {
600
- var p;
601
- return s(), c(t(Me), {
602
- entry: u.$props,
603
- "component-name": t(l),
1105
+ setup(n) {
1106
+ const o = $n("subscription-management");
1107
+ return (i, m) => {
1108
+ var u;
1109
+ return s(), g(t(An), {
1110
+ entry: i.$props,
1111
+ "component-name": t(o),
604
1112
  "allowed-portal-types": ["CUSTOMER"],
605
- "required-configuration": { subscriptionId: (p = a.configuration) == null ? void 0 : p.subscriptionId },
606
- onError: h[0] || (h[0] = (o) => u.$emit("error", o))
1113
+ "required-configuration": { subscriptionId: (u = n.configuration) == null ? void 0 : u.subscriptionId }
607
1114
  }, {
608
- default: d(() => [
609
- (s(), c(rt, {
610
- key: a.configuration.subscriptionId,
611
- configuration: a.configuration
612
- }, null, 8, ["configuration"]))
613
- ]),
1115
+ default: v(() => {
1116
+ var f, d;
1117
+ return [
1118
+ (s(), g($t, {
1119
+ key: n.configuration.subscriptionId,
1120
+ configuration: n.configuration,
1121
+ avatar: ((d = (f = n.branding) == null ? void 0 : f.emblem) == null ? void 0 : d.public_url) ?? void 0
1122
+ }, null, 8, ["configuration", "avatar"]))
1123
+ ];
1124
+ }),
614
1125
  _: 1
615
1126
  }, 8, ["entry", "component-name", "required-configuration"]);
616
1127
  };
617
1128
  }
618
- }), { define: Bt } = $e(
619
- ct,
1129
+ }), { define: da } = xn(
1130
+ xt,
620
1131
  "subscription-management"
621
1132
  );
622
1133
  export {
623
- Bt as defineSolvimonSubscriptionManagement
1134
+ da as defineSolvimonSubscriptionManagement
624
1135
  };