@mobilon-dev/chotto 0.3.82 → 0.3.84

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 (30) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
  3. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +66 -51
  4. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +366 -283
  5. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +46 -34
  6. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +64 -39
  7. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +116 -61
  8. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.js +1 -1
  9. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +30 -16
  10. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +47 -0
  11. package/dist/components/2_blocks/CommunicationPanel/icons/{CommunicationPanelConfirmSpinner.vue2.js → CommunicationPanelConfirmSpinner.vue.js} +1 -1
  12. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +19 -0
  13. package/dist/themes/dark.css +1 -1
  14. package/dist/themes/default.css +1 -1
  15. package/dist/themes/glass.css +1 -1
  16. package/dist/themes/green.css +1 -1
  17. package/dist/themes/mobilon1.css +1 -1
  18. package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +10 -0
  19. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +4 -0
  20. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.d.ts +4 -2
  21. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +10 -1
  22. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +23 -2
  23. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -0
  24. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.d.ts +20 -0
  25. package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.d.ts +2 -0
  26. package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
  27. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +4 -0
  28. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +42 -10
  29. package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +1 -1
  30. package/package.json +1 -1
@@ -1,33 +1,31 @@
1
- import { ref as d, computed as i, watch as H, onMounted as Ue, onUnmounted as Ge, createElementBlock as a, openBlock as s, createCommentVNode as f, unref as n, Fragment as A, renderList as W, normalizeClass as v, createBlock as y, createVNode as B, createElementVNode as c, withCtx as U, resolveDynamicComponent as I, toDisplayString as P, normalizeStyle as Je, nextTick as ve } from "vue";
2
- import G from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
- import { useCommunicationChannels as Ke } from "./composables/useCommunicationChannels.js";
4
- import { useCommunicationMenu as Qe } from "./composables/useCommunicationMenu.js";
5
- import { useCommunicationAttributes as Xe, isAttributeBlocked as Ye, getAttributeStatusClass as ye, isAttributeConfirming as Ce } from "./composables/useCommunicationAttributes.js";
6
- import { useCommunicationActions as Ze } from "./composables/useCommunicationActions.js";
7
- import { useCommunicationSubMenu as et } from "./composables/useCommunicationSubMenu.js";
8
- import { useCommunicationDialogSync as tt } from "./composables/useCommunicationDialogSync.js";
9
- import { useCommunicationPlaceholder as nt } from "./composables/useCommunicationPlaceholder.js";
10
- import be from "./CommunicationPanelAttributeIndicator.vue.js";
11
- import ot from "./icons/CommunicationPanelCheckIcon.vue.js";
12
- /* empty css */
13
- import st from "../../../_virtual/_plugin-vue_export-helper.js";
1
+ import { ref as m, computed as a, watch as j, onMounted as at, onUnmounted as it, createElementBlock as u, openBlock as l, createCommentVNode as y, unref as n, Fragment as w, renderList as te, normalizeClass as g, createBlock as v, createVNode as ne, createElementVNode as d, withCtx as oe, resolveDynamicComponent as _, toDisplayString as z, normalizeStyle as ut, nextTick as le } from "vue";
2
+ import se from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
+ import { useCommunicationChannels as rt } from "./composables/useCommunicationChannels.js";
4
+ import { useCommunicationMenu as ct } from "./composables/useCommunicationMenu.js";
5
+ import { useCommunicationAttributes as dt, isAttributeBlocked as ft, getAttributeStatusClass as Re, isAttributeConfirming as qe, getSubMenuChannelIndicatorType as pt, getSubMenuChannelIndicatorClass as mt } from "./composables/useCommunicationAttributes.js";
6
+ import { useCommunicationActions as vt } from "./composables/useCommunicationActions.js";
7
+ import { useCommunicationSubMenu as ht } from "./composables/useCommunicationSubMenu.js";
8
+ import { useCommunicationDialogSync as yt } from "./composables/useCommunicationDialogSync.js";
9
+ import { useCommunicationPlaceholder as Ct } from "./composables/useCommunicationPlaceholder.js";
10
+ import Pe from "./CommunicationPanelAttributeIndicator.vue.js";
11
+ import bt from "./icons/CommunicationPanelCheckIcon.vue.js";
12
+ import gt from "./icons/CommunicationPanelUnconfirmedIcon.vue.js";
13
+ import kt from "./icons/CommunicationPanelConfirmSpinner.vue.js";
14
+ import It from "../../../_virtual/_plugin-vue_export-helper.js";
14
15
  /* empty css */
15
- const lt = ["onClick", "onMouseenter"], at = { class: "channel-icon" }, it = { class: "channel-icon" }, ut = {
16
+ const At = ["data-channel-type", "onClick", "onMouseenter"], Tt = { class: "channel-icon" }, Mt = { class: "channel-icon" }, St = {
16
17
  key: 1,
17
18
  class: "attributes-menu"
18
- }, rt = {
19
+ }, wt = {
19
20
  key: 0,
20
21
  class: "empty-channels-placeholder"
21
- }, ct = ["data-attribute-status", "onMouseenter", "onClick"], dt = { class: "attribute-info" }, ft = { class: "attribute-value" }, mt = { class: "menu-icon" }, pt = {
22
+ }, _t = ["data-attribute-status", "onMouseenter", "onClick"], Dt = { class: "attribute-info" }, Rt = { class: "attribute-value" }, qt = { class: "menu-icon" }, Pt = {
22
23
  key: 0,
23
24
  class: "menu-icon-arrow"
24
- }, ht = ["data-attribute-status", "onMouseenter", "onClick"], vt = { class: "attribute-info" }, yt = { class: "attribute-value" }, Ct = { class: "menu-icon" }, bt = {
25
+ }, xt = ["data-attribute-status", "onMouseenter", "onClick"], Ot = { class: "attribute-info" }, Bt = { class: "attribute-value" }, Nt = { class: "menu-icon" }, Et = {
25
26
  key: 0,
26
27
  class: "menu-icon-arrow"
27
- }, gt = ["onClick"], kt = {
28
- key: 0,
29
- class: "selected-indicator"
30
- }, At = { class: "sub-menu-title" }, It = {
28
+ }, $t = ["onClick"], jt = { class: "sub-menu-indicator-slot" }, zt = { class: "sub-menu-title" }, Ft = {
31
29
  __name: "CommunicationPanel",
32
30
  props: {
33
31
  contactAttributes: {
@@ -115,6 +113,21 @@ const lt = ["onClick", "onMouseenter"], at = { class: "channel-icon" }, it = { c
115
113
  type: Array,
116
114
  required: !1,
117
115
  default: void 0
116
+ },
117
+ /** Задержка показа тултипов (ms) */
118
+ tooltipDelay: {
119
+ type: Number,
120
+ required: !1,
121
+ default: 3e3
122
+ },
123
+ /**
124
+ * Последний выбор attribute+channel per тип кнопки (whatsapp/telegram/max/sms/phone).
125
+ * Используется для one-click при переключении между мессенджерами.
126
+ */
127
+ recentAttributeChannels: {
128
+ type: Object,
129
+ required: !1,
130
+ default: () => ({})
118
131
  }
119
132
  },
120
133
  emits: [
@@ -123,338 +136,408 @@ const lt = ["onClick", "onMouseenter"], at = { class: "channel-icon" }, it = { c
123
136
  "phone-call",
124
137
  "reset-blocked-attributes"
125
138
  ],
126
- setup(T, { emit: ge }) {
127
- const l = T, J = ge, E = d(null), ke = d(null), N = d(null), z = d(null), _ = d(null), $ = d({}), C = d(!1), M = d(null), m = d(null), S = d(null), b = i(
128
- () => l.confirmingAttributeId ?? S.value
129
- ), j = i(() => l.blockedAttributeIds ?? []), g = (t) => Ye(t, j.value), F = i(() => l.channels ?? []), Ae = i(() => l.channelOrder), Ie = i(() => l.visibleChannelTypes), Te = i(() => l.channelTooltips ?? {}), _e = i(() => l.attributeTooltips ?? {}), K = i(() => l.attributeIndicatorTooltips ?? {}), Q = i(() => l.messages ?? []), Me = i(() => l.selectedChat ?? null), X = i(() => l.isNewDialog ?? !1), Se = i(() => {
130
- var t;
131
- return ((t = l.selectedDialog) == null ? void 0 : t.channelId) ?? null;
132
- }), Y = (t) => Se.value === t, we = i(() => {
133
- var t;
134
- return ((t = l.selectedDialog) == null ? void 0 : t.attributeId) ?? null;
135
- }), w = (t) => {
136
- const o = we.value;
137
- if (!o || !t)
139
+ setup(h, { emit: xe }) {
140
+ const i = h, ae = xe, F = m(null), Oe = m(null), D = m(null), R = m(null), T = m(null), L = m({}), V = m(null), A = m(!1), q = m(null), C = m(null), P = m(null), k = a(
141
+ () => i.confirmingAttributeId ?? P.value
142
+ ), W = a(() => i.blockedAttributeIds ?? []), M = (e) => ft(e, W.value), H = a(() => i.channels ?? []), Be = a(() => i.channelOrder), Ne = a(() => i.visibleChannelTypes), Ee = a(() => i.channelTooltips ?? {}), $e = a(() => i.attributeTooltips ?? {}), ie = a(() => i.attributeIndicatorTooltips ?? {}), ue = a(() => i.recentAttributeChannels ?? {}), re = a(() => i.messages ?? []), je = a(() => i.selectedChat ?? null), ce = a(() => i.isNewDialog ?? !1), de = a(() => {
143
+ var e;
144
+ return ((e = i.selectedDialog) == null ? void 0 : e.channelId) ?? null;
145
+ }), x = (e, o) => {
146
+ if (!o || !e)
147
+ return !1;
148
+ const t = e.id ?? e.attributeId;
149
+ if (!t)
138
150
  return !1;
139
- const e = t.id ?? t.attributeId;
140
- return o === e;
141
- }, Z = (t) => {
142
- const o = _e.value, e = (t == null ? void 0 : t.attributeId) ?? (t == null ? void 0 : t.id);
143
- if (e != null) {
144
- const u = o[String(e)];
145
- if (u)
146
- return u;
151
+ const s = o.includes(".") ? o.split(".").pop() : o;
152
+ return o === t || t === s || t.endsWith(`.${s}`);
153
+ }, fe = (e) => {
154
+ const o = $e.value, t = (e == null ? void 0 : e.attributeId) ?? (e == null ? void 0 : e.id);
155
+ if (t != null) {
156
+ const s = o[String(t)];
157
+ if (s)
158
+ return s;
147
159
  }
148
- return t != null && t.value ? o[String(t.value)] ?? "" : "";
149
- }, Re = (t) => !!Z(t), {
150
- panelChannelTypes: De,
151
- channelsTypes: ee,
152
- getTooltipText: qe,
153
- getChannelTypeFromId: xe,
154
- hasMultipleChannels: k,
155
- isChannelActive: R,
156
- getSingleChannelForType: Oe,
157
- getMenuChannelIconComponentForChannelId: Be,
158
- getSingleMenuChannelIconComponent: te,
159
- getAvailableChannels: ne
160
- } = Ke({
161
- channels: F,
162
- channelTooltips: Te,
163
- channelOrder: Ae,
164
- visibleChannelTypes: Ie,
165
- selectedChannelType: _
160
+ return e != null && e.value ? o[String(e.value)] ?? "" : "";
161
+ }, ze = (e) => !!fe(e), {
162
+ panelChannelTypes: Fe,
163
+ channelsTypes: pe,
164
+ getTooltipText: Le,
165
+ getChannelTypeFromId: Ve,
166
+ hasMultipleChannels: S,
167
+ isChannelActive: O,
168
+ getSingleChannelForType: We,
169
+ getMenuChannelIconComponentForChannelId: He,
170
+ getSingleMenuChannelIconComponent: me,
171
+ getAvailableChannels: ve
172
+ } = rt({
173
+ channels: H,
174
+ channelTooltips: Ee,
175
+ channelOrder: Be,
176
+ visibleChannelTypes: Ne,
177
+ selectedChannelType: T
166
178
  }), {
167
179
  activeChannelType: r,
168
- hoveredChannel: D,
169
- showMenu: q,
170
- showSubMenu: L,
171
- handleChannelClick: Pe,
172
- closeMenu: oe,
173
- handleClickOutside: se
174
- } = Qe({
175
- panelRef: E,
176
- selectedChannelType: _,
177
- frozenAttribute: z
178
- }), V = i(() => l.contactAttributes ?? []), le = (t) => {
179
- var p;
180
- if (!t || !Q.value) return !0;
181
- const o = (p = Me.value) == null ? void 0 : p.chatId;
182
- return o ? !Q.value.filter(
183
- (h) => {
184
- var he;
185
- return h.chatId === o && h.dialogId === ((he = l.selectedDialog) == null ? void 0 : he.dialogId);
180
+ hoveredChannel: B,
181
+ showMenu: b,
182
+ showSubMenu: U,
183
+ handleChannelClick: Ue,
184
+ openMenu: Ge,
185
+ closeMenu: G,
186
+ handleClickOutside: he
187
+ } = ct({
188
+ panelRef: F,
189
+ selectedChannelType: T,
190
+ frozenAttribute: R
191
+ }), J = a(() => {
192
+ var e;
193
+ return ((e = i.selectedDialog) == null ? void 0 : e.attributeId) ?? null;
194
+ }), ye = a(() => {
195
+ if (!b.value || !r.value)
196
+ return null;
197
+ const e = V.value;
198
+ return e && e.channelType === r.value ? e : null;
199
+ }), K = (e) => {
200
+ var De;
201
+ const o = typeof e == "string" ? e : e == null ? void 0 : e.channelId, t = typeof e == "object" && e != null ? e.backendChannelId : void 0, s = (p, ee) => !p || !ee ? !1 : !!(p === ee || t && (p === t || ee === t)), c = ye.value;
202
+ if (c != null && c.channelId && s(c.channelId, o))
203
+ return !0;
204
+ const f = r.value, I = Q.value;
205
+ if (b.value && f && I) {
206
+ const p = (De = ue.value) == null ? void 0 : De[f];
207
+ if (p != null && p.channelId && (p != null && p.attributeId) && x(I, p.attributeId) && s(p.channelId, o))
208
+ return !0;
209
+ }
210
+ return b.value && f && I && J.value && x(I, J.value) && s(de.value, o) ? !0 : s(de.value, o);
211
+ }, N = (e) => {
212
+ const o = ye.value;
213
+ return o != null && o.attributeId ? x(e, o.attributeId) : x(e, J.value);
214
+ }, Q = a(() => D.value ?? R.value ?? null), Ce = (e) => {
215
+ const o = e == null ? void 0 : e.backendChannelId;
216
+ return o ? [o] : [];
217
+ }, X = (e) => pt(
218
+ Q.value,
219
+ e.channelId,
220
+ K(e),
221
+ k.value,
222
+ Ce(e)
223
+ ), Je = (e) => mt(
224
+ Q.value,
225
+ e.channelId,
226
+ K(e),
227
+ k.value,
228
+ Ce(e)
229
+ ) ?? "", Y = a(() => i.contactAttributes ?? []), be = (e) => {
230
+ var c;
231
+ if (!e || !re.value) return !0;
232
+ const o = (c = je.value) == null ? void 0 : c.chatId;
233
+ return o ? !re.value.filter(
234
+ (f) => {
235
+ var I;
236
+ return f.chatId === o && f.dialogId === ((I = i.selectedDialog) == null ? void 0 : I.dialogId);
186
237
  }
187
238
  ).some(
188
- (h) => h.type !== "message.system" && h.type !== "message.delimiter" && h.type !== "system" && h.type !== "system_message" && h.type !== "notification"
239
+ (f) => f.type !== "message.system" && f.type !== "message.delimiter" && f.type !== "system" && f.type !== "system_message" && f.type !== "notification"
189
240
  ) : !0;
190
- }, ae = () => {
191
- x(), C.value = !0, ve(() => {
192
- const t = Array.isArray(m.value) ? m.value[0] : m.value;
193
- t && typeof t.startAutoShow == "function" ? t.startAutoShow() : console.log("startAutoShow method not found on tooltipRef");
194
- }), M.value = setTimeout(() => {
195
- C.value = !1;
241
+ }, ge = () => {
242
+ E(), A.value = !0, le(() => {
243
+ const e = Array.isArray(C.value) ? C.value[0] : C.value;
244
+ e && typeof e.startAutoShow == "function" ? e.startAutoShow() : console.log("startAutoShow method not found on tooltipRef");
245
+ }), q.value = setTimeout(() => {
246
+ A.value = !1;
196
247
  }, 5e3);
197
- }, x = () => {
198
- if (M.value && (clearTimeout(M.value), M.value = null), m.value) {
199
- const t = Array.isArray(m.value) ? m.value[0] : m.value;
200
- t && typeof t.clearAutoTimer == "function" && t.clearAutoTimer();
248
+ }, E = () => {
249
+ if (q.value && (clearTimeout(q.value), q.value = null), C.value) {
250
+ const e = Array.isArray(C.value) ? C.value[0] : C.value;
251
+ e && typeof e.clearAutoTimer == "function" && e.clearAutoTimer();
201
252
  }
202
- C.value = !1;
253
+ A.value = !1;
203
254
  }, {
204
- organizedContactAttributes: ie,
205
- organizeContactAttributes: Ee,
206
- isAttributeFrozen: ue
207
- } = Xe({
208
- contactAttributes: V,
209
- panelChannelTypes: De,
210
- frozenAttribute: z
255
+ organizedContactAttributes: Z,
256
+ organizeContactAttributes: Ke,
257
+ isAttributeFrozen: ke
258
+ } = dt({
259
+ contactAttributes: Y,
260
+ panelChannelTypes: Fe,
261
+ frozenAttribute: R
211
262
  }), {
212
- handleAttributeClick: Ne,
213
- selectChannel: ze,
214
- availableChannels: $e
215
- } = Ze({
263
+ handleAttributeClick: Qe,
264
+ selectChannel: Xe,
265
+ availableChannels: Ye,
266
+ applyRecentChannelButtonSelection: Ze,
267
+ clearPanelPendingSelection: Ie
268
+ } = vt({
216
269
  activeChannelType: r,
217
- channels: F,
218
- selectedChannel: $,
219
- selectedChannelType: _,
220
- hoveredAttribute: N,
221
- confirmingAttributeId: S,
222
- isAttributeBlocked: g,
223
- closeMenu: oe,
224
- hasMultipleChannels: k,
225
- getSingleChannelForType: Oe,
226
- getAvailableChannels: ne,
227
- isChannelEmpty: le,
228
- isNewDialog: X,
229
- showDefaultChannelTooltipWithTimer: ae,
230
- clearDefaultChannelTooltip: x,
231
- emit: J
270
+ channels: H,
271
+ selectedChannel: L,
272
+ selectedChannelType: T,
273
+ hoveredAttribute: D,
274
+ confirmingAttributeId: P,
275
+ isAttributeBlocked: M,
276
+ closeMenu: G,
277
+ hasMultipleChannels: S,
278
+ getSingleChannelForType: We,
279
+ getAvailableChannels: ve,
280
+ isChannelEmpty: be,
281
+ isNewDialog: ce,
282
+ showDefaultChannelTooltipWithTimer: ge,
283
+ clearDefaultChannelTooltip: E,
284
+ emit: ae,
285
+ panelPendingSelection: V
232
286
  }), {
233
- subMenuTop: je,
234
- handleAttributeMouseEnter: Fe,
235
- handleAttributeMouseLeave: O,
236
- keepSubMenuOpen: re,
237
- closeSubMenu: ce,
238
- alignSubMenuWithTarget: Le
239
- } = et({
287
+ subMenuTop: et,
288
+ handleAttributeMouseEnter: tt,
289
+ handleAttributeMouseLeave: $,
290
+ keepSubMenuOpen: Ae,
291
+ closeSubMenu: Te,
292
+ alignSubMenuWithTarget: nt
293
+ } = ht({
240
294
  activeChannelType: r,
241
- showSubMenu: L,
242
- frozenAttribute: z,
243
- hoveredAttribute: N,
244
- hasMultipleChannels: k,
245
- isAttributeBlocked: g
246
- }), Ve = (t) => {
247
- q.value && r.value === t || J("reset-blocked-attributes"), Pe(t);
248
- }, de = (t) => {
249
- g(t) || Ne(t);
295
+ showSubMenu: U,
296
+ frozenAttribute: R,
297
+ hoveredAttribute: D,
298
+ hasMultipleChannels: S,
299
+ isAttributeBlocked: M
300
+ }), ot = async (e) => {
301
+ if (b.value && r.value === e) {
302
+ G();
303
+ return;
304
+ }
305
+ ae("reset-blocked-attributes");
306
+ const t = T.value !== e;
307
+ Ue(e), t ? (Ze(
308
+ e,
309
+ ue.value,
310
+ Z.value
311
+ ), await le(), Ge(e)) : V.value = null;
312
+ };
313
+ j(b, (e) => {
314
+ e || Ie();
315
+ });
316
+ const Me = (e) => {
317
+ M(e) || Qe(e);
250
318
  };
251
- tt({
252
- selectedChannelType: _,
253
- selectedChannel: $,
254
- channels: F,
255
- selectedDialog: i(() => l.selectedDialog ?? null),
256
- isChannelEmpty: le,
257
- isNewDialog: X,
258
- showDefaultChannelTooltipWithTimer: ae,
259
- clearDefaultChannelTooltip: x
319
+ yt({
320
+ selectedChannelType: T,
321
+ selectedChannel: L,
322
+ channels: H,
323
+ selectedDialog: a(() => i.selectedDialog ?? null),
324
+ isChannelEmpty: be,
325
+ isNewDialog: ce,
326
+ showDefaultChannelTooltipWithTimer: ge,
327
+ clearDefaultChannelTooltip: E
260
328
  });
261
329
  const {
262
- emptyChannelsPlaceholderText: He,
263
- shouldShowEmptyChannelsPlaceholder: fe
264
- } = nt({
265
- showMenu: q,
330
+ emptyChannelsPlaceholderText: lt,
331
+ shouldShowEmptyChannelsPlaceholder: Se
332
+ } = Ct({
333
+ showMenu: b,
266
334
  activeChannelType: r,
267
- emptyChannelsPlaceholder: i(() => l.emptyChannelsPlaceholder ?? {}),
268
- getAvailableChannels: ne,
269
- organizedContactAttributes: ie
270
- }), me = i(
271
- () => $e()
272
- ), We = i(
273
- () => L.value && N.value && me.value.length > 0 && r.value !== "phone" && k(r.value)
274
- ), pe = async (t, o) => {
275
- const e = Fe(t, o.currentTarget);
276
- await ve(), e instanceof HTMLElement && Le(E, e);
335
+ emptyChannelsPlaceholder: a(() => i.emptyChannelsPlaceholder ?? {}),
336
+ getAvailableChannels: ve,
337
+ organizedContactAttributes: Z
338
+ }), we = a(
339
+ () => Ye()
340
+ ), st = a(
341
+ () => U.value && D.value && we.value.length > 0 && r.value !== "phone" && S(r.value)
342
+ ), _e = async (e, o) => {
343
+ const t = tt(e, o.currentTarget);
344
+ await le(), t instanceof HTMLElement && nt(F, t);
277
345
  };
278
- return H(() => l.confirmingAttributeId, (t) => {
279
- t || (S.value = null);
280
- }), H(V, () => {
281
- const t = b.value;
282
- if (!t)
346
+ return j(() => i.confirmingAttributeId, (e) => {
347
+ e || (P.value = null);
348
+ }), j(Y, () => {
349
+ const e = k.value;
350
+ if (!e)
283
351
  return;
284
- const o = V.value.find((e) => e.id === t);
285
- (o == null ? void 0 : o.status) === "confirmed" && (S.value = null, oe());
286
- }, { deep: !0 }), H(() => l.selectedDialog, () => {
287
- }, { deep: !0 }), Ue(() => {
288
- document.addEventListener("click", se), Ee();
289
- }), Ge(() => {
290
- document.removeEventListener("click", se), x();
291
- }), (t, o) => (s(), a("div", {
352
+ const o = Y.value.find((t) => t.id === e);
353
+ (o == null ? void 0 : o.status) === "confirmed" && (P.value = null, G());
354
+ }, { deep: !0 }), j(() => i.selectedDialog, () => {
355
+ Ie();
356
+ }, { deep: !0 }), at(() => {
357
+ document.addEventListener("click", he), Ke();
358
+ }), it(() => {
359
+ document.removeEventListener("click", he), E();
360
+ }), (e, o) => (l(), u("div", {
292
361
  ref_key: "panelRef",
293
- ref: E,
362
+ ref: F,
294
363
  class: "communication-panel"
295
364
  }, [
296
- n(ee).length ? (s(), a("div", {
365
+ n(pe).length ? (l(), u("div", {
297
366
  key: 0,
298
367
  ref_key: "channelsPanelRef",
299
- ref: ke,
368
+ ref: Oe,
300
369
  class: "channels-panel"
301
370
  }, [
302
- (s(!0), a(A, null, W(n(ee), (e) => {
303
- var u;
304
- return s(), a("button", {
305
- key: e.type,
306
- class: v(["channel-btn", {
307
- active: n(R)(e.type),
308
- hover: n(D) === e.type && !n(R)(e.type) || n(D) === e.type && n(R)(e.type),
309
- menuOpen: n(q) && n(r) === e.type
371
+ (l(!0), u(w, null, te(n(pe), (t) => {
372
+ var s;
373
+ return l(), u("button", {
374
+ key: t.type,
375
+ "data-channel-type": t.type,
376
+ class: g(["channel-btn", {
377
+ active: n(O)(t.type),
378
+ hover: n(B) === t.type && !n(O)(t.type) || n(B) === t.type && n(O)(t.type),
379
+ menuOpen: n(b) && n(r) === t.type
310
380
  }]),
311
- onClick: (p) => Ve(e.type),
312
- onMouseenter: (p) => D.value = e.type,
313
- onMouseleave: o[0] || (o[0] = (p) => D.value = null)
381
+ onClick: (c) => ot(t.type),
382
+ onMouseenter: (c) => B.value = t.type,
383
+ onMouseleave: o[0] || (o[0] = (c) => B.value = null)
314
384
  }, [
315
- n(R)(e.type) ? (s(), a(A, { key: 0 }, [
316
- B(G, {
385
+ n(O)(t.type) ? (l(), u(w, { key: 0 }, [
386
+ ne(se, {
317
387
  ref_for: !0,
318
- ref: (p) => {
319
- p && (m.value = p);
388
+ ref: (c) => {
389
+ c && (C.value = c);
320
390
  },
321
- text: C.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (u = $.value) == null ? void 0 : u.title,
391
+ text: A.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (s = L.value) == null ? void 0 : s.title,
322
392
  position: "bottom-left",
323
393
  offset: 8,
324
- trigger: C.value ? "auto" : "hover",
325
- "auto-show-duration": C.value ? 5e3 : 0
394
+ delay: h.tooltipDelay,
395
+ "hide-on-click": "",
396
+ trigger: A.value ? "auto" : "hover",
397
+ "auto-show-duration": A.value ? 5e3 : 0
326
398
  }, {
327
- default: U(() => [
328
- c("span", at, [
329
- (s(), y(I(e.component)))
399
+ default: oe(() => [
400
+ d("span", Tt, [
401
+ (l(), v(_(t.component)))
330
402
  ])
331
403
  ]),
332
404
  _: 2
333
- }, 1032, ["text", "trigger", "auto-show-duration"]),
334
- o[5] || (o[5] = c("span", { class: "active-indicator" }, null, -1))
335
- ], 64)) : (s(), y(G, {
405
+ }, 1032, ["text", "delay", "trigger", "auto-show-duration"]),
406
+ o[5] || (o[5] = d("span", { class: "active-indicator" }, null, -1))
407
+ ], 64)) : (l(), v(se, {
336
408
  key: 1,
337
- text: n(qe)(e.type),
409
+ text: n(Le)(t.type),
338
410
  position: "bottom-left",
339
- offset: 8
411
+ offset: 8,
412
+ delay: h.tooltipDelay,
413
+ "hide-on-click": ""
340
414
  }, {
341
- default: U(() => [
342
- c("span", it, [
343
- (s(), y(I(e.component)))
415
+ default: oe(() => [
416
+ d("span", Mt, [
417
+ (l(), v(_(t.component)))
344
418
  ])
345
419
  ]),
346
420
  _: 2
347
- }, 1032, ["text"]))
348
- ], 42, lt);
421
+ }, 1032, ["text", "delay"]))
422
+ ], 42, At);
349
423
  }), 128))
350
- ], 512)) : f("", !0),
351
- n(q) && n(r) ? (s(), a("div", ut, [
352
- n(fe) ? (s(), a("div", rt, P(n(He)), 1)) : f("", !0),
353
- n(fe) ? f("", !0) : (s(!0), a(A, { key: 1 }, W(n(ie)[n(r)], (e) => (s(), a(A, {
354
- key: e.attributeId
424
+ ], 512)) : y("", !0),
425
+ n(b) && n(r) ? (l(), u("div", St, [
426
+ n(Se) ? (l(), u("div", wt, z(n(lt)), 1)) : y("", !0),
427
+ n(Se) ? y("", !0) : (l(!0), u(w, { key: 1 }, te(n(Z)[n(r)], (t) => (l(), u(w, {
428
+ key: t.attributeId
355
429
  }, [
356
- Re(e) ? (s(), y(G, {
430
+ ze(t) ? (l(), v(se, {
357
431
  key: 0,
358
- text: Z(e),
432
+ text: fe(t),
359
433
  position: "bottom-left",
360
- offset: 8
434
+ offset: 8,
435
+ delay: h.tooltipDelay,
436
+ "hide-on-click": ""
361
437
  }, {
362
- default: U(() => [
363
- c("div", {
364
- class: v(["attribute-item", n(ye)(e), {
365
- "frozen-hover": n(ue)(e),
366
- selected: w(e),
367
- confirming: n(Ce)(e, b.value),
368
- blocked: g(e)
438
+ default: oe(() => [
439
+ d("div", {
440
+ class: g(["attribute-item", n(Re)(t), {
441
+ "frozen-hover": n(ke)(t),
442
+ selected: N(t),
443
+ confirming: n(qe)(t, k.value),
444
+ blocked: M(t)
369
445
  }]),
370
- "data-attribute-status": e.status,
371
- onMouseenter: (u) => pe(e, u),
372
- onMouseleave: o[1] || (o[1] = (...u) => n(O) && n(O)(...u)),
373
- onClick: (u) => de(e)
446
+ "data-attribute-status": t.status,
447
+ onMouseenter: (s) => _e(t, s),
448
+ onMouseleave: o[1] || (o[1] = (...s) => n($) && n($)(...s)),
449
+ onClick: (s) => Me(t)
374
450
  }, [
375
- c("div", dt, [
376
- B(be, {
377
- attribute: e,
378
- "is-selected": w(e),
379
- "confirming-attribute-id": b.value,
380
- "blocked-attribute-ids": j.value,
381
- "indicator-tooltips": K.value
382
- }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips"]),
383
- c("span", ft, P(e.value), 1)
451
+ d("div", Dt, [
452
+ ne(Pe, {
453
+ attribute: t,
454
+ "is-selected": N(t),
455
+ "confirming-attribute-id": k.value,
456
+ "blocked-attribute-ids": W.value,
457
+ "indicator-tooltips": ie.value,
458
+ "tooltip-delay": h.tooltipDelay
459
+ }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips", "tooltip-delay"]),
460
+ d("span", Rt, z(t.value), 1)
384
461
  ]),
385
- c("span", mt, [
386
- n(k)(n(r)) ? (s(), a("span", pt)) : T.showChannelIcons ? (s(), a("span", {
462
+ d("span", qt, [
463
+ n(S)(n(r)) ? (l(), u("span", Pt)) : h.showChannelIcons ? (l(), u("span", {
387
464
  key: 1,
388
- class: v(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
465
+ class: g(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
389
466
  }, [
390
- (s(), y(I(n(te)(n(r)))))
391
- ], 2)) : f("", !0)
467
+ (l(), v(_(n(me)(n(r)))))
468
+ ], 2)) : y("", !0)
392
469
  ])
393
- ], 42, ct)
470
+ ], 42, _t)
394
471
  ]),
395
472
  _: 2
396
- }, 1032, ["text"])) : (s(), a("div", {
473
+ }, 1032, ["text", "delay"])) : (l(), u("div", {
397
474
  key: 1,
398
- class: v(["attribute-item", n(ye)(e), {
399
- "frozen-hover": n(ue)(e),
400
- selected: w(e),
401
- confirming: n(Ce)(e, b.value),
402
- blocked: g(e)
475
+ class: g(["attribute-item", n(Re)(t), {
476
+ "frozen-hover": n(ke)(t),
477
+ selected: N(t),
478
+ confirming: n(qe)(t, k.value),
479
+ blocked: M(t)
403
480
  }]),
404
- "data-attribute-status": e.status,
405
- onMouseenter: (u) => pe(e, u),
406
- onMouseleave: o[2] || (o[2] = (...u) => n(O) && n(O)(...u)),
407
- onClick: (u) => de(e)
481
+ "data-attribute-status": t.status,
482
+ onMouseenter: (s) => _e(t, s),
483
+ onMouseleave: o[2] || (o[2] = (...s) => n($) && n($)(...s)),
484
+ onClick: (s) => Me(t)
408
485
  }, [
409
- c("div", vt, [
410
- B(be, {
411
- attribute: e,
412
- "is-selected": w(e),
413
- "confirming-attribute-id": b.value,
414
- "blocked-attribute-ids": j.value,
415
- "indicator-tooltips": K.value
416
- }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips"]),
417
- c("span", yt, P(e.value), 1)
486
+ d("div", Ot, [
487
+ ne(Pe, {
488
+ attribute: t,
489
+ "is-selected": N(t),
490
+ "confirming-attribute-id": k.value,
491
+ "blocked-attribute-ids": W.value,
492
+ "indicator-tooltips": ie.value,
493
+ "tooltip-delay": h.tooltipDelay
494
+ }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips", "tooltip-delay"]),
495
+ d("span", Bt, z(t.value), 1)
418
496
  ]),
419
- c("span", Ct, [
420
- n(k)(n(r)) ? (s(), a("span", bt)) : T.showChannelIcons ? (s(), a("span", {
497
+ d("span", Nt, [
498
+ n(S)(n(r)) ? (l(), u("span", Et)) : h.showChannelIcons ? (l(), u("span", {
421
499
  key: 1,
422
- class: v(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
500
+ class: g(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
423
501
  }, [
424
- (s(), y(I(n(te)(n(r)))))
425
- ], 2)) : f("", !0)
502
+ (l(), v(_(n(me)(n(r)))))
503
+ ], 2)) : y("", !0)
426
504
  ])
427
- ], 42, ht))
505
+ ], 42, xt))
428
506
  ], 64))), 128)),
429
- n(L) && We.value ? (s(), a("div", {
507
+ n(U) && st.value ? (l(), u("div", {
430
508
  key: 2,
431
509
  class: "sub-menu left",
432
- style: Je({ top: n(je) + "px" }),
433
- onMouseenter: o[3] || (o[3] = (...e) => n(re) && n(re)(...e)),
434
- onMouseleave: o[4] || (o[4] = (...e) => n(ce) && n(ce)(...e))
510
+ style: ut({ top: n(et) + "px" }),
511
+ onMouseenter: o[3] || (o[3] = (...t) => n(Ae) && n(Ae)(...t)),
512
+ onMouseleave: o[4] || (o[4] = (...t) => n(Te) && n(Te)(...t))
435
513
  }, [
436
- o[6] || (o[6] = c("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
437
- (s(!0), a(A, null, W(me.value, (e) => (s(), a("div", {
438
- key: e.channelId,
439
- class: v(["sub-menu-item", { selected: Y(e.channelId) }]),
440
- onClick: (u) => n(ze)(e.channelId)
514
+ o[6] || (o[6] = d("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
515
+ (l(!0), u(w, null, te(we.value, (t) => (l(), u("div", {
516
+ key: t.channelId,
517
+ class: g(["sub-menu-item", { selected: K(t) }]),
518
+ onClick: (s) => n(Xe)(t.channelId)
441
519
  }, [
442
- Y(e.channelId) ? (s(), a("span", kt, [
443
- B(n(ot))
444
- ])) : f("", !0),
445
- c("span", At, P(e.title || e.channelId), 1),
446
- T.showChannelIcons ? (s(), a("span", {
447
- key: 1,
448
- class: v(["sub-menu-icon", { "menu-icon-grey": n(xe)(e.channelId) !== "sms" }])
520
+ d("span", jt, [
521
+ X(t) ? (l(), u("span", {
522
+ key: 0,
523
+ class: g(Je(t))
524
+ }, [
525
+ X(t) === "spinner" ? (l(), v(n(kt), { key: 0 })) : X(t) === "unconfirmed" ? (l(), v(n(gt), { key: 1 })) : (l(), v(n(bt), { key: 2 }))
526
+ ], 2)) : y("", !0)
527
+ ]),
528
+ d("span", zt, z(t.title || t.channelId), 1),
529
+ h.showChannelIcons ? (l(), u("span", {
530
+ key: 0,
531
+ class: g(["sub-menu-icon", { "menu-icon-grey": n(Ve)(t.channelId) !== "sms" }])
449
532
  }, [
450
- (s(), y(I(n(Be)(e.channelId))))
451
- ], 2)) : f("", !0)
452
- ], 10, gt))), 128))
453
- ], 36)) : f("", !0)
454
- ])) : f("", !0)
533
+ (l(), v(_(n(He)(t.channelId))))
534
+ ], 2)) : y("", !0)
535
+ ], 10, $t))), 128))
536
+ ], 36)) : y("", !0)
537
+ ])) : y("", !0)
455
538
  ], 512));
456
539
  }
457
- }, zt = /* @__PURE__ */ st(It, [["__scopeId", "data-v-cae081e6"]]);
540
+ }, on = /* @__PURE__ */ It(Ft, [["__scopeId", "data-v-d02b223f"]]);
458
541
  export {
459
- zt as default
542
+ on as default
460
543
  };