@wisemen/wise-crm-web 0.1.2-beta.0 → 0.1.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 (31) hide show
  1. package/dist/{BusinessDetailSidebarProvider-CKT-MWzI.js → BusinessDetailSidebarProvider-B1qF3leV.js} +642 -567
  2. package/dist/{BusinessDetailView-Xjkq0gYI.js → BusinessDetailView-CSVCQCnn.js} +4 -4
  3. package/dist/{CrmDetailHeaderCard--ulW7CCz.js → CrmDetailHeaderCard-CD61YObi.js} +23 -11
  4. package/dist/{CrmDetailView-CZGjj8uf.js → CrmDetailView-U68c8FtU.js} +1 -1
  5. package/dist/{DealDetailView-ZItYEZ3_.js → DealDetailView-Cp_lb8gF.js} +3 -3
  6. package/dist/{DealSendMailDialog-XLd_jRsi.js → DealSendMailDialog-CJ80f8Dl.js} +548 -542
  7. package/dist/{Error-DEa9pg3N.js → Error-DIPflT5m.js} +5 -1
  8. package/dist/IndividualDetailSidebarProvider-BhD4t_q7.js +612 -0
  9. package/dist/{IndividualDetailView-DeXOrNc7.js → IndividualDetailView-CdVJykQm.js} +4 -4
  10. package/dist/api/mutations/business/businessBillingInformationUpsert.mutation.d.ts +1 -0
  11. package/dist/api/mutations/business/businessCreate.mutation.d.ts +1 -0
  12. package/dist/api/mutations/business/businessUpdate.mutation.d.ts +1 -0
  13. package/dist/api/mutations/individual/individualBillingInformationUpdate.mutation.d.ts +1 -0
  14. package/dist/api/mutations/individual/individualUpdate.mutation.d.ts +1 -0
  15. package/dist/composables/geocode/geocode.composable.d.ts +9 -0
  16. package/dist/index.js +103 -45
  17. package/dist/models/address/addressCreateForm.model.d.ts +1 -0
  18. package/dist/models/business/billing-information/update/businessBillingInformationForm.model.d.ts +1 -0
  19. package/dist/models/business/create/businessCreateForm.model.d.ts +2 -0
  20. package/dist/models/business/update/businessUpdateForm.model.d.ts +2 -0
  21. package/dist/models/global-search/globalSearchItem.model.d.ts +1 -0
  22. package/dist/models/individual/billing-information/update/individualBillingInformationForm.model.d.ts +1 -0
  23. package/dist/models/individual/create/individualCreateForm.model.d.ts +2 -0
  24. package/dist/models/individual/update/individualUpdateForm.model.d.ts +2 -0
  25. package/dist/testing/factories/individual.factory.d.ts +2 -1
  26. package/dist/testing.js +14 -0
  27. package/dist/utils/belgianSsn.util.d.ts +30 -0
  28. package/dist/widgets/WidgetBusinessStatistics.vue.d.ts +5 -1
  29. package/dist/widgets/WidgetIndividualStatistics.vue.d.ts +5 -1
  30. package/package.json +2 -1
  31. package/dist/IndividualDetailSidebarProvider-CZ53pmhG.js +0 -613
@@ -1,5 +1,5 @@
1
- import { A as useSearch, B as AppForm_default, E as useCrmConfig, F as useOffsetInfiniteQuery, H as AppConfirmDialog_default, I as NoteUpdateDialog_default, L as AppDialogHeader_default, M as AppSidebarFormSubmitButton_default, N as AppSidebarFormFooter_default, O as AppColorProvider_default, P as AppAndOrSeparator_default, Q as NoteService, R as CrmDetailSidebarNotesView_default, T as useEntityDetail, U as AppDialogContainer_default, V as i18nPlugin, W as AppDialogActions_default, X as useKeysetInfiniteQuery, Z as useNoteDeleteMutation, a as AppOpenEntityButton_default, at as ActivityIndexPaginationTransformer, b as AppGlobalFormError_default, c as CrmDetailAccordionRoot_default, g as IndividualAutocomplete_default, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, it as AddressTransformer, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, nt as ContactPersonUpdateTransformer, o as CrmDetailSidebarCard_default, ot as ActivityIndexTransformer, q as useApiErrorToast, r as CrmDetailSidebarTabs_default, rt as StringUtil, s as CrmDetailSidebarAccordionItem_default, st as individualUuidSchema, t as Error_default, tt as AppGrid_default, v as IndividualService, w as useCrm, x as EntityAutocomplete_default, z as toFormField } from "./Error-DEa9pg3N.js";
2
- import { a as contactPersonUpdateFormSchema, c as AddressUtil, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard--ulW7CCz.js";
1
+ import { A as useSearch, B as AppForm_default, D as useGoogleMapsApiKey, E as useCrmConfig, F as useOffsetInfiniteQuery, H as AppConfirmDialog_default, I as NoteUpdateDialog_default, L as AppDialogHeader_default, M as AppSidebarFormSubmitButton_default, N as AppSidebarFormFooter_default, O as AppColorProvider_default, P as AppAndOrSeparator_default, Q as NoteService, R as CrmDetailSidebarNotesView_default, T as useEntityDetail, U as AppDialogContainer_default, V as i18nPlugin, W as AppDialogActions_default, X as useKeysetInfiniteQuery, Z as useNoteDeleteMutation, a as AppOpenEntityButton_default, at as ActivityIndexPaginationTransformer, b as AppGlobalFormError_default, c as CrmDetailAccordionRoot_default, g as IndividualAutocomplete_default, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, it as AddressTransformer, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, nt as ContactPersonUpdateTransformer, o as CrmDetailSidebarCard_default, ot as ActivityIndexTransformer, q as useApiErrorToast, r as CrmDetailSidebarTabs_default, rt as StringUtil, s as CrmDetailSidebarAccordionItem_default, st as individualUuidSchema, t as Error_default, tt as AppGrid_default, v as IndividualService, w as useCrm, x as EntityAutocomplete_default, z as toFormField } from "./Error-DIPflT5m.js";
2
+ import { a as contactPersonUpdateFormSchema, c as AddressUtil, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard-CD61YObi.js";
3
3
  import { c as Be, i as plainDateSchema, l as He, n as useDateTimeFormat, s as ZonedDateTimeTransformer, t as AppSkeletonLoader_default, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
4
4
  import { E as updateBusinessV1, F as viewBusinessActivityLogIndexV1, I as viewBusinessBillingInformationDetailV1, L as viewBusinessContactPersonDetailV1, N as upsertBusinessBillingInformationV1, R as viewBusinessDetailV1, S as unlinkContactPersonFromBusinessV1, T as updateBusinessContactPersonV1, V as viewBusinessStatisticsV1, d as linkContactPersonToBusinessV1, ft as CountryCode, g as makeBusinessContactPersonPrimaryV1, ht as EntityType, n as createBusinessV1, u as linkBusinessAsChildV1, y as searchCbeEnterprisesV1, z as viewBusinessIndexV1 } from "./client-C1e--fRv.js";
5
5
  import z$1, { z } from "zod";
@@ -211,106 +211,106 @@ var BusinessBillingInformationTransformer = class {
211
211
  };
212
212
  }
213
213
  }, BusinessService = class {
214
- static async addChildBusiness(e, k) {
214
+ static async addChildBusiness(e, O) {
215
215
  await linkBusinessAsChildV1({ path: {
216
216
  businessUuid: e,
217
- childUuid: k
217
+ childUuid: O
218
218
  } });
219
219
  }
220
220
  static async create(e) {
221
221
  return (await createBusinessV1({ body: BusinessCreateTransformer.toDto(e) })).data.uuid;
222
222
  }
223
223
  static async findByName(e) {
224
- let k = await viewBusinessIndexV1({ query: new PaginationParamsBuilder().withSearch(e).build() });
224
+ let O = await viewBusinessIndexV1({ query: new PaginationParamsBuilder().withSearch(e).build() });
225
225
  return {
226
- data: k.data.items.map(BusinessIndexTransformer.fromDto),
227
- meta: k.data.meta
226
+ data: O.data.items.map(BusinessIndexTransformer.fromDto),
227
+ meta: O.data.meta
228
228
  };
229
229
  }
230
- static async getActivity(e, k) {
231
- let A = await viewBusinessActivityLogIndexV1({
232
- query: new PaginationParamsBuilder(k).buildKeyset(ActivityIndexPaginationTransformer.toDto),
230
+ static async getActivity(e, O) {
231
+ let k = await viewBusinessActivityLogIndexV1({
232
+ query: new PaginationParamsBuilder(O).buildKeyset(ActivityIndexPaginationTransformer.toDto),
233
233
  responseValidator: void 0,
234
234
  path: { businessUuid: e }
235
235
  });
236
236
  return {
237
- data: A.data.items.map(ActivityIndexTransformer.fromDto),
237
+ data: k.data.items.map(ActivityIndexTransformer.fromDto),
238
238
  meta: {
239
- next: A.data.meta.next,
240
- total: A.data.items.length
239
+ next: k.data.meta.next,
240
+ total: k.data.items.length
241
241
  }
242
242
  };
243
243
  }
244
244
  static async getAll(e) {
245
- let k = await viewBusinessIndexV1({ query: businessIndexQueryParamsTransformer.toDto(e) });
245
+ let O = await viewBusinessIndexV1({ query: businessIndexQueryParamsTransformer.toDto(e) });
246
246
  return {
247
- data: k.data.items.map(BusinessIndexTransformer.fromDto),
248
- meta: k.data.meta
247
+ data: O.data.items.map(BusinessIndexTransformer.fromDto),
248
+ meta: O.data.meta
249
249
  };
250
250
  }
251
251
  static async getBillingInformation(e) {
252
- let k = await viewBusinessBillingInformationDetailV1({ path: { businessUuid: e } });
253
- return BusinessBillingInformationTransformer.fromDto(k.data);
252
+ let O = await viewBusinessBillingInformationDetailV1({ path: { businessUuid: e } });
253
+ return BusinessBillingInformationTransformer.fromDto(O.data);
254
254
  }
255
255
  static async getByUuid(e) {
256
- let k = await viewBusinessDetailV1({ path: { businessUuid: e } });
257
- return BusinessDetailTransformer.fromDto(k.data);
256
+ let O = await viewBusinessDetailV1({ path: { businessUuid: e } });
257
+ return BusinessDetailTransformer.fromDto(O.data);
258
258
  }
259
- static async getContactPerson(e, k) {
260
- let A = await viewBusinessContactPersonDetailV1({ path: {
259
+ static async getContactPerson(e, O) {
260
+ let k = await viewBusinessContactPersonDetailV1({ path: {
261
261
  businessUuid: e,
262
- contactPersonUuid: k
262
+ contactPersonUuid: O
263
263
  } });
264
- return BusinessContactPersonTransformer.fromDto(A.data);
264
+ return BusinessContactPersonTransformer.fromDto(k.data);
265
265
  }
266
266
  static async getStatistics() {
267
267
  let e = await viewBusinessStatisticsV1();
268
268
  return BusinessStatisticsTransformer.fromDto(e.data);
269
269
  }
270
- static async linkContactPerson(e, k, A, j) {
270
+ static async linkContactPerson(e, O, k, A) {
271
271
  await linkContactPersonToBusinessV1({
272
272
  body: {
273
- contactPersonUuid: k,
274
- email: StringUtil.trimOrNull(j.email),
275
- mobilePhone: j.mobilePhone,
276
- phone: j.phone,
277
- position: A
273
+ contactPersonUuid: O,
274
+ email: StringUtil.trimOrNull(A.email),
275
+ mobilePhone: A.mobilePhone,
276
+ phone: A.phone,
277
+ position: k
278
278
  },
279
279
  responseValidator: void 0,
280
280
  path: { businessUuid: e }
281
281
  });
282
282
  }
283
- static async setPrimaryContactPersonForBusiness(e, k) {
283
+ static async setPrimaryContactPersonForBusiness(e, O) {
284
284
  await makeBusinessContactPersonPrimaryV1({ path: {
285
285
  businessUuid: e,
286
- contactPersonUuid: k
286
+ contactPersonUuid: O
287
287
  } });
288
288
  }
289
- static async unlinkContactPerson(e, k) {
289
+ static async unlinkContactPerson(e, O) {
290
290
  await unlinkContactPersonFromBusinessV1({
291
- body: { contactPersonUuid: k },
291
+ body: { contactPersonUuid: O },
292
292
  responseValidator: void 0,
293
293
  path: { businessUuid: e }
294
294
  });
295
295
  }
296
- static async update(e, k) {
296
+ static async update(e, O) {
297
297
  await updateBusinessV1({
298
- body: BusinessUpdateTransformer.toDto(k),
298
+ body: BusinessUpdateTransformer.toDto(O),
299
299
  path: { businessUuid: e }
300
300
  });
301
301
  }
302
- static async updateContactPerson(e, k, A) {
302
+ static async updateContactPerson(e, O, k) {
303
303
  await updateBusinessContactPersonV1({
304
- body: ContactPersonUpdateTransformer.toDto(A),
304
+ body: ContactPersonUpdateTransformer.toDto(k),
305
305
  path: {
306
306
  businessUuid: e,
307
- contactPersonUuid: k
307
+ contactPersonUuid: O
308
308
  }
309
309
  });
310
310
  }
311
- static async upsertBillingInformation(e, k) {
311
+ static async upsertBillingInformation(e, O) {
312
312
  await upsertBusinessBillingInformationV1({
313
- body: BusinessBillingInformationUpdateTransformer.toDto(k),
313
+ body: BusinessBillingInformationUpdateTransformer.toDto(O),
314
314
  path: { businessUuid: e }
315
315
  });
316
316
  }
@@ -322,72 +322,72 @@ function useBusinessDetailQuery(e) {
322
322
  queryKey: { wiseCrmBusinessDetail: { businessUuid: e } }
323
323
  });
324
324
  }
325
- function useBusinessActivityIndexQuery(e, k) {
325
+ function useBusinessActivityIndexQuery(e, O) {
326
326
  return Be({
327
- paginationOptions: k,
328
- queryFn: async (k) => await BusinessService.getActivity(e.value, k),
329
- queryKey: { businessActivityIndex: { paginationOptions: k } }
327
+ paginationOptions: O,
328
+ queryFn: async (O) => await BusinessService.getActivity(e.value, O),
329
+ queryKey: { businessActivityIndex: { paginationOptions: O } }
330
330
  });
331
331
  }
332
332
  var BusinessDetailSidebarActivityContent_default = /* @__PURE__ */ defineComponent({
333
333
  __name: "BusinessDetailSidebarActivityContent",
334
334
  props: { business: {} },
335
335
  setup(e) {
336
- let k = e, A = usePagination({
336
+ let O = e, k = usePagination({
337
337
  isRouteQueryEnabled: !1,
338
338
  type: "keyset"
339
- }), j = useBusinessActivityIndexQuery(computed(() => k.business.uuid), A.paginationOptions), M = computed(() => j.data.value.data ?? []);
340
- async function N() {
341
- await j.getNextPage();
339
+ }), A = useBusinessActivityIndexQuery(computed(() => O.business.uuid), k.paginationOptions), j = computed(() => A.data.value.data ?? []);
340
+ async function M() {
341
+ await A.getNextPage();
342
342
  }
343
- return (e, k) => (openBlock(), createBlock(ActivityList_default, {
344
- "on-next": N,
345
- "is-loading": unref(j).isLoading.value,
346
- activities: M.value
343
+ return (e, O) => (openBlock(), createBlock(ActivityList_default, {
344
+ "on-next": M,
345
+ "is-loading": unref(A).isLoading.value,
346
+ activities: j.value
347
347
  }, null, 8, ["is-loading", "activities"]));
348
348
  }
349
349
  });
350
350
  function useNoteBusinessCreateMutation() {
351
351
  return ze({
352
- queryFn: async ({ body: e, params: k }) => await NoteService.create(e, { businessUuid: k.businessUuid }),
352
+ queryFn: async ({ body: e, params: O }) => await NoteService.create(e, { businessUuid: O.businessUuid }),
353
353
  queryKeysToInvalidate: { noteBusinessIndex: {} }
354
354
  });
355
355
  }
356
- function useNoteBusinessIndexQuery(e, k) {
356
+ function useNoteBusinessIndexQuery(e, O) {
357
357
  return useKeysetInfiniteQuery({
358
- queryFn: (k) => NoteService.getBusinessNotes({ pagination: k }, e.value),
359
- queryKey: { noteBusinessIndex: { params: k?.params } }
358
+ queryFn: (O) => NoteService.getBusinessNotes({ pagination: O }, e.value),
359
+ queryKey: { noteBusinessIndex: { params: O?.params } }
360
360
  });
361
361
  }
362
362
  var BusinessDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent({
363
363
  __name: "BusinessDetailSidebarNotesContent",
364
364
  props: { business: {} },
365
365
  setup(e) {
366
- let k = e, A = useDialog(NoteUpdateDialog_default), j = useApiErrorToast(), M = useNoteBusinessCreateMutation(), P = useNoteDeleteMutation(), F = useNoteBusinessIndexQuery(computed(() => k.business.uuid)), I = computed(() => F.data?.value?.data ?? []);
367
- async function L(e) {
368
- await M.execute({
366
+ let O = e, k = useDialog(NoteUpdateDialog_default), A = useApiErrorToast(), j = useNoteBusinessCreateMutation(), M = useNoteDeleteMutation(), P = useNoteBusinessIndexQuery(computed(() => O.business.uuid)), F = computed(() => P.data?.value?.data ?? []);
367
+ async function I(e) {
368
+ await j.execute({
369
369
  body: e,
370
- params: { businessUuid: k.business.uuid }
370
+ params: { businessUuid: O.business.uuid }
371
371
  });
372
372
  }
373
- async function R(e) {
373
+ async function L(e) {
374
374
  try {
375
- await P.execute({ params: { noteUuid: e } });
375
+ await M.execute({ params: { noteUuid: e } });
376
376
  } catch (e) {
377
- j.show(e);
377
+ A.show(e);
378
378
  }
379
379
  }
380
- function B(e) {
381
- A.open({ note: e });
380
+ function R(e) {
381
+ k.open({ note: e });
382
382
  }
383
- return (e, k) => (openBlock(), createBlock(CrmDetailSidebarNotesView_default, {
384
- "is-loading": unref(F).isLoading.value,
385
- notes: I.value,
386
- "on-submit": L,
387
- "has-next-page": unref(F).hasNextPage.value,
388
- onNext: k[0] ||= (e) => unref(F).fetchNextPage(),
389
- onDelete: R,
390
- onUpdate: B
383
+ return (e, O) => (openBlock(), createBlock(CrmDetailSidebarNotesView_default, {
384
+ "is-loading": unref(P).isLoading.value,
385
+ notes: F.value,
386
+ "on-submit": I,
387
+ "has-next-page": unref(P).hasNextPage.value,
388
+ onNext: O[0] ||= (e) => unref(P).fetchNextPage(),
389
+ onDelete: L,
390
+ onUpdate: R
391
391
  }, null, 8, [
392
392
  "is-loading",
393
393
  "notes",
@@ -396,40 +396,40 @@ var BusinessDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent(
396
396
  }
397
397
  });
398
398
  function useBusinessPrimaryContactPersonUpdateMutation() {
399
- let e = useQueryClient(), k = "wiseCrmBusinessDetail", A = useMutation({
399
+ let e = useQueryClient(), O = "wiseCrmBusinessDetail", k = useMutation({
400
400
  mutationFn: async (e) => {
401
401
  await BusinessService.setPrimaryContactPersonForBusiness(e.businessUuid, e.contactPersonUuid);
402
402
  },
403
- onError: (A, j, M) => {
404
- e.setQueryData([k, { businessUuid: j.businessUuid }], M?.previousData);
403
+ onError: (k, A, j) => {
404
+ e.setQueryData([O, { businessUuid: A.businessUuid }], j?.previousData);
405
405
  },
406
- onMutate: async (A) => {
407
- await e.cancelQueries({ queryKey: [k] });
408
- let j = e.getQueryData([k, { businessUuid: A.businessUuid }]);
409
- return j === void 0 ? {} : (e.setQueryData([k, { businessUuid: A.businessUuid }], {
410
- ...j,
411
- contactPersons: j.contactPersons.map((e) => e.uuid === A.contactPersonUuid ? {
406
+ onMutate: async (k) => {
407
+ await e.cancelQueries({ queryKey: [O] });
408
+ let A = e.getQueryData([O, { businessUuid: k.businessUuid }]);
409
+ return A === void 0 ? {} : (e.setQueryData([O, { businessUuid: k.businessUuid }], {
410
+ ...A,
411
+ contactPersons: A.contactPersons.map((e) => e.uuid === k.contactPersonUuid ? {
412
412
  ...e,
413
413
  isPrimary: !e.isPrimary
414
414
  } : {
415
415
  ...e,
416
416
  isPrimary: !1
417
417
  })
418
- }), { previousData: j });
418
+ }), { previousData: A });
419
419
  },
420
- onSettled: (A, j, M) => {
421
- e.invalidateQueries({ queryKey: [k, { businessUuid: M.businessUuid }] });
420
+ onSettled: (k, A, j) => {
421
+ e.invalidateQueries({ queryKey: [O, { businessUuid: j.businessUuid }] });
422
422
  }
423
423
  });
424
424
  return {
425
- isLoading: computed(() => A.isPending.value),
426
- data: computed(() => A.data.value),
427
- execute: async (e) => await A.mutateAsync(e.params)
425
+ isLoading: computed(() => k.isPending.value),
426
+ data: computed(() => k.data.value),
427
+ execute: async (e) => await k.mutateAsync(e.params)
428
428
  };
429
429
  }
430
430
  function useBusinessUnlinkContactPersonMutation() {
431
431
  return ze({
432
- queryFn: async ({ body: e, params: k }) => await BusinessService.unlinkContactPerson(k.businessUuid, e.contactPersonUuid),
432
+ queryFn: async ({ body: e, params: O }) => await BusinessService.unlinkContactPerson(O.businessUuid, e.contactPersonUuid),
433
433
  queryKeysToInvalidate: {
434
434
  businessIndex: {},
435
435
  wiseCrmBusinessDetail: { businessUuid: (e) => e.businessUuid }
@@ -451,11 +451,11 @@ function useBusinessCreateMutation() {
451
451
  queryKeysToInvalidate: { businessIndex: {} }
452
452
  });
453
453
  }
454
- function useBusinessIndexQuery(e, k) {
454
+ function useBusinessIndexQuery(e, O) {
455
455
  return useOffsetInfiniteQuery({
456
- isEnabled: computed(() => k?.value ?? !0),
457
- queryFn: (k) => BusinessService.getAll({
458
- pagination: k,
456
+ isEnabled: computed(() => O?.value ?? !0),
457
+ queryFn: (O) => BusinessService.getAll({
458
+ pagination: O,
459
459
  search: e?.params?.search?.value
460
460
  }),
461
461
  queryKey: { businessIndex: { queryParams: e?.params } }
@@ -468,36 +468,36 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
468
468
  onSubmit: { type: Function }
469
469
  },
470
470
  emits: ["createNew"],
471
- setup(A, { emit: j }) {
472
- let M = A, N = j, P = useI18n(), L = useSearch({ persistInUrl: !1 }), B = useBusinessIndexQuery({ params: { search: L.debouncedSearch } }), V = useForm({
471
+ setup(k, { emit: A }) {
472
+ let j = k, M = A, N = useI18n(), P = useSearch({ persistInUrl: !1 }), L = useBusinessIndexQuery({ params: { search: P.debouncedSearch } }), B = useForm({
473
473
  initialState: { business: null },
474
474
  schema: z.object({ business: z.object({
475
475
  uuid: businessUuidSchema,
476
476
  name: z.string()
477
477
  }) }),
478
478
  onSubmit: async (e) => {
479
- await M.onSubmit(e.business.uuid);
479
+ await j.onSubmit(e.business.uuid);
480
480
  }
481
- }), H = V.register("business"), U = computed(() => (B.data.value?.data.filter((e) => e.uuid !== M.parentBusinessUuid) ?? []).map((e) => ({
481
+ }), V = B.register("business"), H = computed(() => (L.data.value?.data.filter((e) => e.uuid !== j.parentBusinessUuid) ?? []).map((e) => ({
482
482
  uuid: e.uuid,
483
483
  name: e.name
484
484
  })));
485
- function W(e) {
486
- L.updateSearch(e);
485
+ function U(e) {
486
+ P.updateSearch(e);
487
487
  }
488
- function G() {
489
- N("createNew");
488
+ function W() {
489
+ M("createNew");
490
490
  }
491
- return (e, A) => (openBlock(), createBlock(AppForm_default, { form: unref(V) }, {
491
+ return (e, k) => (openBlock(), createBlock(AppForm_default, { form: unref(B) }, {
492
492
  default: withCtx(() => [createVNode(AppGrid_default, { cols: 1 }, {
493
493
  default: withCtx(() => [
494
- createVNode(unref(VcAutocomplete), mergeProps(unref(toFormField)(unref(H)), {
495
- items: U.value,
494
+ createVNode(unref(VcAutocomplete), mergeProps(unref(toFormField)(unref(V)), {
495
+ items: H.value,
496
496
  "display-fn": (e) => e.name,
497
- "is-loading": unref(B).isFetching.value,
498
- label: unref(P).t("wise_crm.info_dialog.search_an_existing_one"),
497
+ "is-loading": unref(L).isFetching.value,
498
+ label: unref(N).t("wise_crm.info_dialog.search_an_existing_one"),
499
499
  "icon-left": "search",
500
- onSearch: W
500
+ onSearch: U
501
501
  }), null, 16, [
502
502
  "items",
503
503
  "display-fn",
@@ -505,22 +505,22 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
505
505
  "label"
506
506
  ]),
507
507
  createVNode(AppAndOrSeparator_default, null, {
508
- default: withCtx(() => [createTextVNode(toDisplayString(unref(P).t("wise_crm.shared.or")), 1)]),
508
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.shared.or")), 1)]),
509
509
  _: 1
510
510
  }),
511
511
  createVNode(unref(VcButton), {
512
512
  class: "w-full",
513
513
  size: "lg",
514
514
  variant: "secondary",
515
- onClick: G
515
+ onClick: W
516
516
  }, {
517
- default: withCtx(() => [createTextVNode(toDisplayString(unref(P).t("wise_crm.info_dialog.add_business_child_dialog.create_a_new_one")), 1)]),
517
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.info_dialog.add_business_child_dialog.create_a_new_one")), 1)]),
518
518
  _: 1
519
519
  }),
520
520
  createVNode(AppSidebarFormFooter_default, null, {
521
521
  default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
522
- "is-loading": unref(V).isSubmitting.value,
523
- label: unref(P).t("wise_crm.shared.add")
522
+ "is-loading": unref(B).isSubmitting.value,
523
+ label: unref(N).t("wise_crm.shared.add")
524
524
  }, null, 8, ["is-loading", "label"])]),
525
525
  _: 1
526
526
  })
@@ -530,7 +530,73 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
530
530
  _: 1
531
531
  }, 8, ["form"]));
532
532
  }
533
- }), CbeEnterpriseSearchTransformer = class {
533
+ });
534
+ function setScriptSrc(e, O) {
535
+ e.src = O;
536
+ }
537
+ var bootstrap = (e) => {
538
+ var O, k, A, j = "The Google Maps JavaScript API", M = "google", N = "importLibrary", P = "__ib__", F = document, I = window, L = I[M] || (I[M] = {}), R = L.maps ||= {}, B = /* @__PURE__ */ new Set(), V = new URLSearchParams(), H = () => O ||= new Promise(async (N, I) => {
539
+ for (A in await (k = F.createElement("script")), V.set("libraries", [...B] + ""), e) V.set(A.replace(/[A-Z]/g, (e) => "_" + e[0].toLowerCase()), e[A]);
540
+ V.set("callback", M + ".maps." + P), setScriptSrc(k, "https://maps.googleapis.com/maps/api/js?" + V), R[P] = N, k.onerror = () => O = I(Error(j + " could not load.")), k.nonce = F.querySelector("script[nonce]")?.nonce || "", F.head.append(k);
541
+ });
542
+ R[N] ? console.warn(j + " only loads once. Ignoring:", e) : R[N] = (e, ...O) => B.add(e) && H().then(() => R[N](e, ...O));
543
+ }, MSG_REPEATED_SET_OPTIONS = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, MSG_IMPORT_LIBRARY_EXISTS = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, MSG_SET_OPTIONS_NOT_CALLED = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", MSG_SCRIPT_ELEMENT_EXISTS = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", __DEV__$1 = process.env.NODE_ENV !== "production", logDevWarning = __DEV__$1 ? (e) => {
544
+ console.warn(`[@googlemaps/js-api-loader] ${e}`);
545
+ } : () => {}, logDevNotice = __DEV__$1 ? (e) => {
546
+ console.info(`[@googlemaps/js-api-loader] ${e}`);
547
+ } : () => {}, __DEV__ = process.env.NODE_ENV !== "production", setOptionsWasCalled_ = !1;
548
+ function setOptions(e) {
549
+ if (setOptionsWasCalled_) {
550
+ logDevWarning(MSG_REPEATED_SET_OPTIONS(e));
551
+ return;
552
+ }
553
+ installImportLibrary_(e), setOptionsWasCalled_ = !0;
554
+ }
555
+ async function importLibrary(e) {
556
+ if (setOptionsWasCalled_ || logDevWarning(MSG_SET_OPTIONS_NOT_CALLED), !window?.google?.maps?.importLibrary) throw Error("google.maps.importLibrary is not installed.");
557
+ return await google.maps.importLibrary(e);
558
+ }
559
+ function installImportLibrary_(e) {
560
+ let O = !!window.google?.maps?.importLibrary;
561
+ O ? logDevNotice(MSG_IMPORT_LIBRARY_EXISTS(e)) : __DEV__ && document.querySelector("script[src*=\"maps.googleapis.com/maps/api/js\"]") && logDevWarning(MSG_SCRIPT_ELEMENT_EXISTS), O || bootstrap(e);
562
+ }
563
+ function useGeocode() {
564
+ let { getGoogleMapsApiKey: e } = useGoogleMapsApiKey();
565
+ async function O(O) {
566
+ let k = e();
567
+ if (k === null) return null;
568
+ let A = [
569
+ O.street,
570
+ O.streetNumber,
571
+ O.postalCode,
572
+ O.city,
573
+ O.country
574
+ ].filter(Boolean).join(", ");
575
+ if (A === "") return null;
576
+ try {
577
+ setOptions({
578
+ key: k,
579
+ libraries: ["places"]
580
+ });
581
+ let { Place: e } = await importLibrary("places"), O = {
582
+ fields: ["location"],
583
+ textQuery: A
584
+ }, { places: j } = await e.searchByText(O);
585
+ if (j.length > 0 && j[0].location !== null) {
586
+ let e = j[0].location;
587
+ return {
588
+ lat: e.lat(),
589
+ lng: e.lng()
590
+ };
591
+ }
592
+ return null;
593
+ } catch {
594
+ return null;
595
+ }
596
+ }
597
+ return { geocodeAddress: O };
598
+ }
599
+ var CbeEnterpriseSearchTransformer = class {
534
600
  static fromDto(e) {
535
601
  return {
536
602
  uuid: e.enterpriseNumber,
@@ -547,7 +613,7 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
547
613
  }
548
614
  }, CbeService = class {
549
615
  static async searchEnterprisesByTerm(e) {
550
- let k = await searchCbeEnterprisesV1({ query: {
616
+ let O = await searchCbeEnterprisesV1({ query: {
551
617
  pagination: {
552
618
  limit: 10,
553
619
  offset: 0
@@ -555,8 +621,8 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
555
621
  search: e
556
622
  } });
557
623
  return {
558
- data: k.data.items.map(CbeEnterpriseSearchTransformer.fromDto),
559
- meta: k.data.meta
624
+ data: O.data.items.map(CbeEnterpriseSearchTransformer.fromDto),
625
+ meta: O.data.meta
560
626
  };
561
627
  }
562
628
  };
@@ -580,39 +646,39 @@ var _hoisted_1$4 = { class: "text-sm" }, _hoisted_2$3 = {
580
646
  modelModifiers: {}
581
647
  }),
582
648
  emits: /* @__PURE__ */ mergeModels(["createNew"], ["update:modelValue"]),
583
- setup(e, { emit: k }) {
584
- let A = e, j = k, M = useModel(e, "modelValue"), N = ref(null), P = ref(null), F = useI18n(), I = ref(!0), L = useCbeEnterpriseSearchByTermQuery(computed(() => P.value ?? "")), R = useDebounceFn((e) => {
585
- e !== null && (I.value = e.length === 0 || e.trim().length === 0, P.value = e);
586
- }, 300), B = computed(() => L.data.value ?? []);
587
- async function V(e) {
588
- await R(e);
649
+ setup(e, { emit: O }) {
650
+ let k = e, A = O, j = useModel(e, "modelValue"), M = ref(null), N = ref(null), P = useI18n(), F = ref(!0), I = useCbeEnterpriseSearchByTermQuery(computed(() => N.value ?? "")), L = useDebounceFn((e) => {
651
+ e !== null && (F.value = e.length === 0 || e.trim().length === 0, N.value = e);
652
+ }, 300), R = computed(() => I.data.value ?? []);
653
+ async function B(e) {
654
+ await L(e);
589
655
  }
590
- function H() {
591
- j("createNew");
656
+ function V() {
657
+ A("createNew");
592
658
  }
593
- function U(e) {
594
- return B.value.find((k) => k.uuid === e)?.name ?? "-";
659
+ function H(e) {
660
+ return R.value.find((O) => O.uuid === e)?.name ?? "-";
595
661
  }
596
- function W(e) {
662
+ function U(e) {
597
663
  if (e === null) {
598
- N.value = null;
664
+ M.value = null;
599
665
  return;
600
666
  }
601
- M.value = B.value.find((k) => k.uuid === e.value) ?? null, N.value = e;
667
+ j.value = R.value.find((O) => O.uuid === e.value) ?? null, M.value = e;
602
668
  }
603
- return (e, k) => (openBlock(), createBlock(EntityAutocomplete_default, {
604
- modelValue: N.value,
605
- "onUpdate:modelValue": [k[0] ||= (e) => N.value = e, W],
606
- "is-required": A.isRequired,
607
- "display-fn": U,
608
- label: A.label,
609
- options: B.value,
610
- "is-loading": unref(L).isFetching.value,
611
- placeholder: unref(F).t("component.select.search_placeholder"),
612
- onCreateNew: H,
613
- onSearch: V
669
+ return (e, O) => (openBlock(), createBlock(EntityAutocomplete_default, {
670
+ modelValue: M.value,
671
+ "onUpdate:modelValue": [O[0] ||= (e) => M.value = e, U],
672
+ "is-required": k.isRequired,
673
+ "display-fn": H,
674
+ label: k.label,
675
+ options: R.value,
676
+ "is-loading": unref(I).isFetching.value,
677
+ placeholder: unref(P).t("component.select.search_placeholder"),
678
+ onCreateNew: V,
679
+ onSearch: B
614
680
  }, {
615
- option: withCtx(({ option: e, isHighlighted: k }) => [createElementVNode("div", { class: normalizeClass([{ "bg-brand-50": k }, "p-md px-lg flex flex-col rounded-md"]) }, [createElementVNode("span", _hoisted_1$4, toDisplayString(e.name), 1), e.address ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref(AddressUtil).format(e.address)), 1)) : createCommentVNode("", !0)], 2)]),
681
+ option: withCtx(({ option: e, isHighlighted: O }) => [createElementVNode("div", { class: normalizeClass([{ "bg-brand-50": O }, "p-md px-lg flex flex-col rounded-md"]) }, [createElementVNode("span", _hoisted_1$4, toDisplayString(e.name), 1), e.address ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref(AddressUtil).format(e.address)), 1)) : createCommentVNode("", !0)], 2)]),
616
682
  _: 1
617
683
  }, 8, [
618
684
  "modelValue",
@@ -630,30 +696,30 @@ var _hoisted_1$4 = { class: "text-sm" }, _hoisted_2$3 = {
630
696
  "createNew",
631
697
  "updateCbeSearchItem"
632
698
  ],
633
- setup(e, { emit: k }) {
634
- let A = k, j = useI18n(), M = ref(null);
635
- function N() {
636
- A("createNew");
699
+ setup(e, { emit: O }) {
700
+ let k = O, A = useI18n(), j = ref(null);
701
+ function M() {
702
+ k("createNew");
637
703
  }
638
- function P(e) {
639
- M.value = e, A("updateCbeSearchItem", e);
704
+ function N(e) {
705
+ j.value = e, k("updateCbeSearchItem", e);
640
706
  }
641
- function F() {
642
- A("back");
707
+ function P() {
708
+ k("back");
643
709
  }
644
- return (e, k) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
710
+ return (e, O) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
645
711
  default: withCtx(() => [createVNode(CbeAutocomplete_default, {
646
- modelValue: M.value,
647
- "onUpdate:modelValue": [k[0] ||= (e) => M.value = e, P],
648
- label: unref(j).t("wise_crm.contact.create_dialog.form.fields.cbe_search"),
649
- onCreateNew: N
712
+ modelValue: j.value,
713
+ "onUpdate:modelValue": [O[0] ||= (e) => j.value = e, N],
714
+ label: unref(A).t("wise_crm.contact.create_dialog.form.fields.cbe_search"),
715
+ onCreateNew: M
650
716
  }, null, 8, ["modelValue", "label"]), createVNode(AppDialogActions_default, null, {
651
717
  default: withCtx(() => [createVNode(unref(VcButton), {
652
718
  variant: "secondary",
653
719
  size: "lg",
654
- onClick: F
720
+ onClick: P
655
721
  }, {
656
- default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.back")), 1)]),
722
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(A).t("wise_crm.shared.back")), 1)]),
657
723
  _: 1
658
724
  })]),
659
725
  _: 1
@@ -672,15 +738,15 @@ function useProvideBaseFieldsetContext(e) {
672
738
  var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */ defineComponent({
673
739
  __name: "BaseFieldset",
674
740
  setup(e) {
675
- let k = useId();
676
- return useProvideBaseFieldsetContext({ id: k }), (e, A) => (openBlock(), createElementBlock("fieldset", { "aria-describedby": unref(k) }, [renderSlot(e.$slots, "default")], 8, _hoisted_1$3));
741
+ let O = useId();
742
+ return useProvideBaseFieldsetContext({ id: O }), (e, k) => (openBlock(), createElementBlock("fieldset", { "aria-describedby": unref(O) }, [renderSlot(e.$slots, "default")], 8, _hoisted_1$3));
677
743
  }
678
744
  }), BaseFieldsetLegend_default = /* @__PURE__ */ defineComponent({
679
745
  __name: "BaseFieldsetLegend",
680
746
  props: { as: {} },
681
747
  setup(e) {
682
- let k = e, A = useInjectBaseFieldsetContext();
683
- return (e, j) => (openBlock(), createBlock(resolveDynamicComponent(k.as), { id: unref(A).id }, {
748
+ let O = e, k = useInjectBaseFieldsetContext();
749
+ return (e, A) => (openBlock(), createBlock(resolveDynamicComponent(O.as), { id: unref(k).id }, {
684
750
  default: withCtx(() => [renderSlot(e.$slots, "default")]),
685
751
  _: 3
686
752
  }, 8, ["id"]));
@@ -699,18 +765,18 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
699
765
  description: { default: null }
700
766
  },
701
767
  setup(e) {
702
- let k = e;
703
- return (e, A) => (openBlock(), createBlock(BaseFieldset_default, null, {
704
- default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(), createBlock(resolveDynamicComponent(k.isTitleHidden ? unref(VisuallyHidden) : "div"), null, {
768
+ let O = e;
769
+ return (e, k) => (openBlock(), createBlock(BaseFieldset_default, null, {
770
+ default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(), createBlock(resolveDynamicComponent(O.isTitleHidden ? unref(VisuallyHidden) : "div"), null, {
705
771
  default: withCtx(() => [createVNode(BaseFieldsetLegend_default, {
706
772
  as: "h2",
707
773
  class: "text-primary text-sm font-medium"
708
774
  }, {
709
- default: withCtx(() => [createTextVNode(toDisplayString(k.title), 1)]),
775
+ default: withCtx(() => [createTextVNode(toDisplayString(O.title), 1)]),
710
776
  _: 1
711
777
  })]),
712
778
  _: 1
713
- })), k.description === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(k.description), 1))]), createElementVNode("div", _hoisted_3$2, [renderSlot(e.$slots, "default")])]),
779
+ })), O.description === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(O.description), 1))]), createElementVNode("div", _hoisted_3$2, [renderSlot(e.$slots, "default")])]),
714
780
  _: 3
715
781
  }));
716
782
  }
@@ -718,31 +784,31 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
718
784
  __name: "ContactCreateDialogBusinessContactPerson",
719
785
  props: { form: {} },
720
786
  emits: ["back"],
721
- setup(e, { emit: k }) {
722
- let A = e, j = k, M = useI18n(), N = A.form.register("individual.firstName"), P = A.form.register("individual.lastName"), F = A.form.register("individualPosition"), I = A.form.register("individual.email"), L = A.form.register("individual.mobilePhone"), R = A.form.register("individual.phone");
723
- function B() {
724
- j("back");
787
+ setup(e, { emit: O }) {
788
+ let k = e, A = O, j = useI18n(), M = k.form.register("individual.firstName"), N = k.form.register("individual.lastName"), P = k.form.register("individualPosition"), F = k.form.register("individual.email"), I = k.form.register("individual.mobilePhone"), L = k.form.register("individual.phone");
789
+ function R() {
790
+ A("back");
725
791
  }
726
- return (k, A) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
792
+ return (O, k) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
727
793
  default: withCtx(() => [createVNode(AppGrid_default, { cols: 1 }, {
728
794
  default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
729
795
  default: withCtx(() => [
730
796
  createVNode(unref(VcTextField), mergeProps({
731
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.first_name"),
732
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.first_name")
733
- }, unref(toFormField)(unref(N))), null, 16, ["label", "placeholder"]),
797
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.first_name"),
798
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.first_name")
799
+ }, unref(toFormField)(unref(M))), null, 16, ["label", "placeholder"]),
734
800
  createVNode(unref(VcTextField), mergeProps({
735
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.last_name"),
736
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.last_name")
737
- }, unref(toFormField)(unref(P))), null, 16, ["label", "placeholder"]),
801
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.last_name"),
802
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.last_name")
803
+ }, unref(toFormField)(unref(N))), null, 16, ["label", "placeholder"]),
738
804
  createVNode(unref(VcTextField), mergeProps({
739
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.position"),
740
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.position")
741
- }, unref(toFormField)(unref(F))), null, 16, ["label", "placeholder"])
805
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.position"),
806
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.position")
807
+ }, unref(toFormField)(unref(P))), null, 16, ["label", "placeholder"])
742
808
  ]),
743
809
  _: 1
744
810
  }), createVNode(FormFieldset_default, {
745
- title: unref(M).t("wise_crm.shared.contact_info"),
811
+ title: unref(j).t("wise_crm.shared.contact_info"),
746
812
  class: "col-span-2"
747
813
  }, {
748
814
  default: withCtx(() => [createVNode(AppGrid_default, {
@@ -750,17 +816,17 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
750
816
  class: "mt-sm bg-secondary p-lg rounded-xl"
751
817
  }, {
752
818
  default: withCtx(() => [
753
- createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(I)), {
754
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.email"),
755
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.email")
819
+ createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(F)), {
820
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.email"),
821
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.email")
756
822
  }), null, 16, ["label", "placeholder"]),
757
- createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(L)), {
758
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
759
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.mobile_phone")
823
+ createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(I)), {
824
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
825
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.mobile_phone")
760
826
  }), null, 16, ["label", "placeholder"]),
761
- createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(R)), {
762
- label: unref(M).t("wise_crm.contact.create_dialog.form.fields.phone"),
763
- placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.phone")
827
+ createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(L)), {
828
+ label: unref(j).t("wise_crm.contact.create_dialog.form.fields.phone"),
829
+ placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.phone")
764
830
  }), null, 16, ["label", "placeholder"])
765
831
  ]),
766
832
  _: 1
@@ -772,16 +838,16 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
772
838
  default: withCtx(() => [createVNode(unref(VcButton), {
773
839
  size: "lg",
774
840
  variant: "secondary",
775
- onClick: B
841
+ onClick: R
776
842
  }, {
777
- default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.back")), 1)]),
843
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.back")), 1)]),
778
844
  _: 1
779
845
  }), createVNode(unref(VcButton), {
780
846
  "is-loading": e.form.isSubmitting.value,
781
847
  size: "lg",
782
848
  type: "submit"
783
849
  }, {
784
- default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.create")), 1)]),
850
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.create")), 1)]),
785
851
  _: 1
786
852
  }, 8, ["is-loading"])]),
787
853
  _: 1
@@ -797,44 +863,44 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
797
863
  "createNew",
798
864
  "next"
799
865
  ],
800
- setup(e, { emit: k }) {
801
- let A = e, j = k, M = useI18n(), N = useApiErrorToast(), P = ref(null), F = A.form.register("individualUuid"), I = A.form.register("individual");
802
- async function L(e) {
803
- if (P.value = e, e !== null) {
804
- F.setValue(e ? e.value : null);
866
+ setup(e, { emit: O }) {
867
+ let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = ref(null), P = k.form.register("individualUuid"), F = k.form.register("individual");
868
+ async function I(e) {
869
+ if (N.value = e, e !== null) {
870
+ P.setValue(e ? e.value : null);
805
871
  try {
806
- let k = await IndividualService.getByUuid(e.value);
807
- I.setValue({
808
- email: k.email,
809
- firstName: k.firstName,
810
- lastName: k.lastName,
811
- mobilePhone: k.mobilePhone,
812
- phone: k.phone
813
- }), j("next");
872
+ let O = await IndividualService.getByUuid(e.value);
873
+ F.setValue({
874
+ email: O.email,
875
+ firstName: O.firstName,
876
+ lastName: O.lastName,
877
+ mobilePhone: O.mobilePhone,
878
+ phone: O.phone
879
+ }), A("next");
814
880
  } catch (e) {
815
- N.show(e);
881
+ M.show(e);
816
882
  }
817
883
  }
818
884
  }
819
- function R() {
820
- j("back");
885
+ function L() {
886
+ A("back");
821
887
  }
822
- function B() {
823
- F.setValue(null), I.setValue(null), j("next");
888
+ function R() {
889
+ P.setValue(null), F.setValue(null), A("next");
824
890
  }
825
- return (e, k) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
891
+ return (e, O) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
826
892
  default: withCtx(() => [createVNode(IndividualAutocomplete_default, {
827
- "model-value": P.value,
828
- label: unref(M).t("wise_crm.contact.create_dialog.form.contact_person"),
829
- "onUpdate:modelValue": L,
830
- onCreateNew: B
893
+ "model-value": N.value,
894
+ label: unref(j).t("wise_crm.contact.create_dialog.form.contact_person"),
895
+ "onUpdate:modelValue": I,
896
+ onCreateNew: R
831
897
  }, null, 8, ["model-value", "label"]), createVNode(AppDialogActions_default, null, {
832
898
  default: withCtx(() => [createVNode(unref(VcButton), {
833
899
  variant: "secondary",
834
900
  size: "lg",
835
- onClick: R
901
+ onClick: L
836
902
  }, {
837
- default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.back")), 1)]),
903
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.back")), 1)]),
838
904
  _: 1
839
905
  })]),
840
906
  _: 1
@@ -868,31 +934,31 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
868
934
  }),
869
935
  emits: ["update:modelValue"],
870
936
  setup(e) {
871
- let k = e, A = useModel(e, "modelValue"), j = computed({
872
- get: () => A.value ? `${A.value.countryCode}${A.value.number}` : null,
937
+ let O = e, k = useModel(e, "modelValue"), A = computed({
938
+ get: () => k.value ? `${k.value.countryCode}${k.value.number}` : null,
873
939
  set: (e) => {
874
940
  if (e === null) {
875
- A.value = null;
941
+ k.value = null;
876
942
  return;
877
943
  }
878
- A.value = {
944
+ k.value = {
879
945
  countryCode: e.slice(0, 2).toUpperCase(),
880
946
  number: e.slice(2)
881
947
  };
882
948
  }
883
949
  });
884
- function M(e) {
950
+ function j(e) {
885
951
  e.key.length === 1 && /[a-z0-9]/i.test(e.key) || e.key === "Backspace" || e.key === "Delete" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Tab" || e.preventDefault();
886
952
  }
887
- function N(e) {
888
- let k = (e.clipboardData?.getData("text"))?.replace(/[^a-z0-9]/gi, "");
889
- k && (j.value = k);
953
+ function M(e) {
954
+ let O = (e.clipboardData?.getData("text"))?.replace(/[^a-z0-9]/gi, "");
955
+ O && (A.value = O);
890
956
  }
891
- return (e, A) => (openBlock(), createBlock(unref(VcTextField), mergeProps(k, {
892
- modelValue: j.value,
893
- "onUpdate:modelValue": A[0] ||= (e) => j.value = e,
894
- onKeydown: M,
895
- onPaste: withModifiers(N, ["prevent"])
957
+ return (e, k) => (openBlock(), createBlock(unref(VcTextField), mergeProps(O, {
958
+ modelValue: A.value,
959
+ "onUpdate:modelValue": k[0] ||= (e) => A.value = e,
960
+ onKeydown: j,
961
+ onPaste: withModifiers(M, ["prevent"])
896
962
  }), null, 16, ["modelValue"]));
897
963
  }
898
964
  }), CustomFieldCheckbox_default = /* @__PURE__ */ defineComponent({
@@ -902,8 +968,8 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
902
968
  form: {}
903
969
  },
904
970
  setup(e) {
905
- let k = e, A = k.form.register(`customFields.${k.definition.key}`, k.definition.defaultValue);
906
- return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcCheckbox), mergeProps({ label: k.definition.displayName }, unref(toFormField)(unref(A))), null, 16, ["label"])]));
971
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`, O.definition.defaultValue);
972
+ return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcCheckbox), mergeProps({ label: O.definition.displayName }, unref(toFormField)(unref(k))), null, 16, ["label"])]));
907
973
  }
908
974
  }), CustomFieldDate_default = /* @__PURE__ */ defineComponent({
909
975
  __name: "CustomFieldDate",
@@ -912,12 +978,12 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
912
978
  form: {}
913
979
  },
914
980
  setup(e) {
915
- let k = e, A = k.form.register(`customFields.${k.definition.key}`);
916
- return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcDateField), mergeProps({
917
- "min-date": k.definition.minDate,
918
- "max-date": k.definition.maxDate,
919
- label: k.definition.displayName
920
- }, unref(toFormField)(unref(A))), null, 16, [
981
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`);
982
+ return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcDateField), mergeProps({
983
+ "min-date": O.definition.minDate,
984
+ "max-date": O.definition.maxDate,
985
+ label: O.definition.displayName
986
+ }, unref(toFormField)(unref(k))), null, 16, [
921
987
  "min-date",
922
988
  "max-date",
923
989
  "label"
@@ -930,16 +996,16 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
930
996
  form: {}
931
997
  },
932
998
  setup(e) {
933
- let k = e, A = k.form.register(`customFields.${k.definition.key}`, []);
934
- function j(e) {
935
- return k.definition.options.find((k) => k.key === e)?.value ?? e;
999
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`, []);
1000
+ function A(e) {
1001
+ return O.definition.options.find((O) => O.key === e)?.value ?? e;
936
1002
  }
937
- return (e, M) => (openBlock(), createBlock(unref(VcSelect), mergeProps(unref(toFormField)(unref(A)), {
938
- "display-fn": j,
939
- label: k.definition.displayName,
940
- placeholder: k.definition.displayName
1003
+ return (e, j) => (openBlock(), createBlock(unref(VcSelect), mergeProps(unref(toFormField)(unref(k)), {
1004
+ "display-fn": A,
1005
+ label: O.definition.displayName,
1006
+ placeholder: O.definition.displayName
941
1007
  }), {
942
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
1008
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
943
1009
  key: e.key,
944
1010
  value: e.key
945
1011
  }, {
@@ -956,14 +1022,14 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
956
1022
  form: {}
957
1023
  },
958
1024
  setup(e) {
959
- let k = e, A = k.form.register(`customFields.${k.definition.key}`);
960
- return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcNumberField), mergeProps({
961
- min: k.definition.minValue,
962
- max: k.definition.maxValue,
963
- label: k.definition.displayName,
964
- placeholder: k.definition.displayName,
1025
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`);
1026
+ return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcNumberField), mergeProps({
1027
+ min: O.definition.minValue,
1028
+ max: O.definition.maxValue,
1029
+ label: O.definition.displayName,
1030
+ placeholder: O.definition.displayName,
965
1031
  "hide-controls": !0
966
- }, unref(toFormField)(unref(A))), null, 16, [
1032
+ }, unref(toFormField)(unref(k))), null, 16, [
967
1033
  "min",
968
1034
  "max",
969
1035
  "label",
@@ -977,9 +1043,9 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
977
1043
  form: {}
978
1044
  },
979
1045
  setup(e) {
980
- let k = e, A = k.form.register(`customFields.${k.definition.key}`);
981
- return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcRadioGroup), mergeProps({ label: k.definition.displayName }, unref(toFormField)(unref(A))), {
982
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.definition.options, (e) => (openBlock(), createBlock(unref(VcRadioGroupItem), {
1046
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`);
1047
+ return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcRadioGroup), mergeProps({ label: O.definition.displayName }, unref(toFormField)(unref(k))), {
1048
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcRadioGroupItem), {
983
1049
  key: e.key,
984
1050
  label: e.value,
985
1051
  value: e.key
@@ -994,17 +1060,17 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
994
1060
  form: {}
995
1061
  },
996
1062
  setup(e) {
997
- let k = e, A = k.form.register(`customFields.${k.definition.key}`);
998
- function j(e) {
999
- let A = k.definition.options.find((k) => k.key === e);
1000
- return A ? A.value : e;
1063
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`);
1064
+ function A(e) {
1065
+ let k = O.definition.options.find((O) => O.key === e);
1066
+ return k ? k.value : e;
1001
1067
  }
1002
- return (e, M) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcSelect), mergeProps({
1003
- "display-fn": j,
1004
- label: k.definition.displayName,
1005
- placeholder: k.definition.displayName
1006
- }, unref(toFormField)(unref(A))), {
1007
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
1068
+ return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcSelect), mergeProps({
1069
+ "display-fn": A,
1070
+ label: O.definition.displayName,
1071
+ placeholder: O.definition.displayName
1072
+ }, unref(toFormField)(unref(k))), {
1073
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
1008
1074
  key: e.key,
1009
1075
  value: e.key
1010
1076
  }, {
@@ -1021,11 +1087,11 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
1021
1087
  form: {}
1022
1088
  },
1023
1089
  setup(e) {
1024
- let k = e, A = k.form.register(`customFields.${k.definition.key}`);
1025
- return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcTextField), mergeProps({
1026
- label: k.definition.displayName,
1027
- placeholder: k.definition.displayName
1028
- }, unref(toFormField)(unref(A))), null, 16, ["label", "placeholder"])]));
1090
+ let O = e, k = O.form.register(`customFields.${O.definition.key}`);
1091
+ return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcTextField), mergeProps({
1092
+ label: O.definition.displayName,
1093
+ placeholder: O.definition.displayName
1094
+ }, unref(toFormField)(unref(k))), null, 16, ["label", "placeholder"])]));
1029
1095
  }
1030
1096
  }), CustomFieldDefinitionForm_default = /* @__PURE__ */ defineComponent({
1031
1097
  __name: "CustomFieldDefinitionForm",
@@ -1034,77 +1100,77 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
1034
1100
  form: {}
1035
1101
  },
1036
1102
  setup(e) {
1037
- let k = e;
1038
- function A(e) {
1103
+ let O = e;
1104
+ function k(e) {
1039
1105
  return e === "full" ? "col-span-2" : "col-span-1";
1040
1106
  }
1041
- return (j, M) => (openBlock(), createBlock(AppGrid_default, { cols: 2 }, {
1042
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.customFieldDefinitions, (j) => (openBlock(), createElementBlock(Fragment, { key: j.uuid }, [
1043
- j.type === "string" ? (openBlock(), createBlock(CustomFieldString_default, {
1107
+ return (A, j) => (openBlock(), createBlock(AppGrid_default, { cols: 2 }, {
1108
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.customFieldDefinitions, (A) => (openBlock(), createElementBlock(Fragment, { key: A.uuid }, [
1109
+ A.type === "string" ? (openBlock(), createBlock(CustomFieldString_default, {
1044
1110
  key: 0,
1045
- class: normalizeClass(A(j.width)),
1111
+ class: normalizeClass(k(A.width)),
1046
1112
  form: e.form,
1047
- definition: j
1113
+ definition: A
1048
1114
  }, null, 8, [
1049
1115
  "class",
1050
1116
  "form",
1051
1117
  "definition"
1052
1118
  ])) : createCommentVNode("", !0),
1053
- j.type === "select" ? (openBlock(), createBlock(CustomFieldSelect_default, {
1119
+ A.type === "select" ? (openBlock(), createBlock(CustomFieldSelect_default, {
1054
1120
  key: 1,
1055
- class: normalizeClass(A(j.width)),
1121
+ class: normalizeClass(k(A.width)),
1056
1122
  form: e.form,
1057
- definition: j
1123
+ definition: A
1058
1124
  }, null, 8, [
1059
1125
  "class",
1060
1126
  "form",
1061
1127
  "definition"
1062
1128
  ])) : createCommentVNode("", !0),
1063
- j.type === "radio" ? (openBlock(), createBlock(CustomFieldRadio_default, {
1129
+ A.type === "radio" ? (openBlock(), createBlock(CustomFieldRadio_default, {
1064
1130
  key: 2,
1065
- class: normalizeClass(A(j.width)),
1131
+ class: normalizeClass(k(A.width)),
1066
1132
  form: e.form,
1067
- definition: j
1133
+ definition: A
1068
1134
  }, null, 8, [
1069
1135
  "class",
1070
1136
  "form",
1071
1137
  "definition"
1072
1138
  ])) : createCommentVNode("", !0),
1073
- j.type === "date" ? (openBlock(), createBlock(CustomFieldDate_default, {
1139
+ A.type === "date" ? (openBlock(), createBlock(CustomFieldDate_default, {
1074
1140
  key: 3,
1075
- class: normalizeClass(A(j.width)),
1141
+ class: normalizeClass(k(A.width)),
1076
1142
  form: e.form,
1077
- definition: j
1143
+ definition: A
1078
1144
  }, null, 8, [
1079
1145
  "class",
1080
1146
  "form",
1081
1147
  "definition"
1082
1148
  ])) : createCommentVNode("", !0),
1083
- j.type === "number" ? (openBlock(), createBlock(CustomFieldNumberField_default, {
1149
+ A.type === "number" ? (openBlock(), createBlock(CustomFieldNumberField_default, {
1084
1150
  key: 4,
1085
- definition: j,
1086
- class: normalizeClass(A(j.width)),
1087
- form: k.form
1151
+ definition: A,
1152
+ class: normalizeClass(k(A.width)),
1153
+ form: O.form
1088
1154
  }, null, 8, [
1089
1155
  "definition",
1090
1156
  "class",
1091
1157
  "form"
1092
1158
  ])) : createCommentVNode("", !0),
1093
- j.type === "checkbox" ? (openBlock(), createBlock(CustomFieldCheckbox_default, {
1159
+ A.type === "checkbox" ? (openBlock(), createBlock(CustomFieldCheckbox_default, {
1094
1160
  key: 5,
1095
- definition: j,
1096
- form: k.form,
1097
- class: normalizeClass(A(j.width))
1161
+ definition: A,
1162
+ form: O.form,
1163
+ class: normalizeClass(k(A.width))
1098
1164
  }, null, 8, [
1099
1165
  "definition",
1100
1166
  "form",
1101
1167
  "class"
1102
1168
  ])) : createCommentVNode("", !0),
1103
- j.type === "multiselect" ? (openBlock(), createBlock(CustomFieldMultiSelect_default, {
1169
+ A.type === "multiselect" ? (openBlock(), createBlock(CustomFieldMultiSelect_default, {
1104
1170
  key: 6,
1105
- form: k.form,
1106
- class: normalizeClass(A(j.width)),
1107
- definition: j
1171
+ form: O.form,
1172
+ class: normalizeClass(k(A.width)),
1173
+ definition: A
1108
1174
  }, null, 8, [
1109
1175
  "form",
1110
1176
  "class",
@@ -1121,52 +1187,52 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
1121
1187
  form: {}
1122
1188
  },
1123
1189
  emits: ["back", "next"],
1124
- setup(e, { emit: k }) {
1125
- let j = e, M = k, N = useI18n(), P = useCrmConfig(), F = computed(() => P.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)), I = j.form.register("name"), L = j.form.register("address"), R = j.form.register("companyNumber"), B = j.form.register("vatNumber");
1126
- function V() {
1127
- M("back");
1190
+ setup(e, { emit: O }) {
1191
+ let k = e, j = O, M = useI18n(), N = useCrmConfig(), P = computed(() => N.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)), F = k.form.register("name"), I = k.form.register("address"), L = k.form.register("companyNumber"), R = k.form.register("vatNumber");
1192
+ function B() {
1193
+ j("back");
1128
1194
  }
1129
- function H() {
1130
- j.form.blurAll(), I.isValid.value && L.isValid.value && B.isValid.value && R.isValid.value && M("next");
1195
+ function V() {
1196
+ k.form.blurAll(), F.isValid.value && I.isValid.value && R.isValid.value && L.isValid.value && j("next");
1131
1197
  }
1132
- return (k, A) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
1198
+ return (O, A) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
1133
1199
  default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
1134
1200
  default: withCtx(() => [
1135
1201
  createVNode(unref(VcTextField), mergeProps({
1136
- "is-disabled": j.isDataFromCbe,
1202
+ "is-disabled": k.isDataFromCbe,
1137
1203
  "is-required": !0
1138
- }, unref(toFormField)(unref(I)), {
1139
- label: unref(N).t("wise_crm.contact.create_dialog.form.name"),
1140
- placeholder: unref(N).t("wise_crm.contact.create_dialog.form.name")
1204
+ }, unref(toFormField)(unref(F)), {
1205
+ label: unref(M).t("wise_crm.contact.create_dialog.form.name"),
1206
+ placeholder: unref(M).t("wise_crm.contact.create_dialog.form.name")
1141
1207
  }), null, 16, [
1142
1208
  "is-disabled",
1143
1209
  "label",
1144
1210
  "placeholder"
1145
1211
  ]),
1146
- createVNode(AppVatNumberField_default, mergeProps({ "is-disabled": j.isDataFromCbe }, unref(toFormField)(unref(B)), {
1147
- label: unref(N).t("wise_crm.contact.create_dialog.form.vat_number"),
1148
- placeholder: unref(N).t("wise_crm.contact.create_dialog.form.vat_number")
1212
+ createVNode(AppVatNumberField_default, mergeProps({ "is-disabled": k.isDataFromCbe }, unref(toFormField)(unref(R)), {
1213
+ label: unref(M).t("wise_crm.contact.create_dialog.form.vat_number"),
1214
+ placeholder: unref(M).t("wise_crm.contact.create_dialog.form.vat_number")
1149
1215
  }), null, 16, [
1150
1216
  "is-disabled",
1151
1217
  "label",
1152
1218
  "placeholder"
1153
1219
  ]),
1154
1220
  createVNode(unref(VcAddressAutocomplete), mergeProps({
1155
- "is-disabled": j.isDataFromCbe,
1221
+ "is-disabled": k.isDataFromCbe,
1156
1222
  "is-required": !0,
1157
- label: unref(N).t("wise_crm.contact.create_dialog.form.fields.address"),
1158
- placeholder: unref(N).t("wise_crm.contact.create_dialog.form.fields.address")
1159
- }, unref(toFormField)(unref(L))), null, 16, [
1223
+ label: unref(M).t("wise_crm.contact.create_dialog.form.fields.address"),
1224
+ placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.address")
1225
+ }, unref(toFormField)(unref(I))), null, 16, [
1160
1226
  "is-disabled",
1161
1227
  "label",
1162
1228
  "placeholder"
1163
1229
  ]),
1164
1230
  createVNode(unref(VcTextField), mergeProps({
1165
- label: unref(N).t("wise_crm.contact.create_dialog.form.company_number"),
1166
- placeholder: unref(N).t("wise_crm.contact.create_dialog.form.company_number")
1167
- }, unref(toFormField)(unref(R))), null, 16, ["label", "placeholder"]),
1231
+ label: unref(M).t("wise_crm.contact.create_dialog.form.company_number"),
1232
+ placeholder: unref(M).t("wise_crm.contact.create_dialog.form.company_number")
1233
+ }, unref(toFormField)(unref(L))), null, 16, ["label", "placeholder"]),
1168
1234
  createVNode(CustomFieldDefinitionForm_default, {
1169
- "custom-field-definitions": F.value,
1235
+ "custom-field-definitions": P.value,
1170
1236
  form: e.form
1171
1237
  }, null, 8, ["custom-field-definitions", "form"])
1172
1238
  ]),
@@ -1175,15 +1241,15 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
1175
1241
  default: withCtx(() => [createVNode(unref(VcButton), {
1176
1242
  variant: "secondary",
1177
1243
  size: "lg",
1178
- onClick: V
1244
+ onClick: B
1179
1245
  }, {
1180
- default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.shared.back")), 1)]),
1246
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.back")), 1)]),
1181
1247
  _: 1
1182
1248
  }), createVNode(unref(VcButton), {
1183
1249
  size: "lg",
1184
- onClick: H
1250
+ onClick: V
1185
1251
  }, {
1186
- default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.shared.next")), 1)]),
1252
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.next")), 1)]),
1187
1253
  _: 1
1188
1254
  })]),
1189
1255
  _: 1
@@ -1193,6 +1259,7 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
1193
1259
  }
1194
1260
  });
1195
1261
  const addressFormSchema = z.object({
1262
+ placeId: z.string().nullable().optional(),
1196
1263
  bus: z.string(),
1197
1264
  city: z.string().min(1),
1198
1265
  coordinates: z.object({
@@ -1209,56 +1276,56 @@ const addressFormSchema = z.object({
1209
1276
  });
1210
1277
  var CustomFieldDefinitionUtil = class {
1211
1278
  static getZodType(e) {
1212
- return e.reduce((e, k) => {
1213
- switch (k.type) {
1279
+ return e.reduce((e, O) => {
1280
+ switch (O.type) {
1214
1281
  case "multiselect":
1215
- e[k.key] = z.string().array().default([]).superRefine((e, A) => {
1216
- k.minSelections !== void 0 && e.length < k.minSelections && A.addIssue({
1282
+ e[O.key] = z.string().array().default([]).superRefine((e, k) => {
1283
+ O.minSelections !== void 0 && e.length < O.minSelections && k.addIssue({
1217
1284
  code: z.ZodIssueCode.custom,
1218
- message: `At least ${k.minSelections} selections are required`
1219
- }), k.maxSelections !== void 0 && e.length > k.maxSelections && A.addIssue({
1285
+ message: `At least ${O.minSelections} selections are required`
1286
+ }), O.maxSelections !== void 0 && e.length > O.maxSelections && k.addIssue({
1220
1287
  code: z.ZodIssueCode.custom,
1221
- message: `At most ${k.maxSelections} selections are allowed`
1288
+ message: `At most ${O.maxSelections} selections are allowed`
1222
1289
  });
1223
1290
  });
1224
1291
  break;
1225
1292
  case "checkbox":
1226
- e[k.key] = z.boolean();
1293
+ e[O.key] = z.boolean();
1227
1294
  break;
1228
1295
  case "radio":
1229
- e[k.key] = z.string().nullable();
1296
+ e[O.key] = z.string().nullable();
1230
1297
  break;
1231
1298
  case "select":
1232
- e[k.key] = z.string().nullable().superRefine((e, k) => {
1233
- e === "" && k.addIssue({
1299
+ e[O.key] = z.string().nullable().superRefine((e, O) => {
1300
+ e === "" && O.addIssue({
1234
1301
  code: z.ZodIssueCode.custom,
1235
1302
  message: "Selection is required"
1236
1303
  });
1237
1304
  });
1238
1305
  break;
1239
1306
  case "number":
1240
- e[k.key] = z.number().nullable().superRefine((e, A) => {
1241
- e !== null && k.minValue !== void 0 && e < k.minValue && A.addIssue({
1307
+ e[O.key] = z.number().nullable().superRefine((e, k) => {
1308
+ e !== null && O.minValue !== void 0 && e < O.minValue && k.addIssue({
1242
1309
  code: z.ZodIssueCode.custom,
1243
- message: `Minimum value is ${k.minValue}`
1244
- }), e !== null && k.maxValue !== void 0 && e > k.maxValue && A.addIssue({
1310
+ message: `Minimum value is ${O.minValue}`
1311
+ }), e !== null && O.maxValue !== void 0 && e > O.maxValue && k.addIssue({
1245
1312
  code: z.ZodIssueCode.custom,
1246
- message: `Maximum value is ${k.maxValue}`
1313
+ message: `Maximum value is ${O.maxValue}`
1247
1314
  });
1248
1315
  });
1249
1316
  break;
1250
1317
  case "date":
1251
- e[k.key] = plainDateSchema.nullable().superRefine((e, A) => {
1252
- e !== null && k.minDate !== void 0 && e < k.minDate && A.addIssue({
1318
+ e[O.key] = plainDateSchema.nullable().superRefine((e, k) => {
1319
+ e !== null && O.minDate !== void 0 && e < O.minDate && k.addIssue({
1253
1320
  code: z.ZodIssueCode.custom,
1254
- message: `Minimum date is ${k.minDate}`
1255
- }), e !== null && k.maxDate !== void 0 && e > k.maxDate && A.addIssue({
1321
+ message: `Minimum date is ${O.minDate}`
1322
+ }), e !== null && O.maxDate !== void 0 && e > O.maxDate && k.addIssue({
1256
1323
  code: z.ZodIssueCode.custom,
1257
- message: `Maximum date is ${k.maxDate}`
1324
+ message: `Maximum date is ${O.maxDate}`
1258
1325
  });
1259
1326
  });
1260
1327
  break;
1261
- default: e[k.key] = z.string().nullable();
1328
+ default: e[O.key] = z.string().nullable();
1262
1329
  }
1263
1330
  return e;
1264
1331
  }, {});
@@ -1303,8 +1370,8 @@ var Step = /* @__PURE__ */ function(e) {
1303
1370
  __name: "ContactCreateDialogBusinessForm",
1304
1371
  props: { onSubmit: { type: Function } },
1305
1372
  emits: ["back"],
1306
- setup(e, { emit: j }) {
1307
- let M = e, N = j, F = useI18n(), I = useCrm(), R = useCrmConfig(), B = computed(() => I.getEntityConfig(EntityType.BUSINESS)), V = ref(!1), H = ref(Step.SEARCH_BUSINESS), W = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? F.t("wise_crm.contact.create_dialog.form.contact_person_title") : F.t("wise_crm.contact.create_dialog.form.title", { value: B.value?.name ?? "-" })), G = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? F.t("wise_crm.contact.create_dialog.form.contact_person_description") : F.t("wise_crm.contact.create_dialog.form.description")), K = useForm({
1373
+ setup(e, { emit: k }) {
1374
+ let j = e, M = k, N = useI18n(), F = useCrm(), I = useCrmConfig(), { geocodeAddress: R } = useGeocode(), B = computed(() => F.getEntityConfig(EntityType.BUSINESS)), V = ref(!1), H = ref(Step.SEARCH_BUSINESS), W = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? N.t("wise_crm.contact.create_dialog.form.contact_person_title") : N.t("wise_crm.contact.create_dialog.form.title", { value: B.value?.name ?? "-" })), G = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? N.t("wise_crm.contact.create_dialog.form.contact_person_description") : N.t("wise_crm.contact.create_dialog.form.description")), K = useForm({
1308
1375
  initialState: {
1309
1376
  childUuid: null,
1310
1377
  individualUuid: null,
@@ -1317,14 +1384,14 @@ var Step = /* @__PURE__ */ function(e) {
1317
1384
  individualPosition: null,
1318
1385
  vatNumber: null
1319
1386
  },
1320
- schema: getBusinessCreateFormSchema(computed(() => R.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)).value),
1387
+ schema: getBusinessCreateFormSchema(computed(() => I.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)).value),
1321
1388
  onSubmit: async (e) => {
1322
- await M.onSubmit(e);
1389
+ await j.onSubmit(e);
1323
1390
  }
1324
1391
  }), q = K.register("name"), J = K.register("address"), Y = K.register("companyNumber"), X = K.register("vatNumber");
1325
1392
  function Z(e) {
1326
1393
  if (e === Step.SEARCH_BUSINESS) {
1327
- N("back");
1394
+ M("back");
1328
1395
  return;
1329
1396
  }
1330
1397
  if (e === Step.MANUAL_BUSINESS) {
@@ -1338,22 +1405,30 @@ var Step = /* @__PURE__ */ function(e) {
1338
1405
  e === Step.MANUAL_CONTACT_PERSON && (H.value = Step.SEARCH_CONTACT_PERSON);
1339
1406
  }
1340
1407
  function Q() {
1341
- H.value = Step.MANUAL_BUSINESS;
1408
+ q.setValue(null), J.setValue(null), Y.setValue(null), X.setValue(null), V.value = !1, H.value = Step.MANUAL_BUSINESS;
1342
1409
  }
1343
- function $(e) {
1410
+ async function $(e) {
1344
1411
  if (e === null) return;
1345
1412
  H.value = Step.MANUAL_BUSINESS, V.value = !0;
1346
- let k = e.uuid.replace(/\./g, "");
1347
- q.setValue(e.name), J.setValue(e.address ? {
1348
- ...e.address,
1349
- country: CountryCode.BE
1350
- } : null), X.setValue({
1413
+ let O = e.uuid.replace(/\./g, "");
1414
+ if (q.setValue(e.name), e.address !== null) {
1415
+ let O = await R(e.address);
1416
+ J.setValue({
1417
+ ...e.address,
1418
+ coordinates: O ?? {
1419
+ lat: null,
1420
+ lng: null
1421
+ },
1422
+ country: CountryCode.BE
1423
+ });
1424
+ } else J.setValue(null);
1425
+ X.setValue({
1351
1426
  countryCode: CountryCode.BE,
1352
- number: k
1353
- }), Y.setValue(k);
1427
+ number: O
1428
+ }), Y.setValue(O);
1354
1429
  }
1355
- return (e, A) => (openBlock(), createBlock(AppDialogContainer_default, { class: "gap-xl flex flex-1 flex-col overflow-hidden" }, {
1356
- default: withCtx(() => [createVNode(AppColorProvider_default, { color: unref(I).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null }, {
1430
+ return (e, k) => (openBlock(), createBlock(AppDialogContainer_default, { class: "gap-xl flex flex-1 flex-col overflow-hidden" }, {
1431
+ default: withCtx(() => [createVNode(AppColorProvider_default, { color: unref(F).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null }, {
1357
1432
  default: withCtx(() => [createVNode(AppDialogHeader_default, {
1358
1433
  title: W.value,
1359
1434
  description: G.value,
@@ -1373,25 +1448,25 @@ var Step = /* @__PURE__ */ function(e) {
1373
1448
  key: 0,
1374
1449
  onCreateNew: Q,
1375
1450
  onUpdateCbeSearchItem: $,
1376
- onBack: A[0] ||= (e) => Z(Step.SEARCH_BUSINESS)
1451
+ onBack: k[0] ||= (e) => Z(Step.SEARCH_BUSINESS)
1377
1452
  })) : createCommentVNode("", !0),
1378
1453
  H.value === Step.MANUAL_BUSINESS ? (openBlock(), createBlock(ContactCreateDialogBusinessGeneralInfo_default, {
1379
1454
  key: 1,
1380
1455
  form: unref(K),
1381
1456
  "is-data-from-cbe": V.value,
1382
- onBack: A[1] ||= (e) => Z(Step.MANUAL_BUSINESS),
1383
- onNext: A[2] ||= (e) => H.value = Step.SEARCH_CONTACT_PERSON
1457
+ onBack: k[1] ||= (e) => Z(Step.MANUAL_BUSINESS),
1458
+ onNext: k[2] ||= (e) => H.value = Step.SEARCH_CONTACT_PERSON
1384
1459
  }, null, 8, ["form", "is-data-from-cbe"])) : createCommentVNode("", !0),
1385
1460
  H.value === Step.SEARCH_CONTACT_PERSON ? (openBlock(), createBlock(ContactCreateDialogBusinessContactPersonSearch_default, {
1386
1461
  key: 2,
1387
1462
  form: unref(K),
1388
- onBack: A[3] ||= (e) => Z(Step.SEARCH_CONTACT_PERSON),
1389
- onNext: A[4] ||= (e) => H.value = Step.MANUAL_CONTACT_PERSON
1463
+ onBack: k[3] ||= (e) => Z(Step.SEARCH_CONTACT_PERSON),
1464
+ onNext: k[4] ||= (e) => H.value = Step.MANUAL_CONTACT_PERSON
1390
1465
  }, null, 8, ["form"])) : createCommentVNode("", !0),
1391
1466
  H.value === Step.MANUAL_CONTACT_PERSON ? (openBlock(), createBlock(ContactCreateDialogBusinessContactPerson_default, {
1392
1467
  key: 3,
1393
1468
  form: unref(K),
1394
- onBack: A[5] ||= (e) => Z(Step.MANUAL_CONTACT_PERSON)
1469
+ onBack: k[5] ||= (e) => Z(Step.MANUAL_CONTACT_PERSON)
1395
1470
  }, null, 8, ["form"])) : createCommentVNode("", !0)
1396
1471
  ]),
1397
1472
  _: 1
@@ -1403,63 +1478,63 @@ var Step = /* @__PURE__ */ function(e) {
1403
1478
  __name: "BusinessAddChildBusinessDialog",
1404
1479
  props: { businessUuid: {} },
1405
1480
  emits: ["close"],
1406
- setup(e, { emit: k }) {
1407
- let A = e, j = k, M = useI18n(), N = useApiErrorToast(), F = ref(!1), I = ref(null), L = useBusinessCreateMutation(), R = useBusinessAddChildBusinessMutation();
1408
- function B() {
1409
- j("close");
1481
+ setup(e, { emit: O }) {
1482
+ let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = ref(!1), F = ref(null), I = useBusinessCreateMutation(), L = useBusinessAddChildBusinessMutation();
1483
+ function R() {
1484
+ A("close");
1410
1485
  }
1411
- async function V(e) {
1486
+ async function B(e) {
1412
1487
  try {
1413
- let k = await L.execute({ body: e });
1414
- await R.execute({ params: {
1415
- childUuid: k,
1416
- parentUuid: A.businessUuid
1417
- } }), j("close");
1488
+ let O = await I.execute({ body: e });
1489
+ await L.execute({ params: {
1490
+ childUuid: O,
1491
+ parentUuid: k.businessUuid
1492
+ } }), A("close");
1418
1493
  } catch (e) {
1419
- N.show(e);
1494
+ M.show(e);
1420
1495
  }
1421
1496
  }
1422
- async function H(e) {
1497
+ async function V(e) {
1423
1498
  try {
1424
- await R.execute({ params: {
1499
+ await L.execute({ params: {
1425
1500
  childUuid: e,
1426
- parentUuid: A.businessUuid
1427
- } }), j("close");
1501
+ parentUuid: k.businessUuid
1502
+ } }), A("close");
1428
1503
  } catch (e) {
1429
- N.show(e);
1504
+ M.show(e);
1430
1505
  }
1431
1506
  }
1432
- function W() {
1433
- F.value = !1;
1507
+ function H() {
1508
+ N.value = !1;
1434
1509
  }
1435
- function G() {
1436
- F.value = !0;
1510
+ function W() {
1511
+ N.value = !0;
1437
1512
  }
1438
- return (e, k) => (openBlock(), createBlock(unref(VcDialog), {
1513
+ return (e, O) => (openBlock(), createBlock(unref(VcDialog), {
1439
1514
  "class-config": { content: "max-w-xl w-full" },
1440
- onClose: B
1515
+ onClose: R
1441
1516
  }, {
1442
- default: withCtx(() => [F.value ? (openBlock(), createBlock(ContactCreateDialogBusinessForm_default, {
1517
+ default: withCtx(() => [N.value ? (openBlock(), createBlock(ContactCreateDialogBusinessForm_default, {
1443
1518
  key: 0,
1444
- "on-submit": V,
1445
- onBack: W
1519
+ "on-submit": B,
1520
+ onBack: H
1446
1521
  })) : (openBlock(), createBlock(AppDialogContainer_default, {
1447
1522
  key: 1,
1448
1523
  class: "gap-xl flex flex-1 flex-col"
1449
1524
  }, {
1450
1525
  default: withCtx(() => [createVNode(AppDialogHeader_default, {
1451
- title: unref(M).t("wise_crm.info_dialog.add_business_child_dialog.title"),
1452
- description: unref(M).t("wise_crm.info_dialog.add_business_child_dialog.description"),
1526
+ title: unref(j).t("wise_crm.info_dialog.add_business_child_dialog.title"),
1527
+ description: unref(j).t("wise_crm.info_dialog.add_business_child_dialog.description"),
1453
1528
  icon: "building"
1454
1529
  }, {
1455
1530
  "closse-button": withCtx(() => [createVNode(unref(VcDialogCloseButton))]),
1456
1531
  _: 1
1457
1532
  }, 8, ["title", "description"]), createVNode(BusinessAddExistingChildForm_default, {
1458
- modelValue: I.value,
1459
- "onUpdate:modelValue": k[0] ||= (e) => I.value = e,
1460
- "parent-business-uuid": A.businessUuid,
1461
- "on-submit": H,
1462
- onCreateNew: G
1533
+ modelValue: F.value,
1534
+ "onUpdate:modelValue": O[0] ||= (e) => F.value = e,
1535
+ "parent-business-uuid": k.businessUuid,
1536
+ "on-submit": V,
1537
+ onCreateNew: W
1463
1538
  }, null, 8, ["modelValue", "parent-business-uuid"])]),
1464
1539
  _: 1
1465
1540
  }))]),
@@ -1469,7 +1544,7 @@ var Step = /* @__PURE__ */ function(e) {
1469
1544
  });
1470
1545
  function useBusinessLinkContactPersonMutation() {
1471
1546
  return ze({
1472
- queryFn: async ({ body: e, params: k }) => await BusinessService.linkContactPerson(k.businessUuid, e.contactPersonUuid, e.position, e.contactInfo),
1547
+ queryFn: async ({ body: e, params: O }) => await BusinessService.linkContactPerson(O.businessUuid, e.contactPersonUuid, e.position, e.contactInfo),
1473
1548
  queryKeysToInvalidate: {
1474
1549
  businessIndex: {},
1475
1550
  wiseCrmBusinessDetail: { businessUuid: (e) => e.businessUuid }
@@ -1486,20 +1561,20 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
1486
1561
  }
1487
1562
  },
1488
1563
  emits: ["close", "createNewContactPerson"],
1489
- setup(e, { emit: k }) {
1490
- let A = e, j = k, M = useI18n(), N = useApiErrorToast(), P = useBusinessLinkContactPersonMutation(), F = useContactPersonCreateMutation();
1491
- async function I(e) {
1564
+ setup(e, { emit: O }) {
1565
+ let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = useBusinessLinkContactPersonMutation(), P = useContactPersonCreateMutation();
1566
+ async function F(e) {
1492
1567
  try {
1493
- let k = await F.execute({ body: {
1568
+ let O = await P.execute({ body: {
1494
1569
  email: e.email,
1495
1570
  firstName: e.firstName,
1496
1571
  lastName: e.lastName,
1497
1572
  mobilePhone: e.mobilePhone,
1498
1573
  phone: e.phone
1499
1574
  } });
1500
- A.isCreatingNewContactPerson || await P.execute({
1575
+ k.isCreatingNewContactPerson || await N.execute({
1501
1576
  body: {
1502
- contactPersonUuid: k,
1577
+ contactPersonUuid: O,
1503
1578
  contactInfo: {
1504
1579
  email: e.email,
1505
1580
  mobilePhone: e.mobilePhone,
@@ -1507,45 +1582,45 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
1507
1582
  },
1508
1583
  position: e.position
1509
1584
  },
1510
- params: { businessUuid: A.businessUuid }
1511
- }), R({
1585
+ params: { businessUuid: k.businessUuid }
1586
+ }), L({
1512
1587
  label: `${e.firstName} ${e.lastName}`,
1513
- value: k
1588
+ value: O
1514
1589
  });
1515
1590
  } catch (e) {
1516
- N.show(e);
1591
+ M.show(e);
1517
1592
  }
1518
1593
  }
1519
- async function L(e, k, j) {
1594
+ async function I(e, O, A) {
1520
1595
  if (e !== null) try {
1521
- await P.execute({
1596
+ await N.execute({
1522
1597
  body: {
1523
1598
  contactPersonUuid: e,
1524
- contactInfo: k,
1525
- position: j
1599
+ contactInfo: O,
1600
+ position: A
1526
1601
  },
1527
- params: { businessUuid: A.businessUuid }
1528
- }), R();
1602
+ params: { businessUuid: k.businessUuid }
1603
+ }), L();
1529
1604
  } catch (e) {
1530
- N.show(e);
1605
+ M.show(e);
1531
1606
  }
1532
1607
  }
1533
- function R(e) {
1608
+ function L(e) {
1534
1609
  if (e === void 0) {
1535
- j("close");
1610
+ A("close");
1536
1611
  return;
1537
1612
  }
1538
- j("createNewContactPerson", e), j("close");
1613
+ A("createNewContactPerson", e), A("close");
1539
1614
  }
1540
- return (e, k) => (openBlock(), createBlock(AppDialog_default, {
1541
- title: unref(M).t("wise_crm.info_dialog.contact_person_create.title"),
1542
- description: unref(M).t("wise_crm.info_dialog.contact_person_create.description"),
1543
- onClose: R
1615
+ return (e, O) => (openBlock(), createBlock(AppDialog_default, {
1616
+ title: unref(j).t("wise_crm.info_dialog.contact_person_create.title"),
1617
+ description: unref(j).t("wise_crm.info_dialog.contact_person_create.description"),
1618
+ onClose: L
1544
1619
  }, {
1545
1620
  default: withCtx(() => [createVNode(ContactPersonCreateForm_default, {
1546
- "on-submit": I,
1547
- "on-link-contact-person": L,
1548
- onClose: R
1621
+ "on-submit": F,
1622
+ "on-link-contact-person": I,
1623
+ onClose: L
1549
1624
  })]),
1550
1625
  _: 1
1551
1626
  }, 8, ["title", "description"]));
@@ -1553,7 +1628,7 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
1553
1628
  });
1554
1629
  function useBusinessContactPersonUpdateMutation() {
1555
1630
  return ze({
1556
- queryFn: async ({ body: e, params: k }) => await BusinessService.updateContactPerson(k.businessUuid, k.contactPersonUuid, e),
1631
+ queryFn: async ({ body: e, params: O }) => await BusinessService.updateContactPerson(O.businessUuid, O.contactPersonUuid, e),
1557
1632
  queryKeysToInvalidate: {
1558
1633
  businessIndex: {},
1559
1634
  contactPersonDetail: { contactPersonUuid: (e) => e.contactPersonUuid },
@@ -1561,15 +1636,15 @@ function useBusinessContactPersonUpdateMutation() {
1561
1636
  }
1562
1637
  });
1563
1638
  }
1564
- function useBusinessContactPersonDetailQuery(e, k) {
1639
+ function useBusinessContactPersonDetailQuery(e, O) {
1565
1640
  return He({
1566
- isEnabled: computed(() => e.value !== null && k.value !== null),
1641
+ isEnabled: computed(() => e.value !== null && O.value !== null),
1567
1642
  queryFn: () => {
1568
1643
  if (e.value === null) throw Error("Individual UUID is null");
1569
- if (k.value === null) throw Error("Contact Person UUID is null");
1570
- return BusinessService.getContactPerson(e.value, k.value);
1644
+ if (O.value === null) throw Error("Contact Person UUID is null");
1645
+ return BusinessService.getContactPerson(e.value, O.value);
1571
1646
  },
1572
- queryKey: { contactPersonDetail: { contactPersonUuid: k } }
1647
+ queryKey: { contactPersonDetail: { contactPersonUuid: O } }
1573
1648
  });
1574
1649
  }
1575
1650
  var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
@@ -1579,25 +1654,25 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1579
1654
  onSubmit: { type: Function }
1580
1655
  },
1581
1656
  setup(e) {
1582
- let k = e, A = useI18n(), j = useForm({
1657
+ let O = e, k = useI18n(), A = useForm({
1583
1658
  initialState: {
1584
- email: k.contactPerson.email,
1585
- firstName: k.contactPerson.firstName,
1586
- lastName: k.contactPerson.lastName,
1587
- mobilePhone: k.contactPerson.mobilePhone,
1588
- phone: k.contactPerson.phone,
1589
- position: k.contactPerson.position
1659
+ email: O.contactPerson.email,
1660
+ firstName: O.contactPerson.firstName,
1661
+ lastName: O.contactPerson.lastName,
1662
+ mobilePhone: O.contactPerson.mobilePhone,
1663
+ phone: O.contactPerson.phone,
1664
+ position: O.contactPerson.position
1590
1665
  },
1591
1666
  schema: contactPersonUpdateFormSchema,
1592
1667
  onSubmit: async (e) => {
1593
- await k.onSubmit(e);
1668
+ await O.onSubmit(e);
1594
1669
  }
1595
1670
  });
1596
- return (e, k) => (openBlock(), createBlock(ContactPersonCreateNewForm_default, { form: unref(j) }, {
1671
+ return (e, O) => (openBlock(), createBlock(ContactPersonCreateNewForm_default, { form: unref(A) }, {
1597
1672
  actions: withCtx(() => [createVNode(AppSidebarFormFooter_default, null, {
1598
1673
  default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
1599
- "is-loading": unref(j).isSubmitting.value,
1600
- label: unref(A).t("wise_crm.shared.save_changes")
1674
+ "is-loading": unref(A).isSubmitting.value,
1675
+ label: unref(k).t("wise_crm.shared.save_changes")
1601
1676
  }, null, 8, ["is-loading", "label"])]),
1602
1677
  _: 1
1603
1678
  })]),
@@ -1611,35 +1686,35 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1611
1686
  contactPersonUuid: {}
1612
1687
  },
1613
1688
  emits: ["close"],
1614
- setup(e, { emit: k }) {
1615
- let A = e, j = k, M = useI18n(), N = useApiErrorToast(), P = useBusinessContactPersonUpdateMutation(), F = useBusinessContactPersonDetailQuery(computed(() => A.businessUuid), computed(() => A.contactPersonUuid));
1616
- async function I(e) {
1689
+ setup(e, { emit: O }) {
1690
+ let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = useBusinessContactPersonUpdateMutation(), P = useBusinessContactPersonDetailQuery(computed(() => k.businessUuid), computed(() => k.contactPersonUuid));
1691
+ async function F(e) {
1617
1692
  try {
1618
- await P.execute({
1693
+ await N.execute({
1619
1694
  body: e,
1620
1695
  params: {
1621
- businessUuid: A.businessUuid,
1622
- contactPersonUuid: A.contactPersonUuid
1696
+ businessUuid: k.businessUuid,
1697
+ contactPersonUuid: k.contactPersonUuid
1623
1698
  }
1624
- }), j("close");
1699
+ }), A("close");
1625
1700
  } catch (e) {
1626
- N.show(e);
1701
+ M.show(e);
1627
1702
  }
1628
1703
  }
1629
- function L() {
1630
- j("close");
1704
+ function I() {
1705
+ A("close");
1631
1706
  }
1632
- return (e, k) => (openBlock(), createBlock(AppDialog_default, {
1633
- title: unref(M).t("wise_crm.info_dialog.contact_person_update.title"),
1634
- description: unref(M).t("wise_crm.info_dialog.contact_person_create.description"),
1635
- onClose: L
1707
+ return (e, O) => (openBlock(), createBlock(AppDialog_default, {
1708
+ title: unref(j).t("wise_crm.info_dialog.contact_person_update.title"),
1709
+ description: unref(j).t("wise_crm.info_dialog.contact_person_create.description"),
1710
+ onClose: I
1636
1711
  }, {
1637
- default: withCtx(() => [unref(F).data.value ? (openBlock(), createBlock(BusinessContactPersonUpdateForm_default, {
1712
+ default: withCtx(() => [unref(P).data.value ? (openBlock(), createBlock(BusinessContactPersonUpdateForm_default, {
1638
1713
  key: 0,
1639
- "business-uuid": A.businessUuid,
1640
- "on-submit": I,
1641
- "contact-person": unref(F).data.value,
1642
- onClose: L
1714
+ "business-uuid": k.businessUuid,
1715
+ "on-submit": F,
1716
+ "contact-person": unref(P).data.value,
1717
+ onClose: I
1643
1718
  }, null, 8, ["business-uuid", "contact-person"])) : createCommentVNode("", !0)]),
1644
1719
  _: 1
1645
1720
  }, 8, ["title", "description"]));
@@ -1651,42 +1726,42 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1651
1726
  __name: "BusinessDetailSidebarAccordionBusinessInfoChildren",
1652
1727
  props: { business: {} },
1653
1728
  emits: ["addChild"],
1654
- setup(e, { emit: k }) {
1655
- let A = e, j = k, M = useI18n(), N = useEntityDetail(), P = computed(() => A.business.children), F = computed(() => P.value.length > 1 ? M.t("wise_crm.shared.departments_amount", { value: P.value.length }) : P.value[0]?.name ?? "");
1656
- function I() {
1657
- j("addChild");
1729
+ setup(e, { emit: O }) {
1730
+ let k = e, A = O, j = useI18n(), M = useEntityDetail(), N = computed(() => k.business.children), P = computed(() => N.value.length > 1 ? j.t("wise_crm.shared.departments_amount", { value: N.value.length }) : N.value[0]?.name ?? "");
1731
+ function F() {
1732
+ A("addChild");
1658
1733
  }
1659
- function L(e) {
1660
- N.open(EntityType.BUSINESS, e);
1734
+ function I(e) {
1735
+ M.open(EntityType.BUSINESS, e);
1661
1736
  }
1662
- return (e, k) => (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(unref(VcIcon), {
1737
+ return (e, O) => (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(unref(VcIcon), {
1663
1738
  icon: "layersTree",
1664
1739
  class: "mt-xs size-4 shrink-0"
1665
1740
  }), createElementVNode("div", _hoisted_2$1, [
1666
- A.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_3$1, [createVNode(AppOpenEntityButton_default, {
1741
+ k.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_3$1, [createVNode(AppOpenEntityButton_default, {
1667
1742
  "class-config": { root: "bg-transparent w-min border-none text-primary shadow-none h-auto hover:underline p-0 font-regular" },
1668
1743
  "entity-type": unref(EntityType).BUSINESS,
1669
- uuid: A.business.parent.uuid
1744
+ uuid: k.business.parent.uuid
1670
1745
  }, {
1671
- default: withCtx(() => [createTextVNode(toDisplayString(A.business.parent.name), 1)]),
1746
+ default: withCtx(() => [createTextVNode(toDisplayString(k.business.parent.name), 1)]),
1672
1747
  _: 1
1673
1748
  }, 8, ["entity-type", "uuid"])])),
1674
- createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [A.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcIcon), {
1749
+ createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [k.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcIcon), {
1675
1750
  key: 0,
1676
1751
  icon: "timeLineMarker",
1677
1752
  class: "text-brand-500 size-4"
1678
- })), createElementVNode("p", _hoisted_6, toDisplayString(A.business.name), 1)]), createVNode(unref(VcIconButton), {
1753
+ })), createElementVNode("p", _hoisted_6, toDisplayString(k.business.name), 1)]), createVNode(unref(VcIconButton), {
1679
1754
  "class-config": {
1680
1755
  root: "bg-transparent border-none h-auto w-auto p-xs shadow-none rounded-sm data-[loading=false]:not-disabled:hover:bg-secondary/50 duration-300",
1681
1756
  icon: "text-quaternary size-4"
1682
1757
  },
1683
- label: unref(M).t("wise_crm.info_dialog.sidebar.business.add_icon"),
1758
+ label: unref(j).t("wise_crm.info_dialog.sidebar.business.add_icon"),
1684
1759
  icon: "plus",
1685
- onClick: I
1760
+ onClick: F
1686
1761
  }, null, 8, ["label"])]),
1687
- P.value.length > 0 ? (openBlock(), createElementBlock("div", {
1762
+ N.value.length > 0 ? (openBlock(), createElementBlock("div", {
1688
1763
  key: 1,
1689
- class: normalizeClass([{ "ml-2xl": A.business.parent !== null }, "gap-sm flex items-center"])
1764
+ class: normalizeClass([{ "ml-2xl": k.business.parent !== null }, "gap-sm flex items-center"])
1690
1765
  }, [createVNode(unref(VcIcon), {
1691
1766
  icon: "timeLineMarker",
1692
1767
  class: "text-brand-500 size-4"
@@ -1701,14 +1776,14 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1701
1776
  variant: "secondary",
1702
1777
  class: "underline"
1703
1778
  }, {
1704
- default: withCtx(() => [createTextVNode(toDisplayString(F.value), 1)]),
1779
+ default: withCtx(() => [createTextVNode(toDisplayString(P.value), 1)]),
1705
1780
  _: 1
1706
1781
  })]),
1707
1782
  content: withCtx(() => [createElementVNode("div", _hoisted_7, [createVNode(CrmDetailAccordionRoot_default, {
1708
- "default-values": P.value[0]?.uuid ?? "",
1783
+ "default-values": N.value[0]?.uuid ?? "",
1709
1784
  type: "single"
1710
1785
  }, {
1711
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(P.value, (e) => (openBlock(), createBlock(CrmDetailSidebarAccordionItem_default, {
1786
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.value, (e) => (openBlock(), createBlock(CrmDetailSidebarAccordionItem_default, {
1712
1787
  key: e.uuid,
1713
1788
  label: e.name,
1714
1789
  value: e.uuid,
@@ -1719,9 +1794,9 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1719
1794
  root: "bg-transparent border-none h-auto w-auto p-xs shadow-none rounded-sm data-[loading=false]:not-disabled:hover:bg-secondary/50 duration-300",
1720
1795
  icon: "text-quaternary size-4"
1721
1796
  },
1722
- label: unref(M).t("wise_crm.info_dialog.sidebar.business.add_icon"),
1797
+ label: unref(j).t("wise_crm.info_dialog.sidebar.business.add_icon"),
1723
1798
  icon: "linkExternal",
1724
- onClick: (k) => L(e.uuid)
1799
+ onClick: (O) => I(e.uuid)
1725
1800
  }, null, 8, ["label", "onClick"])]),
1726
1801
  default: withCtx(() => [createVNode(CrmDetailSidebarCard_default, { class: "gap-md flex flex-col" }, {
1727
1802
  default: withCtx(() => [
@@ -1760,122 +1835,122 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1760
1835
  __name: "BusinessDetailSidebarAccordionBusinessInfo",
1761
1836
  props: { business: {} },
1762
1837
  emits: ["addChild"],
1763
- setup(e, { emit: k }) {
1764
- let A = e, j = k, M = useI18n();
1765
- function N() {
1766
- j("addChild");
1838
+ setup(e, { emit: O }) {
1839
+ let k = e, A = O, j = useI18n();
1840
+ function M() {
1841
+ A("addChild");
1767
1842
  }
1768
- return (k, j) => (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(CrmDetailSidebarCard_default, null, {
1843
+ return (O, A) => (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(CrmDetailSidebarCard_default, null, {
1769
1844
  default: withCtx(() => [createElementVNode("div", _hoisted_2, [createVNode(AppIconLabelPair_default, {
1770
- label: A.business.vatNumber ? unref(VatNumberUtil).format(A.business.vatNumber) : "-",
1845
+ label: k.business.vatNumber ? unref(VatNumberUtil).format(k.business.vatNumber) : "-",
1771
1846
  icon: "buildings"
1772
1847
  }, null, 8, ["label"]), createVNode(BusinessDetailSidebarAccordionBusinessInfoChildren_default, {
1773
1848
  business: e.business,
1774
- onAddChild: N
1849
+ onAddChild: M
1775
1850
  }, null, 8, ["business"])]), createElementVNode("div", _hoisted_3, [createVNode(AppIconLabelPair_default, {
1776
- label: unref(M).t("wise_crm.info_dialog.sidebar.overview.created_at_label", { value: A.business.createdAt ? unref(useDateTimeFormat)().toDateTime(A.business.createdAt) : "-" }),
1851
+ label: unref(j).t("wise_crm.info_dialog.sidebar.overview.created_at_label", { value: k.business.createdAt ? unref(useDateTimeFormat)().toDateTime(k.business.createdAt) : "-" }),
1777
1852
  icon: "clockPlus"
1778
1853
  }, null, 8, ["label"])])]),
1779
1854
  _: 1
1780
- }), createVNode(CrmDetailSidebarMapCard_default, { address: A.business.address }, null, 8, ["address"])]));
1855
+ }), createVNode(CrmDetailSidebarMapCard_default, { address: k.business.address }, null, 8, ["address"])]));
1781
1856
  }
1782
1857
  }), BusinessDetailSidebarOverviewContent_default = /* @__PURE__ */ defineComponent({
1783
1858
  __name: "BusinessDetailSidebarOverviewContent",
1784
1859
  props: { business: {} },
1785
1860
  setup(e) {
1786
- let k = e, A = useI18n(), j = useApiErrorToast(), N = useDialog(AppConfirmDialog_default), P = useBusinessPrimaryContactPersonUpdateMutation(), F = useBusinessUnlinkContactPersonMutation(), I = useDialog(BusinessContactPersonCreateDialog_default), L = useDialog(BusinessContactPersonUpdateDialog_default), R = useDialog(BusinessAddChildBusinessDialog_default), B = computed(() => k.business.contactPersons.length > 0);
1787
- function V() {
1788
- I.open({ businessUuid: k.business.uuid });
1861
+ let O = e, k = useI18n(), A = useApiErrorToast(), j = useDialog(AppConfirmDialog_default), N = useBusinessPrimaryContactPersonUpdateMutation(), P = useBusinessUnlinkContactPersonMutation(), F = useDialog(BusinessContactPersonCreateDialog_default), I = useDialog(BusinessContactPersonUpdateDialog_default), L = useDialog(BusinessAddChildBusinessDialog_default), R = computed(() => O.business.contactPersons.length > 0);
1862
+ function B() {
1863
+ F.open({ businessUuid: O.business.uuid });
1789
1864
  }
1790
- function H(e) {
1791
- L.open({
1792
- businessUuid: k.business.uuid,
1865
+ function V(e) {
1866
+ I.open({
1867
+ businessUuid: O.business.uuid,
1793
1868
  contactPersonUuid: e
1794
1869
  });
1795
1870
  }
1796
- function U(e) {
1797
- N.open({
1798
- title: A.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
1871
+ function H(e) {
1872
+ j.open({
1873
+ title: k.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
1799
1874
  isDestructive: !0,
1800
- isLoading: F.isLoading.value,
1801
- confirmText: A.t("shared.delete"),
1802
- description: A.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_description"),
1875
+ isLoading: P.isLoading.value,
1876
+ confirmText: k.t("shared.delete"),
1877
+ description: k.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_description"),
1803
1878
  onConfirm: async () => {
1804
1879
  try {
1805
- await F.execute({
1880
+ await P.execute({
1806
1881
  body: { contactPersonUuid: e },
1807
- params: { businessUuid: k.business.uuid }
1882
+ params: { businessUuid: O.business.uuid }
1808
1883
  });
1809
1884
  } catch (e) {
1810
- j.show(e);
1885
+ A.show(e);
1811
1886
  } finally {
1812
- N.close();
1887
+ j.close();
1813
1888
  }
1814
1889
  }
1815
1890
  });
1816
1891
  }
1817
- function W(e) {
1818
- P.execute({ params: {
1819
- businessUuid: k.business.uuid,
1892
+ function U(e) {
1893
+ N.execute({ params: {
1894
+ businessUuid: O.business.uuid,
1820
1895
  contactPersonUuid: e
1821
1896
  } });
1822
1897
  }
1823
- function G() {
1824
- R.open({ businessUuid: k.business.uuid });
1898
+ function W() {
1899
+ L.open({ businessUuid: O.business.uuid });
1825
1900
  }
1826
- return (j, M) => (openBlock(), createBlock(CrmDetailAccordionRoot_default, { "default-values": [
1901
+ return (A, j) => (openBlock(), createBlock(CrmDetailAccordionRoot_default, { "default-values": [
1827
1902
  "business",
1828
1903
  "invoice",
1829
1904
  "contact-persons"
1830
1905
  ] }, {
1831
1906
  default: withCtx(() => [
1832
1907
  createVNode(CrmDetailSidebarAccordionItem_default, {
1833
- label: unref(A).t("wise_crm.info_dialog.sidebar.overview.business_info"),
1908
+ label: unref(k).t("wise_crm.info_dialog.sidebar.overview.business_info"),
1834
1909
  value: "business",
1835
1910
  icon: "infoCircle"
1836
1911
  }, {
1837
1912
  default: withCtx(() => [createVNode(BusinessDetailSidebarAccordionBusinessInfo_default, {
1838
1913
  business: e.business,
1839
- onAddChild: G
1914
+ onAddChild: W
1840
1915
  }, null, 8, ["business"])]),
1841
1916
  _: 1
1842
1917
  }, 8, ["label"]),
1843
1918
  createVNode(CrmDetailSidebarAccordionItem_default, {
1844
- "is-empty": k.business.billingInformation === null,
1845
- label: unref(A).t("wise_crm.info_dialog.sidebar.overview.invoice_label"),
1919
+ "is-empty": O.business.billingInformation === null,
1920
+ label: unref(k).t("wise_crm.info_dialog.sidebar.overview.invoice_label"),
1846
1921
  value: "invoice",
1847
1922
  icon: "wallet"
1848
1923
  }, {
1849
- default: withCtx(() => [k.business.billingInformation ? (openBlock(), createBlock(CrmDetailSidebarAccordionBillingInformation_default, {
1924
+ default: withCtx(() => [O.business.billingInformation ? (openBlock(), createBlock(CrmDetailSidebarAccordionBillingInformation_default, {
1850
1925
  key: 0,
1851
- "invoice-address": k.business.billingInformation?.location.address,
1852
- "invoice-email": k.business.billingInformation?.invoiceEmail
1926
+ "invoice-address": O.business.billingInformation?.location.address,
1927
+ "invoice-email": O.business.billingInformation?.invoiceEmail
1853
1928
  }, null, 8, ["invoice-address", "invoice-email"])) : createCommentVNode("", !0)]),
1854
1929
  _: 1
1855
1930
  }, 8, ["is-empty", "label"]),
1856
1931
  createVNode(CrmDetailSidebarAccordionItem_default, {
1857
- "is-empty": !B.value,
1858
- label: unref(A).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1932
+ "is-empty": !R.value,
1933
+ label: unref(k).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1859
1934
  value: "contact-persons",
1860
1935
  icon: "userCircle",
1861
- onAdd: V
1936
+ onAdd: B
1862
1937
  }, {
1863
- actions: withCtx(() => [B.value ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailSidebarAccordionHeaderIconButton_default, {
1938
+ actions: withCtx(() => [R.value ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailSidebarAccordionHeaderIconButton_default, {
1864
1939
  key: 0,
1865
- label: unref(A).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1940
+ label: unref(k).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1866
1941
  class: "z-1",
1867
1942
  icon: "plus",
1868
- onClick: V
1943
+ onClick: B
1869
1944
  }, null, 8, ["label"]))]),
1870
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.business.contactPersons, (e) => (openBlock(), createBlock(unref(Motion), {
1945
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.business.contactPersons, (e) => (openBlock(), createBlock(unref(Motion), {
1871
1946
  key: e.uuid,
1872
1947
  "layout-id": e.uuid
1873
1948
  }, {
1874
1949
  default: withCtx(() => [createVNode(CrmDetailSidebarAccordionContactPersonInfo_default, {
1875
1950
  "contact-person": e,
1876
- "on-toggle-is-primary": () => W(e.uuid),
1877
- onUpdate: (k) => H(e.uuid),
1878
- onDelete: (k) => U(e.uuid)
1951
+ "on-toggle-is-primary": () => U(e.uuid),
1952
+ onUpdate: (O) => V(e.uuid),
1953
+ onDelete: (O) => H(e.uuid)
1879
1954
  }, null, 8, [
1880
1955
  "contact-person",
1881
1956
  "on-toggle-is-primary",
@@ -1883,14 +1958,14 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1883
1958
  "onDelete"
1884
1959
  ])]),
1885
1960
  _: 2
1886
- }, 1032, ["layout-id"]))), 128)), B.value ? (openBlock(), createBlock(unref(VcButton), {
1961
+ }, 1032, ["layout-id"]))), 128)), R.value ? (openBlock(), createBlock(unref(VcButton), {
1887
1962
  key: 0,
1888
1963
  variant: "tertiary",
1889
1964
  size: "sm",
1890
1965
  "icon-left": "plus",
1891
- onClick: V
1966
+ onClick: B
1892
1967
  }, {
1893
- default: withCtx(() => [createTextVNode(toDisplayString(unref(A).t("wise_crm.shared.add")), 1)]),
1968
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(k).t("wise_crm.shared.add")), 1)]),
1894
1969
  _: 1
1895
1970
  })) : createCommentVNode("", !0)]),
1896
1971
  _: 1
@@ -1905,34 +1980,34 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1905
1980
  __name: "BusinessDetailSidebar",
1906
1981
  props: { business: {} },
1907
1982
  setup(e) {
1908
- let k = e, A = useI18n(), j = useCrm(), M = computed(() => j.getEntityConfig(EntityType.BUSINESS)), N = ref(InfoTab.OVERVIEW), P = computed(() => [
1983
+ let O = e, k = useI18n(), A = useCrm(), j = computed(() => A.getEntityConfig(EntityType.BUSINESS)), M = ref(InfoTab.OVERVIEW), N = computed(() => [
1909
1984
  {
1910
1985
  icon: "infoCircle",
1911
- label: A.t("wise_crm.shared.overview"),
1986
+ label: k.t("wise_crm.shared.overview"),
1912
1987
  value: InfoTab.OVERVIEW
1913
1988
  },
1914
1989
  {
1915
1990
  icon: "activity",
1916
- label: A.t("wise_crm.shared.activity"),
1991
+ label: k.t("wise_crm.shared.activity"),
1917
1992
  value: InfoTab.ACTIVITY
1918
1993
  },
1919
1994
  {
1920
1995
  icon: "book",
1921
- label: A.t("wise_crm.shared.notes"),
1996
+ label: k.t("wise_crm.shared.notes"),
1922
1997
  value: InfoTab.NOTES
1923
1998
  }
1924
1999
  ]);
1925
- return (e, A) => (openBlock(), createBlock(AppColorProvider_default, {
1926
- color: unref(j).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null,
2000
+ return (e, k) => (openBlock(), createBlock(AppColorProvider_default, {
2001
+ color: unref(A).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null,
1927
2002
  class: "flex h-full flex-col"
1928
2003
  }, {
1929
2004
  default: withCtx(() => [createVNode(CrmDetailHeaderCard_default, {
1930
- name: k.business.name,
1931
- address: k.business.address,
1932
- email: k.business.email,
1933
- "mobile-phone": k.business.mobilePhone,
1934
- "entity-name": M.value?.name ?? null,
1935
- phone: k.business.phone
2005
+ name: O.business.name,
2006
+ address: O.business.address,
2007
+ email: O.business.email,
2008
+ "mobile-phone": O.business.mobilePhone,
2009
+ "entity-name": j.value?.name ?? null,
2010
+ phone: O.business.phone
1936
2011
  }, null, 8, [
1937
2012
  "name",
1938
2013
  "address",
@@ -1941,22 +2016,22 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1941
2016
  "entity-name",
1942
2017
  "phone"
1943
2018
  ]), createVNode(CrmDetailSidebarTabs_default, {
1944
- modelValue: N.value,
1945
- "onUpdate:modelValue": A[0] ||= (e) => N.value = e,
1946
- tabs: P.value
2019
+ modelValue: M.value,
2020
+ "onUpdate:modelValue": k[0] ||= (e) => M.value = e,
2021
+ tabs: N.value
1947
2022
  }, {
1948
2023
  default: withCtx(() => [
1949
- N.value === InfoTab.OVERVIEW ? (openBlock(), createBlock(BusinessDetailSidebarOverviewContent_default, {
2024
+ M.value === InfoTab.OVERVIEW ? (openBlock(), createBlock(BusinessDetailSidebarOverviewContent_default, {
1950
2025
  key: 0,
1951
- business: k.business
2026
+ business: O.business
1952
2027
  }, null, 8, ["business"])) : createCommentVNode("", !0),
1953
- N.value === InfoTab.ACTIVITY ? (openBlock(), createBlock(BusinessDetailSidebarActivityContent_default, {
2028
+ M.value === InfoTab.ACTIVITY ? (openBlock(), createBlock(BusinessDetailSidebarActivityContent_default, {
1954
2029
  key: 1,
1955
- business: k.business
2030
+ business: O.business
1956
2031
  }, null, 8, ["business"])) : createCommentVNode("", !0),
1957
- N.value === InfoTab.NOTES ? (openBlock(), createBlock(BusinessDetailSidebarNotesContent_default, {
2032
+ M.value === InfoTab.NOTES ? (openBlock(), createBlock(BusinessDetailSidebarNotesContent_default, {
1958
2033
  key: 2,
1959
- business: k.business
2034
+ business: O.business
1960
2035
  }, null, 8, ["business"])) : createCommentVNode("", !0)
1961
2036
  ]),
1962
2037
  _: 1
@@ -1968,18 +2043,18 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
1968
2043
  __name: "BusinessDetailSidebarProvider",
1969
2044
  props: { businessUuid: {} },
1970
2045
  setup(e) {
1971
- let k = e, A = useI18n(), j = useBusinessDetailQuery(computed(() => k.businessUuid)), M = computed(() => j.data.value ?? null);
1972
- return (e, k) => (openBlock(), createBlock(CrmDetailContainer_default, null, {
1973
- default: withCtx(() => [unref(j).isError.value ? (openBlock(), createBlock(Error_default, {
2046
+ let O = e, k = useI18n(), A = useBusinessDetailQuery(computed(() => O.businessUuid)), j = computed(() => A.data.value ?? null);
2047
+ return (e, O) => (openBlock(), createBlock(CrmDetailContainer_default, null, {
2048
+ default: withCtx(() => [unref(A).isError.value ? (openBlock(), createBlock(Error_default, {
1974
2049
  key: 0,
1975
- message: unref(A).t("error.business_details.description"),
1976
- title: unref(A).t("error.business_details.title")
1977
- }, null, 8, ["message", "title"])) : unref(j).isLoading.value ? (openBlock(), createBlock(AppSkeletonLoader_default, {
2050
+ message: unref(k).t("error.business_details.description"),
2051
+ title: unref(k).t("error.business_details.title")
2052
+ }, null, 8, ["message", "title"])) : unref(A).isLoading.value ? (openBlock(), createBlock(AppSkeletonLoader_default, {
1978
2053
  key: 1,
1979
2054
  class: "h-full"
1980
- })) : M.value ? (openBlock(), createBlock(BusinessDetailSidebar_default, {
2055
+ })) : j.value ? (openBlock(), createBlock(BusinessDetailSidebar_default, {
1981
2056
  key: 2,
1982
- business: M.value
2057
+ business: j.value
1983
2058
  }, null, 8, ["business"])) : createCommentVNode("", !0)]),
1984
2059
  _: 1
1985
2060
  }));