sm-click-library-ui 0.0.124 → 0.0.126

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.
@@ -11151,7 +11151,7 @@ const Th = () => {
11151
11151
  }
11152
11152
  }, pl = xr("auth", {
11153
11153
  state: () => ({
11154
- jwtToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzI4MDQwOTc4LCJpYXQiOjE3Mjc5NTQ1NzgsImp0aSI6IjYzM2E2ZWFjNjRjNDQwOGVhZTFhMGRkZDZlYmY2NDFkIiwidXNlcl9pZCI6ImRlYTVjMTNmLTQ0NjQtNGNjNi04NjUzLThjODUyNGFjZGQzYiJ9.HS5WBjcRiSpps5umfwphAzVjhOeFW6lEiDfwPYYlNYM"
11154
+ jwtToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzI4NTU5MTE3LCJpYXQiOjE3Mjg0NzI3MTcsImp0aSI6IjhiODUwYTZiMDA5NjQ2MmZhYWQ2M2JhYzAzYjMyZjQ0IiwidXNlcl9pZCI6ImRlYTVjMTNmLTQ0NjQtNGNjNi04NjUzLThjODUyNGFjZGQzYiJ9.iu1aY6vvNdlx9_PmEWIOVDjx4ZJkmJDjvAmfiV7_Y8A"
11155
11155
  // Inicialmente vazio
11156
11156
  }),
11157
11157
  actions: {
@@ -11208,10 +11208,8 @@ function Qp() {
11208
11208
  e.value = l.data.map((c) => ({
11209
11209
  ...c,
11210
11210
  messages: null,
11211
- channel_id: null,
11212
11211
  currentPage: 1,
11213
- hasNextPage: null,
11214
- unreadMessages: 0
11212
+ hasNextPage: null
11215
11213
  }));
11216
11214
  } catch (l) {
11217
11215
  console.error(l);
@@ -11222,7 +11220,7 @@ function Qp() {
11222
11220
  try {
11223
11221
  a.value = !0;
11224
11222
  const c = await ia.get(`${ir}?attendant=${l}&page=1`), d = e.value.find((m) => m.id === l);
11225
- d && (d.messages = c.data.results.reverse(), d.channel_id = c.data.channel_id, d.hasNextPage = c.data.next !== null, d.currentPage++);
11223
+ d && (d.messages = c.data.results.reverse(), d.hasNextPage = c.data.next !== null, d.internal_chat.channel_id = c.data.channel_id, d.currentPage++);
11226
11224
  } catch (c) {
11227
11225
  console.error(c);
11228
11226
  } finally {
@@ -11233,22 +11231,22 @@ function Qp() {
11233
11231
  const c = e.value.find((m) => m.id === l);
11234
11232
  if (!c || !c.hasNextPage) return;
11235
11233
  const d = await ia.get(`${ir}?attendant=${l}&page=${c.currentPage}`);
11236
- c.messages = [...d.data.results.reverse(), ...c.messages], c.channel_id = d.data.channel_id, c.hasNextPage = d.data.next !== null, c.currentPage++;
11234
+ c.messages = [...d.data.results.reverse(), ...c.messages], c.hasNextPage = d.data.next !== null, c.internal_chat.channel_id = d.data.channel_id, c.currentPage++;
11237
11235
  } catch (c) {
11238
11236
  console.error(c);
11239
11237
  }
11240
11238
  }, s = (l, c, d) => {
11241
- const m = l.message, p = e.value.findIndex((g) => g.channel_id === m.channel_id);
11239
+ const m = l.message, p = e.value.findIndex((g) => g.internal_chat.channel_id === m.channel_id);
11242
11240
  if (p !== -1) {
11243
11241
  const g = e.value[p], F = g.messages.findIndex((A) => A.id === m.id);
11244
- F !== -1 ? g.messages[F] = m : (g.messages.push(m), (!c || g.id !== d) && (g.unreadMessages += 1), e.value.splice(p, 1), e.value.unshift(g), g.isMoved = !0, setTimeout(() => g.isMoved = !1, 1e3));
11242
+ F !== -1 ? g.messages[F] = m : (g.messages.push(m), (!c || g.id !== d) && (g.internal_chat.unread += 1), e.value.splice(p, 1), e.value.unshift(g), g.isMoved = !0, setTimeout(() => g.isMoved = !1, 1e3));
11245
11243
  }
11246
11244
  }, i = (l) => {
11247
11245
  const c = e.value.find((d) => d.id === l);
11248
- c && (c.unreadMessages = 0);
11246
+ c && (c.internal_chat.unread = 0);
11249
11247
  }, u = async (l, c, d) => {
11250
11248
  const m = e.value.find((g) => g.id === l);
11251
- if (!m || !m.channel_id) return;
11249
+ if (!m || !m.internal_chat.channel_id) return;
11252
11250
  const p = {
11253
11251
  id: zp(),
11254
11252
  // ID temporário até ser salvo no servidor
@@ -11259,7 +11257,7 @@ function Qp() {
11259
11257
  };
11260
11258
  m.messages.push(p);
11261
11259
  try {
11262
- await ia.post(`${ir}${m.channel_id}/message/`, {
11260
+ await ia.post(`${ir}${m.internal_chat.channel_id}/message/`, {
11263
11261
  id: p.id,
11264
11262
  content: p.content
11265
11263
  });
@@ -11311,7 +11309,7 @@ const Xp = (e) => (wt("data-v-341a1620"), e = e(), bt(), e), Gp = { class: "avat
11311
11309
  }, null, 8, e1)) : (_(), x("svg", Zp, Jp))
11312
11310
  ]));
11313
11311
  }
11314
- }, vl = /* @__PURE__ */ Mt(t1, [["__scopeId", "data-v-341a1620"]]), yl = (e) => (wt("data-v-7297882b"), e = e(), bt(), e), a1 = { class: "attendants-container" }, n1 = { class: "atendentes-list bg-base-300" }, r1 = {
11312
+ }, vl = /* @__PURE__ */ Mt(t1, [["__scopeId", "data-v-341a1620"]]), yl = (e) => (wt("data-v-e7fffde1"), e = e(), bt(), e), a1 = { class: "attendants-container" }, n1 = { class: "atendentes-list bg-base-300" }, r1 = {
11315
11313
  key: 0,
11316
11314
  class: "empty-message bg-base-200"
11317
11315
  }, o1 = ["onClick"], s1 = { class: "atendente-main" }, l1 = { class: "atendente-name" }, i1 = { class: "flex items-center gap-4" }, u1 = {
@@ -11365,7 +11363,7 @@ const Xp = (e) => (wt("data-v-341a1620"), e = e(), bt(), e), Gp = { class: "avat
11365
11363
  y("span", l1, be(l.name), 1)
11366
11364
  ]),
11367
11365
  y("footer", i1, [
11368
- l.unreadMessages > 0 ? (_(), x("span", u1, be(l.unreadMessages), 1)) : V("", !0),
11366
+ l.internal_chat.unread > 0 ? (_(), x("span", u1, be(l.internal_chat.unread), 1)) : V("", !0),
11369
11367
  y("div", {
11370
11368
  class: ye(["status-indicator", s(l.login_status)])
11371
11369
  }, null, 2)
@@ -11376,7 +11374,7 @@ const Xp = (e) => (wt("data-v-341a1620"), e = e(), bt(), e), Gp = { class: "avat
11376
11374
  d1
11377
11375
  ]));
11378
11376
  }
11379
- }, m1 = /* @__PURE__ */ Mt(f1, [["__scopeId", "data-v-7297882b"]]);
11377
+ }, m1 = /* @__PURE__ */ Mt(f1, [["__scopeId", "data-v-e7fffde1"]]);
11380
11378
  function h1(e, a = null) {
11381
11379
  if (!e)
11382
11380
  return !1;
@@ -13320,7 +13318,7 @@ const Fv = {
13320
13318
  function $y(e, a) {
13321
13319
  return _(), x("div", Oy, Sy);
13322
13320
  }
13323
- const Ry = /* @__PURE__ */ Mt(Dy, [["render", $y], ["__scopeId", "data-v-ac25948c"]]), Ml = (e) => (wt("data-v-b19abaa3"), e = e(), bt(), e), Ny = { class: "chat-container" }, Ey = {
13321
+ const Ry = /* @__PURE__ */ Mt(Dy, [["render", $y], ["__scopeId", "data-v-ac25948c"]]), Ml = (e) => (wt("data-v-974ebe24"), e = e(), bt(), e), Ny = { class: "chat-container" }, Ey = {
13324
13322
  key: 0,
13325
13323
  class: "chat-icon"
13326
13324
  }, Yy = /* @__PURE__ */ Ml(() => /* @__PURE__ */ y("svg", {
@@ -13399,7 +13397,7 @@ const Ry = /* @__PURE__ */ Mt(Dy, [["render", $y], ["__scopeId", "data-v-ac25948
13399
13397
  } = Qp(), d = q(!1), m = q(!1), p = q(null), g = K(() => {
13400
13398
  if (p.value) {
13401
13399
  const b = t.value.find((L) => L.id === p.value.id);
13402
- return b ? b.unreadMessages : 0;
13400
+ return b ? b.internal_chat.unread : 0;
13403
13401
  }
13404
13402
  return 0;
13405
13403
  });
@@ -13464,7 +13462,7 @@ const Ry = /* @__PURE__ */ Mt(Dy, [["render", $y], ["__scopeId", "data-v-ac25948
13464
13462
  ], 6)
13465
13463
  ]));
13466
13464
  }
13467
- }, Tl = /* @__PURE__ */ Mt(Wy, [["__scopeId", "data-v-b19abaa3"]]);
13465
+ }, Tl = /* @__PURE__ */ Mt(Wy, [["__scopeId", "data-v-974ebe24"]]);
13468
13466
  xr("debug", {
13469
13467
  state: () => ({
13470
13468
  message: "Debug store initialized"
@@ -13497,8 +13495,7 @@ function jy(e) {
13497
13495
  e.component("primarySelect", Go), e.component("simpleModal", Ko), e.component("simpleCard", Jo), e.component("instanceSelect", xs), e.component("calendar", ml), e.component("MFA", hl), e.component("MfaQrCode", Bp), e.component("chatWindow", Tl);
13498
13496
  }
13499
13497
  function Uy(e, a, t) {
13500
- const n = pl(e);
13501
- console.log(a, t), n.setToken(a), t && (ia.defaults.baseURL = t);
13498
+ pl(e).setToken(a), t && (ia.defaults.baseURL = t);
13502
13499
  }
13503
13500
  const Qy = {
13504
13501
  install: jy,