@wisemen/wise-crm-web 2.0.0-alpha.40 → 2.0.0-alpha.41

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.
@@ -1,16 +1,16 @@
1
- import { defineComponent as x, openBlock as d, createBlock as g, unref as e, ref as O, useTemplateRef as ke, createElementBlock as V, withCtx as r, createVNode as o, mergeProps as A, createElementVNode as S, toDisplayString as G, nextTick as Te, computed as w, createCommentVNode as F, Fragment as le, createTextVNode as se, renderList as Fe, useModel as $e, mergeModels as Me } from "vue";
2
- import { useRouteParams as Ee } from "@vueuse/router";
1
+ import { defineComponent as x, openBlock as c, createBlock as y, unref as e, ref as V, useTemplateRef as Te, createElementBlock as O, withCtx as r, createVNode as l, mergeProps as A, createElementVNode as S, toDisplayString as G, nextTick as Fe, computed as U, createCommentVNode as $, Fragment as J, createTextVNode as se, renderList as _e, useModel as $e, mergeModels as Me } from "vue";
2
+ import { useRouteParams as Oe } from "@vueuse/router";
3
3
  import { useI18n as I } from "vue-i18n";
4
- import { br as _e, bw as Oe, by as Ve, bB as Le } from "./uuid.util-SYJY4Bt5.js";
5
- import { _ as qe } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-Cnn_HfDr.js";
6
- import { f as T, h as ge, i as Ae, j as $, k as E, u as q, l as Qe, E as ye, C as be, n as Be, o as Ke, p as Re, q as je, r as z, g as ze, J as Ge, s as Ye, t as ue, v as Ze, I as He, w as he, x as B, y as Je, z as ve, B as Xe, G as We, U as ea, H as aa, e as ta, K as na, Q as la, L as oa, N as ia, O as ra, P as ce, R as Ce, S as sa, V as de, X as ua, Y as ca, Z as da, $ as ma, a0 as Ue, a1 as fa, a2 as pa, a3 as _a, a4 as ga, a5 as ya, a6 as ba, a7 as ha, a8 as va, a9 as Ca, aa as Ua, A as wa } from "./index-BM5Kw4_U.js";
7
- import { useToast as we, useOverlay as J, UIConfirmDialog as Pa, UIIconButton as oe, UITextField as Y, toFormField as Q, UIDropdownMenu as Da, UIDropdownMenuGroup as xa, UIDropdownMenuItem as me, UIPhoneNumberField as fe, UIFormLayout as ie, UIFormFieldGroup as K, UIFormFieldGrid as R, UIFormDialog as Pe, UIDialogHeader as De, UIForm as pe, UIDialogBody as X, UIDialogFooter as W, UIDialogFooterSubmit as ee, createAutocompleteOptions as Ia, createSelectOptions as ae, UIAutocomplete as Na, UISelect as te, UIButton as Sa, UIBadge as ne } from "@wisemen/vue-core-design-system";
8
- import { useMutation as M, useQuery as xe, useOffsetInfiniteQuery as ka, useKeysetInfiniteQuery as Ta } from "@wisemen/vue-core-api-utils";
4
+ import { br as ge, bw as Ee, by as Ve, bB as Le } from "./uuid.util-SYJY4Bt5.js";
5
+ import { _ as qe } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-Xwd_IT_R.js";
6
+ import { f as T, h as ye, i as Ae, j as F, k as E, u as q, l as Be, E as be, C as he, n as Qe, o as Ke, p as Re, q as je, r as z, g as ze, J as Ge, s as Ye, t as ue, v as Ze, I as He, w as ve, x as Q, y as Je, z as Ce, B as Xe, G as We, U as ea, H as aa, e as ta, K as na, Q as la, L as oa, N as ia, O as ra, P as ce, R as Ue, S as sa, V as de, X as ua, Y as ca, Z as da, $ as ma, a0 as we, a1 as fa, a2 as pa, a3 as _a, a4 as ga, a5 as ya, a6 as ba, a7 as ha, a8 as va, a9 as Ca, aa as Ua, ab as wa, A as Pa } from "./index-DEBSTcsW.js";
7
+ import { useToast as Pe, useOverlay as X, UIConfirmDialog as Da, UIIconButton as oe, UITextField as Y, toFormField as B, UIDropdownMenu as xa, UIDropdownMenuGroup as Ia, UIDropdownMenuItem as me, UIPhoneNumberField as fe, UIFormLayout as ie, UIFormFieldGroup as K, UIFormFieldGrid as R, UIFormDialog as De, UIDialogHeader as xe, UIForm as pe, UIDialogBody as W, UIDialogFooter as ee, UIDialogFooterSubmit as ae, createAutocompleteOptions as Na, createSelectOptions as te, UIAutocomplete as Sa, UISelect as ne, UIButton as ka, UIBadge as le, UIColumnLayout as Ta, UIBadgeGroup as Fa } from "@wisemen/vue-core-design-system";
8
+ import { useMutation as M, useQuery as Ie, useOffsetInfiniteQuery as $a, useKeysetInfiniteQuery as Ma } from "@wisemen/vue-core-api-utils";
9
9
  import { useForm as Z } from "formango";
10
10
  import H, { z as N } from "zod";
11
- import { Motion as Fa } from "motion-v";
12
- import { useQueryClient as $a, useMutation as Ma } from "@tanstack/vue-query";
13
- function Ea() {
11
+ import { Motion as Oa } from "motion-v";
12
+ import { useQueryClient as Ea, useMutation as Va } from "@tanstack/vue-query";
13
+ function La() {
14
14
  return M({
15
15
  queryFn: async ({
16
16
  params: n
@@ -20,15 +20,15 @@ function Ea() {
20
20
  }
21
21
  });
22
22
  }
23
- const Oa = /* @__PURE__ */ x({
23
+ const qa = /* @__PURE__ */ x({
24
24
  __name: "DealDetailSidebarDeleteButton",
25
25
  props: {
26
26
  deal: {}
27
27
  },
28
28
  setup(n) {
29
- const a = n, t = I(), l = we(), i = ge(), c = J().create(Pa), m = Ea();
30
- function f() {
31
- c.open({
29
+ const a = n, t = I(), o = Pe(), i = ye(), s = X().create(Da), d = La();
30
+ function _() {
31
+ s.open({
32
32
  title: t.t("wise_crm.deal.detail.sidebar.delete.title"),
33
33
  isDestructive: !0,
34
34
  confirmLabel: t.t("wise_crm.shared.delete"),
@@ -36,39 +36,39 @@ const Oa = /* @__PURE__ */ x({
36
36
  name: a.deal.name
37
37
  }),
38
38
  onConfirm: async () => {
39
- const u = await m.execute({
39
+ const m = await d.execute({
40
40
  params: {
41
41
  dealUuid: a.deal.uuid
42
42
  }
43
43
  });
44
- if (u.isErr()) {
45
- l.apiError(u.error);
44
+ if (m.isErr()) {
45
+ o.apiError(m.error);
46
46
  return;
47
47
  }
48
- c.close(), i.goToReturnRoute();
48
+ s.close(), i.goToReturnRoute();
49
49
  }
50
50
  });
51
51
  }
52
- return (u, v) => (d(), g(e(oe), {
52
+ return (m, g) => (c(), y(e(oe), {
53
53
  label: e(t).t("wise_crm.deal.detail.sidebar.delete.label"),
54
54
  icon: e(Ae),
55
55
  variant: "tertiary",
56
56
  class: "shrink-0",
57
- onClick: f
57
+ onClick: _
58
58
  }, null, 8, ["label", "icon"]));
59
59
  }
60
60
  });
61
- function Va() {
62
- const n = $();
61
+ function Aa() {
62
+ const n = F();
63
63
  return M({
64
64
  queryFn: async ({
65
65
  body: a,
66
66
  params: t
67
67
  }) => {
68
- const l = await T.update(t.dealUuid, {
68
+ const o = await T.update(t.dealUuid, {
69
69
  dealLanguage: a.dealLanguage
70
70
  });
71
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), l;
71
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), o;
72
72
  },
73
73
  queryKeysToInvalidate: {
74
74
  dealDetail: {
@@ -78,17 +78,17 @@ function Va() {
78
78
  }
79
79
  });
80
80
  }
81
- function La() {
82
- const n = $();
81
+ function Ba() {
82
+ const n = F();
83
83
  return M({
84
84
  queryFn: async ({
85
85
  body: a,
86
86
  params: t
87
87
  }) => {
88
- const l = await T.update(t.dealUuid, {
88
+ const o = await T.update(t.dealUuid, {
89
89
  dealSource: a.dealSource
90
90
  });
91
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), l;
91
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), o;
92
92
  },
93
93
  queryKeysToInvalidate: {
94
94
  dealDetail: {
@@ -98,17 +98,17 @@ function La() {
98
98
  }
99
99
  });
100
100
  }
101
- function qa() {
102
- const n = $();
101
+ function Qa() {
102
+ const n = F();
103
103
  return M({
104
104
  queryFn: async ({
105
105
  body: a,
106
106
  params: t
107
107
  }) => {
108
- const l = await T.update(t.dealUuid, {
108
+ const o = await T.update(t.dealUuid, {
109
109
  dealOwner: a.dealOwner
110
110
  });
111
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), l;
111
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), o;
112
112
  },
113
113
  queryKeysToInvalidate: {
114
114
  dealDetail: {
@@ -118,17 +118,17 @@ function qa() {
118
118
  }
119
119
  });
120
120
  }
121
- function Aa() {
122
- const n = $();
121
+ function Ka() {
122
+ const n = F();
123
123
  return M({
124
124
  queryFn: async ({
125
125
  body: a,
126
126
  params: t
127
127
  }) => {
128
- const l = await T.update(t.dealUuid, {
128
+ const o = await T.update(t.dealUuid, {
129
129
  name: a.name
130
130
  });
131
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), l;
131
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.DETAILS), o;
132
132
  },
133
133
  queryKeysToInvalidate: {
134
134
  dealDetail: {
@@ -138,102 +138,102 @@ function Aa() {
138
138
  }
139
139
  });
140
140
  }
141
- const Qa = {
141
+ const Ra = {
142
142
  key: 1,
143
143
  class: "flex justify-between"
144
- }, Ba = { class: "text-xl font-bold text-primary" }, Ka = /* @__PURE__ */ x({
144
+ }, ja = { class: "text-xl font-bold text-primary" }, za = /* @__PURE__ */ x({
145
145
  __name: "DealDetailSidebarNameField",
146
146
  props: {
147
147
  deal: {}
148
148
  },
149
149
  setup(n) {
150
- const a = n, t = I(), l = q(), i = O(!1), s = ke("nameFieldContainerRef"), c = Aa(), m = Z({
150
+ const a = n, t = I(), o = q(), i = V(!1), u = Te("nameFieldContainerRef"), s = Ka(), d = Z({
151
151
  schema: H.object({
152
152
  name: H.string().min(1)
153
153
  }),
154
- onSubmit: async (_) => {
154
+ onSubmit: async (b) => {
155
155
  try {
156
- await c.execute({
156
+ await s.execute({
157
157
  body: {
158
- name: _.name
158
+ name: b.name
159
159
  },
160
160
  params: {
161
161
  dealUuid: a.deal.uuid
162
162
  }
163
163
  });
164
- } catch (b) {
165
- l.show(b);
164
+ } catch (h) {
165
+ o.show(h);
166
166
  } finally {
167
167
  i.value = !1;
168
168
  }
169
169
  }
170
- }), f = m.register("name", a.deal.name);
171
- async function u() {
172
- i.value = !0, await Te(), v();
170
+ }), _ = d.register("name", a.deal.name);
171
+ async function m() {
172
+ i.value = !0, await Fe(), g();
173
173
  }
174
- function v() {
175
- s.value?.querySelector(
174
+ function g() {
175
+ u.value?.querySelector(
176
176
  "input"
177
177
  )?.focus();
178
178
  }
179
- function y() {
180
- if (!m.isDirty.value) {
179
+ function f() {
180
+ if (!d.isDirty.value) {
181
181
  i.value = !1;
182
182
  return;
183
183
  }
184
- m.submit();
184
+ d.submit();
185
185
  }
186
- return (_, b) => (d(), V("div", {
186
+ return (b, h) => (c(), O("div", {
187
187
  ref_key: "nameFieldContainerRef",
188
- ref: s
188
+ ref: u
189
189
  }, [
190
- i.value ? (d(), g(Qe, {
190
+ i.value ? (c(), y(Be, {
191
191
  key: 0,
192
- form: e(m)
192
+ form: e(d)
193
193
  }, {
194
194
  default: r(() => [
195
- o(e(Y), A(e(Q)(e(f)), {
196
- "is-loading": e(m).isSubmitting.value,
195
+ l(e(Y), A(e(B)(e(_)), {
196
+ "is-loading": e(d).isSubmitting.value,
197
197
  label: e(t).t("wise_crm.deal.detail.sidebar.name_field.label"),
198
198
  class: "[&_input]:text-xl [&_input]:font-bold",
199
- onBlur: y
199
+ onBlur: f
200
200
  }), null, 16, ["is-loading", "label"]),
201
- b[0] || (b[0] = S("button", {
201
+ h[0] || (h[0] = S("button", {
202
202
  type: "submit",
203
203
  class: "sr-only"
204
204
  }, null, -1))
205
205
  ]),
206
206
  _: 1
207
- }, 8, ["form"])) : (d(), V("div", Qa, [
208
- S("h2", Ba, G(a.deal.name), 1),
209
- o(e(oe), {
207
+ }, 8, ["form"])) : (c(), O("div", Ra, [
208
+ S("h2", ja, G(a.deal.name), 1),
209
+ l(e(oe), {
210
210
  label: e(t).t("wise_crm.deal.detail.sidebar.name_field.edit_label"),
211
- icon: e(ye),
211
+ icon: e(be),
212
212
  variant: "tertiary",
213
213
  class: "shrink-0",
214
- onClick: u
214
+ onClick: m
215
215
  }, null, 8, ["label", "icon"])
216
216
  ]))
217
217
  ], 512));
218
218
  }
219
219
  });
220
- function Ra() {
221
- const n = $a(), a = $(), t = "dealDetail", l = Ma({
220
+ function Ga() {
221
+ const n = Ea(), a = F(), t = "dealDetail", o = Va({
222
222
  mutationFn: async (i) => {
223
- const s = await T.setPrimaryContactPerson(i.dealUuid, i.contactPersonUuid);
224
- if (s.isErr())
225
- throw s.error;
223
+ const u = await T.setPrimaryContactPerson(i.dealUuid, i.contactPersonUuid);
224
+ if (u.isErr())
225
+ throw u.error;
226
226
  a.notifyDealChanged(i.dealUuid, E.CONTACT_PERSON);
227
227
  },
228
- onError: (i, s, c) => {
228
+ onError: (i, u, s) => {
229
229
  n.setQueryData(
230
230
  [
231
231
  t,
232
232
  {
233
- dealUuid: s.dealUuid
233
+ dealUuid: u.dealUuid
234
234
  }
235
235
  ],
236
- c?.previousData
236
+ s?.previousData
237
237
  );
238
238
  },
239
239
  onMutate: async (i) => {
@@ -245,7 +245,7 @@ function Ra() {
245
245
  }
246
246
  ]
247
247
  });
248
- const s = n.getQueryData(
248
+ const u = n.getQueryData(
249
249
  [
250
250
  t,
251
251
  {
@@ -253,50 +253,50 @@ function Ra() {
253
253
  }
254
254
  ]
255
255
  );
256
- return s === void 0 ? {} : (n.setQueryData(
256
+ return u === void 0 ? {} : (n.setQueryData(
257
257
  [
258
258
  t,
259
259
  {
260
260
  dealUuid: i.dealUuid
261
261
  }
262
262
  ],
263
- s.map((c) => ({
264
- ...c,
265
- contactPersons: c.contactPersons.map((m) => ({
266
- ...m,
267
- isPrimary: m.uuid === i.contactPersonUuid
263
+ u.map((s) => ({
264
+ ...s,
265
+ contactPersons: s.contactPersons.map((d) => ({
266
+ ...d,
267
+ isPrimary: d.uuid === i.contactPersonUuid
268
268
  }))
269
269
  }))
270
270
  ), {
271
- previousData: s
271
+ previousData: u
272
272
  });
273
273
  },
274
- onSettled: (i, s, c) => {
275
- c !== void 0 && n.invalidateQueries({
274
+ onSettled: (i, u, s) => {
275
+ s !== void 0 && n.invalidateQueries({
276
276
  queryKey: [
277
277
  t,
278
278
  {
279
- dealUuid: c.dealUuid
279
+ dealUuid: s.dealUuid
280
280
  }
281
281
  ]
282
282
  });
283
283
  }
284
284
  });
285
285
  return {
286
- isLoading: w(() => l.isPending.value),
287
- data: w(() => l.data.value),
288
- execute: async (i) => await l.mutateAsync(i.params)
286
+ isLoading: U(() => o.isPending.value),
287
+ data: U(() => o.data.value),
288
+ execute: async (i) => await o.mutateAsync(i.params)
289
289
  };
290
290
  }
291
- function ja() {
292
- const n = $();
291
+ function Ya() {
292
+ const n = F();
293
293
  return M({
294
294
  queryFn: async ({
295
295
  body: a,
296
296
  params: t
297
297
  }) => {
298
- const l = await T.unlinkContactPerson(t.dealUuid, a.contactPersonUuid);
299
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), l;
298
+ const o = await T.unlinkContactPerson(t.dealUuid, a.contactPersonUuid);
299
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), o;
300
300
  },
301
301
  queryKeysToInvalidate: {
302
302
  dealDetail: {
@@ -306,10 +306,10 @@ function ja() {
306
306
  }
307
307
  });
308
308
  }
309
- const za = { class: "flex items-start justify-between" }, Ga = { class: "flex flex-col items-start" }, Ya = {
309
+ const Za = { class: "flex items-start justify-between" }, Ha = { class: "flex flex-col items-start" }, Ja = {
310
310
  key: 1,
311
311
  class: "mt-sm text-brand-700"
312
- }, Za = { class: "-mt-2 -mr-2 flex items-center justify-end" }, Ha = { class: "grid gap-lg" }, Ja = /* @__PURE__ */ x({
312
+ }, Xa = { class: "-mt-2 -mr-2 flex items-center justify-end" }, Wa = { class: "grid gap-lg" }, et = /* @__PURE__ */ x({
313
313
  __name: "CrmDetailSidebarAccordionGenericContactPersonInfo",
314
314
  props: {
315
315
  contactPerson: {},
@@ -318,47 +318,47 @@ const za = { class: "flex items-start justify-between" }, Ga = { class: "flex fl
318
318
  },
319
319
  emits: ["delete", "update"],
320
320
  setup(n, { emit: a }) {
321
- const t = n, l = a, i = I(), s = t.contactPerson.uuid ?? t.contactPerson.contactPersonUuid, c = {
321
+ const t = n, o = a, i = I(), u = t.contactPerson.uuid ?? t.contactPerson.contactPersonUuid, s = {
322
322
  left: {
323
- icon: ye,
323
+ icon: be,
324
324
  type: "icon"
325
325
  }
326
- }, m = {
326
+ }, d = {
327
327
  left: {
328
328
  icon: Re,
329
329
  type: "icon"
330
330
  }
331
331
  };
332
- function f() {
333
- l("update");
332
+ function _() {
333
+ o("update");
334
334
  }
335
- function u() {
336
- l("delete");
335
+ function m() {
336
+ o("delete");
337
337
  }
338
- function v() {
338
+ function g() {
339
339
  t.onToggleIsPrimary();
340
340
  }
341
- return (y, _) => (d(), g(be, { class: "flex flex-col gap-lg" }, {
341
+ return (f, b) => (c(), y(he, { class: "flex flex-col gap-lg" }, {
342
342
  default: r(() => [
343
- S("div", za, [
344
- S("div", Ga, [
345
- e(s) ? (d(), g(Be, {
343
+ S("div", Za, [
344
+ S("div", Ha, [
345
+ e(u) ? (c(), y(Qe, {
346
346
  key: 0,
347
347
  label: `${t.contactPerson.firstName} ${t.contactPerson.lastName}`,
348
- "entity-type": e(_e).INDIVIDUAL,
349
- uuid: e(s),
348
+ "entity-type": e(ge).INDIVIDUAL,
349
+ uuid: e(u),
350
350
  class: "-m-xs"
351
- }, null, 8, ["label", "entity-type", "uuid"])) : F("", !0),
352
- t.description ? (d(), V("p", Ya, G(t.description), 1)) : F("", !0)
351
+ }, null, 8, ["label", "entity-type", "uuid"])) : $("", !0),
352
+ t.description ? (c(), O("p", Ja, G(t.description), 1)) : $("", !0)
353
353
  ]),
354
- S("div", Za, [
355
- o(Ke, {
354
+ S("div", Xa, [
355
+ l(Ke, {
356
356
  "is-active": t.contactPerson.isPrimary,
357
- onClick: v
357
+ onClick: g
358
358
  }, null, 8, ["is-active"]),
359
- o(e(Da), { "popover-align": "end" }, {
359
+ l(e(xa), { "popover-align": "end" }, {
360
360
  trigger: r(() => [
361
- o(e(oe), {
361
+ l(e(oe), {
362
362
  icon: e(je),
363
363
  variant: "tertiary",
364
364
  size: "sm",
@@ -366,18 +366,18 @@ const za = { class: "flex items-start justify-between" }, Ga = { class: "flex fl
366
366
  }, null, 8, ["icon"])
367
367
  ]),
368
368
  content: r(() => [
369
- o(e(xa), null, {
369
+ l(e(Ia), null, {
370
370
  default: r(() => [
371
- o(e(me), {
372
- config: c,
371
+ l(e(me), {
372
+ config: s,
373
373
  label: e(i).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
374
- onSelect: f
374
+ onSelect: _
375
375
  }, null, 8, ["label"]),
376
- o(e(me), {
376
+ l(e(me), {
377
377
  "is-destructive": !0,
378
- config: m,
378
+ config: d,
379
379
  label: e(i).t("wise_crm.info_dialog.sidebar.overview.delete_contact_person"),
380
- onSelect: u
380
+ onSelect: m
381
381
  }, null, 8, ["label"])
382
382
  ]),
383
383
  _: 1
@@ -387,41 +387,41 @@ const za = { class: "flex items-start justify-between" }, Ga = { class: "flex fl
387
387
  })
388
388
  ])
389
389
  ]),
390
- S("div", Ha, [
391
- t.contactPerson.email !== null ? (d(), g(z, {
390
+ S("div", Wa, [
391
+ t.contactPerson.email !== null ? (c(), y(z, {
392
392
  key: 0,
393
393
  label: t.contactPerson.email,
394
394
  icon: e(ze)
395
- }, null, 8, ["label", "icon"])) : F("", !0),
396
- t.contactPerson.mobilePhone !== null ? (d(), g(z, {
395
+ }, null, 8, ["label", "icon"])) : $("", !0),
396
+ t.contactPerson.mobilePhone !== null ? (c(), y(z, {
397
397
  key: 1,
398
398
  label: t.contactPerson.mobilePhone,
399
399
  icon: e(Ge)
400
- }, null, 8, ["label", "icon"])) : F("", !0),
401
- t.contactPerson.phone !== null ? (d(), g(z, {
400
+ }, null, 8, ["label", "icon"])) : $("", !0),
401
+ t.contactPerson.phone !== null ? (c(), y(z, {
402
402
  key: 2,
403
403
  label: t.contactPerson.phone,
404
404
  icon: e(Ye)
405
- }, null, 8, ["label", "icon"])) : F("", !0)
405
+ }, null, 8, ["label", "icon"])) : $("", !0)
406
406
  ])
407
407
  ]),
408
408
  _: 1
409
409
  }));
410
410
  }
411
411
  });
412
- function Xa() {
413
- const n = $();
412
+ function at() {
413
+ const n = F();
414
414
  return M({
415
415
  queryFn: async ({
416
416
  body: a,
417
417
  params: t
418
418
  }) => {
419
- const l = await T.linkContactPerson(
419
+ const o = await T.linkContactPerson(
420
420
  t.dealUuid,
421
421
  a.contactPersonUuid,
422
422
  a.contactInfo
423
423
  );
424
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), l;
424
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), o;
425
425
  },
426
426
  queryKeysToInvalidate: {
427
427
  dealDetail: {
@@ -440,81 +440,81 @@ const re = /* @__PURE__ */ x({
440
440
  },
441
441
  setup(n) {
442
442
  const a = n, t = I();
443
- return (l, i) => (d(), V(le, null, [
444
- o(e(Y), A(e(Q)(a.email), {
443
+ return (o, i) => (c(), O(J, null, [
444
+ l(e(Y), A(e(B)(a.email), {
445
445
  label: e(t).t("wise_crm.contact.create_dialog.form.fields.email"),
446
446
  placeholder: e(t).t("wise_crm.contact.create_dialog.form.fields.email"),
447
447
  class: "col-span-2"
448
448
  }), null, 16, ["label", "placeholder"]),
449
- o(ue, { class: "col-span-2" }, {
449
+ l(ue, { class: "col-span-2" }, {
450
450
  default: r(() => [
451
451
  se(G(e(t).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
452
452
  ]),
453
453
  _: 1
454
454
  }),
455
- o(e(fe), A(e(Q)(a.mobilePhone), {
455
+ l(e(fe), A(e(B)(a.mobilePhone), {
456
456
  label: e(t).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
457
457
  placeholder: e(t).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
458
458
  class: "col-span-2"
459
459
  }), null, 16, ["label", "placeholder"]),
460
- o(ue, { class: "col-span-2" }, {
460
+ l(ue, { class: "col-span-2" }, {
461
461
  default: r(() => [
462
462
  se(G(e(t).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
463
463
  ]),
464
464
  _: 1
465
465
  }),
466
- o(e(fe), A(e(Q)(a.phone), {
466
+ l(e(fe), A(e(B)(a.phone), {
467
467
  label: e(t).t("wise_crm.contact.create_dialog.form.fields.phone"),
468
468
  placeholder: e(t).t("wise_crm.contact.create_dialog.form.fields.phone"),
469
469
  class: "col-span-2"
470
470
  }), null, 16, ["label", "placeholder"])
471
471
  ], 64));
472
472
  }
473
- }), Wa = /* @__PURE__ */ x({
473
+ }), tt = /* @__PURE__ */ x({
474
474
  __name: "DealContactPersonCreateExistingForm",
475
475
  props: {
476
476
  form: {}
477
477
  },
478
478
  emits: ["createNewContactPerson"],
479
479
  setup(n, { emit: a }) {
480
- const t = n, l = a, i = I(), s = t.form.register("email"), c = t.form.register("phone"), m = t.form.register("mobile"), f = t.form.register("existingContactPerson"), u = O(null);
481
- async function v(y) {
482
- if (u.value = y, f.setValue(y?.uuid ?? null), y === null)
480
+ const t = n, o = a, i = I(), u = t.form.register("email"), s = t.form.register("phone"), d = t.form.register("mobile"), _ = t.form.register("existingContactPerson"), m = V(null);
481
+ async function g(f) {
482
+ if (m.value = f, _.setValue(f?.uuid ?? null), f === null)
483
483
  return;
484
- const _ = await He.getByUuid(y.uuid);
485
- if (_.isErr())
484
+ const b = await He.getByUuid(f.uuid);
485
+ if (b.isErr())
486
486
  return;
487
- const b = _.value;
488
- s.setValue(b.email), c.setValue(b.phone), m.setValue(b.mobilePhone);
487
+ const h = b.value;
488
+ u.setValue(h.email), s.setValue(h.phone), d.setValue(h.mobilePhone);
489
489
  }
490
- return (y, _) => (d(), g(e(ie), null, {
490
+ return (f, b) => (c(), y(e(ie), null, {
491
491
  default: r(() => [
492
- o(e(K), null, {
492
+ l(e(K), null, {
493
493
  default: r(() => [
494
- o(Ze, {
495
- modelValue: u.value,
494
+ l(Ze, {
495
+ modelValue: m.value,
496
496
  "onUpdate:modelValue": [
497
- _[0] || (_[0] = (b) => u.value = b),
498
- v
497
+ b[0] || (b[0] = (h) => m.value = h),
498
+ g
499
499
  ],
500
500
  label: e(i).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
501
- onCreateNew: _[1] || (_[1] = (b) => l("createNewContactPerson"))
501
+ onCreateNew: b[1] || (b[1] = (h) => o("createNewContactPerson"))
502
502
  }, null, 8, ["modelValue", "label"])
503
503
  ]),
504
504
  _: 1
505
505
  }),
506
- o(e(K), null, {
506
+ l(e(K), null, {
507
507
  default: r(() => [
508
- o(e(R), {
508
+ l(e(R), {
509
509
  sm: 1,
510
510
  lg: 1,
511
511
  variant: "card"
512
512
  }, {
513
513
  default: r(() => [
514
- o(re, {
515
- email: e(s),
516
- "mobile-phone": e(m),
517
- phone: e(c)
514
+ l(re, {
515
+ email: e(u),
516
+ "mobile-phone": e(d),
517
+ phone: e(s)
518
518
  }, null, 8, ["email", "mobile-phone", "phone"])
519
519
  ]),
520
520
  _: 1
@@ -526,7 +526,7 @@ const re = /* @__PURE__ */ x({
526
526
  _: 1
527
527
  }));
528
528
  }
529
- }), Ie = /* @__PURE__ */ x({
529
+ }), Ne = /* @__PURE__ */ x({
530
530
  __name: "ContactPersonFormNameField",
531
531
  props: {
532
532
  firstName: {},
@@ -534,36 +534,36 @@ const re = /* @__PURE__ */ x({
534
534
  },
535
535
  setup(n) {
536
536
  const a = n, t = I();
537
- return (l, i) => (d(), V(le, null, [
538
- o(e(Y), A(e(Q)(a.firstName), {
537
+ return (o, i) => (c(), O(J, null, [
538
+ l(e(Y), A(e(B)(a.firstName), {
539
539
  label: e(t).t("wise_crm.contact.create_dialog.form.fields.first_name"),
540
540
  placeholder: e(t).t("wise_crm.contact.create_dialog.form.fields.first_name")
541
541
  }), null, 16, ["label", "placeholder"]),
542
- o(e(Y), A(e(Q)(a.lastName), {
542
+ l(e(Y), A(e(B)(a.lastName), {
543
543
  label: e(t).t("wise_crm.contact.create_dialog.form.fields.last_name"),
544
544
  placeholder: e(t).t("wise_crm.contact.create_dialog.form.fields.last_name")
545
545
  }), null, 16, ["label", "placeholder"])
546
546
  ], 64));
547
547
  }
548
- }), et = /* @__PURE__ */ x({
548
+ }), nt = /* @__PURE__ */ x({
549
549
  __name: "DealContactPersonCreateNewForm",
550
550
  props: {
551
551
  form: {}
552
552
  },
553
553
  setup(n) {
554
- const a = n, t = a.form.register("firstName"), l = a.form.register("lastName"), i = a.form.register("email"), s = a.form.register("mobilePhone"), c = a.form.register("phone");
555
- return (m, f) => (d(), g(e(ie), null, {
554
+ const a = n, t = a.form.register("firstName"), o = a.form.register("lastName"), i = a.form.register("email"), u = a.form.register("mobilePhone"), s = a.form.register("phone");
555
+ return (d, _) => (c(), y(e(ie), null, {
556
556
  default: r(() => [
557
- o(e(K), null, {
557
+ l(e(K), null, {
558
558
  default: r(() => [
559
- o(e(R), {
559
+ l(e(R), {
560
560
  sm: 1,
561
561
  lg: 2
562
562
  }, {
563
563
  default: r(() => [
564
- o(Ie, {
564
+ l(Ne, {
565
565
  "first-name": e(t),
566
- "last-name": e(l)
566
+ "last-name": e(o)
567
567
  }, null, 8, ["first-name", "last-name"])
568
568
  ]),
569
569
  _: 1
@@ -571,23 +571,23 @@ const re = /* @__PURE__ */ x({
571
571
  ]),
572
572
  _: 1
573
573
  }),
574
- o(e(K), null, {
574
+ l(e(K), null, {
575
575
  default: r(() => [
576
- o(e(R), {
576
+ l(e(R), {
577
577
  sm: 1,
578
578
  lg: 1,
579
579
  variant: "card"
580
580
  }, {
581
581
  default: r(() => [
582
- o(re, {
582
+ l(re, {
583
583
  email: e(i),
584
- "mobile-phone": e(s),
585
- phone: e(c)
584
+ "mobile-phone": e(u),
585
+ phone: e(s)
586
586
  }, null, 8, ["email", "mobile-phone", "phone"])
587
587
  ]),
588
588
  _: 1
589
589
  }),
590
- o(he, {
590
+ l(ve, {
591
591
  form: a.form
592
592
  }, null, 8, ["form"])
593
593
  ]),
@@ -597,23 +597,23 @@ const re = /* @__PURE__ */ x({
597
597
  _: 1
598
598
  }));
599
599
  }
600
- }), at = H.object({
600
+ }), lt = H.object({
601
601
  email: H.email().nullable(),
602
602
  existingContactPerson: Je.nullable(),
603
- mobile: B.nullable(),
604
- phone: B.nullable()
605
- }), tt = N.object({
603
+ mobile: Q.nullable(),
604
+ phone: Q.nullable()
605
+ }), ot = N.object({
606
606
  email: N.literal("").or(N.email()).nullable(),
607
607
  firstName: N.string().min(1),
608
608
  lastName: N.string().min(1),
609
- mobilePhone: B.nullable(),
610
- phone: B.nullable()
609
+ mobilePhone: Q.nullable(),
610
+ phone: Q.nullable()
611
611
  }).superRefine((n, a) => {
612
612
  n.email !== null && n.email !== "" || n.mobilePhone !== null && n.mobilePhone !== "" || n.phone !== null && n.phone !== "" || a.addIssue({
613
613
  code: N.ZodIssueCode.custom,
614
- message: ve.global.t("wise_crm.form.errors.at_least_one")
614
+ message: Ce.global.t("wise_crm.form.errors.at_least_one")
615
615
  });
616
- }), nt = /* @__PURE__ */ x({
616
+ }), it = /* @__PURE__ */ x({
617
617
  __name: "DealContactPersonCreateDialog",
618
618
  props: {
619
619
  dealUuid: {},
@@ -621,11 +621,11 @@ const re = /* @__PURE__ */ x({
621
621
  },
622
622
  emits: ["close", "createNewContactPerson"],
623
623
  setup(n, { emit: a }) {
624
- const t = n, l = a, i = I(), s = q(), c = we(), m = Xa(), f = Xe(), u = O(t.isCreatingNewContactPerson), v = Z({
625
- schema: tt,
624
+ const t = n, o = a, i = I(), u = q(), s = Pe(), d = at(), _ = Xe(), m = V(t.isCreatingNewContactPerson), g = Z({
625
+ schema: ot,
626
626
  onSubmit: async (p) => {
627
627
  try {
628
- const C = await f.execute({
628
+ const C = await _.execute({
629
629
  body: {
630
630
  email: p.email,
631
631
  firstName: p.firstName,
@@ -635,12 +635,12 @@ const re = /* @__PURE__ */ x({
635
635
  }
636
636
  });
637
637
  if (C.isErr()) {
638
- s.show(C.error);
638
+ u.show(C.error);
639
639
  return;
640
640
  }
641
641
  const k = C.value;
642
642
  if (!t.isCreatingNewContactPerson) {
643
- const j = await m.execute({
643
+ const j = await d.execute({
644
644
  body: {
645
645
  contactPersonUuid: k,
646
646
  contactInfo: {
@@ -654,23 +654,23 @@ const re = /* @__PURE__ */ x({
654
654
  }
655
655
  });
656
656
  if (j.isErr()) {
657
- s.show(j.error);
657
+ u.show(j.error);
658
658
  return;
659
659
  }
660
660
  }
661
- h({
661
+ v({
662
662
  label: `${p.firstName} ${p.lastName}`,
663
663
  value: k
664
664
  });
665
665
  } catch (C) {
666
- s.show(C);
666
+ u.show(C);
667
667
  }
668
668
  },
669
669
  onSubmitError: () => {
670
- c.unableToSave();
670
+ s.unableToSave();
671
671
  }
672
- }), y = Z({
673
- schema: at,
672
+ }), f = Z({
673
+ schema: lt,
674
674
  onSubmit: async (p) => {
675
675
  await P(
676
676
  p.existingContactPerson,
@@ -682,18 +682,18 @@ const re = /* @__PURE__ */ x({
682
682
  );
683
683
  },
684
684
  onSubmitError: () => {
685
- c.unableToSave();
685
+ s.unableToSave();
686
686
  }
687
- }), _ = w(
688
- () => u.value ? v : y
687
+ }), b = U(
688
+ () => m.value ? g : f
689
689
  );
690
- function b() {
691
- u.value = !0;
690
+ function h() {
691
+ m.value = !0;
692
692
  }
693
693
  async function P(p, C) {
694
694
  if (p !== null)
695
695
  try {
696
- await m.execute({
696
+ await d.execute({
697
697
  body: {
698
698
  contactPersonUuid: p,
699
699
  contactInfo: C
@@ -701,45 +701,45 @@ const re = /* @__PURE__ */ x({
701
701
  params: {
702
702
  dealUuid: t.dealUuid
703
703
  }
704
- }), h();
704
+ }), v();
705
705
  } catch (k) {
706
- s.show(k);
706
+ u.show(k);
707
707
  }
708
708
  }
709
- function h(p) {
709
+ function v(p) {
710
710
  if (p === void 0) {
711
- l("close");
711
+ o("close");
712
712
  return;
713
713
  }
714
- l("createNewContactPerson", p), l("close");
714
+ o("createNewContactPerson", p), o("close");
715
715
  }
716
- return (p, C) => (d(), g(e(Pe), {
717
- form: _.value,
716
+ return (p, C) => (c(), y(e(De), {
717
+ form: b.value,
718
718
  size: "md",
719
719
  "render-own-form-component": "",
720
- onClose: h
720
+ onClose: v
721
721
  }, {
722
722
  default: r(() => [
723
- o(e(De), {
723
+ l(e(xe), {
724
724
  title: e(i).t("wise_crm.info_dialog.contact_person_create.title"),
725
725
  description: e(i).t("wise_crm.info_dialog.contact_person_create.description")
726
726
  }, null, 8, ["title", "description"]),
727
- u.value ? (d(), g(e(pe), {
727
+ m.value ? (c(), y(e(pe), {
728
728
  key: 0,
729
- form: e(v),
729
+ form: e(g),
730
730
  "prompt-on-unsaved-changes": !1
731
731
  }, {
732
732
  default: r(() => [
733
- o(e(X), null, {
733
+ l(e(W), null, {
734
734
  default: r(() => [
735
- o(et, { form: e(v) }, null, 8, ["form"])
735
+ l(nt, { form: e(g) }, null, 8, ["form"])
736
736
  ]),
737
737
  _: 1
738
738
  }),
739
- o(e(W), null, {
739
+ l(e(ee), null, {
740
740
  right: r(() => [
741
- o(e(ee), {
742
- "is-loading": e(v).isSubmitting.value,
741
+ l(e(ae), {
742
+ "is-loading": e(g).isSubmitting.value,
743
743
  label: e(i).t("wise_crm.shared.create")
744
744
  }, null, 8, ["is-loading", "label"])
745
745
  ]),
@@ -747,25 +747,25 @@ const re = /* @__PURE__ */ x({
747
747
  })
748
748
  ]),
749
749
  _: 1
750
- }, 8, ["form"])) : (d(), g(e(pe), {
750
+ }, 8, ["form"])) : (c(), y(e(pe), {
751
751
  key: 1,
752
- form: e(y),
752
+ form: e(f),
753
753
  "prompt-on-unsaved-changes": !1
754
754
  }, {
755
755
  default: r(() => [
756
- o(e(X), null, {
756
+ l(e(W), null, {
757
757
  default: r(() => [
758
- o(Wa, {
759
- form: e(y),
760
- onCreateNewContactPerson: b
758
+ l(tt, {
759
+ form: e(f),
760
+ onCreateNewContactPerson: h
761
761
  }, null, 8, ["form"])
762
762
  ]),
763
763
  _: 1
764
764
  }),
765
- o(e(W), null, {
765
+ l(e(ee), null, {
766
766
  right: r(() => [
767
- o(e(ee), {
768
- "is-loading": e(y).isSubmitting.value,
767
+ l(e(ae), {
768
+ "is-loading": e(f).isSubmitting.value,
769
769
  label: e(i).t("wise_crm.shared.create")
770
770
  }, null, 8, ["is-loading", "label"])
771
771
  ]),
@@ -779,15 +779,15 @@ const re = /* @__PURE__ */ x({
779
779
  }, 8, ["form"]));
780
780
  }
781
781
  });
782
- function lt() {
783
- const n = $();
782
+ function rt() {
783
+ const n = F();
784
784
  return M({
785
785
  queryFn: async ({
786
786
  body: a,
787
787
  params: t
788
788
  }) => {
789
- const l = await T.updateContactPerson(t.dealUuid, t.contactPersonUuid, a.form);
790
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), l;
789
+ const o = await T.updateContactPerson(t.dealUuid, t.contactPersonUuid, a.form);
790
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.CONTACT_PERSON), o;
791
791
  },
792
792
  queryKeysToInvalidate: {
793
793
  dealContactPersonDetail: {
@@ -801,8 +801,8 @@ function lt() {
801
801
  }
802
802
  });
803
803
  }
804
- function ot(n, a) {
805
- return xe("dealContactPersonDetail", {
804
+ function st(n, a) {
805
+ return Ie("dealContactPersonDetail", {
806
806
  params: {
807
807
  contactPersonUuid: a,
808
808
  dealUuid: n
@@ -810,18 +810,18 @@ function ot(n, a) {
810
810
  queryFn: () => T.getContactPerson(n.value, a.value)
811
811
  });
812
812
  }
813
- const it = N.object({
813
+ const ut = N.object({
814
814
  email: N.literal("").or(N.email()).nullable(),
815
815
  firstName: N.string().min(1),
816
816
  lastName: N.string().min(1),
817
- mobilePhone: B.nullable(),
818
- phone: B.nullable()
817
+ mobilePhone: Q.nullable(),
818
+ phone: Q.nullable()
819
819
  }).superRefine((n, a) => {
820
820
  n.email !== null && n.email !== "" || n.mobilePhone !== null && n.mobilePhone !== "" || n.phone !== null && n.phone !== "" || a.addIssue({
821
821
  code: N.ZodIssueCode.custom,
822
- message: ve.global.t("wise_crm.form.errors.at_least_one")
822
+ message: Ce.global.t("wise_crm.form.errors.at_least_one")
823
823
  });
824
- }), rt = /* @__PURE__ */ x({
824
+ }), ct = /* @__PURE__ */ x({
825
825
  __name: "DealContactPersonUpdateDialog",
826
826
  props: {
827
827
  contactPersonUuid: {},
@@ -829,25 +829,25 @@ const it = N.object({
829
829
  },
830
830
  emits: ["close"],
831
831
  setup(n, { emit: a }) {
832
- const t = n, l = a, i = I(), s = q(), c = lt(), m = ot(
833
- w(() => t.dealUuid),
834
- w(() => t.contactPersonUuid)
835
- ), f = w(() => m.result.value.isOk() ? m.result.value.getValue() : null), u = Z({
836
- initialState: w(() => f.value === null ? null : {
837
- email: f.value.email,
838
- firstName: f.value.firstName,
839
- lastName: f.value.lastName,
840
- mobilePhone: f.value.mobilePhone,
841
- phone: f.value.phone
832
+ const t = n, o = a, i = I(), u = q(), s = rt(), d = st(
833
+ U(() => t.dealUuid),
834
+ U(() => t.contactPersonUuid)
835
+ ), _ = U(() => d.result.value.isOk() ? d.result.value.getValue() : null), m = Z({
836
+ initialState: U(() => _.value === null ? null : {
837
+ email: _.value.email,
838
+ firstName: _.value.firstName,
839
+ lastName: _.value.lastName,
840
+ mobilePhone: _.value.mobilePhone,
841
+ phone: _.value.phone
842
842
  }),
843
- schema: it,
843
+ schema: ut,
844
844
  onSubmit: async (C) => {
845
- await h(C);
845
+ await v(C);
846
846
  }
847
- }), v = u.register("firstName"), y = u.register("lastName"), _ = u.register("email"), b = u.register("mobilePhone"), P = u.register("phone");
848
- async function h(C) {
847
+ }), g = m.register("firstName"), f = m.register("lastName"), b = m.register("email"), h = m.register("mobilePhone"), P = m.register("phone");
848
+ async function v(C) {
849
849
  try {
850
- await c.execute({
850
+ await s.execute({
851
851
  body: {
852
852
  form: C
853
853
  },
@@ -855,38 +855,38 @@ const it = N.object({
855
855
  contactPersonUuid: t.contactPersonUuid,
856
856
  dealUuid: t.dealUuid
857
857
  }
858
- }), l("close");
858
+ }), o("close");
859
859
  } catch (k) {
860
- s.show(k);
860
+ u.show(k);
861
861
  }
862
862
  }
863
863
  function p() {
864
- l("close");
864
+ o("close");
865
865
  }
866
- return (C, k) => (d(), g(e(Pe), {
867
- form: e(u),
866
+ return (C, k) => (c(), y(e(De), {
867
+ form: e(m),
868
868
  size: "md",
869
869
  onClose: p
870
870
  }, {
871
871
  default: r(() => [
872
- o(e(De), {
872
+ l(e(xe), {
873
873
  title: e(i).t("wise_crm.info_dialog.contact_person_update.title"),
874
874
  description: e(i).t("wise_crm.info_dialog.contact_person_create.description")
875
875
  }, null, 8, ["title", "description"]),
876
- f.value !== null ? (d(), g(e(X), { key: 0 }, {
876
+ _.value !== null ? (c(), y(e(W), { key: 0 }, {
877
877
  default: r(() => [
878
- o(e(ie), null, {
878
+ l(e(ie), null, {
879
879
  default: r(() => [
880
- o(e(K), null, {
880
+ l(e(K), null, {
881
881
  default: r(() => [
882
- o(e(R), {
882
+ l(e(R), {
883
883
  sm: 1,
884
884
  lg: 2
885
885
  }, {
886
886
  default: r(() => [
887
- o(Ie, {
888
- "first-name": e(v),
889
- "last-name": e(y)
887
+ l(Ne, {
888
+ "first-name": e(g),
889
+ "last-name": e(f)
890
890
  }, null, 8, ["first-name", "last-name"])
891
891
  ]),
892
892
  _: 1
@@ -894,25 +894,25 @@ const it = N.object({
894
894
  ]),
895
895
  _: 1
896
896
  }),
897
- o(We, {
897
+ l(We, {
898
898
  title: e(i).t("wise_crm.shared.contact_info")
899
899
  }, {
900
900
  default: r(() => [
901
- o(e(R), {
901
+ l(e(R), {
902
902
  sm: 1,
903
903
  lg: 1,
904
904
  variant: "card"
905
905
  }, {
906
906
  default: r(() => [
907
- o(re, {
908
- email: e(_),
909
- "mobile-phone": e(b),
907
+ l(re, {
908
+ email: e(b),
909
+ "mobile-phone": e(h),
910
910
  phone: e(P)
911
911
  }, null, 8, ["email", "mobile-phone", "phone"])
912
912
  ]),
913
913
  _: 1
914
914
  }),
915
- o(he, { form: e(u) }, null, 8, ["form"])
915
+ l(ve, { form: e(m) }, null, 8, ["form"])
916
916
  ]),
917
917
  _: 1
918
918
  }, 8, ["title"])
@@ -921,11 +921,11 @@ const it = N.object({
921
921
  })
922
922
  ]),
923
923
  _: 1
924
- })) : F("", !0),
925
- o(e(W), null, {
924
+ })) : $("", !0),
925
+ l(e(ee), null, {
926
926
  right: r(() => [
927
- o(e(ee), {
928
- "is-loading": e(u).isSubmitting.value,
927
+ l(e(ae), {
928
+ "is-loading": e(m).isSubmitting.value,
929
929
  label: e(i).t("wise_crm.shared.save_changes")
930
930
  }, null, 8, ["is-loading", "label"])
931
931
  ]),
@@ -936,8 +936,8 @@ const it = N.object({
936
936
  }, 8, ["form"]));
937
937
  }
938
938
  });
939
- function st(n) {
940
- return ka("userIndex", {
939
+ function dt(n) {
940
+ return $a("userIndex", {
941
941
  params: n,
942
942
  queryFn: (a) => ea.getAll({
943
943
  pagination: a,
@@ -945,127 +945,127 @@ function st(n) {
945
945
  })
946
946
  });
947
947
  }
948
- const ut = { class: "p-lg" }, ct = /* @__PURE__ */ x({
948
+ const mt = { class: "p-lg" }, ft = /* @__PURE__ */ x({
949
949
  __name: "DealDetailSidebarGeneralInfo",
950
950
  props: {
951
951
  deal: {}
952
952
  },
953
953
  setup(n) {
954
- const a = n, t = I(), l = q(), i = Va(), s = La(), c = qa(), m = aa({
954
+ const a = n, t = I(), o = q(), i = Aa(), u = Ba(), s = Qa(), d = aa({
955
955
  persistInUrl: !1
956
- }), f = st({
956
+ }), _ = dt({
957
957
  params: {
958
- search: m.debouncedSearch
958
+ search: d.debouncedSearch
959
959
  }
960
- }), u = O(a.deal.dealLanguage), v = O(a.deal.dealSource), y = O(
960
+ }), m = V(a.deal.dealLanguage), g = V(a.deal.dealSource), f = V(
961
961
  a.deal.owner ? {
962
962
  uuid: a.deal.owner.uuid,
963
963
  name: a.deal.owner.name
964
964
  } : null
965
- ), _ = w(() => {
966
- const U = (f.result.value.isOk() ? f.result.value.getValue().data : []).map((D) => ({
965
+ ), b = U(() => {
966
+ const w = (_.result.value.isOk() ? _.result.value.getValue().data : []).map((D) => ({
967
967
  uuid: D.uuid,
968
968
  name: `${D.firstName} ${D.lastName}`
969
969
  }));
970
- return Ia(U);
970
+ return Na(w);
971
971
  });
972
- function b(U) {
973
- return t.t(oa.getI18nKey(U));
972
+ function h(w) {
973
+ return t.t(oa.getI18nKey(w));
974
974
  }
975
- function P(U) {
976
- return t.t(ia.getI18nKey(U));
975
+ function P(w) {
976
+ return t.t(ia.getI18nKey(w));
977
977
  }
978
- const h = ae(Object.values(Oe)), p = ae(Object.values(Ve)), C = ta();
979
- function k(U) {
980
- m.updateSearch(U);
978
+ const v = te(Object.values(Ee)), p = te(Object.values(Ve)), C = ta();
979
+ function k(w) {
980
+ d.updateSearch(w);
981
981
  }
982
- async function j(U) {
983
- if (u.value = U, U !== null)
982
+ async function j(w) {
983
+ if (m.value = w, w !== null)
984
984
  try {
985
985
  await i.execute({
986
986
  body: {
987
- dealLanguage: U
987
+ dealLanguage: w
988
988
  },
989
989
  params: {
990
990
  dealUuid: a.deal.uuid
991
991
  }
992
992
  });
993
993
  } catch (D) {
994
- l.show(D);
994
+ o.show(D);
995
995
  }
996
996
  }
997
- async function Ne(U) {
998
- if (v.value = U, U !== null)
997
+ async function Se(w) {
998
+ if (g.value = w, w !== null)
999
999
  try {
1000
- await s.execute({
1000
+ await u.execute({
1001
1001
  body: {
1002
- dealSource: U
1002
+ dealSource: w
1003
1003
  },
1004
1004
  params: {
1005
1005
  dealUuid: a.deal.uuid
1006
1006
  }
1007
1007
  });
1008
1008
  } catch (D) {
1009
- l.show(D);
1009
+ o.show(D);
1010
1010
  }
1011
1011
  }
1012
- async function Se(U) {
1013
- if (y.value = U, U !== null)
1012
+ async function ke(w) {
1013
+ if (f.value = w, w !== null)
1014
1014
  try {
1015
- await c.execute({
1015
+ await s.execute({
1016
1016
  body: {
1017
- dealOwner: U
1017
+ dealOwner: w
1018
1018
  },
1019
1019
  params: {
1020
1020
  dealUuid: a.deal.uuid
1021
1021
  }
1022
1022
  });
1023
1023
  } catch (D) {
1024
- l.show(D);
1024
+ o.show(D);
1025
1025
  }
1026
1026
  }
1027
- return (U, D) => (d(), V("div", null, [
1028
- o(be, null, {
1027
+ return (w, D) => (c(), O("div", null, [
1028
+ l(he, null, {
1029
1029
  default: r(() => [
1030
1030
  S("form", null, [
1031
- o(na, { cols: 1 }, {
1031
+ l(na, { cols: 1 }, {
1032
1032
  default: r(() => [
1033
- o(e(Na), {
1034
- modelValue: y.value,
1033
+ l(e(Sa), {
1034
+ modelValue: f.value,
1035
1035
  "onUpdate:modelValue": [
1036
- D[0] || (D[0] = (L) => y.value = L),
1037
- Se
1036
+ D[0] || (D[0] = (L) => f.value = L),
1037
+ ke
1038
1038
  ],
1039
- items: _.value,
1039
+ items: b.value,
1040
1040
  "display-fn": (L) => L.name,
1041
- "is-loading": e(f).isLoading.value || e(c).isLoading.value,
1041
+ "is-loading": e(_).isLoading.value || e(s).isLoading.value,
1042
1042
  "search-mode": "remote",
1043
1043
  placeholder: "Select deal owner",
1044
1044
  label: "Deal owner",
1045
1045
  "onUpdate:search": k
1046
1046
  }, null, 8, ["modelValue", "items", "display-fn", "is-loading"]),
1047
- o(e(te), {
1048
- modelValue: u.value,
1047
+ l(e(ne), {
1048
+ modelValue: m.value,
1049
1049
  "onUpdate:modelValue": [
1050
- D[1] || (D[1] = (L) => u.value = L),
1050
+ D[1] || (D[1] = (L) => m.value = L),
1051
1051
  j
1052
1052
  ],
1053
1053
  label: e(t).t("wise_crm.deal.form.fields.language"),
1054
1054
  placeholder: e(t).t("wise_crm.deal.form.fields.language_placeholder"),
1055
- "display-fn": b,
1055
+ "display-fn": h,
1056
1056
  "is-loading": e(i).isLoading.value,
1057
- items: e(h)
1057
+ items: e(v)
1058
1058
  }, null, 8, ["modelValue", "label", "placeholder", "is-loading", "items"]),
1059
- o(e(te), {
1060
- modelValue: v.value,
1059
+ l(e(ne), {
1060
+ modelValue: g.value,
1061
1061
  "onUpdate:modelValue": [
1062
- D[2] || (D[2] = (L) => v.value = L),
1063
- Ne
1062
+ D[2] || (D[2] = (L) => g.value = L),
1063
+ Se
1064
1064
  ],
1065
1065
  "display-fn": P,
1066
1066
  label: e(t).t("wise_crm.deal.form.fields.source"),
1067
1067
  placeholder: e(t).t("wise_crm.deal.form.fields.source_placeholder"),
1068
- "is-loading": e(s).isLoading.value,
1068
+ "is-loading": e(u).isLoading.value,
1069
1069
  items: e(p)
1070
1070
  }, null, 8, ["modelValue", "label", "placeholder", "is-loading", "items"])
1071
1071
  ]),
@@ -1075,8 +1075,8 @@ const ut = { class: "p-lg" }, ct = /* @__PURE__ */ x({
1075
1075
  ]),
1076
1076
  _: 1
1077
1077
  }),
1078
- S("div", ut, [
1079
- o(z, {
1078
+ S("div", mt, [
1079
+ l(z, {
1080
1080
  label: e(t).t("wise_crm.deal.sidebar.created_at", {
1081
1081
  date: e(C).toDate(a.deal.createdAt.toPlainDate())
1082
1082
  }),
@@ -1087,96 +1087,96 @@ const ut = { class: "p-lg" }, ct = /* @__PURE__ */ x({
1087
1087
  ])
1088
1088
  ]));
1089
1089
  }
1090
- }), dt = /* @__PURE__ */ x({
1090
+ }), pt = /* @__PURE__ */ x({
1091
1091
  __name: "DealDetailSidebarOverviewContent",
1092
1092
  props: {
1093
1093
  deal: {}
1094
1094
  },
1095
1095
  setup(n) {
1096
- const a = n, t = I(), l = q(), i = Ra(), s = ja(), c = J(), m = c.create(nt), f = c.create(rt), u = w(() => a.deal.contactPersons.length > 0), v = w(() => a.deal.contactPersons.toSorted((h, p) => Number(p.isPrimary) - Number(h.isPrimary)));
1097
- function y() {
1098
- m.open({
1096
+ const a = n, t = I(), o = q(), i = Ga(), u = Ya(), s = X(), d = s.create(it), _ = s.create(ct), m = U(() => a.deal.contactPersons.length > 0), g = U(() => a.deal.contactPersons.toSorted((v, p) => Number(p.isPrimary) - Number(v.isPrimary)));
1097
+ function f() {
1098
+ d.open({
1099
1099
  dealUuid: a.deal.uuid
1100
1100
  });
1101
1101
  }
1102
- function _(h) {
1103
- f.open({
1104
- contactPersonUuid: h,
1102
+ function b(v) {
1103
+ _.open({
1104
+ contactPersonUuid: v,
1105
1105
  dealUuid: a.deal.uuid
1106
1106
  });
1107
1107
  }
1108
- async function b(h) {
1109
- const p = await s.execute({
1108
+ async function h(v) {
1109
+ const p = await u.execute({
1110
1110
  body: {
1111
- contactPersonUuid: h
1111
+ contactPersonUuid: v
1112
1112
  },
1113
1113
  params: {
1114
1114
  dealUuid: a.deal.uuid
1115
1115
  }
1116
1116
  });
1117
- p.isErr() && l.show(p.error);
1117
+ p.isErr() && o.show(p.error);
1118
1118
  }
1119
- function P(h) {
1119
+ function P(v) {
1120
1120
  i.execute({
1121
1121
  params: {
1122
- contactPersonUuid: h,
1122
+ contactPersonUuid: v,
1123
1123
  dealUuid: a.deal.uuid
1124
1124
  }
1125
1125
  });
1126
1126
  }
1127
- return (h, p) => (d(), g(ra, { "default-values": ["general-info", "contact-persons"] }, {
1127
+ return (v, p) => (c(), y(ra, { "default-values": ["general-info", "contact-persons"] }, {
1128
1128
  default: r(() => [
1129
- o(ce, {
1129
+ l(ce, {
1130
1130
  label: e(t).t("wise_crm.deal.detail.sidebar.accordion.general_info"),
1131
- icon: e(Ce),
1131
+ icon: e(Ue),
1132
1132
  value: "general-info"
1133
1133
  }, {
1134
1134
  default: r(() => [
1135
- o(ct, {
1135
+ l(ft, {
1136
1136
  deal: a.deal
1137
1137
  }, null, 8, ["deal"])
1138
1138
  ]),
1139
1139
  _: 1
1140
1140
  }, 8, ["label", "icon"]),
1141
- o(ce, {
1142
- "is-empty": !u.value,
1141
+ l(ce, {
1142
+ "is-empty": !m.value,
1143
1143
  label: e(t).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1144
1144
  icon: e(sa),
1145
1145
  value: "contact-persons",
1146
- onAdd: y
1146
+ onAdd: f
1147
1147
  }, {
1148
1148
  actions: r(() => [
1149
- u.value ? F("", !0) : (d(), g(ua, {
1149
+ m.value ? $("", !0) : (c(), y(ua, {
1150
1150
  key: 0,
1151
1151
  label: e(t).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
1152
1152
  icon: e(de),
1153
1153
  class: "z-1",
1154
- onClick: y
1154
+ onClick: f
1155
1155
  }, null, 8, ["label", "icon"]))
1156
1156
  ]),
1157
1157
  default: r(() => [
1158
- (d(!0), V(le, null, Fe(v.value, (C) => (d(), g(e(Fa), {
1158
+ (c(!0), O(J, null, _e(g.value, (C) => (c(), y(e(Oa), {
1159
1159
  key: C.uuid,
1160
1160
  "layout-id": C.uuid
1161
1161
  }, {
1162
1162
  default: r(() => [
1163
- o(Ja, {
1163
+ l(et, {
1164
1164
  "contact-person": C,
1165
1165
  "on-toggle-is-primary": () => P(C.uuid),
1166
- onUpdate: (k) => _(C.uuid),
1167
- onDelete: (k) => b(C.uuid)
1166
+ onUpdate: (k) => b(C.uuid),
1167
+ onDelete: (k) => h(C.uuid)
1168
1168
  }, null, 8, ["contact-person", "on-toggle-is-primary", "onUpdate", "onDelete"])
1169
1169
  ]),
1170
1170
  _: 2
1171
1171
  }, 1032, ["layout-id"]))), 128)),
1172
- u.value ? (d(), g(e(Sa), {
1172
+ m.value ? (c(), y(e(ka), {
1173
1173
  key: 0,
1174
1174
  "icon-left": e(de),
1175
1175
  label: e(t).t("wise_crm.shared.add"),
1176
1176
  variant: "tertiary",
1177
1177
  size: "sm",
1178
- onClick: y
1179
- }, null, 8, ["icon-left", "label"])) : F("", !0)
1178
+ onClick: f
1179
+ }, null, 8, ["icon-left", "label"])) : $("", !0)
1180
1180
  ]),
1181
1181
  _: 1
1182
1182
  }, 8, ["is-empty", "label", "icon"])
@@ -1185,15 +1185,15 @@ const ut = { class: "p-lg" }, ct = /* @__PURE__ */ x({
1185
1185
  }));
1186
1186
  }
1187
1187
  });
1188
- function mt() {
1189
- const n = $();
1188
+ function _t() {
1189
+ const n = F();
1190
1190
  return M({
1191
1191
  queryFn: async ({
1192
1192
  body: a,
1193
1193
  params: t
1194
1194
  }) => {
1195
- const l = await T.transition(t.dealUuid, a.toBoardColumnUuid);
1196
- return l.isOk() && n.notifyDealChanged(t.dealUuid, E.TRANSITION), l;
1195
+ const o = await T.transition(t.dealUuid, a.toBoardColumnUuid);
1196
+ return o.isOk() && n.notifyDealChanged(t.dealUuid, E.TRANSITION), o;
1197
1197
  },
1198
1198
  queryKeysToInvalidate: {
1199
1199
  dealDetail: {
@@ -1203,15 +1203,15 @@ function mt() {
1203
1203
  }
1204
1204
  });
1205
1205
  }
1206
- function ft(n, a) {
1207
- return xe("boardColumnsTransition", {
1206
+ function gt(n, a) {
1207
+ return Ie("boardColumnsTransition", {
1208
1208
  params: {
1209
1209
  boardColumnUuid: n
1210
1210
  },
1211
1211
  queryFn: () => ca.getTransitions(n.value, a.value)
1212
1212
  });
1213
1213
  }
1214
- const pt = /* @__PURE__ */ x({
1214
+ const yt = /* @__PURE__ */ x({
1215
1215
  __name: "DealDetailSidebarTransitionSelect",
1216
1216
  props: /* @__PURE__ */ Me({
1217
1217
  deal: {}
@@ -1223,26 +1223,26 @@ const pt = /* @__PURE__ */ x({
1223
1223
  }),
1224
1224
  emits: ["update:modelValue"],
1225
1225
  setup(n) {
1226
- const a = n, t = I(), l = $(), s = J().create(da), c = $e(n, "modelValue"), m = q(), f = mt(), u = ft(
1227
- w(() => c.value.toColumnUuid),
1228
- w(() => l.getOptions().deals?.allowedTransitionTriggerTypes ?? [])
1229
- ), v = w(() => (u.result.value.isOk() ? u.result.value.getValue() : []).flatMap((h) => h.triggers.length === 0 ? [
1230
- h
1231
- ] : h.triggers.map((p) => ({
1232
- ...h,
1233
- toColumnDisplayName: h.toColumnDisplayName,
1226
+ const a = n, t = I(), o = F(), u = X().create(da), s = $e(n, "modelValue"), d = q(), _ = _t(), m = gt(
1227
+ U(() => s.value.toColumnUuid),
1228
+ U(() => o.getOptions().deals?.allowedTransitionTriggerTypes ?? [])
1229
+ ), g = U(() => (m.result.value.isOk() ? m.result.value.getValue() : []).flatMap((v) => v.triggers.length === 0 ? [
1230
+ v
1231
+ ] : v.triggers.map((p) => ({
1232
+ ...v,
1233
+ toColumnDisplayName: v.toColumnDisplayName,
1234
1234
  triggers: [
1235
1235
  p
1236
1236
  ]
1237
1237
  }))));
1238
- function y(P) {
1238
+ function f(P) {
1239
1239
  return P?.toColumnDisplayName ?? "-";
1240
1240
  }
1241
- const _ = w(() => ae(v.value));
1242
- async function b(P) {
1241
+ const b = U(() => te(g.value));
1242
+ async function h(P) {
1243
1243
  if (P.triggers.length !== 0) {
1244
1244
  if (P.triggers[0]?.triggerType === Le.EMAIL) {
1245
- s.open({
1245
+ u.open({
1246
1246
  dealUuid: a.deal.uuid,
1247
1247
  client: {
1248
1248
  uuid: a.deal.client.uuid,
@@ -1253,7 +1253,7 @@ const pt = /* @__PURE__ */ x({
1253
1253
  return;
1254
1254
  }
1255
1255
  try {
1256
- c.value = P, await f.execute({
1256
+ s.value = P, await _.execute({
1257
1257
  body: {
1258
1258
  toBoardColumnUuid: P.toColumnUuid
1259
1259
  },
@@ -1261,47 +1261,47 @@ const pt = /* @__PURE__ */ x({
1261
1261
  dealUuid: a.deal.uuid
1262
1262
  }
1263
1263
  });
1264
- } catch (h) {
1265
- m.show(h);
1264
+ } catch (v) {
1265
+ d.show(v);
1266
1266
  }
1267
1267
  }
1268
1268
  }
1269
- return (P, h) => (d(), g(ma, {
1270
- color: c.value?.toColumnColor ?? null
1269
+ return (P, v) => (c(), y(ma, {
1270
+ color: s.value?.toColumnColor ?? null
1271
1271
  }, {
1272
1272
  default: r(() => [
1273
- v.value.length === 0 ? (d(), g(e(ne), {
1273
+ g.value.length === 0 ? (c(), y(e(le), {
1274
1274
  key: 0,
1275
1275
  "class-config": {
1276
1276
  root: "text-nowrap"
1277
1277
  },
1278
- label: c.value.toColumnDisplayName,
1278
+ label: s.value.toColumnDisplayName,
1279
1279
  variant: "translucent",
1280
1280
  color: "brand"
1281
- }, null, 8, ["label"])) : (d(), g(e(te), {
1281
+ }, null, 8, ["label"])) : (c(), y(e(ne), {
1282
1282
  key: 1,
1283
- "model-value": c.value,
1284
- "is-loading": e(f).isLoading.value,
1285
- "display-fn": y,
1286
- items: _.value,
1283
+ "model-value": s.value,
1284
+ "is-loading": e(_).isLoading.value,
1285
+ "display-fn": f,
1286
+ items: b.value,
1287
1287
  "is-label-hidden": !0,
1288
1288
  placeholder: e(t).t("wise_crm.deal.transition.placeholder"),
1289
1289
  label: e(t).t("wise_crm.deal.transition.label"),
1290
1290
  class: "w-fit shrink-0 text-nowrap",
1291
1291
  size: "sm",
1292
- "onUpdate:modelValue": b
1292
+ "onUpdate:modelValue": h
1293
1293
  }, null, 8, ["model-value", "is-loading", "items", "placeholder", "label"]))
1294
1294
  ]),
1295
1295
  _: 1
1296
1296
  }, 8, ["color"]));
1297
1297
  }
1298
1298
  });
1299
- function _t() {
1299
+ function bt() {
1300
1300
  return M({
1301
1301
  queryFn: async ({
1302
1302
  body: n,
1303
1303
  params: a
1304
- }) => await Ue.create(n, {
1304
+ }) => await we.create(n, {
1305
1305
  dealUuid: a.dealUuid
1306
1306
  }),
1307
1307
  queryKeysToInvalidate: {
@@ -1309,69 +1309,71 @@ function _t() {
1309
1309
  }
1310
1310
  });
1311
1311
  }
1312
- function gt(n, a) {
1313
- return Ta("noteDealIndex", {
1312
+ function ht(n, a) {
1313
+ return Ma("noteDealIndex", {
1314
1314
  params: {
1315
1315
  params: a?.params
1316
1316
  },
1317
- queryFn: (t) => Ue.getDealNotes({
1317
+ queryFn: (t) => we.getDealNotes({
1318
1318
  pagination: t
1319
1319
  }, n.value)
1320
1320
  });
1321
1321
  }
1322
- const yt = /* @__PURE__ */ x({
1322
+ const vt = /* @__PURE__ */ x({
1323
1323
  __name: "DealDialogSidebarNotesContent",
1324
1324
  props: {
1325
1325
  deal: {}
1326
1326
  },
1327
1327
  setup(n) {
1328
- const a = n, l = J().create(fa), i = q(), s = _t(), c = pa(), m = gt(
1329
- w(() => a.deal.uuid)
1330
- ), f = w(() => m.result.value.isOk() ? m.result.value.getValue().data : []);
1331
- async function u(_) {
1332
- await s.execute({
1333
- body: _,
1328
+ const a = n, o = X().create(fa), i = q(), u = bt(), s = pa(), d = ht(
1329
+ U(() => a.deal.uuid)
1330
+ ), _ = U(() => d.result.value.isOk() ? d.result.value.getValue().data : []);
1331
+ async function m(b) {
1332
+ await u.execute({
1333
+ body: b,
1334
1334
  params: {
1335
1335
  dealUuid: a.deal.uuid
1336
1336
  }
1337
1337
  });
1338
1338
  }
1339
- async function v(_) {
1339
+ async function g(b) {
1340
1340
  try {
1341
- await c.execute({
1341
+ await s.execute({
1342
1342
  params: {
1343
- noteUuid: _
1343
+ noteUuid: b
1344
1344
  }
1345
1345
  });
1346
- } catch (b) {
1347
- i.show(b);
1346
+ } catch (h) {
1347
+ i.show(h);
1348
1348
  }
1349
1349
  }
1350
- function y(_) {
1351
- l.open({
1352
- note: _
1350
+ function f(b) {
1351
+ o.open({
1352
+ note: b
1353
1353
  });
1354
1354
  }
1355
- return (_, b) => (d(), g(_a, {
1356
- "is-loading": e(m).isLoading.value,
1357
- notes: f.value,
1358
- "on-submit": u,
1359
- "has-next-page": e(m).hasNextPage.value,
1360
- onNext: b[0] || (b[0] = (P) => e(m).fetchNextPage()),
1361
- onDelete: v,
1362
- onUpdate: y
1355
+ return (b, h) => (c(), y(_a, {
1356
+ "is-loading": e(d).isLoading.value,
1357
+ notes: _.value,
1358
+ "on-submit": m,
1359
+ "has-next-page": e(d).hasNextPage.value,
1360
+ onNext: h[0] || (h[0] = (P) => e(d).fetchNextPage()),
1361
+ onDelete: g,
1362
+ onUpdate: f
1363
1363
  }, null, 8, ["is-loading", "notes", "has-next-page"]));
1364
1364
  }
1365
- }), bt = { class: "flex h-full flex-1 flex-col" }, ht = { class: "flex flex-col gap-xl rounded-2xl border border-primary p-xl" }, vt = { class: "flex items-start gap-xs" }, Ct = { class: "flex w-full flex-wrap items-center justify-between gap-sm" }, Ut = { class: "flex max-w-full min-w-0 items-center gap-sm" }, wt = /* @__PURE__ */ x({
1365
+ }), Ct = { class: "flex h-full flex-1 flex-col" }, Ut = { class: "flex flex-col gap-xl rounded-2xl border border-primary p-xl" }, wt = { class: "flex items-start gap-xs" }, Pt = { class: "flex w-full flex-wrap items-center justify-between gap-sm" }, Dt = { class: "flex max-w-full min-w-0 items-center gap-sm" }, xt = /* @__PURE__ */ x({
1366
1366
  __name: "DealDetailSidebar",
1367
1367
  props: {
1368
1368
  deal: {}
1369
1369
  },
1370
1370
  setup(n) {
1371
- const a = n, t = I(), l = ge(), i = O(
1371
+ const a = n, t = I(), o = ye(), i = F(), u = U(
1372
+ () => i.getOptions().deals?.headerBadges ?? []
1373
+ ), s = V(
1372
1374
  "overview"
1373
1375
  /* OVERVIEW */
1374
- ), s = O({
1376
+ ), d = V({
1375
1377
  // There is no uuid available for the initial value, so a placeholder is used
1376
1378
  uuid: "",
1377
1379
  toColumnUuid: a.deal.boardColumn.uuid,
@@ -1379,9 +1381,9 @@ const yt = /* @__PURE__ */ x({
1379
1381
  toColumnDisplayName: a.deal.boardColumn.displayName,
1380
1382
  toColumnKey: "",
1381
1383
  triggers: []
1382
- }), c = w(() => [
1384
+ }), _ = U(() => [
1383
1385
  {
1384
- icon: Ce,
1386
+ icon: Ue,
1385
1387
  label: t.t("wise_crm.shared.overview"),
1386
1388
  value: "overview"
1387
1389
  /* OVERVIEW */
@@ -1393,118 +1395,137 @@ const yt = /* @__PURE__ */ x({
1393
1395
  /* NOTES */
1394
1396
  }
1395
1397
  ]);
1396
- return (m, f) => (d(), V("div", bt, [
1397
- S("div", ht, [
1398
- S("div", vt, [
1399
- o(Ka, {
1398
+ return (m, g) => (c(), O("div", Ct, [
1399
+ S("div", Ut, [
1400
+ S("div", wt, [
1401
+ l(za, {
1400
1402
  deal: a.deal,
1401
1403
  class: "min-w-0 flex-1"
1402
1404
  }, null, 8, ["deal"]),
1403
- o(Oa, {
1405
+ l(qa, {
1404
1406
  deal: a.deal
1405
1407
  }, null, 8, ["deal"])
1406
1408
  ]),
1407
- S("div", Ct, [
1408
- S("div", Ut, [
1409
- o(e(ne), {
1410
- label: a.deal.dealNumber,
1411
- variant: "translucent",
1412
- color: "gray"
1413
- }, null, 8, ["label"]),
1414
- o(ya, {
1415
- class: "max-w-full min-w-0",
1416
- onClick: f[0] || (f[0] = (u) => e(l).openBusinessDetail(
1417
- a.deal.client.uuid
1418
- ))
1419
- }, {
1420
- default: r(() => [
1421
- o(e(ne), {
1422
- icon: e(ba),
1423
- label: a.deal.client.name,
1409
+ l(e(Ta), {
1410
+ gap: "sm",
1411
+ align: "stretch"
1412
+ }, {
1413
+ default: r(() => [
1414
+ S("div", Pt, [
1415
+ S("div", Dt, [
1416
+ l(e(le), {
1417
+ label: a.deal.dealNumber,
1424
1418
  variant: "translucent",
1425
- color: "brand",
1426
- class: "max-w-full"
1427
- }, null, 8, ["icon", "label"])
1419
+ color: "gray"
1420
+ }, null, 8, ["label"]),
1421
+ l(ya, {
1422
+ class: "max-w-full min-w-0",
1423
+ onClick: g[0] || (g[0] = (f) => e(o).openBusinessDetail(
1424
+ a.deal.client.uuid
1425
+ ))
1426
+ }, {
1427
+ default: r(() => [
1428
+ l(e(le), {
1429
+ icon: e(ba),
1430
+ label: a.deal.client.name,
1431
+ variant: "translucent",
1432
+ color: "brand",
1433
+ class: "max-w-full"
1434
+ }, null, 8, ["icon", "label"])
1435
+ ]),
1436
+ _: 1
1437
+ })
1438
+ ]),
1439
+ l(yt, {
1440
+ modelValue: d.value,
1441
+ "onUpdate:modelValue": g[1] || (g[1] = (f) => d.value = f),
1442
+ deal: a.deal
1443
+ }, null, 8, ["modelValue", "deal"])
1444
+ ]),
1445
+ l(e(Fa), { class: "empty:hidden" }, {
1446
+ default: r(() => [
1447
+ (c(!0), O(J, null, _e(u.value, (f) => (c(), y(ha, {
1448
+ key: f.key,
1449
+ badge: f,
1450
+ uuid: a.deal.uuid,
1451
+ entity: "deal"
1452
+ }, null, 8, ["badge", "uuid"]))), 128))
1428
1453
  ]),
1429
1454
  _: 1
1430
1455
  })
1431
1456
  ]),
1432
- o(pt, {
1433
- modelValue: s.value,
1434
- "onUpdate:modelValue": f[1] || (f[1] = (u) => s.value = u),
1435
- deal: a.deal
1436
- }, null, 8, ["modelValue", "deal"])
1437
- ])
1457
+ _: 1
1458
+ })
1438
1459
  ]),
1439
- o(ha, {
1440
- modelValue: i.value,
1441
- "onUpdate:modelValue": f[2] || (f[2] = (u) => i.value = u),
1442
- tabs: c.value
1460
+ l(va, {
1461
+ modelValue: s.value,
1462
+ "onUpdate:modelValue": g[2] || (g[2] = (f) => s.value = f),
1463
+ tabs: _.value
1443
1464
  }, {
1444
1465
  default: r(() => [
1445
- i.value === "overview" ? (d(), g(dt, {
1466
+ s.value === "overview" ? (c(), y(pt, {
1446
1467
  key: 0,
1447
1468
  deal: a.deal
1448
- }, null, 8, ["deal"])) : i.value === "notes" ? (d(), g(yt, {
1469
+ }, null, 8, ["deal"])) : s.value === "notes" ? (c(), y(vt, {
1449
1470
  key: 1,
1450
1471
  deal: a.deal
1451
- }, null, 8, ["deal"])) : F("", !0)
1472
+ }, null, 8, ["deal"])) : $("", !0)
1452
1473
  ]),
1453
1474
  _: 1
1454
1475
  }, 8, ["modelValue", "tabs"])
1455
1476
  ]));
1456
1477
  }
1457
- }), Pt = /* @__PURE__ */ x({
1478
+ }), It = /* @__PURE__ */ x({
1458
1479
  __name: "DealDetailSidebarProvider",
1459
1480
  props: {
1460
1481
  dealUuid: {}
1461
1482
  },
1462
1483
  setup(n) {
1463
- const a = n, t = va(
1464
- w(() => a.dealUuid)
1465
- ), l = I();
1466
- return (i, s) => (d(), g(Ca, null, {
1484
+ const a = n, t = Ca(
1485
+ U(() => a.dealUuid)
1486
+ ), o = I();
1487
+ return (i, u) => (c(), y(Ua, null, {
1467
1488
  default: r(() => [
1468
- e(t).isError.value ? (d(), g(Ua, {
1489
+ e(t).isError.value ? (c(), y(wa, {
1469
1490
  key: 0,
1470
- message: e(l).t("error.deal_details.description"),
1471
- title: e(l).t("error.deal_details.title")
1472
- }, null, 8, ["message", "title"])) : e(t).isLoading.value ? (d(), g(wa, {
1491
+ message: e(o).t("error.deal_details.description"),
1492
+ title: e(o).t("error.deal_details.title")
1493
+ }, null, 8, ["message", "title"])) : e(t).isLoading.value ? (c(), y(Pa, {
1473
1494
  key: 1,
1474
1495
  class: "h-full"
1475
- })) : e(t).result.value.isOk() ? (d(), g(wt, {
1496
+ })) : e(t).result.value.isOk() ? (c(), y(xt, {
1476
1497
  key: e(t).result.value.getValue().boardColumn.uuid,
1477
1498
  deal: e(t).result.value.getValue()
1478
- }, null, 8, ["deal"])) : F("", !0)
1499
+ }, null, 8, ["deal"])) : $("", !0)
1479
1500
  ]),
1480
1501
  _: 1
1481
1502
  }));
1482
1503
  }
1483
- }), Vt = /* @__PURE__ */ x({
1504
+ }), At = /* @__PURE__ */ x({
1484
1505
  __name: "DealDetailView",
1485
1506
  props: {
1486
1507
  tabs: {}
1487
1508
  },
1488
1509
  setup(n) {
1489
- const a = n, t = I(), l = Ee("dealUuid"), i = w(() => [
1510
+ const a = n, t = I(), o = Oe("dealUuid"), i = U(() => [
1490
1511
  ...a.tabs,
1491
1512
  {
1492
- label: w(() => t.t("wise_crm.deal.detail_view.communication_tab_label")),
1513
+ label: U(() => t.t("wise_crm.deal.detail_view.communication_tab_label")),
1493
1514
  to: "deal-communication"
1494
1515
  }
1495
1516
  ]);
1496
- return (s, c) => (d(), g(qe, {
1497
- key: e(l),
1498
- "entity-type": e(_e).BUSINESS,
1517
+ return (u, s) => (c(), y(qe, {
1518
+ key: e(o),
1519
+ "entity-type": e(ge).BUSINESS,
1499
1520
  tabs: i.value
1500
1521
  }, {
1501
1522
  sidebar: r(() => [
1502
- o(Pt, { "deal-uuid": e(l) }, null, 8, ["deal-uuid"])
1523
+ l(It, { "deal-uuid": e(o) }, null, 8, ["deal-uuid"])
1503
1524
  ]),
1504
1525
  _: 1
1505
1526
  }, 8, ["entity-type", "tabs"]));
1506
1527
  }
1507
1528
  });
1508
1529
  export {
1509
- Vt as default
1530
+ At as default
1510
1531
  };