vue-wiguet-chatweb 0.1.38 → 0.1.39

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.
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .bubble[data-v-586d8c26]{--r: 25px;--t: 30px;padding:calc(2 * var(--r) / 3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100% / calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r) / -2) calc(var(--r) / -2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0 / var(--r) var(--r) space padding-box;mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100% / calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r) / -2) calc(var(--r) / -2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0 / var(--r) var(--r) space padding-box;color:#fff;height:100%}.left[data-v-586d8c26]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:0;background-color:#fcd7ae;color:#4d4d4d}.bubble>.content-left[data-v-586d8c26]{margin-right:10px;margin-bottom:1px}.right[data-v-586d8c26]{--_d: 100%;border-right:var(--t) solid #0000;margin-right:0;background-color:#fdeedb;color:#4d4d4d}.bubble>.content-right[data-v-586d8c26]{margin-bottom:1px;margin-right:10px}.message-text[data-v-586d8c26]{margin-bottom:10px;overflow-wrap:break-word}.detail-message[data-v-586d8c26]{font-size:10px;color:gray;display:flex;justify-content:space-between}.chat-message[data-v-586d8c26]{display:flex;flex-direction:column;justify-content:center}.message[data-v-586d8c26]{width:100%;display:flex}.message-left[data-v-586d8c26]{justify-content:start}.message-right[data-v-586d8c26]{justify-content:end}.target[data-v-586d8c26]{padding:.5rem 0;width:100%}.btn-danger[data-v-586d8c26]{background-color:transparent;border:0;border-radius:50%;cursor:pointer;padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center}.btn-danger svg[data-v-586d8c26]{width:24px;height:24px}.btn-danger[data-v-586d8c26]:hover{background-color:#ff00003a}.btn-container-widget[data-v-586d8c26]{display:flex;align-items:center;position:absolute;left:-40px;top:50%;transform:translateY(-50%)}.message-container[data-v-586d8c26]{min-width:80%;max-width:80%;position:relative;margin-bottom:.5rem}.messages-container-list[data-v-586d8c26]{width:100%}.icon[data-v-586d8c26]{width:2rem}.btn-icon[data-v-586d8c26]{text-decoration:none;border:none;color:#9ca3af}.btn-icon[data-v-586d8c26]:hover:not(.content-disabled){color:#1f2937}.btn-icon span[data-v-586d8c26]{text-wrap:nowrap}.btn-icon .icon[data-v-586d8c26]{font-size:2rem}.content-disabled[data-v-586d8c26]{-webkit-filter:grayscale(1);filter:grayscale(1);opacity:.5}.spinner_ajPY[data-v-d9a6b2b7]{fill:#fe6d00;transform-origin:center;animation:spinner_AtaB-d9a6b2b7 .75s infinite linear}@keyframes spinner_AtaB-d9a6b2b7{to{transform:rotate(360deg)}}.dialog-overlay[data-v-532e0111]{z-index:10001;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;opacity:0;animation:fadeIn-532e0111 .3s forwards}.dialog-content[data-v-532e0111]{background-color:#fff;padding:15px;border-radius:8px;text-align:center;animation:slideIn-532e0111 .3s ease-out forwards}@keyframes fadeIn-532e0111{to{opacity:1}}@keyframes slideIn-532e0111{0%{transform:translateY(-50px)}to{transform:translateY(0)}}.dialog-overlay.v-enter-active[data-v-532e0111],.dialog-overlay.v-leave-active[data-v-532e0111]{transition:opacity .3s}.btn-close[data-v-532e0111]{padding:0;background-color:transparent;border:none;display:flex;align-items:center;border-radius:50%}.btn-close[data-v-532e0111]:hover{background-color:#cacaca88}.btn-primary[data-v-9d715781]{padding:10px 12px;color:var(--primary-color)}.btn-primary[data-v-9d715781]:hover{background-color:#0000001a}.btn-close[data-v-9d715781]{padding:0;background-color:transparent;border:none;display:flex;align-items:center;border-radius:50%}.btn-close[data-v-9d715781]:hover{background-color:#cacaca88}.messages-container[data-v-9d715781]{position:relative;height:100%}.loader[data-v-9d715781]{position:absolute;top:18px;z-index:5;left:50%;transform:translate(-50%,-50%)}.fit[data-v-9d715781]{width:100%;height:100%;position:relative}.center[data-v-9d715781]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.message-send-block[data-v-9d715781]{display:block;margin:1.5rem;text-align:center}.drop-over[data-v-9d715781]{border:2px dashed #007bff!important}:root{--primary-color: var(--primary-color-500, #513c86)}.header-widget{height:5%;display:flex;justify-content:space-between;align-items:center}.jl2-input-chat{height:20px;width:95%;border:none;resize:none;margin-left:8px;margin-top:8px;margin-bottom:8px;overflow:hidden;max-height:10rem}.jl2-input-chat:focus-visible{outline:none}.jl-inputgroup-chat{width:100%;border:1px solid;border-color:var(--primary-color);background:var(--surface-a);color:var(--surface-500);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:13px;display:flex;justify-content:space-around;align-items:center}.jl-inputgroup-chat>input{border:none;background:none}.jl-inputgroup-chat>input:hover{outline:none}.form-message{display:flex;justify-content:space-between}.form-message button,.jl-inputgroup-chat>button{border:none!important;background:none}.form-message button,.jl-inputgroup-chat>button:focus{box-shadow:none}.form-message button,.jl-inputgroup-chat>button:active{box-shadow:none}.widget{margin:auto;height:100%;display:flex;width:100%;flex-direction:column;justify-content:space-evenly}.messages-container{height:80%;overflow-y:scroll;border:1px solid lightgray;border-radius:.5rem;scrollbar-color:red transparent;scrollbar-width:thin;scrollbar-color:var(--primary-color) transparent;scrollbar-track-color:transparent;scrollbar-face-color:var(--primary-color);scrollbar-thumb-color:var(--primary-color)}.messages-container::-webkit-scrollbar{width:8px}.messages-container::-webkit-scrollbar-track{background-color:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:var(--primary-color);border-radius:8px}.input-message{border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color)}.message-send{padding-top:20px;width:90%;margin:auto}#chat-circle{margin:auto;position:fixed;bottom:50px;right:50px;color:#fff;cursor:pointer}.title-chat{font-size:1rem;font-weight:700;color:var(--chat-text-color);margin:0}.chat-box{display:flex;justify-content:center;align-items:center;border:2px solid #d9d9d9;border-radius:25px;padding:5px 15px 30px;background:#fff;position:fixed;right:30px;bottom:50px;width:450px;height:70vh;max-width:85vw;max-height:80vh;box-shadow:0 5px 35px 9px #ccc}.pointer{cursor:pointer}.w-full{width:100%}.widget-component .flex{display:flex;flex-wrap:wrap}.widget-component .flex-col{flex-direction:column}.widget-component .items-center{align-items:center}.widget-component .gap-2{gap:.5rem}.widget-component .mb-2{margin-bottom:8px}.widget-component .mt-2{margin-top:8px}.widget-component .justify-between{justify-content:space-between}.flex-0{flex:0}.flex-1{flex:1}.disabled[data-v-b1fda095]{color:currentColor;cursor:not-allowed!important;opacity:.4!important;text-decoration:none}.container-buttons-chat[data-v-b1fda095]{position:relative;right:-1.8rem}.button[data-v-b1fda095]{position:absolute;width:2.5rem;height:2.5rem;opacity:0;box-shadow:0 1px 3px 1px silver;border-radius:100%;border:1px solid white;background-color:#fff;overflow:hidden;cursor:pointer;transition:transform .5s ease,opacity .3s ease;z-index:-1}.container-buttons-chat.active>a[data-v-b1fda095]{z-index:1;opacity:1}.container-buttons-chat.active .whatsapp[data-v-b1fda095]{transform:translateY(-150px)}.container-buttons-chat.active .telegram[data-v-b1fda095]{transform:translateY(-100px)}.container-buttons-chat.active .webchat[data-v-b1fda095]{transform:translateY(-50px)}.widget-container[data-v-b1fda095]{position:relative}.new-message-badge[data-v-b1fda095]{position:absolute;background-color:red;width:30px;height:30px;display:flex;font-family:Roboto,sans-serif;align-items:center;font-weight:500;justify-content:center;border-radius:50%;right:-2px;top:-4px;z-index:2}.btn-primary[data-v-b1fda095]{color:var(--primary-color)}.btn-primary[data-v-b1fda095]:hover{opacity:.7}
1
+ .bubble[data-v-586d8c26]{--r: 25px;--t: 30px;padding:calc(2 * var(--r) / 3);-webkit-mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100% / calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r) / -2) calc(var(--r) / -2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0 / var(--r) var(--r) space padding-box;mask:radial-gradient(var(--t) at var(--_d) 0,#0000 98%,#000 102%) var(--_d) 100% / calc(100% - var(--r)) var(--t) no-repeat,conic-gradient(at var(--r) var(--r),#000 75%,#0000 0) calc(var(--r) / -2) calc(var(--r) / -2) padding-box,radial-gradient(50% 50%,#000 98%,#0000 101%) 0 0 / var(--r) var(--r) space padding-box;color:#fff;height:100%}.left[data-v-586d8c26]{--_d: 0%;border-left:var(--t) solid #0000;margin-right:0;background-color:#fcd7ae;color:#4d4d4d}.bubble>.content-left[data-v-586d8c26]{margin-right:10px;margin-bottom:1px}.right[data-v-586d8c26]{--_d: 100%;border-right:var(--t) solid #0000;margin-right:0;background-color:#fdeedb;color:#4d4d4d}.bubble>.content-right[data-v-586d8c26]{margin-bottom:1px;margin-right:10px}.message-text[data-v-586d8c26]{margin-bottom:10px;overflow-wrap:break-word}.detail-message[data-v-586d8c26]{font-size:10px;color:gray;display:flex;justify-content:space-between}.chat-message[data-v-586d8c26]{display:flex;flex-direction:column;justify-content:center}.message[data-v-586d8c26]{width:100%;display:flex}.message-left[data-v-586d8c26]{justify-content:start}.message-right[data-v-586d8c26]{justify-content:end}.target[data-v-586d8c26]{padding:.5rem 0;width:100%}.btn-danger[data-v-586d8c26]{background-color:transparent;border:0;border-radius:50%;cursor:pointer;padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center}.btn-danger svg[data-v-586d8c26]{width:24px;height:24px}.btn-danger[data-v-586d8c26]:hover{background-color:#ff00003a}.btn-container-widget[data-v-586d8c26]{display:flex;align-items:center;position:absolute;left:-40px;top:50%;transform:translateY(-50%)}.message-container[data-v-586d8c26]{min-width:80%;max-width:80%;position:relative;margin-bottom:.5rem}.messages-container-list[data-v-586d8c26]{width:100%}.icon[data-v-586d8c26]{width:2rem}.btn-icon[data-v-586d8c26]{text-decoration:none;border:none;color:#9ca3af}.btn-icon[data-v-586d8c26]:hover:not(.content-disabled){color:#1f2937}.btn-icon span[data-v-586d8c26]{text-wrap:nowrap}.btn-icon .icon[data-v-586d8c26]{font-size:2rem}.content-disabled[data-v-586d8c26]{-webkit-filter:grayscale(1);filter:grayscale(1);opacity:.5}.spinner_ajPY[data-v-d9a6b2b7]{fill:#fe6d00;transform-origin:center;animation:spinner_AtaB-d9a6b2b7 .75s infinite linear}@keyframes spinner_AtaB-d9a6b2b7{to{transform:rotate(360deg)}}.dialog-overlay[data-v-532e0111]{z-index:10001;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;justify-content:center;align-items:center;opacity:0;animation:fadeIn-532e0111 .3s forwards}.dialog-content[data-v-532e0111]{background-color:#fff;padding:15px;border-radius:8px;text-align:center;animation:slideIn-532e0111 .3s ease-out forwards}@keyframes fadeIn-532e0111{to{opacity:1}}@keyframes slideIn-532e0111{0%{transform:translateY(-50px)}to{transform:translateY(0)}}.dialog-overlay.v-enter-active[data-v-532e0111],.dialog-overlay.v-leave-active[data-v-532e0111]{transition:opacity .3s}.btn-close[data-v-532e0111]{padding:0;background-color:transparent;border:none;display:flex;align-items:center;border-radius:50%}.btn-close[data-v-532e0111]:hover{background-color:#cacaca88}.btn-primary[data-v-4b8311cb]{padding:10px 12px;color:var(--primary-color)}.btn-primary[data-v-4b8311cb]:hover{background-color:#0000001a}.btn-close[data-v-4b8311cb]{padding:0;background-color:transparent;border:none;display:flex;align-items:center;border-radius:50%}.btn-close[data-v-4b8311cb]:hover{background-color:#cacaca88}.messages-container[data-v-4b8311cb]{position:relative;height:100%}.loader[data-v-4b8311cb]{position:absolute;top:18px;z-index:5;left:50%;transform:translate(-50%,-50%)}.fit[data-v-4b8311cb]{width:100%;height:100%;position:relative}.center[data-v-4b8311cb]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.message-send-block[data-v-4b8311cb]{display:block;margin:1.5rem;text-align:center}.drop-over[data-v-4b8311cb]{border:2px dashed #007bff!important}:root{--primary-color: var(--primary-color-500, #513c86)}.header-widget{height:5%;display:flex;justify-content:space-between;align-items:center}.jl2-input-chat{height:20px;width:95%;border:none;resize:none;margin-left:8px;margin-top:8px;margin-bottom:8px;overflow:hidden;max-height:10rem}.jl2-input-chat:focus-visible{outline:none}.jl-inputgroup-chat{width:100%;border:1px solid;border-color:var(--primary-color);background:var(--surface-a);color:var(--surface-500);-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:13px;display:flex;justify-content:space-around;align-items:center}.jl-inputgroup-chat>input{border:none;background:none}.jl-inputgroup-chat>input:hover{outline:none}.form-message{display:flex;justify-content:space-between}.form-message button,.jl-inputgroup-chat>button{border:none!important;background:none}.form-message button,.jl-inputgroup-chat>button:focus{box-shadow:none}.form-message button,.jl-inputgroup-chat>button:active{box-shadow:none}.widget{margin:auto;height:100%;display:flex;width:100%;flex-direction:column;justify-content:space-evenly}.messages-container{height:80%;overflow-y:scroll;border:1px solid lightgray;border-radius:.5rem;scrollbar-color:red transparent;scrollbar-width:thin;scrollbar-color:var(--primary-color) transparent;scrollbar-track-color:transparent;scrollbar-face-color:var(--primary-color);scrollbar-thumb-color:var(--primary-color)}.messages-container::-webkit-scrollbar{width:8px}.messages-container::-webkit-scrollbar-track{background-color:transparent}.messages-container::-webkit-scrollbar-thumb{background-color:var(--primary-color);border-radius:8px}.input-message{border-left:1px solid var(--fge-gray-lines-color);border-right:1px solid var(--fge-gray-lines-color)}.message-send{padding-top:20px;width:90%;margin:auto}#chat-circle{margin:auto;position:fixed;bottom:50px;right:50px;color:#fff;cursor:pointer}.title-chat{font-size:1rem;font-weight:700;color:var(--chat-text-color);margin:0}.chat-box{display:flex;justify-content:center;align-items:center;border:2px solid #d9d9d9;border-radius:25px;padding:5px 15px 30px;background:#fff;position:fixed;right:30px;bottom:50px;width:450px;height:70vh;max-width:85vw;max-height:80vh;box-shadow:0 5px 35px 9px #ccc}.pointer{cursor:pointer}.w-full{width:100%}.widget-component .flex{display:flex;flex-wrap:wrap}.widget-component .flex-col{flex-direction:column}.widget-component .items-center{align-items:center}.widget-component .gap-2{gap:.5rem}.widget-component .mb-2{margin-bottom:8px}.widget-component .mt-2{margin-top:8px}.widget-component .justify-between{justify-content:space-between}.flex-0{flex:0}.flex-1{flex:1}.disabled[data-v-b1fda095]{color:currentColor;cursor:not-allowed!important;opacity:.4!important;text-decoration:none}.container-buttons-chat[data-v-b1fda095]{position:relative;right:-1.8rem}.button[data-v-b1fda095]{position:absolute;width:2.5rem;height:2.5rem;opacity:0;box-shadow:0 1px 3px 1px silver;border-radius:100%;border:1px solid white;background-color:#fff;overflow:hidden;cursor:pointer;transition:transform .5s ease,opacity .3s ease;z-index:-1}.container-buttons-chat.active>a[data-v-b1fda095]{z-index:1;opacity:1}.container-buttons-chat.active .whatsapp[data-v-b1fda095]{transform:translateY(-150px)}.container-buttons-chat.active .telegram[data-v-b1fda095]{transform:translateY(-100px)}.container-buttons-chat.active .webchat[data-v-b1fda095]{transform:translateY(-50px)}.widget-container[data-v-b1fda095]{position:relative}.new-message-badge[data-v-b1fda095]{position:absolute;background-color:red;width:30px;height:30px;display:flex;font-family:Roboto,sans-serif;align-items:center;font-weight:500;justify-content:center;border-radius:50%;right:-2px;top:-4px;z-index:2}.btn-primary[data-v-b1fda095]{color:var(--primary-color)}.btn-primary[data-v-b1fda095]:hover{opacity:.7}
@@ -1,4 +1,4 @@
1
- import { createElementBlock as I, openBlock as A, createElementVNode as b, unref as Ve, getCurrentScope as vo, onScopeDispose as bo, computed as ns, ref as U, watch as ss, getCurrentInstance as To, onMounted as rs, defineComponent as tn, onBeforeMount as So, Fragment as pt, renderList as Vn, normalizeClass as Be, createCommentVNode as Oe, createVNode as le, toDisplayString as Je, createBlock as is, Teleport as ko, withModifiers as Ee, renderSlot as Eo, nextTick as lt, reactive as Oo, onUnmounted as _o, withDirectives as Yt, withKeys as _t, vModelText as Ss, normalizeProps as Co, guardReactiveProps as xo, withCtx as No, createStaticVNode as Ao, vShow as ks } from "vue";
1
+ import { createElementBlock as I, openBlock as A, createElementVNode as b, unref as Ve, getCurrentScope as vo, onScopeDispose as bo, computed as ns, ref as U, watch as ss, getCurrentInstance as To, onMounted as rs, defineComponent as tn, onBeforeMount as So, Fragment as pt, renderList as Vn, normalizeClass as Be, createCommentVNode as Ee, createVNode as le, toDisplayString as Je, createBlock as is, Teleport as ko, withModifiers as xe, renderSlot as Eo, nextTick as lt, reactive as Oo, onUnmounted as _o, withDirectives as Yt, withKeys as _t, vModelText as Ss, normalizeProps as Co, guardReactiveProps as xo, withCtx as No, createStaticVNode as Ao, vShow as ks } from "vue";
2
2
  let Ct;
3
3
  const Ro = new Uint8Array(16);
4
4
  function Io() {
@@ -1933,7 +1933,7 @@ class ei extends We {
1933
1933
  }
1934
1934
  class Y extends We {
1935
1935
  }
1936
- class Ce extends We {
1936
+ class _e extends We {
1937
1937
  constructor() {
1938
1938
  super("Zone is an abstract class");
1939
1939
  }
@@ -2071,7 +2071,7 @@ class Tt {
2071
2071
  * @type {string}
2072
2072
  */
2073
2073
  get type() {
2074
- throw new Ce();
2074
+ throw new _e();
2075
2075
  }
2076
2076
  /**
2077
2077
  * The name of this zone.
@@ -2079,7 +2079,7 @@ class Tt {
2079
2079
  * @type {string}
2080
2080
  */
2081
2081
  get name() {
2082
- throw new Ce();
2082
+ throw new _e();
2083
2083
  }
2084
2084
  /**
2085
2085
  * The IANA name of this zone.
@@ -2096,7 +2096,7 @@ class Tt {
2096
2096
  * @type {boolean}
2097
2097
  */
2098
2098
  get isUniversal() {
2099
- throw new Ce();
2099
+ throw new _e();
2100
2100
  }
2101
2101
  /**
2102
2102
  * Returns the offset's common name (such as EST) at the specified timestamp
@@ -2108,7 +2108,7 @@ class Tt {
2108
2108
  * @return {string}
2109
2109
  */
2110
2110
  offsetName(e, n) {
2111
- throw new Ce();
2111
+ throw new _e();
2112
2112
  }
2113
2113
  /**
2114
2114
  * Returns the offset's value as a string
@@ -2119,7 +2119,7 @@ class Tt {
2119
2119
  * @return {string}
2120
2120
  */
2121
2121
  formatOffset(e, n) {
2122
- throw new Ce();
2122
+ throw new _e();
2123
2123
  }
2124
2124
  /**
2125
2125
  * Return the offset in minutes for this zone at the specified timestamp.
@@ -2128,7 +2128,7 @@ class Tt {
2128
2128
  * @return {number}
2129
2129
  */
2130
2130
  offset(e) {
2131
- throw new Ce();
2131
+ throw new _e();
2132
2132
  }
2133
2133
  /**
2134
2134
  * Return whether this Zone is equal to another zone
@@ -2137,7 +2137,7 @@ class Tt {
2137
2137
  * @return {boolean}
2138
2138
  */
2139
2139
  equals(e) {
2140
- throw new Ce();
2140
+ throw new _e();
2141
2141
  }
2142
2142
  /**
2143
2143
  * Return whether this Zone is valid.
@@ -2145,7 +2145,7 @@ class Tt {
2145
2145
  * @type {boolean}
2146
2146
  */
2147
2147
  get isValid() {
2148
- throw new Ce();
2148
+ throw new _e();
2149
2149
  }
2150
2150
  }
2151
2151
  let _n = null;
@@ -2226,13 +2226,13 @@ function La(t, e) {
2226
2226
  return s;
2227
2227
  }
2228
2228
  let xt = {};
2229
- class _e extends Tt {
2229
+ class Oe extends Tt {
2230
2230
  /**
2231
2231
  * @param {string} name - Zone name
2232
2232
  * @return {IANAZone}
2233
2233
  */
2234
2234
  static create(e) {
2235
- return xt[e] || (xt[e] = new _e(e)), xt[e];
2235
+ return xt[e] || (xt[e] = new Oe(e)), xt[e];
2236
2236
  }
2237
2237
  /**
2238
2238
  * Reset local caches. Should only be necessary in testing scenarios.
@@ -2270,7 +2270,7 @@ class _e extends Tt {
2270
2270
  }
2271
2271
  }
2272
2272
  constructor(e) {
2273
- super(), this.zoneName = e, this.valid = _e.isValidZone(e);
2273
+ super(), this.zoneName = e, this.valid = Oe.isValidZone(e);
2274
2274
  }
2275
2275
  /**
2276
2276
  * The type of zone. `iana` for all instances of `IANAZone`.
@@ -2471,7 +2471,7 @@ class ja {
2471
2471
  this.dt = e;
2472
2472
  else if (e.zone.type === "fixed") {
2473
2473
  const o = -1 * (e.offset / 60), a = o >= 0 ? `Etc/GMT+${o}` : `Etc/GMT${o}`;
2474
- e.offset !== 0 && _e.create(a).valid ? (r = a, this.dt = e) : (r = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
2474
+ e.offset !== 0 && Oe.create(a).valid ? (r = a, this.dt = e) : (r = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
2475
2475
  } else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, r = e.zone.name) : (r = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
2476
2476
  const i = { ...this.opts };
2477
2477
  i.timeZone = i.timeZone || r, this.dtf = Hn(n, i);
@@ -2801,7 +2801,7 @@ function Ae(t, e) {
2801
2801
  return t;
2802
2802
  if (n0(t)) {
2803
2803
  const n = t.toLowerCase();
2804
- return n === "default" ? e : n === "local" || n === "system" ? cn.instance : n === "utc" || n === "gmt" ? K.utcInstance : K.parseSpecifier(n) || _e.create(t);
2804
+ return n === "default" ? e : n === "local" || n === "system" ? cn.instance : n === "utc" || n === "gmt" ? K.utcInstance : K.parseSpecifier(n) || Oe.create(t);
2805
2805
  } else return Re(t) ? K.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new Ga(t);
2806
2806
  }
2807
2807
  const us = {
@@ -3010,7 +3010,7 @@ class q {
3010
3010
  * @return {void}
3011
3011
  */
3012
3012
  static resetCaches() {
3013
- F.resetCache(), _e.resetCache(), k.resetCache(), Xa();
3013
+ F.resetCache(), Oe.resetCache(), k.resetCache(), Xa();
3014
3014
  }
3015
3015
  }
3016
3016
  class ye {
@@ -3682,7 +3682,7 @@ function kt(t, e) {
3682
3682
  return [{}, r, e + 3];
3683
3683
  }
3684
3684
  function Et(t, e) {
3685
- const n = t[e] ? _e.create(t[e]) : null;
3685
+ const n = t[e] ? Oe.create(t[e]) : null;
3686
3686
  return [{}, n, e + 1];
3687
3687
  }
3688
3688
  const x0 = RegExp(`^T?${ms.source}$`), N0 = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
@@ -3898,7 +3898,7 @@ const or = "Invalid Duration", Wi = {
3898
3898
  "seconds",
3899
3899
  "milliseconds"
3900
3900
  ], rl = $e.slice(0).reverse();
3901
- function xe(t, e, n = !1) {
3901
+ function Ce(t, e, n = !1) {
3902
3902
  const s = {
3903
3903
  values: n ? e.values : { ...t.values, ...e.values || {} },
3904
3904
  loc: t.loc.clone(e.loc),
@@ -4262,7 +4262,7 @@ class M {
4262
4262
  const n = M.fromDurationLike(e), s = {};
4263
4263
  for (const r of $e)
4264
4264
  (Xe(n.values, r) || Xe(this.values, r)) && (s[r] = n.get(r) + this.get(r));
4265
- return xe(this, { values: s }, !0);
4265
+ return Ce(this, { values: s }, !0);
4266
4266
  }
4267
4267
  /**
4268
4268
  * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
@@ -4286,7 +4286,7 @@ class M {
4286
4286
  const n = {};
4287
4287
  for (const s of Object.keys(this.values))
4288
4288
  n[s] = Ni(e(this.values[s], s));
4289
- return xe(this, { values: n }, !0);
4289
+ return Ce(this, { values: n }, !0);
4290
4290
  }
4291
4291
  /**
4292
4292
  * Get the value of unit.
@@ -4309,7 +4309,7 @@ class M {
4309
4309
  set(e) {
4310
4310
  if (!this.isValid) return this;
4311
4311
  const n = { ...this.values, ...en(e, M.normalizeUnit) };
4312
- return xe(this, { values: n });
4312
+ return Ce(this, { values: n });
4313
4313
  }
4314
4314
  /**
4315
4315
  * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
@@ -4318,7 +4318,7 @@ class M {
4318
4318
  */
4319
4319
  reconfigure({ locale: e, numberingSystem: n, conversionAccuracy: s, matrix: r } = {}) {
4320
4320
  const o = { loc: this.loc.clone({ locale: e, numberingSystem: n }), matrix: r, conversionAccuracy: s };
4321
- return xe(this, o);
4321
+ return Ce(this, o);
4322
4322
  }
4323
4323
  /**
4324
4324
  * Return the length of the duration in the specified unit.
@@ -4349,7 +4349,7 @@ class M {
4349
4349
  normalize() {
4350
4350
  if (!this.isValid) return this;
4351
4351
  const e = this.toObject();
4352
- return ar(this.matrix, e), xe(this, { values: e }, !0);
4352
+ return ar(this.matrix, e), Ce(this, { values: e }, !0);
4353
4353
  }
4354
4354
  /**
4355
4355
  * Rescale units to its largest representation
@@ -4359,7 +4359,7 @@ class M {
4359
4359
  rescale() {
4360
4360
  if (!this.isValid) return this;
4361
4361
  const e = il(this.normalize().shiftToAll().toObject());
4362
- return xe(this, { values: e }, !0);
4362
+ return Ce(this, { values: e }, !0);
4363
4363
  }
4364
4364
  /**
4365
4365
  * Convert this Duration into its representation in a different set of units.
@@ -4385,7 +4385,7 @@ class M {
4385
4385
  } else Re(r[o]) && (s[o] = r[o]);
4386
4386
  for (const o in s)
4387
4387
  s[o] !== 0 && (n[i] += o === i ? s[o] : s[o] / this.matrix[i][o]);
4388
- return ar(this.matrix, n), xe(this, { values: n }, !0);
4388
+ return ar(this.matrix, n), Ce(this, { values: n }, !0);
4389
4389
  }
4390
4390
  /**
4391
4391
  * Shift this Duration to all available units.
@@ -4414,7 +4414,7 @@ class M {
4414
4414
  const e = {};
4415
4415
  for (const n of Object.keys(this.values))
4416
4416
  e[n] = this.values[n] === 0 ? 0 : -this.values[n];
4417
- return xe(this, { values: e }, !0);
4417
+ return Ce(this, { values: e }, !0);
4418
4418
  }
4419
4419
  /**
4420
4420
  * Get the years.
@@ -4991,7 +4991,7 @@ class At {
4991
4991
  * @return {boolean}
4992
4992
  */
4993
4993
  static isValidIANAZone(e) {
4994
- return _e.isValidZone(e);
4994
+ return Oe.isValidZone(e);
4995
4995
  }
4996
4996
  /**
4997
4997
  * Converts the input into a {@link Zone} instance.
@@ -5428,7 +5428,7 @@ function wl(t) {
5428
5428
  }
5429
5429
  };
5430
5430
  let n = null, s;
5431
- return E(t.z) || (n = _e.create(t.z)), E(t.Z) || (n || (n = new K(t.Z)), s = t.Z), E(t.q) || (t.M = (t.q - 1) * 3 + 1), E(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), E(t.u) || (t.S = hs(t.u)), [Object.keys(t).reduce((i, o) => {
5431
+ return E(t.z) || (n = Oe.create(t.z)), E(t.Z) || (n || (n = new K(t.Z)), s = t.Z), E(t.q) || (t.M = (t.q - 1) * 3 + 1), E(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), E(t.u) || (t.S = hs(t.u)), [Object.keys(t).reduce((i, o) => {
5432
5432
  const a = e(o);
5433
5433
  return a && (i[a] = t[o]), i;
5434
5434
  }, {}), n, s];
@@ -7389,7 +7389,7 @@ const Il = /* @__PURE__ */ ie(Nl, [["render", Rl]]), gr = "data:image/svg+xml,%3
7389
7389
  }, [
7390
7390
  le(Il)
7391
7391
  ], 8, Fl)
7392
- ])) : Oe("", !0),
7392
+ ])) : Ee("", !0),
7393
7393
  b("div", Vl, [
7394
7394
  b("div", {
7395
7395
  class: Be(["bubble", d.esCliente ? "right" : "left"])
@@ -7432,7 +7432,7 @@ const Il = /* @__PURE__ */ ie(Nl, [["render", Rl]]), gr = "data:image/svg+xml,%3
7432
7432
  width: "150"
7433
7433
  }, null, 8, Zl)
7434
7434
  ], 8, Hl)
7435
- ])) : Oe("", !0),
7435
+ ])) : Ee("", !0),
7436
7436
  f[d.message ?? ""] ? (A(), I("div", jl, [
7437
7437
  b("img", {
7438
7438
  src: f[d.message],
@@ -9844,7 +9844,7 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9844
9844
  n.modelValue ? (A(), I("div", rc, [
9845
9845
  b("div", {
9846
9846
  class: "dialog-content",
9847
- onClick: a[1] || (a[1] = Ee(() => {
9847
+ onClick: a[1] || (a[1] = xe(() => {
9848
9848
  }, ["stop"]))
9849
9849
  }, [
9850
9850
  b("div", ic, [
@@ -9860,8 +9860,8 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9860
9860
  Eo(o.$slots, "default", {}, void 0, !0)
9861
9861
  ])
9862
9862
  ])
9863
- ])) : Oe("", !0)
9864
- ])) : Oe("", !0);
9863
+ ])) : Ee("", !0)
9864
+ ])) : Ee("", !0);
9865
9865
  }
9866
9866
  }), lc = /* @__PURE__ */ ie(ac, [["__scopeId", "data-v-532e0111"]]), uc = { class: "widget" }, cc = { class: "header-widget flex-0" }, fc = { class: "title-chat" }, hc = {
9867
9867
  class: "flex-1",
@@ -9917,29 +9917,29 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9917
9917
  }), u = U(""), c = U(!1), f = e, g = t, y = U(null);
9918
9918
  ss(
9919
9919
  () => g.visible,
9920
- async (p) => {
9921
- if (!p || (f("clear-new-messages"), $(), s.value > 0 && Ps(u.value, g.tokenAuth), u.value)) return;
9922
- const m = await $s(g.tokenAuth);
9923
- m && (u.value = m.appChat.id);
9920
+ async (m) => {
9921
+ if (!m || (f("clear-new-messages"), $(), s.value > 0 && Ps(u.value, g.tokenAuth), u.value)) return;
9922
+ const p = await $s(g.tokenAuth);
9923
+ p && (u.value = p.appChat.id);
9924
9924
  }
9925
9925
  );
9926
- function d(p, m) {
9926
+ function d(m, p) {
9927
9927
  var T;
9928
9928
  if (wn.value) {
9929
9929
  he();
9930
9930
  return;
9931
9931
  }
9932
- if (p.key === "Enter" && p.shiftKey) {
9933
- const N = ((T = p.target) == null ? void 0 : T.value) || "";
9934
- p.target.value = N + `
9932
+ if (m.key === "Enter" && m.shiftKey) {
9933
+ const N = ((T = m.target) == null ? void 0 : T.value) || "";
9934
+ m.target.value = N + `
9935
9935
  `, he();
9936
9936
  return;
9937
9937
  }
9938
- O({ codigoTipoMensaje: m }), ve.modelValue = !1;
9938
+ O({ codigoTipoMensaje: p }), ve.modelValue = !1;
9939
9939
  }
9940
- function S(p, m) {
9940
+ function S(m, p) {
9941
9941
  var C, D, te, ne;
9942
- if ((p == null ? void 0 : p.length) > 300) {
9942
+ if ((m == null ? void 0 : m.length) > 300) {
9943
9943
  f("show-toast", {
9944
9944
  severity: "warn",
9945
9945
  summary: "Error",
@@ -9948,7 +9948,7 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9948
9948
  });
9949
9949
  return;
9950
9950
  }
9951
- if (!p.trim() && m !== Fe.IMAGEN) {
9951
+ if (!m.trim() && p !== Fe.IMAGEN) {
9952
9952
  f("show-toast", {
9953
9953
  severity: "warn",
9954
9954
  summary: "Error",
@@ -9957,13 +9957,13 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9957
9957
  });
9958
9958
  return;
9959
9959
  }
9960
- const T = m ? {
9961
- code: m
9960
+ const T = p ? {
9961
+ code: p
9962
9962
  } : void 0;
9963
9963
  return {
9964
9964
  id: Lo(),
9965
9965
  chatId: (D = (C = Q.value) == null ? void 0 : C.chat) == null ? void 0 : D.id,
9966
- message: p,
9966
+ message: m,
9967
9967
  visto: !0,
9968
9968
  multimedia: !1,
9969
9969
  esCliente: !0,
@@ -9981,16 +9981,16 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
9981
9981
  response: void 0
9982
9982
  };
9983
9983
  }
9984
- function w(p, m, T, N) {
9985
- if (m == null) throw new Error("idx is required");
9984
+ function w(m, p, T, N) {
9985
+ if (p == null) throw new Error("idx is required");
9986
9986
  if (!T) {
9987
9987
  if (N) {
9988
- const D = l.value.data[m];
9988
+ const D = l.value.data[p];
9989
9989
  D.response = void 0;
9990
9990
  } else
9991
- l.value.data[m].error = {
9991
+ l.value.data[p].error = {
9992
9992
  error: !0,
9993
- id: p.id
9993
+ id: m.id
9994
9994
  };
9995
9995
  f("show-toast", {
9996
9996
  severity: "error",
@@ -10000,40 +10000,40 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10000
10000
  });
10001
10001
  return;
10002
10002
  }
10003
- let C = { ...T, chatId: p == null ? void 0 : p.chatId };
10003
+ let C = { ...T, chatId: m == null ? void 0 : m.chatId };
10004
10004
  if (N) {
10005
- const D = l.value.data[m];
10006
- D.response = T, C = { ...D, chatId: p == null ? void 0 : p.chatId };
10005
+ const D = l.value.data[p];
10006
+ D.response = T, C = { ...D, chatId: m == null ? void 0 : m.chatId };
10007
10007
  } else {
10008
10008
  const D = { ...C };
10009
- D.urlFile = l.value.data[m].urlFile, delete D.thumbnailFile, l.value.data[m] = D;
10009
+ D.urlFile = l.value.data[p].urlFile, delete D.thumbnailFile, l.value.data[p] = D;
10010
10010
  }
10011
10011
  return C;
10012
10012
  }
10013
- const O = async (p) => {
10014
- const m = S(n.value, p == null ? void 0 : p.codigoTipoMensaje);
10015
- if (!m) return;
10013
+ const O = async (m) => {
10014
+ const p = S(n.value, m == null ? void 0 : m.codigoTipoMensaje);
10015
+ if (!p) return;
10016
10016
  let T = -1;
10017
- if (p != null && p.tipoCalificacionId) {
10018
- T = l.value.data.findIndex((D) => D.id === (p == null ? void 0 : p.mensajeARespondeId));
10017
+ if (m != null && m.tipoCalificacionId) {
10018
+ T = l.value.data.findIndex((D) => D.id === (m == null ? void 0 : m.mensajeARespondeId));
10019
10019
  const C = l.value.data[T];
10020
- C && (C.response = m);
10020
+ C && (C.response = p);
10021
10021
  } else
10022
- T = l.value.data.push(m) - 1;
10022
+ T = l.value.data.push(p) - 1;
10023
10023
  const N = {
10024
10024
  message: n.value,
10025
10025
  appChatId: u.value,
10026
- ...p,
10027
- codigoTipoMensaje: p == null ? void 0 : p.codigoTipoMensaje,
10026
+ ...m,
10027
+ codigoTipoMensaje: m == null ? void 0 : m.codigoTipoMensaje,
10028
10028
  files: Me.value
10029
10029
  };
10030
10030
  n.value = "", x(N).then((C) => {
10031
10031
  var te, ne;
10032
10032
  let D = w(
10033
- m,
10033
+ p,
10034
10034
  T,
10035
10035
  C,
10036
- p == null ? void 0 : p.tipoCalificacionId
10036
+ m == null ? void 0 : m.tipoCalificacionId
10037
10037
  );
10038
10038
  D && (Ot.value = !!l.value.data.find((ke) => {
10039
10039
  var at;
@@ -10046,36 +10046,36 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10046
10046
  }
10047
10047
  ));
10048
10048
  }), n.value = "", $(), B.value && (B.value.style.height = "20px");
10049
- }, x = async (p) => {
10050
- const m = {
10051
- ...p,
10049
+ }, x = async (m) => {
10050
+ const p = {
10051
+ ...m,
10052
10052
  esCliente: !0
10053
10053
  };
10054
- return va(m, g.tokenAuth);
10054
+ return va(p, g.tokenAuth);
10055
10055
  }, V = async () => {
10056
10056
  var N, C, D;
10057
- const p = (N = l.value.data[0]) == null ? void 0 : N.id, m = {
10058
- lastMessagesId: p,
10057
+ const m = (N = l.value.data[0]) == null ? void 0 : N.id, p = {
10058
+ lastMessagesId: m,
10059
10059
  appChatId: u.value,
10060
10060
  limit: 10
10061
10061
  };
10062
10062
  c.value = !0;
10063
- const T = await wa({ body: m, token: g.tokenAuth });
10063
+ const T = await wa({ body: p, token: g.tokenAuth });
10064
10064
  c.value = !1, Ot.value = !!T.data.find((te) => {
10065
10065
  var ne;
10066
10066
  return ((ne = te.messageType) == null ? void 0 : ne.code) === Fe.PREGUNTA && te.response == null;
10067
10067
  }), l.value.data.unshift(
10068
10068
  ...T.data.sort((te, ne) => -ne.createdAt.localeCompare(te.createdAt))
10069
- ), l.value.canLoadMoreMessages = T.pagination.total > T.pagination.size, p && ((C = y.value) != null && C.scrollHeight) && oe((D = y.value) == null ? void 0 : D.scrollHeight), p || $();
10070
- }, ee = async (p) => {
10069
+ ), l.value.canLoadMoreMessages = T.pagination.total > T.pagination.size, m && ((C = y.value) != null && C.scrollHeight) && oe((D = y.value) == null ? void 0 : D.scrollHeight), m || $();
10070
+ }, ee = async (m) => {
10071
10071
  f("show-confirm", async () => {
10072
10072
  var T, N, C;
10073
- if (!((T = p.error) != null && T.id)) return;
10074
- const m = await x({
10075
- message: p.message,
10073
+ if (!((T = m.error) != null && T.id)) return;
10074
+ const p = await x({
10075
+ message: m.message,
10076
10076
  appChatId: u.value
10077
10077
  });
10078
- if (!m)
10078
+ if (!p)
10079
10079
  f("show-toast", {
10080
10080
  severity: "error",
10081
10081
  summary: "Error",
@@ -10086,11 +10086,11 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10086
10086
  const D = iu(
10087
10087
  l.value.data,
10088
10088
  "id",
10089
- p.error.id
10089
+ m.error.id
10090
10090
  );
10091
- l.value.data[D] = { ...m, error: void 0 }, (C = Z.value) == null || C.emit("sendMessage", {
10091
+ l.value.data[D] = { ...p, error: void 0 }, (C = Z.value) == null || C.emit("sendMessage", {
10092
10092
  roomId: (N = Q == null ? void 0 : Q.value) == null ? void 0 : N.appChat.id,
10093
- message: p
10093
+ message: m
10094
10094
  });
10095
10095
  }
10096
10096
  $();
@@ -10099,58 +10099,58 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10099
10099
  lt(() => {
10100
10100
  y.value && (y.value.scrollTop = y.value.scrollHeight);
10101
10101
  });
10102
- }, oe = (p) => {
10102
+ }, oe = (m) => {
10103
10103
  lt(() => {
10104
- const m = y.value;
10105
- m && (m.scrollTop = m.scrollHeight - p);
10104
+ const p = y.value;
10105
+ p && (p.scrollTop = p.scrollHeight - m);
10106
10106
  });
10107
10107
  }, B = U();
10108
10108
  function he() {
10109
10109
  B.value && (B.value.style.height = B.value.scrollHeight - Cc + "px", B.value.scrollHeight !== B.value.clientHeight && (B.value.style.height = B.value.scrollHeight + "px"));
10110
10110
  }
10111
10111
  const Z = U(), Q = U();
10112
- function gn(p, m = mo.WEBCHAT) {
10112
+ function gn(m, p = mo.WEBCHAT) {
10113
10113
  var T, N;
10114
- if (!p) throw new Error("user chat is required");
10114
+ if (!m) throw new Error("user chat is required");
10115
10115
  Z.value = jt(window.VITE_SOCKET_URI, {
10116
10116
  query: {
10117
10117
  // TODO: confirmar si se quita o no
10118
- usuarioId: `${(N = (T = p == null ? void 0 : p.chat) == null ? void 0 : T.persona) == null ? void 0 : N.funcionarioId}`,
10119
- aplicacion: m
10118
+ usuarioId: `${(N = (T = m == null ? void 0 : m.chat) == null ? void 0 : T.persona) == null ? void 0 : N.funcionarioId}`,
10119
+ aplicacion: p
10120
10120
  },
10121
10121
  extraHeaders: { Authorization: g.tokenAuth }
10122
10122
  }), Z.value.removeAllListeners(), Z.value.on("connect", () => {
10123
10123
  var C, D;
10124
- console.log("Conectado al servidor de sockets"), (D = Z.value) == null || D.emit("joinRoom", `${(C = p == null ? void 0 : p.appChat) == null ? void 0 : C.id}`);
10124
+ console.log("Conectado al servidor de sockets"), (D = Z.value) == null || D.emit("joinRoom", `${(C = m == null ? void 0 : m.appChat) == null ? void 0 : C.id}`);
10125
10125
  }), Z.value.on("disconnect", () => {
10126
10126
  console.log("Desconectado del servidor de sockets");
10127
10127
  }), Z.value.on("receiveMessage", (C) => {
10128
10128
  var te, ne;
10129
- console.log("Mensaje recibido:", C.message, p);
10129
+ console.log("Mensaje recibido:", C.message, m);
10130
10130
  const D = l.value.data.findIndex((ke) => ke.id === C.message.id);
10131
- C.message.sender.msPersonaId === ((ne = (te = p == null ? void 0 : p.chat) == null ? void 0 : te.persona) == null ? void 0 : ne.msPersonaId) && D === -1 || (D !== -1 ? l.value.data[D].response = C.message.response : l.value.data.push(C.message), Ot.value = !!l.value.data.find((ke) => {
10131
+ C.message.sender.msPersonaId === ((ne = (te = m == null ? void 0 : m.chat) == null ? void 0 : te.persona) == null ? void 0 : ne.msPersonaId) && D === -1 || (D !== -1 ? l.value.data[D].response = C.message.response : l.value.data.push(C.message), Ot.value = !!l.value.data.find((ke) => {
10132
10132
  var at;
10133
10133
  return ((at = ke.messageType) == null ? void 0 : at.code) === Fe.PREGUNTA && ke.response == null;
10134
10134
  }), Ps(C.message.appChatId, g.tokenAuth), $(), !g.visible && f("new-message"));
10135
10135
  });
10136
10136
  }
10137
10137
  const { isMobile: wn } = Xu();
10138
- function po({ message: p, emoji: m }) {
10138
+ function po({ message: m, emoji: p }) {
10139
10139
  const T = async () => {
10140
- !p.id || !m || (n.value = m.iconUnicode, O({
10141
- tipoCalificacionId: m.value,
10142
- mensajeARespondeId: p.id
10140
+ !m.id || !p || (n.value = p.iconUnicode, O({
10141
+ tipoCalificacionId: p.value,
10142
+ mensajeARespondeId: m.id
10143
10143
  }).then());
10144
10144
  };
10145
- f("onQualifying", { message: m.iconUnicode, callback: T });
10145
+ f("onQualifying", { message: p.iconUnicode, callback: T });
10146
10146
  }
10147
10147
  const Ot = U(!1), vn = ["image/png", "image/jpeg", "image/jpg", "image/webp"];
10148
10148
  function yo() {
10149
10149
  var T;
10150
10150
  Me.value = [], Se.value = [];
10151
- const p = Array.from((T = r.value) == null ? void 0 : T.files) ?? [], m = p == null ? void 0 : p[0];
10152
- if (Me.value = p, !!m) {
10153
- if (!vn.includes(m.type)) {
10151
+ const m = Array.from((T = r.value) == null ? void 0 : T.files) ?? [], p = m == null ? void 0 : m[0];
10152
+ if (Me.value = m, !!p) {
10153
+ if (!vn.includes(p.type)) {
10154
10154
  f("show-toast", {
10155
10155
  severity: "warn",
10156
10156
  summary: "Error",
@@ -10159,7 +10159,7 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10159
10159
  });
10160
10160
  return;
10161
10161
  }
10162
- if (m.size > 2e6) {
10162
+ if (p.size > 2e6) {
10163
10163
  f("show-toast", {
10164
10164
  severity: "warn",
10165
10165
  summary: "Error",
@@ -10168,25 +10168,25 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10168
10168
  });
10169
10169
  return;
10170
10170
  }
10171
- Se.value.push(URL.createObjectURL(m)), i.value = 0, ve.title = "Vista previa", ve.modelValue = !0, lt(() => {
10171
+ Se.value.push(URL.createObjectURL(p)), i.value = 0, ve.title = "Vista previa", ve.modelValue = !0, lt(() => {
10172
10172
  var N;
10173
10173
  (N = B.value) == null || N.focus();
10174
10174
  });
10175
10175
  }
10176
10176
  }
10177
- const go = (p) => {
10177
+ const go = (m) => {
10178
10178
  var N, C;
10179
- const m = ((N = p.clipboardData) == null ? void 0 : N.files) ?? ((C = window.clipboardData) == null ? void 0 : C.files) ?? [];
10180
- if (m.length === 0) return;
10181
- const T = m == null ? void 0 : m[0];
10182
- T && vn.includes(T == null ? void 0 : T.type) && (i.value = 0, Se.value = [], Me.value = [T], Se.value.push(URL.createObjectURL(T)), ve.modelValue = !0, lt(() => {
10179
+ const p = ((N = m.clipboardData) == null ? void 0 : N.files) ?? ((C = window.clipboardData) == null ? void 0 : C.files) ?? [];
10180
+ if (p.length === 0) return;
10181
+ const T = p == null ? void 0 : p[0];
10182
+ T && vn.includes(T == null ? void 0 : T.type) && (m.preventDefault(), i.value = 0, Se.value = [], Me.value = [T], Se.value.push(URL.createObjectURL(T)), ve.modelValue = !0, lt(() => {
10183
10183
  var D;
10184
10184
  (D = B.value) == null || D.focus();
10185
10185
  }));
10186
10186
  };
10187
- function wo(p) {
10188
- var m;
10189
- (m = p.dataTransfer) != null && m.items && (i.value = 0, Array.from(p.dataTransfer.items).forEach((T) => {
10187
+ function wo(m) {
10188
+ var p;
10189
+ (p = m.dataTransfer) != null && p.items && (i.value = 0, Array.from(m.dataTransfer.items).forEach((T) => {
10190
10190
  if (T.kind === "file") {
10191
10191
  const N = T.getAsFile();
10192
10192
  if (!N) return;
@@ -10208,24 +10208,24 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10208
10208
  }
10209
10209
  const Me = U([]), Se = U([]), ve = Oo({
10210
10210
  modelValue: !1,
10211
- "onUpdate:modelValue": (p) => {
10212
- ve.modelValue = p, !p && (Se.value = [], Me.value = []);
10211
+ "onUpdate:modelValue": (m) => {
10212
+ ve.modelValue = m, !m && (Se.value = [], Me.value = []);
10213
10213
  },
10214
10214
  title: "Preparar imagen"
10215
10215
  });
10216
10216
  return rs(async () => {
10217
10217
  if (u.value) return;
10218
- const p = await $s(g.tokenAuth);
10219
- p && (Q.value = p, u.value = p.appChat.id, s.value = p.appChat.totalNoVistosCliente, gn(p), V(), f("not-viewed-total", p.appChat.totalNoVistosCliente));
10218
+ const m = await $s(g.tokenAuth);
10219
+ m && (Q.value = m, u.value = m.appChat.id, s.value = m.appChat.totalNoVistosCliente, gn(m), V(), f("not-viewed-total", m.appChat.totalNoVistosCliente));
10220
10220
  }), _o(() => {
10221
- var p;
10222
- (p = Z.value) == null || p.off();
10223
- }), (p, m) => (A(), I(pt, null, [
10221
+ var m;
10222
+ (m = Z.value) == null || m.off();
10223
+ }), (m, p) => (A(), I(pt, null, [
10224
10224
  b("div", uc, [
10225
10225
  b("div", cc, [
10226
10226
  b("h4", fc, Je(t.titlePrincipal), 1),
10227
10227
  b("button", {
10228
- onClick: m[0] || (m[0] = () => t.toggleChat()),
10228
+ onClick: p[0] || (p[0] = () => t.toggleChat()),
10229
10229
  class: "btn-close"
10230
10230
  }, [
10231
10231
  le(Cr, { class: "pointer" })
@@ -10235,28 +10235,28 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10235
10235
  b("div", {
10236
10236
  ref_key: "dropZoneRef",
10237
10237
  ref: a,
10238
- onDrop: m[1] || (m[1] = Ee(
10238
+ onDrop: p[1] || (p[1] = xe(
10239
10239
  (T) => {
10240
10240
  var N, C;
10241
10241
  wo(T), (C = (N = T.target) == null ? void 0 : N.classList) == null || C.remove("drop-over"), T.target.style.zIndex = "-1";
10242
10242
  },
10243
10243
  ["self", "prevent"]
10244
10244
  )),
10245
- onDragenter: m[2] || (m[2] = Ee(
10245
+ onDragenter: p[2] || (p[2] = xe(
10246
10246
  (T) => {
10247
10247
  var N, C;
10248
10248
  (C = (N = T.target) == null ? void 0 : N.classList) == null || C.add("drop-over");
10249
10249
  },
10250
10250
  ["self"]
10251
10251
  )),
10252
- onDragleave: m[3] || (m[3] = Ee(
10252
+ onDragleave: p[3] || (p[3] = xe(
10253
10253
  (T) => {
10254
10254
  var N, C;
10255
10255
  (C = (N = T.target) == null ? void 0 : N.classList) == null || C.remove("drop-over"), T.target.style.zIndex = "-1";
10256
10256
  },
10257
10257
  ["self"]
10258
10258
  )),
10259
- onDragover: m[4] || (m[4] = Ee(() => {
10259
+ onDragover: p[4] || (p[4] = xe(() => {
10260
10260
  }, ["prevent"])),
10261
10261
  style: { position: "absolute", bottom: "0", left: "0", right: "0", top: "0", "z-index": "-1" }
10262
10262
  }, null, 544),
@@ -10264,22 +10264,22 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10264
10264
  class: "messages-container",
10265
10265
  ref_key: "messageContainerRef",
10266
10266
  ref: y,
10267
- onDragenter: m[7] || (m[7] = Ee((T) => a.value.style.zIndex = "1", ["prevent"]))
10267
+ onDragenter: p[7] || (p[7] = xe((T) => a.value.style.zIndex = "1", ["prevent"]))
10268
10268
  }, [
10269
10269
  c.value ? (A(), I("div", dc, [
10270
10270
  le(ru)
10271
- ])) : Oe("", !0),
10271
+ ])) : Ee("", !0),
10272
10272
  l.value.data.length > 0 ? (A(), is(eu, {
10273
10273
  key: 1,
10274
10274
  messages: l.value.data,
10275
10275
  canLoadMoreMessages: l.value.canLoadMoreMessages,
10276
10276
  onLoadMore: V,
10277
10277
  onRetry: ee,
10278
- onOnQualifying: m[5] || (m[5] = (T) => po(T)),
10279
- onSee: m[6] || (m[6] = (T) => {
10278
+ onOnQualifying: p[5] || (p[5] = (T) => po(T)),
10279
+ onSee: p[6] || (p[6] = (T) => {
10280
10280
  i.value = 1, o.value = T.urlFile, ve.title = "Imagen", ve.modelValue = !0;
10281
10281
  })
10282
- }, null, 8, ["messages", "canLoadMoreMessages"])) : (A(), I("div", mc, m[18] || (m[18] = [
10282
+ }, null, 8, ["messages", "canLoadMoreMessages"])) : (A(), I("div", mc, p[18] || (p[18] = [
10283
10283
  b("span", { class: "center" }, "No tienes mensajes", -1)
10284
10284
  ])))
10285
10285
  ], 544)
@@ -10288,26 +10288,26 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10288
10288
  Ot.value ? (A(), I("span", vc, " Necesitamos que nos califique la atención para continuar ")) : (A(), I("form", {
10289
10289
  key: 0,
10290
10290
  class: "message-send",
10291
- onSubmit: m[12] || (m[12] = Ee((T) => O(), ["prevent"]))
10291
+ onSubmit: p[12] || (p[12] = xe((T) => O(), ["prevent"]))
10292
10292
  }, [
10293
10293
  b("div", yc, [
10294
10294
  b("div", gc, [
10295
10295
  Yt(b("textarea", {
10296
- "onUpdate:modelValue": m[8] || (m[8] = (T) => n.value = T),
10296
+ "onUpdate:modelValue": p[8] || (p[8] = (T) => n.value = T),
10297
10297
  class: "jl2-input-chat",
10298
10298
  placeholder: "Escribe tu mensaje",
10299
10299
  required: "",
10300
10300
  ref_key: "textAreaRef",
10301
10301
  ref: B,
10302
- onInput: m[9] || (m[9] = () => he()),
10303
- onKeydown: m[10] || (m[10] = _t(
10302
+ onInput: p[9] || (p[9] = () => he()),
10303
+ onKeydown: p[10] || (p[10] = _t(
10304
10304
  (T) => {
10305
10305
  !Ve(wn) && T.preventDefault();
10306
10306
  },
10307
10307
  ["enter"]
10308
10308
  )),
10309
10309
  onKeyup: _t(d, ["enter"]),
10310
- onPaste: Ee(go, ["prevent"])
10310
+ onPaste: go
10311
10311
  }, null, 544), [
10312
10312
  [Ss, n.value]
10313
10313
  ]),
@@ -10323,7 +10323,7 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10323
10323
  type: "button",
10324
10324
  class: "pointer btn-primary",
10325
10325
  title: "Adjuntar archivo",
10326
- onClick: m[11] || (m[11] = () => {
10326
+ onClick: p[11] || (p[11] = () => {
10327
10327
  var T;
10328
10328
  r.value.value = "", (T = r.value) == null || T.click();
10329
10329
  })
@@ -10349,7 +10349,7 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10349
10349
  }, null, 8, Tc))), 128)),
10350
10350
  b("form", {
10351
10351
  class: "message-send",
10352
- onSubmit: m[17] || (m[17] = Ee(
10352
+ onSubmit: p[17] || (p[17] = xe(
10353
10353
  (T) => {
10354
10354
  O({ codigoTipoMensaje: Ve(Fe).IMAGEN }), ve.modelValue = !1;
10355
10355
  },
@@ -10359,20 +10359,20 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10359
10359
  b("div", Sc, [
10360
10360
  b("div", kc, [
10361
10361
  Yt(b("textarea", {
10362
- "onUpdate:modelValue": m[13] || (m[13] = (T) => n.value = T),
10362
+ "onUpdate:modelValue": p[13] || (p[13] = (T) => n.value = T),
10363
10363
  autofocus: "",
10364
10364
  class: "jl2-input-chat",
10365
10365
  placeholder: "Escribe tu mensaje",
10366
10366
  ref_key: "textAreaRef",
10367
10367
  ref: B,
10368
- onInput: m[14] || (m[14] = () => he()),
10369
- onKeydown: m[15] || (m[15] = _t(
10368
+ onInput: p[14] || (p[14] = () => he()),
10369
+ onKeydown: p[15] || (p[15] = _t(
10370
10370
  (T) => {
10371
10371
  !Ve(wn) && T.preventDefault();
10372
10372
  },
10373
10373
  ["enter"]
10374
10374
  )),
10375
- onKeyup: m[16] || (m[16] = _t((T) => {
10375
+ onKeyup: p[16] || (p[16] = _t((T) => {
10376
10376
  d(T, Ve(Fe).IMAGEN);
10377
10377
  }, ["enter"]))
10378
10378
  }, null, 544), [
@@ -10390,14 +10390,14 @@ const sc = /* @__PURE__ */ ie(ec, [["render", nc]]), rc = {
10390
10390
  src: o.value,
10391
10391
  alt: "Image",
10392
10392
  style: { "max-height": "85vh" }
10393
- }, null, 8, _c)) : Oe("", !0)
10393
+ }, null, 8, _c)) : Ee("", !0)
10394
10394
  ]))
10395
10395
  ]),
10396
10396
  _: 1
10397
10397
  }, 16)
10398
10398
  ], 64));
10399
10399
  }
10400
- }), Nc = /* @__PURE__ */ ie(xc, [["__scopeId", "data-v-9d715781"]]), Ac = {}, Rc = {
10400
+ }), Nc = /* @__PURE__ */ ie(xc, [["__scopeId", "data-v-4b8311cb"]]), Ac = {}, Rc = {
10401
10401
  width: "87",
10402
10402
  height: "87",
10403
10403
  viewBox: "0 0 87 87",
@@ -10596,7 +10596,7 @@ const Hc = /* @__PURE__ */ ie(qc, [["render", zc]]), Zc = {
10596
10596
  le(Hc)
10597
10597
  ], 2)
10598
10598
  ], 2),
10599
- i.value ? (A(), I("div", jc, Je(i.value > 9 ? "9+" : i.value), 1)) : Oe("", !0),
10599
+ i.value ? (A(), I("div", jc, Je(i.value > 9 ? "9+" : i.value), 1)) : Ee("", !0),
10600
10600
  b("a", {
10601
10601
  href: "javascript:;",
10602
10602
  onClick: c[3] || (c[3] = (f) => l.tokenAuth.length > 10 && a()),
@@ -10606,7 +10606,7 @@ const Hc = /* @__PURE__ */ ie(qc, [["render", zc]]), Zc = {
10606
10606
  ])
10607
10607
  ], 512)), [
10608
10608
  [ks, !r.value]
10609
- ]) : Oe("", !0),
10609
+ ]) : Ee("", !0),
10610
10610
  Yt(b("div", Yc, [
10611
10611
  t.tokenAuth ? (A(), is(Nc, {
10612
10612
  key: 0,
@@ -10621,7 +10621,7 @@ const Hc = /* @__PURE__ */ ie(qc, [["render", zc]]), Zc = {
10621
10621
  onNewMessage: c[7] || (c[7] = () => i.value++),
10622
10622
  onNotViewedTotal: c[8] || (c[8] = (f) => i.value = f),
10623
10623
  onOnQualifying: c[9] || (c[9] = (f) => n("onQualifying", f))
10624
- }, null, 8, ["visible", "titlePrincipal", "tokenAuth", "user"])) : Oe("", !0)
10624
+ }, null, 8, ["visible", "titlePrincipal", "tokenAuth", "user"])) : Ee("", !0)
10625
10625
  ], 512), [
10626
10626
  [ks, r.value]
10627
10627
  ])
@@ -10,8 +10,8 @@
10
10
  c-7.701,7.596-7.701,19.926,0,27.53s20.188,7.604,27.88,0L235.02,87.987l-0.035-0.026l0.473-0.403
11
11
  c15.682-15.568,15.682-40.823,0-56.39s-41.094-15.568-56.776,0l-0.42,0.473l-0.026-0.018l-14.194,14.089L50.466,158.485
12
12
  c-23.522,23.356-23.522,61.221,0,84.577s61.659,23.356,85.163,0l99.375-98.675l14.194-14.089l14.194,14.089l-14.194,14.098
13
- l-99.357,98.675C149.841,257.159,149.823,257.142,149.823,257.142z`})],-1)]))}const hc=K(cc,[["render",fc]]),dc={key:0,class:"dialog-overlay"},mc={class:"header-widget"},pc={class:"title-chat"},yc=K(l.defineComponent({__name:"ODialog",props:{modelValue:{type:Boolean},title:{},"onUpdate:modelValue":{type:Function}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,s=e,r=l.ref(!1),i=()=>{s("update:modelValue",!1)};return l.onMounted(()=>{const o=document.getElementById("app");if(!o)throw new Error("app is required");let a=document.getElementById("dialogs");a||(a=document.createElement("div"),a.id="dialogs",a.classList.add("widget-component"),o.appendChild(a),r.value=!0)}),(o,a)=>r.value?(l.openBlock(),l.createBlock(l.Teleport,{key:0,to:"#dialogs"},[n.modelValue?(l.openBlock(),l.createElementBlock("div",dc,[l.createElementVNode("div",{class:"dialog-content",onClick:a[1]||(a[1]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",mc,[l.createElementVNode("h4",pc,l.toDisplayString(o.title),1),l.createElementVNode("button",{onClick:a[0]||(a[0]=()=>i()),class:"btn-close"},[l.createVNode(is,{class:"pointer"})])]),l.createElementVNode("div",null,[l.renderSlot(o.$slots,"default",{},void 0,!0)])])])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-532e0111"]]),gc={class:"widget"},wc={class:"header-widget flex-0"},Ec={class:"title-chat"},kc={class:"flex-1",style:{position:"relative",height:"0"}},bc={key:0,class:"loader"},Tc={key:2,class:"fit"},Sc={class:"w-full flex-0"},vc={class:"form-message"},Oc={class:"jl-inputgroup-chat"},_c={type:"submit",class:"pointer btn-primary"},Nc={key:1,class:"message-send-block"},Cc={key:0,class:"flex flex-col justify-center items-center"},xc=["src"],Ac={class:"form-message"},Rc={class:"jl-inputgroup-chat"},Ic={type:"submit",class:"pointer btn-primary"},Mc={key:1},Dc=["src"],Lc=14,Vc=K(l.defineComponent({__name:"Chat",props:{titlePrincipal:{type:String,default:"Comunicación en linea para consultas"},toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},user:{type:Object,required:!0},visible:{type:Boolean,required:!0}},emits:["show-toast","show-confirm","new-message","clear-new-messages","not-viewed-total","onQualifying"],setup(t,{emit:e}){const n=l.ref(""),s=l.ref(0),r=l.ref(),i=l.ref(1),o=l.ref(),a=l.ref(),c=l.ref({data:[],canLoadMoreMessages:!1}),u=l.ref(""),f=l.ref(!1),h=e,w=t,g=l.ref(null);l.watch(()=>w.visible,async y=>{if(!y||(h("clear-new-messages"),B(),s.value>0&&Zs(u.value,w.tokenAuth),u.value))return;const p=await Hs(w.tokenAuth);p&&(u.value=p.appChat.id)});function m(y,p){var b;if(ns.value){me();return}if(y.key==="Enter"&&y.shiftKey){const x=((b=y.target)==null?void 0:b.value)||"";y.target.value=x+`
14
- `,me();return}_({codigoTipoMensaje:p}),ge.modelValue=!1}function T(y,p){var N,M,te,ne;if((y==null?void 0:y.length)>300){h("show-toast",{severity:"warn",summary:"Error",detail:"El mensaje no puede superar los 300 caracteres",life:5e3});return}if(!y.trim()&&p!==Le.IMAGEN){h("show-toast",{severity:"warn",summary:"Error",detail:"Por favor ingrese un mensaje",life:5e3});return}const b=p?{code:p}:void 0;return{id:Ki(),chatId:(M=(N=G.value)==null?void 0:N.chat)==null?void 0:M.id,message:y,visto:!0,multimedia:!1,esCliente:!0,appChatId:u.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),file:(te=Ve.value)==null?void 0:te[0],urlFile:(ne=Ee.value)==null?void 0:ne[0],messageType:b,sender:{nombreCompleto:w.user.nombreCompleto,ci:w.user.ci,msPersonaId:w.user.msPersonaId},response:void 0}}function k(y,p,b,x){if(p==null)throw new Error("idx is required");if(!b){if(x){const M=c.value.data[p];M.response=void 0}else c.value.data[p].error={error:!0,id:y.id};h("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});return}let N={...b,chatId:y==null?void 0:y.chatId};if(x){const M=c.value.data[p];M.response=b,N={...M,chatId:y==null?void 0:y.chatId}}else{const M={...N};M.urlFile=c.value.data[p].urlFile,delete M.thumbnailFile,c.value.data[p]=M}return N}const _=async y=>{const p=T(n.value,y==null?void 0:y.codigoTipoMensaje);if(!p)return;let b=-1;if(y!=null&&y.tipoCalificacionId){b=c.value.data.findIndex(M=>M.id===(y==null?void 0:y.mensajeARespondeId));const N=c.value.data[b];N&&(N.response=p)}else b=c.value.data.push(p)-1;const x={message:n.value,appChatId:u.value,...y,codigoTipoMensaje:y==null?void 0:y.codigoTipoMensaje,files:Ve.value};n.value="",C(x).then(N=>{var te,ne;let M=k(p,b,N,y==null?void 0:y.tipoCalificacionId);M&&(tn.value=!!c.value.data.find(ke=>{var mt;return((mt=ke.messageType)==null?void 0:mt.code)===Le.PREGUNTA&&ke.response==null}),(ne=W.value)==null||ne.emit("sendMessage",{roomId:(te=G==null?void 0:G.value)==null?void 0:te.appChat.id,message:M},ke=>{console.log("🚀 ~ socketService.value.emit ~ response:",ke)}))}),n.value="",B(),V.value&&(V.value.style.height="20px")},C=async y=>{const p={...y,esCliente:!0};return Aa(p,w.tokenAuth)},L=async()=>{var x,N,M;const y=(x=c.value.data[0])==null?void 0:x.id,p={lastMessagesId:y,appChatId:u.value,limit:10};f.value=!0;const b=await xa({body:p,token:w.tokenAuth});f.value=!1,tn.value=!!b.data.find(te=>{var ne;return((ne=te.messageType)==null?void 0:ne.code)===Le.PREGUNTA&&te.response==null}),c.value.data.unshift(...b.data.sort((te,ne)=>-ne.createdAt.localeCompare(te.createdAt))),c.value.canLoadMoreMessages=b.pagination.total>b.pagination.size,y&&((N=g.value)!=null&&N.scrollHeight)&&ae((M=g.value)==null?void 0:M.scrollHeight),y||B()},ee=async y=>{h("show-confirm",async()=>{var b,x,N;if(!((b=y.error)!=null&&b.id))return;const p=await C({message:y.message,appChatId:u.value});if(!p)h("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{const M=ml(c.value.data,"id",y.error.id);c.value.data[M]={...p,error:void 0},(N=W.value)==null||N.emit("sendMessage",{roomId:(x=G==null?void 0:G.value)==null?void 0:x.appChat.id,message:y})}B()})},B=()=>{l.nextTick(()=>{g.value&&(g.value.scrollTop=g.value.scrollHeight)})},ae=y=>{l.nextTick(()=>{const p=g.value;p&&(p.scrollTop=p.scrollHeight-y)})},V=l.ref();function me(){V.value&&(V.value.style.height=V.value.scrollHeight-Lc+"px",V.value.scrollHeight!==V.value.clientHeight&&(V.value.style.height=V.value.scrollHeight+"px"))}const W=l.ref(),G=l.ref();function ts(y,p=Zi.WEBCHAT){var b,x;if(!y)throw new Error("user chat is required");W.value=en(window.VITE_SOCKET_URI,{query:{usuarioId:`${(x=(b=y==null?void 0:y.chat)==null?void 0:b.persona)==null?void 0:x.funcionarioId}`,aplicacion:p},extraHeaders:{Authorization:w.tokenAuth}}),W.value.removeAllListeners(),W.value.on("connect",()=>{var N,M;console.log("Conectado al servidor de sockets"),(M=W.value)==null||M.emit("joinRoom",`${(N=y==null?void 0:y.appChat)==null?void 0:N.id}`)}),W.value.on("disconnect",()=>{console.log("Desconectado del servidor de sockets")}),W.value.on("receiveMessage",N=>{var te,ne;console.log("Mensaje recibido:",N.message,y);const M=c.value.data.findIndex(ke=>ke.id===N.message.id);N.message.sender.msPersonaId===((ne=(te=y==null?void 0:y.chat)==null?void 0:te.persona)==null?void 0:ne.msPersonaId)&&M===-1||(M!==-1?c.value.data[M].response=N.message.response:c.value.data.push(N.message),tn.value=!!c.value.data.find(ke=>{var mt;return((mt=ke.messageType)==null?void 0:mt.code)===Le.PREGUNTA&&ke.response==null}),Zs(N.message.appChatId,w.tokenAuth),B(),!w.visible&&h("new-message"))})}const{isMobile:ns}=lc();function ru({message:y,emoji:p}){const b=async()=>{!y.id||!p||(n.value=p.iconUnicode,_({tipoCalificacionId:p.value,mensajeARespondeId:y.id}).then())};h("onQualifying",{message:p.iconUnicode,callback:b})}const tn=l.ref(!1),ss=["image/png","image/jpeg","image/jpg","image/webp"];function iu(){var b;Ve.value=[],Ee.value=[];const y=Array.from((b=r.value)==null?void 0:b.files)??[],p=y==null?void 0:y[0];if(Ve.value=y,!!p){if(!ss.includes(p.type)){h("show-toast",{severity:"warn",summary:"Error",detail:"El archivo debe ser una imagen permitida (png, jpeg, jpg, webp)",life:5e3});return}if(p.size>2e6){h("show-toast",{severity:"warn",summary:"Error",detail:"El archivo excede los 2MB",life:5e3});return}Ee.value.push(URL.createObjectURL(p)),i.value=0,ge.title="Vista previa",ge.modelValue=!0,l.nextTick(()=>{var x;(x=V.value)==null||x.focus()})}}const ou=y=>{var x,N;const p=((x=y.clipboardData)==null?void 0:x.files)??((N=window.clipboardData)==null?void 0:N.files)??[];if(p.length===0)return;const b=p==null?void 0:p[0];b&&ss.includes(b==null?void 0:b.type)&&(i.value=0,Ee.value=[],Ve.value=[b],Ee.value.push(URL.createObjectURL(b)),ge.modelValue=!0,l.nextTick(()=>{var M;(M=V.value)==null||M.focus()}))};function au(y){var p;(p=y.dataTransfer)!=null&&p.items&&(i.value=0,Array.from(y.dataTransfer.items).forEach(b=>{if(b.kind==="file"){const x=b.getAsFile();if(!x)return;if(!ss.includes(x.type)){h("show-toast",{severity:"error",summary:"Error",detail:"El archivo debe ser una imagen",life:5e3});return}Ve.value=[x],Ee.value=[],Ee.value.push(URL.createObjectURL(x)),ge.modelValue=!0}}),l.nextTick(()=>{var b;(b=V.value)==null||b.focus()}))}const Ve=l.ref([]),Ee=l.ref([]),ge=l.reactive({modelValue:!1,"onUpdate:modelValue":y=>{ge.modelValue=y,!y&&(Ee.value=[],Ve.value=[])},title:"Preparar imagen"});return l.onMounted(async()=>{if(u.value)return;const y=await Hs(w.tokenAuth);y&&(G.value=y,u.value=y.appChat.id,s.value=y.appChat.totalNoVistosCliente,ts(y),L(),h("not-viewed-total",y.appChat.totalNoVistosCliente))}),l.onUnmounted(()=>{var y;(y=W.value)==null||y.off()}),(y,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",gc,[l.createElementVNode("div",wc,[l.createElementVNode("h4",Ec,l.toDisplayString(t.titlePrincipal),1),l.createElementVNode("button",{onClick:p[0]||(p[0]=()=>t.toggleChat()),class:"btn-close"},[l.createVNode(is,{class:"pointer"})])]),l.createElementVNode("div",kc,[l.createElementVNode("div",{ref_key:"dropZoneRef",ref:a,onDrop:p[1]||(p[1]=l.withModifiers(b=>{var x,N;au(b),(N=(x=b.target)==null?void 0:x.classList)==null||N.remove("drop-over"),b.target.style.zIndex="-1"},["self","prevent"])),onDragenter:p[2]||(p[2]=l.withModifiers(b=>{var x,N;(N=(x=b.target)==null?void 0:x.classList)==null||N.add("drop-over")},["self"])),onDragleave:p[3]||(p[3]=l.withModifiers(b=>{var x,N;(N=(x=b.target)==null?void 0:x.classList)==null||N.remove("drop-over"),b.target.style.zIndex="-1"},["self"])),onDragover:p[4]||(p[4]=l.withModifiers(()=>{},["prevent"])),style:{position:"absolute",bottom:"0",left:"0",right:"0",top:"0","z-index":"-1"}},null,544),l.createElementVNode("div",{class:"messages-container",ref_key:"messageContainerRef",ref:g,onDragenter:p[7]||(p[7]=l.withModifiers(b=>a.value.style.zIndex="1",["prevent"]))},[f.value?(l.openBlock(),l.createElementBlock("div",bc,[l.createVNode(dl)])):l.createCommentVNode("",!0),c.value.data.length>0?(l.openBlock(),l.createBlock(cl,{key:1,messages:c.value.data,canLoadMoreMessages:c.value.canLoadMoreMessages,onLoadMore:L,onRetry:ee,onOnQualifying:p[5]||(p[5]=b=>ru(b)),onSee:p[6]||(p[6]=b=>{i.value=1,o.value=b.urlFile,ge.title="Imagen",ge.modelValue=!0})},null,8,["messages","canLoadMoreMessages"])):(l.openBlock(),l.createElementBlock("div",Tc,p[18]||(p[18]=[l.createElementVNode("span",{class:"center"},"No tienes mensajes",-1)])))],544)]),l.createElementVNode("div",Sc,[tn.value?(l.openBlock(),l.createElementBlock("span",Nc," Necesitamos que nos califique la atención para continuar ")):(l.openBlock(),l.createElementBlock("form",{key:0,class:"message-send",onSubmit:p[12]||(p[12]=l.withModifiers(b=>_(),["prevent"]))},[l.createElementVNode("div",vc,[l.createElementVNode("div",Oc,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":p[8]||(p[8]=b=>n.value=b),class:"jl2-input-chat",placeholder:"Escribe tu mensaje",required:"",ref_key:"textAreaRef",ref:V,onInput:p[9]||(p[9]=()=>me()),onKeydown:p[10]||(p[10]=l.withKeys(b=>{!l.unref(ns)&&b.preventDefault()},["enter"])),onKeyup:l.withKeys(m,["enter"]),onPaste:l.withModifiers(ou,["prevent"])},null,544),[[l.vModelText,n.value]]),l.createElementVNode("input",{type:"file",ref_key:"fileInputRef",ref:r,onChange:iu,accept:"image/png,image/jpeg,image/jpg,image/webp",style:{display:"none"}},null,544),l.createElementVNode("button",{type:"button",class:"pointer btn-primary",title:"Adjuntar archivo",onClick:p[11]||(p[11]=()=>{var b;r.value.value="",(b=r.value)==null||b.click()})},[l.createVNode(hc,{style:{width:"20px",height:"20px"}})]),l.createElementVNode("button",_c,[l.createVNode(os,{style:{width:"20px",height:"20px"}})])])])],32))])]),l.createVNode(yc,l.normalizeProps(l.guardReactiveProps(ge)),{default:l.withCtx(()=>[i.value===0?(l.openBlock(),l.createElementBlock("div",Cc,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ee.value,(b,x)=>(l.openBlock(),l.createElementBlock("img",{key:x,src:b.toString(),alt:"Image",width:"400"},null,8,xc))),128)),l.createElementVNode("form",{class:"message-send",onSubmit:p[17]||(p[17]=l.withModifiers(b=>{_({codigoTipoMensaje:l.unref(Le).IMAGEN}),ge.modelValue=!1},["prevent"]))},[l.createElementVNode("div",Ac,[l.createElementVNode("div",Rc,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":p[13]||(p[13]=b=>n.value=b),autofocus:"",class:"jl2-input-chat",placeholder:"Escribe tu mensaje",ref_key:"textAreaRef",ref:V,onInput:p[14]||(p[14]=()=>me()),onKeydown:p[15]||(p[15]=l.withKeys(b=>{!l.unref(ns)&&b.preventDefault()},["enter"])),onKeyup:p[16]||(p[16]=l.withKeys(b=>{m(b,l.unref(Le).IMAGEN)},["enter"]))},null,544),[[l.vModelText,n.value]]),l.createElementVNode("button",Ic,[l.createVNode(os,{style:{width:"20px",height:"20px"}})])])])],32)])):(l.openBlock(),l.createElementBlock("div",Mc,[o.value?(l.openBlock(),l.createElementBlock("img",{key:0,src:o.value,alt:"Image",style:{"max-height":"85vh"}},null,8,Dc)):l.createCommentVNode("",!0)]))]),_:1},16)],64))}}),[["__scopeId","data-v-9d715781"]]),Bc={},Fc={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Uc(t,e){return l.openBlock(),l.createElementBlock("svg",Fc,e[0]||(e[0]=[l.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="currentColor" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="currentColor"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="currentColor"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="currentColor"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="currentColor"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)]))}const $c=K(Bc,[["render",Uc]]),Pc={},qc={viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid"};function Wc(t,e){return l.openBlock(),l.createElementBlock("svg",qc,e[0]||(e[0]=[l.createElementVNode("g",null,[l.createElementVNode("path",{d:"M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z",fill:"#40B3E0"}),l.createElementVNode("path",{d:"M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308",fill:"#FFFFFF"}),l.createElementVNode("path",{d:"M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475",fill:"#D2E5F1"}),l.createElementVNode("path",{d:"M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624",fill:"#B5CFE4"})],-1)]))}const zc=K(Pc,[["render",Wc]]),Hc={},Zc={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 455.731 455.731","xml:space":"preserve"};function jc(t,e){return l.openBlock(),l.createElementBlock("svg",Zc,e[0]||(e[0]=[l.createElementVNode("g",null,[l.createElementVNode("rect",{x:"0",y:"0",style:{fill:"#1bd741"},width:"455.731",height:"455.731"}),l.createElementVNode("g",null,[l.createElementVNode("path",{style:{fill:"#ffffff"},d:`M68.494,387.41l22.323-79.284c-14.355-24.387-21.913-52.134-21.913-80.638
13
+ l-99.357,98.675C149.841,257.159,149.823,257.142,149.823,257.142z`})],-1)]))}const hc=K(cc,[["render",fc]]),dc={key:0,class:"dialog-overlay"},mc={class:"header-widget"},pc={class:"title-chat"},yc=K(l.defineComponent({__name:"ODialog",props:{modelValue:{type:Boolean},title:{},"onUpdate:modelValue":{type:Function}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,s=e,r=l.ref(!1),i=()=>{s("update:modelValue",!1)};return l.onMounted(()=>{const o=document.getElementById("app");if(!o)throw new Error("app is required");let a=document.getElementById("dialogs");a||(a=document.createElement("div"),a.id="dialogs",a.classList.add("widget-component"),o.appendChild(a),r.value=!0)}),(o,a)=>r.value?(l.openBlock(),l.createBlock(l.Teleport,{key:0,to:"#dialogs"},[n.modelValue?(l.openBlock(),l.createElementBlock("div",dc,[l.createElementVNode("div",{class:"dialog-content",onClick:a[1]||(a[1]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",mc,[l.createElementVNode("h4",pc,l.toDisplayString(o.title),1),l.createElementVNode("button",{onClick:a[0]||(a[0]=()=>i()),class:"btn-close"},[l.createVNode(is,{class:"pointer"})])]),l.createElementVNode("div",null,[l.renderSlot(o.$slots,"default",{},void 0,!0)])])])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-532e0111"]]),gc={class:"widget"},wc={class:"header-widget flex-0"},Ec={class:"title-chat"},kc={class:"flex-1",style:{position:"relative",height:"0"}},bc={key:0,class:"loader"},Tc={key:2,class:"fit"},Sc={class:"w-full flex-0"},vc={class:"form-message"},Oc={class:"jl-inputgroup-chat"},_c={type:"submit",class:"pointer btn-primary"},Nc={key:1,class:"message-send-block"},Cc={key:0,class:"flex flex-col justify-center items-center"},xc=["src"],Ac={class:"form-message"},Rc={class:"jl-inputgroup-chat"},Ic={type:"submit",class:"pointer btn-primary"},Mc={key:1},Dc=["src"],Lc=14,Vc=K(l.defineComponent({__name:"Chat",props:{titlePrincipal:{type:String,default:"Comunicación en linea para consultas"},toggleChat:{type:Function,required:!0},tokenAuth:{type:String,required:!0},user:{type:Object,required:!0},visible:{type:Boolean,required:!0}},emits:["show-toast","show-confirm","new-message","clear-new-messages","not-viewed-total","onQualifying"],setup(t,{emit:e}){const n=l.ref(""),s=l.ref(0),r=l.ref(),i=l.ref(1),o=l.ref(),a=l.ref(),c=l.ref({data:[],canLoadMoreMessages:!1}),u=l.ref(""),f=l.ref(!1),h=e,w=t,g=l.ref(null);l.watch(()=>w.visible,async p=>{if(!p||(h("clear-new-messages"),B(),s.value>0&&Zs(u.value,w.tokenAuth),u.value))return;const y=await Hs(w.tokenAuth);y&&(u.value=y.appChat.id)});function m(p,y){var b;if(ns.value){me();return}if(p.key==="Enter"&&p.shiftKey){const x=((b=p.target)==null?void 0:b.value)||"";p.target.value=x+`
14
+ `,me();return}_({codigoTipoMensaje:y}),ge.modelValue=!1}function T(p,y){var N,M,te,ne;if((p==null?void 0:p.length)>300){h("show-toast",{severity:"warn",summary:"Error",detail:"El mensaje no puede superar los 300 caracteres",life:5e3});return}if(!p.trim()&&y!==Le.IMAGEN){h("show-toast",{severity:"warn",summary:"Error",detail:"Por favor ingrese un mensaje",life:5e3});return}const b=y?{code:y}:void 0;return{id:Ki(),chatId:(M=(N=G.value)==null?void 0:N.chat)==null?void 0:M.id,message:p,visto:!0,multimedia:!1,esCliente:!0,appChatId:u.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),file:(te=Ve.value)==null?void 0:te[0],urlFile:(ne=Ee.value)==null?void 0:ne[0],messageType:b,sender:{nombreCompleto:w.user.nombreCompleto,ci:w.user.ci,msPersonaId:w.user.msPersonaId},response:void 0}}function k(p,y,b,x){if(y==null)throw new Error("idx is required");if(!b){if(x){const M=c.value.data[y];M.response=void 0}else c.value.data[y].error={error:!0,id:p.id};h("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});return}let N={...b,chatId:p==null?void 0:p.chatId};if(x){const M=c.value.data[y];M.response=b,N={...M,chatId:p==null?void 0:p.chatId}}else{const M={...N};M.urlFile=c.value.data[y].urlFile,delete M.thumbnailFile,c.value.data[y]=M}return N}const _=async p=>{const y=T(n.value,p==null?void 0:p.codigoTipoMensaje);if(!y)return;let b=-1;if(p!=null&&p.tipoCalificacionId){b=c.value.data.findIndex(M=>M.id===(p==null?void 0:p.mensajeARespondeId));const N=c.value.data[b];N&&(N.response=y)}else b=c.value.data.push(y)-1;const x={message:n.value,appChatId:u.value,...p,codigoTipoMensaje:p==null?void 0:p.codigoTipoMensaje,files:Ve.value};n.value="",C(x).then(N=>{var te,ne;let M=k(y,b,N,p==null?void 0:p.tipoCalificacionId);M&&(tn.value=!!c.value.data.find(ke=>{var mt;return((mt=ke.messageType)==null?void 0:mt.code)===Le.PREGUNTA&&ke.response==null}),(ne=W.value)==null||ne.emit("sendMessage",{roomId:(te=G==null?void 0:G.value)==null?void 0:te.appChat.id,message:M},ke=>{console.log("🚀 ~ socketService.value.emit ~ response:",ke)}))}),n.value="",B(),V.value&&(V.value.style.height="20px")},C=async p=>{const y={...p,esCliente:!0};return Aa(y,w.tokenAuth)},L=async()=>{var x,N,M;const p=(x=c.value.data[0])==null?void 0:x.id,y={lastMessagesId:p,appChatId:u.value,limit:10};f.value=!0;const b=await xa({body:y,token:w.tokenAuth});f.value=!1,tn.value=!!b.data.find(te=>{var ne;return((ne=te.messageType)==null?void 0:ne.code)===Le.PREGUNTA&&te.response==null}),c.value.data.unshift(...b.data.sort((te,ne)=>-ne.createdAt.localeCompare(te.createdAt))),c.value.canLoadMoreMessages=b.pagination.total>b.pagination.size,p&&((N=g.value)!=null&&N.scrollHeight)&&ae((M=g.value)==null?void 0:M.scrollHeight),p||B()},ee=async p=>{h("show-confirm",async()=>{var b,x,N;if(!((b=p.error)!=null&&b.id))return;const y=await C({message:p.message,appChatId:u.value});if(!y)h("show-toast",{severity:"error",summary:"Error",detail:"Ocurrio un error al enviar el mensaje, intente nuevamente",life:5e3});else{const M=ml(c.value.data,"id",p.error.id);c.value.data[M]={...y,error:void 0},(N=W.value)==null||N.emit("sendMessage",{roomId:(x=G==null?void 0:G.value)==null?void 0:x.appChat.id,message:p})}B()})},B=()=>{l.nextTick(()=>{g.value&&(g.value.scrollTop=g.value.scrollHeight)})},ae=p=>{l.nextTick(()=>{const y=g.value;y&&(y.scrollTop=y.scrollHeight-p)})},V=l.ref();function me(){V.value&&(V.value.style.height=V.value.scrollHeight-Lc+"px",V.value.scrollHeight!==V.value.clientHeight&&(V.value.style.height=V.value.scrollHeight+"px"))}const W=l.ref(),G=l.ref();function ts(p,y=Zi.WEBCHAT){var b,x;if(!p)throw new Error("user chat is required");W.value=en(window.VITE_SOCKET_URI,{query:{usuarioId:`${(x=(b=p==null?void 0:p.chat)==null?void 0:b.persona)==null?void 0:x.funcionarioId}`,aplicacion:y},extraHeaders:{Authorization:w.tokenAuth}}),W.value.removeAllListeners(),W.value.on("connect",()=>{var N,M;console.log("Conectado al servidor de sockets"),(M=W.value)==null||M.emit("joinRoom",`${(N=p==null?void 0:p.appChat)==null?void 0:N.id}`)}),W.value.on("disconnect",()=>{console.log("Desconectado del servidor de sockets")}),W.value.on("receiveMessage",N=>{var te,ne;console.log("Mensaje recibido:",N.message,p);const M=c.value.data.findIndex(ke=>ke.id===N.message.id);N.message.sender.msPersonaId===((ne=(te=p==null?void 0:p.chat)==null?void 0:te.persona)==null?void 0:ne.msPersonaId)&&M===-1||(M!==-1?c.value.data[M].response=N.message.response:c.value.data.push(N.message),tn.value=!!c.value.data.find(ke=>{var mt;return((mt=ke.messageType)==null?void 0:mt.code)===Le.PREGUNTA&&ke.response==null}),Zs(N.message.appChatId,w.tokenAuth),B(),!w.visible&&h("new-message"))})}const{isMobile:ns}=lc();function ru({message:p,emoji:y}){const b=async()=>{!p.id||!y||(n.value=y.iconUnicode,_({tipoCalificacionId:y.value,mensajeARespondeId:p.id}).then())};h("onQualifying",{message:y.iconUnicode,callback:b})}const tn=l.ref(!1),ss=["image/png","image/jpeg","image/jpg","image/webp"];function iu(){var b;Ve.value=[],Ee.value=[];const p=Array.from((b=r.value)==null?void 0:b.files)??[],y=p==null?void 0:p[0];if(Ve.value=p,!!y){if(!ss.includes(y.type)){h("show-toast",{severity:"warn",summary:"Error",detail:"El archivo debe ser una imagen permitida (png, jpeg, jpg, webp)",life:5e3});return}if(y.size>2e6){h("show-toast",{severity:"warn",summary:"Error",detail:"El archivo excede los 2MB",life:5e3});return}Ee.value.push(URL.createObjectURL(y)),i.value=0,ge.title="Vista previa",ge.modelValue=!0,l.nextTick(()=>{var x;(x=V.value)==null||x.focus()})}}const ou=p=>{var x,N;const y=((x=p.clipboardData)==null?void 0:x.files)??((N=window.clipboardData)==null?void 0:N.files)??[];if(y.length===0)return;const b=y==null?void 0:y[0];b&&ss.includes(b==null?void 0:b.type)&&(p.preventDefault(),i.value=0,Ee.value=[],Ve.value=[b],Ee.value.push(URL.createObjectURL(b)),ge.modelValue=!0,l.nextTick(()=>{var M;(M=V.value)==null||M.focus()}))};function au(p){var y;(y=p.dataTransfer)!=null&&y.items&&(i.value=0,Array.from(p.dataTransfer.items).forEach(b=>{if(b.kind==="file"){const x=b.getAsFile();if(!x)return;if(!ss.includes(x.type)){h("show-toast",{severity:"error",summary:"Error",detail:"El archivo debe ser una imagen",life:5e3});return}Ve.value=[x],Ee.value=[],Ee.value.push(URL.createObjectURL(x)),ge.modelValue=!0}}),l.nextTick(()=>{var b;(b=V.value)==null||b.focus()}))}const Ve=l.ref([]),Ee=l.ref([]),ge=l.reactive({modelValue:!1,"onUpdate:modelValue":p=>{ge.modelValue=p,!p&&(Ee.value=[],Ve.value=[])},title:"Preparar imagen"});return l.onMounted(async()=>{if(u.value)return;const p=await Hs(w.tokenAuth);p&&(G.value=p,u.value=p.appChat.id,s.value=p.appChat.totalNoVistosCliente,ts(p),L(),h("not-viewed-total",p.appChat.totalNoVistosCliente))}),l.onUnmounted(()=>{var p;(p=W.value)==null||p.off()}),(p,y)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",gc,[l.createElementVNode("div",wc,[l.createElementVNode("h4",Ec,l.toDisplayString(t.titlePrincipal),1),l.createElementVNode("button",{onClick:y[0]||(y[0]=()=>t.toggleChat()),class:"btn-close"},[l.createVNode(is,{class:"pointer"})])]),l.createElementVNode("div",kc,[l.createElementVNode("div",{ref_key:"dropZoneRef",ref:a,onDrop:y[1]||(y[1]=l.withModifiers(b=>{var x,N;au(b),(N=(x=b.target)==null?void 0:x.classList)==null||N.remove("drop-over"),b.target.style.zIndex="-1"},["self","prevent"])),onDragenter:y[2]||(y[2]=l.withModifiers(b=>{var x,N;(N=(x=b.target)==null?void 0:x.classList)==null||N.add("drop-over")},["self"])),onDragleave:y[3]||(y[3]=l.withModifiers(b=>{var x,N;(N=(x=b.target)==null?void 0:x.classList)==null||N.remove("drop-over"),b.target.style.zIndex="-1"},["self"])),onDragover:y[4]||(y[4]=l.withModifiers(()=>{},["prevent"])),style:{position:"absolute",bottom:"0",left:"0",right:"0",top:"0","z-index":"-1"}},null,544),l.createElementVNode("div",{class:"messages-container",ref_key:"messageContainerRef",ref:g,onDragenter:y[7]||(y[7]=l.withModifiers(b=>a.value.style.zIndex="1",["prevent"]))},[f.value?(l.openBlock(),l.createElementBlock("div",bc,[l.createVNode(dl)])):l.createCommentVNode("",!0),c.value.data.length>0?(l.openBlock(),l.createBlock(cl,{key:1,messages:c.value.data,canLoadMoreMessages:c.value.canLoadMoreMessages,onLoadMore:L,onRetry:ee,onOnQualifying:y[5]||(y[5]=b=>ru(b)),onSee:y[6]||(y[6]=b=>{i.value=1,o.value=b.urlFile,ge.title="Imagen",ge.modelValue=!0})},null,8,["messages","canLoadMoreMessages"])):(l.openBlock(),l.createElementBlock("div",Tc,y[18]||(y[18]=[l.createElementVNode("span",{class:"center"},"No tienes mensajes",-1)])))],544)]),l.createElementVNode("div",Sc,[tn.value?(l.openBlock(),l.createElementBlock("span",Nc," Necesitamos que nos califique la atención para continuar ")):(l.openBlock(),l.createElementBlock("form",{key:0,class:"message-send",onSubmit:y[12]||(y[12]=l.withModifiers(b=>_(),["prevent"]))},[l.createElementVNode("div",vc,[l.createElementVNode("div",Oc,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":y[8]||(y[8]=b=>n.value=b),class:"jl2-input-chat",placeholder:"Escribe tu mensaje",required:"",ref_key:"textAreaRef",ref:V,onInput:y[9]||(y[9]=()=>me()),onKeydown:y[10]||(y[10]=l.withKeys(b=>{!l.unref(ns)&&b.preventDefault()},["enter"])),onKeyup:l.withKeys(m,["enter"]),onPaste:ou},null,544),[[l.vModelText,n.value]]),l.createElementVNode("input",{type:"file",ref_key:"fileInputRef",ref:r,onChange:iu,accept:"image/png,image/jpeg,image/jpg,image/webp",style:{display:"none"}},null,544),l.createElementVNode("button",{type:"button",class:"pointer btn-primary",title:"Adjuntar archivo",onClick:y[11]||(y[11]=()=>{var b;r.value.value="",(b=r.value)==null||b.click()})},[l.createVNode(hc,{style:{width:"20px",height:"20px"}})]),l.createElementVNode("button",_c,[l.createVNode(os,{style:{width:"20px",height:"20px"}})])])])],32))])]),l.createVNode(yc,l.normalizeProps(l.guardReactiveProps(ge)),{default:l.withCtx(()=>[i.value===0?(l.openBlock(),l.createElementBlock("div",Cc,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ee.value,(b,x)=>(l.openBlock(),l.createElementBlock("img",{key:x,src:b.toString(),alt:"Image",width:"400"},null,8,xc))),128)),l.createElementVNode("form",{class:"message-send",onSubmit:y[17]||(y[17]=l.withModifiers(b=>{_({codigoTipoMensaje:l.unref(Le).IMAGEN}),ge.modelValue=!1},["prevent"]))},[l.createElementVNode("div",Ac,[l.createElementVNode("div",Rc,[l.withDirectives(l.createElementVNode("textarea",{"onUpdate:modelValue":y[13]||(y[13]=b=>n.value=b),autofocus:"",class:"jl2-input-chat",placeholder:"Escribe tu mensaje",ref_key:"textAreaRef",ref:V,onInput:y[14]||(y[14]=()=>me()),onKeydown:y[15]||(y[15]=l.withKeys(b=>{!l.unref(ns)&&b.preventDefault()},["enter"])),onKeyup:y[16]||(y[16]=l.withKeys(b=>{m(b,l.unref(Le).IMAGEN)},["enter"]))},null,544),[[l.vModelText,n.value]]),l.createElementVNode("button",Ic,[l.createVNode(os,{style:{width:"20px",height:"20px"}})])])])],32)])):(l.openBlock(),l.createElementBlock("div",Mc,[o.value?(l.openBlock(),l.createElementBlock("img",{key:0,src:o.value,alt:"Image",style:{"max-height":"85vh"}},null,8,Dc)):l.createCommentVNode("",!0)]))]),_:1},16)],64))}}),[["__scopeId","data-v-4b8311cb"]]),Bc={},Fc={width:"87",height:"87",viewBox:"0 0 87 87",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Uc(t,e){return l.openBlock(),l.createElementBlock("svg",Fc,e[0]||(e[0]=[l.createStaticVNode('<g filter="url(#filter0_d_4007_3488)"><path d="M43.5 77C64.2107 77 81 60.2107 81 39.5C81 18.7893 64.2107 2 43.5 2C22.7893 2 6 18.7893 6 39.5C6 60.2107 22.7893 77 43.5 77Z" fill="white" stroke="currentColor" stroke-width="3" stroke-miterlimit="10"></path><path d="M39.705 38.885C40.6908 38.885 41.49 38.0858 41.49 37.1C41.49 36.1142 40.6908 35.315 39.705 35.315C38.7192 35.315 37.92 36.1142 37.92 37.1C37.92 38.0858 38.7192 38.885 39.705 38.885Z" fill="currentColor"></path><path d="M45.075 38.885C46.0608 38.885 46.86 38.0858 46.86 37.1C46.86 36.1142 46.0608 35.315 45.075 35.315C44.0892 35.315 43.29 36.1142 43.29 37.1C43.29 38.0858 44.0892 38.885 45.075 38.885Z" fill="currentColor"></path><path d="M50.445 38.885C51.4308 38.885 52.23 38.0858 52.23 37.1C52.23 36.1142 51.4308 35.315 50.445 35.315C49.4592 35.315 48.66 36.1142 48.66 37.1C48.66 38.0858 49.4592 38.885 50.445 38.885Z" fill="currentColor"></path><path d="M63.27 58.235L58.755 47.78C61.125 44.765 62.415 40.97 62.415 37.175C62.415 26.435 52.665 18.185 41.925 20.12C39.99 19.325 37.98 18.905 35.835 18.905C26.955 18.905 19.785 26.135 19.785 34.955C19.785 38.54 21 41.975 23.145 44.765L18.99 54.44C18.84 54.8 18.915 55.235 19.2 55.445C19.485 55.73 19.92 55.73 20.205 55.595L30.6 50.15C31.89 50.585 33.255 50.87 34.68 50.945C39.48 54.53 45.57 55.25 50.655 53.45L61.905 59.33C62.265 59.48 62.625 59.48 62.91 59.18C63.345 58.97 63.405 58.61 63.27 58.25V58.235ZM51.24 51.71C51.03 51.56 50.745 51.56 50.52 51.635C48.795 52.28 46.935 52.64 45.15 52.64C36.69 52.64 29.61 45.755 29.61 37.1C29.61 29.72 34.845 23.345 42.075 21.845C51.75 19.91 60.705 27.29 60.705 37.1C60.705 40.685 59.415 44.27 57.12 46.985C56.91 47.27 56.835 47.63 56.97 47.915L60.69 56.585L51.24 51.71Z" fill="currentColor"></path></g><defs><filter id="filter0_d_4007_3488" x="0.5" y="0.5" width="86" height="86" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="4"></feOffset><feGaussianBlur stdDeviation="2"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4007_3488"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4007_3488" result="shape"></feBlend></filter></defs>',2)]))}const $c=K(Bc,[["render",Uc]]),Pc={},qc={viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid"};function Wc(t,e){return l.openBlock(),l.createElementBlock("svg",qc,e[0]||(e[0]=[l.createElementVNode("g",null,[l.createElementVNode("path",{d:"M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z",fill:"#40B3E0"}),l.createElementVNode("path",{d:"M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308",fill:"#FFFFFF"}),l.createElementVNode("path",{d:"M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475",fill:"#D2E5F1"}),l.createElementVNode("path",{d:"M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624",fill:"#B5CFE4"})],-1)]))}const zc=K(Pc,[["render",Wc]]),Hc={},Zc={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 455.731 455.731","xml:space":"preserve"};function jc(t,e){return l.openBlock(),l.createElementBlock("svg",Zc,e[0]||(e[0]=[l.createElementVNode("g",null,[l.createElementVNode("rect",{x:"0",y:"0",style:{fill:"#1bd741"},width:"455.731",height:"455.731"}),l.createElementVNode("g",null,[l.createElementVNode("path",{style:{fill:"#ffffff"},d:`M68.494,387.41l22.323-79.284c-14.355-24.387-21.913-52.134-21.913-80.638
15
15
  c0-87.765,71.402-159.167,159.167-159.167s159.166,71.402,159.166,159.167c0,87.765-71.401,159.167-159.166,159.167
16
16
  c-27.347,0-54.125-7-77.814-20.292L68.494,387.41z M154.437,337.406l4.872,2.975c20.654,12.609,44.432,19.274,68.762,19.274
17
17
  c72.877,0,132.166-59.29,132.166-132.167S300.948,95.321,228.071,95.321S95.904,154.611,95.904,227.488
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-wiguet-chatweb",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -72,7 +72,7 @@
72
72
  }
73
73
  "
74
74
  @keyup.enter="saltoDeLineaOEnviar"
75
- @paste.prevent="handlePaste"
75
+ @paste="handlePaste"
76
76
  />
77
77
 
78
78
  <input
@@ -668,6 +668,7 @@ const handlePaste = (e: ClipboardEvent) => {
668
668
 
669
669
  if (!tiposArchivosPermitidos.includes(file?.type)) return;
670
670
 
671
+ e.preventDefault();
671
672
  currentDialogView.value = DIALOG_VIEWS.UPLOAD;
672
673
  urlFilesPreview.value = [];
673
674