@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,7 +1,134 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { u as useCustomerPaymentMethodOptions, _ as _sfc_main$3 } from "../../useCustomerPaymentMethodOptions-BzEquyUV.mjs";
|
|
3
|
+
import { p as _sfc_main$2, q as defineCustomElement, o as getComponentName } from "../../component-DEo_ndpK.mjs";
|
|
4
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
5
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-Db-1R6rI.mjs";
|
|
6
|
+
const DEFAULT_MAX_ITEMS = 3;
|
|
7
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "CustomerPaymentMethods.entry.view",
|
|
9
|
+
props: {
|
|
10
|
+
portalObject: { type: Object },
|
|
11
|
+
environment: { type: String },
|
|
12
|
+
locale: { type: String },
|
|
13
|
+
dateLocale: { type: String },
|
|
14
|
+
messages: { type: Object },
|
|
15
|
+
showTimezones: { type: Boolean },
|
|
16
|
+
primaryColor: { type: String },
|
|
17
|
+
secondaryColor: { type: String },
|
|
18
|
+
isShadowRoot: { type: Boolean },
|
|
19
|
+
experimentalFeatures: { type: Array },
|
|
20
|
+
logLevel: { type: String },
|
|
21
|
+
onLog: { type: Function },
|
|
22
|
+
allowedPortalTypes: { type: Array },
|
|
23
|
+
customElementName: { type: String },
|
|
24
|
+
branding: { type: Object },
|
|
25
|
+
configuration: { type: Object }
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
var _a;
|
|
29
|
+
const props = __props;
|
|
30
|
+
const customerId = props.portalObject.customer_id;
|
|
31
|
+
const paymentMethods = usePaymentMethods({
|
|
32
|
+
customerId,
|
|
33
|
+
pageSize: ((_a = props.configuration) == null ? void 0 : _a.maxItems) || DEFAULT_MAX_ITEMS
|
|
34
|
+
});
|
|
35
|
+
const customerPaymentMethodOptions = useCustomerPaymentMethodOptions({ customerId });
|
|
36
|
+
const { isLoading } = useLoadInitialData(
|
|
37
|
+
paymentMethods.fetchInitial(),
|
|
38
|
+
customerPaymentMethodOptions.fetch()
|
|
39
|
+
);
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
var _a2, _b, _c, _d;
|
|
42
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
43
|
+
"custom-element-name": unref(COMPONENT_NAME),
|
|
44
|
+
environment: __props.environment,
|
|
45
|
+
locale: __props.locale,
|
|
46
|
+
"portal-object": __props.portalObject,
|
|
47
|
+
"allowed-portal-types": ["CUSTOMER"],
|
|
48
|
+
"primary-color": (_b = (_a2 = __props.branding) == null ? void 0 : _a2.colors) == null ? void 0 : _b.primary,
|
|
49
|
+
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
50
|
+
"experimental-features": __props.experimentalFeatures,
|
|
51
|
+
"log-level": __props.logLevel,
|
|
52
|
+
"on-log": __props.onLog,
|
|
53
|
+
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
54
|
+
}, {
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
renderSlot(_ctx.$slots, "default", {
|
|
57
|
+
paymentMethods: unref(paymentMethods).items.value,
|
|
58
|
+
paymentMethodsOptions: unref(customerPaymentMethodOptions).items.value,
|
|
59
|
+
isLoading: unref(isLoading)
|
|
60
|
+
})
|
|
61
|
+
]),
|
|
62
|
+
_: 3
|
|
63
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
68
|
+
__name: "CustomerPaymentMethods.entry",
|
|
69
|
+
props: {
|
|
70
|
+
portalObject: { type: Object },
|
|
71
|
+
environment: { type: String },
|
|
72
|
+
locale: { type: String },
|
|
73
|
+
dateLocale: { type: String },
|
|
74
|
+
messages: { type: Object },
|
|
75
|
+
showTimezones: { type: Boolean },
|
|
76
|
+
primaryColor: { type: String },
|
|
77
|
+
secondaryColor: { type: String },
|
|
78
|
+
isShadowRoot: { type: Boolean },
|
|
79
|
+
experimentalFeatures: { type: Array },
|
|
80
|
+
logLevel: { type: String },
|
|
81
|
+
onLog: { type: Function },
|
|
82
|
+
allowedPortalTypes: { type: Array },
|
|
83
|
+
customElementName: { type: String },
|
|
84
|
+
branding: { type: Object },
|
|
85
|
+
configuration: { type: Object }
|
|
86
|
+
},
|
|
87
|
+
setup(__props) {
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
var _a, _b, _c, _d;
|
|
90
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
91
|
+
"custom-element-name": unref(COMPONENT_NAME),
|
|
92
|
+
environment: __props.environment,
|
|
93
|
+
locale: __props.locale,
|
|
94
|
+
"portal-object": __props.portalObject,
|
|
95
|
+
"allowed-portal-types": ["CUSTOMER"],
|
|
96
|
+
"primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
|
|
97
|
+
"secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
|
|
98
|
+
"experimental-features": __props.experimentalFeatures,
|
|
99
|
+
"log-level": __props.logLevel,
|
|
100
|
+
"on-log": __props.onLog,
|
|
101
|
+
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
102
|
+
}, {
|
|
103
|
+
default: withCtx(() => [
|
|
104
|
+
createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
105
|
+
default: withCtx(({ paymentMethods, paymentMethodsOptions, isLoading }) => [
|
|
106
|
+
createVNode(_sfc_main$3, {
|
|
107
|
+
configuration: __props.configuration,
|
|
108
|
+
"payment-methods": paymentMethods,
|
|
109
|
+
"payment-methods-options": paymentMethodsOptions,
|
|
110
|
+
"is-loading": isLoading
|
|
111
|
+
}, null, 8, ["configuration", "payment-methods", "payment-methods-options", "is-loading"])
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 16)
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const SolvimonCustomerPaymentMethods = defineCustomElement(
|
|
122
|
+
_sfc_main
|
|
123
|
+
);
|
|
124
|
+
const COMPONENT_NAME = getComponentName("customer-payment-methods");
|
|
125
|
+
const defineSolvimonCustomerPaymentMethods = () => {
|
|
126
|
+
if (!customElements.get(COMPONENT_NAME)) {
|
|
127
|
+
customElements.define(COMPONENT_NAME, SolvimonCustomerPaymentMethods);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
3
130
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
131
|
+
COMPONENT_NAME,
|
|
132
|
+
SolvimonCustomerPaymentMethods,
|
|
133
|
+
defineSolvimonCustomerPaymentMethods
|
|
7
134
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SolvimonInvoice: import('vue').VueElementConstructor<unknown>;
|
|
1
|
+
export declare const SolvimonInvoice: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
|
|
2
2
|
export declare const COMPONENT_NAME: string;
|
|
3
3
|
export declare const defineSolvimonInvoice: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../Invoice.entry.ce-Cgr43ome.js");require("../../component-Df5eNqYX.js"),exports.COMPONENT_NAME=e.COMPONENT_NAME,exports.SolvimonInvoice=e.SolvimonInvoice,exports.defineSolvimonInvoice=e.defineSolvimonInvoice;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../invoices-BW1notiX.js"),n=require("../../useService-D-CUtlp3.js"),i=require("../../payments-BHv4hCeJ.js"),a=require("../../component-XHQYFLA_.js"),r=require("../../index-CWSXne1Q.js"),l=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js"),c=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js");const s=e.defineComponent({__name:"Invoice.entry.view",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(a){const r=a,l=function({invoiceId:e}){const{getInvoice:t,getInvoicePdf:i}=o.createInvoicesService(),{data:a,execute:r,apiStatus:l,error:c,isPending:s}=n.useService({service:()=>t(e)});return{invoice:a,downloadInvoicePdf:i,apiStatus:l,error:c,get:r,isPending:s}}({invoiceId:r.configuration.invoiceId}),c=function(){const{getPayments:e}=i.createPaymentsService(),{data:t,execute:o,error:a,apiStatus:r,isPending:l}=n.useService({service:e,isCollection:!0});return{payments:t,get:o,error:a,apiStatus:r,isPending:l}}(),{isLoading:s}=t.useLoadInitialData(l.get(),c.get(r.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(l).invoice.value,invoiceDownloadService:e.unref(l).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(s)})}}),d={key:0,class:"mt-8"},u={class:"flex flex-col gap-6"},p=["onClick","onKeyup"],m={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},f={key:0},v={class:"p-0"},g={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},y=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:i,formatMessage:r,formatNumber:l}=a.useIntl(),{getIsOpen:c,toggle:s}=a.useToggleList(),y=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),_=e=>r({defaultMessage:"Service period - {startAt} - {endAt}",id:"kFCxC4",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),w=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=y.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:r({defaultMessage:"Credits",id:"K2fM1n",description:"Fallback label for wallet balance credit types when no name is available"})},b=e=>e?l(Number(e)):r({defaultMessage:"-",id:"dHb0fN",description:"Placeholder shown when a wallet balance quantity is missing"}),h=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,r,l;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(r=u.left_wallet_credits)?void 0:r.quantity),available:n(null==(l=u.available_wallet_credits)?void 0:l.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,g=s.get(m)??new Set;if(g.has(v))continue;g.add(v),s.set(m,g);const y=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};y.rows.push(f),c.set(m,y)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:_,getCreditTypeLabel:w,formatQuantity:b}));return(t,o)=>h.value.length>0?(e.openBlock(),e.createElementBlock("section",d,[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(a._sfc_main$2q),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$2),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(a.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Wallet balance",id:"j2d7b2",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(s)(t.id),onKeyup:[e.withKeys(o=>e.unref(s)(t.id),["enter"]),e.withKeys(o=>e.unref(s)(t.id),["space"])]},[e.createVNode(e.unref(a._sfc_main$u),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main$4),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(c)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",m,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,p),e.unref(c)(t.id)?(e.openBlock(),e.createElementBlock("tr",f,[e.createElementVNode("td",v,[e.createElementVNode("div",g,[e.createVNode(e.unref(a.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(a._sfc_main$t),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Credit breakdown",id:"65I4e4",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Balance",id:"4UjRe6",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Used",id:"rUy4Lk",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(a._sfc_main$t),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Remaining",id:"C8F4/r",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(a._sfc_main$u),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(a._sfc_main$u),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),_=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=a.useIntl(),{width:n}=r.useWindowSize(),i=e.computed(()=>n.value<=768);return(n,r)=>(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1g),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!i.value})},[i.value?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$1J),{key:0,variant:"default","has-icon":"",class:"justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(a._sfc_main$e),{invoice:t.invoice,"is-expandable":!i.value},{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(y,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),w={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},b={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},h=e.defineComponent({__name:"InvoiceDetail",props:{invoice:{type:Object},paymentAttempts:{default:()=>[],type:Array},downloadService:{type:Function},showDownloadButton:{type:Boolean,default:!0},showCustomerBillingInformation:{type:Boolean,default:!0},showPaymentAttempts:{type:Boolean,default:!0}},setup(t){const{$t:o}=a.useIntl();return(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(a._sfc_main$w),{class:"mb-6","payment-attempts":t.paymentAttempts,invoice:t.invoice,"download-service":()=>t.downloadService(t.invoice.id),"show-download-button":t.showDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",w,[t.invoice?(e.openBlock(),e.createBlock(_,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",b,[e.createVNode(l._sfc_main,{invoice:t.invoice},null,8,["invoice"]),t.showPaymentAttempts&&t.paymentAttempts.length?(e.openBlock(),e.createBlock(c._sfc_main,{key:0,"payment-attempts":t.paymentAttempts,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.showCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$z),{key:1,customer:t.invoice.customer,title:e.unref(o)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64))}}),x=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup:t=>(o,n)=>{var i,a,r;return e.openBlock(),e.createBlock(h,{invoice:t.invoice,"payment-attempts":t.payments,"download-service":t.invoiceDownloadService,"show-download-button":null==(i=t.configuration)?void 0:i.enableDownloadButton,"show-customer-billing-information":null==(a=t.configuration)?void 0:a.enableCustomerBillingInformation,"show-payment-attempts":null==(r=t.configuration)?void 0:r.enablePaymentAttempts},null,8,["invoice","payment-attempts","download-service","show-download-button","show-customer-billing-information","show-payment-attempts"])}}),k=e.defineComponent({__name:"Invoice.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){var o;const n=t;if(!(null==(o=n.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const i=e.computed(()=>({...n,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...n.configuration}}));return(o,n)=>{var r,l,c,d;return e.openBlock(),e.createBlock(e.unref(a._sfc_main$1),{"custom-element-name":e.unref(N),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(r=t.branding)?void 0:r.colors)?void 0:l.primary,"secondary-color":null==(d=null==(c=t.branding)?void 0:c.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(s,e.normalizeProps(e.guardReactiveProps(i.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(x,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),C=a.defineCustomElement(k),N=a.getComponentName("invoice");exports.COMPONENT_NAME=N,exports.SolvimonInvoice=C,exports.defineSolvimonInvoice=()=>{customElements.get(N)||customElements.define(N,C)};
|