@wisemen/wise-crm-web 1.1.0 → 1.2.0

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 (114) hide show
  1. package/dist/ActivityIcon-DNdtN-M_.js +19 -0
  2. package/dist/AppSkeletonLoader-Dq6pKznm.js +1112 -0
  3. package/dist/AttachmentIcon-BLUd7LaN.js +19 -0
  4. package/dist/BoldIcon-WRYUWz15.js +16 -0
  5. package/dist/BookIcon-Bb3r5y_J.js +19 -0
  6. package/dist/BuildingIcon-DFutRg8d.js +19 -0
  7. package/dist/BuildingsIcon-BVHy6yoa.js +19 -0
  8. package/dist/BulletListIcon-BhOXLSBa.js +16 -0
  9. package/dist/BusinessDetailSidebarProvider-a6VeNUii.js +2946 -0
  10. package/dist/BusinessDetailView-Dz3wDSx5.js +24 -0
  11. package/dist/ChevronDownIcon-BmyTSPND.js +19 -0
  12. package/dist/ClockIcon-BYfZAvIE.js +23 -0
  13. package/dist/ClockPlusIcon-BcNi0Y9I.js +23 -0
  14. package/dist/CopyIcon-2eV8MRv_.js +19 -0
  15. package/dist/CrmDetailHeaderCard-BkA0Z-Cu.js +2523 -0
  16. package/dist/CrmDetailView-BhZEQqUH.js +67 -0
  17. package/dist/DealCommunicationTabView-Drp9MEPu.js +140 -0
  18. package/dist/DealDetailView-DWLudchX.js +1049 -0
  19. package/dist/DealExternalAttachment-B6l0gDqF.js +179 -0
  20. package/dist/DealIcon-BwUWYDxo.js +19 -0
  21. package/dist/DealSendMailDialog-Dqei4933.js +1566 -0
  22. package/dist/DownloadCloudIcon-BSrLGGrY.js +19 -0
  23. package/dist/EditWithLineIcon-BKYDPJOY.js +19 -0
  24. package/dist/Error-za-wClcU.js +13302 -0
  25. package/dist/FileIcon-DL1e1tAu.js +19 -0
  26. package/dist/FilterLinesIcon-DgVMySAE.js +22 -0
  27. package/dist/H1Icon-B6NEsEbj.js +17 -0
  28. package/dist/H2Icon-CNof5Ohu.js +17 -0
  29. package/dist/H3Icon-B2F2Tb6r.js +17 -0
  30. package/dist/HashIcon-C_XttKfW.js +19 -0
  31. package/dist/HomeFilledIcon-DtZ2eXxt.js +16 -0
  32. package/dist/IndividualDetailSidebarProvider-jjRoK1Av.js +609 -0
  33. package/dist/IndividualDetailView-BqIRHn-0.js +24 -0
  34. package/dist/ItalicIcon-DqBns3yy.js +17 -0
  35. package/dist/LayersTreeIcon-DZZCSCY9.js +23 -0
  36. package/dist/LinkBrokenIcon-BNBpWSi7.js +19 -0
  37. package/dist/LinkExternalIcon-B7SHeB1_.js +19 -0
  38. package/dist/LinkIcon-8bCrZEv9.js +17 -0
  39. package/dist/LocationPinIcon-UySRqSfG.js +19 -0
  40. package/dist/MailIcon-BT7gSIZb.js +19 -0
  41. package/dist/MobilePhoneIcon-_KQGnCSS.js +19 -0
  42. package/dist/NumberedListIcon-B-JVTSAe.js +17 -0
  43. package/dist/PhoneIcon-DGGW_MNR.js +19 -0
  44. package/dist/RefreshIcon-D1QWfdPD.js +19 -0
  45. package/dist/SendIcon-BtJ-NCec.js +19 -0
  46. package/dist/SettingsIcon-CWFwJelS.js +25 -0
  47. package/dist/StarOutlineIcon-C-ELTCDQ.js +19 -0
  48. package/dist/StarYellowIcon-7wuNWaQO.js +19 -0
  49. package/dist/ThreeDotsIcon-C56RWk-0.js +32 -0
  50. package/dist/TimeLineMarkerIcon-DLmPwfs6.js +18 -0
  51. package/dist/TrashIcon-o4PWmcYe.js +20 -0
  52. package/dist/UploadCloudIcon-D2tWB0NP.js +19 -0
  53. package/dist/UserCircleIcon-DiDajcIH.js +23 -0
  54. package/dist/UserIcon-Bv1eF7ln.js +22 -0
  55. package/dist/VerticalDotsIcon-YcD73UqY.js +20 -0
  56. package/dist/WalletIcon-CUh92U5K.js +19 -0
  57. package/dist/_plugin-vue_export-helper-D3hKq4w_.js +8 -0
  58. package/dist/client-9P6xe_5g.js +4188 -0
  59. package/dist/index.js +5598 -28
  60. package/dist/style.css +2 -1
  61. package/dist/testing.js +366 -386
  62. package/dist/uuid.util-DpiDKVoj.js +11 -0
  63. package/package.json +17 -17
  64. package/dist/ActivityIcon-xJAmguCr.js +0 -21
  65. package/dist/AttachmentIcon-BE5eNDu2.js +0 -21
  66. package/dist/BoldIcon-gIpFueAk.js +0 -18
  67. package/dist/BookIcon-BcJ7URa7.js +0 -21
  68. package/dist/BuildingIcon-Dg6uZKp9.js +0 -21
  69. package/dist/BuildingsIcon-BFPEpeVP.js +0 -21
  70. package/dist/BulletListIcon-CjJGF99S.js +0 -18
  71. package/dist/BusinessDetailView-Cq7_ziCe.js +0 -27
  72. package/dist/ChevronDownIcon-CsDbkAjy.js +0 -21
  73. package/dist/ClockIcon-DmkNAIk7.js +0 -32
  74. package/dist/ClockPlusIcon-DeHgqDF1.js +0 -32
  75. package/dist/CopyIcon-BsUjyueq.js +0 -21
  76. package/dist/CrmDetailView.vue_vue_type_script_setup_true_lang-Db5HsgF9.js +0 -102
  77. package/dist/DealCommunicationTabView-CQ9vUi3p.js +0 -207
  78. package/dist/DealDetailView-t_v7MuZA.js +0 -1329
  79. package/dist/DealIcon-BJzNx1o6.js +0 -21
  80. package/dist/DownloadCloudIcon-DNPJTdVt.js +0 -21
  81. package/dist/EditWithLineIcon-BXkQTlXs.js +0 -21
  82. package/dist/FileIcon-DSQi3VUb.js +0 -21
  83. package/dist/FilterLinesIcon-YkTZirYE.js +0 -24
  84. package/dist/H1Icon-DsvWrDD0.js +0 -19
  85. package/dist/H2Icon-8xYiqSmR.js +0 -19
  86. package/dist/H3Icon-BdH22r8A.js +0 -19
  87. package/dist/HashIcon-DNclSYC-.js +0 -21
  88. package/dist/HomeFilledIcon-my0TzA9q.js +0 -18
  89. package/dist/IndividualDetailView-CjgKD__T.js +0 -27
  90. package/dist/ItalicIcon-Be9twusP.js +0 -19
  91. package/dist/LayersTreeIcon-DcK6WtJe.js +0 -32
  92. package/dist/LinkBrokenIcon-9wgVs__d.js +0 -21
  93. package/dist/LinkExternalIcon--XtB6wEj.js +0 -21
  94. package/dist/LinkIcon-BzYeqJaA.js +0 -19
  95. package/dist/LocationPinIcon-CSBPPRHC.js +0 -21
  96. package/dist/MailIcon-BgkBOes6.js +0 -21
  97. package/dist/MobilePhoneIcon-BgB_oAAr.js +0 -21
  98. package/dist/NumberedListIcon-Bf4a8S_g.js +0 -19
  99. package/dist/PhoneIcon-BKgg0ufh.js +0 -21
  100. package/dist/RefreshIcon-GJ03jEFx.js +0 -21
  101. package/dist/SendIcon-0ygrHbYx.js +0 -21
  102. package/dist/SettingsIcon-BRNQD8GX.js +0 -28
  103. package/dist/StarOutlineIcon-Gxm2X9hf.js +0 -21
  104. package/dist/StarYellowIcon-BZfRhUd6.js +0 -21
  105. package/dist/ThreeDotsIcon-cBE_pGvU.js +0 -32
  106. package/dist/TimeLineMarkerIcon-j4hDQteY.js +0 -20
  107. package/dist/TrashIcon-BynOxtIY.js +0 -22
  108. package/dist/UploadCloudIcon-BgcrXv_v.js +0 -21
  109. package/dist/UserCircleIcon-Bc1eahfh.js +0 -32
  110. package/dist/UserIcon-CCK-3lX3.js +0 -24
  111. package/dist/VerticalDotsIcon-C5gK8Zmi.js +0 -22
  112. package/dist/WalletIcon-DjqurEH2.js +0 -21
  113. package/dist/index-Cb2tNFVq.js +0 -24606
  114. package/dist/uuid.util-1167NMVR.js +0 -6562
@@ -1,1329 +0,0 @@
1
- import { defineComponent as U, ref as V, useTemplateRef as ye, openBlock as s, createElementBlock as T, createBlock as m, unref as a, withCtx as r, createVNode as i, mergeProps as be, createElementVNode as x, toDisplayString as k, nextTick as ge, computed as P, createTextVNode as E, createCommentVNode as S, Fragment as B, renderList as Q, renderSlot as he, useModel as ve, mergeModels as Ce } from "vue";
2
- import { useRouteParams as we } from "@vueuse/router";
3
- import { useI18n as N } from "vue-i18n";
4
- import { b0 as ae, b5 as Pe, b6 as Ue, ba as xe } from "./uuid.util-1167NMVR.js";
5
- import { _ as De } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-Db5HsgF9.js";
6
- import { z as F, g as $, h as M, i as z, t as Ne, C as te, j as Se, k as ne, l as K, m as Ie, n as ke, f as $e, o as R, p as Te, q as Fe, r as Ve, s as Y, v as H, w as Z, x as oe, y as le, B as Me, E as L, F as ie, G as Le, I as re, H as se, J as qe, K as J, L as Ee, b as Ke, N as Be, c as X, d as Qe, O as ue, P as Ae, Q as Oe, R as je, S as ze, u as Re, T as Ge, U as We, V as Ye, W as He, X as Ze, A as Je } from "./index-Cb2tNFVq.js";
7
- import { VcTextField as Xe, VcFormFieldLabel as ce, VcIconButton as de, VcDropdownMenu as ea, VcDropdownMenuItem as ee, VcAutocomplete as aa, VcSelect as G, VcSelectItem as W, useDialog as A, VcButton as ta, VcBadge as me } from "@wisemen/vue-core-components";
8
- import { useForm as O } from "formango";
9
- import j, { z as I } from "zod";
10
- import { Motion as na } from "motion-v";
11
- import { useQueryClient as oa, useMutation as la } from "@tanstack/vue-query";
12
- function ia() {
13
- return F({
14
- queryFn: async ({
15
- body: t,
16
- params: e
17
- }) => await $.update(e.dealUuid, {
18
- dealLanguage: t.dealLanguage
19
- }),
20
- queryKeysToInvalidate: {
21
- dealDetail: {
22
- dealUuid: (t) => t.dealUuid
23
- },
24
- dealIndex: {}
25
- }
26
- });
27
- }
28
- function ra() {
29
- return F({
30
- queryFn: async ({
31
- body: t,
32
- params: e
33
- }) => await $.update(e.dealUuid, {
34
- dealSource: t.dealSource
35
- }),
36
- queryKeysToInvalidate: {
37
- dealDetail: {
38
- dealUuid: (t) => t.dealUuid
39
- },
40
- dealIndex: {}
41
- }
42
- });
43
- }
44
- function sa() {
45
- return F({
46
- queryFn: async ({
47
- body: t,
48
- params: e
49
- }) => await $.update(e.dealUuid, {
50
- dealOwner: t.dealOwner
51
- }),
52
- queryKeysToInvalidate: {
53
- dealDetail: {
54
- dealUuid: (t) => t.dealUuid
55
- },
56
- dealIndex: {}
57
- }
58
- });
59
- }
60
- function ua() {
61
- return F({
62
- queryFn: async ({
63
- body: t,
64
- params: e
65
- }) => await $.update(e.dealUuid, {
66
- name: t.name
67
- }),
68
- queryKeysToInvalidate: {
69
- dealDetail: {
70
- dealUuid: (t) => t.dealUuid
71
- },
72
- dealIndex: {}
73
- }
74
- });
75
- }
76
- const ca = {
77
- key: 1,
78
- class: "flex justify-between"
79
- }, da = { class: "text-primary text-xl font-bold" }, ma = /* @__PURE__ */ U({
80
- __name: "DealDetailSidebarNameField",
81
- props: {
82
- deal: {}
83
- },
84
- setup(t) {
85
- const e = t, n = N(), o = M(), l = V(!1), u = ye("nameFieldContainerRef"), _ = ua(), y = O({
86
- schema: j.object({
87
- name: j.string().min(1)
88
- }),
89
- onSubmit: async (b) => {
90
- try {
91
- await _.execute({
92
- body: {
93
- name: b.name
94
- },
95
- params: {
96
- dealUuid: e.deal.uuid
97
- }
98
- });
99
- } catch (f) {
100
- o.show(f);
101
- } finally {
102
- l.value = !1;
103
- }
104
- }
105
- }), d = y.register("name", e.deal.name);
106
- async function p() {
107
- l.value = !0, await ge(), v();
108
- }
109
- function v() {
110
- u.value?.querySelector(
111
- "input"
112
- )?.focus();
113
- }
114
- function g() {
115
- if (!y.isDirty.value) {
116
- l.value = !1;
117
- return;
118
- }
119
- y.submit();
120
- }
121
- return (b, f) => (s(), T("div", {
122
- ref_key: "nameFieldContainerRef",
123
- ref: u
124
- }, [
125
- l.value ? (s(), m(z, {
126
- key: 0,
127
- form: a(y)
128
- }, {
129
- default: r(() => [
130
- i(a(Xe), be(a(Ne)(a(d)), {
131
- "class-config": {
132
- input: "text-xl font-bold"
133
- },
134
- "is-loading": a(y).isSubmitting.value,
135
- label: a(n).t("wise_crm.deal.detail.sidebar.name_field.label"),
136
- onBlur: g
137
- }), {
138
- label: r(() => [
139
- i(a(ce), { class: "sr-only" })
140
- ]),
141
- _: 1
142
- }, 16, ["is-loading", "label"]),
143
- f[0] || (f[0] = x("button", {
144
- type: "submit",
145
- class: "sr-only"
146
- }, null, -1))
147
- ]),
148
- _: 1
149
- }, 8, ["form"])) : (s(), T("div", ca, [
150
- x("h2", da, k(e.deal.name), 1),
151
- i(a(de), {
152
- label: a(n).t("wise_crm.deal.detail.sidebar.name_field.edit_label"),
153
- icon: "editWithLine",
154
- variant: "tertiary",
155
- class: "shrink-0",
156
- onClick: p
157
- }, null, 8, ["label"])
158
- ]))
159
- ], 512));
160
- }
161
- });
162
- function pa() {
163
- const t = oa(), e = "dealDetail", n = la({
164
- mutationFn: async (o) => await $.setPrimaryContactPerson(o.dealUuid, o.contactPersonUuid),
165
- onError: (o, l, u) => {
166
- t.setQueryData(
167
- [
168
- e,
169
- {
170
- dealUuid: l.dealUuid
171
- }
172
- ],
173
- u?.previousData
174
- );
175
- },
176
- onMutate: async (o) => {
177
- await t.cancelQueries({
178
- queryKey: [
179
- e
180
- ]
181
- });
182
- const l = t.getQueryData(
183
- [
184
- e,
185
- {
186
- dealUuid: o.dealUuid
187
- }
188
- ]
189
- );
190
- return l === void 0 ? {} : (t.setQueryData(
191
- [
192
- e,
193
- {
194
- dealUuid: o.dealUuid
195
- }
196
- ],
197
- {
198
- ...l,
199
- contactPersons: l.contactPersons.map((u) => ({
200
- ...u,
201
- isPrimary: u.uuid === o.contactPersonUuid
202
- }))
203
- }
204
- ), {
205
- previousData: l
206
- });
207
- }
208
- });
209
- return {
210
- isLoading: P(() => n.isPending.value),
211
- data: P(() => n.data.value),
212
- execute: async (o) => await n.mutateAsync(o.params)
213
- };
214
- }
215
- function fa() {
216
- return F({
217
- queryFn: async ({
218
- body: t,
219
- params: e
220
- }) => await $.unlinkContactPerson(e.dealUuid, t.contactPersonUuid),
221
- queryKeysToInvalidate: {
222
- dealDetail: {
223
- dealUuid: (t) => t.dealUuid
224
- },
225
- dealIndex: {}
226
- }
227
- });
228
- }
229
- const _a = { class: "flex items-start justify-between" }, ya = { class: "flex flex-col items-start" }, ba = {
230
- key: 1,
231
- class: "text-brand-700"
232
- }, ga = { class: "-mt-2 -mr-2 flex items-center justify-end" }, ha = { class: "gap-lg grid" }, va = /* @__PURE__ */ U({
233
- __name: "CrmDetailSidebarAccordionGenericContactPersonInfo",
234
- props: {
235
- contactPerson: {},
236
- description: { default: null },
237
- onToggleIsPrimary: {}
238
- },
239
- emits: ["delete", "update"],
240
- setup(t, { emit: e }) {
241
- const n = t, o = e, l = N(), u = n.contactPerson.uuid ?? n.contactPerson.contactPersonUuid;
242
- function _() {
243
- o("update");
244
- }
245
- function y() {
246
- o("delete");
247
- }
248
- function d() {
249
- n.onToggleIsPrimary();
250
- }
251
- return (p, v) => (s(), m(te, { class: "gap-lg flex flex-col" }, {
252
- default: r(() => [
253
- x("div", _a, [
254
- x("div", ya, [
255
- a(u) ? (s(), m(Se, {
256
- key: 0,
257
- "class-config": {
258
- root: "bg-transparent border-none text-primary shadow-none h-auto w-auto hover:underline p-0 font-semibold"
259
- },
260
- "entity-type": a(ae).INDIVIDUAL,
261
- uuid: a(u)
262
- }, {
263
- default: r(() => [
264
- E(k(n.contactPerson.firstName) + " " + k(n.contactPerson.lastName), 1)
265
- ]),
266
- _: 1
267
- }, 8, ["entity-type", "uuid"])) : S("", !0),
268
- n.description ? (s(), T("p", ba, k(n.description), 1)) : S("", !0)
269
- ]),
270
- x("div", ga, [
271
- i(ne, {
272
- icon: n.contactPerson.isPrimary ? "starYellow" : "starOutline",
273
- label: a(l).t("wise_crm.info_dialog.sidebar.overview.contact_person_primary"),
274
- onClick: d
275
- }, null, 8, ["icon", "label"]),
276
- i(a(ea), {
277
- "class-config": {
278
- content: "min-w-fit p-sm"
279
- },
280
- "popover-align": "end"
281
- }, {
282
- trigger: r(() => [
283
- i(a(de), {
284
- variant: "tertiary",
285
- size: "sm",
286
- label: "actionMenu",
287
- icon: "threeDots"
288
- })
289
- ]),
290
- content: r(() => [
291
- i(a(ee), {
292
- label: a(l).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
293
- icon: "editWithLine",
294
- onSelect: _
295
- }, null, 8, ["label"]),
296
- i(a(ee), {
297
- "is-destructive": !0,
298
- "is-disabled": n.contactPerson.isPrimary,
299
- label: a(l).t("wise_crm.info_dialog.sidebar.overview.delete_contact_person"),
300
- icon: "linkBroken",
301
- onSelect: y
302
- }, null, 8, ["is-disabled", "label"])
303
- ]),
304
- _: 1
305
- })
306
- ])
307
- ]),
308
- x("div", ha, [
309
- n.contactPerson.email !== null ? (s(), m(K, {
310
- key: 0,
311
- label: n.contactPerson.email,
312
- icon: "mail"
313
- }, null, 8, ["label"])) : S("", !0),
314
- n.contactPerson.mobilePhone !== null ? (s(), m(K, {
315
- key: 1,
316
- label: n.contactPerson.mobilePhone,
317
- icon: "mobilePhone"
318
- }, null, 8, ["label"])) : S("", !0),
319
- n.contactPerson.phone !== null ? (s(), m(K, {
320
- key: 2,
321
- label: n.contactPerson.phone,
322
- icon: "phone"
323
- }, null, 8, ["label"])) : S("", !0)
324
- ])
325
- ]),
326
- _: 1
327
- }));
328
- }
329
- }), Ca = { class: "p-lg" }, wa = /* @__PURE__ */ U({
330
- __name: "DealDetailSidebarGeneralInfo",
331
- props: {
332
- deal: {}
333
- },
334
- setup(t) {
335
- const e = t, n = N(), o = M(), l = ia(), u = ra(), _ = sa(), y = Ie({
336
- persistInUrl: !1
337
- }), d = ke({
338
- params: {
339
- search: y.debouncedSearch
340
- }
341
- }), p = V(e.deal.dealLanguage), v = V(e.deal.dealSource), g = V(
342
- e.deal.owner ? {
343
- uuid: e.deal.owner.uuid,
344
- name: e.deal.owner.name
345
- } : null
346
- ), b = P(() => d.data.value?.data.map((h) => ({
347
- uuid: h.uuid,
348
- name: `${h.firstName} ${h.lastName}`
349
- })) ?? []);
350
- function f(h) {
351
- return n.t(Te.getI18nKey(h));
352
- }
353
- function c(h) {
354
- return n.t(Fe.getI18nKey(h));
355
- }
356
- const C = $e();
357
- function q(h) {
358
- y.updateSearch(h);
359
- }
360
- async function pe(h) {
361
- if (p.value = h, h !== null)
362
- try {
363
- await l.execute({
364
- body: {
365
- dealLanguage: h
366
- },
367
- params: {
368
- dealUuid: e.deal.uuid
369
- }
370
- });
371
- } catch (D) {
372
- o.show(D);
373
- }
374
- }
375
- async function fe(h) {
376
- if (v.value = h, h !== null)
377
- try {
378
- await u.execute({
379
- body: {
380
- dealSource: h
381
- },
382
- params: {
383
- dealUuid: e.deal.uuid
384
- }
385
- });
386
- } catch (D) {
387
- o.show(D);
388
- }
389
- }
390
- async function _e(h) {
391
- if (g.value = h, h !== null)
392
- try {
393
- await _.execute({
394
- body: {
395
- dealOwner: h
396
- },
397
- params: {
398
- dealUuid: e.deal.uuid
399
- }
400
- });
401
- } catch (D) {
402
- o.show(D);
403
- }
404
- }
405
- return (h, D) => (s(), T("div", null, [
406
- i(te, null, {
407
- default: r(() => [
408
- x("form", null, [
409
- i(R, { cols: 1 }, {
410
- default: r(() => [
411
- i(a(aa), {
412
- modelValue: g.value,
413
- "onUpdate:modelValue": [
414
- D[0] || (D[0] = (w) => g.value = w),
415
- _e
416
- ],
417
- items: b.value,
418
- "display-fn": (w) => w.name,
419
- "is-loading": a(d).isLoading.value || a(_).isLoading.value,
420
- placeholder: "Select deal owner",
421
- label: "Deal owner",
422
- onSearch: q
423
- }, null, 8, ["modelValue", "items", "display-fn", "is-loading"]),
424
- i(a(G), {
425
- modelValue: p.value,
426
- "onUpdate:modelValue": [
427
- D[1] || (D[1] = (w) => p.value = w),
428
- pe
429
- ],
430
- label: a(n).t("wise_crm.deal.form.fields.language"),
431
- placeholder: a(n).t("wise_crm.deal.form.fields.language_placeholder"),
432
- "display-fn": f,
433
- "is-loading": a(l).isLoading.value
434
- }, {
435
- default: r(() => [
436
- (s(!0), T(B, null, Q(Object.values(a(Pe)), (w) => (s(), m(a(W), {
437
- key: w,
438
- value: w
439
- }, {
440
- default: r(() => [
441
- E(k(f(w)), 1)
442
- ]),
443
- _: 2
444
- }, 1032, ["value"]))), 128))
445
- ]),
446
- _: 1
447
- }, 8, ["modelValue", "label", "placeholder", "is-loading"]),
448
- i(a(G), {
449
- modelValue: v.value,
450
- "onUpdate:modelValue": [
451
- D[2] || (D[2] = (w) => v.value = w),
452
- fe
453
- ],
454
- "display-fn": c,
455
- label: a(n).t("wise_crm.deal.form.fields.source"),
456
- placeholder: a(n).t("wise_crm.deal.form.fields.source_placeholder"),
457
- "is-loading": a(u).isLoading.value
458
- }, {
459
- default: r(() => [
460
- (s(!0), T(B, null, Q(Object.values(a(Ue)), (w) => (s(), m(a(W), {
461
- key: w,
462
- value: w
463
- }, {
464
- default: r(() => [
465
- E(k(c(w)), 1)
466
- ]),
467
- _: 2
468
- }, 1032, ["value"]))), 128))
469
- ]),
470
- _: 1
471
- }, 8, ["modelValue", "label", "placeholder", "is-loading"])
472
- ]),
473
- _: 1
474
- })
475
- ])
476
- ]),
477
- _: 1
478
- }),
479
- x("div", Ca, [
480
- i(K, {
481
- label: a(n).t("wise_crm.deal.sidebar.created_at", {
482
- date: a(C).toDate(e.deal.createdAt.toPlainDate())
483
- }),
484
- icon: "clockPlus",
485
- "text-color": "text-quaternary",
486
- class: "text-sm"
487
- }, null, 8, ["label"])
488
- ])
489
- ]));
490
- }
491
- });
492
- function Pa() {
493
- return F({
494
- queryFn: async ({
495
- body: t,
496
- params: e
497
- }) => await $.linkContactPerson(
498
- e.dealUuid,
499
- t.contactPersonUuid,
500
- t.contactInfo
501
- ),
502
- queryKeysToInvalidate: {
503
- dealDetail: {
504
- dealUuid: (t) => t.dealUuid
505
- },
506
- dealIndex: {}
507
- }
508
- });
509
- }
510
- const Ua = /* @__PURE__ */ U({
511
- __name: "DealContactPersonCreateExistingForm",
512
- props: {
513
- form: {}
514
- },
515
- emits: ["createNewContactPerson"],
516
- setup(t, { emit: e }) {
517
- const n = t, o = e, l = N(), u = n.form.register("email"), _ = n.form.register("phone"), y = n.form.register("mobile"), d = n.form.register("existingContactPerson");
518
- function p() {
519
- o("createNewContactPerson");
520
- }
521
- return (v, g) => (s(), m(z, {
522
- form: n.form,
523
- class: "pb-xl flex h-full flex-1 flex-col justify-between"
524
- }, {
525
- default: r(() => [
526
- i(R, { cols: 2 }, {
527
- default: r(() => [
528
- i(Ve, {
529
- label: a(l).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
530
- "model-value": a(d).modelValue.value,
531
- class: "col-span-2",
532
- "onUpdate:modelValue": a(d).setValue,
533
- onCreateNew: p
534
- }, null, 8, ["label", "model-value", "onUpdate:modelValue"]),
535
- i(Y, {
536
- email: a(u),
537
- "mobile-phone": a(y),
538
- phone: a(_)
539
- }, null, 8, ["email", "mobile-phone", "phone"])
540
- ]),
541
- _: 1
542
- }),
543
- i(H, null, {
544
- default: r(() => [
545
- i(Z, {
546
- "is-loading": n.form.isSubmitting.value,
547
- label: a(l).t("wise_crm.shared.add"),
548
- class: "col-span-2"
549
- }, null, 8, ["is-loading", "label"])
550
- ]),
551
- _: 1
552
- })
553
- ]),
554
- _: 1
555
- }, 8, ["form"]));
556
- }
557
- }), xa = /* @__PURE__ */ U({
558
- __name: "DealContactPersonCreateNewForm",
559
- props: {
560
- form: {}
561
- },
562
- setup(t) {
563
- const e = t, n = e.form.register("firstName"), o = e.form.register("lastName"), l = e.form.register("email"), u = e.form.register("mobilePhone"), _ = e.form.register("phone");
564
- return (y, d) => (s(), m(z, {
565
- form: e.form,
566
- class: "pb-xl flex h-full flex-col justify-between"
567
- }, {
568
- default: r(() => [
569
- i(R, { cols: 2 }, {
570
- default: r(() => [
571
- i(oe, {
572
- "first-name": a(n),
573
- "last-name": a(o)
574
- }, null, 8, ["first-name", "last-name"]),
575
- i(Y, {
576
- email: a(l),
577
- "mobile-phone": a(u),
578
- phone: a(_)
579
- }, null, 8, ["email", "mobile-phone", "phone"]),
580
- i(le, {
581
- form: e.form
582
- }, null, 8, ["form"])
583
- ]),
584
- _: 1
585
- }),
586
- he(y.$slots, "actions")
587
- ]),
588
- _: 3
589
- }, 8, ["form"]));
590
- }
591
- }), Da = j.object({
592
- email: j.email().nullable(),
593
- existingContactPerson: Me,
594
- mobile: L.nullable(),
595
- phone: L.nullable()
596
- }), Na = I.object({
597
- email: I.email().min(1).nullable(),
598
- firstName: I.string().min(1),
599
- lastName: I.string().min(1),
600
- mobilePhone: L.nullable(),
601
- phone: L.nullable()
602
- }).superRefine((t, e) => {
603
- t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || e.addIssue({
604
- code: I.ZodIssueCode.custom,
605
- message: ie.global.t("wise_crm.form.errors.at_least_one")
606
- });
607
- }), Sa = /* @__PURE__ */ U({
608
- __name: "DealContactPersonCreateDialog",
609
- props: {
610
- dealUuid: {},
611
- isCreatingNewContactPerson: { type: Boolean, default: !1 }
612
- },
613
- emits: ["close", "createNewContactPerson"],
614
- setup(t, { emit: e }) {
615
- const n = t, o = e, l = N(), u = M(), _ = Pa(), y = Le(), d = V(n.isCreatingNewContactPerson), p = O({
616
- schema: Na,
617
- onSubmit: async (c) => {
618
- try {
619
- const C = await y.execute({
620
- body: {
621
- email: c.email,
622
- firstName: c.firstName,
623
- lastName: c.lastName,
624
- mobilePhone: c.mobilePhone,
625
- phone: c.phone
626
- }
627
- });
628
- n.isCreatingNewContactPerson || await _.execute({
629
- body: {
630
- contactPersonUuid: C,
631
- contactInfo: {
632
- email: c.email,
633
- mobilePhone: c.mobilePhone,
634
- phone: c.phone
635
- }
636
- },
637
- params: {
638
- dealUuid: n.dealUuid
639
- }
640
- }), f({
641
- label: `${c.firstName} ${c.lastName}`,
642
- value: C
643
- });
644
- } catch (C) {
645
- u.show(C);
646
- }
647
- }
648
- }), v = O({
649
- schema: Da,
650
- onSubmit: async (c) => {
651
- await b(
652
- c.existingContactPerson.value,
653
- {
654
- email: c.email,
655
- mobilePhone: c.mobile,
656
- phone: c.phone
657
- }
658
- );
659
- }
660
- });
661
- function g() {
662
- d.value = !0;
663
- }
664
- async function b(c, C) {
665
- if (c !== null)
666
- try {
667
- await _.execute({
668
- body: {
669
- contactPersonUuid: c,
670
- contactInfo: C
671
- },
672
- params: {
673
- dealUuid: n.dealUuid
674
- }
675
- }), f();
676
- } catch (q) {
677
- u.show(q);
678
- }
679
- }
680
- function f(c) {
681
- if (c === void 0) {
682
- o("close");
683
- return;
684
- }
685
- o("createNewContactPerson", c), o("close");
686
- }
687
- return (c, C) => (s(), m(re, {
688
- title: a(l).t("wise_crm.info_dialog.contact_person_create.title"),
689
- description: a(l).t("wise_crm.info_dialog.contact_person_create.description"),
690
- onClose: f
691
- }, {
692
- default: r(() => [
693
- d.value ? (s(), m(xa, {
694
- key: 0,
695
- form: a(p)
696
- }, {
697
- actions: r(() => [
698
- i(H, null, {
699
- default: r(() => [
700
- i(Z, {
701
- "is-loading": a(p).isSubmitting.value,
702
- label: a(l).t("wise_crm.shared.create")
703
- }, null, 8, ["is-loading", "label"])
704
- ]),
705
- _: 1
706
- })
707
- ]),
708
- _: 1
709
- }, 8, ["form"])) : (s(), m(Ua, {
710
- key: 1,
711
- form: a(v),
712
- onCreateNewContactPerson: g
713
- }, null, 8, ["form"]))
714
- ]),
715
- _: 1
716
- }, 8, ["title", "description"]));
717
- }
718
- });
719
- function Ia() {
720
- return F({
721
- queryFn: async ({
722
- body: t,
723
- params: e
724
- }) => await $.updateContactPerson(e.dealUuid, e.contactPersonUuid, t.form),
725
- queryKeysToInvalidate: {
726
- dealContactPersonDetail: {
727
- contactPersonUuid: (t) => t.contactPersonUuid,
728
- dealUuid: (t) => t.dealUuid
729
- },
730
- dealDetail: {
731
- dealUuid: (t) => t.dealUuid
732
- },
733
- dealIndex: {}
734
- }
735
- });
736
- }
737
- function ka(t, e) {
738
- return se({
739
- queryFn: () => $.getContactPerson(t.value, e.value),
740
- queryKey: {
741
- dealContactPersonDetail: {
742
- contactPersonUuid: e,
743
- dealUuid: t
744
- }
745
- }
746
- });
747
- }
748
- const $a = I.object({
749
- email: I.email().min(1).nullable(),
750
- firstName: I.string().min(1),
751
- lastName: I.string().min(1),
752
- mobilePhone: L.nullable(),
753
- phone: L.nullable()
754
- }).superRefine((t, e) => {
755
- t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || e.addIssue({
756
- code: I.ZodIssueCode.custom,
757
- message: ie.global.t("wise_crm.form.errors.at_least_one")
758
- });
759
- }), Ta = /* @__PURE__ */ U({
760
- __name: "DealContactPersonUpdateForm",
761
- props: {
762
- contactPerson: {},
763
- onSubmit: { type: Function }
764
- },
765
- setup(t) {
766
- const e = t, n = N(), o = O({
767
- initialState: {
768
- email: e.contactPerson.email,
769
- firstName: e.contactPerson.firstName,
770
- lastName: e.contactPerson.lastName,
771
- mobilePhone: e.contactPerson.mobilePhone,
772
- phone: e.contactPerson.phone
773
- },
774
- schema: $a,
775
- onSubmit: async (p) => {
776
- await e.onSubmit(p);
777
- }
778
- }), l = o.register("firstName"), u = o.register("lastName"), _ = o.register("email"), y = o.register("mobilePhone"), d = o.register("phone");
779
- return (p, v) => (s(), m(z, {
780
- form: a(o),
781
- class: "flex h-full flex-col justify-between"
782
- }, {
783
- default: r(() => [
784
- i(R, { cols: 2 }, {
785
- default: r(() => [
786
- i(oe, {
787
- "first-name": a(l),
788
- "last-name": a(u)
789
- }, null, 8, ["first-name", "last-name"]),
790
- i(Y, {
791
- email: a(_),
792
- "mobile-phone": a(y),
793
- phone: a(d)
794
- }, null, 8, ["email", "mobile-phone", "phone"]),
795
- i(le, { form: a(o) }, null, 8, ["form"])
796
- ]),
797
- _: 1
798
- }),
799
- i(H, null, {
800
- default: r(() => [
801
- i(Z, {
802
- "is-loading": a(o).isSubmitting.value,
803
- label: a(n).t("wise_crm.shared.save_changes")
804
- }, null, 8, ["is-loading", "label"])
805
- ]),
806
- _: 1
807
- })
808
- ]),
809
- _: 1
810
- }, 8, ["form"]));
811
- }
812
- }), Fa = /* @__PURE__ */ U({
813
- __name: "DealContactPersonUpdateDialog",
814
- props: {
815
- contactPersonUuid: {},
816
- dealUuid: {}
817
- },
818
- emits: ["close"],
819
- setup(t, { emit: e }) {
820
- const n = t, o = e, l = N(), u = M(), _ = Ia(), y = ka(
821
- P(() => n.dealUuid),
822
- P(() => n.contactPersonUuid)
823
- );
824
- async function d(v) {
825
- try {
826
- await _.execute({
827
- body: {
828
- form: v
829
- },
830
- params: {
831
- contactPersonUuid: n.contactPersonUuid,
832
- dealUuid: n.dealUuid
833
- }
834
- }), o("close");
835
- } catch (g) {
836
- u.show(g);
837
- }
838
- }
839
- function p() {
840
- o("close");
841
- }
842
- return (v, g) => (s(), m(re, {
843
- title: a(l).t("wise_crm.info_dialog.contact_person_update.title"),
844
- description: a(l).t("wise_crm.info_dialog.contact_person_create.description"),
845
- onClose: p
846
- }, {
847
- default: r(() => [
848
- a(y).data.value ? (s(), m(Ta, {
849
- key: 0,
850
- "on-submit": d,
851
- "contact-person": a(y).data.value,
852
- onClose: p
853
- }, null, 8, ["contact-person"])) : S("", !0)
854
- ]),
855
- _: 1
856
- }, 8, ["title", "description"]));
857
- }
858
- }), Va = /* @__PURE__ */ U({
859
- __name: "DealDetailSidebarOverviewContent",
860
- props: {
861
- deal: {}
862
- },
863
- setup(t) {
864
- const e = t, n = N(), o = M(), l = pa(), u = fa(), _ = A(Sa), y = A(Fa), d = P(() => e.deal.contactPersons.length > 0);
865
- function p() {
866
- _.open({
867
- dealUuid: e.deal.uuid
868
- });
869
- }
870
- function v(f) {
871
- y.open({
872
- contactPersonUuid: f,
873
- dealUuid: e.deal.uuid
874
- });
875
- }
876
- async function g(f) {
877
- try {
878
- await u.execute({
879
- body: {
880
- contactPersonUuid: f
881
- },
882
- params: {
883
- dealUuid: e.deal.uuid
884
- }
885
- });
886
- } catch (c) {
887
- o.show(c);
888
- }
889
- }
890
- function b(f) {
891
- l.execute({
892
- params: {
893
- contactPersonUuid: f,
894
- dealUuid: e.deal.uuid
895
- }
896
- });
897
- }
898
- return (f, c) => (s(), m(qe, { "default-values": ["general-info", "contact-persons"] }, {
899
- default: r(() => [
900
- i(J, {
901
- label: a(n).t("wise_crm.deal.detail.sidebar.accordion.general_info"),
902
- value: "general-info",
903
- icon: "infoCircle"
904
- }, {
905
- default: r(() => [
906
- i(wa, {
907
- deal: e.deal
908
- }, null, 8, ["deal"])
909
- ]),
910
- _: 1
911
- }, 8, ["label"]),
912
- i(J, {
913
- "is-empty": !d.value,
914
- label: a(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
915
- value: "contact-persons",
916
- icon: "userCircle",
917
- onAdd: p
918
- }, {
919
- actions: r(() => [
920
- d.value ? S("", !0) : (s(), m(ne, {
921
- key: 0,
922
- label: a(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
923
- class: "z-1",
924
- icon: "plus",
925
- onClick: p
926
- }, null, 8, ["label"]))
927
- ]),
928
- default: r(() => [
929
- (s(!0), T(B, null, Q(e.deal.contactPersons, (C) => (s(), m(a(na), {
930
- key: C.uuid,
931
- "layout-id": C.uuid
932
- }, {
933
- default: r(() => [
934
- i(va, {
935
- "contact-person": C,
936
- "on-toggle-is-primary": () => b(C.uuid),
937
- description: C.phone,
938
- onUpdate: (q) => v(C.uuid),
939
- onDelete: (q) => g(C.uuid)
940
- }, null, 8, ["contact-person", "on-toggle-is-primary", "description", "onUpdate", "onDelete"])
941
- ]),
942
- _: 2
943
- }, 1032, ["layout-id"]))), 128)),
944
- d.value ? (s(), m(a(ta), {
945
- key: 0,
946
- variant: "tertiary",
947
- size: "sm",
948
- "icon-left": "plus",
949
- onClick: p
950
- }, {
951
- default: r(() => [
952
- E(k(a(n).t("wise_crm.shared.add")), 1)
953
- ]),
954
- _: 1
955
- })) : S("", !0)
956
- ]),
957
- _: 1
958
- }, 8, ["is-empty", "label"])
959
- ]),
960
- _: 1
961
- }));
962
- }
963
- });
964
- function Ma() {
965
- return F({
966
- queryFn: async ({
967
- body: t,
968
- params: e
969
- }) => await $.transition(e.dealUuid, t.toBoardColumnUuid),
970
- queryKeysToInvalidate: {
971
- dealDetail: {
972
- dealUuid: (t) => t.dealUuid
973
- },
974
- dealIndex: {}
975
- }
976
- });
977
- }
978
- function La(t, e) {
979
- return se({
980
- queryFn: () => Ee.getTransitions(
981
- t.value,
982
- e.value
983
- ),
984
- queryKey: {
985
- boardColumnsTransition: {
986
- boardColumnUuid: t
987
- }
988
- }
989
- });
990
- }
991
- const qa = /* @__PURE__ */ U({
992
- __name: "DealDetailSidebarTransitionSelect",
993
- props: /* @__PURE__ */ Ce({
994
- deal: {}
995
- }, {
996
- modelValue: {
997
- required: !0
998
- },
999
- modelModifiers: {}
1000
- }),
1001
- emits: ["update:modelValue"],
1002
- setup(t) {
1003
- const e = t, n = N(), o = Ke(), l = A(Be), u = ve(t, "modelValue"), _ = M(), y = Ma(), d = La(
1004
- P(() => u.value.toColumnUuid),
1005
- P(() => o.getOptions().deals?.allowedTransitionTriggerTypes ?? [])
1006
- ), p = P(() => (d.data.value ?? []).flatMap((f) => f.triggers.length === 0 ? [
1007
- f
1008
- ] : f.triggers.map((c) => ({
1009
- ...f,
1010
- toColumnDisplayName: f.toColumnDisplayName,
1011
- triggers: [
1012
- c
1013
- ]
1014
- }))));
1015
- function v(b) {
1016
- return b?.toColumnDisplayName ?? "-";
1017
- }
1018
- async function g(b) {
1019
- if (b.triggers.length !== 0) {
1020
- if (b.triggers[0]?.triggerType === xe.EMAIL) {
1021
- l.open({
1022
- dealUuid: e.deal.uuid,
1023
- client: {
1024
- uuid: e.deal.client.uuid,
1025
- type: e.deal.client.type
1026
- },
1027
- templateKey: b.triggers[0].config.mailTemplateKey
1028
- });
1029
- return;
1030
- }
1031
- try {
1032
- u.value = b, await y.execute({
1033
- body: {
1034
- toBoardColumnUuid: b.toColumnUuid
1035
- },
1036
- params: {
1037
- dealUuid: e.deal.uuid
1038
- }
1039
- });
1040
- } catch (f) {
1041
- _.show(f);
1042
- }
1043
- }
1044
- }
1045
- return (b, f) => (s(), m(X, {
1046
- color: u.value?.toColumnColor ?? null
1047
- }, {
1048
- default: r(() => [
1049
- p.value.length === 0 ? (s(), m(a(me), {
1050
- key: 0,
1051
- "class-config": {
1052
- root: "text-nowrap"
1053
- },
1054
- variant: "translucent",
1055
- color: "brand"
1056
- }, {
1057
- default: r(() => [
1058
- E(k(u.value.toColumnDisplayName), 1)
1059
- ]),
1060
- _: 1
1061
- })) : (s(), m(a(G), {
1062
- key: 1,
1063
- "model-value": u.value,
1064
- "is-loading": a(y).isLoading.value,
1065
- "display-fn": v,
1066
- "class-config": {
1067
- item: "text-sm",
1068
- baseSingle: "text-brand-700",
1069
- root: "border-brand-200 bg-brand-25 w-fit h-7 py-xxs",
1070
- iconRight: "size-3 text-brand-700",
1071
- loader: "text-brand-700 size-3"
1072
- },
1073
- placeholder: a(n).t("wise_crm.deal.transition.placeholder"),
1074
- label: a(n).t("wise_crm.deal.transition.label"),
1075
- "onUpdate:modelValue": g
1076
- }, {
1077
- label: r(() => [
1078
- i(a(ce), { class: "sr-only" })
1079
- ]),
1080
- default: r(() => [
1081
- (s(!0), T(B, null, Q(p.value, (c) => (s(), m(a(W), {
1082
- key: c.uuid,
1083
- value: {
1084
- uuid: c.uuid,
1085
- toColumnUuid: c.toColumnUuid,
1086
- toColumnColor: c.toColumnColor,
1087
- toColumnDisplayName: c.toColumnDisplayName,
1088
- triggers: c.triggers
1089
- }
1090
- }, {
1091
- default: r(() => [
1092
- i(Qe, null, {
1093
- default: r(() => [
1094
- i(X, {
1095
- color: c.toColumnColor
1096
- }, {
1097
- default: r(() => [...f[0] || (f[0] = [
1098
- x("div", { class: "bg-brand-100 border-brand-400 size-3 rounded-full border" }, null, -1)
1099
- ])]),
1100
- _: 1
1101
- }, 8, ["color"]),
1102
- x("span", null, k(c.toColumnDisplayName), 1)
1103
- ]),
1104
- _: 2
1105
- }, 1024)
1106
- ]),
1107
- _: 2
1108
- }, 1032, ["value"]))), 128))
1109
- ]),
1110
- _: 1
1111
- }, 8, ["model-value", "is-loading", "placeholder", "label"]))
1112
- ]),
1113
- _: 1
1114
- }, 8, ["color"]));
1115
- }
1116
- });
1117
- function Ea() {
1118
- return F({
1119
- queryFn: async ({
1120
- body: t,
1121
- params: e
1122
- }) => await ue.create(t, {
1123
- dealUuid: e.dealUuid
1124
- }),
1125
- queryKeysToInvalidate: {
1126
- noteDealIndex: {}
1127
- }
1128
- });
1129
- }
1130
- function Ka(t, e) {
1131
- return Ae({
1132
- queryFn: (n) => ue.getDealNotes({
1133
- pagination: n
1134
- }, t.value),
1135
- queryKey: {
1136
- noteDealIndex: {
1137
- params: e?.params
1138
- }
1139
- }
1140
- });
1141
- }
1142
- const Ba = /* @__PURE__ */ U({
1143
- __name: "DealDialogSidebarNotesContent",
1144
- props: {
1145
- deal: {}
1146
- },
1147
- setup(t) {
1148
- const e = t, n = A(Oe), o = M(), l = Ea(), u = je(), _ = Ka(
1149
- P(() => e.deal.uuid)
1150
- ), y = P(() => _.data?.value?.data ?? []);
1151
- async function d(g) {
1152
- await l.execute({
1153
- body: g,
1154
- params: {
1155
- dealUuid: e.deal.uuid
1156
- }
1157
- });
1158
- }
1159
- async function p(g) {
1160
- try {
1161
- await u.execute({
1162
- params: {
1163
- noteUuid: g
1164
- }
1165
- });
1166
- } catch (b) {
1167
- o.show(b);
1168
- }
1169
- }
1170
- function v(g) {
1171
- n.open({
1172
- note: g
1173
- });
1174
- }
1175
- return (g, b) => (s(), m(ze, {
1176
- "is-loading": a(_).isLoading.value,
1177
- notes: y.value,
1178
- "on-submit": d,
1179
- "has-next-page": a(_).hasNextPage.value,
1180
- onNext: b[0] || (b[0] = (f) => a(_).fetchNextPage()),
1181
- onDelete: p,
1182
- onUpdate: v
1183
- }, null, 8, ["is-loading", "notes", "has-next-page"]));
1184
- }
1185
- }), Qa = { class: "flex h-full flex-1 flex-col" }, Aa = { class: "gap-xl border-primary p-xl flex flex-col rounded-2xl border" }, Oa = { class: "gap-sm flex w-full flex-wrap items-center" }, ja = { class: "max-w-50 truncate" }, za = /* @__PURE__ */ U({
1186
- __name: "DealDetailSidebar",
1187
- props: {
1188
- deal: {}
1189
- },
1190
- setup(t) {
1191
- const e = t, n = N(), o = Re(), l = V(
1192
- "overview"
1193
- /* OVERVIEW */
1194
- ), u = V({
1195
- // There is no uuid available for the initial value, so a placeholder is used
1196
- uuid: "",
1197
- toColumnUuid: e.deal.boardColumn.uuid,
1198
- toColumnColor: e.deal.boardColumn.color,
1199
- toColumnDisplayName: e.deal.boardColumn.displayName,
1200
- toColumnKey: "",
1201
- triggers: []
1202
- }), _ = P(() => [
1203
- {
1204
- icon: "infoCircle",
1205
- label: n.t("wise_crm.shared.overview"),
1206
- value: "overview"
1207
- /* OVERVIEW */
1208
- },
1209
- {
1210
- icon: "activity",
1211
- label: n.t("wise_crm.shared.activity"),
1212
- value: "activity"
1213
- /* ACTIVITY */
1214
- },
1215
- {
1216
- icon: "book",
1217
- label: n.t("wise_crm.shared.notes"),
1218
- value: "notes"
1219
- /* NOTES */
1220
- }
1221
- ]);
1222
- return (y, d) => (s(), T("div", Qa, [
1223
- x("div", Aa, [
1224
- i(ma, {
1225
- deal: e.deal
1226
- }, null, 8, ["deal"]),
1227
- x("div", Oa, [
1228
- i(Ge, {
1229
- onClick: d[0] || (d[0] = (p) => a(o).openBusinessDetail(
1230
- e.deal.client.uuid
1231
- ))
1232
- }, {
1233
- default: r(() => [
1234
- i(a(me), {
1235
- "class-config": {
1236
- icon: "shrink-0 size-4",
1237
- root: "text-nowrap"
1238
- },
1239
- variant: "translucent",
1240
- color: "brand",
1241
- icon: "building"
1242
- }, {
1243
- default: r(() => [
1244
- x("span", ja, k(e.deal.client.name ?? "-"), 1)
1245
- ]),
1246
- _: 1
1247
- })
1248
- ]),
1249
- _: 1
1250
- }),
1251
- i(qa, {
1252
- modelValue: u.value,
1253
- "onUpdate:modelValue": d[1] || (d[1] = (p) => u.value = p),
1254
- deal: e.deal
1255
- }, null, 8, ["modelValue", "deal"])
1256
- ])
1257
- ]),
1258
- i(We, {
1259
- modelValue: l.value,
1260
- "onUpdate:modelValue": d[2] || (d[2] = (p) => l.value = p),
1261
- tabs: _.value
1262
- }, {
1263
- default: r(() => [
1264
- l.value === "overview" ? (s(), m(Va, {
1265
- key: 0,
1266
- deal: e.deal
1267
- }, null, 8, ["deal"])) : l.value === "notes" ? (s(), m(Ba, {
1268
- key: 1,
1269
- deal: e.deal
1270
- }, null, 8, ["deal"])) : S("", !0)
1271
- ]),
1272
- _: 1
1273
- }, 8, ["modelValue", "tabs"])
1274
- ]));
1275
- }
1276
- }), Ra = /* @__PURE__ */ U({
1277
- __name: "DealDetailSidebarProvider",
1278
- props: {
1279
- dealUuid: {}
1280
- },
1281
- setup(t) {
1282
- const e = t, n = Ye(
1283
- P(() => e.dealUuid)
1284
- ), o = N();
1285
- return (l, u) => (s(), m(He, null, {
1286
- default: r(() => [
1287
- a(n).error.value ? (s(), m(Ze, {
1288
- key: 0,
1289
- message: a(o).t("error.deal_details.description"),
1290
- title: a(o).t("error.deal_details.title")
1291
- }, null, 8, ["message", "title"])) : a(n).isLoading.value ? (s(), m(Je, {
1292
- key: 1,
1293
- class: "h-full"
1294
- })) : a(n).data.value ? (s(), m(za, {
1295
- key: a(n).data.value.boardColumn.uuid,
1296
- deal: a(n).data.value
1297
- }, null, 8, ["deal"])) : S("", !0)
1298
- ]),
1299
- _: 1
1300
- }));
1301
- }
1302
- }), ot = /* @__PURE__ */ U({
1303
- __name: "DealDetailView",
1304
- props: {
1305
- tabs: {}
1306
- },
1307
- setup(t) {
1308
- const e = t, n = N(), o = we("dealUuid"), l = P(() => [
1309
- ...e.tabs,
1310
- {
1311
- label: P(() => n.t("wise_crm.deal.detail_view.communication_tab_label")),
1312
- to: "deal-communication"
1313
- }
1314
- ]);
1315
- return (u, _) => (s(), m(De, {
1316
- key: a(o),
1317
- "entity-type": a(ae).BUSINESS,
1318
- tabs: l.value
1319
- }, {
1320
- sidebar: r(() => [
1321
- i(Ra, { "deal-uuid": a(o) }, null, 8, ["deal-uuid"])
1322
- ]),
1323
- _: 1
1324
- }, 8, ["entity-type", "tabs"]));
1325
- }
1326
- });
1327
- export {
1328
- ot as default
1329
- };