@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.3
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-VMlVPI4O.js → BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-CRsFr9TH.mjs} +1 -1
- package/dist/{ContentWithAsideLayout-CIVSoqFr.js → ContentWithAsideLayout-DczcgSrt.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs} +5 -5
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs +75 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs → Skeleton.vue_vue_type_script_setup_true_lang-C-taYlG4.mjs} +5 -4
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs} +5 -5
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js} +1 -1
- package/dist/auto-DzZuCneB.mjs +14387 -0
- package/dist/auto-PpnAChnH.js +6 -0
- package/dist/{cloneDeep-Hs8Pp07F.js → cloneDeep-DranHQkY.js} +1 -1
- package/dist/{component-BkmcE85U.mjs → component-DEo_ndpK.mjs} +92 -78
- package/dist/component-XHQYFLA_.js +1 -0
- package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +96 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +132 -5
- package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +580 -5
- package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
- package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +102 -5
- package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
- package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +236 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +150 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
- package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
- package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js} +41 -51
- package/dist/core/configuration.d.ts +2 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/registry.d.ts +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +40 -34
- package/dist/invoices-BW1notiX.js +1 -0
- package/dist/{invoices-C31Wz1Bu.mjs → invoices-M5oYVch6.mjs} +1 -1
- package/dist/{paymentMethods-CzUqDlvc.js → paymentMethods-BX80t2zk.js} +1 -1
- package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-CqKUfc3w.mjs} +1 -1
- package/dist/{payments-C3LPk9k9.js → payments-BHv4hCeJ.js} +1 -1
- package/dist/{payments-NtWI8KlU.mjs → payments-CosaPZwo.mjs} +1 -1
- package/dist/registry-BwKEYOf7.js +1 -0
- package/dist/registry-Cag1Jj7P.mjs +143 -0
- package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +5140 -5
- package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +134 -5
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1012 -0
- package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-Bs4DIE8f.mjs} +1 -1
- package/dist/{subscriptions-CqK7t-fF.js → subscriptions-CnxvsBXd.js} +1 -1
- package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-CgRcOqv3.mjs} +1 -1
- package/dist/useActionDispatchProvider-Cru69mAl.js +1 -0
- package/dist/{useCustomer-Dp8sGHI0.js → useCustomer-B0NK96dA.js} +1 -1
- package/dist/{useCustomer-BRY0tuBH.mjs → useCustomer-DlcjY3fP.mjs} +2 -2
- package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → useCustomerPaymentMethodOptions-BzEquyUV.mjs} +7 -6
- package/dist/{useCustomerPaymentMethodOptions-DYpMDnJR.js → useCustomerPaymentMethodOptions-C-8BLzqb.js} +1 -1
- package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-C7ToTmZK.mjs} +9 -7
- package/dist/useIncrementalLoading-D60Vttil.js +1 -0
- package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-CcueV3We.mjs} +2 -2
- package/dist/{useInvoiceData-DImEH1ca.js → useInvoiceData-DstXfI7t.js} +1 -1
- package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CXng3aUm.mjs} +4 -4
- package/dist/{useInvoicesList-BZQ9Y0qN.js → useInvoicesList-DmzjgMlW.js} +1 -1
- package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-DCGVRXA4.js} +1 -1
- package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-Db-1R6rI.mjs} +2 -2
- package/dist/{useService-Dz13Nxbi.mjs → useService-B4qv5N2D.mjs} +14 -5
- package/dist/useService-D-CUtlp3.js +1 -0
- package/dist/useWalletBalanceItems-BZyiAhcV.js +1 -0
- package/dist/useWalletBalanceItems-CHkLaccm.mjs +105 -0
- package/package.json +16 -3
- package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
- package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
- package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
- package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
- package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
- package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
- package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
- package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
- package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
- package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
- package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
- package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
- package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
- package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
- package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
- package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
- package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
- package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
- package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
- package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
- package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
- package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
- package/dist/auto-B_36W1Fc.js +0 -6
- package/dist/auto-BfMZdgp-.mjs +0 -14207
- package/dist/component-Df5eNqYX.js +0 -1
- package/dist/invoices-8M_3ur_U.js +0 -1
- package/dist/registry-By94DXE2.js +0 -1
- package/dist/registry-shRKDl3K.mjs +0 -127
- package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
- package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
- package/dist/useService-bNNi4GB8.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonCustomerOverview: import('vue').VueElementConstructor<unknown>;
|
|
1
|
+
export declare const SolvimonCustomerOverview: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonCustomerOverview: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../ContentWithAsideLayout-DczcgSrt.js"),r=require("../../useInvoicesList-DmzjgMlW.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js"),s=require("../../useCustomer-B0NK96dA.js"),a=require("../../usePaymentMethods-DCGVRXA4.js"),i=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js"),l=require("../../useLoadInitialData-BRg7IWqW.js"),u=require("../../useCustomerPaymentMethodOptions-C-8BLzqb.js"),m=require("../../useWalletBalanceItems-BZyiAhcV.js"),c=require("../../component-XHQYFLA_.js"),p=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(c){var p;const d=null==(p=o.usePortal().value)?void 0:p.customer_id,v=s.useCustomer({customerId:d}),y=r.useInvoicesList({customerId:d,batchSize:5}),f=n.useSubscriptionsList({customerId:d,batchSize:2}),g=a.usePaymentMethods({customerId:d}),h=u.useCustomerPaymentMethodOptions({customerId:d}),_=m.useCustomerWalletBalances({customerId:d}),C=m.useWalletBalanceItems(_.walletBalances),{isLoading:b}=l.useLoadInitialData(v.get.execute(),y.fetchInitial(),f.fetchInitial(),g.fetchAll(),h.fetch(),_.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(v).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,customer:e.unref(v).customer.value,subscriptions:e.unref(f).items.value,"payment-methods":e.unref(g).items.value,"is-loading":e.unref(b),"has-more-items":e.unref(f).hasNextBatch.value,onLoadMore:e.unref(f).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","has-more-items","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{invoices:e.unref(y).items.value,"has-more-items":e.unref(y).hasNextBatch.value,"is-loading":e.unref(b),onLoadMore:e.unref(y).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(m._sfc_main,{"has-error":e.unref(_).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(b),"wallet-balances":e.unref(C)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(u._sfc_main,{"is-loading":e.unref(b),"payment-methods":e.unref(g).items.value,"payment-methods-options":e.unref(h).items.value},null,8,["is-loading","payment-methods","payment-methods-options"]),e.unref(v).customer.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,"is-loading":e.unref(b),customer:e.unref(v).customer.value,"payment-methods":e.unref(g).items.value},null,8,["is-loading","customer","payment-methods"])):e.createCommentVNode("",!0)]),_:1}))}}),d=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var n,s,a,i;return e.openBlock(),e.createBlock(c._sfc_main$1,{"custom-element-name":e.unref(y),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(n=t.branding)?void 0:n.colors)?void 0:s.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(p)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=c.defineCustomElement(d),y=c.getComponentName("customer-overview");exports.COMPONENT_NAME=y,exports.SolvimonCustomerOverview=v,exports.defineSolvimonCustomerOverview=()=>{customElements.get(y)||customElements.define(y,v)};
|
|
@@ -1,7 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
2
|
+
import { A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
|
|
3
|
+
import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-CRsFr9TH.mjs";
|
|
4
|
+
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-CXng3aUm.mjs";
|
|
5
|
+
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs";
|
|
6
|
+
import { u as useCustomer } from "../../useCustomer-DlcjY3fP.mjs";
|
|
7
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-Db-1R6rI.mjs";
|
|
8
|
+
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs";
|
|
9
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
10
|
+
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-BzEquyUV.mjs";
|
|
11
|
+
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-CHkLaccm.mjs";
|
|
12
|
+
import { p as _sfc_main$7, q as defineCustomElement, o as getComponentName } from "../../component-DEo_ndpK.mjs";
|
|
13
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "CustomerOverview",
|
|
15
|
+
props: {
|
|
16
|
+
configuration: { type: Object }
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
var _a;
|
|
20
|
+
const portal = usePortal();
|
|
21
|
+
const customerId = (_a = portal.value) == null ? void 0 : _a.customer_id;
|
|
22
|
+
const customer = useCustomer({ customerId });
|
|
23
|
+
const invoices = useInvoicesList({ customerId, batchSize: 5 });
|
|
24
|
+
const subscriptions = useSubscriptionsList({ customerId, batchSize: 2 });
|
|
25
|
+
const paymentMethods = usePaymentMethods({ customerId });
|
|
26
|
+
const customerPaymentMethodOptions = useCustomerPaymentMethodOptions({ customerId });
|
|
27
|
+
const customerWalletBalances = useCustomerWalletBalances({ customerId });
|
|
28
|
+
const walletBalanceItems = useWalletBalanceItems(customerWalletBalances.walletBalances);
|
|
29
|
+
const { isLoading } = useLoadInitialData(
|
|
30
|
+
customer.get.execute(),
|
|
31
|
+
invoices.fetchInitial(),
|
|
32
|
+
subscriptions.fetchInitial(),
|
|
33
|
+
paymentMethods.fetchAll(),
|
|
34
|
+
customerPaymentMethodOptions.fetch(),
|
|
35
|
+
customerWalletBalances.fetch()
|
|
36
|
+
);
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
|
|
39
|
+
header: withCtx(() => [
|
|
40
|
+
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
41
|
+
key: 0,
|
|
42
|
+
customer: unref(customer).customer.value,
|
|
43
|
+
subscriptions: unref(subscriptions).items.value,
|
|
44
|
+
"payment-methods": unref(paymentMethods).items.value,
|
|
45
|
+
"is-loading": unref(isLoading),
|
|
46
|
+
"has-more-items": unref(subscriptions).hasNextBatch.value,
|
|
47
|
+
onLoadMore: unref(subscriptions).fetchMore
|
|
48
|
+
}, null, 8, ["customer", "subscriptions", "payment-methods", "is-loading", "has-more-items", "onLoadMore"])) : createCommentVNode("", true)
|
|
49
|
+
]),
|
|
50
|
+
content: withCtx(() => [
|
|
51
|
+
createVNode(_sfc_main$5, {
|
|
52
|
+
invoices: unref(invoices).items.value,
|
|
53
|
+
"has-more-items": unref(invoices).hasNextBatch.value,
|
|
54
|
+
"is-loading": unref(isLoading),
|
|
55
|
+
onLoadMore: unref(invoices).fetchMore
|
|
56
|
+
}, null, 8, ["invoices", "has-more-items", "is-loading", "onLoadMore"])
|
|
57
|
+
]),
|
|
58
|
+
aside: withCtx(() => [
|
|
59
|
+
createVNode(_sfc_main$2, {
|
|
60
|
+
"has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
|
|
61
|
+
"is-loading": unref(isLoading),
|
|
62
|
+
"wallet-balances": unref(walletBalanceItems)
|
|
63
|
+
}, null, 8, ["has-error", "is-loading", "wallet-balances"]),
|
|
64
|
+
createVNode(_sfc_main$3, {
|
|
65
|
+
"is-loading": unref(isLoading),
|
|
66
|
+
"payment-methods": unref(paymentMethods).items.value,
|
|
67
|
+
"payment-methods-options": unref(customerPaymentMethodOptions).items.value
|
|
68
|
+
}, null, 8, ["is-loading", "payment-methods", "payment-methods-options"]),
|
|
69
|
+
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
70
|
+
key: 0,
|
|
71
|
+
"is-loading": unref(isLoading),
|
|
72
|
+
customer: unref(customer).customer.value,
|
|
73
|
+
"payment-methods": unref(paymentMethods).items.value
|
|
74
|
+
}, null, 8, ["is-loading", "customer", "payment-methods"])) : createCommentVNode("", true)
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
82
|
+
__name: "CustomerOverview.entry",
|
|
83
|
+
props: {
|
|
84
|
+
environment: { type: String },
|
|
85
|
+
locale: { type: String },
|
|
86
|
+
dateLocale: { type: String },
|
|
87
|
+
messages: { type: Object },
|
|
88
|
+
showTimezones: { type: Boolean },
|
|
89
|
+
primaryColor: { type: String },
|
|
90
|
+
secondaryColor: { type: String },
|
|
91
|
+
isShadowRoot: { type: Boolean },
|
|
92
|
+
experimentalFeatures: { type: Array },
|
|
93
|
+
logLevel: { type: String },
|
|
94
|
+
onLog: { type: Function },
|
|
95
|
+
allowedPortalTypes: { type: Array },
|
|
96
|
+
portalObject: { type: Object },
|
|
97
|
+
customElementName: { type: String },
|
|
98
|
+
branding: { type: Object },
|
|
99
|
+
configuration: { type: Object }
|
|
100
|
+
},
|
|
101
|
+
setup(__props) {
|
|
102
|
+
return (_ctx, _cache) => {
|
|
103
|
+
var _a, _b, _c, _d;
|
|
104
|
+
return openBlock(), createBlock(_sfc_main$7, {
|
|
105
|
+
"custom-element-name": unref(COMPONENT_NAME),
|
|
106
|
+
environment: __props.environment,
|
|
107
|
+
locale: __props.locale,
|
|
108
|
+
"portal-object": __props.portalObject,
|
|
109
|
+
"allowed-portal-types": ["CUSTOMER"],
|
|
110
|
+
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
111
|
+
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
112
|
+
"experimental-features": __props.experimentalFeatures,
|
|
113
|
+
"log-level": __props.logLevel,
|
|
114
|
+
"on-log": __props.onLog,
|
|
115
|
+
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
116
|
+
}, {
|
|
117
|
+
default: withCtx(() => [
|
|
118
|
+
createVNode(_sfc_main$1)
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const SolvimonCustomerOverview = defineCustomElement(_sfc_main);
|
|
126
|
+
const COMPONENT_NAME = getComponentName("customer-overview");
|
|
127
|
+
const defineSolvimonCustomerOverview = () => {
|
|
128
|
+
if (!customElements.get(COMPONENT_NAME)) {
|
|
129
|
+
customElements.define(COMPONENT_NAME, SolvimonCustomerOverview);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
3
132
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
133
|
+
COMPONENT_NAME,
|
|
134
|
+
SolvimonCustomerOverview,
|
|
135
|
+
defineSolvimonCustomerOverview
|
|
7
136
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-XHQYFLA_.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js"),a=require("../../paymentMethods-BX80t2zk.js"),i=require("../../ContentWithAsideLayout-DczcgSrt.js"),r=require("../../useActionDispatchProvider-Cru69mAl.js"),o={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)},c=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}))}))}]}},s=e=>(e.items??[]).filter(l).map(c),d=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(s),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(s)})).filter(e=>e.pricings.length>0)}),u=Object.fromEntries(o.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],l=(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(l)]})),p=e=>({quantity:e.toFixed(2),currency:"EUR"}),m={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},g={id:"intg_zwDeeN0vgXgeM6APNW1g",object_type:"INTEGRATION",reference:"mock-payment-integration",name:"Mock payment integration",description:"Mock payment integration",status:"ACTIVE",type:"PAYMENT_GATEWAY"},_={class:"mb-3 flex flex-col gap-2"},f={class:"flex flex-col gap-1 border-t pt-3"},y={class:"flex items-center justify-between"},v={class:"flex items-center justify-between"},h={class:"flex items-center justify-between border-t pt-3"},b=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,l)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2",class:"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$2),{key:0,variant:"body-sm",shade:"lighter"},{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",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.selectedPricings,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{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$2),{variant:"body-xs",shade:"lighter"},{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$2),{key:0,variant:"body-sm"},{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",y,[e.createVNode(e.unref(t._sfc_main$2),{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$2),{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",v,[e.createVNode(e.unref(t._sfc_main$2),{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$2),{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",h,[e.createVNode(e.unref(t._sfc_main$2),{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$2),{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}))}}),k=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean}},emits:["toggle"],setup(a,{emit:i}){const r=a,o=i,{$t:l}=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)??"—"}),s=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(()=>s.value?`${t.formatAmount(s.value)} ${l({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$1g),{"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$2H),{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(l)({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$2H),{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(l)({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"]))}}),x={class:"grid grid-cols-1 gap-1"},N=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:"flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{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",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(k,{key:t.id,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$2),{variant:"body-sm",weight:"semibold",class:"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(k,{key:t.id,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))}}),w={class:"flex flex-col gap-4"},B={key:0,class:"flex flex-col gap-2"},V={class:"flex flex-col gap-1"},C={key:1,class:"flex flex-col gap-2"},E={class:"flex flex-col gap-1"},T={class:"flex items-center gap-3"},S={key:0,class:"flex h-9 w-9 shrink-0 items-center gap-0.5"},A=["src","alt"],I={key:1,class:"flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},D=["src","alt"],M={key:2,class:"flex flex-col gap-1"},P=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:l}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),s=e.ref([]),d=e.ref([]),u=e.ref(!1),p=e.computed(()=>d.value.flatMap(e=>e.options??[])),_=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,f=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[...f.filter(t=>e.includes(t)),...e.filter(e=>!f.includes(e))].slice(0,4)};return e.onMounted(async()=>{u.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});s.value=e.data,d.value=[{payment_acceptor:m,integration:g,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{u.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",w,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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",V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.id,"content-background":n.selectedId===a.id?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.id},"cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main),{"payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:a.adyen.type,"content-background":n.selectedId===a.adyen.type?"none":"gray",class:e.normalizeClass([{"!bg-white":n.selectedId===a.adyen.type},"cursor-pointer"]),onClick:e=>o("select",a.adyen.type)},{default:e.withCtx(()=>{return[e.createElementVNode("div",T,["scheme"===a.adyen.type?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y(a.adyen.brands),t=>(e.openBlock(),e.createElementBlock("img",{key:t,src:_(t),alt:t,class:"h-5 w-auto rounded"},null,8,A))),128))])):(e.openBlock(),e.createElementBlock("div",I,[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,D)])),e.createVNode(e.unref(t._sfc_main$2),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",M,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}});const $={key:0,class:"flex h-full items-center justify-center p-8"},O={class:"flex flex-col items-center py-10"},j=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(a){const l=a,{$t:c}=t.useIntl(),{dispatchAction:s}=r.useActionDispatchProvider(),{chargeOnDemandPricingItems:m}=function(){const e=t.createRequestService(),n=t.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:t,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:l}){return e({url:`${n.apiUrls.config}/portal/pricing-plan-schedules/${t}/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,...l?{payment_method_id:l}:{}}})}}}(),g=i.usePortal(),_=e.computed(()=>g.value.customer_id),f=e.ref([]),y=e.ref(void 0),v=e.ref(!1),h=e.ref(!1),k=e.ref(void 0),x=e.ref(!1),w=e.computed(()=>(e=>{var t;const n=Date.now(),a=o.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(d).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||o.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}})(l.configuration.subscriptionId)),B=e.computed(()=>w.value.pricing_categories),V=e.computed(()=>B.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),C=e.computed(()=>V.value.filter(e=>f.value.includes(e.id)));let E;e.watch(f,e=>{if(clearTimeout(E),0===e.length)return k.value=void 0,void(x.value=!1);x.value=!0,E=setTimeout(()=>{k.value=(e=>{const t=e.reduce((e,t)=>e+(u[t]??0),0),n=Math.round(.21*t*100)/100,a=t+n;return{invoice:{tax_summary:{base_amount:p(t),tax_amount:p(n),total_amount:p(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,x.value=!1},400)});const T=e=>{f.value.includes(e)?f.value=f.value.filter(t=>t!==e):f.value=[...f.value,e]},S=e.computed(()=>f.value.length>0&&!!y.value),A=e.ref(void 0),I=async()=>{if(S.value){v.value=!0,A.value=void 0;try{const e=C.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=y.value&&y.value.startsWith("pmet_")?y.value:void 0,n=await m({scheduleId:w.value.pricing_plan_schedule_id,pricingPlanVersionId:w.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?h.value=!0:s({action:"pay-invoice",data:{invoiceId:n.id}})}catch{A.value=c({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{v.value=!1}}};return(r,o)=>h.value?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(t._sfc_main$1g),null,{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(t._sfc_main$4),{icon:"check_circle",class:"text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main$2),{variant:"heading-3",tag:"span",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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$2),{variant:"body-sm",shade:"lighter",tag:"span",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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},{content:e.withCtx(()=>[B.value.length>0?(e.openBlock(),e.createBlock(N,{key:0,categories:B.value,"selected-pricing-ids":f.value,onToggle:T},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$2),{key:1,variant:"body-sm",shade:"lighter",class:"p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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$2p),{spacing:"sm"}),e.createVNode(P,{"customer-id":_.value,"subscription-id":a.configuration.subscriptionId,"selected-id":y.value,onSelect:o[0]||(o[0]=e=>y.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(b,{"selected-pricings":C.value,invoice:k.value,"is-pending":x.value},null,8,["selected-pricings","invoice","is-pending"]),A.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,title:A.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$2H),{size:"lg",class:"full-width",type:"button",disabled:!S.value||v.value,loading:v.value,onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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$2),{tag:"div",variant:"body-sm",shade:"lighter",class:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(n._sfc_main$1,{icon:"lock",kpi:e.unref(c)({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}))}}),L=e.defineComponent({__name:"UpgradeSubscription.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:n=>(a,i)=>{var r,o,l,c;return e.openBlock(),e.createBlock(t._sfc_main$1,{"custom-element-name":e.unref(q),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=n.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(c=null==(l=n.branding)?void 0:l.colors)?void 0:c.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:i[0]||(i[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(j,{configuration:n.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),F=t.defineCustomElement(L),q=t.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=q,exports.SolvimonUpgradeSubscription=F,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(q)||customElements.define(q,F)};
|