@mobilon-dev/chotto 0.3.49 → 0.3.50

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,23 +1,27 @@
1
- import { ref as d, computed as m, watch as He, onMounted as $e, onUnmounted as Oe, createElementBlock as l, openBlock as o, createElementVNode as u, createCommentVNode as f, Fragment as q, renderList as W, unref as e, normalizeClass as v, createBlock as h, createVNode as Be, withCtx as V, resolveDynamicComponent as C, normalizeStyle as re, toDisplayString as L, nextTick as Fe } from "vue";
2
- import U from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
- import { useCommunicationChannels as je } from "./composables/useCommunicationChannels.js";
4
- import { useCommunicationMenu as Pe } from "./composables/useCommunicationMenu.js";
5
- import { useCommunicationAttributes as We } from "./composables/useCommunicationAttributes.js";
6
- import { useCommunicationActions as Ve } from "./composables/useCommunicationActions.js";
7
- import { useCommunicationSubMenu as Ue } from "./composables/useCommunicationSubMenu.js";
8
- import { useCommunicationDialogSync as Ge } from "./composables/useCommunicationDialogSync.js";
1
+ import { ref as h, computed as d, watch as Oe, onMounted as $e, onUnmounted as je, createElementBlock as l, openBlock as o, createElementVNode as u, createCommentVNode as m, Fragment as H, renderList as G, unref as e, normalizeClass as f, createBlock as v, createVNode as Be, withCtx as J, resolveDynamicComponent as A, normalizeStyle as he, toDisplayString as R, nextTick as Fe } from "vue";
2
+ import K from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
+ import { useCommunicationChannels as We } from "./composables/useCommunicationChannels.js";
4
+ import { useCommunicationMenu as Ve } from "./composables/useCommunicationMenu.js";
5
+ import { useCommunicationAttributes as Ue } from "./composables/useCommunicationAttributes.js";
6
+ import { useCommunicationActions as Ge } from "./composables/useCommunicationActions.js";
7
+ import { useCommunicationSubMenu as Je } from "./composables/useCommunicationSubMenu.js";
8
+ import { useCommunicationDialogSync as Ke } from "./composables/useCommunicationDialogSync.js";
9
+ import { useCommunicationPlaceholder as Qe } from "./composables/useCommunicationPlaceholder.js";
9
10
  /* empty css */
10
- import Je from "../../../_virtual/_plugin-vue_export-helper.js";
11
- const Ke = ["onClick", "onMouseenter"], Qe = { class: "channel-icon" }, Xe = { class: "channel-icon" }, Ye = {
11
+ import Xe from "../../../_virtual/_plugin-vue_export-helper.js";
12
+ const Ye = ["onClick", "onMouseenter"], Ze = { class: "channel-icon" }, et = { class: "channel-icon" }, tt = {
12
13
  key: 0,
13
14
  class: "menu-header"
14
- }, Ze = { class: "attribute-info" }, et = { class: "attribute-value" }, tt = { class: "attribute-info" }, nt = { class: "attribute-value" }, ot = {
15
+ }, nt = { class: "attribute-info" }, ot = { class: "attribute-value" }, st = { class: "attribute-info" }, lt = { class: "attribute-value" }, at = {
15
16
  key: 3,
16
17
  class: "menu-divider"
17
- }, st = ["onMouseenter", "onClick"], lt = { class: "attribute-info" }, at = { class: "attribute-value" }, it = { class: "menu-icon" }, ut = {
18
+ }, it = {
19
+ key: 4,
20
+ class: "empty-channels-placeholder"
21
+ }, ut = ["onMouseenter", "onClick"], rt = { class: "attribute-info" }, ct = { class: "attribute-value" }, dt = { class: "menu-icon" }, mt = {
18
22
  key: 0,
19
23
  class: "menu-icon-arrow"
20
- }, rt = ["onClick"], ct = { class: "sub-menu-title" }, dt = {
24
+ }, ht = ["onClick"], pt = { class: "sub-menu-title" }, ft = {
21
25
  __name: "CommunicationPanel",
22
26
  props: {
23
27
  contactAttributes: {
@@ -64,46 +68,51 @@ const Ke = ["onClick", "onMouseenter"], Qe = { class: "channel-icon" }, Xe = { c
64
68
  type: Boolean,
65
69
  required: !1,
66
70
  default: !1
71
+ },
72
+ emptyChannelsPlaceholder: {
73
+ type: Object,
74
+ required: !1,
75
+ default: () => ({})
67
76
  }
68
77
  },
69
78
  emits: ["select-attribute-channel", "phone-call"],
70
- setup(g, { emit: ce }) {
71
- const r = g, de = ce, T = d(null), G = d(null), H = d(null), $ = d(null), A = d(!1), w = d(null), O = d({}), y = d(!1), R = d(null), p = d(null), B = m(() => r.channels ?? []), me = m(() => r.channelTooltips ?? {}), J = m(() => r.messages ?? []), fe = m(() => r.selectedChat ?? null), K = m(() => r.isNewDialog ?? !1), {
72
- channelsTypes: pe,
73
- getTooltipText: ve,
74
- getChannelTypeFromId: he,
75
- hasMultipleChannels: I,
76
- isChannelActive: S,
77
- getSingleChannelForType: ye,
78
- getMenuChannelIconComponent: Q,
79
- getMenuChannelIconComponentForChannelId: be,
80
- getSingleMenuChannelIconComponent: Ce,
81
- getAvailableChannels: ge
82
- } = je({
83
- channels: B,
84
- channelTooltips: me,
85
- selectedChannelType: w
79
+ setup(g, { emit: pe }) {
80
+ const r = g, fe = pe, I = h(null), Q = h(null), O = h(null), $ = h(null), M = h(!1), S = h(null), j = h({}), y = h(!1), D = h(null), p = h(null), E = d(() => r.channels ?? []), ve = d(() => r.channelTooltips ?? {}), X = d(() => r.messages ?? []), ye = d(() => r.selectedChat ?? null), Y = d(() => r.isNewDialog ?? !1), {
81
+ channelsTypes: Ce,
82
+ getTooltipText: be,
83
+ getChannelTypeFromId: Z,
84
+ hasMultipleChannels: _,
85
+ isChannelActive: x,
86
+ getSingleChannelForType: Ae,
87
+ getMenuChannelIconComponent: ee,
88
+ getMenuChannelIconComponentForChannelId: ge,
89
+ getSingleMenuChannelIconComponent: Me,
90
+ getAvailableChannels: te
91
+ } = We({
92
+ channels: E,
93
+ channelTooltips: ve,
94
+ selectedChannelType: S
86
95
  }), {
87
96
  activeChannelType: s,
88
- hoveredChannel: D,
89
- showMenu: Ae,
90
- showSubMenu: F,
91
- menuWidth: Me,
92
- updateMenuWidth: j,
93
- handleChannelClick: ke,
94
- closeMenu: Te,
95
- handleClickOutside: X
96
- } = Pe({
97
- panelRef: T,
98
- channelsPanelRef: G,
99
- selectedChannelType: w,
97
+ hoveredChannel: z,
98
+ showMenu: ne,
99
+ showSubMenu: B,
100
+ menuWidth: ke,
101
+ updateMenuWidth: F,
102
+ handleChannelClick: Te,
103
+ closeMenu: we,
104
+ handleClickOutside: oe
105
+ } = Ve({
106
+ panelRef: I,
107
+ channelsPanelRef: Q,
108
+ selectedChannelType: S,
100
109
  frozenAttribute: $,
101
- isRecentAttributeHovered: A
102
- }), we = m(() => r.contactAttributes ?? []), Y = m(() => r.recentAttributeChannels ?? {}), Z = (i) => {
103
- var M;
104
- if (!i || !J.value) return !0;
105
- const n = (M = fe.value) == null ? void 0 : M.chatId;
106
- return n ? !J.value.filter(
110
+ isRecentAttributeHovered: M
111
+ }), Re = d(() => r.contactAttributes ?? []), W = d(() => r.recentAttributeChannels ?? {}), se = (i) => {
112
+ var T;
113
+ if (!i || !X.value) return !0;
114
+ const n = (T = ye.value) == null ? void 0 : T.chatId;
115
+ return n ? !X.value.filter(
107
116
  (c) => {
108
117
  var t;
109
118
  return c.chatId === n && c.dialogId === ((t = r.selectedDialog) == null ? void 0 : t.dialogId);
@@ -111,264 +120,278 @@ const Ke = ["onClick", "onMouseenter"], Qe = { class: "channel-icon" }, Xe = { c
111
120
  ).some(
112
121
  (c) => c.type !== "message.system" && c.type !== "message.delimiter" && c.type !== "system" && c.type !== "system_message" && c.type !== "notification"
113
122
  ) : !0;
114
- }, ee = () => {
115
- E(), y.value = !0, Fe(() => {
123
+ }, le = () => {
124
+ q(), y.value = !0, Fe(() => {
116
125
  const i = Array.isArray(p.value) ? p.value[0] : p.value;
117
126
  i && typeof i.startAutoShow == "function" ? i.startAutoShow() : console.log("startAutoShow method not found on tooltipRef");
118
- }), R.value = setTimeout(() => {
127
+ }), D.value = setTimeout(() => {
119
128
  y.value = !1;
120
129
  }, 5e3);
121
- }, E = () => {
122
- if (R.value && (clearTimeout(R.value), R.value = null), p.value) {
130
+ }, q = () => {
131
+ if (D.value && (clearTimeout(D.value), D.value = null), p.value) {
123
132
  const i = Array.isArray(p.value) ? p.value[0] : p.value;
124
133
  i && typeof i.clearAutoTimer == "function" && i.clearAutoTimer();
125
134
  }
126
135
  y.value = !1;
127
136
  }, {
128
- organizedContactAttributes: te,
129
- organizeContactAttributes: Re,
130
- recentAttribute: x,
131
- showRecentAttribute: _,
132
- isAttributeFrozen: Ie
133
- } = We({
134
- contactAttributes: we,
135
- recentAttributeChannels: Y,
137
+ organizedContactAttributes: V,
138
+ organizeContactAttributes: Ie,
139
+ recentAttribute: N,
140
+ showRecentAttribute: k,
141
+ isAttributeFrozen: Se
142
+ } = Ue({
143
+ contactAttributes: Re,
144
+ recentAttributeChannels: W,
136
145
  activeChannelType: s,
137
146
  frozenAttribute: $
138
147
  }), {
139
- handleRecentAttributeClick: Se,
140
- handleAttributeClick: De,
141
- selectChannel: Ee,
148
+ handleRecentAttributeClick: De,
149
+ handleAttributeClick: Ee,
150
+ selectChannel: _e,
142
151
  availableChannels: xe
143
- } = Ve({
152
+ } = Ge({
144
153
  activeChannelType: s,
145
- channels: B,
146
- recentAttributeChannels: Y,
147
- selectedChannel: O,
148
- selectedChannelType: w,
149
- isRecentAttributeHovered: A,
150
- hoveredAttribute: H,
151
- closeMenu: Te,
152
- hasMultipleChannels: I,
153
- getSingleChannelForType: ye,
154
- getAvailableChannels: ge,
155
- isChannelEmpty: Z,
156
- isNewDialog: K,
157
- showDefaultChannelTooltipWithTimer: ee,
158
- clearDefaultChannelTooltip: E,
159
- emit: de
160
- }), ne = () => {
161
- Se(x.value);
154
+ channels: E,
155
+ recentAttributeChannels: W,
156
+ selectedChannel: j,
157
+ selectedChannelType: S,
158
+ isRecentAttributeHovered: M,
159
+ hoveredAttribute: O,
160
+ closeMenu: we,
161
+ hasMultipleChannels: _,
162
+ getSingleChannelForType: Ae,
163
+ getAvailableChannels: te,
164
+ isChannelEmpty: se,
165
+ isNewDialog: Y,
166
+ showDefaultChannelTooltipWithTimer: le,
167
+ clearDefaultChannelTooltip: q,
168
+ emit: fe
169
+ }), ae = () => {
170
+ De(N.value);
162
171
  }, {
163
- subMenuTop: _e,
164
- resetRegularAttributeHover: z,
165
- handleRecentAttributeMouseEnter: ze,
166
- handleRecentAttributeMouseLeave: N,
172
+ subMenuTop: ze,
173
+ resetRegularAttributeHover: P,
174
+ handleRecentAttributeMouseEnter: qe,
175
+ handleRecentAttributeMouseLeave: L,
167
176
  handleAttributeMouseEnter: Ne,
168
- handleAttributeMouseLeave: oe,
169
- keepSubMenuOpen: se,
170
- closeSubMenu: le,
171
- alignSubMenuWithTarget: ae
172
- } = Ue({
177
+ handleAttributeMouseLeave: ie,
178
+ keepSubMenuOpen: ue,
179
+ closeSubMenu: re,
180
+ alignSubMenuWithTarget: ce
181
+ } = Je({
173
182
  activeChannelType: s,
174
- showSubMenu: F,
183
+ showSubMenu: B,
175
184
  frozenAttribute: $,
176
- hoveredAttribute: H,
177
- isRecentAttributeHovered: A,
178
- hasMultipleChannels: I
185
+ hoveredAttribute: O,
186
+ isRecentAttributeHovered: M,
187
+ hasMultipleChannels: _
179
188
  });
180
- Ge({
181
- selectedChannelType: w,
182
- selectedChannel: O,
183
- channels: B,
184
- selectedDialog: m(() => r.selectedDialog ?? null),
185
- isChannelEmpty: Z,
186
- isNewDialog: K,
187
- showDefaultChannelTooltipWithTimer: ee,
188
- clearDefaultChannelTooltip: E
189
+ Ke({
190
+ selectedChannelType: S,
191
+ selectedChannel: j,
192
+ channels: E,
193
+ selectedDialog: d(() => r.selectedDialog ?? null),
194
+ isChannelEmpty: se,
195
+ isNewDialog: Y,
196
+ showDefaultChannelTooltipWithTimer: le,
197
+ clearDefaultChannelTooltip: q
189
198
  });
190
- const ie = m(
199
+ const {
200
+ emptyChannelsPlaceholderText: Pe,
201
+ shouldShowEmptyChannelsPlaceholder: C
202
+ } = Qe({
203
+ showMenu: ne,
204
+ activeChannelType: s,
205
+ emptyChannelsPlaceholder: d(() => r.emptyChannelsPlaceholder ?? {}),
206
+ getAvailableChannels: te,
207
+ getChannelTypeFromId: Z,
208
+ channels: E,
209
+ recentAttributeChannels: W,
210
+ organizedContactAttributes: V,
211
+ showRecentAttribute: k
212
+ }), de = d(
191
213
  () => xe()
192
- ), qe = m(
193
- () => F.value && H.value && ie.value.length > 0 && s.value !== "phone" && I(s.value)
194
- ), ue = (i) => {
195
- const n = ze(i.currentTarget);
196
- n instanceof HTMLElement && ae(T, n);
197
- }, Le = (i, n) => {
214
+ ), Le = d(
215
+ () => B.value && O.value && de.value.length > 0 && s.value !== "phone" && _(s.value)
216
+ ), me = (i) => {
217
+ const n = qe(i.currentTarget);
218
+ n instanceof HTMLElement && ce(I, n);
219
+ }, He = (i, n) => {
198
220
  const b = Ne(i, n.currentTarget);
199
- b instanceof HTMLElement && ae(T, b);
221
+ b instanceof HTMLElement && ce(I, b);
200
222
  };
201
- return He(() => r.selectedDialog, () => {
223
+ return Oe(() => r.selectedDialog, () => {
202
224
  }, { deep: !0 }), $e(() => {
203
- j(), window.addEventListener("resize", j), document.addEventListener("click", X), Re();
204
- }), Oe(() => {
205
- window.removeEventListener("resize", j), document.removeEventListener("click", X), E();
225
+ F(), window.addEventListener("resize", F), document.addEventListener("click", oe), Ie();
226
+ }), je(() => {
227
+ window.removeEventListener("resize", F), document.removeEventListener("click", oe), q();
206
228
  }), (i, n) => {
207
- var b, P, M, c;
229
+ var b, U, T, c;
208
230
  return o(), l("div", {
209
231
  ref_key: "panelRef",
210
- ref: T,
232
+ ref: I,
211
233
  class: "communication-panel"
212
234
  }, [
213
235
  u("div", {
214
236
  ref_key: "channelsPanelRef",
215
- ref: G,
237
+ ref: Q,
216
238
  class: "channels-panel"
217
239
  }, [
218
- (o(!0), l(q, null, W(e(pe), (t) => {
240
+ (o(!0), l(H, null, G(e(Ce), (t) => {
219
241
  var a;
220
242
  return o(), l("button", {
221
243
  key: t.type,
222
- class: v(["channel-btn", {
223
- active: e(S)(t.type),
224
- hover: e(D) === t.type && !e(S)(t.type) || e(D) === t.type && e(S)(t.type)
244
+ class: f(["channel-btn", {
245
+ active: e(x)(t.type),
246
+ hover: e(z) === t.type && !e(x)(t.type) || e(z) === t.type && e(x)(t.type)
225
247
  }]),
226
- onClick: (k) => e(ke)(t.type),
227
- onMouseenter: (k) => D.value = t.type,
228
- onMouseleave: n[0] || (n[0] = (k) => D.value = null)
248
+ onClick: (w) => e(Te)(t.type),
249
+ onMouseenter: (w) => z.value = t.type,
250
+ onMouseleave: n[0] || (n[0] = (w) => z.value = null)
229
251
  }, [
230
- e(S)(t.type) ? (o(), l(q, { key: 0 }, [
231
- Be(U, {
252
+ e(x)(t.type) ? (o(), l(H, { key: 0 }, [
253
+ Be(K, {
232
254
  ref_for: !0,
233
- ref: (k) => {
234
- k && (p.value = k);
255
+ ref: (w) => {
256
+ w && (p.value = w);
235
257
  },
236
- text: y.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (a = O.value) == null ? void 0 : a.title,
258
+ text: y.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (a = j.value) == null ? void 0 : a.title,
237
259
  position: "bottom-left",
238
260
  offset: 8,
239
261
  trigger: y.value ? "auto" : "hover",
240
262
  "auto-show-duration": y.value ? 5e3 : 0
241
263
  }, {
242
- default: V(() => [
243
- u("span", Qe, [
244
- (o(), h(C(t.component)))
264
+ default: J(() => [
265
+ u("span", Ze, [
266
+ (o(), v(A(t.component)))
245
267
  ])
246
268
  ]),
247
269
  _: 2
248
270
  }, 1032, ["text", "trigger", "auto-show-duration"]),
249
271
  n[12] || (n[12] = u("span", { class: "active-indicator" }, null, -1))
250
- ], 64)) : (o(), h(U, {
272
+ ], 64)) : (o(), v(K, {
251
273
  key: 1,
252
- text: e(ve)(t.type),
274
+ text: e(be)(t.type),
253
275
  position: "bottom-left",
254
276
  offset: 8
255
277
  }, {
256
- default: V(() => [
257
- u("span", Xe, [
258
- (o(), h(C(t.component)))
278
+ default: J(() => [
279
+ u("span", et, [
280
+ (o(), v(A(t.component)))
259
281
  ])
260
282
  ]),
261
283
  _: 2
262
284
  }, 1032, ["text"]))
263
- ], 42, Ke);
285
+ ], 42, Ye);
264
286
  }), 128))
265
287
  ], 512),
266
- e(Ae) && e(s) ? (o(), l("div", {
288
+ e(ne) && e(s) ? (o(), l("div", {
267
289
  key: 0,
268
290
  class: "attributes-menu",
269
- style: re({ width: e(Me) })
291
+ style: he({ width: e(ke) })
270
292
  }, [
271
- e(_) ? (o(), l("div", Ye, " Недавний ")) : f("", !0),
272
- e(_) && ((b = r.recentAttributeChannels[e(s)]) != null && b.tooltip) ? (o(), h(U, {
293
+ e(k) && !e(C) ? (o(), l("div", tt, " Недавний ")) : m("", !0),
294
+ e(k) && !e(C) && ((b = r.recentAttributeChannels[e(s)]) != null && b.tooltip) ? (o(), v(K, {
273
295
  key: 1,
274
- text: (P = r.recentAttributeChannels[e(s)]) == null ? void 0 : P.tooltip,
296
+ text: (U = r.recentAttributeChannels[e(s)]) == null ? void 0 : U.tooltip,
275
297
  position: "bottom",
276
298
  offset: 8
277
299
  }, {
278
- default: V(() => {
300
+ default: J(() => {
279
301
  var t;
280
302
  return [
281
303
  u("div", {
282
- class: v(["recent-attribute", {
283
- "frozen-hover": A.value
304
+ class: f(["recent-attribute", {
305
+ "frozen-hover": M.value
284
306
  }]),
285
- onMouseenter: n[1] || (n[1] = (a) => ue(a)),
286
- onMouseleave: n[2] || (n[2] = (...a) => e(N) && e(N)(...a)),
287
- onMouseover: n[3] || (n[3] = (...a) => e(z) && e(z)(...a)),
288
- onClick: n[4] || (n[4] = (a) => ne())
307
+ onMouseenter: n[1] || (n[1] = (a) => me(a)),
308
+ onMouseleave: n[2] || (n[2] = (...a) => e(L) && e(L)(...a)),
309
+ onMouseover: n[3] || (n[3] = (...a) => e(P) && e(P)(...a)),
310
+ onClick: n[4] || (n[4] = (a) => ae())
289
311
  }, [
290
- u("div", Ze, [
291
- u("span", et, L((t = e(x)) == null ? void 0 : t.value), 1)
312
+ u("div", nt, [
313
+ u("span", ot, R((t = e(N)) == null ? void 0 : t.value), 1)
292
314
  ]),
293
315
  g.showChannelIcons ? (o(), l("span", {
294
316
  key: 0,
295
- class: v(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
317
+ class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
296
318
  }, [
297
- (o(), h(C(e(Q)(e(s)))))
298
- ], 2)) : f("", !0)
319
+ (o(), v(A(e(ee)(e(s)))))
320
+ ], 2)) : m("", !0)
299
321
  ], 34)
300
322
  ];
301
323
  }),
302
324
  _: 1
303
- }, 8, ["text"])) : e(_) ? (o(), l("div", {
325
+ }, 8, ["text"])) : e(k) && !e(C) ? (o(), l("div", {
304
326
  key: 2,
305
- class: v(["recent-attribute", {
306
- "frozen-hover": A.value
327
+ class: f(["recent-attribute", {
328
+ "frozen-hover": M.value
307
329
  }]),
308
- onMouseenter: n[5] || (n[5] = (t) => ue(t)),
309
- onMouseleave: n[6] || (n[6] = (...t) => e(N) && e(N)(...t)),
310
- onMouseover: n[7] || (n[7] = (...t) => e(z) && e(z)(...t)),
311
- onClick: n[8] || (n[8] = (t) => ne(e(x)))
330
+ onMouseenter: n[5] || (n[5] = (t) => me(t)),
331
+ onMouseleave: n[6] || (n[6] = (...t) => e(L) && e(L)(...t)),
332
+ onMouseover: n[7] || (n[7] = (...t) => e(P) && e(P)(...t)),
333
+ onClick: n[8] || (n[8] = (t) => ae(e(N)))
312
334
  }, [
313
- u("div", tt, [
314
- u("span", nt, L((M = e(x)) == null ? void 0 : M.value), 1)
335
+ u("div", st, [
336
+ u("span", lt, R((T = e(N)) == null ? void 0 : T.value), 1)
315
337
  ]),
316
338
  g.showChannelIcons ? (o(), l("span", {
317
339
  key: 0,
318
- class: v(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
340
+ class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
319
341
  }, [
320
- (o(), h(C(e(Q)(e(s)))))
321
- ], 2)) : f("", !0)
322
- ], 34)) : f("", !0),
323
- e(_) && ((c = e(te)[e(s)]) != null && c.length) && e(s) !== "phone" ? (o(), l("div", ot)) : f("", !0),
324
- (o(!0), l(q, null, W(e(te)[e(s)], (t) => (o(), l("div", {
342
+ (o(), v(A(e(ee)(e(s)))))
343
+ ], 2)) : m("", !0)
344
+ ], 34)) : m("", !0),
345
+ e(k) && !e(C) && ((c = e(V)[e(s)]) != null && c.length) && e(s) !== "phone" ? (o(), l("div", at)) : m("", !0),
346
+ e(C) ? (o(), l("div", it, R(e(Pe)), 1)) : m("", !0),
347
+ e(C) ? m("", !0) : (o(!0), l(H, { key: 5 }, G(e(V)[e(s)], (t) => (o(), l("div", {
325
348
  key: t.attributeId,
326
- class: v(["attribute-item", {
327
- "frozen-hover": e(Ie)(t)
349
+ class: f(["attribute-item", {
350
+ "frozen-hover": e(Se)(t)
328
351
  }]),
329
- onMouseenter: (a) => Le(t, a),
330
- onMouseleave: n[9] || (n[9] = (...a) => e(oe) && e(oe)(...a)),
331
- onClick: (a) => e(De)(t)
352
+ onMouseenter: (a) => He(t, a),
353
+ onMouseleave: n[9] || (n[9] = (...a) => e(ie) && e(ie)(...a)),
354
+ onClick: (a) => e(Ee)(t)
332
355
  }, [
333
- u("div", lt, [
334
- u("span", at, L(t.value), 1)
356
+ u("div", rt, [
357
+ u("span", ct, R(t.value), 1)
335
358
  ]),
336
- u("span", it, [
337
- e(I)(e(s)) ? (o(), l("span", ut)) : g.showChannelIcons ? (o(), l("span", {
359
+ u("span", dt, [
360
+ e(_)(e(s)) ? (o(), l("span", mt)) : g.showChannelIcons ? (o(), l("span", {
338
361
  key: 1,
339
- class: v(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
362
+ class: f(["channel-icon-small", { "menu-icon-grey": e(s) !== "sms" }])
340
363
  }, [
341
- (o(), h(C(e(Ce)(e(s)))))
342
- ], 2)) : f("", !0)
364
+ (o(), v(A(e(Me)(e(s)))))
365
+ ], 2)) : m("", !0)
343
366
  ])
344
- ], 42, st))), 128)),
345
- e(F) && qe.value ? (o(), l("div", {
346
- key: 4,
367
+ ], 42, ut))), 128)),
368
+ e(B) && Le.value ? (o(), l("div", {
369
+ key: 6,
347
370
  class: "sub-menu left",
348
- style: re({ top: e(_e) + "px" }),
349
- onMouseenter: n[10] || (n[10] = (...t) => e(se) && e(se)(...t)),
350
- onMouseleave: n[11] || (n[11] = (...t) => e(le) && e(le)(...t))
371
+ style: he({ top: e(ze) + "px" }),
372
+ onMouseenter: n[10] || (n[10] = (...t) => e(ue) && e(ue)(...t)),
373
+ onMouseleave: n[11] || (n[11] = (...t) => e(re) && e(re)(...t))
351
374
  }, [
352
375
  n[13] || (n[13] = u("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
353
- (o(!0), l(q, null, W(ie.value, (t) => (o(), l("div", {
376
+ (o(!0), l(H, null, G(de.value, (t) => (o(), l("div", {
354
377
  key: t.channelId,
355
378
  class: "sub-menu-item",
356
- onClick: (a) => e(Ee)(t.channelId)
379
+ onClick: (a) => e(_e)(t.channelId)
357
380
  }, [
358
- u("span", ct, L(t.title || t.channelId), 1),
381
+ u("span", pt, R(t.title || t.channelId), 1),
359
382
  g.showChannelIcons ? (o(), l("span", {
360
383
  key: 0,
361
- class: v(["sub-menu-icon", { "menu-icon-grey": e(he)(t.channelId) !== "sms" }])
384
+ class: f(["sub-menu-icon", { "menu-icon-grey": e(Z)(t.channelId) !== "sms" }])
362
385
  }, [
363
- (o(), h(C(e(be)(t.channelId))))
364
- ], 2)) : f("", !0)
365
- ], 8, rt))), 128))
366
- ], 36)) : f("", !0)
367
- ], 4)) : f("", !0)
386
+ (o(), v(A(e(ge)(t.channelId))))
387
+ ], 2)) : m("", !0)
388
+ ], 8, ht))), 128))
389
+ ], 36)) : m("", !0)
390
+ ], 4)) : m("", !0)
368
391
  ], 512);
369
392
  };
370
393
  }
371
- }, Mt = /* @__PURE__ */ Je(dt, [["__scopeId", "data-v-31679be9"]]);
394
+ }, It = /* @__PURE__ */ Xe(ft, [["__scopeId", "data-v-8aa7a6b7"]]);
372
395
  export {
373
- Mt as default
396
+ It as default
374
397
  };
@@ -0,0 +1,31 @@
1
+ import { computed as n, unref as l } from "vue";
2
+ function x({
3
+ showMenu: c,
4
+ activeChannelType: e,
5
+ emptyChannelsPlaceholder: h,
6
+ getAvailableChannels: f,
7
+ getChannelTypeFromId: i,
8
+ channels: d,
9
+ recentAttributeChannels: v,
10
+ organizedContactAttributes: m,
11
+ showRecentAttribute: p
12
+ }) {
13
+ const r = n(() => l(h) ?? {}), C = n(() => l(d) ?? []), b = n(() => l(v) ?? {}), a = n(() => !e.value || !r.value ? null : r.value[e.value] || null), I = n(() => {
14
+ var o;
15
+ if (!c.value || !e.value || !a.value)
16
+ return !1;
17
+ const y = f(e.value).length === 0, u = m.value[e.value], A = !u || u.length === 0, F = !p.value;
18
+ if (y) {
19
+ const t = (o = b.value[e.value]) == null ? void 0 : o.channelId;
20
+ return !(t && C.value.find((s) => s.channelId === t) && i(t) === e.value);
21
+ }
22
+ return !!(A && F);
23
+ });
24
+ return {
25
+ emptyChannelsPlaceholderText: a,
26
+ shouldShowEmptyChannelsPlaceholder: I
27
+ };
28
+ }
29
+ export {
30
+ x as useCommunicationPlaceholder
31
+ };