@solvimon/solvimon-web 0.1.0-alpha.13 → 0.1.0-alpha.15

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 (135) hide show
  1. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs} +2 -2
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js → BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js} +1 -1
  3. package/dist/ContentWithAsideLayout-DHpnJfGA.js +1 -0
  4. package/dist/{ContentWithAsideLayout-DhfUkZZg.mjs → ContentWithAsideLayout-Dy9xgxuF.mjs} +6 -3
  5. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js +1 -0
  6. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs} +8 -23
  7. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js +1 -0
  8. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs} +1 -1
  9. package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js +1 -0
  10. package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs +27 -0
  11. package/dist/{PaymentHistoryBlock-BiiFJkpT.js → PaymentHistoryBlock-BGbTy4Se.js} +1 -1
  12. package/dist/{PaymentHistoryBlock-D_B099M7.mjs → PaymentHistoryBlock-BKMttUyk.mjs} +1 -1
  13. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js +1 -0
  14. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs} +1 -1
  15. package/dist/{PaymentIntegrationForm-CkXYj9xs.mjs → PaymentIntegrationForm-BGxjGJGz.mjs} +1 -1
  16. package/dist/{PaymentIntegrationForm-bfGmfwQT.js → PaymentIntegrationForm-liOVNKEG.js} +1 -1
  17. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js +1 -0
  18. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BnMmcoAu.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs} +736 -162
  19. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js +1 -0
  20. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs +145 -0
  21. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js +1 -0
  22. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs +139 -0
  23. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +1 -0
  24. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs +170 -0
  25. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs} +48 -23
  26. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js +1 -0
  27. package/dist/component-B53Df2Rt.js +1 -0
  28. package/dist/component-BSnccqm1.mjs +933 -0
  29. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  30. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  31. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  32. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
  33. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  34. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  35. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  36. package/dist/components/Invoice/Invoice.es.js +14 -13
  37. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  38. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  39. package/dist/components/InvoiceHeader/InvoiceHeader.ce.d.ts +3 -0
  40. package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -0
  41. package/dist/components/InvoiceHeader/InvoiceHeader.es.js +123 -0
  42. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  43. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  44. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  45. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  46. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  47. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +11 -110
  48. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  49. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +5 -5
  50. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  51. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  52. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  53. package/dist/components/WalletBalances/WalletBalances.es.js +3 -3
  54. package/dist/core/action-request.types.d.ts +10 -1
  55. package/dist/core/index.cjs.js +1 -1
  56. package/dist/core/index.es.js +1 -1
  57. package/dist/core/types.d.ts +4 -0
  58. package/dist/{customer-hDxW1Dbp.js → customer-B5b2tLhw.js} +1 -1
  59. package/dist/{customer-B31QzznT.mjs → customer-CANPEYH9.mjs} +1 -1
  60. package/dist/en-US-C0gIE4Q1.js +1 -0
  61. package/dist/{en-US-N3CUCsVy.mjs → en-US-DAgOSlgv.mjs} +33 -18
  62. package/dist/index.cjs.js +1 -1
  63. package/dist/index.es.js +1 -1
  64. package/dist/invoices-BCmE_nnb.js +1 -0
  65. package/dist/{invoices-DIYPN2j_.mjs → invoices-DBv0qkgm.mjs} +22 -3
  66. package/dist/nl-NL-Br7muSHK.js +1 -0
  67. package/dist/{nl-NL-B8U9b85I.mjs → nl-NL-DCsmrA8A.mjs} +33 -14
  68. package/dist/{paymentMethods-67b3UlTZ.mjs → paymentMethods-D-5FNN8W.mjs} +11 -3
  69. package/dist/paymentMethods-u5y9B5ng.js +1 -0
  70. package/dist/{payments-Dq6R37Fz.mjs → payments-BK8yzqJ5.mjs} +1 -1
  71. package/dist/{payments-DkHhTHto.js → payments-BTTtcfyI.js} +1 -1
  72. package/dist/{registry-Df_26rJy.mjs → registry-CMo7X2FD.mjs} +9 -3
  73. package/dist/registry-Cx7p19-6.js +1 -0
  74. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  75. package/dist/screens/Checkout/Checkout.es.js +330 -414
  76. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  77. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -13
  78. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  79. package/dist/screens/PayInvoice/PayInvoice.es.js +45 -34
  80. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.ce.d.ts +3 -0
  81. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -0
  82. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +231 -0
  83. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  84. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +756 -720
  85. package/dist/solvimon-web.css +1 -1
  86. package/dist/{subscriptions-jelITJcX.js → subscriptions-AMC4DirD.js} +1 -1
  87. package/dist/{subscriptions-ClGIr_aS.mjs → subscriptions-DHjXDyH1.mjs} +2 -2
  88. package/dist/{adyen-Bwewy3HC.mjs → url-1Lbg5Yni.mjs} +35 -35
  89. package/dist/url-B6-3PkW2.js +1 -0
  90. package/dist/{useActionDispatchProvider-rw9kWeE0.js → useActionDispatchProvider-CizNgRwv.js} +1 -1
  91. package/dist/{useActionDispatchProvider-BC57-Ufn.mjs → useActionDispatchProvider-DmhD9mYX.mjs} +1 -1
  92. package/dist/{useCustomer-Ba9WRtuT.mjs → useCustomer-DCPq7eHM.mjs} +2 -2
  93. package/dist/{useCustomer-CUcaeQn_.js → useCustomer-DYc54GVD.js} +1 -1
  94. package/dist/useIncrementalLoading-CuSndpP2.js +1 -0
  95. package/dist/{useIncrementalLoading-Cnzh2mAz.mjs → useIncrementalLoading-DmOT2MXH.mjs} +4 -4
  96. package/dist/{useInvoiceData-lIMEwwMy.js → useInvoiceData-BajCyf-x.js} +1 -1
  97. package/dist/{useInvoiceData-D7YN2SAd.mjs → useInvoiceData-BgtUKbHY.mjs} +2 -2
  98. package/dist/{useInvoicesList-CFzAxyae.mjs → useInvoicesList-DRD5yix0.mjs} +4 -4
  99. package/dist/useInvoicesList-wnvjyB_H.js +1 -0
  100. package/dist/{useLoadInitialData-DjwRHcAH.js → useLoadInitialData-BObRB7Vo.js} +1 -1
  101. package/dist/{useLoadInitialData-5sgImpzc.mjs → useLoadInitialData-IlbmC6p0.mjs} +1 -1
  102. package/dist/{usePaymentMethodOptions-DYO6xr3-.js → usePaymentMethodOptions-CzqsebhN.js} +1 -1
  103. package/dist/{usePaymentMethodOptions-C2k4npCQ.mjs → usePaymentMethodOptions-DRkWBjv6.mjs} +2 -2
  104. package/dist/{usePaymentMethods-CRWbH48K.mjs → usePaymentMethods-DFkRNreh.mjs} +2 -2
  105. package/dist/{usePaymentMethods-ryN_YohI.js → usePaymentMethods-ZPxKg5Y3.js} +1 -1
  106. package/dist/{usePayments-DWXPGFvp.js → usePayments-DwiGafZj.js} +1 -1
  107. package/dist/{usePayments-Cw5PPEJa.mjs → usePayments-E_Jsqo98.mjs} +3 -3
  108. package/dist/{usePortal-CxX4nrE4.js → usePortal-CxTS2TQh.js} +1 -1
  109. package/dist/{usePortal-cmE08vYs.mjs → usePortal-DcOz9FEL.mjs} +1 -1
  110. package/dist/{useService-Bb9r_sOQ.js → useService-CHrkefKd.js} +1 -1
  111. package/dist/{useService-BsSEI8DZ.mjs → useService-DF57xuDd.mjs} +1 -1
  112. package/dist/{useWalletBalanceItems-CpZ1NWPr.js → useWalletBalanceItems-BQEXDCBg.js} +1 -1
  113. package/dist/{useWalletBalanceItems-CkDqmk36.mjs → useWalletBalanceItems-MlHgedWR.mjs} +3 -3
  114. package/dist/{vendor-ui-C0K3osvz.mjs → vendor-ui-B8IlviSs.mjs} +6482 -5866
  115. package/dist/vendor-ui-C3Tq-qY_.js +1 -0
  116. package/package.json +5 -4
  117. package/dist/ContentWithAsideLayout-B5B8Kwaw.js +0 -1
  118. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +0 -1
  119. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +0 -1
  120. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +0 -1
  121. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CiyyUp4z.js +0 -1
  122. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs +0 -50
  123. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +0 -1
  124. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +0 -1
  125. package/dist/adyen-R6aSZ0Yf.js +0 -1
  126. package/dist/component-BOqPDAVk.js +0 -1
  127. package/dist/component-Djrf1L-Z.mjs +0 -889
  128. package/dist/en-US-CgPY97Vq.js +0 -1
  129. package/dist/invoices-DzkA1jDc.js +0 -1
  130. package/dist/nl-NL-qMRaTRrM.js +0 -1
  131. package/dist/paymentMethods-C_sdTkSF.js +0 -1
  132. package/dist/registry-BkViv4tv.js +0 -1
  133. package/dist/useIncrementalLoading-DoTTXM2Y.js +0 -1
  134. package/dist/useInvoicesList-CaBCGs4h.js +0 -1
  135. package/dist/vendor-ui-5pJF5KBP.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-5pJF5KBP.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js"),a=require("../../paymentMethods-C_sdTkSF.js"),i=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),r=require("../../component-BOqPDAVk.js"),o=require("../../useActionDispatchProvider-rw9kWeE0.js"),s=require("../../usePortal-CxX4nrE4.js"),c={id:"ppsu_hwDeeN0vhvcVCsAIdp1G",pricing_plan_schedule_infos:[{id:"ppsc_IwDeeN0vhvcVCIAQdq1a",pricing_plan_version_id:"ppve_MwDeeN0vhvcEuaADdd1f",start_at:"2026-04-05T22:00:00Z",pricing_plan_version:{pricing_categories:[{product_category:{id:"proc_iwDeeN0vhphn6VAtBD1w",name:"Add ons"},display_order:1,pricings:[{id:"pric_ywDeeN0vhvcPguAadr1V",name:"Integration setup",products:[{name:"Integration setup"}],items:[{id:"prii_NwDeeN0vhvcPguAxds12",product_items:[{name:"Rillet integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{fixed_amount:{quantity:"5000.00",currency:"EUR"}}]}]},{id:"prii_IwDeeN0vhvcPgvAsdS1Q",product_items:[{name:"Attio integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{amount:{quantity:"50000.00",currency:"EUR"}}]}]}]}],pricing_groups:[]}]}}]},l=e=>{var t,n;return((null==(t=e.configs)?void 0:t.some(e=>e.on_demand))??!1)&&((null==(n=e.product_items)?void 0:n.some(e=>"ONE_OFF"===e.model_type))??!1)},d=e=>{var t,n;return{id:e.id,name:null==(n=null==(t=e.product_items)?void 0:t[0])?void 0:n.name,items:[{id:e.id,configs:(e.configs??[]).map(e=>({bands:(e.bands??[]).map(e=>({fixed_amount:e.fixed_amount??e.amount}))}))}]}},p=e=>(e.items??[]).filter(l).map(d),u=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(p),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(p)})).filter(e=>e.pricings.length>0)}),m=Object.fromEntries(c.pricing_plan_schedule_infos.flatMap(e=>e.pricing_plan_version.pricing_categories).flatMap(e=>e.pricings).flatMap(e=>e.items).filter(l).map(e=>{var t,n,a,i,r;const o=null==(a=null==(n=null==(t=e.configs)?void 0:t[0])?void 0:n.bands)?void 0:a[0],s=(null==(i=null==o?void 0:o.fixed_amount)?void 0:i.quantity)??(null==(r=null==o?void 0:o.amount)?void 0:r.quantity)??"0";return[e.id,parseFloat(s)]})),_=e=>({quantity:e.toFixed(2),currency:"EUR"}),g={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},v={id:"intg_zwDeeN0vgXgeM6APNW1g",object_type:"INTEGRATION",reference:"mock-payment-integration",name:"Mock payment integration",description:"Mock payment integration",status:"ACTIVE",type:"PAYMENT_GATEWAY"},y={class:"sv-order-summary__items mb-3 flex flex-col gap-2"},f={class:"sv-order-summary__tax flex flex-col gap-1 border-t pt-3"},h={class:"sv-order-summary__subtotal flex items-center justify-between"},b={class:"sv-order-summary__tax-row flex items-center justify-between"},k={class:"sv-order-summary__total flex items-center justify-between border-t pt-3"},x=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},isPending:{type:Boolean}},setup(n){const a=n,{$t:i}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,n,a,i,r,o;return null==(o=null==(r=null==(i=null==(a=null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.configs)?void 0:a[0])?void 0:i.bands)?void 0:r[0])?void 0:o.fixed_amount};return(a,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{class:"sv-order-summary sv-upgrade-subscription__order-summary"},{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-order-summary__title mb-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"})),1)]),_:1}),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-sm",shade:"lighter",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Select add-ons to see pricing.",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no add-ons are selected in the order summary"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.selectedPricings,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"sv-order-summary__item flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"sv-order-summary__item-name"},{default:e.withCtx(()=>{var t,a;return[e.createTextVNode(e.toDisplayString(n.name??(null==(a=null==(t=n.products)?void 0:t[0])?void 0:a.name)),1)]}),_:2},1024),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",class:"sv-order-summary__item-meta"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})]),o(n)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-sm",class:"sv-order-summary__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(o(n))),1)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),(null==(a=n.invoice)?void 0:a.tax_summary)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",f,[e.createElementVNode("div",h,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total excluding taxes",id:"upgrade_subscription.order_summary.subtotal_label",description:"Subtotal before tax label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.base_amount)),1)]),_:1})]),e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Taxes",id:"upgrade_subscription.order_summary.taxes_label",description:"Tax amount label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.tax_amount)),1)]),_:1})])]),e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total due today",id:"upgrade_subscription.order_summary.total_label",description:"Total amount due today label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.total_amount)),1)]),_:1})])],64)):e.createCommentVNode("",!0)],64))]}),_:1}))}}),N=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean}},emits:["toggle"],setup(a,{emit:i}){const r=a,o=i,{$t:s}=t.useIntl(),c=e.computed(()=>{var e,t;return r.pricing.name??(null==(t=null==(e=r.pricing.products)?void 0:e[0])?void 0:t.name)??"—"}),l=e.computed(()=>{var e,t,n,a,i,o;return null==(o=null==(i=null==(a=null==(n=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:n[0])?void 0:a.bands)?void 0:i[0])?void 0:o.fixed_amount}),d=e.computed(()=>l.value?`${t.formatAmount(l.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(i,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"content-background":a.selected?"none":"gray",class:e.normalizeClass({"!bg-white":a.selected})},{default:e.withCtx(()=>[e.createVNode(n._sfc_main,{name:c.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:1,color:"primary",size:"sm","icon-prefix":"add",onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1}))]),_:1},8,["name","description"])]),_:1},8,["content-background","class"]))}}),w={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},B=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array}},emits:["toggle"],setup(n,{emit:a}){const i=n,r=a,o=e.computed(()=>[...i.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0)));return(a,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((null==(t=a.product_category)?void 0:t.name)??a.name),1)]}),_:2},1024),e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(N,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[0]||(i[0]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(N,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[1]||(i[1]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128))],64))),128))])]))),128))}}),V={class:"sv-payment-method-picker flex flex-col gap-4"},C={key:0,class:"sv-payment-method-picker__saved flex flex-col gap-2"},E={class:"sv-payment-method-picker__options flex flex-col gap-1"},S={key:1,class:"sv-payment-method-picker__new flex flex-col gap-2"},T={class:"sv-payment-method-picker__options flex flex-col gap-1"},A={class:"sv-payment-method-picker__option-content flex items-center gap-3"},I={key:0,class:"sv-payment-method-picker__option-icon flex h-9 w-9 shrink-0 items-center gap-0.5"},D=["src","alt"],M={key:1,class:"sv-payment-method-picker__option-icon flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},P=["src","alt"],O={key:2,class:"sv-payment-method-picker__loading flex flex-col gap-1"},j=e.defineComponent({__name:"PaymentMethodPicker",props:{customerId:{type:String},subscriptionId:{type:String},selectedId:{type:String}},emits:["select"],setup(n,{emit:i}){const r=n,o=i,{$t:s}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),l=e.ref([]),d=e.ref([]),p=e.ref(!1),u=e.computed(()=>d.value.flatMap(e=>e.options??[])),m=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,_=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[..._.filter(t=>e.includes(t)),...e.filter(e=>!_.includes(e))].slice(0,4)};return e.onMounted(async()=>{p.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});l.value=e.data,d.value=[{payment_acceptor:g,integration:v,options:[{name:"iDeal",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"iDEAL | Wero",type:"ideal"}},{name:"Cards",payment_method_variant:"CARD",payment_gateway_variant:"ADYEN",adyen:{name:"Cards",type:"scheme",brands:["maestro","accel","amex","cup","diners","hipercard","jcb","mc","nyce","pulse","star","visa"]}},{name:"PayPal",payment_method_variant:"DIGITAL_WALLET",payment_gateway_variant:"ADYEN",adyen:{name:"PayPal",type:"paypal",configuration:{intent:"capture"}}},{name:"Trustly",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"Trustly - Instant Bank Payment",type:"trustly"}}]}]}finally{p.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",V,[l.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-payment-method-picker__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Saved payment methods",id:"upgrade_subscription.payment_picker.saved_title",description:"Heading for the saved payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:a.id,"content-background":n.selectedId===a.id?"none":"gray",class:e.normalizeClass([{"sv-payment-method-picker__option--selected !bg-white":n.selectedId===a.id},"sv-payment-method-picker__option cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$5),{class:"sv-payment-method-picker__option-content","payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value.length>0?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-payment-method-picker__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"All payment methods",id:"upgrade_subscription.payment_picker.all_title",description:"Heading for the all payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:a.adyen.type,"content-background":n.selectedId===a.adyen.type?"none":"gray",class:e.normalizeClass([{"sv-payment-method-picker__option--selected !bg-white":n.selectedId===a.adyen.type},"sv-payment-method-picker__option cursor-pointer"]),onClick:e=>o("select",a.adyen.type)},{default:e.withCtx(()=>{return[e.createElementVNode("div",A,["scheme"===a.adyen.type?(e.openBlock(),e.createElementBlock("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y(a.adyen.brands),t=>(e.openBlock(),e.createElementBlock("img",{key:t,src:m(t),alt:t,class:"h-5 w-auto rounded"},null,8,D))),128))])):(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("img",{src:(n=a.adyen.type,`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/${n}.svg`),alt:a.name,class:"h-9 w-9 object-contain"},null,8,P)])),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"sv-payment-method-picker__option-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("div",O,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}}),L={class:"flex gap-1"},F=e.defineComponent({__name:"Kpi",props:{icon:{type:null},kpi:{type:String}},setup:n=>(a,i)=>(e.openBlock(),e.createElementBlock("div",L,[e.createVNode(e.unref(t._sfc_main$6),{icon:n.icon,size:"xs"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.kpi),1)]),_:1})]))});const $={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},q={class:"sv-upgrade-subscription__success-body flex flex-col items-center py-10"},R=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(n){const a=n,{$t:l}=t.useIntl(),{dispatchAction:d}=o.useActionDispatchProvider(),{chargeOnDemandPricingItems:p}=function(){const e=r.createRequestService(),t=r.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:n,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${n}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:i,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})}}}(),g=s.usePortal(),v=r.useLogger(),y=e.computed(()=>g.value.customer_id),f=e.ref([]),h=e.ref(void 0),b=e.ref(!1),k=e.ref(!1),N=e.ref(void 0),w=e.ref(!1),V=e.computed(()=>(e=>{var t;const n=Date.now(),a=c.pricing_plan_schedule_infos,i=a.find(e=>{const t=Date.parse(e.start_at);return Number.isFinite(t)&&t<=n})??a[0],r=((null==(t=null==i?void 0:i.pricing_plan_version)?void 0:t.pricing_categories)??[]).map(u).filter(e=>{var t,n;return((null==(t=e.pricings)?void 0:t.length)??0)>0||((null==(n=e.pricing_groups)?void 0:n.length)??0)>0});return{pricing_plan_subscription_id:e||c.id,pricing_plan_schedule_id:(null==i?void 0:i.id)??"",pricing_plan_version_id:(null==i?void 0:i.pricing_plan_version_id)??"",billing_period:{type:"MONTH",value:1},billing_currency:"EUR",pricing_categories:r}})(a.configuration.subscriptionId)),C=e.computed(()=>V.value.pricing_categories),E=e.computed(()=>C.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),S=e.computed(()=>E.value.filter(e=>f.value.includes(e.id)));let T;e.watch(f,e=>{if(clearTimeout(T),0===e.length)return N.value=void 0,void(w.value=!1);w.value=!0,T=setTimeout(()=>{N.value=(e=>{const t=e.reduce((e,t)=>e+(m[t]??0),0),n=Math.round(.21*t*100)/100,a=t+n;return{invoice:{tax_summary:{base_amount:_(t),tax_amount:_(n),total_amount:_(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,w.value=!1},400)});const A=e=>{f.value.includes(e)?f.value=f.value.filter(t=>t!==e):f.value=[...f.value,e]},I=e.computed(()=>f.value.length>0&&!!h.value),D=e.ref(void 0),M=async()=>{if(I.value){b.value=!0,D.value=void 0;try{const e=S.value.map(e=>{var t,n;return null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.id}).filter(e=>!!e),t=h.value&&h.value.startsWith("pmet_")?h.value:void 0,n=await p({scheduleId:V.value.pricing_plan_schedule_id,pricingPlanVersionId:V.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?k.value=!0:d({action:"pay-invoice",data:{invoiceId:n.id}})}catch(e){v.error("PURCHASE_FAILED","Failed to complete upgrade subscription purchase",{},e),D.value=l({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})}finally{b.value=!1}}};return(a,r)=>k.value?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(t._sfc_main$1),{class:"sv-upgrade-subscription__success"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(e.unref(t._sfc_main$6),{icon:"check_circle",class:"sv-upgrade-subscription__success-icon text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"span",class:"sv-upgrade-subscription__success-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful add-on purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter",tag:"span",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Your add-ons have been activated.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful add-on purchase"})),1)]),_:1})])]),_:1})])):(e.openBlock(),e.createBlock(e.unref(i.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{content:e.withCtx(()=>[C.value.length>0?(e.openBlock(),e.createBlock(B,{key:0,class:"sv-upgrade-subscription__pricing-list",categories:C.value,"selected-pricing-ids":f.value,onToggle:A},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"No on-demand add-ons are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no on-demand add-ons available for the subscription"})),1)]),_:1})),e.createVNode(e.unref(t._sfc_main$24),{spacing:"sm"}),e.createVNode(j,{class:"sv-upgrade-subscription__payment-method-picker","customer-id":y.value,"subscription-id":n.configuration.subscriptionId,"selected-id":h.value,onSelect:r[0]||(r[0]=e=>h.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(x,{class:"sv-upgrade-subscription__order-summary","selected-pricings":S.value,invoice:N.value,"is-pending":w.value},null,8,["selected-pricings","invoice","is-pending"]),D.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,class:"sv-upgrade-subscription__error sv-error",title:D.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase full-width",type:"button",disabled:!I.value||b.value,loading:b.value,onClick:M},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(t._sfc_main),{tag:"div",variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__trust-indicator flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(F,{icon:"lock",kpi:e.unref(l)({defaultMessage:"Secure and encrypted payments",id:"upgrade_subscription.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown on the upgrade subscription page"})},null,8,["kpi"])]),_:1})]),_:1}))}}),z=e.defineComponent({__name:"UpgradeSubscription.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:t=>(n,a)=>{var i,o,s,c;return e.openBlock(),e.createBlock(r._sfc_main,{"custom-element-name":e.unref(Y),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(i=t.branding)?void 0:i.colors)?void 0:o.primary,"secondary-color":null==(c=null==(s=t.branding)?void 0:s.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(R,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),U=r.defineCustomElement(z),Y=r.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=Y,exports.SolvimonUpgradeSubscription=U,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(Y)||customElements.define(Y,U)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-C3Tq-qY_.js"),i=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js"),a=require("../../ContentWithAsideLayout-DHpnJfGA.js"),n=require("../../component-B53Df2Rt.js"),r=require("../../useActionDispatchProvider-CizNgRwv.js"),o=require("../../usePortal-CxTS2TQh.js"),s=require("../../subscriptions-AMC4DirD.js"),l=require("../../customer-B5b2tLhw.js"),c=require("../../paymentMethods-u5y9B5ng.js"),d=require("../../invoices-BCmE_nnb.js"),u=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),p=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),m=require("../../url-B6-3PkW2.js"),g=require("../../useViewport-CKRY1CKR.js"),v={class:"sv-order-summary__body grid grid-cols-1 gap-1"},_={class:"flex items-center justify-center gap-2 px-3 py-5"},f={class:"flex flex-row gap-3 px-3 py-2"},y={class:"grow"},h={class:"sv-order-summary__items grid grid-cols-1 gap-1"},b={class:"flex flex-row gap-2 px-3 py-2"},w={class:"flex flex-row gap-3 px-3 py-2"},k={class:"grow"},x={class:"flex flex-row gap-2 px-3 py-2"},N=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},loading:{type:Boolean}},setup(i){const a=i,{$t:n}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,i,a,n,r;const o=null==(r=null==(n=null==(a=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:a[0])?void 0:n.bands)?void 0:r[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)},s=e.computed(()=>{var e,t,i,r,o,s,c,d;const u=null==(r=null==(i=null==(t=null==(e=a.invoice)?void 0:e.periods)?void 0:t[0])?void 0:i.groups)?void 0:r[0],p=null==(o=null==u?void 0:u.products)?void 0:o[0],m=l.value.length;return{title:(null==p?void 0:p.name)??(null==(s=null==u?void 0:u.product_category)?void 0:s.name)??(null==(c=l.value[0])?void 0:c.description),subtitle:m>1?n({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.item_count",description:"Subtitle shown below the product name when multiple one-off items are selected"},{count:String(m)}):null==(d=l.value[0])?void 0:d.description}}),l=e.computed(()=>{var e;return((null==(e=a.invoice)?void 0:e.periods)??[]).flatMap((e,t)=>e.groups.flatMap((e,i)=>(e.lines??[]).map((a,n)=>{var r,o,s,l,c;return{key:`${t}-${i}-${n}`,description:a.description??(null==(o=null==(r=a.product_items)?void 0:r[0])?void 0:o.name)??(null==(l=null==(s=e.products)?void 0:s[0])?void 0:l.name)??(null==(c=e.product_category)?void 0:c.name)??"—",amount:a.amount_excluding_tax}})))}),c=e.computed(()=>a.selectedPricings.map(e=>{var t,i;return{key:e.id,description:e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)??"—",amount:o(e)}})),d=e.computed(()=>n({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"}));return(a,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-order-summary sv-upgrade-subscription__order-summary","no-border":"","no-spacing":"","content-background":"none",title:d.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,[r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$14),{icon:"shopping_cart",class:"text-gray-500"}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Select your items",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no items are selected in the order summary"})),1)]),_:1})])]),_:1})):i.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value.title?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.title),1)]),_:1}),s.value.subtitle?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.subtitle),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128))]),e.createVNode(e.unref(t._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$18),{class:"sv-order-summary__invoice-preview",variant:"without-products",invoice:i.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"Selected items",id:"upgrade_subscription.order_summary.selected_items_title",description:"Temporary order summary title shown while the invoice preview is loading"}):null==(t=c.value[0])?void 0:t.description),1)]}),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.selected_item_count",description:"Temporary order summary subtitle shown while the invoice preview is loading"},{count:String(c.value.length)}):e.unref(n)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})])])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",x,[e.createVNode(e.unref(t._sfc_main$3),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128)),i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-order-summary__totals"},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("div",{class:"grid grid-cols-1 gap-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-40 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-16 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"border-t border-gray-200 pt-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-5 w-36 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-5 w-24 animate-pulse rounded bg-gray-100"})])])],-1)])]),_:1})):e.createCommentVNode("",!0)],64))])]),_:1},8,["title"]))}}),V=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean},loading:{type:Boolean}},emits:["toggle"],setup(a,{emit:n}){const r=a,o=n,{$t:s}=t.useIntl(),l=e.computed(()=>{var e,t,i,a,n,o;return r.pricing.name??(null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.product_items)?void 0:i[0])?void 0:a.name)??(null==(o=null==(n=r.pricing.products)?void 0:n[0])?void 0:o.name)??"—"}),c=e.computed(()=>{var e,t,i,a,n;const o=null==(n=null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:i[0])?void 0:a.bands)?void 0:n[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)}),d=e.computed(()=>c.value?`${t.formatAmount(c.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(n,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"content-background":a.selected?"none":"gray","content-classes":a.selected?"!border-primary-600 ring-1 ring-primary-600":void 0},{default:e.withCtx(()=>[e.createVNode(i._sfc_main,{name:l.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",loading:a.loading,onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1},8,["loading"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:1,color:"primary",size:"sm","icon-prefix":"add",loading:a.loading,onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1},8,["loading"]))]),_:1},8,["name","description"])]),_:1},8,["content-background","content-classes"]))}}),B={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},C=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array},loadingPricingId:{type:String}},emits:["toggle"],setup(i,{emit:a}){const n=i,r=a,{$t:o}=t.useIntl(),s=e.computed(()=>[...n.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0))),l=e=>{var t;return(null==(t=e.product_category)?void 0:t.name)??e.name??o({defaultMessage:"Items",id:"on_demand_pricing_list.category_fallback_title",description:"Fallback title for the selectable pricing items when no product category name is available"})};return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(a)),1)]),_:2},1024),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[0]||(n[0]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[1]||(n[1]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128))],64))),128))])]))),128))}});const E={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},S={class:"flex flex-col items-center text-center"},T={class:"sv-upgrade-subscription__header"},P={key:1,class:"sv-upgrade-subscription__pricing-list"},I={key:2,class:"sv-upgrade-subscription__loading p-4"},$={class:"sv-upgrade-subscription__payment-methods"},D={key:0,class:"sv-upgrade-subscription__payment-methods-body"},M={key:1,class:"sv-upgrade-subscription__payment-form"},j={class:"sv-upgrade-subscription__order-summary"},O={class:"flex flex-col gap-2"},A=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(v){const _=v,{$t:f}=t.useIntl(),{getSubscription:y}=s.createSubscriptionsService(),{getCustomer:h}=l.createCustomerService(),{getOnDemandPricingItems:b}=function(){const e=n.createRequestService(),t=n.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:i,pricingPlanVersionId:a,pricingItemIds:n,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:n,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})},getOnDemandPricingItems:function({scheduleId:i}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/on-demand-pricing-items`})}}}(),{getPaymentMethodOptions:w}=c.createPaymentMethodsService(),{previewChargeOnDemandPricingItems:k}=d.createInvoicesService(),x=o.usePortal(),V=n.useLogger(),{dispatchAction:B}=r.useActionDispatchProvider(),{isMobileViewport:A}=g.useViewport(),F=e.computed(()=>x.value.customer_id),L={currency:"EUR",quantity:"0"},q=e.ref([]),U=e.ref(!1),R=e.ref([]),z=e.ref([]),W=e.ref(!1),G=e.ref(!1),H=e.ref(!1),Y=e.ref(void 0),K=e.ref(void 0),Z=e.ref(),J=e.ref(void 0),Q=e.ref(void 0),X=e.ref(void 0),ee=(e,t=[])=>t.find(t=>t.id===e.id),te=(e,t)=>(e.items??[]).map(i=>{var a,n,r,o,s,l,c;const d=null==(a=null==t?void 0:t.items)?void 0:a.find(e=>e.id===i.id),u=i.product_items??(null==d?void 0:d.product_items);return{...e,id:i.id,name:(null==(r=null==(n=i.product_items)?void 0:n[0])?void 0:r.name)??(null==(s=null==(o=null==d?void 0:d.product_items)?void 0:o[0])?void 0:s.name)??e.name??(null==t?void 0:t.name)??(null==(c=null==(l=null==t?void 0:t.products)?void 0:l[0])?void 0:c.name),products:e.products??(null==t?void 0:t.products),items:[{...i,product_items:u}]}}),ie=async()=>{var e,i,a;W.value=!0,K.value=void 0;try{const n=await(async()=>{const e=[...(await y({id:_.configuration.subscriptionId,expanded:!0})).pricing_plan_schedule_infos??[]].sort((e,t)=>Date.parse(t.start_at)-Date.parse(e.start_at)),t=Date.now(),i=e.find(e=>{var i;const a=(null==(i=e.pricing_plan_schedule)?void 0:i.type)??e.type,n=Date.parse(e.start_at),r=e.end_at?Date.parse(e.end_at):void 0,o=Number.isFinite(n)&&n<=t,s=void 0===r||!Number.isFinite(r)||r>t;return"DEFAULT"===a&&o&&s});if(!(null==i?void 0:i.id))throw new Error("No pricing plan schedule found for subscription");return i})();J.value=n.id;const[r,o,s]=await Promise.all([b({scheduleId:J.value}),w({customerId:F.value}),h(F.value)]);R.value=(i=r.pricing_categories??[],a=(null==(e=n.pricing_plan_version)?void 0:e.pricing_categories)??[],i.map(e=>{var t;const i=((e,t)=>t.find(t=>t.product_category_id===e.product_category_id))(e,a);return{...e,name:e.name??(null==(t=null==i?void 0:i.product_category)?void 0:t.name),product_category:e.product_category??(null==i?void 0:i.product_category),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==i?void 0:i.pricings))),pricing_groups:(e.pricing_groups??[]).map(e=>{var t;const a=null==(t=null==i?void 0:i.pricing_groups)?void 0:t.find(t=>t.id===e.id);return{...e,name:e.name??(null==a?void 0:a.name),pricings:(e.pricings??[]).flatMap(e=>te(e,ee(e,null==a?void 0:a.pricings)))}})}})),z.value=o,X.value=t.getCustomerCountry(s)}catch(n){V.error("INITIAL_DATA_LOAD_FAILED","Failed to load on-demand pricing items",{},n),K.value=f({defaultMessage:"Unable to load items. Please try again later.",id:"upgrade_subscription.load_error",description:"Error message shown when the one-off items cannot be loaded on the upgrade subscription page"})}finally{W.value=!1}};e.onMounted(()=>{ie()});const ae=e.computed(()=>R.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),ne=e.computed(()=>ae.value.filter(e=>q.value.includes(e.id))),re=e.computed(()=>ne.value.flatMap(e=>e.items??[]).map(e=>e.id).filter(e=>!!e)),oe=e.computed(()=>{var e,t;return null==(t=null==(e=Q.value)?void 0:e.tax_summary)?void 0:t.total_amount}),se=e.computed(()=>oe.value??L);let le,ce=0;e.watch([re,J],([e,t])=>{clearTimeout(le);const i=++ce;if(me.value=void 0,!t||0===e.length)return Q.value=void 0,G.value=!1,void(Y.value=void 0);G.value=!0,le=setTimeout(()=>{k({pricingPlanScheduleId:t,pricingItemIds:e}).then(e=>{i===ce&&(Q.value=e)}).catch(e=>{i===ce&&(V.error("INVOICE_PREVIEW_FAILED","Failed to load charge-on-demand invoice preview",{},e),me.value=f({defaultMessage:"Unable to calculate the total. Please try again.",id:"upgrade_subscription.preview_error",description:"Error message shown when the upgrade subscription invoice preview cannot be loaded"}),Q.value=void 0)}).finally(()=>{i===ce&&(G.value=!1,Y.value=void 0)})},400)});const de=e.computed(()=>{if(!J.value)throw new Error("Cannot create charge-on-demand authorization context without a schedule.");return{type:"CHARGE_ON_DEMAND",charge_on_demand:{pricing_plan_schedule_id:J.value,pricing_items:re.value.map(e=>({pricing_item_id:e}))}}}),ue=e=>{Y.value=e,q.value.includes(e)?q.value=q.value.filter(t=>t!==e):q.value=[...q.value,e]},pe=e.computed(()=>re.value.length>0&&!!J.value&&!!oe.value&&!G.value&&z.value.length>0),me=e.ref(void 0),ge=async()=>{var e;pe.value&&!H.value&&(me.value=void 0,H.value=!0,null==(e=Z.value)||e.submit())},ve=async()=>pe.value;let _e;const fe=()=>{H.value=!1,U.value=!0,_e=setTimeout(()=>{B({action:"navigate-to-customer-overview"})},3e3)},ye=e=>{H.value=!1,me.value=e.message||f({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})};return e.onUnmounted(()=>{clearTimeout(le),clearTimeout(_e)}),(n,r)=>U.value?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(m._sfc_main,{class:"sv-upgrade-subscription__success",status:"success",title:e.unref(f)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful upgrade purchase"})},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Your purchase has been completed.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful upgrade purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-redirect mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"You will be redirected shortly…",id:"upgrade_subscription.success.redirect",description:"Shown below the success message while the redirect timer is running"})),1)]),_:1})])]),_:1},8,["title"])])):(e.openBlock(),e.createBlock(e.unref(a.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",T,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-2",tag:"h1",class:"sv-upgrade-subscription__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Upgrade subscription",id:"upgrade_subscription.title",description:"Title for the upgrade subscription page"})),1)]),_:1})])]),content:e.withCtx(()=>[e.unref(A)?(e.openBlock(),e.createBlock(N,{key:0,class:"sv-upgrade-subscription__mobile-order-summary","selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])):e.createCommentVNode("",!0),!W.value&&!K.value&&R.value.length>0?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(C,{categories:R.value,"selected-pricing-ids":q.value,"loading-pricing-id":Y.value,onToggle:ue},null,8,["categories","selected-pricing-ids","loading-pricing-id"])])):W.value?(e.openBlock(),e.createElementBlock("div",I,[...r[0]||(r[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):K.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:3,class:"sv-upgrade-subscription__load-error sv-error m-4",title:K.value},null,8,["title"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:4,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No one-off items are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no one-off items available for the subscription"})),1)]),_:1})),e.createElementVNode("div",$,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!W.value||W.value&&z.value.length>0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(t._sfc_main$3),{variant:"heading-3",tag:"h2",class:"sv-upgrade-subscription__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment method",id:"upgrade_subscription.payment_method_block.title",description:"The title of the payment method block in the upgrade subscription flow"})),1)]),_:1}),0===z.value.length?(e.openBlock(),e.createBlock(i._sfc_main$2,{key:0,class:"sv-upgrade-subscription__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No payment methods available",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):X.value&&J.value?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{class:e.normalizeClass(["sv-upgrade-subscription__payment-method-picker",{"pointer-events-none opacity-60":H.value}])},[e.createVNode(u._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:Z,"customer-id":F.value,"country-code":X.value,context:de.value,amount:se.value,variant:"AUTHORIZE","payment-method-options":z.value,"validate-on-submit":ve,"force-store-payment-method":"",onPaymentSuccess:fe,onPaymentFailed:ye},null,8,["customer-id","country-code","context","amount","payment-method-options"])],2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])]),aside:e.withCtx(()=>[e.createElementVNode("div",j,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>[e.createVNode(N,{"selected-pricings":ne.value,invoice:Q.value,loading:G.value},null,8,["selected-pricings","invoice","loading"])]),_:1})]),me.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$17),{key:0,class:"sv-upgrade-subscription__error sv-error",title:me.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",O,[e.createVNode(p._sfc_main,{class:"sv-upgrade-subscription__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase w-full",type:"button",disabled:!pe.value||H.value,loading:H.value,onClick:ge},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"])]),_:1}),e.createVNode(i._sfc_main$1,{"payment-method-options":z.value},null,8,["payment-method-options"])])]),_:1}))}}),F=e.defineComponent({__name:"UpgradeSubscription.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:t=>(i,a)=>{var r,o,s,l;return e.openBlock(),e.createBlock(n._sfc_main,{"custom-element-name":e.unref(q),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=t.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(l=null==(s=t.branding)?void 0:s.colors)?void 0:l.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(A,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),L=n.defineCustomElement(F),q=n.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=L,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,L)};