@mobilon-dev/chotto 0.3.118 → 0.3.119

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,31 +1,34 @@
1
- import { ref as m, computed as a, watch as z, onMounted as ct, onUnmounted as dt, createElementBlock as u, openBlock as l, createCommentVNode as y, unref as n, Fragment as w, renderList as te, normalizeClass as k, createBlock as v, createVNode as ne, createElementVNode as d, withCtx as oe, resolveDynamicComponent as D, toDisplayString as F, normalizeStyle as ft, nextTick as le } from "vue";
1
+ import { ref as m, computed as a, watch as z, onMounted as ct, onUnmounted as dt, createElementBlock as u, openBlock as l, createCommentVNode as v, unref as n, Fragment as _, renderList as te, normalizeClass as k, createBlock as h, createVNode as ne, createElementVNode as c, withCtx as oe, resolveDynamicComponent as w, toDisplayString as F, normalizeStyle as ft, nextTick as le } from "vue";
2
2
  import se from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
3
  import { useCommunicationChannels as pt } from "./composables/useCommunicationChannels.js";
4
4
  import { useCommunicationMenu as mt } from "./composables/useCommunicationMenu.js";
5
- import { useCommunicationAttributes as vt, isAttributeBlocked as ht, getAttributeStatusClass as Re, isAttributeConfirming as qe, getSubMenuChannelIndicatorType as yt, getSubMenuChannelIndicatorClass as Ct } from "./composables/useCommunicationAttributes.js";
5
+ import { useCommunicationAttributes as vt, isAttributeBlocked as ht, getAttributeStatusClass as Re, isAttributeConfirming as xe, getSubMenuChannelIndicatorType as yt, getSubMenuChannelIndicatorClass as Ct } from "./composables/useCommunicationAttributes.js";
6
6
  import { useCommunicationActions as bt } from "./composables/useCommunicationActions.js";
7
7
  import { useCommunicationSubMenu as gt } from "./composables/useCommunicationSubMenu.js";
8
8
  import { useCommunicationDialogSync as kt } from "./composables/useCommunicationDialogSync.js";
9
9
  import { useCommunicationPlaceholder as It } from "./composables/useCommunicationPlaceholder.js";
10
- import xe from "./CommunicationPanelAttributeIndicator.vue.js";
10
+ import qe from "./CommunicationPanelAttributeIndicator.vue.js";
11
11
  import At from "./icons/CommunicationPanelCheckIcon.vue.js";
12
12
  import Tt from "./icons/CommunicationPanelUnconfirmedIcon.vue.js";
13
13
  import Mt from "./icons/CommunicationPanelConfirmSpinner.vue.js";
14
14
  import St from "../../../_virtual/_plugin-vue_export-helper.js";
15
15
  /* empty css */
16
- const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "channel-icon" }, _t = { class: "channel-icon" }, Rt = {
16
+ const _t = ["data-channel-type", "onClick", "onMouseenter"], wt = { class: "channel-icon" }, Dt = { class: "channel-icon" }, Rt = {
17
17
  key: 1,
18
18
  class: "attributes-menu"
19
- }, qt = {
19
+ }, xt = {
20
20
  key: 0,
21
21
  class: "empty-channels-placeholder"
22
- }, xt = ["data-attribute-status", "onMouseenter", "onClick"], Ot = { class: "attribute-info" }, Pt = { class: "attribute-value" }, Bt = { class: "menu-icon" }, Nt = {
22
+ }, qt = ["data-attribute-status", "onMouseenter", "onClick"], Ot = { class: "attribute-info" }, Pt = { class: "attribute-value" }, Bt = { class: "menu-icon" }, Nt = {
23
23
  key: 0,
24
24
  class: "menu-icon-arrow"
25
25
  }, Et = ["data-attribute-status", "onMouseenter", "onClick"], $t = { class: "attribute-info" }, jt = { class: "attribute-value" }, zt = { class: "menu-icon" }, Ft = {
26
26
  key: 0,
27
27
  class: "menu-icon-arrow"
28
- }, Lt = ["onClick"], Ut = { class: "sub-menu-indicator-slot" }, Vt = { class: "sub-menu-title" }, Wt = {
28
+ }, Lt = ["onClick"], Ut = { class: "sub-menu-indicator-slot" }, Vt = { class: "sub-menu-title" }, Wt = { class: "sub-menu-title-text" }, Ht = {
29
+ key: 0,
30
+ class: "sub-menu-title-bot"
31
+ }, Gt = {
29
32
  __name: "CommunicationPanel",
30
33
  props: {
31
34
  contactAttributes: {
@@ -136,9 +139,9 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
136
139
  "phone-call",
137
140
  "reset-blocked-attributes"
138
141
  ],
139
- setup(h, { expose: Oe, emit: Pe }) {
140
- const i = h, ae = Pe, L = m(null), Be = m(null), _ = m(null), R = m(null), T = m(null), U = m({}), V = m(null), A = m(!1), q = m(null), C = m(null), x = m(null), b = a(
141
- () => i.confirmingAttributeId ?? x.value
142
+ setup(y, { expose: Oe, emit: Pe }) {
143
+ const i = y, ae = Pe, L = m(null), Be = m(null), D = m(null), R = m(null), T = m(null), U = m({}), V = m(null), A = m(!1), x = m(null), C = m(null), q = m(null), b = a(
144
+ () => i.confirmingAttributeId ?? q.value
142
145
  ), W = a(() => i.blockedAttributeIds ?? []), M = (e) => ht(e, W.value), H = a(() => i.channels ?? []), Ne = a(() => i.channelOrder), Ee = a(() => i.visibleChannelTypes), $e = a(() => i.channelTooltips ?? {}), je = a(() => i.attributeTooltips ?? {}), ie = a(() => i.attributeIndicatorTooltips ?? {}), ue = a(() => i.recentAttributeChannels ?? {}), re = a(() => i.messages ?? []), ze = a(() => i.selectedChat ?? null), ce = a(() => i.isNewDialog ?? !1), de = a(() => {
143
146
  var e;
144
147
  return ((e = i.selectedDialog) == null ? void 0 : e.channelId) ?? null;
@@ -200,13 +203,13 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
200
203
  const e = V.value;
201
204
  return e && e.channelType === r.value ? e : null;
202
205
  }), K = (e) => {
203
- var _e;
204
- 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;
205
- if (c != null && c.channelId && s(c.channelId, o))
206
+ var De;
207
+ 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)), d = ye.value;
208
+ if (d != null && d.channelId && s(d.channelId, o))
206
209
  return !0;
207
210
  const f = r.value, I = Q.value;
208
211
  if (g.value && f && I) {
209
- const p = (_e = ue.value) == null ? void 0 : _e[f];
212
+ const p = (De = ue.value) == null ? void 0 : De[f];
210
213
  if (p != null && p.channelId && (p != null && p.attributeId) && O(I, p.attributeId) && s(p.channelId, o))
211
214
  return !0;
212
215
  }
@@ -214,7 +217,7 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
214
217
  }, E = (e) => {
215
218
  const o = ye.value;
216
219
  return o != null && o.attributeId ? O(e, o.attributeId) : O(e, J.value);
217
- }, Q = a(() => _.value ?? R.value ?? null), Ce = (e) => {
220
+ }, Q = a(() => D.value ?? R.value ?? null), Ce = (e) => {
218
221
  const o = e == null ? void 0 : e.backendChannelId;
219
222
  return o ? [o] : [];
220
223
  }, X = (e) => yt(
@@ -230,9 +233,9 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
230
233
  b.value,
231
234
  Ce(e)
232
235
  ) ?? "", Y = a(() => i.contactAttributes ?? []), be = (e) => {
233
- var c;
236
+ var d;
234
237
  if (!e || !re.value) return !0;
235
- const o = (c = ze.value) == null ? void 0 : c.chatId;
238
+ const o = (d = ze.value) == null ? void 0 : d.chatId;
236
239
  return o ? !re.value.filter(
237
240
  (f) => {
238
241
  var I;
@@ -245,11 +248,11 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
245
248
  $(), A.value = !0, le(() => {
246
249
  const e = Array.isArray(C.value) ? C.value[0] : C.value;
247
250
  e && typeof e.startAutoShow == "function" ? e.startAutoShow() : console.log("startAutoShow method not found on tooltipRef");
248
- }), q.value = setTimeout(() => {
251
+ }), x.value = setTimeout(() => {
249
252
  A.value = !1;
250
253
  }, 5e3);
251
254
  }, $ = () => {
252
- if (q.value && (clearTimeout(q.value), q.value = null), C.value) {
255
+ if (x.value && (clearTimeout(x.value), x.value = null), C.value) {
253
256
  const e = Array.isArray(C.value) ? C.value[0] : C.value;
254
257
  e && typeof e.clearAutoTimer == "function" && e.clearAutoTimer();
255
258
  }
@@ -273,8 +276,8 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
273
276
  channels: H,
274
277
  selectedChannel: U,
275
278
  selectedChannelType: T,
276
- hoveredAttribute: _,
277
- confirmingAttributeId: x,
279
+ hoveredAttribute: D,
280
+ confirmingAttributeId: q,
278
281
  isAttributeBlocked: M,
279
282
  closeMenu: N,
280
283
  pinMenuOpen: Qe,
@@ -298,7 +301,7 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
298
301
  activeChannelType: r,
299
302
  showSubMenu: G,
300
303
  frozenAttribute: R,
301
- hoveredAttribute: _,
304
+ hoveredAttribute: D,
302
305
  confirmingAttributeId: b,
303
306
  retainOpenUntilDismiss: Ge,
304
307
  hasMultipleChannels: S,
@@ -341,22 +344,22 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
341
344
  emptyChannelsPlaceholder: a(() => i.emptyChannelsPlaceholder ?? {}),
342
345
  getAvailableChannels: ve,
343
346
  organizedContactAttributes: Z
344
- }), we = a(
347
+ }), _e = a(
345
348
  () => nt()
346
349
  ), rt = a(
347
- () => G.value && _.value && we.value.length > 0 && r.value !== "phone" && S(r.value)
348
- ), De = async (e, o) => {
350
+ () => G.value && D.value && _e.value.length > 0 && r.value !== "phone" && S(r.value)
351
+ ), we = async (e, o) => {
349
352
  const t = st(e, o.currentTarget);
350
353
  await le(), t instanceof HTMLElement && at(L, t);
351
354
  };
352
355
  return z(() => i.confirmingAttributeId, (e, o) => {
353
- e || (x.value = null, o && Xe());
356
+ e || (q.value = null, o && Xe());
354
357
  }), z(Y, () => {
355
358
  const e = b.value;
356
359
  if (!e)
357
360
  return;
358
361
  const o = Y.value.find((t) => t.id === e);
359
- (o == null ? void 0 : o.status) === "confirmed" && (x.value = null, N());
362
+ (o == null ? void 0 : o.status) === "confirmed" && (q.value = null, N());
360
363
  }, { deep: !0 }), z(() => i.selectedDialog, () => {
361
364
  Ie();
362
365
  }, { deep: !0 }), ct(() => {
@@ -377,7 +380,7 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
377
380
  ref: Be,
378
381
  class: "channels-panel"
379
382
  }, [
380
- (l(!0), u(w, null, te(n(pe), (t) => {
383
+ (l(!0), u(_, null, te(n(pe), (t) => {
381
384
  var s;
382
385
  return l(), u("button", {
383
386
  key: t.type,
@@ -387,96 +390,96 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
387
390
  hover: n(B) === t.type && !n(P)(t.type) || n(B) === t.type && n(P)(t.type),
388
391
  menuOpen: n(g) && n(r) === t.type
389
392
  }]),
390
- onClick: (c) => it(t.type),
391
- onMouseenter: (c) => B.value = t.type,
392
- onMouseleave: o[0] || (o[0] = (c) => B.value = null)
393
+ onClick: (d) => it(t.type),
394
+ onMouseenter: (d) => B.value = t.type,
395
+ onMouseleave: o[0] || (o[0] = (d) => B.value = null)
393
396
  }, [
394
- n(P)(t.type) ? (l(), u(w, { key: 0 }, [
397
+ n(P)(t.type) ? (l(), u(_, { key: 0 }, [
395
398
  ne(se, {
396
399
  ref_for: !0,
397
- ref: (c) => {
398
- c && (C.value = c);
400
+ ref: (d) => {
401
+ d && (C.value = d);
399
402
  },
400
403
  text: A.value ? "Выбран канал по умолчанию, можно изменить в настройках профиля" : (s = U.value) == null ? void 0 : s.title,
401
404
  position: "bottom-left",
402
405
  offset: 8,
403
- delay: h.tooltipDelay,
406
+ delay: y.tooltipDelay,
404
407
  "hide-on-click": "",
405
408
  trigger: A.value ? "auto" : "hover",
406
409
  "auto-show-duration": A.value ? 5e3 : 0
407
410
  }, {
408
411
  default: oe(() => [
409
- d("span", Dt, [
410
- (l(), v(D(t.component)))
412
+ c("span", wt, [
413
+ (l(), h(w(t.component)))
411
414
  ])
412
415
  ]),
413
416
  _: 2
414
417
  }, 1032, ["text", "delay", "trigger", "auto-show-duration"]),
415
- o[5] || (o[5] = d("span", { class: "active-indicator" }, null, -1))
416
- ], 64)) : (l(), v(se, {
418
+ o[5] || (o[5] = c("span", { class: "active-indicator" }, null, -1))
419
+ ], 64)) : (l(), h(se, {
417
420
  key: 1,
418
421
  text: n(Ue)(t.type),
419
422
  position: "bottom-left",
420
423
  offset: 8,
421
- delay: h.tooltipDelay,
424
+ delay: y.tooltipDelay,
422
425
  "hide-on-click": ""
423
426
  }, {
424
427
  default: oe(() => [
425
- d("span", _t, [
426
- (l(), v(D(t.component)))
428
+ c("span", Dt, [
429
+ (l(), h(w(t.component)))
427
430
  ])
428
431
  ]),
429
432
  _: 2
430
433
  }, 1032, ["text", "delay"]))
431
- ], 42, wt);
434
+ ], 42, _t);
432
435
  }), 128))
433
- ], 512)) : y("", !0),
436
+ ], 512)) : v("", !0),
434
437
  n(g) && n(r) ? (l(), u("div", Rt, [
435
- n(Se) ? (l(), u("div", qt, F(n(ut)), 1)) : y("", !0),
436
- n(Se) ? y("", !0) : (l(!0), u(w, { key: 1 }, te(n(Z)[n(r)], (t) => (l(), u(w, {
438
+ n(Se) ? (l(), u("div", xt, F(n(ut)), 1)) : v("", !0),
439
+ n(Se) ? v("", !0) : (l(!0), u(_, { key: 1 }, te(n(Z)[n(r)], (t) => (l(), u(_, {
437
440
  key: t.attributeId
438
441
  }, [
439
- Fe(t) ? (l(), v(se, {
442
+ Fe(t) ? (l(), h(se, {
440
443
  key: 0,
441
444
  text: fe(t),
442
445
  position: "bottom-left",
443
446
  offset: 8,
444
- delay: h.tooltipDelay,
447
+ delay: y.tooltipDelay,
445
448
  "hide-on-click": ""
446
449
  }, {
447
450
  default: oe(() => [
448
- d("div", {
451
+ c("div", {
449
452
  class: k(["attribute-item", n(Re)(t), {
450
453
  "frozen-hover": n(ke)(t),
451
454
  selected: E(t),
452
- confirming: n(qe)(t, b.value),
455
+ confirming: n(xe)(t, b.value),
453
456
  blocked: M(t)
454
457
  }]),
455
458
  "data-attribute-status": t.status,
456
- onMouseenter: (s) => De(t, s),
459
+ onMouseenter: (s) => we(t, s),
457
460
  onMouseleave: o[1] || (o[1] = (...s) => n(j) && n(j)(...s)),
458
461
  onClick: (s) => Me(t)
459
462
  }, [
460
- d("div", Ot, [
461
- ne(xe, {
463
+ c("div", Ot, [
464
+ ne(qe, {
462
465
  attribute: t,
463
466
  "is-selected": E(t),
464
467
  "confirming-attribute-id": b.value,
465
468
  "blocked-attribute-ids": W.value,
466
469
  "indicator-tooltips": ie.value,
467
- "tooltip-delay": h.tooltipDelay
470
+ "tooltip-delay": y.tooltipDelay
468
471
  }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips", "tooltip-delay"]),
469
- d("span", Pt, F(t.value), 1)
472
+ c("span", Pt, F(t.value), 1)
470
473
  ]),
471
- d("span", Bt, [
472
- n(S)(n(r)) ? (l(), u("span", Nt)) : h.showChannelIcons ? (l(), u("span", {
474
+ c("span", Bt, [
475
+ n(S)(n(r)) ? (l(), u("span", Nt)) : y.showChannelIcons ? (l(), u("span", {
473
476
  key: 1,
474
477
  class: k(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
475
478
  }, [
476
- (l(), v(D(n(me)(n(r)))))
477
- ], 2)) : y("", !0)
479
+ (l(), h(w(n(me)(n(r)))))
480
+ ], 2)) : v("", !0)
478
481
  ])
479
- ], 42, xt)
482
+ ], 42, qt)
480
483
  ]),
481
484
  _: 2
482
485
  }, 1032, ["text", "delay"])) : (l(), u("div", {
@@ -484,32 +487,32 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
484
487
  class: k(["attribute-item", n(Re)(t), {
485
488
  "frozen-hover": n(ke)(t),
486
489
  selected: E(t),
487
- confirming: n(qe)(t, b.value),
490
+ confirming: n(xe)(t, b.value),
488
491
  blocked: M(t)
489
492
  }]),
490
493
  "data-attribute-status": t.status,
491
- onMouseenter: (s) => De(t, s),
494
+ onMouseenter: (s) => we(t, s),
492
495
  onMouseleave: o[2] || (o[2] = (...s) => n(j) && n(j)(...s)),
493
496
  onClick: (s) => Me(t)
494
497
  }, [
495
- d("div", $t, [
496
- ne(xe, {
498
+ c("div", $t, [
499
+ ne(qe, {
497
500
  attribute: t,
498
501
  "is-selected": E(t),
499
502
  "confirming-attribute-id": b.value,
500
503
  "blocked-attribute-ids": W.value,
501
504
  "indicator-tooltips": ie.value,
502
- "tooltip-delay": h.tooltipDelay
505
+ "tooltip-delay": y.tooltipDelay
503
506
  }, null, 8, ["attribute", "is-selected", "confirming-attribute-id", "blocked-attribute-ids", "indicator-tooltips", "tooltip-delay"]),
504
- d("span", jt, F(t.value), 1)
507
+ c("span", jt, F(t.value), 1)
505
508
  ]),
506
- d("span", zt, [
507
- n(S)(n(r)) ? (l(), u("span", Ft)) : h.showChannelIcons ? (l(), u("span", {
509
+ c("span", zt, [
510
+ n(S)(n(r)) ? (l(), u("span", Ft)) : y.showChannelIcons ? (l(), u("span", {
508
511
  key: 1,
509
512
  class: k(["channel-icon-small", { "menu-icon-grey": n(r) !== "sms" }])
510
513
  }, [
511
- (l(), v(D(n(me)(n(r)))))
512
- ], 2)) : y("", !0)
514
+ (l(), h(w(n(me)(n(r)))))
515
+ ], 2)) : v("", !0)
513
516
  ])
514
517
  ], 42, Et))
515
518
  ], 64))), 128)),
@@ -520,33 +523,36 @@ const wt = ["data-channel-type", "onClick", "onMouseenter"], Dt = { class: "chan
520
523
  onMouseenter: o[3] || (o[3] = (...t) => n(Ae) && n(Ae)(...t)),
521
524
  onMouseleave: o[4] || (o[4] = (...t) => n(Te) && n(Te)(...t))
522
525
  }, [
523
- o[6] || (o[6] = d("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
524
- (l(!0), u(w, null, te(we.value, (t) => (l(), u("div", {
526
+ o[6] || (o[6] = c("div", { class: "sub-menu-header" }, " Канал связи ", -1)),
527
+ (l(!0), u(_, null, te(_e.value, (t) => (l(), u("div", {
525
528
  key: t.channelId,
526
529
  class: k(["sub-menu-item", { selected: K(t) }]),
527
530
  onClick: (s) => n(tt)(t.channelId)
528
531
  }, [
529
- d("span", Ut, [
532
+ c("span", Ut, [
530
533
  X(t) ? (l(), u("span", {
531
534
  key: 0,
532
535
  class: k(Ye(t))
533
536
  }, [
534
- X(t) === "spinner" ? (l(), v(n(Mt), { key: 0 })) : X(t) === "unconfirmed" ? (l(), v(n(Tt), { key: 1 })) : (l(), v(n(At), { key: 2 }))
535
- ], 2)) : y("", !0)
537
+ X(t) === "spinner" ? (l(), h(n(Mt), { key: 0 })) : X(t) === "unconfirmed" ? (l(), h(n(Tt), { key: 1 })) : (l(), h(n(At), { key: 2 }))
538
+ ], 2)) : v("", !0)
539
+ ]),
540
+ c("span", Vt, [
541
+ c("span", Wt, F(t.title || t.channelId), 1),
542
+ t.isBot ? (l(), u("span", Ht, "бот")) : v("", !0)
536
543
  ]),
537
- d("span", Vt, F(t.title || t.channelId), 1),
538
- h.showChannelIcons ? (l(), u("span", {
544
+ y.showChannelIcons ? (l(), u("span", {
539
545
  key: 0,
540
546
  class: k(["sub-menu-icon", { "menu-icon-grey": n(Ve)(t.channelId) !== "sms" }])
541
547
  }, [
542
- (l(), v(D(n(He)(t.channelId))))
543
- ], 2)) : y("", !0)
548
+ (l(), h(w(n(He)(t.channelId))))
549
+ ], 2)) : v("", !0)
544
550
  ], 10, Lt))), 128))
545
- ], 36)) : y("", !0)
546
- ])) : y("", !0)
551
+ ], 36)) : v("", !0)
552
+ ])) : v("", !0)
547
553
  ], 512));
548
554
  }
549
- }, un = /* @__PURE__ */ St(Wt, [["__scopeId", "data-v-bcd57170"]]);
555
+ }, cn = /* @__PURE__ */ St(Gt, [["__scopeId", "data-v-38881acf"]]);
550
556
  export {
551
- un as default
557
+ cn as default
552
558
  };
@@ -2,8 +2,8 @@ import { computed as c, unref as i } from "vue";
2
2
  /* empty css */
3
3
  import M from "../icons/CommunicationPanelPhoneIcon.vue.js";
4
4
  import b from "../icons/CommunicationPanelWhatsAppIcon.vue.js";
5
- import w from "../icons/CommunicationPanelTelegramIcon.vue.js";
6
- import x from "../icons/CommunicationPanelMaxIcon.vue.js";
5
+ import x from "../icons/CommunicationPanelTelegramIcon.vue.js";
6
+ import w from "../icons/CommunicationPanelMaxIcon.vue.js";
7
7
  import A from "../icons/CommunicationPanelSMSIcon.vue.js";
8
8
  import y from "../icons/CommunicationPanelSubmenuPhoneIcon.vue.js";
9
9
  import E from "../icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js";
@@ -14,8 +14,8 @@ const I = ["whatsapp", "telegram", "max", "sms", "phone"], _ = ["max", "telegram
14
14
  function g(a) {
15
15
  return I.includes(a);
16
16
  }
17
- function D(a, r) {
18
- const u = (a ?? _).filter(g), m = r === void 0 ? [...I] : r.filter(g), p = new Set(m), t = /* @__PURE__ */ new Set(), l = [];
17
+ function D(a, s) {
18
+ const u = (a ?? _).filter(g), m = s === void 0 ? [...I] : s.filter(g), p = new Set(m), t = /* @__PURE__ */ new Set(), l = [];
19
19
  for (const o of u)
20
20
  p.has(o) && !t.has(o) && (t.add(o), l.push(o));
21
21
  for (const o of m)
@@ -25,8 +25,8 @@ function D(a, r) {
25
25
  const H = {
26
26
  phone: M,
27
27
  whatsapp: b,
28
- telegram: w,
29
- max: x,
28
+ telegram: x,
29
+ max: w,
30
30
  sms: A
31
31
  }, R = {
32
32
  phone: y,
@@ -43,12 +43,12 @@ const H = {
43
43
  };
44
44
  function Z({
45
45
  channels: a,
46
- channelTooltips: r,
46
+ channelTooltips: s,
47
47
  channelOrder: u,
48
48
  visibleChannelTypes: m,
49
49
  selectedChannelType: p
50
50
  }) {
51
- const t = c(() => i(a) ?? []), l = c(() => i(r) ?? {}), o = c(
51
+ const t = c(() => i(a) ?? []), l = c(() => i(s) ?? {}), o = c(
52
52
  () => D(i(u), i(m))
53
53
  ), d = c(
54
54
  () => o.value.map((n) => ({
@@ -58,32 +58,32 @@ function Z({
58
58
  ), S = (n) => {
59
59
  const e = l.value[n];
60
60
  return e || (W[n] ?? "");
61
- }, s = (n) => {
61
+ }, r = (n) => {
62
62
  if (!n) return null;
63
63
  const [e] = n.split(".");
64
- return e.includes("waba") ? "whatsapp" : e.includes("telegrambot") ? "telegram" : e;
65
- }, P = (n) => t.value.filter((e) => s(e.channelId) === n).length > 1, T = (n) => p.value === n, C = (n) => {
66
- const e = t.value.filter((v) => s(v.channelId) === n);
64
+ return e.includes("waba") ? "whatsapp" : e.includes("telegrambot") ? "telegram" : e.includes("maxbot") ? "max" : e;
65
+ }, P = (n) => t.value.filter((e) => r(e.channelId) === n).length > 1, T = (n) => p.value === n, f = (n) => {
66
+ const e = t.value.filter((v) => r(v.channelId) === n);
67
67
  return e.length === 1 ? e[0] : null;
68
- }, h = (n) => R[n] ?? null, f = (n) => {
69
- const e = s(n);
68
+ }, h = (n) => R[n] ?? null, C = (n) => {
69
+ const e = r(n);
70
70
  return e ? h(e) : null;
71
71
  };
72
72
  return {
73
73
  panelChannelTypes: o,
74
74
  channelsTypes: d,
75
75
  getTooltipText: S,
76
- getChannelTypeFromId: s,
76
+ getChannelTypeFromId: r,
77
77
  hasMultipleChannels: P,
78
78
  isChannelActive: T,
79
- getSingleChannelForType: C,
79
+ getSingleChannelForType: f,
80
80
  getMenuChannelIconComponent: h,
81
- getMenuChannelIconComponentForChannelId: f,
81
+ getMenuChannelIconComponentForChannelId: C,
82
82
  getSingleMenuChannelIconComponent: (n) => {
83
- const e = C(n);
84
- return e ? f(e.channelId) : h(n);
83
+ const e = f(n);
84
+ return e ? C(e.channelId) : h(n);
85
85
  },
86
- getAvailableChannels: (n) => t.value.filter((e) => s(e.channelId) === n)
86
+ getAvailableChannels: (n) => t.value.filter((e) => r(e.channelId) === n)
87
87
  };
88
88
  }
89
89
  export {
@@ -1,7 +1,7 @@
1
- import { watch as d, unref as p } from "vue";
2
- import { CHANNEL_TYPES as v } from "./useCommunicationChannels.js";
3
- function b({
4
- selectedChannelType: e,
1
+ import { watch as h, unref as v } from "vue";
2
+ import { CHANNEL_TYPES as I } from "./useCommunicationChannels.js";
3
+ function x({
4
+ selectedChannelType: n,
5
5
  selectedChannel: u,
6
6
  channels: c,
7
7
  selectedDialog: i,
@@ -10,31 +10,31 @@ function b({
10
10
  showDefaultChannelTooltipWithTimer: f,
11
11
  clearDefaultChannelTooltip: l
12
12
  }) {
13
- const r = (n) => {
14
- if (!n || !n.channelId) {
15
- e.value = null, u.value = {}, l();
13
+ const r = (e) => {
14
+ if (!e || !e.channelId) {
15
+ n.value = null, u.value = {}, l();
16
16
  return;
17
17
  }
18
- const a = n.channelId ? n.channelId.split(".")[0] : null, t = a ? I(a) : null;
18
+ const a = e.channelId ? e.channelId.split(".")[0] : null, t = a ? p(a) : null;
19
19
  if (t) {
20
- e.value = t;
21
- const h = c.value.find((s) => s.channelId === n.channelId);
22
- u.value = h ?? {}, m(n.channelId) && o.value ? f() : l();
20
+ n.value = t;
21
+ const s = c.value.find((d) => d.channelId === e.channelId);
22
+ u.value = s ?? {}, m(e.channelId) && o.value ? f() : l();
23
23
  }
24
24
  };
25
- return d(
26
- () => p(i),
27
- (n) => {
28
- r(n ?? null);
25
+ return h(
26
+ () => v(i),
27
+ (e) => {
28
+ r(e ?? null);
29
29
  },
30
30
  { immediate: !0, deep: !0 }
31
31
  ), {
32
32
  updateSelectedChannelFromDialog: r
33
33
  };
34
34
  }
35
- function I(e) {
36
- return e.includes("waba") ? "whatsapp" : e.includes("telegrambot") ? "telegram" : v.includes(e) ? e : null;
35
+ function p(n) {
36
+ return n.includes("waba") ? "whatsapp" : n.includes("telegrambot") ? "telegram" : n.includes("maxbot") ? "max" : I.includes(n) ? n : null;
37
37
  }
38
38
  export {
39
- b as useCommunicationDialogSync
39
+ x as useCommunicationDialogSync
40
40
  };