@solvimon/solvimon-web 0.1.0-alpha.1 → 0.1.0-alpha.2

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,584 @@
1
- import { C, S, d } from "../../BillingInformationForm.entry.ce-xfT0Jqps.mjs";
2
- import "../../component-BkmcE85U.mjs";
1
+ import { shallowRef, computed, defineComponent, ref, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode, Fragment, onMounted, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { G as useValidation, H as objectDiff, I as isOrganization, J as isIndividual, b as useIntl, _ as _sfc_main$2$1, K as _sfc_main$2a, L as _sfc_main$1$, M as _sfc_main$20, D as _sfc_main$16, m as _sfc_main$2H, N as getApiError, p as _sfc_main$4, q as defineCustomElement, o as getComponentName } from "../../component-DEo_ndpK.mjs";
3
+ import { e as email, r as required } from "../../index-CzL1ZcGi.mjs";
4
+ import { c as cloneDeep } from "../../cloneDeep-sm9cY-u2.mjs";
5
+ import { u as useCustomer } from "../../useCustomer-DlcjY3fP.mjs";
6
+ const useForm = ({
7
+ initialState,
8
+ validationRules,
9
+ nullifyEmptyValues = false,
10
+ mode = "shallow"
11
+ }) => {
12
+ const initialFormState = shallowRef(cloneDeep(initialState));
13
+ const form = shallowRef(cloneDeep(initialState));
14
+ const validation = useValidation(validationRules ?? {}, form);
15
+ const changes = computed(
16
+ () => objectDiff({ from: initialFormState.value, to: form.value, mode, nullifyEmptyValues })
17
+ );
18
+ const hasChanges = computed(() => Object.entries(changes.value).length > 0);
19
+ const updateInitialState = (state) => {
20
+ form.value = cloneDeep(state);
21
+ initialFormState.value = cloneDeep(state);
22
+ };
23
+ const reset = () => {
24
+ form.value = cloneDeep(initialState);
25
+ validation.value.$reset();
26
+ };
27
+ return {
28
+ form,
29
+ validation,
30
+ changes,
31
+ hasChanges,
32
+ reset,
33
+ updateInitialState,
34
+ initialState: initialFormState
35
+ };
36
+ };
37
+ const DEFAULT_TAX_IDENTIFIER_TYPE = "GENERIC_TAX_ID";
38
+ const DEFAULT_FORM_STATE = {
39
+ type: "INDIVIDUAL",
40
+ email: "",
41
+ country: "",
42
+ addressLine1: "",
43
+ postalCode: "",
44
+ city: "",
45
+ state: ""
46
+ };
47
+ function useBillingInformationForm({
48
+ initialState = {},
49
+ onSubmit
50
+ }) {
51
+ const {
52
+ form,
53
+ validation,
54
+ changes,
55
+ hasChanges,
56
+ updateInitialState: updateFormInitialState,
57
+ initialState: currentInitialState
58
+ } = useForm({
59
+ initialState: {
60
+ ...DEFAULT_FORM_STATE,
61
+ ...initialState
62
+ },
63
+ validationRules: {
64
+ email: { required, email }
65
+ },
66
+ nullifyEmptyValues: true,
67
+ mode: "deep"
68
+ });
69
+ const updateInitialState = (customer) => {
70
+ updateFormInitialState(mapCustomerToFormState(customer));
71
+ };
72
+ const submit = (customerId, data = form.value) => {
73
+ return onSubmit({
74
+ customerId,
75
+ payload: mapFormStateToCustomerPayload(data)
76
+ });
77
+ };
78
+ return {
79
+ form,
80
+ isOrganization,
81
+ validation,
82
+ changes,
83
+ hasChanges,
84
+ updateInitialState,
85
+ submit,
86
+ initialState: currentInitialState
87
+ };
88
+ }
89
+ const mapCustomerToFormState = (customer) => {
90
+ var _a, _b, _c, _d;
91
+ if (isIndividual(customer)) {
92
+ const address2 = customer.individual.residential_address;
93
+ return {
94
+ type: "INDIVIDUAL",
95
+ email: customer.email ?? "",
96
+ country: (address2 == null ? void 0 : address2.country) ?? "",
97
+ addressLine1: (address2 == null ? void 0 : address2.line1) ?? "",
98
+ addressLine2: (address2 == null ? void 0 : address2.line2) ?? "",
99
+ postalCode: (address2 == null ? void 0 : address2.postal_code) ?? "",
100
+ city: (address2 == null ? void 0 : address2.city) ?? "",
101
+ state: (address2 == null ? void 0 : address2.state) ?? "",
102
+ firstName: ((_a = customer.individual.name) == null ? void 0 : _a.first_name) ?? "",
103
+ lastName: ((_b = customer.individual.name) == null ? void 0 : _b.last_name) ?? ""
104
+ };
105
+ }
106
+ const address = customer.organization.registered_address;
107
+ return {
108
+ type: "ORGANIZATION",
109
+ email: customer.email ?? "",
110
+ country: (address == null ? void 0 : address.country) ?? "",
111
+ addressLine1: (address == null ? void 0 : address.line1) ?? "",
112
+ addressLine2: (address == null ? void 0 : address.line2) ?? "",
113
+ postalCode: (address == null ? void 0 : address.postal_code) ?? "",
114
+ city: (address == null ? void 0 : address.city) ?? "",
115
+ state: (address == null ? void 0 : address.state) ?? "",
116
+ companyLegalName: customer.organization.legal_name ?? "",
117
+ companyVatNumber: ((_d = (_c = customer.organization.tax_ids) == null ? void 0 : _c[0]) == null ? void 0 : _d.id) ?? ""
118
+ };
119
+ };
120
+ const mapFormStateToCustomerPayload = (data) => data.type === "ORGANIZATION" ? {
121
+ type: "ORGANIZATION",
122
+ email: data.email,
123
+ organization: {
124
+ legal_name: data.companyLegalName ?? "",
125
+ tax_ids: data.companyVatNumber ? [
126
+ {
127
+ id: data.companyVatNumber,
128
+ type: DEFAULT_TAX_IDENTIFIER_TYPE
129
+ }
130
+ ] : void 0,
131
+ registered_address: {
132
+ line1: data.addressLine1,
133
+ line2: data.addressLine2 ?? "",
134
+ postal_code: data.postalCode,
135
+ city: data.city,
136
+ country: data.country,
137
+ state: data.state ?? ""
138
+ }
139
+ }
140
+ } : {
141
+ type: "INDIVIDUAL",
142
+ email: data.email,
143
+ individual: {
144
+ name: {
145
+ first_name: data.firstName ?? "",
146
+ last_name: data.lastName ?? ""
147
+ },
148
+ residential_address: {
149
+ line1: data.addressLine1,
150
+ line2: data.addressLine2 ?? "",
151
+ postal_code: data.postalCode,
152
+ city: data.city,
153
+ country: data.country,
154
+ state: data.state ?? ""
155
+ }
156
+ }
157
+ };
158
+ const _hoisted_1 = { class: "grid grid-cols-1 gap-4" };
159
+ const _hoisted_2 = { class: "flex grow flex-col" };
160
+ const _hoisted_3 = { class: "mt-6 flex items-center justify-between gap-4" };
161
+ const _hoisted_4 = { class: "flex flex-col gap-2" };
162
+ const _hoisted_5 = {
163
+ key: 0,
164
+ class: "grid grid-cols-2 gap-2"
165
+ };
166
+ const _hoisted_6 = { class: "grid grid-cols-3 gap-2" };
167
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
168
+ __name: "BillingInformationForm",
169
+ props: {
170
+ customer: { type: Object },
171
+ isLoading: { type: Boolean },
172
+ apiError: { type: null },
173
+ updateCustomer: { type: Function }
174
+ },
175
+ setup(__props) {
176
+ const props = __props;
177
+ const { $t } = useIntl();
178
+ const { validation, form, updateInitialState, submit, hasChanges } = useBillingInformationForm({
179
+ onSubmit: ({ customerId, payload }) => props.updateCustomer({ customerId, payload })
180
+ });
181
+ const hasHydratedFromCustomer = ref(false);
182
+ const isCompanyPurchase = computed(() => form.value.type === "ORGANIZATION");
183
+ const showCompanyPurchaseToggle = computed(() => !hasHydratedFromCustomer.value);
184
+ const companyPurchaseModel = computed({
185
+ get: () => isCompanyPurchase.value,
186
+ set: (value) => form.value.type = value ? "ORGANIZATION" : "INDIVIDUAL"
187
+ });
188
+ const handleSubmit = async () => {
189
+ var _a;
190
+ await validation.value.$validate();
191
+ const isValid = !validation.value.$invalid;
192
+ if (!isValid) return;
193
+ if (!((_a = props.customer) == null ? void 0 : _a.id)) return;
194
+ await submit(props.customer.id);
195
+ };
196
+ watch(
197
+ () => props.customer,
198
+ (customer) => {
199
+ if (!customer || hasHydratedFromCustomer.value) {
200
+ return;
201
+ }
202
+ updateInitialState(customer);
203
+ hasHydratedFromCustomer.value = true;
204
+ },
205
+ { immediate: true }
206
+ );
207
+ return (_ctx, _cache) => {
208
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
209
+ return openBlock(), createElementBlock("form", {
210
+ onSubmit: withModifiers(handleSubmit, ["prevent"])
211
+ }, [
212
+ createVNode(unref(_sfc_main$2$1), {
213
+ variant: "heading-3",
214
+ tag: "h2"
215
+ }, {
216
+ default: withCtx(() => [
217
+ createTextVNode(toDisplayString(unref($t)({
218
+ defaultMessage: "Customer information",
219
+ id: "checkout.contact_information_block.title",
220
+ description: "The title of the contact information block in the checkout form"
221
+ })), 1)
222
+ ]),
223
+ _: 1
224
+ }),
225
+ createElementVNode("div", _hoisted_1, [
226
+ createVNode(unref(_sfc_main$2a), {
227
+ modelValue: unref(form).email,
228
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(form).email = $event),
229
+ required: "",
230
+ type: "email",
231
+ label: unref($t)({
232
+ defaultMessage: "Email address",
233
+ id: "checkout.email_address.label",
234
+ description: "The email address of the customer in the checkout form"
235
+ }),
236
+ placeholder: unref($t)({
237
+ defaultMessage: "Email address...",
238
+ id: "checkout.email_address.placeholder",
239
+ description: "The email address of the customer in the checkout form"
240
+ }),
241
+ error: ((_a = unref(validation).value.email) == null ? void 0 : _a.$errors) || ((_b = __props.apiError) == null ? void 0 : _b.email)
242
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
243
+ createVNode(unref(_sfc_main$1$), {
244
+ "single-model-value": unref(form).country,
245
+ "onUpdate:singleModelValue": _cache[1] || (_cache[1] = ($event) => unref(form).country = $event),
246
+ label: unref($t)({
247
+ defaultMessage: "Country",
248
+ id: "checkout.country.label",
249
+ description: "The country of the customer in the checkout form"
250
+ }),
251
+ error: (_c = __props.apiError) == null ? void 0 : _c.country
252
+ }, null, 8, ["single-model-value", "label", "error"]),
253
+ showCompanyPurchaseToggle.value ? (openBlock(), createBlock(unref(_sfc_main$20), {
254
+ key: 0,
255
+ modelValue: companyPurchaseModel.value,
256
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => companyPurchaseModel.value = $event),
257
+ "label-position": "before"
258
+ }, {
259
+ "inline-label": withCtx(() => [
260
+ createElementVNode("div", _hoisted_2, [
261
+ createVNode(unref(_sfc_main$2$1), { tag: "span" }, {
262
+ default: withCtx(() => [
263
+ createTextVNode(toDisplayString(unref($t)({
264
+ defaultMessage: "Company purchase",
265
+ id: "checkout.company_purchase_toggle.title",
266
+ description: "The title of the company purchase toggle in the checkout"
267
+ })), 1)
268
+ ]),
269
+ _: 1
270
+ }),
271
+ createVNode(unref(_sfc_main$2$1), {
272
+ tag: "span",
273
+ variant: "body-xs",
274
+ shade: "lighter"
275
+ }, {
276
+ default: withCtx(() => [
277
+ createTextVNode(toDisplayString(unref($t)({
278
+ defaultMessage: "I am purchasing on behalf of a company",
279
+ id: "checkout.company_purchase_toggle.sub_title",
280
+ description: "The subtitle of the company purchase toggle in the checkout"
281
+ })), 1)
282
+ ]),
283
+ _: 1
284
+ })
285
+ ])
286
+ ]),
287
+ _: 1
288
+ }, 8, ["modelValue"])) : createCommentVNode("", true),
289
+ isCompanyPurchase.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
290
+ createVNode(unref(_sfc_main$2a), {
291
+ modelValue: unref(form).companyVatNumber,
292
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(form).companyVatNumber = $event),
293
+ name: "vat_number",
294
+ label: unref($t)({
295
+ defaultMessage: "VAT number",
296
+ id: "checkout.vat_number.label",
297
+ description: "The label for the vat number in the checkout form"
298
+ }),
299
+ placeholder: unref($t)({
300
+ defaultMessage: "VAT number...",
301
+ id: "checkout.vat_number.placeholder",
302
+ description: "The label for the vat number in the checkout form"
303
+ }),
304
+ error: (_d = __props.apiError) == null ? void 0 : _d.vat_number
305
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
306
+ createVNode(unref(_sfc_main$2a), {
307
+ modelValue: unref(form).companyLegalName,
308
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(form).companyLegalName = $event),
309
+ required: "",
310
+ name: "legal_name",
311
+ label: unref($t)({
312
+ defaultMessage: "Legal entity name",
313
+ id: "checkout.legal_name.label",
314
+ description: "The legal name of the organization customer in the checkout form"
315
+ }),
316
+ placeholder: unref($t)({
317
+ defaultMessage: "Legal entity name...",
318
+ id: "checkout.legal_name.placeholder",
319
+ description: "The legal name of the organization customer in the checkout form"
320
+ }),
321
+ error: (_e = __props.apiError) == null ? void 0 : _e.legal_name
322
+ }, null, 8, ["modelValue", "label", "placeholder", "error"])
323
+ ], 64)) : createCommentVNode("", true)
324
+ ]),
325
+ createElementVNode("div", _hoisted_3, [
326
+ createVNode(unref(_sfc_main$2$1), {
327
+ variant: "heading-3",
328
+ tag: "h2"
329
+ }, {
330
+ default: withCtx(() => [
331
+ createTextVNode(toDisplayString(unref($t)({
332
+ defaultMessage: "Billing details",
333
+ id: "checkout.billing_information_block.title",
334
+ description: "The title of the billing information block in the checkout form"
335
+ })), 1)
336
+ ]),
337
+ _: 1
338
+ })
339
+ ]),
340
+ createElementVNode("div", _hoisted_4, [
341
+ !isCompanyPurchase.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
342
+ createVNode(unref(_sfc_main$2a), {
343
+ modelValue: unref(form).firstName,
344
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(form).firstName = $event),
345
+ name: "first_name",
346
+ label: unref($t)({
347
+ defaultMessage: "First name",
348
+ id: "checkout.first_name.label",
349
+ description: "The first name of the customer in the checkout form"
350
+ }),
351
+ placeholder: unref($t)({
352
+ defaultMessage: "First name...",
353
+ id: "checkout.first_name.placeholder",
354
+ description: "The first name of the customer in the checkout form"
355
+ }),
356
+ error: (_f = __props.apiError) == null ? void 0 : _f.first_name
357
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
358
+ createVNode(unref(_sfc_main$2a), {
359
+ modelValue: unref(form).lastName,
360
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => unref(form).lastName = $event),
361
+ name: "last_name",
362
+ label: unref($t)({
363
+ defaultMessage: "Last name",
364
+ id: "checkout.last_name.label",
365
+ description: "The last name of the customer in the checkout form"
366
+ }),
367
+ placeholder: unref($t)({
368
+ defaultMessage: "Last name...",
369
+ id: "checkout.last_name.placeholder",
370
+ description: "The last name of the customer in the checkout form"
371
+ }),
372
+ error: (_g = __props.apiError) == null ? void 0 : _g.last_name
373
+ }, null, 8, ["modelValue", "label", "placeholder", "error"])
374
+ ])) : createCommentVNode("", true),
375
+ createVNode(unref(_sfc_main$2a), {
376
+ modelValue: unref(form).addressLine1,
377
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(form).addressLine1 = $event),
378
+ name: "address_line_1",
379
+ label: unref($t)({
380
+ defaultMessage: "Billing address",
381
+ id: "checkout.address.title",
382
+ description: "Address line 1 of the customer address in the checkout form"
383
+ }),
384
+ placeholder: unref($t)({
385
+ defaultMessage: "Address line 1...",
386
+ id: "checkout.address.line1.placeholder",
387
+ description: "Address line 1 of the customer address in the checkout form"
388
+ }),
389
+ error: (_h = __props.apiError) == null ? void 0 : _h.address_line_1
390
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
391
+ createVNode(unref(_sfc_main$2a), {
392
+ modelValue: unref(form).addressLine2,
393
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => unref(form).addressLine2 = $event),
394
+ name: "address_line_2",
395
+ placeholder: unref($t)({
396
+ defaultMessage: "Address line 2...",
397
+ id: "checkout.address.line2.placeholder",
398
+ description: "Address line 2 of the customer address in the checkout form"
399
+ }),
400
+ error: (_i = __props.apiError) == null ? void 0 : _i.address_line_2
401
+ }, null, 8, ["modelValue", "placeholder", "error"]),
402
+ createElementVNode("div", _hoisted_6, [
403
+ createVNode(unref(_sfc_main$2a), {
404
+ modelValue: unref(form).postalCode,
405
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => unref(form).postalCode = $event),
406
+ name: "postal_code",
407
+ placeholder: unref($t)({
408
+ defaultMessage: "Postal code...",
409
+ id: "checkout.address.portal_code.placeholder",
410
+ description: "Postal code of the customer address in the checkout form"
411
+ }),
412
+ error: (_j = __props.apiError) == null ? void 0 : _j.postal_code
413
+ }, null, 8, ["modelValue", "placeholder", "error"]),
414
+ createVNode(unref(_sfc_main$2a), {
415
+ modelValue: unref(form).city,
416
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => unref(form).city = $event),
417
+ name: "city",
418
+ placeholder: unref($t)({
419
+ defaultMessage: "City...",
420
+ id: "checkout.address.city.placeholder",
421
+ description: "City of the customer address in the checkout form"
422
+ }),
423
+ error: (_k = __props.apiError) == null ? void 0 : _k.city
424
+ }, null, 8, ["modelValue", "placeholder", "error"]),
425
+ createVNode(unref(_sfc_main$2a), {
426
+ modelValue: unref(form).state,
427
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => unref(form).state = $event),
428
+ name: "state",
429
+ placeholder: unref($t)({
430
+ defaultMessage: "State...",
431
+ id: "checkout.address.state.placeholder",
432
+ description: "State of the customer address in the checkout form"
433
+ }),
434
+ error: (_l = __props.apiError) == null ? void 0 : _l.state
435
+ }, null, 8, ["modelValue", "placeholder", "error"])
436
+ ])
437
+ ]),
438
+ ((_m = __props.apiError) == null ? void 0 : _m._generic) ? (openBlock(), createBlock(unref(_sfc_main$16), {
439
+ key: 0,
440
+ class: "mt-4",
441
+ title: __props.apiError._generic
442
+ }, null, 8, ["title"])) : createCommentVNode("", true),
443
+ createVNode(unref(_sfc_main$2H), {
444
+ type: "submit",
445
+ color: "primary",
446
+ disabled: !unref(hasChanges),
447
+ loading: __props.isLoading,
448
+ class: "mt-4"
449
+ }, {
450
+ default: withCtx(() => [
451
+ createTextVNode(toDisplayString(unref($t)({
452
+ defaultMessage: "Save changes",
453
+ id: "billing_information_form.submit_button.label",
454
+ description: "The label for the submit button of the billing information form"
455
+ })), 1)
456
+ ]),
457
+ _: 1
458
+ }, 8, ["disabled", "loading"])
459
+ ], 32);
460
+ };
461
+ }
462
+ });
463
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
464
+ __name: "BillingInformationForm",
465
+ props: {
466
+ customer: { type: Object },
467
+ apiError: { type: null },
468
+ updateCustomer: { type: Function },
469
+ isLoading: { type: Boolean }
470
+ },
471
+ setup(__props) {
472
+ return (_ctx, _cache) => {
473
+ return openBlock(), createBlock(_sfc_main$3, {
474
+ customer: __props.customer,
475
+ "update-customer": __props.updateCustomer,
476
+ "is-loading": __props.isLoading,
477
+ "api-error": __props.apiError
478
+ }, null, 8, ["customer", "update-customer", "is-loading", "api-error"]);
479
+ };
480
+ }
481
+ });
482
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
483
+ __name: "BillingInformationForm.entry.view",
484
+ props: {
485
+ environment: { type: String },
486
+ locale: { type: String },
487
+ dateLocale: { type: String },
488
+ messages: { type: Object },
489
+ showTimezones: { type: Boolean },
490
+ primaryColor: { type: String },
491
+ secondaryColor: { type: String },
492
+ isShadowRoot: { type: Boolean },
493
+ experimentalFeatures: { type: Array },
494
+ logLevel: { type: String },
495
+ onLog: { type: Function },
496
+ allowedPortalTypes: { type: Array },
497
+ portalObject: { type: Object },
498
+ customElementName: { type: String },
499
+ branding: { type: Object }
500
+ },
501
+ setup(__props) {
502
+ const props = __props;
503
+ const customerId = props.portalObject.customer_id;
504
+ const { customer, get, update } = useCustomer({ customerId });
505
+ onMounted(async () => {
506
+ await get.execute();
507
+ });
508
+ return (_ctx, _cache) => {
509
+ return renderSlot(_ctx.$slots, "default", {
510
+ customer: unref(customer),
511
+ isLoading: unref(get).isPending.value || unref(update).isPending.value,
512
+ updateCustomer: unref(update),
513
+ apiError: unref(getApiError)(unref(update).error)
514
+ });
515
+ };
516
+ }
517
+ });
518
+ const _sfc_main = /* @__PURE__ */ defineComponent({
519
+ __name: "BillingInformationForm.entry",
520
+ props: {
521
+ environment: { type: String },
522
+ locale: { type: String },
523
+ dateLocale: { type: String },
524
+ messages: { type: Object },
525
+ showTimezones: { type: Boolean },
526
+ primaryColor: { type: String },
527
+ secondaryColor: { type: String },
528
+ isShadowRoot: { type: Boolean },
529
+ experimentalFeatures: { type: Array },
530
+ logLevel: { type: String },
531
+ onLog: { type: Function },
532
+ allowedPortalTypes: { type: Array },
533
+ portalObject: { type: Object },
534
+ customElementName: { type: String },
535
+ branding: { type: Object }
536
+ },
537
+ emits: ["error"],
538
+ setup(__props) {
539
+ return (_ctx, _cache) => {
540
+ var _a, _b, _c, _d;
541
+ return openBlock(), createBlock(unref(_sfc_main$4), {
542
+ "custom-element-name": unref(COMPONENT_NAME),
543
+ environment: __props.environment,
544
+ locale: __props.locale,
545
+ "portal-object": __props.portalObject,
546
+ "allowed-portal-types": ["CUSTOMER"],
547
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
548
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
549
+ "experimental-features": __props.experimentalFeatures,
550
+ "log-level": __props.logLevel,
551
+ "on-log": __props.onLog,
552
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
553
+ }, {
554
+ default: withCtx(() => [
555
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
556
+ default: withCtx(({ customer, updateCustomer, isLoading, apiError }) => [
557
+ customer ? (openBlock(), createBlock(_sfc_main$2, {
558
+ key: 0,
559
+ customer,
560
+ "is-loading": isLoading,
561
+ "update-customer": ({ payload }) => updateCustomer.execute(payload),
562
+ "api-error": apiError
563
+ }, null, 8, ["customer", "is-loading", "update-customer", "api-error"])) : createCommentVNode("", true)
564
+ ]),
565
+ _: 1
566
+ }, 16)
567
+ ]),
568
+ _: 1
569
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
570
+ };
571
+ }
572
+ });
573
+ const SolvimonBillingInformationForm = defineCustomElement(_sfc_main);
574
+ const COMPONENT_NAME = getComponentName("billing-information-form");
575
+ const defineSolvimonBillingInformationForm = () => {
576
+ if (!customElements.get(COMPONENT_NAME)) {
577
+ customElements.define(COMPONENT_NAME, SolvimonBillingInformationForm);
578
+ }
579
+ };
3
580
  export {
4
- C as COMPONENT_NAME,
5
- S as SolvimonBillingInformationForm,
6
- d as defineSolvimonBillingInformationForm
581
+ COMPONENT_NAME,
582
+ SolvimonBillingInformationForm,
583
+ defineSolvimonBillingInformationForm
7
584
  };
@@ -1,3 +1,3 @@
1
- export declare const SolvimonCustomerPaymentMethods: import('vue').VueElementConstructor<unknown>;
1
+ export declare const SolvimonCustomerPaymentMethods: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
2
  export declare const COMPONENT_NAME: string;
3
3
  export declare const defineSolvimonCustomerPaymentMethods: () => void;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../CustomerPaymentMethods.entry.ce-DnjlRHPA.js");require("../../component-Df5eNqYX.js"),exports.COMPONENT_NAME=e.COMPONENT_NAME,exports.SolvimonCustomerPaymentMethods=e.SolvimonCustomerPaymentMethods,exports.defineSolvimonCustomerPaymentMethods=e.defineSolvimonCustomerPaymentMethods;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../useCustomerPaymentMethodOptions-C-8BLzqb.js"),t=require("../../component-XHQYFLA_.js"),n=require("../../useLoadInitialData-BRg7IWqW.js"),r=require("../../usePaymentMethods-DCGVRXA4.js"),a=e.defineComponent({__name:"CustomerPaymentMethods.entry.view",props:{portalObject:{type:Object},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},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(a){var l;const i=a,m=i.portalObject.customer_id,p=r.usePaymentMethods({customerId:m,pageSize:(null==(l=i.configuration)?void 0:l.maxItems)||3}),c=o.useCustomerPaymentMethodOptions({customerId:m}),{isLoading:u}=n.useLoadInitialData(p.fetchInitial(),c.fetch());return(o,n)=>{var r,l,i,m;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(s),environment:a.environment,locale:a.locale,"portal-object":a.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(r=a.branding)?void 0:r.colors)?void 0:l.primary,"secondary-color":null==(m=null==(i=a.branding)?void 0:i.colors)?void 0:m.secondary,"experimental-features":a.experimentalFeatures,"log-level":a.logLevel,"on-log":a.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{paymentMethods:e.unref(p).items.value,paymentMethodsOptions:e.unref(c).items.value,isLoading:e.unref(u)})]),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),l=e.defineComponent({__name:"CustomerPaymentMethods.entry",props:{portalObject:{type:Object},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},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:n=>(r,l)=>{var i,m,p,c;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(s),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(m=null==(i=n.branding)?void 0:i.colors)?void 0:m.primary,"secondary-color":null==(c=null==(p=n.branding)?void 0:p.colors)?void 0:c.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:l[0]||(l[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(r.$props)),{default:e.withCtx(({paymentMethods:t,paymentMethodsOptions:r,isLoading:a})=>[e.createVNode(o._sfc_main,{configuration:n.configuration,"payment-methods":t,"payment-methods-options":r,"is-loading":a},null,8,["configuration","payment-methods","payment-methods-options","is-loading"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),i=t.defineCustomElement(l),s=t.getComponentName("customer-payment-methods");exports.COMPONENT_NAME=s,exports.SolvimonCustomerPaymentMethods=i,exports.defineSolvimonCustomerPaymentMethods=()=>{customElements.get(s)||customElements.define(s,i)};