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