@solvimon/solvimon-web 0.1.0-alpha.15 → 0.1.0-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-ugPPvTKf.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs} +2 -2
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-xuCWAVgf.js → BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BpN9nSMC.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D_PE2UbX.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs} +3 -3
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js +1 -0
- package/dist/{useWalletBalanceItems-MlHgedWR.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs} +24 -56
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js +1 -0
- package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3cqlbGY.mjs +147 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-dwIv_xxf.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-wxP5IaGt.mjs} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-05NKI2A0.js} +1 -1
- package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-17v07F58.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BKMttUyk.mjs → PaymentHistoryBlock-BitwS9Re.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-BGbTy4Se.js → PaymentHistoryBlock-ZtmPXXwI.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3ZUDUdw.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CMGK71zZ.js} +1 -1
- package/dist/{PaymentIntegrationForm-BGxjGJGz.mjs → PaymentIntegrationForm-BK2aLPCo.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-liOVNKEG.js → PaymentIntegrationForm-BZTzCUiu.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-aP-gCq7V.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs} +7 -7
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js +1 -0
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-h-JUw1DV.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs} +25 -14
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js +1 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-BQIN3zuf.mjs +156 -0
- package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DyL2-vV0.js +1 -0
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-j5VNsyu7.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DxndhDxR.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js} +1 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BxqIfmkK.js +1 -0
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D1TcP9PR.mjs} +115 -68
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js +1 -0
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BMXr26gF.mjs +37 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Cv6lz35J.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs} +22 -119
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js +1 -0
- package/dist/component-CUJ_G2Nw.mjs +962 -0
- package/dist/component-CiKxWtdx.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +7 -7
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -58
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +8 -6
- package/dist/core/action-request.types.d.ts +3 -3
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -2
- package/dist/{customer-B5b2tLhw.js → customer-AfRcAZ5P.js} +1 -1
- package/dist/{customer-CANPEYH9.mjs → customer-DAgdegIW.mjs} +1 -1
- package/dist/{en-US-DAgOSlgv.mjs → en-US-DSzSbgL5.mjs} +68 -36
- package/dist/en-US-QzQnGXP1.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.es.js +7 -4
- package/dist/invoices-BHgajZHq.js +1 -0
- package/dist/{invoices-DBv0qkgm.mjs → invoices-BXDgW8ch.mjs} +32 -16
- package/dist/nl-NL-C4rr-1tr.js +1 -0
- package/dist/{nl-NL-DCsmrA8A.mjs → nl-NL-Li7RW89R.mjs} +72 -40
- package/dist/{paymentMethods-u5y9B5ng.js → paymentMethods-BMcc-eTl.js} +1 -1
- package/dist/{paymentMethods-D-5FNN8W.mjs → paymentMethods-xzFD2L30.mjs} +2 -2
- package/dist/{payments-BTTtcfyI.js → payments-DMvmB5vg.js} +1 -1
- package/dist/{payments-BK8yzqJ5.mjs → payments-DV6csRej.mjs} +1 -1
- package/dist/pricing-B1uImUm4.mjs +19 -0
- package/dist/pricing-BEjY_5wb.js +1 -0
- package/dist/pricingPlanSchedule-B9HFiXy-.js +1 -0
- package/dist/pricingPlanSchedule-C_cqUyTk.mjs +144 -0
- package/dist/registry-CeMxLjwU.js +1 -0
- package/dist/{registry-CMo7X2FD.mjs → registry-CyENvS6l.mjs} +7 -4
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +414 -675
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +65 -19
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +10 -9
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +8 -8
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.ce.d.ts +3 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -0
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +542 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.ce.d.ts +3 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -0
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +725 -0
- package/dist/solvimon-web.css +1 -1
- package/dist/subscription-B4dBAY9C.mjs +89 -0
- package/dist/subscription-b0OPx8Du.js +1 -0
- package/dist/{subscriptions-DHjXDyH1.mjs → subscriptions-CrNDM9qa.mjs} +6 -2
- package/dist/{subscriptions-AMC4DirD.js → subscriptions-DC-mxa17.js} +1 -1
- package/dist/{url-1Lbg5Yni.mjs → url-BjZ1Pg0l.mjs} +1 -1
- package/dist/url-D8GJi5rF.js +1 -0
- package/dist/{useActionDispatchProvider-CizNgRwv.js → useActionDispatchProvider-bqR_FeM4.js} +1 -1
- package/dist/{useActionDispatchProvider-DmhD9mYX.mjs → useActionDispatchProvider-zB_GKeUR.mjs} +1 -1
- package/dist/{useCustomer-DCPq7eHM.mjs → useCustomer-VfeQ6rG2.mjs} +2 -2
- package/dist/{useCustomer-DYc54GVD.js → useCustomer-bO4D6e4Z.js} +1 -1
- package/dist/{useIncrementalLoading-CuSndpP2.js → useIncrementalLoading-BgWuwoMo.js} +1 -1
- package/dist/{useIncrementalLoading-DmOT2MXH.mjs → useIncrementalLoading-C59FXHzp.mjs} +1 -1
- package/dist/{useInvoiceData-BajCyf-x.js → useInvoiceData-CxxkBTGY.js} +1 -1
- package/dist/{useInvoiceData-BgtUKbHY.mjs → useInvoiceData-Dhg-hx8C.mjs} +2 -2
- package/dist/useInvoicesList-BXZ9uV9i.js +1 -0
- package/dist/{useInvoicesList-DRD5yix0.mjs → useInvoicesList-DBz7T7sM.mjs} +4 -4
- package/dist/{useLoadInitialData-IlbmC6p0.mjs → useLoadInitialData-BhpIg7OF.mjs} +1 -1
- package/dist/{useLoadInitialData-BObRB7Vo.js → useLoadInitialData-BqiAFNFi.js} +1 -1
- package/dist/{usePaymentMethodOptions-CzqsebhN.js → usePaymentMethodOptions-DszFvgKX.js} +1 -1
- package/dist/{usePaymentMethodOptions-DRkWBjv6.mjs → usePaymentMethodOptions-PcMjtMSF.mjs} +2 -2
- package/dist/{usePaymentMethods-DFkRNreh.mjs → usePaymentMethods-B5AbGWsn.mjs} +2 -2
- package/dist/{usePaymentMethods-ZPxKg5Y3.js → usePaymentMethods-Bb1Xbads.js} +1 -1
- package/dist/{usePayments-E_Jsqo98.mjs → usePayments-DgoZoBZh.mjs} +3 -3
- package/dist/{usePayments-DwiGafZj.js → usePayments-is5c66Z6.js} +1 -1
- package/dist/{usePortal-CxTS2TQh.js → usePortal-C4qWsJeq.js} +1 -1
- package/dist/{usePortal-DcOz9FEL.mjs → usePortal-DWLtNqBB.mjs} +1 -1
- package/dist/{useService-DF57xuDd.mjs → useService-BZqFkz7p.mjs} +1 -1
- package/dist/{useService-CHrkefKd.js → useService-DKm3QtT4.js} +1 -1
- package/dist/useSubscription-CEZJw6wZ.mjs +23 -0
- package/dist/useSubscription-DuUNc1_l.js +1 -0
- package/dist/useTopUpModal-DNyWrHDv.mjs +1012 -0
- package/dist/useTopUpModal-DeF-cfCK.js +1 -0
- package/dist/{vendor-ui-B8IlviSs.mjs → vendor-ui-BoGKOJ36.mjs} +8642 -7077
- package/dist/vendor-ui-BuRqLx74.js +1 -0
- package/package.json +14 -7
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js +0 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-DfdaWRO0.js +0 -1
- package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D6hHXndB.js +0 -1
- package/dist/component-B53Df2Rt.js +0 -1
- package/dist/component-BSnccqm1.mjs +0 -933
- package/dist/en-US-C0gIE4Q1.js +0 -1
- package/dist/invoices-BCmE_nnb.js +0 -1
- package/dist/nl-NL-Br7muSHK.js +0 -1
- package/dist/registry-Cx7p19-6.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +0 -3
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +0 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +0 -1102
- package/dist/url-B6-3PkW2.js +0 -1
- package/dist/useInvoicesList-wnvjyB_H.js +0 -1
- package/dist/useWalletBalanceItems-BQEXDCBg.js +0 -1
- package/dist/vendor-ui-C3Tq-qY_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-BXZ9uV9i.js"),s=require("../../usePortal-C4qWsJeq.js"),n=require("../../component-CiKxWtdx.js"),a=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js"),i=require("../../useCustomer-bO4D6e4Z.js"),u=require("../../usePaymentMethods-Bb1Xbads.js"),l=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js"),c=require("../../useLoadInitialData-BqiAFNFi.js"),m=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js"),d=require("../../paymentMethods-BMcc-eTl.js"),p=require("../../useService-DKm3QtT4.js"),v=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js"),_=require("../../useTopUpModal-DeF-cfCK.js"),f=require("../../pricingPlanSchedule-B9HFiXy-.js");const y=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(y){var g;const h=s.usePortal(),b=n.useLogger(),w=null==(g=h.value)?void 0:g.customer_id,C=i.useCustomer({customerId:w}),S=r.useInvoicesList({customerId:w,batchSize:5}),j=a.useSubscriptionsList({customerId:w,batchSize:2}),M=u.usePaymentMethods({customerId:w}),L=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=d.createPaymentMethodsService(),{data:r,execute:s,error:n,apiStatus:a,isPending:i}=p.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:r,fetch:s,isPending:i}}({customerId:w}),O=v.useCustomerWalletBalances({customerId:w}),q=e.computed(()=>{var e;return(null==(e=O.walletBalances.value)?void 0:e.wallet_balances)??[]}),{isLoading:I}=c.useLoadInitialData(C.get.execute(),S.fetchInitial(),j.fetchInitial(),M.fetchAll(),L.fetch(),O.fetch()),x=()=>{M.fetchAll()},N=()=>{O.fetch()},B=e.computed(()=>f.getActiveDefaultScheduleId(j.items.value));e.watch([B,()=>j.items.value],([e,t])=>{e||0===t.length||b.warn("ACTIVE_SCHEDULE_NOT_FOUND","No schedule is currently being billed",{schedules:t.flatMap(({pricing_plan_schedule_infos:e})=>(e??[]).map(({id:e,type:t,start_at:o,end_at:r,...s})=>{var n;return{id:e,type:(null==(n=s.pricing_plan_schedule)?void 0:n.type)??t,start_at:o,end_at:r}}))})});const P=e.ref(),A=_.useTopUpModal(P);return(s,n)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(C).customer.value?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(C).customer.value,subscriptions:e.unref(j).items.value,"payment-methods":e.unref(M).items.value,"is-loading":e.unref(I),onLoadMore:e.unref(j).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(S).items.value,"has-more-items":e.unref(S).hasNextBatch.value,"is-loading":e.unref(I),onLoadMore:e.unref(S).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(O).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(I),"wallet-balances":q.value,"show-top-up-button":"",onTopUp:n[0]||(n[0]=e=>P.value=e)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(m._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(I),"payment-methods":e.unref(M).items.value},null,8,["is-loading","payment-methods"]),e.unref(C).customer.value?(e.openBlock(),e.createBlock(l._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(I),customer:e.unref(C).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0),e.createVNode(_._sfc_main,{"show-modal":e.unref(A).showModal.value,"payment-methods":e.unref(M).items.value,customer:e.unref(C).customer.value,"selected-balance-item":P.value,onClose:n[1]||(n[1]=e=>P.value=void 0),onConfirm:N,onPaymentSuccess:x},null,8,["show-modal","payment-methods","customer","selected-balance-item"])]),_:1}))}}),g=e.defineComponent({__name:"CustomerOverview.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=>(o,r)=>{var s,a,i,u;return e.openBlock(),e.createBlock(n._sfc_main,{"custom-element-name":e.unref(b),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(a=null==(s=t.branding)?void 0:s.colors)?void 0:a.primary,"secondary-color":null==(u=null==(i=t.branding)?void 0:i.colors)?void 0:u.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),h=n.defineCustomElement(g),b=n.getComponentName("customer-overview");exports.COMPONENT_NAME=b,exports.SolvimonCustomerOverview=h,exports.defineSolvimonCustomerOverview=()=>{customElements.get(b)||customElements.define(b,h)};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, computed, watch, ref, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
|
|
3
3
|
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
4
|
-
import { u as useInvoicesList, _ as _sfc_main$
|
|
5
|
-
import { u as usePortal } from "../../usePortal-
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { u as
|
|
15
|
-
import {
|
|
4
|
+
import { u as useInvoicesList, _ as _sfc_main$6 } from "../../useInvoicesList-DBz7T7sM.mjs";
|
|
5
|
+
import { u as usePortal } from "../../usePortal-DWLtNqBB.mjs";
|
|
6
|
+
import { a as useLogger, _ as _sfc_main$8, d as defineCustomElement, g as getComponentName } from "../../component-CUJ_G2Nw.mjs";
|
|
7
|
+
import { u as useSubscriptionsList, _ as _sfc_main$7 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs";
|
|
8
|
+
import { u as useCustomer } from "../../useCustomer-VfeQ6rG2.mjs";
|
|
9
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-B5AbGWsn.mjs";
|
|
10
|
+
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs";
|
|
11
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-BhpIg7OF.mjs";
|
|
12
|
+
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs";
|
|
13
|
+
import { c as createPaymentMethodsService } from "../../paymentMethods-xzFD2L30.mjs";
|
|
14
|
+
import { u as useService } from "../../useService-BZqFkz7p.mjs";
|
|
15
|
+
import { u as useCustomerWalletBalances, _ as _sfc_main$2 } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs";
|
|
16
|
+
import { u as useTopUpModal, _ as _sfc_main$5 } from "../../useTopUpModal-DNyWrHDv.mjs";
|
|
17
|
+
import { a as getActiveDefaultScheduleId } from "../../pricingPlanSchedule-C_cqUyTk.mjs";
|
|
16
18
|
function useCustomerPaymentMethodOptions({
|
|
17
19
|
customerId,
|
|
18
20
|
amount
|
|
@@ -36,6 +38,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
36
38
|
setup(__props) {
|
|
37
39
|
var _a;
|
|
38
40
|
const portal = usePortal();
|
|
41
|
+
const logger = useLogger();
|
|
39
42
|
const customerId = (_a = portal.value) == null ? void 0 : _a.customer_id;
|
|
40
43
|
const customer = useCustomer({ customerId });
|
|
41
44
|
const invoices = useInvoicesList({ customerId, batchSize: 5 });
|
|
@@ -43,7 +46,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
43
46
|
const paymentMethods = usePaymentMethods({ customerId });
|
|
44
47
|
const customerPaymentMethodOptions = useCustomerPaymentMethodOptions({ customerId });
|
|
45
48
|
const customerWalletBalances = useCustomerWalletBalances({ customerId });
|
|
46
|
-
const walletBalanceItems =
|
|
49
|
+
const walletBalanceItems = computed(
|
|
50
|
+
() => {
|
|
51
|
+
var _a2;
|
|
52
|
+
return ((_a2 = customerWalletBalances.walletBalances.value) == null ? void 0 : _a2.wallet_balances) ?? [];
|
|
53
|
+
}
|
|
54
|
+
);
|
|
47
55
|
const { isLoading } = useLoadInitialData(
|
|
48
56
|
customer.get.execute(),
|
|
49
57
|
invoices.fetchInitial(),
|
|
@@ -52,10 +60,37 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
52
60
|
customerPaymentMethodOptions.fetch(),
|
|
53
61
|
customerWalletBalances.fetch()
|
|
54
62
|
);
|
|
63
|
+
const handlePaymentMethodStored = () => {
|
|
64
|
+
void paymentMethods.fetchAll();
|
|
65
|
+
};
|
|
66
|
+
const handleTopUpCharged = () => {
|
|
67
|
+
void customerWalletBalances.fetch();
|
|
68
|
+
};
|
|
69
|
+
const activeScheduleId = computed(() => getActiveDefaultScheduleId(subscriptions.items.value));
|
|
70
|
+
watch([activeScheduleId, () => subscriptions.items.value], ([scheduleId, activeSubscriptions]) => {
|
|
71
|
+
if (scheduleId || activeSubscriptions.length === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
logger.warn("ACTIVE_SCHEDULE_NOT_FOUND", "No schedule is currently being billed", {
|
|
75
|
+
schedules: activeSubscriptions.flatMap(
|
|
76
|
+
({ pricing_plan_schedule_infos }) => (pricing_plan_schedule_infos ?? []).map(({ id, type, start_at, end_at, ...info }) => {
|
|
77
|
+
var _a2;
|
|
78
|
+
return {
|
|
79
|
+
id,
|
|
80
|
+
type: ((_a2 = info.pricing_plan_schedule) == null ? void 0 : _a2.type) ?? type,
|
|
81
|
+
start_at,
|
|
82
|
+
end_at
|
|
83
|
+
};
|
|
84
|
+
})
|
|
85
|
+
)
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
const selectedBalanceItem = ref();
|
|
89
|
+
const topUpModal = useTopUpModal(selectedBalanceItem);
|
|
55
90
|
return (_ctx, _cache) => {
|
|
56
91
|
return openBlock(), createBlock(unref(ContentWithAsideLayout), { class: "sv-customer-overview sv-root sv-screen" }, {
|
|
57
92
|
header: withCtx(() => [
|
|
58
|
-
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$
|
|
93
|
+
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$7, {
|
|
59
94
|
key: 0,
|
|
60
95
|
class: "sv-customer-overview__subscriptions",
|
|
61
96
|
customer: unref(customer).customer.value,
|
|
@@ -66,7 +101,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
66
101
|
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "onLoadMore"])) : createCommentVNode("", true)
|
|
67
102
|
]),
|
|
68
103
|
content: withCtx(() => [
|
|
69
|
-
createVNode(_sfc_main$
|
|
104
|
+
createVNode(_sfc_main$6, {
|
|
70
105
|
class: "sv-customer-overview__invoices",
|
|
71
106
|
invoices: unref(invoices).items.value,
|
|
72
107
|
"has-more-items": unref(invoices).hasNextBatch.value,
|
|
@@ -79,7 +114,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
79
114
|
class: "sv-customer-overview__wallet-balances",
|
|
80
115
|
"has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
|
|
81
116
|
"is-loading": unref(isLoading),
|
|
82
|
-
"wallet-balances":
|
|
117
|
+
"wallet-balances": walletBalanceItems.value,
|
|
118
|
+
"show-top-up-button": "",
|
|
119
|
+
onTopUp: _cache[0] || (_cache[0] = ($event) => selectedBalanceItem.value = $event)
|
|
83
120
|
}, null, 8, ["has-error", "is-loading", "wallet-balances"]),
|
|
84
121
|
createVNode(_sfc_main$3, {
|
|
85
122
|
class: "sv-customer-overview__payment-methods",
|
|
@@ -91,7 +128,16 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
91
128
|
class: "sv-customer-overview__billing-information",
|
|
92
129
|
"is-loading": unref(isLoading),
|
|
93
130
|
customer: unref(customer).customer.value
|
|
94
|
-
}, null, 8, ["is-loading", "customer"])) : createCommentVNode("", true)
|
|
131
|
+
}, null, 8, ["is-loading", "customer"])) : createCommentVNode("", true),
|
|
132
|
+
createVNode(_sfc_main$5, {
|
|
133
|
+
"show-modal": unref(topUpModal).showModal.value,
|
|
134
|
+
"payment-methods": unref(paymentMethods).items.value,
|
|
135
|
+
customer: unref(customer).customer.value,
|
|
136
|
+
"selected-balance-item": selectedBalanceItem.value,
|
|
137
|
+
onClose: _cache[1] || (_cache[1] = ($event) => selectedBalanceItem.value = void 0),
|
|
138
|
+
onConfirm: handleTopUpCharged,
|
|
139
|
+
onPaymentSuccess: handlePaymentMethodStored
|
|
140
|
+
}, null, 8, ["show-modal", "payment-methods", "customer", "selected-balance-item"])
|
|
95
141
|
]),
|
|
96
142
|
_: 1
|
|
97
143
|
});
|
|
@@ -120,7 +166,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
166
|
setup(__props) {
|
|
121
167
|
return (_ctx, _cache) => {
|
|
122
168
|
var _a, _b, _c, _d;
|
|
123
|
-
return openBlock(), createBlock(_sfc_main$
|
|
169
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
124
170
|
"custom-element-name": unref(COMPONENT_NAME),
|
|
125
171
|
environment: __props.environment,
|
|
126
172
|
locale: __props.locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-B53Df2Rt.js"),n=require("../../vendor-ui-C3Tq-qY_.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BxdcIX-Z.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-B6-3PkW2.js"),c=require("../../useLoadInitialData-BObRB7Vo.js"),l=require("../../usePayments-DwiGafZj.js"),s=require("../../usePaymentMethodOptions-CzqsebhN.js"),u=require("../../usePaymentMethods-ZPxKg5Y3.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),d={key:0},m=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$14),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":m.value})},[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$15),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"PayInvoice.entry.view",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){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.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:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(m,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-CiKxWtdx.js"),n=require("../../vendor-ui-BuRqLx74.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-D8GJi5rF.js"),c=require("../../useLoadInitialData-BqiAFNFi.js"),l=require("../../usePayments-is5c66Z6.js"),s=require("../../usePaymentMethodOptions-DszFvgKX.js"),u=require("../../usePaymentMethods-Bb1Xbads.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String},preventDoubleClick:{type:Boolean}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),d={key:0},m=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$9),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":m.value})},[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$17),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"PayInvoice.entry.view",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){const o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=e.defineComponent({__name:"PayInvoice.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:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(m,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
3
|
-
import { u as useIntl,
|
|
2
|
+
import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-CUJ_G2Nw.mjs";
|
|
3
|
+
import { u as useIntl, E as formatAmount, c as _sfc_main$4, F as _sfc_main$6, e as _sfc_main$8, q as _sfc_main$9, _ as _sfc_main$a, d as _sfc_main$c, g as getCustomerCountry } from "../../vendor-ui-BoGKOJ36.mjs";
|
|
4
4
|
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
5
|
-
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs";
|
|
6
6
|
import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
7
|
-
import { _ as _sfc_main$7 } from "../../url-
|
|
8
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
9
|
-
import { u as useInvoice, a as usePayments } from "../../usePayments-
|
|
10
|
-
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-
|
|
11
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
7
|
+
import { _ as _sfc_main$7 } from "../../url-BjZ1Pg0l.mjs";
|
|
8
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-BhpIg7OF.mjs";
|
|
9
|
+
import { u as useInvoice, a as usePayments } from "../../usePayments-DgoZoBZh.mjs";
|
|
10
|
+
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-PcMjtMSF.mjs";
|
|
11
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-B5AbGWsn.mjs";
|
|
12
12
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "PayButton",
|
|
14
14
|
props: {
|
|
@@ -24,7 +24,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
disabled: { type: Boolean },
|
|
25
25
|
iconPrefix: { type: null },
|
|
26
26
|
iconSuffix: { type: null },
|
|
27
|
-
tag: { type: String }
|
|
27
|
+
tag: { type: String },
|
|
28
|
+
preventDoubleClick: { type: Boolean }
|
|
28
29
|
},
|
|
29
30
|
emits: ["click"],
|
|
30
31
|
setup(__props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-CiKxWtdx.js"),o=require("../../vendor-ui-BuRqLx74.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js"),a=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js"),s=require("../../useCustomer-bO4D6e4Z.js"),i=require("../../usePaymentMethods-Bb1Xbads.js"),l=require("../../usePaymentMethodOptions-DszFvgKX.js"),m=require("../../useLoadInitialData-BqiAFNFi.js"),p={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},d={key:0},c=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup:t=>(n,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",null,[e.createVNode(e.unref(o._sfc_main$3),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$3),{key:0,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})):e.createCommentVNode("",!0)]),n.$slots.right?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(n.$slots,"right")])):e.createCommentVNode("",!0)]))}),u=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default"],setup(t,{emit:s}){const i=s,{$t:l}=o.useIntl(),m=e.ref(!1);return(s,p)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(c,{title:e.unref(l)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(l)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(o._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{"payment-methods":t.paymentMethods,onSetDefault:p[0]||(p[0]=e=>i("set-default"))},null,8,["payment-methods"])]),_:1}),m.value?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,customer:t.customer,"payment-method-options":t.paymentMethodOptions},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:1,color:"gray",variant:"outline",onClick:p[1]||(p[1]=e=>m.value=!1)},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(o._sfc_main$1),{key:2,color:"gray",variant:"outline",onClick:p[2]||(p[2]=e=>m.value=!0)},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),y=e.defineComponent({__name:"PaymentMethodsManagement.entry.view",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}},setup(t){const o=t,n=o.portalObject.customer_id,{customer:r,get:a}=s.useCustomer({customerId:n}),{items:p,fetchInitial:d}=i.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:c,get:u}=l.usePaymentMethodOptions(),{isLoading:y}=m.useLoadInitialData(a.execute(),d(),u({customerId:o.portalObject.customer_id}));return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(r),paymentMethods:e.unref(p),paymentMethodOptions:e.unref(c),isLoading:e.unref(y),refreshPaymentMethods:e.unref(d)})}}),g=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup:o=>(n,r)=>{var a,s,i,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(f),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=o.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(l=null==(i=o.branding)?void 0:i.colors)?void 0:l.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:r[0]||(r[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({customer:t,paymentMethods:o,paymentMethodOptions:n,isLoading:r,refreshPaymentMethods:a})=>[t?(e.openBlock(),e.createBlock(u,{key:0,"is-loading":r,"payment-methods":o,"payment-method-options":n,customer:t,onSetDefault:a},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),h=t.defineCustomElement(g),f=t.getComponentName("payment-methods-management");exports.COMPONENT_NAME=f,exports.SolvimonPaymentMethodsManagement=h,exports.defineSolvimonPaymentMethodsManagement=()=>{customElements.get(f)||customElements.define(f,h)};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, renderSlot, ref, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
3
|
-
import { e as _sfc_main$4, u as useIntl, _ as _sfc_main$5, c as _sfc_main$8 } from "../../vendor-ui-
|
|
2
|
+
import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-CUJ_G2Nw.mjs";
|
|
3
|
+
import { e as _sfc_main$4, u as useIntl, _ as _sfc_main$5, c as _sfc_main$8 } from "../../vendor-ui-BoGKOJ36.mjs";
|
|
4
4
|
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
|
|
5
|
-
import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
8
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
9
|
-
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-
|
|
10
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
5
|
+
import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs";
|
|
6
|
+
import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs";
|
|
7
|
+
import { u as useCustomer } from "../../useCustomer-VfeQ6rG2.mjs";
|
|
8
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-B5AbGWsn.mjs";
|
|
9
|
+
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-PcMjtMSF.mjs";
|
|
10
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-BhpIg7OF.mjs";
|
|
11
11
|
const _hoisted_1 = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" };
|
|
12
12
|
const _hoisted_2 = { key: 0 };
|
|
13
13
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-CiKxWtdx.js"),i=require("../../vendor-ui-BuRqLx74.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),s=require("../../useActionDispatchProvider-bqR_FeM4.js"),r=require("../../subscription-b0OPx8Du.js"),a=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js"),o=require("../../SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js"),l=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js"),c=require("../../useTopUpModal-DeF-cfCK.js"),u=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),d=require("../../pricing-BEjY_5wb.js"),p=require("../../ApiStatus-oqvUEWJx.js"),m=require("../../useSubscription-DuUNc1_l.js"),g=require("../../useCustomer-bO4D6e4Z.js"),b=require("../../usePaymentMethods-Bb1Xbads.js"),_=require("../../useLoadInitialData-BqiAFNFi.js");function y(e){var t,i,n,s,r,a,o;const l=null==(n=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:n[0],c=null==(r=null==(s=null==l?void 0:l.details)?void 0:s.bands)?void 0:r[0];return{amount:(null==c?void 0:c.amount)??(null==c?void 0:c.fixed_amount),billingPeriod:(null==(a=null==l?void 0:l.details)?void 0:a.pricing_period)??(null==(o=null==l?void 0:l.details)?void 0:o.billing_period)}}const v={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},f={class:"sv-enabled-pricings-list__item-content grow"},h=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const n=t,{$t:s}=i.useIntl(),r=e.computed(()=>{const{amount:e,billingPeriod:t}=n.entry;if(e)return t?s({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:i.formatAmount(e),period:i.formatBillingPeriod(t,{short:!0,hideValueForExactPeriods:!0})}):i.formatAmount(e)});return(n,a)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",v,[e.createElementVNode("div",f,[e.createVNode(e.unref(i._sfc_main$3),{tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$3),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),r.value?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$3),{key:0,tag:"span",variant:"body-sm",shade:"lighter",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(i._sfc_main$1),{variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:a[0]||(a[0]=e=>n.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),w={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},S=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const n=t,{$t:s}=i.useIntl(),r=e.computed(()=>function(e){var t,i,n;const s=new Set(((null==(t=e.pricing_plan_schedule)?void 0:t.enabled_pricings)??[]).map(({pricing_id:e})=>e));return 0===s.size?[]:((null==(n=null==(i=e.pricing_plan_version)?void 0:i.pricing_categories)?void 0:n.flatMap(e=>e.pricing_groups??[]))??[]).flatMap(e=>(e.pricings??[]).filter(e=>s.has(e.id)).map(t=>({pricingId:t.id,pricingGroupId:e.id,groupName:e.name,name:d.getNameFromPricing(t)||e.name,...y(t)})))}(n.pricingPlanSchedule));return(t,n)=>r.value.length>0?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(s)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,i=>(e.openBlock(),e.createBlock(h,{key:i.pricingId,entry:i,onUpgrade:n[0]||(n[0]=e=>t.$emit("upgrade",e))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}}),C={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},k=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","payment-method-stored"],setup(t){const d=t,{$t:p}=i.useIntl(),{isCancellable:m,isRenewable:g,cancel:b,renew:_,manage:y}=function({subscription:t}){const{dispatchAction:i}=s.useActionDispatchProvider();return{isCancellable:e.computed(()=>{if(!t.value)return!1;const e=t.value.inactive_periods;return!e||0===e.length}),isRenewable:e.computed(()=>{var e;const i=null==(e=t.value)?void 0:e.inactive_periods;return Array.isArray(i)&&i.length>0}),cancel:()=>{t.value&&i({action:"cancel-subscription",data:{subscriptionId:t.value.id}})},renew:()=>{t.value&&i({action:"renew-subscription",data:{subscriptionId:t.value.id}})},manage:()=>{t.value&&i({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}({subscription:e.toRef(d,"subscription")}),v=e.computed(()=>r.getMostRecentScheduleInfo(d.subscription)),f=e.ref(),h=c.useTopUpModal(f),w=e.computed(()=>r.getSubscriptionName({subscription:d.subscription,fallback:p({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(s,r)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",C,[e.createVNode(e.unref(i._sfc_main$3),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1}),e.unref(g)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(_)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:1,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(b)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[t.error?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$10),{key:0,class:"sv-subscription-details__error sv-error",title:e.unref(p)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(u._sfc_main,{key:1,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(e.unref(i._sfc_main),{"no-spacing":"",class:"sv-subscription-details__summary"},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{subscription:t.subscription},null,8,["subscription"])]),_:1}),e.createVNode(o._sfc_main,{class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])],64)):(e.openBlock(),e.createBlock(a._sfc_main$1,{key:3,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(l._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":Boolean(t.hasWalletBalancesError),"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",onTopUp:r[0]||(r[0]=e=>f.value=e)},null,8,["has-error","is-loading","wallet-balances"]),v.value?(e.openBlock(),e.createBlock(S,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":v.value,onUpgrade:e.unref(y)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),e.createVNode(c._sfc_main,{"show-modal":e.unref(h).showModal.value,"payment-methods":t.paymentMethods,customer:t.customer,"selected-balance-item":f.value,onClose:r[1]||(r[1]=e=>f.value=void 0),onConfirm:r[2]||(r[2]=e=>s.$emit("top-up-charged")),onPaymentSuccess:r[3]||(r[3]=e=>s.$emit("payment-method-stored"))},null,8,["show-modal","payment-methods","customer","selected-balance-item"])]),_:1}))}}),B=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},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}},setup(t){const i=t,n=i.portalObject.customer_id,{subscription:s,withPlanData:r,get:a,error:o}=m.useSubscription({subscriptionId:i.configuration.subscriptionId}),{customer:c,get:u}=g.useCustomer({customerId:n}),{items:d,fetchAll:y}=b.usePaymentMethods({customerId:n}),{walletBalances:v,apiStatus:f,fetch:h}=l.useCustomerWalletBalances({customerId:n}),{isLoading:w}=_.useLoadInitialData(a(),u.execute(),y(),h()),S=e.computed(()=>s.value?r(s.value):[]),C=e.computed(()=>{var e;return(null==(e=v.value)?void 0:e.wallet_balances)??[]}),k=e.computed(()=>f.value===p.ApiStatus.Failed);return(t,i)=>e.renderSlot(t.$slots,"default",{subscription:e.unref(s),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(d),walletBalances:C.value,hasWalletBalancesError:k.value,isLoading:e.unref(w),error:e.unref(o),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(y)})}}),x=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},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}},setup:i=>(n,s)=>{var r,a,o,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(j),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(a=null==(r=i.branding)?void 0:r.colors)?void 0:a.primary,"secondary-color":null==(l=null==(o=i.branding)?void 0:o.colors)?void 0:l.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,"css-overrides":i.cssOverrides,onError:s[0]||(s[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(B,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({subscription:t,schedulesData:i,customer:n,paymentMethods:s,walletBalances:r,hasWalletBalancesError:a,isLoading:o,error:l,refreshWalletBalances:c,refreshPaymentMethods:u})=>[e.createVNode(k,{subscription:t,"schedules-data":i,customer:n,"payment-methods":s,"wallet-balances":r,"has-wallet-balances-error":a,"is-loading":o,error:l,onTopUpCharged:c,onPaymentMethodStored:u},null,8,["subscription","schedules-data","customer","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onPaymentMethodStored"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),N=t.defineCustomElement(x),j=t.getComponentName("subscription-details");exports.COMPONENT_NAME=j,exports.SolvimonSubscriptionDetails=N,exports.defineSolvimonSubscriptionDetails=()=>{customElements.get(j)||customElements.define(j,N)};
|