@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.
Files changed (135) hide show
  1. package/README.md +5 -5
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js → BillingInformation.vue_vue_type_script_setup_true_lang-BD3CrJzj.js} +1 -1
  3. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DQAp1xwu.mjs} +2 -2
  4. package/dist/{ContentWithAsideLayout-BC-C5Gjt.mjs → ContentWithAsideLayout-CRsFr9TH.mjs} +1 -1
  5. package/dist/{ContentWithAsideLayout-CIVSoqFr.js → ContentWithAsideLayout-DczcgSrt.js} +1 -1
  6. 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
  7. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs} +1 -1
  8. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs} +1 -1
  9. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-sNdlKgdU.js} +1 -1
  10. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DJEZEEwZ.mjs} +5 -5
  11. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Sn1Jq19s.js +1 -0
  12. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Bifo4jTH.js +1 -0
  13. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-DWp42_G4.mjs +75 -0
  14. 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
  15. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js +1 -0
  16. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bp5RvQVS.mjs} +5 -5
  17. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-yyhwzYSM.js} +1 -1
  18. package/dist/auto-DzZuCneB.mjs +14387 -0
  19. package/dist/auto-PpnAChnH.js +6 -0
  20. package/dist/{cloneDeep-Hs8Pp07F.js → cloneDeep-DranHQkY.js} +1 -1
  21. package/dist/{component-BkmcE85U.mjs → component-DEo_ndpK.mjs} +92 -78
  22. package/dist/component-XHQYFLA_.js +1 -0
  23. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
  24. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  25. package/dist/components/BillingInformation/BillingInformation.es.js +96 -5
  26. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
  27. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  28. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +582 -5
  29. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
  30. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  31. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +132 -5
  32. package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
  33. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  34. package/dist/components/Invoice/Invoice.es.js +580 -5
  35. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
  36. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  37. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +127 -5
  38. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
  39. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  40. package/dist/components/InvoicesList/InvoicesList.es.js +102 -5
  41. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
  42. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  43. package/dist/components/PaymentHistory/PaymentHistory.es.js +131 -5
  44. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
  45. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  46. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +236 -5
  47. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
  48. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  49. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +150 -5
  50. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
  51. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  52. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +132 -5
  53. package/dist/components/WalletBalances/WalletBalances.ce.d.ts +3 -0
  54. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -0
  55. package/dist/{InvoiceDetails.entry.ce-Cnpz8CLJ.mjs → components/WalletBalances/WalletBalances.es.js} +41 -51
  56. package/dist/core/configuration.d.ts +2 -1
  57. package/dist/core/index.cjs.js +1 -1
  58. package/dist/core/index.es.js +1 -1
  59. package/dist/core/registry.d.ts +1 -1
  60. package/dist/core/types.d.ts +4 -0
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.es.js +40 -34
  64. package/dist/invoices-BW1notiX.js +1 -0
  65. package/dist/{invoices-C31Wz1Bu.mjs → invoices-M5oYVch6.mjs} +1 -1
  66. package/dist/{paymentMethods-CzUqDlvc.js → paymentMethods-BX80t2zk.js} +1 -1
  67. package/dist/{paymentMethods-CrU4G_2Y.mjs → paymentMethods-CqKUfc3w.mjs} +1 -1
  68. package/dist/{payments-C3LPk9k9.js → payments-BHv4hCeJ.js} +1 -1
  69. package/dist/{payments-NtWI8KlU.mjs → payments-CosaPZwo.mjs} +1 -1
  70. package/dist/registry-BwKEYOf7.js +1 -0
  71. package/dist/registry-Cag1Jj7P.mjs +143 -0
  72. package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
  73. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  74. package/dist/screens/Checkout/Checkout.es.js +5140 -5
  75. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
  76. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  77. package/dist/screens/CustomerOverview/CustomerOverview.es.js +134 -5
  78. package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +3 -0
  79. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -0
  80. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +1012 -0
  81. package/dist/{subscriptions-3R7aMoky.mjs → subscriptions-Bs4DIE8f.mjs} +1 -1
  82. package/dist/{subscriptions-CqK7t-fF.js → subscriptions-CnxvsBXd.js} +1 -1
  83. package/dist/{useActionDispatchProvider-CBo_Hwu5.mjs → useActionDispatchProvider-CgRcOqv3.mjs} +1 -1
  84. package/dist/useActionDispatchProvider-Cru69mAl.js +1 -0
  85. package/dist/{useCustomer-Dp8sGHI0.js → useCustomer-B0NK96dA.js} +1 -1
  86. package/dist/{useCustomer-BRY0tuBH.mjs → useCustomer-DlcjY3fP.mjs} +2 -2
  87. package/dist/{useCustomerPaymentMethodOptions-Fe_dLxfv.mjs → useCustomerPaymentMethodOptions-BzEquyUV.mjs} +7 -6
  88. package/dist/{useCustomerPaymentMethodOptions-DYpMDnJR.js → useCustomerPaymentMethodOptions-C-8BLzqb.js} +1 -1
  89. package/dist/{useIncrementalLoading-fHCizCSo.mjs → useIncrementalLoading-C7ToTmZK.mjs} +9 -7
  90. package/dist/useIncrementalLoading-D60Vttil.js +1 -0
  91. package/dist/{useInvoiceData-dyvoDwFF.mjs → useInvoiceData-CcueV3We.mjs} +2 -2
  92. package/dist/{useInvoiceData-DImEH1ca.js → useInvoiceData-DstXfI7t.js} +1 -1
  93. package/dist/{useInvoicesList-rDvRzMqe.mjs → useInvoicesList-CXng3aUm.mjs} +4 -4
  94. package/dist/{useInvoicesList-BZQ9Y0qN.js → useInvoicesList-DmzjgMlW.js} +1 -1
  95. package/dist/{usePaymentMethods-Dbimodf0.js → usePaymentMethods-DCGVRXA4.js} +1 -1
  96. package/dist/{usePaymentMethods-Bq5fWl1Q.mjs → usePaymentMethods-Db-1R6rI.mjs} +2 -2
  97. package/dist/{useService-Dz13Nxbi.mjs → useService-B4qv5N2D.mjs} +14 -5
  98. package/dist/useService-D-CUtlp3.js +1 -0
  99. package/dist/useWalletBalanceItems-BZyiAhcV.js +1 -0
  100. package/dist/useWalletBalanceItems-CHkLaccm.mjs +105 -0
  101. package/package.json +16 -3
  102. package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +0 -99
  103. package/dist/BillingInformation.entry.ce-DkrfEvK_.js +0 -1
  104. package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +0 -1
  105. package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +0 -579
  106. package/dist/Checkout.entry.ce-Bif6vR1K.mjs +0 -5185
  107. package/dist/Checkout.entry.ce-CkQnLAn4.js +0 -1
  108. package/dist/CustomerOverview.entry.ce-C__omsVl.js +0 -1
  109. package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +0 -231
  110. package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +0 -135
  111. package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +0 -1
  112. package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +0 -583
  113. package/dist/Invoice.entry.ce-Cgr43ome.js +0 -1
  114. package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +0 -1
  115. package/dist/InvoicesList.entry.ce-38iOW5qh.js +0 -1
  116. package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +0 -105
  117. package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +0 -1
  118. package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +0 -134
  119. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +0 -1
  120. package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +0 -238
  121. package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +0 -1
  122. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +0 -1
  123. package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +0 -1
  124. package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +0 -153
  125. package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +0 -1
  126. package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +0 -135
  127. package/dist/auto-B_36W1Fc.js +0 -6
  128. package/dist/auto-BfMZdgp-.mjs +0 -14207
  129. package/dist/component-Df5eNqYX.js +0 -1
  130. package/dist/invoices-8M_3ur_U.js +0 -1
  131. package/dist/registry-By94DXE2.js +0 -1
  132. package/dist/registry-shRKDl3K.mjs +0 -127
  133. package/dist/useActionDispatchProvider-DsIljrhi.js +0 -1
  134. package/dist/useIncrementalLoading-D8oKNxX7.js +0 -1
  135. package/dist/useService-bNNi4GB8.js +0 -1
@@ -1,7 +1,582 @@
1
- import { C, S, d } from "../../Invoice.entry.ce-CdJ9TPZe.mjs";
2
- import "../../component-BkmcE85U.mjs";
1
+ import { defineComponent, renderSlot, unref, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, withKeys, normalizeClass, createCommentVNode, createBlock, normalizeProps, guardReactiveProps } from "vue";
2
+ import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
3
+ import { c as createInvoicesService } from "../../invoices-M5oYVch6.mjs";
4
+ import { u as useService } from "../../useService-B4qv5N2D.mjs";
5
+ import { c as createPaymentsService } from "../../payments-CosaPZwo.mjs";
6
+ import { b as useIntl, R as useToggleList, S as _sfc_main$2q, _ as _sfc_main$2$1, U as InvoiceTable, V as _sfc_main$t, W as _sfc_main$u, n as _sfc_main$4$1, d as _sfc_main$1g, X as _sfc_main$1J, Y as _sfc_main$e, Z as _sfc_main$w, l as _sfc_main$z, p as _sfc_main$8, q as defineCustomElement, o as getComponentName } from "../../component-DEo_ndpK.mjs";
7
+ import { u as useWindowSize } from "../../index-D3v7hAtc.mjs";
8
+ import { _ as _sfc_main$6 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0ie9Krt.mjs";
9
+ import { _ as _sfc_main$7 } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DVDOsMnT.mjs";
10
+ function useInvoice({ invoiceId }) {
11
+ const { getInvoice, getInvoicePdf: downloadInvoicePdf } = createInvoicesService();
12
+ const service = () => getInvoice(invoiceId);
13
+ const {
14
+ data,
15
+ execute: get,
16
+ apiStatus,
17
+ error,
18
+ isPending
19
+ } = useService({
20
+ service
21
+ });
22
+ return {
23
+ invoice: data,
24
+ downloadInvoicePdf,
25
+ apiStatus,
26
+ error,
27
+ get,
28
+ isPending
29
+ };
30
+ }
31
+ function usePayments() {
32
+ const { getPayments } = createPaymentsService();
33
+ const { data, execute: get, error, apiStatus, isPending } = useService({
34
+ service: getPayments,
35
+ isCollection: true
36
+ });
37
+ return { payments: data, get, error, apiStatus, isPending };
38
+ }
39
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40
+ __name: "Invoice.entry.view",
41
+ props: {
42
+ environment: { type: String },
43
+ locale: { type: String },
44
+ dateLocale: { type: String },
45
+ messages: { type: Object },
46
+ showTimezones: { type: Boolean },
47
+ primaryColor: { type: String },
48
+ secondaryColor: { type: String },
49
+ isShadowRoot: { type: Boolean },
50
+ experimentalFeatures: { type: Array },
51
+ logLevel: { type: String },
52
+ onLog: { type: Function },
53
+ allowedPortalTypes: { type: Array },
54
+ portalObject: { type: Object },
55
+ customElementName: { type: String },
56
+ branding: { type: Object },
57
+ configuration: { type: Object }
58
+ },
59
+ setup(__props) {
60
+ const props = __props;
61
+ const invoice = useInvoice({ invoiceId: props.configuration.invoiceId });
62
+ const payments = usePayments();
63
+ const { isLoading } = useLoadInitialData(
64
+ invoice.get(),
65
+ payments.get(props.configuration.invoiceId)
66
+ );
67
+ return (_ctx, _cache) => {
68
+ return renderSlot(_ctx.$slots, "default", {
69
+ invoice: unref(invoice).invoice.value,
70
+ invoiceDownloadService: unref(invoice).downloadInvoicePdf,
71
+ payments: unref(payments),
72
+ isLoading: unref(isLoading)
73
+ });
74
+ };
75
+ }
76
+ });
77
+ const buildInvoiceCreditsBreakdown = ({
78
+ invoice,
79
+ getPeriodTitle,
80
+ getCreditTypeLabel,
81
+ formatQuantity
82
+ }) => {
83
+ const periods = [...invoice.periods ?? [], ...invoice.closed_periods ?? []];
84
+ return periods.map((period) => {
85
+ var _a, _b, _c, _d;
86
+ const walletRowsByLabel = /* @__PURE__ */ new Map();
87
+ const rowKeysByLabel = /* @__PURE__ */ new Map();
88
+ for (const group of period.groups ?? []) {
89
+ for (const line of group.lines ?? []) {
90
+ const walletBalanceDetails = (_a = line == null ? void 0 : line.details) == null ? void 0 : _a.wallet_balance_details;
91
+ if (!walletBalanceDetails) {
92
+ continue;
93
+ }
94
+ const primaryCredit = walletBalanceDetails.used_wallet_credits ?? walletBalanceDetails.left_wallet_credits ?? walletBalanceDetails.available_wallet_credits;
95
+ const label = getCreditTypeLabel(primaryCredit);
96
+ const row = {
97
+ id: `${period.period_order}-${group.group_order}-${line.line_order}`,
98
+ label,
99
+ used: formatQuantity((_b = walletBalanceDetails.used_wallet_credits) == null ? void 0 : _b.quantity),
100
+ left: formatQuantity((_c = walletBalanceDetails.left_wallet_credits) == null ? void 0 : _c.quantity),
101
+ available: formatQuantity(
102
+ (_d = walletBalanceDetails.available_wallet_credits) == null ? void 0 : _d.quantity
103
+ )
104
+ };
105
+ const rowKey = `${row.label}-${row.used}-${row.left}-${row.available}`;
106
+ const rowKeys = rowKeysByLabel.get(label) ?? /* @__PURE__ */ new Set();
107
+ if (rowKeys.has(rowKey)) {
108
+ continue;
109
+ }
110
+ rowKeys.add(rowKey);
111
+ rowKeysByLabel.set(label, rowKeys);
112
+ const walletRow = walletRowsByLabel.get(label) ?? {
113
+ id: `${period.period_order}-${label}`,
114
+ label,
115
+ amount: row.available,
116
+ rows: []
117
+ };
118
+ walletRow.rows.push(row);
119
+ walletRowsByLabel.set(label, walletRow);
120
+ }
121
+ }
122
+ return {
123
+ id: `${period.period_order}-${period.start_at}`,
124
+ title: getPeriodTitle(period),
125
+ rows: [...walletRowsByLabel.values()]
126
+ };
127
+ }).filter((period) => period.rows.length > 0);
128
+ };
129
+ const _hoisted_1$1 = {
130
+ key: 0,
131
+ class: "mt-8"
132
+ };
133
+ const _hoisted_2$1 = { class: "flex flex-col gap-6" };
134
+ const _hoisted_3 = ["onClick", "onKeyup"];
135
+ const _hoisted_4 = { 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" };
136
+ const _hoisted_5 = { key: 0 };
137
+ const _hoisted_6 = { class: "p-0" };
138
+ const _hoisted_7 = { class: "-mx-9 bg-gray-50 px-9 py-3 text-xs" };
139
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
140
+ __name: "InvoiceCreditsBreakdown",
141
+ props: {
142
+ invoice: { type: Object }
143
+ },
144
+ setup(__props) {
145
+ const props = __props;
146
+ const { formatDate, $t, formatMessage, formatNumber } = useIntl();
147
+ const { getIsOpen, toggle } = useToggleList();
148
+ const creditTypesById = computed(
149
+ () => Object.fromEntries(
150
+ (props.invoice.credit_types ?? []).map((creditType) => [
151
+ creditType.id,
152
+ creditType
153
+ ])
154
+ )
155
+ );
156
+ const getPeriodTitle = (period) => formatMessage(
157
+ {
158
+ defaultMessage: "Service period - {startAt} - {endAt}",
159
+ id: "kFCxC4",
160
+ description: "Heading shown above wallet balance details for an invoice period"
161
+ },
162
+ {
163
+ startAt: formatDate({
164
+ date: period.start_at,
165
+ format: "date",
166
+ offsetType: "offsetted",
167
+ timezone: props.invoice.customer.timezone
168
+ }),
169
+ endAt: formatDate({
170
+ date: period.end_at,
171
+ format: "date",
172
+ offsetType: "offsetted",
173
+ timezone: props.invoice.customer.timezone
174
+ })
175
+ }
176
+ );
177
+ const getCreditTypeLabel = (credits) => {
178
+ var _a;
179
+ if (!(credits == null ? void 0 : credits.credit_type_id)) {
180
+ return formatMessage({
181
+ defaultMessage: "Credits",
182
+ id: "K2fM1n",
183
+ description: "Fallback label for wallet balance credit types when no name is available"
184
+ });
185
+ }
186
+ return ((_a = creditTypesById.value[credits.credit_type_id]) == null ? void 0 : _a.name) ?? credits.credit_type_id;
187
+ };
188
+ const formatQuantity = (quantity) => quantity ? formatNumber(Number(quantity)) : formatMessage({
189
+ defaultMessage: "-",
190
+ id: "dHb0fN",
191
+ description: "Placeholder shown when a wallet balance quantity is missing"
192
+ });
193
+ const periodsWithCredits = computed(
194
+ () => buildInvoiceCreditsBreakdown({
195
+ invoice: props.invoice,
196
+ getPeriodTitle,
197
+ getCreditTypeLabel,
198
+ formatQuantity
199
+ })
200
+ );
201
+ return (_ctx, _cache) => {
202
+ return periodsWithCredits.value.length > 0 ? (openBlock(), createElementBlock("section", _hoisted_1$1, [
203
+ createElementVNode("div", _hoisted_2$1, [
204
+ (openBlock(true), createElementBlock(Fragment, null, renderList(periodsWithCredits.value, (period) => {
205
+ return openBlock(), createElementBlock("section", {
206
+ key: period.id
207
+ }, [
208
+ createVNode(unref(_sfc_main$2q), { class: "mt-4" }, {
209
+ default: withCtx(() => [
210
+ createVNode(unref(_sfc_main$2$1), {
211
+ tag: "h3",
212
+ variant: "caps-heading"
213
+ }, {
214
+ default: withCtx(() => [
215
+ createTextVNode(toDisplayString(period.title), 1)
216
+ ]),
217
+ _: 2
218
+ }, 1024)
219
+ ]),
220
+ _: 2
221
+ }, 1024),
222
+ createVNode(unref(InvoiceTable), { class: "mt-3" }, {
223
+ default: withCtx(() => [
224
+ createElementVNode("tr", null, [
225
+ createVNode(unref(_sfc_main$t), {
226
+ left: "",
227
+ class: "text-gray-600"
228
+ }, {
229
+ default: withCtx(() => [
230
+ createTextVNode(toDisplayString(unref($t)({
231
+ defaultMessage: "Wallet balance",
232
+ id: "j2d7b2",
233
+ description: "Section header for invoice wallet balance details"
234
+ })), 1)
235
+ ]),
236
+ _: 1
237
+ })
238
+ ]),
239
+ (openBlock(true), createElementBlock(Fragment, null, renderList(period.rows, (row) => {
240
+ return openBlock(), createElementBlock(Fragment, {
241
+ key: row.id
242
+ }, [
243
+ createElementVNode("tr", {
244
+ class: "cursor-pointer border-t",
245
+ tabindex: "0",
246
+ onClick: ($event) => unref(toggle)(row.id),
247
+ onKeyup: [
248
+ withKeys(($event) => unref(toggle)(row.id), ["enter"]),
249
+ withKeys(($event) => unref(toggle)(row.id), ["space"])
250
+ ]
251
+ }, [
252
+ createVNode(unref(_sfc_main$u), { class: "p-0" }, {
253
+ default: withCtx(() => [
254
+ createVNode(unref(_sfc_main$4$1), {
255
+ icon: "keyboard_arrow_down",
256
+ size: "md",
257
+ class: normalizeClass(["absolute -translate-x-7 text-slate-400", { "-rotate-90": !unref(getIsOpen)(row.id) }])
258
+ }, null, 8, ["class"]),
259
+ createTextVNode(" " + toDisplayString(row.label) + " ", 1),
260
+ createElementVNode("span", _hoisted_4, toDisplayString(row.rows.length), 1)
261
+ ]),
262
+ _: 2
263
+ }, 1024)
264
+ ], 40, _hoisted_3),
265
+ unref(getIsOpen)(row.id) ? (openBlock(), createElementBlock("tr", _hoisted_5, [
266
+ createElementVNode("td", _hoisted_6, [
267
+ createElementVNode("div", _hoisted_7, [
268
+ createVNode(unref(InvoiceTable), null, {
269
+ default: withCtx(() => [
270
+ createElementVNode("tr", null, [
271
+ createVNode(unref(_sfc_main$t), {
272
+ left: "",
273
+ class: "w-2/5"
274
+ }, {
275
+ default: withCtx(() => [
276
+ createTextVNode(toDisplayString(unref($t)({
277
+ defaultMessage: "Credit breakdown",
278
+ id: "65I4e4",
279
+ description: "Column header for wallet balance credit type details"
280
+ })), 1)
281
+ ]),
282
+ _: 1
283
+ }),
284
+ createVNode(unref(_sfc_main$t), {
285
+ right: "",
286
+ class: "w-1/5"
287
+ }, {
288
+ default: withCtx(() => [
289
+ createTextVNode(toDisplayString(unref($t)({
290
+ defaultMessage: "Balance",
291
+ id: "4UjRe6",
292
+ description: "Column header for the available wallet balance amount"
293
+ })), 1)
294
+ ]),
295
+ _: 1
296
+ }),
297
+ createVNode(unref(_sfc_main$t), {
298
+ right: "",
299
+ class: "w-1/5"
300
+ }, {
301
+ default: withCtx(() => [
302
+ createTextVNode(toDisplayString(unref($t)({
303
+ defaultMessage: "Used",
304
+ id: "rUy4Lk",
305
+ description: "Column header for the used wallet credit amount"
306
+ })), 1)
307
+ ]),
308
+ _: 1
309
+ }),
310
+ createVNode(unref(_sfc_main$t), {
311
+ right: "",
312
+ class: "w-1/5"
313
+ }, {
314
+ default: withCtx(() => [
315
+ createTextVNode(toDisplayString(unref($t)({
316
+ defaultMessage: "Remaining",
317
+ id: "C8F4/r",
318
+ description: "Column header for the remaining wallet credit amount"
319
+ })), 1)
320
+ ]),
321
+ _: 1
322
+ })
323
+ ]),
324
+ (openBlock(true), createElementBlock(Fragment, null, renderList(row.rows, (breakdownRow) => {
325
+ return openBlock(), createElementBlock("tr", {
326
+ key: breakdownRow.id,
327
+ class: "border-t"
328
+ }, [
329
+ createVNode(unref(_sfc_main$u), null, {
330
+ default: withCtx(() => [
331
+ createTextVNode(toDisplayString(breakdownRow.label), 1)
332
+ ]),
333
+ _: 2
334
+ }, 1024),
335
+ createVNode(unref(_sfc_main$u), { number: "" }, {
336
+ default: withCtx(() => [
337
+ createTextVNode(toDisplayString(breakdownRow.available), 1)
338
+ ]),
339
+ _: 2
340
+ }, 1024),
341
+ createVNode(unref(_sfc_main$u), { number: "" }, {
342
+ default: withCtx(() => [
343
+ createTextVNode(toDisplayString(breakdownRow.used), 1)
344
+ ]),
345
+ _: 2
346
+ }, 1024),
347
+ createVNode(unref(_sfc_main$u), { number: "" }, {
348
+ default: withCtx(() => [
349
+ createTextVNode(toDisplayString(breakdownRow.left), 1)
350
+ ]),
351
+ _: 2
352
+ }, 1024)
353
+ ]);
354
+ }), 128))
355
+ ]),
356
+ _: 2
357
+ }, 1024)
358
+ ])
359
+ ])
360
+ ])) : createCommentVNode("", true)
361
+ ], 64);
362
+ }), 128))
363
+ ]),
364
+ _: 2
365
+ }, 1024)
366
+ ]);
367
+ }), 128))
368
+ ])
369
+ ])) : createCommentVNode("", true);
370
+ };
371
+ }
372
+ });
373
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
374
+ __name: "InvoiceBlock",
375
+ props: {
376
+ invoice: { type: Object }
377
+ },
378
+ setup(__props) {
379
+ const { $t } = useIntl();
380
+ const { width } = useWindowSize();
381
+ const isSmallScreen = computed(() => width.value <= 768);
382
+ return (_ctx, _cache) => {
383
+ return openBlock(), createBlock(unref(_sfc_main$1g), {
384
+ title: unref($t)({
385
+ defaultMessage: "Invoice",
386
+ description: "Title for the invoice block on the invoice details page",
387
+ id: "sdk.invoice_details.invoice.title"
388
+ }),
389
+ class: "grow"
390
+ }, {
391
+ default: withCtx(() => [
392
+ createElementVNode("div", {
393
+ class: normalizeClass({ "p-6 pt-2": !isSmallScreen.value })
394
+ }, [
395
+ isSmallScreen.value ? (openBlock(), createBlock(unref(_sfc_main$1J), {
396
+ key: 0,
397
+ variant: "default",
398
+ "has-icon": "",
399
+ class: "justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"
400
+ }, {
401
+ default: withCtx(() => [
402
+ createTextVNode(toDisplayString(unref($t)({
403
+ defaultMessage: "Download the PDF for a full breakdown",
404
+ description: "Download the PDF for a full breakdown",
405
+ id: "sdk.invoice_details.invoice.download_pdf"
406
+ })), 1)
407
+ ]),
408
+ _: 1
409
+ })) : createCommentVNode("", true),
410
+ createVNode(unref(_sfc_main$e), {
411
+ invoice: __props.invoice,
412
+ "is-expandable": !isSmallScreen.value
413
+ }, {
414
+ logo: withCtx(() => [
415
+ renderSlot(_ctx.$slots, "logo")
416
+ ]),
417
+ _: 3
418
+ }, 8, ["invoice", "is-expandable"]),
419
+ createVNode(_sfc_main$4, { invoice: __props.invoice }, null, 8, ["invoice"])
420
+ ], 2)
421
+ ]),
422
+ _: 3
423
+ }, 8, ["title"]);
424
+ };
425
+ }
426
+ });
427
+ const _hoisted_1 = { class: "flex flex-col gap-3 lg:flex-row lg:gap-6" };
428
+ const _hoisted_2 = { class: "flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6" };
429
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
430
+ __name: "InvoiceDetail",
431
+ props: {
432
+ invoice: { type: Object },
433
+ paymentAttempts: { default: () => [], type: Array },
434
+ downloadService: { type: Function },
435
+ showDownloadButton: { type: Boolean, default: true },
436
+ showCustomerBillingInformation: { type: Boolean, default: true },
437
+ showPaymentAttempts: { type: Boolean, default: true }
438
+ },
439
+ setup(__props) {
440
+ const { $t } = useIntl();
441
+ return (_ctx, _cache) => {
442
+ return openBlock(), createElementBlock(Fragment, null, [
443
+ createVNode(unref(_sfc_main$w), {
444
+ class: "mb-6",
445
+ "payment-attempts": __props.paymentAttempts,
446
+ invoice: __props.invoice,
447
+ "download-service": () => __props.downloadService(__props.invoice.id),
448
+ "show-download-button": __props.showDownloadButton,
449
+ variant: "external"
450
+ }, null, 8, ["payment-attempts", "invoice", "download-service", "show-download-button"]),
451
+ createElementVNode("div", _hoisted_1, [
452
+ __props.invoice ? (openBlock(), createBlock(_sfc_main$3, {
453
+ key: 0,
454
+ invoice: __props.invoice
455
+ }, null, 8, ["invoice"])) : createCommentVNode("", true),
456
+ createElementVNode("div", _hoisted_2, [
457
+ createVNode(_sfc_main$6, { invoice: __props.invoice }, null, 8, ["invoice"]),
458
+ __props.showPaymentAttempts && __props.paymentAttempts.length ? (openBlock(), createBlock(_sfc_main$7, {
459
+ key: 0,
460
+ "payment-attempts": __props.paymentAttempts,
461
+ customer: __props.invoice.customer
462
+ }, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true),
463
+ __props.showCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$z), {
464
+ key: 1,
465
+ customer: __props.invoice.customer,
466
+ title: unref($t)({
467
+ defaultMessage: "Your billing information",
468
+ description: "Title for the billing information on the detailed invoice view",
469
+ id: "sdk.invoice_details.customer_billing_information.title"
470
+ })
471
+ }, null, 8, ["customer", "title"])) : createCommentVNode("", true)
472
+ ])
473
+ ])
474
+ ], 64);
475
+ };
476
+ }
477
+ });
478
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
479
+ __name: "Invoice",
480
+ props: {
481
+ isLoading: { type: Boolean },
482
+ invoice: { type: Object },
483
+ payments: { type: Array },
484
+ invoiceDownloadService: { type: Function },
485
+ configuration: { type: Object }
486
+ },
487
+ setup(__props) {
488
+ return (_ctx, _cache) => {
489
+ var _a, _b, _c;
490
+ return openBlock(), createBlock(_sfc_main$2, {
491
+ invoice: __props.invoice,
492
+ "payment-attempts": __props.payments,
493
+ "download-service": __props.invoiceDownloadService,
494
+ "show-download-button": (_a = __props.configuration) == null ? void 0 : _a.enableDownloadButton,
495
+ "show-customer-billing-information": (_b = __props.configuration) == null ? void 0 : _b.enableCustomerBillingInformation,
496
+ "show-payment-attempts": (_c = __props.configuration) == null ? void 0 : _c.enablePaymentAttempts
497
+ }, null, 8, ["invoice", "payment-attempts", "download-service", "show-download-button", "show-customer-billing-information", "show-payment-attempts"]);
498
+ };
499
+ }
500
+ });
501
+ const _sfc_main = /* @__PURE__ */ defineComponent({
502
+ __name: "Invoice.entry",
503
+ props: {
504
+ environment: { type: String },
505
+ locale: { type: String },
506
+ dateLocale: { type: String },
507
+ messages: { type: Object },
508
+ showTimezones: { type: Boolean },
509
+ primaryColor: { type: String },
510
+ secondaryColor: { type: String },
511
+ isShadowRoot: { type: Boolean },
512
+ experimentalFeatures: { type: Array },
513
+ logLevel: { type: String },
514
+ onLog: { type: Function },
515
+ allowedPortalTypes: { type: Array },
516
+ portalObject: { type: Object },
517
+ customElementName: { type: String },
518
+ branding: { type: Object },
519
+ configuration: { type: Object }
520
+ },
521
+ setup(__props) {
522
+ var _a;
523
+ const props = __props;
524
+ if (!((_a = props.configuration) == null ? void 0 : _a.invoiceId)) {
525
+ throw new Error("Missing invoice id");
526
+ }
527
+ const resolvedProps = computed(() => ({
528
+ ...props,
529
+ configuration: {
530
+ enableCustomerBillingInformation: true,
531
+ enableDownloadButton: true,
532
+ enablePaymentAttempts: true,
533
+ ...props.configuration
534
+ }
535
+ }));
536
+ return (_ctx, _cache) => {
537
+ var _a2, _b, _c, _d;
538
+ return openBlock(), createBlock(unref(_sfc_main$8), {
539
+ "custom-element-name": unref(COMPONENT_NAME),
540
+ environment: __props.environment,
541
+ locale: __props.locale,
542
+ "portal-object": __props.portalObject,
543
+ "allowed-portal-types": ["CUSTOMER"],
544
+ "primary-color": (_b = (_a2 = __props.branding) == null ? void 0 : _a2.colors) == null ? void 0 : _b.primary,
545
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
546
+ "experimental-features": __props.experimentalFeatures,
547
+ "log-level": __props.logLevel,
548
+ "on-log": __props.onLog,
549
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
550
+ }, {
551
+ default: withCtx(() => [
552
+ createVNode(_sfc_main$5, normalizeProps(guardReactiveProps(resolvedProps.value)), {
553
+ default: withCtx(({ invoice, payments, isLoading, invoiceDownloadService }) => [
554
+ invoice ? (openBlock(), createBlock(_sfc_main$1, {
555
+ key: 0,
556
+ "is-loading": isLoading,
557
+ invoice,
558
+ "invoice-download-service": invoiceDownloadService,
559
+ payments: payments.payments.value,
560
+ configuration: __props.configuration
561
+ }, null, 8, ["is-loading", "invoice", "invoice-download-service", "payments", "configuration"])) : createCommentVNode("", true)
562
+ ]),
563
+ _: 1
564
+ }, 16)
565
+ ]),
566
+ _: 1
567
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
568
+ };
569
+ }
570
+ });
571
+ const SolvimonInvoice = defineCustomElement(_sfc_main);
572
+ const COMPONENT_NAME = getComponentName("invoice");
573
+ const defineSolvimonInvoice = () => {
574
+ if (!customElements.get(COMPONENT_NAME)) {
575
+ customElements.define(COMPONENT_NAME, SolvimonInvoice);
576
+ }
577
+ };
3
578
  export {
4
- C as COMPONENT_NAME,
5
- S as SolvimonInvoice,
6
- d as defineSolvimonInvoice
579
+ COMPONENT_NAME,
580
+ SolvimonInvoice,
581
+ defineSolvimonInvoice
7
582
  };
@@ -1,3 +1,3 @@
1
- export declare const SolvimonInvoiceDetails: import('vue').VueElementConstructor<unknown>;
1
+ export declare const SolvimonInvoiceDetails: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
2
  export declare const COMPONENT_NAME: string;
3
3
  export declare const defineSolvimonInvoiceDetails: () => void;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../InvoiceDetails.entry.ce-jHDyWra2.js");require("../../component-Df5eNqYX.js"),exports.COMPONENT_NAME=e.COMPONENT_NAME,exports.SolvimonInvoiceDetails=e.SolvimonInvoiceDetails,exports.defineSolvimonInvoiceDetails=e.defineSolvimonInvoiceDetails;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BE3I7Oe1.js"),t=require("../../Skeleton.vue_vue_type_script_setup_true_lang-C_BwMlBE.js"),n=require("../../useInvoiceData-DstXfI7t.js"),i=require("../../component-XHQYFLA_.js"),r=e.defineComponent({__name:"InvoiceDetails",props:{invoice:{type:Object},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(i,r)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"min-h-[100px]","data-testid":"invoice-details-skeleton"})):(e.openBlock(),e.createBlock(o._sfc_main,{key:1,invoice:n.invoice},null,8,["invoice"]))}),a=e.defineComponent({__name:"InvoiceDetails.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(o){const t=o,i=n.useInvoiceData(t.configuration.invoiceId);return(o,t)=>{var n;return e.renderSlot(o.$slots,"default",{invoice:null==(n=e.unref(i).data.value)?void 0:n.invoice,isLoading:e.unref(i).isPending.value})}}}),l=e.defineComponent({__name:"InvoiceDetails.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(o){var t;if(!(null==(t=o.configuration)?void 0:t.invoiceId))throw new Error("Missing invoice id");return(t,n)=>{var l,c,s,u;return e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{"custom-element-name":e.unref(p),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(l=o.branding)?void 0:l.colors)?void 0:c.primary,"secondary-color":null==(u=null==(s=o.branding)?void 0:s.colors)?void 0:u.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:n[0]||(n[0]=e=>t.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(({invoice:t,isLoading:n})=>[t?(e.openBlock(),e.createBlock(r,{key:0,"is-loading":n,invoice:t,configuration:o.configuration},null,8,["is-loading","invoice","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=i.defineCustomElement(l),p=i.getComponentName("invoice-details");exports.COMPONENT_NAME=p,exports.SolvimonInvoiceDetails=c,exports.defineSolvimonInvoiceDetails=()=>{customElements.get(p)||customElements.define(p,c)};